diff --git a/src/bin/eolian/common_funcs.c b/src/bin/eolian/common_funcs.c index da6123ce3c..da770f4d8d 100644 --- a/src/bin/eolian/common_funcs.c +++ b/src/bin/eolian/common_funcs.c @@ -19,6 +19,34 @@ _class_name_concatenate(const Eolian_Class class, char *buffer) sprintf(buffer, "%s", eolian_class_name_get(class)); } +void +_class_env_create(const Eolian_Class class, const char *over_classname, _eolian_class_vars *env) +{ + if (!env || !class) return; + + const char *eo_prefix = NULL; + char *p; + + if (!class) + strncpy(env->full_classname, over_classname, PATH_MAX - 1); + else + _class_name_concatenate(class, env->full_classname); + + /* class/CLASS*/ + p = strncpy(env->upper_classname, env->full_classname, PATH_MAX - 1); + eina_str_toupper(&p); + p = strncpy(env->lower_classname, env->full_classname, PATH_MAX - 1); + eina_str_tolower(&p); + + /* eo_prefix */ + if (class) eo_prefix = eolian_class_eo_prefix_get(class); + if (!eo_prefix) eo_prefix = env->full_classname; + p = strncpy(env->upper_eo_prefix, eo_prefix, PATH_MAX - 1); + eina_str_toupper(&p); + p = strncpy(env->lower_eo_prefix, eo_prefix, PATH_MAX - 1); + eina_str_tolower(&p); +} + void _class_func_names_fill(const Eolian_Class class, const char *over_classname, const char *funcname) { diff --git a/src/bin/eolian/common_funcs.h b/src/bin/eolian/common_funcs.h index 03cce704a6..6b8d5046b4 100644 --- a/src/bin/eolian/common_funcs.h +++ b/src/bin/eolian/common_funcs.h @@ -33,6 +33,17 @@ extern int _eolian_gen_log_dom; #endif #define CRIT(...) EINA_LOG_DOM_CRIT(_eolian_gen_log_dom, __VA_ARGS__) +typedef struct +{ + char full_classname[PATH_MAX]; + + char upper_eo_prefix[PATH_MAX]; + char lower_eo_prefix[PATH_MAX]; + + char upper_classname[PATH_MAX]; + char lower_classname[PATH_MAX]; +}_eolian_class_vars; + void _template_fill(Eina_Strbuf *buf, const char *templ, const Eolian_Class class, const char *classname, const char *funcname, Eina_Bool reset); char *_nextline(char *str, unsigned int lines); @@ -41,6 +52,8 @@ char *_startline(char *str, char *pos); char *_source_desc_get(const char *str); +void _class_env_create(const Eolian_Class class, const char *over_classname, _eolian_class_vars *env); + void _class_func_names_fill(const Eolian_Class class, const char *classname, const char *funcname); char current_eo_prefix_lower[256]; @@ -49,10 +62,8 @@ char current_eo_prefix_upper[256]; char current_classname[256]; -char capobjclass[0xFF]; -char lowobjclass[0xFF]; char capclass[0xFF]; char lowclass[0xFF]; -char normclass[0xFF]; + char capfunc[0xFF]; #endif