Values API: split into private and public APIs
[babeltrace.git] / plugins / utils / muxer / muxer.c
index 956e84f5e2af31a5d279d7a762c2f33760ba69db..e146daad993c0399f18879fbb4be3cd949514cde 100644 (file)
@@ -35,6 +35,7 @@
 #include <stdbool.h>
 #include <inttypes.h>
 #include <babeltrace/assert-internal.h>
+#include <babeltrace/common-internal.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -243,18 +244,18 @@ void destroy_muxer_comp(struct muxer_comp *muxer_comp)
 }
 
 static
-struct bt_value *get_default_params(void)
+struct bt_private_value *get_default_params(void)
 {
-       struct bt_value *params;
+       struct bt_private_value *params;
        int ret;
 
-       params = bt_value_map_create();
+       params = bt_private_value_map_create();
        if (!params) {
                BT_LOGE_STR("Cannot create a map value object.");
                goto error;
        }
 
-       ret = bt_value_map_insert_bool_entry(params,
+       ret = bt_private_value_map_insert_bool_entry(params,
                ASSUME_ABSOLUTE_CLOCK_CLASSES_PARAM_NAME, false);
        if (ret) {
                BT_LOGE_STR("Cannot add boolean value to map value object.");
@@ -273,8 +274,8 @@ end:
 static
 int configure_muxer_comp(struct muxer_comp *muxer_comp, struct bt_value *params)
 {
-       struct bt_value *default_params = NULL;
-       struct bt_value *real_params = NULL;
+       struct bt_private_value *default_params = NULL;
+       struct bt_private_value *real_params = NULL;
        struct bt_value *assume_absolute_clock_classes = NULL;
        int ret = 0;
        bt_bool bool_val;
@@ -286,7 +287,8 @@ int configure_muxer_comp(struct muxer_comp *muxer_comp, struct bt_value *params)
                goto error;
        }
 
-       real_params = bt_value_map_extend(default_params, params);
+       real_params = bt_value_map_extend(
+               bt_value_borrow_from_private(default_params), params);
        if (!real_params) {
                BT_LOGE("Cannot extend default parameters map value: "
                        "muxer-comp-addr=%p, def-params-addr=%p, "
@@ -295,14 +297,15 @@ int configure_muxer_comp(struct muxer_comp *muxer_comp, struct bt_value *params)
                goto error;
        }
 
-       assume_absolute_clock_classes = bt_value_map_borrow_entry_value(real_params,
+       assume_absolute_clock_classes = bt_value_map_borrow_entry_value(
+               bt_value_borrow_from_private(real_params),
                ASSUME_ABSOLUTE_CLOCK_CLASSES_PARAM_NAME);
        if (assume_absolute_clock_classes &&
                        !bt_value_is_bool(assume_absolute_clock_classes)) {
                BT_LOGE("Expecting a boolean value for the `%s` parameter: "
                        "muxer-comp-addr=%p, value-type=%s",
                        ASSUME_ABSOLUTE_CLOCK_CLASSES_PARAM_NAME, muxer_comp,
-                       bt_value_type_string(
+                       bt_common_value_type_string(
                                bt_value_get_type(assume_absolute_clock_classes)));
                goto error;
        }
This page took 0.024192 seconds and 4 git commands to generate.