Replace all assert(false) and assert(0) with abort()
[babeltrace.git] / lib / plugin / plugin.c
index a55b9843a3a92fa40f298c5082745c3335b91fba..d219fe893bfe5762afa2823a3aafa6b8395fb69e 100644 (file)
 #include <babeltrace/common-internal.h>
 #include <babeltrace/plugin/plugin-internal.h>
 #include <babeltrace/plugin/plugin-so-internal.h>
+#include <babeltrace/types.h>
 #include <glib.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <stdint.h>
 #include <sys/stat.h>
 #include <dirent.h>
 
@@ -59,7 +61,7 @@ void init_python_plugin_provider(void) {
                g_module_open(PYTHON_PLUGIN_PROVIDER_FILENAME,
                        G_MODULE_BIND_LOCAL);
        if (!python_plugin_provider_module) {
-               printf_warning("Cannot find `%s`: Python plugin support is disabled\n",
+               printf_verbose("Cannot find `%s`: Python plugin support is disabled\n",
                        PYTHON_PLUGIN_PROVIDER_FILENAME);
                return;
        }
@@ -67,7 +69,7 @@ void init_python_plugin_provider(void) {
        if (!g_module_symbol(python_plugin_provider_module,
                        PYTHON_PLUGIN_PROVIDER_SYM_NAME_STR,
                        (gpointer) &bt_plugin_python_create_all_from_file_sym)) {
-               printf_warning("Cannot find the Python plugin provider loading symbole: Python plugin support is disabled\n");
+               printf_verbose("Cannot find the Python plugin provider loading symbole: Python plugin support is disabled\n");
        }
 }
 
@@ -89,7 +91,7 @@ int64_t bt_plugin_set_get_plugin_count(struct bt_plugin_set *plugin_set)
                goto end;
        }
 
-       count = plugin_set->plugins->len;
+       count = (int64_t) plugin_set->plugins->len;
 
 end:
        return count;
@@ -97,7 +99,7 @@ end:
 
 extern
 struct bt_plugin *bt_plugin_set_get_plugin(struct bt_plugin_set *plugin_set,
-               unsigned int index)
+               uint64_t index)
 {
        struct bt_plugin *plugin = NULL;
 
@@ -221,7 +223,7 @@ struct bt_plugin *bt_plugin_find(const char *plugin_name)
                printf_verbose("Trying to load plugins from directory `%s`\n",
                        dir->str);
                BT_PUT(plugin_set);
-               plugin_set = bt_plugin_create_all_from_dir(dir->str, false);
+               plugin_set = bt_plugin_create_all_from_dir(dir->str, BT_FALSE);
                if (!plugin_set) {
                        continue;
                }
@@ -307,7 +309,7 @@ struct dirent *alloc_dirent(const char *path)
 static
 enum bt_plugin_status bt_plugin_create_append_all_from_dir(
                struct bt_plugin_set *plugin_set, const char *path,
-               bool recurse)
+               bt_bool recurse)
 {
        DIR *directory = NULL;
        struct dirent *entry = NULL, *result = NULL;
@@ -381,7 +383,7 @@ enum bt_plugin_status bt_plugin_create_append_all_from_dir(
 
                if (S_ISDIR(st.st_mode) && recurse) {
                        ret = bt_plugin_create_append_all_from_dir(plugin_set,
-                               file_path, true);
+                               file_path, BT_TRUE);
                        if (ret < 0) {
                                goto end;
                        }
@@ -420,7 +422,7 @@ end:
 }
 
 struct bt_plugin_set *bt_plugin_create_all_from_dir(const char *path,
-               bool recurse)
+               bt_bool recurse)
 {
        struct bt_plugin_set *plugin_set;
        enum bt_plugin_status status;
@@ -504,11 +506,11 @@ end:
 
 int64_t bt_plugin_get_component_class_count(struct bt_plugin *plugin)
 {
-       return plugin ? plugin->comp_classes->len : -1;
+       return plugin ? plugin->comp_classes->len : (int64_t) -1;
 }
 
-struct bt_component_class *bt_plugin_get_component_class(
-               struct bt_plugin *plugin, size_t index)
+struct bt_component_class *bt_plugin_get_component_class_by_index(
+               struct bt_plugin *plugin, uint64_t index)
 {
        struct bt_component_class *comp_class = NULL;
 
This page took 0.02638 seconds and 4 git commands to generate.