From: Kevin Day Date: Wed, 28 Feb 2024 02:11:56 +0000 (-0600) Subject: Refactor: The map "name" into "key". X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=3fbd696f05704214ad4b6d508ae201f10c4adc5d;p=fll Refactor: The map "name" into "key". I find myself constantly typing "key" rather than "name". I like the idea of using "name" as it is the "name" of the "key". However, I have decided to refactor this from "name" into "key" given my natural tendency to type "key" when thinking about a map. --- diff --git a/level_0/f_abstruse/c/abstruse/private-abstruse.c b/level_0/f_abstruse/c/abstruse/private-abstruse.c index 893792a..4de2ffa 100644 --- a/level_0/f_abstruse/c/abstruse/private-abstruse.c +++ b/level_0/f_abstruse/c/abstruse/private-abstruse.c @@ -94,8 +94,8 @@ extern "C" { break; case f_abstruse_map_e: - if (abstruse->is.a_map.name.size) { - return f_memory_array_resize(0, sizeof(f_char_t), (void **) &abstruse->is.a_map.name.string, &abstruse->is.a_map.name.used, &abstruse->is.a_map.name.size); + if (abstruse->is.a_map.key.size) { + return f_memory_array_resize(0, sizeof(f_char_t), (void **) &abstruse->is.a_map.key.string, &abstruse->is.a_map.key.used, &abstruse->is.a_map.key.size); } if (abstruse->is.a_map.value.size) { @@ -112,8 +112,8 @@ extern "C" { break; case f_abstruse_map_multi_e: - if (abstruse->is.a_map_multi.name.size) { - return f_memory_array_resize(0, sizeof(f_char_t), (void **) &abstruse->is.a_map_multi.name.string, &abstruse->is.a_map_multi.name.used, &abstruse->is.a_map_multi.name.size); + if (abstruse->is.a_map_multi.key.size) { + return f_memory_array_resize(0, sizeof(f_char_t), (void **) &abstruse->is.a_map_multi.key.string, &abstruse->is.a_map_multi.key.used, &abstruse->is.a_map_multi.key.size); } if (abstruse->is.a_map_multi.value.size) { @@ -262,8 +262,8 @@ extern "C" { break; case f_abstruse_map_e: - if (abstruse->is.a_map.name.size) { - return f_memory_array_adjust(0, sizeof(f_char_t), (void **) &abstruse->is.a_map.name.string, &abstruse->is.a_map.name.used, &abstruse->is.a_map.name.size); + if (abstruse->is.a_map.key.size) { + return f_memory_array_adjust(0, sizeof(f_char_t), (void **) &abstruse->is.a_map.key.string, &abstruse->is.a_map.key.used, &abstruse->is.a_map.key.size); } if (abstruse->is.a_map.value.size) { @@ -280,8 +280,8 @@ extern "C" { break; case f_abstruse_map_multi_e: - if (abstruse->is.a_map_multi.name.size) { - return f_memory_array_adjust(0, sizeof(f_char_t), (void **) &abstruse->is.a_map_multi.name.string, &abstruse->is.a_map_multi.name.used, &abstruse->is.a_map_multi.name.size); + if (abstruse->is.a_map_multi.key.size) { + return f_memory_array_adjust(0, sizeof(f_char_t), (void **) &abstruse->is.a_map_multi.key.string, &abstruse->is.a_map_multi.key.used, &abstruse->is.a_map_multi.key.size); } if (abstruse->is.a_map_multi.value.size) { diff --git a/level_0/f_console/c/console.c b/level_0/f_console/c/console.c index f57ea47..c8a1cdb 100644 --- a/level_0/f_console/c/console.c +++ b/level_0/f_console/c/console.c @@ -33,9 +33,9 @@ extern "C" { } // for if (total) { - environment->array[environment->used].name.string = arguments.envp[i]; - environment->array[environment->used].name.used = total; - environment->array[environment->used].name.size = 0; + environment->array[environment->used].key.string = arguments.envp[i]; + environment->array[environment->used].key.used = total; + environment->array[environment->used].key.size = 0; if (arguments.envp[i][++total]) { environment->array[environment->used].value.string = arguments.envp[i] + total; diff --git a/level_0/f_console/tests/unit/c/test-console-environment_process.c b/level_0/f_console/tests/unit/c/test-console-environment_process.c index f6a56f2..eac341a 100644 --- a/level_0/f_console/tests/unit/c/test-console-environment_process.c +++ b/level_0/f_console/tests/unit/c/test-console-environment_process.c @@ -77,25 +77,25 @@ void test__f_console_environment_process__works(void **state) { assert_int_equal(status, F_okay); assert_int_equal(maps.used, 5); - assert_int_equal(maps.array[0].name.used, 1); + assert_int_equal(maps.array[0].key.used, 1); assert_int_equal(maps.array[0].value.used, 1); - assert_int_equal(maps.array[1].name.used, 3); + assert_int_equal(maps.array[1].key.used, 3); assert_int_equal(maps.array[1].value.used, 5); - assert_int_equal(maps.array[2].name.used, 1); + assert_int_equal(maps.array[2].key.used, 1); assert_int_equal(maps.array[2].value.used, 5); - assert_int_equal(maps.array[3].name.used, 3); + assert_int_equal(maps.array[3].key.used, 3); assert_int_equal(maps.array[3].value.used, 6); - assert_int_equal(maps.array[4].name.used, 4); + assert_int_equal(maps.array[4].key.used, 4); assert_int_equal(maps.array[4].value.used, 0); // Construct NULL terminated strings to perform validation. for (uint8_t i = 0; i < 5; ++i) { { - char buffer[maps.array[i].name.used + 1]; + char buffer[maps.array[i].key.used + 1]; - memcpy(buffer, maps.array[i].name.string, sizeof(f_char_t) * maps.array[i].name.used); - buffer[maps.array[i].name.used] = 0; + memcpy(buffer, maps.array[i].key.string, sizeof(f_char_t) * maps.array[i].key.used); + buffer[maps.array[i].key.used] = 0; assert_string_equal(buffer, names[i]); } diff --git a/level_0/f_environment/c/environment.c b/level_0/f_environment/c/environment.c index 71e2b6e..80b8b3c 100644 --- a/level_0/f_environment/c/environment.c +++ b/level_0/f_environment/c/environment.c @@ -89,17 +89,17 @@ extern char **environ; // Copy all environment variables over when a custom define is used. for (char **string = environ; *string; string++) { - map.name.string = 0; + map.key.string = 0; map.value.string = 0; - map.name.used = 0; + map.key.used = 0; map.value.used = 0; at = index(*string, f_string_ascii_equal_s.string[0]); if (!at || at == *string) continue; - map.name.string = *string; - map.name.used = at - *string; + map.key.string = *string; + map.key.used = at - *string; map.value.string = at + 1; map.value.used = strlen(at + 1); diff --git a/level_0/f_environment/tests/unit/c/test-environment-get_all.c b/level_0/f_environment/tests/unit/c/test-environment-get_all.c index d469f12..29e7d98 100644 --- a/level_0/f_environment/tests/unit/c/test-environment-get_all.c +++ b/level_0/f_environment/tests/unit/c/test-environment-get_all.c @@ -16,7 +16,7 @@ void test__f_environment_get_all__parameter_checking(void **state) { void test__f_environment_get_all__works(void **state) { - const f_string_static_t name = macro_f_string_static_t_initialize_1("test", 0, 4); + const f_string_static_t key = macro_f_string_static_t_initialize_1("test", 0, 4); const f_string_static_t value = macro_f_string_static_t_initialize_1("works", 0, 5); f_string_maps_t environment = f_string_maps_t_initialize; @@ -24,13 +24,13 @@ void test__f_environment_get_all__works(void **state) { { // Cannot easily mock because this is used: extern char **environ; clearenv(); - setenv(name.string, value.string, true); + setenv(key.string, value.string, true); const f_status_t status = f_environment_get_all(&environment); assert_int_equal(status, F_okay); assert_int_equal(environment.used, 1); - assert_string_equal(environment.array[0].name.string, name.string); + assert_string_equal(environment.array[0].key.string, key.string); assert_string_equal(environment.array[0].value.string, value.string); } diff --git a/level_0/f_string/c/string/map.h b/level_0/f_string/c/string/map.h index 1f38bd3..1f2c8f9 100644 --- a/level_0/f_string/c/string/map.h +++ b/level_0/f_string/c/string/map.h @@ -17,24 +17,24 @@ extern "C" { #endif /** - * A string map consisting of a name and value. + * A string map consisting of a key and value. * * Properties: - * - name: A string representing the map name. + * - key: A string representing the map key. * - value: A string representing the map value. */ #ifndef _di_f_string_map_t_ typedef struct { - f_string_dynamic_t name; + f_string_dynamic_t key; f_string_dynamic_t value; } f_string_map_t; #define f_string_map_t_initialize { f_string_dynamic_t_initialize, f_string_dynamic_t_initialize } - #define macro_f_string_map_t_initialize_1(name, value) { name, value } + #define macro_f_string_map_t_initialize_1(key, value) { key, value } #define macro_f_string_map_t_clear(map) \ - macro_f_string_dynamic_t_clear(map.name) \ + macro_f_string_dynamic_t_clear(map.key) \ macro_f_string_dynamic_t_clear(map.value) #endif // _di_f_string_map_t_ diff --git a/level_0/f_string/c/string/map_multi.h b/level_0/f_string/c/string/map_multi.h index f255e16..4db5406 100644 --- a/level_0/f_string/c/string/map_multi.h +++ b/level_0/f_string/c/string/map_multi.h @@ -20,22 +20,22 @@ extern "C" { * A string map consisting of a name and multiple values. * * Properties: - * - name: A string representing the map name. + * - key: A string representing the map key. * - value: An array of strings representing the map value. */ #ifndef _di_f_string_map_multi_t_ typedef struct { - f_string_dynamic_t name; + f_string_dynamic_t key; f_string_dynamics_t value; } f_string_map_multi_t; #define f_string_map_multi_t_initialize { f_string_dynamic_t_initialize, f_string_dynamics_t_initialize } - #define macro_f_string_map_multi_t_initialize_1(name, value) { name, value } + #define macro_f_string_map_multi_t_initialize_1(key, value) { key, value } - #define macro_f_string_map_multi_t_clear(map) \ - macro_f_string_dynamic_t_clear(map.name) \ - macro_f_string_dynamics_t_clear(map.value) + #define macro_f_string_map_multi_t_clear(key) \ + macro_f_string_dynamic_t_clear(key.name) \ + macro_f_string_dynamics_t_clear(key.value) #endif // _di_f_string_map_multi_t_ #ifdef __cplusplus diff --git a/level_0/f_string/c/string/map_multis.c b/level_0/f_string/c/string/map_multis.c index 3f22244..7f73516 100644 --- a/level_0/f_string/c/string/map_multis.c +++ b/level_0/f_string/c/string/map_multis.c @@ -17,11 +17,11 @@ extern "C" { f_string_map_multi_t * const destination_inner = &destination->array[destination->used]; - destination_inner->name.used = 0; + destination_inner->key.used = 0; destination_inner->value.used = 0; - if (source.name.used) { - status = private_f_string_append(source.name.string, source.name.used, &destination_inner->name); + if (source.key.used) { + status = private_f_string_append(source.key.string, source.key.used, &destination_inner->key); if (F_status_is_error(status)) return status; } @@ -65,11 +65,11 @@ extern "C" { for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { destination_inner = &destination->array[destination->used]; - destination_inner->name.used = 0; + destination_inner->key.used = 0; destination_inner->value.used = 0; - if (source.array[i].name.used) { - status = private_f_string_append(source.array[i].name.string, source.array[i].name.used, &destination_inner->name); + if (source.array[i].key.used) { + status = private_f_string_append(source.array[i].key.string, source.array[i].key.used, &destination_inner->key); if (F_status_is_error(status)) return status; } @@ -104,8 +104,8 @@ extern "C" { 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; } @@ -138,8 +138,8 @@ extern "C" { 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; } diff --git a/level_0/f_string/c/string/map_multiss.c b/level_0/f_string/c/string/map_multiss.c index bb9c33b..5f5ffb9 100644 --- a/level_0/f_string/c/string/map_multiss.c +++ b/level_0/f_string/c/string/map_multiss.c @@ -30,11 +30,11 @@ extern "C" { for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination_inner->used) { - destination_inner->array[destination_inner->used].name.used = 0; + destination_inner->array[destination_inner->used].key.used = 0; destination_inner->array[destination_inner->used].value.used = 0; - if (source.array[i].name.used) { - status = private_f_string_append(source.array[i].name.string, source.array[i].name.used, &destination_inner->array[destination_inner->used].name); + if (source.array[i].key.used) { + status = private_f_string_append(source.array[i].key.string, source.array[i].key.used, &destination_inner->array[destination_inner->used].key); if (F_status_is_error(status)) return status; } @@ -94,11 +94,11 @@ extern "C" { destination_inner_deep = &destination_inner->array[destination_inner->used]; - destination_inner_deep->name.used = 0; + destination_inner_deep->key.used = 0; destination_inner_deep->value.used = 0; - if (source.array[i].array[j].name.used) { - status = private_f_string_append(source.array[i].array[j].name.string, source.array[i].array[j].name.used, &destination_inner_deep->name); + if (source.array[i].array[j].key.used) { + status = private_f_string_append(source.array[i].array[j].key.string, source.array[i].array[j].key.used, &destination_inner_deep->key); if (F_status_is_error(status)) return status; } @@ -137,8 +137,8 @@ extern "C" { for (f_number_unsigned_t i = start; i < stop; ++i) { if (array[i].size && array[i].array) { - if (array[i].array[j].name.size) { - 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) { + 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; } @@ -177,8 +177,8 @@ extern "C" { 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; } diff --git a/level_0/f_string/c/string/maps.c b/level_0/f_string/c/string/maps.c index c1f8c62..214bf51 100644 --- a/level_0/f_string/c/string/maps.c +++ b/level_0/f_string/c/string/maps.c @@ -15,11 +15,11 @@ extern "C" { f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_map_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_string_append(source.name.string, source.name.used, &destination->array[destination->used].name); + if (source.key.used) { + status = private_f_string_append(source.key.string, source.key.used, &destination->array[destination->used].key); if (F_status_is_error(status)) return status; } @@ -49,11 +49,11 @@ extern "C" { 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_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_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; } @@ -77,8 +77,8 @@ extern "C" { 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; } @@ -102,8 +102,8 @@ extern "C" { 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; } diff --git a/level_0/f_string/c/string/mapss.c b/level_0/f_string/c/string/mapss.c index a5dde7b..d43edb1 100644 --- a/level_0/f_string/c/string/mapss.c +++ b/level_0/f_string/c/string/mapss.c @@ -27,11 +27,11 @@ extern "C" { for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination_inner->used) { - destination_inner->array[destination_inner->used].name.used = 0; + destination_inner->array[destination_inner->used].key.used = 0; destination_inner->array[destination_inner->used].value.used = 0; - if (source.array[i].name.used) { - status = private_f_string_append(source.array[i].name.string, source.array[i].name.used, &destination_inner->array[destination_inner->used].name); + if (source.array[i].key.used) { + status = private_f_string_append(source.array[i].key.string, source.array[i].key.used, &destination_inner->array[destination_inner->used].key); if (F_status_is_error(status)) return status; } @@ -75,11 +75,11 @@ extern "C" { for (j = 0; j < source.array[i].used; ++j, ++destination_inner->used) { - destination_inner->array[destination_inner->used].name.used = 0; + destination_inner->array[destination_inner->used].key.used = 0; destination_inner->array[destination_inner->used].value.used = 0; - if (source.array[i].array[j].name.used) { - status = private_f_string_append(source.array[i].array[j].name.string, source.array[i].array[j].name.used, &destination_inner->array[destination_inner->used].name); + if (source.array[i].array[j].key.used) { + status = private_f_string_append(source.array[i].array[j].key.string, source.array[i].array[j].key.used, &destination_inner->array[destination_inner->used].key); if (F_status_is_error(status)) return status; } @@ -109,8 +109,8 @@ extern "C" { 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; } @@ -143,8 +143,8 @@ extern "C" { 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; } diff --git a/level_0/f_string/tests/unit/c/test-string-map_multis_append.c b/level_0/f_string/tests/unit/c/test-string-map_multis_append.c index 6dd72cd..54c43cb 100644 --- a/level_0/f_string/tests/unit/c/test-string-map_multis_append.c +++ b/level_0/f_string/tests/unit/c/test-string-map_multis_append.c @@ -16,15 +16,15 @@ void test__f_string_map_multis_append__works(void **state) { macro_f_string_static_t_initialize_1("test_value2", 0, 11), }; - const f_string_static_t test_name = macro_f_string_static_t_initialize_1("test_name", 0, 9); + const f_string_static_t test_key = macro_f_string_static_t_initialize_1("test_key", 0, 8); const f_string_statics_t test_value = macro_f_string_statics_t_initialize_1(test_value_array, 0, length_values); { - f_status_t status = f_string_dynamic_append(test_name, &source.name); + f_status_t status = f_string_dynamic_append(test_key, &source.key); assert_int_equal(status, F_okay); - assert_int_equal(source.name.used, test_name.used); - assert_string_equal(source.name.string, test_name.string); + assert_int_equal(source.key.used, test_key.used); + assert_string_equal(source.key.string, test_key.string); status = f_string_dynamics_append_all(test_value, &source.value); @@ -42,22 +42,22 @@ void test__f_string_map_multis_append__works(void **state) { 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); } - 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); diff --git a/level_0/f_string/tests/unit/c/test-string-map_multis_append_all.c b/level_0/f_string/tests/unit/c/test-string-map_multis_append_all.c index c841371..fedc2fb 100644 --- a/level_0/f_string/tests/unit/c/test-string-map_multis_append_all.c +++ b/level_0/f_string/tests/unit/c/test-string-map_multis_append_all.c @@ -17,7 +17,7 @@ void test__f_string_map_multis_append_all__works(void **state) { macro_f_string_static_t_initialize_1("test_value2", 0, 11), }; - const f_string_static_t test_name = macro_f_string_static_t_initialize_1("test_name", 0, 9); + const f_string_static_t test_key = macro_f_string_static_t_initialize_1("test_key", 0, 8); const f_string_statics_t test_value = macro_f_string_statics_t_initialize_1(test_value_array, 0, length_values); { @@ -28,11 +28,11 @@ void test__f_string_map_multis_append_all__works(void **state) { for (; source.used < length_inner; ++source.used) { - status = f_string_dynamic_append(test_name, &source.array[source.used].name); + status = f_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_string_dynamics_append_all(test_value, &source.array[source.used].value); @@ -53,12 +53,12 @@ void test__f_string_map_multis_append_all__works(void **state) { 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 @@ -66,7 +66,7 @@ void test__f_string_map_multis_append_all__works(void **state) { 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); @@ -74,7 +74,7 @@ void test__f_string_map_multis_append_all__works(void **state) { 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); diff --git a/level_0/f_string/tests/unit/c/test-string-map_multis_delete_callback.c b/level_0/f_string/tests/unit/c/test-string-map_multis_delete_callback.c index 1562825..35ec50a 100644 --- a/level_0/f_string/tests/unit/c/test-string-map_multis_delete_callback.c +++ b/level_0/f_string/tests/unit/c/test-string-map_multis_delete_callback.c @@ -10,11 +10,11 @@ void test__f_string_map_multis_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_string_dynamic_t name = { .string = "name", .used = 0, .size = 1 }; + f_string_dynamic_t key = { .string = "key", .used = 0, .size = 1 }; f_string_dynamic_t value = { .string = "value", .used = 0, .size = 1 }; f_string_dynamic_t value_array[] = { value }; f_string_dynamics_t values = { .array = value_array, .used = 0, .size = 1 }; - f_string_map_multi_t data = { .name = name, .value = values }; + f_string_map_multi_t data = { .key = key, .value = values }; f_string_map_multi_t data_array[] = { data }; { @@ -26,7 +26,7 @@ void test__f_string_map_multis_delete_callback__fails(void **state) { 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; @@ -42,7 +42,7 @@ void test__f_string_map_multis_delete_callback__fails(void **state) { 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; @@ -75,7 +75,7 @@ void test__f_string_map_multis_delete_callback__works(void **state) { f_status_t status = f_memory_array_resize(length, sizeof(f_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_string_dynamic_t), (void **) &datas.array[0].value.array, &datas.array[0].value.used, &datas.array[0].value.size); @@ -89,11 +89,11 @@ void test__f_string_map_multis_delete_callback__works(void **state) { const f_status_t status = f_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); } diff --git a/level_0/f_string/tests/unit/c/test-string-map_multis_destroy_callback.c b/level_0/f_string/tests/unit/c/test-string-map_multis_destroy_callback.c index 6c892d1..aa8363c 100644 --- a/level_0/f_string/tests/unit/c/test-string-map_multis_destroy_callback.c +++ b/level_0/f_string/tests/unit/c/test-string-map_multis_destroy_callback.c @@ -10,11 +10,11 @@ void test__f_string_map_multis_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_string_dynamic_t name = { .string = "name", .used = 0, .size = 1 }; + f_string_dynamic_t key = { .string = "key", .used = 0, .size = 1 }; f_string_dynamic_t value = { .string = "value", .used = 0, .size = 1 }; f_string_dynamic_t value_array[] = { value }; f_string_dynamics_t values = { .array = value_array, .used = 0, .size = 1 }; - f_string_map_multi_t data = { .name = name, .value = values }; + f_string_map_multi_t data = { .key = key, .value = values }; f_string_map_multi_t data_array[] = { data }; { @@ -26,7 +26,7 @@ void test__f_string_map_multis_destroy_callback__fails(void **state) { 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; @@ -42,7 +42,7 @@ void test__f_string_map_multis_destroy_callback__fails(void **state) { 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; @@ -75,7 +75,7 @@ void test__f_string_map_multis_destroy_callback__works(void **state) { f_status_t status = f_memory_array_resize(length, sizeof(f_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_string_dynamic_t), (void **) &datas.array[0].value.array, &datas.array[0].value.used, &datas.array[0].value.size); @@ -89,11 +89,11 @@ void test__f_string_map_multis_destroy_callback__works(void **state) { const f_status_t status = f_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); } diff --git a/level_0/f_string/tests/unit/c/test-string-map_multiss_append.c b/level_0/f_string/tests/unit/c/test-string-map_multiss_append.c index ed5ce88..46a816a 100644 --- a/level_0/f_string/tests/unit/c/test-string-map_multiss_append.c +++ b/level_0/f_string/tests/unit/c/test-string-map_multiss_append.c @@ -22,9 +22,9 @@ void test__f_string_map_multiss_append__works(void **state) { macro_f_string_static_t_initialize_1("test_value4", 0, 11), }; - const f_string_static_t test_names[] = { - macro_f_string_static_t_initialize_1("test_name1", 0, 10), - macro_f_string_static_t_initialize_1("test_name2", 0, 10), + const f_string_static_t test_keys[] = { + macro_f_string_static_t_initialize_1("test_key1", 0, 9), + macro_f_string_static_t_initialize_1("test_key2", 0, 9), }; const f_string_statics_t test_values[] = { @@ -40,11 +40,11 @@ void test__f_string_map_multiss_append__works(void **state) { for (; source.used < length_inner; ++source.used) { - status = f_string_dynamic_append(test_names[source.used], &source.array[source.used].name); + status = f_string_dynamic_append(test_keys[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_keys[source.used].string); + assert_int_equal(source.array[source.used].key.used, test_keys[source.used].used); status = f_string_dynamics_append_all(test_values[source.used], &source.array[source.used].value); @@ -66,12 +66,12 @@ void test__f_string_map_multiss_append__works(void **state) { 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_keys[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_keys[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 @@ -79,7 +79,7 @@ void test__f_string_map_multiss_append__works(void **state) { 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); @@ -88,7 +88,7 @@ void test__f_string_map_multiss_append__works(void **state) { 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); diff --git a/level_0/f_string/tests/unit/c/test-string-map_multiss_append_all.c b/level_0/f_string/tests/unit/c/test-string-map_multiss_append_all.c index f2352e5..aa081f7 100644 --- a/level_0/f_string/tests/unit/c/test-string-map_multiss_append_all.c +++ b/level_0/f_string/tests/unit/c/test-string-map_multiss_append_all.c @@ -23,9 +23,9 @@ void test__f_string_map_multiss_append_all__works(void **state) { macro_f_string_static_t_initialize_1("test_value4", 0, 11), }; - const f_string_static_t test_names[] = { - macro_f_string_static_t_initialize_1("test_name1", 0, 10), - macro_f_string_static_t_initialize_1("test_name2", 0, 10), + const f_string_static_t test_keys[] = { + macro_f_string_static_t_initialize_1("test_key1", 0, 9), + macro_f_string_static_t_initialize_1("test_key2", 0, 9), }; const f_string_statics_t test_values[] = { @@ -52,11 +52,11 @@ void test__f_string_map_multiss_append_all__works(void **state) { for (i = 0; i < length_inner; ++i) { - status = f_string_dynamic_append(test_names[i], &source.array[source.used].array[i].name); + status = f_string_dynamic_append(test_keys[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_keys[i].used); + assert_string_equal(source.array[source.used].array[i].key.string, test_keys[i].string); status = f_string_dynamics_append_all(test_values[i], &source.array[source.used].array[i].value); @@ -83,12 +83,12 @@ void test__f_string_map_multiss_append_all__works(void **state) { 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_keys[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_keys[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 @@ -99,7 +99,7 @@ void test__f_string_map_multiss_append_all__works(void **state) { 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); @@ -112,7 +112,7 @@ void test__f_string_map_multiss_append_all__works(void **state) { 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); diff --git a/level_0/f_string/tests/unit/c/test-string-maps_append.c b/level_0/f_string/tests/unit/c/test-string-maps_append.c index 4a867ea..19a42c5 100644 --- a/level_0/f_string/tests/unit/c/test-string-maps_append.c +++ b/level_0/f_string/tests/unit/c/test-string-maps_append.c @@ -10,15 +10,15 @@ void test__f_string_maps_append__works(void **state) { f_string_map_t source = f_string_map_t_initialize; f_string_maps_t destination = f_string_maps_t_initialize; - const f_string_static_t test_name = macro_f_string_static_t_initialize_1("test_name", 0, 9); + const f_string_static_t test_key = macro_f_string_static_t_initialize_1("test_key", 0, 8); const f_string_static_t test_value = macro_f_string_static_t_initialize_1("test_value", 0, 10); { - f_status_t status = f_string_dynamic_append(test_name, &source.name); + f_status_t status = f_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_string_dynamic_append(test_value, &source.value); @@ -32,16 +32,16 @@ void test__f_string_maps_append__works(void **state) { 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); diff --git a/level_0/f_string/tests/unit/c/test-string-maps_append_all.c b/level_0/f_string/tests/unit/c/test-string-maps_append_all.c index a73053b..a272a45 100644 --- a/level_0/f_string/tests/unit/c/test-string-maps_append_all.c +++ b/level_0/f_string/tests/unit/c/test-string-maps_append_all.c @@ -11,7 +11,7 @@ void test__f_string_maps_append_all__works(void **state) { f_string_maps_t source = f_string_maps_t_initialize; f_string_maps_t destination = f_string_maps_t_initialize; - const f_string_static_t test_name = macro_f_string_static_t_initialize_1("test_name", 0, 9); + const f_string_static_t test_key = macro_f_string_static_t_initialize_1("test_key", 0, 8); const f_string_static_t test_value = macro_f_string_static_t_initialize_1("test_value", 0, 10); { @@ -22,11 +22,11 @@ void test__f_string_maps_append_all__works(void **state) { for (; source.used < length_inner; ++source.used) { - status = f_string_dynamic_append(test_name, &source.array[source.used].name); + status = f_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_string_dynamic_append(test_value, &source.array[source.used].value); @@ -45,23 +45,23 @@ void test__f_string_maps_append_all__works(void **state) { 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 diff --git a/level_0/f_string/tests/unit/c/test-string-maps_delete_callback.c b/level_0/f_string/tests/unit/c/test-string-maps_delete_callback.c index 66adc06..e24783a 100644 --- a/level_0/f_string/tests/unit/c/test-string-maps_delete_callback.c +++ b/level_0/f_string/tests/unit/c/test-string-maps_delete_callback.c @@ -10,9 +10,9 @@ void test__f_string_maps_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_string_dynamic_t name = { .string = "name", .used = 0, .size = 1 }; + f_string_dynamic_t key = { .string = "key", .used = 0, .size = 1 }; f_string_dynamic_t value = { .string = "value", .used = 0, .size = 1 }; - f_string_map_t data = { .name = name, .value = value }; + f_string_map_t data = { .key = key, .value = value }; f_string_map_t data_array[] = { data }; { @@ -24,7 +24,7 @@ void test__f_string_maps_delete_callback__fails(void **state) { 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; { @@ -53,7 +53,7 @@ void test__f_string_maps_delete_callback__works(void **state) { f_status_t status = f_memory_array_resize(length, sizeof(f_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); @@ -64,11 +64,11 @@ void test__f_string_maps_delete_callback__works(void **state) { const f_status_t status = f_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); } diff --git a/level_0/f_string/tests/unit/c/test-string-maps_destroy_callback.c b/level_0/f_string/tests/unit/c/test-string-maps_destroy_callback.c index b125cbc..0a3fd34 100644 --- a/level_0/f_string/tests/unit/c/test-string-maps_destroy_callback.c +++ b/level_0/f_string/tests/unit/c/test-string-maps_destroy_callback.c @@ -10,9 +10,9 @@ void test__f_string_maps_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_string_dynamic_t name = { .string = "name", .used = 0, .size = 1 }; + f_string_dynamic_t key = { .string = "key", .used = 0, .size = 1 }; f_string_dynamic_t value = { .string = "value", .used = 0, .size = 1 }; - f_string_map_t data = { .name = name, .value = value }; + f_string_map_t data = { .key = key, .value = value }; f_string_map_t data_array[] = { data }; { @@ -24,7 +24,7 @@ void test__f_string_maps_destroy_callback__fails(void **state) { 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; { @@ -53,7 +53,7 @@ void test__f_string_maps_destroy_callback__works(void **state) { f_status_t status = f_memory_array_resize(length, sizeof(f_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); @@ -64,11 +64,11 @@ void test__f_string_maps_destroy_callback__works(void **state) { const f_status_t status = f_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); } diff --git a/level_0/f_string/tests/unit/c/test-string-mapss_append.c b/level_0/f_string/tests/unit/c/test-string-mapss_append.c index b86a5c4..1cd4a8d 100644 --- a/level_0/f_string/tests/unit/c/test-string-mapss_append.c +++ b/level_0/f_string/tests/unit/c/test-string-mapss_append.c @@ -11,9 +11,9 @@ void test__f_string_mapss_append__works(void **state) { f_string_maps_t source = f_string_maps_t_initialize; f_string_mapss_t destination = f_string_mapss_t_initialize; - const f_string_static_t test_names[] = { - macro_f_string_static_t_initialize_1("test_name1", 0, 10), - macro_f_string_static_t_initialize_1("test_name2", 0, 10), + const f_string_static_t test_keys[] = { + macro_f_string_static_t_initialize_1("test_key1", 0, 9), + macro_f_string_static_t_initialize_1("test_key2", 0, 9), }; const f_string_static_t test_values[] = { @@ -29,11 +29,11 @@ void test__f_string_mapss_append__works(void **state) { for (; source.used < length_inner; ++source.used) { - status = f_string_dynamic_append(test_names[source.used], &source.array[source.used].name); + status = f_string_dynamic_append(test_keys[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_keys[source.used].string); + assert_int_equal(source.array[source.used].key.used, test_keys[source.used].used); status = f_string_dynamic_append(test_values[source.used], &source.array[source.used].value); @@ -51,24 +51,24 @@ void test__f_string_mapss_append__works(void **state) { 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_keys[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_keys[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 diff --git a/level_0/f_string/tests/unit/c/test-string-mapss_append_all.c b/level_0/f_string/tests/unit/c/test-string-mapss_append_all.c index 76ed80c..1ef3088 100644 --- a/level_0/f_string/tests/unit/c/test-string-mapss_append_all.c +++ b/level_0/f_string/tests/unit/c/test-string-mapss_append_all.c @@ -12,9 +12,9 @@ void test__f_string_mapss_append_all__works(void **state) { f_string_mapss_t source = f_string_mapss_t_initialize; f_string_mapss_t destination = f_string_mapss_t_initialize; - const f_string_static_t test_names[] = { - macro_f_string_static_t_initialize_1("test_name1", 0, 10), - macro_f_string_static_t_initialize_1("test_name2", 0, 10), + const f_string_static_t test_keys[] = { + macro_f_string_static_t_initialize_1("test_key1", 0, 9), + macro_f_string_static_t_initialize_1("test_key2", 0, 9), }; const f_string_static_t test_values[] = { @@ -41,11 +41,11 @@ void test__f_string_mapss_append_all__works(void **state) { for (i = 0; i < length_inner; ++i) { - status = f_string_dynamic_append(test_names[i], &source.array[source.used].array[i].name); + status = f_string_dynamic_append(test_keys[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_keys[i].string); + assert_int_equal(source.array[source.used].array[i].key.used, test_keys[i].used); status = f_string_dynamic_append(test_values[i], &source.array[source.used].array[i].value); @@ -68,10 +68,10 @@ void test__f_string_mapss_append_all__works(void **state) { 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_keys[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_keys[i].string); assert_string_equal(destination.array[j].array[i].value.string, test_values[i].string); } // for } // for @@ -81,7 +81,7 @@ void test__f_string_mapss_append_all__works(void **state) { 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 @@ -92,7 +92,7 @@ void test__f_string_mapss_append_all__works(void **state) { 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 diff --git a/level_0/f_utf/c/utf/map.h b/level_0/f_utf/c/utf/map.h index 22b0e38..d1987b5 100644 --- a/level_0/f_utf/c/utf/map.h +++ b/level_0/f_utf/c/utf/map.h @@ -20,7 +20,7 @@ extern "C" { * A string map consisting of a name and value. * * Properties: - * - name: A string representing the map name. + * - key: A string representing the map key. * - value: A string representing the map value. */ #ifndef _di_f_utf_string_map_t_ diff --git a/level_0/f_utf/c/utf/map_multi.h b/level_0/f_utf/c/utf/map_multi.h index 38e2b68..69de59d 100644 --- a/level_0/f_utf/c/utf/map_multi.h +++ b/level_0/f_utf/c/utf/map_multi.h @@ -20,7 +20,7 @@ extern "C" { * A string map consisting of a name and multiple values. * * Properties: - * - name: A string representing the map name. + * - key: A string representing the map key. * - value: An array of strings representing the map value. */ #ifndef _di_f_utf_string_map_multi_t_ diff --git a/level_1/fl_environment/c/environment.c b/level_1/fl_environment/c/environment.c index 6dfcf23..d5b1152 100644 --- a/level_1/fl_environment/c/environment.c +++ b/level_1/fl_environment/c/environment.c @@ -16,17 +16,17 @@ extern "C" { f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_string_map_t), (void **) &environment->array, &environment->used, &environment->size); if (F_status_is_error(status)) return status; - environment->array[environment->used].name.used = 0; + environment->array[environment->used].key.used = 0; environment->array[environment->used].value.used = 0; - status = f_string_dynamic_append_nulless(name, &environment->array[environment->used].name); + status = f_string_dynamic_append_nulless(name, &environment->array[environment->used].key); if (F_status_is_error_not(status)) { status = f_environment_get(name, &environment->array[environment->used].value); } if (F_status_is_error(status) || status == F_data_not || status == F_exist_not) { - environment->array[environment->used].name.used = 0; + environment->array[environment->used].key.used = 0; environment->array[environment->used].value.used = 0; return status; @@ -54,16 +54,16 @@ extern "C" { for (f_number_unsigned_t i = 0; i < names.used; ++i) { - environment->array[environment->used].name.used = 0; + environment->array[environment->used].key.used = 0; environment->array[environment->used].value.used = 0; - status = f_string_dynamic_append_nulless(names.array[i], &environment->array[environment->used].name); + status = f_string_dynamic_append_nulless(names.array[i], &environment->array[environment->used].key); if (F_status_is_error_not(status)) { status = f_environment_get(names.array[i], &environment->array[environment->used].value); } else { - environment->array[environment->used].name.used = 0; + environment->array[environment->used].key.used = 0; environment->array[environment->used].value.used = 0; return status; diff --git a/level_1/fl_fss/c/fss/payload.c b/level_1/fl_fss/c/fss/payload.c index d3fe751..995b0be 100644 --- a/level_1/fl_fss/c/fss/payload.c +++ b/level_1/fl_fss/c/fss/payload.c @@ -78,16 +78,16 @@ extern "C" { if (F_status_set_fine(state->status) == F_interrupt) return; } - destinations->array[destinations->used].name.used = 0; + destinations->array[destinations->used].key.used = 0; destinations->array[destinations->used].value.used = 0; internal.range.start = 0; internal.range.stop = headers.array[internal.i].key.used ? headers.array[internal.i].key.used - 1 : 0; - private_fl_fss_basic_write(F_true, headers.array[internal.i].key, internal.quote, &internal.range, &destinations->array[destinations->used].name, state, (void * const) &internal); + private_fl_fss_basic_write(F_true, headers.array[internal.i].key, internal.quote, &internal.range, &destinations->array[destinations->used].key, state, (void * const) &internal); if (F_status_is_error_not(state->status)) { - state->status = f_string_dynamic_strip_null(&destinations->array[destinations->used].name); + state->status = f_string_dynamic_strip_null(&destinations->array[destinations->used].key); } if (F_status_is_error_not(state->status)) { @@ -222,7 +222,7 @@ extern "C" { break; case f_abstruse_map_e: - if (headers.array[internal.i].value.is.a_map.name.used || headers.array[internal.i].value.is.a_map.value.used) { + if (headers.array[internal.i].value.is.a_map.key.used || headers.array[internal.i].value.is.a_map.value.used) { if (private_fl_payload_header_map_map(data, state, &internal, &headers.array[internal.i].value.is.a_map, destinations) == F_false) { ++destinations->used; } @@ -246,7 +246,7 @@ extern "C" { break; case f_abstruse_map_multi_e: - if (headers.array[internal.i].value.is.a_map_multi.name.used || headers.array[internal.i].value.is.a_map_multi.value.used || (data->flag & f_fss_payload_header_map_flag_null_map_multi_values_name_e)) { + if (headers.array[internal.i].value.is.a_map_multi.key.used || headers.array[internal.i].value.is.a_map_multi.value.used || (data->flag & f_fss_payload_header_map_flag_null_map_multi_values_name_e)) { if (private_fl_payload_header_map_map_multi(data, state, &internal, &headers.array[internal.i].value.is.a_map_multi, destinations) == F_false) { ++destinations->used; } diff --git a/level_1/fl_fss/c/fss/payload/define.h b/level_1/fl_fss/c/fss/payload/define.h index 0132755..b8aeb13 100644 --- a/level_1/fl_fss/c/fss/payload/define.h +++ b/level_1/fl_fss/c/fss/payload/define.h @@ -95,10 +95,10 @@ extern "C" { } \ \ if (!(data->flag & f_fss_payload_header_map_flag_join_digits_e)) { \ - destinations->array[destinations->used].name.used = 0; \ + destinations->array[destinations->used].key.used = 0; \ destinations->array[destinations->used].value.used = 0; \ \ - state->status = f_string_dynamic_append(headers.array[internal.i].key, &destinations->array[destinations->used].name); \ + state->status = f_string_dynamic_append(headers.array[internal.i].key, &destinations->array[destinations->used].key); \ if (F_status_is_error(state->status)) break; \ \ state->status = f_string_dynamic_append(*data->cache, &destinations->array[destinations->used].value); \ diff --git a/level_1/fl_fss/c/fss/private-payload.c b/level_1/fl_fss/c/fss/private-payload.c index 08b11c9..c46a713 100644 --- a/level_1/fl_fss/c/fss/private-payload.c +++ b/level_1/fl_fss/c/fss/private-payload.c @@ -93,18 +93,18 @@ extern "C" { #if !defined(_di_fl_fss_payload_header_map_) uint8_t private_fl_payload_header_map_map(f_fss_payload_header_state_t * const data, f_state_t * const state, f_fss_payload_header_internal_t * const internal, f_string_map_t * const map, f_string_maps_t * const destinations) { - state->status = f_memory_array_increase_by(map->name.used + map->value.used + f_string_space_s.used + internal->quote_null.used * 2, sizeof(f_char_t), (void **) &destinations->array[destinations->used].value.string, &destinations->array[destinations->used].value.used, &destinations->array[destinations->used].value.size); + state->status = f_memory_array_increase_by(map->key.used + map->value.used + f_string_space_s.used + internal->quote_null.used * 2, sizeof(f_char_t), (void **) &destinations->array[destinations->used].value.string, &destinations->array[destinations->used].value.used, &destinations->array[destinations->used].value.size); if (F_status_is_error(state->status)) return F_true; if (data->flag & f_fss_payload_header_map_flag_join_map_e) { data->cache->used = 0; - state->status = f_memory_array_increase_by(map->name.used + map->value.used + f_string_space_s.used, sizeof(f_char_t), (void **) &data->cache->string, &data->cache->used, &data->cache->size); + state->status = f_memory_array_increase_by(map->key.used + map->value.used + f_string_space_s.used, sizeof(f_char_t), (void **) &data->cache->string, &data->cache->used, &data->cache->size); if (F_status_is_error(state->status)) return F_true; - if (map->name.used || (data->flag & f_fss_payload_header_map_flag_null_map_name_e)) { - if (map->name.used) { - state->status = f_string_dynamic_append(map->name, data->cache); + if (map->key.used || (data->flag & f_fss_payload_header_map_flag_null_map_name_e)) { + if (map->key.used) { + state->status = f_string_dynamic_append(map->key, data->cache); } else { state->status = f_string_dynamic_append(internal->quote_null, data->cache); @@ -139,12 +139,12 @@ extern "C" { if (F_status_is_error(state->status)) return F_true; } else { - if (map->name.used || (data->flag & f_fss_payload_header_map_flag_null_map_name_e)) { - if (map->name.used) { + if (map->key.used || (data->flag & f_fss_payload_header_map_flag_null_map_name_e)) { + if (map->key.used) { internal->range.start = 0; - internal->range.stop = map->name.used - 1; + internal->range.stop = map->key.used - 1; - private_fl_fss_basic_write(F_false, map->name, 0, &internal->range, &destinations->array[destinations->used].value, state, (void * const) internal); + private_fl_fss_basic_write(F_false, map->key, 0, &internal->range, &destinations->array[destinations->used].value, state, (void * const) internal); } else { state->status = f_string_dynamic_append(internal->quote_null, &destinations->array[destinations->used].value); @@ -191,8 +191,8 @@ extern "C" { #if !defined(_di_fl_fss_payload_header_map_) uint8_t private_fl_payload_header_map_map_multi(f_fss_payload_header_state_t * const data, f_state_t * const state, f_fss_payload_header_internal_t * const internal, f_string_map_multi_t * const map, f_string_maps_t * const destinations) { - if (map->name.used || (data->flag & f_fss_payload_header_map_flag_null_map_multi_name_e)) { - internal->k = map->name.used + internal->quote_null.used; + if (map->key.used || (data->flag & f_fss_payload_header_map_flag_null_map_multi_name_e)) { + internal->k = map->key.used + internal->quote_null.used; } else { internal->k = 0; @@ -219,9 +219,9 @@ extern "C" { state->status = f_memory_array_increase_by(internal->k, sizeof(f_char_t), (void **) &data->cache->string, &data->cache->used, &data->cache->size); if (F_status_is_error(state->status)) return F_true; - if (map->name.used || (data->flag & f_fss_payload_header_map_flag_null_map_multi_name_e)) { - if (map->name.used) { - state->status = f_string_dynamic_append(map->name, data->cache); + if (map->key.used || (data->flag & f_fss_payload_header_map_flag_null_map_multi_name_e)) { + if (map->key.used) { + state->status = f_string_dynamic_append(map->key, data->cache); } else { state->status = f_string_dynamic_append(internal->quote_null, data->cache); @@ -270,12 +270,12 @@ extern "C" { if (F_status_is_error(state->status)) return F_true; } else { - if (map->name.used || (data->flag & f_fss_payload_header_map_flag_null_map_multi_name_e)) { - if (map->name.used) { + if (map->key.used || (data->flag & f_fss_payload_header_map_flag_null_map_multi_name_e)) { + if (map->key.used) { internal->range.start = 0; - internal->range.stop = map->name.used - 1; + internal->range.stop = map->key.used - 1; - private_fl_fss_basic_write(F_false, map->name, 0, &internal->range, &destinations->array[destinations->used].value, state, (void * const) internal); + private_fl_fss_basic_write(F_false, map->key, 0, &internal->range, &destinations->array[destinations->used].value, state, (void * const) internal); } else { state->status = f_string_dynamic_append(internal->quote_null, &destinations->array[destinations->used].value); @@ -349,8 +349,8 @@ extern "C" { if (F_status_set_fine(state->status) == F_interrupt) return F_true; } - if (maps->array[internal->l].name.used) { - internal->k += maps->array[internal->k].name.used + f_fss_extended_next_s.used + internal->quote_null.used; + if (maps->array[internal->l].key.used) { + internal->k += maps->array[internal->k].key.used + f_fss_extended_next_s.used + internal->quote_null.used; } else if (data->flag & f_fss_payload_header_map_flag_null_map_multi_name_e) { internal->k += f_fss_extended_next_s.used + internal->quote_null.used; @@ -385,9 +385,9 @@ extern "C" { if (F_status_set_fine(state->status) == F_interrupt) return F_true; } - if (maps->array[internal->l].name.used || (data->flag & f_fss_payload_header_map_flag_null_map_multi_name_e)) { - if (maps->array[internal->l].name.used) { - state->status = f_string_dynamic_append(maps->array[internal->l].name, data->cache); + if (maps->array[internal->l].key.used || (data->flag & f_fss_payload_header_map_flag_null_map_multi_name_e)) { + if (maps->array[internal->l].key.used) { + state->status = f_string_dynamic_append(maps->array[internal->l].key, data->cache); } else if (data->flag & f_fss_payload_header_map_flag_null_map_multi_name_e) { state->status = f_string_dynamic_append(internal->quote_null, data->cache); @@ -452,9 +452,9 @@ extern "C" { data->cache->used = 0; - if (maps->array[internal->l].name.used || (data->flag & f_fss_payload_header_map_flag_null_map_multi_name_e)) { - if (maps->array[internal->l].name.used) { - state->status = f_string_dynamic_append(maps->array[internal->l].name, data->cache); + if (maps->array[internal->l].key.used || (data->flag & f_fss_payload_header_map_flag_null_map_multi_name_e)) { + if (maps->array[internal->l].key.used) { + state->status = f_string_dynamic_append(maps->array[internal->l].key, data->cache); } else if (data->flag & f_fss_payload_header_map_flag_null_map_multi_name_e) { state->status = f_string_dynamic_append(internal->quote_null, data->cache); @@ -523,12 +523,12 @@ extern "C" { if (F_status_set_fine(state->status) == F_interrupt) return F_true; } - if (maps->array[internal->l].name.used || (data->flag & f_fss_payload_header_map_flag_null_map_multi_name_e)) { - if (maps->array[internal->l].name.used) { + if (maps->array[internal->l].key.used || (data->flag & f_fss_payload_header_map_flag_null_map_multi_name_e)) { + if (maps->array[internal->l].key.used) { internal->range.start = 0; - internal->range.stop = maps->array[internal->l].name.used - 1; + internal->range.stop = maps->array[internal->l].key.used - 1; - private_fl_fss_basic_write(F_false, maps->array[internal->l].name, 0, &internal->range, &destinations->array[destinations->used].value, state, (void * const) internal); + private_fl_fss_basic_write(F_false, maps->array[internal->l].key, 0, &internal->range, &destinations->array[destinations->used].value, state, (void * const) internal); if (F_status_is_error(state->status)) return F_true; } else if (data->flag & f_fss_payload_header_map_flag_null_map_multi_name_e) { @@ -641,8 +641,8 @@ extern "C" { if (F_status_set_fine(state->status) == F_interrupt) return F_true; } - if (maps->array[internal->l].name.used) { - internal->k += maps->array[internal->k].name.used + f_fss_extended_next_s.used + internal->quote_null.used; + if (maps->array[internal->l].key.used) { + internal->k += maps->array[internal->k].key.used + f_fss_extended_next_s.used + internal->quote_null.used; } else if (data->flag & f_fss_payload_header_map_flag_null_map_name_e) { internal->k += f_fss_extended_next_s.used + internal->quote_null.used; @@ -669,9 +669,9 @@ extern "C" { if (F_status_set_fine(state->status) == F_interrupt) return F_true; } - if (maps->array[internal->l].name.used || (data->flag & f_fss_payload_header_map_flag_null_map_name_e)) { - if (maps->array[internal->l].name.used) { - state->status = f_string_dynamic_append(maps->array[internal->l].name, data->cache); + if (maps->array[internal->l].key.used || (data->flag & f_fss_payload_header_map_flag_null_map_name_e)) { + if (maps->array[internal->l].key.used) { + state->status = f_string_dynamic_append(maps->array[internal->l].key, data->cache); } else if (data->flag & f_fss_payload_header_map_flag_null_map_name_e) { state->status = f_string_dynamic_append(internal->quote_null, data->cache); @@ -721,9 +721,9 @@ extern "C" { data->cache->used = 0; - if (maps->array[internal->l].name.used || (data->flag & f_fss_payload_header_map_flag_null_map_name_e)) { - if (maps->array[internal->l].name.used) { - state->status = f_string_dynamic_append(maps->array[internal->l].name, data->cache); + if (maps->array[internal->l].key.used || (data->flag & f_fss_payload_header_map_flag_null_map_name_e)) { + if (maps->array[internal->l].key.used) { + state->status = f_string_dynamic_append(maps->array[internal->l].key, data->cache); } else if (data->flag & f_fss_payload_header_map_flag_null_map_name_e) { state->status = f_string_dynamic_append(internal->quote_null, data->cache); @@ -735,7 +735,7 @@ extern "C" { if (F_status_is_error(state->status)) return F_true; } - if (maps->array[internal->l].name.used || (data->flag & f_fss_payload_header_map_flag_null_map_name_e)) { + if (maps->array[internal->l].key.used || (data->flag & f_fss_payload_header_map_flag_null_map_name_e)) { if (maps->array[internal->l].value.used) { state->status = f_string_dynamic_append(maps->array[internal->l].value, data->cache); } @@ -775,12 +775,12 @@ extern "C" { if (F_status_set_fine(state->status) == F_interrupt) return F_true; } - if (maps->array[internal->l].name.used || (data->flag & f_fss_payload_header_map_flag_null_map_name_e)) { - if (maps->array[internal->l].name.used) { + if (maps->array[internal->l].key.used || (data->flag & f_fss_payload_header_map_flag_null_map_name_e)) { + if (maps->array[internal->l].key.used) { internal->range.start = 0; - internal->range.stop = maps->array[internal->l].name.used - 1; + internal->range.stop = maps->array[internal->l].key.used - 1; - private_fl_fss_basic_write(F_false, maps->array[internal->l].name, 0, &internal->range, &destinations->array[destinations->used].value, state, (void * const) internal); + private_fl_fss_basic_write(F_false, maps->array[internal->l].key, 0, &internal->range, &destinations->array[destinations->used].value, state, (void * const) internal); if (F_status_is_error(state->status)) return F_true; } else if (data->flag & f_fss_payload_header_map_flag_null_map_name_e) { diff --git a/level_2/fll_execute/c/execute.c b/level_2/fll_execute/c/execute.c index 9209f80..e38acdb 100644 --- a/level_2/fll_execute/c/execute.c +++ b/level_2/fll_execute/c/execute.c @@ -211,7 +211,7 @@ extern "C" { clearenv(); for (f_number_unsigned_t i = 0; i < environment->used; ++i) { - f_environment_set(environment->array[i].name, environment->array[i].value, F_true); + f_environment_set(environment->array[i].key, environment->array[i].value, F_true); } // for } @@ -222,7 +222,7 @@ extern "C" { clearenv(); for (f_number_unsigned_t i = 0; i < environment->used; ++i) { - f_environment_set(environment->array[i].name, environment->array[i].value, F_true); + f_environment_set(environment->array[i].key, environment->array[i].value, F_true); } // for } diff --git a/level_2/fll_execute/c/private-execute.c b/level_2/fll_execute/c/private-execute.c index ccbdbbf..ca8400e 100644 --- a/level_2/fll_execute/c/private-execute.c +++ b/level_2/fll_execute/c/private-execute.c @@ -316,7 +316,7 @@ extern "C" { clearenv(); for (f_number_unsigned_t i = 0; i < parameter->environment->used; ++i) { - f_environment_set(parameter->environment->array[i].name, parameter->environment->array[i].value, F_true); + f_environment_set(parameter->environment->array[i].key, parameter->environment->array[i].value, F_true); } // for } @@ -498,7 +498,7 @@ extern "C" { clearenv(); for (f_number_unsigned_t i = 0; i < parameter->environment->used; ++i) { - f_environment_set(parameter->environment->array[i].name, parameter->environment->array[i].value, F_true); + f_environment_set(parameter->environment->array[i].key, parameter->environment->array[i].value, F_true); } // for } diff --git a/level_2/fll_fss/c/fss.c b/level_2/fll_fss/c/fss.c index 21046f5..69fff03 100644 --- a/level_2/fll_fss/c/fss.c +++ b/level_2/fll_fss/c/fss.c @@ -329,7 +329,7 @@ extern "C" { for (k = 0; k < values[j]->used; ++k) { - status = f_compare_dynamic_partial_trim_string(values[j]->array[k].name.string, buffer, values[j]->array[k].name.used, contents.array[i].array[0]); + status = f_compare_dynamic_partial_trim_string(values[j]->array[k].key.string, buffer, values[j]->array[k].key.used, contents.array[i].array[0]); if (F_status_is_error(status)) { f_memory_array_resize(0, sizeof(f_char_t), (void **) &name.string, &name.used, &name.size); @@ -382,9 +382,9 @@ extern "C" { } } - map->name.string = name.string; - map->name.used = name.used; - map->name.size = name.size; + map->key.string = name.string; + map->key.used = name.used; + map->key.size = name.size; ++values[j]->used; @@ -448,7 +448,7 @@ extern "C" { map_multi = &values[j]->array[values[j]->used]; - status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &map_multi->name); + status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &map_multi->key); if (F_status_is_error(status)) return status; ++values[j]->used; @@ -522,7 +522,7 @@ extern "C" { map = &values[j]->array[values[j]->used]; - status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &map->name); + status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &map->key); if (F_status_is_error(status)) return status; ++values[j]->used; @@ -596,7 +596,7 @@ extern "C" { for (k = 0; k < values[j]->used; ++k) { - status = f_compare_dynamic_partial_trim_string(values[j]->array[k].name.string, buffer, values[j]->array[k].name.used, contents.array[i].array[0]); + status = f_compare_dynamic_partial_trim_string(values[j]->array[k].key.string, buffer, values[j]->array[k].key.used, contents.array[i].array[0]); if (F_status_is_error(status)) { f_memory_array_resize(0, sizeof(f_char_t), (void **) &name.string, &name.used, &name.size); @@ -628,9 +628,9 @@ extern "C" { } map_multi = &values[j]->array[values[j]->used]; - map_multi->name.string = name.string; - map_multi->name.used = name.used; - map_multi->name.size = name.size; + map_multi->key.string = name.string; + map_multi->key.used = name.used; + map_multi->key.size = name.size; ++values[j]->used; @@ -713,7 +713,7 @@ extern "C" { for (k = 0; k < values[j]->used; ++k) { - status = f_compare_dynamic_partial_trim_string(values[j]->array[k].name.string, buffer, values[j]->array[k].name.used, contents.array[i].array[0]); + status = f_compare_dynamic_partial_trim_string(values[j]->array[k].key.string, buffer, values[j]->array[k].key.used, contents.array[i].array[0]); if (F_status_is_error(status)) { f_memory_array_resize(0, sizeof(f_char_t), (void **) &name.string, &name.used, &name.size); @@ -745,9 +745,9 @@ extern "C" { map = &values[j]->array[values[j]->used]; - map->name.string = name.string; - map->name.used = name.used; - map->name.size = name.size; + map->key.string = name.string; + map->key.used = name.used; + map->key.size = name.size; ++values[j]->used; diff --git a/level_3/controller/c/entry/private-entry.c b/level_3/controller/c/entry/private-entry.c index bcda753..f479998 100644 --- a/level_3/controller/c/entry/private-entry.c +++ b/level_3/controller/c/entry/private-entry.c @@ -2313,10 +2313,10 @@ extern "C" { f_status_t status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_map_t), (void **) &setting_maps->array, &setting_maps->used, &setting_maps->size); if (F_status_is_error(status)) return status; - setting_maps->array[setting_maps->used].name.used = 0; + setting_maps->array[setting_maps->used].key.used = 0; setting_maps->array[setting_maps->used].value.used = 0; - status = f_string_dynamic_partial_append_nulless(buffer, ranges.array[0], &setting_maps->array[setting_maps->used].name); + status = f_string_dynamic_partial_append_nulless(buffer, ranges.array[0], &setting_maps->array[setting_maps->used].key); if (F_status_is_error(status)) return status; status = f_string_dynamic_partial_append_nulless(buffer, ranges.array[1], &setting_maps->array[setting_maps->used].value); @@ -2537,7 +2537,7 @@ extern "C" { fl_print_format(" %[%r%] {%r", global.main->output.to.stream, global.main->context.set.important, controller_define_s, global.main->context.set.important, f_string_eol_s); for (i = 0; i < entry->define.used; ++i) { - fl_print_format(" %Q %Q%r", global.main->output.to.stream, entry->define.array[i].name, entry->define.array[i].value, f_string_eol_s); + fl_print_format(" %Q %Q%r", global.main->output.to.stream, entry->define.array[i].key, entry->define.array[i].value, f_string_eol_s); } // for fl_print_format(" }%r", global.main->output.to.stream, f_string_eol_s, f_string_eol_s); @@ -2547,7 +2547,7 @@ extern "C" { fl_print_format(" %[%r%] {%r", global.main->output.to.stream, global.main->context.set.important, controller_parameter_s, global.main->context.set.important, f_string_eol_s); for (i = 0; i < entry->parameter.used; ++i) { - fl_print_format(" %Q %Q%r", global.main->output.to.stream, entry->parameter.array[i].name, entry->parameter.array[i].value, f_string_eol_s); + fl_print_format(" %Q %Q%r", global.main->output.to.stream, entry->parameter.array[i].key, entry->parameter.array[i].value, f_string_eol_s); } // for fl_print_format(" }%r", global.main->output.to.stream, f_string_eol_s); @@ -2563,7 +2563,7 @@ extern "C" { for (i = 0; i < entry->items.used; ++i) { - fl_print_format("%r%Q %Q %[%Q%] {%r", global.main->output.to.stream, f_string_eol_s, is_entry ? controller_Entry_s : controller_Exit_s, controller_Item_s, global.main->context.set.title, entry->items.array[i].name, global.main->context.set.title, f_string_eol_s); + fl_print_format("%r%Q %Q %[%Q%] {%r", global.main->output.to.stream, f_string_eol_s, is_entry ? controller_Entry_s : controller_Exit_s, controller_Item_s, global.main->context.set.title, entry->items.array[i].key, global.main->context.set.title, f_string_eol_s); for (j = 0; j < entry->items.array[i].actions.used; ++j) { diff --git a/level_3/controller/c/rule/private-rule.c b/level_3/controller/c/rule/private-rule.c index e9cdb32..89a13e1 100644 --- a/level_3/controller/c/rule/private-rule.c +++ b/level_3/controller/c/rule/private-rule.c @@ -1033,11 +1033,11 @@ extern "C" { for (j = 0; j < process->rule.environment.used; ++j) { - if (f_compare_dynamic(entry->define.array[i].name, process->rule.environment.array[j]) == F_equal_to) { + if (f_compare_dynamic(entry->define.array[i].key, process->rule.environment.array[j]) == F_equal_to) { for (k = 0; k < environment.used; ++k) { - if (f_compare_dynamic(entry->define.array[i].name, environment.array[k].name) == F_equal_to) { + if (f_compare_dynamic(entry->define.array[i].key, environment.array[k].name) == F_equal_to) { environment.array[k].value.used = 0; @@ -1074,11 +1074,11 @@ extern "C" { for (j = 0; j < process->rule.environment.used; ++j) { - if (f_compare_dynamic(process->rule.define.array[i].name, process->rule.environment.array[j]) == F_equal_to) { + if (f_compare_dynamic(process->rule.define.array[i].key, process->rule.environment.array[j]) == F_equal_to) { for (k = 0; k < environment.used; ++k) { - if (f_compare_dynamic(process->rule.define.array[i].name, environment.array[k].name) == F_equal_to) { + if (f_compare_dynamic(process->rule.define.array[i].key, environment.array[k].name) == F_equal_to) { environment.array[k].value.used = 0; @@ -2025,7 +2025,7 @@ extern "C" { // First check to see if the environment variable is overwritten by a "define". for (; i < process->rule.define.used; ++i) { - if (f_compare_dynamic_partial_string(process->rule.define.array[i].name.string, source, process->rule.define.array[i].name.used, content) == F_equal_to) { + if (f_compare_dynamic_partial_string(process->rule.define.array[i].key.string, source, process->rule.define.array[i].key.used, content) == F_equal_to) { status = f_string_dynamic_append(process->rule.define.array[i].value, destination); if (F_status_is_error(status)) return status; @@ -2038,7 +2038,7 @@ extern "C" { for (i = 0; i < entry->define.used; ++i) { - if (f_compare_dynamic_partial_string(entry->define.array[i].name.string, source, entry->define.array[i].name.used, content) == F_equal_to) { + if (f_compare_dynamic_partial_string(entry->define.array[i].key.string, source, entry->define.array[i].key.used, content) == F_equal_to) { status = f_string_dynamic_append(entry->define.array[i].value, destination); if (F_status_is_error(status)) return status; @@ -5884,8 +5884,8 @@ extern "C" { for (i = 0; i < rule.define.used; ++i) { - if (rule.define.array[i].name.used && rule.define.array[i].value.used) { - fl_print_format(" %Q %[=%] %Q%r", main->output.to, rule.define.array[i].name, main->context.set.important, main->context.set.important, rule.define.array[i].value, f_string_eol_s); + if (rule.define.array[i].key.used && rule.define.array[i].value.used) { + fl_print_format(" %Q %[=%] %Q%r", main->output.to, rule.define.array[i].key, main->context.set.important, main->context.set.important, rule.define.array[i].value, f_string_eol_s); } } // for diff --git a/level_3/fake/c/main/build.c b/level_3/fake/c/main/build.c index ca7aa35..6baabbf 100644 --- a/level_3/fake/c/main/build.c +++ b/level_3/fake/c/main/build.c @@ -166,12 +166,12 @@ extern "C" { fake_build_print_message_copying(&main->program.message, label); fake_string_dynamic_reset(&main->cache_2); - fake_string_dynamic_reset(&main->cache_map.name); + fake_string_dynamic_reset(&main->cache_map.key); main->setting.state.status = f_string_dynamic_append_nulless(source, &main->cache_2); if (F_status_is_error_not(main->setting.state.status)) { - main->setting.state.status = f_string_dynamic_append_nulless(destination, &main->cache_map.name); + main->setting.state.status = f_string_dynamic_append_nulless(destination, &main->cache_map.key); } if (F_status_is_error(main->setting.state.status)) { @@ -188,7 +188,7 @@ extern "C" { fake_string_dynamic_reset(&main->cache_map.value); main->cache_2.used = source.used; - main->cache_map.name.used = destination.used; + main->cache_map.key.used = destination.used; main->setting.state.status = f_string_dynamic_append_nulless(files.array[i], &main->cache_2); @@ -199,12 +199,12 @@ extern "C" { } main->cache_2.string[main->cache_2.used] = 0; - main->cache_map.name.string[main->cache_map.name.used] = 0; + main->cache_map.key.string[main->cache_map.key.used] = 0; main->setting.state.status = f_directory_is(main->cache_2); if (main->setting.state.status == F_true) { - main->setting.state.status = f_file_name_base(main->cache_2, &main->cache_map.name); + main->setting.state.status = f_file_name_base(main->cache_2, &main->cache_map.key); if (F_status_is_error(main->setting.state.status)) { fake_print_error(&main->program.error, macro_fake_f(f_file_name_base)); @@ -212,7 +212,7 @@ extern "C" { break; } - main->cache_map.name.string[main->cache_map.name.used] = 0; + main->cache_map.key.string[main->cache_map.key.used] = 0; fl_directory_do(main->cache_2, &main->cache_recurse_do); if (F_status_set_fine(main->setting.state.status) == F_interrupt) break; @@ -226,7 +226,7 @@ extern "C" { main->setting.state.status = F_status_set_error(F_failure); } - fake_print_error_build_operation_file(&main->program.error, macro_fake_f(fl_directory_do), f_file_operation_copy_s, main->cache_2, main->cache_map.name, f_file_operation_to_s, F_true); + fake_print_error_build_operation_file(&main->program.error, macro_fake_f(fl_directory_do), f_file_operation_copy_s, main->cache_2, main->cache_map.key, f_file_operation_to_s, F_true); if (F_status_is_error(failed)) { main->setting.state.status = failed; @@ -248,7 +248,7 @@ extern "C" { buffer.string = main->cache_2.string + perserve_offset; buffer.used = main->cache_2.used - perserve_offset; - main->setting.state.status = f_file_name_directory(buffer, &main->cache_map.name); + main->setting.state.status = f_file_name_directory(buffer, &main->cache_map.key); if (F_status_is_error(main->setting.state.status)) { fake_print_error(&main->program.error, macro_fake_f(f_file_name_directory)); @@ -256,10 +256,10 @@ extern "C" { break; } - main->setting.state.status = fl_directory_create(main->cache_map.name, F_file_mode_all_rwx_d); + main->setting.state.status = fl_directory_create(main->cache_map.key, F_file_mode_all_rwx_d); if (F_status_is_error(main->setting.state.status)) { - fake_print_error_file(&main->program.error, macro_fake_f(fl_directory_create), main->cache_map.name, f_file_operation_create_s, fll_error_file_type_directory_e); + fake_print_error_file(&main->program.error, macro_fake_f(fl_directory_create), main->cache_map.key, f_file_operation_create_s, fll_error_file_type_directory_e); break; } @@ -273,7 +273,7 @@ extern "C" { } } else { - fake_string_dynamic_reset(&main->cache_map.name); + fake_string_dynamic_reset(&main->cache_map.key); main->setting.state.status = f_file_name_base(main->cache_2, &main->cache_map.value); @@ -298,9 +298,9 @@ extern "C" { // Restore the destination path in cases where it is changed. if (!perserve_offset || perserve_offset >= main->cache_2.used) { - fake_string_dynamic_reset(&main->cache_map.name); + fake_string_dynamic_reset(&main->cache_map.key); - main->setting.state.status = f_string_dynamic_append_nulless(destination, &main->cache_map.name); + main->setting.state.status = f_string_dynamic_append_nulless(destination, &main->cache_map.key); if (F_status_is_error(main->setting.state.status)) { fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); diff --git a/level_3/fake/c/main/build/load.c b/level_3/fake/c/main/build/load.c index d0e67d4..8ef7a04 100644 --- a/level_3/fake/c/main/build/load.c +++ b/level_3/fake/c/main/build/load.c @@ -15,7 +15,7 @@ extern "C" { // Reset the environment. for (f_number_unsigned_t i = 0; i < environment->used; ++i) { - environment->array[i].name.used = 0; + environment->array[i].key.used = 0; environment->array[i].value.used = 0; } // for diff --git a/level_3/fake/c/main/common/type.c b/level_3/fake/c/main/common/type.c index 6524675..2b2ed39 100644 --- a/level_3/fake/c/main/common/type.c +++ b/level_3/fake/c/main/common/type.c @@ -195,7 +195,7 @@ extern "C" { f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &main->cache_arguments.array, &main->cache_arguments.used, &main->cache_arguments.size, &f_string_dynamics_delete_callback); - f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->cache_map.name.string, &main->cache_map.name.used, &main->cache_map.name.size); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->cache_map.key.string, &main->cache_map.key.used, &main->cache_map.key.size); f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->cache_map.value.string, &main->cache_map.value.used, &main->cache_map.value.size); f_iki_data_delete(&main->cache_iki); diff --git a/level_3/fake/c/main/fake/do.c b/level_3/fake/c/main/fake/do.c index 47b784e..d63fd38 100644 --- a/level_3/fake/c/main/fake/do.c +++ b/level_3/fake/c/main/fake/do.c @@ -26,14 +26,14 @@ extern "C" { if (flag & f_directory_recurse_do_flag_before_e) { if (flag & f_directory_recurse_do_flag_top_e) { if (recurse->state.code & fake_state_code_clone_e) { - fake_print_verbose_cloning(&local->main->program.message, *recurse->path_top, map->name); + fake_print_verbose_cloning(&local->main->program.message, *recurse->path_top, map->key); - recurse->state.status = f_file_clone(*recurse->path_top, map->name, F_file_default_size_write_d, f_file_stat_flag_group_e | f_file_stat_flag_owner_e | (f_directory_recurse_do_flag_dereference_e ? 0 : f_file_stat_flag_reference_e)); + recurse->state.status = f_file_clone(*recurse->path_top, map->key, F_file_default_size_write_d, f_file_stat_flag_group_e | f_file_stat_flag_owner_e | (f_directory_recurse_do_flag_dereference_e ? 0 : f_file_stat_flag_reference_e)); } else { - fake_print_verbose_copying(&local->main->program.message, *recurse->path_top, map->name); + fake_print_verbose_copying(&local->main->program.message, *recurse->path_top, map->key); - recurse->state.status = f_file_copy(*recurse->path_top, map->name, recurse->mode, F_file_default_size_write_d, f_directory_recurse_do_flag_dereference_e ? 0 : f_file_stat_flag_reference_e); + recurse->state.status = f_file_copy(*recurse->path_top, map->key, recurse->mode, F_file_default_size_write_d, f_directory_recurse_do_flag_dereference_e ? 0 : f_file_stat_flag_reference_e); } if (F_status_is_error(recurse->state.status)) { @@ -48,7 +48,7 @@ extern "C" { fake_string_dynamic_reset(&recurse->path_cache); // Pre-populate the destination into the path cache. - recurse->state.status = f_string_dynamic_append_nulless(map->name, &recurse->path_cache); + recurse->state.status = f_string_dynamic_append_nulless(map->key, &recurse->path_cache); if (F_status_is_error_not(recurse->state.status)) { recurse->state.status = F_okay; diff --git a/level_3/fake/c/main/make/load_fakefile.c b/level_3/fake/c/main/make/load_fakefile.c index 24f9102..9f83b18 100644 --- a/level_3/fake/c/main/make/load_fakefile.c +++ b/level_3/fake/c/main/make/load_fakefile.c @@ -195,7 +195,7 @@ extern "C" { data_make->setting_make.parameter.used = 1; function_name = macro_fake_f(f_string_dynamic_append); - data_make->main->setting.state.status = f_string_dynamic_append(fake_make_setting_return_s, &data_make->setting_make.parameter.array[0].name); + data_make->main->setting.state.status = f_string_dynamic_append(fake_make_setting_return_s, &data_make->setting_make.parameter.array[0].key); } if (F_status_is_error_not(data_make->main->setting.state.status)) { @@ -382,7 +382,7 @@ extern "C" { for (; i < define.used; ++i) { - if (fake_make_operate_validate_define_name(define.array[i].name) == F_true) { + if (fake_make_operate_validate_define_name(define.array[i].key) == F_true) { combined.used = 0; for (j = 0; j < define.array[i].value.used; ++j) { @@ -398,7 +398,7 @@ extern "C" { if (F_status_is_error(data_make->main->setting.state.status)) break; - data_make->main->setting.state.status = f_environment_set(define.array[i].name, combined, F_true); + data_make->main->setting.state.status = f_environment_set(define.array[i].key, combined, F_true); if (F_status_is_error(data_make->main->setting.state.status)) { fake_print_error(&data_make->main->program.error, macro_fake_f(f_environment_set)); @@ -407,7 +407,7 @@ extern "C" { } } else { - fake_make_print_error_define_invalid_character(&data_make->main->program.error, define.array[i].name); + fake_make_print_error_define_invalid_character(&data_make->main->program.error, define.array[i].key); data_make->main->setting.state.status = F_status_set_error(F_failure); diff --git a/level_3/fake/c/main/make/operate.c b/level_3/fake/c/main/make/operate.c index 9456599..9fdd8eb 100644 --- a/level_3/fake/c/main/make/operate.c +++ b/level_3/fake/c/main/make/operate.c @@ -644,7 +644,7 @@ extern "C" { for (k = 0; k < parameter->used; ++k) { // Check against IKI variable list. - if (f_compare_dynamic_partial_dynamic(parameter->array[k].name, main->buffer, iki_data->content.array[j]) != F_equal_to) { + if (f_compare_dynamic_partial_dynamic(parameter->array[k].key, main->buffer, iki_data->content.array[j]) != F_equal_to) { continue; } diff --git a/level_3/fake/c/main/make/operate_process.c b/level_3/fake/c/main/make/operate_process.c index db0b62a..cb43421 100644 --- a/level_3/fake/c/main/make/operate_process.c +++ b/level_3/fake/c/main/make/operate_process.c @@ -301,7 +301,7 @@ extern "C" { // Reset the environment. for (f_number_unsigned_t i = 0; i < data_make->environment.used; ++i) { - data_make->environment.array[i].name.used = 0; + data_make->environment.array[i].key.used = 0; data_make->environment.array[i].value.used = 0; } // for diff --git a/level_3/fake/c/main/make/operate_process_type.c b/level_3/fake/c/main/make/operate_process_type.c index 629ffc3..5b93acb 100644 --- a/level_3/fake/c/main/make/operate_process_type.c +++ b/level_3/fake/c/main/make/operate_process_type.c @@ -257,9 +257,9 @@ extern "C" { if (F_status_is_error_not(main->setting.state.status)) { for (; i < total; ++i) { - fake_string_dynamic_reset(&main->cache_map.name); + fake_string_dynamic_reset(&main->cache_map.key); - main->setting.state.status = f_string_dynamic_append_nulless(main->cache_arguments.array[total], &main->cache_map.name); + main->setting.state.status = f_string_dynamic_append_nulless(main->cache_arguments.array[total], &main->cache_map.key); if (F_status_is_error(main->setting.state.status)) { function = ¯o_fake_f(f_string_dynamic_append_nulless); @@ -269,7 +269,7 @@ extern "C" { } if (existing) { - main->setting.state.status = f_string_dynamic_append_assure(f_path_separator_s, &main->cache_map.name); + main->setting.state.status = f_string_dynamic_append_assure(f_path_separator_s, &main->cache_map.key); if (F_status_is_error(main->setting.state.status)) { function = ¯o_fake_f(f_string_dynamic_append_assure); @@ -278,7 +278,7 @@ extern "C" { break; } - main->setting.state.status = f_file_name_base(main->cache_arguments.array[i], &main->cache_map.name); + main->setting.state.status = f_file_name_base(main->cache_arguments.array[i], &main->cache_map.key); if (F_status_is_error(main->setting.state.status)) { function = ¯o_fake_f(f_file_name_base); @@ -305,10 +305,10 @@ extern "C" { } else if (main->setting.state.status == F_false) { if (clone) { - main->setting.state.status = f_file_clone(main->cache_arguments.array[i], main->cache_map.name, F_file_default_size_write_d, f_file_stat_flag_group_e | f_file_stat_flag_owner_e | (f_directory_recurse_do_flag_dereference_e ? 0 : f_file_stat_flag_reference_e)); + main->setting.state.status = f_file_clone(main->cache_arguments.array[i], main->cache_map.key, F_file_default_size_write_d, f_file_stat_flag_group_e | f_file_stat_flag_owner_e | (f_directory_recurse_do_flag_dereference_e ? 0 : f_file_stat_flag_reference_e)); } else { - main->setting.state.status = f_file_copy(main->cache_arguments.array[i], main->cache_map.name, main->cache_recurse_do.mode, F_file_default_size_write_d, f_directory_recurse_do_flag_dereference_e ? 0 : f_file_stat_flag_reference_e); + main->setting.state.status = f_file_copy(main->cache_arguments.array[i], main->cache_map.key, main->cache_recurse_do.mode, F_file_default_size_write_d, f_directory_recurse_do_flag_dereference_e ? 0 : f_file_stat_flag_reference_e); } if (F_status_is_error(main->setting.state.status)) { @@ -319,7 +319,7 @@ extern "C" { break; } - fake_make_print_verbose_operate_copy(&main->program.message, clone, main->cache_arguments.array[i], main->cache_map.name); + fake_make_print_verbose_operate_copy(&main->program.message, clone, main->cache_arguments.array[i], main->cache_map.key); } else if (F_status_is_error(main->setting.state.status)) { function = ¯o_fake_f(f_directory_is); @@ -1290,7 +1290,7 @@ extern "C" { if (!result) { for (j = 0; j < data_make->setting_make.parameter.used; ++j) { - if (f_compare_dynamic(main->cache_arguments.array[i], data_make->setting_make.parameter.array[j].name) == F_equal_to) { + if (f_compare_dynamic(main->cache_arguments.array[i], data_make->setting_make.parameter.array[j].key) == F_equal_to) { result = 2; break; @@ -1677,7 +1677,7 @@ extern "C" { for (; i < data_make->setting_make.parameter.used; ++i) { - if (f_compare_dynamic(main->cache_arguments.array[0], data_make->setting_make.parameter.array[i].name) == F_equal_to) { + if (f_compare_dynamic(main->cache_arguments.array[0], data_make->setting_make.parameter.array[i].key) == F_equal_to) { found = F_true; break; @@ -1719,7 +1719,7 @@ extern "C" { return; } - main->setting.state.status = f_string_dynamic_append_nulless(main->cache_arguments.array[0], &data_make->setting_make.parameter.array[data_make->setting_make.parameter.used].name); + main->setting.state.status = f_string_dynamic_append_nulless(main->cache_arguments.array[0], &data_make->setting_make.parameter.array[data_make->setting_make.parameter.used].key); if (F_status_is_error(main->setting.state.status)) { fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); diff --git a/level_3/iki_read/c/main/common.c b/level_3/iki_read/c/main/common.c index 9e50165..d914ae6 100644 --- a/level_3/iki_read/c/main/common.c +++ b/level_3/iki_read/c/main/common.c @@ -291,7 +291,7 @@ extern "C" { // Replace any existing value so that each name exists only once. for (j = 0; j < main->setting.replace.used; ++j) { - if (f_compare_dynamic(main->program.parameters.arguments.array[index], main->setting.replace.array[j].name) == F_equal_to) { + if (f_compare_dynamic(main->program.parameters.arguments.array[index], main->setting.replace.array[j].key) == F_equal_to) { break; } } // for @@ -299,8 +299,8 @@ extern "C" { at = j; // Static strings are being used, so if a dynamic string exists (size > 0), then de-allocate it. - if (main->setting.replace.array[at].name.size) { - main->setting.state.status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->setting.replace.array[at].name.string, &main->setting.replace.array[at].name.used, &main->setting.replace.array[at].name.size); + if (main->setting.replace.array[at].key.size) { + main->setting.state.status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &main->setting.replace.array[at].key.string, &main->setting.replace.array[at].key.used, &main->setting.replace.array[at].key.size); } if (F_status_is_error_not(main->setting.state.status) && main->setting.replace.array[at].value.size) { @@ -317,9 +317,9 @@ extern "C" { return; } - main->setting.replace.array[at].name.string = main->program.parameters.arguments.array[index].string; - main->setting.replace.array[at].name.used = main->program.parameters.arguments.array[index].used; - main->setting.replace.array[at].name.size = 0; + main->setting.replace.array[at].key.string = main->program.parameters.arguments.array[index].string; + main->setting.replace.array[at].key.used = main->program.parameters.arguments.array[index].used; + main->setting.replace.array[at].key.size = 0; index = main->program.parameters.array[iki_read_parameter_replace_e].values.array[++i]; diff --git a/level_3/iki_read/c/main/identify.c b/level_3/iki_read/c/main/identify.c index a7c776f..054790e 100644 --- a/level_3/iki_read/c/main/identify.c +++ b/level_3/iki_read/c/main/identify.c @@ -22,7 +22,7 @@ extern "C" { j = main->setting.replace.used - 1; do { - if (f_compare_dynamic_partial_string(main->setting.replace.array[j].name.string, main->setting.buffer, main->setting.replace.array[j].name.used, main->setting.data.vocabulary.array[i]) == F_equal_to) { + if (f_compare_dynamic_partial_string(main->setting.replace.array[j].key.string, main->setting.buffer, main->setting.replace.array[j].key.used, main->setting.data.vocabulary.array[i]) == F_equal_to) { main->setting.map_replaces[i] = j; break; diff --git a/level_3/iki_read/c/main/print/data.c b/level_3/iki_read/c/main/print/data.c index 48aaf6e..3d2e7a9 100644 --- a/level_3/iki_read/c/main/print/data.c +++ b/level_3/iki_read/c/main/print/data.c @@ -77,7 +77,7 @@ extern "C" { iki_read_print_data_wrap_append(&main->program.output, index); } else if (main->setting.flag & iki_read_main_flag_object_e) { - f_print_dynamic(main->setting.replace.array[main->setting.map_replaces[index]].name, main->program.output.to); + f_print_dynamic(main->setting.replace.array[main->setting.map_replaces[index]].key, main->program.output.to); } else { f_range_t range = macro_f_range_t_initialize_1(main->setting.data.variable.array[index].start, main->setting.data.content.array[index].start - 1);