forked from enlightenment/efl
eolian: remove the need to pass prefix to eolian_function_full_c_name_get
This commit is contained in:
parent
13a9650491
commit
8631212e45
|
@ -98,12 +98,9 @@ _class_func_env_create(const Eolian_Class *class, const char *funcname, Eolian_F
|
|||
p = strncpy(env->upper_func, funcname, PATH_MAX - 1);
|
||||
eina_str_toupper(&p);
|
||||
|
||||
ret = eolian_function_full_c_name_get(funcid, tmp_env.upper_eo_prefix);
|
||||
ret = eolian_function_full_c_name_get(funcid);
|
||||
sprintf(p = env->upper_eo_func, "%s%s", ret, suffix);
|
||||
eina_str_toupper(&p);
|
||||
eina_stringshare_del(ret);
|
||||
|
||||
ret = eolian_function_full_c_name_get(funcid, tmp_env.lower_eo_prefix);
|
||||
sprintf(p = env->lower_eo_func, "%s%s", ret, suffix);
|
||||
eina_str_tolower(&p);
|
||||
eina_stringshare_del(ret);
|
||||
|
|
|
@ -807,7 +807,7 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
|
|||
goto end;
|
||||
}
|
||||
|
||||
rets = eolian_function_full_c_name_get(fnid, impl_env.lower_eo_prefix);
|
||||
rets = eolian_function_full_c_name_get(fnid);
|
||||
|
||||
const char *class_str = "";
|
||||
if (eolian_function_is_class(fnid)) class_str = "CLASS_";
|
||||
|
|
|
@ -728,7 +728,7 @@ EAPI Eolian_Object_Scope eolian_function_scope_get(const Eolian_Function *functi
|
|||
EAPI Eina_Stringshare *eolian_function_name_get(const Eolian_Function *function_id);
|
||||
|
||||
/*
|
||||
* @brief Returns the full C name of a function (with prefix).
|
||||
* @brief Returns the full C name of a function.
|
||||
*
|
||||
* @param[in] function_id Id of the function
|
||||
* @return the function name
|
||||
|
@ -740,7 +740,7 @@ EAPI Eina_Stringshare *eolian_function_name_get(const Eolian_Function *function_
|
|||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI Eina_Stringshare *eolian_function_full_c_name_get(const Eolian_Function *function_id, const char *prefix);
|
||||
EAPI Eina_Stringshare *eolian_function_full_c_name_get(const Eolian_Function *function_id);
|
||||
|
||||
/*
|
||||
* @brief Get a function in a class by its name and type
|
||||
|
|
|
@ -26,9 +26,23 @@ eolian_function_name_get(const Eolian_Function *fid)
|
|||
return fid->name;
|
||||
}
|
||||
|
||||
EAPI Eina_Stringshare *
|
||||
eolian_function_full_c_name_get(const Eolian_Function *foo_id, const char *prefix)
|
||||
static const char *
|
||||
get_eo_prefix(const Eolian_Function *foo_id, char *buf)
|
||||
{
|
||||
char *tmp = buf;
|
||||
if (foo_id->klass->eo_prefix)
|
||||
return foo_id->klass->eo_prefix;
|
||||
strcpy(buf, foo_id->klass->full_name);
|
||||
eina_str_tolower(&buf);
|
||||
while ((tmp = strchr(tmp, '.'))) *tmp = '_';
|
||||
return buf;
|
||||
}
|
||||
|
||||
EAPI Eina_Stringshare *
|
||||
eolian_function_full_c_name_get(const Eolian_Function *foo_id)
|
||||
{
|
||||
char tbuf[512];
|
||||
const char *prefix = get_eo_prefix(foo_id, tbuf);
|
||||
const char *funcn = eolian_function_name_get(foo_id);
|
||||
const char *last_p = strrchr(prefix, '_');
|
||||
const char *func_p = strchr(funcn, '_');
|
||||
|
|
|
@ -1329,6 +1329,7 @@ parse_property(Eo_Lexer *ls)
|
|||
has_keys = EINA_FALSE, has_values = EINA_FALSE,
|
||||
has_protected = EINA_FALSE, has_class = EINA_FALSE;
|
||||
prop = calloc(1, sizeof(Eolian_Function));
|
||||
prop->klass = ls->tmp.kls;
|
||||
prop->type = EOLIAN_UNRESOLVED;
|
||||
prop->base.file = eina_stringshare_ref(ls->filename);
|
||||
prop->base.line = ls->line_number;
|
||||
|
@ -1399,6 +1400,7 @@ parse_method(Eo_Lexer *ls, Eina_Bool ctor)
|
|||
has_protected = EINA_FALSE, has_class = EINA_FALSE,
|
||||
has_eo = EINA_FALSE;
|
||||
meth = calloc(1, sizeof(Eolian_Function));
|
||||
meth->klass = ls->tmp.kls;
|
||||
meth->type = EOLIAN_METHOD;
|
||||
meth->base.file = eina_stringshare_ref(ls->filename);
|
||||
meth->base.line = ls->line_number;
|
||||
|
|
|
@ -118,6 +118,7 @@ struct _Eolian_Function
|
|||
Eina_Bool set_only_legacy: 1;
|
||||
Eina_Bool is_class :1;
|
||||
Eina_List *ctor_of;
|
||||
Eolian_Class *klass;
|
||||
};
|
||||
|
||||
struct _Eolian_Function_Parameter
|
||||
|
|
Loading…
Reference in New Issue