lib: use common precond. assert. macros from `assert-cond.h` thru lib
[babeltrace.git] / src / lib / plugin / plugin.c
index af8dc0924f177e1da3c79268c30f2c00e735ee2c..c95fe83070e20dbb4790d7e903d34b8999b3b697 100644 (file)
@@ -154,14 +154,14 @@ void fini_python_plugin_provider(void) {
 
 uint64_t bt_plugin_set_get_plugin_count(const struct bt_plugin_set *plugin_set)
 {
-       BT_ASSERT_PRE_DEV_NON_NULL(plugin_set, "Plugin set");
+       BT_ASSERT_PRE_DEV_PLUGIN_SET_NON_NULL(plugin_set);
        return (uint64_t) plugin_set->plugins->len;
 }
 
 const struct bt_plugin *bt_plugin_set_borrow_plugin_by_index_const(
                const struct bt_plugin_set *plugin_set, uint64_t index)
 {
-       BT_ASSERT_PRE_DEV_NON_NULL(plugin_set, "Plugin set");
+       BT_ASSERT_PRE_DEV_PLUGIN_SET_NON_NULL(plugin_set);
        BT_ASSERT_PRE_DEV_VALID_INDEX(index, plugin_set->plugins->len);
        return g_ptr_array_index(plugin_set->plugins, index);
 }
@@ -185,7 +185,7 @@ enum bt_plugin_find_all_from_file_status bt_plugin_find_all_from_file(
 
        BT_ASSERT_PRE_NO_ERROR();
        BT_ASSERT_PRE_NON_NULL(path, "Path");
-       BT_ASSERT_PRE_NON_NULL(path, "Plugin set (output)");
+       BT_ASSERT_PRE_PLUGIN_SET_OUT_NON_NULL(path);
        BT_LOGI("Creating plugins from file: path=\"%s\"", path);
 
        /* Try shared object plugins */
@@ -268,7 +268,7 @@ enum bt_plugin_find_all_status bt_plugin_find_all(bt_bool find_in_std_env_var,
        uint64_t dir_i, plugin_i;
 
        BT_ASSERT_PRE_NO_ERROR();
-       BT_ASSERT_PRE_NON_NULL(plugin_set_out, "Plugin set (output)");
+       BT_ASSERT_PRE_PLUGIN_SET_OUT_NON_NULL(plugin_set_out);
        BT_LOGI("Finding all plugins in standard directories and built-in plugins: "
                "find-in-std-env-var=%d, find-in-user-dir=%d, "
                "find-in-sys-dir=%d, find-in-static=%d",
@@ -452,8 +452,8 @@ enum bt_plugin_find_status bt_plugin_find(const char *plugin_name,
        uint64_t i;
 
        BT_ASSERT_PRE_NO_ERROR();
-       BT_ASSERT_PRE_NON_NULL(plugin_name, "Name");
-       BT_ASSERT_PRE_NON_NULL(plugin_out, "Plugin (output)");
+       BT_ASSERT_PRE_NAME_NON_NULL(plugin_name);
+       BT_ASSERT_PRE_PLUGIN_OUT_NON_NULL(plugin_out);
        BT_LOGI("Finding named plugin in standard directories and built-in plugins: "
                "name=\"%s\", find-in-std-env-var=%d, find-in-user-dir=%d, "
                "find-in-sys-dir=%d, find-in-static=%d",
@@ -654,7 +654,7 @@ enum bt_plugin_find_all_from_dir_status bt_plugin_find_all_from_dir(
                BT_FUNC_STATUS_OK;
 
        BT_ASSERT_PRE_NO_ERROR();
-       BT_ASSERT_PRE_NON_NULL(plugin_set_out, "Plugin set (output)");
+       BT_ASSERT_PRE_PLUGIN_SET_OUT_NON_NULL(plugin_set_out);
        BT_LOGI("Creating all plugins in directory: path=\"%s\", recurse=%d",
                path, recurse);
        *plugin_set_out = bt_plugin_set_create();
@@ -706,31 +706,31 @@ end:
 
 const char *bt_plugin_get_name(const struct bt_plugin *plugin)
 {
-       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
        return plugin->info.name_set ? plugin->info.name->str : NULL;
 }
 
 const char *bt_plugin_get_author(const struct bt_plugin *plugin)
 {
-       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
        return plugin->info.author_set ? plugin->info.author->str : NULL;
 }
 
 const char *bt_plugin_get_license(const struct bt_plugin *plugin)
 {
-       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
        return plugin->info.license_set ? plugin->info.license->str : NULL;
 }
 
 const char *bt_plugin_get_path(const struct bt_plugin *plugin)
 {
-       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
        return plugin->info.path_set ? plugin->info.path->str : NULL;
 }
 
 const char *bt_plugin_get_description(const struct bt_plugin *plugin)
 {
-       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
        return plugin->info.description_set ?
                plugin->info.description->str : NULL;
 }
@@ -742,7 +742,7 @@ enum bt_property_availability bt_plugin_get_version(const struct bt_plugin *plug
        enum bt_property_availability avail =
                BT_PROPERTY_AVAILABILITY_AVAILABLE;
 
-       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
 
        if (!plugin->info.version_set) {
                BT_LIB_LOGD("Plugin's version is not set: %!+l", plugin);
@@ -772,19 +772,19 @@ end:
 
 uint64_t bt_plugin_get_source_component_class_count(const struct bt_plugin *plugin)
 {
-       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
        return (uint64_t) plugin->src_comp_classes->len;
 }
 
 uint64_t bt_plugin_get_filter_component_class_count(const struct bt_plugin *plugin)
 {
-       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
        return (uint64_t) plugin->flt_comp_classes->len;
 }
 
 uint64_t bt_plugin_get_sink_component_class_count(const struct bt_plugin *plugin)
 {
-       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
        return (uint64_t) plugin->sink_comp_classes->len;
 }
 
@@ -793,7 +793,7 @@ struct bt_component_class *borrow_component_class_by_index(
                const struct bt_plugin *plugin, GPtrArray *comp_classes,
                uint64_t index)
 {
-       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
+       BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
        BT_ASSERT_PRE_DEV_VALID_INDEX(index, comp_classes->len);
        return g_ptr_array_index(comp_classes, index);
 }
@@ -830,8 +830,8 @@ struct bt_component_class *borrow_component_class_by_name(
        struct bt_component_class *comp_class = NULL;
        size_t i;
 
-       BT_ASSERT_PRE_DEV_NON_NULL(plugin, "Plugin");
-       BT_ASSERT_PRE_DEV_NON_NULL(name, "Name");
+       BT_ASSERT_PRE_DEV_PLUGIN_NON_NULL(plugin);
+       BT_ASSERT_PRE_DEV_NAME_NON_NULL(name);
 
        for (i = 0; i < comp_classes->len; i++) {
                struct bt_component_class *comp_class_candidate =
This page took 0.025427 seconds and 4 git commands to generate.