Add clock accessor to CTF IR Trace
[babeltrace.git] / formats / ctf / ir / trace.c
index 073e4abffb83c8ba11f802e5ce29d0949e312fa1..1ad37bec5ee85b5d7e7c65d885580d29b9726806 100644 (file)
@@ -282,6 +282,34 @@ end:
        return ret;
 }
 
+int bt_ctf_trace_get_clock_count(struct bt_ctf_trace *trace)
+{
+       int ret = -1;
+
+       if (!trace) {
+               goto end;
+       }
+
+       ret = trace->clocks->len;
+end:
+       return ret;
+}
+
+struct bt_ctf_clock *bt_ctf_trace_get_clock(struct bt_ctf_trace *trace,
+               int index)
+{
+       struct bt_ctf_clock *clock = NULL;
+
+       if (!trace || index < 0 || index >= trace->clocks->len) {
+               goto end;
+       }
+
+       clock = g_ptr_array_index(trace->clocks, index);
+       bt_ctf_clock_get(clock);
+end:
+       return clock;
+}
+
 BT_HIDDEN
 const char *get_byte_order_string(int byte_order)
 {
This page took 0.026789 seconds and 4 git commands to generate.