*/
#ifndef _di_f_utf_string_map_t_
typedef struct {
- f_utf_string_dynamic_t name;
+ f_utf_string_dynamic_t key;
f_utf_string_dynamic_t value;
} f_utf_string_map_t;
#define f_utf_string_map_t_initialize { f_utf_string_dynamic_t_initialize, f_utf_string_dynamic_t_initialize }
- #define macro_f_utf_string_map_t_initialize_1(name, value) { name, value }
+ #define macro_f_utf_string_map_t_initialize_1(key, value) { key, value }
#define macro_f_utf_string_map_t_clear(map) \
- macro_f_utf_string_dynamic_t_clear(map.name) \
+ macro_f_utf_string_dynamic_t_clear(map.key) \
macro_f_utf_string_dynamic_t_clear(map.value)
#endif // _di_f_utf_string_map_t_
#endif
/**
- * A string map consisting of a name and multiple values.
+ * A string map consisting of a key and multiple values.
*
* Properties:
* - key: A string representing the map key.
*/
#ifndef _di_f_utf_string_map_multi_t_
typedef struct {
- f_utf_string_dynamic_t name;
+ f_utf_string_dynamic_t key;
f_utf_string_dynamics_t value;
} f_utf_string_map_multi_t;
#define f_utf_string_map_multi_t_initialize { f_utf_string_dynamic_t_initialize, f_utf_string_dynamics_t_initialize }
- #define macro_f_utf_string_map_multi_t_initialize_1(name, value) { name, value }
+ #define macro_f_utf_string_map_multi_t_initialize_1(key, value) { key, value }
#define macro_f_utf_string_map_multi_t_clear(map) \
- macro_f_utf_string_dynamic_t_clear(map.name) \
+ macro_f_utf_string_dynamic_t_clear(map.key) \
macro_f_utf_string_dynamics_t_clear(map.value)
#endif // _di_f_utf_string_map_multi_t_
f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_utf_string_map_multi_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
- destination->array[destination->used].name.used = 0;
+ destination->array[destination->used].key.used = 0;
destination->array[destination->used].value.used = 0;
- if (source.name.used) {
- status = private_f_utf_string_append(source.name.string, source.name.used, &destination->array[destination->used].name);
+ if (source.key.used) {
+ status = private_f_utf_string_append(source.key.string, source.key.used, &destination->array[destination->used].key);
if (F_status_is_error(status)) return status;
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
- if (array[i].name.size && array[i].name.string) {
- status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size);
+ if (array[i].key.size && array[i].key.string) {
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].key.string, &array[i].key.used, &array[i].key.size);
if (F_status_is_error(status)) return status;
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
- if (array[i].name.size && array[i].name.string) {
- status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size);
+ if (array[i].key.size && array[i].key.string) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].key.string, &array[i].key.used, &array[i].key.size);
if (F_status_is_error(status)) return status;
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
if (array[i].size && array[i].array) {
- if (array[i].array[j].name.size && array[i].array[j].name.string) {
- status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size);
+ if (array[i].array[j].key.size && array[i].array[j].key.string) {
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].key.string, &array[i].array[j].key.used, &array[i].array[j].key.size);
if (F_status_is_error(status)) return status;
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
if (array[i].size && array[i].array) {
- if (array[i].array[j].name.size && array[i].array[j].name.string) {
- status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size);
+ if (array[i].array[j].key.size && array[i].array[j].key.string) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].key.string, &array[i].array[j].key.used, &array[i].array[j].key.size);
if (F_status_is_error(status)) return status;
}
{
f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_utf_string_map_t), (void **) &destination->array, &destination->used, &destination->size);
- destination->array[destination->used].name.used = 0;
+ destination->array[destination->used].key.used = 0;
destination->array[destination->used].value.used = 0;
- if (source.name.used) {
- status = private_f_utf_string_append(source.name.string, source.name.used, &destination->array[destination->used].name);
+ if (source.key.used) {
+ status = private_f_utf_string_append(source.key.string, source.key.used, &destination->array[destination->used].key);
if (F_status_is_error(status)) return status;
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
- if (array[i].name.size && array[i].name.string) {
- status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size);
+ if (array[i].key.size && array[i].key.string) {
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].key.string, &array[i].key.used, &array[i].key.size);
if (F_status_is_error(status)) return status;
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
- if (array[i].name.size && array[i].name.string) {
- status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size);
+ if (array[i].key.size && array[i].key.string) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].key.string, &array[i].key.used, &array[i].key.size);
if (F_status_is_error(status)) return status;
}
if (array[i].size && array[i].array) {
for (j = 0; j < array[i].size; ++j) {
- if (array[i].array[j].name.size && array[i].array[j].name.string) {
- status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size);
+ if (array[i].array[j].key.size && array[i].array[j].key.string) {
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].key.string, &array[i].array[j].key.used, &array[i].array[j].key.size);
if (F_status_is_error(status)) return status;
}
if (array[i].size && array[i].array) {
for (j = 0; j < array[i].size; ++j) {
- if (array[i].array[j].name.size && array[i].array[j].name.string) {
- status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size);
+ if (array[i].array[j].key.size && array[i].array[j].key.string) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].key.string, &array[i].array[j].key.used, &array[i].array[j].key.size);
if (F_status_is_error(status)) return status;
}
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
- destination->array[destination->used].name.used = 0;
+ destination->array[destination->used].key.used = 0;
destination->array[destination->used].value.used = 0;
- if (source.array[i].name.used) {
- status = private_f_utf_string_append(source.array[i].name.string, source.array[i].name.used, &destination->array[destination->used].name);
+ if (source.array[i].key.used) {
+ status = private_f_utf_string_append(source.array[i].key.string, source.array[i].key.used, &destination->array[destination->used].key);
if (F_status_is_error(status)) return status;
}
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
- destination->array[destination->used].name.used = 0;
+ destination->array[destination->used].key.used = 0;
destination->array[destination->used].value.used = 0;
- if (source.array[i].name.used) {
- status = private_f_utf_string_append(source.array[i].name.string, source.array[i].name.used, &destination->array[destination->used].name);
+ if (source.array[i].key.used) {
+ status = private_f_utf_string_append(source.array[i].key.string, source.array[i].key.used, &destination->array[destination->used].key);
if (F_status_is_error(status)) return status;
}
+++ /dev/null
-#include "../utf.h"
-#include "../private-utf.h"
-#include "private-maps.h"
-#include "private-mapss.h"
-#include "private-string.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: UTF
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * These are provided for internal reduction in redundant code.
- * These should not be exposed/used outside of this project.
- */
-#ifndef _PRIVATE_F_utf_mapss_h
-#define _PRIVATE_F_utf_mapss_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_F_utf_mapss_h
macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\02\0\0\0", 0, 11),
};
- const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9);
+ const f_utf_string_static_t test_key = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9);
const f_utf_string_statics_t test_value = macro_f_utf_string_statics_t_initialize_1(test_value_array, 0, length_values);
{
- f_status_t status = f_utf_string_dynamic_append(test_name, &source.name);
+ f_status_t status = f_utf_string_dynamic_append(test_key, &source.key);
assert_int_equal(status, F_okay);
- assert_int_equal(source.name.used, test_name.used);
+ assert_int_equal(source.key.used, test_key.used);
- for (f_number_unsigned_t i = 0; i < source.name.used; ++i) {
- assert_int_equal(source.name.string[i], test_name.string[i]);
+ for (f_number_unsigned_t i = 0; i < source.key.used; ++i) {
+ assert_int_equal(source.key.string[i], test_key.string[i]);
} // for
status = f_utf_string_dynamics_append_all(test_value, &source.value);
assert_int_equal(status, F_okay);
assert_int_equal(destination.used, 1);
- assert_int_equal(destination.array[0].name.used, source.name.used);
+ assert_int_equal(destination.array[0].key.used, source.key.used);
assert_int_equal(destination.array[0].value.used, source.value.used);
assert_int_equal(destination.array[0].value.array[0].used, source.value.array[0].used);
assert_int_equal(destination.array[0].value.array[1].used, source.value.array[1].used);
- assert_string_equal(destination.array[0].name.string, source.name.string);
+ assert_string_equal(destination.array[0].key.string, source.key.string);
assert_string_equal(destination.array[0].value.array[0].string, source.value.array[0].string);
assert_string_equal(destination.array[0].value.array[1].string, source.value.array[1].string);
- for (f_number_unsigned_t j = 0; j < destination.array[0].name.used; ++j) {
- assert_int_equal(destination.array[0].name.string[j], source.name.string[j]);
+ for (f_number_unsigned_t j = 0; j < destination.array[0].key.used; ++j) {
+ assert_int_equal(destination.array[0].key.string[j], source.key.string[j]);
} // for
for (f_number_unsigned_t j = 0; j < destination.array[0].value.array[0].used; ++j) {
} // for
}
- free((void *) source.name.string);
+ free((void *) source.key.string);
free((void *) source.value.array[0].string);
free((void *) source.value.array[1].string);
free((void *) source.value.array);
- free((void *) destination.array[0].name.string);
+ free((void *) destination.array[0].key.string);
free((void *) destination.array[0].value.array[0].string);
free((void *) destination.array[0].value.array[1].string);
free((void *) destination.array[0].value.array);
macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\02\0\0\0", 0, 11),
};
- const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9);
+ const f_utf_string_static_t test_key = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9);
const f_utf_string_statics_t test_value = macro_f_utf_string_statics_t_initialize_1(test_value_array, 0, length_values);
{
for (; source.used < length_inner; ++source.used) {
- status = f_utf_string_dynamic_append(test_name, &source.array[source.used].name);
+ status = f_utf_string_dynamic_append(test_key, &source.array[source.used].key);
assert_int_equal(status, F_okay);
- assert_string_equal(source.array[source.used].name.string, test_name.string);
- assert_int_equal(source.array[source.used].name.used, test_name.used);
+ assert_string_equal(source.array[source.used].key.string, test_key.string);
+ assert_int_equal(source.array[source.used].key.used, test_key.used);
status = f_utf_string_dynamics_append_all(test_value, &source.array[source.used].value);
for (f_number_unsigned_t i = 0; i < length_inner; ++i) {
- assert_int_equal(destination.array[i].name.used, source.array[i].name.used);
+ assert_int_equal(destination.array[i].key.used, source.array[i].key.used);
assert_int_equal(destination.array[i].value.used, source.array[i].value.used);
assert_int_equal(destination.array[i].value.array[0].used, source.array[i].value.array[0].used);
assert_int_equal(destination.array[i].value.array[1].used, source.array[i].value.array[1].used);
- assert_string_equal(destination.array[i].name.string, source.array[i].name.string);
+ assert_string_equal(destination.array[i].key.string, source.array[i].key.string);
assert_string_equal(destination.array[i].value.array[0].string, source.array[i].value.array[0].string);
assert_string_equal(destination.array[i].value.array[1].string, source.array[i].value.array[1].string);
} // for
for (f_number_unsigned_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].name.string);
+ free((void *) source.array[i].key.string);
free((void *) source.array[i].value.array[0].string);
free((void *) source.array[i].value.array[1].string);
free((void *) source.array[i].value.array);
for (f_number_unsigned_t i = 0; i < destination.used; ++i) {
- free((void *) destination.array[i].name.string);
+ free((void *) destination.array[i].key.string);
free((void *) destination.array[i].value.array[0].string);
free((void *) destination.array[i].value.array[1].string);
free((void *) destination.array[i].value.array);
mock_unwrap = 0;
mock_unwrap_f_memory = 0;
- f_utf_char_t name_string[] = { 'n', 0 };
+ f_utf_char_t key_string[] = { 'n', 0 };
f_utf_char_t value_string[] = { 'v', 0 };
- f_utf_string_dynamic_t name = { .string = name_string, .used = 0, .size = 1 };
+ f_utf_string_dynamic_t key = { .string = key_string, .used = 0, .size = 1 };
f_utf_string_dynamic_t value = { .string = value_string, .used = 0, .size = 1 };
f_utf_string_dynamic_t value_array[] = { value };
f_utf_string_dynamics_t values = { .array = value_array, .used = 0, .size = 1 };
- f_utf_string_map_multi_t data = { .name = name, .value = values };
+ f_utf_string_map_multi_t data = { .key = key, .value = values };
f_utf_string_map_multi_t data_array[] = { data };
{
assert_int_equal(status, F_status_set_error(F_failure));
}
- data_array[0].name.size = 1;
+ data_array[0].key.size = 1;
data_array[0].value.size = 1;
data_array[0].value.array[0].size = 1;
assert_int_equal(status, F_status_set_error(F_failure));
}
- data_array[0].name.size = 1;
+ data_array[0].key.size = 1;
data_array[0].value.size = 1;
data_array[0].value.array[0].size = 1;
f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_map_multi_t), (void **) &datas.array, &datas.used, &datas.size);
assert_int_equal(status, F_okay);
- status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size);
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].key.string, &datas.array[0].key.used, &datas.array[0].key.size);
assert_int_equal(status, F_okay);
status = f_memory_array_resize(1, sizeof(f_utf_string_dynamic_t), (void **) &datas.array[0].value.array, &datas.array[0].value.used, &datas.array[0].value.size);
const f_status_t status = f_utf_string_map_multis_delete_callback(0, length, (void *) datas.array);
assert_int_equal(status, F_okay);
- assert_int_equal(datas.array[0].name.size, 0);
+ assert_int_equal(datas.array[0].key.size, 0);
assert_int_equal(datas.array[0].value.size, 0);
}
- free((void *) datas.array[0].name.string);
+ free((void *) datas.array[0].key.string);
free((void *) datas.array[0].value.array);
free((void *) datas.array);
}
mock_unwrap = 0;
mock_unwrap_f_memory = 0;
- f_utf_char_t name_string[] = { 'n', 0 };
+ f_utf_char_t key_string[] = { 'n', 0 };
f_utf_char_t value_string[] = { 'v', 0 };
- f_utf_string_dynamic_t name = { .string = name_string, .used = 0, .size = 1 };
+ f_utf_string_dynamic_t key = { .string = key_string, .used = 0, .size = 1 };
f_utf_string_dynamic_t value = { .string = value_string, .used = 0, .size = 1 };
f_utf_string_dynamic_t value_array[] = { value };
f_utf_string_dynamics_t values = { .array = value_array, .used = 0, .size = 1 };
- f_utf_string_map_multi_t data = { .name = name, .value = values };
+ f_utf_string_map_multi_t data = { .key = key, .value = values };
f_utf_string_map_multi_t data_array[] = { data };
{
assert_int_equal(status, F_status_set_error(F_failure));
}
- data_array[0].name.size = 1;
+ data_array[0].key.size = 1;
data_array[0].value.size = 1;
data_array[0].value.array[0].size = 1;
assert_int_equal(status, F_status_set_error(F_failure));
}
- data_array[0].name.size = 1;
+ data_array[0].key.size = 1;
data_array[0].value.size = 1;
data_array[0].value.array[0].size = 1;
f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_map_multi_t), (void **) &datas.array, &datas.used, &datas.size);
assert_int_equal(status, F_okay);
- status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size);
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].key.string, &datas.array[0].key.used, &datas.array[0].key.size);
assert_int_equal(status, F_okay);
status = f_memory_array_resize(1, sizeof(f_utf_string_dynamic_t), (void **) &datas.array[0].value.array, &datas.array[0].value.used, &datas.array[0].value.size);
const f_status_t status = f_utf_string_map_multis_destroy_callback(0, length, (void *) datas.array);
assert_int_equal(status, F_okay);
- assert_int_equal(datas.array[0].name.size, 0);
+ assert_int_equal(datas.array[0].key.size, 0);
assert_int_equal(datas.array[0].value.size, 0);
}
- free((void *) datas.array[0].name.string);
+ free((void *) datas.array[0].key.string);
free((void *) datas.array[0].value.array);
free((void *) datas.array);
}
for (; source.used < length_inner; ++source.used) {
- status = f_utf_string_dynamic_append(test_names[source.used], &source.array[source.used].name);
+ status = f_utf_string_dynamic_append(test_names[source.used], &source.array[source.used].key);
assert_int_equal(status, F_okay);
- assert_string_equal(source.array[source.used].name.string, test_names[source.used].string);
- assert_int_equal(source.array[source.used].name.used, test_names[source.used].used);
+ assert_string_equal(source.array[source.used].key.string, test_names[source.used].string);
+ assert_int_equal(source.array[source.used].key.used, test_names[source.used].used);
status = f_utf_string_dynamics_append_all(test_values[source.used], &source.array[source.used].value);
for (f_number_unsigned_t i = 0; i < length_inner; ++i) {
- assert_int_equal(destination.array[0].array[i].name.used, test_names[i].used);
+ assert_int_equal(destination.array[0].array[i].key.used, test_names[i].used);
assert_int_equal(destination.array[0].array[i].value.used, test_values[i].used);
assert_int_equal(destination.array[0].array[i].value.array[0].used, test_values[i].array[0].used);
assert_int_equal(destination.array[0].array[i].value.array[1].used, test_values[i].array[1].used);
- assert_string_equal(destination.array[0].array[i].name.string, test_names[i].string);
+ assert_string_equal(destination.array[0].array[i].key.string, test_names[i].string);
assert_string_equal(destination.array[0].array[i].value.array[0].string, test_values[i].array[0].string);
assert_string_equal(destination.array[0].array[i].value.array[1].string, test_values[i].array[1].string);
} // for
for (f_number_unsigned_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].name.string);
+ free((void *) source.array[i].key.string);
free((void *) source.array[i].value.array[0].string);
free((void *) source.array[i].value.array[1].string);
free((void *) source.array[i].value.array);
for (f_number_unsigned_t i = 0; i < destination.array[0].used; ++i) {
- free((void *) destination.array[0].array[i].name.string);
+ free((void *) destination.array[0].array[i].key.string);
free((void *) destination.array[0].array[i].value.array[0].string);
free((void *) destination.array[0].array[i].value.array[1].string);
free((void *) destination.array[0].array[i].value.array);
for (i = 0; i < length_inner; ++i) {
- status = f_utf_string_dynamic_append(test_names[i], &source.array[source.used].array[i].name);
+ status = f_utf_string_dynamic_append(test_names[i], &source.array[source.used].array[i].key);
assert_int_equal(status, F_okay);
- assert_int_equal(source.array[source.used].array[i].name.used, test_names[i].used);
- assert_string_equal(source.array[source.used].array[i].name.string, test_names[i].string);
+ assert_int_equal(source.array[source.used].array[i].key.used, test_names[i].used);
+ assert_string_equal(source.array[source.used].array[i].key.string, test_names[i].string);
status = f_utf_string_dynamics_append_all(test_values[i], &source.array[source.used].array[i].value);
for (f_number_unsigned_t i = 0; i < length_inner; ++i) {
- assert_int_equal(destination.array[j].array[i].name.used, test_names[i].used);
+ assert_int_equal(destination.array[j].array[i].key.used, test_names[i].used);
assert_int_equal(destination.array[j].array[i].value.used, test_values[i].used);
assert_int_equal(destination.array[j].array[i].value.array[0].used, test_values[i].array[0].used);
assert_int_equal(destination.array[j].array[i].value.array[1].used, test_values[i].array[1].used);
- assert_string_equal(destination.array[j].array[i].name.string, test_names[i].string);
+ assert_string_equal(destination.array[j].array[i].key.string, test_names[i].string);
assert_string_equal(destination.array[j].array[i].value.array[0].string, test_values[i].array[0].string);
assert_string_equal(destination.array[j].array[i].value.array[1].string, test_values[i].array[1].string);
} // for
for (f_number_unsigned_t i = 0; i < source.array[j].used; ++i) {
- free((void *) source.array[j].array[i].name.string);
+ free((void *) source.array[j].array[i].key.string);
free((void *) source.array[j].array[i].value.array[0].string);
free((void *) source.array[j].array[i].value.array[1].string);
free((void *) source.array[j].array[i].value.array);
for (f_number_unsigned_t i = 0; i < destination.array[j].used; ++i) {
- free((void *) destination.array[j].array[i].name.string);
+ free((void *) destination.array[j].array[i].key.string);
free((void *) destination.array[j].array[i].value.array[0].string);
free((void *) destination.array[j].array[i].value.array[1].string);
free((void *) destination.array[j].array[i].value.array);
f_utf_string_map_t source = f_utf_string_map_t_initialize;
f_utf_string_maps_t destination = f_utf_string_maps_t_initialize;
- const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9);
+ const f_utf_string_static_t test_key = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9);
const f_utf_string_static_t test_value = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e", 0, 10);
{
- f_status_t status = f_utf_string_dynamic_append(test_name, &source.name);
+ f_status_t status = f_utf_string_dynamic_append(test_key, &source.key);
assert_int_equal(status, F_okay);
- assert_string_equal(source.name.string, test_name.string);
- assert_int_equal(source.name.used, test_name.used);
+ assert_string_equal(source.key.string, test_key.string);
+ assert_int_equal(source.key.used, test_key.used);
status = f_utf_string_dynamic_append(test_value, &source.value);
assert_int_equal(status, F_okay);
assert_int_equal(destination.used, 1);
- assert_int_equal(destination.array[0].name.used, source.name.used);
+ assert_int_equal(destination.array[0].key.used, source.key.used);
assert_int_equal(destination.array[0].value.used, source.value.used);
- assert_string_equal(destination.array[0].name.string, source.name.string);
+ assert_string_equal(destination.array[0].key.string, source.key.string);
assert_string_equal(destination.array[0].value.string, source.value.string);
}
- free((void *) source.name.string);
+ free((void *) source.key.string);
free((void *) source.value.string);
- free((void *) destination.array[0].name.string);
+ free((void *) destination.array[0].key.string);
free((void *) destination.array[0].value.string);
free((void *) destination.array);
f_utf_string_maps_t source = f_utf_string_maps_t_initialize;
f_utf_string_maps_t destination = f_utf_string_maps_t_initialize;
- const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9);
+ const f_utf_string_static_t test_key = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9);
const f_utf_string_static_t test_value = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e", 0, 10);
{
for (; source.used < length_inner; ++source.used) {
- status = f_utf_string_dynamic_append(test_name, &source.array[source.used].name);
+ status = f_utf_string_dynamic_append(test_key, &source.array[source.used].key);
assert_int_equal(status, F_okay);
- assert_string_equal(source.array[source.used].name.string, test_name.string);
- assert_int_equal(source.array[source.used].name.used, test_name.used);
+ assert_string_equal(source.array[source.used].key.string, test_key.string);
+ assert_int_equal(source.array[source.used].key.used, test_key.used);
status = f_utf_string_dynamic_append(test_value, &source.array[source.used].value);
for (f_number_unsigned_t i = 0; i < length_inner; ++i) {
- assert_int_equal(destination.array[i].name.used, source.array[i].name.used);
+ assert_int_equal(destination.array[i].key.used, source.array[i].key.used);
assert_int_equal(destination.array[i].value.used, source.array[i].value.used);
- assert_string_equal(destination.array[i].name.string, source.array[i].name.string);
+ assert_string_equal(destination.array[i].key.string, source.array[i].key.string);
assert_string_equal(destination.array[i].value.string, source.array[i].value.string);
} // for
}
for (f_number_unsigned_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].name.string);
+ free((void *) source.array[i].key.string);
free((void *) source.array[i].value.string);
} // for
for (f_number_unsigned_t i = 0; i < destination.used; ++i) {
- free((void *) destination.array[i].name.string);
+ free((void *) destination.array[i].key.string);
free((void *) destination.array[i].value.string);
} // for
mock_unwrap = 0;
mock_unwrap_f_memory = 0;
- f_utf_char_t name_string[] = { 'n', 0 };
+ f_utf_char_t key_string[] = { 'n', 0 };
f_utf_char_t value_string[] = { 'v', 0 };
- f_utf_string_dynamic_t name = { .string = name_string, .used = 0, .size = 1 };
+ f_utf_string_dynamic_t key = { .string = key_string, .used = 0, .size = 1 };
f_utf_string_dynamic_t value = { .string = value_string, .used = 0, .size = 1 };
- f_utf_string_map_t data = { .name = name, .value = value };
+ f_utf_string_map_t data = { .key = key, .value = value };
f_utf_string_map_t data_array[] = { data };
{
assert_int_equal(status, F_status_set_error(F_failure));
}
- data_array[0].name.size = 1;
+ data_array[0].key.size = 1;
data_array[0].value.size = 1;
{
f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_map_t), (void **) &datas.array, &datas.used, &datas.size);
assert_int_equal(status, F_okay);
- status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size);
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].key.string, &datas.array[0].key.used, &datas.array[0].key.size);
assert_int_equal(status, F_okay);
status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].value.string, &datas.array[0].value.used, &datas.array[0].value.size);
assert_int_equal(datas.size, 0);
}
- free((void *) datas.array[0].name.string);
+ free((void *) datas.array[0].key.string);
free((void *) datas.array[0].value.string);
free((void *) datas.array);
}
mock_unwrap = 0;
mock_unwrap_f_memory = 0;
- f_utf_char_t name_string[] = { 'n', 0 };
+ f_utf_char_t key_string[] = { 'n', 0 };
f_utf_char_t value_string[] = { 'v', 0 };
- f_utf_string_dynamic_t name = { .string = name_string, .used = 0, .size = 1 };
+ f_utf_string_dynamic_t key = { .string = key_string, .used = 0, .size = 1 };
f_utf_string_dynamic_t value = { .string = value_string, .used = 0, .size = 1 };
- f_utf_string_map_t data = { .name = name, .value = value };
+ f_utf_string_map_t data = { .key = key, .value = value };
f_utf_string_map_t data_array[] = { data };
{
assert_int_equal(status, F_status_set_error(F_failure));
}
- data_array[0].name.size = 1;
+ data_array[0].key.size = 1;
data_array[0].value.size = 1;
{
f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_map_t), (void **) &datas.array, &datas.used, &datas.size);
assert_int_equal(status, F_okay);
- status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size);
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].key.string, &datas.array[0].key.used, &datas.array[0].key.size);
assert_int_equal(status, F_okay);
status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].value.string, &datas.array[0].value.used, &datas.array[0].value.size);
const f_status_t status = f_utf_string_maps_delete_callback(0, length, (void *) datas.array);
assert_int_equal(status, F_okay);
- assert_int_equal(datas.array[0].name.size, 0);
+ assert_int_equal(datas.array[0].key.size, 0);
assert_int_equal(datas.array[0].value.size, 0);
}
- free((void *) datas.array[0].name.string);
+ free((void *) datas.array[0].key.string);
free((void *) datas.array[0].value.string);
free((void *) datas.array);
}
mock_unwrap = 0;
mock_unwrap_f_memory = 0;
- f_utf_char_t name_string[] = { 'n', 0 };
+ f_utf_char_t key_string[] = { 'n', 0 };
f_utf_char_t value_string[] = { 'v', 0 };
- f_utf_string_dynamic_t name = { .string = name_string, .used = 0, .size = 1 };
+ f_utf_string_dynamic_t key = { .string = key_string, .used = 0, .size = 1 };
f_utf_string_dynamic_t value = { .string = value_string, .used = 0, .size = 1 };
- f_utf_string_map_t data = { .name = name, .value = value };
+ f_utf_string_map_t data = { .key = key, .value = value };
f_utf_string_map_t data_array[] = { data };
{
assert_int_equal(status, F_status_set_error(F_failure));
}
- data_array[0].name.size = 1;
+ data_array[0].key.size = 1;
data_array[0].value.size = 1;
{
f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_map_t), (void **) &datas.array, &datas.used, &datas.size);
assert_int_equal(status, F_okay);
- status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size);
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].key.string, &datas.array[0].key.used, &datas.array[0].key.size);
assert_int_equal(status, F_okay);
status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].value.string, &datas.array[0].value.used, &datas.array[0].value.size);
const f_status_t status = f_utf_string_maps_destroy_callback(0, length, (void *) datas.array);
assert_int_equal(status, F_okay);
- assert_int_equal(datas.array[0].name.size, 0);
+ assert_int_equal(datas.array[0].key.size, 0);
assert_int_equal(datas.array[0].value.size, 0);
}
- free((void *) datas.array[0].name.string);
+ free((void *) datas.array[0].key.string);
free((void *) datas.array[0].value.string);
free((void *) datas.array);
}
for (; source.used < length_inner; ++source.used) {
- status = f_utf_string_dynamic_append(test_names[source.used], &source.array[source.used].name);
+ status = f_utf_string_dynamic_append(test_names[source.used], &source.array[source.used].key);
assert_int_equal(status, F_okay);
- assert_string_equal(source.array[source.used].name.string, test_names[source.used].string);
- assert_int_equal(source.array[source.used].name.used, test_names[source.used].used);
+ assert_string_equal(source.array[source.used].key.string, test_names[source.used].string);
+ assert_int_equal(source.array[source.used].key.used, test_names[source.used].used);
status = f_utf_string_dynamic_append(test_values[source.used], &source.array[source.used].value);
for (f_number_unsigned_t i = 0; i < length_inner; ++i) {
- assert_int_equal(destination.array[0].array[i].name.used, test_names[i].used);
+ assert_int_equal(destination.array[0].array[i].key.used, test_names[i].used);
assert_int_equal(destination.array[0].array[i].value.used, test_values[i].used);
- assert_string_equal(destination.array[0].array[i].name.string, test_names[i].string);
+ assert_string_equal(destination.array[0].array[i].key.string, test_names[i].string);
assert_string_equal(destination.array[0].array[i].value.string, test_values[i].string);
} // for
}
for (f_number_unsigned_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].name.string);
+ free((void *) source.array[i].key.string);
free((void *) source.array[i].value.string);
} // for
for (f_number_unsigned_t i = 0; i < destination.array[0].used; ++i) {
- free((void *) destination.array[0].array[i].name.string);
+ free((void *) destination.array[0].array[i].key.string);
free((void *) destination.array[0].array[i].value.string);
} // for
for (i = 0; i < length_inner; ++i) {
- status = f_utf_string_dynamic_append(test_names[i], &source.array[source.used].array[i].name);
+ status = f_utf_string_dynamic_append(test_names[i], &source.array[source.used].array[i].key);
assert_int_equal(status, F_okay);
- assert_string_equal(source.array[source.used].array[i].name.string, test_names[i].string);
- assert_int_equal(source.array[source.used].array[i].name.used, test_names[i].used);
+ assert_string_equal(source.array[source.used].array[i].key.string, test_names[i].string);
+ assert_int_equal(source.array[source.used].array[i].key.used, test_names[i].used);
status = f_utf_string_dynamic_append(test_values[i], &source.array[source.used].array[i].value);
for (f_number_unsigned_t i = 0; i < length_inner; ++i) {
- assert_int_equal(destination.array[j].array[i].name.used, test_names[i].used);
+ assert_int_equal(destination.array[j].array[i].key.used, test_names[i].used);
assert_int_equal(destination.array[j].array[i].value.used, test_values[i].used);
- assert_string_equal(destination.array[j].array[i].name.string, test_names[i].string);
+ assert_string_equal(destination.array[j].array[i].key.string, test_names[i].string);
assert_string_equal(destination.array[j].array[i].value.string, test_values[i].string);
} // for
} // for
for (f_number_unsigned_t i = 0; i < source.array[j].used; ++i) {
- free((void *) source.array[j].array[i].name.string);
+ free((void *) source.array[j].array[i].key.string);
free((void *) source.array[j].array[i].value.string);
} // for
for (f_number_unsigned_t i = 0; i < destination.array[j].used; ++i) {
- free((void *) destination.array[j].array[i].name.string);
+ free((void *) destination.array[j].array[i].key.string);
free((void *) destination.array[j].array[i].value.string);
} // for