q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=482c5d1ba237225720f02c358166291cbe9349ea

commit 482c5d1ba237225720f02c358166291cbe9349ea
Author: Daniel Kolesa <d.kol...@osg.samsung.com>
Date:   Wed Mar 7 13:53:08 2018 +0100

    eolian: get rid of old APIs for typedecl retrieval
---
 src/bin/eolian/docs.c                    |   4 +-
 src/bindings/luajit/eolian.lua           | 138 ++++++++++++++++++-------------
 src/lib/eolian/Eolian.h                  |  27 ------
 src/lib/eolian/database_expr.c           |   4 +-
 src/lib/eolian/eolian_database.c         |  61 +-------------
 src/scripts/elua/apps/docgen/doctree.lua |  45 ++++------
 src/tests/eolian/eolian_parsing.c        |  66 +++++++--------
 7 files changed, 135 insertions(+), 210 deletions(-)

diff --git a/src/bin/eolian/docs.c b/src/bin/eolian/docs.c
index 173fce910a..acb56089a9 100644
--- a/src/bin/eolian/docs.c
+++ b/src/bin/eolian/docs.c
@@ -39,7 +39,7 @@ _generate_ref(const Eolian_Unit *src, const char *refn, 
Eina_Strbuf *wbuf,
 
    Eina_Stringshare *bname = eina_stringshare_add_length(refn, sfx - refn);
 
-   const Eolian_Typedecl *tp = eolian_typedecl_struct_get_by_name(src, bname);
+   const Eolian_Typedecl *tp = eolian_unit_struct_by_name_get(src, bname);
    if (tp)
      {
         if (!eolian_typedecl_struct_field_get(tp, sfx + 1))
@@ -53,7 +53,7 @@ _generate_ref(const Eolian_Unit *src, const char *refn, 
Eina_Strbuf *wbuf,
         return;
      }
 
-   tp = eolian_typedecl_enum_get_by_name(src, bname);
+   tp = eolian_unit_enum_by_name_get(src, bname);
    if (tp)
      {
         const Eolian_Enum_Type_Field *efl = eolian_typedecl_enum_field_get(tp, 
sfx + 1);
diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua
index 759e3aee2a..39293125d2 100644
--- a/src/bindings/luajit/eolian.lua
+++ b/src/bindings/luajit/eolian.lua
@@ -399,15 +399,6 @@ ffi.cdef [[
     Eina_Bool eolian_class_ctor_enable_get(const Eolian_Class *klass);
     Eina_Bool eolian_class_dtor_enable_get(const Eolian_Class *klass);
     const char *eolian_class_c_get_function_name_get(const Eolian_Class 
*klass);
-    const Eolian_Typedecl *eolian_typedecl_alias_get_by_name(const Eolian_Unit 
*unit, const char *name);
-    const Eolian_Typedecl *eolian_typedecl_struct_get_by_name(const 
Eolian_Unit *unit, const char *name);
-    const Eolian_Typedecl *eolian_typedecl_enum_get_by_name(const Eolian_Unit 
*unit, const char *name);
-    Eina_Iterator *eolian_typedecl_aliases_get_by_file(const Eolian_Unit 
*unit, const char *fname);
-    Eina_Iterator *eolian_typedecl_structs_get_by_file(const Eolian_Unit 
*unit, const char *fname);
-    Eina_Iterator *eolian_typedecl_enums_get_by_file(const Eolian_Unit *unit, 
const char *fname);
-    Eina_Iterator *eolian_typedecl_all_aliases_get(const Eolian_Unit *unit);
-    Eina_Iterator *eolian_typedecl_all_structs_get(const Eolian_Unit *unit);
-    Eina_Iterator *eolian_typedecl_all_enums_get(const Eolian_Unit *unit);
     Eolian_Type_Type eolian_type_type_get(const Eolian_Type *tp);
     Eolian_Type_Builtin_Type eolian_type_builtin_type_get(const Eolian_Type 
*tp);
     Eolian_Typedecl_Type eolian_typedecl_type_get(const Eolian_Typedecl *tp);
@@ -649,6 +640,54 @@ ffi.metatype("Eolian_State", {
         globals_get = function(self)
             return Ptr_Iterator("const Eolian_Variable *",
                 eolian.eolian_state_globals_get(self))
+        end,
+
+        alias_by_name_get = function(self, name)
+            local v = eolian.eolian_state_alias_by_name_get(self, name)
+            if v == nil then return nil end
+            return v
+        end,
+
+        struct_by_name_get = function(self, name)
+            local v = eolian.eolian_state_struct_by_name_get(self, name)
+            if v == nil then return nil end
+            return v
+        end,
+
+        enum_by_name_get = function(self, name)
+            local v = eolian.eolian_state_enum_by_name_get(self, name)
+            if v == nil then return nil end
+            return v
+        end,
+
+        aliases_by_file_get = function(self, fname)
+            return Ptr_Iterator("const Eolian_Typedecl *",
+                eolian.eolian_state_aliases_by_file_get(self, fname))
+        end,
+
+        structs_by_file_get = function(self, fname)
+            return Ptr_Iterator("const Eolian_Typedecl *",
+                eolian.eolian_state_structs_by_file_get(self, fname))
+        end,
+
+        enums_by_file_get = function(self, fname)
+            return Ptr_Iterator("const Eolian_Typedecl *",
+                eolian.eolian_state_enums_by_file_get(self, fname))
+        end,
+
+        aliases_get = function(self)
+            return Ptr_Iterator("const Eolian_Typedecl *",
+                eolian.eolian_state_aliases_get(self))
+        end,
+
+        structs_get = function(self)
+            return Ptr_Iterator("const Eolian_Typedecl *",
+                eolian.eolian_state_structs_get(self))
+        end,
+
+        enums_get = function(self)
+            return Ptr_Iterator("const Eolian_Typedecl *",
+                eolian.eolian_state_enums_get(self))
         end
     },
     __gc = function(self)
@@ -700,6 +739,39 @@ ffi.metatype("Eolian_Unit", {
         globals_get = function(self)
             return Ptr_Iterator("const Eolian_Variable *",
                 eolian.eolian_unit_globals_get(self))
+        end,
+
+        alias_by_name_get = function(self, name)
+            local v = eolian.eolian_unit_alias_by_name_get(self, name)
+            if v == nil then return nil end
+            return v
+        end,
+
+        struct_by_name_get = function(self, name)
+            local v = eolian.eolian_unit_struct_by_name_get(self, name)
+            if v == nil then return nil end
+            return v
+        end,
+
+        enum_by_name_get = function(self, name)
+            local v = eolian.eolian_unit_enum_by_name_get(self, name)
+            if v == nil then return nil end
+            return v
+        end,
+
+        aliases_get = function(self)
+            return Ptr_Iterator("const Eolian_Typedecl *",
+                eolian.eolian_unit_aliases_get(self))
+        end,
+
+        structs_get = function(self)
+            return Ptr_Iterator("const Eolian_Typedecl *",
+                eolian.eolian_unit_structs_get(self))
+        end,
+
+        enums_get = function(self)
+            return Ptr_Iterator("const Eolian_Typedecl *",
+                eolian.eolian_unit_enums_get(self))
         end
     }
 })
@@ -1428,54 +1500,6 @@ M.Class = ffi.metatype("Eolian_Class", {
     }
 })
 
-M.typedecl_alias_get_by_name = function(unit, name)
-    local v = eolian.eolian_typedecl_alias_get_by_name(unit, name)
-    if v == nil then return nil end
-    return v
-end
-
-M.typedecl_struct_get_by_name = function(unit, name)
-    local v = eolian.eolian_typedecl_struct_get_by_name(unit, name)
-    if v == nil then return nil end
-    return v
-end
-
-M.typedecl_enum_get_by_name = function(unit, name)
-    local v = eolian.eolian_typedecl_enum_get_by_name(unit, name)
-    if v == nil then return nil end
-    return v
-end
-
-M.typedecl_aliases_get_by_file = function(unit, fname)
-    return Ptr_Iterator("const Eolian_Typedecl *",
-        eolian.eolian_type_aliases_get_by_file(unit, self))
-end
-
-M.typedecl_structs_get_by_file = function(unit, fname)
-    return Ptr_Iterator("const Eolian_Typedecl *",
-        eolian.eolian_type_structs_get_by_file(unit, self))
-end
-
-M.typedecl_enums_get_by_file = function(unit, fname)
-    return Ptr_Iterator("const Eolian_Typedecl *",
-        eolian.eolian_type_enums_get_by_file(unit, self))
-end
-
-M.typedecl_all_aliases_get = function(unit)
-    return Ptr_Iterator("const Eolian_Typedecl *",
-        eolian.eolian_typedecl_all_aliases_get(unit))
-end
-
-M.typedecl_all_structs_get = function(unit)
-    return Ptr_Iterator("const Eolian_Typedecl *",
-        eolian.eolian_typedecl_all_structs_get(unit))
-end
-
-M.typedecl_all_enums_get = function(unit)
-    return Ptr_Iterator("const Eolian_Typedecl *",
-        eolian.eolian_typedecl_all_enums_get(unit))
-end
-
 M.expression_type = {
     UNKNOWN = 0,
     INT     = 1,
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index 1a75d00675..900c9f167b 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -2772,33 +2772,6 @@ EAPI char *eolian_doc_token_text_get(const 
Eolian_Doc_Token *tok);
  */
 EAPI Eolian_Doc_Ref_Type eolian_doc_token_ref_get(const Eolian_Unit *unit, 
const Eolian_Doc_Token *tok, const void **data, const void **data2);
 
-/* DEPRECATED */
-EAPI const Eolian_Typedecl *eolian_typedecl_alias_get_by_name(const 
Eolian_Unit *unit, const char *name);
-
-/* DEPRECATED */
-EAPI const Eolian_Typedecl *eolian_typedecl_struct_get_by_name(const 
Eolian_Unit *unit, const char *name);
-
-/* DEPRECATED */
-EAPI const Eolian_Typedecl *eolian_typedecl_enum_get_by_name(const Eolian_Unit 
*unit, const char *name);
-
-/* DEPRECATED */
-EAPI Eina_Iterator *eolian_typedecl_aliases_get_by_file(const Eolian_Unit 
*unit, const char *fname);
-
-/* DEPRECATED */
-EAPI Eina_Iterator *eolian_typedecl_structs_get_by_file(const Eolian_Unit 
*unit, const char *fname);
-
-/* DEPRECATED */
-EAPI Eina_Iterator *eolian_typedecl_enums_get_by_file(const Eolian_Unit *unit, 
const char *fname);
-
-/* DEPRECATED */
-EAPI Eina_Iterator *eolian_typedecl_all_aliases_get(const Eolian_Unit *unit);
-
-/* DEPRECATED */
-EAPI Eina_Iterator *eolian_typedecl_all_structs_get(const Eolian_Unit *unit);
-
-/* DEPRECATED */
-EAPI Eina_Iterator *eolian_typedecl_all_enums_get(const Eolian_Unit *unit);
-
 #endif
 
 /**
diff --git a/src/lib/eolian/database_expr.c b/src/lib/eolian/database_expr.c
index 40cc05ccb1..45ea7a65c5 100644
--- a/src/lib/eolian/database_expr.c
+++ b/src/lib/eolian/database_expr.c
@@ -524,7 +524,7 @@ eval_exp(const Eolian_Unit *unit, Eolian_Expression *expr,
                 if (!(mask & EOLIAN_MASK_INT))
                   return expr_type_error(expr, EOLIAN_MASK_INT, mask);
 
-                etpd = eolian_typedecl_alias_get_by_name(unit, fulln);
+                etpd = eolian_unit_alias_by_name_get(unit, fulln);
                 while (etpd && etpd->type == EOLIAN_TYPEDECL_ALIAS)
                   {
                      const Eolian_Type *etp = 
eolian_typedecl_base_type_get(etpd);
@@ -533,7 +533,7 @@ eval_exp(const Eolian_Unit *unit, Eolian_Expression *expr,
                      etpd = database_type_decl_find(unit, etp);
                   }
 
-                if (!etpd) etpd = eolian_typedecl_enum_get_by_name(unit, 
fulln);
+                if (!etpd) etpd = eolian_unit_enum_by_name_get(unit, fulln);
                 if (!etpd || etpd->type != EOLIAN_TYPEDECL_ENUM)
                   {
                      free(fulln);
diff --git a/src/lib/eolian/eolian_database.c b/src/lib/eolian/eolian_database.c
index 36ce4f11c0..4d206dc182 100644
--- a/src/lib/eolian/eolian_database.c
+++ b/src/lib/eolian/eolian_database.c
@@ -456,7 +456,7 @@ eolian_doc_token_ref_get(const Eolian_Unit *unit, const 
Eolian_Doc_Token *tok,
    *suffix++ = '\0';
 
    /* try a struct field */
-   const Eolian_Typedecl *tpd = eolian_typedecl_struct_get_by_name(unit, name);
+   const Eolian_Typedecl *tpd = eolian_unit_struct_by_name_get(unit, name);
    if (tpd)
      {
         const Eolian_Struct_Type_Field *fld = 
eolian_typedecl_struct_field_get(tpd, suffix);
@@ -469,7 +469,7 @@ eolian_doc_token_ref_get(const Eolian_Unit *unit, const 
Eolian_Doc_Token *tok,
      }
 
    /* try an enum field */
-   tpd = eolian_typedecl_enum_get_by_name(unit, name);
+   tpd = eolian_unit_enum_by_name_get(unit, name);
    if (tpd)
      {
         const Eolian_Enum_Type_Field *fld = 
eolian_typedecl_enum_field_get(tpd, suffix);
@@ -1130,63 +1130,6 @@ eolian_unit_enums_get(const Eolian_Unit *unit)
    return (unit ? eina_hash_iterator_data_new(unit->enums) : NULL);
 }
 
-EAPI const Eolian_Typedecl *
-eolian_typedecl_alias_get_by_name(const Eolian_Unit *unit, const char *name)
-{
-   return eolian_unit_alias_by_name_get(unit, name);
-}
-
-EAPI const Eolian_Typedecl *
-eolian_typedecl_struct_get_by_name(const Eolian_Unit *unit, const char *name)
-{
-   return eolian_unit_struct_by_name_get(unit, name);
-}
-
-EAPI const Eolian_Typedecl *
-eolian_typedecl_enum_get_by_name(const Eolian_Unit *unit, const char *name)
-{
-   return eolian_unit_enum_by_name_get(unit, name);
-}
-
-EAPI Eina_Iterator *
-eolian_typedecl_aliases_get_by_file(const Eolian_Unit *unit, const char *fname)
-{
-   if (!unit) return NULL;
-   return eolian_state_aliases_by_file_get(unit->state, fname);
-}
-
-EAPI Eina_Iterator *
-eolian_typedecl_structs_get_by_file(const Eolian_Unit *unit, const char *fname)
-{
-   if (!unit) return NULL;
-   return eolian_state_structs_by_file_get(unit->state, fname);
-}
-
-EAPI Eina_Iterator *
-eolian_typedecl_enums_get_by_file(const Eolian_Unit *unit, const char *fname)
-{
-   if (!unit) return NULL;
-   return eolian_state_enums_by_file_get(unit->state, fname);
-}
-
-EAPI Eina_Iterator *
-eolian_typedecl_all_aliases_get(const Eolian_Unit *unit)
-{
-   return eolian_unit_aliases_get(unit);
-}
-
-EAPI Eina_Iterator *
-eolian_typedecl_all_structs_get(const Eolian_Unit *unit)
-{
-   return eolian_unit_structs_get(unit);
-}
-
-EAPI Eina_Iterator *
-eolian_typedecl_all_enums_get(const Eolian_Unit *unit)
-{
-   return eolian_unit_enums_get(unit);
-}
-
 char *
 database_class_to_filename(const char *cname)
 {
diff --git a/src/scripts/elua/apps/docgen/doctree.lua 
b/src/scripts/elua/apps/docgen/doctree.lua
index 73b456cafa..31f27b6c26 100644
--- a/src/scripts/elua/apps/docgen/doctree.lua
+++ b/src/scripts/elua/apps/docgen/doctree.lua
@@ -939,8 +939,7 @@ M.Typedecl = Node:clone {
 
     all_aliases_get = function()
         local ret = {}
-        -- FIXME: unit
-        for tp in eolian.typedecl_all_aliases_get(eos:unit_get()) do
+        for tp in eos:aliases_get() do
             local tpo = M.Typedecl(tp)
             if matches_filter(tpo) then
                 ret[#ret + 1] = tpo
@@ -951,8 +950,7 @@ M.Typedecl = Node:clone {
 
     all_structs_get = function()
         local ret = {}
-        -- FIXME: unit
-        for tp in eolian.typedecl_all_structs_get(eos:unit_get()) do
+        for tp in eos:structs_get() do
             local tpo = M.Typedecl(tp)
             if matches_filter(tpo) then
                 ret[#ret + 1] = tpo
@@ -963,8 +961,7 @@ M.Typedecl = Node:clone {
 
     all_enums_get = function()
         local ret = {}
-        -- FIXME: unit
-        for tp in eolian.typedecl_all_enums_get(eos:unit_get()) do
+        for tp in eos:enums_get() do
             local tpo = M.Typedecl(tp)
             local tpn = tpo:nspaces_get()
             if matches_filter(tpo) then
@@ -976,8 +973,7 @@ M.Typedecl = Node:clone {
 
     aliases_by_file_get = function(fn)
         local ret = {}
-        -- FIXME: unit
-        for tp in eolian.typedecl_aliases_get_by_file(eos:unit_get(), fn) do
+        for tp in eos:aliases_by_file_get(fn) do
             ret[#ret + 1] = M.Typedecl(tp)
         end
         return ret
@@ -985,8 +981,7 @@ M.Typedecl = Node:clone {
 
     structs_by_file_get = function(fn)
         local ret = {}
-        -- FIXME: unit
-        for tp in eolian.typedecl_structs_get_by_file(eos:unit_get(), fn) do
+        for tp in eos:struts_by_file_get(fn) do
             ret[#ret + 1] = M.Typedecl(tp)
         end
         return ret
@@ -994,16 +989,14 @@ M.Typedecl = Node:clone {
 
     enums_by_file_get = function(fn)
         local ret = {}
-        -- FIXME: unit
-        for tp in eolian.typedecl_enums_get_by_file(eos:unit_get(), fn) do
+        for tp in eeos:enums_by_file_get(fn) do
             ret[#ret + 1] = M.Typedecl(tp)
         end
         return ret
     end,
 
     alias_by_name_get = function(tn)
-        -- FIXME: unit
-        local v = eolian.typedecl_alias_get_by_name(eos:unit_get(), tn)
+        local v = eos:alias_by_name_get(tn)
         if not v then
             return nil
         end
@@ -1011,8 +1004,7 @@ M.Typedecl = Node:clone {
     end,
 
     struct_by_name_get = function(tn)
-        -- FIXME: unit
-        local v = eolian.typedecl_struct_get_by_name(eos:unit_get(), tn)
+        local v = eos:struct_by_name_get(tn)
         if not v then
             return nil
         end
@@ -1020,8 +1012,7 @@ M.Typedecl = Node:clone {
     end,
 
     enum_by_name_get = function(tn)
-        -- FIXME: unit
-        local v = eolian.typedecl_enum_get_by_name(eos:unit_get(), tn)
+        local v = eos:enum_by_name_get(tn)
         if not v then
             return nil
         end
@@ -1303,8 +1294,7 @@ M.Variable = Node:clone {
 
     all_globals_get = function()
         local ret = {}
-        -- FIXME: unit
-        for v in eolian.variable_all_globals_get(eos:unit_get()) do
+        for v in eos:globals_get() do
             ret[#ret + 1] = M.Variable(v)
         end
         return ret
@@ -1312,8 +1302,7 @@ M.Variable = Node:clone {
 
     all_constants_get = function()
         local ret = {}
-        -- FIXME: unit
-        for v in eolian.variable_all_constants_get(eos:unit_get()) do
+        for v in eos:constants_get() do
             ret[#ret + 1] = M.Variable(v)
         end
         return ret
@@ -1321,8 +1310,7 @@ M.Variable = Node:clone {
 
     globals_by_file_get = function(fn)
         local ret = {}
-        -- FIXME: unit
-        for v in eolian.variable_globals_get_by_file(eos:unit_get(), fn) do
+        for v in eos:globals_by_file_get(fn) do
             ret[#ret + 1] = M.Variable(v)
         end
         return ret
@@ -1330,16 +1318,14 @@ M.Variable = Node:clone {
 
     constants_by_file_get = function(fn)
         local ret = {}
-        -- FIXME: unit
-        for v in eolian.variable_constants_get_by_file(eos:unit_get(), fn) do
+        for v in eos:constants_by_file_get(fn) do
             ret[#ret + 1] = M.Variable(v)
         end
         return ret
     end,
 
     global_by_name_get = function(vn)
-        -- FIXME: unit
-        local v = eolian.variable_global_get_by_name(eos:unit_get(), vn)
+        local v = eos:global_by_name_get(vn)
         if not v then
             return nil
         end
@@ -1347,8 +1333,7 @@ M.Variable = Node:clone {
     end,
 
     constant_by_name_get = function(vn)
-        -- FIXME: unit
-        local v = eolian.variable_constant_get_by_name(eos:unit_get(), vn)
+        local v = eos:constant_by_name_get(vn)
         if not v then
             return nil
         end
diff --git a/src/tests/eolian/eolian_parsing.c 
b/src/tests/eolian/eolian_parsing.c
index 9665f945a8..331f6d6d0e 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -344,7 +344,7 @@ START_TEST(eolian_typedef)
    fail_if(!eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD));
 
    /* Basic type */
-   fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Evas.Coord")));
+   fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Evas.Coord")));
    fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_ALIAS);
    fail_if(!(type_name = eolian_typedecl_name_get(tdl)));
    fail_if(strcmp(type_name, "Coord"));
@@ -363,12 +363,12 @@ START_TEST(eolian_typedef)
    fail_if(strcmp(file, "typedef.eo"));
 
    /* Lowest alias base */
-   fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Evas.Coord3")));
+   fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Evas.Coord3")));
    fail_if(!(type = eolian_typedecl_aliased_base_get(tdl)));
    fail_if(strcmp(eolian_type_name_get(type), "int"));
 
    /* Complex type */
-   fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "List_Objects")));
+   fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "List_Objects")));
    fail_if(!(type_name = eolian_typedecl_name_get(tdl)));
    fail_if(strcmp(type_name, "List_Objects"));
    fail_if(!(type = eolian_typedecl_base_type_get(tdl)));
@@ -384,7 +384,7 @@ START_TEST(eolian_typedef)
    eina_stringshare_del(type_name);
 
    /* List */
-   fail_if(!(iter = eolian_typedecl_aliases_get_by_file(unit, "typedef.eo")));
+   fail_if(!(iter = eolian_state_aliases_by_file_get(eos, "typedef.eo")));
    fail_if(!eina_iterator_next(iter, (void**)&tdl));
    fail_if(!(type_name = eolian_typedecl_name_get(tdl)));
    fail_if(strcmp(type_name, "Coord"));
@@ -694,7 +694,7 @@ START_TEST(eolian_struct)
    fail_if(!eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD));
 
    /* named struct */
-   fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Named")));
+   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(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_STRUCT);
@@ -713,7 +713,7 @@ START_TEST(eolian_struct)
    eina_stringshare_del(type_name);
 
    /* referencing */
-   fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Another")));
+   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(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_STRUCT);
@@ -728,7 +728,7 @@ START_TEST(eolian_struct)
        != EOLIAN_TYPEDECL_STRUCT);
 
    /* opaque struct */
-   fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Opaque")));
+   fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Opaque")));
    fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_STRUCT_OPAQUE);
 
    /* use in function */
@@ -762,19 +762,19 @@ START_TEST(eolian_extern)
    fail_if(!eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD));
 
    /* regular type */
-   fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Foo")));
+   fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Foo")));
    fail_if(eolian_typedecl_is_extern(tdl));
 
    /* extern type */
-   fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Evas.Coord")));
+   fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Evas.Coord")));
    fail_if(!eolian_typedecl_is_extern(tdl));
 
    /* regular struct */
-   fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "X")));
+   fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "X")));
    fail_if(eolian_typedecl_is_extern(tdl));
 
    /* extern struct */
-   fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Y")));
+   fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Y")));
    fail_if(!eolian_typedecl_is_extern(tdl));
 
    eolian_state_free(eos);
@@ -874,7 +874,7 @@ START_TEST(eolian_enum)
    fail_if(!(class = eolian_unit_class_by_name_get(unit, "Enum")));
    fail_if(!eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD));
 
-   fail_if(!(tdl = eolian_typedecl_enum_get_by_name(unit, "Foo")));
+   fail_if(!(tdl = eolian_unit_enum_by_name_get(unit, "Foo")));
 
    fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "first")));
    fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
@@ -891,7 +891,7 @@ START_TEST(eolian_enum)
    fail_if(v.type != EOLIAN_EXPR_INT);
    fail_if(v.value.i != 15);
 
-   fail_if(!(tdl = eolian_typedecl_enum_get_by_name(unit, "Bar")));
+   fail_if(!(tdl = eolian_unit_enum_by_name_get(unit, "Bar")));
    fail_if(strcmp(eolian_typedecl_enum_legacy_prefix_get(tdl), "test"));
 
    fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "foo")));
@@ -904,7 +904,7 @@ START_TEST(eolian_enum)
    fail_if(strcmp(cname, "TEST_FOO"));
    eina_stringshare_del(cname);
 
-   fail_if(!(tdl = eolian_typedecl_enum_get_by_name(unit, "Baz")));
+   fail_if(!(tdl = eolian_unit_enum_by_name_get(unit, "Baz")));
 
    fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "flag1")));
    fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
@@ -924,7 +924,7 @@ START_TEST(eolian_enum)
    fail_if(v.type != EOLIAN_EXPR_INT);
    fail_if(v.value.i != (1 << 2));
 
-   fail_if(!(tdl = eolian_typedecl_enum_get_by_name(unit, "Name.Spaced")));
+   fail_if(!(tdl = eolian_unit_enum_by_name_get(unit, "Name.Spaced")));
    fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "pants")));
 
    cname = eolian_typedecl_enum_field_c_name_get(field);
