q66 pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3bffb5fa1de4946b95af73affe9d8b417d16152d
commit 3bffb5fa1de4946b95af73affe9d8b417d16152d Author: Daniel Kolesa <[email protected]> Date: Wed Jul 9 13:01:53 2014 +0100 eolian: support for structs in eo_parser_dump --- src/lib/eolian/eo_parser.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index 91eb8a0..6d6fb1f 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -1053,12 +1053,18 @@ parse_chunk(Eo_Lexer *ls, Eina_Bool eot) static char *_accessor_type_str[ACCESSOR_TYPE_LAST] = { "setter", "getter" }; static char * _param_way_str[ PARAM_WAY_LAST] = { "IN", "OUT", "INOUT" }; -typedef struct +static void _print_type(FILE *f, Eo_Type_Def *tp); + +static Eina_Bool +_print_field(const Eina_Hash *hash EINA_UNUSED, const void *key, void *data, + void *fdata) { - Eina_List *subtypes; - Eina_Stringshare *name; - Eina_Bool is_own :1; -} _Parameter_Type; + FILE *f = (FILE*)fdata; + fprintf(f, "%s: ", (const char*)key); + _print_type(f, (Eo_Type_Def*)data); + fputs("; ", f); + return EINA_TRUE; +} static void _print_type(FILE *f, Eo_Type_Def *tp) @@ -1096,6 +1102,14 @@ _print_type(FILE *f, Eo_Type_Def *tp) } fputc(')', f); } + else if (tp->type == EOLIAN_TYPE_STRUCT) + { + fputs("struct ", f); + if (tp->name) fprintf(f, "%s ", tp->name); + fputs("{ ", f); + eina_hash_foreach(tp->fields, _print_field, f); + fputs("}", f); + } if (tp->is_own) fputc(')', f); if (tp->is_const) --
