summaryrefslogtreecommitdiff
path: root/src
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
parentad3dbe834b01ecb4381a8c26548be418600dbbb6 (diff)
eolian: get rid of eolian_parameter_information_get
Diffstat (limited to 'src')
-rw-r--r--src/bin/eolian/eo_generator.c57
-rw-r--r--src/bin/eolian/impl_generator.c20
-rw-r--r--src/bin/eolian/legacy_generator.c60
-rw-r--r--src/bin/eolian_cxx/convert_comments.cc7
-rw-r--r--src/bin/eolian_cxx/eolian_wrappers.hh3
-rw-r--r--src/lib/eolian/Eolian.h19
-rw-r--r--src/lib/eolian/database_function_parameter_api.c18
-rw-r--r--src/tests/eolian/eolian_parsing.c38
8 files changed, 103 insertions, 119 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);
diff --git a/src/bin/eolian/impl_generator.c b/src/bin/eolian/impl_generator.c
index 3e5f1f99db..069797e443 100644
--- a/src/bin/eolian/impl_generator.c
+++ b/src/bin/eolian/impl_generator.c
@@ -17,11 +17,9 @@ _params_generate(const Eolian_Function *foo, Eolian_Function_Type ftype, Eina_Bo
17 itr = eolian_property_keys_get(foo); 17 itr = eolian_property_keys_get(foo);
18 EINA_ITERATOR_FOREACH(itr, param) 18 EINA_ITERATOR_FOREACH(itr, param)
19 { 19 {
20 const Eolian_Type *ptypet; 20 const Eolian_Type *ptypet = eolian_parameter_type_get(param);
21 const char *pname; 21 const char *pname = eolian_parameter_name_get(param);
22 const char *ptype; 22 const char *ptype = eolian_type_c_type_get(ptypet);
23 eolian_parameter_information_get(param, NULL, &ptypet, &pname, NULL);
24 ptype = eolian_type_c_type_get(ptypet);
25 Eina_Bool had_star = !!strchr(ptype, '*'); 23 Eina_Bool had_star = !!strchr(ptype, '*');
26 Eina_Bool is_const = eolian_parameter_const_attribute_get(param, ftype == EOLIAN_PROP_GET); 24 Eina_Bool is_const = eolian_parameter_const_attribute_get(param, ftype == EOLIAN_PROP_GET);
27 if (eina_strbuf_length_get(params)) 25 if (eina_strbuf_length_get(params))
@@ -43,12 +41,10 @@ _params_generate(const Eolian_Function *foo, Eolian_Function_Type ftype, Eina_Bo
43 itr = eolian_function_parameters_get(foo); 41 itr = eolian_function_parameters_get(foo);
44 EINA_ITERATOR_FOREACH(itr, param) 42 EINA_ITERATOR_FOREACH(itr, param)
45 { 43 {
46 const Eolian_Type *ptypet; 44 const Eolian_Type *ptypet = eolian_parameter_type_get(param);
47 const char *pname; 45 const char *pname = eolian_parameter_name_get(param);
48 const char *ptype; 46 const char *ptype = eolian_type_c_type_get(ptypet);
49 Eolian_Parameter_Dir pdir; 47 Eolian_Parameter_Dir pdir = eolian_parameter_direction_get(param);
50 eolian_parameter_information_get(param, &pdir, &ptypet, &pname, NULL);
51 ptype = eolian_type_c_type_get(ptypet);
52 Eina_Bool is_const = eolian_parameter_const_attribute_get(param, ftype == EOLIAN_PROP_GET); 48 Eina_Bool is_const = eolian_parameter_const_attribute_get(param, ftype == EOLIAN_PROP_GET);
53 Eina_Bool had_star = !!strchr(ptype, '*'); 49 Eina_Bool had_star = !!strchr(ptype, '*');
54 if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM || pdir == EOLIAN_INOUT_PARAM); 50 if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM || pdir == EOLIAN_INOUT_PARAM);
@@ -153,7 +149,7 @@ _prototype_generate(const Eolian_Function *foo, Eolian_Function_Type ftype, Eina
153 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2)) 149 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2))
154 { 150 {
155 Eolian_Function_Parameter *param = data; 151 Eolian_Function_Parameter *param = data;
156 eolian_parameter_information_get(param, NULL, &rettypet, NULL, NULL); 152 rettypet = eolian_parameter_type_get(param);
157 var_as_ret = EINA_TRUE; 153 var_as_ret = EINA_TRUE;
158 ret_const = eolian_parameter_const_attribute_get(param, EINA_TRUE); 154 ret_const = eolian_parameter_const_attribute_get(param, EINA_TRUE);
159 } 155 }
diff --git a/src/bin/eolian/legacy_generator.c b/src/bin/eolian/legacy_generator.c
index e32e444f0f..42046a261b 100644
--- a/src/bin/eolian/legacy_generator.c
+++ b/src/bin/eolian/legacy_generator.c
@@ -72,7 +72,7 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci
72 /* We want to check if there is only one parameter */ 72 /* We want to check if there is only one parameter */
73 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2)) 73 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2))
74 { 74 {
75 eolian_parameter_information_get((Eolian_Function_Parameter*)data, NULL, &rettypet, NULL, NULL); 75 rettypet = eolian_parameter_type_get((Eolian_Function_Parameter*)data);
76 var_as_ret = EINA_TRUE; 76 var_as_ret = EINA_TRUE;
77 ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE); 77 ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE);
78 } 78 }
@@ -112,12 +112,11 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci
112 itr = eolian_property_keys_get(funcid); 112 itr = eolian_property_keys_get(funcid);
113 EINA_ITERATOR_FOREACH(itr, data) 113 EINA_ITERATOR_FOREACH(itr, data)
114 { 114 {
115 const Eolian_Type *ptypet; 115 Eolian_Function_Parameter *param = data;
116 const char *pname; 116 const Eolian_Type *ptypet = eolian_parameter_type_get(param);
117 const char *pdesc; 117 const char *pname = eolian_parameter_name_get(param);
118 const char *ptype; 118 const char *ptype = eolian_type_c_type_get(ptypet);
119 eolian_parameter_information_get((Eolian_Function_Parameter*)data, NULL, &ptypet, &pname, &pdesc); 119 const char *pdesc = eolian_parameter_description_get(param);
120 ptype = eolian_type_c_type_get(ptypet);
121 leg_param_idx++; 120 leg_param_idx++;
122 if (eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, ", "); 121 if (eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, ", ");
123 eina_strbuf_append_printf(fparam, "%s%s %s", 122 eina_strbuf_append_printf(fparam, "%s%s %s",
@@ -142,14 +141,13 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci
142 itr = eolian_function_parameters_get(funcid); 141 itr = eolian_function_parameters_get(funcid);
143 EINA_ITERATOR_FOREACH(itr, data) 142 EINA_ITERATOR_FOREACH(itr, data)
144 { 143 {
145 const Eolian_Type *ptypet; 144 Eolian_Function_Parameter *param = data;
146 const char *pname; 145 const Eolian_Type *ptypet = eolian_parameter_type_get(param);
147 const char *pdesc; 146 const char *pname = eolian_parameter_name_get(param);
148 const char *ptype; 147 const char *ptype = eolian_type_c_type_get(ptypet);
149 Eolian_Parameter_Dir pdir; 148 const char *pdesc = eolian_parameter_description_get(param);
149 Eolian_Parameter_Dir pdir = eolian_parameter_direction_get(param);
150 const char *str_dir[] = {"in", "out", "inout"}; 150 const char *str_dir[] = {"in", "out", "inout"};
151 eolian_parameter_information_get((Eolian_Function_Parameter*)data, &pdir, &ptypet, &pname, &pdesc);
152 ptype = eolian_type_c_type_get(ptypet);
153 Eina_Bool had_star = !!strchr(ptype, '*'); 151 Eina_Bool had_star = !!strchr(ptype, '*');
154 if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM || pdir == EOLIAN_INOUT_PARAM); 152 if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM || pdir == EOLIAN_INOUT_PARAM);
155 if (ftype == EOLIAN_PROP_GET) pdir = EOLIAN_OUT_PARAM; 153 if (ftype == EOLIAN_PROP_GET) pdir = EOLIAN_OUT_PARAM;
@@ -242,7 +240,9 @@ _eapi_func_generate(const Eolian_Class *class, const Eolian_Function *funcid, Eo
242 /* We want to check if there is only one parameter */ 240 /* We want to check if there is only one parameter */
243 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2)) 241 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2))
244 { 242 {
245 eolian_parameter_information_get((Eolian_Function_Parameter*)data, NULL, &rettypet, &retname, NULL); 243 Eolian_Function_Parameter *param = data;
244 rettypet = eolian_parameter_type_get(param);
245 retname = eolian_parameter_name_get(param);
246 var_as_ret = EINA_TRUE; 246 var_as_ret = EINA_TRUE;
247 ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE); 247 ret_const = eolian_parameter_const_attribute_get(data, EINA_TRUE);
248 } 248 }
@@ -283,11 +283,10 @@ _eapi_func_generate(const Eolian_Class *class, const Eolian_Function *funcid, Eo
283 itr = eolian_property_keys_get(funcid); 283 itr = eolian_property_keys_get(funcid);
284 EINA_ITERATOR_FOREACH(itr, data) 284 EINA_ITERATOR_FOREACH(itr, data)
285 { 285 {
286 const Eolian_Type *ptypet; 286 Eolian_Function_Parameter *param = data;
287 const char *pname; 287 const Eolian_Type *ptypet = eolian_parameter_type_get(param);
288 const char *ptype; 288 const char *pname = eolian_parameter_name_get(param);
289 eolian_parameter_information_get((Eolian_Function_Parameter*)data, NULL, &ptypet, &pname, NULL); 289 const char *ptype = eolian_type_c_type_get(ptypet);
290 ptype = eolian_type_c_type_get(ptypet);
291 if (eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, ", "); 290 if (eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, ", ");
292 eina_strbuf_append_printf(fparam, "%s%s %s", 291 eina_strbuf_append_printf(fparam, "%s%s %s",
293 eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET)?"const ":"", 292 eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET)?"const ":"",
@@ -299,15 +298,14 @@ _eapi_func_generate(const Eolian_Class *class, const Eolian_Function *funcid, Eo
299 eina_iterator_free(itr); 298 eina_iterator_free(itr);
300 if (!var_as_ret) 299 if (!var_as_ret)
301 { 300 {
302 itr = eolian_function_parameters_get(funcid); 301 itr = eolian_function_parameters_get(funcid);
303 EINA_ITERATOR_FOREACH(itr, data) 302 EINA_ITERATOR_FOREACH(itr, data)
304 { 303 {
305 const Eolian_Type *ptypet; 304 Eolian_Function_Parameter *param = data;
306 const char *pname; 305 const Eolian_Type *ptypet = eolian_parameter_type_get(param);
307 const char *ptype; 306 const char *pname = eolian_parameter_name_get(param);
308 Eolian_Parameter_Dir pdir; 307 const char *ptype = eolian_type_c_type_get(ptypet);
309 eolian_parameter_information_get((Eolian_Function_Parameter*)data, &pdir, &ptypet, &pname, NULL); 308 Eolian_Parameter_Dir pdir = eolian_parameter_direction_get(param);
310 ptype = eolian_type_c_type_get(ptypet);
311 Eina_Bool had_star = !!strchr(ptype, '*'); 309 Eina_Bool had_star = !!strchr(ptype, '*');
312 if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM || pdir == EOLIAN_INOUT_PARAM); 310 if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM || pdir == EOLIAN_INOUT_PARAM);
313 if (eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, ", "); 311 if (eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, ", ");
@@ -317,8 +315,8 @@ _eapi_func_generate(const Eolian_Class *class, const Eolian_Function *funcid, Eo
317 eina_stringshare_del(ptype); 315 eina_stringshare_del(ptype);
318 if (eina_strbuf_length_get(eoparam)) eina_strbuf_append(eoparam, ", "); 316 if (eina_strbuf_length_get(eoparam)) eina_strbuf_append(eoparam, ", ");
319 eina_strbuf_append_printf(eoparam, "%s", pname); 317 eina_strbuf_append_printf(eoparam, "%s", pname);
320 } 318 }
321 eina_iterator_free(itr); 319 eina_iterator_free(itr);
322 } 320 }
323 if (!eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, "void"); 321 if (!eina_strbuf_length_get(fparam)) eina_strbuf_append(fparam, "void");
324 322
diff --git a/src/bin/eolian_cxx/convert_comments.cc b/src/bin/eolian_cxx/convert_comments.cc
index 4f13048044..87b0f350c5 100644
--- a/src/bin/eolian_cxx/convert_comments.cc
+++ b/src/bin/eolian_cxx/convert_comments.cc
@@ -7,11 +7,8 @@ namespace eolian_cxx {
7static std::string 7static std::string
8_comment_parameter(Eolian_Function_Parameter *param) 8_comment_parameter(Eolian_Function_Parameter *param)
9{ 9{
10 Eolian_Parameter_Dir direction; 10 Eolian_Parameter_Dir direction = eolian_parameter_direction_get(param);
11 Eina_Stringshare *description; 11 Eina_Stringshare *description = eolian_parameter_description_get(param);
12
13 ::eolian_parameter_information_get
14 (param, &direction, NULL, NULL, &description);
15 12
16 std::string doc = "@param"; 13 std::string doc = "@param";
17 if (direction == EOLIAN_IN_PARAM) doc += " "; 14 if (direction == EOLIAN_IN_PARAM) doc += " ";
diff --git a/src/bin/eolian_cxx/eolian_wrappers.hh b/src/bin/eolian_cxx/eolian_wrappers.hh
index 7f10b49e0d..c3a093a11b 100644
--- a/src/bin/eolian_cxx/eolian_wrappers.hh
+++ b/src/bin/eolian_cxx/eolian_wrappers.hh
@@ -276,8 +276,7 @@ parameter_name(Eolian_Function_Parameter const& parameter)
276inline bool 276inline bool
277parameter_is_out(Eolian_Function_Parameter const& parameter) 277parameter_is_out(Eolian_Function_Parameter const& parameter)
278{ 278{
279 Eolian_Parameter_Dir direction; 279 Eolian_Parameter_Dir direction = eolian_parameter_direction_get(&parameter);
280 ::eolian_parameter_information_get(&parameter, &direction, NULL, NULL, NULL);
281 return direction == EOLIAN_OUT_PARAM || direction == EOLIAN_INOUT_PARAM; 280 return direction == EOLIAN_OUT_PARAM || direction == EOLIAN_INOUT_PARAM;
282} 281}
283 282
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index bddb4fcbe2..7a6df642c1 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -705,17 +705,14 @@ EAPI Eina_Iterator *eolian_property_keys_get(const Eolian_Function *foo_id);
705EAPI Eina_Iterator *eolian_property_values_get(const Eolian_Function *foo_id); 705EAPI Eina_Iterator *eolian_property_values_get(const Eolian_Function *foo_id);
706 706
707/* 707/*
708 * @brief Get information about a function parameter 708 * @brief Get direction of a parameter
709 * 709 *
710 * @param[in] param_desc parameter handle 710 * @param[in] param_desc parameter handle
711 * @param[out] param_dir in/out/inout 711 * @return the direction of the parameter
712 * @param[out] type type of the parameter
713 * @param[out] name name of the parameter
714 * @param[out] description description of the parameter
715 * 712 *
716 * @ingroup Eolian 713 * @ingroup Eolian
717 */ 714 */
718EAPI void eolian_parameter_information_get(const Eolian_Function_Parameter *param_desc, Eolian_Parameter_Dir *param_dir, const Eolian_Type **type, const char **name, const char **description); 715EAPI Eolian_Parameter_Dir eolian_parameter_direction_get(const Eolian_Function_Parameter *param);
719 716
720/* 717/*
721 * @brief Get type of a parameter 718 * @brief Get type of a parameter
@@ -738,6 +735,16 @@ EAPI const Eolian_Type *eolian_parameter_type_get(const Eolian_Function_Paramete
738EAPI Eina_Stringshare *eolian_parameter_name_get(const Eolian_Function_Parameter *param); 735EAPI Eina_Stringshare *eolian_parameter_name_get(const Eolian_Function_Parameter *param);
739 736
740/* 737/*
738 * @brief Get description of a parameter
739 *
740 * @param[in] param_desc parameter handle
741 * @return the description of the parameter or NULL
742 *
743 * @ingroup Eolian
744 */
745EAPI Eina_Stringshare *eolian_parameter_description_get(const Eolian_Function_Parameter *param);
746
747/*
741 * @brief Indicates if a parameter has a const attribute. 748 * @brief Indicates if a parameter has a const attribute.
742 * 749 *
743 * This function is relevant for properties, to know if a parameter is a const 750 * This function is relevant for properties, to know if a parameter is a const
diff --git a/src/lib/eolian/database_function_parameter_api.c b/src/lib/eolian/database_function_parameter_api.c
index ed82a9a0ac..73048b4c69 100644
--- a/src/lib/eolian/database_function_parameter_api.c
+++ b/src/lib/eolian/database_function_parameter_api.c
@@ -1,6 +1,13 @@
1#include <Eina.h> 1#include <Eina.h>
2#include "eolian_database.h" 2#include "eolian_database.h"
3 3
4EAPI Eolian_Parameter_Dir
5eolian_parameter_direction_get(const Eolian_Function_Parameter *param)
6{
7 EINA_SAFETY_ON_NULL_RETURN_VAL(param, EOLIAN_IN_PARAM);
8 return param->param_dir;
9}
10
4EAPI const Eolian_Type * 11EAPI const Eolian_Type *
5eolian_parameter_type_get(const Eolian_Function_Parameter *param) 12eolian_parameter_type_get(const Eolian_Function_Parameter *param)
6{ 13{
@@ -16,14 +23,11 @@ eolian_parameter_name_get(const Eolian_Function_Parameter *param)
16 return param->name; 23 return param->name;
17} 24}
18 25
19EAPI void 26EAPI Eina_Stringshare *
20eolian_parameter_information_get(const Eolian_Function_Parameter *param, Eolian_Parameter_Dir *param_dir, const Eolian_Type **type, const char **name, const char **description) 27eolian_parameter_description_get(const Eolian_Function_Parameter *param)
21{ 28{
22 EINA_SAFETY_ON_NULL_RETURN(param); 29 EINA_SAFETY_ON_NULL_RETURN_VAL(param, NULL);
23 if (param_dir) *param_dir = param->param_dir; 30 return param->description;
24 if (type) *type = param->type;
25 if (name) *name = param->name;
26 if (description) *description = param->description;
27} 31}
28 32
29EAPI Eina_Bool 33EAPI Eina_Bool
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c
index c4155926c2..5d98a8ffe8 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -437,9 +437,7 @@ END_TEST
437START_TEST(eolian_simple_parsing) 437START_TEST(eolian_simple_parsing)
438{ 438{
439 const Eolian_Function *fid = NULL; 439 const Eolian_Function *fid = NULL;
440 const Eolian_Type *ptypep = NULL; 440 const char *string = NULL, *ptype = NULL;
441 const char *string = NULL, *ptype = NULL, *pname = NULL;
442 Eolian_Parameter_Dir dir = EOLIAN_IN_PARAM;
443 const Eolian_Function_Parameter *param = NULL; 441 const Eolian_Function_Parameter *param = NULL;
444 const Eolian_Expression *expr = NULL; 442 const Eolian_Expression *expr = NULL;
445 const Eolian_Class *class; 443 const Eolian_Class *class;
@@ -494,10 +492,9 @@ START_TEST(eolian_simple_parsing)
494 fail_if(!(eina_iterator_next(iter, (void**)&param))); 492 fail_if(!(eina_iterator_next(iter, (void**)&param)));
495 fail_if(eina_iterator_next(iter, &dummy)); 493 fail_if(eina_iterator_next(iter, &dummy));
496 eina_iterator_free(iter); 494 eina_iterator_free(iter);
497 eolian_parameter_information_get(param, NULL, &ptypep, &pname, &string); 495 fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "int"));
498 fail_if(strcmp(eolian_type_name_get(ptypep), "int")); 496 fail_if(strcmp(eolian_parameter_name_get(param), "value"));
499 fail_if(strcmp(pname, "value")); 497 fail_if(strcmp(eolian_parameter_description_get(param), "Value description"));
500 fail_if(strcmp(string, "Value description"));
501 498
502 /* Method */ 499 /* Method */
503 fail_if(!(fid = eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD))); 500 fail_if(!(fid = eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD)));
@@ -521,25 +518,22 @@ START_TEST(eolian_simple_parsing)
521 /* Function parameters */ 518 /* Function parameters */
522 fail_if(!(iter = eolian_property_values_get(fid))); 519 fail_if(!(iter = eolian_property_values_get(fid)));
523 fail_if(!(eina_iterator_next(iter, (void**)&param))); 520 fail_if(!(eina_iterator_next(iter, (void**)&param)));
524 eolian_parameter_information_get(param, &dir, &ptypep, &pname, &string); 521 fail_if(eolian_parameter_direction_get(param) != EOLIAN_IN_PARAM);
525 fail_if(dir != EOLIAN_IN_PARAM); 522 fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "int"));
526 fail_if(strcmp(eolian_type_name_get(ptypep), "int")); 523 fail_if(strcmp(eolian_parameter_name_get(param), "a"));
527 fail_if(strcmp(pname, "a")); 524 fail_if(strcmp(eolian_parameter_description_get(param), "a"));
528 fail_if(!string || strcmp(string, "a"));
529 fail_if(!(eina_iterator_next(iter, (void**)&param))); 525 fail_if(!(eina_iterator_next(iter, (void**)&param)));
530 eolian_parameter_information_get(param, &dir, &ptypep, &pname, &string); 526 fail_if(eolian_parameter_direction_get(param) != EOLIAN_INOUT_PARAM);
531 fail_if(dir != EOLIAN_INOUT_PARAM); 527 ptype = eolian_type_name_get(eolian_parameter_type_get(param));
532 ptype = eolian_type_name_get(ptypep);
533 fail_if(strcmp(ptype, "char")); 528 fail_if(strcmp(ptype, "char"));
534 eina_stringshare_del(ptype); 529 eina_stringshare_del(ptype);
535 fail_if(strcmp(pname, "b")); 530 fail_if(strcmp(eolian_parameter_name_get(param), "b"));
536 fail_if(string); 531 fail_if(eolian_parameter_description_get(param));
537 fail_if(!(eina_iterator_next(iter, (void**)&param))); 532 fail_if(!(eina_iterator_next(iter, (void**)&param)));
538 eolian_parameter_information_get(param, &dir, &ptypep, &pname, &string); 533 fail_if(eolian_parameter_direction_get(param) != EOLIAN_OUT_PARAM);
539 fail_if(dir != EOLIAN_OUT_PARAM); 534 fail_if(strcmp(eolian_type_name_get(eolian_parameter_type_get(param)), "double"));
540 fail_if(strcmp(eolian_type_name_get(ptypep), "double")); 535 fail_if(strcmp(eolian_parameter_name_get(param), "c"));
541 fail_if(strcmp(pname, "c")); 536 fail_if(eolian_parameter_description_get(param));
542 fail_if(string);
543 fail_if(eina_iterator_next(iter, &dummy)); 537 fail_if(eina_iterator_next(iter, &dummy));
544 eina_iterator_free(iter); 538 eina_iterator_free(iter);
545 539