ir: add weak reference to parent trace to bt_ctf_stream_class
[babeltrace.git] / formats / ctf / ir / stream-class.c
index 9ef5ca790d7bbf8c8fec5ed95620b2ec5f422cef..22ea8a5db6628d819153026dd8201b98487d345d 100644 (file)
@@ -666,6 +666,28 @@ end:
        return ret;
 }
 
+BT_HIDDEN
+int bt_ctf_stream_class_set_trace(struct bt_ctf_stream_class *stream_class,
+               struct bt_ctf_trace *trace)
+{
+       int ret = 0;
+
+       if (!stream_class) {
+               ret = -1;
+               goto end;
+       }
+
+       if (stream_class->trace && trace) {
+               /* Already attached to a trace */
+               ret = -1;
+               goto end;
+       }
+
+       stream_class->trace = trace;
+end:
+       return ret;
+}
+
 static
 void bt_ctf_stream_class_destroy(struct bt_ctf_ref *ref)
 {
This page took 0.024432 seconds and 4 git commands to generate.