summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2016-03-01 11:38:17 +0000
committerTom Hacohen <tom@stosb.com>2016-03-01 11:46:37 +0000
commit13cd00c5c00af043347858394eb49a64f6c2cc3d (patch)
tree428759b57ef8089a9cc9503888b8447130750351
parent9d3391e35085d1477003493f796337e6e22ddf4f (diff)
eolian generator: add obj as first param to header method prototypes
-rw-r--r--src/bin/eolian/eo_generator.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/bin/eolian/eo_generator.c b/src/bin/eolian/eo_generator.c
index 1223ff5ecc..1128e414d2 100644
--- a/src/bin/eolian/eo_generator.c
+++ b/src/bin/eolian/eo_generator.c
@@ -97,7 +97,7 @@ eo_fundef_generate(const Eolian_Class *class, const Eolian_Function *func, Eolia
97 eina_strbuf_append_char(str_func, '\n'); 97 eina_strbuf_append_char(str_func, '\n');
98 eina_strbuf_free(dbuf); 98 eina_strbuf_free(dbuf);
99 } 99 }
100 eina_strbuf_append_printf(str_func, "EOAPI @#rettype@#retspace%s(@#full_params);\n", func_env.lower_eo_func); 100 eina_strbuf_append_printf(str_func, "EOAPI @#rettype@#retspace%s(Eo *obj@#full_params);\n", func_env.lower_eo_func);
101 101
102 if (scope == EOLIAN_SCOPE_PROTECTED) 102 if (scope == EOLIAN_SCOPE_PROTECTED)
103 eina_strbuf_append_printf(str_func, "#endif\n"); 103 eina_strbuf_append_printf(str_func, "#endif\n");
@@ -106,7 +106,6 @@ eo_fundef_generate(const Eolian_Class *class, const Eolian_Function *func, Eolia
106 eina_strbuf_append_printf(str_func, "\n"); 106 eina_strbuf_append_printf(str_func, "\n");
107 107
108 Eina_Strbuf *str_par = eina_strbuf_new(); 108 Eina_Strbuf *str_par = eina_strbuf_new();
109 Eina_Strbuf *str_pardesc = eina_strbuf_new();
110 109
111 itr = eolian_property_keys_get(func, ftype); 110 itr = eolian_property_keys_get(func, ftype);
112 EINA_ITERATOR_FOREACH(itr, data) 111 EINA_ITERATOR_FOREACH(itr, data)
@@ -115,9 +114,7 @@ eo_fundef_generate(const Eolian_Class *class, const Eolian_Function *func, Eolia
115 const Eolian_Type *ptypet = eolian_parameter_type_get(param); 114 const Eolian_Type *ptypet = eolian_parameter_type_get(param);
116 const char *pname = eolian_parameter_name_get(param); 115 const char *pname = eolian_parameter_name_get(param);
117 const char *ptype = eolian_type_c_type_get(ptypet); 116 const char *ptype = eolian_type_c_type_get(ptypet);
118 117 eina_strbuf_append_printf(str_par, ", %s %s", ptype, pname);
119 if (eina_strbuf_length_get(str_par)) eina_strbuf_append(str_par, ", ");
120 eina_strbuf_append_printf(str_par, "%s %s", ptype, pname);
121 eina_stringshare_del(ptype); 118 eina_stringshare_del(ptype);
122 } 119 }
123 eina_iterator_free(itr); 120 eina_iterator_free(itr);
@@ -142,8 +139,7 @@ eo_fundef_generate(const Eolian_Class *class, const Eolian_Function *func, Eolia
142 if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM || pdir == EOLIAN_INOUT_PARAM); 139 if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM || pdir == EOLIAN_INOUT_PARAM);
143 Eina_Bool had_star = !!strchr(ptype, '*'); 140 Eina_Bool had_star = !!strchr(ptype, '*');
144 141
145 if (eina_strbuf_length_get(str_par)) eina_strbuf_append(str_par, ", "); 142 eina_strbuf_append_printf(str_par, ", %s%s%s%s",
146 eina_strbuf_append_printf(str_par, "%s%s%s%s",
147 ptype, had_star?"":" ", add_star?"*":"", pname); 143 ptype, had_star?"":" ", add_star?"*":"", pname);
148 144
149 eina_stringshare_del(ptype); 145 eina_stringshare_del(ptype);
@@ -159,15 +155,11 @@ eo_fundef_generate(const Eolian_Class *class, const Eolian_Function *func, Eolia
159 else 155 else
160 eina_strbuf_replace_all(str_func, "@#retspace", ""); 156 eina_strbuf_replace_all(str_func, "@#retspace", "");
161 157
162 eina_strbuf_replace_all(str_func, "@#list_param", eina_strbuf_string_get(str_par));
163 if (!eina_strbuf_length_get(str_par)) eina_strbuf_append(str_par, "void");
164 eina_strbuf_replace_all(str_func, "@#full_params", eina_strbuf_string_get(str_par)); 158 eina_strbuf_replace_all(str_func, "@#full_params", eina_strbuf_string_get(str_par));
165 eina_strbuf_replace_all(str_func, "@#list_desc_param", eina_strbuf_string_get(str_pardesc));
166 159
167 if (rettype) eina_stringshare_del(rettype); 160 if (rettype) eina_stringshare_del(rettype);
168 161
169 eina_strbuf_free(str_par); 162 eina_strbuf_free(str_par);
170 eina_strbuf_free(str_pardesc);
171 163
172 eina_strbuf_append(functext, eina_strbuf_string_get(str_func)); 164 eina_strbuf_append(functext, eina_strbuf_string_get(str_func));
173 eina_strbuf_free(str_func); 165 eina_strbuf_free(str_func);