summaryrefslogtreecommitdiff
path: root/src/bin/eolian/eo_generator.c
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-08-13 14:08:00 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-08-21 09:26:04 +0100
commit93726c86a3ff0d541d901ea7e0b5a033583b9d9d (patch)
tree64e04ece97a966d029c86a3023eacc06fbe5977c /src/bin/eolian/eo_generator.c
parentad3dbe834b01ecb4381a8c26548be418600dbbb6 (diff)
eolian: get rid of eolian_parameter_information_get
Diffstat (limited to 'src/bin/eolian/eo_generator.c')
-rw-r--r--src/bin/eolian/eo_generator.c57
1 files changed, 23 insertions, 34 deletions
diff --git a/src/bin/eolian/eo_generator.c b/src/bin/eolian/eo_generator.c
index 438c0f878f..cb47c21bf1 100644
--- a/src/bin/eolian/eo_generator.c
+++ b/src/bin/eolian/eo_generator.c
@@ -106,7 +106,7 @@ eo_fundef_generate(const Eolian_Class *class, Eolian_Function *func, Eolian_Func
106 /* We want to check if there is only one parameter */ 106 /* We want to check if there is only one parameter */
107 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2)) 107 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2))
108 { 108 {
109 eolian_parameter_information_get((Eolian_Function_Parameter*)data, NULL, &rettypet, NULL, NULL); 109 rettypet = eolian_parameter_type_get((Eolian_Function_Parameter*)data);
110 var_as_ret = EINA_TRUE; 110 var_as_ret = EINA_TRUE;
111 ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE); 111 ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE);
112 } 112 }
@@ -154,13 +154,11 @@ eo_fundef_generate(const Eolian_Class *class, Eolian_Function *func, Eolian_Func
154 itr = eolian_property_keys_get(func); 154 itr = eolian_property_keys_get(func);
155 EINA_ITERATOR_FOREACH(itr, data) 155 EINA_ITERATOR_FOREACH(itr, data)
156 { 156 {
157 const Eolian_Type *ptypet; 157 Eolian_Function_Parameter *param = data;
158 const char *pname; 158 const Eolian_Type *ptypet = eolian_parameter_type_get(param);
159 const char *ptype; 159 const char *pname = eolian_parameter_name_get(param);
160 const char *pdesc = NULL; 160 const char *ptype = eolian_type_c_type_get(ptypet);
161 eolian_parameter_information_get((Eolian_Function_Parameter*)data, NULL, &ptypet, &pname, &pdesc); 161 const char *pdesc = eolian_parameter_description_get(param);
162
163 ptype = eolian_type_c_type_get(ptypet);
164 162
165 eina_strbuf_append_printf(str_pardesc, tmpl_eo_pardesc, "in", pname, pdesc?pdesc:"No description supplied."); 163 eina_strbuf_append_printf(str_pardesc, tmpl_eo_pardesc, "in", pname, pdesc?pdesc:"No description supplied.");
166 164
@@ -175,15 +173,13 @@ eo_fundef_generate(const Eolian_Class *class, Eolian_Function *func, Eolian_Func
175 itr = eolian_function_parameters_get(func); 173 itr = eolian_function_parameters_get(func);
176 EINA_ITERATOR_FOREACH(itr, data) 174 EINA_ITERATOR_FOREACH(itr, data)
177 { 175 {
178 const Eolian_Type *ptypet; 176 Eolian_Function_Parameter *param = data;
179 const char *pname; 177 const Eolian_Type *ptypet = eolian_parameter_type_get(param);
180 const char *ptype; 178 const char *pname = eolian_parameter_name_get(param);
181 const char *pdesc; 179 const char *ptype = eolian_type_c_type_get(ptypet);
180 const char *pdesc = eolian_parameter_description_get(param);
182 Eina_Bool add_star = EINA_FALSE; 181 Eina_Bool add_star = EINA_FALSE;
183 Eolian_Parameter_Dir pdir; 182 Eolian_Parameter_Dir pdir = eolian_parameter_direction_get(param);
184 eolian_parameter_information_get((Eolian_Function_Parameter*)data, &pdir, &ptypet, &pname, &pdesc);
185
186 ptype = eolian_type_c_type_get(ptypet);
187 183
188 Eina_Bool is_const = eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET); 184 Eina_Bool is_const = eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET);
189 if (ftype == EOLIAN_PROP_GET) { 185 if (ftype == EOLIAN_PROP_GET) {
@@ -342,7 +338,6 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
342 Eina_Bool var_as_ret = EINA_FALSE; 338 Eina_Bool var_as_ret = EINA_FALSE;
343 const Eolian_Type *rettypet = NULL; 339 const Eolian_Type *rettypet = NULL;
344 const char *rettype = NULL; 340 const char *rettype = NULL;
345 const char *retname = NULL;
346 Eina_Bool ret_const = EINA_FALSE; 341 Eina_Bool ret_const = EINA_FALSE;
347 Eina_Bool add_star = EINA_FALSE; 342 Eina_Bool add_star = EINA_FALSE;
348 Eina_Iterator *itr; 343 Eina_Iterator *itr;
@@ -357,7 +352,6 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
357 Eina_Strbuf *full_params = eina_strbuf_new(); /* variables types + names */ 352 Eina_Strbuf *full_params = eina_strbuf_new(); /* variables types + names */
358 353
359 rettypet = eolian_function_return_type_get(funcid, ftype); 354 rettypet = eolian_function_return_type_get(funcid, ftype);
360 retname = "ret";
361 if (ftype == EOLIAN_PROP_GET) 355 if (ftype == EOLIAN_PROP_GET)
362 { 356 {
363 suffix = "_get"; 357 suffix = "_get";
@@ -368,7 +362,8 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
368 /* We want to check if there is only one parameter */ 362 /* We want to check if there is only one parameter */
369 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2)) 363 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2))
370 { 364 {
371 eolian_parameter_information_get((Eolian_Function_Parameter*)data, NULL, &rettypet, &retname, NULL); 365 Eolian_Function_Parameter *param = data;
366 rettypet = eolian_parameter_type_get(param);
372 var_as_ret = EINA_TRUE; 367 var_as_ret = EINA_TRUE;
373 ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE); 368 ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE);
374 } 369 }
@@ -383,13 +378,10 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
383 itr = eolian_property_keys_get(funcid); 378 itr = eolian_property_keys_get(funcid);
384 EINA_ITERATOR_FOREACH(itr, data) 379 EINA_ITERATOR_FOREACH(itr, data)
385 { 380 {
386 const Eolian_Type *ptypet; 381 Eolian_Function_Parameter *param = data;
387 const char *pname; 382 const Eolian_Type *ptypet = eolian_parameter_type_get(param);
388 const char *ptype; 383 const char *pname = eolian_parameter_name_get(param);
389 eolian_parameter_information_get((Eolian_Function_Parameter*)data, NULL, &ptypet, &pname, NULL); 384 const char *ptype = eolian_type_c_type_get(ptypet);
390
391 ptype = eolian_type_c_type_get(ptypet);
392
393 Eina_Bool is_const = eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET); 385 Eina_Bool is_const = eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET);
394 if (eina_strbuf_length_get(params)) eina_strbuf_append(params, ", "); 386 if (eina_strbuf_length_get(params)) eina_strbuf_append(params, ", ");
395 eina_strbuf_append_printf(params, "%s", pname); 387 eina_strbuf_append_printf(params, "%s", pname);
@@ -404,14 +396,11 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
404 itr = eolian_function_parameters_get(funcid); 396 itr = eolian_function_parameters_get(funcid);
405 EINA_ITERATOR_FOREACH(itr, data) 397 EINA_ITERATOR_FOREACH(itr, data)
406 { 398 {
407 const Eolian_Type *ptypet; 399 Eolian_Function_Parameter *param = data;
408 const char *pname; 400 const Eolian_Type *ptypet = eolian_parameter_type_get(param);
409 const char *ptype; 401 const char *pname = eolian_parameter_name_get(param);
410 Eolian_Parameter_Dir pdir; 402 const char *ptype = eolian_type_c_type_get(ptypet);
411 eolian_parameter_information_get((Eolian_Function_Parameter*)data, &pdir, &ptypet, &pname, NULL); 403 Eolian_Parameter_Dir pdir = eolian_parameter_direction_get(param);
412
413 ptype = eolian_type_c_type_get(ptypet);
414
415 Eina_Bool is_const = eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET); 404 Eina_Bool is_const = eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET);
416 Eina_Bool had_star = !!strchr(ptype, '*'); 405 Eina_Bool had_star = !!strchr(ptype, '*');
417 if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM || pdir == EOLIAN_INOUT_PARAM); 406 if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM || pdir == EOLIAN_INOUT_PARAM);