I have been explicitly avoiding making change to f_utf until I finished updating and successfully vetted the f_string project.
Now that the f_string has tests that pass, mass update the f_utf project.
This changes the functions and structure to be inline with how f_string works.
Many of the fixes are brought over.
I have observed that several of the bugs that were recently in f_string is also present in f_utf.
These bugs in f_utf should now be fixed as well.
This tests are brought over.
Only the tests for functions that are shared between f_string and f_utf are implemented.
And then those tests currently cannot be compiled.
The reason is that normal quoted strings cannot be used with the special UTF dynamic strings.
I simply did not have the time to get to this to finish writing these tests for f_utf.
There are some parts of f_string that make no sense in f_utf, such as f_string_range_t and f_string_quantity_t (both of which can be used on f_string and f_utf strings).
These have been omitted when copying the relevant f_string into f_utf code.
build_sources_library signal.c
build_sources_library socket.c
build_sources_library status_string.c
-build_sources_library string.c private-string.c string/common.c string/private-dynamic.c string/private-map.c string/private-map_multi.c string/private-quantity.c string/private-range.c string/private-triple.c string/dynamic.c string/map.c string/map_multi.c string/quantity.c string/range.c string/static.c string/triple.c
+build_sources_library string.c private-string.c string/common.c string/dynamic.c string/map.c string/map_multi.c string/private-dynamic.c string/private-map.c string/private-map_multi.c string/private-quantity.c string/private-range.c string/private-triple.c string/quantity.c string/range.c string/static.c string/triple.c
build_sources_library type_array/array_length.c type_array/cell.c type_array/fll_id.c type_array/int8.c type_array/int16.c type_array/int32.c type_array/int64.c type_array/int128.c type_array/state.c type_array/status.c type_array/uint8.c type_array/uint16.c type_array/uint32.c type_array/uint64.c type_array/uint128.c
build_sources_library type_array/private-array_length.c type_array/private-cell.c type_array/private-fll_id.c type_array/private-int8.c type_array/private-int16.c type_array/private-int32.c type_array/private-int64.c type_array/private-int128.c type_array/private-state.c type_array/private-status.c type_array/private-uint8.c type_array/private-uint16.c type_array/private-uint32.c type_array/private-uint64.c type_array/private-uint128.c
-build_sources_library utf.c private-utf.c utf/common.c utf/convert.c utf/dynamic.c utf/is.c utf/is_character.c utf/map.c utf/private-is_unassigned.c utf/private-string.c utf/string.c utf/triple.c
+build_sources_library utf.c private-utf.c utf/common.c utf/convert.c utf/dynamic.c utf/is.c utf/is_character.c utf/map.c utf/private-dynamic.c utf/private-map.c utf/private-map_multi.c utf/private-triple.c utf/private-is_unassigned.c utf/private-string.c utf/static.c utf/string.c utf/triple.c
build_sources_library-level thread.c private-thread.c
build_sources_library_shared
build_sources_library_static
build_sources_headers type.h
build_sources_headers type_array.h type_array/common.h
build_sources_headers type_array/array_length.h type_array/cell.h type_array/fll_id.h type_array/int8.h type_array/int16.h type_array/int32.h type_array/int64.h type_array/int128.h type_array/state.h type_array/status.h type_array/uint8.h type_array/uint16.h type_array/uint32.h type_array/uint64.h type_array/uint128.h
-build_sources_headers utf.h utf/common.h utf/convert.h utf/dynamic.h utf/is.h utf/is_character.h utf/map.h utf/string.h utf/triple.h
+build_sources_headers utf.h utf/common.h utf/convert.h utf/dynamic.h utf/is.h utf/is_character.h utf/map.h utf/map_multi.h utf/static.h utf/string.h utf/triple.h
build_sources_headers-level thread.h thread/common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_library level_0/signal.c
build_sources_library level_0/socket.c
build_sources_library level_0/status_string.c
-build_sources_library level_0/string.c level_0/private-string.c level_0/string/common.c level_0/string/private-dynamic.c level_0/string/private-map.c level_0/string/private-map_multi.c level_0/string/private-quantity.c level_0/string/private-range.c level_0/string/private-triple.c level_0/string/dynamic.c level_0/string/map.c level_0/string/map_multi.c level_0/string/quantity.c level_0/string/range.c level_0/string/static.c level_0/string/triple.c
+build_sources_library level_0/string.c level_0/private-string.c level_0/string/common.c level_0/string/dynamic.c level_0/string/map.c level_0/string/map_multi.c level_0/string/private-dynamic.c level_0/string/private-map.c level_0/string/private-map_multi.c level_0/string/private-quantity.c level_0/string/private-range.c level_0/string/private-triple.c level_0/string/quantity.c level_0/string/range.c level_0/string/static.c level_0/string/triple.c
build_sources_library level_0/type_array/array_length.c level_0/type_array/cell.c level_0/type_array/fll_id.c level_0/type_array/int8.c level_0/type_array/int16.c level_0/type_array/int32.c level_0/type_array/int64.c level_0/type_array/int128.c level_0/type_array/state.c level_0/type_array/status.c level_0/type_array/uint8.c level_0/type_array/uint16.c level_0/type_array/uint32.c level_0/type_array/uint64.c level_0/type_array/uint128.c
build_sources_library level_0/type_array/private-array_length.c level_0/type_array/private-cell.c level_0/type_array/private-fll_id.c level_0/type_array/private-int8.c level_0/type_array/private-int16.c level_0/type_array/private-int32.c level_0/type_array/private-int64.c level_0/type_array/private-int128.c level_0/type_array/private-state.c level_0/type_array/private-status.c level_0/type_array/private-uint8.c level_0/type_array/private-uint16.c level_0/type_array/private-uint32.c level_0/type_array/private-uint64.c level_0/type_array/private-uint128.c
-build_sources_library level_0/utf.c level_0/private-utf.c level_0/utf/common.c level_0/utf/convert.c level_0/utf/dynamic.c level_0/utf/is.c level_0/utf/is_character.c level_0/utf/map.c level_0/utf/string.c level_0/utf/triple.c level_0/utf/private-is_unassigned.c level_0/utf/private-string.c
+build_sources_library level_0/utf.c level_0/private-utf.c level_0/utf/common.c level_0/utf/convert.c level_0/utf/dynamic.c level_0/utf/is.c level_0/utf/is_character.c level_0/utf/map.c level_0/utf/map_multi.c level_0/utf/static.c level_0/utf/string.c level_0/utf/triple.c level_0/utf/private-dynamic.c level_0/utf/private-is_unassigned.c level_0/utf/private-map.c level_0/utf/private-map_multi.c level_0/utf/private-triple.c level_0/utf/private-string.c
build_sources_library level_1/control_group.c
build_sources_library level_1/conversion.c level_1/private-conversion.c
build_sources_library level_1/directory.c level_1/private-directory.c
build_sources_headers level_0/type.h
build_sources_headers level_0/type_array.h level_0/type_array/common.h
build_sources_headers level_0/type_array/array_length.h level_0/type_array/cell.h level_0/type_array/fll_id.h level_0/type_array/int8.h level_0/type_array/int16.h level_0/type_array/int32.h level_0/type_array/int64.h level_0/type_array/int128.h level_0/type_array/state.h level_0/type_array/status.h level_0/type_array/uint8.h level_0/type_array/uint16.h level_0/type_array/uint32.h level_0/type_array/uint64.h level_0/type_array/uint128.h
-build_sources_headers level_0/utf.h level_0/utf/common.h level_0/utf/convert.h level_0/utf/dynamic.h level_0/utf/is.h level_0/utf/is_character.h level_0/utf/map.h level_0/utf/string.h level_0/utf/triple.h
+build_sources_headers level_0/utf.h level_0/utf/common.h level_0/utf/convert.h level_0/utf/dynamic.h level_0/utf/is.h level_0/utf/is_character.h level_0/utf/map.h level_0/utf/map_multi.h level_0/utf/static.h level_0/utf/string.h level_0/utf/triple.h
build_sources_headers level_1/control_group.h
build_sources_headers level_1/conversion.h
build_sources_headers level_1/directory.h level_1/directory/common.h
// FLL-0 utf includes.
#include <fll/level_0/utf/common.h>
-#include <fll/level_0/utf/convert.h>
+#include <fll/level_0/utf/static.h>
#include <fll/level_0/utf/dynamic.h>
+#include <fll/level_0/utf/convert.h>
#include <fll/level_0/utf/is.h>
#include <fll/level_0/utf/is_character.h>
#include <fll/level_0/utf/map.h>
+#include <fll/level_0/utf/map_multi.h>
#include <fll/level_0/utf/string.h>
#include <fll/level_0/utf/triple.h>
#include "../utf.h"
#include "../private-utf.h"
+#include "static.h"
+#include "private-dynamic.h"
#include "private-string.h"
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_f_utf_string_static_empty_s_
- const f_utf_string_static_t f_utf_string_static_empty_s = macro_f_utf_string_static_t_initialize(0, 0);
-#endif // _di_f_utf_string_static_empty_s_
-
#ifndef _di_f_utf_string_dynamic_adjust_
- f_status_t f_utf_string_dynamic_adjust(const f_array_length_t length, f_utf_string_dynamic_t *dynamic) {
+ f_status_t f_utf_string_dynamic_adjust(const f_array_length_t length, f_utf_string_dynamic_t * const dynamic) {
#ifndef _di_level_0_parameter_checking_
if (!dynamic) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_utf_string_dynamic_adjust_
#ifndef _di_f_utf_string_dynamic_append_
- f_status_t f_utf_string_dynamic_append(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_append(const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not_eos;
- }
+ if (!source.used) return F_data_not;
return private_f_utf_string_append(source.string, source.used, destination);
}
#endif // _di_f_utf_string_dynamic_append_
#ifndef _di_f_utf_string_dynamic_append_assure_
- f_status_t f_utf_string_dynamic_append_assure(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_append_assure(const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) return F_data_not;
if (destination->used < source.used) {
return private_f_utf_string_append(source.string, source.used, destination);
while (i <= source.used && j <= destination->used) {
- if (!source.string[source.used - i]) {
- ++i;
- continue;
- }
-
- if (!destination->string[destination->used - j]) {
- ++j;
-
- continue;
- }
-
if (source.string[source.used - i] != destination->string[destination->used - j]) {
return private_f_utf_string_append(source.string, source.used, destination);
}
#endif // _di_f_utf_string_dynamic_append_assure_
#ifndef _di_f_utf_string_dynamic_append_assure_nulless_
- f_status_t f_utf_string_dynamic_append_assure_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_append_assure_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) return F_data_not;
- if (destination->used < source.used) {
+ if (!destination->used) {
return private_f_utf_string_append_nulless(source.string, source.used, destination);
}
#endif // _di_f_utf_string_dynamic_append_assure_nulless_
#ifndef _di_f_utf_string_dynamic_append_nulless_
- f_status_t f_utf_string_dynamic_append_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_append_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) return F_data_not;
return private_f_utf_string_append_nulless(source.string, source.used, destination);
}
#endif // _di_f_utf_string_dynamic_append_nulless_
#ifndef _di_f_utf_string_dynamic_decimate_by_
- f_status_t f_utf_string_dynamic_decimate_by(const f_array_length_t amount, f_utf_string_dynamic_t *dynamic) {
+ f_status_t f_utf_string_dynamic_decimate_by(const f_array_length_t amount, f_utf_string_dynamic_t * const dynamic) {
#ifndef _di_level_0_parameter_checking_
- if (!amount) return F_status_set_error(F_parameter);
if (!dynamic) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
+ if (!amount) return F_data_not;
+
if (dynamic->size - amount > 0) {
return private_f_utf_string_dynamic_adjust(dynamic->size - amount, dynamic);
}
#endif // _di_f_utf_string_dynamic_decimate_by_
#ifndef _di_f_utf_string_dynamic_decrease_by_
- f_status_t f_utf_string_dynamic_decrease_by(const f_array_length_t amount, f_utf_string_dynamic_t *dynamic) {
+ f_status_t f_utf_string_dynamic_decrease_by(const f_array_length_t amount, f_utf_string_dynamic_t * const dynamic) {
#ifndef _di_level_0_parameter_checking_
- if (!amount) return F_status_set_error(F_parameter);
if (!dynamic) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
+ if (!amount) return F_data_not;
+
if (dynamic->size - amount > 0) {
return private_f_utf_string_dynamic_resize(dynamic->size - amount, dynamic);
}
#endif // _di_f_utf_string_dynamic_decrease_by_
#ifndef _di_f_utf_string_dynamic_increase_
- f_status_t f_utf_string_dynamic_increase(const f_array_length_t step, f_utf_string_dynamic_t *dynamic) {
+ f_status_t f_utf_string_dynamic_increase(const f_array_length_t step, f_utf_string_dynamic_t * const dynamic) {
#ifndef _di_level_0_parameter_checking_
- if (!step) return F_status_set_error(F_parameter);
if (!dynamic) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (dynamic->used + 1 > dynamic->size) {
+ if (step && dynamic->used + 1 > dynamic->size) {
f_array_length_t size = dynamic->used + step;
if (size > F_string_t_size_d) {
#endif // _di_f_utf_string_dynamic_increase_
#ifndef _di_f_utf_string_dynamic_increase_by_
- f_status_t f_utf_string_dynamic_increase_by(const f_array_length_t amount, f_utf_string_dynamic_t *dynamic) {
+ f_status_t f_utf_string_dynamic_increase_by(const f_array_length_t amount, f_utf_string_dynamic_t * const dynamic) {
#ifndef _di_level_0_parameter_checking_
if (!dynamic) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
+ if (!amount) return F_data_not;
+
return private_f_utf_string_dynamic_increase_by(amount, dynamic);
}
#endif // _di_f_utf_string_dynamic_increase_by_
#ifndef _di_f_utf_string_dynamic_mash_
- f_status_t f_utf_string_dynamic_mash(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_mash(const f_utf_string_static_t glue, const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not_eos;
- }
+ if (!source.used) return F_data_not;
- if (glue_length && destination->used) {
- const f_status_t status = private_f_utf_string_append(glue, glue_length, destination);
+ if (glue.used && destination->used) {
+ const f_status_t status = private_f_utf_string_append(glue.string, glue.used, destination);
if (F_status_is_error(status)) return status;
}
#endif // _di_f_utf_string_dynamic_mash_
#ifndef _di_f_utf_string_dynamic_mash_nulless_
- f_status_t f_utf_string_dynamic_mash_nulless(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_mash_nulless(const f_utf_string_static_t glue, const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not_eos;
- }
+ if (!source.used) return F_data_not;
- if (glue_length && destination->used) {
- const f_status_t status = private_f_utf_string_append_nulless(glue, glue_length, destination);
+ if (glue.used && destination->used) {
+ const f_status_t status = private_f_utf_string_append_nulless(glue.string, glue.used, destination);
if (F_status_is_error(status)) return status;
}
#endif // _di_f_utf_string_dynamic_mash_nulless_
#ifndef _di_f_utf_string_dynamic_mish_
- f_status_t f_utf_string_dynamic_mish(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_mish(const f_utf_string_static_t glue, const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not_eos;
- }
+ if (!source.used) return F_data_not;
- if (glue_length && destination->used) {
- const f_status_t status = private_f_utf_string_prepend(glue, glue_length, destination);
+ if (glue.used && destination->used) {
+ const f_status_t status = private_f_utf_string_prepend(glue.string, glue.used, destination);
if (F_status_is_error(status)) return status;
}
#endif // _di_f_utf_string_dynamic_mish_
#ifndef _di_f_utf_string_dynamic_mish_nulless_
- f_status_t f_utf_string_dynamic_mish_nulless(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_mish_nulless(const f_utf_string_static_t glue, const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not_eos;
- }
+ if (!source.used) return F_data_not;
- if (glue_length && destination->used) {
- const f_status_t status = private_f_utf_string_prepend_nulless(glue, glue_length, destination);
+ if (glue.used && destination->used) {
+ const f_status_t status = private_f_utf_string_prepend_nulless(glue.string, glue.used, destination);
if (F_status_is_error(status)) return status;
}
#endif // _di_f_utf_string_dynamic_mish_nulless_
#ifndef _di_f_utf_string_dynamic_partial_append_
- f_status_t f_utf_string_dynamic_partial_append(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_partial_append(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
- if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not_eos;
- }
+ if (!source.used) return F_data_not;
+ if (range.start > range.stop) return F_data_not_stop;
+ if (range.start >= source.used) return F_data_not_eos;
- if (range.start > range.stop) {
- return F_data_not_stop;
+ if (range.stop >= source.used) {
+ return private_f_utf_string_append(source.string + range.start, source.used - range.start, destination);
}
return private_f_utf_string_append(source.string + range.start, (range.stop - range.start) + 1, destination);
#endif // _di_f_utf_string_dynamic_partial_append_
#ifndef _di_f_utf_string_dynamic_partial_append_assure_
- f_status_t f_utf_string_dynamic_partial_append_assure(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_partial_append_assure(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
- if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not_eos;
- }
-
- if (range.start > range.stop) {
- return F_data_not_stop;
- }
+ if (!source.used) return F_data_not;
+ if (range.start > range.stop) return F_data_not_stop;
+ if (range.start >= source.used) return F_data_not_eos;
- const f_array_length_t length = (range.stop - range.start) + 1;
+ const f_array_length_t length = range.stop >= source.used ? source.used - range.start : (range.stop - range.start) + 1;
if (destination->used < length) {
return private_f_utf_string_append(source.string + range.start, length, destination);
}
+ const f_array_length_t stop = range.stop >= source.used ? source.used : range.stop + 1;
f_array_length_t i = 1;
f_array_length_t j = 1;
while (i <= length && j <= destination->used) {
- if (!source.string[range.stop - i]) {
- ++i;
-
- continue;
- }
-
- if (!destination->string[destination->used - j]) {
- ++j;
-
- continue;
- }
-
- if (source.string[range.stop - i] != destination->string[destination->used - j]) {
+ if (source.string[stop - i] != destination->string[destination->used - j]) {
return private_f_utf_string_append(source.string + range.start, length, destination);
}
#endif // _di_f_utf_string_dynamic_partial_append_assure_
#ifndef _di_f_utf_string_dynamic_partial_append_assure_nulless_
- f_status_t f_utf_string_dynamic_partial_append_assure_nulless(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_partial_append_assure_nulless(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
- if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) return F_data_not;
if (range.start > range.stop) return F_data_not_stop;
+ if (range.start >= source.used) return F_data_not_eos;
- const f_array_length_t length = (range.stop - range.start) + 1;
+ const f_array_length_t length = range.stop >= source.used ? source.used - range.start : (range.stop - range.start) + 1;
- if (destination->used < length) {
+ if (!destination->used) {
return private_f_utf_string_append_nulless(source.string + range.start, length, destination);
}
+ const f_array_length_t stop = range.stop >= source.used ? source.used : range.stop + 1;
f_array_length_t i = 1;
f_array_length_t j = 1;
while (i <= length && j <= destination->used) {
- if (!source.string[range.stop - i]) {
+ if (!source.string[stop - i]) {
++i;
continue;
continue;
}
- if (source.string[range.stop - i] != destination->string[destination->used - j]) {
+ if (source.string[stop - i] != destination->string[destination->used - j]) {
return private_f_utf_string_append_nulless(source.string + range.start, length, destination);
}
#endif // _di_f_utf_string_dynamic_append_assure_nulless_
#ifndef _di_f_utf_string_dynamic_partial_append_nulless_
- f_status_t f_utf_string_dynamic_partial_append_nulless(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_partial_append_nulless(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
- if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not_eos;
- }
+ if (!source.used) return F_data_not;
+ if (range.start > range.stop) return F_data_not_stop;
+ if (range.start >= source.used) return F_data_not_eos;
- if (range.start > range.stop) {
- return F_data_not_stop;
+ if (range.stop >= source.used) {
+ return private_f_utf_string_append_nulless(source.string + range.start, source.used - range.start, destination);
}
return private_f_utf_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
#endif // _di_f_utf_string_dynamic_partial_append_nulless_
#ifndef _di_f_utf_string_dynamic_partial_mash_
- f_status_t f_utf_string_dynamic_partial_mash(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_partial_mash(const f_utf_string_static_t glue, const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
- if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not_eos;
- }
+ if (!source.used) return F_data_not;
+ if (range.start > range.stop) return F_data_not_stop;
+ if (range.start >= source.used) return F_data_not_eos;
- if (range.start > range.stop) {
- return F_data_not_stop;
+ if (glue.used && destination->used) {
+ const f_status_t status = private_f_utf_string_append(glue.string, glue.used, destination);
+ if (F_status_is_error(status)) return status;
}
- if (glue_length && destination->used) {
- f_status_t status = private_f_utf_string_append(glue, glue_length, destination);
- if (F_status_is_error(status)) return status;
+ if (range.stop >= source.used) {
+ return private_f_utf_string_append(source.string + range.start, source.used - range.start, destination);
}
return private_f_utf_string_append(source.string + range.start, (range.stop - range.start) + 1, destination);
#endif // _di_f_utf_string_dynamic_partial_mash_
#ifndef _di_f_utf_string_dynamic_partial_mash_nulless_
- f_status_t f_utf_string_dynamic_partial_mash_nulless(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_partial_mash_nulless(const f_utf_string_static_t glue, const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
- if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not_eos;
- }
+ if (!source.used) return F_data_not;
+ if (range.start > range.stop) return F_data_not_stop;
+ if (range.start >= source.used) return F_data_not_eos;
- if (range.start > range.stop) {
- return F_data_not_stop;
+ if (glue.used && destination->used) {
+ const f_status_t status = private_f_utf_string_append_nulless(glue.string, glue.used, destination);
+ if (F_status_is_error(status)) return status;
}
- if (glue_length && destination->used) {
- f_status_t status = private_f_utf_string_append_nulless(glue, glue_length, destination);
- if (F_status_is_error(status)) return status;
+ if (range.stop >= source.used) {
+ return private_f_utf_string_append(source.string + range.start, source.used - range.start, destination);
}
return private_f_utf_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
#endif // _di_f_utf_string_dynamic_partial_mash_nulless_
#ifndef _di_f_utf_string_dynamic_partial_mish_
- f_status_t f_utf_string_partial_dynamic_mish(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_partial_mish(const f_utf_string_static_t glue, const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
- if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not_eos;
- }
+ if (!source.used) return F_data_not;
+ if (range.start > range.stop) return F_data_not_stop;
+ if (range.start >= source.used) return F_data_not_eos;
- if (range.start > range.stop) {
- return F_data_not_stop;
+ if (glue.used && destination->used) {
+ const f_status_t status = private_f_utf_string_prepend(glue.string, glue.used, destination);
+ if (F_status_is_error(status)) return status;
}
- if (glue_length && destination->used) {
- f_status_t status = private_f_utf_string_prepend(glue, glue_length, destination);
- if (F_status_is_error(status)) return status;
+ if (range.stop >= source.used) {
+ return private_f_utf_string_append(source.string + range.start, source.used - range.start, destination);
}
return private_f_utf_string_prepend(source.string + range.start, (range.stop - range.start) + 1, destination);
#endif // _di_f_utf_string_dynamic_partial_mish_
#ifndef _di_f_utf_string_dynamic_partial_mish_nulless_
- f_status_t f_utf_string_dynamic_partial_mish_nulless(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_partial_mish_nulless(const f_utf_string_static_t glue, const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
- if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not_eos;
- }
+ if (!source.used) return F_data_not;
+ if (range.start > range.stop) return F_data_not_stop;
+ if (range.start >= source.used) return F_data_not_eos;
- if (range.start > range.stop) {
- return F_data_not_stop;
+ if (glue.used && destination->used) {
+ const f_status_t status = private_f_utf_string_prepend_nulless(glue.string, glue.used, destination);
+ if (F_status_is_error(status)) return status;
}
- if (glue_length && destination->used) {
- f_status_t status = private_f_utf_string_prepend_nulless(glue, glue_length, destination);
- if (F_status_is_error(status)) return status;
+ if (range.stop >= source.used) {
+ return private_f_utf_string_append(source.string + range.start, source.used - range.start, destination);
}
return private_f_utf_string_prepend_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
#endif // _di_f_utf_string_dynamic_partial_mish_nulless_
#ifndef _di_f_utf_string_dynamic_partial_prepend_
- f_status_t f_utf_string_dynamic_partial_prepend(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_partial_prepend(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
- if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not_eos;
- }
+ if (!source.used) return F_data_not;
+ if (range.start > range.stop) return F_data_not_stop;
+ if (range.start >= source.used) return F_data_not_eos;
- if (range.start > range.stop) {
- return F_data_not_stop;
+ if (range.stop >= source.used) {
+ return private_f_utf_string_append(source.string + range.start, source.used - range.start, destination);
}
return private_f_utf_string_prepend(source.string + range.start, (range.stop - range.start) + 1, destination);
#endif // _di_f_utf_string_dynamic_partial_prepend_
#ifndef _di_f_utf_string_dynamic_partial_prepend_assure_
- f_status_t f_utf_string_dynamic_partial_prepend_assure(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_partial_prepend_assure(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
- if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not_eos;
- }
-
- if (range.start > range.stop) {
- return F_data_not_stop;
- }
+ if (!source.used) return F_data_not;
+ if (range.start > range.stop) return F_data_not_stop;
+ if (range.start >= source.used) return F_data_not_eos;
- const f_array_length_t length = (range.stop - range.start) + 1;
+ const f_array_length_t length = range.stop >= source.used ? source.used - range.start : (range.stop - range.start) + 1;
if (destination->used < length) {
return private_f_utf_string_prepend(source.string + range.start, length, destination);
while (i < length && j < destination->used) {
- if (!source.string[i + range.start]) {
- ++i;
-
- continue;
- }
-
- if (!destination->string[j]) {
- ++j;
-
- continue;
- }
-
- if (source.string[i + range.start] != destination->string[i]) {
+ if (source.string[i + range.start] != destination->string[j]) {
return private_f_utf_string_prepend(source.string + range.start, length, destination);
}
#endif // _di_f_utf_string_dynamic_partial_prepend_assure_
#ifndef _di_f_utf_string_dynamic_partial_prepend_assure_nulless_
- f_status_t f_utf_string_dynamic_partial_prepend_assure_nulless(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_partial_prepend_assure_nulless(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
- if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not_eos;
- }
-
- if (range.start > range.stop) {
- return F_data_not_stop;
- }
+ if (!source.used) return F_data_not;
+ if (range.start > range.stop) return F_data_not_stop;
+ if (range.start >= source.used) return F_data_not_eos;
- const f_array_length_t length = (range.stop - range.start) + 1;
+ const f_array_length_t length = range.stop >= source.used ? source.used - range.start : (range.stop - range.start) + 1;
- if (destination->used < length) {
+ if (!destination->used) {
return private_f_utf_string_prepend_nulless(source.string + range.start, length, destination);
}
continue;
}
- if (source.string[i + range.start] != destination->string[i]) {
+ if (source.string[i + range.start] != destination->string[j]) {
return private_f_utf_string_prepend_nulless(source.string + range.start, length, destination);
}
#endif // _di_f_utf_string_dynamic_partial_prepend_assure_nulless
#ifndef _di_f_utf_string_dynamic_partial_prepend_nulless_
- f_status_t f_utf_string_dynamic_partial_prepend_nulless(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_partial_prepend_nulless(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
- if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) return F_data_not;
if (range.start > range.stop) return F_data_not_stop;
+ if (range.start >= source.used) return F_data_not_eos;
return private_f_utf_string_prepend_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
}
#endif // _di_f_utf_string_dynamic_partial_prepend_nulless
#ifndef _di_f_utf_string_dynamic_prepend_
- f_status_t f_utf_string_dynamic_prepend(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_prepend(const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) return F_data_not;
return private_f_utf_string_prepend(source.string, source.used, destination);
}
#endif // _di_f_utf_string_dynamic_prepend_
#ifndef _di_f_utf_string_dynamic_prepend_assure_
- f_status_t f_utf_string_dynamic_prepend_assure(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_prepend_assure(const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) return F_data_not;
if (destination->used < source.used) {
return private_f_utf_string_prepend(source.string, source.used, destination);
while (i < source.used && j < destination->used) {
- if (!source.string[i]) {
- ++i;
-
- continue;
- }
-
- if (!destination->string[j]) {
- ++j;
-
- continue;
- }
-
- if (source.string[i] != destination->string[i]) {
+ if (source.string[i] != destination->string[j]) {
return private_f_utf_string_prepend(source.string, source.used, destination);
}
#endif // _di_f_utf_string_dynamic_prepend_assure_
#ifndef _di_f_utf_string_dynamic_prepend_assure_nulless_
- f_status_t f_utf_string_dynamic_prepend_assure_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_prepend_assure_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not_eos;
- }
+ if (!source.used) return F_data_not;
- if (destination->used < source.used) {
+ if (!destination->used) {
return private_f_utf_string_prepend_nulless(source.string, source.used, destination);
}
continue;
}
- if (source.string[i] != destination->string[i]) {
+ if (source.string[i] != destination->string[j]) {
return private_f_utf_string_prepend_nulless(source.string, source.used, destination);
}
#endif // _di_f_utf_string_dynamic_prepend_assure_nulless_
#ifndef _di_f_utf_string_dynamic_prepend_nulless_
- f_status_t f_utf_string_dynamic_prepend_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_prepend_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) return F_data_not;
return private_f_utf_string_prepend_nulless(source.string, source.used, destination);
}
#endif // _di_f_utf_string_dynamic_prepend_nulless_
#ifndef _di_f_utf_string_dynamic_resize_
- f_status_t f_utf_string_dynamic_resize(const f_array_length_t length, f_utf_string_dynamic_t *buffer) {
+ f_status_t f_utf_string_dynamic_resize(const f_array_length_t length, f_utf_string_dynamic_t * const buffer) {
#ifndef _di_level_0_parameter_checking_
if (!buffer) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_utf_string_dynamic_resize_
#ifndef _di_f_utf_string_dynamic_seek_line_
- f_status_t f_utf_string_dynamic_seek_line(const f_utf_string_static_t buffer, f_string_range_t *range) {
+ f_status_t f_utf_string_dynamic_seek_line(const f_utf_string_static_t buffer, f_string_range_t * const range) {
#ifndef _di_level_0_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!buffer.used) return F_data_not_eos;
+ if (!buffer.used) return F_data_not;
if (range->start > range->stop) return F_data_not_stop;
while (buffer.string[range->start] != F_utf_character_t_eol_d) {
#endif // _di_f_utf_string_dynamic_seek_line_
#ifndef _di_f_utf_string_dynamic_seek_line_to_
- f_status_t f_utf_string_dynamic_seek_line_to(const f_utf_string_static_t buffer, const f_char_t seek_to_this, f_string_range_t *range) {
+ f_status_t f_utf_string_dynamic_seek_line_to(const f_utf_string_static_t buffer, const f_char_t seek_to_this, f_string_range_t * const range) {
#ifndef _di_level_0_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!buffer.used) return F_data_not_eos;
+ if (!buffer.used) return F_data_not;
if (range->start > range->stop) return F_data_not_stop;
while (buffer.string[range->start] != seek_to_this) {
#endif // _di_f_utf_string_dynamic_seek_line_to_
#ifndef _di_f_utf_string_dynamic_seek_to_
- f_status_t f_utf_string_dynamic_seek_to(const f_utf_string_static_t buffer, const f_char_t seek_to_this, f_string_range_t *range) {
+ f_status_t f_utf_string_dynamic_seek_to(const f_utf_string_static_t buffer, const f_char_t seek_to_this, f_string_range_t * const range) {
#ifndef _di_level_0_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!buffer.used) return F_data_not_eos;
+ if (!buffer.used) return F_data_not;
if (range->start > range->stop) return F_data_not_stop;
while (buffer.string[range->start] != seek_to_this) {
#endif // _di_f_utf_string_dynamic_seek_to_
#ifndef _di_f_utf_string_dynamic_terminate_
- f_status_t f_utf_string_dynamic_terminate(f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_terminate(f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!destination->used && destination->size && !destination->string[destination->used - 1]) {
+ if (destination->used && !destination->string[destination->used - 1]) {
return F_none;
}
return F_status_set_error(F_string_too_large);
}
- const f_array_length_t total = destination->used + 1;
-
- if (total > destination->size) {
- const f_status_t status = private_f_utf_string_dynamic_resize(total, destination);
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_utf_string_dynamic_resize(destination->used + (destination->used + 1 == F_string_t_size_d ? 1 : F_memory_default_allocation_small_d), destination);
if (F_status_is_error(status)) return status;
}
- destination->string[destination->used] = 0;
- destination->used = total;
+ destination->string[destination->used++] = 0;
return F_none;
}
#endif // _di_f_utf_string_dynamic_terminate_
#ifndef _di_f_utf_string_dynamic_terminate_after_
- f_status_t f_utf_string_dynamic_terminate_after(f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_dynamic_terminate_after(f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (destination->used) {
- for (; destination->used; --destination->used) {
-
- if (!destination->string[destination->used - 1]) continue;
- break;
- } // for
+ if (destination->used < destination->size) {
+ if (!destination->string[destination->used]) {
+ return F_none;
+ }
}
if (destination->used == F_string_t_size_d) {
return F_status_set_error(F_string_too_large);
}
- const f_array_length_t total = destination->used + 1;
-
- if (total > destination->size) {
- const f_status_t status = private_f_utf_string_dynamic_resize(total, destination);
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_utf_string_dynamic_resize(destination->used + (destination->used + 1 == F_string_t_size_d ? 1 : F_memory_default_allocation_small_d), destination);
if (F_status_is_error(status)) return status;
}
destination->string[destination->used] = 0;
- destination->used = total - 1;
return F_none;
}
#endif // _di_f_utf_string_dynamic_terminate_after_
#ifndef _di_f_utf_string_dynamics_adjust_
- f_status_t f_utf_string_dynamics_adjust(const f_array_length_t length, f_utf_string_dynamics_t *dynamics) {
+ f_status_t f_utf_string_dynamics_adjust(const f_array_length_t length, f_utf_string_dynamics_t * const dynamics) {
#ifndef _di_level_0_parameter_checking_
if (!dynamics) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_utf_string_dynamics_adjust_
#ifndef _di_f_utf_string_dynamics_append_
- f_status_t f_utf_string_dynamics_append(const f_utf_string_dynamics_t source, f_utf_string_dynamics_t *destination) {
+ f_status_t f_utf_string_dynamics_append(const f_utf_string_dynamic_t source, f_utf_string_dynamics_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
}
#endif // _di_f_utf_string_dynamics_append_
+#ifndef _di_f_utf_string_dynamics_append_all_
+ f_status_t f_utf_string_dynamics_append_all(const f_utf_string_dynamics_t source, f_utf_string_dynamics_t * const destination) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!destination) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!source.used) return F_data_not;
+
+ return private_f_utf_string_dynamics_append_all(source, destination);
+ }
+#endif // _di_f_utf_string_dynamics_append_all_
+
#ifndef _di_f_utf_string_dynamics_decimate_by_
- f_status_t f_utf_string_dynamics_decimate_by(const f_array_length_t amount, f_utf_string_dynamics_t *dynamics) {
+ f_status_t f_utf_string_dynamics_decimate_by(const f_array_length_t amount, f_utf_string_dynamics_t * const dynamics) {
#ifndef _di_level_0_parameter_checking_
- if (!amount) return F_status_set_error(F_parameter);
if (!dynamics) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
+ if (!amount) return F_data_not;
+
if (dynamics->size - amount > 0) {
return private_f_utf_string_dynamics_adjust(dynamics->size - amount, dynamics);
}
#endif // _di_f_utf_string_dynamics_decimate_by_
#ifndef _di_f_utf_string_dynamics_decrease_by_
- f_status_t f_utf_string_dynamics_decrease_by(const f_array_length_t amount, f_utf_string_dynamics_t *dynamics) {
+ f_status_t f_utf_string_dynamics_decrease_by(const f_array_length_t amount, f_utf_string_dynamics_t * const dynamics) {
#ifndef _di_level_0_parameter_checking_
- if (!amount) return F_status_set_error(F_parameter);
if (!dynamics) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
+ if (!amount) return F_data_not;
+
if (dynamics->size - amount > 0) {
return private_f_utf_string_dynamics_resize(dynamics->size - amount, dynamics);
}
#endif // _di_f_utf_string_dynamics_decrease_by_
#ifndef _di_f_utf_string_dynamics_increase_
- f_status_t f_utf_string_dynamics_increase(const f_array_length_t step, f_utf_string_dynamics_t *dynamics) {
+ f_status_t f_utf_string_dynamics_increase(const f_array_length_t step, f_utf_string_dynamics_t * const dynamics) {
#ifndef _di_level_0_parameter_checking_
- if (!step) return F_status_set_error(F_parameter);
if (!dynamics) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
+ if (!step) return F_data_not;
+
if (dynamics->used + 1 > dynamics->size) {
f_array_length_t size = dynamics->used + step;
#endif // _di_f_utf_string_dynamics_increase_
#ifndef _di_f_utf_string_dynamics_increase_by_
- f_status_t f_utf_string_dynamics_increase_by(const f_array_length_t amount, f_utf_string_dynamics_t *dynamics) {
+ f_status_t f_utf_string_dynamics_increase_by(const f_array_length_t amount, f_utf_string_dynamics_t * const dynamics) {
#ifndef _di_level_0_parameter_checking_
if (!dynamics) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_utf_string_dynamics_increase_by_
#ifndef _di_f_utf_string_dynamics_resize_
- f_status_t f_utf_string_dynamics_resize(const f_array_length_t length, f_utf_string_dynamics_t *dynamics) {
+ f_status_t f_utf_string_dynamics_resize(const f_array_length_t length, f_utf_string_dynamics_t * const dynamics) {
#ifndef _di_level_0_parameter_checking_
if (!dynamics) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
}
#endif // _di_f_utf_string_dynamics_resize_
+#ifndef _di_f_utf_string_dynamicss_adjust_
+ f_status_t f_utf_string_dynamicss_adjust(const f_array_length_t length, f_utf_string_dynamicss_t * const dynamicss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!dynamicss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_utf_string_dynamicss_adjust(length, dynamicss);
+ }
+#endif // _di_f_utf_string_dynamicss_adjust_
+
+#ifndef _di_f_utf_string_dynamicss_append_
+ f_status_t f_utf_string_dynamicss_append(const f_utf_string_dynamics_t source, f_utf_string_dynamicss_t * const destination) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!destination) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!source.used) return F_data_not;
+
+ f_status_t status = F_none;
+
+ if (destination->used + 1 > destination->size) {
+ status = private_f_utf_string_dynamicss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used].used = 0;
+
+ if (source.used) {
+ status = private_f_utf_string_dynamics_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_utf_string_dynamicss_append_
+
+#ifndef _di_f_utf_string_dynamicss_append_all_
+ f_status_t f_utf_string_dynamicss_append_all(const f_utf_string_dynamicss_t source, f_utf_string_dynamicss_t * const destination) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!destination) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!source.used) return F_data_not;
+
+ f_status_t status = F_none;
+
+ if (destination->used + source.used > destination->size) {
+ status = private_f_utf_string_dynamicss_resize(destination->used + source.used, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
+
+ destination->array[destination->used].used = 0;
+
+ if (source.array[i].used) {
+ status = private_f_utf_string_dynamics_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+
+ return F_none;
+ }
+#endif // _di_f_utf_string_dynamicss_append_all_
+
+#ifndef _di_f_utf_string_dynamicss_decimate_by_
+ f_status_t f_utf_string_dynamicss_decimate_by(const f_array_length_t amount, f_utf_string_dynamicss_t * const dynamicss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!dynamicss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) return F_data_not;
+
+ if (dynamicss->size - amount > 0) {
+ return private_f_utf_string_dynamicss_adjust(dynamicss->size - amount, dynamicss);
+ }
+
+ return private_f_utf_string_dynamicss_adjust(0, dynamicss);
+ }
+#endif // _di_f_utf_string_dynamicss_decimate_by_
+
+#ifndef _di_f_utf_string_dynamicss_decrease_by_
+ f_status_t f_utf_string_dynamicss_decrease_by(const f_array_length_t amount, f_utf_string_dynamicss_t * const dynamicss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!dynamicss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) return F_data_not;
+
+ if (dynamicss->size - amount > 0) {
+ return private_f_utf_string_dynamicss_resize(dynamicss->size - amount, dynamicss);
+ }
+
+ return private_f_utf_string_dynamicss_resize(0, dynamicss);
+ }
+#endif // _di_f_utf_string_dynamicss_decrease_by_
+
+#ifndef _di_f_utf_string_dynamicss_increase_
+ f_status_t f_utf_string_dynamicss_increase(const f_array_length_t step, f_utf_string_dynamicss_t * const dynamicss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!dynamicss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!step) return F_data_not;
+
+ if (dynamicss->used + 1 > dynamicss->size) {
+ f_array_length_t size = dynamicss->used + step;
+
+ if (size > F_array_length_t_size_d) {
+ if (dynamicss->used + 1 > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ size = F_array_length_t_size_d;
+ }
+
+ return private_f_utf_string_dynamicss_resize(size, dynamicss);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_utf_string_dynamicss_increase_
+
+#ifndef _di_f_utf_string_dynamicss_increase_by_
+ f_status_t f_utf_string_dynamicss_increase_by(const f_array_length_t amount, f_utf_string_dynamicss_t * const dynamicss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!dynamicss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) return F_data_not;
+
+ if (dynamicss->used + amount > dynamicss->size) {
+ if (dynamicss->used + amount > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ return private_f_utf_string_dynamicss_resize(dynamicss->used + amount, dynamicss);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_utf_string_dynamicss_increase_by_
+
+#ifndef _di_f_utf_string_dynamicss_resize_
+ f_status_t f_utf_string_dynamicss_resize(const f_array_length_t length, f_utf_string_dynamicss_t * const dynamicss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!dynamicss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_utf_string_dynamicss_resize(length, dynamicss);
+ }
+#endif // _di_f_utf_string_dynamicss_resize_
+
#ifdef __cplusplus
} // extern "C"
#endif
*
* This is auto-included by utf.h and should not need to be explicitly included.
*/
-#ifndef _F_utf_string_dynamic_h
-#define _F_utf_string_dynamic_h
+#ifndef _F_utf_dynamic_h
+#define _F_utf_dynamic_h
#ifdef __cplusplus
extern "C" {
#endif
/**
- * A string that is analogous to f_utf_string_dynamic_t but intended for static-only uses.
- *
- * The f_utf_string_static_t type should never be directly allocated or deallocated.
- *
- * A special macro_f_utf_string_static_t_initialize() is provided for the special purpose of easily initialize a static string.
- *
- * string: the string.
- * size: total amount of space available.
- * used: total number of space used.
- */
-#ifndef _di_f_utf_string_static_t_
- typedef struct {
- f_utf_string_t string;
-
- f_array_length_t size;
- f_array_length_t used;
- } f_utf_string_static_t;
-
- #define f_utf_string_static_t_initialize { 0, 0, 0 }
-
- #define macro_f_utf_string_static_t_clear(string_static) \
- string_static.string = 0; \
- string_static.size = 0; \
- string_static.used = 0;
-
- #define macro_f_utf_string_static_t_initialize(string, length) { string, length, length }
-#endif // _di_f_utf_string_static_t_
-
-/**
- * Define a a global empty UTF-8 string.
- */
-#ifndef _di_f_utf_string_static_empty_s_
- const extern f_utf_string_static_t f_utf_string_static_empty_s;
-#endif // _di_f_utf_string_static_empty_s_
-
-/**
* A string that supports contains a size attribute to handle dynamic allocations and deallocations.
*
* Save the string size along with the string, so that strlen(..) commands can be avoided as much as possible.
* This is a sub-type of f_utf_string_static_t, allowing it to be passed into any f_utf_string_static_t type.
* It is recommended that f_utf_string_static_t are not otherwise casted into f_utf_string_dynamic_t to avoid potential memory allocation issues.
*
- * string: the string.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * string: The string.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_utf_string_dynamic_t_
typedef f_utf_string_static_t f_utf_string_dynamic_t;
#define f_utf_string_dynamic_t_initialize f_utf_string_static_t_initialize
+ #define macro_f_utf_string_dynamic_t_initialize(array, size, used) { array, size, used }
+ #define macro_f_utf_string_dynamic_t_initialize2(array, length) { array, length, length }
+
#define macro_f_utf_string_dynamic_t_clear(dynamic) macro_f_utf_string_static_t_clear(dynamic)
#define macro_f_utf_string_dynamic_t_resize(status, dynamic, length) status = f_utf_string_dynamic_resize(length, &dynamic);
#endif // _di_f_utf_string_dynamic_t_
/**
- * An array of static dynamics.
- *
- * array: the array of static dynamics.
- * size: total amount of space available.
- * used: total number of space used.
- */
-#ifndef _di_f_utf_string_statics_t_
- typedef struct {
- f_utf_string_static_t *array;
-
- f_array_length_t size;
- f_array_length_t used;
- } f_utf_string_statics_t;
-
- #define f_utf_string_statics_t_initialize { 0, 0, 0 }
-
- #define macro_f_utf_string_statics_t_clear(statics) \
- statics.array = 0; \
- statics.size = 0; \
- statics.used = 0;
-#endif // _di_f_utf_string_statics_t_
-
-/**
* An array of dynamic dynamics.
*
- * array: the array of dynamic dynamics.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of dynamic dynamics.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_utf_string_dynamics_t_
typedef f_utf_string_statics_t f_utf_string_dynamics_t;
#define f_utf_string_dynamics_t_initialize f_utf_string_statics_t_initialize
+ #define macro_f_utf_string_dynamics_t_initialize(array, size, used) { array, size, used }
+ #define macro_f_utf_string_dynamics_t_initialize2(array, length) { array, length, length }
+
#define macro_f_utf_string_dynamics_t_clear(dynamics) macro_f_utf_string_statics_t_clear(dynamics)
#define macro_f_utf_string_dynamics_t_resize(status, dynamics, length) status = f_utf_string_dynamics_resize(length, &dynamics);
#define macro_f_utf_string_dynamics_t_delete_simple(dynamics) f_utf_string_dynamics_resize(0, &dynamics);
#define macro_f_utf_string_dynamics_t_destroy_simple(dynamics) f_utf_string_dynamics_adjust(0, &dynamics);
- #define macro_f_utf_string_dynamics_t_increase(status, dynamics) status = f_utf_string_dynamics_increase(&dynamics);
+ #define macro_f_utf_string_dynamics_t_increase(status, step, dynamics) status = f_utf_string_dynamics_increase(step, &dynamics);
#define macro_f_utf_string_dynamics_t_increase_by(status, dynamics, amount) status = f_utf_string_dynamics_increase_by(amount, &dynamics);
#define macro_f_utf_string_dynamics_t_decrease_by(status, dynamics, amount) status = f_utf_string_dynamics_decrease_by(amount, &dynamics);
#define macro_f_utf_string_dynamics_t_decimate_by(status, dynamics, amount) status = f_utf_string_dynamics_decimate_by(amount, &dynamics);
#endif // _di_f_utf_string_dynamics_t_
/**
+ * An array of dynamic dynamicss.
+ *
+ * array: The array of dynamic dynamicss.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
+ */
+#ifndef _di_f_utf_string_dynamicss_t_
+ typedef f_utf_string_staticss_t f_utf_string_dynamicss_t;
+
+ #define f_utf_string_dynamicss_t_initialize f_utf_string_staticss_t_initialize
+
+ #define macro_f_utf_string_dynamicss_t_initialize(array, size, used) { array, size, used }
+ #define macro_f_utf_string_dynamicss_t_initialize2(array, length) { array, length, length }
+
+ #define macro_f_utf_string_dynamicss_t_clear(dynamicss) macro_f_utf_string_staticss_t_clear(dynamicss)
+
+ #define macro_f_utf_string_dynamicss_t_resize(status, dynamicss, length) status = f_utf_string_dynamicss_resize(length, &dynamicss);
+ #define macro_f_utf_string_dynamicss_t_adjust(status, dynamicss, length) status = f_utf_string_dynamicss_adjust(length, &dynamicss);
+
+ #define macro_f_utf_string_dynamicss_t_delete_simple(dynamicss) f_utf_string_dynamicss_resize(0, &dynamicss);
+ #define macro_f_utf_string_dynamicss_t_destroy_simple(dynamicss) f_utf_string_dynamicss_adjust(0, &dynamicss);
+
+ #define macro_f_utf_string_dynamicss_t_increase(status, step, dynamicss) status = f_utf_string_dynamicss_increase(step, &dynamicss);
+ #define macro_f_utf_string_dynamicss_t_increase_by(status, dynamicss, amount) status = f_utf_string_dynamicss_increase_by(amount, &dynamicss);
+ #define macro_f_utf_string_dynamicss_t_decrease_by(status, dynamicss, amount) status = f_utf_string_dynamicss_decrease_by(amount, &dynamicss);
+ #define macro_f_utf_string_dynamicss_t_decimate_by(status, dynamicss, amount) status = f_utf_string_dynamicss_decimate_by(amount, &dynamicss);
+#endif // _di_f_utf_string_dynamicss_t_
+
+/**
* Resize the dynamic string.
*
* @param length
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_utf_string_dynamic_adjust_
- extern f_status_t f_utf_string_dynamic_adjust(const f_array_length_t length, f_utf_string_dynamic_t *dynamic);
+ extern f_status_t f_utf_string_dynamic_adjust(const f_array_length_t length, f_utf_string_dynamic_t * const dynamic);
#endif // _di_f_utf_string_dynamic_adjust_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_append_
- extern f_status_t f_utf_string_dynamic_append(const f_utf_string_dynamic_t source, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_append(const f_utf_string_dynamic_t source, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_append_
/**
- * Append the source string onto the destination.
+ * Append the source string onto the destination only if the string is not already at the end.
*
* @param source
* The source string to append.
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_append_assure_
- extern f_status_t f_utf_string_dynamic_append_assure(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_append_assure(const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_append_assure_
/**
- * Append the source string onto the destination.
+ * Append the source string onto the destination only if the string is not already at the end.
*
* Skips over NULL characters from source when appending.
*
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_append_assure_nulless_
- extern f_status_t f_utf_string_dynamic_append_assure_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_append_assure_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_append_assure_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_append_nulless_
- extern f_status_t f_utf_string_dynamic_append_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_append_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_append_nulless_
/**
*
* @return
* F_none on success.
+ * F_data_not if amount is 0.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_dynamic_decimate_by_
+ extern f_status_t f_utf_string_dynamic_decimate_by(const f_array_length_t amount, f_utf_string_dynamic_t * const dynamic);
+#endif // _di_f_utf_string_dynamic_decimate_by_
+
+/**
+ * Resize the dynamic string to a smaller size.
+ *
+ * This will resize making the string smaller based on (size - given length).
+ * If the given length is too small, then the resize will fail.
+ * This will not shrink the size to less than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decrease the size by.
+ * @param dynamic
+ * The string to resize.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_decrease_by_
- extern f_status_t f_utf_string_dynamic_decrease_by(const f_array_length_t amount, f_utf_string_dynamic_t *dynamic);
+ extern f_status_t f_utf_string_dynamic_decrease_by(const f_array_length_t amount, f_utf_string_dynamic_t * const dynamic);
#endif // _di_f_utf_string_dynamic_decrease_by_
/**
*
* @return
* F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ * F_data_not on success, but there is no reason to increase size (used + 1 <= size) (or step is 0).
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_increase_
- extern f_status_t f_utf_string_dynamic_increase(const f_array_length_t step, f_utf_string_dynamic_t *dynamic);
+ extern f_status_t f_utf_string_dynamic_increase(const f_array_length_t step, f_utf_string_dynamic_t * const dynamic);
#endif // _di_f_utf_string_dynamic_increase_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_increase_by_
- extern f_status_t f_utf_string_dynamic_increase_by(const f_array_length_t amount, f_utf_string_dynamic_t *dynamic);
+ extern f_status_t f_utf_string_dynamic_increase_by(const f_array_length_t amount, f_utf_string_dynamic_t * const dynamic);
#endif // _di_f_utf_string_dynamic_increase_by_
/**
*
* @param glue
* A string to append between the source and destination, such as a space: ' '.
- * @param glue_length
- * The number of bytes the glue takes up.
* @param source
* The source string to append.
* @param destination
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_mash_
- extern f_status_t f_utf_string_dynamic_mash(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_static_t source, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_mash(const f_utf_string_static_t glue, const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_mash_
/**
*
* @param glue
* A string to append between the source and destination, such as a space: ' '.
- * @param glue_length
- * The number of bytes the glue takes up.
* @param source
* The source string to append.
* @param destination
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_mash_nulless_
- extern f_status_t f_utf_string_dynamic_mash_nulless(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_static_t source, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_mash_nulless(const f_utf_string_static_t glue, const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_mash_nulless_
/**
*
* @param glue
* A string to append between the source and destination, such as a space: ' '.
- * @param glue_length
- * The number of bytes the glue takes up.
* @param source
* The source string to append.
* @param destination
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_mish_
- extern f_status_t f_utf_string_dynamic_mish(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_static_t source, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_mish(const f_utf_string_static_t glue, const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_mish_
/**
*
* @param glue
* A string to append between the source and destination, such as a space: ' '.
- * @param glue_length
- * The number of bytes the glue takes up.
* @param source
* The source string to append.
* @param destination
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_mish_nulless_
- extern f_status_t f_utf_string_dynamic_mish_nulless(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_static_t source, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_mish_nulless(const f_utf_string_static_t glue, const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_mish_nulless_
/**
* Append the source string onto the destination, but restricted to the given range.
*
+ * If range.stop is on or after source.used, then source.used - 1 is used as the stopping point.
+ *
* @param source
* The source string to append.
* @param range
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
+ * F_data_not_eos if range.start >= source.used.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_partial_append_
- extern f_status_t f_utf_string_dynamic_partial_append(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_partial_append(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_partial_append_
/**
- * Append the source string onto the destination, but only if the string is not already at the end and restricted to the given range
- *
- * This ignores NULL characters when comparing both the source and the destination.
+ * Append the source string onto the destination only if the string is not already at the end and restricted to the given range.
*
* @param source
* The source string to append.
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
+ * F_data_not_eos if range.start >= source.used.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_partial_append_assure_
- extern f_status_t f_utf_string_dynamic_partial_append_assure(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_partial_append_assure(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_partial_append_assure_
/**
- * Append the source string onto the destination, but only if the string is not already at the end and restricted to the given range
+ * Append the source string onto the destination only if the string is not already at the end and restricted to the given range.
*
* This ignores NULL characters when comparing both the source and the destination.
*
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
+ * F_data_not_eos if range.start >= source.used.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_partial_append_assure_nulless_
- extern f_status_t f_utf_string_dynamic_partial_append_assure_nulless(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_partial_append_assure_nulless(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_partial_append_assure_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
+ * F_data_not_eos if range.start >= source.used.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_partial_append_nulless_
- extern f_status_t f_utf_string_dynamic_partial_append_nulless(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_partial_append_nulless(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_partial_append_nulless_
/**
*
* @param glue
* A string to append between the source and destination, such as a space: ' '.
- * @param glue_length
- * The number of bytes the glue takes up.
* @param source
* The source string to append.
* @param range
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
+ * F_data_not_eos if range.start >= source.used.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_partial_mash_
- extern f_status_t f_utf_string_dynamic_partial_mash(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_partial_mash(const f_utf_string_static_t glue, const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_partial_mash_
/**
*
* @param glue
* A string to append between the source and destination, such as a space: ' '.
- * @param glue_length
- * The number of bytes the glue takes up.
* @param source
* The source string to append.
* @param range
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
+ * F_data_not_eos if range.start >= source.used.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_partial_mash_nulless_
- extern f_status_t f_utf_string_dynamic_partial_mash_nulless(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_partial_mash_nulless(const f_utf_string_static_t glue, const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_partial_mash_nulless_
/**
*
* @param glue
* A string to append between the source and destination, such as a space: ' '.
- * @param glue_length
- * The number of bytes the glue takes up.
* @param source
* The source string to append.
* @param range
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
+ * F_data_not_eos if range.start >= source.used.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_partial_mish_
- extern f_status_t f_utf_string_dynamic_partial_mish(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_partial_mish(const f_utf_string_static_t glue, const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_partial_mish_
/**
*
* @param glue
* A string to append between the source and destination, such as a space: ' '.
- * @param glue_length
- * The number of bytes the glue takes up.
* @param source
* The source string to append.
* @param range
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
+ * F_data_not_eos if range.start >= source.used.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_partial_mish_nulless_
- extern f_status_t f_utf_string_dynamic_partial_mish_nulless(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_partial_mish_nulless(const f_utf_string_static_t glue, const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_partial_mish_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
+ * F_data_not_eos if range.start >= source.used.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_partial_prepend_
- extern f_status_t f_utf_string_dynamic_partial_prepend(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_partial_prepend(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_partial_prepend_
/**
- * Prepend the source string onto the destination, but only if the string is not already at the end and restricted to the given range
+ * Prepend the source string onto the destination only if the string is not already at the beginning and restricted to the given range.
*
* Prepend operations require memory move operations and are therefore likely more expensive than append operations.
*
- * This ignores NULL characters when comparing both the source and the destination.
- *
* @param source
* The source string to prepend.
* @param range
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
+ * F_data_not_eos if range.start >= source.used.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_partial_prepend_assure_
- extern f_status_t f_utf_string_dynamic_partial_prepend_assure(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_partial_prepend_assure(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_partial_prepend_assure_
/**
- * Prepend the source string onto the destination, but only if the string is not already at the end and restricted to the given range
+ * Prepend the source string onto the destination only if the string is not already at the beginning and restricted to the given range.
*
* Prepend operations require memory move operations and are therefore likely more expensive than append operations.
*
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
+ * F_data_not_eos if range.start >= source.used.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_partial_prepend_assure_nulless_
- extern f_status_t f_utf_string_dynamic_partial_prepend_assure_nulless(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_partial_prepend_assure_nulless(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_partial_prepend_assure_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
+ * F_data_not_eos if range.start >= source.used.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_partial_prepend_nulless_
- extern f_status_t f_utf_string_dynamic_partial_prepend_nulless(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_partial_prepend_nulless(const f_utf_string_static_t source, const f_string_range_t range, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_partial_prepend_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
- * F_data_not_stop if range.start > range.stop.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_prepend_
- extern f_status_t f_utf_string_dynamic_prepend(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_prepend(const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_prepend_
/**
- * Prepend the source string onto the destination, but only if the string is not already at the beginning.
+ * Prepend the source string onto the destination only if the string is not already at the beginning.
*
* Prepend operations require memory move operations and are therefore likely more expensive than append operations.
*
- * This ignores NULL characters when comparing both the source and the destination.
- *
* @param source
* The source string to prepend.
* @param destination
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
- * F_data_not_stop if range.start > range.stop.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_prepend_assure_
- extern f_status_t f_utf_string_dynamic_prepend_assure(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_prepend_assure(const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_prepend_assure_
/**
- * Prepend the source string onto the destination, but only if the string is not already at the beginning.
+ * Prepend the source string onto the destination only if the string is not already at the beginning.
*
* Prepend operations require memory move operations and are therefore likely more expensive than append operations.
*
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
- * F_data_not_stop if range.start > range.stop.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_prepend_assure_nulless_
- extern f_status_t f_utf_string_dynamic_prepend_assure_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_prepend_assure_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_prepend_assure_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
- * F_data_not_stop if range.start > range.stop.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_prepend_nulless_
- extern f_status_t f_utf_string_dynamic_prepend_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_prepend_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_prepend_nulless_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_resize_
- extern f_status_t f_utf_string_dynamic_resize(const f_array_length_t length, f_utf_string_dynamic_t *buffer);
+ extern f_status_t f_utf_string_dynamic_resize(const f_array_length_t length, f_utf_string_dynamic_t * const buffer);
#endif // _di_f_utf_string_dynamic_resize_
/**
* F_none on success.
* F_none_eos on success, but stopped at end of string.
* F_none_stop on success, but stopped at end of range.
- * F_data_not_eos on success, but there was no string data to seek.
+ * F_data_not on success, but there was no string data to seek.
* F_data_not_stop on success, but the range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
- * F_utf (with error bit) if character is invalid UTF-8.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_seek_line_
- extern f_status_t f_utf_string_dynamic_seek_line(const f_utf_string_static_t buffer, f_string_range_t *range);
+ extern f_status_t f_utf_string_dynamic_seek_line(const f_utf_string_static_t buffer, f_string_range_t * const range);
#endif // _di_f_utf_string_dynamic_seek_line_
/**
* F_none on success.
* F_none_eos on success, but stopped at end of string.
* F_none_stop on success, but stopped at end of range.
- * F_data_not_eos on success, but there was no string data to seek.
+ * F_data_not on success, but there was no string data to seek.
* F_data_not_stop on success, but the range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
- * F_utf (with error bit) if character is invalid UTF-8.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_seek_line_to_
- extern f_status_t f_utf_string_dynamic_seek_line_to(const f_utf_string_static_t buffer, const f_char_t seek_to_this, f_string_range_t *range);
+ extern f_status_t f_utf_string_dynamic_seek_line_to(const f_utf_string_static_t buffer, const f_char_t seek_to_this, f_string_range_t * const range);
#endif // _di_f_utf_string_dynamic_seek_line_to_
/**
* F_none on success.
* F_none_eos on success, but stopped at end of string.
* F_none_stop on success, but stopped at end of range.
- * F_data_not_eos on success, but there was no string data to seek.
+ * F_data_not on success, but there was no string data to seek.
* F_data_not_stop on success, but the range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
- * F_utf (with error bit) if character is invalid UTF-8.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_seek_to_
- extern f_status_t f_utf_string_dynamic_seek_to(const f_utf_string_static_t buffer, const f_char_t seek_to_this, f_string_range_t *range);
+ extern f_status_t f_utf_string_dynamic_seek_to(const f_utf_string_static_t buffer, const f_char_t seek_to_this, f_string_range_t * const range);
#endif // _di_f_utf_string_dynamic_seek_to_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_terminate_
- extern f_status_t f_utf_string_dynamic_terminate(f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_terminate(f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_terminate_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_terminate_after_
- extern f_status_t f_utf_string_dynamic_terminate_after(f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_dynamic_terminate_after(f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_dynamic_terminate_after_
/**
* Errors (with error bit) from: f_memory_adjust().
*/
#ifndef _di_f_utf_string_dynamics_adjust_
- extern f_status_t f_utf_string_dynamics_adjust(const f_array_length_t length, f_utf_string_dynamics_t *dynamics);
+ extern f_status_t f_utf_string_dynamics_adjust(const f_array_length_t length, f_utf_string_dynamics_t * const dynamics);
#endif // _di_f_utf_string_dynamics_adjust_
/**
- * Append the source strings onto the destination.
+ * Append the single source string onto the destination.
*
* @param source
- * The source strings to append.
+ * The source string to append.
* @param destination
* The destination strings the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamics_append_
- extern f_status_t f_utf_string_dynamics_append(const f_utf_string_dynamics_t source, f_utf_string_dynamics_t *destination);
+ extern f_status_t f_utf_string_dynamics_append(const f_utf_string_dynamic_t source, f_utf_string_dynamics_t * const destination);
#endif // _di_f_utf_string_dynamics_append_
/**
+ * Append the source strings onto the destination.
+ *
+ * @param source
+ * The source strings to append.
+ * @param destination
+ * The destination strings the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is nothing to append (size == 0).
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_dynamics_append_all_
+ extern f_status_t f_utf_string_dynamics_append_all(const f_utf_string_dynamics_t source, f_utf_string_dynamics_t * const destination);
+#endif // _di_f_utf_string_dynamics_append_all_
+
+/**
* Resize the dynamic string array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
+ * F_data_not on success, but there is no reason to increase size (size == 0) (or amount is 0).
*
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamics_decimate_by_
- extern f_status_t f_utf_string_dynamics_decimate_by(const f_array_length_t amount, f_utf_string_dynamics_t *dynamics);
+ extern f_status_t f_utf_string_dynamics_decimate_by(const f_array_length_t amount, f_utf_string_dynamics_t * const dynamics);
#endif // _di_f_utf_string_dynamics_decimate_by_
/**
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
+ * F_data_not on success, but there is no reason to increase size (size == 0) (or amount is 0).
*
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamics_decrease_by_
- extern f_status_t f_utf_string_dynamics_decrease_by(const f_array_length_t amount, f_utf_string_dynamics_t *dynamics);
+ extern f_status_t f_utf_string_dynamics_decrease_by(const f_array_length_t amount, f_utf_string_dynamics_t * const dynamics);
#endif // _di_f_utf_string_dynamics_decrease_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamics_increase_
- extern f_status_t f_utf_string_dynamics_increase(const f_array_length_t step, f_utf_string_dynamics_t *dynamics);
+ extern f_status_t f_utf_string_dynamics_increase(const f_array_length_t step, f_utf_string_dynamics_t * const dynamics);
#endif // _di_f_utf_string_dynamics_increase_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamics_increase_by_
- extern f_status_t f_utf_string_dynamics_increase_by(const f_array_length_t amount, f_utf_string_dynamics_t *dynamics);
+ extern f_status_t f_utf_string_dynamics_increase_by(const f_array_length_t amount, f_utf_string_dynamics_t * const dynamics);
#endif // _di_f_utf_string_dynamics_increase_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamics_resize_
- extern f_status_t f_utf_string_dynamics_resize(const f_array_length_t length, f_utf_string_dynamics_t *dynamics);
+ extern f_status_t f_utf_string_dynamics_resize(const f_array_length_t length, f_utf_string_dynamics_t * const dynamics);
#endif // _di_f_utf_string_dynamics_resize_
+/**
+ * Resize the dynamics string array.
+ *
+ * @param length
+ * The new size to use.
+ * @param dynamicss
+ * The array to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ */
+#ifndef _di_f_utf_string_dynamicss_adjust_
+ extern f_status_t f_utf_string_dynamicss_adjust(const f_array_length_t length, f_utf_string_dynamicss_t * const dynamicss);
+#endif // _di_f_utf_string_dynamicss_adjust_
+
+/**
+ * Append the single source string onto the destination.
+ *
+ * @param source
+ * The source string to append.
+ * @param destination
+ * The destination strings the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is nothing to append (size == 0).
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_dynamicss_append_
+ extern f_status_t f_utf_string_dynamicss_append(const f_utf_string_dynamics_t source, f_utf_string_dynamicss_t * const destination);
+#endif // _di_f_utf_string_dynamicss_append_
+
+/**
+ * Append the source strings onto the destination.
+ *
+ * @param source
+ * The source strings to append.
+ * @param destination
+ * The destination strings the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is nothing to append (size == 0).
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_dynamicss_append_all_
+ extern f_status_t f_utf_string_dynamicss_append_all(const f_utf_string_dynamicss_t source, f_utf_string_dynamicss_t * const destination);
+#endif // _di_f_utf_string_dynamicss_append_all_
+
+/**
+ * Resize the dynamics string array to a smaller size.
+ *
+ * This will resize making the array smaller based on (size - given length).
+ * If the given length is too small, then the resize will fail.
+ * This will not shrink the size to less than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decimate the size by.
+ * @param dynamicss
+ * The array to resize.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (size == 0) (or amount is 0).
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_dynamicss_decimate_by_
+ extern f_status_t f_utf_string_dynamicss_decimate_by(const f_array_length_t amount, f_utf_string_dynamicss_t * const dynamicss);
+#endif // _di_f_utf_string_dynamicss_decimate_by_
+
+/**
+ * Resize the dynamics string array to a smaller size.
+ *
+ * This will resize making the array smaller based on (size - given length).
+ * If the given length is too small, then the resize will fail.
+ * This will not shrink the size to less than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decrease the size by.
+ * @param dynamicss
+ * The array to resize.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (size == 0) (or amount is 0).
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_dynamicss_decrease_by_
+ extern f_status_t f_utf_string_dynamicss_decrease_by(const f_array_length_t amount, f_utf_string_dynamicss_t * const dynamicss);
+#endif // _di_f_utf_string_dynamicss_decrease_by_
+
+/**
+ * Increase the size of the dynamics string array, but only if necessary.
+ *
+ * If the given length is too large for the buffer, then attempt to set max buffer size (F_array_length_t_size_d).
+ * If already set to the maximum buffer size, then the resize will fail.
+ *
+ * @param step
+ * The allocation step to use.
+ * Must be greater than 0.
+ * @param dynamicss
+ * The array to resize.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ *
+ * F_array_too_large (with error bit) if the new array length is too large.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_dynamicss_increase_
+ extern f_status_t f_utf_string_dynamicss_increase(const f_array_length_t step, f_utf_string_dynamicss_t * const dynamicss);
+#endif // _di_f_utf_string_dynamicss_increase_
+
+/**
+ * Resize the dynamics string array to a larger size.
+ *
+ * This will resize making the array larger based on the given length.
+ * If the given length is too large for the buffer, then attempt to set max buffer size (F_array_length_t_size_d).
+ * If already set to the maximum buffer size, then the resize will fail.
+ *
+ * @param amount
+ * A positive number representing how much to increase the size by.
+ * @param dynamicss
+ * The array to resize.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + amount <= size).
+ *
+ * F_array_too_large (with error bit) if the new array length is too large.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_dynamicss_increase_by_
+ extern f_status_t f_utf_string_dynamicss_increase_by(const f_array_length_t amount, f_utf_string_dynamicss_t * const dynamicss);
+#endif // _di_f_utf_string_dynamicss_increase_by_
+
+/**
+ * Resize the dynamics string array.
+ *
+ * @param length
+ * The new size to use.
+ * @param dynamicss
+ * The array to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_dynamicss_resize_
+ extern f_status_t f_utf_string_dynamicss_resize(const f_array_length_t length, f_utf_string_dynamicss_t * const dynamicss);
+#endif // _di_f_utf_string_dynamicss_resize_
+
#ifdef __cplusplus
} // extern "C"
#endif
-#endif // _F_utf_string_dynamic_h
+#endif // _F_utf_dynamic_h
#include "../utf.h"
#include "../private-utf.h"
#include "private-string.h"
+#include "private-map.h"
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_f_utf_string_map_multis_adjust_
- f_status_t f_utf_string_map_multis_adjust(const f_array_length_t length, f_utf_string_map_multis_t *map_multis) {
+#ifndef _di_f_utf_string_maps_adjust_
+ f_status_t f_utf_string_maps_adjust(const f_array_length_t length, f_utf_string_maps_t * const maps) {
#ifndef _di_level_0_parameter_checking_
- if (!map_multis) return F_status_set_error(F_parameter);
+ if (!maps) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_utf_string_map_multis_adjust(length, map_multis);
+ return private_f_utf_string_maps_adjust(length, maps);
}
-#endif // _di_f_utf_string_map_multis_adjust_
+#endif // _di_f_utf_string_maps_adjust_
-#ifndef _di_f_utf_string_map_multis_append_
- f_status_t f_utf_string_map_multis_append(const f_utf_string_map_multis_t source, f_utf_string_map_multis_t *destination) {
+#ifndef _di_f_utf_string_maps_append_
+ f_status_t f_utf_string_maps_append(const f_utf_string_map_t source, f_utf_string_maps_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
f_status_t status = F_none;
- if (destination->used + source.used > destination->size) {
- status = private_f_utf_string_map_multis_resize(destination->used + source.used, destination);
+ if (destination->used + 1 > destination->size) {
+ status = private_f_utf_string_maps_resize(destination->used + F_memory_default_allocation_small_d, destination);
if (F_status_is_error(status)) return status;
}
- for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
+ destination->array[destination->used].name.used = 0;
+ destination->array[destination->used].value.used = 0;
- destination->array[destination->used].name.used = 0;
- destination->array[destination->used].value.used = 0;
+ if (source.name.used) {
+ status = private_f_utf_string_append(source.name.string, source.name.used, &destination->array[destination->used].name);
+ if (F_status_is_error(status)) return status;
+ }
- if (source.array[i].name.used) {
- status = private_f_utf_string_append(source.array[i].name.string, source.array[i].name.used, &destination->array[destination->used].name);
- if (F_status_is_error(status)) return status;
- }
+ if (source.value.used) {
+ status = private_f_utf_string_append(source.value.string, source.value.used, &destination->array[destination->used].value);
+ if (F_status_is_error(status)) return status;
+ }
- if (source.array[i].value.used) {
- status = private_f_utf_string_dynamics_append(source.array[i].value, &destination->array[destination->used].value);
- if (F_status_is_error(status)) return status;
- }
- } // for
+ ++destination->used;
return F_none;
}
-#endif // _di_f_utf_string_map_multis_append_
+#endif // _di_f_utf_string_maps_append_
+
+#ifndef _di_f_utf_string_maps_append_all_
+ f_status_t f_utf_string_maps_append_all(const f_utf_string_maps_t source, f_utf_string_maps_t * const destination) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!destination) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!source.used) return F_data_not;
+
+ return private_f_utf_string_maps_append_all(source, destination);
+ }
+#endif // _di_f_utf_string_maps_append_all_
-#ifndef _di_f_utf_string_map_multis_decimate_by_
- f_status_t f_utf_string_map_multis_decimate_by(const f_array_length_t amount, f_utf_string_map_multis_t *map_multis) {
+#ifndef _di_f_utf_string_maps_decimate_by_
+ f_status_t f_utf_string_maps_decimate_by(const f_array_length_t amount, f_utf_string_maps_t * const maps) {
#ifndef _di_level_0_parameter_checking_
- if (!amount) return F_status_set_error(F_parameter);
- if (!map_multis) return F_status_set_error(F_parameter);
+ if (!maps) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (map_multis->size - amount > 0) {
- return private_f_utf_string_map_multis_adjust(map_multis->size - amount, map_multis);
+ if (!amount) return F_data_not;
+
+ if (maps->size - amount > 0) {
+ return private_f_utf_string_maps_adjust(maps->size - amount, maps);
}
- return private_f_utf_string_map_multis_adjust(0, map_multis);
+ return private_f_utf_string_maps_adjust(0, maps);
}
-#endif // _di_f_utf_string_map_multis_decimate_by_
+#endif // _di_f_utf_string_maps_decimate_by_
-#ifndef _di_f_utf_string_map_multis_decrease_by_
- f_status_t f_utf_string_map_multis_decrease_by(const f_array_length_t amount, f_utf_string_map_multis_t *map_multis) {
+#ifndef _di_f_utf_string_maps_decrease_by_
+ f_status_t f_utf_string_maps_decrease_by(const f_array_length_t amount, f_utf_string_maps_t * const maps) {
#ifndef _di_level_0_parameter_checking_
- if (!amount) return F_status_set_error(F_parameter);
- if (!map_multis) return F_status_set_error(F_parameter);
+ if (!maps) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (map_multis->size - amount > 0) {
- return private_f_utf_string_map_multis_resize(map_multis->size - amount, map_multis);
+ if (!amount) return F_data_not;
+
+ if (maps->size - amount > 0) {
+ return private_f_utf_string_maps_resize(maps->size - amount, maps);
}
- return private_f_utf_string_map_multis_resize(0, map_multis);
+ return private_f_utf_string_maps_resize(0, maps);
}
-#endif // _di_f_utf_string_map_multis_decrease_by_
+#endif // _di_f_utf_string_maps_decrease_by_
-#ifndef _di_f_utf_string_map_multis_increase_
- f_status_t f_utf_string_map_multis_increase(const f_array_length_t step, f_utf_string_map_multis_t *map_multis) {
+#ifndef _di_f_utf_string_maps_increase_
+ f_status_t f_utf_string_maps_increase(const f_array_length_t step, f_utf_string_maps_t * const maps) {
#ifndef _di_level_0_parameter_checking_
- if (!step) return F_status_set_error(F_parameter);
- if (!map_multis) return F_status_set_error(F_parameter);
+ if (!maps) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (map_multis->used + 1 > map_multis->size) {
- f_array_length_t size = map_multis->used + step;
+ if (step && maps->used + 1 > maps->size) {
+ f_array_length_t size = maps->used + step;
if (size > F_array_length_t_size_d) {
- if (map_multis->used + 1 > F_array_length_t_size_d) {
+ if (maps->used + 1 > F_array_length_t_size_d) {
return F_status_set_error(F_array_too_large);
}
size = F_array_length_t_size_d;
}
- return private_f_utf_string_map_multis_resize(size, map_multis);
+ return private_f_utf_string_maps_resize(size, maps);
}
return F_data_not;
}
-#endif // _di_f_utf_string_map_multis_increase_
+#endif // _di_f_utf_string_maps_increase_
-#ifndef _di_f_utf_string_map_multis_increase_by_
- f_status_t f_utf_string_map_multis_increase_by(const f_array_length_t amount, f_utf_string_map_multis_t *map_multis) {
+#ifndef _di_f_utf_string_maps_increase_by_
+ f_status_t f_utf_string_maps_increase_by(const f_array_length_t amount, f_utf_string_maps_t * const maps) {
#ifndef _di_level_0_parameter_checking_
- if (!amount) return F_status_set_error(F_parameter);
- if (!map_multis) return F_status_set_error(F_parameter);
+ if (!maps) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (map_multis->used + amount > map_multis->size) {
- if (map_multis->used + amount > F_array_length_t_size_d) {
+ if (!amount) return F_data_not;
+
+ if (maps->used + amount > maps->size) {
+ if (maps->used + amount > F_array_length_t_size_d) {
return F_status_set_error(F_array_too_large);
}
- return private_f_utf_string_map_multis_resize(map_multis->used + amount, map_multis);
+ return private_f_utf_string_maps_resize(maps->used + amount, maps);
}
return F_data_not;
}
-#endif // _di_f_utf_string_map_multis_increase_by_
+#endif // _di_f_utf_string_maps_increase_by_
-#ifndef _di_f_utf_string_map_multis_resize_
- f_status_t f_utf_string_map_multis_resize(const f_array_length_t length, f_utf_string_map_multis_t *map_multis) {
+#ifndef _di_f_utf_string_maps_resize_
+ f_status_t f_utf_string_maps_resize(const f_array_length_t length, f_utf_string_maps_t * const maps) {
#ifndef _di_level_0_parameter_checking_
- if (!map_multis) return F_status_set_error(F_parameter);
+ if (!maps) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_utf_string_map_multis_resize(length, map_multis);
+ return private_f_utf_string_maps_resize(length, maps);
}
-#endif // _di_f_utf_string_map_multis_resize_
+#endif // _di_f_utf_string_maps_resize_
-#ifndef _di_f_utf_string_maps_adjust_
- f_status_t f_utf_string_maps_adjust(const f_array_length_t length, f_utf_string_maps_t *maps) {
+#ifndef _di_f_utf_string_mapss_adjust_
+ f_status_t f_utf_string_mapss_adjust(const f_array_length_t length, f_utf_string_mapss_t * const mapss) {
#ifndef _di_level_0_parameter_checking_
- if (!maps) return F_status_set_error(F_parameter);
+ if (!mapss) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_utf_string_maps_adjust(length, maps);
+ return private_f_utf_string_mapss_adjust(length, mapss);
}
-#endif // _di_f_utf_string_maps_adjust_
+#endif // _di_f_utf_string_mapss_adjust_
-#ifndef _di_f_utf_string_maps_append_
- f_status_t f_utf_string_maps_append(const f_utf_string_maps_t source, f_utf_string_maps_t *destination) {
+#ifndef _di_f_utf_string_mapss_append_
+ f_status_t f_utf_string_mapss_append(const f_utf_string_maps_t source, f_utf_string_mapss_t * const destination) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!destination) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!source.used) return F_data_not;
+
+ f_status_t status = F_none;
+
+ if (destination->used + 1 > destination->size) {
+ status = private_f_utf_string_mapss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used].used = 0;
+
+ if (source.used) {
+ status = private_f_utf_string_maps_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_utf_string_mapss_append_
+
+#ifndef _di_f_utf_string_mapss_append_all_
+ f_status_t f_utf_string_mapss_append_all(const f_utf_string_mapss_t source, f_utf_string_mapss_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
f_status_t status = F_none;
if (destination->used + source.used > destination->size) {
- status = private_f_utf_string_maps_resize(destination->used + source.used, destination);
+ status = private_f_utf_string_mapss_resize(destination->used + source.used, destination);
if (F_status_is_error(status)) return status;
}
for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
- destination->array[destination->used].name.used = 0;
- destination->array[destination->used].value.used = 0;
+ destination->array[destination->used].used = 0;
- if (source.array[i].name.used) {
- status = private_f_utf_string_append(source.array[i].name.string, source.array[i].name.used, &destination->array[destination->used].name);
- if (F_status_is_error(status)) return status;
- }
-
- if (source.array[i].value.used) {
- status = private_f_utf_string_append(source.array[i].value.string, source.array[i].value.used, &destination->array[destination->used].value);
+ if (source.array[i].used) {
+ status = private_f_utf_string_maps_append_all(source.array[i], &destination->array[destination->used]);
if (F_status_is_error(status)) return status;
}
} // for
return F_none;
}
-#endif // _di_f_utf_string_maps_append_
+#endif // _di_f_utf_string_mapss_append_all_
-#ifndef _di_f_utf_string_maps_decimate_by_
- f_status_t f_utf_string_maps_decimate_by(const f_array_length_t amount, f_utf_string_maps_t *maps) {
+#ifndef _di_f_utf_string_mapss_decimate_by_
+ f_status_t f_utf_string_mapss_decimate_by(const f_array_length_t amount, f_utf_string_mapss_t * const mapss) {
#ifndef _di_level_0_parameter_checking_
- if (!amount) return F_status_set_error(F_parameter);
- if (!maps) return F_status_set_error(F_parameter);
+ if (!mapss) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (maps->size - amount > 0) {
- return private_f_utf_string_maps_adjust(maps->size - amount, maps);
+ if (!amount) return F_data_not;
+
+ if (mapss->size - amount > 0) {
+ return private_f_utf_string_mapss_adjust(mapss->size - amount, mapss);
}
- return private_f_utf_string_maps_adjust(0, maps);
+ return private_f_utf_string_mapss_adjust(0, mapss);
}
-#endif // _di_f_utf_string_maps_decimate_by_
+#endif // _di_f_utf_string_mapss_decimate_by_
-#ifndef _di_f_utf_string_maps_decrease_by_
- f_status_t f_utf_string_maps_decrease_by(const f_array_length_t amount, f_utf_string_maps_t *maps) {
+#ifndef _di_f_utf_string_mapss_decrease_by_
+ f_status_t f_utf_string_mapss_decrease_by(const f_array_length_t amount, f_utf_string_mapss_t * const mapss) {
#ifndef _di_level_0_parameter_checking_
- if (!amount) return F_status_set_error(F_parameter);
- if (!maps) return F_status_set_error(F_parameter);
+ if (!mapss) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (maps->size - amount > 0) {
- return private_f_utf_string_maps_resize(maps->size - amount, maps);
+ if (!amount) return F_data_not;
+
+ if (mapss->size - amount > 0) {
+ return private_f_utf_string_mapss_resize(mapss->size - amount, mapss);
}
- return private_f_utf_string_maps_resize(0, maps);
+ return private_f_utf_string_mapss_resize(0, mapss);
}
-#endif // _di_f_utf_string_maps_decrease_by_
+#endif // _di_f_utf_string_mapss_decrease_by_
-#ifndef _di_f_utf_string_maps_increase_
- f_status_t f_utf_string_maps_increase(const f_array_length_t step, f_utf_string_maps_t *maps) {
+#ifndef _di_f_utf_string_mapss_increase_
+ f_status_t f_utf_string_mapss_increase(const f_array_length_t step, f_utf_string_mapss_t * const mapss) {
#ifndef _di_level_0_parameter_checking_
- if (!step) return F_status_set_error(F_parameter);
- if (!maps) return F_status_set_error(F_parameter);
+ if (!mapss) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (maps->used + 1 > maps->size) {
- f_array_length_t size = maps->used + step;
+ if (step && mapss->used + 1 > mapss->size) {
+ f_array_length_t size = mapss->used + step;
if (size > F_array_length_t_size_d) {
- if (maps->used + 1 > F_array_length_t_size_d) {
+ if (mapss->used + 1 > F_array_length_t_size_d) {
return F_status_set_error(F_array_too_large);
}
size = F_array_length_t_size_d;
}
- return private_f_utf_string_maps_resize(size, maps);
+ return private_f_utf_string_mapss_resize(size, mapss);
}
return F_data_not;
}
-#endif // _di_f_utf_string_maps_increase_
+#endif // _di_f_utf_string_mapss_increase_
-#ifndef _di_f_utf_string_maps_increase_by_
- f_status_t f_utf_string_maps_increase_by(const f_array_length_t amount, f_utf_string_maps_t *maps) {
+#ifndef _di_f_utf_string_mapss_increase_by_
+ f_status_t f_utf_string_mapss_increase_by(const f_array_length_t amount, f_utf_string_mapss_t * const mapss) {
#ifndef _di_level_0_parameter_checking_
- if (!amount) return F_status_set_error(F_parameter);
- if (!maps) return F_status_set_error(F_parameter);
+ if (!mapss) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (maps->used + amount > maps->size) {
- if (maps->used + amount > F_array_length_t_size_d) {
+ if (!amount) return F_data_not;
+
+ if (mapss->used + amount > mapss->size) {
+ if (mapss->used + amount > F_array_length_t_size_d) {
return F_status_set_error(F_array_too_large);
}
- return private_f_utf_string_maps_resize(maps->used + amount, maps);
+ return private_f_utf_string_mapss_resize(mapss->used + amount, mapss);
}
return F_data_not;
}
-#endif // _di_f_utf_string_maps_increase_by_
+#endif // _di_f_utf_string_mapss_increase_by_
-#ifndef _di_f_utf_string_maps_resize_
- f_status_t f_utf_string_maps_resize(const f_array_length_t length, f_utf_string_maps_t *maps) {
+#ifndef _di_f_utf_string_mapss_resize_
+ f_status_t f_utf_string_mapss_resize(const f_array_length_t length, f_utf_string_mapss_t * const mapss) {
#ifndef _di_level_0_parameter_checking_
- if (!maps) return F_status_set_error(F_parameter);
+ if (!mapss) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_utf_string_maps_resize(length, maps);
+ return private_f_utf_string_mapss_resize(length, mapss);
}
-#endif // _di_f_utf_string_maps_resize_
+#endif // _di_f_utf_string_mapss_resize_
#ifdef __cplusplus
} // extern "C"
*
* This is auto-included by utf.h and should not need to be explicitly included.
*/
-#ifndef _F_utf_string_map_h
-#define _F_utf_string_map_h
+#ifndef _F_utf_map_h
+#define _F_utf_map_h
#ifdef __cplusplus
extern "C" {
#define f_utf_string_map_t_initialize { f_utf_string_dynamic_t_initialize, f_utf_string_dynamic_t_initialize }
+ #define macro_f_utf_string_map_t_initialize(name, value) { name, value }
+
#define macro_f_utf_string_map_t_clear(map) \
macro_f_utf_string_dynamic_t_clear(map.name) \
macro_f_utf_string_dynamic_t_clear(map.value)
#define f_utf_string_maps_t_initialize f_utf_string_statics_t_initialize
+ #define macro_f_utf_string_maps_t_initialize(array, size, used) { array, size, used }
+ #define macro_f_utf_string_maps_t_initialize2(array, length) { array, length, length }
+
#define macro_f_utf_string_maps_t_clear(maps) macro_f_memory_structure_clear(maps)
#define macro_f_utf_string_maps_t_resize(status, maps, length) status = f_utf_string_maps_resize(length, &maps);
#define macro_f_utf_string_maps_t_delete_simple(maps) f_utf_string_maps_resize(0, &maps);
#define macro_f_utf_string_maps_t_destroy_simple(maps) f_utf_string_maps_adjust(0, &maps);
- #define macro_f_utf_string_maps_t_increase(status, maps) status = f_utf_string_maps_increase(maps);
+ #define macro_f_utf_string_maps_t_increase(status, step, maps) status = f_utf_string_maps_increase(step, maps);
#define macro_f_utf_string_maps_t_increase_by(status, maps, amount) status = f_utf_string_maps_increase_by(amount, maps);
#define macro_f_utf_string_maps_t_decrease_by(status, maps, amount) status = f_utf_string_maps_decrease_by(amount, maps);
#define macro_f_utf_string_maps_t_decimate_by(status, maps, amount) status = f_utf_string_maps_decimate_by(amount, maps);
#endif // _di_f_utf_string_maps_t_
/**
- * A string map consisting of a name and multiple values.
- *
- * name: A string representing the map name.
- * value: An array of strings representing the map value.
- */
-#ifndef _di_f_utf_string_map_multi_t_
- typedef struct {
- f_utf_string_dynamic_t name;
- f_utf_string_dynamics_t value;
- } f_utf_string_map_multi_t;
-
- #define f_utf_string_map_multi_t_initialize { f_utf_string_dynamic_t_initialize, f_utf_string_dynamics_t_initialize }
-
- #define macro_f_utf_string_map_multi_t_clear(map) \
- macro_f_utf_string_dynamic_t_clear(map.name) \
- macro_f_utf_string_dynamics_t_clear(map.value)
-
- #define macro_f_utf_string_map_multi_t_delete_simple(map) \
- macro_f_utf_string_dynamic_t_delete_simple(map.name) \
- macro_f_utf_string_dynamics_t_delete_simple(map.value)
-
- #define macro_f_utf_string_map_multi_t_destroy_simple(map) \
- macro_f_utf_string_dynamic_t_destroy_simple(map.name) \
- macro_f_utf_string_dynamics_t_destroy_simple(map.value)
-#endif // _di_f_utf_string_map_multi_t_
-
-/**
* An array of string maps.
*
- * array: the array of string maps.
+ * array: the array of an array of string maps.
* size: total amount of allocated space.
* used: total number of allocated spaces used.
*/
-#ifndef _di_f_utf_string_map_multis_t_
+#ifndef _di_f_utf_string_mapss_t_
typedef struct {
- f_utf_string_map_multi_t *array;
+ f_utf_string_maps_t *array;
f_array_length_t size;
f_array_length_t used;
- } f_utf_string_map_multis_t;
+ } f_utf_string_mapss_t;
- #define f_utf_string_map_multis_t_initialize f_utf_string_statics_t_initialize
+ #define f_utf_string_mapss_t_initialize f_utf_string_statics_t_initialize
- #define macro_f_utf_string_map_multis_t_clear(map_multis) macro_f_memory_structure_clear(map_multis)
+ #define macro_f_utf_string_mapss_t_initialize(array, size, used) { array, size, used }
+ #define macro_f_utf_string_mapss_t_initialize2(array, length) { array, length, length }
- #define macro_f_utf_string_map_multis_t_resize(status, map_multis, length) status = f_utf_string_map_multis_resize(length, &map_multis);
- #define macro_f_utf_string_map_multis_t_adjust(status, map_multis, length) status = f_utf_string_map_multis_adjust(length, &map_multis);
+ #define macro_f_utf_string_mapss_t_clear(maps) macro_f_memory_structure_clear(maps)
- #define macro_f_utf_string_map_multis_t_delete_simple(map_multis) f_utf_string_map_multis_resize(0, &map_multis);
- #define macro_f_utf_string_map_multis_t_destroy_simple(map_multis) f_utf_string_map_multis_adjust(0, &map_multis);
+ #define macro_f_utf_string_mapss_t_resize(status, maps, length) status = f_utf_string_mapss_resize(length, &maps);
+ #define macro_f_utf_string_mapss_t_adjust(status, maps, length) status = f_utf_string_mapss_adjust(length, &maps);
- #define macro_f_utf_string_map_multis_t_increase(status, map_multis) status = f_utf_string_map_multis_increase(&map_multis);
- #define macro_f_utf_string_map_multis_t_increase_by(status, map_multis, amount) status = f_utf_string_map_multis_increase_by(amount, &map_multis);
- #define macro_f_utf_string_map_multis_t_decrease_by(status, map_multis, amount) status = f_utf_string_map_multis_decrease_by(amount, &map_multis);
- #define macro_f_utf_string_map_multis_t_decimate_by(status, map_multis, amount) status = f_utf_string_map_multis_decimate_by(amount, &map_multis);
-#endif // _di_f_utf_string_map_multis_t_
+ #define macro_f_utf_string_mapss_t_delete_simple(maps) f_utf_string_mapss_resize(0, &maps);
+ #define macro_f_utf_string_mapss_t_destroy_simple(maps) f_utf_string_mapss_adjust(0, &maps);
+
+ #define macro_f_utf_string_mapss_t_increase(status, step, maps) status = f_utf_string_mapss_increase(step, maps);
+ #define macro_f_utf_string_mapss_t_increase_by(status, maps, amount) status = f_utf_string_mapss_increase_by(amount, maps);
+ #define macro_f_utf_string_mapss_t_decrease_by(status, maps, amount) status = f_utf_string_mapss_decrease_by(amount, maps);
+ #define macro_f_utf_string_mapss_t_decimate_by(status, maps, amount) status = f_utf_string_mapss_decimate_by(amount, maps);
+#endif // _di_f_utf_string_mapss_t_
/**
- * Resize the map_multis array.
+ * Resize the string maps array.
*
* @param length
* The new size to use.
- * @param map_multis
- * The map_multis array to resize.
+ * @param maps
+ * The string maps array to resize.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_utf_string_map_multis_adjust_
- extern f_status_t f_utf_string_map_multis_adjust(const f_array_length_t length, f_utf_string_map_multis_t *map_multis);
-#endif // _di_f_utf_string_map_multis_adjust_
+#ifndef _di_f_utf_string_maps_adjust_
+ extern f_status_t f_utf_string_maps_adjust(const f_array_length_t length, f_utf_string_maps_t * const maps);
+#endif // _di_f_utf_string_maps_adjust_
/**
- * Append the source map_multis onto the destination.
+ * Append a single source map onto the destination.
+ *
+ * @param source
+ * The source maps to append.
+ * @param destination
+ * The destination maps the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_maps_append_
+ extern f_status_t f_utf_string_maps_append(const f_utf_string_map_t source, f_utf_string_maps_t * const destination);
+#endif // _di_f_utf_string_maps_append_
+
+/**
+ * Append the source maps onto the destination.
*
* @param source
* The source maps to append.
*
* Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_utf_string_map_multis_append_
- f_status_t f_utf_string_map_multis_append(const f_utf_string_map_multis_t source, f_utf_string_map_multis_t *destination);
-#endif // _di_f_utf_string_map_multis_append_
+#ifndef _di_f_utf_string_maps_append_all_
+ extern f_status_t f_utf_string_maps_append_all(const f_utf_string_maps_t source, f_utf_string_maps_t * const destination);
+#endif // _di_f_utf_string_maps_append_all_
/**
- * Resize the map_multis array to a smaller size.
+ * Resize the string maps array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param map_multis
- * The map_multis array to resize.
+ * @param maps
+ * The string maps array to resize.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_utf_string_map_multis_decimate_by_
- extern f_status_t f_utf_string_map_multis_decimate_by(const f_array_length_t amount, f_utf_string_map_multis_t *map_multis);
-#endif // _di_f_utf_string_map_multis_decimate_by_
+#ifndef _di_f_utf_string_maps_decimate_by_
+ extern f_status_t f_utf_string_maps_decimate_by(const f_array_length_t amount, f_utf_string_maps_t * const maps);
+#endif // _di_f_utf_string_maps_decimate_by_
/**
- * Resize the map_multis array to a smaller size.
+ * Resize the string maps array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param map_multis
- * The map_multis array to resize.
+ * @param maps
+ * The string maps array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_utf_string_map_multis_decrease_by_
- extern f_status_t f_utf_string_map_multis_decrease_by(const f_array_length_t amount, f_utf_string_map_multis_t *map_multis);
-#endif // _di_f_utf_string_map_multis_decrease_by_
+#ifndef _di_f_utf_string_maps_decrease_by_
+ extern f_status_t f_utf_string_maps_decrease_by(const f_array_length_t amount, f_utf_string_maps_t * const maps);
+#endif // _di_f_utf_string_maps_decrease_by_
/**
- * Increase the size of the map_multis array, but only if necessary.
+ * Increase the size of the string maps array, but only if necessary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_array_length_t_size_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param map_multis
- * The map_multis array to resize.
+ * @param maps
+ * The string maps array to resize.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_utf_string_map_multis_increase_
- extern f_status_t f_utf_string_map_multis_increase(const f_array_length_t step, f_utf_string_map_multis_t *map_multis);
-#endif // _di_f_utf_string_map_multis_increase_
+#ifndef _di_f_utf_string_maps_increase_
+ extern f_status_t f_utf_string_maps_increase(const f_array_length_t step, f_utf_string_maps_t * const maps);
+#endif // _di_f_utf_string_maps_increase_
/**
- * Resize the map_multis array to a larger size.
+ * Resize the string maps array to a larger size.
*
* This will resize making the string larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_array_length_t_size_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param map_multis
- * The map_multis array to resize.
+ * @param maps
+ * The string maps array to resize.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_utf_string_map_multis_increase_by_
- extern f_status_t f_utf_string_map_multis_increase_by(const f_array_length_t amount, f_utf_string_map_multis_t *map_multis);
-#endif // _di_f_utf_string_map_multis_increase_by_
+#ifndef _di_f_utf_string_maps_increase_by_
+ extern f_status_t f_utf_string_maps_increase_by(const f_array_length_t amount, f_utf_string_maps_t * const maps);
+#endif // _di_f_utf_string_maps_increase_by_
/**
- * Resize the map_multis array.
+ * Resize the string maps array.
*
* @param length
* The new size to use.
- * @param map_multis
- * The map_multis array to adjust.
+ * @param maps
+ * The string maps array to adjust.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_utf_string_map_multis_resize_
- extern f_status_t f_utf_string_map_multis_resize(const f_array_length_t length, f_utf_string_map_multis_t *map_multis);
-#endif // _di_f_utf_string_map_multis_resize_
+#ifndef _di_f_utf_string_maps_resize_
+ extern f_status_t f_utf_string_maps_resize(const f_array_length_t length, f_utf_string_maps_t * const maps);
+#endif // _di_f_utf_string_maps_resize_
/**
- * Resize the string maps array.
+ * Resize the string mapss array.
*
* @param length
* The new size to use.
- * @param maps
- * The string maps array to resize.
+ * @param mapss
+ * The string mapss array to resize.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_utf_string_maps_adjust_
- extern f_status_t f_utf_string_maps_adjust(const f_array_length_t length, f_utf_string_maps_t *maps);
-#endif // _di_f_utf_string_maps_adjust_
+#ifndef _di_f_utf_string_mapss_adjust_
+ extern f_status_t f_utf_string_mapss_adjust(const f_array_length_t length, f_utf_string_mapss_t * const mapss);
+#endif // _di_f_utf_string_mapss_adjust_
/**
- * Append the source maps onto the destination.
+ * Append a single source maps onto the destination.
*
* @param source
- * The source maps to append.
+ * The source mapss to append.
* @param destination
- * The destination maps the source is appended onto.
+ * The destination mapss the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_mapss_append_
+ extern f_status_t f_utf_string_mapss_append(const f_utf_string_maps_t source, f_utf_string_mapss_t * const destination);
+#endif // _di_f_utf_string_mapss_append_
+
+/**
+ * Append the source mapss onto the destination.
+ *
+ * @param source
+ * The source mapss to append.
+ * @param destination
+ * The destination mapss the source is appended onto.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_utf_string_maps_append_
- extern f_status_t f_utf_string_maps_append(const f_utf_string_maps_t source, f_utf_string_maps_t *destination);
-#endif // _di_f_utf_string_maps_append_
+#ifndef _di_f_utf_string_mapss_append_all_
+ extern f_status_t f_utf_string_mapss_append_all(const f_utf_string_mapss_t source, f_utf_string_mapss_t * const destination);
+#endif // _di_f_utf_string_mapss_append_all_
/**
- * Resize the string maps array to a smaller size.
+ * Resize the string mapss array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param maps
- * The string maps array to resize.
+ * @param mapss
+ * The string mapss array to resize.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_utf_string_maps_decimate_by_
- extern f_status_t f_utf_string_maps_decimate_by(const f_array_length_t amount, f_utf_string_maps_t *maps);
-#endif // _di_f_utf_string_maps_decimate_by_
+#ifndef _di_f_utf_string_mapss_decimate_by_
+ extern f_status_t f_utf_string_mapss_decimate_by(const f_array_length_t amount, f_utf_string_mapss_t * const mapss);
+#endif // _di_f_utf_string_mapss_decimate_by_
/**
- * Resize the string maps array to a smaller size.
+ * Resize the string mapss array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param maps
- * The string maps array to resize.
+ * @param mapss
+ * The string mapss array to resize.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_utf_string_maps_decrease_by_
- extern f_status_t f_utf_string_maps_decrease_by(const f_array_length_t amount, f_utf_string_maps_t *maps);
-#endif // _di_f_utf_string_maps_decrease_by_
+#ifndef _di_f_utf_string_mapss_decrease_by_
+ extern f_status_t f_utf_string_mapss_decrease_by(const f_array_length_t amount, f_utf_string_mapss_t * const mapss);
+#endif // _di_f_utf_string_mapss_decrease_by_
/**
- * Increase the size of the string maps array, but only if necessary.
+ * Increase the size of the string mapss array, but only if necessary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_array_length_t_size_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param maps
- * The string maps array to resize.
+ * @param mapss
+ * The string mapss array to resize.
*
* @return
* F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ * F_data_not on success, but there is no reason to increase size (used + 1 <= size) (or step is 0).
*
* F_array_too_large (with error bit) if the new array length is too large.
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_utf_string_maps_increase_
- extern f_status_t f_utf_string_maps_increase(const f_array_length_t step, f_utf_string_maps_t *maps);
-#endif // _di_f_utf_string_maps_increase_
+#ifndef _di_f_utf_string_mapss_increase_
+ extern f_status_t f_utf_string_mapss_increase(const f_array_length_t step, f_utf_string_mapss_t * const mapss);
+#endif // _di_f_utf_string_mapss_increase_
/**
- * Resize the string maps array to a larger size.
+ * Resize the string mapss array to a larger size.
*
* This will resize making the string larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_array_length_t_size_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param maps
- * The string maps array to resize.
+ * @param mapss
+ * The string mapss array to resize.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_utf_string_maps_increase_by_
- extern f_status_t f_utf_string_maps_increase_by(const f_array_length_t amount, f_utf_string_maps_t *maps);
-#endif // _di_f_utf_string_maps_increase_by_
+#ifndef _di_f_utf_string_mapss_increase_by_
+ extern f_status_t f_utf_string_mapss_increase_by(const f_array_length_t amount, f_utf_string_mapss_t * const mapss);
+#endif // _di_f_utf_string_mapss_increase_by_
/**
- * Resize the string maps array.
+ * Resize the string mapss array.
*
* @param length
* The new size to use.
- * @param maps
- * The string maps array to adjust.
+ * @param mapss
+ * The string mapss array to adjust.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_utf_string_maps_resize_
- extern f_status_t f_utf_string_maps_resize(const f_array_length_t length, f_utf_string_maps_t *maps);
-#endif // _di_f_utf_string_maps_resize_
+#ifndef _di_f_utf_string_mapss_resize_
+ extern f_status_t f_utf_string_mapss_resize(const f_array_length_t length, f_utf_string_mapss_t * const mapss);
+#endif // _di_f_utf_string_mapss_resize_
#ifdef __cplusplus
} // extern "C"
#endif
-#endif // _F_utf_string_map_h
+#endif // _F_utf_map_h
--- /dev/null
+#include "../utf.h"
+#include "../private-utf.h"
+#include "private-dynamic.h"
+#include "private-map_multi.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_f_utf_string_map_multis_adjust_
+ f_status_t f_utf_string_map_multis_adjust(const f_array_length_t length, f_utf_string_map_multis_t * const map_multis) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!map_multis) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_utf_string_map_multis_adjust(length, map_multis);
+ }
+#endif // _di_f_utf_string_map_multis_adjust_
+
+#ifndef _di_f_utf_string_map_multis_append_
+ f_status_t f_utf_string_map_multis_append(const f_utf_string_map_multi_t source, f_utf_string_map_multis_t * const destination) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!destination) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ f_status_t status = F_none;
+
+ if (destination->used + 1 > destination->size) {
+ status = private_f_utf_string_map_multis_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used].name.used = 0;
+ destination->array[destination->used].value.used = 0;
+
+ if (source.name.used) {
+ status = private_f_utf_string_append(source.name.string, source.name.used, &destination->array[destination->used].name);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.value.used) {
+ status = private_f_utf_string_dynamics_append_all(source.value, &destination->array[destination->used].value);
+ if (F_status_is_error(status)) return status;
+ }
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_utf_string_map_multis_append_
+
+#ifndef _di_f_utf_string_map_multis_append_all_
+ f_status_t f_utf_string_map_multis_append_all(const f_utf_string_map_multis_t source, f_utf_string_map_multis_t * const destination) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!destination) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!source.used) return F_data_not;
+
+ return private_f_utf_string_map_multis_append_all(source, destination);
+ }
+#endif // _di_f_utf_string_map_multis_append_all_
+
+#ifndef _di_f_utf_string_map_multis_decimate_by_
+ f_status_t f_utf_string_map_multis_decimate_by(const f_array_length_t amount, f_utf_string_map_multis_t * const map_multis) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!map_multis) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) return F_data_not;
+
+ if (map_multis->size - amount > 0) {
+ return private_f_utf_string_map_multis_adjust(map_multis->size - amount, map_multis);
+ }
+
+ return private_f_utf_string_map_multis_adjust(0, map_multis);
+ }
+#endif // _di_f_utf_string_map_multis_decimate_by_
+
+#ifndef _di_f_utf_string_map_multis_decrease_by_
+ f_status_t f_utf_string_map_multis_decrease_by(const f_array_length_t amount, f_utf_string_map_multis_t * const map_multis) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!map_multis) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) return F_data_not;
+
+ if (map_multis->size - amount > 0) {
+ return private_f_utf_string_map_multis_resize(map_multis->size - amount, map_multis);
+ }
+
+ return private_f_utf_string_map_multis_resize(0, map_multis);
+ }
+#endif // _di_f_utf_string_map_multis_decrease_by_
+
+#ifndef _di_f_utf_string_map_multis_increase_
+ f_status_t f_utf_string_map_multis_increase(const f_array_length_t step, f_utf_string_map_multis_t * const map_multis) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!map_multis) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (step && map_multis->used + 1 > map_multis->size) {
+ f_array_length_t size = map_multis->used + step;
+
+ if (size > F_array_length_t_size_d) {
+ if (map_multis->used + 1 > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ size = F_array_length_t_size_d;
+ }
+
+ return private_f_utf_string_map_multis_resize(size, map_multis);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_utf_string_map_multis_increase_
+
+#ifndef _di_f_utf_string_map_multis_increase_by_
+ f_status_t f_utf_string_map_multis_increase_by(const f_array_length_t amount, f_utf_string_map_multis_t * const map_multis) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!map_multis) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) return F_data_not;
+
+ if (map_multis->used + amount > map_multis->size) {
+ if (map_multis->used + amount > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ return private_f_utf_string_map_multis_resize(map_multis->used + amount, map_multis);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_utf_string_map_multis_increase_by_
+
+#ifndef _di_f_utf_string_map_multis_resize_
+ f_status_t f_utf_string_map_multis_resize(const f_array_length_t length, f_utf_string_map_multis_t * const map_multis) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!map_multis) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_utf_string_map_multis_resize(length, map_multis);
+ }
+#endif // _di_f_utf_string_map_multis_resize_
+
+#ifndef _di_f_utf_string_map_multiss_adjust_
+ f_status_t f_utf_string_map_multiss_adjust(const f_array_length_t length, f_utf_string_map_multiss_t * const map_multiss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!map_multiss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_utf_string_map_multiss_adjust(length, map_multiss);
+ }
+#endif // _di_f_utf_string_map_multiss_adjust_
+
+#ifndef _di_f_utf_string_map_multiss_append_
+ f_status_t f_utf_string_map_multiss_append(const f_utf_string_map_multis_t source, f_utf_string_map_multiss_t * const destination) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!destination) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!source.used) return F_data_not;
+
+ f_status_t status = F_none;
+
+ if (destination->used + 1 > destination->size) {
+ status = private_f_utf_string_map_multiss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used].used = 0;
+
+ if (source.used) {
+ status = private_f_utf_string_map_multis_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_utf_string_map_multiss_append_
+
+#ifndef _di_f_utf_string_map_multiss_append_all_
+ f_status_t f_utf_string_map_multiss_append_all(const f_utf_string_map_multiss_t source, f_utf_string_map_multiss_t * const destination) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!destination) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!source.used) return F_data_not;
+
+ f_status_t status = F_none;
+
+ if (destination->used + source.used > destination->size) {
+ status = private_f_utf_string_map_multiss_resize(destination->used + source.used, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
+
+ destination->array[destination->used].used = 0;
+
+ if (source.array[i].used) {
+ status = private_f_utf_string_map_multis_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+
+ return F_none;
+ }
+#endif // _di_f_utf_string_map_multiss_append_all_
+
+#ifndef _di_f_utf_string_map_multiss_decimate_by_
+ f_status_t f_utf_string_map_multiss_decimate_by(const f_array_length_t amount, f_utf_string_map_multiss_t * const map_multiss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!map_multiss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) return F_data_not;
+
+ if (map_multiss->size - amount > 0) {
+ return private_f_utf_string_map_multiss_adjust(map_multiss->size - amount, map_multiss);
+ }
+
+ return private_f_utf_string_map_multiss_adjust(0, map_multiss);
+ }
+#endif // _di_f_utf_string_map_multiss_decimate_by_
+
+#ifndef _di_f_utf_string_map_multiss_decrease_by_
+ f_status_t f_utf_string_map_multiss_decrease_by(const f_array_length_t amount, f_utf_string_map_multiss_t * const map_multiss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!map_multiss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) return F_data_not;
+
+ if (map_multiss->size - amount > 0) {
+ return private_f_utf_string_map_multiss_resize(map_multiss->size - amount, map_multiss);
+ }
+
+ return private_f_utf_string_map_multiss_resize(0, map_multiss);
+ }
+#endif // _di_f_utf_string_map_multiss_decrease_by_
+
+#ifndef _di_f_utf_string_map_multiss_increase_
+ f_status_t f_utf_string_map_multiss_increase(const f_array_length_t step, f_utf_string_map_multiss_t * const map_multiss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!map_multiss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (step && map_multiss->used + 1 > map_multiss->size) {
+ f_array_length_t size = map_multiss->used + step;
+
+ if (size > F_array_length_t_size_d) {
+ if (map_multiss->used + 1 > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ size = F_array_length_t_size_d;
+ }
+
+ return private_f_utf_string_map_multiss_resize(size, map_multiss);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_utf_string_map_multiss_increase_
+
+#ifndef _di_f_utf_string_map_multiss_increase_by_
+ f_status_t f_utf_string_map_multiss_increase_by(const f_array_length_t amount, f_utf_string_map_multiss_t * const map_multiss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!map_multiss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) return F_data_not;
+
+ if (map_multiss->used + amount > map_multiss->size) {
+ if (map_multiss->used + amount > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ return private_f_utf_string_map_multiss_resize(map_multiss->used + amount, map_multiss);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_utf_string_map_multiss_increase_by_
+
+#ifndef _di_f_utf_string_map_multiss_resize_
+ f_status_t f_utf_string_map_multiss_resize(const f_array_length_t length, f_utf_string_map_multiss_t * const map_multiss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!map_multiss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_utf_string_map_multiss_resize(length, map_multiss);
+ }
+#endif // _di_f_utf_string_map_multiss_resize_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Defines map string data.
+ *
+ * This is auto-included by string.h and should not need to be explicitly included.
+ */
+#ifndef _F_utf_map_multi_h
+#define _F_utf_map_multi_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * A string map consisting of a name and multiple values.
+ *
+ * name: A string representing the map name.
+ * value: An array of strings representing the map value.
+ */
+#ifndef _di_f_utf_string_map_multi_t_
+ typedef struct {
+ f_utf_string_dynamic_t name;
+ f_utf_string_dynamics_t value;
+ } f_utf_string_map_multi_t;
+
+ #define f_utf_string_map_multi_t_initialize { f_utf_string_dynamic_t_initialize, f_utf_string_dynamics_t_initialize }
+
+ #define macro_f_utf_string_map_t_initialize(name, value) { name, value }
+
+ #define macro_f_utf_string_map_multi_t_clear(map) \
+ macro_f_utf_string_dynamic_t_clear(map.name) \
+ macro_f_utf_string_dynamics_t_clear(map.value)
+
+ #define macro_f_utf_string_map_multi_t_delete_simple(map) \
+ macro_f_utf_string_dynamic_t_delete_simple(map.name) \
+ macro_f_utf_string_dynamics_t_delete_simple(map.value)
+
+ #define macro_f_utf_string_map_multi_t_destroy_simple(map) \
+ macro_f_utf_string_dynamic_t_destroy_simple(map.name) \
+ macro_f_utf_string_dynamics_t_destroy_simple(map.value)
+#endif // _di_f_utf_string_map_multi_t_
+
+/**
+ * An array of string maps.
+ *
+ * array: the array of string maps.
+ * size: total amount of allocated space.
+ * used: total number of allocated spaces used.
+ */
+#ifndef _di_f_utf_string_map_multis_t_
+ typedef struct {
+ f_utf_string_map_multi_t *array;
+
+ f_array_length_t size;
+ f_array_length_t used;
+ } f_utf_string_map_multis_t;
+
+ #define f_utf_string_map_multis_t_initialize f_utf_string_statics_t_initialize
+
+ #define macro_f_utf_string_map_multis_t_initialize(array, size, used) { array, size, used }
+ #define macro_f_utf_string_map_multis_t_initialize2(array, length) { array, length, length }
+
+ #define macro_f_utf_string_map_multis_t_clear(map_multis) macro_f_memory_structure_clear(map_multis)
+
+ #define macro_f_utf_string_map_multis_t_resize(status, map_multis, length) status = f_utf_string_map_multis_resize(length, &map_multis);
+ #define macro_f_utf_string_map_multis_t_adjust(status, map_multis, length) status = f_utf_string_map_multis_adjust(length, &map_multis);
+
+ #define macro_f_utf_string_map_multis_t_delete_simple(map_multis) f_utf_string_map_multis_resize(0, &map_multis);
+ #define macro_f_utf_string_map_multis_t_destroy_simple(map_multis) f_utf_string_map_multis_adjust(0, &map_multis);
+
+ #define macro_f_utf_string_map_multis_t_increase(status, step, map_multis) status = f_utf_string_map_multis_increase(step, &map_multis);
+ #define macro_f_utf_string_map_multis_t_increase_by(status, map_multis, amount) status = f_utf_string_map_multis_increase_by(amount, &map_multis);
+ #define macro_f_utf_string_map_multis_t_decrease_by(status, map_multis, amount) status = f_utf_string_map_multis_decrease_by(amount, &map_multis);
+ #define macro_f_utf_string_map_multis_t_decimate_by(status, map_multis, amount) status = f_utf_string_map_multis_decimate_by(amount, &map_multis);
+#endif // _di_f_utf_string_map_multis_t_
+
+/**
+ * An array of string maps.
+ *
+ * array: the array of an array of string maps.
+ * size: total amount of allocated space.
+ * used: total number of allocated spaces used.
+ */
+#ifndef _di_f_utf_string_map_multiss_t_
+ typedef struct {
+ f_utf_string_map_multis_t *array;
+
+ f_array_length_t size;
+ f_array_length_t used;
+ } f_utf_string_map_multiss_t;
+
+ #define f_utf_string_map_multiss_t_initialize f_utf_string_statics_t_initialize
+
+ #define macro_f_utf_string_map_multiss_t_initialize(array, size, used) { array, size, used }
+ #define macro_f_utf_string_map_multiss_t_initialize2(array, length) { array, length, length }
+
+ #define macro_f_utf_string_map_multiss_t_clear(map_multis) macro_f_memory_structure_clear(map_multis)
+
+ #define macro_f_utf_string_map_multiss_t_resize(status, map_multis, length) status = f_utf_string_map_multiss_resize(length, &map_multis);
+ #define macro_f_utf_string_map_multiss_t_adjust(status, map_multis, length) status = f_utf_string_map_multiss_adjust(length, &map_multis);
+
+ #define macro_f_utf_string_map_multiss_t_delete_simple(map_multis) f_utf_string_map_multiss_resize(0, &map_multis);
+ #define macro_f_utf_string_map_multiss_t_destroy_simple(map_multis) f_utf_string_map_multiss_adjust(0, &map_multis);
+
+ #define macro_f_utf_string_map_multiss_t_increase(status, step, map_multis) status = f_utf_string_map_multiss_increase(step, &map_multis);
+ #define macro_f_utf_string_map_multiss_t_increase_by(status, map_multis, amount) status = f_utf_string_map_multiss_increase_by(amount, &map_multis);
+ #define macro_f_utf_string_map_multiss_t_decrease_by(status, map_multis, amount) status = f_utf_string_map_multiss_decrease_by(amount, &map_multis);
+ #define macro_f_utf_string_map_multiss_t_decimate_by(status, map_multis, amount) status = f_utf_string_map_multiss_decimate_by(amount, &map_multis);
+#endif // _di_f_utf_string_map_multiss_t_
+
+/**
+ * Resize the map_multis array.
+ *
+ * @param length
+ * The new size to use.
+ * @param map_multis
+ * The map_multis array to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_map_multis_adjust_
+ extern f_status_t f_utf_string_map_multis_adjust(const f_array_length_t length, f_utf_string_map_multis_t * const map_multis);
+#endif // _di_f_utf_string_map_multis_adjust_
+
+/**
+ * Append a single source map_multi onto the destination.
+ *
+ * @param source
+ * The source maps to append.
+ * @param destination
+ * The destination maps the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_map_multis_append_
+ f_status_t f_utf_string_map_multis_append(const f_utf_string_map_multi_t source, f_utf_string_map_multis_t *destination);
+#endif // _di_f_utf_string_map_multis_append_
+
+/**
+ * Append the source map_multis onto the destination.
+ *
+ * @param source
+ * The source maps to append.
+ * @param destination
+ * The destination maps the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is nothing to append (size == 0).
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_map_multis_append_all_
+ f_status_t f_utf_string_map_multis_append_all(const f_utf_string_map_multis_t source, f_utf_string_map_multis_t *destination);
+#endif // _di_f_utf_string_map_multis_append_all_
+
+/**
+ * Resize the map_multis array to a smaller size.
+ *
+ * This will resize making the array smaller based on (size - given length).
+ * If the given length is too small, then the resize will fail.
+ * This will not shrink the size to less than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decimate the size by.
+ * @param map_multis
+ * The map_multis array to resize.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not if amount is 0.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_map_multis_decimate_by_
+ extern f_status_t f_utf_string_map_multis_decimate_by(const f_array_length_t amount, f_utf_string_map_multis_t * const map_multis);
+#endif // _di_f_utf_string_map_multis_decimate_by_
+
+/**
+ * Resize the map_multis array to a smaller size.
+ *
+ * This will resize making the array smaller based on (size - given length).
+ * If the given length is too small, then the resize will fail.
+ * This will not shrink the size to less than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decrease the size by.
+ * @param map_multis
+ * The map_multis array to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_map_multis_decrease_by_
+ extern f_status_t f_utf_string_map_multis_decrease_by(const f_array_length_t amount, f_utf_string_map_multis_t * const map_multis);
+#endif // _di_f_utf_string_map_multis_decrease_by_
+
+/**
+ * Increase the size of the map_multis array, but only if necessary.
+ *
+ * If the given length is too large for the buffer, then attempt to set max buffer size (F_array_length_t_size_d).
+ * If already set to the maximum buffer size, then the resize will fail.
+ *
+ * @param step
+ * The allocation step to use.
+ * Must be greater than 0.
+ * @param map_multis
+ * The map_multis array to resize.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ *
+ * F_array_too_large (with error bit) if the new array length is too large.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_map_multis_increase_
+ extern f_status_t f_utf_string_map_multis_increase(const f_array_length_t step, f_utf_string_map_multis_t * const map_multis);
+#endif // _di_f_utf_string_map_multis_increase_
+
+/**
+ * Resize the map_multis array to a larger size.
+ *
+ * This will resize making the string larger based on the given length.
+ * If the given length is too large for the buffer, then attempt to set max buffer size (F_array_length_t_size_d).
+ * If already set to the maximum buffer size, then the resize will fail.
+ *
+ * @param amount
+ * A positive number representing how much to increase the size by.
+ * @param map_multis
+ * The map_multis array to resize.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + amount <= size).
+ *
+ * F_array_too_large (with error bit) if the new array length is too large.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_map_multis_increase_by_
+ extern f_status_t f_utf_string_map_multis_increase_by(const f_array_length_t amount, f_utf_string_map_multis_t * const map_multis);
+#endif // _di_f_utf_string_map_multis_increase_by_
+
+/**
+ * Resize the map_multis array.
+ *
+ * @param length
+ * The new size to use.
+ * @param map_multis
+ * The map_multis array to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_map_multis_resize_
+ extern f_status_t f_utf_string_map_multis_resize(const f_array_length_t length, f_utf_string_map_multis_t * const map_multis);
+#endif // _di_f_utf_string_map_multis_resize_
+
+/**
+ * Resize the map_multiss array.
+ *
+ * @param length
+ * The new size to use.
+ * @param map_multiss
+ * The map_multiss array to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_map_multiss_adjust_
+ extern f_status_t f_utf_string_map_multiss_adjust(const f_array_length_t length, f_utf_string_map_multiss_t * const map_multiss);
+#endif // _di_f_utf_string_map_multiss_adjust_
+
+/**
+ * Append a single source map_multis onto the destination.
+ *
+ * @param source
+ * The source maps to append.
+ * @param destination
+ * The destination maps the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_map_multiss_append_
+ f_status_t f_utf_string_map_multiss_append(const f_utf_string_map_multis_t source, f_utf_string_map_multiss_t *destination);
+#endif // _di_f_utf_string_map_multiss_append_
+
+/**
+ * Append the source map_multiss onto the destination.
+ *
+ * @param source
+ * The source maps to append.
+ * @param destination
+ * The destination maps the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is nothing to append (size == 0).
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_map_multiss_append_all_
+ f_status_t f_utf_string_map_multiss_append_all(const f_utf_string_map_multiss_t source, f_utf_string_map_multiss_t *destination);
+#endif // _di_f_utf_string_map_multiss_append_all_
+
+/**
+ * Resize the map_multiss array to a smaller size.
+ *
+ * This will resize making the array smaller based on (size - given length).
+ * If the given length is too small, then the resize will fail.
+ * This will not shrink the size to less than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decimate the size by.
+ * @param map_multiss
+ * The map_multiss array to resize.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not if amount is 0.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_map_multiss_decimate_by_
+ extern f_status_t f_utf_string_map_multiss_decimate_by(const f_array_length_t amount, f_utf_string_map_multiss_t * const map_multiss);
+#endif // _di_f_utf_string_map_multiss_decimate_by_
+
+/**
+ * Resize the map_multiss array to a smaller size.
+ *
+ * This will resize making the array smaller based on (size - given length).
+ * If the given length is too small, then the resize will fail.
+ * This will not shrink the size to less than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decrease the size by.
+ * @param map_multiss
+ * The map_multiss array to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_map_multiss_decrease_by_
+ extern f_status_t f_utf_string_map_multiss_decrease_by(const f_array_length_t amount, f_utf_string_map_multiss_t * const map_multiss);
+#endif // _di_f_utf_string_map_multiss_decrease_by_
+
+/**
+ * Increase the size of the map_multiss array, but only if necessary.
+ *
+ * If the given length is too large for the buffer, then attempt to set max buffer size (F_array_length_t_size_d).
+ * If already set to the maximum buffer size, then the resize will fail.
+ *
+ * @param step
+ * The allocation step to use.
+ * Must be greater than 0.
+ * @param map_multiss
+ * The map_multiss array to resize.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ *
+ * F_array_too_large (with error bit) if the new array length is too large.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_map_multiss_increase_
+ extern f_status_t f_utf_string_map_multiss_increase(const f_array_length_t step, f_utf_string_map_multiss_t * const map_multiss);
+#endif // _di_f_utf_string_map_multiss_increase_
+
+/**
+ * Resize the map_multiss array to a larger size.
+ *
+ * This will resize making the string larger based on the given length.
+ * If the given length is too large for the buffer, then attempt to set max buffer size (F_array_length_t_size_d).
+ * If already set to the maximum buffer size, then the resize will fail.
+ *
+ * @param amount
+ * A positive number representing how much to increase the size by.
+ * @param map_multiss
+ * The map_multiss array to resize.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + amount <= size).
+ *
+ * F_array_too_large (with error bit) if the new array length is too large.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_map_multiss_increase_by_
+ extern f_status_t f_utf_string_map_multiss_increase_by(const f_array_length_t amount, f_utf_string_map_multiss_t * const map_multiss);
+#endif // _di_f_utf_string_map_multiss_increase_by_
+
+/**
+ * Resize the map_multiss array.
+ *
+ * @param length
+ * The new size to use.
+ * @param map_multiss
+ * The map_multiss array to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_map_multiss_resize_
+ extern f_status_t f_utf_string_map_multiss_resize(const f_array_length_t length, f_utf_string_map_multiss_t * const map_multiss);
+#endif // _di_f_utf_string_map_multiss_resize_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _F_utf_map_multi_h
--- /dev/null
+#include "../utf.h"
+#include "../private-utf.h"
+#include "private-dynamic.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_utf_string_dynamic_adjust_) || !defined(_di_f_utf_string_dynamic_decimate_by_) || !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_)
+ f_status_t private_f_utf_string_dynamic_adjust(const f_array_length_t length, f_utf_string_dynamic_t * const dynamic) {
+
+ const f_status_t status = f_memory_adjust(dynamic->size, length, sizeof(f_char_t), (void **) & dynamic->string);
+ if (F_status_is_error(status)) return status;
+
+ dynamic->size = length;
+
+ if (dynamic->used > dynamic->size) {
+ dynamic->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_dynamic_adjust_) || !defined(_di_f_utf_string_dynamic_decimate_by_) || !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_)
+
+#if !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_)
+ f_status_t private_f_utf_string_dynamic_increase_by(const f_array_length_t amount, f_utf_string_dynamic_t * const dynamic) {
+
+ if (dynamic->used + amount > dynamic->size) {
+ if (dynamic->used + amount > F_string_t_size_d) {
+ return F_status_set_error(F_string_too_large);
+ }
+
+ return private_f_utf_string_dynamic_resize(dynamic->used + amount, dynamic);
+ }
+
+ return F_data_not;
+ }
+#endif // !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_)
+
+#if !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_decrease_by_) || !defined(_di_f_utf_string_dynamic_increase_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(f_utf_string_dynamic_partial_append) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_terminate_) || !defined(_di_f_utf_string_dynamic_terminate_after_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_)
+ f_status_t private_f_utf_string_dynamic_resize(const f_array_length_t length, f_utf_string_dynamic_t * const dynamic) {
+
+ const f_status_t status = f_memory_resize(dynamic->size, length, sizeof(f_char_t), (void **) & dynamic->string);
+ if (F_status_is_error(status)) return status;
+
+ dynamic->size = length;
+
+ if (dynamic->used > dynamic->size) {
+ dynamic->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_decrease_by_) || !defined(_di_f_utf_string_dynamic_increase_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(f_utf_string_dynamic_partial_append) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_terminate_) || !defined(_di_f_utf_string_dynamic_terminate_after_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_)
+
+#if !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_)
+ f_status_t private_f_utf_string_dynamics_adjust(const f_array_length_t length, f_utf_string_dynamics_t * const dynamics) {
+
+ if (dynamics->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < dynamics->size; ++i) {
+
+ status = private_f_utf_string_dynamic_adjust(0, &dynamics->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_adjust(dynamics->size, length, sizeof(f_utf_string_dynamic_t), (void **) & dynamics->array);
+ if (F_status_is_error(status)) return status;
+
+ dynamics->size = length;
+
+ if (dynamics->used > dynamics->size) {
+ dynamics->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_)
+
+#if !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_)
+ f_status_t private_f_utf_string_dynamics_append(const f_utf_string_dynamic_t source, f_utf_string_dynamics_t * const destination) {
+
+ f_status_t status = F_none;
+
+ if (destination->used + 1 > destination->size) {
+ status = private_f_utf_string_dynamics_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used].used = 0;
+
+ if (source.used) {
+ status = private_f_utf_string_append(source.string, source.used, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_)
+
+
+#if !defined(_di_f_utf_string_dynamics_append_all_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_)
+ f_status_t private_f_utf_string_dynamics_append_all(const f_utf_string_dynamics_t source, f_utf_string_dynamics_t * const destination) {
+
+ f_status_t status = F_none;
+
+ if (destination->used + source.used > destination->size) {
+ status = private_f_utf_string_dynamics_resize(destination->used + source.used, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
+
+ destination->array[destination->used].used = 0;
+
+ if (source.array[i].used) {
+ status = private_f_utf_string_append(source.array[i].string, source.array[i].used, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_dynamics_append_all_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_)
+
+#if !defined(_di_f_utf_string_dynamics_decrease_by_) || !defined(_di_f_utf_string_dynamics_increase_) || !defined(_di_f_utf_string_dynamics_increase_by_) || !defined(f_utf_string_map_multis_append)
+ f_status_t private_f_utf_string_dynamics_resize(const f_array_length_t length, f_utf_string_dynamics_t * const dynamics) {
+
+ if (dynamics->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < dynamics->size; ++i) {
+
+ status = private_f_utf_string_dynamic_resize(0, &dynamics->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_resize(dynamics->size, length, sizeof(f_utf_string_dynamic_t), (void **) & dynamics->array);
+ if (F_status_is_error(status)) return status;
+
+ dynamics->size = length;
+
+ if (dynamics->used > dynamics->size) {
+ dynamics->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_dynamics_decrease_by_) || !defined(_di_f_utf_string_dynamics_increase_) || !defined(_di_f_utf_string_dynamics_increase_by_) || !defined(f_utf_string_map_multis_append)
+
+#if !defined(_di_f_utf_string_dynamicss_adjust_) || !defined(_di_f_utf_string_dynamicss_append_) || !defined(_di_f_utf_string_dynamicss_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_)
+ f_status_t private_f_utf_string_dynamicss_adjust(const f_array_length_t length, f_utf_string_dynamicss_t * const dynamicss) {
+
+ if (dynamicss->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < dynamicss->size; ++i) {
+
+ status = private_f_utf_string_dynamics_adjust(0, &dynamicss->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_adjust(dynamicss->size, length, sizeof(f_utf_string_dynamics_t), (void **) & dynamicss->array);
+ if (F_status_is_error(status)) return status;
+
+ dynamicss->size = length;
+
+ if (dynamicss->used > dynamicss->size) {
+ dynamicss->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_dynamicss_adjust_) || !defined(_di_f_utf_string_dynamicss_append_) || !defined(_di_f_utf_string_dynamicss_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_)
+
+#if !defined(_di_f_utf_string_dynamicss_decrease_by_) || !defined(_di_f_utf_string_dynamicss_increase_) || !defined(_di_f_utf_string_dynamicss_increase_by_) || !defined(_di_f_utf_string_dynamicss_append_all_) || !defined(_di_f_utf_string_map_multis_append_all_)
+ f_status_t private_f_utf_string_dynamicss_resize(const f_array_length_t length, f_utf_string_dynamicss_t * const dynamicss) {
+
+ if (dynamicss->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < dynamicss->size; ++i) {
+
+ status = private_f_utf_string_dynamics_resize(0, &dynamicss->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_resize(dynamicss->size, length, sizeof(f_utf_string_dynamics_t), (void **) & dynamicss->array);
+ if (F_status_is_error(status)) return status;
+
+ dynamicss->size = length;
+
+ if (dynamicss->used > dynamicss->size) {
+ dynamicss->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_dynamicss_decrease_by_) || !defined(_di_f_utf_string_dynamicss_increase_) || !defined(_di_f_utf_string_dynamicss_increase_by_) || !defined(_di_f_utf_string_dynamicss_append_all_) || !defined(_di_f_utf_string_map_multis_append_all_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * These are provided for internal reduction in redundant code.
+ * These should not be exposed/used outside of this project.
+ */
+#ifndef _PRIVATE_F_utf_dynamic_h
+#define _PRIVATE_F_utf_dynamic_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation of f_utf_string_append().
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source string to append.
+ * @param length
+ * Length of source to append.
+ * @param destination
+ * The destination string the source and glue are appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_string_too_large (with error bit) if the combined string is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see memcpy()
+ *
+ * @see f_utf_string_append()
+ * @see f_utf_string_append_assure()
+ * @see f_utf_string_dynamic_append()
+ * @see f_utf_string_dynamic_append_assure()
+ * @see f_utf_string_dynamic_mash()
+ * @see f_utf_string_dynamic_partial_append)
+ * @see f_utf_string_dynamic_partial_append_assure()
+ * @see f_utf_string_dynamic_partial_mash()
+ * @see f_utf_string_dynamics_append()
+ * @see f_utf_string_map_multis_append()
+ * @see f_utf_string_mash()
+ * @see f_utf_string_maps_append()
+ * @see f_utf_string_triples_append()
+ */
+#if !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(f_utf_string_dynamic_partial_append) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_triples_append_)
+ extern f_status_t private_f_utf_string_append(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(f_utf_string_dynamic_partial_append) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_triples_append_)
+
+/**
+ * Private implementation of f_utf_string_append_nulless().
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source string to append.
+ * @param length
+ * Length of source to append.
+ * @param destination
+ * The destination string the source and glue are appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_string_too_large (with error bit) if the combined string is too large.
+ *
+ * @see memcpy()
+ *
+ * @see f_utf_string_append_assure_nulless()
+ * @see f_utf_string_append_nulless()
+ * @see f_utf_string_dynamic_append_assure_nulless()
+ * @see f_utf_string_dynamic_append_nulless()
+ * @see f_utf_string_dynamic_mash_nulless()
+ * @see f_utf_string_dynamic_partial_append_assure_nulless()
+ * @see f_utf_string_dynamic_partial_append_nulless()
+ * @see f_utf_string_dynamic_partial_mash_nulless()
+ * @see f_utf_string_mash_nulless()
+ */
+#if !defined(_di_f_utf_string_append_assure_nulless_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mash_nulless_) || !defined(_di_f_utf_string_mash_nulless_)
+ extern f_status_t private_f_utf_string_append_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_append_assure_nulless_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mash_nulless_) || !defined(_di_f_utf_string_mash_nulless_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param dynamic
+ * The string to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_utf_string_dynamic_adjust()
+ * @see f_utf_string_dynamic_decimate_by()
+ * @see f_utf_string_dynamics_adjust()
+ * @see f_utf_string_dynamics_append()
+ * @see f_utf_string_dynamics_decimate_by()
+ * @see f_utf_string_map_multis_adjust()
+ * @see f_utf_string_map_multis_append()
+ * @see f_utf_string_triples_adjust()
+ * @see f_utf_string_triples_decimate_by()
+ */
+#if !defined(_di_f_utf_string_dynamic_adjust_) || !defined(_di_f_utf_string_dynamic_decimate_by_) || !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_)
+ extern f_status_t private_f_utf_string_dynamic_adjust(const f_array_length_t length, f_utf_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_dynamic_adjust_) || !defined(_di_f_utf_string_dynamic_decimate_by_) || !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_)
+
+/**
+ * Private implementation of f_utf_string_dynamic_increase_by().
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param amount
+ * A positive number representing how much to increase the size by.
+ * @param dynamic
+ * The string to resize.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + amount <= size).
+ *
+ * F_string_too_large (with error bit) if the combined string is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see memcpy()
+ *
+ * @see f_utf_string_append()
+ * @see f_utf_string_append_assure()
+ * @see f_utf_string_append_mash()
+ * @see f_utf_string_append_nulless()
+ * @see f_utf_string_dynamic_append()
+ * @see f_utf_string_dynamic_append_assure()
+ * @see f_utf_string_dynamic_append_nulless()
+ * @see f_utf_string_dynamic_increase_by()
+ * @see f_utf_string_dynamic_mash()
+ * @see f_utf_string_dynamic_mash_nulless()
+ * @see f_utf_string_dynamic_partial_append)
+ * @see f_utf_string_dynamic_partial_append_assure()
+ * @see f_utf_string_dynamic_partial_mash()
+ * @see f_utf_string_dynamic_prepend()
+ * @see f_utf_string_dynamic_prepend_nulless()
+ * @see f_utf_string_dynamics_append()
+ * @see f_utf_string_map_multis_append()
+ * @see f_utf_string_mash()
+ * @see f_utf_string_mash_nulless()
+ * @see f_utf_string_maps_append()
+ * @see f_utf_string_prepend()
+ * @see f_utf_string_prepend_nulless()
+ * @see f_utf_string_triples_append()
+ */
+#if !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_)
+ extern f_status_t private_f_utf_string_dynamic_increase_by(const f_array_length_t amount, f_utf_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param dynamic
+ * The string to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_utf_string_append()
+ * @see f_utf_string_append_assure()
+ * @see f_utf_string_append_mash()
+ * @see f_utf_string_append_nulless()
+ * @see f_utf_string_dynamic_append()
+ * @see f_utf_string_dynamic_append_assure()
+ * @see f_utf_string_dynamic_append_nulless()
+ * @see f_utf_string_dynamic_decrease_by()
+ * @see f_utf_string_dynamic_increase()
+ * @see f_utf_string_dynamic_increase_by()
+ * @see f_utf_string_dynamic_mash()
+ * @see f_utf_string_dynamic_mash_nulless()
+ * @see f_utf_string_dynamic_partial_append)
+ * @see f_utf_string_dynamic_partial_append_assure()
+ * @see f_utf_string_dynamic_partial_mash()
+ * @see f_utf_string_dynamic_prepend()
+ * @see f_utf_string_dynamic_prepend_nulless()
+ * @see f_utf_string_dynamic_terminate()
+ * @see f_utf_string_dynamic_terminate_after()
+ * @see f_utf_string_dynamics_append()
+ * @see f_utf_string_map_multis_append()
+ * @see f_utf_string_mash_nulless()
+ * @see f_utf_string_mash()
+ * @see f_utf_string_maps_append()
+ * @see f_utf_string_prepend()
+ * @see f_utf_string_prepend_nulless()
+ * @see f_utf_string_triples_append()
+ */
+#if !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_decrease_by_) || !defined(_di_f_utf_string_dynamic_increase_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(f_utf_string_dynamic_partial_append) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_terminate_) || !defined(_di_f_utf_string_dynamic_terminate_after_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_)
+ extern f_status_t private_f_utf_string_dynamic_resize(const f_array_length_t length, f_utf_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_decrease_by_) || !defined(_di_f_utf_string_dynamic_increase_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(f_utf_string_dynamic_partial_append) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_terminate_) || !defined(_di_f_utf_string_dynamic_terminate_after_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param dynamics
+ * The strings to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_utf_string_dynamics_adjust()
+ * @see f_utf_string_dynamics_append()
+ * @see f_utf_string_dynamics_decimate_by()
+ * @see f_utf_string_map_multis_adjust()
+ * @see f_utf_string_map_multis_append()
+ */
+#if !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_)
+ extern f_status_t private_f_utf_string_dynamics_adjust(const f_array_length_t length, f_utf_string_dynamics_t * const dynamics) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_)
+
+/**
+ * Private implementation for appending.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source string to append.
+ * @param destination
+ * The destination strings the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_utf_string_dynamics_append()
+ * @see f_utf_string_map_multis_append()
+ * @see f_utf_string_map_multis_append_all()
+ */
+#if !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_)
+ extern f_status_t private_f_utf_string_dynamics_append(const f_utf_string_dynamic_t source, f_utf_string_dynamics_t * const destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_)
+
+/**
+ * Private implementation for appending.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source strings to append.
+ * @param destination
+ * The destination strings the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_utf_string_dynamics_append_all()
+ * @see f_utf_string_map_multis_append()
+ * @see f_utf_string_map_multis_append_all()
+ */
+#if !defined(_di_f_utf_string_dynamics_append_all_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_)
+ extern f_status_t private_f_utf_string_dynamics_append_all(const f_utf_string_dynamics_t source, f_utf_string_dynamics_t * const destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_dynamics_append_all_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param dynamics
+ * The strings to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_utf_string_dynamics_decrease_by()
+ * @see f_utf_string_dynamics_increase()
+ * @see f_utf_string_dynamics_increase_by()
+ */
+#if !defined(_di_f_utf_string_dynamics_decrease_by_) || !defined(_di_f_utf_string_dynamics_increase_) || !defined(_di_f_utf_string_dynamics_increase_by_)
+ extern f_status_t private_f_utf_string_dynamics_resize(const f_array_length_t length, f_utf_string_dynamics_t * const dynamics) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_dynamics_decrease_by_) || !defined(_di_f_utf_string_dynamics_increase_) || !defined(_di_f_utf_string_dynamics_increase_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param dynamicss
+ * The strings to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_utf_string_dynamicss_adjust()
+ * @see f_utf_string_dynamicss_append()
+ * @see f_utf_string_dynamicss_decimate_by()
+ * @see f_utf_string_map_multis_adjust()
+ * @see f_utf_string_map_multis_append()
+ */
+#if !defined(_di_f_utf_string_dynamicss_adjust_) || !defined(_di_f_utf_string_dynamicss_append_) || !defined(_di_f_utf_string_dynamicss_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_)
+ extern f_status_t private_f_utf_string_dynamicss_adjust(const f_array_length_t length, f_utf_string_dynamicss_t * const dynamicss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_dynamicss_adjust_) || !defined(_di_f_utf_string_dynamicss_append_) || !defined(_di_f_utf_string_dynamicss_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param dynamicss
+ * The strings to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_utf_string_dynamicss_append_all()
+ * @see f_utf_string_dynamicss_decrease_by()
+ * @see f_utf_string_dynamicss_increase()
+ * @see f_utf_string_dynamicss_increase_by()
+ * @see f_utf_string_map_multis_append_all()
+ */
+#if !defined(_di_f_utf_string_dynamicss_decrease_by_) || !defined(_di_f_utf_string_dynamicss_increase_) || !defined(_di_f_utf_string_dynamicss_increase_by_) || !defined(_di_f_utf_string_dynamicss_append_all_) || !defined(_di_f_utf_string_map_multis_append_all_)
+ extern f_status_t private_f_utf_string_dynamicss_resize(const f_array_length_t length, f_utf_string_dynamicss_t * const dynamicss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_dynamicss_decrease_by_) || !defined(_di_f_utf_string_dynamicss_increase_) || !defined(_di_f_utf_string_dynamicss_increase_by_) || !defined(_di_f_utf_string_dynamicss_append_all_) || !defined(_di_f_utf_string_map_multis_append_all_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_utf_dynamic_h
--- /dev/null
+#include "../utf.h"
+#include "../private-utf.h"
+#include "private-dynamic.h"
+#include "private-map.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_utf_string_maps_adjust_) || !defined(_di_f_utf_string_maps_decimate_by_)
+ f_status_t private_f_utf_string_maps_adjust(const f_array_length_t length, f_utf_string_maps_t * const maps) {
+
+ if (maps->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < maps->size; ++i) {
+
+ status = private_f_utf_string_dynamic_adjust(0, &maps->array[i].name);
+ if (F_status_is_error(status)) return status;
+
+ status = private_f_utf_string_dynamic_adjust(0, &maps->array[i].value);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_adjust(maps->size, length, sizeof(f_utf_string_map_t), (void **) & maps->array);
+ if (F_status_is_error(status)) return status;
+
+ maps->size = length;
+
+ if (maps->used > maps->size) {
+ maps->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_maps_adjust_) || !defined(_di_f_utf_string_maps_decimate_by_)
+
+#if !defined(_di_f_utf_string_maps_append_all_) || !defined(_di_f_utf_string_mapss_append_) || !defined(_di_f_utf_string_mapss_append_all_)
+ f_status_t private_f_utf_string_maps_append_all(const f_utf_string_maps_t source, f_utf_string_maps_t * const destination) {
+
+ f_status_t status = F_none;
+
+ if (destination->used + source.used > destination->size) {
+ status = private_f_utf_string_maps_resize(destination->used + source.used, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
+
+ destination->array[destination->used].name.used = 0;
+ destination->array[destination->used].value.used = 0;
+
+ if (source.array[i].name.used) {
+ status = private_f_utf_string_append(source.array[i].name.string, source.array[i].name.used, &destination->array[destination->used].name);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.array[i].value.used) {
+ status = private_f_utf_string_append(source.array[i].value.string, source.array[i].value.used, &destination->array[destination->used].value);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_maps_append_all_) || !defined(_di_f_utf_string_mapss_append_) || !defined(_di_f_utf_string_mapss_append_all_)
+
+#if !defined(_di_f_utf_string_maps_decrease_by_) || !defined(_di_f_utf_string_maps_increase_) || !defined(_di_f_utf_string_maps_increase_by_) || !defined(_di_f_utf_string_maps_terminate_) || !defined(_di_f_utf_string_maps_terminate_after_)
+ f_status_t private_f_utf_string_maps_resize(const f_array_length_t length, f_utf_string_maps_t * const maps) {
+
+ if (maps->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < maps->size; ++i) {
+
+ status = private_f_utf_string_dynamic_resize(0, &maps->array[i].name);
+ if (F_status_is_error(status)) return status;
+
+ status = private_f_utf_string_dynamic_resize(0, &maps->array[i].value);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_resize(maps->size, length, sizeof(f_utf_string_map_t), (void **) & maps->array);
+ if (F_status_is_error(status)) return status;
+
+ maps->size = length;
+
+ if (maps->used > maps->size) {
+ maps->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_maps_decrease_by_) || !defined(_di_f_utf_string_maps_increase_) || !defined(_di_f_utf_string_maps_increase_by_) || !defined(_di_f_utf_string_maps_terminate_) || !defined(_di_f_utf_string_maps_terminate_after_)
+
+#if !defined(_di_f_utf_string_mapss_adjust_) || !defined(_di_f_utf_string_mapss_decimate_by_)
+ f_status_t private_f_utf_string_mapss_adjust(const f_array_length_t length, f_utf_string_mapss_t * const mapss) {
+
+ if (mapss->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < mapss->size; ++i) {
+
+ status = private_f_utf_string_maps_adjust(0, &mapss->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_adjust(mapss->size, length, sizeof(f_utf_string_maps_t), (void **) & mapss->array);
+ if (F_status_is_error(status)) return status;
+
+ mapss->size = length;
+
+ if (mapss->used > mapss->size) {
+ mapss->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_mapss_adjust_) || !defined(_di_f_utf_string_mapss_decimate_by_)
+
+#if !defined(_di_f_utf_string_mapss_decrease_by_) || !defined(_di_f_utf_string_mapss_increase_) || !defined(_di_f_utf_string_mapss_increase_by_) || !defined(_di_f_utf_string_mapss_terminate_) || !defined(_di_f_utf_string_mapss_terminate_after_)
+ f_status_t private_f_utf_string_mapss_resize(const f_array_length_t length, f_utf_string_mapss_t * const mapss) {
+
+ if (mapss->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < mapss->size; ++i) {
+
+ status = private_f_utf_string_maps_resize(0, &mapss->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_resize(mapss->size, length, sizeof(f_utf_string_maps_t), (void **) & mapss->array);
+ if (F_status_is_error(status)) return status;
+
+ mapss->size = length;
+
+ if (mapss->used > mapss->size) {
+ mapss->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_mapss_decrease_by_) || !defined(_di_f_utf_string_mapss_increase_) || !defined(_di_f_utf_string_mapss_increase_by_) || !defined(_di_f_utf_string_mapss_terminate_) || !defined(_di_f_utf_string_mapss_terminate_after_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * These are provided for internal reduction in redundant code.
+ * These should not be exposed/used outside of this project.
+ */
+#ifndef _PRIVATE_F_utf_map_h
+#define _PRIVATE_F_utf_map_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param maps
+ * The maps to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_utf_string_maps_adjust()
+ */
+#if !defined(_di_f_utf_string_maps_adjust_) || !defined(_di_f_utf_string_maps_decimate_by_)
+ extern f_status_t private_f_utf_string_maps_adjust(const f_array_length_t length, f_utf_string_maps_t * const maps) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_maps_adjust_) || !defined(_di_f_utf_string_maps_decimate_by_)
+
+/**
+ * Private implementation for appending.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source maps to append.
+ * @param destination
+ * The destination maps the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_utf_string_maps_append_all()
+ * @see f_utf_string_mapss_append()
+ * @see f_utf_string_mapss_append_all()
+ */
+#if !defined(_di_f_utf_string_maps_append_all_) || !defined(_di_f_utf_string_mapss_append_) || !defined(_di_f_utf_string_mapss_append_all_)
+ extern f_status_t private_f_utf_string_maps_append_all(const f_utf_string_maps_t source, f_utf_string_maps_t * const destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_maps_append_all_) || !defined(_di_f_utf_string_mapss_append_) || !defined(_di_f_utf_string_mapss_append_all_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param maps
+ * The maps to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_adjust()
+ * @see f_utf_string_maps_decrease_by()
+ * @see f_utf_string_maps_increase()
+ * @see f_utf_string_maps_increase_by()
+ * @see f_utf_string_maps_terminate()
+ * @see f_utf_string_maps_terminate_after()
+ */
+#if !defined(_di_f_utf_string_maps_decrease_by_) || !defined(_di_f_utf_string_maps_increase_) || !defined(_di_f_utf_string_maps_increase_by_) || !defined(_di_f_utf_string_maps_terminate_) || !defined(_di_f_utf_string_maps_terminate_after_)
+ extern f_status_t private_f_utf_string_maps_resize(const f_array_length_t length, f_utf_string_maps_t * const maps) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_maps_decrease_by_) || !defined(_di_f_utf_string_maps_increase_) || !defined(_di_f_utf_string_maps_increase_by_) || !defined(_di_f_utf_string_maps_terminate_) || !defined(_di_f_utf_string_maps_terminate_after_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param mapss
+ * The mapss to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_utf_string_mapss_adjust()
+ */
+#if !defined(_di_f_utf_string_mapss_adjust_) || !defined(_di_f_utf_string_mapss_decimate_by_)
+ extern f_status_t private_f_utf_string_mapss_adjust(const f_array_length_t length, f_utf_string_mapss_t * const mapss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_mapss_adjust_) || !defined(_di_f_utf_string_mapss_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param mapss
+ * The mapss to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_adjust()
+ * @see f_utf_string_mapss_decrease_by()
+ * @see f_utf_string_mapss_increase()
+ * @see f_utf_string_mapss_increase_by()
+ * @see f_utf_string_mapss_terminate()
+ * @see f_utf_string_mapss_terminate_after()
+ */
+#if !defined(_di_f_utf_string_mapss_decrease_by_) || !defined(_di_f_utf_string_mapss_increase_) || !defined(_di_f_utf_string_mapss_increase_by_) || !defined(_di_f_utf_string_mapss_terminate_) || !defined(_di_f_utf_string_mapss_terminate_after_)
+ extern f_status_t private_f_utf_string_mapss_resize(const f_array_length_t length, f_utf_string_mapss_t * const mapss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_mapss_decrease_by_) || !defined(_di_f_utf_string_mapss_increase_) || !defined(_di_f_utf_string_mapss_increase_by_) || !defined(_di_f_utf_string_mapss_terminate_) || !defined(_di_f_utf_string_mapss_terminate_after_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_utf_map_h
--- /dev/null
+#include "../utf.h"
+#include "../private-utf.h"
+#include "private-dynamic.h"
+#include "private-map_multi.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_decimate_by_)
+ f_status_t private_f_utf_string_map_multis_adjust(const f_array_length_t length, f_utf_string_map_multis_t * const map_multis) {
+
+ if (map_multis->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < map_multis->size; ++i) {
+
+ status = private_f_utf_string_dynamic_adjust(0, &map_multis->array[i].name);
+ if (F_status_is_error(status)) return status;
+
+ status = private_f_utf_string_dynamics_adjust(0, &map_multis->array[i].value);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_adjust(map_multis->size, length, sizeof(f_utf_string_map_multi_t), (void **) & map_multis->array);
+ if (F_status_is_error(status)) return status;
+
+ map_multis->size = length;
+
+ if (map_multis->used > map_multis->size) {
+ map_multis->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_decimate_by_)
+
+#if !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_)
+ f_status_t private_f_utf_string_map_multis_append_all(const f_utf_string_map_multis_t source, f_utf_string_map_multis_t * const destination) {
+
+ f_status_t status = F_none;
+
+ if (destination->used + source.used > destination->size) {
+ status = private_f_utf_string_map_multis_resize(destination->used + source.used, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
+
+ destination->array[destination->used].name.used = 0;
+ destination->array[destination->used].value.used = 0;
+
+ if (source.array[i].name.used) {
+ status = private_f_utf_string_append(source.array[i].name.string, source.array[i].name.used, &destination->array[destination->used].name);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.array[i].value.used) {
+ status = private_f_utf_string_dynamics_append_all(source.array[i].value, &destination->array[destination->used].value);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_)
+
+#if !defined(_di_f_utf_string_map_multis_decrease_by_) || !defined(_di_f_utf_string_map_multis_increase_) || !defined(_di_f_utf_string_map_multis_increase_by_) || !defined(_di_f_utf_string_map_multis_terminate_) || !defined(_di_f_utf_string_map_multis_terminate_after_)
+ f_status_t private_f_utf_string_map_multis_resize(const f_array_length_t length, f_utf_string_map_multis_t * const map_multis) {
+
+ if (map_multis->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < map_multis->size; ++i) {
+
+ status = private_f_utf_string_dynamic_resize(0, &map_multis->array[i].name);
+ if (F_status_is_error(status)) return status;
+
+ status = private_f_utf_string_dynamics_resize(0, &map_multis->array[i].value);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_resize(map_multis->size, length, sizeof(f_utf_string_map_multi_t), (void **) & map_multis->array);
+ if (F_status_is_error(status)) return status;
+
+ map_multis->size = length;
+
+ if (map_multis->used > map_multis->size) {
+ map_multis->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_map_multis_decrease_by_) || !defined(_di_f_utf_string_map_multis_increase_) || !defined(_di_f_utf_string_map_multis_increase_by_) || !defined(_di_f_utf_string_map_multis_terminate_) || !defined(_di_f_utf_string_map_multis_terminate_after_)
+
+#if !defined(_di_f_utf_string_map_multiss_adjust_) || !defined(_di_f_utf_string_map_multiss_decimate_by_)
+ f_status_t private_f_utf_string_map_multiss_adjust(const f_array_length_t length, f_utf_string_map_multiss_t * const map_multiss) {
+
+ if (map_multiss->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < map_multiss->size; ++i) {
+
+ status = private_f_utf_string_map_multis_adjust(0, &map_multiss->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_adjust(map_multiss->size, length, sizeof(f_utf_string_map_multis_t), (void **) & map_multiss->array);
+ if (F_status_is_error(status)) return status;
+
+ map_multiss->size = length;
+
+ if (map_multiss->used > map_multiss->size) {
+ map_multiss->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_map_multiss_adjust_) || !defined(_di_f_utf_string_map_multiss_decimate_by_)
+
+#if !defined(_di_f_utf_string_map_multiss_decrease_by_) || !defined(_di_f_utf_string_map_multiss_increase_) || !defined(_di_f_utf_string_map_multiss_increase_by_) || !defined(_di_f_utf_string_map_multiss_terminate_) || !defined(_di_f_utf_string_map_multiss_terminate_after_)
+ f_status_t private_f_utf_string_map_multiss_resize(const f_array_length_t length, f_utf_string_map_multiss_t * const map_multiss) {
+
+ if (map_multiss->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < map_multiss->size; ++i) {
+
+ status = private_f_utf_string_map_multis_resize(0, &map_multiss->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_resize(map_multiss->size, length, sizeof(f_utf_string_map_multis_t), (void **) & map_multiss->array);
+ if (F_status_is_error(status)) return status;
+
+ map_multiss->size = length;
+
+ if (map_multiss->used > map_multiss->size) {
+ map_multiss->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_map_multiss_decrease_by_) || !defined(_di_f_utf_string_map_multiss_increase_) || !defined(_di_f_utf_string_map_multiss_increase_by_) || !defined(_di_f_utf_string_map_multiss_terminate_) || !defined(_di_f_utf_string_map_multiss_terminate_after_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * These are provided for internal reduction in redundant code.
+ * These should not be exposed/used outside of this project.
+ */
+#ifndef _PRIVATE_F_map_multi_h
+#define _PRIVATE_F_map_multi_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param map_multis
+ * The map_multis to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_utf_string_map_multis_adjust()
+ */
+#if !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_decimate_by_)
+ extern f_status_t private_f_utf_string_map_multis_adjust(const f_array_length_t length, f_utf_string_map_multis_t * const map_multis) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_decimate_by_)
+
+/**
+ * Private implementation for appending.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source map_multis to append.
+ * @param destination
+ * The destination map_multis the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_utf_string_map_multis_append_all()
+ * @see f_utf_string_map_multiss_append()
+ * @see f_utf_string_map_multiss_append_all()
+ */
+#if !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_)
+ extern f_status_t private_f_utf_string_map_multis_append_all(const f_utf_string_map_multis_t source, f_utf_string_map_multis_t * const destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param map_multis
+ * The map_multis to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_adjust()
+ * @see f_utf_string_map_multis_decrease_by()
+ * @see f_utf_string_map_multis_increase()
+ * @see f_utf_string_map_multis_increase_by()
+ * @see f_utf_string_map_multis_terminate()
+ * @see f_utf_string_map_multis_terminate_after()
+ */
+#if !defined(_di_f_utf_string_map_multis_decrease_by_) || !defined(_di_f_utf_string_map_multis_increase_) || !defined(_di_f_utf_string_map_multis_increase_by_) || !defined(_di_f_utf_string_map_multis_terminate_) || !defined(_di_f_utf_string_map_multis_terminate_after_)
+ extern f_status_t private_f_utf_string_map_multis_resize(const f_array_length_t length, f_utf_string_map_multis_t * const map_multis) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_map_multis_decrease_by_) || !defined(_di_f_utf_string_map_multis_increase_) || !defined(_di_f_utf_string_map_multis_increase_by_) || !defined(_di_f_utf_string_map_multis_terminate_) || !defined(_di_f_utf_string_map_multis_terminate_after_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param map_multiss
+ * The map_multiss to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_utf_string_map_multiss_adjust()
+ */
+#if !defined(_di_f_utf_string_map_multiss_adjust_) || !defined(_di_f_utf_string_map_multiss_decimate_by_)
+ extern f_status_t private_f_utf_string_map_multiss_adjust(const f_array_length_t length, f_utf_string_map_multiss_t * const map_multiss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_map_multiss_adjust_) || !defined(_di_f_utf_string_map_multiss_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param map_multiss
+ * The map_multiss to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_adjust()
+ * @see f_utf_string_map_multiss_decrease_by()
+ * @see f_utf_string_map_multiss_increase()
+ * @see f_utf_string_map_multiss_increase_by()
+ * @see f_utf_string_map_multiss_terminate()
+ * @see f_utf_string_map_multiss_terminate_after()
+ */
+#if !defined(_di_f_utf_string_map_multiss_decrease_by_) || !defined(_di_f_utf_string_map_multiss_increase_) || !defined(_di_f_utf_string_map_multiss_increase_by_) || !defined(_di_f_utf_string_map_multiss_terminate_) || !defined(_di_f_utf_string_map_multiss_terminate_after_)
+ extern f_status_t private_f_utf_string_map_multiss_resize(const f_array_length_t length, f_utf_string_map_multiss_t * const map_multiss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_map_multiss_decrease_by_) || !defined(_di_f_utf_string_map_multiss_increase_) || !defined(_di_f_utf_string_map_multiss_increase_by_) || !defined(_di_f_utf_string_map_multiss_terminate_) || !defined(_di_f_utf_string_map_multiss_terminate_after_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_map_multi_h
#include "../utf.h"
+#include "private-dynamic.h"
#include "private-string.h"
#ifdef __cplusplus
#endif
#if !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(f_utf_string_dynamic_partial_append) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_triples_append_)
- f_status_t private_f_utf_string_append(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination) {
+ f_status_t private_f_utf_string_append(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) {
- if (destination->used + length > destination->size) {
- const f_status_t status = private_f_utf_string_dynamic_increase_by(length, destination);
+ if (destination->used + length + 1 > destination->size) {
+ const f_status_t status = private_f_utf_string_dynamic_increase_by(length + 1, destination);
if (F_status_is_error(status)) return status;
}
- memcpy(destination->string + destination->used, source, sizeof(f_char_t) * length);
- destination->used = destination->used + length;
+ memcpy(destination->string + destination->used, source, sizeof(f_utf_character_t) * length);
+ destination->used += length;
+ destination->string[destination->used] = 0;
return F_none;
}
#endif // !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(f_utf_string_dynamic_partial_append) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_triples_append_)
#if !defined(_di_f_utf_string_append_assure_nulless_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mash_nulless_) || !defined(_di_f_utf_string_mash_nulless_)
- f_status_t private_f_utf_string_append_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination) {
-
- if (destination->used + length > F_string_t_size_d) {
- return F_status_set_error(F_string_too_large);
- }
+ f_status_t private_f_utf_string_append_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) {
f_status_t status = F_none;
f_array_length_t i = 0;
- f_array_length_t first = 0;
f_array_length_t size = 0;
+ // Count all of the NULLs and subtract them from the total size.
for (; i < length; ++i) {
+ if (source[i]) ++size;
+ } // for
+
+ if (destination->used + size + 1 > destination->size) {
+ status = private_f_utf_string_dynamic_increase_by(size + 1, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ f_array_length_t first = 0;
+
+ for (i = 0, size = 0; i < length; ++i) {
if (source[i]) continue;
if (i && i > first) {
size = i - first;
- if (destination->used + size > destination->size) {
- status = private_f_utf_string_dynamic_increase_by(size, destination);
- if (F_status_is_error(status)) return status;
- }
-
- memcpy(destination->string + destination->used, source + first, sizeof(f_char_t) * size);
- destination->used = destination->used + size;
+ memcpy(destination->string + destination->used, source + first, sizeof(f_utf_character_t) * size);
+ destination->used += size;
}
while (i + 1 < length && !source[i + 1]) {
if (i > first) {
size = i - first;
- if (destination->used + size > destination->size) {
- status = private_f_utf_string_dynamic_increase_by(size, destination);
- if (F_status_is_error(status)) return status;
- }
-
- memcpy(destination->string + destination->used, source + first, sizeof(f_char_t) * size);
- destination->used = destination->used + size;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_utf_string_append_assure_nulless_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mash_nulless_) || !defined(_di_f_utf_string_mash_nulless_)
-
-#if !defined(_di_f_utf_string_dynamic_adjust_) || !defined(_di_f_utf_string_dynamic_decimate_by_) || !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_)
- f_status_t private_f_utf_string_dynamic_adjust(const f_array_length_t length, f_utf_string_dynamic_t *dynamic) {
-
- const f_status_t status = f_memory_adjust(dynamic->size, length, sizeof(f_utf_string_t), (void **) & dynamic->string);
- if (F_status_is_error(status)) return status;
-
- dynamic->size = length;
-
- if (dynamic->used > dynamic->size) {
- dynamic->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_utf_string_dynamic_adjust_) || !defined(_di_f_utf_string_dynamic_decimate_by_) || !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_)
-
-#if !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_)
- f_status_t private_f_utf_string_dynamic_increase_by(const f_array_length_t amount, f_utf_string_dynamic_t *dynamic) {
-
- if (dynamic->used + amount > dynamic->size) {
- if (dynamic->used + amount > F_string_t_size_d) {
- return F_status_set_error(F_string_too_large);
- }
-
- return private_f_utf_string_dynamic_resize(dynamic->used + amount, dynamic);
- }
-
- return F_data_not;
- }
-#endif // !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_)
-
-#if !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_decrease_by_) || !defined(_di_f_utf_string_dynamic_increase_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(f_utf_string_dynamic_partial_append) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_terminate_) || !defined(_di_f_utf_string_dynamic_terminate_after_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_)
- f_status_t private_f_utf_string_dynamic_resize(const f_array_length_t length, f_utf_string_dynamic_t *dynamic) {
-
- const f_status_t status = f_memory_resize(dynamic->size, length, sizeof(f_utf_string_t), (void **) & dynamic->string);
- if (F_status_is_error(status)) return status;
-
- dynamic->size = length;
-
- if (dynamic->used > dynamic->size) {
- dynamic->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_decrease_by_) || !defined(_di_f_utf_string_dynamic_increase_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(f_utf_string_dynamic_partial_append) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_terminate_) || !defined(_di_f_utf_string_dynamic_terminate_after_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_)
-
-#if !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_)
- f_status_t private_f_utf_string_dynamics_adjust(const f_array_length_t length, f_utf_string_dynamics_t *dynamics) {
-
- if (dynamics->used + length > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- f_status_t status = F_none;
-
- for (f_array_length_t i = length; i < dynamics->size; ++i) {
-
- status = private_f_utf_string_dynamic_adjust(0, &dynamics->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(dynamics->size, length, sizeof(f_utf_string_dynamic_t), (void **) & dynamics->array);
- if (F_status_is_error(status)) return status;
-
- dynamics->size = length;
-
- if (dynamics->used > dynamics->size) {
- dynamics->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_)
-
-#if !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_)
- f_status_t private_f_utf_string_dynamics_append(const f_utf_string_dynamics_t source, f_utf_string_dynamics_t *destination) {
-
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_utf_string_dynamics_adjust(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
-
- for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
-
- destination->array[destination->used].used = 0;
-
- if (source.array[i].used) {
- status = private_f_utf_string_append(source.array[i].string, source.array[i].used, &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
- }
- } // for
-
- return F_none;
- }
-#endif // !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_)
-
-#if !defined(_di_f_utf_string_dynamics_decrease_by_) || !defined(_di_f_utf_string_dynamics_increase_) || !defined(_di_f_utf_string_dynamics_increase_by_)
- f_status_t private_f_utf_string_dynamics_resize(const f_array_length_t length, f_utf_string_dynamics_t *dynamics) {
-
- if (dynamics->used + length > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- f_status_t status = F_none;
-
- for (f_array_length_t i = length; i < dynamics->size; ++i) {
- status = private_f_utf_string_dynamic_resize(0, &dynamics->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(dynamics->size, length, sizeof(f_utf_string_dynamic_t), (void **) & dynamics->array);
- if (F_status_is_error(status)) return status;
-
- dynamics->size = length;
-
- if (dynamics->used > dynamics->size) {
- dynamics->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_utf_string_dynamics_decrease_by_) || !defined(_di_f_utf_string_dynamics_increase_) || !defined(_di_f_utf_string_dynamics_increase_by_)
-
-#if !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_decimate_by_)
- f_status_t private_f_utf_string_map_multis_adjust(const f_array_length_t length, f_utf_string_map_multis_t *map_multis) {
-
- if (map_multis->used + length > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- f_status_t status = F_none;
-
- for (f_array_length_t i = length; i < map_multis->size; ++i) {
-
- status = private_f_utf_string_dynamic_adjust(0, &map_multis->array[i].name);
- if (F_status_is_error(status)) return status;
-
- status = private_f_utf_string_dynamics_adjust(0, &map_multis->array[i].value);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(map_multis->size, length, sizeof(f_utf_string_map_multi_t), (void **) & map_multis->array);
- if (F_status_is_error(status)) return status;
-
- map_multis->size = length;
-
- if (map_multis->used > map_multis->size) {
- map_multis->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_decimate_by_)
-
-#if !defined(_di_f_utf_string_map_multis_decrease_by_) || !defined(_di_f_utf_string_map_multis_increase_) || !defined(_di_f_utf_string_map_multis_increase_by_) || !defined(_di_f_utf_string_map_multis_terminate_) || !defined(_di_f_utf_string_map_multis_terminate_after_)
- f_status_t private_f_utf_string_map_multis_resize(const f_array_length_t length, f_utf_string_map_multis_t *map_multis) {
-
- if (map_multis->used + length > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- f_status_t status = F_none;
-
- for (f_array_length_t i = length; i < map_multis->size; ++i) {
-
- status = private_f_utf_string_dynamic_resize(0, &map_multis->array[i].name);
- if (F_status_is_error(status)) return status;
-
- status = private_f_utf_string_dynamics_resize(0, &map_multis->array[i].value);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(map_multis->size, length, sizeof(f_utf_string_map_multi_t), (void **) & map_multis->array);
- if (F_status_is_error(status)) return status;
-
- map_multis->size = length;
-
- if (map_multis->used > map_multis->size) {
- map_multis->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_utf_string_map_multis_decrease_by_) || !defined(_di_f_utf_string_map_multis_increase_) || !defined(_di_f_utf_string_map_multis_increase_by_) || !defined(_di_f_utf_string_map_multis_terminate_) || !defined(_di_f_utf_string_map_multis_terminate_after_)
-
-#if !defined(_di_f_utf_string_maps_adjust_) || !defined(_di_f_utf_string_maps_decimate_by_)
- f_status_t private_f_utf_string_maps_adjust(const f_array_length_t length, f_utf_string_maps_t *maps) {
-
- if (maps->used + length > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
+ memcpy(destination->string + destination->used, source + first, sizeof(f_utf_character_t) * size);
+ destination->used += size;
}
- f_status_t status = F_none;
-
- for (f_array_length_t i = length; i < maps->size; ++i) {
-
- status = private_f_utf_string_dynamic_adjust(0, &maps->array[i].name);
- if (F_status_is_error(status)) return status;
-
- status = private_f_utf_string_dynamic_adjust(0, &maps->array[i].value);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(maps->size, length, sizeof(f_utf_string_map_t), (void **) & maps->array);
- if (F_status_is_error(status)) return status;
-
- maps->size = length;
-
- if (maps->used > maps->size) {
- maps->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_utf_string_maps_adjust_) || !defined(_di_f_utf_string_maps_decimate_by_)
-
-#if !defined(_di_f_utf_string_maps_decrease_by_) || !defined(_di_f_utf_string_maps_increase_) || !defined(_di_f_utf_string_maps_increase_by_) || !defined(_di_f_utf_string_maps_terminate_) || !defined(_di_f_utf_string_maps_terminate_after_)
- f_status_t private_f_utf_string_maps_resize(const f_array_length_t length, f_utf_string_maps_t *maps) {
-
- if (maps->used + length > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- f_status_t status = F_none;
-
- for (f_array_length_t i = length; i < maps->size; ++i) {
-
- status = private_f_utf_string_dynamic_resize(0, &maps->array[i].name);
- if (F_status_is_error(status)) return status;
-
- status = private_f_utf_string_dynamic_resize(0, &maps->array[i].value);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(maps->size, length, sizeof(f_utf_string_map_t), (void **) & maps->array);
- if (F_status_is_error(status)) return status;
-
- maps->size = length;
-
- if (maps->used > maps->size) {
- maps->used = length;
- }
+ destination->string[destination->used] = 0;
return F_none;
}
-#endif // !defined(_di_f_utf_string_maps_decrease_by_) || !defined(_di_f_utf_string_maps_increase_) || !defined(_di_f_utf_string_maps_increase_by_) || !defined(_di_f_utf_string_maps_terminate_) || !defined(_di_f_utf_string_maps_terminate_after_)
+#endif // !defined(_di_f_utf_string_append_assure_nulless_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mash_nulless_) || !defined(_di_f_utf_string_mash_nulless_)
#if !defined(_di_f_utf_string_dynamic_mish_) || !defined(_di_f_utf_string_dynamic_partial_mish_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_) || !defined(_di_f_utf_string_dynamic_partial_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_assure_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_mish_) || !defined(_di_f_utf_string_prepend_assure_) || !defined(_di_f_utf_string_prepend_)
- f_status_t private_f_utf_string_prepend(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination) {
+ f_status_t private_f_utf_string_prepend(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) {
if (destination->used + length > F_string_t_size_d) {
return F_status_set_error(F_string_too_large);
if (destination->used) {
memmove(destination->string + length, destination->string, destination->used);
- memcpy(destination->string, source, sizeof(f_char_t) * length);
+ memcpy(destination->string, source, sizeof(f_utf_character_t) * length);
}
else {
- memcpy(destination->string, source, sizeof(f_char_t) * length);
+ memcpy(destination->string, source, sizeof(f_utf_character_t) * length);
}
- destination->used = destination->used + length;
-
+ destination->used += length;
return F_none;
}
#endif // !defined(_di_f_utf_string_dynamic_mish_) || !defined(_di_f_utf_string_dynamic_partial_mish_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_) || !defined(_di_f_utf_string_dynamic_partial_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_assure_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_mish_) || !defined(_di_f_utf_string_prepend_assure_) || !defined(_di_f_utf_string_prepend_)
#if !defined(_di_f_utf_string_dynamic_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_mish_nulless_) || !defined(_di_f_utf_string_prepend_assure_nulless_) || !defined(_di_f_utf_string_prepend_nulless_)
- f_status_t private_f_utf_string_prepend_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination) {
+ f_status_t private_f_utf_string_prepend_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) {
if (destination->used + length > F_string_t_size_d) {
return F_status_set_error(F_string_too_large);
}
memmove(destination->string + offset + size, destination->string + offset, destination->used - offset);
- memcpy(destination->string + offset, source + first, sizeof(f_char_t) * size);
+ memcpy(destination->string + offset, source + first, size);
- destination->used = destination->used + size;
+ destination->used += size;
offset += size;
}
}
memmove(destination->string + offset + size, destination->string + offset, destination->used - offset);
- memcpy(destination->string + offset, source + first, sizeof(f_char_t) * size);
+ memcpy(destination->string + offset, source + first, sizeof(f_utf_character_t) * size);
- destination->used = destination->used + size;
+ destination->used += size;
offset += size;
}
}
}
#endif // !defined(_di_f_utf_string_dynamic_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_mish_nulless_) || !defined(_di_f_utf_string_prepend_assure_nulless_) || !defined(_di_f_utf_string_prepend_nulless_)
-#if !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_)
- f_status_t private_f_utf_string_triples_adjust(const f_array_length_t length, f_utf_string_triples_t *triples) {
-
- if (triples->used + length > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- f_status_t status = F_none;
-
- for (f_array_length_t i = length; i < triples->size; ++i) {
-
- status = private_f_utf_string_dynamic_adjust(0, &triples->array[i].a);
- if (F_status_is_error(status)) return status;
-
- status = private_f_utf_string_dynamic_adjust(0, &triples->array[i].b);
- if (F_status_is_error(status)) return status;
-
- status = private_f_utf_string_dynamic_adjust(0, &triples->array[i].c);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(triples->size, length, sizeof(f_utf_string_triple_t), (void **) & triples->array);
- if (F_status_is_error(status)) return status;
-
- triples->size = length;
-
- if (triples->used > triples->size) {
- triples->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_)
-
-#if !defined(_di_f_utf_string_triples_decrease_) || !defined(_di_f_utf_string_triples_decrease_by_) || !defined(_di_f_utf_string_triples_increase_) || !defined(_di_f_utf_string_triples_increase_by_) || !defined(_di_f_utf_string_triples_terminate_) || !defined(_di_f_utf_string_triples_terminate_after_)
- f_status_t private_f_utf_string_triples_resize(const f_array_length_t length, f_utf_string_triples_t *triples) {
-
- if (triples->used + length > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- f_status_t status = F_none;
-
- for (f_array_length_t i = length; i < triples->size; ++i) {
-
- status = private_f_utf_string_dynamic_resize(0, &triples->array[i].a);
- if (F_status_is_error(status)) return status;
-
- status = private_f_utf_string_dynamic_resize(0, &triples->array[i].b);
- if (F_status_is_error(status)) return status;
-
- status = private_f_utf_string_dynamic_resize(0, &triples->array[i].c);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(triples->size, length, sizeof(f_utf_string_triple_t), (void **) & triples->array);
- if (F_status_is_error(status)) return status;
-
- triples->size = length;
-
- if (triples->used > triples->size) {
- triples->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_utf_string_triples_decrease_) || !defined(_di_f_utf_string_triples_decrease_by_) || !defined(_di_f_utf_string_triples_increase_) || !defined(_di_f_utf_string_triples_increase_by_) || !defined(_di_f_utf_string_triples_terminate_) || !defined(_di_f_utf_string_triples_terminate_after_)
-
#ifdef __cplusplus
} // extern "C"
#endif
* @see f_utf_string_triples_append()
*/
#if !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(f_utf_string_dynamic_partial_append) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_triples_append_)
- extern f_status_t private_f_utf_string_append(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_string_append(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(f_utf_string_dynamic_partial_append) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_triples_append_)
/**
* @see f_utf_string_mash_nulless()
*/
#if !defined(_di_f_utf_string_append_assure_nulless_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mash_nulless_) || !defined(_di_f_utf_string_mash_nulless_)
- extern f_status_t private_f_utf_string_append_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_string_append_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_string_append_assure_nulless_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mash_nulless_) || !defined(_di_f_utf_string_mash_nulless_)
/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param string
- * The string to adjust.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_utf_string_dynamic_adjust()
- * @see f_utf_string_dynamic_decimate_by()
- * @see f_utf_string_dynamics_adjust()
- * @see f_utf_string_dynamics_append()
- * @see f_utf_string_dynamics_decimate_by()
- * @see f_utf_string_map_multis_adjust()
- * @see f_utf_string_map_multis_append()
- * @see f_utf_string_triples_adjust()
- * @see f_utf_string_triples_decimate_by()
- */
-#if !defined(_di_f_utf_string_dynamic_adjust_) || !defined(_di_f_utf_string_dynamic_decimate_by_) || !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_)
- extern f_status_t private_f_utf_string_dynamic_adjust(const f_array_length_t length, f_utf_string_dynamic_t *string) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_utf_string_dynamic_adjust_) || !defined(_di_f_utf_string_dynamic_decimate_by_) || !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_)
-
-/**
- * Private implementation of f_utf_string_dynamic_increase_by().
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param amount
- * A positive number representing how much to increase the size by.
- * @param string
- * The string to resize.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + amount <= size).
- *
- * F_string_too_large (with error bit) if the combined string is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see memcpy()
- *
- * @see f_utf_string_append()
- * @see f_utf_string_append_assure()
- * @see f_utf_string_append_mash()
- * @see f_utf_string_append_nulless()
- * @see f_utf_string_dynamic_append()
- * @see f_utf_string_dynamic_append_assure()
- * @see f_utf_string_dynamic_append_nulless()
- * @see f_utf_string_dynamic_increase_by()
- * @see f_utf_string_dynamic_mash()
- * @see f_utf_string_dynamic_mash_nulless()
- * @see f_utf_string_dynamic_partial_append)
- * @see f_utf_string_dynamic_partial_append_assure()
- * @see f_utf_string_dynamic_partial_mash()
- * @see f_utf_string_dynamic_prepend()
- * @see f_utf_string_dynamic_prepend_nulless()
- * @see f_utf_string_dynamics_append()
- * @see f_utf_string_map_multis_append()
- * @see f_utf_string_mash()
- * @see f_utf_string_mash_nulless()
- * @see f_utf_string_maps_append()
- * @see f_utf_string_prepend()
- * @see f_utf_string_prepend_nulless()
- * @see f_utf_string_triples_append()
- */
-#if !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_)
- extern f_status_t private_f_utf_string_dynamic_increase_by(const f_array_length_t amount, f_utf_string_dynamic_t *string) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param string
- * The string to resize.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_utf_string_append()
- * @see f_utf_string_append_assure()
- * @see f_utf_string_append_mash()
- * @see f_utf_string_append_nulless()
- * @see f_utf_string_dynamic_append()
- * @see f_utf_string_dynamic_append_assure()
- * @see f_utf_string_dynamic_append_nulless()
- * @see f_utf_string_dynamic_decrease_by()
- * @see f_utf_string_dynamic_increase()
- * @see f_utf_string_dynamic_increase_by()
- * @see f_utf_string_dynamic_mash()
- * @see f_utf_string_dynamic_mash_nulless()
- * @see f_utf_string_dynamic_partial_append)
- * @see f_utf_string_dynamic_partial_append_assure()
- * @see f_utf_string_dynamic_partial_mash()
- * @see f_utf_string_dynamic_prepend()
- * @see f_utf_string_dynamic_prepend_nulless()
- * @see f_utf_string_dynamic_terminate()
- * @see f_utf_string_dynamic_terminate_after()
- * @see f_utf_string_dynamics_append()
- * @see f_utf_string_map_multis_append()
- * @see f_utf_string_mash_nulless()
- * @see f_utf_string_mash()
- * @see f_utf_string_maps_append()
- * @see f_utf_string_prepend()
- * @see f_utf_string_prepend_nulless()
- * @see f_utf_string_triples_append()
- */
-#if !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_decrease_by_) || !defined(_di_f_utf_string_dynamic_increase_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(f_utf_string_dynamic_partial_append) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_terminate_) || !defined(_di_f_utf_string_dynamic_terminate_after_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_)
- extern f_status_t private_f_utf_string_dynamic_resize(const f_array_length_t length, f_utf_string_dynamic_t *string) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_decrease_by_) || !defined(_di_f_utf_string_dynamic_increase_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(f_utf_string_dynamic_partial_append) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_terminate_) || !defined(_di_f_utf_string_dynamic_terminate_after_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param strings
- * The strings to adjust.
- *
- * @return
- * F_none on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_utf_string_dynamics_adjust()
- * @see f_utf_string_dynamics_append()
- * @see f_utf_string_dynamics_decimate_by()
- * @see f_utf_string_map_multis_adjust()
- * @see f_utf_string_map_multis_append()
- */
-#if !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_)
- extern f_status_t private_f_utf_string_dynamics_adjust(const f_array_length_t length, f_utf_string_dynamics_t *strings) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_)
-
-/**
- * Private implementation for appending.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
- * The source strings to append.
- * @param destination
- * The destination strings the source is appended onto.
- *
- * @return
- * F_none on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_utf_string_dynamics_append()
- * @see f_utf_string_map_multis_append()
- */
-#if !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_)
- extern f_status_t private_f_utf_string_dynamics_append(const f_utf_string_dynamics_t source, f_utf_string_dynamics_t *destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param strings
- * The strings to resize.
- *
- * @return
- * F_none on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_utf_string_dynamics_decrease_by()
- * @see f_utf_string_dynamics_increase()
- * @see f_utf_string_dynamics_increase_by()
- */
-#if !defined(_di_f_utf_string_dynamics_decrease_by_) || !defined(_di_f_utf_string_dynamics_increase_) || !defined(_di_f_utf_string_dynamics_increase_by_)
- extern f_status_t private_f_utf_string_dynamics_resize(const f_array_length_t length, f_utf_string_dynamics_t *strings) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_utf_string_dynamics_decrease_by_) || !defined(_di_f_utf_string_dynamics_increase_) || !defined(_di_f_utf_string_dynamics_increase_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param map_multis
- * The map_multis to adjust.
- *
- * @return
- * F_none on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_utf_string_map_multis_adjust()
- */
-#if !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_decimate_by_)
- extern f_status_t private_f_utf_string_map_multis_adjust(const f_array_length_t length, f_utf_string_map_multis_t *map_multis) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param map_multis
- * The map_multis to resize.
- *
- * @return
- * F_none on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_adjust()
- * @see f_utf_string_map_multis_decrease_by()
- * @see f_utf_string_map_multis_increase()
- * @see f_utf_string_map_multis_increase_by()
- * @see f_utf_string_map_multis_terminate()
- * @see f_utf_string_map_multis_terminate_after()
- */
-#if !defined(_di_f_utf_string_map_multis_decrease_by_) || !defined(_di_f_utf_string_map_multis_increase_) || !defined(_di_f_utf_string_map_multis_increase_by_) || !defined(_di_f_utf_string_map_multis_terminate_) || !defined(_di_f_utf_string_map_multis_terminate_after_)
- extern f_status_t private_f_utf_string_map_multis_resize(const f_array_length_t length, f_utf_string_map_multis_t *map_multis) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_utf_string_map_multis_decrease_by_) || !defined(_di_f_utf_string_map_multis_increase_) || !defined(_di_f_utf_string_map_multis_increase_by_) || !defined(_di_f_utf_string_map_multis_terminate_) || !defined(_di_f_utf_string_map_multis_terminate_after_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param maps
- * The maps to adjust.
- *
- * @return
- * F_none on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_utf_string_maps_adjust()
- */
-#if !defined(_di_f_utf_string_maps_adjust_) || !defined(_di_f_utf_string_maps_decimate_by_)
- extern f_status_t private_f_utf_string_maps_adjust(const f_array_length_t length, f_utf_string_maps_t *maps) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_utf_string_maps_adjust_) || !defined(_di_f_utf_string_maps_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param maps
- * The maps to resize.
- *
- * @return
- * F_none on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_adjust()
- * @see f_utf_string_maps_decrease_by()
- * @see f_utf_string_maps_increase()
- * @see f_utf_string_maps_increase_by()
- * @see f_utf_string_maps_terminate()
- * @see f_utf_string_maps_terminate_after()
- */
-#if !defined(_di_f_utf_string_maps_decrease_by_) || !defined(_di_f_utf_string_maps_increase_) || !defined(_di_f_utf_string_maps_increase_by_) || !defined(_di_f_utf_string_maps_terminate_) || !defined(_di_f_utf_string_maps_terminate_after_)
- extern f_status_t private_f_utf_string_maps_resize(const f_array_length_t length, f_utf_string_maps_t *maps) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_utf_string_maps_decrease_by_) || !defined(_di_f_utf_string_maps_increase_) || !defined(_di_f_utf_string_maps_increase_by_) || !defined(_di_f_utf_string_maps_terminate_) || !defined(_di_f_utf_string_maps_terminate_after_)
-
-/**
* Private implementation of f_utf_string_prepend().
*
* Intended to be shared to each of the different implementation variations.
* @see f_utf_string_prepend()
*/
#if !defined(_di_f_utf_string_dynamic_mish_) || !defined(_di_f_utf_string_dynamic_partial_mish_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_) || !defined(_di_f_utf_string_dynamic_partial_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_assure_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_mish_) || !defined(_di_f_utf_string_prepend_assure_) || !defined(_di_f_utf_string_prepend_)
- extern f_status_t private_f_utf_string_prepend(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_string_prepend(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_string_dynamic_mish_) || !defined(_di_f_utf_string_dynamic_partial_mish_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_) || !defined(_di_f_utf_string_dynamic_partial_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_assure_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_mish_) || !defined(_di_f_utf_string_prepend_assure_) || !defined(_di_f_utf_string_prepend_)
/**
* @see f_utf_string_prepend_nulless()
*/
#if !defined(_di_f_utf_string_dynamic_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_mish_nulless_) || !defined(_di_f_utf_string_prepend_assure_nulless_) || !defined(_di_f_utf_string_prepend_nulless_)
- extern f_status_t private_f_utf_string_prepend_nulless(const f_utf_string_t source, f_array_length_t length, f_utf_string_dynamic_t *destination) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_string_prepend_nulless(const f_utf_string_t source, f_array_length_t length, f_utf_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_string_dynamic_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_mish_nulless_) || !defined(_di_f_utf_string_prepend_assure_nulless_) || !defined(_di_f_utf_string_prepend_nulless_)
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param triples
- * The triples to adjust.
- *
- * @return
- * F_none on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_utf_string_triples_adjust()
- * @see f_utf_string_triples_decimate_by()
- */
-#if !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_)
- extern f_status_t private_f_utf_string_triples_adjust(const f_array_length_t length, f_utf_string_triples_t *triples) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param triples
- * The triples to resize.
- *
- * @return
- * F_none on success.
- *
- * F_array_too_large (with error bit) if the combined array is too large.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_utf_string_triples_decrease_by()
- * @see f_utf_string_triples_increase()
- * @see f_utf_string_triples_increase_by()
- * @see f_utf_string_triples_terminate()
- * @see f_utf_string_triples_terminate_after()
- */
-#if !defined(_di_f_utf_string_triples_decrease_by_) || !defined(_di_f_utf_string_triples_increase_) || !defined(_di_f_utf_string_triples_increase_by_) || !defined(_di_f_utf_string_triples_terminate_) || !defined(_di_f_utf_string_triples_terminate_after_)
- extern f_status_t private_f_utf_string_triples_resize(const f_array_length_t length, f_utf_string_triples_t *triples) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_utf_string_triples_decrease_by_) || !defined(_di_f_utf_string_triples_increase_) || !defined(_di_f_utf_string_triples_increase_by_) || !defined(_di_f_utf_string_triples_terminate_) || !defined(_di_f_utf_string_triples_terminate_after_)
#ifdef __cplusplus
} // extern "C"
--- /dev/null
+#include "../utf.h"
+#include "../private-utf.h"
+#include "private-dynamic.h"
+#include "private-triple.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_)
+ f_status_t private_f_utf_string_triples_adjust(const f_array_length_t length, f_utf_string_triples_t * const triples) {
+
+ if (triples->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < triples->size; ++i) {
+
+ status = private_f_utf_string_dynamic_adjust(0, &triples->array[i].a);
+ if (F_status_is_error(status)) return status;
+
+ status = private_f_utf_string_dynamic_adjust(0, &triples->array[i].b);
+ if (F_status_is_error(status)) return status;
+
+ status = private_f_utf_string_dynamic_adjust(0, &triples->array[i].c);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_adjust(triples->size, length, sizeof(f_utf_string_triple_t), (void **) & triples->array);
+ if (F_status_is_error(status)) return status;
+
+ triples->size = length;
+
+ if (triples->used > triples->size) {
+ triples->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_)
+
+#if !defined(_di_f_utf_string_triples_append_all_) || !defined(_di_f_utf_string_tripless_append_) || !defined(_di_f_utf_string_tripless_append_all_)
+ f_status_t private_f_utf_string_triples_append_all(const f_utf_string_triples_t source, f_utf_string_triples_t * const destination) {
+
+ f_status_t status = F_none;
+
+ if (destination->used + source.used > destination->size) {
+ status = private_f_utf_string_triples_resize(destination->used + source.used, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
+
+ destination->array[destination->used].a.used = 0;
+ destination->array[destination->used].b.used = 0;
+ destination->array[destination->used].c.used = 0;
+
+ if (source.array[i].a.used) {
+ status = private_f_utf_string_append(source.array[i].a.string, source.array[i].a.used, &destination->array[destination->used].a);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.array[i].b.used) {
+ status = private_f_utf_string_append(source.array[i].b.string, source.array[i].b.used, &destination->array[destination->used].b);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.array[i].c.used) {
+ status = private_f_utf_string_append(source.array[i].c.string, source.array[i].c.used, &destination->array[destination->used].c);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_triples_append_all_) || !defined(_di_f_utf_string_tripless_append_) || !defined(_di_f_utf_string_tripless_append_all_)
+
+#if !defined(_di_f_utf_string_triples_decrease_by_) || !defined(_di_f_utf_string_triples_increase_) || !defined(_di_f_utf_string_triples_increase_by_) || !defined(_di_f_utf_string_triples_terminate_) || !defined(_di_f_utf_string_triples_terminate_after_)
+ f_status_t private_f_utf_string_triples_resize(const f_array_length_t length, f_utf_string_triples_t * const triples) {
+
+ if (triples->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < triples->size; ++i) {
+
+ status = private_f_utf_string_dynamic_resize(0, &triples->array[i].a);
+ if (F_status_is_error(status)) return status;
+
+ status = private_f_utf_string_dynamic_resize(0, &triples->array[i].b);
+ if (F_status_is_error(status)) return status;
+
+ status = private_f_utf_string_dynamic_resize(0, &triples->array[i].c);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_resize(triples->size, length, sizeof(f_utf_string_triple_t), (void **) & triples->array);
+ if (F_status_is_error(status)) return status;
+
+ triples->size = length;
+
+ if (triples->used > triples->size) {
+ triples->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_triples_decrease_by_) || !defined(_di_f_utf_string_triples_increase_) || !defined(_di_f_utf_string_triples_increase_by_) || !defined(_di_f_utf_string_triples_terminate_) || !defined(_di_f_utf_string_triples_terminate_after_)
+
+#if !defined(_di_f_utf_string_tripless_adjust_) || !defined(_di_f_utf_string_tripless_decimate_by_)
+ f_status_t private_f_utf_string_tripless_adjust(const f_array_length_t length, f_utf_string_tripless_t * const tripless) {
+
+ if (tripless->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < tripless->size; ++i) {
+
+ status = private_f_utf_string_triples_adjust(0, &tripless->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_adjust(tripless->size, length, sizeof(f_utf_string_triples_t), (void **) & tripless->array);
+ if (F_status_is_error(status)) return status;
+
+ tripless->size = length;
+
+ if (tripless->used > tripless->size) {
+ tripless->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_tripless_adjust_) || !defined(_di_f_utf_string_tripless_decimate_by_)
+
+#if !defined(_di_f_utf_string_tripless_decrease_by_) || !defined(_di_f_utf_string_tripless_increase_) || !defined(_di_f_utf_string_tripless_increase_by_) || !defined(_di_f_utf_string_tripless_terminate_) || !defined(_di_f_utf_string_tripless_terminate_after_)
+ f_status_t private_f_utf_string_tripless_resize(const f_array_length_t length, f_utf_string_tripless_t * const tripless) {
+
+ if (tripless->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < tripless->size; ++i) {
+
+ status = private_f_utf_string_triples_resize(0, &tripless->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_resize(tripless->size, length, sizeof(f_utf_string_triples_t), (void **) & tripless->array);
+ if (F_status_is_error(status)) return status;
+
+ tripless->size = length;
+
+ if (tripless->used > tripless->size) {
+ tripless->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_utf_string_tripless_decrease_by_) || !defined(_di_f_utf_string_tripless_increase_) || !defined(_di_f_utf_string_tripless_increase_by_) || !defined(_di_f_utf_string_tripless_terminate_) || !defined(_di_f_utf_string_tripless_terminate_after_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * These are provided for internal reduction in redundant code.
+ * These should not be exposed/used outside of this project.
+ */
+#ifndef _PRIVATE_F_utf_triple_h
+#define _PRIVATE_F_utf_triple_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param triples
+ * The triples to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_utf_string_triples_adjust()
+ */
+#if !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_)
+ extern f_status_t private_f_utf_string_triples_adjust(const f_array_length_t length, f_utf_string_triples_t * const triples) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_)
+
+/**
+ * Private implementation for appending.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source triples to append.
+ * @param destination
+ * The destination triples the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_utf_string_triples_append_all()
+ * @see f_utf_string_tripless_append()
+ * @see f_utf_string_tripless_append_all()
+ */
+#if !defined(_di_f_utf_string_triples_append_all_) || !defined(_di_f_utf_string_tripless_append_) || !defined(_di_f_utf_string_tripless_append_all_)
+ extern f_status_t private_f_utf_string_triples_append_all(const f_utf_string_triples_t source, f_utf_string_triples_t * const destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_triples_append_all_) || !defined(_di_f_utf_string_tripless_append_) || !defined(_di_f_utf_string_tripless_append_all_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param triples
+ * The triples to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_adjust()
+ * @see f_utf_string_triples_decrease_by()
+ * @see f_utf_string_triples_increase()
+ * @see f_utf_string_triples_increase_by()
+ * @see f_utf_string_triples_terminate()
+ * @see f_utf_string_triples_terminate_after()
+ */
+#if !defined(_di_f_utf_string_triples_decrease_by_) || !defined(_di_f_utf_string_triples_increase_) || !defined(_di_f_utf_string_triples_increase_by_) || !defined(_di_f_utf_string_triples_terminate_) || !defined(_di_f_utf_string_triples_terminate_after_)
+ extern f_status_t private_f_utf_string_triples_resize(const f_array_length_t length, f_utf_string_triples_t * const triples) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_triples_decrease_by_) || !defined(_di_f_utf_string_triples_increase_) || !defined(_di_f_utf_string_triples_increase_by_) || !defined(_di_f_utf_string_triples_terminate_) || !defined(_di_f_utf_string_triples_terminate_after_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param tripless
+ * The tripless to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_memory_adjust()
+ * @see f_utf_string_tripless_adjust()
+ */
+#if !defined(_di_f_utf_string_tripless_adjust_) || !defined(_di_f_utf_string_tripless_decimate_by_)
+ extern f_status_t private_f_utf_string_tripless_adjust(const f_array_length_t length, f_utf_string_tripless_t * const tripless) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_tripless_adjust_) || !defined(_di_f_utf_string_tripless_decimate_by_)
+
+/**
+ * Private implementation for resizing.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The new size to use.
+ * @param tripless
+ * The tripless to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_array_too_large (with error bit) if the combined array is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_adjust()
+ * @see f_utf_string_tripless_decrease_by()
+ * @see f_utf_string_tripless_increase()
+ * @see f_utf_string_tripless_increase_by()
+ * @see f_utf_string_tripless_terminate()
+ * @see f_utf_string_tripless_terminate_after()
+ */
+#if !defined(_di_f_utf_string_tripless_decrease_by_) || !defined(_di_f_utf_string_tripless_increase_) || !defined(_di_f_utf_string_tripless_increase_by_) || !defined(_di_f_utf_string_tripless_terminate_) || !defined(_di_f_utf_string_tripless_terminate_after_)
+ extern f_status_t private_f_utf_string_tripless_resize(const f_array_length_t length, f_utf_string_tripless_t * const tripless) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_utf_string_tripless_decrease_by_) || !defined(_di_f_utf_string_tripless_increase_) || !defined(_di_f_utf_string_tripless_increase_by_) || !defined(_di_f_utf_string_tripless_terminate_) || !defined(_di_f_utf_string_tripless_terminate_after_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_utf_triple_h
--- /dev/null
+#include "../utf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_f_utf_string_empty_s_
+ const f_utf_string_static_t f_utf_string_empty_s = macro_f_utf_string_static_t_initialize(0, 0, 0);
+#endif // _di_f_utf_string_empty_s_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Defines static string data.
+ *
+ * This is auto-included by string.h and should not need to be explicitly included.
+ */
+#ifndef _F_utf_static_h
+#define _F_utf_static_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * A string that is analogous to f_utf_string_dynamic_t but intended for static-only uses.
+ *
+ * The f_utf_string_static_t type should never be directly allocated or deallocated.
+ *
+ * A special macro_f_utf_string_static_t_initialize() is provided for the special purpose of easily initialize a static string.
+ * A special macro_f_utf_string_static_t_initialize2() is provided for the special purpose of easily initialize a static string with an identical used and size.
+ *
+ * string: The string.
+ * size: Total amount of space available.
+ * used: Total number of space used.
+ */
+#ifndef _di_f_utf_string_static_t_
+ typedef struct {
+ f_utf_string_t string;
+
+ f_array_length_t size;
+ f_array_length_t used;
+ } f_utf_string_static_t;
+
+ #define f_utf_string_static_t_initialize { 0, 0, 0 }
+
+ #define macro_f_utf_string_static_t_initialize(string, size, used) { string, size, used }
+ #define macro_f_utf_string_static_t_initialize2(string, length) { string, length, length }
+
+ #define macro_f_utf_string_static_t_clear(string_static) \
+ string_static.string = 0; \
+ string_static.size = 0; \
+ string_static.used = 0;
+#endif // _di_f_utf_string_static_t_
+
+/**
+ * An array of static strings.
+ *
+ * array: The array of static strings.
+ * size: Total amount of space available.
+ * used: Total number of space used.
+ */
+#ifndef _di_f_utf_string_statics_t_
+ typedef struct {
+ f_utf_string_static_t *array;
+
+ f_array_length_t size;
+ f_array_length_t used;
+ } f_utf_string_statics_t;
+
+ #define f_utf_string_statics_t_initialize { 0, 0, 0 }
+
+ #define macro_f_utf_string_statics_t_initialize(array, size, used) { array, size, used }
+ #define macro_f_utf_string_statics_t_initialize2(array, length) { array, length, length }
+
+ #define macro_f_utf_string_statics_t_clear(statics) \
+ statics.array = 0; \
+ statics.size = 0; \
+ statics.used = 0;
+#endif // _di_f_utf_string_statics_t_
+
+/**
+ * An array of static strings.
+ *
+ * array: The array of static strings.
+ * size: Total amount of space available.
+ * used: Total number of space used.
+ */
+#ifndef _di_f_utf_string_staticss_t_
+ typedef struct {
+ f_utf_string_statics_t *array;
+
+ f_array_length_t size;
+ f_array_length_t used;
+ } f_utf_string_staticss_t;
+
+ #define f_utf_string_staticss_t_initialize { 0, 0, 0 }
+
+ #define macro_f_utf_string_staticss_t_initialize(array, size, used) { array, size, used }
+ #define macro_f_utf_string_staticss_t_initialize2(array, length) { array, length, length }
+
+ #define macro_f_utf_string_staticss_t_clear(staticss) \
+ staticss.array = 0; \
+ staticss.size = 0; \
+ staticss.used = 0;
+#endif // _di_f_utf_string_staticss_t_
+
+/**
+ * Provide a static empty string.
+ *
+ * This is intended to represent an empty string.
+ */
+#ifndef _di_f_utf_string_empty_s_
+ extern const f_utf_string_static_t f_utf_string_empty_s;
+#endif // _di_f_utf_string_empty_s_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _F_utf_static_h
#include "../utf.h"
+#include "private-dynamic.h"
#include "private-string.h"
#ifdef __cplusplus
#endif
#ifndef _di_f_utf_string_append_
- f_status_t f_utf_string_append(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_append(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) return F_data_not;
return private_f_utf_string_append(source, length, destination);
}
#endif // _di_f_utf_string_append_
#ifndef _di_f_utf_string_append_assure_
- f_status_t f_utf_string_append_assure(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_append_assure(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
- if (destination->used < length) return private_f_utf_string_append(source, length, destination);
+ if (!length) return F_data_not;
+
+ if (destination->used < length) {
+ return private_f_utf_string_append(source, length, destination);
+ }
f_array_length_t i = 1;
f_array_length_t j = 1;
#endif // _di_f_utf_string_append_assure_
#ifndef _di_f_utf_string_append_assure_nulless_
- f_status_t f_utf_string_append_assure_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_append_assure_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) {
- return F_data_not_eos;
- }
+ if (!length) return F_data_not;
- if (destination->used < length) {
+ if (!destination->used) {
return private_f_utf_string_append_nulless(source, length, destination);
}
#endif // _di_f_utf_string_append_assure_nulless_
#ifndef _di_f_utf_string_append_nulless_
- f_status_t f_utf_string_append_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_append_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) return F_data_not;
return private_f_utf_string_append_nulless(source, length, destination);
}
#endif // _di_f_utf_string_append_nulless_
#ifndef _di_f_utf_string_mash_
- f_status_t f_utf_string_mash(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_mash(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) {
+ return F_data_not;
+ }
if (glue_length && destination->used) {
f_status_t status = private_f_utf_string_append(glue, glue_length, destination);
#endif // _di_f_utf_string_mash_
#ifndef _di_f_utf_string_mash_nulless_
- f_status_t f_utf_string_mash_nulless(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_mash_nulless(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) return F_data_not;
if (glue_length && destination->used) {
f_status_t status = private_f_utf_string_append_nulless(glue, glue_length, destination);
#endif // _di_f_utf_string_mash_nulless_
#ifndef _di_f_utf_string_mish_
- f_status_t f_utf_string_mish(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_mish(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) return F_data_not;
if (glue_length && destination->used) {
f_status_t status = private_f_utf_string_prepend(glue, glue_length, destination);
#endif // _di_f_utf_string_mish_
#ifndef _di_f_utf_string_mish_nulless_
- f_status_t f_utf_string_mish_nulless(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_mish_nulless(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) return F_data_not;
if (glue_length && destination->used) {
f_status_t status = private_f_utf_string_prepend_nulless(glue, glue_length, destination);
#endif // _di_f_utf_string_mish_nulless_
#ifndef _di_f_utf_string_prepend_
- f_status_t f_utf_string_prepend(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_prepend(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) return F_data_not;
return private_f_utf_string_prepend(source, length, destination);
}
#endif // _di_f_utf_string_prepend_
#ifndef _di_f_utf_string_prepend_assure_
- f_status_t f_utf_string_prepend_assure(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_prepend_assure(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) return F_data_not;
if (destination->used < length) {
return private_f_utf_string_prepend(source, length, destination);
continue;
}
- if (source[i] != destination->string[i]) {
+ if (source[i] != destination->string[j]) {
return private_f_utf_string_prepend(source, length, destination);
}
#endif // _di_f_utf_string_prepend_assure_
#ifndef _di_f_utf_string_prepend_assure_nulless_
- f_status_t f_utf_string_prepend_assure_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_prepend_assure_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) {
- return F_data_not_eos;
- }
+ if (!length) return F_data_not;
- if (destination->used < length) {
+ if (!destination->used) {
return private_f_utf_string_prepend_nulless(source, length, destination);
}
continue;
}
- if (source[i] != destination->string[i]) {
+ if (source[i] != destination->string[j]) {
return private_f_utf_string_prepend_nulless(source, length, destination);
}
#endif // _di_f_utf_string_prepend_assure_nulless_
#ifndef _di_f_utf_string_prepend_nulless_
- f_status_t f_utf_string_prepend_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination) {
+ f_status_t f_utf_string_prepend_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) return F_data_not;
return private_f_utf_string_prepend_nulless(source, length, destination);
}
#endif // _di_f_utf_string_seek_line_
#ifndef _di_f_utf_string_seek_line_to_
- f_status_t f_utf_string_seek_line_to(const f_utf_string_t string, const uint8_t seek_to, f_string_range_t *range) {
+ f_status_t f_utf_string_seek_line_to(const f_utf_string_t string, const f_char_t seek_to, f_string_range_t * const range) {
#ifndef _di_level_0_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_utf_string_seek_line_to_
#ifndef _di_f_utf_string_seek_to_
- f_status_t f_utf_string_seek_to(const f_utf_string_t string, const uint8_t seek_to, f_string_range_t *range) {
+ f_status_t f_utf_string_seek_to(const f_utf_string_t string, const f_char_t seek_to, f_string_range_t * const range) {
#ifndef _di_level_0_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
*
* Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
*/
#ifndef _di_f_utf_string_append_
- extern f_status_t f_utf_string_append(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_append(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_append_
/**
- * Append the source string onto the destination, but only if the string is not already at the end.
+ * Append the source string onto the destination only if the string is not already at the end.
*
* This ignores NULL characters when comparing both the source and the destination.
*
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
*
* Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
*/
#ifndef _di_f_utf_string_append_assure_
- extern f_status_t f_utf_string_append_assure(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_append_assure(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_append_assure_
/**
- * Append the source string onto the destination, but only if the string is not already at the end.
+ * Append the source string onto the destination only if the string is not already at the end.
*
* This ignores NULL characters when comparing both the source and the destination.
* Skips over NULL characters from source when appending.
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_append_assure_nulless_
- extern f_status_t f_utf_string_append_assure_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_append_assure_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_append_assure_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_append_nulless_
- extern f_status_t f_utf_string_append_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_append_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_append_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_mash_
- extern f_status_t f_utf_string_mash(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_mash(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_mash_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_mash_nulless_
- extern f_status_t f_utf_string_mash_nulless(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_mash_nulless(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_mash_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_mish_
- extern f_status_t f_utf_string_mish(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_mish(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_mish_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_mish_nulless_
- extern f_status_t f_utf_string_mish_nulless(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_mish_nulless(const f_utf_string_t glue, const f_array_length_t glue_length, const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_mish_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_prepend_
- extern f_status_t f_utf_string_prepend(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_prepend(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_prepend_
/**
- * Prepend the source string onto the destination, but only if the string is not already at the beginning.
+ * Prepend the source string onto the destination only if the string is not already at the beginning.
*
* Prepend operations require memory move operations and are therefore likely more expensive than append operations.
*
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_prepend_assure_
- extern f_status_t f_utf_string_prepend_assure(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_prepend_assure(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_prepend_assure_
/**
- * Prepend the source string onto the destination, but only if the string is not already at the beginning.
+ * Prepend the source string onto the destination only if the string is not already at the beginning.
*
* Prepend operations require memory move operations and are therefore likely more expensive than append operations.
*
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_prepend_assure_nulless_
- extern f_status_t f_utf_string_prepend_assure_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_prepend_assure_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_prepend_assure_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_prepend_nulless_
- extern f_status_t f_utf_string_prepend_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t *destination);
+ extern f_status_t f_utf_string_prepend_nulless(const f_utf_string_t source, const f_array_length_t length, f_utf_string_dynamic_t * const destination);
#endif // _di_f_utf_string_prepend_nulless_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_seek_line_
- extern f_status_t f_utf_string_seek_line(const f_utf_string_t string, f_string_range_t *range);
+ extern f_status_t f_utf_string_seek_line(const f_utf_string_t string, f_string_range_t * const range);
#endif // _di_f_utf_string_seek_line_
/**
* @return
* F_none on success.
* F_none_eol on success, but stopped at EOL.
- * F_none_stop on success, but stopped stop location.
+ * F_none_stop on success, but stopped at the stop location.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_string_seek_line_to_
- extern f_status_t f_utf_string_seek_line_to(const f_utf_string_t string, const uint8_t seek_to, f_string_range_t *range);
+ extern f_status_t f_utf_string_seek_line_to(const f_utf_string_t string, const f_char_t seek_to, f_string_range_t * const range);
#endif // _di_f_utf_string_seek_line_to_
/**
*
* @return
* F_none on success.
- * F_none_stop on success, but stopped stop location.
+ * F_none_stop on success, but stopped at the stop location.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_string_seek_to_
- extern f_status_t f_utf_string_seek_to(const f_utf_string_t string, const uint8_t seek_to, f_string_range_t *range);
+ extern f_status_t f_utf_string_seek_to(const f_utf_string_t string, const f_char_t seek_to, f_string_range_t * const range);
#endif // _di_f_utf_string_seek_to_
#ifdef __cplusplus
#include "../utf.h"
#include "../private-utf.h"
#include "private-string.h"
+#include "private-triple.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _di_f_utf_string_triples_adjust_
- f_status_t f_utf_string_triples_adjust(const f_array_length_t length, f_utf_string_triples_t *triples) {
+ f_status_t f_utf_string_triples_adjust(const f_array_length_t length, f_utf_string_triples_t * const triples) {
#ifndef _di_level_0_parameter_checking_
if (!triples) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_utf_string_triples_adjust_
#ifndef _di_f_utf_string_triples_append_
- f_status_t f_utf_string_triples_append(const f_utf_string_triples_t source, f_utf_string_triples_t *destination) {
+ f_status_t f_utf_string_triples_append(const f_utf_string_triple_t source, f_utf_string_triples_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not;
+ f_status_t status = F_none;
+
+ if (destination->used + 1 > destination->size) {
+ status = private_f_utf_string_triples_adjust(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used].a.used = 0;
+ destination->array[destination->used].b.used = 0;
+ destination->array[destination->used].c.used = 0;
+
+ if (source.a.used) {
+ status = private_f_utf_string_append(source.a.string, source.a.used, &destination->array[destination->used].a);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.b.used) {
+ status = private_f_utf_string_append(source.b.string, source.b.used, &destination->array[destination->used].b);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.c.used) {
+ status = private_f_utf_string_append(source.c.string, source.c.used, &destination->array[destination->used].c);
+ if (F_status_is_error(status)) return status;
}
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_utf_string_triples_append_
+
+#ifndef _di_f_utf_string_triples_append_all_
+ f_status_t f_utf_string_triples_append_all(const f_utf_string_triples_t source, f_utf_string_triples_t * const destination) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!destination) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!source.used) return F_data_not;
+
f_status_t status = F_none;
if (destination->used + source.used > destination->size) {
return F_none;
}
-#endif // _di_f_utf_string_triples_append_
+#endif // _di_f_utf_string_triples_append_all_
#ifndef _di_f_utf_string_triples_decimate_by_
- f_status_t f_utf_string_triples_decimate_by(const f_array_length_t amount, f_utf_string_triples_t *triples) {
+ f_status_t f_utf_string_triples_decimate_by(const f_array_length_t amount, f_utf_string_triples_t * const triples) {
#ifndef _di_level_0_parameter_checking_
if (!triples) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) {
- return F_data_not;
- }
-
if (triples->size - amount > 0) {
return private_f_utf_string_triples_adjust(triples->size - amount, triples);
}
#endif // _di_f_utf_string_triples_decimate_by_
#ifndef _di_f_utf_string_triples_decrease_by_
- f_status_t f_utf_string_triples_decrease_by(const f_array_length_t amount, f_utf_string_triples_t *triples) {
+ f_status_t f_utf_string_triples_decrease_by(const f_array_length_t amount, f_utf_string_triples_t * const triples) {
#ifndef _di_level_0_parameter_checking_
if (!triples) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) {
- return F_data_not;
- }
+ if (!amount) return F_data_not;
if (triples->size - amount > 0) {
return private_f_utf_string_triples_resize(triples->size - amount, triples);
#endif // _di_f_utf_string_triples_decrease_by_
#ifndef _di_f_utf_string_triples_increase_
- f_status_t f_utf_string_triples_increase(const f_array_length_t step, f_utf_string_triples_t *triples) {
+ f_status_t f_utf_string_triples_increase(const f_array_length_t step, f_utf_string_triples_t * const triples) {
#ifndef _di_level_0_parameter_checking_
if (!triples) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (step && triples->used + 1 > triples->size) {
- f_array_length_t size = triples->used + step;
+ f_array_length_t size = triples->used + F_memory_default_allocation_small_d;
if (size > F_array_length_t_size_d) {
if (triples->used + 1 > F_array_length_t_size_d) {
#endif // _di_f_utf_string_triples_increase_
#ifndef _di_f_utf_string_triples_increase_by_
- f_status_t f_utf_string_triples_increase_by(const f_array_length_t amount, f_utf_string_triples_t *triples) {
+ f_status_t f_utf_string_triples_increase_by(const f_array_length_t amount, f_utf_string_triples_t * const triples) {
#ifndef _di_level_0_parameter_checking_
if (!triples) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) {
- return F_data_not;
- }
+ if (!amount) return F_data_not;
if (triples->used + amount > triples->size) {
if (triples->used + amount > F_array_length_t_size_d) {
#endif // _di_f_utf_string_triples_increase_by_
#ifndef _di_f_utf_string_triples_resize_
- f_status_t f_utf_string_triples_resize(const f_array_length_t length, f_utf_string_triples_t *triples) {
+ f_status_t f_utf_string_triples_resize(const f_array_length_t length, f_utf_string_triples_t * const triples) {
#ifndef _di_level_0_parameter_checking_
if (!triples) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
}
#endif // _di_f_utf_string_triples_resize_
+#ifndef _di_f_utf_string_tripless_append_
+ f_status_t f_utf_string_tripless_append(const f_utf_string_triples_t source, f_utf_string_tripless_t * const destination) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!destination) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!source.used) return F_data_not;
+
+ f_status_t status = F_none;
+
+ if (destination->used + 1 > destination->size) {
+ status = private_f_utf_string_tripless_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used].used = 0;
+
+ if (source.used) {
+ status = private_f_utf_string_triples_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_utf_string_tripless_append_
+
+#ifndef _di_f_utf_string_tripless_append_all_
+ f_status_t f_utf_string_tripless_append_all(const f_utf_string_tripless_t source, f_utf_string_tripless_t * const destination) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!destination) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!source.used) return F_data_not;
+
+ f_status_t status = F_none;
+
+ if (destination->used + source.used > destination->size) {
+ status = private_f_utf_string_tripless_resize(destination->used + source.used, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
+
+ destination->array[destination->used].used = 0;
+
+ if (source.array[i].used) {
+ status = private_f_utf_string_triples_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+
+ return F_none;
+ }
+#endif // _di_f_utf_string_tripless_append_all_
+
+#ifndef _di_f_utf_string_tripless_adjust_
+ f_status_t f_utf_string_tripless_adjust(const f_array_length_t length, f_utf_string_tripless_t * const tripless) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!tripless) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_utf_string_tripless_adjust(length, tripless);
+ }
+#endif // _di_f_utf_string_tripless_adjust_
+
+#ifndef _di_f_utf_string_tripless_decimate_by_
+ f_status_t f_utf_string_tripless_decimate_by(const f_array_length_t amount, f_utf_string_tripless_t * const tripless) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!tripless) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) return F_data_not;
+
+ if (tripless->size - amount > 0) {
+ return private_f_utf_string_tripless_adjust(tripless->size - amount, tripless);
+ }
+
+ return private_f_utf_string_tripless_adjust(0, tripless);
+ }
+#endif // _di_f_utf_string_tripless_decimate_by_
+
+#ifndef _di_f_utf_string_tripless_decrease_by_
+ f_status_t f_utf_string_tripless_decrease_by(const f_array_length_t amount, f_utf_string_tripless_t * const tripless) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!tripless) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) return F_data_not;
+
+ if (tripless->size - amount > 0) {
+ return private_f_utf_string_tripless_resize(tripless->size - amount, tripless);
+ }
+
+ return private_f_utf_string_tripless_resize(0, tripless);
+ }
+#endif // _di_f_utf_string_tripless_decrease_by_
+
+#ifndef _di_f_utf_string_tripless_increase_
+ f_status_t f_utf_string_tripless_increase(const f_array_length_t step, f_utf_string_tripless_t * const tripless) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!tripless) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (step && tripless->used + 1 > tripless->size) {
+ f_array_length_t size = tripless->used + step;
+
+ if (size > F_array_length_t_size_d) {
+ if (tripless->used + 1 > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ size = F_array_length_t_size_d;
+ }
+
+ return private_f_utf_string_tripless_resize(size, tripless);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_utf_string_tripless_increase_
+
+#ifndef _di_f_utf_string_tripless_increase_by_
+ f_status_t f_utf_string_tripless_increase_by(const f_array_length_t amount, f_utf_string_tripless_t * const tripless) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!tripless) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) return F_data_not;
+
+ if (tripless->used + amount > tripless->size) {
+ if (tripless->used + amount > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ return private_f_utf_string_tripless_resize(tripless->used + amount, tripless);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_utf_string_tripless_increase_by_
+
+#ifndef _di_f_utf_string_tripless_resize_
+ f_status_t f_utf_string_tripless_resize(const f_array_length_t length, f_utf_string_tripless_t * const tripless) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!tripless) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_utf_string_tripless_resize(length, tripless);
+ }
+#endif // _di_f_utf_string_tripless_resize_
+
#ifdef __cplusplus
} // extern "C"
#endif
*
* This is auto-included by utf.h and should not need to be explicitly included.
*/
-#ifndef _F_utf_string_triple_h
-#define _F_utf_string_triple_h
+#ifndef _F_utf_triple_h
+#define _F_utf_triple_h
#ifdef __cplusplus
extern "C" {
triple.c.size = 0; \
triple.c.used = 0;
+ #define macro_f_utf_string_triple_t_initialize(a, b, c) { a, b, c }
+
#define macro_f_utf_string_triple_t_delete_simple(triple) \
macro_f_utf_string_dynamic_t_delete_simple(triple.a) \
macro_f_utf_string_dynamic_t_delete_simple(triple.b) \
/**
* An array of string triples.
*
- * array: the array of string triples.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of string triples.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_utf_string_triples_t_
typedef struct {
#define f_utf_string_triples_t_initialize f_utf_string_statics_t_initialize
+ #define macro_f_utf_string_triples_t_initialize(array, size, used) { array, size, used }
+ #define macro_f_utf_string_triples_t_initialize2(array, length) { array, length, length }
+
#define macro_f_utf_string_triples_t_clear(triples) macro_f_memory_structure_clear(triples)
#define macro_f_utf_string_triples_t_resize(status, triples, length) status = f_utf_string_triples_resize(length, &triples);
#define macro_f_utf_string_triples_t_delete_simple(triples) f_utf_string_triples_resize(0, &triples);
#define macro_f_utf_string_triples_t_destroy_simple(triples) f_utf_string_triples_adjust(0, &triples);
- #define macro_f_utf_string_triples_t_increase(status, triples) status = f_utf_string_triples_increase(triples);
+ #define macro_f_utf_string_triples_t_increase(status, step, triples) status = f_utf_string_triples_increase(step, triples);
#define macro_f_utf_string_triples_t_increase_by(status, triples, amount) status = f_utf_string_triples_increase_by(amount, triples);
#define macro_f_utf_string_triples_t_decrease_by(status, triples, amount) status = f_utf_string_triples_decrease_by(amount, triples);
#define macro_f_utf_string_triples_t_decimate_by(status, triples, amount) status = f_utf_string_triples_decimate_by(amount, triples);
#endif // _di_f_utf_string_triples_t_
/**
+ * An array of string tripless.
+ *
+ * array: The array of string triples.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
+ */
+#ifndef _di_f_utf_string_tripless_t_
+ typedef struct {
+ f_utf_string_triples_t *array;
+
+ f_array_length_t size;
+ f_array_length_t used;
+ } f_utf_string_tripless_t;
+
+ #define f_utf_string_tripless_t_initialize f_utf_string_statics_t_initialize
+
+ #define macro_f_utf_string_tripless_t_initialize(array, size, used) { array, size, used }
+ #define macro_f_utf_string_tripless_t_initialize2(array, length) { array, length, length }
+
+ #define macro_f_utf_string_tripless_t_clear(tripless) macro_f_memory_structure_clear(tripless)
+
+ #define macro_f_utf_string_tripless_t_resize(status, tripless, length) status = f_utf_string_tripless_resize(length, &tripless);
+ #define macro_f_utf_string_tripless_t_adjust(status, tripless, length) status = f_utf_string_tripless_adjust(length, &tripless);
+
+ #define macro_f_utf_string_tripless_t_delete_simple(tripless) f_utf_string_tripless_resize(0, &tripless);
+ #define macro_f_utf_string_tripless_t_destroy_simple(tripless) f_utf_string_tripless_adjust(0, &tripless);
+
+ #define macro_f_utf_string_tripless_t_increase(status, step, tripless) status = f_utf_string_tripless_increase(step, tripless);
+ #define macro_f_utf_string_tripless_t_increase_by(status, tripless, amount) status = f_utf_string_tripless_increase_by(amount, tripless);
+ #define macro_f_utf_string_tripless_t_decrease_by(status, tripless, amount) status = f_utf_string_tripless_decrease_by(amount, tripless);
+ #define macro_f_utf_string_tripless_t_decimate_by(status, tripless, amount) status = f_utf_string_tripless_decimate_by(amount, tripless);
+#endif // _di_f_utf_string_tripless_t_
+
+/**
* Resize the string triples array.
*
* @param length
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_utf_string_triples_adjust_
- extern f_status_t f_utf_string_triples_adjust(const f_array_length_t length, f_utf_string_triples_t *triples);
+ extern f_status_t f_utf_string_triples_adjust(const f_array_length_t length, f_utf_string_triples_t * const triples);
#endif // _di_f_utf_string_triples_adjust_
/**
- * Append the source triples onto the destination.
+ * Append the single source triples onto the destination.
*
* @param source
- * The source triples to append.
+ * The source triple to append.
* @param destination
* The destination triples the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_triples_append_
- extern f_status_t f_utf_string_triples_append(const f_utf_string_triples_t source, f_utf_string_triples_t *destination);
+ extern f_status_t f_utf_string_triples_append(const f_utf_string_triple_t source, f_utf_string_triples_t * const destination);
#endif // _di_f_utf_string_triples_append_
/**
+ * Append the source triples onto the destination.
+ *
+ * @param source
+ * The source triples to append.
+ * @param destination
+ * The destination triples the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (size == 0).
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_triples_append_all_
+ extern f_status_t f_utf_string_triples_append_all(const f_utf_string_triples_t source, f_utf_string_triples_t * const destination);
+#endif // _di_f_utf_string_triples_append_all_
+
+/**
* Resize the string triples array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_triples_decimate_by_
- extern f_status_t f_utf_string_triples_decimate_by(const f_array_length_t amount, f_utf_string_triples_t *triples);
+ extern f_status_t f_utf_string_triples_decimate_by(const f_array_length_t amount, f_utf_string_triples_t * const triples);
#endif // _di_f_utf_string_triples_decimate_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_triples_decrease_by_
- extern f_status_t f_utf_string_triples_decrease_by(const f_array_length_t amount, f_utf_string_triples_t *triples);
+ extern f_status_t f_utf_string_triples_decrease_by(const f_array_length_t amount, f_utf_string_triples_t * const triples);
#endif // _di_f_utf_string_triples_decrease_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_triples_increase_
- extern f_status_t f_utf_string_triples_increase(const f_array_length_t step, f_utf_string_triples_t *triples);
+ extern f_status_t f_utf_string_triples_increase(const f_array_length_t step, f_utf_string_triples_t * const triples);
#endif // _di_f_utf_string_triples_increase_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_triples_increase_by_
- extern f_status_t f_utf_string_triples_increase_by(const f_array_length_t amount, f_utf_string_triples_t *triples);
+ extern f_status_t f_utf_string_triples_increase_by(const f_array_length_t amount, f_utf_string_triples_t * const triples);
#endif // _di_f_utf_string_triples_increase_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_triples_resize_
- extern f_status_t f_utf_string_triples_resize(const f_array_length_t length, f_utf_string_triples_t *triples);
+ extern f_status_t f_utf_string_triples_resize(const f_array_length_t length, f_utf_string_triples_t * const triples);
#endif // _di_f_utf_string_triples_resize_
+/**
+ * Resize the string tripless array.
+ *
+ * @param length
+ * The new size to use.
+ * @param tripless
+ * The string tripless array to resize.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_memory_not (with error bit) on out of memory.
+ * F_parameter (with error bit) if a parameter is invalid.
+ */
+#ifndef _di_f_utf_string_tripless_adjust_
+ extern f_status_t f_utf_string_tripless_adjust(const f_array_length_t length, f_utf_string_tripless_t * const tripless);
+#endif // _di_f_utf_string_tripless_adjust_
+
+/**
+ * Append the single source triples onto the destination.
+ *
+ * @param source
+ * The source triples to append.
+ * @param destination
+ * The destination tripless the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (size == 0).
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_tripless_append_
+ extern f_status_t f_utf_string_tripless_append(const f_utf_string_triples_t source, f_utf_string_tripless_t * const destination);
+#endif // _di_f_utf_string_tripless_append_
+
+/**
+ * Append the source tripless onto the destination.
+ *
+ * @param source
+ * The source tripless to append.
+ * @param destination
+ * The destination tripless the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (size == 0).
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_string_too_large (with error bit) if the combined string is too large.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_tripless_append_all_
+ extern f_status_t f_utf_string_tripless_append_all(const f_utf_string_tripless_t source, f_utf_string_tripless_t * const destination);
+#endif // _di_f_utf_string_tripless_append_all_
+
+/**
+ * Resize the string tripless array to a smaller size.
+ *
+ * This will resize making the array smaller based on (size - given length).
+ * If the given length is too small, then the resize will fail.
+ * This will not shrink the size to less than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decimate the size by.
+ * @param tripless
+ * The string tripless array to resize.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not if amount is 0.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_tripless_decimate_by_
+ extern f_status_t f_utf_string_tripless_decimate_by(const f_array_length_t amount, f_utf_string_tripless_t * const tripless);
+#endif // _di_f_utf_string_tripless_decimate_by_
+
+/**
+ * Resize the string tripless array to a smaller size.
+ *
+ * This will resize making the array smaller based on (size - given length).
+ * If the given length is too small, then the resize will fail.
+ * This will not shrink the size to less than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decrease the size by.
+ * @param tripless
+ * The string tripless array to resize.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not if amount is 0.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_tripless_decrease_by_
+ extern f_status_t f_utf_string_tripless_decrease_by(const f_array_length_t amount, f_utf_string_tripless_t * const tripless);
+#endif // _di_f_utf_string_tripless_decrease_by_
+
+/**
+ * Increase the size of the string tripless array, but only if necessary.
+ *
+ * If the given length is too large for the buffer, then attempt to set max buffer size (F_array_length_t_size_d).
+ * If already set to the maximum buffer size, then the resize will fail.
+ *
+ * @param step
+ * The allocation step to use.
+ * Must be greater than 0.
+ * @param tripless
+ * The string tripless array to resize.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ *
+ * F_array_too_large (with error bit) if the new array length is too large.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_tripless_increase_
+ extern f_status_t f_utf_string_tripless_increase(const f_array_length_t step, f_utf_string_tripless_t * const tripless);
+#endif // _di_f_utf_string_tripless_increase_
+
+/**
+ * Resize the string tripless array to a larger size.
+ *
+ * This will resize making the string larger based on the given length.
+ * If the given length is too large for the buffer, then attempt to set max buffer size (F_array_length_t_size_d).
+ * If already set to the maximum buffer size, then the resize will fail.
+ *
+ * @param amount
+ * A positive number representing how much to increase the size by.
+ * @param tripless
+ * The string tripless array to resize.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + amount <= size).
+ *
+ * F_array_too_large (with error bit) if the new array length is too large.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_tripless_increase_by_
+ extern f_status_t f_utf_string_tripless_increase_by(const f_array_length_t amount, f_utf_string_tripless_t * const tripless);
+#endif // _di_f_utf_string_tripless_increase_by_
+
+/**
+ * Resize the string tripless array.
+ *
+ * @param length
+ * The new size to use.
+ * @param tripless
+ * The string tripless array to adjust.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_utf_string_tripless_resize_
+ extern f_status_t f_utf_string_tripless_resize(const f_array_length_t length, f_utf_string_tripless_t * const tripless);
+#endif // _di_f_utf_string_tripless_resize_
+
#ifdef __cplusplus
} // extern "C"
#endif
-#endif // _F_utf_string_triple_h
+#endif // _F_utf_triple_h
build_objects_program
build_objects_program_shared
build_objects_program_static
-build_sources_library utf.c private-utf.c utf/common.c utf/convert.c utf/dynamic.c utf/is.c utf/is_character.c utf/map.c utf/private-is_unassigned.c utf/private-string.c utf/string.c utf/triple.c
+build_sources_library utf.c private-utf.c utf/common.c utf/convert.c utf/dynamic.c utf/is.c utf/is_character.c utf/map.c utf/map_multi.c utf/private-is_unassigned.c utf/private-dynamic.c utf/private-map.c utf/private-map_multi.c utf/private-string.c utf/private-triple.c utf/static.c utf/string.c utf/triple.c
build_sources_library_shared
build_sources_library_static
build_sources_object
build_sources_program
build_sources_program_shared
build_sources_program_static
-build_sources_headers utf.h utf/common.h utf/convert.h utf/dynamic.h utf/is.h utf/is_character.h utf/map.h utf/string.h utf/triple.h
+build_sources_headers utf.h utf/common.h utf/convert.h utf/dynamic.h utf/is.h utf/is_character.h utf/map.h utf/map_multi.h utf/static.h utf/string.h utf/triple.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+# fss-0001
+
+build_name test-f_utf
+
+version_major 0
+version_minor 5
+version_micro 9
+version_file major
+version_target major
+
+modes individual level monolithic clang test
+modes_default individual
+
+build_compiler gcc
+build_compiler-clang clang
+build_indexer ar
+build_indexer_arguments rcs
+build_language c
+build_libraries -lc -lcmocka
+build_libraries-individual -lf_memory -lf_string -lf_utf
+build_libraries-level -lfll_0
+build_libraries-monolithic -lfll
+build_sources_program test-utf-append.c test-utf-append_assure.c test-utf-append_assure_nulless.c test-utf-append_nulless.c
+build_sources_program test-utf-dynamic_adjust.c test-utf-dynamic_append.c test-utf-dynamic_append_assure.c test-utf-dynamic_append_assure_nulless.c test-utf-dynamic_append_nulless.c
+build_sources_program test-utf-dynamic_decimate_by.c test-utf-dynamic_decrease_by.c test-utf-dynamic_increase.c test-utf-dynamic_increase_by.c
+build_sources_program test-utf-dynamic_mash.c test-utf-dynamic_mash_nulless.c
+build_sources_program test-utf-dynamic_mish.c test-utf-dynamic_mish_nulless.c
+build_sources_program test-utf-dynamic_partial_append.c test-utf-dynamic_partial_append_assure.c test-utf-dynamic_partial_append_assure_nulless.c test-utf-dynamic_partial_append_nulless.c
+build_sources_program test-utf-dynamic_partial_mash.c test-utf-dynamic_partial_mash_nulless.c
+build_sources_program test-utf-dynamic_partial_mish.c test-utf-dynamic_partial_mish_nulless.c
+build_sources_program test-utf-dynamic_partial_prepend.c test-utf-dynamic_partial_prepend_assure.c test-utf-dynamic_partial_prepend_assure_nulless.c test-utf-dynamic_partial_prepend_nulless.c
+build_sources_program test-utf-dynamic_prepend.c test-utf-dynamic_prepend_assure.c test-utf-dynamic_prepend_assure_nulless.c test-utf-dynamic_prepend_nulless.c
+build_sources_program test-utf-dynamic_resize.c
+build_sources_program test-utf-dynamic_seek_line.c test-utf-dynamic_seek_line_to.c test-utf-dynamic_seek_to.c
+build_sources_program test-utf-dynamic_terminate.c test-utf-dynamic_terminate_after.c
+build_sources_program test-utf-dynamics_adjust.c test-utf-dynamics_append.c test-utf-dynamics_append_all.c test-utf-dynamics_decimate_by.c test-utf-dynamics_decrease_by.c test-utf-dynamics_increase.c test-utf-dynamics_increase_by.c test-utf-dynamics_resize.c test-utf-dynamicss_adjust.c test-utf-dynamicss_append.c test-utf-dynamicss_append_all.c test-utf-dynamicss_decimate_by.c test-utf-dynamicss_decrease_by.c test-utf-dynamicss_increase.c test-utf-dynamicss_increase_by.c test-utf-dynamicss_resize.c
+build_sources_program test-utf-map_multis_adjust.c test-utf-map_multis_append.c test-utf-map_multis_append_all.c test-utf-map_multis_decimate_by.c test-utf-map_multis_decrease_by.c test-utf-map_multis_increase.c test-utf-map_multis_increase_by.c test-utf-map_multis_resize.c test-utf-map_multiss_adjust.c test-utf-map_multiss_append.c test-utf-map_multiss_append_all.c test-utf-map_multiss_decimate_by.c test-utf-map_multiss_decrease_by.c test-utf-map_multiss_increase.c test-utf-map_multiss_increase_by.c test-utf-map_multiss_resize.c
+build_sources_program test-utf-maps_adjust.c test-utf-maps_append.c test-utf-maps_append_all.c test-utf-maps_decimate_by.c test-utf-maps_decrease_by.c test-utf-maps_increase.c test-utf-maps_increase_by.c test-utf-maps_resize.c test-utf-mapss_adjust.c test-utf-mapss_append.c test-utf-mapss_append_all.c test-utf-mapss_decimate_by.c test-utf-mapss_decrease_by.c test-utf-mapss_increase.c test-utf-mapss_increase_by.c test-utf-mapss_resize.c
+build_sources_program test-utf-mash.c test-utf-mash_nulless.c
+build_sources_program test-utf-mish.c test-utf-mish_nulless.c
+build_sources_program test-utf-prepend.c test-utf-prepend_assure.c test-utf-prepend_assure_nulless.c test-utf-prepend_nulless.c
+build_sources_program test-utf-seek_line.c test-utf-seek_line_to.c test-utf-seek_to.c
+build_sources_program test-utf-triples_adjust.c test-utf-triples_append.c test-utf-triples_append_all.c test-utf-triples_decimate_by.c test-utf-triples_decrease_by.c test-utf-triples_increase.c test-utf-triples_increase_by.c test-utf-triples_resize.c test-utf-tripless_adjust.c test-utf-tripless_append.c test-utf-tripless_append_all.c test-utf-tripless_decimate_by.c test-utf-tripless_decrease_by.c test-utf-tripless_increase.c test-utf-tripless_increase_by.c test-utf-tripless_resize.c
+build_sources_program test-utf.c
+build_script no
+build_shared yes
+build_static no
+
+path_headers tests/unit/c
+path_sources tests/unit/c
+
+has_path_standard no
+preserve_path_headers no
+
+search_exclusive yes
+search_shared yes
+search_static yes
+
+defines
+defines -Ibuild/includes
+defines_static -Lbuild/libraries/static
+defines_shared -Lbuild/libraries/shared
+
+flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses
+flags-clang -Wno-logical-op-parentheses
+flags-test -fstack-protector
+flags_program -fPIE
+flags_program_shared
+flags_program_static
+flags_shared
+flags_static
--- /dev/null
+# fss-0005 iki-0002
+
+settings:
+ load_build yes
+ fail exit
+
+ environment LD_LIBRARY_PATH
+
+main:
+ build settings
+ build settings-tests
+
+ operate ld_library_path
+
+ if exists build/programs/shared/test-f_utf
+ shell build/programs/shared/test-f_utf
+
+ if exists build/programs/static/test-f_utf
+ shell build/programs/static/test-f_utf
+
+ if not exists build/programs/shared/test-f_utf
+ and not exists build/programs/static/test-f_utf
+ operate not_created
+
+not_created:
+ print
+ print 'context:"error"Failed to test due to being unable to find either a shared or static test binary to perform tests. context:"reset"'
+
+ exit failure
+
+ld_library_path:
+ if defined environment LD_LIBRARY_PATH
+ and defined parameter work
+ define LD_LIBRARY_PATH 'build/libraries/shared:parameter:"work:value"libraries/shared:define:"LD_LIBRARY_PATH"'
+
+ else
+ if defined environment LD_LIBRARY_PATH
+ define LD_LIBRARY_PATH 'build/libraries/shared:parameter:define:"LD_LIBRARY_PATH"'
+
+ else
+ if defined parameter work
+ define LD_LIBRARY_PATH 'build/libraries/shared:parameter:"work:value"libraries/shared'
+
+ else
+ define LD_LIBRARY_PATH build/libraries/shared
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_append__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_append(source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ assert_string_equal(destination.string, source.string);
+ assert_string_equal(destination.string + 3, source.string + 3);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_append__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_append(data.string, data.used, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_append_h
+#define _TEST__F_utf_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_append()
+ */
+extern void test__f_utf_append__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_append()
+ */
+extern void test__f_utf_append__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_append_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-append_assure.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_append_assure__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_append_assure(source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ assert_string_equal(destination.string, source.string);
+ assert_string_equal(destination.string + 3, source.string + 3);
+ }
+
+ // The string already exists, so destination should be unchanged.
+ {
+ const f_status_t status = f_utf_string_append_assure(source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ assert_string_equal(destination.string, source.string);
+ assert_string_equal(destination.string + 3, source.string + 3);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_append_assure__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_append_assure(data.string, data.used, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_append_assure_h
+#define _TEST__F_utf_append_assure_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_append_assure()
+ */
+extern void test__f_utf_append_assure__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_append_assure()
+ */
+extern void test__f_utf_append_assure__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_append_assure_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-append_assure_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_append_assure_nulless__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_append_assure_nulless(source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ // The string already exists, so destination should be unchanged.
+ {
+ const f_status_t status = f_utf_string_append_assure_nulless(source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_append_assure_nulless__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_append_assure_nulless(data.string, data.used, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_append_assure_nulless_h
+#define _TEST__F_utf_append_assure_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_append_assure_nulless()
+ */
+extern void test__f_utf_append_assure_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_append_assure_nulless()
+ */
+extern void test__f_utf_append_assure_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_append_assure_nulless_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-append_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_append_nulless__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_append_nulless(source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_append_nulless__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_append_nulless(data.string, data.used, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_append_nulless_h
+#define _TEST__F_utf_append_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_append_nulless()
+ */
+extern void test__f_utf_append_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_append_nulless()
+ */
+extern void test__f_utf_append_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_append_nulless_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_adjust__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.string);
+}
+
+void test__f_utf_dynamic_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.string);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf__string_dynamic_adjust
+#define _TEST__F_utf__string_dynamic_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_adjust()
+ */
+extern void test__f_utf_dynamic_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_adjust()
+ */
+extern void test__f_utf_dynamic_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_utf__string_dynamic_adjust
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_append__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ assert_string_equal(destination.string, source.string);
+ assert_string_equal(destination.string + 3, source.string + 3);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_append__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_append(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_append_h
+#define _TEST__F_utf_dynamic_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_append()
+ */
+extern void test__f_utf_dynamic_append__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_append()
+ */
+extern void test__f_utf_dynamic_append__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_append_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_append_assure.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_append_assure__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_append_assure(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ assert_string_equal(destination.string, source.string);
+ assert_string_equal(destination.string + 3, source.string + 3);
+ }
+
+ // The string already exists, so destination should be unchanged.
+ {
+ const f_status_t status = f_utf_string_dynamic_append_assure(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ assert_string_equal(destination.string, source.string);
+ assert_string_equal(destination.string + 3, source.string + 3);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_append_assure__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_append_assure(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_append_assure_h
+#define _TEST__F_utf_dynamic_append_assure_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_append_assure()
+ */
+extern void test__f_utf_dynamic_append_assure__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_append_assure()
+ */
+extern void test__f_utf_dynamic_append_assure__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_append_assure_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_append_assure_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_append_assure_nulless__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_append_assure_nulless(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ // The string already exists, so destination should be unchanged.
+ {
+ const f_status_t status = f_utf_string_dynamic_append_assure_nulless(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_append_assure_nulless__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_append_assure_nulless(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_append_assure_nulless_h
+#define _TEST__F_utf_dynamic_append_assure_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_append_assure_nulless()
+ */
+extern void test__f_utf_dynamic_append_assure_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_append_assure_nulless()
+ */
+extern void test__f_utf_dynamic_append_assure_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_append_assure_nulless_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_append_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_append_nulless__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_append_nulless(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_append_nulless__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_append_nulless(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_append_nulless_h
+#define _TEST__F_utf_dynamic_append_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_append_nulless()
+ */
+extern void test__f_utf_dynamic_append_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_append_nulless()
+ */
+extern void test__f_utf_dynamic_append_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_append_nulless_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_dynamic_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.string);
+}
+
+void test__f_utf_dynamic_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.string);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_dynamic_decimate_by_h
+#define _TEST__F_dynamic_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_decimate_by()
+ */
+extern void test__f_utf_dynamic_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_decimate_by()
+ */
+extern void test__f_utf_dynamic_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_dynamic_decimate_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_dynamic_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.string);
+}
+
+void test__f_utf_dynamic_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.string);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_decrease_by_h
+#define _TEST__F_utf_dynamic_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_decrease_by()
+ */
+extern void test__f_utf_dynamic_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_decrease_by()
+ */
+extern void test__f_utf_dynamic_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_decrease_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_increase__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_utf_string_dynamic_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
+ }
+
+ free((void *) data.string);
+}
+
+void test__f_utf_dynamic_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_dynamic_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.string);
+}
+
+void test__f_utf_dynamic_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.string);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_increase_h
+#define _TEST__F_utf_dynamic_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_increase()
+ */
+extern void test__f_utf_dynamic_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_dynamic_increase()
+ */
+extern void test__f_utf_dynamic_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_increase()
+ */
+extern void test__f_utf_dynamic_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_increase_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_utf_string_dynamic_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.string);
+}
+
+void test__f_utf_dynamic_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.string);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_increase_by_h
+#define _TEST__F_utf_dynamic_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_increase_by()
+ */
+extern void test__f_utf_dynamic_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_increase_by()
+ */
+extern void test__f_utf_dynamic_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_increase_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_mash.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_mash__works(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("te\0st:te\0st", 0, 11);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_mash(glue, source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ assert_string_equal(destination.string, source.string);
+ assert_string_equal(destination.string + 3, source.string + 3);
+ }
+
+ // Check that the glue is added.
+ {
+ const f_status_t status = f_utf_string_dynamic_mash(glue, source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ assert_string_equal(destination.string + 3, expected.string + 3);
+ assert_string_equal(destination.string + 9, expected.string + 9);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_mash__parameter_checking(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+
+ {
+ const f_status_t status = f_utf_string_dynamic_mash(glue, source, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_mash_h
+#define _TEST__F_utf_dynamic_mash_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_mash()
+ */
+extern void test__f_utf_dynamic_mash__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_mash()
+ */
+extern void test__f_utf_dynamic_mash__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_mash_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_mash_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_mash_nulless__works(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize("test:test", 0, 9);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_mash_nulless(glue, source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected1.used);
+
+ assert_string_equal(destination.string, expected1.string);
+ }
+
+ // Check that the glue is added.
+ {
+ const f_status_t status = f_utf_string_dynamic_mash_nulless(glue, source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected2.used);
+
+ assert_string_equal(destination.string, expected2.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_mash_nulless__parameter_checking(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+
+ {
+ const f_status_t status = f_utf_string_dynamic_mash_nulless(glue, source, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_mash_nulless_h
+#define _TEST__F_utf_dynamic_mash_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_mash_nulless()
+ */
+extern void test__f_utf_dynamic_mash_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_mash_nulless()
+ */
+extern void test__f_utf_dynamic_mash_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_mash_nulless_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_mish.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_mish__works(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("te\0st:te\0st", 0, 11);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_mish(glue, source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ assert_string_equal(destination.string, source.string);
+ assert_string_equal(destination.string + 3, source.string + 3);
+ }
+
+ // Check that the glue is added.
+ {
+ const f_status_t status = f_utf_string_dynamic_mish(glue, source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ assert_string_equal(destination.string + 3, expected.string + 3);
+ assert_string_equal(destination.string + 9, expected.string + 9);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_mish__parameter_checking(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+
+ {
+ const f_status_t status = f_utf_string_dynamic_mish(glue, source, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_mish_h
+#define _TEST__F_utf_dynamic_mish_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_mish()
+ */
+extern void test__f_utf_dynamic_mish__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_mish()
+ */
+extern void test__f_utf_dynamic_mish__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_mish_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_mish_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_mish_nulless__works(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize("test:test", 0, 9);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_mish_nulless(glue, source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected1.used);
+
+ assert_string_equal(destination.string, expected1.string);
+ }
+
+ // Check that the glue is added.
+ {
+ const f_status_t status = f_utf_string_dynamic_mish_nulless(glue, source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected2.used);
+
+ assert_string_equal(destination.string, expected2.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_mish_nulless__parameter_checking(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+
+ {
+ const f_status_t status = f_utf_string_dynamic_mish_nulless(glue, source, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_mish_nulless_h
+#define _TEST__F_utf_dynamic_mish_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_mish_nulless()
+ */
+extern void test__f_utf_dynamic_mish_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_mish_nulless()
+ */
+extern void test__f_utf_dynamic_mish_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_mish_nulless_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_partial_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_partial_append__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_append(source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ assert_string_equal(destination.string + 3, expected.string + 3);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_partial_append__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+ const f_string_range_t partial = f_utf_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_append(data, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_partial_append_h
+#define _TEST__F_utf_dynamic_partial_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_partial_append()
+ */
+extern void test__f_utf_dynamic_partial_append__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_partial_append()
+ */
+extern void test__f_utf_dynamic_partial_append__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_partial_append_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_partial_append_assure.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_partial_append_assure__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_append(expected, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ assert_string_equal(destination.string + 3, expected.string + 3);
+ }
+
+ // The string already exists, so destination should be unchanged.
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_append_assure(source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ assert_string_equal(destination.string + 3, expected.string + 3);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_partial_append_assure__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+ const f_string_range_t partial = f_utf_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_append_assure(data, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_partial_append_assure_h
+#define _TEST__F_utf_dynamic_partial_append_assure_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_partial_append_assure()
+ */
+extern void test__f_utf_dynamic_partial_append_assure__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_partial_append_assure()
+ */
+extern void test__f_utf_dynamic_partial_append_assure__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_partial_append_assure_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_partial_append_assure_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_partial_append_assure_nulless__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_append(expected, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ // The string already exists, so destination should be unchanged.
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_append_assure_nulless(source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_partial_append_assure_nulless__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+ const f_string_range_t partial = f_utf_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_append_assure_nulless(data, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_partial_append_assure_nulless_h
+#define _TEST__F_utf_dynamic_partial_append_assure_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_partial_append_assure_nulless()
+ */
+extern void test__f_utf_dynamic_partial_append_assure_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_partial_append_assure_nulless()
+ */
+extern void test__f_utf_dynamic_partial_append_assure_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_partial_append_assure_nulless_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_partial_append_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_partial_append_nulless__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_append_nulless(source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_partial_append_nulless__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+ const f_string_range_t partial = f_utf_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_append_nulless(data, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_partial_append_nulless_h
+#define _TEST__F_utf_dynamic_partial_append_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_partial_append_nulless()
+ */
+extern void test__f_utf_dynamic_partial_append_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_partial_append_nulless()
+ */
+extern void test__f_utf_dynamic_partial_append_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_partial_append_nulless_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_partial_mash.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_partial_mash__works(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize("te\0st:te\0st", 0, 11);
+ const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_mash(glue, source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected1.used);
+
+ assert_string_equal(destination.string, expected1.string);
+ assert_string_equal(destination.string + 3, expected1.string + 3);
+ }
+
+ // Check that the glue is added.
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_mash(glue, source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected2.used);
+
+ assert_string_equal(destination.string, expected2.string);
+ assert_string_equal(destination.string + 3, expected2.string + 3);
+ assert_string_equal(destination.string + 9, expected2.string + 9);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_partial_mash__parameter_checking(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_string_range_t partial = f_utf_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_mash(glue, source, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_partial_mash_h
+#define _TEST__F_utf_dynamic_partial_mash_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_partial_mash()
+ */
+extern void test__f_utf_dynamic_partial_mash__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_partial_mash()
+ */
+extern void test__f_utf_dynamic_partial_mash__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_partial_mash_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_partial_mash_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_partial_mash_nulless__works(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize("test:test", 0, 9);
+ const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_mash_nulless(glue, source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected1.used);
+
+ assert_string_equal(destination.string, expected1.string);
+ }
+
+ // Check that the glue is added.
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_mash_nulless(glue, source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected2.used);
+
+ assert_string_equal(destination.string, expected2.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_partial_mash_nulless__parameter_checking(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_string_range_t partial = f_utf_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_mash_nulless(glue, source, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_partial_mash_nulless_h
+#define _TEST__F_utf_dynamic_partial_mash_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_partial_mash_nulless()
+ */
+extern void test__f_utf_dynamic_partial_mash_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_partial_mash_nulless()
+ */
+extern void test__f_utf_dynamic_partial_mash_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_partial_mash_nulless_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_partial_mish.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_partial_mish__works(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize("te\0st:te\0st", 0, 11);
+ const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_mish(glue, source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected1.used);
+
+ assert_string_equal(destination.string, expected1.string);
+ assert_string_equal(destination.string + 3, expected1.string + 3);
+ }
+
+ // Check that the glue is added.
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_mish(glue, source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected2.used);
+
+ assert_string_equal(destination.string, expected2.string);
+ assert_string_equal(destination.string + 3, expected2.string + 3);
+ assert_string_equal(destination.string + 9, expected2.string + 9);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_partial_mish__parameter_checking(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_string_range_t partial = f_utf_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_mish(glue, source, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_partial_mish_h
+#define _TEST__F_utf_dynamic_partial_mish_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_partial_mish()
+ */
+extern void test__f_utf_dynamic_partial_mish__works(void **state);
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_partial_mish()
+ */
+extern void test__f_utf_dynamic_partial_mish__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_partial_mish_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_partial_mish_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_partial_mish_nulless__works(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize("test:test", 0, 9);
+ const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_mish_nulless(glue, source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected1.used);
+
+ assert_string_equal(destination.string, expected1.string);
+ }
+
+ // Check that the glue is added.
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_mish_nulless(glue, source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected2.used);
+
+ assert_string_equal(destination.string, expected2.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_partial_mish_nulless__parameter_checking(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_string_range_t partial = f_utf_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_mish_nulless(glue, source, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_partial_mish_nulless_h
+#define _TEST__F_utf_dynamic_partial_mish_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_partial_mish_nulless()
+ */
+extern void test__f_utf_dynamic_partial_mish_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_partial_mish_nulless()
+ */
+extern void test__f_utf_dynamic_partial_mish_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_partial_mish_nulless_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_partial_prepend.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_partial_prepend__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_prepend(source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ assert_string_equal(destination.string + 3, expected.string + 3);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_partial_prepend__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+ const f_string_range_t partial = f_utf_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_prepend(data, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_partial_prepend_h
+#define _TEST__F_utf_dynamic_partial_prepend_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_partial_prepend()
+ */
+extern void test__f_utf_dynamic_partial_prepend__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_partial_prepend()
+ */
+extern void test__f_utf_dynamic_partial_prepend__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_partial_prepend_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_partial_prepend_assure.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_partial_prepend_assure__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_prepend_assure(source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ assert_string_equal(destination.string + 3, expected.string + 3);
+ }
+
+ // The string already exists, so destination should be unchanged.
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_prepend_assure(source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ assert_string_equal(destination.string + 3, expected.string + 3);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_partial_prepend_assure__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+ const f_string_range_t partial = f_utf_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_prepend_assure(data, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_partial_prepend_assure_h
+#define _TEST__F_utf_dynamic_partial_prepend_assure_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_partial_prepend_assure()
+ */
+extern void test__f_utf_dynamic_partial_prepend_assure__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_partial_prepend_assure()
+ */
+extern void test__f_utf_dynamic_partial_prepend_assure__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_partial_prepend_assure_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_partial_prepend_assure_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_partial_prepend_assure_nulless__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_prepend_assure_nulless(source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ // The string already exists, so destination should be unchanged.
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_prepend_assure_nulless(source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_partial_prepend_assure_nulless__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+ const f_string_range_t partial = f_utf_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_prepend_assure_nulless(data, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_partial_prepend_assure_nulless_h
+#define _TEST__F_utf_dynamic_partial_prepend_assure_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_partial_prepend_assure_nulless()
+ */
+extern void test__f_utf_dynamic_partial_prepend_assure_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_partial_prepend_assure_nulless()
+ */
+extern void test__f_utf_dynamic_partial_prepend_assure_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_partial_prepend_assure_nulless_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_partial_prepend_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_partial_prepend_nulless__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_prepend_nulless(source, partial, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_partial_prepend_nulless__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+ const f_string_range_t partial = f_utf_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_partial_prepend_nulless(data, partial, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_partial_prepend_nulless_h
+#define _TEST__F_utf_dynamic_partial_prepend_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_partial_prepend_nulless()
+ */
+extern void test__f_utf_dynamic_partial_prepend_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_partial_prepend_nulless()
+ */
+extern void test__f_utf_dynamic_partial_prepend_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_partial_prepend_nulless_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_prepend.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_prepend__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_prepend(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ assert_string_equal(destination.string, source.string);
+ assert_string_equal(destination.string + 3, source.string + 3);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_prepend__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_prepend(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_prepend_h
+#define _TEST__F_utf_dynamic_prepend_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_prepend()
+ */
+extern void test__f_utf_dynamic_prepend__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_prepend()
+ */
+extern void test__f_utf_dynamic_prepend__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_prepend_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_prepend_assure.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_prepend_assure__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_prepend_assure(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ assert_string_equal(destination.string, source.string);
+ assert_string_equal(destination.string + 3, source.string + 3);
+ }
+
+ // The string already exists, so destination should be unchanged.
+ {
+ const f_status_t status = f_utf_string_dynamic_prepend_assure(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ assert_string_equal(destination.string, source.string);
+ assert_string_equal(destination.string + 3, source.string + 3);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_prepend_assure__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_prepend_assure(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_prepend_assure_h
+#define _TEST__F_utf_dynamic_prepend_assure_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_prepend_assure()
+ */
+extern void test__f_utf_dynamic_prepend_assure__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_prepend_assure()
+ */
+extern void test__f_utf_dynamic_prepend_assure__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_prepend_assure_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_prepend_assure_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_prepend_assure_nulless__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_prepend_assure_nulless(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ // The string already exists, so destination should be unchanged.
+ {
+ const f_status_t status = f_utf_string_dynamic_prepend_assure_nulless(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_prepend_assure_nulless__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_prepend_assure_nulless(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_prepend_assure_nulless_h
+#define _TEST__F_utf_dynamic_prepend_assure_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_prepend_assure_nulless()
+ */
+extern void test__f_utf_dynamic_prepend_assure_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_prepend_assure_nulless()
+ */
+extern void test__f_utf_dynamic_prepend_assure_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_prepend_assure_nulless_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_prepend_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_prepend_nulless__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_prepend_nulless(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_dynamic_prepend_nulless__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_prepend_nulless(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_prepend_nulless_h
+#define _TEST__F_utf_dynamic_prepend_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_prepend_nulless()
+ */
+extern void test__f_utf_dynamic_prepend_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_prepend_nulless()
+ */
+extern void test__f_utf_dynamic_prepend_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_prepend_nulless_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_resize__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.string);
+}
+
+void test__f_utf_dynamic_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamic_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.string);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_resize_h
+#define _TEST__F_utf_dynamic_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_resize()
+ */
+extern void test__f_utf_dynamic_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_resize()
+ */
+extern void test__f_utf_dynamic_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_resize_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_seek_line.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_seek_line__returns_data_not_stop(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+
+ {
+ f_string_range_t range = f_utf_string_range_t_initialize;
+
+ const f_status_t status = f_utf_string_dynamic_seek_line(source, &range);
+
+ assert_int_equal(status, F_data_not_stop);
+ }
+}
+
+void test__f_utf_dynamic_seek_line__returns_none_eos(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test", 0, 4);
+
+ {
+ f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+
+ const f_status_t status = f_utf_string_dynamic_seek_line(source, &range);
+
+ assert_int_equal(status, F_none_eos);
+
+ assert_int_equal(range.start, source.used);
+ assert_int_equal(range.stop, source.used - 1);
+ }
+}
+
+void test__f_utf_dynamic_seek_line__returns_none_stop(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test", 0, 4);
+
+ {
+ f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 2);
+
+ const f_status_t status = f_utf_string_dynamic_seek_line(source, &range);
+
+ assert_int_equal(status, F_none_stop);
+
+ assert_int_equal(range.start, source.used - 1);
+ assert_int_equal(range.stop, source.used - 2);
+ }
+}
+
+void test__f_utf_dynamic_seek_line__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+
+ {
+ f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+
+ const f_status_t status = f_utf_string_dynamic_seek_line(source, &range);
+
+ assert_int_equal(status, F_none);
+
+ assert_int_equal(range.start, 4);
+ assert_int_equal(range.stop, source.used - 1);
+ }
+}
+
+void test__f_utf_dynamic_seek_line__parameter_checking(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("teX\nst", 0, 6);
+
+ {
+ const f_status_t status = f_utf_string_dynamic_seek_line(source, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_seek_line_h
+#define _TEST__F_utf_dynamic_seek_line_h
+
+/**
+ * Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop).
+ *
+ * @see f_utf_string_dynamic_seek_line()
+ */
+extern void test__f_utf_dynamic_seek_line__returns_data_not_stop(void **state);
+
+/**
+ * Test that the function returns F_none_eos stopped after end of string because no newline is found.
+ *
+ * @see f_utf_string_dynamic_seek_line()
+ */
+extern void test__f_utf_dynamic_seek_line__returns_none_eos(void **state);
+
+/**
+ * Test that the function returns F_none_stop stopped after end of range because no newline is found.
+ *
+ * @see f_utf_string_dynamic_seek_line()
+ */
+extern void test__f_utf_dynamic_seek_line__returns_none_stop(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_seek_line()
+ */
+extern void test__f_utf_dynamic_seek_line__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_seek_line()
+ */
+extern void test__f_utf_dynamic_seek_line__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_seek_line_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_seek_line_to.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_seek_line_to__at_newline(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\nXst", 0, 6);
+
+ {
+ f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+
+ const f_status_t status = f_utf_string_dynamic_seek_line_to(source, to.string[0], &range);
+
+ assert_int_equal(status, F_none_eol);
+
+ assert_int_equal(range.start, 2);
+ assert_int_equal(range.stop, source.used - 1);
+ }
+}
+
+void test__f_utf_dynamic_seek_line_to__returns_data_not_stop(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+
+ {
+ f_string_range_t range = f_utf_string_range_t_initialize;
+
+ const f_status_t status = f_utf_string_dynamic_seek_line_to(source, to.string[0], &range);
+
+ assert_int_equal(status, F_data_not_stop);
+ }
+}
+
+void test__f_utf_dynamic_seek_line_to__returns_none_eos(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test", 0, 4);
+
+ {
+ f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+
+ const f_status_t status = f_utf_string_dynamic_seek_line_to(source, to.string[0], &range);
+
+ assert_int_equal(status, F_none_eos);
+
+ assert_int_equal(range.start, source.used);
+ assert_int_equal(range.stop, source.used - 1);
+ }
+}
+
+void test__f_utf_dynamic_seek_line_to__returns_none_stop(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test", 0, 4);
+
+ {
+ f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 2);
+
+ const f_status_t status = f_utf_string_dynamic_seek_line_to(source, to.string[0], &range);
+
+ assert_int_equal(status, F_none_stop);
+
+ assert_int_equal(range.start, source.used - 1);
+ assert_int_equal(range.stop, source.used - 2);
+ }
+}
+
+void test__f_utf_dynamic_seek_line_to__works(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("teX\nst", 0, 6);
+
+ {
+ f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+
+ const f_status_t status = f_utf_string_dynamic_seek_line_to(source, to.string[0], &range);
+
+ assert_int_equal(status, F_none);
+
+ assert_int_equal(range.start, 2);
+ assert_int_equal(range.stop, source.used - 1);
+ }
+}
+
+void test__f_utf_dynamic_seek_line_to__parameter_checking(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("teX\nst", 0, 6);
+
+ {
+ const f_status_t status = f_utf_string_dynamic_seek_line_to(source, to.string[0], 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_seek_line_to_h
+#define _TEST__F_utf_dynamic_seek_line_to_h
+
+/**
+ * Test that the function works but stops at newline rather than search string.
+ *
+ * @see f_utf_string_dynamic_seek_line_to()
+ */
+extern void test__f_utf_dynamic_seek_line_to__at_newline(void **state);
+
+/**
+ * Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop).
+ *
+ * @see f_utf_string_dynamic_seek_line_to()
+ */
+extern void test__f_utf_dynamic_seek_line_to__returns_data_not_stop(void **state);
+
+/**
+ * Test that the function returns F_none_eos stopped after end of string because no newline is found.
+ *
+ * @see f_utf_string_dynamic_seek_line_to()
+ */
+extern void test__f_utf_dynamic_seek_line_to__returns_none_eos(void **state);
+
+/**
+ * Test that the function returns F_none_stop stopped after end of range because no newline is found.
+ *
+ * @see f_utf_string_dynamic_seek_line_to()
+ */
+extern void test__f_utf_dynamic_seek_line_to__returns_none_stop(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_seek_line_to()
+ */
+extern void test__f_utf_dynamic_seek_line_to__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_seek_line_to()
+ */
+extern void test__f_utf_dynamic_seek_line_to__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_seek_line_to_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_seek_to.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_seek_to__returns_data_not_stop(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+
+ {
+ f_string_range_t range = f_utf_string_range_t_initialize;
+
+ const f_status_t status = f_utf_string_dynamic_seek_to(source, to.string[0], &range);
+
+ assert_int_equal(status, F_data_not_stop);
+ }
+}
+
+void test__f_utf_dynamic_seek_to__returns_none_eos(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+
+ {
+ f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+
+ const f_status_t status = f_utf_string_dynamic_seek_to(source, to.string[0], &range);
+
+ assert_int_equal(status, F_none_eos);
+
+ assert_int_equal(range.start, source.used);
+ assert_int_equal(range.stop, source.used - 1);
+ }
+}
+
+void test__f_utf_dynamic_seek_to__returns_none_stop(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+
+ {
+ f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 2);
+
+ const f_status_t status = f_utf_string_dynamic_seek_to(source, to.string[0], &range);
+
+ assert_int_equal(status, F_none_stop);
+
+ assert_int_equal(range.start, source.used - 1);
+ assert_int_equal(range.stop, source.used - 2);
+ }
+}
+
+void test__f_utf_dynamic_seek_to__works(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\nXst", 0, 6);
+
+ {
+ f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+
+ const f_status_t status = f_utf_string_dynamic_seek_to(source, to.string[0], &range);
+
+ assert_int_equal(status, F_none);
+
+ assert_int_equal(range.start, 3);
+ assert_int_equal(range.stop, source.used - 1);
+ }
+}
+
+void test__f_utf_dynamic_seek_to__parameter_checking(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("teX\nst", 0, 6);
+
+ {
+ const f_status_t status = f_utf_string_dynamic_seek_to(source, to.string[0], 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_seek_to_h
+#define _TEST__F_utf_dynamic_seek_to_h
+
+/**
+ * Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop).
+ *
+ * @see f_utf_string_dynamic_seek_to()
+ */
+extern void test__f_utf_dynamic_seek_to__returns_data_not_stop(void **state);
+
+/**
+ * Test that the function returns F_none_eos stopped after end of string because no newline is found.
+ *
+ * @see f_utf_string_dynamic_seek_to()
+ */
+extern void test__f_utf_dynamic_seek_to__returns_none_eos(void **state);
+
+/**
+ * Test that the function returns F_none_stop stopped after end of range because no newline is found.
+ *
+ * @see f_utf_string_dynamic_seek_to()
+ */
+extern void test__f_utf_dynamic_seek_to__returns_none_stop(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamic_seek_to()
+ */
+extern void test__f_utf_dynamic_seek_to__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_seek_to()
+ */
+extern void test__f_utf_dynamic_seek_to__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_seek_to_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_terminate.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamic_terminate__appends_null(void **state) {
+
+ const f_array_length_t length = 2;
+ f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ // Put some value in the unused section at the end so that it gets overridden.
+ {
+ const f_status_t status = f_utf_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+
+ data.string[0] = 'X';
+ }
+
+ {
+ const f_status_t status = f_utf_string_dynamic_terminate(&data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 1);
+ assert_int_equal(data.string[0], 0);
+ }
+
+ free((void *) data.string);
+}
+
+void test__f_utf_dynamic_terminate__doesnt_append_null(void **state) {
+
+ const f_array_length_t length = 2;
+ f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ // Ensure a NULL already exists so that the test can confirm that another NULL is not appended.
+ {
+ const f_status_t status = f_utf_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+
+ data.string[0] = 0;
+ }
+
+ {
+ const f_status_t status = f_utf_string_dynamic_terminate(&data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 1);
+ assert_int_equal(data.string[0], 0);
+ }
+
+ free((void *) data.string);
+}
+
+void test__f_utf_dynamic_terminate__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_utf_string_dynamic_terminate(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_terminate_h
+#define _TEST__F_utf_dynamic_terminate_h
+
+/**
+ * Test that the function appends a NULL.
+ *
+ * @see f_utf_string_dynamic_terminate()
+ */
+extern void test__f_utf_dynamic_terminate__appends_null(void **state);
+
+/**
+ * Test that the function does not append a NULL.
+ *
+ * @see f_utf_string_dynamic_terminate()
+ */
+extern void test__f_utf_dynamic_terminate__doesnt_append_null(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_terminate()
+ */
+extern void test__f_utf_dynamic_terminate__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_terminate_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamic_terminate_after.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+void test__f_utf_dynamic_terminate_after__appends_null(void **state) {
+
+ const f_array_length_t length = 2;
+ f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ // Put some value in the unused section at the end so that it gets overridden.
+ {
+ const f_status_t status = f_utf_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+
+ data.string[0] = 'X';
+ }
+
+ {
+ const f_status_t status = f_utf_string_dynamic_terminate_after(&data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_in_range(data.size, 1, 1 + F_memory_default_allocation_small_d);
+
+ assert_int_equal(data.string[data.used], 0);
+ }
+
+ free((void *) data.string);
+}
+
+void test__f_utf_dynamic_terminate_after__doesnt_append_null(void **state) {
+
+ const f_array_length_t length = 2;
+ f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ // Ensure a NULL already exists so that the test can confirm that another NULL is not appended.
+ {
+ const f_status_t status = f_utf_string_dynamic_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_in_range(data.size, length, length + F_memory_default_allocation_small_d);
+
+ data.string[0] = 0;
+ }
+
+ {
+ const f_status_t status = f_utf_string_dynamic_terminate_after(&data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_in_range(data.size, length, length + F_memory_default_allocation_small_d);
+
+ assert_int_equal(data.string[data.used], 0);
+ }
+
+ free((void *) data.string);
+}
+
+void test__f_utf_dynamic_terminate_after__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_utf_string_dynamic_terminate_after(0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamic_terminate_after_h
+#define _TEST__F_utf_dynamic_terminate_after_h
+
+/**
+ * Test that the function appends a new line.
+ *
+ * @see f_utf_string_dynamic_terminate_after()
+ */
+extern void test__f_utf_dynamic_terminate_after__appends_null(void **state);
+
+/**
+ * Test that the function does not append a new line.
+ *
+ * @see f_utf_string_dynamic_terminate_after()
+ */
+extern void test__f_utf_dynamic_terminate_after__doesnt_append_null(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamic_terminate_after()
+ */
+extern void test__f_utf_dynamic_terminate_after__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamic_terminate_after_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamics_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamics_adjust__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamics_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_dynamics_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamics_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf__string_dynamics_adjust
+#define _TEST__F_utf__string_dynamics_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamics_adjust()
+ */
+extern void test__f_utf_dynamics_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamics_adjust()
+ */
+extern void test__f_utf_dynamics_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_utf__string_dynamics_adjust
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamics_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamics_append__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ f_utf_string_dynamics_t destination = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamics_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].used, source.used);
+
+ assert_string_equal(destination.array[0].string, source.string);
+ assert_string_equal(destination.array[0].string + 3, source.string + 3);
+ }
+
+ free((void *) destination.array[0].string);
+ free((void *) destination.array);
+}
+
+void test__f_utf_dynamics_append__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamics_append(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamics_append_h
+#define _TEST__F_utf_dynamics_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamics_append()
+ */
+extern void test__f_utf_dynamics_append__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamics_append()
+ */
+extern void test__f_utf_dynamics_append__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamics_append_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamics_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamics_append_all__works(void **state) {
+
+ const int length_inner = 2;
+ f_utf_string_dynamics_t source = f_utf_string_dynamics_t_initialize;
+ f_utf_string_dynamics_t destination = f_utf_string_dynamics_t_initialize;
+
+ const f_utf_string_static_t test_sources[] = {
+ macro_f_utf_string_static_t_initialize("te\0st1", 0, 6),
+ macro_f_utf_string_static_t_initialize("test2", 0, 5),
+ };
+
+ {
+ f_status_t status = f_utf_string_dynamics_resize(length_inner, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.size, length_inner);
+
+ for (; source.used < length_inner; ++source.used) {
+
+ status = f_utf_string_dynamic_append(test_sources[source.used], &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[source.used].used, test_sources[source.used].used);
+
+ assert_string_equal(source.array[source.used].string, test_sources[source.used].string);
+ assert_string_equal(source.array[source.used].string + 3, test_sources[source.used].string + 3);
+ } // for
+ }
+
+ {
+ const f_status_t status = f_utf_string_dynamics_append_all(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+ assert_int_equal(destination.size, source.used);
+
+ for (f_array_length_t i = 0; i < length_inner; ++i) {
+
+ assert_int_equal(destination.array[i].used, source.array[i].used);
+
+ assert_string_equal(destination.array[i].string, source.array[i].string);
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].string);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].string);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_utf_dynamics_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamics_t source = f_utf_string_dynamics_t_initialize;
+ f_utf_string_dynamics_t destination = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamics_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_dynamics_append_all(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ assert_null(destination.array);
+ }
+
+ free((void *) source.array);
+}
+
+void test__f_utf_dynamics_append_all__parameter_checking(void **state) {
+
+ const f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamics_append_all(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamics_append_all_h
+#define _TEST__F_utf_dynamics_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamics_append_all()
+ */
+extern void test__f_utf_dynamics_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_dynamics_append_all()
+ */
+extern void test__f_utf_dynamics_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamics_append_all()
+ */
+extern void test__f_utf_dynamics_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamics_append_all_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamics_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamics_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamics_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_dynamics_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_utf_dynamics_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamics_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_dynamics_decimate_by_h
+#define _TEST__F_dynamics_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamics_decimate_by()
+ */
+extern void test__f_utf_dynamics_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamics_decimate_by()
+ */
+extern void test__f_utf_dynamics_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_dynamics_decimate_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamics_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamics_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamics_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_dynamics_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_utf_dynamics_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamics_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamics_decrease_by_h
+#define _TEST__F_utf_dynamics_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamics_decrease_by()
+ */
+extern void test__f_utf_dynamics_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamics_decrease_by()
+ */
+extern void test__f_utf_dynamics_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamics_decrease_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamics_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamics_increase__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamics_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_utf_string_dynamics_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_dynamics_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamics_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_dynamics_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_dynamics_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamics_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamics_increase_h
+#define _TEST__F_utf_dynamics_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamics_increase()
+ */
+extern void test__f_utf_dynamics_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_dynamics_increase()
+ */
+extern void test__f_utf_dynamics_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamics_increase()
+ */
+extern void test__f_utf_dynamics_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamics_increase_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamics_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamics_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamics_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_utf_string_dynamics_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_dynamics_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamics_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamics_increase_by_h
+#define _TEST__F_utf_dynamics_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamics_increase_by()
+ */
+extern void test__f_utf_dynamics_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamics_increase_by()
+ */
+extern void test__f_utf_dynamics_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamics_increase_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamics_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamics_resize__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamics_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_dynamics_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamics_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamics_resize_h
+#define _TEST__F_utf_dynamics_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamics_resize()
+ */
+extern void test__f_utf_dynamics_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamics_resize()
+ */
+extern void test__f_utf_dynamics_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamics_resize_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamicss_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamicss_adjust__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamicss_t data = f_utf_string_dynamicss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_dynamicss_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamicss_t data = f_utf_string_dynamicss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamicss_adjust_h
+#define _TEST__F_utf_dynamicss_adjust_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamicss_adjust()
+ */
+extern void test__f_utf_dynamicss_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamicss_adjust()
+ */
+extern void test__f_utf_dynamicss_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamicss_adjust_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamicss_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamicss_append__works(void **state) {
+
+ const int length_inner = 2;
+ f_utf_string_dynamics_t source = f_utf_string_dynamics_t_initialize;
+ f_utf_string_dynamicss_t destination = f_utf_string_dynamicss_t_initialize;
+
+ const f_utf_string_static_t test_names[] = {
+ macro_f_utf_string_static_t_initialize("test1", 0, 5),
+ macro_f_utf_string_static_t_initialize("test2", 0, 5),
+ };
+
+ {
+ f_status_t status = f_utf_string_dynamics_resize(length_inner, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.size, length_inner);
+
+ for (; source.used < length_inner; ++source.used) {
+
+ status = f_utf_string_dynamic_append(test_names[source.used], &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+ assert_string_equal(source.array[source.used].string, test_names[source.used].string);
+ assert_int_equal(source.array[source.used].used, test_names[source.used].used);
+ } // for
+ }
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.array[0].used, length_inner);
+
+ for (f_array_length_t i = 0; i < length_inner; ++i) {
+
+ assert_int_equal(destination.array[0].array[i].used, test_names[i].used);
+ assert_string_equal(destination.array[0].array[i].string, test_names[i].string);
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].string);
+ } // for
+
+
+ for (f_array_length_t i = 0; i < destination.array[0].used; ++i) {
+ free((void *) destination.array[0].array[i].string);
+ } // for
+
+ free((void *) destination.array[0].array);
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_utf_dynamicss_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamics_t source = f_utf_string_dynamicss_t_initialize;
+ f_utf_string_dynamicss_t destination = f_utf_string_dynamicss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamics_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_append(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ assert_null(destination.array);
+ }
+
+ free((void *) source.array);
+}
+
+void test__f_utf_dynamicss_append__parameter_checking(void **state) {
+
+ f_utf_string_dynamics_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_append(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamicss_append_h
+#define _TEST__F_utf_dynamicss_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamicss_append()
+ */
+extern void test__f_utf_dynamicss_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_dynamicss_append()
+ */
+extern void test__f_utf_dynamicss_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamicss_append()
+ */
+extern void test__f_utf_dynamicss_append__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamicss_append_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamicss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamicss_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ const int length_outer = 2;
+ f_utf_string_dynamicss_t source = f_utf_string_dynamicss_t_initialize;
+ f_utf_string_dynamicss_t destination = f_utf_string_dynamicss_t_initialize;
+
+ const f_utf_string_static_t test_names[] = {
+ macro_f_utf_string_static_t_initialize("test1", 0, 5),
+ macro_f_utf_string_static_t_initialize("test2", 0, 5),
+ };
+
+ {
+ f_status_t status = f_utf_string_dynamicss_resize(length_outer, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length_outer);
+
+ f_array_length_t i = 0;
+ f_array_length_t j = 0;
+
+ for (; source.used < length_outer; ++source.used) {
+
+ status = f_utf_string_dynamics_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[source.used].used, 0);
+ assert_int_equal(source.array[source.used].size, length_inner);
+
+ for (i = 0; i < length_inner; ++i) {
+
+ status = f_utf_string_dynamic_append(test_names[i], &source.array[source.used].array[i]);
+
+ assert_int_equal(status, F_none);
+ assert_string_equal(source.array[source.used].array[i].string, test_names[i].string);
+ assert_int_equal(source.array[source.used].array[i].used, test_names[i].used);
+ } // for
+
+ source.array[source.used].used = length_inner;
+ } // for
+ }
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_append_all(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ for (f_array_length_t j = 0; j < length_outer; ++j) {
+
+ for (f_array_length_t i = 0; i < length_inner; ++i) {
+
+ assert_int_equal(destination.array[j].array[i].used, test_names[i].used);
+
+ assert_string_equal(destination.array[j].array[i].string, test_names[i].string);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t j = 0; j < source.used; ++j) {
+
+ for (f_array_length_t i = 0; i < source.array[j].used; ++i) {
+ free((void *) source.array[j].array[i].string);
+ } // for
+
+ free((void *) source.array[j].array);
+ } // for
+
+ for (f_array_length_t j = 0; j < destination.used; ++j) {
+
+ for (f_array_length_t i = 0; i < destination.array[j].used; ++i) {
+ free((void *) destination.array[j].array[i].string);
+ } // for
+
+ free((void *) destination.array[j].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_utf_dynamicss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamicss_t source = f_utf_string_dynamicss_t_initialize;
+ f_utf_string_dynamicss_t destination = f_utf_string_dynamicss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_append_all(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ assert_null(destination.array);
+ }
+
+ free((void *) source.array);
+}
+
+void test__f_utf_dynamicss_append_all__parameter_checking(void **state) {
+
+ const f_utf_string_dynamicss_t data = f_utf_string_dynamicss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_append_all(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamicss_append_all_h
+#define _TEST__F_utf_dynamicss_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamicss_append_all()
+ */
+extern void test__f_utf_dynamicss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_dynamicss_append_all()
+ */
+extern void test__f_utf_dynamicss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamicss_append_all()
+ */
+extern void test__f_utf_dynamicss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamicss_append_all_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamicss_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamicss_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamicss_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_utf_dynamicss_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamicss_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamicss_decimate_by_h
+#define _TEST__F_utf_dynamicss_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamicss_decimate_by()
+ */
+extern void test__f_utf_dynamicss_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamicss_decimate_by()
+ */
+extern void test__f_utf_dynamicss_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamicss_decimate_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamicss_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamicss_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamicss_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_utf_dynamicss_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamicss_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamicss_decrease_by_h
+#define _TEST__F_utf_dynamicss_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_utf_string_dynamicss_decrease_by()
+ */
+extern void test__f_utf_dynamicss_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_utf_string_dynamicss_decrease_by()
+ */
+extern void test__f_utf_dynamicss_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamicss_decrease_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamicss_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamicss_increase__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamicss_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_utf_string_dynamicss_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_dynamicss_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamicss_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_dynamicss_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamicss_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamicss_increase_h
+#define _TEST__F_utf_dynamicss_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamicss_increase()
+ */
+extern void test__f_utf_dynamicss_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_dynamicss_increase()
+ */
+extern void test__f_utf_dynamicss_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamicss_increase()
+ */
+extern void test__f_utf_dynamicss_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamicss_increase_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamicss_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamicss_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamicss_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_utf_string_dynamicss_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_dynamicss_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamicss_t data = f_utf_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamicss_increase_by_h
+#define _TEST__F_utf_dynamicss_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamicss_increase_by()
+ */
+extern void test__f_utf_dynamicss_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamicss_increase_by()
+ */
+extern void test__f_utf_dynamicss_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamicss_increase_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-dynamicss_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_dynamicss_resize__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamicss_t data = f_utf_string_dynamicss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_dynamicss_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_dynamicss_t data = f_utf_string_dynamicss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_dynamicss_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_dynamicss_resize_h
+#define _TEST__F_utf_dynamicss_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_dynamicss_resize()
+ */
+extern void test__f_utf_dynamicss_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_dynamicss_resize()
+ */
+extern void test__f_utf_dynamicss_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_dynamicss_resize_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-map_multis_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_map_multis_adjust__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multis_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_map_multis_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multis_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf__string_map_multis_adjust
+#define _TEST__F_utf__string_map_multis_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_map_multis_adjust()
+ */
+extern void test__f_utf_map_multis_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_map_multis_adjust()
+ */
+extern void test__f_utf_map_multis_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_utf__string_map_multis_adjust
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-map_multis_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_map_multis_append__works(void **state) {
+
+ const int length_values = 2;
+ f_utf_string_map_multi_t source = f_utf_string_map_multi_t_initialize;
+ f_utf_string_map_multis_t destination = f_utf_string_map_multis_t_initialize;
+
+ f_utf_string_static_t test_value_array[] = {
+ macro_f_utf_string_static_t_initialize("test_value1", 0, 11),
+ macro_f_utf_string_static_t_initialize("test_value2", 0, 11),
+ };
+
+ const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize("test_name", 0, 9);
+ const f_utf_string_statics_t test_value = macro_f_utf_string_statics_t_initialize(test_value_array, 0, length_values);
+
+ {
+ f_status_t status = f_utf_string_dynamic_append(test_name, &source.name);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.name.used, test_name.used);
+ assert_string_equal(source.name.string, test_name.string);
+
+ status = f_utf_string_dynamics_append_all(test_value, &source.value);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.value.used, test_value.used);
+ assert_int_equal(source.value.array[0].used, test_value.array[0].used);
+ assert_int_equal(source.value.array[1].used, test_value.array[1].used);
+
+ assert_string_equal(source.value.array[0].string, test_value.array[0].string);
+ assert_string_equal(source.value.array[1].string, test_value.array[1].string);
+ }
+
+ {
+ const f_status_t status = f_utf_string_map_multis_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].name.used, source.name.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].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.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].value.array[0].string);
+ free((void *) destination.array[0].value.array[1].string);
+ free((void *) destination.array[0].value.array);
+
+ free((void *) destination.array);
+}
+
+void test__f_utf_map_multis_append__parameter_checking(void **state) {
+
+ const f_utf_string_map_multi_t data = f_utf_string_map_multi_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multis_append(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_map_multis_append_h
+#define _TEST__F_utf_map_multis_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_map_multis_append()
+ */
+extern void test__f_utf_map_multis_append__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_map_multis_append()
+ */
+extern void test__f_utf_map_multis_append__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_map_multis_append_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-map_multis_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_map_multis_append_all__works(void **state) {
+
+ const int length_values = 2;
+ const int length_inner = 2;
+ f_utf_string_map_multis_t source = f_utf_string_map_multis_t_initialize;
+ f_utf_string_map_multis_t destination = f_utf_string_map_multis_t_initialize;
+
+ f_utf_string_static_t test_value_array[] = {
+ macro_f_utf_string_static_t_initialize("test_value1", 0, 11),
+ macro_f_utf_string_static_t_initialize("test_value2", 0, 11),
+ };
+
+ const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize("test_name", 0, 9);
+ const f_utf_string_statics_t test_value = macro_f_utf_string_statics_t_initialize(test_value_array, 0, length_values);
+
+ {
+ f_status_t status = f_utf_string_map_multis_resize(length_inner, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.size, length_inner);
+
+ for (; source.used < length_inner; ++source.used) {
+
+ status = f_utf_string_dynamic_append(test_name, &source.array[source.used].name);
+
+ assert_int_equal(status, F_none);
+ assert_string_equal(source.array[source.used].name.string, test_name.string);
+ assert_int_equal(source.array[source.used].name.used, test_name.used);
+
+ status = f_utf_string_dynamics_append_all(test_value, &source.array[source.used].value);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[source.used].value.array[0].used, test_value.array[0].used);
+ assert_int_equal(source.array[source.used].value.array[1].used, test_value.array[1].used);
+ assert_string_equal(source.array[source.used].value.array[0].string, test_value.array[0].string);
+ assert_string_equal(source.array[source.used].value.array[1].string, test_value.array[1].string);
+ } // for
+ }
+
+ {
+ const f_status_t status = f_utf_string_map_multis_append_all(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+ assert_int_equal(destination.size, source.used);
+
+ for (f_array_length_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].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].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_array_length_t i = 0; i < source.used; ++i) {
+
+ free((void *) source.array[i].name.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
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+
+ free((void *) destination.array[i].name.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);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_utf_map_multis_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multis_t source = f_utf_string_map_multis_t_initialize;
+ f_utf_string_map_multis_t destination = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multis_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_map_multis_append_all(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ assert_null(destination.array);
+ }
+
+ free((void *) source.array);
+}
+
+void test__f_utf_map_multis_append_all__parameter_checking(void **state) {
+
+ const f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multis_append_all(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_map_multis_append_all_h
+#define _TEST__F_utf_map_multis_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_map_multis_append_all()
+ */
+extern void test__f_utf_map_multis_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_map_multis_append_all()
+ */
+extern void test__f_utf_map_multis_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_map_multis_append_all()
+ */
+extern void test__f_utf_map_multis_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_map_multis_append_all_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-map_multis_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_map_multis_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multis_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_map_multis_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_utf_map_multis_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multis_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_map_multis_decimate_by_h
+#define _TEST__F_map_multis_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_map_multis_decimate_by()
+ */
+extern void test__f_utf_map_multis_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_map_multis_decimate_by()
+ */
+extern void test__f_utf_map_multis_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_map_multis_decimate_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-map_multis_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_map_multis_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multis_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_map_multis_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_utf_map_multis_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multis_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_map_multis_decrease_by_h
+#define _TEST__F_utf_map_multis_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_map_multis_decrease_by()
+ */
+extern void test__f_utf_map_multis_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_map_multis_decrease_by()
+ */
+extern void test__f_utf_map_multis_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_map_multis_decrease_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-map_multis_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_map_multis_increase__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multis_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_utf_string_map_multis_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_map_multis_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multis_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_map_multis_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_map_multis_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multis_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_map_multis_increase_h
+#define _TEST__F_utf_map_multis_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_map_multis_increase()
+ */
+extern void test__f_utf_map_multis_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_map_multis_increase()
+ */
+extern void test__f_utf_map_multis_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_map_multis_increase()
+ */
+extern void test__f_utf_map_multis_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_map_multis_increase_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-map_multis_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_map_multis_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multis_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_utf_string_map_multis_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_map_multis_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multis_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_map_multis_increase_by_h
+#define _TEST__F_utf_map_multis_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_map_multis_increase_by()
+ */
+extern void test__f_utf_map_multis_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_map_multis_increase_by()
+ */
+extern void test__f_utf_map_multis_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_map_multis_increase_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-map_multis_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_map_multis_resize__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multis_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_map_multis_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multis_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_map_multis_resize_h
+#define _TEST__F_utf_map_multis_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_map_multis_resize()
+ */
+extern void test__f_utf_map_multis_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_map_multis_resize()
+ */
+extern void test__f_utf_map_multis_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_map_multis_resize_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-map_multiss_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_map_multiss_adjust__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multiss_t data = f_utf_string_map_multiss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_map_multiss_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multiss_t data = f_utf_string_map_multiss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_map_multiss_adjust_h
+#define _TEST__F_utf_map_multiss_adjust_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_map_multiss_adjust()
+ */
+extern void test__f_utf_map_multiss_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_map_multiss_adjust()
+ */
+extern void test__f_utf_map_multiss_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_map_multiss_adjust_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-map_multiss_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_map_multiss_append__works(void **state) {
+
+ const int length_values = 2;
+ const int length_values_set = 2;
+ const int length_inner = 2;
+ f_utf_string_map_multis_t source = f_utf_string_map_multis_t_initialize;
+ f_utf_string_map_multiss_t destination = f_utf_string_map_multiss_t_initialize;
+
+ f_utf_string_static_t test_value_array1[] = {
+ macro_f_utf_string_static_t_initialize("test_value1", 0, 11),
+ macro_f_utf_string_static_t_initialize("test_value2", 0, 11),
+ };
+
+ f_utf_string_static_t test_value_array2[] = {
+ macro_f_utf_string_static_t_initialize("test_value3", 0, 11),
+ macro_f_utf_string_static_t_initialize("test_value4", 0, 11),
+ };
+
+ const f_utf_string_static_t test_names[] = {
+ macro_f_utf_string_static_t_initialize("test_name1", 0, 10),
+ macro_f_utf_string_static_t_initialize("test_name2", 0, 10),
+ };
+
+ const f_utf_string_statics_t test_values[] = {
+ macro_f_utf_string_statics_t_initialize(test_value_array1, 0, length_values),
+ macro_f_utf_string_statics_t_initialize(test_value_array2, 0, length_values),
+ };
+
+ {
+ f_status_t status = f_utf_string_map_multis_resize(length_inner, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.size, length_inner);
+
+ for (; source.used < length_inner; ++source.used) {
+
+ status = f_utf_string_dynamic_append(test_names[source.used], &source.array[source.used].name);
+
+ assert_int_equal(status, F_none);
+ 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);
+
+ status = f_utf_string_dynamics_append_all(test_values[source.used], &source.array[source.used].value);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[source.used].value.used, test_values[source.used].used);
+ assert_int_equal(source.array[source.used].value.array[0].used, test_values[source.used].array[0].used);
+ assert_int_equal(source.array[source.used].value.array[1].used, test_values[source.used].array[1].used);
+
+ assert_string_equal(source.array[source.used].value.array[0].string, test_values[source.used].array[0].string);
+ assert_string_equal(source.array[source.used].value.array[1].string, test_values[source.used].array[1].string);
+ } // for
+ }
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.array[0].used, length_inner);
+
+ for (f_array_length_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].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].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_array_length_t i = 0; i < source.used; ++i) {
+
+ free((void *) source.array[i].name.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
+
+
+ for (f_array_length_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].value.array[0].string);
+ free((void *) destination.array[0].array[i].value.array[1].string);
+ free((void *) destination.array[0].array[i].value.array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array[0].array);
+ free((void *) destination.array);
+}
+
+void test__f_utf_map_multiss_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multis_t source = f_utf_string_map_multiss_t_initialize;
+ f_utf_string_map_multiss_t destination = f_utf_string_map_multiss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multis_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_append(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ assert_null(destination.array);
+ }
+
+ free((void *) source.array);
+}
+
+void test__f_utf_map_multiss_append__parameter_checking(void **state) {
+
+ f_utf_string_map_multis_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_append(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_map_multiss_append_h
+#define _TEST__F_utf_map_multiss_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_map_multiss_append()
+ */
+extern void test__f_utf_map_multiss_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_map_multiss_append()
+ */
+extern void test__f_utf_map_multiss_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_map_multiss_append()
+ */
+extern void test__f_utf_map_multiss_append__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_map_multiss_append_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-map_multiss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_map_multiss_append_all__works(void **state) {
+
+ const int length_values = 2;
+ const int length_values_set = 2;
+ const int length_inner = 2;
+ const int length_outer = 2;
+ f_utf_string_map_multiss_t source = f_utf_string_map_multiss_t_initialize;
+ f_utf_string_map_multiss_t destination = f_utf_string_map_multiss_t_initialize;
+
+ f_utf_string_static_t test_value_array1[] = {
+ macro_f_utf_string_static_t_initialize("test_value1", 0, 11),
+ macro_f_utf_string_static_t_initialize("test_value2", 0, 11),
+ };
+
+ f_utf_string_static_t test_value_array2[] = {
+ macro_f_utf_string_static_t_initialize("test_value3", 0, 11),
+ macro_f_utf_string_static_t_initialize("test_value4", 0, 11),
+ };
+
+ const f_utf_string_static_t test_names[] = {
+ macro_f_utf_string_static_t_initialize("test_name1", 0, 10),
+ macro_f_utf_string_static_t_initialize("test_name2", 0, 10),
+ };
+
+ const f_utf_string_statics_t test_values[] = {
+ macro_f_utf_string_statics_t_initialize(test_value_array1, 0, length_values),
+ macro_f_utf_string_statics_t_initialize(test_value_array2, 0, length_values),
+ };
+
+ {
+ f_status_t status = f_utf_string_map_multiss_resize(length_outer, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length_outer);
+
+ f_array_length_t i = 0;
+ f_array_length_t j = 0;
+
+ for (; source.used < length_outer; ++source.used) {
+
+ status = f_utf_string_map_multis_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[source.used].used, 0);
+ assert_int_equal(source.array[source.used].size, length_inner);
+
+ for (i = 0; i < length_inner; ++i) {
+
+ status = f_utf_string_dynamic_append(test_names[i], &source.array[source.used].array[i].name);
+
+ assert_int_equal(status, F_none);
+ 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);
+
+ status = f_utf_string_dynamics_append_all(test_values[i], &source.array[source.used].array[i].value);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[source.used].array[i].value.used, test_values[i].used);
+ assert_int_equal(source.array[source.used].array[i].value.array[0].used, test_values[i].array[0].used);
+ assert_int_equal(source.array[source.used].array[i].value.array[1].used, test_values[i].array[1].used);
+
+ assert_string_equal(source.array[source.used].array[i].value.array[0].string, test_values[i].array[0].string);
+ assert_string_equal(source.array[source.used].array[i].value.array[1].string, test_values[i].array[1].string);
+ } // for
+
+ source.array[source.used].used = length_inner;
+ } // for
+ }
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_append_all(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ for (f_array_length_t j = 0; j < length_outer; ++j) {
+
+ for (f_array_length_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].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].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
+ }
+
+ for (f_array_length_t j = 0; j < source.used; ++j) {
+
+ for (f_array_length_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].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
+
+ free((void *) source.array[j].array);
+ } // for
+
+ for (f_array_length_t j = 0; j < destination.used; ++j) {
+
+ for (f_array_length_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].value.array[0].string);
+ free((void *) destination.array[j].array[i].value.array[1].string);
+ free((void *) destination.array[j].array[i].value.array);
+ } // for
+
+ free((void *) destination.array[j].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_utf_map_multiss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multiss_t source = f_utf_string_map_multiss_t_initialize;
+ f_utf_string_map_multiss_t destination = f_utf_string_map_multiss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_append_all(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ assert_null(destination.array);
+ }
+
+ free((void *) source.array);
+}
+
+void test__f_utf_map_multiss_append_all__parameter_checking(void **state) {
+
+ const f_utf_string_map_multiss_t data = f_utf_string_map_multiss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_append_all(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_map_multiss_append_all_h
+#define _TEST__F_utf_map_multiss_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_map_multiss_append_all()
+ */
+extern void test__f_utf_map_multiss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_map_multiss_append_all()
+ */
+extern void test__f_utf_map_multiss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_map_multiss_append_all()
+ */
+extern void test__f_utf_map_multiss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_map_multiss_append_all_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-map_multiss_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_map_multiss_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multiss_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_utf_map_multiss_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multiss_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_map_multiss_decimate_by_h
+#define _TEST__F_utf_map_multiss_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_map_multiss_decimate_by()
+ */
+extern void test__f_utf_map_multiss_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_map_multiss_decimate_by()
+ */
+extern void test__f_utf_map_multiss_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_map_multiss_decimate_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-map_multiss_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_map_multiss_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multiss_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_utf_map_multiss_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multiss_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_map_multiss_decrease_by_h
+#define _TEST__F_utf_map_multiss_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_map_multiss_decrease_by()
+ */
+extern void test__f_utf_map_multiss_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_map_multiss_decrease_by()
+ */
+extern void test__f_utf_map_multiss_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_map_multiss_decrease_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-map_multiss_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_map_multiss_increase__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multiss_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_utf_string_map_multiss_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_map_multiss_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multiss_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_map_multiss_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multiss_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_map_multiss_increase_h
+#define _TEST__F_utf_map_multiss_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_map_multiss_increase()
+ */
+extern void test__f_utf_map_multiss_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_map_multiss_increase()
+ */
+extern void test__f_utf_map_multiss_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_map_multiss_increase()
+ */
+extern void test__f_utf_map_multiss_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_map_multiss_increase_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-map_multiss_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_map_multiss_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multiss_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_utf_string_map_multiss_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_map_multiss_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multiss_t data = f_utf_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_map_multiss_increase_by_h
+#define _TEST__F_utf_map_multiss_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_map_multiss_increase_by()
+ */
+extern void test__f_utf_map_multiss_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_map_multiss_increase_by()
+ */
+extern void test__f_utf_map_multiss_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_map_multiss_increase_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-map_multiss_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_map_multiss_resize__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multiss_t data = f_utf_string_map_multiss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_map_multiss_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_map_multiss_t data = f_utf_string_map_multiss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_map_multiss_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_map_multiss_resize_h
+#define _TEST__F_utf_map_multiss_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_map_multiss_resize()
+ */
+extern void test__f_utf_map_multiss_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_map_multiss_resize()
+ */
+extern void test__f_utf_map_multiss_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_map_multiss_resize_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-maps_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_maps_adjust__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_maps_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_maps_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_maps_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_maps_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_maps_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf__string_maps_adjust
+#define _TEST__F_utf__string_maps_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_maps_adjust()
+ */
+extern void test__f_utf_maps_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_maps_adjust()
+ */
+extern void test__f_utf_maps_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_utf__string_maps_adjust
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-maps_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_maps_append__works(void **state) {
+
+ f_utf_string_map_t source = f_utf_string_map_t_initialize;
+ f_utf_string_maps_t destination = f_utf_string_maps_t_initialize;
+
+ const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize("test_name", 0, 9);
+ const f_utf_string_static_t test_value = macro_f_utf_string_static_t_initialize("test_value", 0, 10);
+
+ {
+ f_status_t status = f_utf_string_dynamic_append(test_name, &source.name);
+
+ assert_int_equal(status, F_none);
+ assert_string_equal(source.name.string, test_name.string);
+ assert_int_equal(source.name.used, test_name.used);
+
+ status = f_utf_string_dynamic_append(test_value, &source.value);
+
+ assert_int_equal(status, F_none);
+ assert_string_equal(source.value.string, test_value.string);
+ assert_int_equal(source.value.used, test_value.used);
+ }
+
+ {
+ const f_status_t status = f_utf_string_maps_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].name.used, source.name.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].value.string, source.value.string);
+ }
+
+ free((void *) source.name.string);
+ free((void *) source.value.string);
+
+ free((void *) destination.array[0].name.string);
+ free((void *) destination.array[0].value.string);
+
+ free((void *) destination.array);
+}
+
+void test__f_utf_maps_append__parameter_checking(void **state) {
+
+ const f_utf_string_map_t data = f_utf_string_map_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_maps_append(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_maps_append_h
+#define _TEST__F_utf_maps_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_maps_append()
+ */
+extern void test__f_utf_maps_append__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_maps_append()
+ */
+extern void test__f_utf_maps_append__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_maps_append_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-maps_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_maps_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_utf_string_maps_t source = f_utf_string_maps_t_initialize;
+ f_utf_string_maps_t destination = f_utf_string_maps_t_initialize;
+
+ const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize("test_name", 0, 9);
+ const f_utf_string_static_t test_value = macro_f_utf_string_static_t_initialize("test_value", 0, 10);
+
+ {
+ f_status_t status = f_utf_string_maps_resize(length_inner, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.size, length_inner);
+
+ for (; source.used < length_inner; ++source.used) {
+
+ status = f_utf_string_dynamic_append(test_name, &source.array[source.used].name);
+
+ assert_int_equal(status, F_none);
+ assert_string_equal(source.array[source.used].name.string, test_name.string);
+ assert_int_equal(source.array[source.used].name.used, test_name.used);
+
+ status = f_utf_string_dynamic_append(test_value, &source.array[source.used].value);
+
+ assert_int_equal(status, F_none);
+ assert_string_equal(source.array[source.used].value.string, test_value.string);
+ assert_int_equal(source.array[source.used].value.used, test_value.used);
+ } // for
+ }
+
+ {
+ const f_status_t status = f_utf_string_maps_append_all(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+ assert_int_equal(destination.size, source.used);
+
+ for (f_array_length_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].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].value.string, source.array[i].value.string);
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+
+ free((void *) source.array[i].name.string);
+ free((void *) source.array[i].value.string);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+
+ free((void *) destination.array[i].name.string);
+ free((void *) destination.array[i].value.string);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_utf_maps_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_maps_t source = f_utf_string_maps_t_initialize;
+ f_utf_string_maps_t destination = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_maps_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_maps_append_all(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ assert_null(destination.array);
+ }
+
+ free((void *) source.array);
+}
+
+void test__f_utf_maps_append_all__parameter_checking(void **state) {
+
+ const f_utf_string_maps_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_maps_append_all(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_maps_append_all_h
+#define _TEST__F_utf_maps_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_maps_append_all()
+ */
+extern void test__f_utf_maps_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_maps_append_all()
+ */
+extern void test__f_utf_maps_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_maps_append_all()
+ */
+extern void test__f_utf_maps_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_maps_append_all_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-maps_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_maps_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_maps_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_maps_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_maps_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_utf_maps_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_maps_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_maps_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_maps_decimate_by_h
+#define _TEST__F_maps_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_maps_decimate_by()
+ */
+extern void test__f_utf_maps_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_maps_decimate_by()
+ */
+extern void test__f_utf_maps_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_maps_decimate_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-maps_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_maps_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_maps_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_maps_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_maps_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_utf_maps_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_maps_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_maps_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_maps_decrease_by_h
+#define _TEST__F_utf_maps_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_maps_decrease_by()
+ */
+extern void test__f_utf_maps_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_maps_decrease_by()
+ */
+extern void test__f_utf_maps_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_maps_decrease_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-maps_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_maps_increase__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_maps_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_maps_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_utf_string_maps_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_maps_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_maps_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_maps_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_maps_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_maps_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_maps_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_maps_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_maps_increase_h
+#define _TEST__F_utf_maps_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_maps_increase()
+ */
+extern void test__f_utf_maps_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_maps_increase()
+ */
+extern void test__f_utf_maps_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_maps_increase()
+ */
+extern void test__f_utf_maps_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_maps_increase_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-maps_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_maps_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_maps_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_maps_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_utf_string_maps_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_maps_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_maps_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_maps_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_maps_increase_by_h
+#define _TEST__F_utf_maps_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_maps_increase_by()
+ */
+extern void test__f_utf_maps_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_maps_increase_by()
+ */
+extern void test__f_utf_maps_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_maps_increase_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-maps_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_maps_resize__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_maps_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_maps_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_maps_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_maps_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_maps_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_maps_resize_h
+#define _TEST__F_utf_maps_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_maps_resize()
+ */
+extern void test__f_utf_maps_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_maps_resize()
+ */
+extern void test__f_utf_maps_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_maps_resize_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-mapss_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_mapss_adjust__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_mapss_t data = f_utf_string_mapss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mapss_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_mapss_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_mapss_t data = f_utf_string_mapss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mapss_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_mapss_adjust_h
+#define _TEST__F_utf_mapss_adjust_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_mapss_adjust()
+ */
+extern void test__f_utf_mapss_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_mapss_adjust()
+ */
+extern void test__f_utf_mapss_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_mapss_adjust_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-mapss_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_mapss_append__works(void **state) {
+
+ const int length_inner = 2;
+ f_utf_string_maps_t source = f_utf_string_maps_t_initialize;
+ f_utf_string_mapss_t destination = f_utf_string_mapss_t_initialize;
+
+ const f_utf_string_static_t test_names[] = {
+ macro_f_utf_string_static_t_initialize("test_name1", 0, 10),
+ macro_f_utf_string_static_t_initialize("test_name2", 0, 10),
+ };
+
+ const f_utf_string_static_t test_values[] = {
+ macro_f_utf_string_static_t_initialize("test_value1", 0, 11),
+ macro_f_utf_string_static_t_initialize("test_value2", 0, 11),
+ };
+
+ {
+ f_status_t status = f_utf_string_maps_resize(length_inner, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.size, length_inner);
+
+ for (; source.used < length_inner; ++source.used) {
+
+ status = f_utf_string_dynamic_append(test_names[source.used], &source.array[source.used].name);
+
+ assert_int_equal(status, F_none);
+ 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);
+
+ status = f_utf_string_dynamic_append(test_values[source.used], &source.array[source.used].value);
+
+ assert_int_equal(status, F_none);
+ assert_string_equal(source.array[source.used].value.string, test_values[source.used].string);
+ assert_int_equal(source.array[source.used].value.used, test_values[source.used].used);
+ } // for
+ }
+
+ {
+ const f_status_t status = f_utf_string_mapss_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.array[0].used, length_inner);
+
+ for (f_array_length_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].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].value.string, test_values[i].string);
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+
+ free((void *) source.array[i].name.string);
+ free((void *) source.array[i].value.string);
+ } // for
+
+
+ for (f_array_length_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].value.string);
+ } // for
+
+ free((void *) destination.array[0].array);
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_utf_mapss_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_maps_t source = f_utf_string_mapss_t_initialize;
+ f_utf_string_mapss_t destination = f_utf_string_mapss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_maps_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_mapss_append(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ assert_null(destination.array);
+ }
+
+ free((void *) source.array);
+}
+
+void test__f_utf_mapss_append__parameter_checking(void **state) {
+
+ f_utf_string_maps_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mapss_append(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_mapss_append_h
+#define _TEST__F_utf_mapss_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_mapss_append()
+ */
+extern void test__f_utf_mapss_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_mapss_append()
+ */
+extern void test__f_utf_mapss_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_mapss_append()
+ */
+extern void test__f_utf_mapss_append__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_mapss_append_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-mapss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_mapss_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ const int length_outer = 2;
+ f_utf_string_mapss_t source = f_utf_string_mapss_t_initialize;
+ f_utf_string_mapss_t destination = f_utf_string_mapss_t_initialize;
+
+ const f_utf_string_static_t test_names[] = {
+ macro_f_utf_string_static_t_initialize("test_name1", 0, 10),
+ macro_f_utf_string_static_t_initialize("test_name2", 0, 10),
+ };
+
+ const f_utf_string_static_t test_values[] = {
+ macro_f_utf_string_static_t_initialize("test_value1", 0, 11),
+ macro_f_utf_string_static_t_initialize("test_value2", 0, 11),
+ };
+
+ {
+ f_status_t status = f_utf_string_mapss_resize(length_outer, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length_outer);
+
+ f_array_length_t i = 0;
+ f_array_length_t j = 0;
+
+ for (; source.used < length_outer; ++source.used) {
+
+ status = f_utf_string_maps_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[source.used].used, 0);
+ assert_int_equal(source.array[source.used].size, length_inner);
+
+ for (i = 0; i < length_inner; ++i) {
+
+ status = f_utf_string_dynamic_append(test_names[i], &source.array[source.used].array[i].name);
+
+ assert_int_equal(status, F_none);
+ 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);
+
+ status = f_utf_string_dynamic_append(test_values[i], &source.array[source.used].array[i].value);
+
+ assert_int_equal(status, F_none);
+ assert_string_equal(source.array[source.used].array[i].value.string, test_values[i].string);
+ assert_int_equal(source.array[source.used].array[i].value.used, test_values[i].used);
+ } // for
+
+ source.array[source.used].used = length_inner;
+ } // for
+ }
+
+ {
+ const f_status_t status = f_utf_string_mapss_append_all(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ for (f_array_length_t j = 0; j < length_outer; ++j) {
+
+ for (f_array_length_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].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].value.string, test_values[i].string);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t j = 0; j < source.used; ++j) {
+
+ for (f_array_length_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].value.string);
+ } // for
+
+ free((void *) source.array[j].array);
+ } // for
+
+ for (f_array_length_t j = 0; j < destination.used; ++j) {
+
+ for (f_array_length_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].value.string);
+ } // for
+
+ free((void *) destination.array[j].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_utf_mapss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_mapss_t source = f_utf_string_mapss_t_initialize;
+ f_utf_string_mapss_t destination = f_utf_string_mapss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mapss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_mapss_append_all(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ assert_null(destination.array);
+ }
+
+ free((void *) source.array);
+}
+
+void test__f_utf_mapss_append_all__parameter_checking(void **state) {
+
+ const f_utf_string_mapss_t data = f_utf_string_mapss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mapss_append_all(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_mapss_append_all_h
+#define _TEST__F_utf_mapss_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_mapss_append_all()
+ */
+extern void test__f_utf_mapss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_mapss_append_all()
+ */
+extern void test__f_utf_mapss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_mapss_append_all()
+ */
+extern void test__f_utf_mapss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_mapss_append_all_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-mapss_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_mapss_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_mapss_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mapss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_mapss_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_utf_mapss_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_mapss_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mapss_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_mapss_decimate_by_h
+#define _TEST__F_utf_mapss_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_mapss_decimate_by()
+ */
+extern void test__f_utf_mapss_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_mapss_decimate_by()
+ */
+extern void test__f_utf_mapss_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_mapss_decimate_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-mapss_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_mapss_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_mapss_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mapss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_mapss_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_utf_mapss_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_mapss_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mapss_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_mapss_decrease_by_h
+#define _TEST__F_utf_mapss_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_mapss_decrease_by()
+ */
+extern void test__f_utf_mapss_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_mapss_decrease_by()
+ */
+extern void test__f_utf_mapss_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_mapss_decrease_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-mapss_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_mapss_increase__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_mapss_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mapss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_utf_string_mapss_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_mapss_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_mapss_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mapss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_mapss_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_mapss_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_mapss_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mapss_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_mapss_increase_h
+#define _TEST__F_utf_mapss_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_mapss_increase()
+ */
+extern void test__f_utf_mapss_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_mapss_increase()
+ */
+extern void test__f_utf_mapss_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_mapss_increase()
+ */
+extern void test__f_utf_mapss_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_mapss_increase_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-mapss_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_mapss_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_mapss_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mapss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_utf_string_mapss_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_mapss_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_mapss_t data = f_utf_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mapss_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_mapss_increase_by_h
+#define _TEST__F_utf_mapss_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_mapss_increase_by()
+ */
+extern void test__f_utf_mapss_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_mapss_increase_by()
+ */
+extern void test__f_utf_mapss_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_mapss_increase_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-mapss_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_mapss_resize__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_mapss_t data = f_utf_string_mapss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mapss_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_mapss_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_mapss_t data = f_utf_string_mapss_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mapss_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_mapss_resize_h
+#define _TEST__F_utf_mapss_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_mapss_resize()
+ */
+extern void test__f_utf_mapss_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_mapss_resize()
+ */
+extern void test__f_utf_mapss_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_mapss_resize_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-mash.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_mash__works(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("te\0st:te\0st", 0, 11);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mash(glue.string, glue.used, source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ assert_string_equal(destination.string, source.string);
+ assert_string_equal(destination.string + 3, source.string + 3);
+ }
+
+ // Check that the glue is added.
+ {
+ const f_status_t status = f_utf_string_mash(glue.string, glue.used, source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ assert_string_equal(destination.string + 3, expected.string + 3);
+ assert_string_equal(destination.string + 9, expected.string + 9);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_mash__parameter_checking(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+
+ {
+ const f_status_t status = f_utf_string_mash(glue.string, glue.used, source.string, source.used, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_mash_h
+#define _TEST__F_utf_mash_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_mash()
+ */
+extern void test__f_utf_mash__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_mash()
+ */
+extern void test__f_utf_mash__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_mash_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-mash_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_mash_nulless__works(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize("test:test", 0, 9);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mash_nulless(glue.string, glue.used, source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected1.used);
+
+ assert_string_equal(destination.string, expected1.string);
+ }
+
+ // Check that the glue is added.
+ {
+ const f_status_t status = f_utf_string_mash_nulless(glue.string, glue.used, source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected2.used);
+
+ assert_string_equal(destination.string, expected2.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_mash_nulless__parameter_checking(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+
+ {
+ const f_status_t status = f_utf_string_mash_nulless(glue.string, glue.used, source.string, source.used, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_mash_nulless_h
+#define _TEST__F_utf_mash_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_mash_nulless()
+ */
+extern void test__f_utf_mash_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_mash_nulless()
+ */
+extern void test__f_utf_mash_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_mash_nulless_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-mish.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_mish__works(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("te\0st:te\0st", 0, 11);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mish(glue.string, glue.used, source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ assert_string_equal(destination.string, source.string);
+ assert_string_equal(destination.string + 3, source.string + 3);
+ }
+
+ // Check that the glue is added.
+ {
+ const f_status_t status = f_utf_string_mish(glue.string, glue.used, source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ assert_string_equal(destination.string + 3, expected.string + 3);
+ assert_string_equal(destination.string + 9, expected.string + 9);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_mish__parameter_checking(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+
+ {
+ const f_status_t status = f_utf_string_mish(glue.string, glue.used, source.string, source.used, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_mish_h
+#define _TEST__F_utf_mish_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_mish()
+ */
+extern void test__f_utf_mish__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_mish()
+ */
+extern void test__f_utf_mish__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_mish_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-mish_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_mish_nulless__works(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize("test:test", 0, 9);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_mish_nulless(glue.string, glue.used, source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected1.used);
+
+ assert_string_equal(destination.string, expected1.string);
+ }
+
+ // Check that the glue is added.
+ {
+ const f_status_t status = f_utf_string_mish_nulless(glue.string, glue.used, source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected2.used);
+
+ assert_string_equal(destination.string, expected2.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_mish_nulless__parameter_checking(void **state) {
+
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+
+ {
+ const f_status_t status = f_utf_string_mish_nulless(glue.string, glue.used, source.string, source.used, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_mish_nulless_h
+#define _TEST__F_utf_mish_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_mish_nulless()
+ */
+extern void test__f_utf_mish_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_mish_nulless()
+ */
+extern void test__f_utf_mish_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_mish_nulless_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-prepend.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_prepend__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_prepend(source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ assert_string_equal(destination.string, source.string);
+ assert_string_equal(destination.string + 3, source.string + 3);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_prepend__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_prepend(data.string, data.used, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_prepend_h
+#define _TEST__F_utf_prepend_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_prepend()
+ */
+extern void test__f_utf_prepend__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_prepend()
+ */
+extern void test__f_utf_prepend__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_prepend_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-prepend_assure.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_prepend_assure__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_prepend_assure(source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ assert_string_equal(destination.string, source.string);
+ assert_string_equal(destination.string + 3, source.string + 3);
+ }
+
+ // The string already exists, so destination should be unchanged.
+ {
+ const f_status_t status = f_utf_string_prepend_assure(source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ assert_string_equal(destination.string, source.string);
+ assert_string_equal(destination.string + 3, source.string + 3);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_prepend_assure__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_prepend_assure(data.string, data.used, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_prepend_assure_h
+#define _TEST__F_utf_prepend_assure_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_prepend_assure()
+ */
+extern void test__f_utf_prepend_assure__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_prepend_assure()
+ */
+extern void test__f_utf_prepend_assure__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_prepend_assure_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-prepend_assure_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_prepend_assure_nulless__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_prepend_assure_nulless(source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ // The string already exists, so destination should be unchanged.
+ {
+ const f_status_t status = f_utf_string_prepend_assure_nulless(source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_prepend_assure_nulless__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_prepend_assure_nulless(data.string, data.used, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_prepend_assure_nulless_h
+#define _TEST__F_utf_prepend_assure_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_prepend_assure_nulless()
+ */
+extern void test__f_utf_prepend_assure_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_prepend_assure_nulless()
+ */
+extern void test__f_utf_prepend_assure_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_prepend_assure_nulless_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-prepend_nulless.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_prepend_nulless__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_prepend_nulless(source.string, source.used, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, expected.used);
+
+ assert_string_equal(destination.string, expected.string);
+ }
+
+ free((void *) destination.string);
+}
+
+void test__f_utf_prepend_nulless__parameter_checking(void **state) {
+
+ const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_prepend_nulless(data.string, data.used, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_prepend_nulless_h
+#define _TEST__F_utf_prepend_nulless_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_prepend_nulless()
+ */
+extern void test__f_utf_prepend_nulless__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_prepend_nulless()
+ */
+extern void test__f_utf_prepend_nulless__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_prepend_nulless_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-seek_line.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_seek_line__returns_data_not_stop(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+
+ {
+ f_string_range_t range = f_utf_string_range_t_initialize;
+
+ const f_status_t status = f_utf_string_seek_line(source.string, &range);
+
+ assert_int_equal(status, F_data_not_stop);
+ }
+}
+
+void test__f_utf_seek_line__returns_none_stop(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test", 0, 4);
+
+ {
+ f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+
+ const f_status_t status = f_utf_string_seek_line(source.string, &range);
+
+ assert_int_equal(status, F_none_stop);
+
+ assert_int_equal(range.start, source.used);
+ assert_int_equal(range.stop, source.used - 1);
+ }
+}
+
+void test__f_utf_seek_line__works(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+
+ {
+ f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+
+ const f_status_t status = f_utf_string_seek_line(source.string, &range);
+
+ assert_int_equal(status, F_none);
+
+ assert_int_equal(range.start, 4);
+ assert_int_equal(range.stop, source.used - 1);
+ }
+}
+
+void test__f_utf_seek_line__parameter_checking(void **state) {
+
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("teX\nst", 0, 6);
+
+ {
+ const f_status_t status = f_utf_string_seek_line(source.string, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_seek_line_h
+#define _TEST__F_utf_seek_line_h
+
+/**
+ * Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop).
+ *
+ * @see f_utf_string_seek_line()
+ */
+extern void test__f_utf_seek_line__returns_data_not_stop(void **state);
+
+/**
+ * Test that the function returns F_none_stop stopped after end of range because no newline is found.
+ *
+ * @see f_utf_string_seek_line()
+ */
+extern void test__f_utf_seek_line__returns_none_stop(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_seek_line()
+ */
+extern void test__f_utf_seek_line__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_seek_line()
+ */
+extern void test__f_utf_seek_line__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_seek_line_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-seek_line_to.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_seek_line_to__at_newline(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\nXst", 0, 6);
+
+ {
+ f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+
+ const f_status_t status = f_utf_string_seek_line_to(source.string, to.string[0], &range);
+
+ assert_int_equal(status, F_none_eol);
+
+ assert_int_equal(range.start, 2);
+ assert_int_equal(range.stop, source.used - 1);
+ }
+}
+
+void test__f_utf_seek_line_to__returns_data_not_stop(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+
+ {
+ f_string_range_t range = f_utf_string_range_t_initialize;
+
+ const f_status_t status = f_utf_string_seek_line_to(source.string, to.string[0], &range);
+
+ assert_int_equal(status, F_data_not_stop);
+ }
+}
+
+void test__f_utf_seek_line_to__returns_none_stop(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test", 0, 4);
+
+ {
+ f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+
+ const f_status_t status = f_utf_string_seek_line_to(source.string, to.string[0], &range);
+
+ assert_int_equal(status, F_none_stop);
+
+ assert_int_equal(range.start, source.used);
+ assert_int_equal(range.stop, source.used - 1);
+ }
+}
+
+void test__f_utf_seek_line_to__works(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("teX\nst", 0, 6);
+
+ {
+ f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+
+ const f_status_t status = f_utf_string_seek_line_to(source.string, to.string[0], &range);
+
+ assert_int_equal(status, F_none);
+
+ assert_int_equal(range.start, 2);
+ assert_int_equal(range.stop, source.used - 1);
+ }
+}
+
+void test__f_utf_seek_line_to__parameter_checking(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("teX\nst", 0, 6);
+
+ {
+ const f_status_t status = f_utf_string_seek_line_to(source.string, to.string[0], 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_seek_line_to_h
+#define _TEST__F_utf_seek_line_to_h
+
+/**
+ * Test that the function works but stops at newline rather than search string.
+ *
+ * @see f_utf_string_seek_line_to()
+ */
+extern void test__f_utf_seek_line_to__at_newline(void **state);
+
+/**
+ * Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop).
+ *
+ * @see f_utf_string_seek_line_to()
+ */
+extern void test__f_utf_seek_line_to__returns_data_not_stop(void **state);
+
+/**
+ * Test that the function returns F_none_stop stopped after end of range because no newline is found.
+ *
+ * @see f_utf_string_seek_line_to()
+ */
+extern void test__f_utf_seek_line_to__returns_none_stop(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_seek_line_to()
+ */
+extern void test__f_utf_seek_line_to__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_seek_line_to()
+ */
+extern void test__f_utf_seek_line_to__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_seek_line_to_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-seek_to.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_seek_to__returns_data_not_stop(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+
+ {
+ f_string_range_t range = f_utf_string_range_t_initialize;
+
+ const f_status_t status = f_utf_string_seek_to(source.string, to.string[0], &range);
+
+ assert_int_equal(status, F_data_not_stop);
+ }
+}
+
+void test__f_utf_seek_to__returns_none_stop(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+
+ {
+ f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+
+ const f_status_t status = f_utf_string_seek_to(source.string, to.string[0], &range);
+
+ assert_int_equal(status, F_none_stop);
+
+ assert_int_equal(range.start, source.used);
+ assert_int_equal(range.stop, source.used - 1);
+ }
+}
+
+void test__f_utf_seek_to__works(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\nXst", 0, 6);
+
+ {
+ f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+
+ const f_status_t status = f_utf_string_seek_to(source.string, to.string[0], &range);
+
+ assert_int_equal(status, F_none);
+
+ assert_int_equal(range.start, 3);
+ assert_int_equal(range.stop, source.used - 1);
+ }
+}
+
+void test__f_utf_seek_to__parameter_checking(void **state) {
+
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("teX\nst", 0, 6);
+
+ {
+ const f_status_t status = f_utf_string_seek_to(source.string, to.string[0], 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_seek_to_h
+#define _TEST__F_utf_seek_to_h
+
+/**
+ * Test that the function returns F_data_not_stop because range is an empty range (range.start > range.stop).
+ *
+ * @see f_utf_string_seek_to()
+ */
+extern void test__f_utf_seek_to__returns_data_not_stop(void **state);
+
+/**
+ * Test that the function returns F_none_stop stopped after end of range because no newline is found.
+ *
+ * @see f_utf_string_seek_to()
+ */
+extern void test__f_utf_seek_to__returns_none_stop(void **state);
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_seek_to()
+ */
+extern void test__f_utf_seek_to__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_seek_to()
+ */
+extern void test__f_utf_seek_to__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_seek_to_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-triples_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_triples_adjust__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_triples_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_triples_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_triples_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_triples_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_triples_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf__string_triples_adjust
+#define _TEST__F_utf__string_triples_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_triples_adjust()
+ */
+extern void test__f_utf_triples_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_triples_adjust()
+ */
+extern void test__f_utf_triples_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_utf__string_triples_adjust
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-triples_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_triples_append__works(void **state) {
+
+ const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize("a", 0, 1);
+ const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize("b", 0, 1);
+ const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize("c", 0, 1);
+
+ const f_utf_string_triple_t source = macro_f_utf_string_triple_t_initialize(test_a, test_b, test_c);
+ f_utf_string_triples_t destination = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_triples_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].a.used, source.a.used);
+ assert_int_equal(destination.array[0].b.used, source.b.used);
+ assert_int_equal(destination.array[0].c.used, source.c.used);
+
+ assert_string_equal(destination.array[0].a.string, source.a.string);
+ assert_string_equal(destination.array[0].b.string, source.b.string);
+ assert_string_equal(destination.array[0].c.string, source.c.string);
+ }
+
+ free((void *) destination.array[0].a.string);
+ free((void *) destination.array[0].b.string);
+ free((void *) destination.array[0].c.string);
+ free((void *) destination.array);
+}
+
+void test__f_utf_triples_append__parameter_checking(void **state) {
+
+ const f_utf_string_triple_t data = f_utf_string_triple_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_triples_append(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_triples_append_h
+#define _TEST__F_utf_triples_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_triples_append()
+ */
+extern void test__f_utf_triples_append__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_triples_append()
+ */
+extern void test__f_utf_triples_append__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_triples_append_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-triples_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_triples_append_all__works(void **state) {
+
+ const int length_sources = 2;
+
+ const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize("a", 0, 1);
+ const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize("b", 0, 1);
+ const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize("c", 0, 1);
+
+ const f_utf_string_static_t test_d = macro_f_utf_string_static_t_initialize("d", 0, 1);
+ const f_utf_string_static_t test_e = macro_f_utf_string_static_t_initialize("e", 0, 1);
+ const f_utf_string_static_t test_f = macro_f_utf_string_static_t_initialize("f", 0, 1);
+
+ f_utf_string_triple_t sources_array[] = {
+ macro_f_utf_string_triple_t_initialize(test_a, test_b, test_c),
+ macro_f_utf_string_triple_t_initialize(test_d, test_e, test_f),
+ };
+
+ const f_utf_string_triples_t source = macro_f_utf_string_triples_t_initialize(sources_array, 0, length_sources);
+ f_utf_string_triples_t destination = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_triples_append_all(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+ assert_int_equal(destination.size, source.used);
+
+ for (f_array_length_t i = 0; i < length_sources; ++i) {
+
+ assert_int_equal(destination.array[i].a.used, source.array[i].a.used);
+ assert_int_equal(destination.array[i].b.used, source.array[i].b.used);
+ assert_int_equal(destination.array[i].c.used, source.array[i].c.used);
+
+ assert_string_equal(destination.array[i].a.string, source.array[i].a.string);
+ assert_string_equal(destination.array[i].b.string, source.array[i].b.string);
+ assert_string_equal(destination.array[i].c.string, source.array[i].c.string);
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+
+ free((void *) destination.array[i].a.string);
+ free((void *) destination.array[i].b.string);
+ free((void *) destination.array[i].c.string);
+ } // for
+
+ free((void *) destination.array);
+}
+
+void test__f_utf_triples_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_triples_t source = f_utf_string_triples_t_initialize;
+ f_utf_string_triples_t destination = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_triples_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_triples_append_all(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ assert_null(destination.array);
+ }
+
+ free((void *) source.array);
+}
+
+void test__f_utf_triples_append_all__parameter_checking(void **state) {
+
+ const f_utf_string_triples_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_triples_append_all(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_triples_append_all_h
+#define _TEST__F_utf_triples_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_triples_append_all()
+ */
+extern void test__f_utf_triples_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_triples_append_all()
+ */
+extern void test__f_utf_triples_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_triples_append_all()
+ */
+extern void test__f_utf_triples_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_triples_append_all_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-triples_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_triples_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_triples_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_triples_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_triples_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_utf_triples_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_triples_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_triples_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_triples_decimate_by_h
+#define _TEST__F_triples_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_triples_decimate_by()
+ */
+extern void test__f_utf_triples_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_triples_decimate_by()
+ */
+extern void test__f_utf_triples_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_triples_decimate_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-triples_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_triples_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_triples_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_triples_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_triples_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_utf_triples_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_triples_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_triples_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_triples_decrease_by_h
+#define _TEST__F_utf_triples_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_triples_decrease_by()
+ */
+extern void test__f_utf_triples_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_triples_decrease_by()
+ */
+extern void test__f_utf_triples_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_triples_decrease_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-triples_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_triples_increase__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_triples_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_triples_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_utf_string_triples_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_triples_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_triples_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_triples_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_triples_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_triples_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_triples_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_triples_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_triples_increase_h
+#define _TEST__F_utf_triples_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_triples_increase()
+ */
+extern void test__f_utf_triples_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_triples_increase()
+ */
+extern void test__f_utf_triples_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_triples_increase()
+ */
+extern void test__f_utf_triples_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_triples_increase_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-triples_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_triples_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_triples_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_triples_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_utf_string_triples_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_triples_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_triples_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_triples_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_triples_increase_by_h
+#define _TEST__F_utf_triples_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_triples_increase_by()
+ */
+extern void test__f_utf_triples_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_triples_increase_by()
+ */
+extern void test__f_utf_triples_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_triples_increase_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-triples_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_triples_resize__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_triples_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_triples_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_triples_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_triples_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_triples_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_triples_resize_h
+#define _TEST__F_utf_triples_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_triples_resize()
+ */
+extern void test__f_utf_triples_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_triples_resize()
+ */
+extern void test__f_utf_triples_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_triples_resize_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-tripless_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_tripless_adjust__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_tripless_t data = f_utf_string_tripless_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_tripless_adjust(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_tripless_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_tripless_t data = f_utf_string_tripless_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_tripless_adjust(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_tripless_adjust_h
+#define _TEST__F_utf_tripless_adjust_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_tripless_adjust()
+ */
+extern void test__f_utf_tripless_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_tripless_adjust()
+ */
+extern void test__f_utf_tripless_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_tripless_adjust_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-tripless_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_tripless_append__works(void **state) {
+
+ const int length_sources = 2;
+
+ const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize("a", 0, 1);
+ const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize("b", 0, 1);
+ const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize("c", 0, 1);
+
+ const f_utf_string_static_t test_d = macro_f_utf_string_static_t_initialize("d", 0, 1);
+ const f_utf_string_static_t test_e = macro_f_utf_string_static_t_initialize("e", 0, 1);
+ const f_utf_string_static_t test_f = macro_f_utf_string_static_t_initialize("f", 0, 1);
+
+ f_utf_string_triple_t sources_array[] = {
+ macro_f_utf_string_triple_t_initialize(test_a, test_b, test_c),
+ macro_f_utf_string_triple_t_initialize(test_d, test_e, test_f),
+ };
+
+ const f_utf_string_triples_t source = macro_f_utf_string_triples_t_initialize(sources_array, 0, length_sources);
+ f_utf_string_tripless_t destination = f_utf_string_tripless_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_tripless_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.array[0].used, length_sources);
+
+ for (f_array_length_t i = 0; i < length_sources; ++i) {
+
+ assert_int_equal(destination.array[0].array[i].a.used, sources_array[i].a.used);
+ assert_int_equal(destination.array[0].array[i].b.used, sources_array[i].b.used);
+ assert_int_equal(destination.array[0].array[i].c.used, sources_array[i].c.used);
+
+ assert_string_equal(destination.array[0].array[i].a.string, sources_array[i].a.string);
+ assert_string_equal(destination.array[0].array[i].b.string, sources_array[i].b.string);
+ assert_string_equal(destination.array[0].array[i].c.string, sources_array[i].c.string);
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < destination.array[0].used; ++i) {
+
+ free((void *) destination.array[0].array[i].a.string);
+ free((void *) destination.array[0].array[i].b.string);
+ free((void *) destination.array[0].array[i].c.string);
+ } // for
+
+ free((void *) destination.array[0].array);
+ free((void *) destination.array);
+}
+
+void test__f_utf_tripless_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_triples_t source = f_utf_string_tripless_t_initialize;
+ f_utf_string_tripless_t destination = f_utf_string_tripless_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_triples_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_tripless_append(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ assert_null(destination.array);
+ }
+
+ free((void *) source.array);
+}
+
+void test__f_utf_tripless_append__parameter_checking(void **state) {
+
+ f_utf_string_triples_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_tripless_append(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_tripless_append_h
+#define _TEST__F_utf_tripless_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_tripless_append()
+ */
+extern void test__f_utf_tripless_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_tripless_append()
+ */
+extern void test__f_utf_tripless_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_tripless_append()
+ */
+extern void test__f_utf_tripless_append__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_tripless_append_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-tripless_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_tripless_append_all__works(void **state) {
+
+ const int length_sources = 2;
+ const int length_sources_set = 2;
+
+ const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize("a", 0, 1);
+ const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize("b", 0, 1);
+ const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize("c", 0, 1);
+
+ const f_utf_string_static_t test_d = macro_f_utf_string_static_t_initialize("d", 0, 1);
+ const f_utf_string_static_t test_e = macro_f_utf_string_static_t_initialize("e", 0, 1);
+ const f_utf_string_static_t test_f = macro_f_utf_string_static_t_initialize("f", 0, 1);
+
+ const f_utf_string_static_t test_g = macro_f_utf_string_static_t_initialize("g", 0, 1);
+ const f_utf_string_static_t test_h = macro_f_utf_string_static_t_initialize("h", 0, 1);
+ const f_utf_string_static_t test_i = macro_f_utf_string_static_t_initialize("i", 0, 1);
+
+ const f_utf_string_static_t test_j = macro_f_utf_string_static_t_initialize("j", 0, 1);
+ const f_utf_string_static_t test_k = macro_f_utf_string_static_t_initialize("k", 0, 1);
+ const f_utf_string_static_t test_l = macro_f_utf_string_static_t_initialize("l", 0, 1);
+
+ f_utf_string_triple_t sources_array1[] = {
+ macro_f_utf_string_triple_t_initialize(test_a, test_b, test_c),
+ macro_f_utf_string_triple_t_initialize(test_d, test_e, test_f),
+ };
+
+ f_utf_string_triple_t sources_array2[] = {
+ macro_f_utf_string_triple_t_initialize(test_g, test_h, test_i),
+ macro_f_utf_string_triple_t_initialize(test_j, test_k, test_l),
+ };
+
+ f_utf_string_triples_t sources_set_array[] = {
+ macro_f_utf_string_triples_t_initialize(sources_array1, 0, length_sources),
+ macro_f_utf_string_triples_t_initialize(sources_array2, 0, length_sources),
+ };
+
+ const f_utf_string_tripless_t source = macro_f_utf_string_tripless_t_initialize(sources_set_array, 0, length_sources_set);
+ f_utf_string_tripless_t destination = f_utf_string_tripless_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_tripless_append_all(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ for (f_array_length_t j = 0; j < length_sources_set; ++j) {
+
+ for (f_array_length_t i = 0; i < length_sources; ++i) {
+
+ assert_int_equal(destination.array[j].array[i].a.used, sources_set_array[j].array[i].a.used);
+ assert_int_equal(destination.array[j].array[i].b.used, sources_set_array[j].array[i].b.used);
+ assert_int_equal(destination.array[j].array[i].c.used, sources_set_array[j].array[i].c.used);
+
+ assert_string_equal(destination.array[j].array[i].a.string, sources_set_array[j].array[i].a.string);
+ assert_string_equal(destination.array[j].array[i].b.string, sources_set_array[j].array[i].b.string);
+ assert_string_equal(destination.array[j].array[i].c.string, sources_set_array[j].array[i].c.string);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t j = 0; j < destination.used; ++j) {
+
+ for (f_array_length_t i = 0; i < destination.array[j].used; ++i) {
+
+ free((void *) destination.array[j].array[i].a.string);
+ free((void *) destination.array[j].array[i].b.string);
+ free((void *) destination.array[j].array[i].c.string);
+ } // for
+
+ free((void *) destination.array[j].array);
+ } // for
+
+ free((void *) destination.array);
+}
+
+void test__f_utf_tripless_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_tripless_t source = f_utf_string_tripless_t_initialize;
+ f_utf_string_tripless_t destination = f_utf_string_tripless_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_tripless_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_tripless_append_all(source, &destination);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(destination.used, 0);
+ assert_int_equal(destination.size, 0);
+ assert_null(destination.array);
+ }
+
+ free((void *) source.array);
+}
+
+void test__f_utf_tripless_append_all__parameter_checking(void **state) {
+
+ const f_utf_string_tripless_t data = f_utf_string_tripless_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_tripless_append_all(data, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_tripless_append_all_h
+#define _TEST__F_utf_tripless_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_tripless_append_all()
+ */
+extern void test__f_utf_tripless_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_tripless_append_all()
+ */
+extern void test__f_utf_tripless_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_tripless_append_all()
+ */
+extern void test__f_utf_tripless_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_tripless_append_all_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-tripless_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_tripless_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_tripless_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_tripless_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_tripless_decimate_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_utf_tripless_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_tripless_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_tripless_decimate_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_tripless_decimate_by_h
+#define _TEST__F_utf_tripless_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_tripless_decimate_by()
+ */
+extern void test__f_utf_tripless_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_tripless_decimate_by()
+ */
+extern void test__f_utf_tripless_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_tripless_decimate_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-tripless_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_tripless_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_tripless_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_tripless_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_tripless_decrease_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+void test__f_utf_tripless_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_tripless_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_tripless_decrease_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_tripless_decrease_by_h
+#define _TEST__F_utf_tripless_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_tripless_decrease_by()
+ */
+extern void test__f_utf_tripless_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_tripless_decrease_by()
+ */
+extern void test__f_utf_tripless_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_tripless_decrease_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-tripless_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_tripless_increase__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_tripless_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_tripless_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_utf_string_tripless_increase(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_tripless_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_utf_string_tripless_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_tripless_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ const f_status_t status = f_utf_string_tripless_increase(length, &data);
+
+ assert_int_equal(status, F_data_not);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_tripless_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_tripless_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_tripless_increase(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ free((void *) data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_tripless_increase_h
+#define _TEST__F_utf_tripless_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_tripless_increase()
+ */
+extern void test__f_utf_tripless_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_utf_string_tripless_increase()
+ */
+extern void test__f_utf_tripless_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_tripless_increase()
+ */
+extern void test__f_utf_tripless_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_tripless_increase_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-tripless_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_tripless_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_tripless_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_tripless_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ {
+ data.used = length;
+
+ const f_status_t status = f_utf_string_tripless_increase_by(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, length);
+ assert_int_equal(data.size, length * 2);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_tripless_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_tripless_t data = f_utf_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_tripless_increase_by(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_tripless_increase_by_h
+#define _TEST__F_utf_tripless_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_tripless_increase_by()
+ */
+extern void test__f_utf_tripless_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_tripless_increase_by()
+ */
+extern void test__f_utf_tripless_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_tripless_increase_by_h
--- /dev/null
+#include "test-utf.h"
+#include "test-utf-tripless_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_utf_tripless_resize__works(void **state) {
+
+ const int length = 5;
+ f_utf_string_tripless_t data = f_utf_string_tripless_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_tripless_resize(length, &data);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, length);
+ }
+
+ free((void *) data.array);
+}
+
+void test__f_utf_tripless_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_utf_string_tripless_t data = f_utf_string_tripless_t_initialize;
+
+ {
+ const f_status_t status = f_utf_string_tripless_resize(length, 0);
+
+ assert_int_equal(status, F_status_set_error(F_parameter));
+ assert_int_equal(data.used, 0);
+ assert_int_equal(data.size, 0);
+ }
+
+ assert_null(data.array);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the array types in the type project.
+ */
+#ifndef _TEST__F_utf_tripless_resize_h
+#define _TEST__F_utf_tripless_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_utf_string_tripless_resize()
+ */
+extern void test__f_utf_tripless_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_utf_string_tripless_resize()
+ */
+extern void test__f_utf_tripless_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_utf_tripless_resize_h
--- /dev/null
+#include "test-utf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int setup(void **state) {
+
+ return 0;
+}
+
+int setdown(void **state) {
+
+ errno = 0;
+
+ return 0;
+}
+
+int main(void) {
+
+ const struct CMUnitTest tests[] = {
+ cmocka_unit_test(test__f_utf_append__works),
+ cmocka_unit_test(test__f_utf_append_assure__works),
+ cmocka_unit_test(test__f_utf_append_assure_nulless__works),
+ cmocka_unit_test(test__f_utf_append_nulless__works),
+
+ cmocka_unit_test(test__f_utf_dynamic_adjust__works),
+
+ cmocka_unit_test(test__f_utf_dynamic_append__works),
+ cmocka_unit_test(test__f_utf_dynamic_append_assure__works),
+ cmocka_unit_test(test__f_utf_dynamic_append_assure_nulless__works),
+ cmocka_unit_test(test__f_utf_dynamic_append_nulless__works),
+
+ cmocka_unit_test(test__f_utf_dynamic_decimate_by__works),
+ cmocka_unit_test(test__f_utf_dynamic_decrease_by__works),
+ cmocka_unit_test(test__f_utf_dynamic_increase__works),
+ cmocka_unit_test(test__f_utf_dynamic_increase__returns_data_not),
+ cmocka_unit_test(test__f_utf_dynamic_increase_by__works),
+
+ cmocka_unit_test(test__f_utf_dynamic_mash__works),
+ cmocka_unit_test(test__f_utf_dynamic_mash_nulless__works),
+
+ cmocka_unit_test(test__f_utf_dynamic_mish__works),
+ cmocka_unit_test(test__f_utf_dynamic_mish_nulless__works),
+
+ cmocka_unit_test(test__f_utf_dynamic_partial_append__works),
+ cmocka_unit_test(test__f_utf_dynamic_partial_append_assure__works),
+ cmocka_unit_test(test__f_utf_dynamic_partial_append_assure_nulless__works),
+ cmocka_unit_test(test__f_utf_dynamic_partial_append_nulless__works),
+
+ cmocka_unit_test(test__f_utf_dynamic_partial_mash__works),
+ cmocka_unit_test(test__f_utf_dynamic_partial_mash_nulless__works),
+
+ cmocka_unit_test(test__f_utf_dynamic_partial_mish__works),
+ cmocka_unit_test(test__f_utf_dynamic_partial_mish_nulless__works),
+
+ cmocka_unit_test(test__f_utf_dynamic_partial_prepend__works),
+ cmocka_unit_test(test__f_utf_dynamic_partial_prepend_assure__works),
+ cmocka_unit_test(test__f_utf_dynamic_partial_prepend_assure_nulless__works),
+ cmocka_unit_test(test__f_utf_dynamic_partial_prepend_nulless__works),
+
+ cmocka_unit_test(test__f_utf_dynamic_prepend__works),
+ cmocka_unit_test(test__f_utf_dynamic_prepend_assure__works),
+ cmocka_unit_test(test__f_utf_dynamic_prepend_assure_nulless__works),
+ cmocka_unit_test(test__f_utf_dynamic_prepend_nulless__works),
+
+ cmocka_unit_test(test__f_utf_dynamic_resize__works),
+
+ cmocka_unit_test(test__f_utf_dynamic_seek_line__returns_data_not_stop),
+ cmocka_unit_test(test__f_utf_dynamic_seek_line__returns_none_eos),
+ cmocka_unit_test(test__f_utf_dynamic_seek_line__returns_none_stop),
+ cmocka_unit_test(test__f_utf_dynamic_seek_line__works),
+
+ cmocka_unit_test(test__f_utf_dynamic_seek_line_to__at_newline),
+ cmocka_unit_test(test__f_utf_dynamic_seek_line_to__returns_data_not_stop),
+ cmocka_unit_test(test__f_utf_dynamic_seek_line_to__returns_none_eos),
+ cmocka_unit_test(test__f_utf_dynamic_seek_line_to__returns_none_stop),
+ cmocka_unit_test(test__f_utf_dynamic_seek_line_to__works),
+
+ cmocka_unit_test(test__f_utf_dynamic_seek_to__returns_data_not_stop),
+ cmocka_unit_test(test__f_utf_dynamic_seek_to__returns_none_eos),
+ cmocka_unit_test(test__f_utf_dynamic_seek_to__returns_none_stop),
+ cmocka_unit_test(test__f_utf_dynamic_seek_to__works),
+
+ cmocka_unit_test(test__f_utf_dynamic_terminate__appends_null),
+ cmocka_unit_test(test__f_utf_dynamic_terminate__doesnt_append_null),
+
+ cmocka_unit_test(test__f_utf_dynamic_terminate_after__appends_null),
+ cmocka_unit_test(test__f_utf_dynamic_terminate_after__doesnt_append_null),
+
+ cmocka_unit_test(test__f_utf_dynamics_adjust__works),
+ cmocka_unit_test(test__f_utf_dynamics_append__works),
+ cmocka_unit_test(test__f_utf_dynamics_append_all__works),
+ cmocka_unit_test(test__f_utf_dynamics_append_all__returns_data_not),
+ cmocka_unit_test(test__f_utf_dynamics_decimate_by__works),
+ cmocka_unit_test(test__f_utf_dynamics_decrease_by__works),
+ cmocka_unit_test(test__f_utf_dynamics_increase__works),
+ cmocka_unit_test(test__f_utf_dynamics_increase__returns_data_not),
+ cmocka_unit_test(test__f_utf_dynamics_increase_by__works),
+ cmocka_unit_test(test__f_utf_dynamics_resize__works),
+
+ cmocka_unit_test(test__f_utf_dynamicss_adjust__works),
+ cmocka_unit_test(test__f_utf_dynamicss_append__works),
+ cmocka_unit_test(test__f_utf_dynamicss_append__returns_data_not),
+ cmocka_unit_test(test__f_utf_dynamicss_append_all__works),
+ cmocka_unit_test(test__f_utf_dynamicss_append_all__returns_data_not),
+ cmocka_unit_test(test__f_utf_dynamicss_decimate_by__works),
+ cmocka_unit_test(test__f_utf_dynamicss_decrease_by__works),
+ cmocka_unit_test(test__f_utf_dynamicss_increase__works),
+ cmocka_unit_test(test__f_utf_dynamicss_increase__returns_data_not),
+ cmocka_unit_test(test__f_utf_dynamicss_increase_by__works),
+ cmocka_unit_test(test__f_utf_dynamicss_resize__works),
+
+ cmocka_unit_test(test__f_utf_map_multis_adjust__works),
+ cmocka_unit_test(test__f_utf_map_multis_append__works),
+ cmocka_unit_test(test__f_utf_map_multis_append_all__works),
+ cmocka_unit_test(test__f_utf_map_multis_append_all__returns_data_not),
+ cmocka_unit_test(test__f_utf_map_multis_decimate_by__works),
+ cmocka_unit_test(test__f_utf_map_multis_decrease_by__works),
+ cmocka_unit_test(test__f_utf_map_multis_increase__works),
+ cmocka_unit_test(test__f_utf_map_multis_increase__returns_data_not),
+ cmocka_unit_test(test__f_utf_map_multis_increase_by__works),
+ cmocka_unit_test(test__f_utf_map_multis_resize__works),
+
+ cmocka_unit_test(test__f_utf_map_multiss_adjust__works),
+ cmocka_unit_test(test__f_utf_map_multiss_append__works),
+ cmocka_unit_test(test__f_utf_map_multiss_append__returns_data_not),
+ cmocka_unit_test(test__f_utf_map_multiss_append_all__works),
+ cmocka_unit_test(test__f_utf_map_multiss_append_all__returns_data_not),
+ cmocka_unit_test(test__f_utf_map_multiss_decimate_by__works),
+ cmocka_unit_test(test__f_utf_map_multiss_decrease_by__works),
+ cmocka_unit_test(test__f_utf_map_multiss_increase__works),
+ cmocka_unit_test(test__f_utf_map_multiss_increase__returns_data_not),
+ cmocka_unit_test(test__f_utf_map_multiss_increase_by__works),
+ cmocka_unit_test(test__f_utf_map_multiss_resize__works),
+
+ cmocka_unit_test(test__f_utf_maps_adjust__works),
+ cmocka_unit_test(test__f_utf_maps_append__works),
+ cmocka_unit_test(test__f_utf_maps_append_all__works),
+ cmocka_unit_test(test__f_utf_maps_append_all__returns_data_not),
+ cmocka_unit_test(test__f_utf_maps_decimate_by__works),
+ cmocka_unit_test(test__f_utf_maps_decrease_by__works),
+ cmocka_unit_test(test__f_utf_maps_increase__works),
+ cmocka_unit_test(test__f_utf_maps_increase__returns_data_not),
+ cmocka_unit_test(test__f_utf_maps_increase_by__works),
+ cmocka_unit_test(test__f_utf_maps_resize__works),
+
+ cmocka_unit_test(test__f_utf_mapss_adjust__works),
+ cmocka_unit_test(test__f_utf_mapss_append__works),
+ cmocka_unit_test(test__f_utf_mapss_append__returns_data_not),
+ cmocka_unit_test(test__f_utf_mapss_append_all__works),
+ cmocka_unit_test(test__f_utf_mapss_append_all__returns_data_not),
+ cmocka_unit_test(test__f_utf_mapss_decimate_by__works),
+ cmocka_unit_test(test__f_utf_mapss_decrease_by__works),
+ cmocka_unit_test(test__f_utf_mapss_increase__works),
+ cmocka_unit_test(test__f_utf_mapss_increase__returns_data_not),
+ cmocka_unit_test(test__f_utf_mapss_increase_by__works),
+ cmocka_unit_test(test__f_utf_mapss_resize__works),
+
+ cmocka_unit_test(test__f_utf_mash__works),
+ cmocka_unit_test(test__f_utf_mash_nulless__works),
+
+ cmocka_unit_test(test__f_utf_mish__works),
+ cmocka_unit_test(test__f_utf_mish_nulless__works),
+
+ cmocka_unit_test(test__f_utf_prepend__works),
+ cmocka_unit_test(test__f_utf_prepend_assure__works),
+ cmocka_unit_test(test__f_utf_prepend_assure_nulless__works),
+ cmocka_unit_test(test__f_utf_prepend_nulless__works),
+
+ cmocka_unit_test(test__f_utf_triples_adjust__works),
+ cmocka_unit_test(test__f_utf_triples_append__works),
+ cmocka_unit_test(test__f_utf_triples_append_all__works),
+ cmocka_unit_test(test__f_utf_triples_append_all__returns_data_not),
+ cmocka_unit_test(test__f_utf_triples_decimate_by__works),
+ cmocka_unit_test(test__f_utf_triples_decrease_by__works),
+ cmocka_unit_test(test__f_utf_triples_increase__works),
+ cmocka_unit_test(test__f_utf_triples_increase__returns_data_not),
+ cmocka_unit_test(test__f_utf_triples_increase_by__works),
+ cmocka_unit_test(test__f_utf_triples_resize__works),
+
+ cmocka_unit_test(test__f_utf_tripless_adjust__works),
+ cmocka_unit_test(test__f_utf_tripless_append__works),
+ cmocka_unit_test(test__f_utf_tripless_append__returns_data_not),
+ cmocka_unit_test(test__f_utf_tripless_append_all__works),
+ cmocka_unit_test(test__f_utf_tripless_append_all__returns_data_not),
+ cmocka_unit_test(test__f_utf_tripless_decimate_by__works),
+ cmocka_unit_test(test__f_utf_tripless_decrease_by__works),
+ cmocka_unit_test(test__f_utf_tripless_increase__works),
+ cmocka_unit_test(test__f_utf_tripless_increase__returns_data_not),
+ cmocka_unit_test(test__f_utf_tripless_increase_by__works),
+ cmocka_unit_test(test__f_utf_tripless_resize__works),
+
+ cmocka_unit_test(test__f_utf_seek_line__returns_data_not_stop),
+ cmocka_unit_test(test__f_utf_seek_line__returns_none_stop),
+ cmocka_unit_test(test__f_utf_seek_line__works),
+
+ cmocka_unit_test(test__f_utf_seek_line_to__at_newline),
+ cmocka_unit_test(test__f_utf_seek_line_to__returns_data_not_stop),
+ cmocka_unit_test(test__f_utf_seek_line_to__returns_none_stop),
+ cmocka_unit_test(test__f_utf_seek_line_to__works),
+
+ cmocka_unit_test(test__f_utf_seek_to__returns_data_not_stop),
+ cmocka_unit_test(test__f_utf_seek_to__returns_none_stop),
+ cmocka_unit_test(test__f_utf_seek_to__works),
+
+ #ifndef _di_level_0_parameter_checking_
+ cmocka_unit_test(test__f_utf_append__parameter_checking),
+ cmocka_unit_test(test__f_utf_append_assure__parameter_checking),
+ cmocka_unit_test(test__f_utf_append_assure_nulless__parameter_checking),
+ cmocka_unit_test(test__f_utf_append_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_dynamic_adjust__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_dynamic_append__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_append_assure__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_append_assure_nulless__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_append_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_dynamic_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_increase__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_increase__returns_data_not),
+ cmocka_unit_test(test__f_utf_dynamic_increase_by__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_dynamic_mash__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_mash_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_dynamic_mish__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_mish_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_dynamic_partial_append__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_partial_append_assure__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_partial_append_assure_nulless__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_partial_append_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_dynamic_partial_mash__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_partial_mash_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_dynamic_partial_mish__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_partial_mish_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_dynamic_partial_prepend__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_partial_prepend_assure__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_partial_prepend_assure_nulless__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_partial_prepend_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_dynamic_prepend__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_prepend_assure__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_prepend_assure_nulless__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_prepend_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_dynamic_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_dynamic_seek_line__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_seek_line_to__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_seek_to__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_dynamic_terminate__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamic_terminate_after__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_dynamics_adjust__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamics_append__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamics_append_all__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamics_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamics_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamics_increase__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamics_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamics_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_dynamicss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamicss_append__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamicss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamicss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamicss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamicss_increase__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamicss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_dynamicss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_map_multis_adjust__parameter_checking),
+ cmocka_unit_test(test__f_utf_map_multis_append__parameter_checking),
+ cmocka_unit_test(test__f_utf_map_multis_append_all__parameter_checking),
+ cmocka_unit_test(test__f_utf_map_multis_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_map_multis_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_map_multis_increase__parameter_checking),
+ cmocka_unit_test(test__f_utf_map_multis_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_map_multis_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_map_multiss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_utf_map_multiss_append__parameter_checking),
+ cmocka_unit_test(test__f_utf_map_multiss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_utf_map_multiss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_map_multiss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_map_multiss_increase__parameter_checking),
+ cmocka_unit_test(test__f_utf_map_multiss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_map_multiss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_maps_adjust__parameter_checking),
+ cmocka_unit_test(test__f_utf_maps_append__parameter_checking),
+ cmocka_unit_test(test__f_utf_maps_append_all__parameter_checking),
+ cmocka_unit_test(test__f_utf_maps_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_maps_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_maps_increase__parameter_checking),
+ cmocka_unit_test(test__f_utf_maps_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_maps_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_mapss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_utf_mapss_append__parameter_checking),
+ cmocka_unit_test(test__f_utf_mapss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_utf_mapss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_mapss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_mapss_increase__parameter_checking),
+ cmocka_unit_test(test__f_utf_mapss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_mapss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_mash__parameter_checking),
+ cmocka_unit_test(test__f_utf_mash_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_mish__parameter_checking),
+ cmocka_unit_test(test__f_utf_mish_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_prepend__parameter_checking),
+ cmocka_unit_test(test__f_utf_prepend_assure__parameter_checking),
+ cmocka_unit_test(test__f_utf_prepend_assure_nulless__parameter_checking),
+ cmocka_unit_test(test__f_utf_prepend_nulless__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_triples_adjust__parameter_checking),
+ cmocka_unit_test(test__f_utf_triples_append__parameter_checking),
+ cmocka_unit_test(test__f_utf_triples_append_all__parameter_checking),
+ cmocka_unit_test(test__f_utf_triples_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_triples_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_triples_increase__parameter_checking),
+ cmocka_unit_test(test__f_utf_triples_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_triples_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_tripless_adjust__parameter_checking),
+ cmocka_unit_test(test__f_utf_tripless_append__parameter_checking),
+ cmocka_unit_test(test__f_utf_tripless_append_all__parameter_checking),
+ cmocka_unit_test(test__f_utf_tripless_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_tripless_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_tripless_increase__parameter_checking),
+ cmocka_unit_test(test__f_utf_tripless_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_utf_tripless_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_seek_line__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_seek_line_to__parameter_checking),
+
+ cmocka_unit_test(test__f_utf_seek_to__parameter_checking),
+ #endif // _di_level_0_parameter_checking_
+ };
+
+ return cmocka_run_group_tests(tests, setup, setdown);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: String
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the string project.
+ */
+#ifndef _TEST__F_utf_h
+#define _TEST__F_utf_h
+
+// Libc includes.
+#include <stdarg.h>
+#include <stddef.h>
+#include <setjmp.h>
+#include <stdint.h>
+
+// cmocka includes.
+#include <cmocka.h>
+
+// FLL-0 includes.
+#include <fll/level_0/utf.h>
+
+// Mock includes.
+//#include "mock-string.h"
+
+// Test includes.
+#include "test-utf-append.h"
+#include "test-utf-append_assure.h"
+#include "test-utf-append_assure_nulless.h"
+#include "test-utf-append_nulless.h"
+#include "test-utf-dynamic_adjust.h"
+#include "test-utf-dynamic_append.h"
+#include "test-utf-dynamic_append_assure.h"
+#include "test-utf-dynamic_append_assure_nulless.h"
+#include "test-utf-dynamic_append_nulless.h"
+#include "test-utf-dynamic_decimate_by.h"
+#include "test-utf-dynamic_decrease_by.h"
+#include "test-utf-dynamic_increase.h"
+#include "test-utf-dynamic_increase_by.h"
+#include "test-utf-dynamic_mash.h"
+#include "test-utf-dynamic_mash_nulless.h"
+#include "test-utf-dynamic_mish.h"
+#include "test-utf-dynamic_mish_nulless.h"
+#include "test-utf-dynamic_partial_append.h"
+#include "test-utf-dynamic_partial_append_assure.h"
+#include "test-utf-dynamic_partial_append_assure_nulless.h"
+#include "test-utf-dynamic_partial_append_nulless.h"
+#include "test-utf-dynamic_partial_mash.h"
+#include "test-utf-dynamic_partial_mash_nulless.h"
+#include "test-utf-dynamic_partial_mish.h"
+#include "test-utf-dynamic_partial_mish_nulless.h"
+#include "test-utf-dynamic_partial_prepend.h"
+#include "test-utf-dynamic_partial_prepend_assure.h"
+#include "test-utf-dynamic_partial_prepend_assure_nulless.h"
+#include "test-utf-dynamic_partial_prepend_nulless.h"
+#include "test-utf-dynamic_prepend.h"
+#include "test-utf-dynamic_prepend_assure.h"
+#include "test-utf-dynamic_prepend_assure_nulless.h"
+#include "test-utf-dynamic_prepend_nulless.h"
+#include "test-utf-dynamic_resize.h"
+#include "test-utf-dynamic_seek_line.h"
+#include "test-utf-dynamic_seek_line_to.h"
+#include "test-utf-dynamic_seek_to.h"
+#include "test-utf-dynamic_terminate.h"
+#include "test-utf-dynamic_terminate_after.h"
+#include "test-utf-dynamics_adjust.h"
+#include "test-utf-dynamics_append.h"
+#include "test-utf-dynamics_append_all.h"
+#include "test-utf-dynamics_decimate_by.h"
+#include "test-utf-dynamics_decrease_by.h"
+#include "test-utf-dynamics_increase.h"
+#include "test-utf-dynamics_increase_by.h"
+#include "test-utf-dynamics_resize.h"
+#include "test-utf-dynamicss_adjust.h"
+#include "test-utf-dynamicss_append.h"
+#include "test-utf-dynamicss_append_all.h"
+#include "test-utf-dynamicss_decimate_by.h"
+#include "test-utf-dynamicss_decrease_by.h"
+#include "test-utf-dynamicss_increase.h"
+#include "test-utf-dynamicss_increase_by.h"
+#include "test-utf-dynamicss_resize.h"
+#include "test-utf-map_multis_adjust.h"
+#include "test-utf-map_multis_append.h"
+#include "test-utf-map_multis_append_all.h"
+#include "test-utf-map_multis_decimate_by.h"
+#include "test-utf-map_multis_decrease_by.h"
+#include "test-utf-map_multis_increase.h"
+#include "test-utf-map_multis_increase_by.h"
+#include "test-utf-map_multis_resize.h"
+#include "test-utf-map_multiss_adjust.h"
+#include "test-utf-map_multiss_append.h"
+#include "test-utf-map_multiss_append_all.h"
+#include "test-utf-map_multiss_decimate_by.h"
+#include "test-utf-map_multiss_decrease_by.h"
+#include "test-utf-map_multiss_increase.h"
+#include "test-utf-map_multiss_increase_by.h"
+#include "test-utf-map_multiss_resize.h"
+#include "test-utf-maps_adjust.h"
+#include "test-utf-maps_append.h"
+#include "test-utf-maps_append_all.h"
+#include "test-utf-maps_decimate_by.h"
+#include "test-utf-maps_decrease_by.h"
+#include "test-utf-maps_increase.h"
+#include "test-utf-maps_increase_by.h"
+#include "test-utf-maps_resize.h"
+#include "test-utf-mapss_adjust.h"
+#include "test-utf-mapss_append.h"
+#include "test-utf-mapss_append_all.h"
+#include "test-utf-mapss_decimate_by.h"
+#include "test-utf-mapss_decrease_by.h"
+#include "test-utf-mapss_increase.h"
+#include "test-utf-mapss_increase_by.h"
+#include "test-utf-mapss_resize.h"
+#include "test-utf-mash.h"
+#include "test-utf-mash_nulless.h"
+#include "test-utf-mish.h"
+#include "test-utf-mish_nulless.h"
+#include "test-utf-prepend.h"
+#include "test-utf-prepend_assure.h"
+#include "test-utf-prepend_assure_nulless.h"
+#include "test-utf-prepend_nulless.h"
+#include "test-utf-seek_line.h"
+#include "test-utf-seek_line_to.h"
+#include "test-utf-seek_to.h"
+#include "test-utf-triples_adjust.h"
+#include "test-utf-triples_append.h"
+#include "test-utf-triples_append_all.h"
+#include "test-utf-triples_decimate_by.h"
+#include "test-utf-triples_decrease_by.h"
+#include "test-utf-triples_increase.h"
+#include "test-utf-triples_increase_by.h"
+#include "test-utf-triples_resize.h"
+#include "test-utf-tripless_adjust.h"
+#include "test-utf-tripless_append.h"
+#include "test-utf-tripless_append_all.h"
+#include "test-utf-tripless_decimate_by.h"
+#include "test-utf-tripless_decrease_by.h"
+#include "test-utf-tripless_increase.h"
+#include "test-utf-tripless_increase_by.h"
+#include "test-utf-tripless_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Perform any setup operations.
+ *
+ * @param state
+ * The test state.
+ *
+ * @return
+ * The status of this function, where 0 means success.
+ */
+extern int setup(void **state);
+
+/**
+ * Peform any setdown operations.
+ *
+ * @param state
+ * The test state.
+ *
+ * @return
+ * The status of this function, where 0 means success.
+ */
+extern int setdown(void **state);
+
+/**
+ * Run all tests.
+ *
+ * @return
+ * The final result of the tests.
+ *
+ * @see cmocka_run_group_tests()
+ * @see cmocka_unit_test()
+ */
+extern int main(void);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _TEST__F_utf_h