From 4f88aa424de73dfd7b45aa258c618972a534110e Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Thu, 25 May 2017 15:17:29 +0200 Subject: [PATCH] eolian: use units in by_file getters for typedecls --- src/lib/eolian/Eolian.h | 9 ++++++--- src/lib/eolian/database_type_api.c | 9 ++++++--- src/tests/eolian/eolian_parsing.c | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h index d5fb437..aa8d942 100644 --- a/src/lib/eolian/Eolian.h +++ b/src/lib/eolian/Eolian.h @@ -1403,6 +1403,7 @@ EAPI const Eolian_Typedecl *eolian_typedecl_enum_get_by_name(const Eolian_Unit * /* * @brief Get an iterator to all aliases contained in a file. * + * @param[in] unit the unit to look in * @param[in] fname the file name without full path * @return the iterator or NULL * @@ -1410,11 +1411,12 @@ EAPI const Eolian_Typedecl *eolian_typedecl_enum_get_by_name(const Eolian_Unit * * * @ingroup Eolian */ -EAPI Eina_Iterator *eolian_typedecl_aliases_get_by_file(const char *fname); +EAPI Eina_Iterator *eolian_typedecl_aliases_get_by_file(const Eolian_Unit *unit, const char *fname); /* * @brief Get an iterator to all named structs contained in a file. * + * @param[in] unit the unit to look in * @param[in] fname the file name without full path * @return the iterator or NULL * @@ -1422,11 +1424,12 @@ EAPI Eina_Iterator *eolian_typedecl_aliases_get_by_file(const char *fname); * * @ingroup Eolian */ -EAPI Eina_Iterator *eolian_typedecl_structs_get_by_file(const char *fname); +EAPI Eina_Iterator *eolian_typedecl_structs_get_by_file(const Eolian_Unit *unit, const char *fname); /* * @brief Get an iterator to all enums contained in a file. * + * @param[in] unit the unit to look in * @param[in] fname the file name without full path * @return the iterator or NULL * @@ -1434,7 +1437,7 @@ EAPI Eina_Iterator *eolian_typedecl_structs_get_by_file(const char *fname); * * @ingroup Eolian */ -EAPI Eina_Iterator *eolian_typedecl_enums_get_by_file(const char *fname); +EAPI Eina_Iterator *eolian_typedecl_enums_get_by_file(const Eolian_Unit *unit, const char *fname); /* * @brief Get an iterator to all aliases in the Eolian database. diff --git a/src/lib/eolian/database_type_api.c b/src/lib/eolian/database_type_api.c index 2261fa7..4b16c58 100644 --- a/src/lib/eolian/database_type_api.c +++ b/src/lib/eolian/database_type_api.c @@ -43,7 +43,8 @@ eolian_typedecl_enum_get_by_name(const Eolian_Unit *unit EINA_UNUSED, } EAPI Eina_Iterator * -eolian_typedecl_aliases_get_by_file(const char *fname) +eolian_typedecl_aliases_get_by_file(const Eolian_Unit *unit EINA_UNUSED, + const char *fname) { if (!_aliasesf) return NULL; Eina_Stringshare *shr = eina_stringshare_add(fname); @@ -54,7 +55,8 @@ eolian_typedecl_aliases_get_by_file(const char *fname) } EAPI Eina_Iterator * -eolian_typedecl_structs_get_by_file(const char *fname) +eolian_typedecl_structs_get_by_file(const Eolian_Unit *unit EINA_UNUSED, + const char *fname) { if (!_structsf) return NULL; Eina_Stringshare *shr = eina_stringshare_add(fname); @@ -65,7 +67,8 @@ eolian_typedecl_structs_get_by_file(const char *fname) } EAPI Eina_Iterator * -eolian_typedecl_enums_get_by_file(const char *fname) +eolian_typedecl_enums_get_by_file(const Eolian_Unit *unit EINA_UNUSED, + const char *fname) { if (!_enumsf) return NULL; Eina_Stringshare *shr = eina_stringshare_add(fname); diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c index 5f47401..84813e7 100644 --- a/src/tests/eolian/eolian_parsing.c +++ b/src/tests/eolian/eolian_parsing.c @@ -369,7 +369,7 @@ START_TEST(eolian_typedef) eina_stringshare_del(type_name); /* List */ - fail_if(!(iter = eolian_typedecl_aliases_get_by_file("typedef.eo"))); + fail_if(!(iter = eolian_typedecl_aliases_get_by_file(unit, "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")); -- 2.7.4