eolian: remove obsolete file_get APIs
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Thu, 8 Mar 2018 21:54:12 +0000 (22:54 +0100)
committerWonki Kim <wonki_.kim@samsung.com>
Tue, 10 Apr 2018 11:10:51 +0000 (20:10 +0900)
src/lib/eolian/Eolian.h
src/lib/eolian/database_class_api.c
src/lib/eolian/database_type_api.c
src/lib/eolian/database_var_api.c
src/tests/eolian/eolian_parsing.c

index 05aa1ea..d5ba7e0 100644 (file)
@@ -1173,16 +1173,6 @@ EAPI Eina_Iterator *eolian_unit_structs_get(const Eolian_Unit *unit);
 EAPI Eina_Iterator *eolian_unit_enums_get(const Eolian_Unit *unit);
 
 /*
- * @brief Returns the name of the file containing the given class.
- *
- * @param[in] klass the class.
- * @return the name of the file on success or NULL otherwise.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Stringshare *eolian_class_file_get(const Eolian_Class *klass);
-
-/*
  * @brief Returns the full name of the given class.
  *
  * @param[in] class the class.
@@ -2190,16 +2180,6 @@ EAPI Eina_Stringshare *eolian_typedecl_enum_legacy_prefix_get(const Eolian_Typed
 EAPI const Eolian_Documentation *eolian_typedecl_documentation_get(const Eolian_Typedecl *tp);
 
 /*
- * @brief Get the filename of a type declaration.
- *
- * @param[in] tp the type declaration.
- * @return the filename.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Stringshare *eolian_typedecl_file_get(const Eolian_Typedecl *tp);
-
-/*
  * @brief Get the base type of an alias declaration.
  *
  * @param[in] tp the type declaration.
@@ -2321,16 +2301,6 @@ EAPI Eolian_Type_Type eolian_type_type_get(const Eolian_Type *tp);
 EAPI Eolian_Type_Builtin_Type eolian_type_builtin_type_get(const Eolian_Type *tp);
 
 /*
- * @brief Get the filename of a type.
- *
- * @param[in] tp the type.
- * @return the filename.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Stringshare *eolian_type_file_get(const Eolian_Type *tp);
-
-/*
  * @brief Get the base type of a type.
  *
  * Only applies to "complex" ordinary types, i.e. this is the first inner
@@ -2660,16 +2630,6 @@ EAPI Eolian_Variable_Type eolian_variable_type_get(const Eolian_Variable *var);
 EAPI const Eolian_Documentation *eolian_variable_documentation_get(const Eolian_Variable *var);
 
 /*
- * @brief Get the filename of a variable.
- *
- * @param[in] var the variable.
- * @return the filename or NULL.
- *
- * @ingroup Eolian
- */
-EAPI Eina_Stringshare *eolian_variable_file_get(const Eolian_Variable *var);
-
-/*
  * @brief Get the base type of a variable.
  *
  * @param[in] var the variable.
index 42125ad..2306757 100644 (file)
@@ -7,12 +7,6 @@
 #include "eolian_priv.h"
 
 EAPI Eina_Stringshare *
-eolian_class_file_get(const Eolian_Class *cl)
-{
-   return cl ? cl->base.file : NULL;
-}
-
-EAPI Eina_Stringshare *
 eolian_class_full_name_get(const Eolian_Class *cl)
 {
    return cl ? cl->base.name : NULL;
index c5f3508..f54dace 100644 (file)
@@ -153,20 +153,6 @@ eolian_typedecl_documentation_get(const Eolian_Typedecl *tp)
    return tp->doc;
 }
 
-EAPI Eina_Stringshare *
-eolian_type_file_get(const Eolian_Type *tp)
-{
-   EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
-   return tp->base.file;
-}
-
-EAPI Eina_Stringshare *
-eolian_typedecl_file_get(const Eolian_Typedecl *tp)
-{
-   EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
-   return tp->base.file;
-}
-
 EAPI const Eolian_Type *
 eolian_type_base_type_get(const Eolian_Type *tp)
 {
index 208e339..87a7e38 100644 (file)
@@ -19,13 +19,6 @@ eolian_variable_documentation_get(const Eolian_Variable *var)
    return var->doc;
 }
 
-EAPI Eina_Stringshare *
-eolian_variable_file_get(const Eolian_Variable *var)
-{
-   EINA_SAFETY_ON_NULL_RETURN_VAL(var, NULL);
-   return var->base.file;
-}
-
 EAPI const Eolian_Type *
 eolian_variable_base_type_get(const Eolian_Variable *var)
 {
index 331f6d6..6eb3fa9 100644 (file)
@@ -359,7 +359,7 @@ START_TEST(eolian_typedef)
    fail_if(strcmp(type_name, "int"));
 
    /* File */
-   fail_if(!(file = eolian_typedecl_file_get(tdl)));
+   fail_if(!(file = eolian_object_file_get((const Eolian_Object *)tdl)));
    fail_if(strcmp(file, "typedef.eo"));
 
    /* Lowest alias base */
@@ -552,7 +552,7 @@ START_TEST(eolian_simple_parsing)
    fail_if(!(unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/class_simple.eo")));
    fail_if(!(class = eolian_unit_class_by_name_get(unit, "Class_Simple")));
    fail_if(eolian_state_class_by_file_get(eos, "class_simple.eo") != class);
-   fail_if(strcmp(eolian_class_file_get(class), "class_simple.eo"));
+   fail_if(strcmp(eolian_object_file_get((const Eolian_Object *)class), "class_simple.eo"));
 
    /* Class */
    fail_if(eolian_class_type_get(class) != EOLIAN_CLASS_REGULAR);
@@ -696,7 +696,7 @@ START_TEST(eolian_struct)
    /* named struct */
    fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Named")));
    fail_if(!(type_name = eolian_typedecl_name_get(tdl)));
-   fail_if(!(file = eolian_typedecl_file_get(tdl)));
+   fail_if(!(file = eolian_object_file_get((const Eolian_Object *)tdl)));
    fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_STRUCT);
    fail_if(strcmp(type_name, "Named"));
    fail_if(strcmp(file, "struct.eo"));
@@ -715,7 +715,7 @@ START_TEST(eolian_struct)
    /* referencing */
    fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Another")));
    fail_if(!(type_name = eolian_typedecl_name_get(tdl)));
-   fail_if(!(file = eolian_typedecl_file_get(tdl)));
+   fail_if(!(file = eolian_object_file_get((const Eolian_Object *)tdl)));
    fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_STRUCT);
    fail_if(strcmp(type_name, "Another"));
    fail_if(strcmp(file, "struct.eo"));
@@ -1109,10 +1109,10 @@ START_TEST(eolian_import)
    fail_if(!(class = eolian_unit_class_by_name_get(unit, "Import")));
 
    fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Imported")));
-   fail_if(strcmp(eolian_typedecl_file_get(tdl), "import_types.eot"));
+   fail_if(strcmp(eolian_object_file_get((const Eolian_Object *)tdl), "import_types.eot"));
 
    fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Imported_Struct")));
-   fail_if(strcmp(eolian_typedecl_file_get(tdl), "import_types.eot"));
+   fail_if(strcmp(eolian_object_file_get((const Eolian_Object *)tdl), "import_types.eot"));
 
    eolian_state_free(eos);
    eolian_shutdown();