X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=include%2Fbabeltrace%2Ftypes.h;h=885a6a1b85c07ff1195e85b051606b8d6e5fb87f;hp=ed2aae87f054727342629f30121d8c08fd44af5d;hb=05c749e538ebc3a4f6735f62d022655cf92fc17e;hpb=3888a159635f33766e433d76453a0a43a8c3e971 diff --git a/include/babeltrace/types.h b/include/babeltrace/types.h index ed2aae87..885a6a1b 100644 --- a/include/babeltrace/types.h +++ b/include/babeltrace/types.h @@ -105,6 +105,12 @@ struct definition_scope { /* Hash table mapping field name GQuark to "struct definition" */ GHashTable *definitions; struct definition_scope *parent_scope; + /* + * Complete "path" leading to this definition scope. + * Includes trace/stream/event '.' field name '.' field name '.' .... + * Array of GQuark elements (which are each separated by dots). + */ + GArray *scope_path; /* array of GQuark */ }; enum ctf_type_id { @@ -131,7 +137,8 @@ struct declaration { void (*declaration_free)(struct declaration *declaration); struct definition * (*definition_new)(struct declaration *declaration, - struct definition_scope *parent_scope); + struct definition_scope *parent_scope, + GQuark field_name, int index); /* * definition_free called with definition ref is decremented to 0. */ @@ -147,6 +154,7 @@ struct declaration { struct definition { struct declaration *declaration; + int index; /* Position of the definition in its container */ int ref; /* number of references to the definition */ }; @@ -360,13 +368,15 @@ void free_declaration_scope(struct declaration_scope *scope); * definition scopes. */ struct definition * - lookup_field_definition(GQuark field_name, - struct definition_scope *scope); + lookup_definition(GArray *cur_path, /* array of GQuark */ + GArray *lookup_path, /* array of GQuark */ + struct definition_scope *scope); int register_field_definition(GQuark field_name, struct definition *definition, struct definition_scope *scope); struct definition_scope * - new_definition_scope(struct definition_scope *parent_scope); + new_definition_scope(struct definition_scope *parent_scope, + GQuark field_name); void free_definition_scope(struct definition_scope *scope); void declaration_ref(struct declaration *declaration);