X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=plugins%2Fwriter%2Fwriter.c;h=089a3d595d2a38ea77f046551af174707bd682a2;hb=d3e4dcd8e7a601e0aa063455147f29fbe051582b;hp=971e6bf8a61b26facedce6ac3b1daddd16c107c8;hpb=d1b057f5b2954339b0b48fdc5973ec59a641f5a9;p=babeltrace.git diff --git a/plugins/writer/writer.c b/plugins/writer/writer.c index 971e6bf8..089a3d59 100644 --- a/plugins/writer/writer.c +++ b/plugins/writer/writer.c @@ -246,23 +246,11 @@ enum bt_component_status writer_component_init( goto error; } - ret = bt_component_set_destroy_cb(component, - destroy_writer_component); - if (ret != BT_COMPONENT_STATUS_OK) { - goto error; - } - ret = bt_component_set_private_data(component, writer_component); 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: @@ -276,7 +264,7 @@ BT_PLUGIN(writer); BT_PLUGIN_DESCRIPTION("Babeltrace CTF-Writer output plug-in."); BT_PLUGIN_AUTHOR("Jérémie Galarneau"); BT_PLUGIN_LICENSE("MIT"); -BT_PLUGIN_COMPONENT_CLASS(BT_COMPONENT_TYPE_SINK, writer, - writer_component_init); -BT_PLUGIN_COMPONENT_CLASS_DESCRIPTION(BT_COMPONENT_TYPE_SINK, writer, - "Formats CTF-IR to CTF."); +BT_PLUGIN_SINK_COMPONENT_CLASS(writer, run); +BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD(writer, writer_component_init); +BT_PLUGIN_SINK_COMPONENT_CLASS_DESTROY_METHOD(writer, destroy_writer_component); +BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION(writer, "Formats CTF-IR to CTF.");