lib: add "borrow" functions where "get" functions exist
[babeltrace.git] / include / babeltrace / graph / notification-stream.h
index bb4c5d603f84d19791c8a8b93d5c654b4f4998a0..5deff05b74a15e4b0ae67ed72dc9b198898d6a77 100644 (file)
@@ -27,6 +27,9 @@
  * SOFTWARE.
  */
 
+/* For bt_get() */
+#include <babeltrace/ref.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -40,12 +43,26 @@ extern struct bt_notification *bt_notification_stream_begin_create(
 extern struct bt_notification *bt_notification_stream_end_create(
                struct bt_stream *stream);
 
-extern struct bt_stream *bt_notification_stream_begin_get_stream(
+extern struct bt_stream *bt_notification_stream_begin_borrow_stream(
                struct bt_notification *notification);
 
-extern struct bt_stream *bt_notification_stream_end_get_stream(
+static inline
+struct bt_stream *bt_notification_stream_begin_get_stream(
+               struct bt_notification *notification)
+{
+       return bt_get(bt_notification_stream_begin_borrow_stream(notification));
+}
+
+extern struct bt_stream *bt_notification_stream_end_borrow_stream(
                struct bt_notification *notification);
 
+static inline
+struct bt_stream *bt_notification_stream_end_get_stream(
+               struct bt_notification *notification)
+{
+       return bt_get(bt_notification_stream_end_borrow_stream(notification));
+}
+
 #ifdef __cplusplus
 }
 #endif
This page took 0.023277 seconds and 4 git commands to generate.