Eolian/Generator: fix for legacy function name overriding.

When legacy is specified in the .eo file, the generator was adding the
property/method name after the legacy name.
So if you have 'legacy evas_object_textblock_clear_all' for clear method,
it was adding the function evas_object_textblock_clear_all_clear.
This commit is contained in:
Daniel Zaoui 2014-03-09 14:07:39 +02:00
parent 4b758f71c1
commit a04e80e7f6
2 changed files with 17 additions and 14 deletions

View File

@ -62,10 +62,10 @@ _template_fill(Eina_Strbuf *buf, const char* templ, const char* classname, const
eina_strbuf_free(classobj);
}
strncpy(capfunc, funcname, sizeof(capfunc) - 1);
if (funcname) strncpy(capfunc, funcname, sizeof(capfunc) - 1);
p = capfunc; eina_str_toupper(&p);
eina_strbuf_replace_all(buf, "@#func", funcname);
if (funcname) eina_strbuf_replace_all(buf, "@#func", funcname);
eina_strbuf_replace_all(buf, "@#FUNC", capfunc);
eina_strbuf_replace_all(buf, "@#Class", classname);
eina_strbuf_replace_all(buf, "@#class", lowclass);

View File

@ -194,6 +194,7 @@ static void
_eapi_func_generate(const char *classname, Eolian_Function funcid, Eolian_Function_Type ftype, Eina_Strbuf *buf)
{
//TODO return value
char tmpstr[0xFF];
const char *suffix = "";
const char *func_lpref = NULL;
Eina_Bool var_as_ret = EINA_FALSE;
@ -202,6 +203,10 @@ _eapi_func_generate(const char *classname, Eolian_Function funcid, Eolian_Functi
Eina_Bool ret_const = EINA_FALSE;
Eina_Bool add_star = EINA_FALSE;
Eina_Strbuf *fbody = eina_strbuf_new();
Eina_Strbuf *fparam = eina_strbuf_new();
Eina_Strbuf *eoparam = eina_strbuf_new();
rettype = eolian_function_return_type_get(funcid, ftype);
if (rettype && !strcmp(rettype, "void")) rettype = NULL;
retname = "ret";
@ -229,24 +234,22 @@ _eapi_func_generate(const char *classname, Eolian_Function funcid, Eolian_Functi
}
func_lpref = (func_lpref) ? func_lpref : eolian_function_data_get(funcid, EOLIAN_LEGACY);
func_lpref = (func_lpref) ? func_lpref : eolian_class_legacy_prefix_get(classname);
_template_fill(fbody, tmpl_eapi_body, classname, NULL, EINA_FALSE);
Eina_Strbuf *fbody = eina_strbuf_new();
Eina_Strbuf *fparam = eina_strbuf_new();
Eina_Strbuf *eoparam = eina_strbuf_new();
char tmpstr[0xFF];
sprintf (tmpstr, "%s%s", eolian_function_name_get(funcid), suffix);
_template_fill(fbody, tmpl_eapi_body, classname, tmpstr, EINA_FALSE);
if (!func_lpref)
if (func_lpref)
eina_strbuf_replace_all(fbody, "@#eapi_prefix_@#func", func_lpref);
else
{
func_lpref = eolian_class_legacy_prefix_get(classname);
eina_strbuf_replace_all(fbody, "@#eapi_prefix", func_lpref);
strncpy(tmpstr, classname, sizeof(tmpstr) - 1);
char *p = tmpstr;
eina_str_tolower(&p);
func_lpref = tmpstr;
}
eina_strbuf_replace_all(fbody, "@#eapi_prefix", func_lpref);
sprintf (tmpstr, "%s%s", eolian_function_name_get(funcid), suffix);
eina_strbuf_replace_all(fbody, "@#func", tmpstr);
const Eina_List *l;
void *data;