@@ -1012,28 +1012,28 @@ START_TEST(eolian_free_func)
    fail_if(!eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD));
 
    /* regular struct */
-   fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Named1")));
+   fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Named1")));
    fail_if(eolian_typedecl_free_func_get(tdl));
-   fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Named2")));
+   fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Named2")));
    fail_if(strcmp(eolian_typedecl_free_func_get(tdl), "test_free"));
 
    /* typedef */
-   fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Typedef1")));
+   fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Typedef1")));
    fail_if(eolian_typedecl_free_func_get(tdl));
-   fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Typedef2")));
+   fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Typedef2")));
    fail_if(strcmp(eolian_typedecl_free_func_get(tdl), "def_free"));
 
    /* opaque struct */
-   fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Opaque1")));
+   fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Opaque1")));
    fail_if(eolian_typedecl_free_func_get(tdl));
-   fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Opaque2")));
+   fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Opaque2")));
    fail_if(strcmp(eolian_typedecl_free_func_get(tdl), "opaque_free"));
 
    /* pointer */
-   fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Pointer1")));
+   fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Pointer1")));
    fail_if(!(type = eolian_typedecl_base_type_get(tdl)));
    fail_if(eolian_type_free_func_get(type));
-   fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Pointer2")));
+   fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Pointer2")));
    fail_if(!(type = eolian_typedecl_base_type_get(tdl)));
    fail_if(strcmp(eolian_type_free_func_get(type), "ptr_free"));
 
