Values API: split into private and public APIs
[babeltrace.git] / tests / lib / test-plugin-plugins / sfs.c
index f9d521300818638ed4a633659efadb163ce00e44..92ee2ca2419dfa17f9225de60b1be31a22bbb1fe 100644 (file)
@@ -18,7 +18,8 @@
 #include <babeltrace/plugin/plugin-dev.h>
 #include <babeltrace/graph/component-class.h>
 #include <babeltrace/values.h>
-#include <babeltrace/ref.h>
+#include <babeltrace/private-values.h>
+#include <babeltrace/object.h>
 #include <babeltrace/assert-internal.h>
 #include <babeltrace/assert-internal.h>
 
@@ -40,15 +41,12 @@ static void dummy_iterator_finalize_method(
 {
 }
 
-static struct bt_notification_iterator_next_method_return dummy_iterator_next_method(
-               struct bt_private_connection_private_notification_iterator *private_iterator)
+static enum bt_notification_iterator_status dummy_iterator_next_method(
+               struct bt_private_connection_private_notification_iterator *private_iterator,
+               bt_notification_array notifs, uint64_t capacity,
+               uint64_t *count)
 {
-       struct bt_notification_iterator_next_method_return next_return = {
-               .notification = NULL,
-               .status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
-       };
-
-       return next_return;
+       return BT_NOTIFICATION_ITERATOR_STATUS_ERROR;
 }
 
 static struct bt_component_class_query_method_return query_method(
@@ -56,16 +54,17 @@ static struct bt_component_class_query_method_return query_method(
                struct bt_query_executor *query_exec,
                const char *object, struct bt_value *params)
 {
+       struct bt_private_value *results = bt_private_value_array_create();
        struct bt_component_class_query_method_return ret = {
                .status = BT_QUERY_STATUS_OK,
-               .result = bt_value_array_create(),
+               .result = bt_value_borrow_from_private(results),
        };
        int iret;
 
        BT_ASSERT(ret.result);
-       iret = bt_value_array_append_string(ret.result, object);
+       iret = bt_private_value_array_append_string_element(results, object);
        BT_ASSERT(iret == 0);
-       iret = bt_value_array_append(ret.result, params);
+       iret = bt_private_value_array_append_element(results, params);
        BT_ASSERT(iret == 0);
        return ret;
 }
This page took 0.024125 seconds and 4 git commands to generate.