Fix header guard
[babeltrace.git] / converter / babeltrace.c
index 43121dc43f0a6c42a63131bbbf6c14466ad233d2..892096d1fd4ca08ff65fc4617ae5422bb54a4a32 100644 (file)
@@ -40,6 +40,8 @@
 
 #include <babeltrace/iterator.h>
 #include <babeltrace/plugin/component-factory.h>
+#include <babeltrace/ref.h>
+#include <babeltrace/values.h>
 #include <popt.h>
 #include <errno.h>
 #include <stdlib.h>
@@ -62,7 +64,6 @@
 #define NET4_URL_PREFIX        "net4://"
 #define NET6_URL_PREFIX        "net6://"
 
-static struct bt_component_factory *component_factory;
 static char *opt_input_format, *opt_output_format;
 
 /*
@@ -733,6 +734,8 @@ int main(int argc, char **argv)
        struct bt_format *fmt_write;
        struct bt_trace_descriptor *td_write;
        struct bt_context *ctx;
+       struct bt_component_factory *component_factory;
+       struct bt_value *components = NULL;
        int i;
 
        call_plugins_hooks();
@@ -772,6 +775,11 @@ int main(int argc, char **argv)
                goto end;
        }
 
+       ret = bt_component_factory_get_component_class_count(component_factory);
+       if (ret <= 0) {
+               goto end;
+       }
+
        if (opt_input_paths->len == 0) {
                ret = -1;
                goto end;
@@ -907,6 +915,8 @@ end:
        free(opt_debug_info_dir);
        free(opt_debug_info_target_prefix);
        g_ptr_array_free(opt_input_paths, TRUE);
+       BT_PUT(components);
+       BT_PUT(component_factory);
        if (partial_error)
                exit(EXIT_FAILURE);
        else
This page took 0.024848 seconds and 4 git commands to generate.