@@ -1108,10 +1108,10 @@ START_TEST(eolian_import)
    fail_if(!(unit = eolian_state_file_parse(eos, 
TESTS_SRC_DIR"/data/import.eo")));
    fail_if(!(class = eolian_unit_class_by_name_get(unit, "Import")));
 
-   fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Imported")));
+   fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Imported")));
    fail_if(strcmp(eolian_typedecl_file_get(tdl), "import_types.eot"));
 
-   fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, 
"Imported_Struct")));
+   fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Imported_Struct")));
    fail_if(strcmp(eolian_typedecl_file_get(tdl), "import_types.eot"));
 
    eolian_state_free(eos);
@@ -1204,7 +1204,7 @@ START_TEST(eolian_docs)
 
    fail_if(!(unit = eolian_state_file_parse(eos, 
TESTS_SRC_DIR"/data/docs.eo")));
 
-   fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Foo")));
+   fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Foo")));
    fail_if(!(doc = eolian_typedecl_documentation_get(tdl)));
    fail_if(strcmp(eolian_documentation_summary_get(doc),
                   "This is struct Foo. It does stuff."));
@@ -1306,7 +1306,7 @@ START_TEST(eolian_docs)
                   "Another field documentation."));
    fail_if(eolian_documentation_description_get(doc));
 
