X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=include%2Fbabeltrace%2Ftypes.h;h=718d391a0dc9a90aa405da80cc263e8f2d421fd6;hp=3d396c86b03b5d161ab35bace26cc2b965ad4eed;hb=ac88af7594050b366fadec583e60ac26bb2aff75;hpb=6ee5115efee00adab0c8f384bc9c0f38fed8a84e diff --git a/include/babeltrace/types.h b/include/babeltrace/types.h index 3d396c86..718d391a 100644 --- a/include/babeltrace/types.h +++ b/include/babeltrace/types.h @@ -91,6 +91,8 @@ struct declaration; struct declaration_scope { /* Hash table mapping type name GQuark to struct type */ GHashTable *types; + /* Hash table mapping field name GQuark to struct declaration */ + GHashTable *declarations; struct declaration_scope *parent_scope; }; @@ -229,6 +231,7 @@ struct type_field { }; struct field { + GQuark name; struct declaration *declaration; }; @@ -287,9 +290,14 @@ struct declaration_sequence { struct field current_element; /* struct field */ }; -struct type *lookup_type(GQuark qname, struct declaration_scope *scope); +struct type *lookup_type(GQuark type_name, struct declaration_scope *scope); int register_type(struct type *type, struct declaration_scope *scope); +struct declaration * + lookup_declaration(GQuark field_name, struct declaration_scope *scope); +int register_declaration(GQuark field_name, struct declaration *declaration, + struct declaration_scope *scope); + void type_ref(struct type *type); void type_unref(struct type *type);