static
struct bt_value *bt_value_null_copy(const struct bt_value *null_obj)
{
+ BT_ASSERT(null_obj == bt_value_null);
+
+ bt_object_get_no_null_check(bt_value_null);
return (void *) bt_value_null;
}
const struct bt_value_array *array_obj_a =
BT_VALUE_TO_ARRAY(object_a);
- if (bt_value_array_get_size(object_a) !=
- bt_value_array_get_size(object_b)) {
+ if (bt_value_array_get_length(object_a) !=
+ bt_value_array_get_length(object_b)) {
BT_LOGT("Array values are different: size mismatch "
"value-a-addr=%p, value-b-addr=%p, "
"value-a-size=%" PRId64 ", value-b-size=%" PRId64,
object_a, object_b,
- bt_value_array_get_size(object_a),
- bt_value_array_get_size(object_b));
+ bt_value_array_get_length(object_a),
+ bt_value_array_get_length(object_b));
ret = BT_FALSE;
goto end;
}
return BT_FUNC_STATUS_OK;
}
-uint64_t bt_value_array_get_size(const struct bt_value *array_obj)
+uint64_t bt_value_array_get_length(const struct bt_value *array_obj)
{
BT_ASSERT_PRE_DEV_NON_NULL(array_obj, "Value object");
BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY);
}
enum bt_value_array_append_element_status
-bt_value_array_append_empty_array_element(struct bt_value *array_obj)
+bt_value_array_append_empty_array_element(struct bt_value *array_obj,
+ struct bt_value **element_obj)
{
enum bt_value_array_append_element_status ret;
struct bt_value *empty_array_obj = NULL;
empty_array_obj = bt_value_array_create();
ret = bt_value_array_append_element(array_obj,
(void *) empty_array_obj);
+
+ if (element_obj) {
+ *element_obj = empty_array_obj;
+ }
+
bt_object_put_ref(empty_array_obj);
return ret;
}
enum bt_value_array_append_element_status
-bt_value_array_append_empty_map_element(struct bt_value *array_obj)
+bt_value_array_append_empty_map_element(struct bt_value *array_obj,
+ struct bt_value **element_obj)
{
enum bt_value_array_append_element_status ret;
struct bt_value *map_obj = NULL;
map_obj = bt_value_map_create();
ret = bt_value_array_append_element(array_obj,
(void *) map_obj);
+
+ if (element_obj) {
+ *element_obj = map_obj;
+ }
+
bt_object_put_ref(map_obj);
return ret;
}
enum bt_value_map_insert_entry_status
bt_value_map_insert_empty_array_entry(
- struct bt_value *map_obj, const char *key)
+ struct bt_value *map_obj, const char *key,
+ bt_value **entry_obj)
{
enum bt_value_map_insert_entry_status ret;
struct bt_value *array_obj = NULL;
array_obj = bt_value_array_create();
ret = bt_value_map_insert_entry(map_obj, key,
(void *) array_obj);
+
+ if (entry_obj) {
+ *entry_obj = array_obj;
+ }
+
bt_object_put_ref(array_obj);
return ret;
}
enum bt_value_map_insert_entry_status
-bt_value_map_insert_empty_map_entry(struct bt_value *map_obj, const char *key)
+bt_value_map_insert_empty_map_entry(struct bt_value *map_obj, const char *key,
+ bt_value **entry_obj)
{
enum bt_value_map_insert_entry_status ret;
struct bt_value *empty_map_obj = NULL;
empty_map_obj = bt_value_map_create();
ret = bt_value_map_insert_entry(map_obj, key,
(void *) empty_map_obj);
+
+ if (entry_obj) {
+ *entry_obj = empty_map_obj;
+ }
+
bt_object_put_ref(empty_map_obj);
return ret;
}
const char *key_str = g_quark_to_string(GPOINTER_TO_UINT(key));
if (!func(key_str, element_obj, data)) {
- BT_LOGT("User canceled the loop: key=\"%s\", "
+ BT_LOGT("User interrupted the loop: key=\"%s\", "
"value-addr=%p, data=%p",
key_str, element_obj, data);
- ret = BT_FUNC_STATUS_CANCELED;
+ ret = BT_FUNC_STATUS_INTERRUPTED;
break;
}
}