-   fail_if(!(tdl = eolian_typedecl_enum_get_by_name(unit, "Bar")));
+   fail_if(!(tdl = eolian_unit_enum_by_name_get(unit, "Bar")));
    fail_if(!(doc = eolian_typedecl_documentation_get(tdl)));
    fail_if(strcmp(eolian_documentation_summary_get(doc),
                   "Docs for enum Bar."));
@@ -1328,7 +1328,7 @@ START_TEST(eolian_docs)
                   "Docs for bar."));
    fail_if(eolian_documentation_description_get(doc));
 
-   fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Alias")));
+   fail_if(!(tdl = eolian_unit_alias_by_name_get(unit, "Alias")));
    fail_if(!(doc = eolian_typedecl_documentation_get(tdl)));
    fail_if(strcmp(eolian_documentation_summary_get(doc),
                   "Docs for typedef."));
@@ -1343,7 +1343,7 @@ START_TEST(eolian_docs)
                   "Docs for var."));
    fail_if(eolian_documentation_description_get(doc));
 
-   fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Opaque")));
+   fail_if(!(tdl = eolian_unit_struct_by_name_get(unit, "Opaque")));
    fail_if(!(doc = eolian_typedecl_documentation_get(tdl)));
    fail_if(strcmp(eolian_documentation_summary_get(doc),
                   "Opaque struct docs. See @Foo for another struct."));
