From 3baf0856bdb8b7b278527f43576631b7f456a0d7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 6 Jan 2015 17:38:58 -0500 Subject: [PATCH] Add missing stream class accessor MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- formats/ctf/ir/stream.c | 15 +++++++++++++++ include/babeltrace/ctf-ir/stream.h | 10 ++++++++++ 2 files changed, 25 insertions(+) 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. -- 2.34.1