-BT_HIDDEN
-int bt_ctf_event_class_set_stream_class(struct bt_ctf_event_class *event_class,
- struct bt_ctf_stream_class *stream_class)
-{
- int ret = 0;
-
- if (!event_class) {
- ret = -1;
- goto end;
- }
-
- /* Allow a NULL stream_class to unset the current stream_class */
- if (stream_class && event_class->stream_class) {
- ret = -1;
- goto end;
- }
-
- event_class->stream_class = stream_class;
- /*
- * We don't get() the stream_class since doing so would introduce
- * a circular ownership between event classes and stream classes.
- *
- * A stream class will always unset itself from its events before
- * being destroyed. This ensures that a user won't get a pointer
- * to a stale stream class instance from an event class.
- */
-end:
- return ret;
-}
-