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.
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) {
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) {
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) {
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) {
} // 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;
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]);
}
// 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);
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;
{
// 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);
}
#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_
* 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
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;
}
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;
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
- if (array[i].name.size && array[i].name.string) {
- status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size);
+ if (array[i].key.size && array[i].key.string) {
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].key.string, &array[i].key.used, &array[i].key.size);
if (F_status_is_error(status)) return status;
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
- if (array[i].name.size && array[i].name.string) {
- status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size);
+ if (array[i].key.size && array[i].key.string) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].key.string, &array[i].key.used, &array[i].key.size);
if (F_status_is_error(status)) return status;
}
for (f_number_unsigned_t i = 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;
}
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;
}
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;
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
if (array[i].size && array[i].array) {
- if (array[i].array[j].name.size && array[i].array[j].name.string) {
- status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size);
+ if (array[i].array[j].key.size && array[i].array[j].key.string) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].key.string, &array[i].array[j].key.used, &array[i].array[j].key.size);
if (F_status_is_error(status)) return status;
}
f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_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;
}
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;
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
- if (array[i].name.size && array[i].name.string) {
- status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size);
+ if (array[i].key.size && array[i].key.string) {
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].key.string, &array[i].key.used, &array[i].key.size);
if (F_status_is_error(status)) return status;
}
for (f_number_unsigned_t i = start; i < stop; ++i) {
- if (array[i].name.size && array[i].name.string) {
- status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size);
+ if (array[i].key.size && array[i].key.string) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].key.string, &array[i].key.used, &array[i].key.size);
if (F_status_is_error(status)) return status;
}
for (f_number_unsigned_t i = 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;
}
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;
}
if (array[i].size && array[i].array) {
for (j = 0; j < array[i].size; ++j) {
- if (array[i].array[j].name.size && array[i].array[j].name.string) {
- status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size);
+ if (array[i].array[j].key.size && array[i].array[j].key.string) {
+ status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].key.string, &array[i].array[j].key.used, &array[i].array[j].key.size);
if (F_status_is_error(status)) return status;
}
if (array[i].size && array[i].array) {
for (j = 0; j < array[i].size; ++j) {
- if (array[i].array[j].name.size && array[i].array[j].name.string) {
- status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size);
+ if (array[i].array[j].key.size && array[i].array[j].key.string) {
+ status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].key.string, &array[i].array[j].key.used, &array[i].array[j].key.size);
if (F_status_is_error(status)) return status;
}
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);
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);
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);
{
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);
for (f_number_unsigned_t i = 0; i < length_inner; ++i) {
- assert_int_equal(destination.array[i].name.used, source.array[i].name.used);
+ assert_int_equal(destination.array[i].key.used, source.array[i].key.used);
assert_int_equal(destination.array[i].value.used, source.array[i].value.used);
assert_int_equal(destination.array[i].value.array[0].used, source.array[i].value.array[0].used);
assert_int_equal(destination.array[i].value.array[1].used, source.array[i].value.array[1].used);
- assert_string_equal(destination.array[i].name.string, source.array[i].name.string);
+ assert_string_equal(destination.array[i].key.string, source.array[i].key.string);
assert_string_equal(destination.array[i].value.array[0].string, source.array[i].value.array[0].string);
assert_string_equal(destination.array[i].value.array[1].string, source.array[i].value.array[1].string);
} // for
for (f_number_unsigned_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].name.string);
+ free((void *) source.array[i].key.string);
free((void *) source.array[i].value.array[0].string);
free((void *) source.array[i].value.array[1].string);
free((void *) source.array[i].value.array);
for (f_number_unsigned_t i = 0; i < destination.used; ++i) {
- free((void *) destination.array[i].name.string);
+ free((void *) destination.array[i].key.string);
free((void *) destination.array[i].value.array[0].string);
free((void *) destination.array[i].value.array[1].string);
free((void *) destination.array[i].value.array);
mock_unwrap = 0;
mock_unwrap_f_memory = 0;
- f_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 };
{
assert_int_equal(status, F_status_set_error(F_failure));
}
- data_array[0].name.size = 1;
+ data_array[0].key.size = 1;
data_array[0].value.size = 1;
data_array[0].value.array[0].size = 1;
assert_int_equal(status, F_status_set_error(F_failure));
}
- data_array[0].name.size = 1;
+ data_array[0].key.size = 1;
data_array[0].value.size = 1;
data_array[0].value.array[0].size = 1;
f_status_t status = f_memory_array_resize(length, sizeof(f_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);
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);
}
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 };
{
assert_int_equal(status, F_status_set_error(F_failure));
}
- data_array[0].name.size = 1;
+ data_array[0].key.size = 1;
data_array[0].value.size = 1;
data_array[0].value.array[0].size = 1;
assert_int_equal(status, F_status_set_error(F_failure));
}
- data_array[0].name.size = 1;
+ data_array[0].key.size = 1;
data_array[0].value.size = 1;
data_array[0].value.array[0].size = 1;
f_status_t status = f_memory_array_resize(length, sizeof(f_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);
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);
}
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[] = {
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);
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
for (f_number_unsigned_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].name.string);
+ free((void *) source.array[i].key.string);
free((void *) source.array[i].value.array[0].string);
free((void *) source.array[i].value.array[1].string);
free((void *) source.array[i].value.array);
for (f_number_unsigned_t i = 0; i < destination.array[0].used; ++i) {
- free((void *) destination.array[0].array[i].name.string);
+ free((void *) destination.array[0].array[i].key.string);
free((void *) destination.array[0].array[i].value.array[0].string);
free((void *) destination.array[0].array[i].value.array[1].string);
free((void *) destination.array[0].array[i].value.array);
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[] = {
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);
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
for (f_number_unsigned_t i = 0; i < source.array[j].used; ++i) {
- free((void *) source.array[j].array[i].name.string);
+ free((void *) source.array[j].array[i].key.string);
free((void *) source.array[j].array[i].value.array[0].string);
free((void *) source.array[j].array[i].value.array[1].string);
free((void *) source.array[j].array[i].value.array);
for (f_number_unsigned_t i = 0; i < destination.array[j].used; ++i) {
- free((void *) destination.array[j].array[i].name.string);
+ free((void *) destination.array[j].array[i].key.string);
free((void *) destination.array[j].array[i].value.array[0].string);
free((void *) destination.array[j].array[i].value.array[1].string);
free((void *) destination.array[j].array[i].value.array);
f_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);
assert_int_equal(status, F_okay);
assert_int_equal(destination.used, 1);
- assert_int_equal(destination.array[0].name.used, source.name.used);
+ assert_int_equal(destination.array[0].key.used, source.key.used);
assert_int_equal(destination.array[0].value.used, source.value.used);
- assert_string_equal(destination.array[0].name.string, source.name.string);
+ assert_string_equal(destination.array[0].key.string, source.key.string);
assert_string_equal(destination.array[0].value.string, source.value.string);
}
- free((void *) source.name.string);
+ free((void *) source.key.string);
free((void *) source.value.string);
- free((void *) destination.array[0].name.string);
+ free((void *) destination.array[0].key.string);
free((void *) destination.array[0].value.string);
free((void *) destination.array);
f_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);
{
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);
for (f_number_unsigned_t i = 0; i < length_inner; ++i) {
- assert_int_equal(destination.array[i].name.used, source.array[i].name.used);
+ assert_int_equal(destination.array[i].key.used, source.array[i].key.used);
assert_int_equal(destination.array[i].value.used, source.array[i].value.used);
- assert_string_equal(destination.array[i].name.string, source.array[i].name.string);
+ assert_string_equal(destination.array[i].key.string, source.array[i].key.string);
assert_string_equal(destination.array[i].value.string, source.array[i].value.string);
} // for
}
for (f_number_unsigned_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].name.string);
+ free((void *) source.array[i].key.string);
free((void *) source.array[i].value.string);
} // for
for (f_number_unsigned_t i = 0; i < destination.used; ++i) {
- free((void *) destination.array[i].name.string);
+ free((void *) destination.array[i].key.string);
free((void *) destination.array[i].value.string);
} // for
mock_unwrap = 0;
mock_unwrap_f_memory = 0;
- f_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 };
{
assert_int_equal(status, F_status_set_error(F_failure));
}
- data_array[0].name.size = 1;
+ data_array[0].key.size = 1;
data_array[0].value.size = 1;
{
f_status_t status = f_memory_array_resize(length, sizeof(f_string_map_t), (void **) &datas.array, &datas.used, &datas.size);
assert_int_equal(status, F_okay);
- status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size);
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].key.string, &datas.array[0].key.used, &datas.array[0].key.size);
assert_int_equal(status, F_okay);
status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].value.string, &datas.array[0].value.used, &datas.array[0].value.size);
const f_status_t status = f_string_maps_delete_callback(0, length, (void *) datas.array);
assert_int_equal(status, F_okay);
- assert_int_equal(datas.array[0].name.size, 0);
+ assert_int_equal(datas.array[0].key.size, 0);
assert_int_equal(datas.array[0].value.size, 0);
}
- free((void *) datas.array[0].name.string);
+ free((void *) datas.array[0].key.string);
free((void *) datas.array[0].value.string);
free((void *) datas.array);
}
mock_unwrap = 0;
mock_unwrap_f_memory = 0;
- f_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 };
{
assert_int_equal(status, F_status_set_error(F_failure));
}
- data_array[0].name.size = 1;
+ data_array[0].key.size = 1;
data_array[0].value.size = 1;
{
f_status_t status = f_memory_array_resize(length, sizeof(f_string_map_t), (void **) &datas.array, &datas.used, &datas.size);
assert_int_equal(status, F_okay);
- status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size);
+ status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].key.string, &datas.array[0].key.used, &datas.array[0].key.size);
assert_int_equal(status, F_okay);
status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].value.string, &datas.array[0].value.used, &datas.array[0].value.size);
const f_status_t status = f_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);
}
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[] = {
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);
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
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[] = {
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);
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
for (f_number_unsigned_t i = 0; i < source.array[j].used; ++i) {
- free((void *) source.array[j].array[i].name.string);
+ free((void *) source.array[j].array[i].key.string);
free((void *) source.array[j].array[i].value.string);
} // for
for (f_number_unsigned_t i = 0; i < destination.array[j].used; ++i) {
- free((void *) destination.array[j].array[i].name.string);
+ free((void *) destination.array[j].array[i].key.string);
free((void *) destination.array[j].array[i].value.string);
} // for
* 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_
* 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_
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;
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;
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)) {
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;
}
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;
}
} \
\
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); \
#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);
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);
#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;
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);
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);
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;
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);
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);
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) {
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;
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);
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);
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);
}
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) {
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
}
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
}
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
}
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
}
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);
}
}
- 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;
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;
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;
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);
}
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;
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);
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;
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);
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);
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);
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) {
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;
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;
// 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;
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;
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
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)) {
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);
}
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));
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;
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;
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));
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;
}
}
}
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);
// 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));
// 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
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);
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)) {
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;
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)) {
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) {
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));
}
}
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);
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;
}
// 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
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);
}
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);
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);
}
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)) {
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);
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;
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;
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));
// 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
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) {
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];
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;
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);