summaryrefslogtreecommitdiff
path: root/src/bin/eolian/headers.c
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-08-30 15:45:20 +0200
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-08-30 15:45:20 +0200
commit2071bbe8fb6efedef6cfa3ec1ad3df398c42727f (patch)
treef6777fc775e4a36abd4aeab512269b0f03db1374 /src/bin/eolian/headers.c
parentaf6713ebb464fe264e553542c0a6cbf545e8052f (diff)
eolian: clean up and fix function pointer generation
Out/inout params are now correctly handled.
Diffstat (limited to 'src/bin/eolian/headers.c')
-rw-r--r--src/bin/eolian/headers.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/bin/eolian/headers.c b/src/bin/eolian/headers.c
index a0c6879..90fc1ea 100644
--- a/src/bin/eolian/headers.c
+++ b/src/bin/eolian/headers.c
@@ -11,8 +11,8 @@ _get_add_star(Eolian_Function_Type ftype, Eolian_Parameter_Dir pdir)
11 return ""; 11 return "";
12} 12}
13 13
14int 14static int
15eo_gen_type_c_params_gen(Eina_Strbuf *buf, Eolian_Function_Parameter *pr, Eolian_Function_Type ftype, int *rpid) 15_gen_param(Eina_Strbuf *buf, Eolian_Function_Parameter *pr, Eolian_Function_Type ftype, int *rpid)
16{ 16{
17 const Eolian_Type *prt = eolian_parameter_type_get(pr); 17 const Eolian_Type *prt = eolian_parameter_type_get(pr);
18 const Eolian_Typedecl *ptd = eolian_type_typedecl_get(prt); 18 const Eolian_Typedecl *ptd = eolian_type_typedecl_get(prt);
@@ -38,8 +38,8 @@ eo_gen_type_c_params_gen(Eina_Strbuf *buf, Eolian_Function_Parameter *pr, Eolian
38 return 1; 38 return 1;
39} 39}
40 40
41static void 41void
42_gen_params(Eina_Iterator *itr, Eina_Strbuf *buf, Eina_Strbuf **flagbuf, int *nidx, Eolian_Function_Type ftype) 42eo_gen_params(Eina_Iterator *itr, Eina_Strbuf *buf, Eina_Strbuf **flagbuf, int *nidx, Eolian_Function_Type ftype)
43{ 43{
44 Eolian_Function_Parameter *pr; 44 Eolian_Function_Parameter *pr;
45 EINA_ITERATOR_FOREACH(itr, pr) 45 EINA_ITERATOR_FOREACH(itr, pr)
@@ -47,9 +47,9 @@ _gen_params(Eina_Iterator *itr, Eina_Strbuf *buf, Eina_Strbuf **flagbuf, int *ni
47 int rpid = 0; 47 int rpid = 0;
48 if (*nidx) 48 if (*nidx)
49 eina_strbuf_append(buf, ", "); 49 eina_strbuf_append(buf, ", ");
50 *nidx += eo_gen_type_c_params_gen(buf, pr, ftype, &rpid); 50 *nidx += _gen_param(buf, pr, ftype, &rpid);
51 51
52 if (!eolian_parameter_is_nonull(pr)) 52 if (!eolian_parameter_is_nonull(pr) || !flagbuf)
53 continue; 53 continue;
54 54
55 if (!*flagbuf) 55 if (!*flagbuf)
@@ -139,7 +139,7 @@ _gen_func(const Eolian_Unit *src, const Eolian_Function *fid,
139 eina_strbuf_append(buf, "Eo *obj"); 139 eina_strbuf_append(buf, "Eo *obj");
140 } 140 }
141 141
142 _gen_params(eolian_property_keys_get(fid, ftype), buf, &flagbuf, &nidx, EOLIAN_PROPERTY); 142 eo_gen_params(eolian_property_keys_get(fid, ftype), buf, &flagbuf, &nidx, EOLIAN_PROPERTY);
143 143
144 if (!var_as_ret) 144 if (!var_as_ret)
145 { 145 {
@@ -148,7 +148,7 @@ _gen_func(const Eolian_Unit *src, const Eolian_Function *fid,
148 itr = eolian_property_values_get(fid, ftype); 148 itr = eolian_property_values_get(fid, ftype);
149 else 149 else
150 itr = eolian_function_parameters_get(fid); 150 itr = eolian_function_parameters_get(fid);
151 _gen_params(itr, buf, &flagbuf, &nidx, ftype); 151 eo_gen_params(itr, buf, &flagbuf, &nidx, ftype);
152 } 152 }
153 153
154 if (flagbuf) 154 if (flagbuf)