bt_clock_class_create(): accept mandatory trace class
[babeltrace.git] / lib / trace-ir / stream.c
index a75aef344b66ee0c23e1e35f9b8cffbed926610d..966d1032d8468cca468fbfd9d7d32b8b808743b4 100644 (file)
@@ -1,8 +1,7 @@
 /*
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
  * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
  * in the Software without restriction, including without limitation the rights
@@ -34,7 +33,6 @@
 #include <babeltrace/trace-ir/trace.h>
 #include <babeltrace/trace-ir/trace-internal.h>
 #include <babeltrace/trace-ir/packet-internal.h>
-#include <babeltrace/object.h>
 #include <babeltrace/compiler-internal.h>
 #include <babeltrace/align-internal.h>
 #include <babeltrace/assert-internal.h>
@@ -209,7 +207,8 @@ const char *bt_stream_get_name(const struct bt_stream *stream)
        return stream->name.value;
 }
 
-int bt_stream_set_name(struct bt_stream *stream, const char *name)
+enum bt_stream_status bt_stream_set_name(struct bt_stream *stream,
+               const char *name)
 {
        BT_ASSERT_PRE_NON_NULL(stream, "Clock class");
        BT_ASSERT_PRE_NON_NULL(name, "Name");
@@ -217,7 +216,7 @@ int bt_stream_set_name(struct bt_stream *stream, const char *name)
        g_string_assign(stream->name.str, name);
        stream->name.value = stream->name.str->str;
        BT_LIB_LOGV("Set stream class's name: %!+s", stream);
-       return 0;
+       return BT_STREAM_STATUS_OK;
 }
 
 uint64_t bt_stream_get_id(const struct bt_stream *stream)
@@ -234,3 +233,13 @@ void _bt_stream_freeze(const struct bt_stream *stream)
        BT_LIB_LOGD("Freezing stream: %!+s", stream);
        ((struct bt_stream *) stream)->frozen = true;
 }
+
+void bt_stream_get_ref(const struct bt_stream *stream)
+{
+       bt_object_get_ref(stream);
+}
+
+void bt_stream_put_ref(const struct bt_stream *stream)
+{
+       bt_object_put_ref(stream);
+}
This page took 0.033914 seconds and 4 git commands to generate.