eolian: generate underscored structs as well as correct opaque struct typedefs

This commit is contained in:
Daniel Kolesa 2015-05-13 11:14:49 +01:00
parent 7a614c80f3
commit ec73644cb6
2 changed files with 5 additions and 5 deletions

View File

@ -87,11 +87,11 @@ _type_generate(const Eolian_Type *tp, Eina_Bool in_typedef, Eina_Bool full)
char *name = _concat_name(tp);
if ((in_typedef && name) || tp_type == EOLIAN_TYPE_STRUCT_OPAQUE || !full)
{
eina_strbuf_append_printf(buf, "struct %s", name);
eina_strbuf_append_printf(buf, "typedef struct _%s %s", name, name);
free(name);
break;
}
eina_strbuf_append_printf(buf, "typedef struct\n{\n");
eina_strbuf_append_printf(buf, "typedef struct _%s\n{\n", name);
Eina_Iterator *members = eolian_type_struct_fields_get(tp);
EINA_ITERATOR_FOREACH(members, member)
{

View File

@ -11,18 +11,18 @@ typedef Eo Struct;
#ifndef _STRUCT_EO_TYPES
#define _STRUCT_EO_TYPES
typedef struct
typedef struct _Named
{
int field;
const char *something;
} Named;
typedef struct
typedef struct _Another
{
Named field;
} Another;
struct Opaque;
typedef struct _Opaque Opaque;
#endif