path: root/src/lib/eolian/eolian_database.h
diff options
authorDaniel Kolesa <>2019-01-29 15:46:05 +0100
committerDaniel Kolesa <>2019-02-28 00:52:14 +0100
commita9360222b053f38c8fd0f2ee21fc2f3ea94430d7 (patch)
treeb41d6444a59455449c59e29ae3bc994ccf816576 /src/lib/eolian/eolian_database.h
parent0e027980f6c275f1a56ae550679010d689c91b23 (diff)
eolian: add support for inlist structs
This adds support for inlist structs, a special type of struct that can only be used with inlists. This differs from regular structs in a couple ways: 1) They are stored separately. Just like structs, enums, aliases have their own storage, so do inlist structs. 2) They can't be @extern, nor they can be opaque. 3) They are their own type of typedecl. 4) When they contain only one field, this field must be a value type always, cannot be a pointer. Like regular structs, they can have arbitrary fields, and they can have a pre-set free function via @free(). In C, the inlist structs will be generated exactly like ordinary ones, except they will have EINA_INLIST before the first field. Other binding generators can deal with them as they wish, for example to provide high level interfaces to them. This does not yet do the plumbing necessary to hook these into the type system, nor it adds generator support. @feature
Diffstat (limited to 'src/lib/eolian/eolian_database.h')
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index b70f2b4..fd15d64 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -44,6 +44,7 @@ struct _Eolian_Unit
44 Eina_Hash *aliases; 44 Eina_Hash *aliases;
45 Eina_Hash *structs; 45 Eina_Hash *structs;
46 Eina_Hash *enums; 46 Eina_Hash *enums;
47 Eina_Hash *inlists;
47 Eina_Hash *objects; 48 Eina_Hash *objects;
48}; 49};
49 50
@@ -57,6 +58,7 @@ typedef struct _Eolian_State_Area
57 Eina_Hash *aliases_f; 58 Eina_Hash *aliases_f;
58 Eina_Hash *structs_f; 59 Eina_Hash *structs_f;
59 Eina_Hash *enums_f; 60 Eina_Hash *enums_f;
61 Eina_Hash *inlists_f;
60 Eina_Hash *globals_f; 62 Eina_Hash *globals_f;
61 Eina_Hash *constants_f; 63 Eina_Hash *constants_f;
62 Eina_Hash *objects_f; 64 Eina_Hash *objects_f;
@@ -407,7 +409,7 @@ Eolian_Object_Type database_doc_token_ref_resolve(const Eolian_Doc_Token *tok,
407/* types */ 409/* types */
408 410
409void database_type_add(Eolian_Unit *unit, Eolian_Typedecl *tp); 411void database_type_add(Eolian_Unit *unit, Eolian_Typedecl *tp);
410void database_struct_add(Eolian_Unit *unit, Eolian_Typedecl *tp); 412void database_struct_add(Eolian_Unit *unit, Eolian_Typedecl *tp, Eina_Bool is_inlist);
411void database_enum_add(Eolian_Unit *unit, Eolian_Typedecl *tp); 413void database_enum_add(Eolian_Unit *unit, Eolian_Typedecl *tp);
412void database_type_del(Eolian_Type *tp); 414void database_type_del(Eolian_Type *tp);
413void database_typedecl_del(Eolian_Typedecl *tp); 415void database_typedecl_del(Eolian_Typedecl *tp);