From 912409df3cee321a354d8de6cef95ed3d4e77a54 Mon Sep 17 00:00:00 2001 From: Daniel Zaoui Date: Sun, 6 Apr 2014 16:41:45 +0300 Subject: [PATCH] Eolian: rename enums. Add the EOLIAN namespace to the function types. --- src/bin/eolian/eo1_generator.c | 114 ++++++++++++++--------------- src/bin/eolian/legacy_generator.c | 54 +++++++------- src/lib/eolian/Eolian.h | 19 +++-- src/lib/eolian/eo_lexer.c | 30 ++++---- src/lib/eolian/eo_lexer.rl | 30 ++++---- src/lib/eolian/eolian_database.c | 118 +++++++++++++++--------------- 6 files changed, 182 insertions(+), 183 deletions(-) diff --git a/src/bin/eolian/eo1_generator.c b/src/bin/eolian/eo1_generator.c index 52a4ef7fa8..0a9aeb9c97 100644 --- a/src/bin/eolian/eo1_generator.c +++ b/src/bin/eolian/eo1_generator.c @@ -140,8 +140,8 @@ eo1_fundef_generate(const char *classname, Eolian_Function func, Eolian_Function char *tmpstr = malloc(0x1FF); char *fsuffix = ""; - if (ftype == GET) fsuffix = "_get"; - if (ftype == SET) fsuffix = "_set"; + if (ftype == EOLIAN_PROP_GET) fsuffix = "_get"; + if (ftype == EOLIAN_PROP_SET) fsuffix = "_set"; sprintf (funcname, "%s%s", eolian_function_name_get(func), fsuffix); sprintf (descname, "comment%s", fsuffix); @@ -196,13 +196,13 @@ eo1_fundef_generate(const char *classname, Eolian_Function func, Eolian_Function Eina_Bool add_star = EINA_FALSE; Eolian_Parameter_Dir pdir; eolian_parameter_information_get((Eolian_Function_Parameter)data, &pdir, &ptype, &pname, &pdesc); - Eina_Bool is_const = eolian_parameter_const_attribute_get(data, ftype == GET); - if (ftype == GET) { + Eina_Bool is_const = eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET); + if (ftype == EOLIAN_PROP_GET) { add_star = EINA_TRUE; pdir = EOLIAN_OUT_PARAM; } - if (ftype == SET) pdir = EOLIAN_IN_PARAM; - if (ftype == UNRESOLVED || ftype == METHOD_FUNC) add_star = (pdir == EOLIAN_OUT_PARAM); + if (ftype == EOLIAN_PROP_SET) pdir = EOLIAN_IN_PARAM; + if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM); Eina_Bool had_star = !!strchr(ptype, '*'); const char *dir_str = str_dir[(int)pdir]; @@ -246,7 +246,7 @@ eo1_fundef_generate(const char *classname, Eolian_Function func, Eolian_Function Eina_Bool eo1_header_generate(const char *classname, Eina_Strbuf *buf) { - const Eolian_Function_Type ftype_order[] = {CONSTRUCTOR, PROPERTY_FUNC, METHOD_FUNC}; + const Eolian_Function_Type ftype_order[] = {EOLIAN_CTOR, EOLIAN_PROPERTY, EOLIAN_METHOD}; const Eina_List *l; void *data; char *tmpstr = malloc(0x1FF); @@ -259,10 +259,10 @@ eo1_header_generate(const char *classname, Eina_Strbuf *buf) return EINA_FALSE; } - if (eolian_class_functions_list_get(classname, CONSTRUCTOR) || - eolian_class_functions_list_get(classname, DESTRUCTOR) || - eolian_class_functions_list_get(classname, PROPERTY_FUNC) || - eolian_class_functions_list_get(classname, METHOD_FUNC)) + if (eolian_class_functions_list_get(classname, EOLIAN_CTOR) || + eolian_class_functions_list_get(classname, EOLIAN_DTOR) || + eolian_class_functions_list_get(classname, EOLIAN_PROPERTY) || + eolian_class_functions_list_get(classname, EOLIAN_METHOD)) { no_ids = EINA_FALSE; } @@ -308,25 +308,25 @@ eo1_header_generate(const char *classname, Eina_Strbuf *buf) { const Eolian_Function_Type ftype = eolian_function_type_get((Eolian_Function)data); const char *funcname = eolian_function_name_get((Eolian_Function)data); - Eina_Bool prop_read = (ftype == PROPERTY_FUNC || ftype == GET ) ? EINA_TRUE : EINA_FALSE ; - Eina_Bool prop_write = (ftype == PROPERTY_FUNC || ftype == SET ) ? EINA_TRUE : EINA_FALSE ; + Eina_Bool prop_read = (ftype == EOLIAN_PROPERTY || ftype == EOLIAN_PROP_GET ) ? EINA_TRUE : EINA_FALSE ; + Eina_Bool prop_write = (ftype == EOLIAN_PROPERTY || ftype == EOLIAN_PROP_SET ) ? EINA_TRUE : EINA_FALSE ; if (!prop_read && !prop_write) { _template_fill(str_subid, tmpl_eo_subid, classname, funcname, EINA_FALSE); - eo1_fundef_generate(classname, (Eolian_Function)data, UNRESOLVED, str_hdr); + eo1_fundef_generate(classname, (Eolian_Function)data, EOLIAN_UNRESOLVED, str_hdr); } if (prop_write) { sprintf(tmpstr, "%s_set", funcname); _template_fill(str_subid, tmpl_eo_subid, classname, tmpstr, EINA_FALSE); - eo1_fundef_generate(classname, (Eolian_Function)data, SET, str_hdr); + eo1_fundef_generate(classname, (Eolian_Function)data, EOLIAN_PROP_SET, str_hdr); } if (prop_read) { sprintf(tmpstr, "%s_get", funcname); _template_fill(str_subid, tmpl_eo_subid, classname, tmpstr, EINA_FALSE); - eo1_fundef_generate(classname, (Eolian_Function)data, GET, str_hdr); + eo1_fundef_generate(classname, (Eolian_Function)data, EOLIAN_PROP_GET, str_hdr); } eina_strbuf_replace_all(str_subid, "@#EOPREFIX", current_eo_prefix_upper); } @@ -378,7 +378,7 @@ eo1_bind_func_generate(const char *classname, Eolian_Function funcid, Eolian_Fun rettype = eolian_function_return_type_get(funcid, ftype); if (rettype && !strcmp(rettype, "void")) rettype = NULL; retname = "ret"; - if (ftype == GET) + if (ftype == EOLIAN_PROP_GET) { suffix = "_get"; add_star = EINA_TRUE; @@ -394,7 +394,7 @@ eo1_bind_func_generate(const char *classname, Eolian_Function funcid, Eolian_Fun } } } - if (ftype == SET) + if (ftype == EOLIAN_PROP_SET) { suffix = "_set"; } @@ -413,13 +413,13 @@ eo1_bind_func_generate(const char *classname, Eolian_Function funcid, Eolian_Fun const char *pname; const char *ptype; eolian_parameter_information_get((Eolian_Function_Parameter)data, NULL, &ptype, &pname, NULL); - Eina_Bool is_const = eolian_parameter_const_attribute_get(data, ftype == GET); + Eina_Bool is_const = eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET); eina_strbuf_append_printf(va_args, " %s%s %s = va_arg(*list, %s%s);\n", - ftype == GET && is_const?"const ":"", ptype, pname, - ftype == GET && is_const?"const ":"", _varg_upgr(ptype)); + ftype == EOLIAN_PROP_GET && is_const?"const ":"", ptype, pname, + ftype == EOLIAN_PROP_GET && is_const?"const ":"", _varg_upgr(ptype)); eina_strbuf_append_printf(params, ", %s", pname); eina_strbuf_append_printf(full_params, ", %s%s %s", - ftype == GET && eolian_parameter_const_attribute_get(data, ftype == GET)?"const ":"", + ftype == EOLIAN_PROP_GET && eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET)?"const ":"", ptype, pname); } if (!var_as_ret) @@ -430,9 +430,9 @@ eo1_bind_func_generate(const char *classname, Eolian_Function funcid, Eolian_Fun const char *ptype; Eolian_Parameter_Dir pdir; eolian_parameter_information_get((Eolian_Function_Parameter)data, &pdir, &ptype, &pname, NULL); - Eina_Bool is_const = eolian_parameter_const_attribute_get(data, ftype == GET); + Eina_Bool is_const = eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET); Eina_Bool had_star = !!strchr(ptype, '*'); - if (ftype == UNRESOLVED || ftype == METHOD_FUNC) add_star = (pdir == EOLIAN_OUT_PARAM); + if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM); eina_strbuf_append_printf(va_args, " %s%s%s%s%s = va_arg(*list, %s%s%s%s);\n", is_const?"const ":"", ptype, had_star?"":" ", add_star?"*":"", pname, is_const?"const ":"", add_star ? ptype : _varg_upgr(ptype), !had_star && add_star?" ":"", add_star?"*":""); @@ -536,10 +536,10 @@ eo1_source_beginning_generate(const char *classname, Eina_Strbuf *buf) Eina_Strbuf *tmpbuf = eina_strbuf_new(); Eina_Strbuf *str_ev = eina_strbuf_new(); - if (eolian_class_functions_list_get(classname, CONSTRUCTOR) || - eolian_class_functions_list_get(classname, DESTRUCTOR) || - eolian_class_functions_list_get(classname, PROPERTY_FUNC) || - eolian_class_functions_list_get(classname, METHOD_FUNC)) + if (eolian_class_functions_list_get(classname, EOLIAN_CTOR) || + eolian_class_functions_list_get(classname, EOLIAN_DTOR) || + eolian_class_functions_list_get(classname, EOLIAN_PROPERTY) || + eolian_class_functions_list_get(classname, EOLIAN_METHOD)) { _template_fill(NULL, NULL, classname, NULL, EINA_TRUE); eina_strbuf_append_printf(buf, "EAPI Eo_Op @#EOPREFIX_BASE_ID = EO_NOOP;\n"); @@ -644,14 +644,14 @@ eo1_source_end_generate(const char *classname, Eina_Strbuf *buf) if (ctor_fn) { _template_fill(str_func, tmpl_eobase_func_desc, classname, "constructor", EINA_FALSE); - eo1_bind_func_generate(classname, ctor_fn, UNRESOLVED, str_bodyf, NULL); + eo1_bind_func_generate(classname, ctor_fn, EOLIAN_UNRESOLVED, str_bodyf, NULL); } // default destructor Eolian_Function dtor_fn = eolian_class_default_destructor_get(classname); if (dtor_fn) { _template_fill(str_func, tmpl_eobase_func_desc, classname, "destructor", EINA_FALSE); - eo1_bind_func_generate(classname, dtor_fn, UNRESOLVED, str_bodyf, NULL); + eo1_bind_func_generate(classname, dtor_fn, EOLIAN_UNRESOLVED, str_bodyf, NULL); } //Implements - TODO one generate func def for all @@ -681,11 +681,11 @@ eo1_source_end_generate(const char *classname, Eina_Strbuf *buf) Eolian_Function in_prop = NULL; const Eina_List *itr2; Eolian_Function fnid; - EINA_LIST_FOREACH(eolian_class_functions_list_get((char *)impl_class, CONSTRUCTOR), itr2, fnid) + EINA_LIST_FOREACH(eolian_class_functions_list_get((char *)impl_class, EOLIAN_CTOR), itr2, fnid) if (fnid && !strcmp(eolian_function_name_get(fnid), funcname)) in_meth = fnid; - EINA_LIST_FOREACH(eolian_class_functions_list_get((char *)impl_class, METHOD_FUNC), itr2, fnid) + EINA_LIST_FOREACH(eolian_class_functions_list_get((char *)impl_class, EOLIAN_METHOD), itr2, fnid) if (fnid && !strcmp(eolian_function_name_get(fnid), funcname)) in_meth = fnid; - EINA_LIST_FOREACH(eolian_class_functions_list_get((char *)impl_class, PROPERTY_FUNC), itr2, fnid) + EINA_LIST_FOREACH(eolian_class_functions_list_get((char *)impl_class, EOLIAN_PROPERTY), itr2, fnid) if (fnid && !strcmp(eolian_function_name_get(fnid), funcname)) in_prop = fnid; if (!in_meth && !in_prop) @@ -694,15 +694,15 @@ eo1_source_end_generate(const char *classname, Eina_Strbuf *buf) goto end; } - /* e.g event_freeze can be a property or a method. If a type is explicit (property SET/GET), + /* e.g event_freeze can be a property or a method. If a type is explicit (property EOLIAN_PROP_SET/EOLIAN_PROP_GET), * we assume it can't be a method. */ - if ((in_meth && in_prop) && (ftype == SET || ftype == GET)) in_meth = NULL; + if ((in_meth && in_prop) && (ftype == EOLIAN_PROP_SET || ftype == EOLIAN_PROP_GET)) in_meth = NULL; if (in_meth) { _template_fill(str_func, tmpl_impl_str, impl_class, funcname, EINA_FALSE); - eo1_bind_func_generate(classname, in_meth, UNRESOLVED, str_bodyf, impl_class); + eo1_bind_func_generate(classname, in_meth, EOLIAN_UNRESOLVED, str_bodyf, impl_class); continue; } @@ -710,29 +710,29 @@ eo1_source_end_generate(const char *classname, Eina_Strbuf *buf) { char tmpstr[0xFF]; - if ((ftype != GET) && (ftype != SET)) ftype = eolian_function_type_get(in_prop); + if ((ftype != EOLIAN_PROP_GET) && (ftype != EOLIAN_PROP_SET)) ftype = eolian_function_type_get(in_prop); - Eina_Bool prop_read = ( ftype == SET ) ? EINA_FALSE : EINA_TRUE; - Eina_Bool prop_write = ( ftype == GET ) ? EINA_FALSE : EINA_TRUE; + Eina_Bool prop_read = ( ftype == EOLIAN_PROP_SET ) ? EINA_FALSE : EINA_TRUE; + Eina_Bool prop_write = ( ftype == EOLIAN_PROP_GET ) ? EINA_FALSE : EINA_TRUE; if (prop_write) { sprintf(tmpstr, "%s_set", funcname); _template_fill(str_func, tmpl_impl_str, impl_class, tmpstr, EINA_FALSE); - eo1_bind_func_generate(classname, in_prop, SET, str_bodyf, impl_class); + eo1_bind_func_generate(classname, in_prop, EOLIAN_PROP_SET, str_bodyf, impl_class); } if (prop_read) { sprintf(tmpstr, "%s_get", funcname); _template_fill(str_func, tmpl_impl_str, impl_class, tmpstr, EINA_FALSE); - eo1_bind_func_generate(classname, in_prop, GET, str_bodyf, impl_class); + eo1_bind_func_generate(classname, in_prop, EOLIAN_PROP_GET, str_bodyf, impl_class); } } } //Constructors - EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, CONSTRUCTOR), itr, fn) + EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, EOLIAN_CTOR), itr, fn) { const char *funcname = eolian_function_name_get(fn); char *desc = _source_desc_get(eolian_function_description_get(fn, "comment")); @@ -743,18 +743,18 @@ eo1_source_end_generate(const char *classname, Eina_Strbuf *buf) eo1_eo_func_desc_generate(classname, NULL, funcname, tmpbuf); eina_strbuf_append(str_func, eina_strbuf_string_get(tmpbuf)); - eo1_bind_func_generate(classname, fn, UNRESOLVED, str_bodyf, NULL); + eo1_bind_func_generate(classname, fn, EOLIAN_UNRESOLVED, str_bodyf, NULL); } //Properties - EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, PROPERTY_FUNC), itr, fn) + EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, EOLIAN_PROPERTY), itr, fn) { const char *funcname = eolian_function_name_get(fn); const Eolian_Function_Type ftype = eolian_function_type_get(fn); char tmpstr[0xFF]; - Eina_Bool prop_read = ( ftype == SET ) ? EINA_FALSE : EINA_TRUE; - Eina_Bool prop_write = ( ftype == GET ) ? EINA_FALSE : EINA_TRUE; + Eina_Bool prop_read = ( ftype == EOLIAN_PROP_SET ) ? EINA_FALSE : EINA_TRUE; + Eina_Bool prop_write = ( ftype == EOLIAN_PROP_GET ) ? EINA_FALSE : EINA_TRUE; if (prop_write) { @@ -765,7 +765,7 @@ eo1_source_end_generate(const char *classname, Eina_Strbuf *buf) eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf)); free(desc); - if (!eolian_function_is_virtual_pure(fn, SET)) + if (!eolian_function_is_virtual_pure(fn, EOLIAN_PROP_SET)) eo1_eo_func_desc_generate(classname, NULL, tmpstr, tmpbuf); else eina_strbuf_reset(tmpbuf); @@ -780,7 +780,7 @@ eo1_source_end_generate(const char *classname, Eina_Strbuf *buf) free(desc); eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf)); - if (!eolian_function_is_virtual_pure(fn, GET)) + if (!eolian_function_is_virtual_pure(fn, EOLIAN_PROP_GET)) eo1_eo_func_desc_generate(classname, NULL, tmpstr, tmpbuf); else eina_strbuf_reset(tmpbuf); @@ -789,7 +789,7 @@ eo1_source_end_generate(const char *classname, Eina_Strbuf *buf) } //Methods - EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, METHOD_FUNC), itr, fn) + EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, EOLIAN_METHOD), itr, fn) { const char *funcname = eolian_function_name_get(fn); @@ -798,7 +798,7 @@ eo1_source_end_generate(const char *classname, Eina_Strbuf *buf) free(desc); eina_strbuf_append(str_op, eina_strbuf_string_get(tmpbuf)); - if (!eolian_function_is_virtual_pure(fn, METHOD_FUNC)) + if (!eolian_function_is_virtual_pure(fn, EOLIAN_METHOD)) eo1_eo_func_desc_generate(classname, NULL, funcname, tmpbuf); else eina_strbuf_reset(tmpbuf); @@ -909,27 +909,27 @@ eo_source_generate(const char *classname, int eo_version EINA_UNUSED, Eina_Strbu if (!eo1_source_beginning_generate(classname, buf)) goto end; //Properties - EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, PROPERTY_FUNC), itr, fn) + EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, EOLIAN_PROPERTY), itr, fn) { const Eolian_Function_Type ftype = eolian_function_type_get(fn); - Eina_Bool prop_read = ( ftype == SET ) ? EINA_FALSE : EINA_TRUE; - Eina_Bool prop_write = ( ftype == GET ) ? EINA_FALSE : EINA_TRUE; + Eina_Bool prop_read = ( ftype == EOLIAN_PROP_SET ) ? EINA_FALSE : EINA_TRUE; + Eina_Bool prop_write = ( ftype == EOLIAN_PROP_GET ) ? EINA_FALSE : EINA_TRUE; if (prop_write) { - if (!eo1_bind_func_generate(classname, fn, SET, str_bodyf, NULL)) goto end; + if (!eo1_bind_func_generate(classname, fn, EOLIAN_PROP_SET, str_bodyf, NULL)) goto end; } if (prop_read) { - if (!eo1_bind_func_generate(classname, fn, GET, str_bodyf, NULL)) goto end; + if (!eo1_bind_func_generate(classname, fn, EOLIAN_PROP_GET, str_bodyf, NULL)) goto end; } } //Methods - EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, METHOD_FUNC), itr, fn) + EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, EOLIAN_METHOD), itr, fn) { - if (!eo1_bind_func_generate(classname, fn, UNRESOLVED, str_bodyf, NULL)) goto end; + if (!eo1_bind_func_generate(classname, fn, EOLIAN_UNRESOLVED, str_bodyf, NULL)) goto end; } eina_strbuf_append(buf, eina_strbuf_string_get(str_bodyf)); diff --git a/src/bin/eolian/legacy_generator.c b/src/bin/eolian/legacy_generator.c index 8f605f9244..c0c35ae216 100644 --- a/src/bin/eolian/legacy_generator.c +++ b/src/bin/eolian/legacy_generator.c @@ -51,7 +51,7 @@ _eapi_decl_func_generate(const char *classname, Eolian_Function funcid, Eolian_F Eina_Strbuf *descparam = eina_strbuf_new(); rettype = eolian_function_return_type_get(funcid, ftype); - if (ftype == GET) + if (ftype == EOLIAN_PROP_GET) { suffix = "_get"; add_star = EINA_TRUE; @@ -68,7 +68,7 @@ _eapi_decl_func_generate(const char *classname, Eolian_Function funcid, Eolian_F } } - if (ftype == SET) + if (ftype == EOLIAN_PROP_SET) { suffix = "_set"; func_lpref = eolian_function_data_get(funcid, EOLIAN_LEGACY_SET); @@ -118,7 +118,7 @@ _eapi_decl_func_generate(const char *classname, Eolian_Function funcid, Eolian_F eolian_parameter_information_get((Eolian_Function_Parameter)data, NULL, &ptype, &pname, &pdesc); leg_param_idx++; eina_strbuf_append_printf(fparam, ", %s%s %s", - eolian_parameter_const_attribute_get(data, ftype == GET)?"const":"", + eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET)?"const":"", ptype, pname); eina_strbuf_append_printf(descparam, " * @param[in] %s %s\n", pname, pdesc?pdesc:"No description supplied."); if (eolian_parameter_is_nonull((Eolian_Function_Parameter)data)) @@ -143,12 +143,12 @@ _eapi_decl_func_generate(const char *classname, Eolian_Function funcid, Eolian_F const char *str_dir[] = {"in", "out", "inout"}; eolian_parameter_information_get((Eolian_Function_Parameter)data, &pdir, &ptype, &pname, &pdesc); Eina_Bool had_star = !!strchr(ptype, '*'); - if (ftype == UNRESOLVED || ftype == METHOD_FUNC) add_star = (pdir == EOLIAN_OUT_PARAM); - if (ftype == GET) pdir = EOLIAN_OUT_PARAM; - if (ftype == SET) pdir = EOLIAN_IN_PARAM; + if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM); + if (ftype == EOLIAN_PROP_GET) pdir = EOLIAN_OUT_PARAM; + if (ftype == EOLIAN_PROP_SET) pdir = EOLIAN_IN_PARAM; leg_param_idx++; eina_strbuf_append_printf(fparam, ", %s%s%s%s%s", - eolian_parameter_const_attribute_get(data, ftype == GET)?"const":"", + eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET)?"const":"", ptype, had_star?"":" ", add_star?"*":"", pname); const char *dir_str = str_dir[(int)pdir]; eina_strbuf_append_printf(descparam, " * @param[%s] %s %s\n", dir_str, pname, pdesc?pdesc:"No description supplied."); @@ -173,7 +173,7 @@ _eapi_decl_func_generate(const char *classname, Eolian_Function funcid, Eolian_F rettype ? rettype : "void", rettype && strchr(rettype, '*')?"":" "); eina_strbuf_replace_all(fbody, "@#type_return", eina_strbuf_string_get(fparam)); - eina_strbuf_replace_all(fbody, "@#is_const", (ftype == GET || eolian_function_object_is_const(funcid)) ? "const " : ""); + eina_strbuf_replace_all(fbody, "@#is_const", (ftype == EOLIAN_PROP_GET || eolian_function_object_is_const(funcid)) ? "const " : ""); if (eolian_function_return_is_warn_unused(funcid, ftype)) { Eina_Bool no_nonull = !flags; @@ -213,7 +213,7 @@ _eapi_func_generate(const char *classname, Eolian_Function funcid, Eolian_Functi rettype = eolian_function_return_type_get(funcid, ftype); if (rettype && !strcmp(rettype, "void")) ret_is_void = EINA_TRUE; retname = "ret"; - if (ftype == GET) + if (ftype == EOLIAN_PROP_GET) { suffix = "_get"; add_star = EINA_TRUE; @@ -230,7 +230,7 @@ _eapi_func_generate(const char *classname, Eolian_Function funcid, Eolian_Functi } } } - if (ftype == SET) + if (ftype == EOLIAN_PROP_SET) { suffix = "_set"; func_lpref = eolian_function_data_get(funcid, EOLIAN_LEGACY_SET); @@ -273,7 +273,7 @@ _eapi_func_generate(const char *classname, Eolian_Function funcid, Eolian_Functi const char *ptype; eolian_parameter_information_get((Eolian_Function_Parameter)data, NULL, &ptype, &pname, NULL); eina_strbuf_append_printf(fparam, ", %s%s %s", - eolian_parameter_const_attribute_get(data, ftype == GET)?"const ":"", + eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET)?"const ":"", ptype, pname); if (eina_strbuf_length_get(eoparam)) eina_strbuf_append(eoparam, ", "); eina_strbuf_append_printf(eoparam, "%s", pname); @@ -287,9 +287,9 @@ _eapi_func_generate(const char *classname, Eolian_Function funcid, Eolian_Functi Eolian_Parameter_Dir pdir; eolian_parameter_information_get((Eolian_Function_Parameter)data, &pdir, &ptype, &pname, NULL); Eina_Bool had_star = !!strchr(ptype, '*'); - if (ftype == UNRESOLVED || ftype == METHOD_FUNC) add_star = (pdir == EOLIAN_OUT_PARAM); + if (ftype == EOLIAN_UNRESOLVED || ftype == EOLIAN_METHOD) add_star = (pdir == EOLIAN_OUT_PARAM); eina_strbuf_append_printf(fparam, ", %s%s%s%s%s", - eolian_parameter_const_attribute_get(data, ftype == GET)?"const ":"", + eolian_parameter_const_attribute_get(data, ftype == EOLIAN_PROP_GET)?"const ":"", ptype, had_star?"":" ", add_star?"*":"", pname); if (eina_strbuf_length_get(eoparam)) eina_strbuf_append(eoparam, ", "); eina_strbuf_append_printf(eoparam, "%s", pname); @@ -315,7 +315,7 @@ _eapi_func_generate(const char *classname, Eolian_Function funcid, Eolian_Functi eina_strbuf_replace_all(fbody, "@#ret_type", tmp_ret_str); eina_strbuf_replace_all(fbody, "@#ret_init_val", tmpstr); eina_strbuf_replace_all(fbody, "@#ret_val", (rettype && !ret_is_void) ? retname : ""); - eina_strbuf_replace_all(fbody, "@#is_const", (ftype == GET || eolian_function_object_is_const(funcid)) ? "const " : ""); + eina_strbuf_replace_all(fbody, "@#is_const", (ftype == EOLIAN_PROP_GET || eolian_function_object_is_const(funcid)) ? "const " : ""); eina_strbuf_append(buf, eina_strbuf_string_get(fbody)); @@ -328,7 +328,7 @@ end: Eina_Bool legacy_header_generate(const char *classname, int eo_version EINA_UNUSED, Eina_Strbuf *buf) { - const Eolian_Function_Type ftype_order[] = {PROPERTY_FUNC, METHOD_FUNC}; + const Eolian_Function_Type ftype_order[] = {EOLIAN_PROPERTY, EOLIAN_METHOD}; const Eina_List *l; void *data; @@ -343,20 +343,20 @@ legacy_header_generate(const char *classname, int eo_version EINA_UNUSED, Eina_S EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, ftype_order[i]), l, data) { const Eolian_Function_Type ftype = eolian_function_type_get((Eolian_Function)data); - Eina_Bool prop_read = (ftype == PROPERTY_FUNC || ftype == GET ) ? EINA_TRUE : EINA_FALSE ; - Eina_Bool prop_write = (ftype == PROPERTY_FUNC || ftype == SET ) ? EINA_TRUE : EINA_FALSE ; + Eina_Bool prop_read = (ftype == EOLIAN_PROPERTY || ftype == EOLIAN_PROP_GET ) ? EINA_TRUE : EINA_FALSE ; + Eina_Bool prop_write = (ftype == EOLIAN_PROPERTY || ftype == EOLIAN_PROP_SET ) ? EINA_TRUE : EINA_FALSE ; if (!prop_read && !prop_write) { - _eapi_decl_func_generate(classname, (Eolian_Function)data, METHOD_FUNC, buf); + _eapi_decl_func_generate(classname, (Eolian_Function)data, EOLIAN_METHOD, buf); } if (prop_write) { - _eapi_decl_func_generate(classname, (Eolian_Function)data, SET, buf); + _eapi_decl_func_generate(classname, (Eolian_Function)data, EOLIAN_PROP_SET, buf); } if (prop_read) { - _eapi_decl_func_generate(classname, (Eolian_Function)data, GET, buf); + _eapi_decl_func_generate(classname, (Eolian_Function)data, EOLIAN_PROP_GET, buf); } } return EINA_TRUE; @@ -379,27 +379,27 @@ legacy_source_generate(const char *classname, int eo_version EINA_UNUSED, Eina_S Eina_Strbuf *str_bodyf = eina_strbuf_new(); //Properties - EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, PROPERTY_FUNC), itr, fn) + EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, EOLIAN_PROPERTY), itr, fn) { const Eolian_Function_Type ftype = eolian_function_type_get(fn); - Eina_Bool prop_read = ( ftype == SET ) ? EINA_FALSE : EINA_TRUE; - Eina_Bool prop_write = ( ftype == GET ) ? EINA_FALSE : EINA_TRUE; + Eina_Bool prop_read = ( ftype == EOLIAN_PROP_SET ) ? EINA_FALSE : EINA_TRUE; + Eina_Bool prop_write = ( ftype == EOLIAN_PROP_GET ) ? EINA_FALSE : EINA_TRUE; if (prop_write) { - _eapi_func_generate(classname, fn, SET, str_bodyf); + _eapi_func_generate(classname, fn, EOLIAN_PROP_SET, str_bodyf); } if (prop_read) { - _eapi_func_generate(classname, fn, GET, str_bodyf); + _eapi_func_generate(classname, fn, EOLIAN_PROP_GET, str_bodyf); } } //Methods - EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, METHOD_FUNC), itr, fn) + EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, EOLIAN_METHOD), itr, fn) { - _eapi_func_generate(classname, fn, UNRESOLVED, str_bodyf); + _eapi_func_generate(classname, fn, EOLIAN_UNRESOLVED, str_bodyf); } eina_strbuf_append(buf, eina_strbuf_string_get(str_bodyf)); diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h index a909f479cf..49749a8d0e 100644 --- a/src/lib/eolian/Eolian.h +++ b/src/lib/eolian/Eolian.h @@ -89,16 +89,15 @@ typedef struct _Event_Desc* Eolian_Event; typedef enum { - UNRESOLVED, - PROPERTY_FUNC, - // FIXME: bs - SET, - GET, - METHOD_FUNC, - CONSTRUCTOR, - DFLT_CONSTRUCTOR, - DESTRUCTOR, - DFLT_DESTRUCTOR + EOLIAN_UNRESOLVED, + EOLIAN_PROPERTY, + EOLIAN_PROP_SET, + EOLIAN_PROP_GET, + EOLIAN_METHOD, + EOLIAN_CTOR, + EOLIAN_DTOR, + EOLIAN_DFLT_CTOR, + EOLIAN_DFLT_DTOR } Eolian_Function_Type; typedef enum diff --git a/src/lib/eolian/eo_lexer.c b/src/lib/eolian/eo_lexer.c index aa1ea91441..2b407bb570 100644 --- a/src/lib/eolian/eo_lexer.c +++ b/src/lib/eolian/eo_lexer.c @@ -4367,7 +4367,7 @@ eo_tokenizer_database_fill(const char *filename) } EINA_LIST_FOREACH(kls->constructors, l, meth) { - Eolian_Function foo_id = database_function_new(meth->name, CONSTRUCTOR); + Eolian_Function foo_id = database_function_new(meth->name, EOLIAN_CTOR); database_class_function_add(kls->name, foo_id); if (meth->ret) database_function_description_set(foo_id, EOLIAN_RETURN_COMMENT, meth->ret->comment); database_function_data_set(foo_id, EOLIAN_LEGACY, meth->legacy); @@ -4379,7 +4379,7 @@ eo_tokenizer_database_fill(const char *filename) EINA_LIST_FOREACH(kls->destructors, l, meth) { - Eolian_Function foo_id = database_function_new(meth->name, DESTRUCTOR); + Eolian_Function foo_id = database_function_new(meth->name, EOLIAN_DTOR); database_class_function_add(kls->name, foo_id); if (meth->ret) database_function_description_set(foo_id, EOLIAN_RETURN_COMMENT, meth->ret->comment); database_function_data_set(foo_id, EOLIAN_LEGACY, meth->legacy); @@ -4391,7 +4391,7 @@ eo_tokenizer_database_fill(const char *filename) EINA_LIST_FOREACH(kls->properties, l, prop) { - Eolian_Function foo_id = database_function_new(prop->name, UNRESOLVED); + Eolian_Function foo_id = database_function_new(prop->name, EOLIAN_UNRESOLVED); EINA_LIST_FOREACH(prop->keys, m, param) { Eolian_Function_Parameter p = database_property_key_add( @@ -4408,20 +4408,20 @@ eo_tokenizer_database_fill(const char *filename) } EINA_LIST_FOREACH(prop->accessors, m, accessor) { - database_function_type_set(foo_id, (accessor->type == SETTER?SET:GET)); + database_function_type_set(foo_id, (accessor->type == SETTER?EOLIAN_PROP_SET:EOLIAN_PROP_GET)); if (accessor->ret && accessor->ret->type) { database_function_return_type_set(foo_id, - accessor->type == SETTER?SET:GET, accessor->ret->type); + accessor->type == SETTER?EOLIAN_PROP_SET:EOLIAN_PROP_GET, accessor->ret->type); database_function_data_set(foo_id, (accessor->type == SETTER?EOLIAN_PROP_SET_RETURN_COMMENT:EOLIAN_PROP_GET_RETURN_COMMENT), accessor->ret->comment); database_function_return_flag_set_as_warn_unused(foo_id, - accessor->type == SETTER?SET:GET, accessor->ret->warn_unused); + accessor->type == SETTER?EOLIAN_PROP_SET:EOLIAN_PROP_GET, accessor->ret->warn_unused); database_function_return_flag_set_own(foo_id, - accessor->type == SETTER?SET:GET, accessor->ret->own); + accessor->type == SETTER?EOLIAN_PROP_SET:EOLIAN_PROP_GET, accessor->ret->own); database_function_return_dflt_val_set(foo_id, - accessor->type == SETTER?SET:GET, accessor->ret->dflt_ret_val); + accessor->type == SETTER?EOLIAN_PROP_SET:EOLIAN_PROP_GET, accessor->ret->dflt_ret_val); } if (accessor->legacy) { @@ -4453,17 +4453,17 @@ eo_tokenizer_database_fill(const char *filename) EINA_LIST_FOREACH(kls->methods, l, meth) { - Eolian_Function foo_id = database_function_new(meth->name, METHOD_FUNC); + Eolian_Function foo_id = database_function_new(meth->name, EOLIAN_METHOD); database_class_function_add(kls->name, foo_id); if (meth->ret) { database_function_data_set(foo_id, EOLIAN_METHOD_RETURN_TYPE, meth->ret->type); database_function_description_set(foo_id, EOLIAN_RETURN_COMMENT, meth->ret->comment); database_function_return_flag_set_as_warn_unused(foo_id, - METHOD_FUNC, meth->ret->warn_unused); - database_function_return_flag_set_own(foo_id, METHOD_FUNC, meth->ret->own); + EOLIAN_METHOD, meth->ret->warn_unused); + database_function_return_flag_set_own(foo_id, EOLIAN_METHOD, meth->ret->own); database_function_return_dflt_val_set(foo_id, - METHOD_FUNC, meth->ret->dflt_ret_val); + EOLIAN_METHOD, meth->ret->dflt_ret_val); } database_function_description_set(foo_id, EOLIAN_COMMENT, meth->comment); database_function_data_set(foo_id, EOLIAN_LEGACY, meth->legacy); @@ -4495,13 +4495,13 @@ eo_tokenizer_database_fill(const char *filename) char *func = strstr(class, "::"); if (func) *func = '\0'; func += 2; - Eolian_Function_Type ftype = UNRESOLVED; + Eolian_Function_Type ftype = EOLIAN_UNRESOLVED; char *type_as_str = strstr(func, "::"); if (type_as_str) { *type_as_str = '\0'; - if (!strcmp(type_as_str+2, "set")) ftype = SET; - else if (!strcmp(type_as_str+2, "get")) ftype = GET; + if (!strcmp(type_as_str+2, "set")) ftype = EOLIAN_PROP_SET; + else if (!strcmp(type_as_str+2, "get")) ftype = EOLIAN_PROP_GET; } if (virtual_pure) { diff --git a/src/lib/eolian/eo_lexer.rl b/src/lib/eolian/eo_lexer.rl index 753dc9373a..5a26226891 100644 --- a/src/lib/eolian/eo_lexer.rl +++ b/src/lib/eolian/eo_lexer.rl @@ -1349,7 +1349,7 @@ eo_tokenizer_database_fill(const char *filename) } EINA_LIST_FOREACH(kls->constructors, l, meth) { - Eolian_Function foo_id = database_function_new(meth->name, CONSTRUCTOR); + Eolian_Function foo_id = database_function_new(meth->name, EOLIAN_CTOR); database_class_function_add(kls->name, foo_id); if (meth->ret) database_function_description_set(foo_id, EOLIAN_RETURN_COMMENT, meth->ret->comment); database_function_data_set(foo_id, EOLIAN_LEGACY, meth->legacy); @@ -1361,7 +1361,7 @@ eo_tokenizer_database_fill(const char *filename) EINA_LIST_FOREACH(kls->destructors, l, meth) { - Eolian_Function foo_id = database_function_new(meth->name, DESTRUCTOR); + Eolian_Function foo_id = database_function_new(meth->name, EOLIAN_DTOR); database_class_function_add(kls->name, foo_id); if (meth->ret) database_function_description_set(foo_id, EOLIAN_RETURN_COMMENT, meth->ret->comment); database_function_data_set(foo_id, EOLIAN_LEGACY, meth->legacy); @@ -1373,7 +1373,7 @@ eo_tokenizer_database_fill(const char *filename) EINA_LIST_FOREACH(kls->properties, l, prop) { - Eolian_Function foo_id = database_function_new(prop->name, UNRESOLVED); + Eolian_Function foo_id = database_function_new(prop->name, EOLIAN_UNRESOLVED); EINA_LIST_FOREACH(prop->keys, m, param) { Eolian_Function_Parameter p = database_property_key_add( @@ -1390,20 +1390,20 @@ eo_tokenizer_database_fill(const char *filename) } EINA_LIST_FOREACH(prop->accessors, m, accessor) { - database_function_type_set(foo_id, (accessor->type == SETTER?SET:GET)); + database_function_type_set(foo_id, (accessor->type == SETTER?EOLIAN_PROP_SET:EOLIAN_PROP_GET)); if (accessor->ret && accessor->ret->type) { database_function_return_type_set(foo_id, - accessor->type == SETTER?SET:GET, accessor->ret->type); + accessor->type == SETTER?EOLIAN_PROP_SET:EOLIAN_PROP_GET, accessor->ret->type); database_function_data_set(foo_id, (accessor->type == SETTER?EOLIAN_PROP_SET_RETURN_COMMENT:EOLIAN_PROP_GET_RETURN_COMMENT), accessor->ret->comment); database_function_return_flag_set_as_warn_unused(foo_id, - accessor->type == SETTER?SET:GET, accessor->ret->warn_unused); + accessor->type == SETTER?EOLIAN_PROP_SET:EOLIAN_PROP_GET, accessor->ret->warn_unused); database_function_return_flag_set_own(foo_id, - accessor->type == SETTER?SET:GET, accessor->ret->own); + accessor->type == SETTER?EOLIAN_PROP_SET:EOLIAN_PROP_GET, accessor->ret->own); database_function_return_dflt_val_set(foo_id, - accessor->type == SETTER?SET:GET, accessor->ret->dflt_ret_val); + accessor->type == SETTER?EOLIAN_PROP_SET:EOLIAN_PROP_GET, accessor->ret->dflt_ret_val); } if (accessor->legacy) { @@ -1435,17 +1435,17 @@ eo_tokenizer_database_fill(const char *filename) EINA_LIST_FOREACH(kls->methods, l, meth) { - Eolian_Function foo_id = database_function_new(meth->name, METHOD_FUNC); + Eolian_Function foo_id = database_function_new(meth->name, EOLIAN_METHOD); database_class_function_add(kls->name, foo_id); if (meth->ret) { database_function_data_set(foo_id, EOLIAN_METHOD_RETURN_TYPE, meth->ret->type); database_function_description_set(foo_id, EOLIAN_RETURN_COMMENT, meth->ret->comment); database_function_return_flag_set_as_warn_unused(foo_id, - METHOD_FUNC, meth->ret->warn_unused); - database_function_return_flag_set_own(foo_id, METHOD_FUNC, meth->ret->own); + EOLIAN_METHOD, meth->ret->warn_unused); + database_function_return_flag_set_own(foo_id, EOLIAN_METHOD, meth->ret->own); database_function_return_dflt_val_set(foo_id, - METHOD_FUNC, meth->ret->dflt_ret_val); + EOLIAN_METHOD, meth->ret->dflt_ret_val); } database_function_description_set(foo_id, EOLIAN_COMMENT, meth->comment); database_function_data_set(foo_id, EOLIAN_LEGACY, meth->legacy); @@ -1477,13 +1477,13 @@ eo_tokenizer_database_fill(const char *filename) char *func = strstr(class, "::"); if (func) *func = '\0'; func += 2; - Eolian_Function_Type ftype = UNRESOLVED; + Eolian_Function_Type ftype = EOLIAN_UNRESOLVED; char *type_as_str = strstr(func, "::"); if (type_as_str) { *type_as_str = '\0'; - if (!strcmp(type_as_str+2, "set")) ftype = SET; - else if (!strcmp(type_as_str+2, "get")) ftype = GET; + if (!strcmp(type_as_str+2, "set")) ftype = EOLIAN_PROP_SET; + else if (!strcmp(type_as_str+2, "get")) ftype = EOLIAN_PROP_GET; } if (virtual_pure) { diff --git a/src/lib/eolian/eolian_database.c b/src/lib/eolian/eolian_database.c index b9fe76a962..392dd65bdb 100644 --- a/src/lib/eolian/eolian_database.c +++ b/src/lib/eolian/eolian_database.c @@ -378,11 +378,11 @@ database_function_type_set(Eolian_Function function_id, Eolian_Function_Type foo EINA_SAFETY_ON_NULL_RETURN(fid); switch (foo_type) { - case SET: - if (fid->type == GET) foo_type = PROPERTY_FUNC; + case EOLIAN_PROP_SET: + if (fid->type == EOLIAN_PROP_GET) foo_type = EOLIAN_PROPERTY; break; - case GET: - if (fid->type == SET) foo_type = PROPERTY_FUNC; + case EOLIAN_PROP_GET: + if (fid->type == EOLIAN_PROP_SET) foo_type = EOLIAN_PROPERTY; break; default: break; @@ -398,24 +398,24 @@ Eina_Bool database_class_function_add(const char *class_name, Eolian_Function fo _Function_Id *fid = (_Function_Id *) foo_id; switch (fid->type) { - case PROPERTY_FUNC: - case SET: - case GET: + case EOLIAN_PROPERTY: + case EOLIAN_PROP_SET: + case EOLIAN_PROP_GET: desc->properties = eina_list_append(desc->properties, foo_id); break; - case METHOD_FUNC: + case EOLIAN_METHOD: desc->methods = eina_list_append(desc->methods, foo_id); break; - case CONSTRUCTOR: + case EOLIAN_CTOR: desc->constructors = eina_list_append(desc->constructors, foo_id); break; - case DFLT_CONSTRUCTOR: + case EOLIAN_DFLT_CTOR: desc->dflt_ctor = foo_id; break; - case DESTRUCTOR: + case EOLIAN_DTOR: desc->destructors = eina_list_append(desc->destructors, foo_id); break; - case DFLT_DESTRUCTOR: + case EOLIAN_DFLT_DTOR: desc->dflt_dtor = foo_id; break; default: @@ -540,7 +540,7 @@ eolian_class_function_find_by_name(const char *class_name, const char *func_name Class_desc *desc = _class_get(class_name); EINA_SAFETY_ON_NULL_RETURN_VAL(desc, NULL); - if (f_type == UNRESOLVED || f_type == METHOD_FUNC) + if (f_type == EOLIAN_UNRESOLVED || f_type == EOLIAN_METHOD) EINA_LIST_FOREACH(desc->methods, itr, foo_id) { _Function_Id *fid = (_Function_Id *) foo_id; @@ -548,8 +548,8 @@ eolian_class_function_find_by_name(const char *class_name, const char *func_name return foo_id; } - if (f_type == UNRESOLVED || f_type == PROPERTY_FUNC || - f_type == SET || f_type == GET) + if (f_type == EOLIAN_UNRESOLVED || f_type == EOLIAN_PROPERTY || + f_type == EOLIAN_PROP_SET || f_type == EOLIAN_PROP_GET) { EINA_LIST_FOREACH(desc->properties, itr, foo_id) { @@ -559,7 +559,7 @@ eolian_class_function_find_by_name(const char *class_name, const char *func_name } } - if (f_type == CONSTRUCTOR) + if (f_type == EOLIAN_CTOR) { EINA_LIST_FOREACH(desc->constructors, itr, foo_id) { @@ -569,7 +569,7 @@ eolian_class_function_find_by_name(const char *class_name, const char *func_name } } - if (f_type == DESTRUCTOR) + if (f_type == EOLIAN_DTOR) { EINA_LIST_FOREACH(desc->destructors, itr, foo_id) { @@ -589,13 +589,13 @@ eolian_class_functions_list_get(const char *class_name, Eolian_Function_Type foo EINA_SAFETY_ON_NULL_RETURN_VAL(desc, NULL); switch (foo_type) { - case PROPERTY_FUNC: + case EOLIAN_PROPERTY: return desc->properties; - case METHOD_FUNC: + case EOLIAN_METHOD: return desc->methods; - case CONSTRUCTOR: + case EOLIAN_CTOR: return desc->constructors; - case DESTRUCTOR: + case EOLIAN_DTOR: return desc->destructors; default: return NULL; } @@ -621,7 +621,7 @@ EAPI Eolian_Function_Type eolian_function_type_get(Eolian_Function function_id) { _Function_Id *fid = (_Function_Id *)function_id; - EINA_SAFETY_ON_NULL_RETURN_VAL(fid, UNRESOLVED); + EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EOLIAN_UNRESOLVED); return fid->type; } @@ -640,8 +640,8 @@ database_function_set_as_virtual_pure(Eolian_Function function_id, Eolian_Functi EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE); switch (ftype) { - case UNRESOLVED: case METHOD_FUNC: case GET: fid->get_virtual_pure = EINA_TRUE; break; - case SET: fid->set_virtual_pure = EINA_TRUE; break; + case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROP_GET: fid->get_virtual_pure = EINA_TRUE; break; + case EOLIAN_PROP_SET: fid->set_virtual_pure = EINA_TRUE; break; default: return EINA_FALSE; } return EINA_TRUE; @@ -654,8 +654,8 @@ eolian_function_is_virtual_pure(Eolian_Function function_id, Eolian_Function_Typ EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE); switch (ftype) { - case UNRESOLVED: case METHOD_FUNC: case GET: return fid->get_virtual_pure; break; - case SET: return fid->set_virtual_pure; break; + case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROP_GET: return fid->get_virtual_pure; break; + case EOLIAN_PROP_SET: return fid->set_virtual_pure; break; default: return EINA_FALSE; } } @@ -850,9 +850,9 @@ void database_function_return_type_set(Eolian_Function foo_id, Eolian_Function_T const char *key = NULL; switch (ftype) { - case SET: key = EOLIAN_PROP_SET_RETURN_TYPE; break; - case GET: key = EOLIAN_PROP_GET_RETURN_TYPE; break; - case METHOD_FUNC: key = EOLIAN_METHOD_RETURN_TYPE; break; + case EOLIAN_PROP_SET: key = EOLIAN_PROP_SET_RETURN_TYPE; break; + case EOLIAN_PROP_GET: key = EOLIAN_PROP_GET_RETURN_TYPE; break; + case EOLIAN_METHOD: key = EOLIAN_METHOD_RETURN_TYPE; break; default: return; } database_function_data_set(foo_id, key, ret_type); @@ -864,9 +864,9 @@ eolian_function_return_type_get(Eolian_Function foo_id, Eolian_Function_Type fty const char *key = NULL; switch (ftype) { - case SET: key = EOLIAN_PROP_SET_RETURN_TYPE; break; - case GET: key = EOLIAN_PROP_GET_RETURN_TYPE; break; - case UNRESOLVED: case METHOD_FUNC: key = EOLIAN_METHOD_RETURN_TYPE; break; + case EOLIAN_PROP_SET: key = EOLIAN_PROP_SET_RETURN_TYPE; break; + case EOLIAN_PROP_GET: key = EOLIAN_PROP_GET_RETURN_TYPE; break; + case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: key = EOLIAN_METHOD_RETURN_TYPE; break; default: return NULL; } return eolian_function_data_get(foo_id, key); @@ -877,9 +877,9 @@ void database_function_return_dflt_val_set(Eolian_Function foo_id, Eolian_Functi const char *key = NULL; switch (ftype) { - case SET: key = PROP_SET_RETURN_DFLT_VAL; break; - case GET: key = PROP_GET_RETURN_DFLT_VAL; break; - case METHOD_FUNC: key = METHOD_RETURN_DFLT_VAL; break; + case EOLIAN_PROP_SET: key = PROP_SET_RETURN_DFLT_VAL; break; + case EOLIAN_PROP_GET: key = PROP_GET_RETURN_DFLT_VAL; break; + case EOLIAN_METHOD: key = METHOD_RETURN_DFLT_VAL; break; default: return; } database_function_data_set(foo_id, key, ret_dflt_value); @@ -891,9 +891,9 @@ eolian_function_return_dflt_value_get(Eolian_Function foo_id, Eolian_Function_Ty const char *key = NULL; switch (ftype) { - case SET: key = PROP_SET_RETURN_DFLT_VAL; break; - case GET: key = PROP_GET_RETURN_DFLT_VAL; break; - case UNRESOLVED: case METHOD_FUNC: key = METHOD_RETURN_DFLT_VAL; break; + case EOLIAN_PROP_SET: key = PROP_SET_RETURN_DFLT_VAL; break; + case EOLIAN_PROP_GET: key = PROP_GET_RETURN_DFLT_VAL; break; + case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: key = METHOD_RETURN_DFLT_VAL; break; default: return NULL; } return eolian_function_data_get(foo_id, key); @@ -905,9 +905,9 @@ eolian_function_return_comment_get(Eolian_Function foo_id, Eolian_Function_Type const char *key = NULL; switch (ftype) { - case SET: key = EOLIAN_PROP_SET_RETURN_COMMENT; break; - case GET: key = EOLIAN_PROP_GET_RETURN_COMMENT; break; - case UNRESOLVED: case METHOD_FUNC: key = EOLIAN_RETURN_COMMENT; break; + case EOLIAN_PROP_SET: key = EOLIAN_PROP_SET_RETURN_COMMENT; break; + case EOLIAN_PROP_GET: key = EOLIAN_PROP_GET_RETURN_COMMENT; break; + case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: key = EOLIAN_RETURN_COMMENT; break; default: return NULL; } return eolian_function_data_get(foo_id, key); @@ -920,8 +920,8 @@ void database_function_return_flag_set_as_warn_unused(Eolian_Function foo_id, EINA_SAFETY_ON_NULL_RETURN(fid); switch (ftype) { - case METHOD_FUNC: case GET: fid->get_return_warn_unused = warn_unused; break; - case SET: fid->set_return_warn_unused = warn_unused; break; + case EOLIAN_METHOD: case EOLIAN_PROP_GET: fid->get_return_warn_unused = warn_unused; break; + case EOLIAN_PROP_SET: fid->set_return_warn_unused = warn_unused; break; default: return; } } @@ -934,8 +934,8 @@ eolian_function_return_is_warn_unused(Eolian_Function foo_id, EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE); switch (ftype) { - case METHOD_FUNC: case GET: return fid->get_return_warn_unused; - case SET: return fid->set_return_warn_unused; + case EOLIAN_METHOD: case EOLIAN_PROP_GET: return fid->get_return_warn_unused; + case EOLIAN_PROP_SET: return fid->set_return_warn_unused; default: return EINA_FALSE; } } @@ -947,8 +947,8 @@ void database_function_return_flag_set_own(Eolian_Function foo_id, EINA_SAFETY_ON_NULL_RETURN(fid); switch (ftype) { - case METHOD_FUNC: case GET: fid->get_return_own = own; break; - case SET: fid->set_return_own = own; break; + case EOLIAN_METHOD: case EOLIAN_PROP_GET: fid->get_return_own = own; break; + case EOLIAN_PROP_SET: fid->set_return_own = own; break; default: return; } } @@ -961,8 +961,8 @@ eolian_function_return_own_get(Eolian_Function foo_id, EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE); switch (ftype) { - case METHOD_FUNC: case GET: return fid->get_return_own; - case SET: return fid->set_return_own; + case EOLIAN_METHOD: case EOLIAN_PROP_GET: return fid->get_return_own; + case EOLIAN_PROP_SET: return fid->set_return_own; default: return EINA_FALSE; } } @@ -1075,10 +1075,10 @@ _implements_print(Eolian_Implement impl, int nb_spaces) eolian_implement_information_get(impl, &cl, &fn, &ft); switch (ft) { - case SET: t = "SET"; break; - case GET: t = "GET"; break; - case METHOD_FUNC: t = "METHOD"; break; - case UNRESOLVED: + case EOLIAN_PROP_SET: t = "SET"; break; + case EOLIAN_PROP_GET: t = "GET"; break; + case EOLIAN_METHOD: t = "METHOD"; break; + case EOLIAN_UNRESOLVED: { t = "Type is the same as function being overriden"; break; @@ -1128,7 +1128,7 @@ static Eina_Bool _function_print(const _Function_Id *fid, int nb_spaces) const char *ret_desc = eolian_function_description_get(foo_id, EOLIAN_RETURN_COMMENT); switch (fid->type) { - case PROPERTY_FUNC: + case EOLIAN_PROPERTY: { printf("%*s<%s> %s\n", nb_spaces, "", ret_desc ? ret_desc : "", fid->name); const char *str = eolian_function_description_get(foo_id, EOLIAN_COMMENT_GET); @@ -1145,7 +1145,7 @@ static Eina_Bool _function_print(const _Function_Id *fid, int nb_spaces) if (str) printf("%*sreturn type for set: <%s>\n", nb_spaces + 5, "", str); break; } - case GET: + case EOLIAN_PROP_GET: { printf("%*sGET:<%s> %s\n", nb_spaces, "", ret_desc ? ret_desc : "", fid->name); const char *str = eolian_function_description_get(foo_id, EOLIAN_COMMENT_GET); @@ -1156,7 +1156,7 @@ static Eina_Bool _function_print(const _Function_Id *fid, int nb_spaces) if (str) printf("%*sreturn type: <%s>\n", nb_spaces + 5, "", str); break; } - case SET: + case EOLIAN_PROP_SET: { printf("%*sSET:<%s> %s\n", nb_spaces, "", ret_desc ? ret_desc : "", fid->name); const char *str = eolian_function_description_get(foo_id, EOLIAN_COMMENT_SET); @@ -1167,7 +1167,7 @@ static Eina_Bool _function_print(const _Function_Id *fid, int nb_spaces) if (str) printf("%*sreturn type: <%s>\n", nb_spaces + 5, "", str); break; } - case METHOD_FUNC: + case EOLIAN_METHOD: { printf("%*s<%s> %s\n", nb_spaces, "", ret_desc ? ret_desc : "", fid->name); const char *str = eolian_function_description_get(foo_id, EOLIAN_COMMENT); @@ -1179,8 +1179,8 @@ static Eina_Bool _function_print(const _Function_Id *fid, int nb_spaces) if (fid->obj_is_const) printf("%*sobj const: \n", nb_spaces + 5, ""); break; } - case CONSTRUCTOR: - case DESTRUCTOR: + case EOLIAN_CTOR: + case EOLIAN_DTOR: { //char *str = eina_hash_find(fid->data, "comment"); const char *str = eolian_function_description_get(foo_id, EOLIAN_COMMENT);