eolian: support for structs in eo_parser_dump
This commit is contained in:
parent
881a8754ab
commit
3bffb5fa1d
|
@ -1053,12 +1053,18 @@ parse_chunk(Eo_Lexer *ls, Eina_Bool eot)
|
||||||
static char *_accessor_type_str[ACCESSOR_TYPE_LAST] = { "setter", "getter" };
|
static char *_accessor_type_str[ACCESSOR_TYPE_LAST] = { "setter", "getter" };
|
||||||
static char * _param_way_str[ PARAM_WAY_LAST] = { "IN", "OUT", "INOUT" };
|
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;
|
FILE *f = (FILE*)fdata;
|
||||||
Eina_Stringshare *name;
|
fprintf(f, "%s: ", (const char*)key);
|
||||||
Eina_Bool is_own :1;
|
_print_type(f, (Eo_Type_Def*)data);
|
||||||
} _Parameter_Type;
|
fputs("; ", f);
|
||||||
|
return EINA_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_print_type(FILE *f, Eo_Type_Def *tp)
|
_print_type(FILE *f, Eo_Type_Def *tp)
|
||||||
|
@ -1096,6 +1102,14 @@ _print_type(FILE *f, Eo_Type_Def *tp)
|
||||||
}
|
}
|
||||||
fputc(')', f);
|
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)
|
if (tp->is_own)
|
||||||
fputc(')', f);
|
fputc(')', f);
|
||||||
if (tp->is_const)
|
if (tp->is_const)
|
||||||
|
|
Loading…
Reference in New Issue