lib: make public reference count functions have strict types
[babeltrace.git] / include / babeltrace / graph / component-const.h
index 1877988cdffcf66639c7b2616dd949d67089687b..a737d0d59ae79c5bcefc6d5831b6ac2e51164532 100644 (file)
@@ -84,6 +84,23 @@ bt_bool bt_component_is_sink(const struct bt_component *component)
 extern bt_bool bt_component_graph_is_canceled(
                const struct bt_component *component);
 
+extern void bt_component_get_ref(const struct bt_component *component);
+
+extern void bt_component_put_ref(const struct bt_component *component);
+
+#define BT_COMPONENT_PUT_REF_AND_RESET(_var)           \
+       do {                                            \
+               bt_component_put_ref(_var);             \
+               (_var) = NULL;                          \
+       } while (0)
+
+#define BT_COMPONENT_MOVE_REF(_var_dst, _var_src)      \
+       do {                                            \
+               bt_component_put_ref(_var_dst);         \
+               (_var_dst) = (_var_src);                \
+               (_var_src) = NULL;                      \
+       } while (0)
+
 #ifdef __cplusplus
 }
 #endif
This page took 0.023212 seconds and 4 git commands to generate.