summaryrefslogtreecommitdiff
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
parent13fd94dbf2e8fd726ec7c0335d9f9273d651988d (diff)
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,
18 { 18 {
19 case EOLIAN_TYPEDECL_ALIAS: 19 case EOLIAN_TYPEDECL_ALIAS:
20 { 20 {
21 Eina_Stringshare *tn = eolian_typedecl_c_type_get(tp); 21 Eina_Stringshare *tn = eolian_typedecl_c_type_get(src, tp);
22 eina_strbuf_append(buf, tn); 22 eina_strbuf_append(buf, tn);
23 eina_stringshare_del(tn); 23 eina_stringshare_del(tn);
24 break; 24 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 [[
342 Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp); 342 Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp);
343 343
344 const char *eolian_type_c_type_get(const Eolian_Type *tp); 344 const char *eolian_type_c_type_get(const Eolian_Type *tp);
345 const char *eolian_typedecl_c_type_get(const Eolian_Typedecl *tp); 345 const char *eolian_typedecl_c_type_get(const Eolian_Unit *unit, const Eolian_Typedecl *tp);
346 346
347 const char *eolian_type_name_get(const Eolian_Type *tp); 347 const char *eolian_type_name_get(const Eolian_Type *tp);
348 const char *eolian_typedecl_name_get(const Eolian_Typedecl *tp); 348 const char *eolian_typedecl_name_get(const Eolian_Typedecl *tp);
@@ -624,8 +624,8 @@ M.Typedecl = ffi.metatype("Eolian_Typedecl", {
624 return eolian.eolian_typedecl_is_extern(self) ~= 0 624 return eolian.eolian_typedecl_is_extern(self) ~= 0
625 end, 625 end,
626 626
627 c_type_get = function(self) 627 c_type_get = function(self, unit)
628 local v = eolian.eolian_typedecl_c_type_get(self) 628 local v = eolian.eolian_typedecl_c_type_get(unit, self)
629 if v == nil then return nil end 629 if v == nil then return nil end
630 return ffi_stringshare(v) 630 return ffi_stringshare(v)
631 end, 631 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);
1677/* 1677/*
1678 * @brief Get the full C type name of the given type. 1678 * @brief Get the full C type name of the given type.
1679 * 1679 *
1680 * @param[in] unit the unit to look in
1680 * @param[in] tp the type declaration. 1681 * @param[in] tp the type declaration.
1681 * @return The C type name assuming @c tp is not NULL. 1682 * @return The C type name assuming @c tp is not NULL.
1682 * 1683 *
@@ -1686,7 +1687,7 @@ EAPI Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp);
1686 * 1687 *
1687 * @ingroup Eolian 1688 * @ingroup Eolian
1688 */ 1689 */
1689EAPI Eina_Stringshare *eolian_typedecl_c_type_get(const Eolian_Typedecl *tp); 1690EAPI Eina_Stringshare *eolian_typedecl_c_type_get(const Eolian_Unit *unit, const Eolian_Typedecl *tp);
1690 1691
1691/* 1692/*
1692 * @brief Get the name of the given type declaration. Keep in mind that the 1693 * @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)
368} 368}
369 369
370EAPI Eina_Stringshare * 370EAPI Eina_Stringshare *
371eolian_typedecl_c_type_get(const Eolian_Typedecl *tp) 371eolian_typedecl_c_type_get(const Eolian_Unit *unit, const Eolian_Typedecl *tp)
372{ 372{
373 Eina_Stringshare *ret; 373 Eina_Stringshare *ret;
374 Eina_Strbuf *buf; 374 Eina_Strbuf *buf;
375 EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL); 375 EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
376 buf = eina_strbuf_new(); 376 buf = eina_strbuf_new();
377 /* FIXME: pass unit properly */ 377 database_typedecl_to_str(unit, tp, buf);
378 database_typedecl_to_str(NULL, tp, buf);
379 ret = eina_stringshare_add(eina_strbuf_string_get(buf)); 378 ret = eina_stringshare_add(eina_strbuf_string_get(buf));
380 eina_strbuf_free(buf); 379 eina_strbuf_free(buf);
381 return ret; 380 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)
333 fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_ALIAS); 333 fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_ALIAS);
334 fail_if(!(type_name = eolian_typedecl_name_get(tdl))); 334 fail_if(!(type_name = eolian_typedecl_name_get(tdl)));
335 fail_if(strcmp(type_name, "Coord")); 335 fail_if(strcmp(type_name, "Coord"));
336 fail_if(!(type_name = eolian_typedecl_c_type_get(tdl))); 336 fail_if(!(type_name = eolian_typedecl_c_type_get(unit, tdl)));
337 fail_if(strcmp(type_name, "typedef int Evas_Coord")); 337 fail_if(strcmp(type_name, "typedef int Evas_Coord"));
338 eina_stringshare_del(type_name); 338 eina_stringshare_del(type_name);
339 fail_if(!(type = eolian_typedecl_base_type_get(tdl))); 339 fail_if(!(type = eolian_typedecl_base_type_get(tdl)));