lib: make public reference count functions have strict types
[babeltrace.git] / include / babeltrace / graph / component-source-const.h
index daaaa4ef78e5368c79b05471df67eecbac994225..7c16d03e15453bbfdf320298af13463b8e03efcb 100644 (file)
@@ -52,6 +52,25 @@ extern const struct bt_port_output *
 bt_component_source_borrow_output_port_by_index_const(
                const struct bt_component_source *component, uint64_t index);
 
+extern void bt_component_source_get_ref(
+               const struct bt_component_source *component_source);
+
+extern void bt_component_source_put_ref(
+               const struct bt_component_source *component_source);
+
+#define BT_COMPONENT_SOURCE_PUT_REF_AND_RESET(_var)            \
+       do {                                                    \
+               bt_component_source_put_ref(_var);              \
+               (_var) = NULL;                                  \
+       } while (0)
+
+#define BT_COMPONENT_SOURCE_MOVE_REF(_var_dst, _var_src)       \
+       do {                                                    \
+               bt_component_source_put_ref(_var_dst);          \
+               (_var_dst) = (_var_src);                        \
+               (_var_src) = NULL;                              \
+       } while (0)
+
 #ifdef __cplusplus
 }
 #endif
This page took 0.022967 seconds and 4 git commands to generate.