text plugin: add color support
[babeltrace.git] / plugins / trimmer / iterator.c
index d7633a9c395148a63838411b0a7faaf0f82e8eec..04557cba3ad4b491ba0e429791bc48463b43622f 100644 (file)
@@ -42,8 +42,9 @@
 #include <babeltrace/ctf-ir/trace.h>
 #include <babeltrace/ctf-ir/fields.h>
 #include <assert.h>
+#include <plugins-common.h>
 
-static
+BT_HIDDEN
 void trimmer_iterator_destroy(struct bt_notification_iterator *it)
 {
        struct trimmer_iterator *it_data;
@@ -59,15 +60,18 @@ void trimmer_iterator_destroy(struct bt_notification_iterator *it)
 }
 
 BT_HIDDEN
-enum bt_component_status trimmer_iterator_init(struct bt_component *component,
-               struct bt_notification_iterator *iterator)
+enum bt_notification_iterator_status trimmer_iterator_init(
+               struct bt_component *component,
+               struct bt_notification_iterator *iterator,
+               UNUSED_VAR void *init_method_data)
 {
-       enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
+       enum bt_notification_iterator_status ret =
+               BT_NOTIFICATION_ITERATOR_STATUS_OK;
        enum bt_notification_iterator_status it_ret;
        struct trimmer_iterator *it_data = g_new0(struct trimmer_iterator, 1);
 
        if (!it_data) {
-               ret = BT_COMPONENT_STATUS_NOMEM;
+               ret = BT_NOTIFICATION_ITERATOR_STATUS_NOMEM;
                goto end;
        }
 
@@ -76,34 +80,6 @@ enum bt_component_status trimmer_iterator_init(struct bt_component *component,
        if (it_ret) {
                goto end;
        }
-
-       it_ret = bt_notification_iterator_set_destroy_cb(iterator,
-                       trimmer_iterator_destroy);
-       if (it_ret) {
-               ret = BT_COMPONENT_STATUS_ERROR;
-               goto end;
-       }
-
-       it_ret = bt_notification_iterator_set_next_cb(iterator,
-                       trimmer_iterator_next);
-       if (it_ret) {
-               ret = BT_COMPONENT_STATUS_ERROR;
-               goto end;
-       }
-
-       it_ret = bt_notification_iterator_set_get_cb(iterator,
-                       trimmer_iterator_get);
-       if (it_ret) {
-               ret = BT_COMPONENT_STATUS_ERROR;
-               goto end;
-       }
-
-       it_ret = bt_notification_iterator_set_seek_time_cb(iterator,
-                       trimmer_iterator_seek_time);
-       if (it_ret) {
-               ret = BT_COMPONENT_STATUS_ERROR;
-               goto end;
-       }
 end:
        return ret;
 }
This page took 0.023506 seconds and 4 git commands to generate.