Add bt_ctf_trace_get_stream_count() and bt_ctf_trace_get_stream()
[babeltrace.git] / lib / ctf-ir / trace.c
index 9514c6d7ffa58a464d87ea7601af46551263856f..b850b4ffe6e35495fcc07bad3eea2c2105a41a75 100644 (file)
@@ -715,6 +715,36 @@ end:
        return ret;
 }
 
+int bt_ctf_trace_get_stream_count(struct bt_ctf_trace *trace)
+{
+       int ret;
+
+       if (!trace) {
+               ret = -1;
+               goto end;
+       }
+
+       ret = trace->streams->len;
+
+end:
+       return ret;
+}
+
+struct bt_ctf_stream *bt_ctf_trace_get_stream(struct bt_ctf_trace *trace,
+               int index)
+{
+       struct bt_ctf_stream *stream = NULL;
+
+       if (!trace || index >= trace->streams->len) {
+               goto end;
+       }
+
+       stream = bt_get(g_ptr_array_index(trace->streams, index));
+
+end:
+       return stream;
+}
+
 int bt_ctf_trace_get_stream_class_count(struct bt_ctf_trace *trace)
 {
        int ret;
This page took 0.024223 seconds and 4 git commands to generate.