From: Jérémie Galarneau Date: Tue, 6 Jan 2015 22:38:58 +0000 (-0500) Subject: Add missing stream class accessor X-Git-Tag: v2.0.0-pre1~1433 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=3baf0856bdb8b7b278527f43576631b7f456a0d7 Add missing stream class accessor Signed-off-by: Jérémie Galarneau --- diff --git a/formats/ctf/ir/stream.c b/formats/ctf/ir/stream.c index 18c9edfd..d291981e 100644 --- a/formats/ctf/ir/stream.c +++ b/formats/ctf/ir/stream.c @@ -355,6 +355,21 @@ void bt_ctf_stream_set_trace(struct bt_ctf_stream *stream, stream->trace = trace; } +struct bt_ctf_stream_class *bt_ctf_stream_get_class( + struct bt_ctf_stream *stream) +{ + struct bt_ctf_stream_class *stream_class = NULL; + + if (!stream) { + goto end; + } + + stream_class = stream->stream_class; + bt_ctf_stream_class_get(stream_class); +end: + return stream_class; +} + int bt_ctf_stream_get_discarded_events_count( struct bt_ctf_stream *stream, uint64_t *count) { diff --git a/include/babeltrace/ctf-ir/stream.h b/include/babeltrace/ctf-ir/stream.h index 73fc5369..f302583d 100644 --- a/include/babeltrace/ctf-ir/stream.h +++ b/include/babeltrace/ctf-ir/stream.h @@ -39,6 +39,16 @@ extern "C" { struct bt_ctf_event; struct bt_ctf_stream; +/* + * bt_ctf_stream_get_stream_class: get a stream's class. + * + * @param stream Stream instance. + * + * Returns the stream's class, NULL on error. + */ +extern struct bt_ctf_stream_class *bt_ctf_stream_get_class( + struct bt_ctf_stream *stream); + /* * bt_ctf_stream_get_discarded_events_count: get the number of discarded * events associated with this stream.