X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fctf-ir%2Ftrace-internal.h;h=8b6c1f5a45ec6e99850b3c0de3a9478bb91a56e5;hb=5acf2ae6bdfb2bc6fa88e250a87ccc6ba3546d89;hp=a782d04c88e2b4295066eaf4b91e88988d33246e;hpb=e96045d4f186a5f3a7ed1f5585cf4cbfe890f579;p=babeltrace.git diff --git a/include/babeltrace/ctf-ir/trace-internal.h b/include/babeltrace/ctf-ir/trace-internal.h index a782d04c..8b6c1f5a 100644 --- a/include/babeltrace/ctf-ir/trace-internal.h +++ b/include/babeltrace/ctf-ir/trace-internal.h @@ -52,9 +52,9 @@ struct bt_ctf_trace { GString *name; int frozen; uuid_t uuid; - int byte_order; /* A value defined in Babeltrace's "endian.h" */ + enum bt_ctf_byte_order native_byte_order; struct bt_value *environment; - GPtrArray *clocks; /* Array of pointers to bt_ctf_clock */ + GPtrArray *clocks; /* Array of pointers to bt_ctf_clock_class */ GPtrArray *stream_classes; /* Array of ptrs to bt_ctf_stream_class */ GPtrArray *streams; /* Array of ptrs to bt_ctf_stream */ struct bt_ctf_field_type *packet_header_type; @@ -67,6 +67,7 @@ struct bt_ctf_trace { */ int valid; GPtrArray *listeners; /* Array of struct listener_wrapper */ + bool is_static; }; struct metadata_context { @@ -82,7 +83,42 @@ BT_HIDDEN struct bt_ctf_field_type *get_field_type(enum field_type_alias alias); BT_HIDDEN -int bt_ctf_trace_element_modification(struct bt_ctf_ir_element *element, +int bt_ctf_trace_object_modification(struct bt_ctf_object *object, void *trace_ptr); +BT_HIDDEN +bool bt_ctf_trace_has_clock_class(struct bt_ctf_trace *trace, + struct bt_ctf_clock_class *clock_class); + +/** +@brief User function type to use with bt_ctf_trace_add_listener(). + +@param[in] obj New CTF IR object which is part of the trace + class hierarchy. +@param[in] data User data. + +@prenotnull{obj} +*/ +typedef void (*bt_ctf_listener_cb)(struct bt_ctf_object *obj, void *data); + +/** +@brief Adds the trace class modification listener \p listener to + the CTF IR trace class \p trace_class. + +Once you add \p listener to \p trace_class, whenever \p trace_class +is modified, \p listener is called with the new element and with +\p data (user data). + +@param[in] trace_class Trace class to which to add \p listener. +@param[in] listener Modification listener function. +@param[in] data User data. +@returns 0 on success, or a negative value on error. + +@prenotnull{trace_class} +@prenotnull{listener} +@postrefcountsame{trace_class} +*/ +extern int bt_ctf_trace_add_listener(struct bt_ctf_trace *trace_class, + bt_ctf_listener_cb listener, void *data); + #endif /* BABELTRACE_CTF_IR_TRACE_INTERNAL_H */