lib: make public reference count functions have strict types
[babeltrace.git] / include / babeltrace / trace-ir / stream-const.h
index e204f4c92687c07619f476b295b72e216a9ceeaa..328441c8fc6fc7ef745b551fdb96181f8685ddea 100644 (file)
@@ -47,6 +47,23 @@ extern const char *bt_stream_get_name(const struct bt_stream *stream);
 
 extern uint64_t bt_stream_get_id(const struct bt_stream *stream);
 
+extern void bt_stream_get_ref(const struct bt_stream *stream);
+
+extern void bt_stream_put_ref(const struct bt_stream *stream);
+
+#define BT_STREAM_PUT_REF_AND_RESET(_var)              \
+       do {                                            \
+               bt_stream_put_ref(_var);                \
+               (_var) = NULL;                          \
+       } while (0)
+
+#define BT_STREAM_MOVE_REF(_var_dst, _var_src)         \
+       do {                                            \
+               bt_stream_put_ref(_var_dst);            \
+               (_var_dst) = (_var_src);                \
+               (_var_src) = NULL;                      \
+       } while (0)
+
 #ifdef __cplusplus
 }
 #endif
This page took 0.023509 seconds and 4 git commands to generate.