summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-02-26 20:02:10 +0200
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-03-03 14:09:55 +0200
commit5ae7cc962f9ea73b461fca9b8a4f9f0812ed362d (patch)
tree31454b73e09de92b16f3b8b477d83d65ac738351 /src/bin
parenta8661af73e0088f4c8983406c99a1a421620811a (diff)
Eolian: Format changes
- Support keys/values for properties instead of params - Direction for parameters syntax changed from in to @in... - obj:const changed to const in .eo
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian/eo1_generator.c31
-rw-r--r--src/bin/eolian/legacy_generator.c22
2 files changed, 52 insertions, 1 deletions
diff --git a/src/bin/eolian/eo1_generator.c b/src/bin/eolian/eo1_generator.c
index 60f12af55c..b686fc6fc8 100644
--- a/src/bin/eolian/eo1_generator.c
+++ b/src/bin/eolian/eo1_generator.c
@@ -158,6 +158,20 @@ eo1_fundef_generate(const char *classname, Eolian_Function func, Eolian_Function
158 eina_strbuf_append_printf(str_typecheck, ", EO_TYPECHECK(%s*, ret)", rettype); 158 eina_strbuf_append_printf(str_typecheck, ", EO_TYPECHECK(%s*, ret)", rettype);
159 } 159 }
160 160
161 EINA_LIST_FOREACH(eolian_property_keys_list_get(func), l, data)
162 {
163 const char *pname;
164 const char *ptype;
165 eolian_parameter_information_get((Eolian_Function_Parameter)data, NULL, &ptype, &pname, NULL);
166
167 eina_strbuf_append_printf(str_pardesc, tmpl_eo_pardesc, "in", pname);
168
169 if (eina_strbuf_length_get(str_par)) eina_strbuf_append(str_par, ", ");
170 eina_strbuf_append(str_par, pname);
171
172 eina_strbuf_append_printf(str_typecheck, ", EO_TYPECHECK(%s, %s)", ptype, pname);
173 }
174
161 EINA_LIST_FOREACH(eolian_parameters_list_get(func), l, data) 175 EINA_LIST_FOREACH(eolian_parameters_list_get(func), l, data)
162 { 176 {
163 const char *pname; 177 const char *pname;
@@ -329,6 +343,20 @@ eo1_bind_func_generate(const char *classname, Eolian_Function funcid, Eolian_Fun
329 const Eina_List *l; 343 const Eina_List *l;
330 void *data; 344 void *data;
331 345
346 EINA_LIST_FOREACH(eolian_property_keys_list_get(funcid), l, data)
347 {
348 const char *pname;
349 const char *ptype;
350 eolian_parameter_information_get((Eolian_Function_Parameter)data, NULL, &ptype, &pname, NULL);
351 Eina_Bool is_const = eolian_parameter_get_const_attribute_get(data);
352 eina_strbuf_append_printf(va_args, " %s%s %s = va_arg(*list, %s%s);\n",
353 ftype == GET && is_const?"const ":"", ptype, pname,
354 ftype == GET && is_const?"const ":"", _varg_upgr(ptype));
355 eina_strbuf_append_printf(params, ", %s", pname);
356 eina_strbuf_append_printf(full_params, ", %s%s %s",
357 ftype == GET && eolian_parameter_get_const_attribute_get(data)?"const ":"",
358 ptype, pname);
359 }
332 if (!var_as_ret) 360 if (!var_as_ret)
333 { 361 {
334 EINA_LIST_FOREACH(eolian_parameters_list_get(funcid), l, data) 362 EINA_LIST_FOREACH(eolian_parameters_list_get(funcid), l, data)
@@ -369,7 +397,8 @@ eo1_bind_func_generate(const char *classname, Eolian_Function funcid, Eolian_Fun
369 eina_strbuf_replace_all(fbody, "@#ret_type", "void"); 397 eina_strbuf_replace_all(fbody, "@#ret_type", "void");
370 } 398 }
371 399
372 if (eina_list_count(eolian_parameters_list_get(funcid)) == 0) 400 if (eina_list_count(eolian_parameters_list_get(funcid)) == 0 &&
401 (eina_list_count(eolian_property_keys_list_get(funcid)) == 0))
373 { 402 {
374 eina_strbuf_replace_all(fbody, "@#list_unused", " EINA_UNUSED"); 403 eina_strbuf_replace_all(fbody, "@#list_unused", " EINA_UNUSED");
375 } 404 }
diff --git a/src/bin/eolian/legacy_generator.c b/src/bin/eolian/legacy_generator.c
index 84fe51e8f9..ad9aa7e55b 100644
--- a/src/bin/eolian/legacy_generator.c
+++ b/src/bin/eolian/legacy_generator.c
@@ -96,6 +96,17 @@ _eapi_decl_func_generate(const char *classname, Eolian_Function funcid, Eolian_F
96 const Eina_List *l; 96 const Eina_List *l;
97 void *data; 97 void *data;
98 98
99 EINA_LIST_FOREACH(eolian_property_keys_list_get(funcid), l, data)
100 {
101 const char *pname;
102 const char *pdesc;
103 const char *ptype;
104 eolian_parameter_information_get((Eolian_Function_Parameter)data, NULL, &ptype, &pname, &pdesc);
105 eina_strbuf_append_printf(fparam, ", %s%s %s",
106 eolian_parameter_get_const_attribute_get(data)?"const":"",
107 ptype, pname);
108 eina_strbuf_append_printf(descparam, " * @param %s\n", pname);
109 }
99 if (!var_as_ret) 110 if (!var_as_ret)
100 { 111 {
101 EINA_LIST_FOREACH(eolian_parameters_list_get(funcid), l, data) 112 EINA_LIST_FOREACH(eolian_parameters_list_get(funcid), l, data)
@@ -187,6 +198,17 @@ _eapi_func_generate(const char *classname, Eolian_Function funcid, Eolian_Functi
187 198
188 tmpstr[0] = '\0'; 199 tmpstr[0] = '\0';
189 200
201 EINA_LIST_FOREACH(eolian_property_keys_list_get(funcid), l, data)
202 {
203 const char *pname;
204 const char *ptype;
205 eolian_parameter_information_get((Eolian_Function_Parameter)data, NULL, &ptype, &pname, NULL);
206 eina_strbuf_append_printf(fparam, ", %s%s %s",
207 ftype == GET && eolian_parameter_get_const_attribute_get(data)?"const ":"",
208 ptype, pname);
209 if (eina_strbuf_length_get(eoparam)) eina_strbuf_append(eoparam, ", ");
210 eina_strbuf_append_printf(eoparam, "%s", pname);
211 }
190 if (!var_as_ret) 212 if (!var_as_ret)
191 { 213 {
192 EINA_LIST_FOREACH(eolian_parameters_list_get(funcid), l, data) 214 EINA_LIST_FOREACH(eolian_parameters_list_get(funcid), l, data)