aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-05-26 15:09:49 +0200
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-05-26 15:11:48 +0200
commite660023169d7715469df1798a17f8542bf2e7289 (patch)
tree96c4e510a39c909cf91bd7d05500c3f60468abec
parenteolian: pass unit in internal type serialization (diff)
downloadefl-devs/q66/eolian_units.tar.gz
eolian: use unit in typedecl c_type_getdevs/q66/eolian_units
-rw-r--r--src/bin/eolian/types.c2
-rw-r--r--src/bindings/luajit/eolian.lua6
-rw-r--r--src/lib/eolian/Eolian.h3
-rw-r--r--src/lib/eolian/database_type_api.c5
-rw-r--r--src/tests/eolian/eolian_parsing.c2
5 files changed, 9 insertions, 9 deletions
diff --git a/src/bin/eolian/types.c b/src/bin/eolian/types.c
index 8db220bd1d..c1d4e1fa94 100644
--- a/src/bin/eolian/types.c
+++ b/src/bin/eolian/types.c
@@ -18,7 +18,7 @@ _type_generate(const Eolian_Unit *src, const Eolian_Typedecl *tp,
{
case EOLIAN_TYPEDECL_ALIAS:
{
- Eina_Stringshare *tn = eolian_typedecl_c_type_get(tp);
+ Eina_Stringshare *tn = eolian_typedecl_c_type_get(src, tp);
eina_strbuf_append(buf, tn);
eina_stringshare_del(tn);
break;
diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua
index 473a587aec..056370695d 100644
--- a/src/bindings/luajit/eolian.lua
+++ b/src/bindings/luajit/eolian.lua
@@ -342,7 +342,7 @@ ffi.cdef [[
Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp);
const char *eolian_type_c_type_get(const Eolian_Type *tp);
- const char *eolian_typedecl_c_type_get(const Eolian_Typedecl *tp);
+ const char *eolian_typedecl_c_type_get(const Eolian_Unit *unit, const Eolian_Typedecl *tp);
const char *eolian_type_name_get(const Eolian_Type *tp);
const char *eolian_typedecl_name_get(const Eolian_Typedecl *tp);
@@ -624,8 +624,8 @@ M.Typedecl = ffi.metatype("Eolian_Typedecl", {
return eolian.eolian_typedecl_is_extern(self) ~= 0
end,
- c_type_get = function(self)
- local v = eolian.eolian_typedecl_c_type_get(self)
+ c_type_get = function(self, unit)
+ local v = eolian.eolian_typedecl_c_type_get(unit, self)
if v == nil then return nil end
return ffi_stringshare(v)
end,
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index dc8dfc3f9c..02ee4f9d91 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -1677,6 +1677,7 @@ EAPI Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp);
/*
* @brief Get the full C type name of the given type.
*
+ * @param[in] unit the unit to look in
* @param[in] tp the type declaration.
* @return The C type name assuming @c tp is not NULL.
*
@@ -1686,7 +1687,7 @@ EAPI Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp);
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_typedecl_c_type_get(const Eolian_Typedecl *tp);
+EAPI Eina_Stringshare *eolian_typedecl_c_type_get(const Eolian_Unit *unit, const Eolian_Typedecl *tp);
/*
* @brief Get the name of the given type declaration. Keep in mind that the
diff --git a/src/lib/eolian/database_type_api.c b/src/lib/eolian/database_type_api.c
index d1dcc4fed0..22d95eecec 100644
--- a/src/lib/eolian/database_type_api.c
+++ b/src/lib/eolian/database_type_api.c
@@ -368,14 +368,13 @@ eolian_type_c_type_get(const Eolian_Type *tp)
}
EAPI Eina_Stringshare *
-eolian_typedecl_c_type_get(const Eolian_Typedecl *tp)
+eolian_typedecl_c_type_get(const Eolian_Unit *unit, const Eolian_Typedecl *tp)
{
Eina_Stringshare *ret;
Eina_Strbuf *buf;
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
buf = eina_strbuf_new();
- /* FIXME: pass unit properly */
- database_typedecl_to_str(NULL, tp, buf);
+ database_typedecl_to_str(unit, tp, buf);
ret = eina_stringshare_add(eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
return ret;
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c
index 16645ab198..33acd989f5 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -333,7 +333,7 @@ START_TEST(eolian_typedef)
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"));
- fail_if(!(type_name = eolian_typedecl_c_type_get(tdl)));
+ fail_if(!(type_name = eolian_typedecl_c_type_get(unit, tdl)));
fail_if(strcmp(type_name, "typedef int Evas_Coord"));
eina_stringshare_del(type_name);
fail_if(!(type = eolian_typedecl_base_type_get(tdl)));