X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fplugin%2Fplugin-const.h;fp=include%2Fbabeltrace%2Fplugin%2Fplugin-const.h;h=ad0b454d4b9cb02ddbad611ee879969018ca30f3;hb=c5b9b4417bedfbec9b5dd23b8395ccdd4eeffc44;hp=4bf3564c59ad931f61ec671dd166e43b194de4b1;hpb=e2f7325d1e58710ee928373592adcee466f93d06;p=babeltrace.git diff --git a/include/babeltrace/plugin/plugin-const.h b/include/babeltrace/plugin/plugin-const.h index 4bf3564c..ad0b454d 100644 --- a/include/babeltrace/plugin/plugin-const.h +++ b/include/babeltrace/plugin/plugin-const.h @@ -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