summaryrefslogtreecommitdiff
path: root/src/bin/eolian/eo1_generator.c
diff options
context:
space:
mode:
authorYossi Kantor <yossi.kantor@samsung.com>2014-03-13 16:40:34 +0200
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-03-16 09:23:49 +0200
commit6862fa801b9b2b40670772351e78a73ac9533c88 (patch)
treed3b379836c9b29a329421cd397733b549e2eb210 /src/bin/eolian/eo1_generator.c
parentf82612e3f260b1ba5bc36292553b1b69b6bb6089 (diff)
Eolian/Generator: Improved event generation
Line breaks in source files and extern definitions of events in header files.
Diffstat (limited to '')
-rw-r--r--src/bin/eolian/eo1_generator.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/bin/eolian/eo1_generator.c b/src/bin/eolian/eo1_generator.c
index a50a8fde29..675ab13444 100644
--- a/src/bin/eolian/eo1_generator.c
+++ b/src/bin/eolian/eo1_generator.c
@@ -83,7 +83,7 @@ enum\n\
83 @#EOPREFIX_SUB_ID_LAST\n\ 83 @#EOPREFIX_SUB_ID_LAST\n\
84};\n\ 84};\n\
85\n\ 85\n\
86#define @#EOPREFIX_ID(sub_id) (@#EOPREFIX_BASE_ID + sub_id)\n\ 86#define @#EOPREFIX_ID(sub_id) (@#EOPREFIX_BASE_ID + sub_id)\n\n\
87"; 87";
88 88
89static const char 89static const char
@@ -264,6 +264,7 @@ eo1_header_generate(const char *classname, Eina_Strbuf *buf)
264 264
265 Eina_Strbuf *str_subid = eina_strbuf_new(); 265 Eina_Strbuf *str_subid = eina_strbuf_new();
266 Eina_Strbuf *str_ev = eina_strbuf_new(); 266 Eina_Strbuf *str_ev = eina_strbuf_new();
267 Eina_Strbuf *str_extrn_ev = eina_strbuf_new();
267 Eina_Strbuf *tmpbuf = eina_strbuf_new(); 268 Eina_Strbuf *tmpbuf = eina_strbuf_new();
268 269
269 Eolian_Event event; 270 Eolian_Event event;
@@ -284,6 +285,7 @@ eo1_header_generate(const char *classname, Eina_Strbuf *buf)
284 eina_strbuf_replace_all(tmpbuf, ",", "_"); 285 eina_strbuf_replace_all(tmpbuf, ",", "_");
285 const char* s = eina_strbuf_string_get(tmpbuf); 286 const char* s = eina_strbuf_string_get(tmpbuf);
286 eina_strbuf_append_printf(str_ev, "#define %s (&(_%s))\n", s, s); 287 eina_strbuf_append_printf(str_ev, "#define %s (&(_%s))\n", s, s);
288 eina_strbuf_append_printf(str_extrn_ev, "EAPI extern const Eo_Event_Description _%s;\n", s);
287 } 289 }
288 290
289 int i; 291 int i;
@@ -316,6 +318,7 @@ eo1_header_generate(const char *classname, Eina_Strbuf *buf)
316 } 318 }
317 319
318 eina_strbuf_replace_all(str_hdr, "@#list_subid", eina_strbuf_string_get(str_subid)); 320 eina_strbuf_replace_all(str_hdr, "@#list_subid", eina_strbuf_string_get(str_subid));
321 eina_strbuf_append(str_hdr, eina_strbuf_string_get(str_extrn_ev));
319 eina_strbuf_append(str_hdr, eina_strbuf_string_get(str_ev)); 322 eina_strbuf_append(str_hdr, eina_strbuf_string_get(str_ev));
320 323
321 eina_strbuf_append(buf, eina_strbuf_string_get(str_hdr)); 324 eina_strbuf_append(buf, eina_strbuf_string_get(str_hdr));
@@ -323,6 +326,7 @@ eo1_header_generate(const char *classname, Eina_Strbuf *buf)
323 free(tmpstr); 326 free(tmpstr);
324 eina_strbuf_free(str_subid); 327 eina_strbuf_free(str_subid);
325 eina_strbuf_free(str_ev); 328 eina_strbuf_free(str_ev);
329 eina_strbuf_free(str_extrn_ev);
326 eina_strbuf_free(tmpbuf); 330 eina_strbuf_free(tmpbuf);
327 eina_strbuf_free(str_hdr); 331 eina_strbuf_free(str_hdr);
328 332
@@ -525,7 +529,7 @@ eo1_source_beginning_generate(const char *classname, Eina_Strbuf *buf)
525 eina_strbuf_replace_all(str_ev, ",", "_"); 529 eina_strbuf_replace_all(str_ev, ",", "_");
526 530
527 eina_strbuf_append_printf(tmpbuf, 531 eina_strbuf_append_printf(tmpbuf,
528 "EAPI const Eo_Event_Description _%s = EO_EVENT_DESCRIPTION(\"%s\", \"%s\");\n", 532 "EAPI const Eo_Event_Description _%s =\n EO_EVENT_DESCRIPTION(\"%s\", \"%s\");\n",
529 eina_strbuf_string_get(str_ev), evname, evdesc_line1); 533 eina_strbuf_string_get(str_ev), evname, evdesc_line1);
530 free(evdesc_line1); 534 free(evdesc_line1);
531 } 535 }