Plugins: use UNUSED_VAR instead of casting to void
[babeltrace.git] / plugins / muxer / muxer.c
index 6cd355e5c94a85939ff6fa59d5182428e717bcb2..f8eb7d30c9f82ec96d2b9d44d04266295e96a946 100644 (file)
 
 #include <babeltrace/plugin/plugin-dev.h>
 #include <babeltrace/component/component.h>
-#include <babeltrace/component/filter.h>
+#include <babeltrace/component/component-filter.h>
 #include <babeltrace/component/notification/notification.h>
 #include <babeltrace/component/notification/iterator.h>
 #include <babeltrace/component/notification/event.h>
+#include <plugins-common.h>
 #include "muxer.h"
 
 static
@@ -62,7 +63,8 @@ void destroy_muxer(struct bt_component *component)
 }
 
 enum bt_component_status muxer_component_init(
-       struct bt_component *component, struct bt_value *params)
+       struct bt_component *component, struct bt_value *params,
+       UNUSED_VAR void *init_method_data)
 {
        enum bt_component_status ret;
        struct muxer *muxer = create_muxer();
@@ -72,12 +74,6 @@ enum bt_component_status muxer_component_init(
                goto end;
        }
 
-       ret = bt_component_set_destroy_cb(component,
-                       destroy_muxer);
-       if (ret != BT_COMPONENT_STATUS_OK) {
-               goto error;
-       }
-
        ret = bt_component_set_private_data(component, muxer);
        if (ret != BT_COMPONENT_STATUS_OK) {
                goto error;
@@ -89,14 +85,20 @@ error:
        return ret;
 }
 
+enum bt_component_status muxer_init_iterator(
+               struct bt_component *component,
+               struct bt_notification_iterator *iter)
+{
+       return BT_COMPONENT_STATUS_OK;
+}
+
 /* Initialize plug-in entry points. */
-BT_PLUGIN_NAME("muxer");
+BT_PLUGIN(muxer);
 BT_PLUGIN_DESCRIPTION("Babeltrace Trace Muxer Plug-In.");
 BT_PLUGIN_AUTHOR("Jérémie Galarneau");
 BT_PLUGIN_LICENSE("MIT");
-
-BT_PLUGIN_COMPONENT_CLASSES_BEGIN
-BT_PLUGIN_COMPONENT_CLASS_FILTER_ENTRY("muxer",
-               "Time-correlate multiple traces.",
-               muxer_component_init)
-BT_PLUGIN_COMPONENT_CLASSES_END
+BT_PLUGIN_FILTER_COMPONENT_CLASS(muxer, muxer_init_iterator);
+BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION(muxer,
+       "Time-correlate multiple traces.");
+BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD(muxer, muxer_component_init);
+BT_PLUGIN_FILTER_COMPONENT_CLASS_DESTROY_METHOD(muxer, destroy_muxer);
This page took 0.023412 seconds and 4 git commands to generate.