lib: make public reference count functions have strict types
[babeltrace.git] / include / babeltrace / plugin / plugin-const.h
index 4bf3564c59ad931f61ec671dd166e43b194de4b1..ad0b454d4b9cb02ddbad611ee879969018ca30f3 100644 (file)
@@ -121,6 +121,23 @@ extern const struct bt_component_class_sink *
 bt_plugin_borrow_sink_component_class_by_name_const(
                const struct bt_plugin *plugin, const char *name);
 
+extern void bt_plugin_get_ref(const struct bt_plugin *plugin);
+
+extern void bt_plugin_put_ref(const struct bt_plugin *plugin);
+
+#define BT_PLUGIN_PUT_REF_AND_RESET(_var)              \
+       do {                                            \
+               bt_plugin_put_ref(_var);                \
+               (_var) = NULL;                          \
+       } while (0)
+
+#define BT_PLUGIN_MOVE_REF(_var_dst, _var_src)         \
+       do {                                            \
+               bt_plugin_put_ref(_var_dst);            \
+               (_var_dst) = (_var_src);                \
+               (_var_src) = NULL;                      \
+       } while (0)
+
 #ifdef __cplusplus
 }
 #endif
This page took 0.024146 seconds and 4 git commands to generate.