BT_ASSERT(element_obj);
BT_LOGD("Copying array value's element: element-addr=%p, "
"index=%d", element_obj, i);
- ret = bt_value_copy(&element_obj_copy, element_obj);
+ ret = bt_value_copy(element_obj, &element_obj_copy);
if (ret) {
BT_LOGE("Cannot copy array value's element: "
"array-addr=%p, index=%d",
BT_ASSERT(key_str);
BT_LOGD("Copying map value's element: element-addr=%p, "
"key=\"%s\"", element_obj, key_str);
- ret = bt_value_copy(&element_obj_copy, element_obj);
+ ret = bt_value_copy(element_obj, &element_obj_copy);
if (ret) {
BT_LOGE("Cannot copy map value's element: "
"map-addr=%p, key=\"%s\"",
}
enum bt_value_status bt_value_map_foreach_entry(struct bt_value *map_obj,
- bt_value_map_foreach_entry_cb cb, void *data)
+ bt_value_map_foreach_entry_func func, void *data)
{
enum bt_value_status ret = BT_VALUE_STATUS_OK;
gpointer key, element_obj;
struct bt_value_map *typed_map_obj = BT_VALUE_TO_MAP(map_obj);
BT_ASSERT_PRE_NON_NULL(map_obj, "Value object");
- BT_ASSERT_PRE_NON_NULL(cb, "Callback");
+ BT_ASSERT_PRE_NON_NULL(func, "Callback");
BT_ASSERT_PRE_VALUE_IS_TYPE(map_obj, BT_VALUE_TYPE_MAP);
g_hash_table_iter_init(&iter, typed_map_obj->ght);
while (g_hash_table_iter_next(&iter, &key, &element_obj)) {
const char *key_str = g_quark_to_string(GPOINTER_TO_UINT(key));
- if (!cb(key_str, element_obj, data)) {
+ if (!func(key_str, element_obj, data)) {
BT_LOGV("User canceled the loop: key=\"%s\", "
"value-addr=%p, data=%p",
key_str, element_obj, 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)
+ bt_value_map_foreach_entry_const_func func, void *data)
{
return bt_value_map_foreach_entry((void *) map_obj,
- (bt_value_map_foreach_entry_cb) cb, data);
+ (bt_value_map_foreach_entry_func) func, data);
}
struct extend_map_element_data {
struct bt_value *extension_obj_elem_copy = NULL;
/* Copy object which is to replace the current one */
- extend_data->status = bt_value_copy(&extension_obj_elem_copy,
- extension_obj_elem);
+ extend_data->status = bt_value_copy(extension_obj_elem,
+ &extension_obj_elem_copy);
if (extend_data->status) {
BT_LOGE("Cannot copy map element: addr=%p",
extension_obj_elem);
}
enum bt_value_status bt_value_map_extend(
- struct bt_value **extended_map_obj,
const struct bt_value *base_map_obj,
- const struct bt_value *extension_obj)
+ const struct bt_value *extension_obj,
+ struct bt_value **extended_map_obj)
{
struct extend_map_element_data extend_data = {
.extended_obj = NULL,
*extended_map_obj = NULL;
/* Create copy of base map object to start with */
- extend_data.status = bt_value_copy(extended_map_obj, base_map_obj);
+ extend_data.status = bt_value_copy(base_map_obj, extended_map_obj);
if (extend_data.status) {
BT_LOGE("Cannot copy base value: base-value-addr=%p",
base_map_obj);
return extend_data.status;
}
-enum bt_value_status bt_value_copy(struct bt_value **copy_obj,
- const struct bt_value *object)
+enum bt_value_status bt_value_copy(const struct bt_value *object,
+ struct bt_value **copy_obj)
{
enum bt_value_status status = BT_VALUE_STATUS_OK;