summaryrefslogtreecommitdiff
path: root/src/bin/eolian/headers.c
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2016-10-12 15:08:37 +0200
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2016-10-12 15:11:16 +0200
commita862e07520231952e70b81152584b21c4b6fc897 (patch)
tree124421dc54b227164cac5e3097b576ac3d645a22 /src/bin/eolian/headers.c
parentd3d63ea8d39378b254728390809c44163bbadb63 (diff)
eolian gen: use the C get function name getter instead of manual concat
Diffstat (limited to 'src/bin/eolian/headers.c')
-rw-r--r--src/bin/eolian/headers.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/src/bin/eolian/headers.c b/src/bin/eolian/headers.c
index af95b17..febc11a 100644
--- a/src/bin/eolian/headers.c
+++ b/src/bin/eolian/headers.c
@@ -2,23 +2,6 @@
2#include "docs.h" 2#include "docs.h"
3 3
4static const char * 4static const char *
5_cl_type_str_get(const Eolian_Class *cl, Eina_Bool uc)
6{
7 switch (eolian_class_type_get(cl))
8 {
9 case EOLIAN_CLASS_REGULAR:
10 case EOLIAN_CLASS_ABSTRACT:
11 return uc ? "CLASS" : "class";
12 case EOLIAN_CLASS_MIXIN:
13 return uc ? "MIXIN" : "mixin";
14 case EOLIAN_CLASS_INTERFACE:
15 return uc ? "INTERFACE" : "interface";
16 default:
17 return NULL;
18 }
19}
20
21static const char *
22_get_add_star(Eolian_Function_Type ftype, Eolian_Parameter_Dir pdir) 5_get_add_star(Eolian_Function_Type ftype, Eolian_Parameter_Dir pdir)
23{ 6{
24 if (ftype == EOLIAN_PROP_GET) 7 if (ftype == EOLIAN_PROP_GET)
@@ -198,8 +181,8 @@ eo_gen_header_gen(const Eolian_Class *cl, Eina_Strbuf *buf, Eina_Bool legacy)
198 if (!cl) 181 if (!cl)
199 return; 182 return;
200 183
201 char *cname = NULL, *cnameu = NULL, *cnamel = NULL; 184 char *cname = NULL, *cnameu = NULL;
202 eo_gen_class_names_get(cl, &cname, &cnameu, &cnamel); 185 eo_gen_class_names_get(cl, &cname, &cnameu, NULL);
203 186
204 /* class definition */ 187 /* class definition */
205 188
@@ -219,12 +202,12 @@ eo_gen_header_gen(const Eolian_Class *cl, Eina_Strbuf *buf, Eina_Bool legacy)
219 } 202 }
220 203
221 Eina_Stringshare *mname = eolian_class_c_name_get(cl); 204 Eina_Stringshare *mname = eolian_class_c_name_get(cl);
222 eina_strbuf_append_printf(buf, "#define %s %s_%s_get()\n\n", 205 Eina_Stringshare *gname = eolian_class_c_get_function_name_get(cl);
223 mname, cnamel, _cl_type_str_get(cl, EINA_FALSE)); 206 eina_strbuf_append_printf(buf, "#define %s %s()\n\n", mname, gname);
224 eina_stringshare_del(mname); 207 eina_stringshare_del(mname);
225 208
226 eina_strbuf_append_printf(buf, "EWAPI const Efl_Class *%s_%s_get(void);\n", 209 eina_strbuf_append_printf(buf, "EWAPI const Efl_Class *%s(void);\n", gname);
227 cnamel, _cl_type_str_get(cl, EINA_FALSE)); 210 eina_stringshare_del(gname);
228 } 211 }
229 212
230 /* method section */ 213 /* method section */
@@ -312,5 +295,4 @@ events:
312 295
313 free(cname); 296 free(cname);
314 free(cnameu); 297 free(cnameu);
315 free(cnamel);
316} 298}