summaryrefslogtreecommitdiff
path: root/src/bin/eolian/headers.c
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-12-15 17:00:36 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-12-15 17:11:11 +0100
commit18e18ca74c5456e0ecb7f03065959fb9fb7b58f4 (patch)
treeeda220d83a70bdec5b2b14227fa1bac8d3381b3c /src/bin/eolian/headers.c
parentd624464ab4c61140ed3d46a2bbc183b8cb500d2b (diff)
eolian: remove remaining global state (+ modify APIs accordingly)
Diffstat (limited to 'src/bin/eolian/headers.c')
-rw-r--r--src/bin/eolian/headers.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/bin/eolian/headers.c b/src/bin/eolian/headers.c
index 90fc1ea..b2fe73a 100644
--- a/src/bin/eolian/headers.c
+++ b/src/bin/eolian/headers.c
@@ -12,12 +12,13 @@ _get_add_star(Eolian_Function_Type ftype, Eolian_Parameter_Dir pdir)
12} 12}
13 13
14static int 14static int
15_gen_param(Eina_Strbuf *buf, Eolian_Function_Parameter *pr, Eolian_Function_Type ftype, int *rpid) 15_gen_param(const Eolian_Unit *src, Eina_Strbuf *buf,
16 Eolian_Function_Parameter *pr, Eolian_Function_Type ftype, int *rpid)
16{ 17{
17 const Eolian_Type *prt = eolian_parameter_type_get(pr); 18 const Eolian_Type *prt = eolian_parameter_type_get(pr);
18 const Eolian_Typedecl *ptd = eolian_type_typedecl_get(prt); 19 const Eolian_Typedecl *ptd = eolian_type_typedecl_get(src, prt);
19 const char *prn = eolian_parameter_name_get(pr); 20 const char *prn = eolian_parameter_name_get(pr);
20 Eina_Stringshare *prtn = eolian_type_c_type_get(prt, EOLIAN_C_TYPE_PARAM); 21 Eina_Stringshare *prtn = eolian_type_c_type_get(src, prt, EOLIAN_C_TYPE_PARAM);
21 22
22 if (ptd && (eolian_typedecl_type_get(ptd) == EOLIAN_TYPEDECL_FUNCTION_POINTER)) 23 if (ptd && (eolian_typedecl_type_get(ptd) == EOLIAN_TYPEDECL_FUNCTION_POINTER))
23 { 24 {
@@ -39,7 +40,8 @@ _gen_param(Eina_Strbuf *buf, Eolian_Function_Parameter *pr, Eolian_Function_Type
39} 40}
40 41
41void 42void
42eo_gen_params(Eina_Iterator *itr, Eina_Strbuf *buf, Eina_Strbuf **flagbuf, int *nidx, Eolian_Function_Type ftype) 43eo_gen_params(const Eolian_Unit *src, Eina_Iterator *itr, Eina_Strbuf *buf,
44 Eina_Strbuf **flagbuf, int *nidx, Eolian_Function_Type ftype)
43{ 45{
44 Eolian_Function_Parameter *pr; 46 Eolian_Function_Parameter *pr;
45 EINA_ITERATOR_FOREACH(itr, pr) 47 EINA_ITERATOR_FOREACH(itr, pr)
@@ -47,7 +49,7 @@ eo_gen_params(Eina_Iterator *itr, Eina_Strbuf *buf, Eina_Strbuf **flagbuf, int *
47 int rpid = 0; 49 int rpid = 0;
48 if (*nidx) 50 if (*nidx)
49 eina_strbuf_append(buf, ", "); 51 eina_strbuf_append(buf, ", ");
50 *nidx += _gen_param(buf, pr, ftype, &rpid); 52 *nidx += _gen_param(src, buf, pr, ftype, &rpid);
51 53
52 if (!eolian_parameter_is_nonull(pr) || !flagbuf) 54 if (!eolian_parameter_is_nonull(pr) || !flagbuf)
53 continue; 55 continue;
@@ -110,7 +112,7 @@ _gen_func(const Eolian_Unit *src, const Eolian_Function *fid,
110 eina_strbuf_append(buf, legacy ? "EAPI " : "EOAPI "); 112 eina_strbuf_append(buf, legacy ? "EAPI " : "EOAPI ");
111 if (rtp) 113 if (rtp)
112 { 114 {
113 Eina_Stringshare *rtps = eolian_type_c_type_get(rtp, EOLIAN_C_TYPE_RETURN); 115 Eina_Stringshare *rtps = eolian_type_c_type_get(src, rtp, EOLIAN_C_TYPE_RETURN);
114 eina_strbuf_append(buf, rtps); 116 eina_strbuf_append(buf, rtps);
115 if (rtps[strlen(rtps) - 1] != '*') 117 if (rtps[strlen(rtps) - 1] != '*')
116 eina_strbuf_append_char(buf, ' '); 118 eina_strbuf_append_char(buf, ' ');
@@ -139,7 +141,7 @@ _gen_func(const Eolian_Unit *src, const Eolian_Function *fid,
139 eina_strbuf_append(buf, "Eo *obj"); 141 eina_strbuf_append(buf, "Eo *obj");
140 } 142 }
141 143
142 eo_gen_params(eolian_property_keys_get(fid, ftype), buf, &flagbuf, &nidx, EOLIAN_PROPERTY); 144 eo_gen_params(src, eolian_property_keys_get(fid, ftype), buf, &flagbuf, &nidx, EOLIAN_PROPERTY);
143 145
144 if (!var_as_ret) 146 if (!var_as_ret)
145 { 147 {
@@ -148,7 +150,7 @@ _gen_func(const Eolian_Unit *src, const Eolian_Function *fid,
148 itr = eolian_property_values_get(fid, ftype); 150 itr = eolian_property_values_get(fid, ftype);
149 else 151 else
150 itr = eolian_function_parameters_get(fid); 152 itr = eolian_function_parameters_get(fid);
151 eo_gen_params(itr, buf, &flagbuf, &nidx, ftype); 153 eo_gen_params(src, itr, buf, &flagbuf, &nidx, ftype);
152 } 154 }
153 155
154 if (flagbuf) 156 if (flagbuf)