#include <babeltrace/compiler-internal.h>
#include <babeltrace/common-internal.h>
#include <babeltrace/object.h>
#include <babeltrace/compiler-internal.h>
#include <babeltrace/common-internal.h>
#include <babeltrace/object.h>
#include <babeltrace/compat/glib-internal.h>
#include <babeltrace/types.h>
#include <babeltrace/object-internal.h>
#include <babeltrace/compat/glib-internal.h>
#include <babeltrace/types.h>
#include <babeltrace/object-internal.h>
struct bt_value_array *typed_array_obj;
BT_LOGD("Copying array value: addr=%p", array_obj);
typed_array_obj = BT_VALUE_TO_ARRAY(array_obj);
struct bt_value_array *typed_array_obj;
BT_LOGD("Copying array value: addr=%p", array_obj);
typed_array_obj = BT_VALUE_TO_ARRAY(array_obj);
if (!copy_obj) {
BT_LOGE_STR("Cannot create empty array value.");
goto end;
}
for (i = 0; i < typed_array_obj->garray->len; ++i) {
if (!copy_obj) {
BT_LOGE_STR("Cannot create empty array value.");
goto end;
}
for (i = 0; i < typed_array_obj->garray->len; ++i) {
- struct bt_private_value *element_obj_copy = NULL;
- struct bt_value *element_obj =
- bt_value_array_borrow_element_by_index(
+ struct bt_value *element_obj_copy = NULL;
+ const struct bt_value *element_obj =
+ bt_value_array_borrow_element_by_index_const(
struct bt_value_map *typed_map_obj;
BT_LOGD("Copying map value: addr=%p", map_obj);
typed_map_obj = BT_VALUE_TO_MAP(map_obj);
struct bt_value_map *typed_map_obj;
BT_LOGD("Copying map value: addr=%p", map_obj);
typed_map_obj = BT_VALUE_TO_MAP(map_obj);
[BT_VALUE_TYPE_NULL] = bt_value_null_copy,
[BT_VALUE_TYPE_BOOL] = bt_value_bool_copy,
[BT_VALUE_TYPE_INTEGER] = bt_value_integer_copy,
[BT_VALUE_TYPE_NULL] = bt_value_null_copy,
[BT_VALUE_TYPE_BOOL] = bt_value_bool_copy,
[BT_VALUE_TYPE_INTEGER] = bt_value_integer_copy,
g_hash_table_iter_init(&iter, map_obj_a->ght);
while (g_hash_table_iter_next(&iter, &key, &element_obj_a)) {
g_hash_table_iter_init(&iter, map_obj_a->ght);
while (g_hash_table_iter_next(&iter, &key, &element_obj_a)) {
{
BT_ASSERT_PRE_NON_NULL(bool_obj, "Value object");
BT_ASSERT_PRE_VALUE_IS_TYPE(bool_obj, BT_VALUE_TYPE_BOOL);
{
BT_ASSERT_PRE_NON_NULL(bool_obj, "Value object");
BT_ASSERT_PRE_VALUE_IS_TYPE(bool_obj, BT_VALUE_TYPE_BOOL);
{
BT_ASSERT_PRE_NON_NULL(real_obj, "Value object");
BT_ASSERT_PRE_VALUE_IS_TYPE(real_obj, BT_VALUE_TYPE_REAL);
{
BT_ASSERT_PRE_NON_NULL(real_obj, "Value object");
BT_ASSERT_PRE_VALUE_IS_TYPE(real_obj, BT_VALUE_TYPE_REAL);
-enum bt_value_status bt_private_value_string_set(
- struct bt_private_value *string_obj, const char *val)
+enum bt_value_status bt_value_string_set(
+ struct bt_value *string_obj, const char *val)
{
BT_ASSERT_PRE_NON_NULL(string_obj, "Value object");
BT_ASSERT_PRE_VALUE_IS_TYPE(string_obj, BT_VALUE_TYPE_STRING);
{
BT_ASSERT_PRE_NON_NULL(string_obj, "Value object");
BT_ASSERT_PRE_VALUE_IS_TYPE(string_obj, BT_VALUE_TYPE_STRING);
-struct bt_private_value *bt_private_value_array_borrow_element_by_index(
- const struct bt_private_value *array_obj,
+const struct bt_value *bt_value_array_borrow_element_by_index_const(
+ const struct bt_value *array_obj,
-enum bt_value_status bt_private_value_array_append_element(
- struct bt_private_value *array_obj,
+enum bt_value_status bt_value_array_append_element(
+ struct bt_value *array_obj,
-enum bt_value_status bt_private_value_array_append_bool_element(
- struct bt_private_value *array_obj, bt_bool val)
+enum bt_value_status bt_value_array_append_bool_element(
+ struct bt_value *array_obj, bt_bool val)
- bool_obj = bt_private_value_bool_create_init(val);
- ret = bt_private_value_array_append_element(array_obj,
+ bool_obj = bt_value_bool_create_init(val);
+ ret = bt_value_array_append_element(array_obj,
-enum bt_value_status bt_private_value_array_append_integer_element(
- struct bt_private_value *array_obj, int64_t val)
+enum bt_value_status bt_value_array_append_integer_element(
+ struct bt_value *array_obj, int64_t val)
- integer_obj = bt_private_value_integer_create_init(val);
- ret = bt_private_value_array_append_element(array_obj,
+ integer_obj = bt_value_integer_create_init(val);
+ ret = bt_value_array_append_element(array_obj,
-enum bt_value_status bt_private_value_array_append_real_element(
- struct bt_private_value *array_obj, double val)
+enum bt_value_status bt_value_array_append_real_element(
+ struct bt_value *array_obj, double val)
- real_obj = bt_private_value_real_create_init(val);
- ret = bt_private_value_array_append_element(array_obj,
+ real_obj = bt_value_real_create_init(val);
+ ret = bt_value_array_append_element(array_obj,
-enum bt_value_status bt_private_value_array_append_string_element(
- struct bt_private_value *array_obj, const char *val)
+enum bt_value_status bt_value_array_append_string_element(
+ struct bt_value *array_obj, const char *val)
- string_obj = bt_private_value_string_create_init(val);
- ret = bt_private_value_array_append_element(array_obj,
+ string_obj = bt_value_string_create_init(val);
+ ret = bt_value_array_append_element(array_obj,
-enum bt_value_status bt_private_value_array_append_empty_array_element(
- struct bt_private_value *array_obj)
+enum bt_value_status bt_value_array_append_empty_array_element(
+ struct bt_value *array_obj)
- empty_array_obj = bt_private_value_array_create();
- ret = bt_private_value_array_append_element(array_obj,
+ empty_array_obj = bt_value_array_create();
+ ret = bt_value_array_append_element(array_obj,
- map_obj = bt_private_value_map_create();
- ret = bt_private_value_array_append_element(array_obj,
+ map_obj = bt_value_map_create();
+ ret = bt_value_array_append_element(array_obj,
-enum bt_value_status bt_private_value_array_set_element_by_index(
- struct bt_private_value *array_obj, uint64_t index,
+enum bt_value_status bt_value_array_set_element_by_index(
+ struct bt_value *array_obj, uint64_t index,
-struct bt_private_value *bt_private_value_map_borrow_entry_value(
- const struct bt_private_value *map_obj, const char *key)
+const struct bt_value *bt_value_map_borrow_entry_value_const(
+ const struct bt_value *map_obj, const char *key)
-enum bt_value_status bt_private_value_map_insert_entry(
- struct bt_private_value *map_obj,
+enum bt_value_status bt_value_map_insert_entry(
+ struct bt_value *map_obj,
const char *key, struct bt_value *element_obj)
{
BT_ASSERT_PRE_NON_NULL(map_obj, "Map value object");
const char *key, struct bt_value *element_obj)
{
BT_ASSERT_PRE_NON_NULL(map_obj, "Map value object");
-enum bt_value_status bt_private_value_map_insert_bool_entry(
- struct bt_private_value *map_obj, const char *key, bt_bool val)
+enum bt_value_status bt_value_map_insert_bool_entry(
+ struct bt_value *map_obj, const char *key, bt_bool val)
- bool_obj = bt_private_value_bool_create_init(val);
- ret = bt_private_value_map_insert_entry(map_obj, key,
+ bool_obj = bt_value_bool_create_init(val);
+ ret = bt_value_map_insert_entry(map_obj, key,
-enum bt_value_status bt_private_value_map_insert_integer_entry(
- struct bt_private_value *map_obj, const char *key, int64_t val)
+enum bt_value_status bt_value_map_insert_integer_entry(
+ struct bt_value *map_obj, const char *key, int64_t val)
- integer_obj = bt_private_value_integer_create_init(val);
- ret = bt_private_value_map_insert_entry(map_obj, key,
+ integer_obj = bt_value_integer_create_init(val);
+ ret = bt_value_map_insert_entry(map_obj, key,
-enum bt_value_status bt_private_value_map_insert_real_entry(
- struct bt_private_value *map_obj, const char *key, double val)
+enum bt_value_status bt_value_map_insert_real_entry(
+ struct bt_value *map_obj, const char *key, double val)
- real_obj = bt_private_value_real_create_init(val);
- ret = bt_private_value_map_insert_entry(map_obj, key,
+ real_obj = bt_value_real_create_init(val);
+ ret = bt_value_map_insert_entry(map_obj, key,
-enum bt_value_status bt_private_value_map_insert_string_entry(
- struct bt_private_value *map_obj, const char *key,
+enum bt_value_status bt_value_map_insert_string_entry(
+ struct bt_value *map_obj, const char *key,
- string_obj = bt_private_value_string_create_init(val);
- ret = bt_private_value_map_insert_entry(map_obj, key,
+ string_obj = bt_value_string_create_init(val);
+ ret = bt_value_map_insert_entry(map_obj, key,
-enum bt_value_status bt_private_value_map_insert_empty_array_entry(
- struct bt_private_value *map_obj, const char *key)
+enum bt_value_status bt_value_map_insert_empty_array_entry(
+ struct bt_value *map_obj, const char *key)
- array_obj = bt_private_value_array_create();
- ret = bt_private_value_map_insert_entry(map_obj, key,
+ array_obj = bt_value_array_create();
+ ret = bt_value_map_insert_entry(map_obj, key,
-enum bt_value_status bt_private_value_map_insert_empty_map_entry(
- struct bt_private_value *map_obj, const char *key)
+enum bt_value_status bt_value_map_insert_empty_map_entry(
+ struct bt_value *map_obj, const char *key)
- empty_map_obj = bt_private_value_map_create();
- ret = bt_private_value_map_insert_entry(map_obj, key,
+ empty_map_obj = bt_value_map_create();
+ ret = bt_value_map_insert_entry(map_obj, key,
bt_value_map_foreach_entry_cb cb, void *data)
{
enum bt_value_status ret = BT_VALUE_STATUS_OK;
bt_value_map_foreach_entry_cb cb, void *data)
{
enum bt_value_status ret = BT_VALUE_STATUS_OK;
-enum bt_value_status bt_private_value_map_foreach_entry(
- const struct bt_private_value *map_obj,
- bt_private_value_map_foreach_entry_cb cb, void *data)
+enum bt_value_status bt_value_map_foreach_entry_const(
+ const struct bt_value *map_obj,
+ bt_value_map_foreach_entry_const_cb cb, void *data)
{
return bt_value_map_foreach_entry((void *) map_obj,
(bt_value_map_foreach_entry_cb) cb, data);
}
struct extend_map_element_data {
{
return bt_value_map_foreach_entry((void *) map_obj,
(bt_value_map_foreach_entry_cb) cb, data);
}
struct extend_map_element_data {
enum bt_value_status status;
};
static
bt_bool extend_map_element(const char *key,
enum bt_value_status status;
};
static
bt_bool extend_map_element(const char *key,
/* Copy object which is to replace the current one */
extend_data->status = bt_value_copy(&extension_obj_elem_copy,
/* Copy object which is to replace the current one */
extend_data->status = bt_value_copy(&extension_obj_elem_copy,
extend_data->extended_obj, key,
(void *) extension_obj_elem_copy);
if (extend_data->status) {
extend_data->extended_obj, key,
(void *) extension_obj_elem_copy);
if (extend_data->status) {
const struct bt_value *base_map_obj,
const struct bt_value *extension_obj)
{
const struct bt_value *base_map_obj,
const struct bt_value *extension_obj)
{
&extend_data)) {
BT_LOGE("Cannot iterate on the extension object's elements: "
"extension-value-addr=%p", extension_obj);
&extend_data)) {
BT_LOGE("Cannot iterate on the extension object's elements: "
"extension-value-addr=%p", extension_obj);