CTF-IR: Support unnamed streams
[babeltrace.git] / formats / ctf / ir / stream-class.c
index 18ae57eaccadc7ba733d8d36288af8b0f3f578a4..116befab0b6e3444bdfe925415ece33e4fe54296 100644 (file)
@@ -51,7 +51,7 @@ struct bt_ctf_stream_class *bt_ctf_stream_class_create(const char *name)
        int ret;
        struct bt_ctf_stream_class *stream_class = NULL;
 
-       if (!name || !strlen(name) || bt_ctf_validate_identifier(name)) {
+       if (name && bt_ctf_validate_identifier(name)) {
                goto error;
        }
 
@@ -101,6 +101,21 @@ end:
        return name;
 }
 
+int bt_ctf_stream_class_set_name(struct bt_ctf_stream_class *stream_class,
+               const char *name)
+{
+       int ret = 0;
+
+       if (!stream_class || stream_class->frozen) {
+               ret = -1;
+               goto end;
+       }
+
+       g_string_assign(stream_class->name, name);
+end:
+       return ret;
+}
+
 struct bt_ctf_clock *bt_ctf_stream_class_get_clock(
                struct bt_ctf_stream_class *stream_class)
 {
This page took 0.024005 seconds and 4 git commands to generate.