summaryrefslogtreecommitdiff
path: root/src/bin/eolian/eo_generator.c
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-06-08 09:24:43 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-06-08 12:40:42 +0300
commitfc2a983ab9a1637c390690419aace83a246c9274 (patch)
treea8b5eb4954ef8c2d9114ae1ecd7582eb2177ba01 /src/bin/eolian/eo_generator.c
parentd56359c74b5b165ed3d9e9c91063cb73d5ca829d (diff)
Eolian/Generator: remove unused code.
The removed code was needed for Eo1 and is no more necessary.
Diffstat (limited to '')
-rw-r--r--src/bin/eolian/eo_generator.c68
1 files changed, 2 insertions, 66 deletions
diff --git a/src/bin/eolian/eo_generator.c b/src/bin/eolian/eo_generator.c
index d2c5480393..da4cb356d0 100644
--- a/src/bin/eolian/eo_generator.c
+++ b/src/bin/eolian/eo_generator.c
@@ -52,9 +52,6 @@ EO_DEFINE_CLASS(@#class_class_get, &_@#class_class_desc, @#list_inheritNULL);\
52"; 52";
53 53
54static const char 54static const char
55tmpl_eo_op_desc[] = "\n EO_OP_FUNC(@#eoprefix_@#func, _@#class_@#func, \"@#desc\"),";
56
57static const char
58tmpl_eo_obj_header[] = "\ 55tmpl_eo_obj_header[] = "\
59#define @#CLASS_CLASS @#class_class_get()\n\ 56#define @#CLASS_CLASS @#class_class_get()\n\
60\n\ 57\n\
@@ -63,12 +60,6 @@ const Eo_Class *@#class_class_get(void) EINA_CONST;\n\
63"; 60";
64 61
65static const char 62static const char
66tmpl_eo_subid[] = "\n @#EOPREFIX_SUB_ID_@#FUNC,";
67
68static const char
69tmpl_eo_subid_apnd[] = " @#EOPREFIX_SUB_ID_@#FUNC,\n";
70
71static const char
72tmpl_eo_funcdef_doxygen[] = "\ 63tmpl_eo_funcdef_doxygen[] = "\
73/**\n\ 64/**\n\
74 * @def @#eoprefix_@#func\n\ 65 * @def @#eoprefix_@#func\n\
@@ -261,7 +252,6 @@ eo_header_generate(const Eolian_Class class, Eina_Strbuf *buf)
261 eina_strbuf_replace_all(str_hdr, "@#EOPREFIX", class_env.upper_eo_prefix); 252 eina_strbuf_replace_all(str_hdr, "@#EOPREFIX", class_env.upper_eo_prefix);
262 eina_strbuf_replace_all(str_hdr, "@#eoprefix", class_env.lower_eo_prefix); 253 eina_strbuf_replace_all(str_hdr, "@#eoprefix", class_env.lower_eo_prefix);
263 254
264 Eina_Strbuf *str_subid = eina_strbuf_new();
265 Eina_Strbuf *str_ev = eina_strbuf_new(); 255 Eina_Strbuf *str_ev = eina_strbuf_new();
266 Eina_Strbuf *str_extrn_ev = eina_strbuf_new(); 256 Eina_Strbuf *str_extrn_ev = eina_strbuf_new();
267 Eina_Strbuf *tmpbuf = eina_strbuf_new(); 257 Eina_Strbuf *tmpbuf = eina_strbuf_new();
@@ -292,38 +282,29 @@ eo_header_generate(const Eolian_Class class, Eina_Strbuf *buf)
292 EINA_LIST_FOREACH(eolian_class_functions_list_get(class, ftype_order[i]), l, data) 282 EINA_LIST_FOREACH(eolian_class_functions_list_get(class, ftype_order[i]), l, data)
293 { 283 {
294 const Eolian_Function_Type ftype = eolian_function_type_get((Eolian_Function)data); 284 const Eolian_Function_Type ftype = eolian_function_type_get((Eolian_Function)data);
295 const char *funcname = eolian_function_name_get((Eolian_Function)data);
296 Eina_Bool prop_read = (ftype == EOLIAN_PROPERTY || ftype == EOLIAN_PROP_GET ) ? EINA_TRUE : EINA_FALSE ; 285 Eina_Bool prop_read = (ftype == EOLIAN_PROPERTY || ftype == EOLIAN_PROP_GET ) ? EINA_TRUE : EINA_FALSE ;
297 Eina_Bool prop_write = (ftype == EOLIAN_PROPERTY || ftype == EOLIAN_PROP_SET ) ? EINA_TRUE : EINA_FALSE ; 286 Eina_Bool prop_write = (ftype == EOLIAN_PROPERTY || ftype == EOLIAN_PROP_SET ) ? EINA_TRUE : EINA_FALSE ;
298 287
299 if (!prop_read && !prop_write) 288 if (!prop_read && !prop_write)
300 { 289 {
301 _template_fill(str_subid, tmpl_eo_subid, class, NULL, funcname, EINA_FALSE);
302 eo_fundef_generate(class, (Eolian_Function)data, EOLIAN_UNRESOLVED, str_hdr); 290 eo_fundef_generate(class, (Eolian_Function)data, EOLIAN_UNRESOLVED, str_hdr);
303 } 291 }
304 if (prop_write) 292 if (prop_write)
305 { 293 {
306 sprintf(tmpstr, "%s_set", funcname);
307 _template_fill(str_subid, tmpl_eo_subid, class, NULL, tmpstr, EINA_FALSE);
308 eo_fundef_generate(class, (Eolian_Function)data, EOLIAN_PROP_SET, str_hdr); 294 eo_fundef_generate(class, (Eolian_Function)data, EOLIAN_PROP_SET, str_hdr);
309 } 295 }
310 if (prop_read) 296 if (prop_read)
311 { 297 {
312 sprintf(tmpstr, "%s_get", funcname);
313 _template_fill(str_subid, tmpl_eo_subid, class, NULL, tmpstr, EINA_FALSE);
314 eo_fundef_generate(class, (Eolian_Function)data, EOLIAN_PROP_GET, str_hdr); 298 eo_fundef_generate(class, (Eolian_Function)data, EOLIAN_PROP_GET, str_hdr);
315 } 299 }
316 eina_strbuf_replace_all(str_subid, "@#EOPREFIX", class_env.upper_eo_prefix);
317 } 300 }
318 301
319 eina_strbuf_replace_all(str_hdr, "@#list_subid", eina_strbuf_string_get(str_subid));
320 eina_strbuf_append(str_hdr, eina_strbuf_string_get(str_extrn_ev)); 302 eina_strbuf_append(str_hdr, eina_strbuf_string_get(str_extrn_ev));
321 eina_strbuf_append(str_hdr, eina_strbuf_string_get(str_ev)); 303 eina_strbuf_append(str_hdr, eina_strbuf_string_get(str_ev));
322 304
323 eina_strbuf_append(buf, eina_strbuf_string_get(str_hdr)); 305 eina_strbuf_append(buf, eina_strbuf_string_get(str_hdr));
324 306
325 free(tmpstr); 307 free(tmpstr);
326 eina_strbuf_free(str_subid);
327 eina_strbuf_free(str_ev); 308 eina_strbuf_free(str_ev);
328 eina_strbuf_free(str_extrn_ev); 309 eina_strbuf_free(str_extrn_ev);
329 eina_strbuf_free(tmpbuf); 310 eina_strbuf_free(tmpbuf);
@@ -479,23 +460,6 @@ eo_bind_func_generate(const Eolian_Class class, Eolian_Function funcid, Eolian_F
479} 460}
480 461
481static Eina_Bool 462static Eina_Bool
482eo_func_desc_generate(const Eolian_Class class, const char *impl_name, const char *func_name, Eina_Strbuf *buf)
483{
484 if (impl_name)
485 _class_func_names_fill(NULL, impl_name, func_name);
486 else
487 _class_func_names_fill(class, NULL, func_name);
488
489 eina_strbuf_reset(buf);
490 eina_strbuf_append_printf(buf,
491 "\n EO_OP_FUNC(%s_ID(%s_SUB_ID_%s), _eo_obj_%s%s%s_%s),",
492 class_env.upper_eo_prefix, class_env.upper_eo_prefix, capfunc,
493 class_env.lower_classname, impl_name?"_":"", impl_name?impl_name:"",
494 func_name);
495 return EINA_TRUE;
496}
497
498static Eina_Bool
499eo_op_desc_generate(const Eolian_Class class, Eolian_Function fid, Eolian_Function_Type ftype, 463eo_op_desc_generate(const Eolian_Class class, Eolian_Function fid, Eolian_Function_Type ftype,
500 const char *desc, Eina_Strbuf *buf) 464 const char *desc, Eina_Strbuf *buf)
501{ 465{
@@ -584,7 +548,6 @@ eo_source_end_generate(const Eolian_Class class, Eina_Strbuf *buf)
584 Eina_Strbuf *str_end = eina_strbuf_new(); 548 Eina_Strbuf *str_end = eina_strbuf_new();
585 Eina_Strbuf *tmpbuf = eina_strbuf_new(); 549 Eina_Strbuf *tmpbuf = eina_strbuf_new();
586 Eina_Strbuf *str_op = eina_strbuf_new(); 550 Eina_Strbuf *str_op = eina_strbuf_new();
587 Eina_Strbuf *str_func = eina_strbuf_new();
588 Eina_Strbuf *str_bodyf = eina_strbuf_new(); 551 Eina_Strbuf *str_bodyf = eina_strbuf_new();
589 Eina_Strbuf *str_ev = eina_strbuf_new(); 552 Eina_Strbuf *str_ev = eina_strbuf_new();
590 553
@@ -676,15 +639,11 @@ eo_source_end_generate(const Eolian_Class class, Eina_Strbuf *buf)
676 //Constructors 639 //Constructors
677 EINA_LIST_FOREACH(eolian_class_functions_list_get(class, EOLIAN_CTOR), itr, fn) 640 EINA_LIST_FOREACH(eolian_class_functions_list_get(class, EOLIAN_CTOR), itr, fn)
678 { 641 {
679 const char *funcname = eolian_function_name_get(fn);
680 char *desc = _source_desc_get(eolian_function_description_get(fn, "comment")); 642 char *desc = _source_desc_get(eolian_function_description_get(fn, "comment"));
681 eo_op_desc_generate(class, fn, EOLIAN_CTOR, desc, tmpbuf); 643 eo_op_desc_generate(class, fn, EOLIAN_CTOR, desc, tmpbuf);
682 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf)); 644 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf));
683 free(desc); 645 free(desc);
684 646
685 eo_func_desc_generate(class, NULL, funcname, tmpbuf);
686 eina_strbuf_append(str_func, eina_strbuf_string_get(tmpbuf));
687
688 eo_bind_func_generate(class, fn, EOLIAN_UNRESOLVED, str_bodyf, NULL); 647 eo_bind_func_generate(class, fn, EOLIAN_UNRESOLVED, str_bodyf, NULL);
689 } 648 }
690 649
@@ -706,12 +665,6 @@ eo_source_end_generate(const Eolian_Class class, Eina_Strbuf *buf)
706 eo_op_desc_generate(class, fn, EOLIAN_PROP_SET, desc, tmpbuf); 665 eo_op_desc_generate(class, fn, EOLIAN_PROP_SET, desc, tmpbuf);
707 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf)); 666 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf));
708 free(desc); 667 free(desc);
709
710 if (!eolian_function_is_virtual_pure(fn, EOLIAN_PROP_SET))
711 eo_func_desc_generate(class, NULL, tmpstr, tmpbuf);
712 else
713 eina_strbuf_reset(tmpbuf);
714 eina_strbuf_append(str_func, eina_strbuf_string_get(tmpbuf));
715 } 668 }
716 if (prop_read) 669 if (prop_read)
717 { 670 {
@@ -719,32 +672,18 @@ eo_source_end_generate(const Eolian_Class class, Eina_Strbuf *buf)
719 672
720 sprintf(tmpstr, "%s_get", funcname); 673 sprintf(tmpstr, "%s_get", funcname);
721 eo_op_desc_generate(class, fn, EOLIAN_PROP_GET, desc, tmpbuf); 674 eo_op_desc_generate(class, fn, EOLIAN_PROP_GET, desc, tmpbuf);
722 free(desc);
723 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf)); 675 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf));
724 676 free(desc);
725 if (!eolian_function_is_virtual_pure(fn, EOLIAN_PROP_GET))
726 eo_func_desc_generate(class, NULL, tmpstr, tmpbuf);
727 else
728 eina_strbuf_reset(tmpbuf);
729 eina_strbuf_append(str_func, eina_strbuf_string_get(tmpbuf));
730 } 677 }
731 } 678 }
732 679
733 //Methods 680 //Methods
734 EINA_LIST_FOREACH(eolian_class_functions_list_get(class, EOLIAN_METHOD), itr, fn) 681 EINA_LIST_FOREACH(eolian_class_functions_list_get(class, EOLIAN_METHOD), itr, fn)
735 { 682 {
736 const char *funcname = eolian_function_name_get(fn);
737
738 char *desc = _source_desc_get(eolian_function_description_get(fn, "comment")); 683 char *desc = _source_desc_get(eolian_function_description_get(fn, "comment"));
739 eo_op_desc_generate(class, fn, EOLIAN_METHOD, desc, tmpbuf); 684 eo_op_desc_generate(class, fn, EOLIAN_METHOD, desc, tmpbuf);
740 free(desc);
741 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf)); 685 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf));
742 686 free(desc);
743 if (!eolian_function_is_virtual_pure(fn, EOLIAN_METHOD))
744 eo_func_desc_generate(class, NULL, funcname, tmpbuf);
745 else
746 eina_strbuf_reset(tmpbuf);
747 eina_strbuf_append(str_func, eina_strbuf_string_get(tmpbuf));
748 } 687 }
749 688
750 Eolian_Event event; 689 Eolian_Event event;
@@ -788,8 +727,6 @@ eo_source_end_generate(const Eolian_Class class, Eina_Strbuf *buf)
788 if (eina_strbuf_length_get(tmpbuf) == 0) eina_strbuf_append(tmpbuf, "NULL, "); 727 if (eina_strbuf_length_get(tmpbuf) == 0) eina_strbuf_append(tmpbuf, "NULL, ");
789 eina_strbuf_replace_all(str_end, "@#list_inherit", eina_strbuf_string_get(tmpbuf)); 728 eina_strbuf_replace_all(str_end, "@#list_inherit", eina_strbuf_string_get(tmpbuf));
790 729
791 eina_strbuf_replace_all(str_end, "@#list_func", eina_strbuf_string_get(str_func));
792
793 eina_strbuf_reset(tmpbuf); 730 eina_strbuf_reset(tmpbuf);
794 if (eina_strbuf_length_get(str_op)) 731 if (eina_strbuf_length_get(str_op))
795 { 732 {
@@ -829,7 +766,6 @@ eo_source_end_generate(const Eolian_Class class, Eina_Strbuf *buf)
829end: 766end:
830 eina_strbuf_free(tmpbuf); 767 eina_strbuf_free(tmpbuf);
831 eina_strbuf_free(str_op); 768 eina_strbuf_free(str_op);
832 eina_strbuf_free(str_func);
833 eina_strbuf_free(str_bodyf); 769 eina_strbuf_free(str_bodyf);
834 eina_strbuf_free(str_end); 770 eina_strbuf_free(str_end);
835 eina_strbuf_free(str_ev); 771 eina_strbuf_free(str_ev);