summaryrefslogtreecommitdiff
path: root/src/bin/edje/edje_cc_handlers.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-06-26 10:40:27 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-06-30 10:12:13 +0900
commitb676dcf9982292c08227f7133fb97d4bf31b7ebe (patch)
tree6bca88d7c478a9cfb597dd3ab5907c56342b0109 /src/bin/edje/edje_cc_handlers.c
parent508da27bb161aa93c80ee9b252cae9b07c49f6d2 (diff)
Edje: Use array instead of hash for filters data
Yeah that was totally overkill and pure laziness on my side. Despite having the EO API for the filters still in beta, I want to the EDC API and EDJ binary formats to stay compatible, so let's get it right before the release :)
Diffstat (limited to '')
-rw-r--r--src/bin/edje/edje_cc_handlers.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index 7834ffbbee..114a085713 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -11703,8 +11703,10 @@ st_collections_group_parts_part_description_filter_source(void)
11703static void 11703static void
11704st_collections_group_parts_part_description_filter_data(void) 11704st_collections_group_parts_part_description_filter_data(void)
11705{ 11705{
11706 Edje_Part_Description_Spec_Filter_Data *array;
11706 Edje_Part_Description_Spec_Filter *filter; 11707 Edje_Part_Description_Spec_Filter *filter;
11707 char *name, *value; 11708 char *name, *value;
11709 unsigned k;
11708 11710
11709 if (current_part->type == EDJE_PART_TYPE_TEXT) 11711 if (current_part->type == EDJE_PART_TYPE_TEXT)
11710 filter = &(((Edje_Part_Description_Text *)current_desc)->text.filter); 11712 filter = &(((Edje_Part_Description_Text *)current_desc)->text.filter);
@@ -11719,19 +11721,21 @@ st_collections_group_parts_part_description_filter_data(void)
11719 11721
11720 check_arg_count(2); 11722 check_arg_count(2);
11721 11723
11722 if (!filter->data)
11723 filter->data = eina_hash_string_small_new(EINA_FREE_CB(free));
11724
11725 name = parse_str(0); 11724 name = parse_str(0);
11726 value = parse_str(1); 11725 value = parse_str(1);
11727 if (eina_hash_find(filter->data, name)) 11726 for (k = 0; k < filter->data_count; k++)
11728 { 11727 if (!strcmp(filter->data[k].name, name))
11729 ERR("parse error %s:%i. filter.data '%s' already exists in this context", 11728 {
11730 file_in, line - 1, name); 11729 ERR("parse error %s:%i. filter.data '%s' already exists in this context",
11731 exit(-1); 11730 file_in, line - 1, name);
11732 } 11731 exit(-1);
11732 }
11733 11733
11734 eina_hash_add(filter->data, name, value); 11734 filter->data_count++;
11735 array = realloc(filter->data, sizeof(Edje_Part_Description_Spec_Filter_Data) * filter->data_count);
11736 array[filter->data_count - 1].name = name;
11737 array[filter->data_count - 1].value = value;
11738 filter->data = array;
11735} 11739}
11736 11740
11737/** @edcsubsection{collections_group_parts_descriptions_params, 11741/** @edcsubsection{collections_group_parts_descriptions_params,