X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=include%2Fbabeltrace%2Ftypes.h;h=fa543bf2ddaed57323aea6d4331ce2ce7586e477;hp=059c371dea37cd2323b74a1d29d256ef338997d0;hb=aa6bffaea450106c60fc1292152bd94a270fd243;hpb=b1a2f5806630289aa0b85edbb7f7c581cfa26178 diff --git a/include/babeltrace/types.h b/include/babeltrace/types.h index 059c371d..fa543bf2 100644 --- a/include/babeltrace/types.h +++ b/include/babeltrace/types.h @@ -31,6 +31,7 @@ /* Preallocate this many fields for structures */ #define DEFAULT_NR_STRUCT_FIELDS 8 +struct ctf_stream_class; struct stream_pos; struct format; struct definition; @@ -102,6 +103,7 @@ struct definition { int index; /* Position of the definition in its container */ GQuark name; /* Field name in its container (or 0 if unset) */ int ref; /* number of references to the definition */ + GQuark path; }; typedef int (*rw_dispatch)(struct stream_pos *pos, @@ -111,6 +113,8 @@ typedef int (*rw_dispatch)(struct stream_pos *pos, struct stream_pos { /* read/write dispatch table. Specific to plugin used for stream. */ rw_dispatch *rw_table; /* rw dispatch table */ + int (*event_cb)(struct stream_pos *pos, + struct ctf_stream_class *stream_class); }; static inline @@ -359,6 +363,14 @@ void set_dynamic_definition_scope(struct definition *definition, const char *root_name); void free_definition_scope(struct definition_scope *scope); +GQuark new_definition_path(struct definition_scope *parent_scope, GQuark field_name); + +static inline +int compare_definition_path(struct definition *definition, GQuark path) +{ + return definition->path == path; +} + void declaration_ref(struct declaration *declaration); void declaration_unref(struct declaration *declaration); @@ -493,4 +505,4 @@ int sequence_rw(struct stream_pos *pos, struct definition *definition); */ void append_scope_path(const char *path, GArray *q); -#endif /* _BABELTRACE_declarationS_H */ +#endif /* _BABELTRACE_TYPES_H */