diff options
Diffstat (limited to 'src/lib/eolian')
-rw-r--r-- | src/lib/eolian/Eolian.h | 44 | ||||
-rw-r--r-- | src/lib/eolian/database_class.c | 1 | ||||
-rw-r--r-- | src/lib/eolian/database_class_api.c | 7 | ||||
-rw-r--r-- | src/lib/eolian/database_function.c | 2 | ||||
-rw-r--r-- | src/lib/eolian/database_function_api.c | 101 | ||||
-rw-r--r-- | src/lib/eolian/database_type.c | 1 | ||||
-rw-r--r-- | src/lib/eolian/database_validate.c | 2 | ||||
-rw-r--r-- | src/lib/eolian/eo_lexer.h | 4 | ||||
-rw-r--r-- | src/lib/eolian/eo_parser.c | 70 | ||||
-rw-r--r-- | src/lib/eolian/eolian_database.h | 6 |
10 files changed, 13 insertions, 225 deletions
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h index 77a5c1843a..20979ec99b 100644 --- a/src/lib/eolian/Eolian.h +++ b/src/lib/eolian/Eolian.h @@ -1421,16 +1421,6 @@ EAPI Eolian_Class_Type eolian_class_type_get(const Eolian_Class *klass); EAPI const Eolian_Documentation *eolian_class_documentation_get(const Eolian_Class *klass); /* - * @brief Returns the legacy prefix of a class - * - * @param[in] klass the class - * @return the legacy prefix - * - * @ingroup Eolian - */ -EAPI Eina_Stringshare *eolian_class_legacy_prefix_get(const Eolian_Class *klass); - -/* * @brief Returns the eo prefix of a class * * @param[in] klass the class @@ -1559,22 +1549,20 @@ eolian_function_name_get(const Eolian_Function *fid) * * @param[in] function_id Id of the function * @param[in] ftype The type of function to get the name for - * @param[in] use_legacy If true, legacy prefix or name will be used when available * @return the function name * * It's here because the C API names are deduplicated (prefix of function and * suffix of prefix merge if applicable) and this helps generators not write * the same code over and over. * - * If legacy name is supplied for the given type and use_legacy is set, it - * will be used. Also, if the given type is PROP_GET or PROPERTY, a "_get" - * suffix will be applied when not using legacy name, and "_set" for PROP_SET. + * If the given type is PROP_GET or PROPERTY, a "_get" suffix will be applied, + * and "_set" for PROP_SET. * * Also, you're responsible for deleting the stringshare. * * @ingroup Eolian */ -EAPI Eina_Stringshare *eolian_function_full_c_name_get(const Eolian_Function *function_id, Eolian_Function_Type ftype, Eina_Bool use_legacy); +EAPI Eina_Stringshare *eolian_function_full_c_name_get(const Eolian_Function *function_id, Eolian_Function_Type ftype); /* * @brief Get a function in a class by its name and type @@ -1593,19 +1581,6 @@ EAPI Eina_Stringshare *eolian_function_full_c_name_get(const Eolian_Function *fu EAPI const Eolian_Function *eolian_class_function_by_name_get(const Eolian_Class *klass, const char *func_name, Eolian_Function_Type f_type); /* - * @brief Returns a legacy name for a function. - * - * @param[in] function_id Id of the function - * @param[in] f_type The function type, for property get/set distinction. - * @return the legacy name or NULL. - * - * Acceptable input types are METHOD, PROP_GET and PROP_SET. - * - * @ingroup Eolian - */ -EAPI Eina_Stringshare *eolian_function_legacy_get(const Eolian_Function *function_id, Eolian_Function_Type f_type); - -/* * @brief Returns the implement for a function. * * @param[in] function_id Id of the function @@ -1616,19 +1591,6 @@ EAPI Eina_Stringshare *eolian_function_legacy_get(const Eolian_Function *functio EAPI const Eolian_Implement *eolian_function_implement_get(const Eolian_Function *function_id); /* - * @brief Indicates if a function is legacy only. - * - * @param[in] function_id Id of the function - * @param[in] f_type The function type, for property get/set distinction. - * @return EINA_TRUE if legacy only, EINA_FALSE otherwise. - * - * Acceptable input types are METHOD, PROP_GET and PROP_SET. - * - * @ingroup Eolian - */ -EAPI Eina_Bool eolian_function_is_legacy_only(const Eolian_Function *function_id, Eolian_Function_Type ftype); - -/* * @brief Get whether a function is a class method/property. * * @param[in] function_id Id of the function diff --git a/src/lib/eolian/database_class.c b/src/lib/eolian/database_class.c index a28d36b42e..34551d3c80 100644 --- a/src/lib/eolian/database_class.c +++ b/src/lib/eolian/database_class.c @@ -33,7 +33,6 @@ database_class_del(Eolian_Class *cl) eina_list_free(cl->callables); eina_list_free(cl->composite); - if (cl->legacy_prefix) eina_stringshare_del(cl->legacy_prefix); if (cl->eo_prefix) eina_stringshare_del(cl->eo_prefix); if (cl->ev_prefix) eina_stringshare_del(cl->ev_prefix); if (cl->data_type) eina_stringshare_del(cl->data_type); diff --git a/src/lib/eolian/database_class_api.c b/src/lib/eolian/database_class_api.c index f79cdb800b..fa7d36b541 100644 --- a/src/lib/eolian/database_class_api.c +++ b/src/lib/eolian/database_class_api.c @@ -21,13 +21,6 @@ eolian_class_documentation_get(const Eolian_Class *cl) } EAPI Eina_Stringshare* -eolian_class_legacy_prefix_get(const Eolian_Class *cl) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(cl, NULL); - return cl->legacy_prefix; -} - -EAPI Eina_Stringshare* eolian_class_eo_prefix_get(const Eolian_Class *cl) { EINA_SAFETY_ON_NULL_RETURN_VAL(cl, NULL); diff --git a/src/lib/eolian/database_function.c b/src/lib/eolian/database_function.c index 15187e93d7..c3b45d3954 100644 --- a/src/lib/eolian/database_function.c +++ b/src/lib/eolian/database_function.c @@ -25,8 +25,6 @@ database_function_del(Eolian_Function *fid) database_type_del(fid->set_ret_type); database_expr_del(fid->get_ret_val); database_expr_del(fid->set_ret_val); - if (fid->get_legacy) eina_stringshare_del(fid->get_legacy); - if (fid->set_legacy) eina_stringshare_del(fid->set_legacy); database_doc_del(fid->get_return_doc); database_doc_del(fid->set_return_doc); free(fid); diff --git a/src/lib/eolian/database_function_api.c b/src/lib/eolian/database_function_api.c index 9e7135b96e..8a38443359 100644 --- a/src/lib/eolian/database_function_api.c +++ b/src/lib/eolian/database_function_api.c @@ -38,12 +38,10 @@ eolian_function_type_get(const Eolian_Function *fid) } static const char * -_get_eo_prefix(const Eolian_Function *foo_id, char *buf, Eina_Bool use_legacy) +_get_eo_prefix(const Eolian_Function *foo_id, char *buf) { char *tmp = buf; - if (use_legacy) - return foo_id->klass->legacy_prefix; - else if (foo_id->klass->eo_prefix) + if (foo_id->klass->eo_prefix) return foo_id->klass->eo_prefix; strcpy(buf, foo_id->klass->base.name); eina_str_tolower(&buf); @@ -86,36 +84,11 @@ _get_abbreviated_name(const char *prefix, const char *fname) EAPI Eina_Stringshare * eolian_function_full_c_name_get(const Eolian_Function *foo_id, - Eolian_Function_Type ftype, - Eina_Bool use_legacy) + Eolian_Function_Type ftype) { - switch (ftype) - { - case EOLIAN_UNRESOLVED: - case EOLIAN_METHOD: - case EOLIAN_PROPERTY: - case EOLIAN_PROP_GET: - case EOLIAN_FUNCTION_POINTER: - if (foo_id->get_legacy && use_legacy) - { - if (!strcmp(foo_id->get_legacy, "null")) - return NULL; - return eina_stringshare_ref(foo_id->get_legacy); - } - break; - case EOLIAN_PROP_SET: - if (foo_id->set_legacy && use_legacy) - { - if (!strcmp(foo_id->set_legacy, "null")) - return NULL; - return eina_stringshare_ref(foo_id->set_legacy); - } - break; - } - char tbuf[512]; tbuf[0] = '\0'; - const char *prefix = (ftype != EOLIAN_FUNCTION_POINTER) ? _get_eo_prefix(foo_id, tbuf, use_legacy): tbuf; + const char *prefix = (ftype != EOLIAN_FUNCTION_POINTER) ? _get_eo_prefix(foo_id, tbuf): tbuf; if (!prefix) return NULL; @@ -124,22 +97,6 @@ eolian_function_full_c_name_get(const Eolian_Function *foo_id, Eina_Strbuf *buf = eina_strbuf_new(); Eina_Stringshare *ret; - if (use_legacy) - { - eina_strbuf_append(buf, prefix); - eina_strbuf_append_char(buf, '_'); - eina_strbuf_append(buf, funcn); - - if ((ftype == EOLIAN_PROP_GET) || (ftype == EOLIAN_PROPERTY)) - eina_strbuf_append(buf, "_get"); - else if (ftype == EOLIAN_PROP_SET) - eina_strbuf_append(buf, "_set"); - - ret = eina_stringshare_add(eina_strbuf_string_get(buf)); - eina_strbuf_free(buf); - return ret; - } - char *abbr = _get_abbreviated_name(prefix, funcn); eina_strbuf_append(buf, abbr); free(abbr); @@ -154,31 +111,6 @@ eolian_function_full_c_name_get(const Eolian_Function *foo_id, return ret; } -EAPI Eina_Stringshare * -eolian_function_legacy_get(const Eolian_Function *fid, Eolian_Function_Type ftype) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL); - EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_UNRESOLVED, NULL); - EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_PROPERTY, NULL); - switch (ftype) - { - case EOLIAN_METHOD: - if (fid->type != EOLIAN_METHOD) - return NULL; - return fid->get_legacy; - case EOLIAN_PROP_GET: - if ((fid->type != EOLIAN_PROP_GET) && (fid->type != EOLIAN_PROPERTY)) - return NULL; - return fid->get_legacy; - case EOLIAN_PROP_SET: - if ((fid->type != EOLIAN_PROP_SET) && (fid->type != EOLIAN_PROPERTY)) - return NULL; - return fid->set_legacy; - default: - return NULL; - } -} - EAPI const Eolian_Implement * eolian_function_implement_get(const Eolian_Function *fid) { @@ -187,31 +119,6 @@ eolian_function_implement_get(const Eolian_Function *fid) } EAPI Eina_Bool -eolian_function_is_legacy_only(const Eolian_Function *fid, Eolian_Function_Type ftype) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE); - EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_UNRESOLVED, EINA_FALSE); - EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_PROPERTY, EINA_FALSE); - switch (ftype) - { - case EOLIAN_METHOD: - if (fid->type != EOLIAN_METHOD) - return EINA_FALSE; - return fid->get_only_legacy; - case EOLIAN_PROP_GET: - if ((fid->type != EOLIAN_PROP_GET) && (fid->type != EOLIAN_PROPERTY)) - return EINA_FALSE; - return fid->get_only_legacy; - case EOLIAN_PROP_SET: - if ((fid->type != EOLIAN_PROP_SET) && (fid->type != EOLIAN_PROPERTY)) - return EINA_FALSE; - return fid->set_only_legacy; - default: - return EINA_FALSE; - } -} - -EAPI Eina_Bool eolian_function_is_class(const Eolian_Function *fid) { EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE); diff --git a/src/lib/eolian/database_type.c b/src/lib/eolian/database_type.c index 79343a39d4..529617e348 100644 --- a/src/lib/eolian/database_type.c +++ b/src/lib/eolian/database_type.c @@ -26,7 +26,6 @@ database_typedecl_del(Eolian_Typedecl *tp) database_type_del(tp->base_type); if (tp->fields) eina_hash_free(tp->fields); if (tp->field_list) eina_list_free(tp->field_list); - if (tp->legacy) eina_stringshare_del(tp->legacy); if (tp->freefunc) eina_stringshare_del(tp->freefunc); database_doc_del(tp->doc); free(tp); diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c index 665f095817..e4ebce0b40 100644 --- a/src/lib/eolian/database_validate.c +++ b/src/lib/eolian/database_validate.c @@ -247,7 +247,7 @@ _validate_type(Validate_State *vals, Eolian_Type *tp) return EINA_FALSE; } - if (tp->is_ptr && !tp->legacy) + if (tp->is_ptr) { tp->is_ptr = EINA_FALSE; Eina_Bool still_ownable = database_type_is_ownable(src, tp, EINA_FALSE); diff --git a/src/lib/eolian/eo_lexer.h b/src/lib/eolian/eo_lexer.h index dc8d171b02..90a79c2158 100644 --- a/src/lib/eolian/eo_lexer.h +++ b/src/lib/eolian/eo_lexer.h @@ -25,9 +25,9 @@ enum Tokens #define KEYWORDS KW(class), KW(const), KW(enum), KW(return), KW(struct), \ \ KW(abstract), KW(composite), KW(constructor), KW(constructors), KW(data), \ - KW(destructor), KW(eo), KW(eo_prefix), KW(event_prefix), KW(events), \ + KW(destructor), KW(eo_prefix), KW(event_prefix), KW(events), \ KW(extends), KW(free), KW(get), KW(implements), KW(import), KW(interface), \ - KW(keys), KW(legacy), KW(legacy_prefix), KW(methods), KW(mixin), KW(params), \ + KW(keys), KW(legacy), KW(methods), KW(mixin), KW(params), \ KW(parse), KW(parts), KW(ptr), KW(set), KW(type), KW(values), KW(var), KW(requires), \ \ KWAT(auto), KWAT(beta), KWAT(class), KWAT(const), KWAT(cref), KWAT(empty), \ diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index 6de91efc15..716cec6497 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -631,19 +631,6 @@ parse_type_void(Eo_Lexer *ls, Eina_Bool allow_ptr) check_match(ls, ')', '(', pline, pcol); return def; } - case KW_legacy: - { - int pline, pcol; - eo_lexer_get(ls); - pline = ls->line_number; - pcol = ls->column; - check_next(ls, '('); - def = parse_type_void(ls, allow_ptr); - FILL_BASE(def->base, ls, line, col, TYPE); - def->legacy = EINA_TRUE; - check_match(ls, ')', '(', pline, pcol); - return def; - } case KW_free: { int pline, pcolumn; @@ -984,17 +971,6 @@ end: } static void -parse_legacy(Eo_Lexer *ls, const char **out) -{ - eo_lexer_get(ls); - check_next(ls, ':'); - check(ls, TOK_VALUE); - *out = eina_stringshare_ref(ls->t.value.s); - eo_lexer_get(ls); - check_next(ls, ';'); -} - -static void parse_params(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout, Eina_Bool is_vals) { @@ -1018,7 +994,7 @@ static void parse_accessor(Eo_Lexer *ls, Eolian_Function *prop) { int line, col; - Eina_Bool has_return = EINA_FALSE, has_legacy = EINA_FALSE, + Eina_Bool has_return = EINA_FALSE, has_eo = EINA_FALSE, has_keys = EINA_FALSE, has_values = EINA_FALSE, has_protected = EINA_FALSE, has_virtp = EINA_FALSE; @@ -1113,24 +1089,6 @@ parse_accessor: prop->set_ret_type->owned = ret.owned; } break; - case KW_legacy: - CASE_LOCK(ls, legacy, "legacy name") - if (is_get) - parse_legacy(ls, &prop->get_legacy); - else - parse_legacy(ls, &prop->set_legacy); - break; - case KW_eo: - CASE_LOCK(ls, eo, "eo name") - eo_lexer_get(ls); - check_next(ls, ':'); - check_kw_next(ls, KW_null); - check_next(ls, ';'); - if (is_get) - prop->get_only_legacy = EINA_TRUE; - else - prop->set_only_legacy = EINA_TRUE; - break; case KW_keys: { Eina_List **stor; @@ -1352,7 +1310,7 @@ parse_method(Eo_Lexer *ls) Eolian_Function *meth = NULL; Eolian_Implement *impl = NULL; Eina_Bool has_const = EINA_FALSE, has_params = EINA_FALSE, - has_return = EINA_FALSE, has_legacy = EINA_FALSE, + has_return = EINA_FALSE, has_protected = EINA_FALSE, has_class = EINA_FALSE, has_eo = EINA_FALSE, has_beta = EINA_FALSE, has_virtp = EINA_FALSE; @@ -1428,18 +1386,6 @@ body: meth->get_return_warn_unused = ret.warn_unused; meth->get_ret_type->owned = ret.owned; break; - case KW_legacy: - CASE_LOCK(ls, legacy, "legacy name") - parse_legacy(ls, &meth->get_legacy); - break; - case KW_eo: - CASE_LOCK(ls, eo, "eo name") - eo_lexer_get(ls); - check_next(ls, ':'); - check_kw_next(ls, KW_null); - check_next(ls, ';'); - meth->get_only_legacy = EINA_TRUE; - break; case KW_params: CASE_LOCK(ls, params, "params definition") parse_params(ls, &meth->params, EINA_TRUE, EINA_FALSE); @@ -1921,8 +1867,7 @@ error: static void parse_class_body(Eo_Lexer *ls, Eolian_Class_Type type) { - Eina_Bool has_legacy_prefix = EINA_FALSE, - has_eo_prefix = EINA_FALSE, + Eina_Bool has_eo_prefix = EINA_FALSE, has_event_prefix = EINA_FALSE, has_data = EINA_FALSE, has_methods = EINA_FALSE, @@ -1938,15 +1883,6 @@ parse_class_body(Eo_Lexer *ls, Eolian_Class_Type type) } for (;;) switch (ls->t.kw) { - case KW_legacy_prefix: - CASE_LOCK(ls, legacy_prefix, "legacy prefix definition") - eo_lexer_get(ls); - check_next(ls, ':'); - _validate_pfx(ls); - ls->klass->legacy_prefix = eina_stringshare_ref(ls->t.value.s); - eo_lexer_get(ls); - check_next(ls, ';'); - break; case KW_eo_prefix: CASE_LOCK(ls, eo_prefix, "eo prefix definition") eo_lexer_get(ls); diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h index 058da20dd8..8c1b02bd2a 100644 --- a/src/lib/eolian/eolian_database.h +++ b/src/lib/eolian/eolian_database.h @@ -177,7 +177,6 @@ struct _Eolian_Class Eolian_Object base; Eolian_Class_Type type; Eolian_Documentation *doc; - Eina_Stringshare *legacy_prefix; Eina_Stringshare *eo_prefix; Eina_Stringshare *ev_prefix; Eina_Stringshare *data_type; @@ -222,15 +221,11 @@ struct _Eolian_Function Eolian_Expression *get_ret_val; Eolian_Expression *set_ret_val; Eolian_Implement *impl; - Eina_Stringshare *get_legacy; - Eina_Stringshare *set_legacy; Eolian_Documentation *get_return_doc; Eolian_Documentation *set_return_doc; Eina_Bool obj_is_const :1; /* True if the object has to be const. Useful for a few methods. */ Eina_Bool get_return_warn_unused :1; /* also used for methods */ Eina_Bool set_return_warn_unused :1; - Eina_Bool get_only_legacy: 1; - Eina_Bool set_only_legacy: 1; Eina_Bool is_class :1; Eina_List *ctor_of; Eolian_Class *klass; @@ -276,7 +271,6 @@ struct _Eolian_Type Eina_Bool is_const :1; Eina_Bool is_ptr :1; Eina_Bool owned :1; - Eina_Bool legacy :1; }; struct _Eolian_Typedecl |