Remove the need to implement the notification iterator's "get" method
[babeltrace.git] / tests / lib / test-plugin-plugins / sfs.c
index ba8dcba1a979785cb95b5224310e4f5793f55c8f..43acb8adfc71dbcc334dfee4b66aa6667945d9a2 100644 (file)
@@ -40,16 +40,15 @@ static void dummy_iterator_finalize_method(
 {
 }
 
-static struct bt_notification *dummy_iterator_get_method(
+static struct bt_notification_iterator_next_return dummy_iterator_next_method(
                struct bt_private_notification_iterator *private_iterator)
 {
-       return NULL;
-}
+       struct bt_notification_iterator_next_return next_return = {
+               .notification = NULL,
+               .status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
+       };
 
-static enum bt_notification_iterator_status dummy_iterator_next_method(
-               struct bt_private_notification_iterator *private_iterator)
-{
-       return BT_NOTIFICATION_ITERATOR_STATUS_OK;
+       return next_return;
 }
 
 static enum bt_notification_iterator_status dummy_iterator_seek_time_method(
@@ -80,8 +79,7 @@ BT_PLUGIN_AUTHOR("Janine Sutto");
 BT_PLUGIN_LICENSE("Beerware");
 BT_PLUGIN_VERSION(1, 2, 3, "yes");
 
-BT_PLUGIN_SOURCE_COMPONENT_CLASS(source, dummy_iterator_get_method,
-       dummy_iterator_next_method);
+BT_PLUGIN_SOURCE_COMPONENT_CLASS(source, dummy_iterator_next_method);
 BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION(source, "A source.");
 BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(source,
        dummy_iterator_init_method);
@@ -99,8 +97,7 @@ BT_PLUGIN_SINK_COMPONENT_CLASS_HELP(sink,
        "ground round brisket salami cupim pork bresaola turkey bacon boudin.\n"
 );
 
-BT_PLUGIN_FILTER_COMPONENT_CLASS(filter, dummy_iterator_get_method,
-       dummy_iterator_next_method);
+BT_PLUGIN_FILTER_COMPONENT_CLASS(filter, dummy_iterator_next_method);
 BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION(filter, "A filter.");
 BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(filter,
        dummy_iterator_init_method);
This page took 0.023609 seconds and 4 git commands to generate.