X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fctf-ir%2Ftrace.h;h=29b60980cac2bbb37d9c52058517b27c419ca860;hb=4841ccc167f5f99267a0c129a1e79214b60f553c;hp=953810342b10896b4c85364bb8d1e589be8ce6f0;hpb=a7c415355d7e6def65028b131c8cb2d5586cd2a0;p=babeltrace.git diff --git a/include/babeltrace/ctf-ir/trace.h b/include/babeltrace/ctf-ir/trace.h index 95381034..29b60980 100644 --- a/include/babeltrace/ctf-ir/trace.h +++ b/include/babeltrace/ctf-ir/trace.h @@ -31,7 +31,7 @@ */ #include -#include +#include #include #ifdef __cplusplus @@ -84,8 +84,8 @@ extern struct bt_ctf_stream *bt_ctf_trace_create_stream( * If a value exists in the environment for the specified name, it is * replaced by the new value. * - * The value parameter _must_ be either an integer object or a - * string object. Other object types are not supported. + * The value parameter _must_ be either an integer value object or a + * string value object. Other object types are not supported. * * @param trace Trace instance. * @param name Name of the environment field (will be copied). @@ -95,7 +95,7 @@ extern struct bt_ctf_stream *bt_ctf_trace_create_stream( */ extern int bt_ctf_trace_set_environment_field( struct bt_ctf_trace *trace, const char *name, - struct bt_object *value); + struct bt_value *value); /* * bt_ctf_trace_set_environment_field_string: sets a string environment @@ -167,14 +167,14 @@ bt_ctf_trace_get_environment_field_name(struct bt_ctf_trace *trace, * * Get an environment field's value (an object). The returned object's * reference count is incremented. When done with the object, the caller - * must call bt_object_put() on it. + * must call bt_value_put() on it. * * @param trace Trace instance. * @param index Index of the environment field. * * Returns the environment field's object value, NULL on error. */ -extern struct bt_object * +extern struct bt_value * bt_ctf_trace_get_environment_field_value(struct bt_ctf_trace *trace, int index); @@ -184,14 +184,14 @@ bt_ctf_trace_get_environment_field_value(struct bt_ctf_trace *trace, * * Get an environment field's value (an object) by its field name. The * returned object's reference count is incremented. When done with the - * object, the caller must call bt_object_put() on it. + * object, the caller must call bt_value_put() on it. * * @param trace Trace instance. * @param name Environment field's name * * Returns the environment field's object value, NULL on error. */ -extern struct bt_object * +extern struct bt_value * bt_ctf_trace_get_environment_field_value_by_name(struct bt_ctf_trace *trace, const char *name); @@ -264,6 +264,17 @@ extern int bt_ctf_trace_get_stream_class_count(struct bt_ctf_trace *trace); extern struct bt_ctf_stream_class *bt_ctf_trace_get_stream_class( struct bt_ctf_trace *trace, int index); +/* + * bt_ctf_trace_get_stream_class_by_id: get a trace's stream class by ID. + * + * @param trace Trace instance. + * @param index ID of the stream class in the given trace. + * + * Return a stream class on success, NULL on error. + */ +extern struct bt_ctf_stream_class *bt_ctf_trace_get_stream_class_by_id( + struct bt_ctf_trace *trace, uint32_t id); + /* * bt_ctf_trace_get_clock_by_name: get a trace's clock by name * @@ -346,6 +357,8 @@ extern int bt_ctf_trace_set_packet_header_type(struct bt_ctf_trace *trace, * bt_ctf_trace_get and bt_ctf_trace_put: increment and decrement the * trace's reference count. * + * You may also use bt_ctf_get() and bt_ctf_put() with trace objects. + * * These functions ensure that the trace won't be destroyed while it * is in use. The same number of get and put (plus one extra put to * release the initial reference done at creation) have to be done to