@@ -1450,7 +1450,7 @@ START_TEST(eolian_function_types)
    fail_if(!(unit = eolian_state_file_parse(eos, 
TESTS_SRC_DIR"/data/function_types.eot")));
 
    /* void func(void); */
-   fail_if(!(decl = eolian_typedecl_alias_get_by_name(unit, "VoidFunc")));
+   fail_if(!(decl = eolian_unit_alias_by_name_get(unit, "VoidFunc")));
    fail_if(eolian_typedecl_type_get(decl) != EOLIAN_TYPEDECL_FUNCTION_POINTER);
 
    fail_if(!(fid = eolian_typedecl_function_pointer_get(decl)));
@@ -1460,7 +1460,7 @@ START_TEST(eolian_function_types)
    fail_if((eolian_function_parameters_get(fid)));
 
    /* Function pointer with return and parameters */
-   fail_if(!(decl = eolian_typedecl_alias_get_by_name(unit, "SimpleFunc")));
+   fail_if(!(decl = eolian_unit_alias_by_name_get(unit, "SimpleFunc")));
    fail_if(eolian_typedecl_type_get(decl) != EOLIAN_TYPEDECL_FUNCTION_POINTER);
 
    fail_if(!(fid = eolian_typedecl_function_pointer_get(decl)));
