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)
{
extern int bt_ctf_trace_add_clock(struct bt_ctf_trace *trace,
struct bt_ctf_clock *clock);
+/*
+ * bt_ctf_trace_get_clock_count: get the number of clocks
+ * associated to the trace.
+ *
+ * @param trace Trace instance.
+ *
+ * Returns the clock count on success, a negative value on error.
+ */
+extern int bt_ctf_trace_get_clock_count(struct bt_ctf_trace *trace);
+
+/*
+ * bt_ctf_trace_get_clock: get a trace's clock at index.
+ *
+ * @param trace Trace instance.
+ * @param index Index of the clock in the given trace.
+ *
+ * Return a clock instance on success, NULL on error.
+ */
+extern struct bt_ctf_clock *bt_ctf_trace_get_clock(
+ struct bt_ctf_trace *trace, int index);
+
/*
* bt_ctf_trace_get_metadata_string: get metadata string.
*