X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Ftext%2Ftext.c;h=4ddca35cfa1310f828e5dd4c9887475a351554f3;hb=d3e4dcd8e7a601e0aa063455147f29fbe051582b;hp=2712dd684db95d8de215cf24dc94a356e3faf71e;hpb=ea0e619ec5a367076b752c24fa385af7aa82994a;p=babeltrace.git diff --git a/plugins/text/text.c b/plugins/text/text.c index 2712dd68..4ddca35c 100644 --- a/plugins/text/text.c +++ b/plugins/text/text.c @@ -27,12 +27,12 @@ * SOFTWARE. */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -40,8 +40,6 @@ #include #include "text.h" -#define PLUGIN_NAME "text" - static const char *plugin_options[] = { "output-path", @@ -224,8 +222,7 @@ bool check_param_exists(const char *key, struct bt_value *object, void *data) if (!bt_value_map_get(plugin_opt_map, key)) { fprintf(text->err, - "[warning] Parameter \"%s\" unknown to \"%s\" plugin\n", - key, PLUGIN_NAME); + "[warning] Parameter \"%s\" unknown to \"text\" plugin\n", key); } return true; } @@ -631,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: @@ -655,13 +640,13 @@ error: } /* Initialize plug-in entry points. */ -BT_PLUGIN_NAME("text"); +BT_PLUGIN(text); BT_PLUGIN_DESCRIPTION("Babeltrace text output plug-in."); BT_PLUGIN_AUTHOR("Jérémie Galarneau"); BT_PLUGIN_LICENSE("MIT"); +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."); -BT_PLUGIN_COMPONENT_CLASSES_BEGIN -BT_PLUGIN_SINK_COMPONENT_CLASS_ENTRY(PLUGIN_NAME, - "Formats CTF-IR to text. Formerly known as ctf-text.", - text_component_init) -BT_PLUGIN_COMPONENT_CLASSES_END