summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-02-20 16:46:23 +0200
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-03-03 14:09:57 +0200
commit210051ebb375ac0629ebf97cfba7b3e4d056583a (patch)
tree59c9b35e1c40bb8fedf171228c9a4dbde4e9d95f /src/bin
parent10d7bffc4a7566aeb9600bbd317c2ce54ea99d06 (diff)
Eolian/Generator: fix data type for implement function
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian/eo1_generator.c21
-rw-r--r--src/bin/eolian/eo1_generator.h3
-rw-r--r--src/bin/eolian/legacy_generator.c6
3 files changed, 17 insertions, 13 deletions
diff --git a/src/bin/eolian/eo1_generator.c b/src/bin/eolian/eo1_generator.c
index a02cfaede5..ab5f80b066 100644
--- a/src/bin/eolian/eo1_generator.c
+++ b/src/bin/eolian/eo1_generator.c
@@ -109,7 +109,7 @@ tmpl_eo_pardesc[] =" * @param[%s] %s\n";
109static const char 109static const char
110tmpl_eobind_body[] ="\ 110tmpl_eobind_body[] ="\
111\n\ 111\n\
112@#ret_type _@#class_@#func(Eo *obj, @#Class_Data *pd@#full_params);\n\n\ 112@#ret_type _@#class_@#func(Eo *obj, @#Datatype_Data *pd@#full_params);\n\n\
113static void\n\ 113static void\n\
114_eo_obj_@#class_@#func(Eo *obj, void *_pd, va_list *list@#list_unused)\n\ 114_eo_obj_@#class_@#func(Eo *obj, void *_pd, va_list *list@#list_unused)\n\
115{\n\ 115{\n\
@@ -307,7 +307,7 @@ _varg_upgr(const char *stype)
307} 307}
308 308
309Eina_Bool 309Eina_Bool
310eo1_bind_func_generate(const char *classname, Eolian_Function funcid, Eolian_Function_Type ftype, Eina_Strbuf *buf) 310eo1_bind_func_generate(const char *classname, Eolian_Function funcid, Eolian_Function_Type ftype, Eina_Strbuf *buf, const char *impl_name)
311{ 311{
312 const char *suffix = ""; 312 const char *suffix = "";
313 const char *umpr = NULL; 313 const char *umpr = NULL;
@@ -349,7 +349,9 @@ eo1_bind_func_generate(const char *classname, Eolian_Function funcid, Eolian_Fun
349 349
350 char tmpstr[0xFF]; 350 char tmpstr[0xFF];
351 sprintf (tmpstr, "%s%s", eolian_function_name_get(funcid), suffix); 351 sprintf (tmpstr, "%s%s", eolian_function_name_get(funcid), suffix);
352 _template_fill(fbody, tmpl_eobind_body, classname, tmpstr, EINA_FALSE); 352 char tmpstr2[0xFF];
353 sprintf (tmpstr2, "%s_%s", classname, impl_name);
354 _template_fill(fbody, tmpl_eobind_body, impl_name?tmpstr2:classname, tmpstr, EINA_FALSE);
353 355
354 const Eina_List *l; 356 const Eina_List *l;
355 void *data; 357 void *data;
@@ -420,6 +422,7 @@ eo1_bind_func_generate(const char *classname, Eolian_Function funcid, Eolian_Fun
420 eina_strbuf_replace_all(fbody, "@#list_vars", eina_strbuf_string_get(va_args)); 422 eina_strbuf_replace_all(fbody, "@#list_vars", eina_strbuf_string_get(va_args));
421 eina_strbuf_replace_all(fbody, "@#full_params", eina_strbuf_string_get(full_params)); 423 eina_strbuf_replace_all(fbody, "@#full_params", eina_strbuf_string_get(full_params));
422 eina_strbuf_replace_all(fbody, "@#list_params", eina_strbuf_string_get(params)); 424 eina_strbuf_replace_all(fbody, "@#list_params", eina_strbuf_string_get(params));
425 eina_strbuf_replace_all(fbody, "@#Datatype", classname);
423 eina_strbuf_append(buf, eina_strbuf_string_get(fbody)); 426 eina_strbuf_append(buf, eina_strbuf_string_get(fbody));
424 427
425 eina_strbuf_free(va_args); 428 eina_strbuf_free(va_args);
@@ -546,14 +549,14 @@ eo1_source_end_generate(const char *classname, Eina_Strbuf *buf)
546 if (ctor_fn) 549 if (ctor_fn)
547 { 550 {
548 _template_fill(str_func, tmpl_eobase_func_desc, classname, "constructor", EINA_FALSE); 551 _template_fill(str_func, tmpl_eobase_func_desc, classname, "constructor", EINA_FALSE);
549 eo1_bind_func_generate(classname, ctor_fn, UNRESOLVED, str_bodyf); 552 eo1_bind_func_generate(classname, ctor_fn, UNRESOLVED, str_bodyf, NULL);
550 } 553 }
551 // default destructor 554 // default destructor
552 Eolian_Function dtor_fn = eolian_class_default_destructor_get(classname); 555 Eolian_Function dtor_fn = eolian_class_default_destructor_get(classname);
553 if (dtor_fn) 556 if (dtor_fn)
554 { 557 {
555 _template_fill(str_func, tmpl_eobase_func_desc, classname, "destructor", EINA_FALSE); 558 _template_fill(str_func, tmpl_eobase_func_desc, classname, "destructor", EINA_FALSE);
556 eo1_bind_func_generate(classname, dtor_fn, UNRESOLVED, str_bodyf); 559 eo1_bind_func_generate(classname, dtor_fn, UNRESOLVED, str_bodyf, NULL);
557 } 560 }
558 561
559 //Implements - TODO one generate func def for all 562 //Implements - TODO one generate func def for all
@@ -597,7 +600,7 @@ eo1_source_end_generate(const char *classname, Eina_Strbuf *buf)
597 if (in_meth) 600 if (in_meth)
598 { 601 {
599 _template_fill(str_func, tmpl_impl_str, impl_class, funcname, EINA_FALSE); 602 _template_fill(str_func, tmpl_impl_str, impl_class, funcname, EINA_FALSE);
600 eo1_bind_func_generate(implname, in_meth, UNRESOLVED, str_bodyf); 603 eo1_bind_func_generate(classname, in_meth, UNRESOLVED, str_bodyf, impl_class);
601 } 604 }
602 605
603 if (in_prop) 606 if (in_prop)
@@ -613,14 +616,14 @@ eo1_source_end_generate(const char *classname, Eina_Strbuf *buf)
613 { 616 {
614 sprintf(tmpstr, "%s_get", funcname); 617 sprintf(tmpstr, "%s_get", funcname);
615 _template_fill(str_func, tmpl_impl_str, impl_class, tmpstr, EINA_FALSE); 618 _template_fill(str_func, tmpl_impl_str, impl_class, tmpstr, EINA_FALSE);
616 eo1_bind_func_generate(implname, in_prop, GET, str_bodyf); 619 eo1_bind_func_generate(classname, in_prop, GET, str_bodyf, impl_class);
617 } 620 }
618 621
619 if (prop_write) 622 if (prop_write)
620 { 623 {
621 sprintf(tmpstr, "%s_set", funcname); 624 sprintf(tmpstr, "%s_set", funcname);
622 _template_fill(str_func, tmpl_impl_str, impl_class, tmpstr, EINA_FALSE); 625 _template_fill(str_func, tmpl_impl_str, impl_class, tmpstr, EINA_FALSE);
623 eo1_bind_func_generate(implname, in_prop, SET, str_bodyf); 626 eo1_bind_func_generate(classname, in_prop, SET, str_bodyf, impl_class);
624 } 627 }
625 } 628 }
626 eina_strbuf_free(tmpl_impl); 629 eina_strbuf_free(tmpl_impl);
@@ -639,7 +642,7 @@ eo1_source_end_generate(const char *classname, Eina_Strbuf *buf)
639 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf)); 642 eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf));
640 643
641 _template_fill(str_func, tmpl_eo_func_desc, classname, funcname, EINA_FALSE); 644 _template_fill(str_func, tmpl_eo_func_desc, classname, funcname, EINA_FALSE);
642 eo1_bind_func_generate(classname, fn, UNRESOLVED, str_bodyf); 645 eo1_bind_func_generate(classname, fn, UNRESOLVED, str_bodyf, NULL);
643 } 646 }
644 647
645 //Properties 648 //Properties
diff --git a/src/bin/eolian/eo1_generator.h b/src/bin/eolian/eo1_generator.h
index 8363529401..5db237b2bf 100644
--- a/src/bin/eolian/eo1_generator.h
+++ b/src/bin/eolian/eo1_generator.h
@@ -41,13 +41,14 @@ eo1_source_end_generate(const char *classname, Eina_Strbuf *buf);
41 * @param[in] classname class name 41 * @param[in] classname class name
42 * @param[in] funcid Function Id 42 * @param[in] funcid Function Id
43 * @param[in] ftype type of the function (SET/GET/METHOD...) 43 * @param[in] ftype type of the function (SET/GET/METHOD...)
44 * @param[in] impl_name name to append in case of implement.
44 * @param[inout] buf buffer to fill 45 * @param[inout] buf buffer to fill
45 * 46 *
46 * @return EINA_TRUE on success, EINA_FALSE on error. 47 * @return EINA_TRUE on success, EINA_FALSE on error.
47 * 48 *
48 */ 49 */
49Eina_Bool 50Eina_Bool
50eo1_bind_func_generate(const char *classname, Eolian_Function funcid, Eolian_Function_Type ftype, Eina_Strbuf *buf); 51eo1_bind_func_generate(const char *classname, Eolian_Function funcid, Eolian_Function_Type ftype, Eina_Strbuf *buf, const char *impl_name);
51 52
52/* 53/*
53 * @brief Generate the header code for a specific Eo class. 54 * @brief Generate the header code for a specific Eo class.
diff --git a/src/bin/eolian/legacy_generator.c b/src/bin/eolian/legacy_generator.c
index f028f915f7..783c2d3963 100644
--- a/src/bin/eolian/legacy_generator.c
+++ b/src/bin/eolian/legacy_generator.c
@@ -421,12 +421,12 @@ legacy_source_generate(const char *classname, Eina_Bool legacy, int eo_version,
421 421
422 if (prop_read) 422 if (prop_read)
423 { 423 {
424 if (!eo1_bind_func_generate(classname, fn, GET, str_bodyf)) return EINA_FALSE; 424 if (!eo1_bind_func_generate(classname, fn, GET, str_bodyf, NULL)) return EINA_FALSE;
425 if (legacy) _eapi_func_generate(classname, fn, GET, str_bodyf); 425 if (legacy) _eapi_func_generate(classname, fn, GET, str_bodyf);
426 } 426 }
427 if (prop_write) 427 if (prop_write)
428 { 428 {
429 if (!eo1_bind_func_generate(classname, fn, SET, str_bodyf)) return EINA_FALSE; 429 if (!eo1_bind_func_generate(classname, fn, SET, str_bodyf, NULL)) return EINA_FALSE;
430 if (legacy) _eapi_func_generate(classname, fn, SET, str_bodyf); 430 if (legacy) _eapi_func_generate(classname, fn, SET, str_bodyf);
431 } 431 }
432 } 432 }
@@ -434,7 +434,7 @@ legacy_source_generate(const char *classname, Eina_Bool legacy, int eo_version,
434 //Methods 434 //Methods
435 EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, METHOD_FUNC), itr, fn) 435 EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, METHOD_FUNC), itr, fn)
436 { 436 {
437 if (!eo1_bind_func_generate(classname, fn, UNRESOLVED, str_bodyf)) return EINA_FALSE; 437 if (!eo1_bind_func_generate(classname, fn, UNRESOLVED, str_bodyf, NULL)) return EINA_FALSE;
438 if (legacy) _eapi_func_generate(classname, fn, UNRESOLVED, str_bodyf); 438 if (legacy) _eapi_func_generate(classname, fn, UNRESOLVED, str_bodyf);
439 } 439 }
440 440