Declaration scope lookup
[babeltrace.git] / include / babeltrace / types.h
index fe7ab62950f10604a1f4971b03f901bb6ab71f3c..718d391a0dc9a90aa405da80cc263e8f2d421fd6 100644 (file)
@@ -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,7 +231,8 @@ struct type_field {
 };
 
 struct field {
-       struct declaration *type;
+       GQuark name;
+       struct declaration *declaration;
 };
 
 struct type_struct {
@@ -255,7 +258,7 @@ struct declaration_variant {
        struct declaration p;
        struct type_variant *type;
        struct declaration_scope *scope;
-       struct declaration *tag;
+       struct declaration *enum_tag;
        GArray *fields;                 /* Array of struct field */
        struct field *current_field;    /* Last field read */
 };
@@ -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);
 
This page took 0.0241170000000001 seconds and 4 git commands to generate.