@@ -1487,7 +1487,7 @@ START_TEST(eolian_function_types)
    fail_if(eina_iterator_next(iter, &dummy));
 
    /* Function pointer with parameter attributes (in/out) */
-   fail_if(!(decl = eolian_typedecl_alias_get_by_name(unit, "ComplexFunc")));
+   fail_if(!(decl = eolian_unit_alias_by_name_get(unit, "ComplexFunc")));
    fail_if(eolian_typedecl_type_get(decl) != EOLIAN_TYPEDECL_FUNCTION_POINTER);
 
    fail_if(!(fid = eolian_typedecl_function_pointer_get(decl)));
@@ -1519,7 +1519,7 @@ START_TEST(eolian_function_types)
    fail_if(eina_iterator_next(iter, &dummy));
 
    /* Function pointer receiving another function pointer */
-   fail_if(!(decl = eolian_typedecl_alias_get_by_name(unit, "FuncAsArgFunc")));
+   fail_if(!(decl = eolian_unit_alias_by_name_get(unit, "FuncAsArgFunc")));
    fail_if(eolian_typedecl_type_get(decl) != EOLIAN_TYPEDECL_FUNCTION_POINTER);
 
    fail_if(!(fid = eolian_typedecl_function_pointer_get(decl)));

-- 


Reply via email to