Refactor the component class and component API
[babeltrace.git] / plugins / text / text.c
index 370fb2d3478fdb9892e57d916314893a6a714be4..4ddca35cfa1310f828e5dd4c9887475a351554f3 100644 (file)
@@ -628,22 +628,10 @@ enum bt_component_status text_component_init(
                goto error;
        }
 
-       ret = bt_component_set_destroy_cb(component,
-                       destroy_text);
-       if (ret != BT_COMPONENT_STATUS_OK) {
-               goto error;
-       }
-
        ret = bt_component_set_private_data(component, text);
        if (ret != BT_COMPONENT_STATUS_OK) {
                goto error;
        }
-
-       ret = bt_component_sink_set_consume_cb(component,
-                       run);
-       if (ret != BT_COMPONENT_STATUS_OK) {
-               goto error;
-       }
 end:
        return ret;
 error:
@@ -656,7 +644,9 @@ BT_PLUGIN(text);
 BT_PLUGIN_DESCRIPTION("Babeltrace text output plug-in.");
 BT_PLUGIN_AUTHOR("Jérémie Galarneau");
 BT_PLUGIN_LICENSE("MIT");
-BT_PLUGIN_COMPONENT_CLASS(BT_COMPONENT_TYPE_SINK, text,
-               text_component_init);
-BT_PLUGIN_COMPONENT_CLASS_DESCRIPTION(BT_COMPONENT_TYPE_SINK, text,
+BT_PLUGIN_SINK_COMPONENT_CLASS(text, run);
+BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD(text, text_component_init);
+BT_PLUGIN_SINK_COMPONENT_CLASS_DESTROY_METHOD(text, destroy_text);
+BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION(text,
        "Formats CTF-IR to text. Formerly known as ctf-text.");
+
This page took 0.024214 seconds and 4 git commands to generate.