summaryrefslogtreecommitdiff
path: root/src/bin/eolian/eo_generator.c
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-08-15 11:52:11 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-08-21 09:26:05 +0100
commit913e0f09fa789b72fe48d02c042afc49b3a64df9 (patch)
treeeb0b12a82cffb86578e8465b0cb289d1c60212b3 /src/bin/eolian/eo_generator.c
parent60f0450bacbecb7f3d842ba6d1f09229edada103 (diff)
eolian: get rid of the data hash in Eolian_Function
Diffstat (limited to 'src/bin/eolian/eo_generator.c')
-rw-r--r--src/bin/eolian/eo_generator.c38
1 files changed, 13 insertions, 25 deletions
diff --git a/src/bin/eolian/eo_generator.c b/src/bin/eolian/eo_generator.c
index 02402121a8..be294d35ec 100644
--- a/src/bin/eolian/eo_generator.c
+++ b/src/bin/eolian/eo_generator.c
@@ -85,8 +85,6 @@ eo_fundef_generate(const Eolian_Class *class, Eolian_Function *func, Eolian_Func
85 const char *str_dir[] = {"in", "out", "inout"}; 85 const char *str_dir[] = {"in", "out", "inout"};
86 Eina_Iterator *itr; 86 Eina_Iterator *itr;
87 void *data, *data2; 87 void *data, *data2;
88 char funcname[0xFF];
89 char descname[0xFF];
90 char *tmpstr = malloc(0x1FF); 88 char *tmpstr = malloc(0x1FF);
91 Eina_Bool var_as_ret = EINA_FALSE; 89 Eina_Bool var_as_ret = EINA_FALSE;
92 const Eolian_Type *rettypet = NULL; 90 const Eolian_Type *rettypet = NULL;
@@ -95,30 +93,20 @@ eo_fundef_generate(const Eolian_Class *class, Eolian_Function *func, Eolian_Func
95 Eolian_Object_Scope scope = eolian_function_scope_get(func); 93 Eolian_Object_Scope scope = eolian_function_scope_get(func);
96 94
97 _class_func_env_create(class, eolian_function_name_get(func), ftype, &func_env); 95 _class_func_env_create(class, eolian_function_name_get(func), ftype, &func_env);
98 char *fsuffix = "";
99 rettypet = eolian_function_return_type_get(func, ftype); 96 rettypet = eolian_function_return_type_get(func, ftype);
100 if (ftype == EOLIAN_PROP_GET) 97 if (ftype == EOLIAN_PROP_GET && !rettypet)
101 { 98 {
102 fsuffix = "_get"; 99 itr = eolian_function_parameters_get(func);
103 if (!rettypet) 100 /* We want to check if there is only one parameter */
101 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2))
104 { 102 {
105 itr = eolian_function_parameters_get(func); 103 rettypet = eolian_parameter_type_get((Eolian_Function_Parameter*)data);
106 /* We want to check if there is only one parameter */ 104 var_as_ret = EINA_TRUE;
107 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2)) 105 ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE);
108 {
109 rettypet = eolian_parameter_type_get((Eolian_Function_Parameter*)data);
110 var_as_ret = EINA_TRUE;
111 ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE);
112 }
113 eina_iterator_free(itr);
114 } 106 }
107 eina_iterator_free(itr);
115 } 108 }
116 if (ftype == EOLIAN_PROP_SET) fsuffix = "_set"; 109 const char *funcdesc = eolian_function_description_get(func, ftype);
117
118 sprintf (funcname, "%s%s", eolian_function_name_get(func), fsuffix);
119 sprintf (descname, "comment%s", fsuffix);
120 const char *funcdesc = eolian_function_description_get(func, descname);
121
122 Eina_Strbuf *str_func = eina_strbuf_new(); 110 Eina_Strbuf *str_func = eina_strbuf_new();
123 if (scope == EOLIAN_SCOPE_PROTECTED) 111 if (scope == EOLIAN_SCOPE_PROTECTED)
124 eina_strbuf_append_printf(str_func, "#ifdef %s_PROTECTED\n", class_env.upper_classname); 112 eina_strbuf_append_printf(str_func, "#ifdef %s_PROTECTED\n", class_env.upper_classname);
@@ -727,7 +715,7 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
727 itr = eolian_class_functions_get(class, EOLIAN_CTOR); 715 itr = eolian_class_functions_get(class, EOLIAN_CTOR);
728 EINA_ITERATOR_FOREACH(itr, fn) 716 EINA_ITERATOR_FOREACH(itr, fn)
729 { 717 {
730 char *desc = _source_desc_get(eolian_function_description_get(fn, "comment")); 718 char *desc = _source_desc_get(eolian_function_description_get(fn, EOLIAN_METHOD));
731 eo_op_desc_generate(class, fn, EOLIAN_CTOR, desc, tmpbuf); 719 eo_op_desc_generate(class, fn, EOLIAN_CTOR, desc, tmpbuf);
732 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf)); 720 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf));
733 free(desc); 721 free(desc);
@@ -749,7 +737,7 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
749 737
750 if (prop_write) 738 if (prop_write)
751 { 739 {
752 char *desc = _source_desc_get(eolian_function_description_get(fn, "comment_set")); 740 char *desc = _source_desc_get(eolian_function_description_get(fn, EOLIAN_PROP_SET));
753 741
754 sprintf(tmpstr, "%s_set", funcname); 742 sprintf(tmpstr, "%s_set", funcname);
755 eo_op_desc_generate(class, fn, EOLIAN_PROP_SET, desc, tmpbuf); 743 eo_op_desc_generate(class, fn, EOLIAN_PROP_SET, desc, tmpbuf);
@@ -758,7 +746,7 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
758 } 746 }
759 if (prop_read) 747 if (prop_read)
760 { 748 {
761 char *desc = _source_desc_get(eolian_function_description_get(fn, "comment_get")); 749 char *desc = _source_desc_get(eolian_function_description_get(fn, EOLIAN_PROP_GET));
762 750
763 sprintf(tmpstr, "%s_get", funcname); 751 sprintf(tmpstr, "%s_get", funcname);
764 eo_op_desc_generate(class, fn, EOLIAN_PROP_GET, desc, tmpbuf); 752 eo_op_desc_generate(class, fn, EOLIAN_PROP_GET, desc, tmpbuf);
@@ -772,7 +760,7 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
772 itr = eolian_class_functions_get(class, EOLIAN_METHOD); 760 itr = eolian_class_functions_get(class, EOLIAN_METHOD);
773 EINA_ITERATOR_FOREACH(itr, fn) 761 EINA_ITERATOR_FOREACH(itr, fn)
774 { 762 {
775 char *desc = _source_desc_get(eolian_function_description_get(fn, "comment")); 763 char *desc = _source_desc_get(eolian_function_description_get(fn, EOLIAN_METHOD));
776 eo_op_desc_generate(class, fn, EOLIAN_METHOD, desc, tmpbuf); 764 eo_op_desc_generate(class, fn, EOLIAN_METHOD, desc, tmpbuf);
777 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf)); 765 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf));
778 free(desc); 766 free(desc);