#include <babeltrace/babeltrace-internal.h>
#include <babeltrace/compiler-internal.h>
-#include <babeltrace/ref.h>
+#include <babeltrace/object.h>
#include <babeltrace/common-internal.h>
#include <babeltrace/plugin/plugin-internal.h>
#include <babeltrace/plugin/plugin-so-internal.h>
goto end;
}
- plugin = bt_get(g_ptr_array_index(plugin_set->plugins, index));
+ plugin = bt_object_get_ref(g_ptr_array_index(plugin_set->plugins, index));
end:
return plugin;
for (i = 0; i < dirs->len; i++) {
GString *dir = g_ptr_array_index(dirs, i);
- BT_PUT(plugin_set);
+ BT_OBJECT_PUT_REF_AND_RESET(plugin_set);
/*
* Skip this if the directory does not exist because
plugin_name) == 0) {
BT_LOGD("Plugin found in directory: name=\"%s\", path=\"%s\"",
plugin_name, dir->str);
- plugin = bt_get(candidate_plugin);
+ plugin = bt_object_get_ref(candidate_plugin);
goto end;
}
}
plugin_name, dir->str);
}
- bt_put(plugin_set);
+ bt_object_put_ref(plugin_set);
plugin_set = bt_plugin_create_all_from_static();
if (plugin_set) {
for (j = 0; j < plugin_set->plugins->len; j++) {
plugin_name) == 0) {
BT_LOGD("Plugin found in built-in plugins: "
"name=\"%s\"", plugin_name);
- plugin = bt_get(candidate_plugin);
+ plugin = bt_object_get_ref(candidate_plugin);
goto end;
}
}
end:
free(home_plugin_dir);
- bt_put(plugin_set);
+ bt_object_put_ref(plugin_set);
if (dirs) {
g_ptr_array_free(dirs, TRUE);
}
end:
- bt_put(plugin);
+ bt_object_put_ref(plugin);
return comp_cls;
}
bt_plugin_set_add_plugin(append_all_from_dir_info.plugin_set, plugin);
}
- bt_put(plugins_from_file);
+ bt_object_put_ref(plugins_from_file);
}
break;
}
goto end;
error:
- BT_PUT(plugin_set);
+ BT_OBJECT_PUT_REF_AND_RESET(plugin_set);
end:
return plugin_set;
}
comp_class = g_ptr_array_index(plugin->comp_classes, index);
- bt_get(comp_class);
+ bt_object_get_ref(comp_class);
goto end;
error:
- BT_PUT(comp_class);
+ BT_OBJECT_PUT_REF_AND_RESET(comp_class);
end:
return comp_class;
if (strcmp(name, comp_class_cand_name) == 0 &&
comp_class_cand_type == type) {
- comp_class = bt_get(comp_class_candidate);
+ comp_class = bt_object_get_ref(comp_class_candidate);
break;
}
}
goto end;
error:
- BT_PUT(comp_class);
+ BT_OBJECT_PUT_REF_AND_RESET(comp_class);
end:
return comp_class;
/* Add new component class */
comp_class_index = plugin->comp_classes->len;
- g_ptr_array_add(plugin->comp_classes, bt_get(comp_class));
+ g_ptr_array_add(plugin->comp_classes, bt_object_get_ref(comp_class));
/* Special case for a shared object plugin */
if (plugin->type == BT_PLUGIN_TYPE_SO) {
status = BT_PLUGIN_STATUS_ERROR;
end:
- bt_put(comp_class_dup);
+ bt_object_put_ref(comp_class_dup);
return status;
}