The array functions for managing structures needs to be consistent with the *_append() functions.
This introduces the *_append() all across the board.
The previous *_append() behavior is essentially refactored into *_append_all().
The *_append() now accepts a single type for a given structure rather than a set.
(The single type can still be representative of a set itself.)
Add a lot of tests.
Add missing f_iki tests.
The f_string tests are not fully implemented, the f_dynamic_* functions are only partially tested.
All of the other f_string structures should be fully tested now.
Make the macro_f_string_range_t_initialize() macro consistency with all other macros.
That is, the macro initialize that does not have a digit initializes using all of the structures members.
This effectively refactors macro_f_string_range_t_initialize() into macro_f_string_range_t_initialize2() and macro_f_string_range_t_initialize2() into macro_f_string_range_t_initialize().
Change the behavior of the *_resize() and *_adjust() functions to return F_none rather than a direct f_memory status code.
Update some of the string functions to return F_data_not_eos.
Restructure some of the code to be a bit more organized.
Specifically, the f_iki_data_t is moved into its own source and header files.
Reduce the clutter in some of the private source and header files by moving some of their content into separate individual files as appropriate.
build_sources_library execute.c
build_sources_library file.c file/common.c private-file.c
build_sources_library fss.c private-fss.c fss/common.c fss/named.c fss/nest.c fss/set.c
-build_sources_library iki.c iki/common.c private-iki.c
+build_sources_library iki.c iki/common.c iki/data.c private-iki.c iki/private-data.c
build_sources_library limit.c
build_sources_library memory.c private-memory.c memory/structure.c
build_sources_library path.c private-path.c path/common.c
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/dynamic.c string/map.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
-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
+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 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/dynamic.c utf/map.c utf/private-is_unassigned.c utf/private-string.c utf/string.c utf/triple.c
build_sources_library-level thread.c private-thread.c
build_sources_library_shared
build_sources_headers execute.h execute/common.h
build_sources_headers file.h file/common.h
build_sources_headers fss.h fss/comment.h fss/common.h fss/delimit.h fss/named.h fss/nest.h fss/quote.h fss/set.h
-build_sources_headers iki.h iki/common.h
+build_sources_headers iki.h iki/common.h iki/data.h
build_sources_headers limit.h limit/common.h
build_sources_headers memory.h memory/structure.h memory/common.h
build_sources_headers path.h path/common.h
build_sources_headers socket.h socket/common.h
build_sources_headers status.h
build_sources_headers status_string.h
-build_sources_headers string.h string/common.h string/dynamic.h string/map.h string/quantity.h string/range.h string/static.h string/triple.h
+build_sources_headers string.h string/common.h string/dynamic.h string/map.h string/map_multi.h string/quantity.h string/range.h string/static.h string/triple.h
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
+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/dynamic.h utf/map.h utf/string.h utf/triple.h
build_sources_headers-level thread.h thread/common.h
build_sources_headers_shared
build_sources_library level_0/execute.c
build_sources_library level_0/file.c level_0/file/common.c level_0/private-file.c
build_sources_library level_0/fss.c level_0/private-fss.c level_0/fss/common.c level_0/fss/named.c level_0/fss/nest.c level_0/fss/set.c
-build_sources_library level_0/iki.c level_0/iki/common.c level_0/private-iki.c
+build_sources_library level_0/iki.c level_0/iki/common.c level_0/iki/data.c level_0/private-iki.c level_0/iki/private-data.c
build_sources_library level_0/limit.c
build_sources_library level_0/memory.c level_0/private-memory.c level_0/memory/structure.c
build_sources_library level_0/path.c level_0/private-path.c level_0/path/common.c
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/dynamic.c level_0/string/map.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
-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
+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/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/dynamic.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_1/control_group.c
build_sources_library level_1/conversion.c level_1/private-conversion.c
build_sources_headers level_0/execute.h level_0/execute/common.h
build_sources_headers level_0/file.h level_0/file/common.h
build_sources_headers level_0/fss.h level_0/fss/comment.h level_0/fss/common.h level_0/fss/delimit.h level_0/fss/named.h level_0/fss/nest.h level_0/fss/quote.h level_0/fss/set.h
-build_sources_headers level_0/iki.h level_0/iki/common.h
+build_sources_headers level_0/iki.h level_0/iki/common.h level_0/iki/data.h
build_sources_headers level_0/limit.h level_0/limit/common.h
build_sources_headers level_0/memory.h level_0/memory/structure.h level_0/memory/common.h
build_sources_headers level_0/path.h level_0/path/common.h
build_sources_headers level_0/socket.h level_0/socket/common.h
build_sources_headers level_0/status.h
build_sources_headers level_0/status_string.h
-build_sources_headers level_0/string.h level_0/string/common.h level_0/string/dynamic.h level_0/string/map.h level_0/string/quantity.h level_0/string/range.h level_0/string/static.h level_0/string/triple.h
+build_sources_headers level_0/string.h level_0/string/common.h level_0/string/dynamic.h level_0/string/map.h level_0/string/map_multi.h level_0/string/quantity.h level_0/string/range.h level_0/string/static.h level_0/string/triple.h
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
+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/dynamic.h level_0/utf/map.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
}
if (source.groups.used) {
- status = f_string_dynamics_append(source.groups, &destination->groups);
+ status = f_string_dynamics_append_all(source.groups, &destination->groups);
if (F_status_is_error(status)) return status;
}
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_string_dynamic_append().
- * Errors (with error bit) from: f_string_dynamics_append().
+ * Errors (with error bit) from: f_string_dynamics_append_all().
*
* @see f_string_dynamic_append()
- * @see f_string_dynamics_append()
+ * @see f_string_dynamics_append_all()
*/
#ifndef _di_f_control_group_copy_
extern f_status_t f_control_group_copy(const f_control_group_t source, f_control_group_t * const destination);
#define f_fss_comment_t_initialize f_string_range_t_initialize
- #define macro_f_fss_comment_t_initialize(length) macro_f_string_range_t_initialize(length)
+ #define macro_f_fss_comment_t_initialize(length) macro_f_string_range_t_initialize2(length)
#define macro_f_fss_comment_t_clear(comment) macro_f_string_range_t_clear(comment)
#endif // _di_f_fss_comment_t_
#define f_fss_object_t_initialize f_string_range_t_initialize
- #define macro_f_fss_object_t_initialize(length) macro_f_string_range_t_initialize(length)
+ #define macro_f_fss_object_t_initialize(length) macro_f_string_range_t_initialize2(length)
#define macro_f_fss_object_t_clear(object) macro_f_string_range_t_clear(object)
#endif // _di_f_fss_object_t_
#ifndef _di_f_fss_delimit_t_
typedef f_array_length_t f_fss_delimit_t;
- #define macro_f_fss_object_t_initialize(length) macro_f_string_range_t_initialize(length)
+ #define macro_f_fss_object_t_initialize(length) macro_f_string_range_t_initialize2(length)
#endif // _di_f_fss_delimit_t_
/**
} // for
status = f_memory_resize(items->size, length, sizeof(f_fss_item_t), (void **) & items->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- items->size = length;
+ items->size = length;
- if (items->used > items->size) {
- items->used = length;
- }
+ if (items->used > items->size) {
+ items->used = length;
}
- if (F_status_is_error(status)) return status;
-
return F_none;
}
#endif // !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_increase_) || !defined(_di_f_fss_items_increase_by_) || !defined(_di_f_fss_items_resize_)
} // for
status = f_memory_resize(nameds->size, length, sizeof(f_fss_named_t), (void **) & nameds->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- nameds->size = length;
+ nameds->size = length;
- if (nameds->used > nameds->size) {
- nameds->used = length;
- }
+ if (nameds->used > nameds->size) {
+ nameds->used = length;
}
- if (F_status_is_error(status)) return status;
-
return F_none;
}
#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_)
} // for
status = f_memory_resize(nest->size, length, sizeof(f_fss_items_t), (void **) & nest->depth);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- nest->size = length;
+ nest->size = length;
- if (nest->used > nest->size) {
- nest->used = length;
- }
+ if (nest->used > nest->size) {
+ nest->used = length;
}
- if (F_status_is_error(status)) return status;
-
return F_none;
}
#endif // !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_increase_) || !defined(_di_f_fss_nest_increase_by_) || !defined(_di_f_fss_nest_resize_)
} // for
status = f_memory_resize(nests->size, length, sizeof(f_fss_nest_t), (void **) & nests->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- nests->size = length;
+ nests->size = length;
- if (nests->used > nests->size) {
- nests->used = length;
- }
+ if (nests->used > nests->size) {
+ nests->used = length;
}
- if (F_status_is_error(status)) return status;
-
return F_none;
}
#endif // !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_)
} // for
status = f_memory_resize(set_quotes->size, length, sizeof(f_fss_set_quote_t), (void **) & set_quotes->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- set_quotes->size = length;
+ set_quotes->size = length;
- if (set_quotes->used > set_quotes->size) {
- set_quotes->used = length;
- }
+ if (set_quotes->used > set_quotes->size) {
+ set_quotes->used = length;
}
- if (F_status_is_error(status)) return status;
-
return F_none;
}
#endif // !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_increase_) || !defined(_di_f_fss_set_quotes_increase_by_) || !defined(_di_f_fss_set_quotes_resize_)
} // for
status = f_memory_resize(sets->size, length, sizeof(f_fss_set_t), (void **) & sets->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- sets->size = length;
+ sets->size = length;
- if (sets->used > sets->size) {
- sets->used = length;
- }
+ if (sets->used > sets->size) {
+ sets->used = length;
}
- if (F_status_is_error(status)) return status;
-
return F_none;
}
#endif // !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_increase_) || !defined(_di_f_fss_sets_increase_by_) || !defined(_di_f_fss_sets_resize_)
// FLL-0 iki includes.
#include <fll/level_0/iki/common.h>
+#include <fll/level_0/iki/data.h>
#ifdef __cplusplus
extern "C" {
const f_string_static_t f_iki_vocabulary_0002_parameter_s = macro_f_string_static_t_initialize(F_iki_vocabulary_0002_parameter_s, 0, F_iki_vocabulary_0002_parameter_s_length);
#endif // _di_f_iki_vocabulary_0002_s_
-#ifndef _di_f_iki_data_delete_
- f_status_t f_iki_data_delete(f_iki_data_t *data) {
- #ifndef _di_level_0_parameter_checking_
- if (!data) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- f_status_t status = f_string_ranges_resize(0, &data->content);
- if (F_status_is_error(status)) return status;
-
- status = f_array_lengths_resize(0, &data->delimits);
- if (F_status_is_error(status)) return status;
-
- status = f_string_ranges_resize(0, &data->variable);
- if (F_status_is_error(status)) return status;
-
- status = f_string_ranges_resize(0, &data->vocabulary);
- if (F_status_is_error(status)) return status;
-
- return F_none;
- }
-#endif // _di_f_iki_data_delete_
-
-#ifndef _di_f_iki_data_destroy_
- f_status_t f_iki_data_destroy(f_iki_data_t *data) {
- #ifndef _di_level_0_parameter_checking_
- if (!data) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- f_status_t status = f_string_ranges_adjust(0, &data->content);
- if (F_status_is_error(status)) return status;
-
- status = f_array_lengths_adjust(0, &data->delimits);
- if (F_status_is_error(status)) return status;
-
- status = f_string_ranges_adjust(0, &data->variable);
- if (F_status_is_error(status)) return status;
-
- status = f_string_ranges_adjust(0, &data->vocabulary);
- if (F_status_is_error(status)) return status;
-
- return F_none;
- }
-#endif // _di_f_iki_data_destroy_
-
-#ifndef _di_f_iki_datas_adjust_
- f_status_t f_iki_datas_adjust(const f_array_length_t length, f_iki_datas_t *datas) {
- #ifndef _di_level_0_parameter_checking_
- if (!datas) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_iki_datas_adjust(length, datas);
- }
-#endif // _di_f_iki_datas_adjust_
-
-#ifndef _di_f_iki_datas_append_
- f_status_t f_iki_datas_append(const f_iki_datas_t source, f_iki_datas_t *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_iki_datas_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].content.used = 0;
- destination->array[destination->used].delimits.used = 0;
- destination->array[destination->used].variable.used = 0;
- destination->array[destination->used].vocabulary.used = 0;
-
- status = f_string_ranges_append(source.array[i].content, &destination->array[destination->used].content);
- if (F_status_is_error(status)) return status;
-
- status = f_array_lengths_append(source.array[i].delimits, &destination->array[destination->used].delimits);
- if (F_status_is_error(status)) return status;
-
- status = f_string_ranges_append(source.array[i].variable, &destination->array[destination->used].variable);
- if (F_status_is_error(status)) return status;
-
- status = f_string_ranges_append(source.array[i].vocabulary, &destination->array[destination->used].vocabulary);
- if (F_status_is_error(status)) return status;
- } // for
-
- return F_none;
- }
-#endif // _di_f_iki_datas_append_
-
-#ifndef _di_f_iki_datas_decimate_by_
- f_status_t f_iki_datas_decimate_by(const f_array_length_t amount, f_iki_datas_t *datas) {
- #ifndef _di_level_0_parameter_checking_
- if (!datas) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (datas->size - amount > 0) {
- return private_f_iki_datas_adjust(datas->size - amount, datas);
- }
-
- return private_f_iki_datas_adjust(0, datas);
- }
-#endif // _di_f_iki_datas_decimate_by_
-
-#ifndef _di_f_iki_datas_decrease_by_
- f_status_t f_iki_datas_decrease_by(const f_array_length_t amount, f_iki_datas_t *datas) {
- #ifndef _di_level_0_parameter_checking_
- if (!datas) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (datas->size - amount > 0) {
- return private_f_iki_datas_resize(datas->size - amount, datas);
- }
-
- return private_f_iki_datas_resize(0, datas);
- }
-#endif // _di_f_iki_datas_decrease_by_
-
-#ifndef _di_f_iki_datas_increase_
- f_status_t f_iki_datas_increase(const f_array_length_t step, f_iki_datas_t *datas) {
- #ifndef _di_level_0_parameter_checking_
- if (!datas) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (step && datas->used + 1 > datas->size) {
- f_array_length_t size = datas->used + step;
-
- if (size > F_array_length_t_size_d) {
- if (datas->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_iki_datas_resize(size, datas);
- }
-
- return F_data_not;
- }
-#endif // _di_f_iki_datas_increase_
-
-#ifndef _di_f_iki_datas_increase_by_
- f_status_t f_iki_datas_increase_by(const f_array_length_t amount, f_iki_datas_t *datas) {
- #ifndef _di_level_0_parameter_checking_
- if (!datas) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (datas->used + amount > datas->size) {
- if (datas->used + amount > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_iki_datas_resize(datas->used + amount, datas);
- }
-
- return F_data_not;
- }
-#endif // _di_f_iki_datas_increase_by_
-
-#ifndef _di_f_iki_datas_resize_
- f_status_t f_iki_datas_resize(const f_array_length_t length, f_iki_datas_t *datas) {
- #ifndef _di_level_0_parameter_checking_
- if (!datas) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_iki_datas_resize(length, datas);
- }
-#endif // _di_f_iki_datas_resize_
-
#ifdef __cplusplus
} // extern "C"
#endif
/**
* An array of f_iki_data_t.
*
- * array: The array of fss quotes.
+ * array: The array of IKI data.
* size: Total amount of allocated space.
* used: Total number of allocated spaces used.
*/
f_array_length_t used;
} f_iki_datas_t;
- #define f_fss_iki_datas_t_initialize { 0, 0, 0 }
+ #define f_iki_datas_t_initialize { 0, 0, 0 }
#define macro_f_iki_datas_t_initialize(content, size, used) { array, size, used }
#define macro_f_iki_datas_t_initialize2(array, length) { array, length, length }
- #define macro_f_fss_iki_datas_t_clear(datas) macro_f_memory_structure_clear(datas)
+ #define macro_f_iki_datas_t_clear(datas) macro_f_memory_structure_clear(datas)
- #define macro_f_fss_iki_datas_t_resize(status, datas, length) status = f_iki_datas_resize(length, &datas);
- #define macro_f_fss_iki_datas_t_adjust(status, datas, length) status = f_iki_datas_adjust(length, &datas);
+ #define macro_f_iki_datas_t_resize(status, datas, length) status = f_iki_datas_resize(length, &datas);
+ #define macro_f_iki_datas_t_adjust(status, datas, length) status = f_iki_datas_adjust(length, &datas);
- #define macro_f_fss_iki_datas_t_delete_simple(datas) status = f_iki_datas_resize(0, &datas);
- #define macro_f_fss_iki_datas_t_destroy_simple(datas) status = f_iki_datas_adjust(0, &datas);
+ #define macro_f_iki_datas_t_delete_simple(datas) status = f_iki_datas_resize(0, &datas);
+ #define macro_f_iki_datas_t_destroy_simple(datas) status = f_iki_datas_adjust(0, &datas);
- #define macro_f_fss_iki_datas_t_increase(status, step, datas) status = f_iki_datas_increase(step, &datas);
- #define macro_f_fss_iki_datas_t_increase_by(status, datas, amount) status = f_iki_datas_increase_by(amount, &datas);
- #define macro_f_fss_iki_datas_t_decrease_by(status, datas, amount) status = f_iki_datas_decrease_by(amount, &datas);
- #define macro_f_fss_iki_datas_t_decimate_by(status, datas, amount) status = f_iki_datas_decimate_by(amount, &datas);
+ #define macro_f_iki_datas_t_increase(status, step, datas) status = f_iki_datas_increase(step, &datas);
+ #define macro_f_iki_datas_t_increase_by(status, datas, amount) status = f_iki_datas_increase_by(amount, &datas);
+ #define macro_f_iki_datas_t_decrease_by(status, datas, amount) status = f_iki_datas_decrease_by(amount, &datas);
+ #define macro_f_iki_datas_t_decimate_by(status, datas, amount) status = f_iki_datas_decimate_by(amount, &datas);
#endif // _di_f_iki_datas_t_
/**
- * Provide a default allocation step.
- *
- * For a UTF-8 friendly allocation step, set to at least 4.
- */
-#ifndef _di_f_iki_default_allocation_step_
- #define F_iki_default_allocation_step_d 4
-#endif // _di_f_iki_default_allocation_step_
-
-/**
- * Delete the IKI data.
- *
- * @param data
- * The IKI data to delete.
+ * An array of f_iki_datas_t.
*
- * @return
- * F_none on success.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_array_lengths_resize().
- * Errors (with error bit) from: f_string_ranges_resize().
- *
- * @see f_array_lengths_resize()
- * @see f_string_ranges_resize()
+ * array: The array of IKI datas.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
-#ifndef _di_f_iki_data_delete_
- extern f_status_t f_iki_data_delete(f_iki_data_t *data);
-#endif // _di_f_iki_data_delete_
+#ifndef _di_f_iki_datass_t_
+ typedef struct {
+ f_iki_datas_t *array;
-/**
- * Destroy the IKI data.
- *
- * @param data
- * The IKI data to destroy.
- *
- * @return
- * F_none on success.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_array_lengths_adjust().
- * Errors (with error bit) from: f_string_ranges_adjust().
- *
- * @see f_array_lengths_adjust()
- * @see f_string_ranges_adjust()
- */
-#ifndef _di_f_iki_data_destroy_
- extern f_status_t f_iki_data_destroy(f_iki_data_t *data);
-#endif // _di_f_iki_data_destroy_
+ f_array_length_t size;
+ f_array_length_t used;
+ } f_iki_datass_t;
-/**
- * Resize the string lengths array.
- *
- * @param length
- * The new size to use.
- * @param lengths
- * The string lengths 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_iki_datas_adjust_
- extern f_status_t f_iki_datas_adjust(const f_array_length_t length, f_iki_datas_t *datas);
-#endif // _di_f_iki_datas_adjust_
+ #define f_iki_datass_t_initialize { 0, 0, 0 }
-/**
- * Append the source lengths onto the destination.
- *
- * @param source
- * The source lengths to append.
- * @param destination
- * The destination lengths 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.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_iki_datas_append_
- extern f_status_t f_iki_datas_append(const f_iki_datas_t source, f_iki_datas_t *destination);
-#endif // _di_f_iki_datas_append_
+ #define macro_f_iki_datass_t_initialize(content, size, used) { array, size, used }
+ #define macro_f_iki_datass_t_initialize2(array, length) { array, length, length }
-/**
- * Resize the string lengths 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 les than 0.
- *
- * @param amount
- * A positive number representing how much to decimate the size by.
- * @param lengths
- * The string lengths 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_adjust().
- */
-#ifndef _di_f_iki_datas_decimate_by_
- extern f_status_t f_iki_datas_decimate_by(const f_array_length_t amount, f_iki_datas_t *datas);
-#endif // _di_f_iki_datas_decimate_by_
+ #define macro_f_iki_datass_t_clear(datas) macro_f_memory_structure_clear(datas)
-/**
- * Resize the string lengths 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 les than 0.
- *
- * @param amount
- * A positive number representing how much to decrease the size by.
- * @param lengths
- * The string lengths 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_iki_datas_decrease_by_
- extern f_status_t f_iki_datas_decrease_by(const f_array_length_t amount, f_iki_datas_t *datas);
-#endif // _di_f_iki_datas_decrease_by_
+ #define macro_f_iki_datass_t_resize(status, datas, length) status = f_iki_datass_resize(length, &datas);
+ #define macro_f_iki_datass_t_adjust(status, datas, length) status = f_iki_datass_adjust(length, &datas);
-/**
- * Increase the size of the string lengths array, but only if necesary.
- *
- * 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 lengths
- * The string lengths 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_iki_datas_increase_
- extern f_status_t f_iki_datas_increase(const f_array_length_t step, f_iki_datas_t *datas);
-#endif // _di_f_iki_datas_increase_
+ #define macro_f_iki_datass_t_delete_simple(datas) status = f_iki_datass_resize(0, &datas);
+ #define macro_f_iki_datass_t_destroy_simple(datas) status = f_iki_datass_adjust(0, &datas);
-/**
- * Resize the string lengths 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 lengths
- * The string lengths 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_iki_datas_increase_by_
- extern f_status_t f_iki_datas_increase_by(const f_array_length_t amount, f_iki_datas_t *datas);
-#endif // _di_f_iki_datas_increase_by_
+ #define macro_f_iki_datass_t_increase(status, step, datas) status = f_iki_datass_increase(step, &datas);
+ #define macro_f_iki_datass_t_increase_by(status, datas, amount) status = f_iki_datass_increase_by(amount, &datas);
+ #define macro_f_iki_datass_t_decrease_by(status, datas, amount) status = f_iki_datass_decrease_by(amount, &datas);
+ #define macro_f_iki_datass_t_decimate_by(status, datas, amount) status = f_iki_datass_decimate_by(amount, &datas);
+#endif // _di_f_iki_datass_t_
/**
- * Resize the string lengths array.
- *
- * @param length
- * The new size to use.
- * @param lengths
- * The string lengths array to adjust.
- *
- * @return
- * F_none on success.
+ * Provide a default allocation step.
*
- * F_parameter (with error bit) if a parameter is invalid.
+ * For a UTF-8 friendly allocation step, set to at least 4.
*
- * Errors (with error bit) from: f_memory_resize().
+ * F_iki_default_allocation_*:
+ * - large: The large allocation size.
+ * - small: The small allocation size, in particular used for allocation iki strings.
*/
-#ifndef _di_f_iki_datas_resize_
- extern f_status_t f_iki_datas_resize(const f_array_length_t length, f_iki_datas_t *datas);
-#endif // _di_f_iki_datas_resize_
+#ifndef _di_f_iki_default_allocation_step_
+ #define F_iki_default_allocation_large_d F_memory_default_allocation_large_d
+ #define F_iki_default_allocation_small_d 4
+#endif // _di_f_iki_default_allocation_step_
#ifdef __cplusplus
} // extern "C"
--- /dev/null
+#include "../iki.h"
+#include "data.h"
+#include "private-data.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_f_iki_data_delete_
+ f_status_t f_iki_data_delete(f_iki_data_t *data) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!data) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ f_status_t status = f_string_ranges_resize(0, &data->content);
+ if (F_status_is_error(status)) return status;
+
+ status = f_array_lengths_resize(0, &data->delimits);
+ if (F_status_is_error(status)) return status;
+
+ status = f_string_ranges_resize(0, &data->variable);
+ if (F_status_is_error(status)) return status;
+
+ status = f_string_ranges_resize(0, &data->vocabulary);
+ if (F_status_is_error(status)) return status;
+
+ return F_none;
+ }
+#endif // _di_f_iki_data_delete_
+
+#ifndef _di_f_iki_data_destroy_
+ f_status_t f_iki_data_destroy(f_iki_data_t *data) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!data) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ f_status_t status = f_string_ranges_adjust(0, &data->content);
+ if (F_status_is_error(status)) return status;
+
+ status = f_array_lengths_adjust(0, &data->delimits);
+ if (F_status_is_error(status)) return status;
+
+ status = f_string_ranges_adjust(0, &data->variable);
+ if (F_status_is_error(status)) return status;
+
+ status = f_string_ranges_adjust(0, &data->vocabulary);
+ if (F_status_is_error(status)) return status;
+
+ return F_none;
+ }
+#endif // _di_f_iki_data_destroy_
+
+#ifndef _di_f_iki_datas_adjust_
+ f_status_t f_iki_datas_adjust(const f_array_length_t length, f_iki_datas_t *datas) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!datas) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_iki_datas_adjust(length, datas);
+ }
+#endif // _di_f_iki_datas_adjust_
+
+#ifndef _di_f_iki_datas_append_
+ f_status_t f_iki_datas_append(const f_iki_data_t source, f_iki_datas_t *destination) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!destination) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_iki_datas_append(source, destination);
+ }
+#endif // _di_f_iki_datas_append_
+
+#ifndef _di_f_iki_datas_append_all_
+ f_status_t f_iki_datas_append_all(const f_iki_datas_t source, f_iki_datas_t *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_iki_datas_append_all(source, destination);
+ }
+#endif // _di_f_iki_datas_append_all_
+
+#ifndef _di_f_iki_datas_decimate_by_
+ f_status_t f_iki_datas_decimate_by(const f_array_length_t amount, f_iki_datas_t *datas) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!datas) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (datas->size - amount > 0) {
+ return private_f_iki_datas_adjust(datas->size - amount, datas);
+ }
+
+ return private_f_iki_datas_adjust(0, datas);
+ }
+#endif // _di_f_iki_datas_decimate_by_
+
+#ifndef _di_f_iki_datas_decrease_by_
+ f_status_t f_iki_datas_decrease_by(const f_array_length_t amount, f_iki_datas_t *datas) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!datas) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (datas->size - amount > 0) {
+ return private_f_iki_datas_resize(datas->size - amount, datas);
+ }
+
+ return private_f_iki_datas_resize(0, datas);
+ }
+#endif // _di_f_iki_datas_decrease_by_
+
+#ifndef _di_f_iki_datas_increase_
+ f_status_t f_iki_datas_increase(const f_array_length_t step, f_iki_datas_t *datas) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!datas) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (step && datas->used + 1 > datas->size) {
+ f_array_length_t size = datas->used + step;
+
+ if (size > F_array_length_t_size_d) {
+ if (datas->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_iki_datas_resize(size, datas);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_iki_datas_increase_
+
+#ifndef _di_f_iki_datas_increase_by_
+ f_status_t f_iki_datas_increase_by(const f_array_length_t amount, f_iki_datas_t *datas) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!datas) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (datas->used + amount > datas->size) {
+ if (datas->used + amount > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ return private_f_iki_datas_resize(datas->used + amount, datas);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_iki_datas_increase_by_
+
+#ifndef _di_f_iki_datas_resize_
+ f_status_t f_iki_datas_resize(const f_array_length_t length, f_iki_datas_t *datas) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!datas) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_iki_datas_resize(length, datas);
+ }
+#endif // _di_f_iki_datas_resize_
+
+#ifndef _di_f_iki_datass_adjust_
+ f_status_t f_iki_datass_adjust(const f_array_length_t length, f_iki_datass_t *datass) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!datass) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_iki_datass_adjust(length, datass);
+ }
+#endif // _di_f_iki_datass_adjust_
+
+#ifndef _di_f_iki_datass_append_
+ f_status_t f_iki_datass_append(const f_iki_datas_t source, f_iki_datass_t *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_iki_datass_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ status = private_f_iki_datas_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_iki_datass_append_
+
+#ifndef _di_f_iki_datass_append_all_
+ f_status_t f_iki_datass_append_all(const f_iki_datass_t source, f_iki_datass_t *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_iki_datass_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_iki_datas_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+
+ return F_none;
+ }
+#endif // _di_f_iki_datass_append_all_
+
+#ifndef _di_f_iki_datass_decimate_by_
+ f_status_t f_iki_datass_decimate_by(const f_array_length_t amount, f_iki_datass_t *datass) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!datass) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (datass->size - amount > 0) {
+ return private_f_iki_datass_adjust(datass->size - amount, datass);
+ }
+
+ return private_f_iki_datass_adjust(0, datass);
+ }
+#endif // _di_f_iki_datass_decimate_by_
+
+#ifndef _di_f_iki_datass_decrease_by_
+ f_status_t f_iki_datass_decrease_by(const f_array_length_t amount, f_iki_datass_t *datass) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!datass) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (datass->size - amount > 0) {
+ return private_f_iki_datass_resize(datass->size - amount, datass);
+ }
+
+ return private_f_iki_datass_resize(0, datass);
+ }
+#endif // _di_f_iki_datass_decrease_by_
+
+#ifndef _di_f_iki_datass_increase_
+ f_status_t f_iki_datass_increase(const f_array_length_t step, f_iki_datass_t *datass) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!datass) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (step && datass->used + 1 > datass->size) {
+ f_array_length_t size = datass->used + step;
+
+ if (size > F_array_length_t_size_d) {
+ if (datass->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_iki_datass_resize(size, datass);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_iki_datass_increase_
+
+#ifndef _di_f_iki_datass_increase_by_
+ f_status_t f_iki_datass_increase_by(const f_array_length_t amount, f_iki_datass_t *datass) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!datass) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (datass->used + amount > datass->size) {
+ if (datass->used + amount > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ return private_f_iki_datass_resize(datass->used + amount, datass);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_iki_datass_increase_by_
+
+#ifndef _di_f_iki_datass_resize_
+ f_status_t f_iki_datass_resize(const f_array_length_t length, f_iki_datass_t *datass) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!datass) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_iki_datass_resize(length, datass);
+ }
+#endif // _di_f_iki_datass_resize_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Defines data to be used for/by type (array) related functionality.
+ *
+ * This is auto-included by type_array.h and should not need to be explicitly included.
+ */
+#ifndef _F_iki_data_h
+#define _F_iki_data_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Delete the IKI data.
+ *
+ * @param data
+ * The IKI data to delete.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_array_lengths_resize().
+ * Errors (with error bit) from: f_string_ranges_resize().
+ *
+ * @see f_array_lengths_resize()
+ * @see f_string_ranges_resize()
+ */
+#ifndef _di_f_iki_data_delete_
+ extern f_status_t f_iki_data_delete(f_iki_data_t *data);
+#endif // _di_f_iki_data_delete_
+
+/**
+ * Destroy the IKI data.
+ *
+ * @param data
+ * The IKI data to destroy.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_array_lengths_adjust().
+ * Errors (with error bit) from: f_string_ranges_adjust().
+ *
+ * @see f_array_lengths_adjust()
+ * @see f_string_ranges_adjust()
+ */
+#ifndef _di_f_iki_data_destroy_
+ extern f_status_t f_iki_data_destroy(f_iki_data_t *data);
+#endif // _di_f_iki_data_destroy_
+
+/**
+ * Resize the iki_datas array.
+ *
+ * @param length
+ * The new size to use.
+ * @param iki_datas
+ * The iki_datas 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_iki_datas_adjust_
+ extern f_status_t f_iki_datas_adjust(const f_array_length_t length, f_iki_datas_t *datas);
+#endif // _di_f_iki_datas_adjust_
+
+/**
+ * Append the single source iki_data onto the destination.
+ *
+ * @param source
+ * The source iki_data to append.
+ * @param destination
+ * The destination iki_datas 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_iki_datas_append_
+ extern f_status_t f_iki_datas_append(const f_iki_data_t source, f_iki_datas_t *destination);
+#endif // _di_f_iki_datas_append_
+
+/**
+ * Append the source iki_datas onto the destination.
+ *
+ * @param source
+ * The source iki_datas to append.
+ * @param destination
+ * The destination iki_datas 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_iki_datas_append_all_
+ extern f_status_t f_iki_datas_append_all(const f_iki_datas_t source, f_iki_datas_t *destination);
+#endif // _di_f_iki_datas_append_all_
+
+/**
+ * Resize the iki_datas 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 les than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decimate the size by.
+ * @param iki_datas
+ * The iki_datas 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_adjust().
+ */
+#ifndef _di_f_iki_datas_decimate_by_
+ extern f_status_t f_iki_datas_decimate_by(const f_array_length_t amount, f_iki_datas_t *datas);
+#endif // _di_f_iki_datas_decimate_by_
+
+/**
+ * Resize the iki_datas 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 les than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decrease the size by.
+ * @param iki_datas
+ * The iki_datas 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_iki_datas_decrease_by_
+ extern f_status_t f_iki_datas_decrease_by(const f_array_length_t amount, f_iki_datas_t *datas);
+#endif // _di_f_iki_datas_decrease_by_
+
+/**
+ * Increase the size of the iki_datas array, but only if necesary.
+ *
+ * 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 iki_datas
+ * The iki_datas 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_iki_datas_increase_
+ extern f_status_t f_iki_datas_increase(const f_array_length_t step, f_iki_datas_t *datas);
+#endif // _di_f_iki_datas_increase_
+
+/**
+ * Resize the iki_datas 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 iki_datas
+ * The iki_datas 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_iki_datas_increase_by_
+ extern f_status_t f_iki_datas_increase_by(const f_array_length_t amount, f_iki_datas_t *datas);
+#endif // _di_f_iki_datas_increase_by_
+
+/**
+ * Resize the iki_datas array.
+ *
+ * @param length
+ * The new size to use.
+ * @param iki_datas
+ * The iki_datas 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_iki_datas_resize_
+ extern f_status_t f_iki_datas_resize(const f_array_length_t length, f_iki_datas_t *datas);
+#endif // _di_f_iki_datas_resize_
+
+/**
+ * Resize the iki_datass array.
+ *
+ * @param length
+ * The new size to use.
+ * @param iki_datass
+ * The iki_datass 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().
+ * Errors (with error bit) from: f_memory_destroy().
+ */
+#ifndef _di_f_iki_datass_adjust_
+ extern f_status_t f_iki_datass_adjust(const f_array_length_t length, f_iki_datass_t *datass);
+#endif // _di_f_iki_datass_adjust_
+
+/**
+ * Append the single source iki_datas onto the destination.
+ *
+ * @param source
+ * The source iki_datas to append.
+ * @param destination
+ * The destination ranges 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_iki_datass_append_
+ extern f_status_t f_iki_datass_append(const f_iki_datas_t source, f_iki_datass_t *destination);
+#endif // _di_f_iki_datass_append_
+
+/**
+ * Append the source iki_datass onto the destination.
+ *
+ * @param source
+ * The source iki_datass to append.
+ * @param destination
+ * The destination ranges 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_iki_datass_append_all_
+ extern f_status_t f_iki_datass_append_all(const f_iki_datass_t source, f_iki_datass_t *destination);
+#endif // _di_f_iki_datass_append_all_
+
+/**
+ * Resize the iki_datass 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 iki_datass
+ * The iki_datass 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_adjust().
+ * Errors (with error bit) from: f_memory_destroy().
+ */
+#ifndef _di_f_iki_datass_decimate_by_
+ extern f_status_t f_iki_datass_decimate_by(const f_array_length_t amount, f_iki_datass_t *datass);
+#endif // _di_f_iki_datass_decimate_by_
+
+/**
+ * Resize the iki_datass 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 iki_datass
+ * The iki_datass 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_delete().
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_iki_datass_decrease_by_
+ extern f_status_t f_iki_datass_decrease_by(const f_array_length_t amount, f_iki_datass_t *datass);
+#endif // _di_f_iki_datass_decrease_by_
+
+/**
+ * Increase the size of the iki_datass 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 iki_datass
+ * The iki_datass 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_iki_datass_increase_
+ extern f_status_t f_iki_datass_increase(const f_array_length_t step, f_iki_datass_t *datass);
+#endif // _di_f_iki_datass_increase_
+
+/**
+ * Resize the iki_datass 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 iki_datass
+ * The iki_datass 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_iki_datass_increase_by_
+ extern f_status_t f_iki_datass_increase_by(const f_array_length_t amount, f_iki_datass_t *datass);
+#endif // _di_f_iki_datass_increase_by_
+
+/**
+ * Resize the iki_datass array.
+ *
+ * @param length
+ * The new size to use.
+ * @param iki_datass
+ * The iki_datass 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_delete().
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_iki_datass_resize_
+ extern f_status_t f_iki_datass_resize(const f_array_length_t length, f_iki_datass_t *datass);
+#endif // _di_f_iki_datass_resize_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _F_iki_data_h
--- /dev/null
+#include "../iki.h"
+#include "private-data.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_iki_datas_adjust_) || !defined(_di_f_iki_datas_decimate_by_)
+ f_status_t private_f_iki_datas_adjust(const f_array_length_t length, f_iki_datas_t *datas) {
+
+ if (datas->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 < datas->size; ++i) {
+
+ status = f_string_ranges_adjust(0, &datas->array[i].content);
+ if (F_status_is_error(status)) return status;
+
+ status = f_array_lengths_adjust(0, &datas->array[i].delimits);
+ if (F_status_is_error(status)) return status;
+
+ status = f_string_ranges_adjust(0, &datas->array[i].variable);
+ if (F_status_is_error(status)) return status;
+
+ status = f_string_ranges_adjust(0, &datas->array[i].vocabulary);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_adjust(datas->size, length, sizeof(f_iki_data_t), (void **) & datas->array);
+ if (F_status_is_error(status)) return status;
+
+ datas->size = length;
+
+ if (datas->used > datas->size) {
+ datas->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_iki_datas_adjust_) || !defined(_di_f_iki_datas_decimate_by_)
+
+#if !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datass_append_)
+ extern f_status_t private_f_iki_datas_append(const f_iki_data_t source, f_iki_datas_t *destination) {
+
+ f_status_t status = F_none;
+
+ if (destination->used + 1 > destination->size) {
+ status = private_f_iki_datas_resize(destination->used + F_iki_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used].content.used = 0;
+ destination->array[destination->used].delimits.used = 0;
+ destination->array[destination->used].variable.used = 0;
+ destination->array[destination->used].vocabulary.used = 0;
+
+ if (source.content.used) {
+ status = f_string_ranges_append_all(source.content, &destination->array[destination->used].content);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.delimits.used) {
+ status = f_array_lengths_append_all(source.delimits, &destination->array[destination->used].delimits);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.variable.used) {
+ status = f_string_ranges_append_all(source.variable, &destination->array[destination->used].variable);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.vocabulary.used) {
+ status = f_string_ranges_append_all(source.vocabulary, &destination->array[destination->used].vocabulary);
+ if (F_status_is_error(status)) return status;
+ }
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datass_append_)
+
+#if !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datas_append_all_) || !defined(_di_f_iki_datass_append_all_)
+ extern f_status_t private_f_iki_datas_append_all(const f_iki_datas_t source, f_iki_datas_t *destination) {
+
+ f_status_t status = F_none;
+
+ if (destination->used + source.used > destination->size) {
+ status = private_f_iki_datas_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].content.used = 0;
+ destination->array[destination->used].delimits.used = 0;
+ destination->array[destination->used].variable.used = 0;
+ destination->array[destination->used].vocabulary.used = 0;
+
+ if (source.array[i].content.used) {
+ status = f_string_ranges_append_all(source.array[i].content, &destination->array[destination->used].content);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.array[i].delimits.used) {
+ status = f_array_lengths_append_all(source.array[i].delimits, &destination->array[destination->used].delimits);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.array[i].variable.used) {
+ status = f_string_ranges_append_all(source.array[i].variable, &destination->array[destination->used].variable);
+ if (F_status_is_error(status)) return status;
+ }
+
+ if (source.array[i].vocabulary.used) {
+ status = f_string_ranges_append_all(source.array[i].vocabulary, &destination->array[destination->used].vocabulary);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+
+ return F_none;
+ }
+#endif // !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datas_append_all_) || !defined(_di_f_iki_datass_append_all_)
+
+#if !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datas_decrease_by_) || !defined(_di_f_iki_datas_increase_) || !defined(_di_f_iki_datas_increase_by_) || !defined(_di_f_iki_datas_resize_)
+ f_status_t private_f_iki_datas_resize(const f_array_length_t length, f_iki_datas_t *datas) {
+
+ if (datas->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 < datas->size; ++i) {
+
+ status = f_string_ranges_resize(0, &datas->array[i].content);
+ if (F_status_is_error(status)) return status;
+
+ status = f_array_lengths_resize(0, &datas->array[i].delimits);
+ if (F_status_is_error(status)) return status;
+
+ status = f_string_ranges_resize(0, &datas->array[i].variable);
+ if (F_status_is_error(status)) return status;
+
+ status = f_string_ranges_resize(0, &datas->array[i].vocabulary);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_resize(datas->size, length, sizeof(f_iki_data_t), (void **) & datas->array);
+ if (F_status_is_error(status)) return status;
+
+ datas->size = length;
+
+ if (datas->used > datas->size) {
+ datas->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datas_decrease_by_) || !defined(_di_f_iki_datas_increase_) || !defined(_di_f_iki_datas_increase_by_) || !defined(_di_f_iki_datas_resize_)
+
+#if !defined(_di_f_iki_datass_adjust_) || !defined(_di_f_iki_datass_decimate_by_)
+ f_status_t private_f_iki_datass_adjust(const f_array_length_t length, f_iki_datass_t *datass) {
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < datass->size; ++i) {
+
+ status = f_memory_destroy(datass->array[i].size, sizeof(f_iki_datas_t), (void **) & datass->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ datass->array[i].size = 0;
+ datass->array[i].used = 0;
+ } // for
+
+ status = f_memory_adjust(datass->size, length, sizeof(f_iki_datas_t), (void **) & datass->array);
+ if (F_status_is_error(status)) return status;
+
+ datass->size = length;
+
+ if (datass->used > datass->size) {
+ datass->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_iki_datass_adjust_) || !defined(_di_f_iki_datass_decimate_by_)
+
+#if !defined(_di_f_iki_datass_decrease_by_) || !defined(_di_f_iki_datass_increase_) || !defined(_di_f_iki_datass_increase_by_) || !defined(_di_f_iki_datass_resize_)
+ f_status_t private_f_iki_datass_resize(const f_array_length_t length, f_iki_datass_t *datass) {
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < datass->size; ++i) {
+
+ status = f_memory_delete(datass->array[i].size, sizeof(f_iki_datas_t), (void **) & datass->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ datass->array[i].size = 0;
+ datass->array[i].used = 0;
+ } // for
+
+ status = f_memory_resize(datass->size, length, sizeof(f_iki_datas_t), (void **) & datass->array);
+ if (F_status_is_error(status)) return status;
+
+ datass->size = length;
+
+ if (datass->used > datass->size) {
+ datass->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_iki_datass_decrease_by_) || !defined(_di_f_iki_datass_increase_) || !defined(_di_f_iki_datass_increase_by_) || !defined(_di_f_iki_datass_resize_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * 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_iki_data_h
+#define _PRIVATE_F_iki_data_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for resizing the iki_datas array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to adjust to.
+ * @param iki_datas
+ * The iki_datas array to adjust.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_iki_datas_adjust()
+ * @see f_iki_datas_decimate_by()
+ */
+#if !defined(_di_f_iki_datas_adjust_) || !defined(_di_f_iki_datas_decimate_by_)
+ extern f_status_t private_f_iki_datas_adjust(const f_array_length_t length, f_iki_datas_t *datas) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_iki_datas_adjust_) || !defined(_di_f_iki_datas_decimate_by_)
+
+/**
+ * Private implementation for appending the iki_data array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source iki_data to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_iki_datas_append()
+ * @see f_iki_datass_append()
+ */
+#if !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datass_append_)
+ extern f_status_t private_f_iki_datas_append(const f_iki_data_t source, f_iki_datas_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datass_append_)
+
+/**
+ * Private implementation for appending the iki_data array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source iki_datas to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_iki_datas_append_all()
+ * @see f_iki_datass_append()
+ * @see f_iki_datass_append_all()
+ */
+#if !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datas_append_all_) || !defined(_di_f_iki_datass_append_all_)
+ extern f_status_t private_f_iki_datas_append_all(const f_iki_datas_t source, f_iki_datas_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datas_append_all_) || !defined(_di_f_iki_datass_append_all_)
+
+/**
+ * Private implementation for resizing the iki_datas array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to adjust to.
+ * @param iki_datas
+ * The iki_datas array to adjust.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_iki_datas_resize()
+ * @see f_iki_datas_append()
+ * @see f_iki_datas_decimate_by()
+ * @see f_iki_datass_append()
+ */
+#if !defined(_di_f_iki_datas_resize_) || !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datas_decimate_by_) || !defined(_di_f_iki_datass_append_)
+ extern f_status_t private_f_iki_datas_resize(const f_array_length_t length, f_iki_datas_t *datas) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_iki_datas_resize_) || !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datas_decimate_by_) || !defined(_di_f_iki_datass_append_)
+
+/**
+ * Private implementation for resizing the iki_datass array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to adjust to.
+ * @param iki_datass
+ * The iki_datass array to adjust.
+ *
+ * @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 new length is larger than max array length.
+ * F_memory_not (with error bit) on out of memory.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_destroy().
+ *
+ * @see f_iki_datass_adjust()
+ * @see f_iki_datass_decimate_by()
+ */
+#if !defined(_di_f_iki_datass_adjust_) || !defined(_di_f_iki_datass_decimate_by_)
+ extern f_status_t private_f_iki_datass_adjust(const f_array_length_t length, f_iki_datass_t *datass) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_iki_datass_adjust_) || !defined(_di_f_iki_datass_decimate_by_)
+
+/**
+ * Private implementation for resizing the iki_datass array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to resize to.
+ * @param iki_datass
+ * The iki_datass 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 new length is larger than max array length.
+ * F_memory_not (with error bit) on out of memory.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_delete().
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_iki_datass_decrease_by()
+ * @see f_iki_datass_increase()
+ * @see f_iki_datass_increase_by()
+ * @see f_iki_datass_resize()
+ */
+#if !defined(_di_f_iki_datass_decrease_by_) || !defined(_di_f_iki_datass_increase_) || !defined(_di_f_iki_datass_increase_by_) || !defined(_di_f_iki_datass_resize_)
+ extern f_status_t private_f_iki_datass_resize(const f_array_length_t length, f_iki_datass_t *datass) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_iki_datass_decrease_by_) || !defined(_di_f_iki_datass_increase_) || !defined(_di_f_iki_datass_increase_by_) || !defined(_di_f_iki_datass_resize_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_iki_data_h
extern "C" {
#endif
-#if !defined(_di_f_iki_datas_adjust_) || !defined(_di_f_iki_datas_decimate_by_)
- f_status_t private_f_iki_datas_adjust(const f_array_length_t length, f_iki_datas_t *datas) {
-
- if (datas->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 < datas->size; ++i) {
-
- status = f_string_ranges_adjust(0, &datas->array[i].content);
- if (F_status_is_error(status)) return status;
-
- status = f_array_lengths_adjust(0, &datas->array[i].delimits);
- if (F_status_is_error(status)) return status;
-
- status = f_string_ranges_adjust(0, &datas->array[i].variable);
- if (F_status_is_error(status)) return status;
-
- status = f_string_ranges_adjust(0, &datas->array[i].vocabulary);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(datas->size, length, sizeof(f_iki_data_t), (void **) & datas->array);
-
- if (F_status_is_error_not(status)) {
- datas->size = length;
-
- if (datas->used > datas->size) {
- datas->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_iki_datas_adjust_) || !defined(_di_f_iki_datas_decimate_by_)
-
-#if !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datas_decrease_by_) || !defined(_di_f_iki_datas_increase_) || !defined(_di_f_iki_datas_increase_by_) || !defined(_di_f_iki_datas_resize_)
- f_status_t private_f_iki_datas_resize(const f_array_length_t length, f_iki_datas_t *datas) {
-
- if (datas->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 < datas->size; ++i) {
-
- status = f_string_ranges_resize(0, &datas->array[i].content);
- if (F_status_is_error(status)) return status;
-
- status = f_array_lengths_resize(0, &datas->array[i].delimits);
- if (F_status_is_error(status)) return status;
-
- status = f_string_ranges_resize(0, &datas->array[i].variable);
- if (F_status_is_error(status)) return status;
-
- status = f_string_ranges_resize(0, &datas->array[i].vocabulary);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(datas->size, length, sizeof(f_iki_data_t), (void **) & datas->array);
-
- if (F_status_is_error_not(status)) {
- datas->size = length;
-
- if (datas->used > datas->size) {
- datas->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datas_decrease_by_) || !defined(_di_f_iki_datas_increase_) || !defined(_di_f_iki_datas_increase_by_) || !defined(_di_f_iki_datas_resize_)
-
#if !defined(_di_f_iki_content_is_) || !defined(_di_f_iki_content_partial_is_)
f_status_t private_f_iki_content_partial_is(const f_string_t buffer, const f_array_length_t length, const f_char_t quote) {
#endif
/**
+ * Private implementation of f_iki_content_partial_is().
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param buffer
+ * The string to validate as an content name.
+ * @param length
+ * The length of the string to validate.
+ * @param range
+ * The range within the buffer that represents the content name.
+ * @param quote
+ * The quote character in use.
+ * This must be either a single (') or double (") quote.
+ *
+ * @return
+ * F_true on success and string is a valid content name.
+ * F_false on success and string is not a valid content name.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see f_iki_content_is()
+ * @see f_iki_content_partial_is()
+ */
+#if !defined(_di_f_iki_content_is_) || !defined(_di_f_iki_content_partial_is_)
+ extern f_status_t private_f_iki_content_partial_is(const f_string_t buffer, const f_array_length_t length, const f_char_t quote) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_iki_content_is_) || !defined(_di_f_iki_content_partial_is_)
+
+/**
* Private implementation for resizing the iki_datas array.
*
* Intended to be shared to each of the different implementation variations.
#endif // !defined(_di_f_iki_datas_adjust_) || !defined(_di_f_iki_datas_decimate_by_)
/**
+ * Private implementation for appending the iki_data array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source iki_datas to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_iki_datas_append_all()
+ * @see f_iki_datass_append()
+ * @see f_iki_datass_append_all()
+ */
+#if !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datas_append_all_) || !defined(_di_f_iki_datass_append_all_)
+ extern f_status_t private_f_iki_datas_append_all(const f_iki_datas_t source, f_iki_datas_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datas_append_all_) || !defined(_di_f_iki_datass_append_all_)
+
+/**
* Private implementation for resizing the iki_datas array.
*
* Intended to be shared to each of the different implementation variations.
#endif // !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datas_decrease_by_) || !defined(_di_f_iki_datas_increase_) || !defined(_di_f_iki_datas_increase_by_) || !defined(_di_f_iki_datas_resize_)
/**
- * Private implementation of f_iki_content_partial_is().
+ * Private implementation for resizing the iki_datass array.
*
* Intended to be shared to each of the different implementation variations.
*
- * @param buffer
- * The string to validate as an content name.
* @param length
- * The length of the string to validate.
- * @param range
- * The range within the buffer that represents the content name.
- * @param quote
- * The quote character in use.
- * This must be either a single (') or double (") quote.
+ * The length to adjust to.
+ * @param iki_datass
+ * The iki_datass array to adjust.
*
* @return
- * F_true on success and string is a valid content name.
- * F_false on success and string is not a valid content name.
+ * 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 new length is larger than max array length.
+ * F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
- * @see f_iki_content_is()
- * @see f_iki_content_partial_is()
+ * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_destroy().
+ *
+ * @see f_iki_datass_adjust()
+ * @see f_iki_datass_decimate_by()
*/
-#if !defined(_di_f_iki_content_is_) || !defined(_di_f_iki_content_partial_is_)
- extern f_status_t private_f_iki_content_partial_is(const f_string_t buffer, const f_array_length_t length, const f_char_t quote) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_iki_content_is_) || !defined(_di_f_iki_content_partial_is_)
+#if !defined(_di_f_iki_datass_adjust_) || !defined(_di_f_iki_datass_decimate_by_)
+ extern f_status_t private_f_iki_datass_adjust(const f_array_length_t length, f_iki_datass_t *datass) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_iki_datass_adjust_) || !defined(_di_f_iki_datass_decimate_by_)
+
+/**
+ * Private implementation for resizing the iki_datass array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to resize to.
+ * @param iki_datass
+ * The iki_datass 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 new length is larger than max array length.
+ * F_memory_not (with error bit) on out of memory.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_delete().
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_iki_datass_decrease_by()
+ * @see f_iki_datass_increase()
+ * @see f_iki_datass_increase_by()
+ * @see f_iki_datass_resize()
+ */
+#if !defined(_di_f_iki_datass_decrease_by_) || !defined(_di_f_iki_datass_increase_) || !defined(_di_f_iki_datass_increase_by_) || !defined(_di_f_iki_datass_resize_)
+ extern f_status_t private_f_iki_datass_resize(const f_array_length_t length, f_iki_datass_t *datass) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_iki_datass_decrease_by_) || !defined(_di_f_iki_datass_increase_) || !defined(_di_f_iki_datass_increase_by_) || !defined(_di_f_iki_datass_resize_)
/**
* Private implementation of f_iki_object_partial_is().
build_objects_program
build_objects_program_shared
build_objects_program_static
-build_sources_library iki.c private-iki.c iki/common.c
+build_sources_library iki.c private-iki.c iki/common.c iki/private-data.c iki/data.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 iki.h iki/common.h
+build_sources_headers iki.h iki/common.h iki/data.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
build_libraries-individual -lf_memory -lf_string -lf_type_array -lf_utf -lf_iki
build_libraries-level -lfll_0
build_libraries-monolithic -lfll
-build_sources_program test-iki-content_is.c test-iki-content_partial_is.c test-iki-object_is.c test-iki-object_partial_is.c test-iki-read.c test-iki.c
+build_sources_program test-iki-content_is.c test-iki-content_partial_is.c test-iki-object_is.c test-iki-object_partial_is.c test-iki-read.c
+build_sources_program test-iki-datas_adjust.c test-iki-datas_append.c test-iki-datas_append_all.c test-iki-datas_decimate_by.c test-iki-datas_decrease_by.c test-iki-datas_increase.c test-iki-datas_increase_by.c test-iki-datas_resize.c test-iki-datass_adjust.c test-iki-datass_append.c test-iki-datass_append_all.c test-iki-datass_decimate_by.c test-iki-datass_decrease_by.c test-iki-datass_increase.c test-iki-datass_increase_by.c test-iki-datass_resize.c
+build_sources_program test-iki.c
build_script no
build_shared yes
build_static no
};
const f_string_range_t ranges[] = {
- macro_f_string_range_t_initialize2(4, 10),
- macro_f_string_range_t_initialize2(4, 9),
- macro_f_string_range_t_initialize2(4, 9),
- macro_f_string_range_t_initialize2(4, 10),
- macro_f_string_range_t_initialize2(4, 9),
- macro_f_string_range_t_initialize2(4, 5),
- macro_f_string_range_t_initialize2(4, 9),
- macro_f_string_range_t_initialize2(4, 9),
- macro_f_string_range_t_initialize2(4, 10),
- macro_f_string_range_t_initialize2(4, 9),
- macro_f_string_range_t_initialize2(4, 5),
+ macro_f_string_range_t_initialize(4, 10),
+ macro_f_string_range_t_initialize(4, 9),
+ macro_f_string_range_t_initialize(4, 9),
+ macro_f_string_range_t_initialize(4, 10),
+ macro_f_string_range_t_initialize(4, 9),
+ macro_f_string_range_t_initialize(4, 5),
+ macro_f_string_range_t_initialize(4, 9),
+ macro_f_string_range_t_initialize(4, 9),
+ macro_f_string_range_t_initialize(4, 10),
+ macro_f_string_range_t_initialize(4, 9),
+ macro_f_string_range_t_initialize(4, 5),
};
const f_string_static_t quotes[] = {
void test__f_iki_content_partial_is__returns_data_not_eos(void **state) {
{
- const f_string_range_t range = macro_f_string_range_t_initialize2(f_string_ascii_a_s.used, f_string_ascii_a_s.used);
+ const f_string_range_t range = macro_f_string_range_t_initialize(f_string_ascii_a_s.used, f_string_ascii_a_s.used);
const f_status_t status = f_iki_content_partial_is(f_string_ascii_a_s, range, f_string_ascii_quote_single_s);
};
const f_string_range_t ranges[] = {
- macro_f_string_range_t_initialize2(4, 8),
- macro_f_string_range_t_initialize2(4, 13),
- macro_f_string_range_t_initialize2(4, 12),
- macro_f_string_range_t_initialize2(4, 13),
- macro_f_string_range_t_initialize2(4, 14),
- macro_f_string_range_t_initialize2(4, 12),
- macro_f_string_range_t_initialize2(4, 13),
- macro_f_string_range_t_initialize2(4, 14),
+ macro_f_string_range_t_initialize(4, 8),
+ macro_f_string_range_t_initialize(4, 13),
+ macro_f_string_range_t_initialize(4, 12),
+ macro_f_string_range_t_initialize(4, 13),
+ macro_f_string_range_t_initialize(4, 14),
+ macro_f_string_range_t_initialize(4, 12),
+ macro_f_string_range_t_initialize(4, 13),
+ macro_f_string_range_t_initialize(4, 14),
};
const f_string_static_t quotes[] = {
--- /dev/null
+#include "test-iki.h"
+#include "test-iki-datas_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_iki_datas_adjust__works(void **state) {
+
+ const int length = 5;
+ f_iki_datas_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datas_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_iki_datas_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_iki_datas_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datas_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_iki_datas_adjust_h
+#define _TEST__F_iki_datas_adjust_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_iki_datas_adjust()
+ */
+extern void test__f_iki_datas_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_iki_datas_adjust()
+ */
+extern void test__f_iki_datas_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_iki_datas_adjust_h
--- /dev/null
+#include "test-iki.h"
+#include "test-iki-datas_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_iki_datas_append__works(void **state) {
+
+ const f_array_length_t length = 5;
+ f_iki_data_t source = f_iki_data_t_initialize;
+ f_iki_datas_t destination = f_iki_datas_t_initialize;
+
+ {
+ f_array_length_t i = 1;
+
+ f_status_t status = f_string_ranges_resize(length, &source.content);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.content.size, length);
+
+ status = f_array_lengths_resize(length, &source.delimits);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.delimits.size, length);
+
+ status = f_string_ranges_resize(length, &source.variable);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.variable.size, length);
+
+ status = f_string_ranges_resize(length, &source.vocabulary);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.vocabulary.size, length);
+
+ for (; source.content.used < length; ++i) {
+
+ source.content.array[source.content.used].start = i - 1;
+ source.content.array[source.content.used++].stop = i;
+ } // for
+
+ for (; source.delimits.used < length; ++i) {
+ source.delimits.array[source.delimits.used++] = i;
+ } // for
+
+ for (; source.variable.used < length; ++i) {
+
+ source.variable.array[source.variable.used].start = i - 1;
+ source.variable.array[source.variable.used++].stop = i;
+ } // for
+
+ for (; source.vocabulary.used < length; ++i) {
+
+ source.vocabulary.array[source.vocabulary.used].start = i - 1;
+ source.vocabulary.array[source.vocabulary.used++].stop = i;
+ } // for
+ }
+
+ {
+ const f_status_t status = f_iki_datas_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].content.used, source.content.used);
+ assert_int_equal(destination.array[0].delimits.used, source.delimits.used);
+ assert_int_equal(destination.array[0].variable.used, source.variable.used);
+ assert_int_equal(destination.array[0].vocabulary.used, source.vocabulary.used);
+
+ for (f_array_length_t i = 0; i < length; ++i) {
+
+ assert_int_equal(destination.array[0].content.array[i].start, source.content.array[i].start);
+ assert_int_equal(destination.array[0].content.array[i].stop, source.content.array[i].stop);
+
+ assert_int_equal(destination.array[0].delimits.array[i], source.delimits.array[i]);
+
+ assert_int_equal(destination.array[0].variable.array[i].start, source.variable.array[i].start);
+ assert_int_equal(destination.array[0].variable.array[i].stop, source.variable.array[i].stop);
+
+ assert_int_equal(destination.array[0].vocabulary.array[i].start, source.vocabulary.array[i].start);
+ assert_int_equal(destination.array[0].vocabulary.array[i].stop, source.vocabulary.array[i].stop);
+ } // for
+ }
+
+ free((void *) source.content.array);
+ free((void *) source.delimits.array);
+ free((void *) source.variable.array);
+ free((void *) source.vocabulary.array);
+
+ free((void *) destination.array[0].content.array);
+ free((void *) destination.array[0].delimits.array);
+ free((void *) destination.array[0].variable.array);
+ free((void *) destination.array[0].vocabulary.array);
+
+ free((void *) destination.array);
+}
+
+void test__f_iki_datas_append__parameter_checking(void **state) {
+
+ const f_iki_data_t data = f_iki_data_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datas_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_iki_datas_append_h
+#define _TEST__F_iki_datas_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_iki_datas_append()
+ */
+extern void test__f_iki_datas_append__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_iki_datas_append()
+ */
+extern void test__f_iki_datas_append__parameter_checking(void **state);
+
+#endif // _TEST__F_iki_datas_append_h
--- /dev/null
+#include "test-iki.h"
+#include "test-iki-datas_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_iki_datas_append_all__works(void **state) {
+
+ const int length = 5;
+ f_iki_datas_t source = f_iki_datas_t_initialize;
+ f_iki_datas_t destination = f_iki_datas_t_initialize;
+
+ {
+ f_status_t status = f_iki_datas_resize(2, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.size, 2);
+
+ f_array_length_t i = 1;
+ f_array_length_t j = 0;
+
+ for (; j < 2; ++j) {
+
+ status = f_string_ranges_resize(length, &source.array[j].content);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[j].content.size, length);
+
+ status = f_array_lengths_resize(length, &source.array[j].delimits);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[j].delimits.size, length);
+
+ status = f_string_ranges_resize(length, &source.array[j].variable);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[j].variable.size, length);
+
+ status = f_string_ranges_resize(length, &source.array[j].vocabulary);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[j].vocabulary.size, length);
+
+ for (; source.array[j].content.used < length; ++i) {
+
+ source.array[j].content.array[source.array[j].content.used].start = i - 1;
+ source.array[j].content.array[source.array[j].content.used++].stop = i;
+ } // for
+
+ for (; source.array[j].delimits.used < length; ++i) {
+
+ source.array[j].delimits.array[source.array[j].delimits.used++] = i;
+ } // for
+
+ for (; source.array[j].variable.used < length; ++i) {
+
+ source.array[j].variable.array[source.array[j].variable.used].start = i - 1;
+ source.array[j].variable.array[source.array[j].variable.used++].stop = i;
+ } // for
+
+ for (; source.array[j].vocabulary.used < length; ++i) {
+
+ source.array[j].vocabulary.array[source.array[j].vocabulary.used].start = i - 1;
+ source.array[j].vocabulary.array[source.array[j].vocabulary.used++].stop = i;
+ } // for
+ } // for
+
+ source.used = 2;
+ }
+
+ {
+ const f_status_t status = f_iki_datas_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 j = 0; j < 2; ++j) {
+
+ assert_int_equal(destination.array[j].content.used, source.array[j].content.used);
+ assert_int_equal(destination.array[j].delimits.used, source.array[j].delimits.used);
+ assert_int_equal(destination.array[j].variable.used, source.array[j].variable.used);
+ assert_int_equal(destination.array[j].vocabulary.used, source.array[j].vocabulary.used);
+
+ for (f_array_length_t i = 0; i < length; ++i) {
+
+ assert_int_equal(destination.array[j].content.array[i].start, source.array[j].content.array[i].start);
+ assert_int_equal(destination.array[j].content.array[i].stop, source.array[j].content.array[i].stop);
+
+ assert_int_equal(destination.array[j].delimits.array[i], source.array[j].delimits.array[i]);
+
+ assert_int_equal(destination.array[j].variable.array[i].start, source.array[j].variable.array[i].start);
+ assert_int_equal(destination.array[j].variable.array[i].stop, source.array[j].variable.array[i].stop);
+
+ assert_int_equal(destination.array[j].vocabulary.array[i].start, source.array[j].vocabulary.array[i].start);
+ assert_int_equal(destination.array[j].vocabulary.array[i].stop, source.array[j].vocabulary.array[i].stop);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+
+ free((void *) source.array[i].content.array);
+ free((void *) source.array[i].delimits.array);
+ free((void *) source.array[i].variable.array);
+ free((void *) source.array[i].vocabulary.array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+
+ free((void *) destination.array[i].content.array);
+ free((void *) destination.array[i].delimits.array);
+ free((void *) destination.array[i].variable.array);
+ free((void *) destination.array[i].vocabulary.array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_iki_datas_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_iki_datas_t source = f_iki_datas_t_initialize;
+ f_iki_datas_t destination = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datas_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_iki_datas_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_iki_datas_append_all__parameter_checking(void **state) {
+
+ const f_iki_datas_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datas_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_iki_datas_append_all_h
+#define _TEST__F_iki_datas_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_iki_datas_append_all()
+ */
+extern void test__f_iki_datas_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_iki_datas_append_all()
+ */
+extern void test__f_iki_datas_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_iki_datas_append_all()
+ */
+extern void test__f_iki_datas_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_iki_datas_append_all_h
--- /dev/null
+#include "test-iki.h"
+#include "test-iki-datas_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_iki_datas_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_iki_datas_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datas_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_iki_datas_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_iki_datas_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_iki_datas_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datas_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_iki_datas_decimate_by_h
+#define _TEST__F_iki_datas_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_iki_datas_decimate_by()
+ */
+extern void test__f_iki_datas_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_iki_datas_decimate_by()
+ */
+extern void test__f_iki_datas_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_iki_datas_decimate_by_h
--- /dev/null
+#include "test-iki.h"
+#include "test-iki-datas_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_iki_datas_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_iki_datas_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datas_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_iki_datas_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_iki_datas_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_iki_datas_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datas_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_iki_datas_decrease_by_h
+#define _TEST__F_iki_datas_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_iki_datas_decrease_by()
+ */
+extern void test__f_iki_datas_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_iki_datas_decrease_by()
+ */
+extern void test__f_iki_datas_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_iki_datas_decrease_by_h
--- /dev/null
+#include "test-iki.h"
+#include "test-iki-datas_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_iki_datas_increase__works(void **state) {
+
+ const int length = 5;
+ f_iki_datas_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datas_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_iki_datas_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_iki_datas_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_iki_datas_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datas_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_iki_datas_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_iki_datas_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_iki_datas_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datas_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_iki_datas_increase_h
+#define _TEST__F_iki_datas_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_iki_datas_increase()
+ */
+extern void test__f_iki_datas_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_iki_datas_increase()
+ */
+extern void test__f_iki_datas_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_iki_datas_increase()
+ */
+extern void test__f_iki_datas_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_iki_datas_increase_h
--- /dev/null
+#include "test-iki.h"
+#include "test-iki-datas_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_iki_datas_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_iki_datas_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datas_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_iki_datas_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_iki_datas_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_iki_datas_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datas_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_iki_datas_increase_by_h
+#define _TEST__F_iki_datas_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_iki_datas_increase_by()
+ */
+extern void test__f_iki_datas_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_iki_datas_increase_by()
+ */
+extern void test__f_iki_datas_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_iki_datas_increase_by_h
--- /dev/null
+#include "test-iki.h"
+#include "test-iki-datas_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_iki_datas_resize__works(void **state) {
+
+ const int length = 5;
+ f_iki_datas_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datas_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_iki_datas_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_iki_datas_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datas_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_iki_datas_resize_h
+#define _TEST__F_iki_datas_resize_H
+
+/**
+ * Test that the function works.
+ *
+ * @see f_iki_datas_resize()
+ */
+extern void test__f_iki_datas_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_iki_datas_resize()
+ */
+extern void test__f_iki_datas_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_iki_datas_resize_H
--- /dev/null
+#include "test-iki.h"
+#include "test-iki-datass_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_iki_datass_adjust__works(void **state) {
+
+ const int length = 5;
+ f_iki_datass_t data = f_iki_datass_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datass_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_iki_datass_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_iki_datass_t data = f_iki_datass_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datass_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_iki_datass_adjust_h
+#define _TEST__F_iki_datass_adjust_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_iki_datass_adjust()
+ */
+extern void test__f_iki_datass_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_iki_datass_adjust()
+ */
+extern void test__f_iki_datass_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_iki_datass_adjust_h
--- /dev/null
+#include "test-iki.h"
+#include "test-iki-datass_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_iki_datass_append__works(void **state) {
+
+ const int length = 5;
+ const int length_outer = 2;
+ f_iki_datas_t source = f_iki_datas_t_initialize;
+ f_iki_datass_t destination = f_iki_datass_t_initialize;
+
+ {
+ f_status_t status = f_iki_datas_resize(length_outer, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.size, length_outer);
+
+ f_array_length_t i = 1;
+
+ for (f_array_length_t j = 0; j < length_outer; ++j) {
+
+ status = f_string_ranges_resize(length, &source.array[j].content);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[j].content.size, length);
+
+ status = f_array_lengths_resize(length, &source.array[j].delimits);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[j].delimits.size, length);
+
+ status = f_string_ranges_resize(length, &source.array[j].variable);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[j].variable.size, length);
+
+ status = f_string_ranges_resize(length, &source.array[j].vocabulary);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[j].vocabulary.size, length);
+
+ for (; source.array[j].content.used < length; ++i) {
+
+ source.array[j].content.array[source.array[j].content.used].start = i - 1;
+ source.array[j].content.array[source.array[j].content.used++].stop = i;
+ } // for
+
+ for (; source.array[j].delimits.used < length; ++i) {
+
+ source.array[j].delimits.array[source.array[j].delimits.used++] = i;
+ } // for
+
+ for (; source.array[j].variable.used < length; ++i) {
+
+ source.array[j].variable.array[source.array[j].variable.used].start = i - 1;
+ source.array[j].variable.array[source.array[j].variable.used++].stop = i;
+ } // for
+
+ for (; source.array[j].vocabulary.used < length; ++i) {
+
+ source.array[j].vocabulary.array[source.array[j].vocabulary.used].start = i - 1;
+ source.array[j].vocabulary.array[source.array[j].vocabulary.used++].stop = i;
+ } // for
+ } // for
+
+ source.used = length_outer;
+ }
+
+ {
+ const f_status_t status = f_iki_datass_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].used, source.used);
+
+ for (f_array_length_t j = 0; j < length_outer; ++j) {
+
+ assert_int_equal(destination.array[0].array[j].content.used, source.array[j].content.used);
+ assert_int_equal(destination.array[0].array[j].delimits.used, source.array[j].delimits.used);
+ assert_int_equal(destination.array[0].array[j].variable.used, source.array[j].variable.used);
+ assert_int_equal(destination.array[0].array[j].vocabulary.used, source.array[j].vocabulary.used);
+
+ for (f_array_length_t i = 0; i < length; ++i) {
+
+ assert_int_equal(destination.array[0].array[j].content.array[i].start, source.array[j].content.array[i].start);
+ assert_int_equal(destination.array[0].array[j].content.array[i].stop, source.array[j].content.array[i].stop);
+
+ assert_int_equal(destination.array[0].array[j].delimits.array[i], source.array[j].delimits.array[i]);
+
+ assert_int_equal(destination.array[0].array[j].variable.array[i].start, source.array[j].variable.array[i].start);
+ assert_int_equal(destination.array[0].array[j].variable.array[i].stop, source.array[j].variable.array[i].stop);
+
+ assert_int_equal(destination.array[0].array[j].vocabulary.array[i].start, source.array[j].vocabulary.array[i].start);
+ assert_int_equal(destination.array[0].array[j].vocabulary.array[i].stop, source.array[j].vocabulary.array[i].stop);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+
+ free((void *) source.array[i].content.array);
+ free((void *) source.array[i].delimits.array);
+ free((void *) source.array[i].variable.array);
+ free((void *) source.array[i].vocabulary.array);
+ } // for
+
+ for (f_array_length_t j = 0; j < length_outer; ++j) {
+
+ for (f_array_length_t i = 0; i < destination.array[j].used; ++i) {
+
+ free((void *) destination.array[j].array[i].content.array);
+ free((void *) destination.array[j].array[i].delimits.array);
+ free((void *) destination.array[j].array[i].variable.array);
+ free((void *) destination.array[j].array[i].vocabulary.array);
+ } // for
+
+ free((void *) destination.array[j].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_iki_datass_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_iki_datas_t source = f_iki_datass_t_initialize;
+ f_iki_datass_t destination = f_iki_datass_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datas_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_iki_datass_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_iki_datass_append__parameter_checking(void **state) {
+
+ f_iki_datas_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datass_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_iki_datass_append_h
+#define _TEST__F_iki_datass_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_iki_datass_append()
+ */
+extern void test__f_iki_datass_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_iki_datass_append()
+ */
+extern void test__f_iki_datass_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_iki_datass_append()
+ */
+extern void test__f_iki_datass_append__parameter_checking(void **state);
+
+#endif // _TEST__F_iki_datass_append_h
--- /dev/null
+#include "test-iki.h"
+#include "test-iki-datass_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_iki_datass_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ const int length_outer = 2;
+ f_iki_datass_t source = f_iki_datass_t_initialize;
+ f_iki_datass_t destination = f_iki_datass_t_initialize;
+
+ {
+ f_status_t status = f_iki_datass_resize(length_outer, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.size, length_outer);
+
+ f_array_length_t i = 1;
+ f_array_length_t j = 0;
+
+ for (; source.used < length_outer; ++source.used) {
+
+ status = f_iki_datas_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[source.used].size, length_inner);
+
+ for (j = 0; j < length_inner; ++j) {
+
+ status = f_string_ranges_resize(length, &source.array[source.used].array[j].content);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[source.used].array[j].content.size, length);
+
+ status = f_array_lengths_resize(length, &source.array[source.used].array[j].delimits);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[source.used].array[j].delimits.size, length);
+
+ status = f_string_ranges_resize(length, &source.array[source.used].array[j].variable);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[source.used].array[j].variable.size, length);
+
+ status = f_string_ranges_resize(length, &source.array[source.used].array[j].vocabulary);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.array[source.used].array[j].vocabulary.size, length);
+
+ for (; source.array[source.used].array[j].content.used < length; ++i) {
+
+ source.array[source.used].array[j].content.array[source.array[source.used].array[j].content.used].start = i - 1;
+ source.array[source.used].array[j].content.array[source.array[source.used].array[j].content.used++].stop = i;
+ } // for
+
+ for (; source.array[source.used].array[j].delimits.used < length; ++i) {
+ source.array[source.used].array[j].delimits.array[source.array[source.used].array[j].delimits.used++] = i;
+ } // for
+
+ for (; source.array[source.used].array[j].variable.used < length; ++i) {
+
+ source.array[source.used].array[j].variable.array[source.array[source.used].array[j].variable.used].start = i - 1;
+ source.array[source.used].array[j].variable.array[source.array[source.used].array[j].variable.used++].stop = i;
+ } // for
+
+ for (; source.array[source.used].array[j].vocabulary.used < length; ++i) {
+
+ source.array[source.used].array[j].vocabulary.array[source.array[source.used].array[j].vocabulary.used].start = i - 1;
+ source.array[source.used].array[j].vocabulary.array[source.array[source.used].array[j].vocabulary.used++].stop = i;
+ } // for
+ } // for
+
+ source.array[source.used].used = length_inner;
+ } // for
+ }
+
+ {
+ const f_status_t status = f_iki_datass_append_all(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+
+ for (f_array_length_t k = 0; k < length_outer; ++k) {
+
+ for (f_array_length_t j = 0; j < length_inner; ++j) {
+
+ assert_int_equal(destination.array[k].array[j].content.used, source.array[k].array[j].content.used);
+ assert_int_equal(destination.array[k].array[j].delimits.used, source.array[k].array[j].delimits.used);
+ assert_int_equal(destination.array[k].array[j].variable.used, source.array[k].array[j].variable.used);
+ assert_int_equal(destination.array[k].array[j].vocabulary.used, source.array[k].array[j].vocabulary.used);
+
+ for (f_array_length_t i = 0; i < length; ++i) {
+
+ assert_int_equal(destination.array[k].array[j].content.array[i].start, source.array[k].array[j].content.array[i].start);
+ assert_int_equal(destination.array[k].array[j].content.array[i].stop, source.array[k].array[j].content.array[i].stop);
+
+ assert_int_equal(destination.array[k].array[j].delimits.array[i], source.array[k].array[j].delimits.array[i]);
+
+ assert_int_equal(destination.array[k].array[j].variable.array[i].start, source.array[k].array[j].variable.array[i].start);
+ assert_int_equal(destination.array[k].array[j].variable.array[i].stop, source.array[k].array[j].variable.array[i].stop);
+
+ assert_int_equal(destination.array[k].array[j].vocabulary.array[i].start, source.array[k].array[j].vocabulary.array[i].start);
+ assert_int_equal(destination.array[k].array[j].vocabulary.array[i].stop, source.array[k].array[j].vocabulary.array[i].stop);
+ } // for
+ } // 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].content.array);
+ free((void *) source.array[j].array[i].delimits.array);
+ free((void *) source.array[j].array[i].variable.array);
+ free((void *) source.array[j].array[i].vocabulary.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].content.array);
+ free((void *) destination.array[j].array[i].delimits.array);
+ free((void *) destination.array[j].array[i].variable.array);
+ free((void *) destination.array[j].array[i].vocabulary.array);
+ } // for
+
+ free((void *) destination.array[j].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_iki_datass_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_iki_datass_t source = f_iki_datass_t_initialize;
+ f_iki_datass_t destination = f_iki_datass_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datass_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_iki_datass_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_iki_datass_append_all__parameter_checking(void **state) {
+
+ const f_iki_datass_t data = f_iki_datass_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datass_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_iki_datass_append_all_h
+#define _TEST__F_iki_datass_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_iki_datass_append_all()
+ */
+extern void test__f_iki_datass_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_iki_datass_append_all()
+ */
+extern void test__f_iki_datass_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_iki_datass_append_all()
+ */
+extern void test__f_iki_datass_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_iki_datass_append_all_h
--- /dev/null
+#include "test-iki.h"
+#include "test-iki-datass_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_iki_datass_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_iki_datass_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datass_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_iki_datass_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_iki_datass_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_iki_datass_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datass_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_iki_datass_decimate_by_h
+#define _TEST__F_iki_datass_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_iki_datass_decimate_by()
+ */
+extern void test__f_iki_datass_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_iki_datass_decimate_by()
+ */
+extern void test__f_iki_datass_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_iki_datass_decimate_by_h
--- /dev/null
+#include "test-iki.h"
+#include "test-iki-datass_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_iki_datass_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_iki_datass_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datass_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_iki_datass_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_iki_datass_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_iki_datass_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datass_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_iki_datass_decrease_by_h
+#define _TEST__F_iki_datass_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_iki_datass_decrease_by()
+ */
+extern void test__f_iki_datass_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_iki_datass_decrease_by()
+ */
+extern void test__f_iki_datass_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_iki_datass_decrease_by_h
--- /dev/null
+#include "test-iki.h"
+#include "test-iki-datass_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_iki_datass_increase__works(void **state) {
+
+ const int length = 5;
+ f_iki_datass_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datass_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_iki_datass_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_iki_datass_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_iki_datass_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datass_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_iki_datass_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_iki_datass_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_iki_datass_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datass_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_iki_datass_increase_h
+#define _TEST__F_iki_datass_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_iki_datass_increase()
+ */
+extern void test__f_iki_datass_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_iki_datass_increase()
+ */
+extern void test__f_iki_datass_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_iki_datass_increase()
+ */
+extern void test__f_iki_datass_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_iki_datass_increase_h
--- /dev/null
+#include "test-iki.h"
+#include "test-iki-datass_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_iki_datass_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_iki_datass_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datass_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_iki_datass_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_iki_datass_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_iki_datass_t data = f_iki_datas_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datass_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_iki_datass_increase_by_h
+#define _TEST__F_iki_datass_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_iki_datass_increase_by()
+ */
+extern void test__f_iki_datass_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_iki_datass_increase_by()
+ */
+extern void test__f_iki_datass_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_iki_datass_increase_by_h
--- /dev/null
+#include "test-iki.h"
+#include "test-iki-datass_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_iki_datass_resize__works(void **state) {
+
+ const int length = 5;
+ f_iki_datass_t data = f_iki_datass_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datass_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_iki_datass_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_iki_datass_t data = f_iki_datass_t_initialize;
+
+ {
+ const f_status_t status = f_iki_datass_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_iki_datass_resize_h
+#define _TEST__F_iki_datass_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_iki_datass_resize()
+ */
+extern void test__f_iki_datass_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_iki_datass_resize()
+ */
+extern void test__f_iki_datass_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_iki_datass_resize_h
};
const f_string_range_t ranges[] = {
- macro_f_string_range_t_initialize2(4, 9),
- macro_f_string_range_t_initialize2(4, 9),
- macro_f_string_range_t_initialize2(4, 9),
- macro_f_string_range_t_initialize2(4, 9),
- macro_f_string_range_t_initialize2(4, 9),
- macro_f_string_range_t_initialize2(4, 9),
- macro_f_string_range_t_initialize2(4, 10),
- macro_f_string_range_t_initialize2(4, 9),
- macro_f_string_range_t_initialize2(4, 10),
- macro_f_string_range_t_initialize2(4, 9),
- macro_f_string_range_t_initialize2(4, 9),
- macro_f_string_range_t_initialize2(4, 10),
- macro_f_string_range_t_initialize2(4, 9),
- macro_f_string_range_t_initialize2(4, 10),
+ macro_f_string_range_t_initialize(4, 9),
+ macro_f_string_range_t_initialize(4, 9),
+ macro_f_string_range_t_initialize(4, 9),
+ macro_f_string_range_t_initialize(4, 9),
+ macro_f_string_range_t_initialize(4, 9),
+ macro_f_string_range_t_initialize(4, 9),
+ macro_f_string_range_t_initialize(4, 10),
+ macro_f_string_range_t_initialize(4, 9),
+ macro_f_string_range_t_initialize(4, 10),
+ macro_f_string_range_t_initialize(4, 9),
+ macro_f_string_range_t_initialize(4, 9),
+ macro_f_string_range_t_initialize(4, 10),
+ macro_f_string_range_t_initialize(4, 9),
+ macro_f_string_range_t_initialize(4, 10),
};
for (uint8_t i = 0; i < 14; ++i) {
void test__f_iki_object_partial_is__returns_data_not_eos(void **state) {
{
- const f_string_range_t range = macro_f_string_range_t_initialize2(f_string_ascii_a_s.used, f_string_ascii_a_s.used);
+ const f_string_range_t range = macro_f_string_range_t_initialize(f_string_ascii_a_s.used, f_string_ascii_a_s.used);
const f_status_t status = f_iki_object_partial_is(f_string_ascii_a_s, range);
};
const f_string_range_t ranges[] = {
- macro_f_string_range_t_initialize2(4, 8),
- macro_f_string_range_t_initialize2(4, 9),
- macro_f_string_range_t_initialize2(4, 9),
- macro_f_string_range_t_initialize2(4, 10),
- macro_f_string_range_t_initialize2(4, 8),
+ macro_f_string_range_t_initialize(4, 8),
+ macro_f_string_range_t_initialize(4, 9),
+ macro_f_string_range_t_initialize(4, 9),
+ macro_f_string_range_t_initialize(4, 10),
+ macro_f_string_range_t_initialize(4, 8),
};
for (uint8_t i = 0; i < 5; ++i) {
f_string_static_t ascii_a = macro_f_string_static_t_initialize(f_string_ascii_a_s.string, f_string_ascii_a_s.size, f_string_ascii_a_s.used);
{
- f_string_range_t range = macro_f_string_range_t_initialize2(f_string_ascii_a_s.used, f_string_ascii_a_s.used);
+ f_string_range_t range = macro_f_string_range_t_initialize(f_string_ascii_a_s.used, f_string_ascii_a_s.used);
f_iki_data_t iki = f_iki_data_t_initialize;
const f_status_t status = f_iki_read(the_state, &ascii_a, &range, &iki);
const f_string_range_t variables[][22] = {
{ f_string_range_t_initialize, f_string_range_t_initialize },
{ f_string_range_t_initialize, f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(0, 8), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(4, 12), macro_f_string_range_t_initialize2(14, 33) },
- { macro_f_string_range_t_initialize2(0, 8), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(4, 12), macro_f_string_range_t_initialize2(14, 33) },
- { macro_f_string_range_t_initialize2(24, 36), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(24, 36), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(5, 22), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(5, 22), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(5, 23), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(5, 21), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(5, 22), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(5, 22), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(5, 23), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(5, 21), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(4, 42), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(4, 42), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(4, 43), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(4, 43), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(0, 66), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(0, 66), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(0, 8), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(4, 12), macro_f_string_range_t_initialize(14, 33) },
+ { macro_f_string_range_t_initialize(0, 8), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(4, 12), macro_f_string_range_t_initialize(14, 33) },
+ { macro_f_string_range_t_initialize(24, 36), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(24, 36), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(5, 22), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(5, 22), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(5, 23), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(5, 21), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(5, 22), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(5, 22), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(5, 23), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(5, 21), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(4, 42), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(4, 42), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(4, 43), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(4, 43), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(0, 66), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(0, 66), f_string_range_t_initialize },
};
const f_string_range_t vocabularys[][22] = {
{ f_string_range_t_initialize, f_string_range_t_initialize },
{ f_string_range_t_initialize, f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(0, 2), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(4, 6), macro_f_string_range_t_initialize2(14, 16) },
- { macro_f_string_range_t_initialize2(0, 2), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(4, 6), macro_f_string_range_t_initialize2(14, 16) },
- { macro_f_string_range_t_initialize2(24, 27), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(24, 27), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(5, 10), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(5, 10), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(5, 11), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(5, 9), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(5, 10), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(5, 10), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(5, 11), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(5, 9), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(4, 10), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(4, 10), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(4, 10), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(4, 10), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(0, 2), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(0, 2), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(0, 2), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(4, 6), macro_f_string_range_t_initialize(14, 16) },
+ { macro_f_string_range_t_initialize(0, 2), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(4, 6), macro_f_string_range_t_initialize(14, 16) },
+ { macro_f_string_range_t_initialize(24, 27), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(24, 27), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(5, 10), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(5, 10), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(5, 11), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(5, 9), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(5, 10), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(5, 10), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(5, 11), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(5, 9), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(4, 10), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(4, 10), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(4, 10), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(4, 10), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(0, 2), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(0, 2), f_string_range_t_initialize },
};
const f_string_range_t contents[][22] = {
{ f_string_range_t_initialize, f_string_range_t_initialize },
{ f_string_range_t_initialize, f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(5, 7), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(9, 11), macro_f_string_range_t_initialize2(19, 32) },
- { macro_f_string_range_t_initialize2(5, 7), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(9, 11), macro_f_string_range_t_initialize2(19, 32) },
- { macro_f_string_range_t_initialize2(30, 35), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(30, 35), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(13, 21), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(13, 21), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(14, 22), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(12, 20), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(13, 21), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(13, 21), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(14, 22), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(12, 20), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(13, 41), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(13, 41), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(13, 42), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(13, 42), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(5, 65), f_string_range_t_initialize },
- { macro_f_string_range_t_initialize2(5, 65), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(5, 7), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(9, 11), macro_f_string_range_t_initialize(19, 32) },
+ { macro_f_string_range_t_initialize(5, 7), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(9, 11), macro_f_string_range_t_initialize(19, 32) },
+ { macro_f_string_range_t_initialize(30, 35), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(30, 35), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(13, 21), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(13, 21), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(14, 22), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(12, 20), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(13, 21), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(13, 21), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(14, 22), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(12, 20), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(13, 41), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(13, 41), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(13, 42), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(13, 42), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(5, 65), f_string_range_t_initialize },
+ { macro_f_string_range_t_initialize(5, 65), f_string_range_t_initialize },
};
for (uint8_t i = 0; i < 22; ++i) {
- f_string_range_t range = macro_f_string_range_t_initialize(buffers[i].used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(buffers[i].used);
f_iki_data_t iki = f_iki_data_t_initialize;
const f_status_t status = f_iki_read(the_state, &buffers[i], &range, &iki);
cmocka_unit_test(test__f_iki_content_partial_is__returns_false),
cmocka_unit_test(test__f_iki_content_partial_is__returns_true),
+ cmocka_unit_test(test__f_iki_datas_adjust__works),
+ cmocka_unit_test(test__f_iki_datas_append__works),
+ cmocka_unit_test(test__f_iki_datas_append_all__works),
+ cmocka_unit_test(test__f_iki_datas_append_all__returns_data_not),
+ cmocka_unit_test(test__f_iki_datas_decimate_by__works),
+ cmocka_unit_test(test__f_iki_datas_decrease_by__works),
+ cmocka_unit_test(test__f_iki_datas_increase__works),
+ cmocka_unit_test(test__f_iki_datas_increase__returns_data_not),
+ cmocka_unit_test(test__f_iki_datas_increase_by__works),
+ cmocka_unit_test(test__f_iki_datas_resize__works),
+
+ cmocka_unit_test(test__f_iki_datass_adjust__works),
+ cmocka_unit_test(test__f_iki_datass_append__works),
+ cmocka_unit_test(test__f_iki_datass_append__returns_data_not),
+ cmocka_unit_test(test__f_iki_datass_append_all__works),
+ cmocka_unit_test(test__f_iki_datass_append_all__returns_data_not),
+ cmocka_unit_test(test__f_iki_datass_decimate_by__works),
+ cmocka_unit_test(test__f_iki_datass_decrease_by__works),
+ cmocka_unit_test(test__f_iki_datass_increase__works),
+ cmocka_unit_test(test__f_iki_datass_increase__returns_data_not),
+ cmocka_unit_test(test__f_iki_datass_increase_by__works),
+ cmocka_unit_test(test__f_iki_datass_resize__works),
+
cmocka_unit_test(test__f_iki_object_is__returns_data_not),
cmocka_unit_test(test__f_iki_object_is__returns_false),
cmocka_unit_test(test__f_iki_object_is__returns_true),
#ifndef _di_level_0_parameter_checking_
cmocka_unit_test(test__f_iki_content_is__parameter_checking),
cmocka_unit_test(test__f_iki_content_partial_is__parameter_checking),
+
+ cmocka_unit_test(test__f_iki_datas_adjust__parameter_checking),
+ cmocka_unit_test(test__f_iki_datas_append__parameter_checking),
+ cmocka_unit_test(test__f_iki_datas_append_all__parameter_checking),
+ cmocka_unit_test(test__f_iki_datas_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_iki_datas_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_iki_datas_increase__parameter_checking),
+ cmocka_unit_test(test__f_iki_datas_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_iki_datas_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_iki_datass_adjust__parameter_checking),
+ cmocka_unit_test(test__f_iki_datass_append__parameter_checking),
+ cmocka_unit_test(test__f_iki_datass_append_all__parameter_checking),
+ cmocka_unit_test(test__f_iki_datass_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_iki_datass_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_iki_datass_increase__parameter_checking),
+ cmocka_unit_test(test__f_iki_datass_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_iki_datass_resize__parameter_checking),
+
// f_iki_object_is() doesn't use parameter checking.
// f_iki_object_partial_is() doesn't use parameter checking.
+
cmocka_unit_test(test__f_iki_read__parameter_checking),
#endif // _di_level_0_parameter_checking_
};
// Test includes.
#include "test-iki-content_is.h"
#include "test-iki-content_partial_is.h"
+#include "test-iki-datas_adjust.h"
+#include "test-iki-datas_append.h"
+#include "test-iki-datas_append_all.h"
+#include "test-iki-datas_decimate_by.h"
+#include "test-iki-datas_decrease_by.h"
+#include "test-iki-datas_increase.h"
+#include "test-iki-datas_increase_by.h"
+#include "test-iki-datas_resize.h"
+#include "test-iki-datass_adjust.h"
+#include "test-iki-datass_append.h"
+#include "test-iki-datass_append_all.h"
+#include "test-iki-datass_decimate_by.h"
+#include "test-iki-datass_decrease_by.h"
+#include "test-iki-datass_increase.h"
+#include "test-iki-datass_increase_by.h"
+#include "test-iki-datass_resize.h"
#include "test-iki-object_is.h"
#include "test-iki-object_partial_is.h"
#include "test-iki-read.h"
f_status_t private_f_memory_structure_resize(const size_t length_new, const size_t type_size, void ** const structure, f_array_length_t * const used, f_array_length_t * const size) {
const f_status_t status = private_f_memory_resize(*size, length_new, type_size, structure);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- *size = length_new;
+ *size = length_new;
- if (*used > *size) {
- *used = *size;
- }
+ if (*used > *size) {
+ *used = *size;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_)
#include "string.h"
#include "private-string.h"
+#include "string/private-dynamic.h"
#ifdef __cplusplus
extern "C" {
}
#endif // !defined(_di_f_string_append_assure_nulless_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_assure_nulless_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_string_dynamic_partial_append_nulless_) || !defined(_di_f_string_dynamic_partial_mash_nulless_) || !defined(_di_f_string_mash_nulless_)
-#if !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
- f_status_t private_f_string_dynamic_adjust(const f_array_length_t length, f_string_dynamic_t * const dynamic) {
-
- f_status_t status = f_memory_adjust(dynamic->size, length, sizeof(f_char_t), (void **) & dynamic->string);
-
- if (F_status_is_error_not(status)) {
- dynamic->size = length;
-
- if (dynamic->used > dynamic->size) {
- dynamic->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
-
-#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
- f_status_t private_f_string_dynamic_increase_by(const f_array_length_t amount, f_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_string_dynamic_resize(dynamic->used + amount, dynamic);
- }
-
- return F_data_not;
- }
-#endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
-
-#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
- f_status_t private_f_string_dynamic_resize(const f_array_length_t length, f_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_not(status)) {
- dynamic->size = length;
-
- if (dynamic->used > dynamic->size) {
- dynamic->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
-
-#if !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
- f_status_t private_f_string_dynamics_adjust(const f_array_length_t length, f_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_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_string_dynamic_t), (void **) & dynamics->array);
-
- if (F_status_is_error_not(status)) {
- dynamics->size = length;
-
- if (dynamics->used > dynamics->size) {
- dynamics->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
-
-#if !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_)
- f_status_t private_f_string_dynamics_append(const f_string_dynamics_t source, f_string_dynamics_t * const destination) {
-
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_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_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_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_)
-
-#if !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_)
- f_status_t private_f_string_dynamics_resize(const f_array_length_t length, f_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_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_string_dynamic_t), (void **) & dynamics->array);
-
- if (F_status_is_error_not(status)) {
- dynamics->size = length;
-
- if (dynamics->used > dynamics->size) {
- dynamics->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_)
-
-#if !defined(_di_f_string_dynamicss_adjust_) || !defined(_di_f_string_dynamicss_append_) || !defined(_di_f_string_dynamicss_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
- f_status_t private_f_string_dynamicss_adjust(const f_array_length_t length, f_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_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_string_dynamics_t), (void **) & dynamicss->array);
-
- if (F_status_is_error_not(status)) {
- dynamicss->size = length;
-
- if (dynamicss->used > dynamicss->size) {
- dynamicss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_dynamicss_adjust_) || !defined(_di_f_string_dynamicss_append_) || !defined(_di_f_string_dynamicss_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
-
-#if !defined(_di_f_string_dynamicss_append_) || !defined(_di_f_string_map_multis_append_)
- f_status_t private_f_string_dynamicss_append(const f_string_dynamicss_t source, f_string_dynamicss_t *destination) {
-
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_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_string_dynamics_append(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
- }
- } // for
-
- return F_none;
- }
-#endif // !defined(_di_f_string_dynamicss_append_) || !defined(_di_f_string_map_multis_append_)
-
-#if !defined(_di_f_string_dynamicss_decrease_by_) || !defined(_di_f_string_dynamicss_increase_) || !defined(_di_f_string_dynamicss_increase_by_)
- f_status_t private_f_string_dynamicss_resize(const f_array_length_t length, f_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_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_string_dynamics_t), (void **) & dynamicss->array);
-
- if (F_status_is_error_not(status)) {
- dynamicss->size = length;
-
- if (dynamicss->used > dynamicss->size) {
- dynamicss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_dynamicss_decrease_by_) || !defined(_di_f_string_dynamicss_increase_) || !defined(_di_f_string_dynamicss_increase_by_)
-
-#if !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_decimate_by_)
- f_status_t private_f_string_map_multis_adjust(const f_array_length_t length, f_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_string_dynamic_adjust(0, &map_multis->array[i].name);
- if (F_status_is_error(status)) return status;
-
- status = private_f_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_string_map_multi_t), (void **) & map_multis->array);
-
- if (F_status_is_error_not(status)) {
- map_multis->size = length;
-
- if (map_multis->used > map_multis->size) {
- map_multis->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_decimate_by_)
-
-#if !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multis_append_)
- f_status_t private_f_string_map_multis_append(const f_string_map_multi_t source, f_string_map_multis_t * const destination) {
-
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_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_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_string_dynamics_append(source.value, &destination->array[destination->used].value);
- if (F_status_is_error(status)) return status;
- }
-
- ++destination->used;
-
- return F_none;
- }
-#endif // !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multis_append_)
-
-#if !defined(_di_f_string_map_multiss_append_all_) || !defined(_di_f_string_map_multis_append_all_)
- f_status_t private_f_string_map_multis_append_all(const f_string_map_multis_t source, f_string_map_multis_t * const destination) {
-
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_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_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_string_dynamics_append(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_string_map_multiss_append_all_) || !defined(_di_f_string_map_multis_append_all_)
-
-#if !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_terminate_) || !defined(_di_f_string_map_multis_terminate_after_)
- f_status_t private_f_string_map_multis_resize(const f_array_length_t length, f_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_string_dynamic_resize(0, &map_multis->array[i].name);
- if (F_status_is_error(status)) return status;
-
- status = private_f_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_string_map_multi_t), (void **) & map_multis->array);
-
- if (F_status_is_error_not(status)) {
- map_multis->size = length;
-
- if (map_multis->used > map_multis->size) {
- map_multis->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_terminate_) || !defined(_di_f_string_map_multis_terminate_after_)
-
-#if !defined(_di_f_string_map_multiss_adjust_) || !defined(_di_f_string_map_multiss_decimate_by_)
- f_status_t private_f_string_map_multiss_adjust(const f_array_length_t length, f_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_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_string_map_multis_t), (void **) & map_multiss->array);
-
- if (F_status_is_error_not(status)) {
- map_multiss->size = length;
-
- if (map_multiss->used > map_multiss->size) {
- map_multiss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_map_multiss_adjust_) || !defined(_di_f_string_map_multiss_decimate_by_)
-
-#if !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_) || !defined(_di_f_string_map_multiss_terminate_) || !defined(_di_f_string_map_multiss_terminate_after_)
- f_status_t private_f_string_map_multiss_resize(const f_array_length_t length, f_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_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_string_map_multis_t), (void **) & map_multiss->array);
-
- if (F_status_is_error_not(status)) {
- map_multiss->size = length;
-
- if (map_multiss->used > map_multiss->size) {
- map_multiss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_) || !defined(_di_f_string_map_multiss_terminate_) || !defined(_di_f_string_map_multiss_terminate_after_)
-
-#if !defined(_di_f_string_maps_adjust_) || !defined(_di_f_string_maps_decimate_by_)
- f_status_t private_f_string_maps_adjust(const f_array_length_t length, f_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_string_dynamic_adjust(0, &maps->array[i].name);
- if (F_status_is_error(status)) return status;
-
- status = private_f_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_string_map_t), (void **) & maps->array);
-
- if (F_status_is_error_not(status)) {
- maps->size = length;
-
- if (maps->used > maps->size) {
- maps->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_maps_adjust_) || !defined(_di_f_string_maps_decimate_by_)
-
-#if !defined(_di_f_string_mapss_append_) || !defined(_di_f_string_maps_append_)
- f_status_t private_f_string_maps_append(const f_string_map_t source, f_string_maps_t * const destination) {
-
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_string_maps_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_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_string_append(source.value.string, source.value.used, &destination->array[destination->used].value);
- if (F_status_is_error(status)) return status;
- }
-
- ++destination->used;
-
- return F_none;
- }
-#endif // !defined(_di_f_string_mapss_append_) || !defined(_di_f_string_maps_append_)
-
-#if !defined(_di_f_string_mapss_append_all_) || !defined(_di_f_string_maps_append_all_)
- f_status_t private_f_string_maps_append_all(const f_string_maps_t source, f_string_maps_t * const destination) {
-
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_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_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_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_string_mapss_append_all_) || !defined(_di_f_string_maps_append_all_)
-
-#if !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_terminate_) || !defined(_di_f_string_maps_terminate_after_)
- f_status_t private_f_string_maps_resize(const f_array_length_t length, f_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_string_dynamic_resize(0, &maps->array[i].name);
- if (F_status_is_error(status)) return status;
-
- status = private_f_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_string_map_t), (void **) & maps->array);
-
- if (F_status_is_error_not(status)) {
- maps->size = length;
-
- if (maps->used > maps->size) {
- maps->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_terminate_) || !defined(_di_f_string_maps_terminate_after_)
-
-#if !defined(_di_f_string_mapss_adjust_) || !defined(_di_f_string_mapss_decimate_by_)
- f_status_t private_f_string_mapss_adjust(const f_array_length_t length, f_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_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_string_maps_t), (void **) & mapss->array);
-
- if (F_status_is_error_not(status)) {
- mapss->size = length;
-
- if (mapss->used > mapss->size) {
- mapss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_mapss_adjust_) || !defined(_di_f_string_mapss_decimate_by_)
-
-#if !defined(_di_f_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_) || !defined(_di_f_string_mapss_terminate_) || !defined(_di_f_string_mapss_terminate_after_)
- f_status_t private_f_string_mapss_resize(const f_array_length_t length, f_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_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_string_maps_t), (void **) & mapss->array);
-
- if (F_status_is_error_not(status)) {
- mapss->size = length;
-
- if (mapss->used > mapss->size) {
- mapss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_) || !defined(_di_f_string_mapss_terminate_) || !defined(_di_f_string_mapss_terminate_after_)
-
#if !defined(_di_f_string_dynamic_mish_) || !defined(_di_f_string_dynamic_partial_mish_) || !defined(_di_f_string_dynamic_partial_prepend_assure_) || !defined(_di_f_string_dynamic_partial_prepend_) || !defined(_di_f_string_dynamic_prepend_assure_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_mish_) || !defined(_di_f_string_prepend_assure_) || !defined(_di_f_string_prepend_)
f_status_t private_f_string_prepend(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
}
#endif // !defined(_di_f_string_dynamic_mish_nulless_) || !defined(_di_f_string_dynamic_partial_mish_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_mish_nulless_) || !defined(_di_f_string_prepend_assure_nulless_) || !defined(_di_f_string_prepend_nulless_)
-#if !defined(_di_f_string_quantitys_adjust_) || !defined(_di_f_string_quantitys_decimate_by_)
- f_status_t private_f_string_quantitys_adjust(const f_array_length_t length, f_string_quantitys_t * const quantitys) {
-
- if (quantitys->used + length > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- const f_status_t status = f_memory_adjust(quantitys->size, length, sizeof(f_string_quantity_t), (void **) & quantitys->array);
-
- if (F_status_is_error_not(status)) {
- quantitys->size = length;
-
- if (quantitys->used > quantitys->size) {
- quantitys->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_quantitys_adjust_) || !defined(_di_f_string_quantitys_decimate_by_)
-
-#if !defined(_di_f_string_quantitys_decrease_) || !defined(_di_f_string_quantitys_decrease_by_) || !defined(_di_f_string_quantitys_increase_) || !defined(_di_f_string_quantitys_increase_by_) || !defined(_di_f_string_quantitys_terminate_) || !defined(_di_f_string_quantitys_terminate_after_)
- f_status_t private_f_string_quantitys_resize(const f_array_length_t length, f_string_quantitys_t * const quantitys) {
-
- if (quantitys->used + length > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- const f_status_t status = f_memory_resize(quantitys->size, length, sizeof(f_string_quantity_t), (void **) & quantitys->array);
-
- if (F_status_is_error_not(status)) {
- quantitys->size = length;
-
- if (quantitys->used > quantitys->size) {
- quantitys->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_quantitys_decrease_) || !defined(_di_f_string_quantitys_decrease_by_) || !defined(_di_f_string_quantitys_increase_) || !defined(_di_f_string_quantitys_increase_by_) || !defined(_di_f_string_quantitys_terminate_) || !defined(_di_f_string_quantitys_terminate_after_)
-
-#if !defined(_di_f_string_quantityss_adjust_) || !defined(_di_f_string_quantityss_decimate_by_)
- f_status_t private_f_string_quantityss_adjust(const f_array_length_t length, f_string_quantityss_t * const quantityss) {
-
- if (quantityss->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 < quantityss->size; ++i) {
-
- status = private_f_string_quantitys_adjust(0, &quantityss->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(quantityss->size, length, sizeof(f_string_quantitys_t), (void **) & quantityss->array);
-
- if (F_status_is_error_not(status)) {
- quantityss->size = length;
-
- if (quantityss->used > quantityss->size) {
- quantityss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_quantityss_adjust_) || !defined(_di_f_string_quantityss_decimate_by_)
-
-#if !defined(_di_f_string_quantityss_decrease_) || !defined(_di_f_string_quantityss_decrease_by_) || !defined(_di_f_string_quantityss_increase_) || !defined(_di_f_string_quantityss_increase_by_) || !defined(_di_f_string_quantityss_terminate_) || !defined(_di_f_string_quantityss_terminate_after_)
- f_status_t private_f_string_quantityss_resize(const f_array_length_t length, f_string_quantityss_t * const quantityss) {
-
- if (quantityss->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 < quantityss->size; ++i) {
-
- status = private_f_string_quantitys_resize(0, &quantityss->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(quantityss->size, length, sizeof(f_string_quantitys_t), (void **) & quantityss->array);
-
- if (F_status_is_error_not(status)) {
- quantityss->size = length;
-
- if (quantityss->used > quantityss->size) {
- quantityss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_quantityss_decrease_) || !defined(_di_f_string_quantityss_decrease_by_) || !defined(_di_f_string_quantityss_increase_) || !defined(_di_f_string_quantityss_increase_by_) || !defined(_di_f_string_quantityss_terminate_) || !defined(_di_f_string_quantityss_terminate_after_)
-
-#if !defined(_di_f_string_ranges_adjust_) || !defined(_di_f_string_ranges_decimate_by_)
- f_status_t private_f_string_ranges_adjust(const f_array_length_t length, f_string_ranges_t * const ranges) {
-
- if (ranges->used + length > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- const f_status_t status = f_memory_adjust(ranges->size, length, sizeof(f_string_range_t), (void **) & ranges->array);
-
- if (F_status_is_error_not(status)) {
- ranges->size = length;
-
- if (ranges->used > ranges->size) {
- ranges->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_ranges_adjust_) || !defined(_di_f_string_ranges_decimate_by_)
-
-#if !defined(_di_f_string_ranges_decrease_) || !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_terminate_) || !defined(_di_f_string_ranges_terminate_after_)
- f_status_t private_f_string_ranges_resize(const f_array_length_t length, f_string_ranges_t * const ranges) {
-
- if (ranges->used + length > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- const f_status_t status = f_memory_resize(ranges->size, length, sizeof(f_string_range_t), (void **) & ranges->array);
-
- if (F_status_is_error_not(status)) {
- ranges->size = length;
-
- if (ranges->used > ranges->size) {
- ranges->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_ranges_decrease_) || !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_terminate_) || !defined(_di_f_string_ranges_terminate_after_)
-
-#if !defined(_di_f_string_rangess_adjust_) || !defined(_di_f_string_rangess_decimate_by_)
- f_status_t private_f_string_rangess_adjust(const f_array_length_t length, f_string_rangess_t * const rangess) {
-
- if (rangess->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 < rangess->size; ++i) {
-
- status = private_f_string_ranges_adjust(0, &rangess->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(rangess->size, length, sizeof(f_string_ranges_t), (void **) & rangess->array);
-
- if (F_status_is_error_not(status)) {
- rangess->size = length;
-
- if (rangess->used > rangess->size) {
- rangess->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_rangess_adjust_) || !defined(_di_f_string_rangess_decimate_by_)
-
-#if !defined(_di_f_string_rangess_decrease_) || !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_) || !defined(_di_f_string_rangess_terminate_) || !defined(_di_f_string_rangess_terminate_after_)
- f_status_t private_f_string_rangess_resize(const f_array_length_t length, f_string_rangess_t * const rangess) {
-
- if (rangess->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 < rangess->size; ++i) {
-
- status = private_f_string_ranges_resize(0, &rangess->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(rangess->size, length, sizeof(f_string_ranges_t), (void **) & rangess->array);
-
- if (F_status_is_error_not(status)) {
- rangess->size = length;
-
- if (rangess->used > rangess->size) {
- rangess->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_rangess_decrease_) || !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_) || !defined(_di_f_string_rangess_terminate_) || !defined(_di_f_string_rangess_terminate_after_)
-
-#if !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
- f_status_t private_f_string_triples_adjust(const f_array_length_t length, f_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_string_dynamic_adjust(0, &triples->array[i].a);
- if (F_status_is_error(status)) return status;
-
- status = private_f_string_dynamic_adjust(0, &triples->array[i].b);
- if (F_status_is_error(status)) return status;
-
- status = private_f_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_string_triple_t), (void **) & triples->array);
-
- if (F_status_is_error_not(status)) {
- triples->size = length;
-
- if (triples->used > triples->size) {
- triples->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
-
-#if !defined(_di_f_string_triples_decrease_) || !defined(_di_f_string_triples_decrease_by_) || !defined(_di_f_string_triples_increase_) || !defined(_di_f_string_triples_increase_by_) || !defined(_di_f_string_triples_terminate_) || !defined(_di_f_string_triples_terminate_after_)
- f_status_t private_f_string_triples_resize(const f_array_length_t length, f_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_string_dynamic_resize(0, &triples->array[i].a);
- if (F_status_is_error(status)) return status;
-
- status = private_f_string_dynamic_resize(0, &triples->array[i].b);
- if (F_status_is_error(status)) return status;
-
- status = private_f_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_string_triple_t), (void **) & triples->array);
-
- if (F_status_is_error_not(status)) {
- triples->size = length;
-
- if (triples->used > triples->size) {
- triples->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_triples_decrease_) || !defined(_di_f_string_triples_decrease_by_) || !defined(_di_f_string_triples_increase_) || !defined(_di_f_string_triples_increase_by_) || !defined(_di_f_string_triples_terminate_) || !defined(_di_f_string_triples_terminate_after_)
-
-#if !defined(_di_f_string_tripless_adjust_) || !defined(_di_f_string_tripless_decimate_by_)
- f_status_t private_f_string_tripless_adjust(const f_array_length_t length, f_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_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_string_triples_t), (void **) & tripless->array);
-
- if (F_status_is_error_not(status)) {
- tripless->size = length;
-
- if (tripless->used > tripless->size) {
- tripless->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_tripless_adjust_) || !defined(_di_f_string_tripless_decimate_by_)
-
-#if !defined(_di_f_string_tripless_decrease_) || !defined(_di_f_string_tripless_decrease_by_) || !defined(_di_f_string_tripless_increase_) || !defined(_di_f_string_tripless_increase_by_) || !defined(_di_f_string_tripless_terminate_) || !defined(_di_f_string_tripless_terminate_after_)
- f_status_t private_f_string_tripless_resize(const f_array_length_t length, f_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_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_string_triples_t), (void **) & tripless->array);
-
- if (F_status_is_error_not(status)) {
- tripless->size = length;
-
- if (tripless->used > tripless->size) {
- tripless->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_string_tripless_decrease_) || !defined(_di_f_string_tripless_decrease_by_) || !defined(_di_f_string_tripless_increase_) || !defined(_di_f_string_tripless_increase_by_) || !defined(_di_f_string_tripless_terminate_) || !defined(_di_f_string_tripless_terminate_after_)
-
#ifdef __cplusplus
} // extern "C"
#endif
#endif // !defined(_di_f_string_append_assure_nulless_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_assure_nulless_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_string_dynamic_partial_append_nulless_) || !defined(_di_f_string_dynamic_partial_mash_nulless_) || !defined(_di_f_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_string_dynamic_adjust()
- * @see f_string_dynamic_decimate_by()
- * @see f_string_dynamics_adjust()
- * @see f_string_dynamics_append()
- * @see f_string_dynamics_decimate_by()
- * @see f_string_map_multis_adjust()
- * @see f_string_map_multis_append()
- * @see f_string_triples_adjust()
- * @see f_string_triples_decimate_by()
- */
-#if !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
- extern f_status_t private_f_string_dynamic_adjust(const f_array_length_t length, f_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
-
-/**
- * Private implementation of f_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_string_append()
- * @see f_string_append_assure()
- * @see f_string_append_mash()
- * @see f_string_append_nulless()
- * @see f_string_dynamic_append()
- * @see f_string_dynamic_append_assure()
- * @see f_string_dynamic_append_nulless()
- * @see f_string_dynamic_increase_by()
- * @see f_string_dynamic_mash()
- * @see f_string_dynamic_mash_nulless()
- * @see f_string_dynamic_partial_append)
- * @see f_string_dynamic_partial_append_assure()
- * @see f_string_dynamic_partial_mash()
- * @see f_string_dynamic_prepend()
- * @see f_string_dynamic_prepend_nulless()
- * @see f_string_dynamics_append()
- * @see f_string_map_multis_append()
- * @see f_string_mash()
- * @see f_string_mash_nulless()
- * @see f_string_maps_append()
- * @see f_string_prepend()
- * @see f_string_prepend_nulless()
- * @see f_string_triples_append()
- */
-#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
- extern f_status_t private_f_string_dynamic_increase_by(const f_array_length_t amount, f_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_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_string_append()
- * @see f_string_append_assure()
- * @see f_string_append_mash()
- * @see f_string_append_nulless()
- * @see f_string_dynamic_append()
- * @see f_string_dynamic_append_assure()
- * @see f_string_dynamic_append_nulless()
- * @see f_string_dynamic_decrease_by()
- * @see f_string_dynamic_increase()
- * @see f_string_dynamic_increase_by()
- * @see f_string_dynamic_mash()
- * @see f_string_dynamic_mash_nulless()
- * @see f_string_dynamic_partial_append)
- * @see f_string_dynamic_partial_append_assure()
- * @see f_string_dynamic_partial_mash()
- * @see f_string_dynamic_prepend()
- * @see f_string_dynamic_prepend_nulless()
- * @see f_string_dynamic_terminate()
- * @see f_string_dynamic_terminate_after()
- * @see f_string_dynamics_append()
- * @see f_string_map_multis_append()
- * @see f_string_mash_nulless()
- * @see f_string_mash()
- * @see f_string_maps_append()
- * @see f_string_prepend()
- * @see f_string_prepend_nulless()
- * @see f_string_triples_append()
- */
-#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
- extern f_status_t private_f_string_dynamic_resize(const f_array_length_t length, f_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_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_string_dynamics_adjust()
- * @see f_string_dynamics_append()
- * @see f_string_dynamics_decimate_by()
- * @see f_string_map_multis_adjust()
- * @see f_string_map_multis_append()
- */
-#if !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
- extern f_status_t private_f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t * const dynamics) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_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_resize().
- *
- * @see f_memory_resize()
- * @see f_string_dynamics_append()
- * @see f_string_map_multis_append()
- */
-#if !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_)
- extern f_status_t private_f_string_dynamics_append(const f_string_dynamics_t source, f_string_dynamics_t * const destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_dynamics_append_) || !defined(_di_f_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 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_string_dynamics_decrease_by()
- * @see f_string_dynamics_increase()
- * @see f_string_dynamics_increase_by()
- */
-#if !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_)
- extern f_status_t private_f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t * const dynamics) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_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_string_dynamicss_adjust()
- * @see f_string_dynamicss_append()
- * @see f_string_dynamicss_decimate_by()
- * @see f_string_map_multis_adjust()
- * @see f_string_map_multis_append()
- */
-#if !defined(_di_f_string_dynamicss_adjust_) || !defined(_di_f_string_dynamicss_append_) || !defined(_di_f_string_dynamicss_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
- extern f_status_t private_f_string_dynamicss_adjust(const f_array_length_t length, f_string_dynamicss_t * const dynamicss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_dynamicss_adjust_) || !defined(_di_f_string_dynamicss_append_) || !defined(_di_f_string_dynamicss_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_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_resize().
- *
- * @see f_memory_resize()
- * @see f_string_dynamicss_append()
- * @see f_string_map_multis_append()
- */
-#if !defined(_di_f_string_dynamicss_append_) || !defined(_di_f_string_map_multis_append_)
- extern f_status_t private_f_string_dynamicss_append(const f_string_dynamicss_t source, f_string_dynamicss_t * const destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_dynamicss_append_) || !defined(_di_f_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_string_dynamicss_decrease_by()
- * @see f_string_dynamicss_increase()
- * @see f_string_dynamicss_increase_by()
- */
-#if !defined(_di_f_string_dynamicss_decrease_by_) || !defined(_di_f_string_dynamicss_increase_) || !defined(_di_f_string_dynamicss_increase_by_)
- extern f_status_t private_f_string_dynamicss_resize(const f_array_length_t length, f_string_dynamicss_t * const dynamicss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_dynamicss_decrease_by_) || !defined(_di_f_string_dynamicss_increase_) || !defined(_di_f_string_dynamicss_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_string_map_multis_adjust()
- */
-#if !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_decimate_by_)
- extern f_status_t private_f_string_map_multis_adjust(const f_array_length_t length, f_string_map_multis_t * const map_multis) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_decimate_by_)
-
-/**
- * Private implementation for appending.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
- * The source multi-map to append.
- * @param destination
- * The destination multi-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().
- * Errors (with error bit) from: f_string_map_multis_append().
- * Errors (with error bit) from: f_string_map_multiss_append().
- *
- * @see f_memory_resize()
- * @see f_string_map_multis_append()
- * @see f_string_map_multiss_append()
- */
-#if !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multis_append_)
- extern f_status_t private_f_string_map_multis_append(const f_string_map_multi_t source, f_string_map_multis_t * const destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multis_append_)
-
-/**
- * Private implementation for appending.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
- * The source multi-maps to append.
- * @param destination
- * The destination multi-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().
- * Errors (with error bit) from: f_string_map_multis_append().
- * Errors (with error bit) from: f_string_map_multiss_append().
- *
- * @see f_memory_resize()
- * @see f_string_map_multis_append()
- * @see f_string_map_multiss_append()
- */
-#if !defined(_di_f_string_map_multiss_append_all_) || !defined(_di_f_string_map_multis_append_all_)
- extern f_status_t private_f_string_map_multis_append_all(const f_string_map_multis_t source, f_string_map_multis_t * const destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_map_multiss_append_all_) || !defined(_di_f_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 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_string_map_multis_decrease_by()
- * @see f_string_map_multis_increase()
- * @see f_string_map_multis_increase_by()
- * @see f_string_map_multis_terminate()
- * @see f_string_map_multis_terminate_after()
- */
-#if !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_terminate_) || !defined(_di_f_string_map_multis_terminate_after_)
- extern f_status_t private_f_string_map_multis_resize(const f_array_length_t length, f_string_map_multis_t * const map_multis) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_terminate_) || !defined(_di_f_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_string_map_multiss_adjust()
- */
-#if !defined(_di_f_string_map_multiss_adjust_) || !defined(_di_f_string_map_multiss_decimate_by_)
- extern f_status_t private_f_string_map_multiss_adjust(const f_array_length_t length, f_string_map_multiss_t * const map_multiss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_map_multiss_adjust_) || !defined(_di_f_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_string_map_multiss_decrease_by()
- * @see f_string_map_multiss_increase()
- * @see f_string_map_multiss_increase_by()
- * @see f_string_map_multiss_terminate()
- * @see f_string_map_multiss_terminate_after()
- */
-#if !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_) || !defined(_di_f_string_map_multiss_terminate_) || !defined(_di_f_string_map_multiss_terminate_after_)
- extern f_status_t private_f_string_map_multiss_resize(const f_array_length_t length, f_string_map_multiss_t * const map_multiss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_) || !defined(_di_f_string_map_multiss_terminate_) || !defined(_di_f_string_map_multiss_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_string_maps_adjust()
- */
-#if !defined(_di_f_string_maps_adjust_) || !defined(_di_f_string_maps_decimate_by_)
- extern f_status_t private_f_string_maps_adjust(const f_array_length_t length, f_string_maps_t * const maps) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_maps_adjust_) || !defined(_di_f_string_maps_decimate_by_)
-
-/**
- * Private implementation for appending.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
- * The source map 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_string_maps_append()
- * @see f_string_mapss_append()
- */
-#if !defined(_di_f_string_mapss_append_) || !defined(_di_f_string_maps_append_)
- extern f_status_t private_f_string_maps_append(const f_string_map_t source, f_string_maps_t * const destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_mapss_append_) || !defined(_di_f_string_maps_append_)
-
-/**
- * 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_string_maps_append()
- * @see f_string_mapss_append()
- */
-#if !defined(_di_f_string_mapss_append_all_) || !defined(_di_f_string_maps_append_all_)
- extern f_status_t private_f_string_maps_append_all(const f_string_maps_t source, f_string_maps_t * const destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_mapss_append_all_) || !defined(_di_f_string_maps_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_string_maps_decrease_by()
- * @see f_string_maps_increase()
- * @see f_string_maps_increase_by()
- * @see f_string_maps_terminate()
- * @see f_string_maps_terminate_after()
- */
-#if !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_terminate_) || !defined(_di_f_string_maps_terminate_after_)
- extern f_status_t private_f_string_maps_resize(const f_array_length_t length, f_string_maps_t * const maps) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_terminate_) || !defined(_di_f_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_string_mapss_adjust()
- */
-#if !defined(_di_f_string_mapss_adjust_) || !defined(_di_f_string_mapss_decimate_by_)
- extern f_status_t private_f_string_mapss_adjust(const f_array_length_t length, f_string_mapss_t * const mapss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_mapss_adjust_) || !defined(_di_f_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_string_mapss_decrease_by()
- * @see f_string_mapss_increase()
- * @see f_string_mapss_increase_by()
- * @see f_string_mapss_terminate()
- * @see f_string_mapss_terminate_after()
- */
-#if !defined(_di_f_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_) || !defined(_di_f_string_mapss_terminate_) || !defined(_di_f_string_mapss_terminate_after_)
- extern f_status_t private_f_string_mapss_resize(const f_array_length_t length, f_string_mapss_t * const mapss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_) || !defined(_di_f_string_mapss_terminate_) || !defined(_di_f_string_mapss_terminate_after_)
-
-/**
* Private implementation of f_string_prepend().
*
* Intended to be shared to each of the different implementation variations.
extern f_status_t private_f_string_prepend_nulless(const f_string_t source, f_array_length_t length, f_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_string_dynamic_mish_nulless_) || !defined(_di_f_string_dynamic_partial_mish_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_mish_nulless_) || !defined(_di_f_string_prepend_assure_nulless_) || !defined(_di_f_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 quantitys
- * The quantitys 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_string_quantitys_adjust()
- * @see f_string_quantitys_decimate_by()
- */
-#if !defined(_di_f_string_quantitys_adjust_) || !defined(_di_f_string_quantitys_decimate_by_)
- extern f_status_t private_f_string_quantitys_adjust(const f_array_length_t length, f_string_quantitys_t * const quantitys) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_quantitys_adjust_) || !defined(_di_f_string_quantitys_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 quantitys
- * The quantitys 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_string_quantitys_decrease_by()
- * @see f_string_quantitys_increase()
- * @see f_string_quantitys_increase_by()
- * @see f_string_quantitys_terminate()
- * @see f_string_quantitys_terminate_after()
- */
-#if !defined(_di_f_string_quantitys_decrease_by_) || !defined(_di_f_string_quantitys_increase_) || !defined(_di_f_string_quantitys_increase_by_) || !defined(_di_f_string_quantitys_terminate_) || !defined(_di_f_string_quantitys_terminate_after_)
- extern f_status_t private_f_string_quantitys_resize(const f_array_length_t length, f_string_quantitys_t * const quantitys) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_quantitys_decrease_by_) || !defined(_di_f_string_quantitys_increase_) || !defined(_di_f_string_quantitys_increase_by_) || !defined(_di_f_string_quantitys_terminate_) || !defined(_di_f_string_quantitys_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 quantityss
- * The quantityss 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_string_quantityss_adjust()
- * @see f_string_quantityss_decimate_by()
- */
-#if !defined(_di_f_string_quantityss_adjust_) || !defined(_di_f_string_quantityss_decimate_by_)
- extern f_status_t private_f_string_quantityss_adjust(const f_array_length_t length, f_string_quantityss_t * const quantityss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_quantityss_adjust_) || !defined(_di_f_string_quantityss_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 quantityss
- * The quantityss 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_string_quantityss_decrease_by()
- * @see f_string_quantityss_increase()
- * @see f_string_quantityss_increase_by()
- * @see f_string_quantityss_terminate()
- * @see f_string_quantityss_terminate_after()
- */
-#if !defined(_di_f_string_quantityss_decrease_by_) || !defined(_di_f_string_quantityss_increase_) || !defined(_di_f_string_quantityss_increase_by_) || !defined(_di_f_string_quantityss_terminate_) || !defined(_di_f_string_quantityss_terminate_after_)
- extern f_status_t private_f_string_quantityss_resize(const f_array_length_t length, f_string_quantityss_t * const quantityss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_quantityss_decrease_by_) || !defined(_di_f_string_quantityss_increase_) || !defined(_di_f_string_quantityss_increase_by_) || !defined(_di_f_string_quantityss_terminate_) || !defined(_di_f_string_quantityss_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 ranges
- * The ranges 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_string_ranges_adjust()
- * @see f_string_ranges_decimate_by()
- */
-#if !defined(_di_f_string_ranges_adjust_) || !defined(_di_f_string_ranges_decimate_by_)
- extern f_status_t private_f_string_ranges_adjust(const f_array_length_t length, f_string_ranges_t * const ranges) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_ranges_adjust_) || !defined(_di_f_string_ranges_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 ranges
- * The ranges 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_string_ranges_decrease_by()
- * @see f_string_ranges_increase()
- * @see f_string_ranges_increase_by()
- * @see f_string_ranges_terminate()
- * @see f_string_ranges_terminate_after()
- */
-#if !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_terminate_) || !defined(_di_f_string_ranges_terminate_after_)
- extern f_status_t private_f_string_ranges_resize(const f_array_length_t length, f_string_ranges_t * const ranges) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_terminate_) || !defined(_di_f_string_ranges_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 rangess
- * The rangess 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_string_rangess_adjust()
- * @see f_string_rangess_decimate_by()
- */
-#if !defined(_di_f_string_rangess_adjust_) || !defined(_di_f_string_rangess_decimate_by_)
- extern f_status_t private_f_string_rangess_adjust(const f_array_length_t length, f_string_rangess_t * const rangess) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_rangess_adjust_) || !defined(_di_f_string_rangess_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 rangess
- * The rangess 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_string_rangess_decrease_by()
- * @see f_string_rangess_increase()
- * @see f_string_rangess_increase_by()
- * @see f_string_rangess_terminate()
- * @see f_string_rangess_terminate_after()
- */
-#if !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_) || !defined(_di_f_string_rangess_terminate_) || !defined(_di_f_string_rangess_terminate_after_)
- extern f_status_t private_f_string_rangess_resize(const f_array_length_t length, f_string_rangess_t * const rangess) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_) || !defined(_di_f_string_rangess_terminate_) || !defined(_di_f_string_rangess_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 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_string_triples_adjust()
- * @see f_string_triples_decimate_by()
- */
-#if !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
- extern f_status_t private_f_string_triples_adjust(const f_array_length_t length, f_string_triples_t * const triples) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_triples_adjust_) || !defined(_di_f_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_string_triples_decrease_by()
- * @see f_string_triples_increase()
- * @see f_string_triples_increase_by()
- * @see f_string_triples_terminate()
- * @see f_string_triples_terminate_after()
- */
-#if !defined(_di_f_string_triples_decrease_by_) || !defined(_di_f_string_triples_increase_) || !defined(_di_f_string_triples_increase_by_) || !defined(_di_f_string_triples_terminate_) || !defined(_di_f_string_triples_terminate_after_)
- extern f_status_t private_f_string_triples_resize(const f_array_length_t length, f_string_triples_t * const triples) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_triples_decrease_by_) || !defined(_di_f_string_triples_increase_) || !defined(_di_f_string_triples_increase_by_) || !defined(_di_f_string_triples_terminate_) || !defined(_di_f_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_string_tripless_adjust()
- * @see f_string_tripless_decimate_by()
- */
-#if !defined(_di_f_string_tripless_adjust_) || !defined(_di_f_string_tripless_decimate_by_)
- extern f_status_t private_f_string_tripless_adjust(const f_array_length_t length, f_string_tripless_t * const tripless) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_tripless_adjust_) || !defined(_di_f_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_resize()
- * @see f_string_tripless_decrease_by()
- * @see f_string_tripless_increase()
- * @see f_string_tripless_increase_by()
- * @see f_string_tripless_terminate()
- * @see f_string_tripless_terminate_after()
- */
-#if !defined(_di_f_string_tripless_decrease_by_) || !defined(_di_f_string_tripless_increase_) || !defined(_di_f_string_tripless_increase_by_) || !defined(_di_f_string_tripless_terminate_) || !defined(_di_f_string_tripless_terminate_after_)
- extern f_status_t private_f_string_tripless_resize(const f_array_length_t length, f_string_tripless_t * const tripless) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_string_tripless_decrease_by_) || !defined(_di_f_string_tripless_increase_) || !defined(_di_f_string_tripless_increase_by_) || !defined(_di_f_string_tripless_terminate_) || !defined(_di_f_string_tripless_terminate_after_)
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_0/string/static.h>
#include <fll/level_0/string/dynamic.h>
#include <fll/level_0/string/map.h>
+#include <fll/level_0/string/map_multi.h>
#include <fll/level_0/string/quantity.h>
#include <fll/level_0/string/triple.h>
#include "../string.h"
#include "../private-string.h"
+#include "private-dynamic.h"
#ifdef __cplusplus
extern "C" {
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not;
- }
+ if (!source.used) return F_data_not;
return private_f_string_append(source.string, source.used, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not;
- }
+ if (!source.used) return F_data_not;
if (destination->used < source.used) {
return private_f_string_append(source.string, source.used, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not;
- }
+ if (!source.used) return F_data_not;
if (destination->used < source.used) {
return private_f_string_append_nulless(source.string, source.used, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not;
- }
+ if (!source.used) return F_data_not;
return private_f_string_append_nulless(source.string, source.used, destination);
}
if (!dynamic) 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 (dynamic->size - amount > 0) {
return private_f_string_dynamic_adjust(dynamic->size - amount, dynamic);
if (!dynamic) 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 (dynamic->size - amount > 0) {
return private_f_string_dynamic_resize(dynamic->size - amount, dynamic);
if (!dynamic) 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;
return private_f_string_dynamic_increase_by(amount, dynamic);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not;
- }
+ if (!source.used) return F_data_not;
if (glue.used && destination->used) {
const f_status_t status = private_f_string_append(glue.string, glue.used, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not;
- }
+ if (!source.used) return F_data_not;
if (glue.used && destination->used) {
const f_status_t status = private_f_string_append_nulless(glue.string, glue.used, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not;
- }
+ if (!source.used) return F_data_not;
if (glue.used && destination->used) {
const f_status_t status = private_f_string_prepend(glue.string, glue.used, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not;
- }
+ if (!source.used) return F_data_not;
if (glue.used && destination->used) {
const f_status_t status = private_f_string_prepend_nulless(glue.string, glue.used, destination);
#ifndef _di_f_string_dynamic_partial_append_
f_status_t f_string_dynamic_partial_append(const f_string_static_t source, const f_string_range_t range, f_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;
- }
+ 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_string_append(source.string + range.start, source.used - range.start, destination);
}
return private_f_string_append(source.string + range.start, (range.stop - range.start) + 1, destination);
#ifndef _di_f_string_dynamic_partial_append_assure_
f_status_t f_string_dynamic_partial_append_assure(const f_string_static_t source, const f_string_range_t range, f_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;
- }
-
- 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_string_append(source.string + range.start, length, destination);
#ifndef _di_f_string_dynamic_partial_append_assure_nulless_
f_status_t f_string_dynamic_partial_append_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_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;
- }
-
- 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_string_append_nulless(source.string + range.start, length, destination);
#ifndef _di_f_string_dynamic_partial_append_nulless_
f_status_t f_string_dynamic_partial_append_nulless(const f_string_static_t source, const f_string_range_t range, f_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;
- }
+ 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_string_append_nulless(source.string + range.start, source.used - range.start, destination);
}
return private_f_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
#ifndef _di_f_string_dynamic_partial_mash_
f_status_t f_string_dynamic_partial_mash(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_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;
- }
-
- 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;
if (glue.used && destination->used) {
- f_status_t status = private_f_string_append(glue.string, glue.used, destination);
+ const f_status_t status = private_f_string_append(glue.string, glue.used, destination);
if (F_status_is_error(status)) return status;
}
+ if (range.stop >= source.used) {
+ return private_f_string_append(source.string + range.start, source.used - range.start, destination);
+ }
+
return private_f_string_append(source.string + range.start, (range.stop - range.start) + 1, destination);
}
#endif // _di_f_string_dynamic_partial_mash_
#ifndef _di_f_string_dynamic_partial_mash_nulless_
f_status_t f_string_dynamic_partial_mash_nulless(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_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;
- }
-
- 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;
if (glue.used && destination->used) {
- f_status_t status = private_f_string_append_nulless(glue.string, glue.used, destination);
+ const f_status_t status = private_f_string_append_nulless(glue.string, glue.used, destination);
if (F_status_is_error(status)) return status;
}
+ if (range.stop >= source.used) {
+ return private_f_string_append(source.string + range.start, source.used - range.start, destination);
+ }
+
return private_f_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
}
#endif // _di_f_string_dynamic_partial_mash_nulless_
#ifndef _di_f_string_dynamic_partial_mish_
f_status_t f_string_partial_dynamic_mish(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_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;
- }
-
- 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;
if (glue.used && destination->used) {
- f_status_t status = private_f_string_prepend(glue.string, glue.used, destination);
+ const f_status_t status = private_f_string_prepend(glue.string, glue.used, destination);
if (F_status_is_error(status)) return status;
}
+ if (range.stop >= source.used) {
+ return private_f_string_append(source.string + range.start, source.used - range.start, destination);
+ }
+
return private_f_string_prepend(source.string + range.start, (range.stop - range.start) + 1, destination);
}
#endif // _di_f_string_dynamic_partial_mish_
#ifndef _di_f_string_dynamic_partial_mish_nulless_
f_status_t f_string_dynamic_partial_mish_nulless(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_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;
- }
-
- 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;
if (glue.used && destination->used) {
- f_status_t status = private_f_string_prepend_nulless(glue.string, glue.used, destination);
+ const f_status_t status = private_f_string_prepend_nulless(glue.string, glue.used, destination);
if (F_status_is_error(status)) return status;
}
+ if (range.stop >= source.used) {
+ return private_f_string_append(source.string + range.start, source.used - range.start, destination);
+ }
+
return private_f_string_prepend_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
}
#endif // _di_f_string_dynamic_partial_mish_nulless_
#ifndef _di_f_string_dynamic_partial_prepend_
f_status_t f_string_dynamic_partial_prepend(const f_string_static_t source, const f_string_range_t range, f_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;
- }
+ 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_string_append(source.string + range.start, source.used - range.start, destination);
}
return private_f_string_prepend(source.string + range.start, (range.stop - range.start) + 1, destination);
#ifndef _di_f_string_dynamic_partial_prepend_assure_
f_status_t f_string_dynamic_partial_prepend_assure(const f_string_static_t source, const f_string_range_t range, f_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;
- }
-
- 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_string_prepend(source.string + range.start, length, destination);
#ifndef _di_f_string_dynamic_partial_prepend_assure_nulless_
f_status_t f_string_dynamic_partial_prepend_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_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;
- }
-
- 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_string_prepend_nulless(source.string + range.start, length, destination);
#ifndef _di_f_string_dynamic_partial_prepend_nulless_
f_status_t f_string_dynamic_partial_prepend_nulless(const f_string_static_t source, const f_string_range_t range, f_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;
- }
-
- 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;
return private_f_string_prepend_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not;
- }
+ if (!source.used) return F_data_not;
return private_f_string_prepend(source.string, source.used, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not;
- }
+ if (!source.used) return F_data_not;
if (destination->used < source.used) {
return private_f_string_prepend(source.string, source.used, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) {
- return F_data_not;
- }
+ if (!source.used) return F_data_not;
if (destination->used < source.used) {
return private_f_string_prepend_nulless(source.string, source.used, destination);
#endif // _di_f_string_dynamics_adjust_
#ifndef _di_f_string_dynamics_append_
- f_status_t f_string_dynamics_append(const f_string_dynamics_t source, f_string_dynamics_t * const destination) {
+ f_status_t f_string_dynamics_append(const f_string_dynamic_t source, f_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;
- }
+ if (!source.used) return F_data_not;
return private_f_string_dynamics_append(source, destination);
}
#endif // _di_f_string_dynamics_append_
+#ifndef _di_f_string_dynamics_append_all_
+ f_status_t f_string_dynamics_append_all(const f_string_dynamics_t source, f_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_string_dynamics_append_all(source, destination);
+ }
+#endif // _di_f_string_dynamics_append_all_
+
#ifndef _di_f_string_dynamics_decimate_by_
f_status_t f_string_dynamics_decimate_by(const f_array_length_t amount, f_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_
- if (!amount) {
- return F_data_not;
- }
+ if (!amount) return F_data_not;
if (dynamics->size - amount > 0) {
return private_f_string_dynamics_adjust(dynamics->size - amount, dynamics);
if (!dynamics) 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 (dynamics->size - amount > 0) {
return private_f_string_dynamics_resize(dynamics->size - amount, dynamics);
if (!dynamics) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!step) {
- return F_data_not;
- }
+ if (!step) return F_data_not;
if (dynamics->used + 1 > dynamics->size) {
f_array_length_t size = dynamics->used + step;
#endif // _di_f_string_dynamicss_adjust_
#ifndef _di_f_string_dynamicss_append_
- f_status_t f_string_dynamicss_append(const f_string_dynamicss_t source, f_string_dynamicss_t * const destination) {
+ f_status_t f_string_dynamicss_append(const f_string_dynamics_t source, f_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;
+ if (!source.used) return F_data_not;
+
+ f_status_t status = F_none;
+
+ if (destination->used + 1 > destination->size) {
+ status = private_f_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_string_dynamics_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
}
- return private_f_string_dynamicss_append(source, destination);
+ ++destination->used;
+
+ return F_none;
}
#endif // _di_f_string_dynamicss_append_
+#ifndef _di_f_string_dynamicss_append_all_
+ f_status_t f_string_dynamicss_append_all(const f_string_dynamicss_t source, f_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_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_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_string_dynamicss_append_all_
+
#ifndef _di_f_string_dynamicss_decimate_by_
f_status_t f_string_dynamicss_decimate_by(const f_array_length_t amount, f_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 (!amount) return F_data_not;
if (dynamicss->size - amount > 0) {
return private_f_string_dynamicss_adjust(dynamicss->size - amount, dynamicss);
if (!dynamicss) 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 (dynamicss->size - amount > 0) {
return private_f_string_dynamicss_resize(dynamicss->size - amount, dynamicss);
if (!dynamicss) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!step) {
- return F_data_not;
- }
+ if (!step) return F_data_not;
if (dynamicss->used + 1 > dynamicss->size) {
f_array_length_t size = dynamicss->used + step;
if (!dynamicss) 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 (dynamicss->used + amount > dynamicss->size) {
if (dynamicss->used + amount > F_array_length_t_size_d) {
/**
* 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 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.
* @return
* F_none on success.
* 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.
* @return
* F_none on success.
* 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.
* @return
* F_none on success.
* 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.
* @return
* F_none on success.
* 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.
* @return
* F_none on success.
* 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.
* @return
* F_none on success.
* 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.
* @return
* F_none on success.
* 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.
* @return
* F_none on success.
* 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.
* @return
* F_none on success.
* 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.
* @return
* F_none on success.
* 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.
* @return
* F_none on success.
* 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.
* @return
* F_none on success.
* F_data_not if source length is 0.
- * F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not if source length is 0.
- * F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not if source length is 0.
- * F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not if source length is 0.
- * F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
#endif // _di_f_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_string_dynamics_append_
- extern f_status_t f_string_dynamics_append(const f_string_dynamics_t source, f_string_dynamics_t * const destination);
+ extern f_status_t f_string_dynamics_append(const f_string_dynamic_t source, f_string_dynamics_t * const destination);
#endif // _di_f_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_string_dynamics_append_all_
+ extern f_status_t f_string_dynamics_append_all(const f_string_dynamics_t source, f_string_dynamics_t * const destination);
+#endif // _di_f_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).
#endif // _di_f_string_dynamicss_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_string_dynamicss_append_
- extern f_status_t f_string_dynamicss_append(const f_string_dynamicss_t source, f_string_dynamicss_t * const destination);
+ extern f_status_t f_string_dynamicss_append(const f_string_dynamics_t source, f_string_dynamicss_t * const destination);
#endif // _di_f_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_string_dynamicss_append_all_
+ extern f_status_t f_string_dynamicss_append_all(const f_string_dynamicss_t source, f_string_dynamicss_t * const destination);
+#endif // _di_f_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).
#include "../string.h"
#include "../private-string.h"
+#include "private-map.h"
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_f_string_map_multis_adjust_
- f_status_t f_string_map_multis_adjust(const f_array_length_t length, f_string_map_multis_t * const map_multis) {
+#ifndef _di_f_string_maps_adjust_
+ f_status_t f_string_maps_adjust(const f_array_length_t length, f_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_string_map_multis_adjust(length, map_multis);
+ return private_f_string_maps_adjust(length, maps);
}
-#endif // _di_f_string_map_multis_adjust_
+#endif // _di_f_string_maps_adjust_
-#ifndef _di_f_string_map_multis_append_
- f_status_t f_string_map_multis_append(const f_string_map_multi_t source, f_string_map_multis_t * const destination) {
+#ifndef _di_f_string_maps_append_
+ f_status_t f_string_maps_append(const f_string_map_t source, f_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 + 1 > destination->size) {
- status = private_f_string_map_multis_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ status = private_f_string_maps_resize(destination->used + F_memory_default_allocation_small_d, destination);
if (F_status_is_error(status)) return status;
}
}
if (source.value.used) {
- status = private_f_string_dynamics_append(source.value, &destination->array[destination->used].value);
- if (F_status_is_error(status)) return status;
- }
-
- ++destination->used;
-
- return F_none;
- }
-#endif // _di_f_string_map_multis_append_
-
-#ifndef _di_f_string_map_multis_append_all_
- f_status_t f_string_map_multis_append_all(const f_string_map_multis_t source, f_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 + source.used > destination->size) {
- status = private_f_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_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_string_dynamics_append(source.array[i].value, &destination->array[destination->used].value);
- if (F_status_is_error(status)) return status;
- }
- } // for
-
- return F_none;
- }
-#endif // _di_f_string_map_multis_append_all_
-
-#ifndef _di_f_string_map_multis_decimate_by_
- f_status_t f_string_map_multis_decimate_by(const f_array_length_t amount, f_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_string_map_multis_adjust(map_multis->size - amount, map_multis);
- }
-
- return private_f_string_map_multis_adjust(0, map_multis);
- }
-#endif // _di_f_string_map_multis_decimate_by_
-
-#ifndef _di_f_string_map_multis_decrease_by_
- f_status_t f_string_map_multis_decrease_by(const f_array_length_t amount, f_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_string_map_multis_resize(map_multis->size - amount, map_multis);
- }
-
- return private_f_string_map_multis_resize(0, map_multis);
- }
-#endif // _di_f_string_map_multis_decrease_by_
-
-#ifndef _di_f_string_map_multis_increase_
- f_status_t f_string_map_multis_increase(const f_array_length_t step, f_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_string_map_multis_resize(size, map_multis);
- }
-
- return F_data_not;
- }
-#endif // _di_f_string_map_multis_increase_
-
-#ifndef _di_f_string_map_multis_increase_by_
- f_status_t f_string_map_multis_increase_by(const f_array_length_t amount, f_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_string_map_multis_resize(map_multis->used + amount, map_multis);
- }
-
- return F_data_not;
- }
-#endif // _di_f_string_map_multis_increase_by_
-
-#ifndef _di_f_string_map_multis_resize_
- f_status_t f_string_map_multis_resize(const f_array_length_t length, f_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_string_map_multis_resize(length, map_multis);
- }
-#endif // _di_f_string_map_multis_resize_
-
-#ifndef _di_f_string_map_multiss_adjust_
- f_status_t f_string_map_multiss_adjust(const f_array_length_t length, f_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_string_map_multiss_adjust(length, map_multiss);
- }
-#endif // _di_f_string_map_multiss_adjust_
-
-#ifndef _di_f_string_map_multiss_append_
- f_status_t f_string_map_multiss_append(const f_string_map_multis_t source, f_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_
-
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_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_string_map_multis_append_all(source, &destination->array[destination->used]);
+ status = private_f_string_append(source.value.string, source.value.used, &destination->array[destination->used].value);
if (F_status_is_error(status)) return status;
}
return F_none;
}
-#endif // _di_f_string_map_multiss_append_
-
-#ifndef _di_f_string_map_multiss_append_all_
- f_status_t f_string_map_multiss_append_all(const f_string_map_multiss_t source, f_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_
-
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_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_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_string_map_multiss_append_all_
-
-#ifndef _di_f_string_map_multiss_decimate_by_
- f_status_t f_string_map_multiss_decimate_by(const f_array_length_t amount, f_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_string_map_multiss_adjust(map_multiss->size - amount, map_multiss);
- }
-
- return private_f_string_map_multiss_adjust(0, map_multiss);
- }
-#endif // _di_f_string_map_multiss_decimate_by_
-
-#ifndef _di_f_string_map_multiss_decrease_by_
- f_status_t f_string_map_multiss_decrease_by(const f_array_length_t amount, f_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_string_map_multiss_resize(map_multiss->size - amount, map_multiss);
- }
-
- return private_f_string_map_multiss_resize(0, map_multiss);
- }
-#endif // _di_f_string_map_multiss_decrease_by_
-
-#ifndef _di_f_string_map_multiss_increase_
- f_status_t f_string_map_multiss_increase(const f_array_length_t step, f_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_string_map_multiss_resize(size, map_multiss);
- }
-
- return F_data_not;
- }
-#endif // _di_f_string_map_multiss_increase_
-
-#ifndef _di_f_string_map_multiss_increase_by_
- f_status_t f_string_map_multiss_increase_by(const f_array_length_t amount, f_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_string_map_multiss_resize(map_multiss->used + amount, map_multiss);
- }
-
- return F_data_not;
- }
-#endif // _di_f_string_map_multiss_increase_by_
-
-#ifndef _di_f_string_map_multiss_resize_
- f_status_t f_string_map_multiss_resize(const f_array_length_t length, f_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_string_map_multiss_resize(length, map_multiss);
- }
-#endif // _di_f_string_map_multiss_resize_
-
-#ifndef _di_f_string_maps_adjust_
- f_status_t f_string_maps_adjust(const f_array_length_t length, f_string_maps_t * const maps) {
- #ifndef _di_level_0_parameter_checking_
- if (!maps) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_string_maps_adjust(length, maps);
- }
-#endif // _di_f_string_maps_adjust_
-
-#ifndef _di_f_string_maps_append_
- f_status_t f_string_maps_append(const f_string_map_t source, f_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_
-
- return private_f_string_maps_append(source, destination);
- }
#endif // _di_f_string_maps_append_
#ifndef _di_f_string_maps_append_all_
if (!maps) 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 (maps->size - amount > 0) {
return private_f_string_maps_adjust(maps->size - amount, maps);
if (!maps) 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 (maps->size - amount > 0) {
return private_f_string_maps_resize(maps->size - amount, maps);
if (!maps) 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 (maps->used + amount > maps->size) {
if (maps->used + amount > F_array_length_t_size_d) {
if (!mapss) 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 (mapss->size - amount > 0) {
return private_f_string_mapss_adjust(mapss->size - amount, mapss);
if (!mapss) 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 (mapss->size - amount > 0) {
return private_f_string_mapss_resize(mapss->size - amount, mapss);
if (!mapss) 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 (mapss->used + amount > mapss->size) {
if (mapss->used + amount > F_array_length_t_size_d) {
#endif // _di_f_string_mapss_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_string_map_multi_t_
- typedef struct {
- f_string_dynamic_t name;
- f_string_dynamics_t value;
- } f_string_map_multi_t;
-
- #define f_string_map_multi_t_initialize { f_string_dynamic_t_initialize, f_string_dynamics_t_initialize }
-
- #define macro_f_string_map_t_initialize(name, value) { name, value }
-
- #define macro_f_string_map_multi_t_clear(map) \
- macro_f_string_dynamic_t_clear(map.name) \
- macro_f_string_dynamics_t_clear(map.value)
-
- #define macro_f_string_map_multi_t_delete_simple(map) \
- macro_f_string_dynamic_t_delete_simple(map.name) \
- macro_f_string_dynamics_t_delete_simple(map.value)
-
- #define macro_f_string_map_multi_t_destroy_simple(map) \
- macro_f_string_dynamic_t_destroy_simple(map.name) \
- macro_f_string_dynamics_t_destroy_simple(map.value)
-#endif // _di_f_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_string_map_multis_t_
- typedef struct {
- f_string_map_multi_t *array;
-
- f_array_length_t size;
- f_array_length_t used;
- } f_string_map_multis_t;
-
- #define f_string_map_multis_t_initialize f_string_statics_t_initialize
-
- #define macro_f_string_map_multis_t_initialize(array, size, used) { array, size, used }
- #define macro_f_string_map_multis_t_initialize2(array, length) { array, length, length }
-
- #define macro_f_string_map_multis_t_clear(map_multis) macro_f_memory_structure_clear(map_multis)
-
- #define macro_f_string_map_multis_t_resize(status, map_multis, length) status = f_string_map_multis_resize(length, &map_multis);
- #define macro_f_string_map_multis_t_adjust(status, map_multis, length) status = f_string_map_multis_adjust(length, &map_multis);
-
- #define macro_f_string_map_multis_t_delete_simple(map_multis) f_string_map_multis_resize(0, &map_multis);
- #define macro_f_string_map_multis_t_destroy_simple(map_multis) f_string_map_multis_adjust(0, &map_multis);
-
- #define macro_f_string_map_multis_t_increase(status, step, map_multis) status = f_string_map_multis_increase(step, &map_multis);
- #define macro_f_string_map_multis_t_increase_by(status, map_multis, amount) status = f_string_map_multis_increase_by(amount, &map_multis);
- #define macro_f_string_map_multis_t_decrease_by(status, map_multis, amount) status = f_string_map_multis_decrease_by(amount, &map_multis);
- #define macro_f_string_map_multis_t_decimate_by(status, map_multis, amount) status = f_string_map_multis_decimate_by(amount, &map_multis);
-#endif // _di_f_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_string_map_multiss_t_
- typedef struct {
- f_string_map_multis_t *array;
-
- f_array_length_t size;
- f_array_length_t used;
- } f_string_map_multiss_t;
-
- #define f_string_map_multiss_t_initialize f_string_statics_t_initialize
-
- #define macro_f_string_map_multiss_t_initialize(array, size, used) { array, size, used }
- #define macro_f_string_map_multiss_t_initialize2(array, length) { array, length, length }
-
- #define macro_f_string_map_multiss_t_clear(map_multis) macro_f_memory_structure_clear(map_multis)
-
- #define macro_f_string_map_multiss_t_resize(status, map_multis, length) status = f_string_map_multiss_resize(length, &map_multis);
- #define macro_f_string_map_multiss_t_adjust(status, map_multis, length) status = f_string_map_multiss_adjust(length, &map_multis);
-
- #define macro_f_string_map_multiss_t_delete_simple(map_multis) f_string_map_multiss_resize(0, &map_multis);
- #define macro_f_string_map_multiss_t_destroy_simple(map_multis) f_string_map_multiss_adjust(0, &map_multis);
-
- #define macro_f_string_map_multiss_t_increase(status, step, map_multis) status = f_string_map_multiss_increase(step, &map_multis);
- #define macro_f_string_map_multiss_t_increase_by(status, map_multis, amount) status = f_string_map_multiss_increase_by(amount, &map_multis);
- #define macro_f_string_map_multiss_t_decrease_by(status, map_multis, amount) status = f_string_map_multiss_decrease_by(amount, &map_multis);
- #define macro_f_string_map_multiss_t_decimate_by(status, map_multis, amount) status = f_string_map_multiss_decimate_by(amount, &map_multis);
-#endif // _di_f_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_string_map_multis_adjust_
- extern f_status_t f_string_map_multis_adjust(const f_array_length_t length, f_string_map_multis_t * const map_multis);
-#endif // _di_f_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_string_map_multis_append_
- f_status_t f_string_map_multis_append(const f_string_map_multi_t source, f_string_map_multis_t *destination);
-#endif // _di_f_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_string_map_multis_append_all_
- f_status_t f_string_map_multis_append_all(const f_string_map_multis_t source, f_string_map_multis_t *destination);
-#endif // _di_f_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_string_map_multis_decimate_by_
- extern f_status_t f_string_map_multis_decimate_by(const f_array_length_t amount, f_string_map_multis_t * const map_multis);
-#endif // _di_f_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_string_map_multis_decrease_by_
- extern f_status_t f_string_map_multis_decrease_by(const f_array_length_t amount, f_string_map_multis_t * const map_multis);
-#endif // _di_f_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_string_map_multis_increase_
- extern f_status_t f_string_map_multis_increase(const f_array_length_t step, f_string_map_multis_t * const map_multis);
-#endif // _di_f_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_string_map_multis_increase_by_
- extern f_status_t f_string_map_multis_increase_by(const f_array_length_t amount, f_string_map_multis_t * const map_multis);
-#endif // _di_f_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_string_map_multis_resize_
- extern f_status_t f_string_map_multis_resize(const f_array_length_t length, f_string_map_multis_t * const map_multis);
-#endif // _di_f_string_map_multis_resize_
-
-/**
* Resize the string maps array.
*
* @param length
--- /dev/null
+#include "../string.h"
+#include "../private-string.h"
+#include "private-dynamic.h"
+#include "private-map_multi.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_f_string_map_multis_adjust_
+ f_status_t f_string_map_multis_adjust(const f_array_length_t length, f_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_string_map_multis_adjust(length, map_multis);
+ }
+#endif // _di_f_string_map_multis_adjust_
+
+#ifndef _di_f_string_map_multis_append_
+ f_status_t f_string_map_multis_append(const f_string_map_multi_t source, f_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_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_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_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_string_map_multis_append_
+
+#ifndef _di_f_string_map_multis_append_all_
+ f_status_t f_string_map_multis_append_all(const f_string_map_multis_t source, f_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_string_map_multis_append_all(source, destination);
+ }
+#endif // _di_f_string_map_multis_append_all_
+
+#ifndef _di_f_string_map_multis_decimate_by_
+ f_status_t f_string_map_multis_decimate_by(const f_array_length_t amount, f_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_string_map_multis_adjust(map_multis->size - amount, map_multis);
+ }
+
+ return private_f_string_map_multis_adjust(0, map_multis);
+ }
+#endif // _di_f_string_map_multis_decimate_by_
+
+#ifndef _di_f_string_map_multis_decrease_by_
+ f_status_t f_string_map_multis_decrease_by(const f_array_length_t amount, f_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_string_map_multis_resize(map_multis->size - amount, map_multis);
+ }
+
+ return private_f_string_map_multis_resize(0, map_multis);
+ }
+#endif // _di_f_string_map_multis_decrease_by_
+
+#ifndef _di_f_string_map_multis_increase_
+ f_status_t f_string_map_multis_increase(const f_array_length_t step, f_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_string_map_multis_resize(size, map_multis);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_string_map_multis_increase_
+
+#ifndef _di_f_string_map_multis_increase_by_
+ f_status_t f_string_map_multis_increase_by(const f_array_length_t amount, f_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_string_map_multis_resize(map_multis->used + amount, map_multis);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_string_map_multis_increase_by_
+
+#ifndef _di_f_string_map_multis_resize_
+ f_status_t f_string_map_multis_resize(const f_array_length_t length, f_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_string_map_multis_resize(length, map_multis);
+ }
+#endif // _di_f_string_map_multis_resize_
+
+#ifndef _di_f_string_map_multiss_adjust_
+ f_status_t f_string_map_multiss_adjust(const f_array_length_t length, f_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_string_map_multiss_adjust(length, map_multiss);
+ }
+#endif // _di_f_string_map_multiss_adjust_
+
+#ifndef _di_f_string_map_multiss_append_
+ f_status_t f_string_map_multiss_append(const f_string_map_multis_t source, f_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_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_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_string_map_multiss_append_
+
+#ifndef _di_f_string_map_multiss_append_all_
+ f_status_t f_string_map_multiss_append_all(const f_string_map_multiss_t source, f_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_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_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_string_map_multiss_append_all_
+
+#ifndef _di_f_string_map_multiss_decimate_by_
+ f_status_t f_string_map_multiss_decimate_by(const f_array_length_t amount, f_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_string_map_multiss_adjust(map_multiss->size - amount, map_multiss);
+ }
+
+ return private_f_string_map_multiss_adjust(0, map_multiss);
+ }
+#endif // _di_f_string_map_multiss_decimate_by_
+
+#ifndef _di_f_string_map_multiss_decrease_by_
+ f_status_t f_string_map_multiss_decrease_by(const f_array_length_t amount, f_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_string_map_multiss_resize(map_multiss->size - amount, map_multiss);
+ }
+
+ return private_f_string_map_multiss_resize(0, map_multiss);
+ }
+#endif // _di_f_string_map_multiss_decrease_by_
+
+#ifndef _di_f_string_map_multiss_increase_
+ f_status_t f_string_map_multiss_increase(const f_array_length_t step, f_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_string_map_multiss_resize(size, map_multiss);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_string_map_multiss_increase_
+
+#ifndef _di_f_string_map_multiss_increase_by_
+ f_status_t f_string_map_multiss_increase_by(const f_array_length_t amount, f_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_string_map_multiss_resize(map_multiss->used + amount, map_multiss);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_string_map_multiss_increase_by_
+
+#ifndef _di_f_string_map_multiss_resize_
+ f_status_t f_string_map_multiss_resize(const f_array_length_t length, f_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_string_map_multiss_resize(length, map_multiss);
+ }
+#endif // _di_f_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_string_map_multi_h
+#define _F_string_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_string_map_multi_t_
+ typedef struct {
+ f_string_dynamic_t name;
+ f_string_dynamics_t value;
+ } f_string_map_multi_t;
+
+ #define f_string_map_multi_t_initialize { f_string_dynamic_t_initialize, f_string_dynamics_t_initialize }
+
+ #define macro_f_string_map_t_initialize(name, value) { name, value }
+
+ #define macro_f_string_map_multi_t_clear(map) \
+ macro_f_string_dynamic_t_clear(map.name) \
+ macro_f_string_dynamics_t_clear(map.value)
+
+ #define macro_f_string_map_multi_t_delete_simple(map) \
+ macro_f_string_dynamic_t_delete_simple(map.name) \
+ macro_f_string_dynamics_t_delete_simple(map.value)
+
+ #define macro_f_string_map_multi_t_destroy_simple(map) \
+ macro_f_string_dynamic_t_destroy_simple(map.name) \
+ macro_f_string_dynamics_t_destroy_simple(map.value)
+#endif // _di_f_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_string_map_multis_t_
+ typedef struct {
+ f_string_map_multi_t *array;
+
+ f_array_length_t size;
+ f_array_length_t used;
+ } f_string_map_multis_t;
+
+ #define f_string_map_multis_t_initialize f_string_statics_t_initialize
+
+ #define macro_f_string_map_multis_t_initialize(array, size, used) { array, size, used }
+ #define macro_f_string_map_multis_t_initialize2(array, length) { array, length, length }
+
+ #define macro_f_string_map_multis_t_clear(map_multis) macro_f_memory_structure_clear(map_multis)
+
+ #define macro_f_string_map_multis_t_resize(status, map_multis, length) status = f_string_map_multis_resize(length, &map_multis);
+ #define macro_f_string_map_multis_t_adjust(status, map_multis, length) status = f_string_map_multis_adjust(length, &map_multis);
+
+ #define macro_f_string_map_multis_t_delete_simple(map_multis) f_string_map_multis_resize(0, &map_multis);
+ #define macro_f_string_map_multis_t_destroy_simple(map_multis) f_string_map_multis_adjust(0, &map_multis);
+
+ #define macro_f_string_map_multis_t_increase(status, step, map_multis) status = f_string_map_multis_increase(step, &map_multis);
+ #define macro_f_string_map_multis_t_increase_by(status, map_multis, amount) status = f_string_map_multis_increase_by(amount, &map_multis);
+ #define macro_f_string_map_multis_t_decrease_by(status, map_multis, amount) status = f_string_map_multis_decrease_by(amount, &map_multis);
+ #define macro_f_string_map_multis_t_decimate_by(status, map_multis, amount) status = f_string_map_multis_decimate_by(amount, &map_multis);
+#endif // _di_f_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_string_map_multiss_t_
+ typedef struct {
+ f_string_map_multis_t *array;
+
+ f_array_length_t size;
+ f_array_length_t used;
+ } f_string_map_multiss_t;
+
+ #define f_string_map_multiss_t_initialize f_string_statics_t_initialize
+
+ #define macro_f_string_map_multiss_t_initialize(array, size, used) { array, size, used }
+ #define macro_f_string_map_multiss_t_initialize2(array, length) { array, length, length }
+
+ #define macro_f_string_map_multiss_t_clear(map_multis) macro_f_memory_structure_clear(map_multis)
+
+ #define macro_f_string_map_multiss_t_resize(status, map_multis, length) status = f_string_map_multiss_resize(length, &map_multis);
+ #define macro_f_string_map_multiss_t_adjust(status, map_multis, length) status = f_string_map_multiss_adjust(length, &map_multis);
+
+ #define macro_f_string_map_multiss_t_delete_simple(map_multis) f_string_map_multiss_resize(0, &map_multis);
+ #define macro_f_string_map_multiss_t_destroy_simple(map_multis) f_string_map_multiss_adjust(0, &map_multis);
+
+ #define macro_f_string_map_multiss_t_increase(status, step, map_multis) status = f_string_map_multiss_increase(step, &map_multis);
+ #define macro_f_string_map_multiss_t_increase_by(status, map_multis, amount) status = f_string_map_multiss_increase_by(amount, &map_multis);
+ #define macro_f_string_map_multiss_t_decrease_by(status, map_multis, amount) status = f_string_map_multiss_decrease_by(amount, &map_multis);
+ #define macro_f_string_map_multiss_t_decimate_by(status, map_multis, amount) status = f_string_map_multiss_decimate_by(amount, &map_multis);
+#endif // _di_f_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_string_map_multis_adjust_
+ extern f_status_t f_string_map_multis_adjust(const f_array_length_t length, f_string_map_multis_t * const map_multis);
+#endif // _di_f_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_string_map_multis_append_
+ f_status_t f_string_map_multis_append(const f_string_map_multi_t source, f_string_map_multis_t *destination);
+#endif // _di_f_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_string_map_multis_append_all_
+ f_status_t f_string_map_multis_append_all(const f_string_map_multis_t source, f_string_map_multis_t *destination);
+#endif // _di_f_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_string_map_multis_decimate_by_
+ extern f_status_t f_string_map_multis_decimate_by(const f_array_length_t amount, f_string_map_multis_t * const map_multis);
+#endif // _di_f_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_string_map_multis_decrease_by_
+ extern f_status_t f_string_map_multis_decrease_by(const f_array_length_t amount, f_string_map_multis_t * const map_multis);
+#endif // _di_f_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_string_map_multis_increase_
+ extern f_status_t f_string_map_multis_increase(const f_array_length_t step, f_string_map_multis_t * const map_multis);
+#endif // _di_f_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_string_map_multis_increase_by_
+ extern f_status_t f_string_map_multis_increase_by(const f_array_length_t amount, f_string_map_multis_t * const map_multis);
+#endif // _di_f_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_string_map_multis_resize_
+ extern f_status_t f_string_map_multis_resize(const f_array_length_t length, f_string_map_multis_t * const map_multis);
+#endif // _di_f_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_string_map_multiss_adjust_
+ extern f_status_t f_string_map_multiss_adjust(const f_array_length_t length, f_string_map_multiss_t * const map_multiss);
+#endif // _di_f_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_string_map_multiss_append_
+ f_status_t f_string_map_multiss_append(const f_string_map_multis_t source, f_string_map_multiss_t *destination);
+#endif // _di_f_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_string_map_multiss_append_all_
+ f_status_t f_string_map_multiss_append_all(const f_string_map_multiss_t source, f_string_map_multiss_t *destination);
+#endif // _di_f_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_string_map_multiss_decimate_by_
+ extern f_status_t f_string_map_multiss_decimate_by(const f_array_length_t amount, f_string_map_multiss_t * const map_multiss);
+#endif // _di_f_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_string_map_multiss_decrease_by_
+ extern f_status_t f_string_map_multiss_decrease_by(const f_array_length_t amount, f_string_map_multiss_t * const map_multiss);
+#endif // _di_f_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_string_map_multiss_increase_
+ extern f_status_t f_string_map_multiss_increase(const f_array_length_t step, f_string_map_multiss_t * const map_multiss);
+#endif // _di_f_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_string_map_multiss_increase_by_
+ extern f_status_t f_string_map_multiss_increase_by(const f_array_length_t amount, f_string_map_multiss_t * const map_multiss);
+#endif // _di_f_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_string_map_multiss_resize_
+ extern f_status_t f_string_map_multiss_resize(const f_array_length_t length, f_string_map_multiss_t * const map_multiss);
+#endif // _di_f_string_map_multiss_resize_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _F_string_map_multi_h
--- /dev/null
+#include "../string.h"
+#include "../private-string.h"
+#include "private-dynamic.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
+ f_status_t private_f_string_dynamic_adjust(const f_array_length_t length, f_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_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
+
+#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
+ f_status_t private_f_string_dynamic_increase_by(const f_array_length_t amount, f_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_string_dynamic_resize(dynamic->used + amount, dynamic);
+ }
+
+ return F_data_not;
+ }
+#endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
+
+#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
+ f_status_t private_f_string_dynamic_resize(const f_array_length_t length, f_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_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
+
+#if !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
+ f_status_t private_f_string_dynamics_adjust(const f_array_length_t length, f_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_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_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_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
+
+#if !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_)
+ f_status_t private_f_string_dynamics_append(const f_string_dynamic_t source, f_string_dynamics_t * const destination) {
+
+ f_status_t status = F_none;
+
+ if (destination->used + 1 > destination->size) {
+ status = private_f_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_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_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_)
+
+
+#if !defined(_di_f_string_dynamics_append_all_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_)
+ f_status_t private_f_string_dynamics_append_all(const f_string_dynamics_t source, f_string_dynamics_t * const destination) {
+
+ f_status_t status = F_none;
+
+ if (destination->used + source.used > destination->size) {
+ status = private_f_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_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_string_dynamics_append_all_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_)
+
+#if !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_) || !defined(f_string_map_multis_append)
+ f_status_t private_f_string_dynamics_resize(const f_array_length_t length, f_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_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_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_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_) || !defined(f_string_map_multis_append)
+
+#if !defined(_di_f_string_dynamicss_adjust_) || !defined(_di_f_string_dynamicss_append_) || !defined(_di_f_string_dynamicss_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
+ f_status_t private_f_string_dynamicss_adjust(const f_array_length_t length, f_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_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_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_string_dynamicss_adjust_) || !defined(_di_f_string_dynamicss_append_) || !defined(_di_f_string_dynamicss_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
+
+#if !defined(_di_f_string_dynamicss_decrease_by_) || !defined(_di_f_string_dynamicss_increase_) || !defined(_di_f_string_dynamicss_increase_by_) || !defined(_di_f_string_dynamicss_append_all_) || !defined(_di_f_string_map_multis_append_all_)
+ f_status_t private_f_string_dynamicss_resize(const f_array_length_t length, f_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_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_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_string_dynamicss_decrease_by_) || !defined(_di_f_string_dynamicss_increase_) || !defined(_di_f_string_dynamicss_increase_by_) || !defined(_di_f_string_dynamicss_append_all_) || !defined(_di_f_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_string_dynamic_h
+#define _PRIVATE_F_string_dynamic_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation of f_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_string_append()
+ * @see f_string_append_assure()
+ * @see f_string_dynamic_append()
+ * @see f_string_dynamic_append_assure()
+ * @see f_string_dynamic_mash()
+ * @see f_string_dynamic_partial_append)
+ * @see f_string_dynamic_partial_append_assure()
+ * @see f_string_dynamic_partial_mash()
+ * @see f_string_dynamics_append()
+ * @see f_string_map_multis_append()
+ * @see f_string_mash()
+ * @see f_string_maps_append()
+ * @see f_string_triples_append()
+ */
+#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_mash_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_triples_append_)
+ extern f_status_t private_f_string_append(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_mash_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_triples_append_)
+
+/**
+ * Private implementation of f_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_string_append_assure_nulless()
+ * @see f_string_append_nulless()
+ * @see f_string_dynamic_append_assure_nulless()
+ * @see f_string_dynamic_append_nulless()
+ * @see f_string_dynamic_mash_nulless()
+ * @see f_string_dynamic_partial_append_assure_nulless()
+ * @see f_string_dynamic_partial_append_nulless()
+ * @see f_string_dynamic_partial_mash_nulless()
+ * @see f_string_mash_nulless()
+ */
+#if !defined(_di_f_string_append_assure_nulless_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_assure_nulless_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_string_dynamic_partial_append_nulless_) || !defined(_di_f_string_dynamic_partial_mash_nulless_) || !defined(_di_f_string_mash_nulless_)
+ extern f_status_t private_f_string_append_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_append_assure_nulless_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_assure_nulless_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_string_dynamic_partial_append_nulless_) || !defined(_di_f_string_dynamic_partial_mash_nulless_) || !defined(_di_f_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_string_dynamic_adjust()
+ * @see f_string_dynamic_decimate_by()
+ * @see f_string_dynamics_adjust()
+ * @see f_string_dynamics_append()
+ * @see f_string_dynamics_decimate_by()
+ * @see f_string_map_multis_adjust()
+ * @see f_string_map_multis_append()
+ * @see f_string_triples_adjust()
+ * @see f_string_triples_decimate_by()
+ */
+#if !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
+ extern f_status_t private_f_string_dynamic_adjust(const f_array_length_t length, f_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
+
+/**
+ * Private implementation of f_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_string_append()
+ * @see f_string_append_assure()
+ * @see f_string_append_mash()
+ * @see f_string_append_nulless()
+ * @see f_string_dynamic_append()
+ * @see f_string_dynamic_append_assure()
+ * @see f_string_dynamic_append_nulless()
+ * @see f_string_dynamic_increase_by()
+ * @see f_string_dynamic_mash()
+ * @see f_string_dynamic_mash_nulless()
+ * @see f_string_dynamic_partial_append)
+ * @see f_string_dynamic_partial_append_assure()
+ * @see f_string_dynamic_partial_mash()
+ * @see f_string_dynamic_prepend()
+ * @see f_string_dynamic_prepend_nulless()
+ * @see f_string_dynamics_append()
+ * @see f_string_map_multis_append()
+ * @see f_string_mash()
+ * @see f_string_mash_nulless()
+ * @see f_string_maps_append()
+ * @see f_string_prepend()
+ * @see f_string_prepend_nulless()
+ * @see f_string_triples_append()
+ */
+#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
+ extern f_status_t private_f_string_dynamic_increase_by(const f_array_length_t amount, f_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_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_string_append()
+ * @see f_string_append_assure()
+ * @see f_string_append_mash()
+ * @see f_string_append_nulless()
+ * @see f_string_dynamic_append()
+ * @see f_string_dynamic_append_assure()
+ * @see f_string_dynamic_append_nulless()
+ * @see f_string_dynamic_decrease_by()
+ * @see f_string_dynamic_increase()
+ * @see f_string_dynamic_increase_by()
+ * @see f_string_dynamic_mash()
+ * @see f_string_dynamic_mash_nulless()
+ * @see f_string_dynamic_partial_append)
+ * @see f_string_dynamic_partial_append_assure()
+ * @see f_string_dynamic_partial_mash()
+ * @see f_string_dynamic_prepend()
+ * @see f_string_dynamic_prepend_nulless()
+ * @see f_string_dynamic_terminate()
+ * @see f_string_dynamic_terminate_after()
+ * @see f_string_dynamics_append()
+ * @see f_string_map_multis_append()
+ * @see f_string_mash_nulless()
+ * @see f_string_mash()
+ * @see f_string_maps_append()
+ * @see f_string_prepend()
+ * @see f_string_prepend_nulless()
+ * @see f_string_triples_append()
+ */
+#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
+ extern f_status_t private_f_string_dynamic_resize(const f_array_length_t length, f_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_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_string_dynamics_adjust()
+ * @see f_string_dynamics_append()
+ * @see f_string_dynamics_decimate_by()
+ * @see f_string_map_multis_adjust()
+ * @see f_string_map_multis_append()
+ */
+#if !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
+ extern f_status_t private_f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t * const dynamics) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_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_string_dynamics_append()
+ * @see f_string_map_multis_append()
+ * @see f_string_map_multis_append_all()
+ */
+#if !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_)
+ extern f_status_t private_f_string_dynamics_append(const f_string_dynamic_t source, f_string_dynamics_t * const destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_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_string_dynamics_append_all()
+ * @see f_string_map_multis_append()
+ * @see f_string_map_multis_append_all()
+ */
+#if !defined(_di_f_string_dynamics_append_all_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_)
+ extern f_status_t private_f_string_dynamics_append_all(const f_string_dynamics_t source, f_string_dynamics_t * const destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_dynamics_append_all_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_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_string_dynamics_decrease_by()
+ * @see f_string_dynamics_increase()
+ * @see f_string_dynamics_increase_by()
+ */
+#if !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_)
+ extern f_status_t private_f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t * const dynamics) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_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_string_dynamicss_adjust()
+ * @see f_string_dynamicss_append()
+ * @see f_string_dynamicss_decimate_by()
+ * @see f_string_map_multis_adjust()
+ * @see f_string_map_multis_append()
+ */
+#if !defined(_di_f_string_dynamicss_adjust_) || !defined(_di_f_string_dynamicss_append_) || !defined(_di_f_string_dynamicss_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
+ extern f_status_t private_f_string_dynamicss_adjust(const f_array_length_t length, f_string_dynamicss_t * const dynamicss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_dynamicss_adjust_) || !defined(_di_f_string_dynamicss_append_) || !defined(_di_f_string_dynamicss_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_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_string_dynamicss_append_all()
+ * @see f_string_dynamicss_decrease_by()
+ * @see f_string_dynamicss_increase()
+ * @see f_string_dynamicss_increase_by()
+ * @see f_string_map_multis_append_all()
+ */
+#if !defined(_di_f_string_dynamicss_decrease_by_) || !defined(_di_f_string_dynamicss_increase_) || !defined(_di_f_string_dynamicss_increase_by_) || !defined(_di_f_string_dynamicss_append_all_) || !defined(_di_f_string_map_multis_append_all_)
+ extern f_status_t private_f_string_dynamicss_resize(const f_array_length_t length, f_string_dynamicss_t * const dynamicss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_dynamicss_decrease_by_) || !defined(_di_f_string_dynamicss_increase_) || !defined(_di_f_string_dynamicss_increase_by_) || !defined(_di_f_string_dynamicss_append_all_) || !defined(_di_f_string_map_multis_append_all_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_string_dynamic_h
--- /dev/null
+#include "../string.h"
+#include "../private-string.h"
+#include "private-dynamic.h"
+#include "private-map.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_string_maps_adjust_) || !defined(_di_f_string_maps_decimate_by_)
+ f_status_t private_f_string_maps_adjust(const f_array_length_t length, f_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_string_dynamic_adjust(0, &maps->array[i].name);
+ if (F_status_is_error(status)) return status;
+
+ status = private_f_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_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_string_maps_adjust_) || !defined(_di_f_string_maps_decimate_by_)
+
+#if !defined(_di_f_string_maps_append_all_) || !defined(_di_f_string_mapss_append_) || !defined(_di_f_string_mapss_append_all_)
+ f_status_t private_f_string_maps_append_all(const f_string_maps_t source, f_string_maps_t * const destination) {
+
+ f_status_t status = F_none;
+
+ if (destination->used + source.used > destination->size) {
+ status = private_f_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_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_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_string_maps_append_all_) || !defined(_di_f_string_mapss_append_) || !defined(_di_f_string_mapss_append_all_)
+
+#if !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_terminate_) || !defined(_di_f_string_maps_terminate_after_)
+ f_status_t private_f_string_maps_resize(const f_array_length_t length, f_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_string_dynamic_resize(0, &maps->array[i].name);
+ if (F_status_is_error(status)) return status;
+
+ status = private_f_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_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_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_terminate_) || !defined(_di_f_string_maps_terminate_after_)
+
+#if !defined(_di_f_string_mapss_adjust_) || !defined(_di_f_string_mapss_decimate_by_)
+ f_status_t private_f_string_mapss_adjust(const f_array_length_t length, f_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_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_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_string_mapss_adjust_) || !defined(_di_f_string_mapss_decimate_by_)
+
+#if !defined(_di_f_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_) || !defined(_di_f_string_mapss_terminate_) || !defined(_di_f_string_mapss_terminate_after_)
+ f_status_t private_f_string_mapss_resize(const f_array_length_t length, f_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_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_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_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_) || !defined(_di_f_string_mapss_terminate_) || !defined(_di_f_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_string_map_h
+#define _PRIVATE_F_string_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_string_maps_adjust()
+ */
+#if !defined(_di_f_string_maps_adjust_) || !defined(_di_f_string_maps_decimate_by_)
+ extern f_status_t private_f_string_maps_adjust(const f_array_length_t length, f_string_maps_t * const maps) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_maps_adjust_) || !defined(_di_f_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_string_maps_append_all()
+ * @see f_string_mapss_append()
+ * @see f_string_mapss_append_all()
+ */
+#if !defined(_di_f_string_maps_append_all_) || !defined(_di_f_string_mapss_append_) || !defined(_di_f_string_mapss_append_all_)
+ extern f_status_t private_f_string_maps_append_all(const f_string_maps_t source, f_string_maps_t * const destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_maps_append_all_) || !defined(_di_f_string_mapss_append_) || !defined(_di_f_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_string_maps_decrease_by()
+ * @see f_string_maps_increase()
+ * @see f_string_maps_increase_by()
+ * @see f_string_maps_terminate()
+ * @see f_string_maps_terminate_after()
+ */
+#if !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_terminate_) || !defined(_di_f_string_maps_terminate_after_)
+ extern f_status_t private_f_string_maps_resize(const f_array_length_t length, f_string_maps_t * const maps) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_terminate_) || !defined(_di_f_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_string_mapss_adjust()
+ */
+#if !defined(_di_f_string_mapss_adjust_) || !defined(_di_f_string_mapss_decimate_by_)
+ extern f_status_t private_f_string_mapss_adjust(const f_array_length_t length, f_string_mapss_t * const mapss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_mapss_adjust_) || !defined(_di_f_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_string_mapss_decrease_by()
+ * @see f_string_mapss_increase()
+ * @see f_string_mapss_increase_by()
+ * @see f_string_mapss_terminate()
+ * @see f_string_mapss_terminate_after()
+ */
+#if !defined(_di_f_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_) || !defined(_di_f_string_mapss_terminate_) || !defined(_di_f_string_mapss_terminate_after_)
+ extern f_status_t private_f_string_mapss_resize(const f_array_length_t length, f_string_mapss_t * const mapss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_mapss_decrease_by_) || !defined(_di_f_string_mapss_increase_) || !defined(_di_f_string_mapss_increase_by_) || !defined(_di_f_string_mapss_terminate_) || !defined(_di_f_string_mapss_terminate_after_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_string_map_h
--- /dev/null
+#include "../string.h"
+#include "../private-string.h"
+#include "private-dynamic.h"
+#include "private-map_multi.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_decimate_by_)
+ f_status_t private_f_string_map_multis_adjust(const f_array_length_t length, f_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_string_dynamic_adjust(0, &map_multis->array[i].name);
+ if (F_status_is_error(status)) return status;
+
+ status = private_f_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_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_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_decimate_by_)
+
+#if !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_)
+ f_status_t private_f_string_map_multis_append_all(const f_string_map_multis_t source, f_string_map_multis_t * const destination) {
+
+ f_status_t status = F_none;
+
+ if (destination->used + source.used > destination->size) {
+ status = private_f_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_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_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_string_map_multis_append_all_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_)
+
+#if !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_terminate_) || !defined(_di_f_string_map_multis_terminate_after_)
+ f_status_t private_f_string_map_multis_resize(const f_array_length_t length, f_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_string_dynamic_resize(0, &map_multis->array[i].name);
+ if (F_status_is_error(status)) return status;
+
+ status = private_f_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_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_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_terminate_) || !defined(_di_f_string_map_multis_terminate_after_)
+
+#if !defined(_di_f_string_map_multiss_adjust_) || !defined(_di_f_string_map_multiss_decimate_by_)
+ f_status_t private_f_string_map_multiss_adjust(const f_array_length_t length, f_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_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_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_string_map_multiss_adjust_) || !defined(_di_f_string_map_multiss_decimate_by_)
+
+#if !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_) || !defined(_di_f_string_map_multiss_terminate_) || !defined(_di_f_string_map_multiss_terminate_after_)
+ f_status_t private_f_string_map_multiss_resize(const f_array_length_t length, f_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_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_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_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_) || !defined(_di_f_string_map_multiss_terminate_) || !defined(_di_f_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_string_map_multi_h
+#define _PRIVATE_F_string_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_string_map_multis_adjust()
+ */
+#if !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_decimate_by_)
+ extern f_status_t private_f_string_map_multis_adjust(const f_array_length_t length, f_string_map_multis_t * const map_multis) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_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_string_map_multis_append_all()
+ * @see f_string_map_multiss_append()
+ * @see f_string_map_multiss_append_all()
+ */
+#if !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_)
+ extern f_status_t private_f_string_map_multis_append_all(const f_string_map_multis_t source, f_string_map_multis_t * const destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_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_string_map_multis_decrease_by()
+ * @see f_string_map_multis_increase()
+ * @see f_string_map_multis_increase_by()
+ * @see f_string_map_multis_terminate()
+ * @see f_string_map_multis_terminate_after()
+ */
+#if !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_terminate_) || !defined(_di_f_string_map_multis_terminate_after_)
+ extern f_status_t private_f_string_map_multis_resize(const f_array_length_t length, f_string_map_multis_t * const map_multis) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_terminate_) || !defined(_di_f_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_string_map_multiss_adjust()
+ */
+#if !defined(_di_f_string_map_multiss_adjust_) || !defined(_di_f_string_map_multiss_decimate_by_)
+ extern f_status_t private_f_string_map_multiss_adjust(const f_array_length_t length, f_string_map_multiss_t * const map_multiss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_map_multiss_adjust_) || !defined(_di_f_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_string_map_multiss_decrease_by()
+ * @see f_string_map_multiss_increase()
+ * @see f_string_map_multiss_increase_by()
+ * @see f_string_map_multiss_terminate()
+ * @see f_string_map_multiss_terminate_after()
+ */
+#if !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_) || !defined(_di_f_string_map_multiss_terminate_) || !defined(_di_f_string_map_multiss_terminate_after_)
+ extern f_status_t private_f_string_map_multiss_resize(const f_array_length_t length, f_string_map_multiss_t * const map_multiss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_) || !defined(_di_f_string_map_multiss_terminate_) || !defined(_di_f_string_map_multiss_terminate_after_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_string_map_multi_h
--- /dev/null
+#include "../string.h"
+#include "../private-string.h"
+#include "private-quantity.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_string_quantitys_adjust_) || !defined(_di_f_string_quantitys_decimate_by_)
+ f_status_t private_f_string_quantitys_adjust(const f_array_length_t length, f_string_quantitys_t * const quantitys) {
+
+ if (quantitys->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ const f_status_t status = f_memory_adjust(quantitys->size, length, sizeof(f_string_quantity_t), (void **) & quantitys->array);
+ if (F_status_is_error(status)) return status;
+
+ quantitys->size = length;
+
+ if (quantitys->used > quantitys->size) {
+ quantitys->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_string_quantitys_adjust_) || !defined(_di_f_string_quantitys_decimate_by_)
+
+#if !defined(_di_f_string_quantitys_append_all_) || !defined(_di_f_string_quantityss_append_) || !defined(_di_f_string_quantityss_append_all_)
+ f_status_t private_f_string_quantitys_append_all(const f_string_quantitys_t source, f_string_quantitys_t * const destination) {
+
+ if (destination->used + source.used > destination->size) {
+ const f_status_t status = private_f_string_quantitys_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->array[destination->used].start = source.array[i].start;
+ destination->array[destination->used++].total = source.array[i].total;
+ } // for
+
+ return F_none;
+ }
+#endif // !defined(_di_f_string_quantitys_append_all_) || !defined(_di_f_string_quantityss_append_) || !defined(_di_f_string_quantityss_append_all_)
+
+#if !defined(_di_f_string_quantitys_decrease_) || !defined(_di_f_string_quantitys_decrease_by_) || !defined(_di_f_string_quantitys_increase_) || !defined(_di_f_string_quantitys_increase_by_) || !defined(_di_f_string_quantitys_terminate_) || !defined(_di_f_string_quantitys_terminate_after_)
+ f_status_t private_f_string_quantitys_resize(const f_array_length_t length, f_string_quantitys_t * const quantitys) {
+
+ if (quantitys->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ const f_status_t status = f_memory_resize(quantitys->size, length, sizeof(f_string_quantity_t), (void **) & quantitys->array);
+ if (F_status_is_error(status)) return status;
+
+ quantitys->size = length;
+
+ if (quantitys->used > quantitys->size) {
+ quantitys->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_string_quantitys_decrease_) || !defined(_di_f_string_quantitys_decrease_by_) || !defined(_di_f_string_quantitys_increase_) || !defined(_di_f_string_quantitys_increase_by_) || !defined(_di_f_string_quantitys_terminate_) || !defined(_di_f_string_quantitys_terminate_after_)
+
+#if !defined(_di_f_string_quantityss_adjust_) || !defined(_di_f_string_quantityss_decimate_by_)
+ f_status_t private_f_string_quantityss_adjust(const f_array_length_t length, f_string_quantityss_t * const quantityss) {
+
+ if (quantityss->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 < quantityss->size; ++i) {
+
+ status = private_f_string_quantitys_adjust(0, &quantityss->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_adjust(quantityss->size, length, sizeof(f_string_quantitys_t), (void **) & quantityss->array);
+ if (F_status_is_error(status)) return status;
+
+ quantityss->size = length;
+
+ if (quantityss->used > quantityss->size) {
+ quantityss->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_string_quantityss_adjust_) || !defined(_di_f_string_quantityss_decimate_by_)
+
+#if !defined(_di_f_string_quantityss_decrease_) || !defined(_di_f_string_quantityss_decrease_by_) || !defined(_di_f_string_quantityss_increase_) || !defined(_di_f_string_quantityss_increase_by_) || !defined(_di_f_string_quantityss_terminate_) || !defined(_di_f_string_quantityss_terminate_after_)
+ f_status_t private_f_string_quantityss_resize(const f_array_length_t length, f_string_quantityss_t * const quantityss) {
+
+ if (quantityss->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 < quantityss->size; ++i) {
+
+ status = private_f_string_quantitys_resize(0, &quantityss->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_resize(quantityss->size, length, sizeof(f_string_quantitys_t), (void **) & quantityss->array);
+ if (F_status_is_error(status)) return status;
+
+ quantityss->size = length;
+
+ if (quantityss->used > quantityss->size) {
+ quantityss->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_string_quantityss_decrease_) || !defined(_di_f_string_quantityss_decrease_by_) || !defined(_di_f_string_quantityss_increase_) || !defined(_di_f_string_quantityss_increase_by_) || !defined(_di_f_string_quantityss_terminate_) || !defined(_di_f_string_quantityss_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_string_quantity_h
+#define _PRIVATE_F_string_quantity_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 quantitys
+ * The quantitys 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_string_quantitys_adjust()
+ */
+#if !defined(_di_f_string_quantitys_adjust_) || !defined(_di_f_string_quantitys_decimate_by_)
+ extern f_status_t private_f_string_quantitys_adjust(const f_array_length_t length, f_string_quantitys_t * const quantitys) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_quantitys_adjust_) || !defined(_di_f_string_quantitys_decimate_by_)
+
+/**
+ * Private implementation for appending.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source quantitys to append.
+ * @param destination
+ * The destination quantitys 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_string_quantitys_append_all()
+ * @see f_string_quantityss_append()
+ * @see f_string_quantityss_append_all()
+ */
+#if !defined(_di_f_string_quantitys_append_all_) || !defined(_di_f_string_quantityss_append_) || !defined(_di_f_string_quantityss_append_all_)
+ extern f_status_t private_f_string_quantitys_append_all(const f_string_quantitys_t source, f_string_quantitys_t * const destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_quantitys_append_all_) || !defined(_di_f_string_quantityss_append_) || !defined(_di_f_string_quantityss_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 quantitys
+ * The quantitys 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_string_quantitys_decrease_by()
+ * @see f_string_quantitys_increase()
+ * @see f_string_quantitys_increase_by()
+ * @see f_string_quantitys_terminate()
+ * @see f_string_quantitys_terminate_after()
+ */
+#if !defined(_di_f_string_quantitys_decrease_by_) || !defined(_di_f_string_quantitys_increase_) || !defined(_di_f_string_quantitys_increase_by_) || !defined(_di_f_string_quantitys_terminate_) || !defined(_di_f_string_quantitys_terminate_after_)
+ extern f_status_t private_f_string_quantitys_resize(const f_array_length_t length, f_string_quantitys_t * const quantitys) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_quantitys_decrease_by_) || !defined(_di_f_string_quantitys_increase_) || !defined(_di_f_string_quantitys_increase_by_) || !defined(_di_f_string_quantitys_terminate_) || !defined(_di_f_string_quantitys_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 quantityss
+ * The quantityss 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_string_quantityss_adjust()
+ */
+#if !defined(_di_f_string_quantityss_adjust_) || !defined(_di_f_string_quantityss_decimate_by_)
+ extern f_status_t private_f_string_quantityss_adjust(const f_array_length_t length, f_string_quantityss_t * const quantityss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_quantityss_adjust_) || !defined(_di_f_string_quantityss_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 quantityss
+ * The quantityss 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_string_quantityss_decrease_by()
+ * @see f_string_quantityss_increase()
+ * @see f_string_quantityss_increase_by()
+ * @see f_string_quantityss_terminate()
+ * @see f_string_quantityss_terminate_after()
+ */
+#if !defined(_di_f_string_quantityss_decrease_by_) || !defined(_di_f_string_quantityss_increase_) || !defined(_di_f_string_quantityss_increase_by_) || !defined(_di_f_string_quantityss_terminate_) || !defined(_di_f_string_quantityss_terminate_after_)
+ extern f_status_t private_f_string_quantityss_resize(const f_array_length_t length, f_string_quantityss_t * const quantityss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_quantityss_decrease_by_) || !defined(_di_f_string_quantityss_increase_) || !defined(_di_f_string_quantityss_increase_by_) || !defined(_di_f_string_quantityss_terminate_) || !defined(_di_f_string_quantityss_terminate_after_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_string_quantity_h
--- /dev/null
+#include "../string.h"
+#include "../private-string.h"
+#include "private-range.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_string_ranges_adjust_) || !defined(_di_f_string_ranges_decimate_by_)
+ f_status_t private_f_string_ranges_adjust(const f_array_length_t length, f_string_ranges_t * const ranges) {
+
+ if (ranges->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ const f_status_t status = f_memory_adjust(ranges->size, length, sizeof(f_string_range_t), (void **) & ranges->array);
+ if (F_status_is_error(status)) return status;
+
+ ranges->size = length;
+
+ if (ranges->used > ranges->size) {
+ ranges->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_string_ranges_adjust_) || !defined(_di_f_string_ranges_decimate_by_)
+
+#if !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_)
+ f_status_t private_f_string_ranges_append_all(const f_string_ranges_t source, f_string_ranges_t * const destination) {
+
+ if (destination->used + source.used > destination->size) {
+ const f_status_t status = private_f_string_ranges_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->array[destination->used].start = source.array[i].start;
+ destination->array[destination->used++].stop = source.array[i].stop;
+ } // for
+
+ return F_none;
+ }
+#endif // !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_)
+
+#if !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_terminate_) || !defined(_di_f_string_ranges_terminate_after_)
+ f_status_t private_f_string_ranges_resize(const f_array_length_t length, f_string_ranges_t * const ranges) {
+
+ if (ranges->used + length > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ const f_status_t status = f_memory_resize(ranges->size, length, sizeof(f_string_range_t), (void **) & ranges->array);
+ if (F_status_is_error(status)) return status;
+
+ ranges->size = length;
+
+ if (ranges->used > ranges->size) {
+ ranges->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_terminate_) || !defined(_di_f_string_ranges_terminate_after_)
+
+#if !defined(_di_f_string_rangess_adjust_) || !defined(_di_f_string_rangess_decimate_by_)
+ f_status_t private_f_string_rangess_adjust(const f_array_length_t length, f_string_rangess_t * const rangess) {
+
+ if (rangess->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 < rangess->size; ++i) {
+
+ status = private_f_string_ranges_adjust(0, &rangess->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_adjust(rangess->size, length, sizeof(f_string_ranges_t), (void **) & rangess->array);
+ if (F_status_is_error(status)) return status;
+
+ rangess->size = length;
+
+ if (rangess->used > rangess->size) {
+ rangess->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_string_rangess_adjust_) || !defined(_di_f_string_rangess_decimate_by_)
+
+#if !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_) || !defined(_di_f_string_rangess_terminate_) || !defined(_di_f_string_rangess_terminate_after_)
+ f_status_t private_f_string_rangess_resize(const f_array_length_t length, f_string_rangess_t * const rangess) {
+
+ if (rangess->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 < rangess->size; ++i) {
+
+ status = private_f_string_ranges_resize(0, &rangess->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
+
+ status = f_memory_resize(rangess->size, length, sizeof(f_string_ranges_t), (void **) & rangess->array);
+ if (F_status_is_error(status)) return status;
+
+ rangess->size = length;
+
+ if (rangess->used > rangess->size) {
+ rangess->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_) || !defined(_di_f_string_rangess_terminate_) || !defined(_di_f_string_rangess_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_string_range_h
+#define _PRIVATE_F_string_range_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 ranges
+ * The ranges 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_string_ranges_adjust()
+ */
+#if !defined(_di_f_string_ranges_adjust_) || !defined(_di_f_string_ranges_decimate_by_)
+ extern f_status_t private_f_string_ranges_adjust(const f_array_length_t length, f_string_ranges_t * const ranges) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_ranges_adjust_) || !defined(_di_f_string_ranges_decimate_by_)
+
+/**
+ * Private implementation for appending.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source ranges to append.
+ * @param destination
+ * The destination ranges 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_string_ranges_append_all()
+ * @see f_string_rangess_append()
+ * @see f_string_rangess_append_all()
+ */
+#if !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_append_all_)
+ extern f_status_t private_f_string_ranges_append_all(const f_string_ranges_t source, f_string_ranges_t * const destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_ranges_append_all_) || !defined(_di_f_string_rangess_append_) || !defined(_di_f_string_rangess_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 ranges
+ * The ranges 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_string_ranges_decrease_by()
+ * @see f_string_ranges_increase()
+ * @see f_string_ranges_increase_by()
+ * @see f_string_ranges_terminate()
+ * @see f_string_ranges_terminate_after()
+ */
+#if !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_terminate_) || !defined(_di_f_string_ranges_terminate_after_)
+ extern f_status_t private_f_string_ranges_resize(const f_array_length_t length, f_string_ranges_t * const ranges) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_ranges_decrease_by_) || !defined(_di_f_string_ranges_increase_) || !defined(_di_f_string_ranges_increase_by_) || !defined(_di_f_string_ranges_terminate_) || !defined(_di_f_string_ranges_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 rangess
+ * The rangess 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_string_rangess_adjust()
+ */
+#if !defined(_di_f_string_rangess_adjust_) || !defined(_di_f_string_rangess_decimate_by_)
+ extern f_status_t private_f_string_rangess_adjust(const f_array_length_t length, f_string_rangess_t * const rangess) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_rangess_adjust_) || !defined(_di_f_string_rangess_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 rangess
+ * The rangess 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_string_rangess_decrease_by()
+ * @see f_string_rangess_increase()
+ * @see f_string_rangess_increase_by()
+ * @see f_string_rangess_terminate()
+ * @see f_string_rangess_terminate_after()
+ */
+#if !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_) || !defined(_di_f_string_rangess_terminate_) || !defined(_di_f_string_rangess_terminate_after_)
+ extern f_status_t private_f_string_rangess_resize(const f_array_length_t length, f_string_rangess_t * const rangess) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_rangess_decrease_by_) || !defined(_di_f_string_rangess_increase_) || !defined(_di_f_string_rangess_increase_by_) || !defined(_di_f_string_rangess_terminate_) || !defined(_di_f_string_rangess_terminate_after_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_string_range_h
--- /dev/null
+#include "../string.h"
+#include "../private-string.h"
+#include "private-dynamic.h"
+#include "private-triple.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
+ f_status_t private_f_string_triples_adjust(const f_array_length_t length, f_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_string_dynamic_adjust(0, &triples->array[i].a);
+ if (F_status_is_error(status)) return status;
+
+ status = private_f_string_dynamic_adjust(0, &triples->array[i].b);
+ if (F_status_is_error(status)) return status;
+
+ status = private_f_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_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_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
+
+#if !defined(_di_f_string_triples_append_all_) || !defined(_di_f_string_tripless_append_) || !defined(_di_f_string_tripless_append_all_)
+ f_status_t private_f_string_triples_append_all(const f_string_triples_t source, f_string_triples_t * const destination) {
+
+ f_status_t status = F_none;
+
+ if (destination->used + source.used > destination->size) {
+ status = private_f_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_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_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_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_string_triples_append_all_) || !defined(_di_f_string_tripless_append_) || !defined(_di_f_string_tripless_append_all_)
+
+#if !defined(_di_f_string_triples_decrease_by_) || !defined(_di_f_string_triples_increase_) || !defined(_di_f_string_triples_increase_by_) || !defined(_di_f_string_triples_terminate_) || !defined(_di_f_string_triples_terminate_after_)
+ f_status_t private_f_string_triples_resize(const f_array_length_t length, f_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_string_dynamic_resize(0, &triples->array[i].a);
+ if (F_status_is_error(status)) return status;
+
+ status = private_f_string_dynamic_resize(0, &triples->array[i].b);
+ if (F_status_is_error(status)) return status;
+
+ status = private_f_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_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_string_triples_decrease_by_) || !defined(_di_f_string_triples_increase_) || !defined(_di_f_string_triples_increase_by_) || !defined(_di_f_string_triples_terminate_) || !defined(_di_f_string_triples_terminate_after_)
+
+#if !defined(_di_f_string_tripless_adjust_) || !defined(_di_f_string_tripless_decimate_by_)
+ f_status_t private_f_string_tripless_adjust(const f_array_length_t length, f_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_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_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_string_tripless_adjust_) || !defined(_di_f_string_tripless_decimate_by_)
+
+#if !defined(_di_f_string_tripless_decrease_by_) || !defined(_di_f_string_tripless_increase_) || !defined(_di_f_string_tripless_increase_by_) || !defined(_di_f_string_tripless_terminate_) || !defined(_di_f_string_tripless_terminate_after_)
+ f_status_t private_f_string_tripless_resize(const f_array_length_t length, f_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_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_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_string_tripless_decrease_by_) || !defined(_di_f_string_tripless_increase_) || !defined(_di_f_string_tripless_increase_by_) || !defined(_di_f_string_tripless_terminate_) || !defined(_di_f_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_string_triple_h
+#define _PRIVATE_F_string_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_string_triples_adjust()
+ */
+#if !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
+ extern f_status_t private_f_string_triples_adjust(const f_array_length_t length, f_string_triples_t * const triples) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_triples_adjust_) || !defined(_di_f_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_string_triples_append_all()
+ * @see f_string_tripless_append()
+ * @see f_string_tripless_append_all()
+ */
+#if !defined(_di_f_string_triples_append_all_) || !defined(_di_f_string_tripless_append_) || !defined(_di_f_string_tripless_append_all_)
+ extern f_status_t private_f_string_triples_append_all(const f_string_triples_t source, f_string_triples_t * const destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_triples_append_all_) || !defined(_di_f_string_tripless_append_) || !defined(_di_f_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_string_triples_decrease_by()
+ * @see f_string_triples_increase()
+ * @see f_string_triples_increase_by()
+ * @see f_string_triples_terminate()
+ * @see f_string_triples_terminate_after()
+ */
+#if !defined(_di_f_string_triples_decrease_by_) || !defined(_di_f_string_triples_increase_) || !defined(_di_f_string_triples_increase_by_) || !defined(_di_f_string_triples_terminate_) || !defined(_di_f_string_triples_terminate_after_)
+ extern f_status_t private_f_string_triples_resize(const f_array_length_t length, f_string_triples_t * const triples) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_triples_decrease_by_) || !defined(_di_f_string_triples_increase_) || !defined(_di_f_string_triples_increase_by_) || !defined(_di_f_string_triples_terminate_) || !defined(_di_f_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_string_tripless_adjust()
+ */
+#if !defined(_di_f_string_tripless_adjust_) || !defined(_di_f_string_tripless_decimate_by_)
+ extern f_status_t private_f_string_tripless_adjust(const f_array_length_t length, f_string_tripless_t * const tripless) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_tripless_adjust_) || !defined(_di_f_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_string_tripless_decrease_by()
+ * @see f_string_tripless_increase()
+ * @see f_string_tripless_increase_by()
+ * @see f_string_tripless_terminate()
+ * @see f_string_tripless_terminate_after()
+ */
+#if !defined(_di_f_string_tripless_decrease_by_) || !defined(_di_f_string_tripless_increase_) || !defined(_di_f_string_tripless_increase_by_) || !defined(_di_f_string_tripless_terminate_) || !defined(_di_f_string_tripless_terminate_after_)
+ extern f_status_t private_f_string_tripless_resize(const f_array_length_t length, f_string_tripless_t * const tripless) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_string_tripless_decrease_by_) || !defined(_di_f_string_tripless_increase_) || !defined(_di_f_string_tripless_increase_by_) || !defined(_di_f_string_tripless_terminate_) || !defined(_di_f_string_tripless_terminate_after_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_string_triple_h
#include "../string.h"
#include "../private-string.h"
+#include "private-quantity.h"
#ifdef __cplusplus
extern "C" {
#endif // _di_f_string_quantitys_adjust_
#ifndef _di_f_string_quantitys_append_
- f_status_t f_string_quantitys_append(const f_string_quantitys_t source, f_string_quantitys_t * const destination) {
+ f_status_t f_string_quantitys_append(const f_string_quantity_t source, f_string_quantitys_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_string_quantitys_adjust(destination->used + source.used, destination);
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_string_quantitys_adjust(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].start = source.array[i].start;
- destination->array[destination->used].total = source.array[i].total;
- } // for
+ destination->array[destination->used].start = source.start;
+ destination->array[destination->used++].total = source.total;
return F_none;
}
#endif // _di_f_string_quantitys_append_
+#ifndef _di_f_string_quantitys_append_all_
+ f_status_t f_string_quantitys_append_all(const f_string_quantitys_t source, f_string_quantitys_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_string_quantitys_append_all(source, destination);
+ }
+#endif // _di_f_string_quantitys_append_all_
+
#ifndef _di_f_string_quantitys_decimate_by_
f_status_t f_string_quantitys_decimate_by(const f_array_length_t amount, f_string_quantitys_t * const quantitys) {
#ifndef _di_level_0_parameter_checking_
if (!quantitys) 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 (quantitys->size - amount > 0) {
return private_f_string_quantitys_adjust(quantitys->size - amount, quantitys);
if (!quantitys) 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 (quantitys->size - amount > 0) {
return private_f_string_quantitys_resize(quantitys->size - amount, quantitys);
if (!quantitys) 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 (quantitys->used + amount > quantitys->size) {
if (quantitys->used + amount > F_array_length_t_size_d) {
}
#endif // _di_f_string_quantityss_adjust_
+#ifndef _di_f_string_quantityss_append_
+ f_status_t f_string_quantityss_append(const f_string_quantitys_t source, f_string_quantityss_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_string_quantityss_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_string_quantitys_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_string_quantityss_append_
+
+#ifndef _di_f_string_quantityss_append_all_
+ f_status_t f_string_quantityss_append_all(const f_string_quantityss_t source, f_string_quantityss_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_string_quantityss_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_string_quantitys_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+
+ return F_none;
+ }
+#endif // _di_f_string_quantityss_append_all_
+
#ifndef _di_f_string_quantityss_decimate_by_
f_status_t f_string_quantityss_decimate_by(const f_array_length_t amount, f_string_quantityss_t * const quantityss) {
#ifndef _di_level_0_parameter_checking_
if (!quantityss) 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 (quantityss->size - amount > 0) {
return private_f_string_quantityss_adjust(quantityss->size - amount, quantityss);
if (!quantityss) 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 (quantityss->size - amount > 0) {
return private_f_string_quantityss_resize(quantityss->size - amount, quantityss);
if (!quantityss) 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 (quantityss->used + amount > quantityss->size) {
if (quantityss->used + amount > F_array_length_t_size_d) {
#endif // _di_f_string_quantitys_adjust_
/**
- * Append the source quantitys onto the destination.
+ * Append the single source quantity onto the destination.
*
* @param source
- * The source quantitys to append.
+ * The source quantity to append.
* @param destination
* The destination quantitys the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_quantitys_append_
- extern f_status_t f_string_quantitys_append(const f_string_quantitys_t source, f_string_quantitys_t * const destination);
+ extern f_status_t f_string_quantitys_append(const f_string_quantity_t source, f_string_quantitys_t * const destination);
#endif // _di_f_string_quantitys_append_
/**
+ * Append the source quantitys onto the destination.
+ *
+ * @param source
+ * The source quantitys to append.
+ * @param destination
+ * The destination quantitys 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_string_quantitys_append_all_
+ extern f_status_t f_string_quantitys_append_all(const f_string_quantitys_t source, f_string_quantitys_t * const destination);
+#endif // _di_f_string_quantitys_append_all_
+
+/**
* Resize the string quantitys array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
#endif // _di_f_string_quantityss_adjust_
/**
+ * Append the single source quantitys onto the destination.
+ *
+ * @param source
+ * The source quantitys to append.
+ * @param destination
+ * The destination quantityss 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_string_quantityss_append_
+ extern f_status_t f_string_quantityss_append(const f_string_quantitys_t source, f_string_quantityss_t * const destination);
+#endif // _di_f_string_quantityss_append_
+
+/**
+ * Append the source quantityss onto the destination.
+ *
+ * @param source
+ * The source quantityss to append.
+ * @param destination
+ * The destination quantityss 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_string_quantityss_append_all_
+ extern f_status_t f_string_quantityss_append_all(const f_string_quantityss_t source, f_string_quantityss_t * const destination);
+#endif // _di_f_string_quantityss_append_all_
+
+/**
* Resize the string quantityss array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
#include "../string.h"
#include "../private-string.h"
+#include "private-range.h"
#ifdef __cplusplus
extern "C" {
#endif // _di_f_string_ranges_adjust_
#ifndef _di_f_string_ranges_append_
- f_status_t f_string_ranges_append(const f_string_ranges_t source, f_string_ranges_t * const destination) {
+ f_status_t f_string_ranges_append(const f_string_range_t source, f_string_ranges_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;
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_string_ranges_adjust(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
}
- f_status_t status = F_none;
+ destination->array[destination->used].start = source.start;
+ destination->array[destination->used++].stop = source.stop;
+
+ return F_none;
+ }
+#endif // _di_f_string_ranges_append_
+
+#ifndef _di_f_string_ranges_append_all_
+ f_status_t f_string_ranges_append_all(const f_string_ranges_t source, f_string_ranges_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;
if (destination->used + source.used > destination->size) {
- status = private_f_string_ranges_adjust(destination->used + source.used, destination);
+ const f_status_t status = private_f_string_ranges_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) {
+ for (f_array_length_t i = 0; i < source.used; ++i) {
destination->array[destination->used].start = source.array[i].start;
- destination->array[destination->used].stop = source.array[i].stop;
+ destination->array[destination->used++].stop = source.array[i].stop;
} // for
return F_none;
}
-#endif // _di_f_string_ranges_append_
+#endif // _di_f_string_ranges_append_all_
#ifndef _di_f_string_ranges_decimate_by_
f_status_t f_string_ranges_decimate_by(const f_array_length_t amount, f_string_ranges_t * const ranges) {
if (!ranges) 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 (ranges->size - amount > 0) {
return private_f_string_ranges_adjust(ranges->size - amount, ranges);
if (!ranges) 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 (ranges->size - amount > 0) {
return private_f_string_ranges_resize(ranges->size - amount, ranges);
if (!ranges) 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 (ranges->used + amount > ranges->size) {
if (ranges->used + amount > F_array_length_t_size_d) {
}
#endif // _di_f_string_rangess_adjust_
+#ifndef _di_f_string_rangess_append_
+ f_status_t f_string_rangess_append(const f_string_ranges_t source, f_string_rangess_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_string_rangess_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_string_ranges_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_string_rangess_append_
+
+#ifndef _di_f_string_rangess_append_all_
+ f_status_t f_string_rangess_append_all(const f_string_rangess_t source, f_string_rangess_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_string_rangess_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_string_ranges_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+
+ return F_none;
+ }
+#endif // _di_f_string_rangess_append_all_
+
#ifndef _di_f_string_rangess_decimate_by_
f_status_t f_string_rangess_decimate_by(const f_array_length_t amount, f_string_rangess_t * const rangess) {
#ifndef _di_level_0_parameter_checking_
if (!rangess) 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 (rangess->size - amount > 0) {
return private_f_string_rangess_adjust(rangess->size - amount, rangess);
if (!rangess) 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 (rangess->size - amount > 0) {
return private_f_string_rangess_resize(rangess->size - amount, rangess);
if (!rangess) 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 (rangess->used + amount > rangess->size) {
if (rangess->used + amount > F_array_length_t_size_d) {
#define f_string_range_t_initialize { 1, 0 }
- #define macro_f_string_range_t_initialize(length) { length ? 0 : 1, length ? length - 1 : 0 }
- #define macro_f_string_range_t_initialize2(start, stop) { start, stop }
+ #define macro_f_string_range_t_initialize(start, stop) { start, stop }
+ #define macro_f_string_range_t_initialize2(length) { length ? 0 : 1, length ? length - 1 : 0 }
#define macro_f_string_range_t_clear(range) \
range.start = 1; \
#endif // _di_f_string_ranges_adjust_
/**
- * Append the source ranges onto the destination.
+ * Append the single source range onto the destination.
*
* @param source
- * The source ranges to append.
+ * The source range to append.
* @param destination
* The destination ranges the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_ranges_append_
- extern f_status_t f_string_ranges_append(const f_string_ranges_t source, f_string_ranges_t * const destination);
+ extern f_status_t f_string_ranges_append(const f_string_range_t source, f_string_ranges_t * const destination);
#endif // _di_f_string_ranges_append_
/**
+ * Append the source ranges onto the destination.
+ *
+ * @param source
+ * The source ranges to append.
+ * @param destination
+ * The destination ranges 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_string_ranges_append_all_
+ extern f_status_t f_string_ranges_append_all(const f_string_ranges_t source, f_string_ranges_t * const destination);
+#endif // _di_f_string_ranges_append_all_
+
+/**
* Resize the string ranges array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
#endif // _di_f_string_rangess_adjust_
/**
+ * Append the single source ranges onto the destination.
+ *
+ * @param source
+ * The source ranges to append.
+ * @param destination
+ * The destination rangess 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_string_rangess_append_
+ extern f_status_t f_string_rangess_append(const f_string_ranges_t source, f_string_rangess_t * const destination);
+#endif // _di_f_string_rangess_append_
+
+/**
+ * Append the source rangess onto the destination.
+ *
+ * @param source
+ * The source rangess to append.
+ * @param destination
+ * The destination rangess 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_string_rangess_append_all_
+ extern f_status_t f_string_rangess_append_all(const f_string_rangess_t source, f_string_rangess_t * const destination);
+#endif // _di_f_string_rangess_append_all_
+
+/**
* Resize the string rangess array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
#include "../string.h"
#include "../private-string.h"
+#include "private-triple.h"
#ifdef __cplusplus
extern "C" {
#endif // _di_f_string_triples_adjust_
#ifndef _di_f_string_triples_append_
- f_status_t f_string_triples_append(const f_string_triples_t source, f_string_triples_t * const destination) {
+ f_status_t f_string_triples_append(const f_string_triple_t source, f_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_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_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_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_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_string_triples_append_
+
+#ifndef _di_f_string_triples_append_all_
+ f_status_t f_string_triples_append_all(const f_string_triples_t source, f_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_string_triples_append_
+#endif // _di_f_string_triples_append_all_
#ifndef _di_f_string_triples_decimate_by_
f_status_t f_string_triples_decimate_by(const f_array_length_t amount, f_string_triples_t * const triples) {
#ifndef _di_level_0_parameter_checking_
- if (!amount) return F_status_set_error(F_parameter);
if (!triples) return F_status_set_error(F_parameter);
#endif // _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_string_triples_resize(triples->size - amount, triples);
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_string_triples_resize_
+#ifndef _di_f_string_tripless_append_
+ f_status_t f_string_tripless_append(const f_string_triples_t source, f_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_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_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_string_tripless_append_
+
+#ifndef _di_f_string_tripless_append_all_
+ f_status_t f_string_tripless_append_all(const f_string_tripless_t source, f_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_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_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_string_tripless_append_all_
+
#ifndef _di_f_string_tripless_adjust_
f_status_t f_string_tripless_adjust(const f_array_length_t length, f_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 (!amount) return F_data_not;
if (tripless->size - amount > 0) {
return private_f_string_tripless_adjust(tripless->size - amount, tripless);
if (!tripless) 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 (tripless->size - amount > 0) {
return private_f_string_tripless_resize(tripless->size - amount, tripless);
if (!tripless) 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 (tripless->used + amount > tripless->size) {
if (tripless->used + amount > F_array_length_t_size_d) {
#endif // _di_f_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_string_triples_append_
- extern f_status_t f_string_triples_append(const f_string_triples_t source, f_string_triples_t * const destination);
+ extern f_status_t f_string_triples_append(const f_string_triple_t source, f_string_triples_t * const destination);
#endif // _di_f_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_string_triples_append_all_
+ extern f_status_t f_string_triples_append_all(const f_string_triples_t source, f_string_triples_t * const destination);
+#endif // _di_f_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).
#endif // _di_f_string_tripless_adjust_
/**
- * Append the source tripless onto the destination.
+ * Append the single source triples onto the destination.
*
* @param source
- * The source tripless to append.
+ * The source triples to append.
* @param destination
* The destination tripless the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_tripless_append_
- extern f_status_t f_string_tripless_append(const f_string_tripless_t source, f_string_tripless_t * const destination);
+ extern f_status_t f_string_tripless_append(const f_string_triples_t source, f_string_tripless_t * const destination);
#endif // _di_f_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_string_tripless_append_all_
+ extern f_status_t f_string_tripless_append_all(const f_string_tripless_t source, f_string_tripless_t * const destination);
+#endif // _di_f_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).
build_objects_program
build_objects_program_shared
build_objects_program_static
-build_sources_library string.c private-string.c string/common.c string/dynamic.c string/map.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/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_shared
build_sources_library_static
build_sources_object
build_sources_program
build_sources_program_shared
build_sources_program_static
-build_sources_headers string.h string/common.h string/dynamic.h string/map.h string/quantity.h string/range.h string/static.h string/triple.h
+build_sources_headers string.h string/common.h string/dynamic.h string/map.h string/map_multi.h string/quantity.h string/range.h string/static.h string/triple.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+# fss-0001
+
+build_name test-f_string
+
+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
+build_libraries-level -lfll_0
+build_libraries-monolithic -lfll
+build_sources_program test-string-dynamics_adjust.c test-string-dynamics_append.c test-string-dynamics_append_all.c test-string-dynamics_decimate_by.c test-string-dynamics_decrease_by.c test-string-dynamics_increase.c test-string-dynamics_increase_by.c test-string-dynamics_resize.c test-string-dynamicss_adjust.c test-string-dynamicss_append.c test-string-dynamicss_append_all.c test-string-dynamicss_decimate_by.c test-string-dynamicss_decrease_by.c test-string-dynamicss_increase.c test-string-dynamicss_increase_by.c test-string-dynamicss_resize.c
+build_sources_program test-string-maps_adjust.c test-string-maps_append.c test-string-maps_append_all.c test-string-maps_decimate_by.c test-string-maps_decrease_by.c test-string-maps_increase.c test-string-maps_increase_by.c test-string-maps_resize.c test-string-mapss_adjust.c test-string-mapss_append.c test-string-mapss_append_all.c test-string-mapss_decimate_by.c test-string-mapss_decrease_by.c test-string-mapss_increase.c test-string-mapss_increase_by.c test-string-mapss_resize.c
+build_sources_program test-string-map_multis_adjust.c test-string-map_multis_append.c test-string-map_multis_append_all.c test-string-map_multis_decimate_by.c test-string-map_multis_decrease_by.c test-string-map_multis_increase.c test-string-map_multis_increase_by.c test-string-map_multis_resize.c test-string-map_multiss_adjust.c test-string-map_multiss_append.c test-string-map_multiss_append_all.c test-string-map_multiss_decimate_by.c test-string-map_multiss_decrease_by.c test-string-map_multiss_increase.c test-string-map_multiss_increase_by.c test-string-map_multiss_resize.c
+build_sources_program test-string-quantitys_adjust.c test-string-quantitys_append.c test-string-quantitys_append_all.c test-string-quantitys_decimate_by.c test-string-quantitys_decrease_by.c test-string-quantitys_increase.c test-string-quantitys_increase_by.c test-string-quantitys_resize.c test-string-quantityss_adjust.c test-string-quantityss_append.c test-string-quantityss_append_all.c test-string-quantityss_decimate_by.c test-string-quantityss_decrease_by.c test-string-quantityss_increase.c test-string-quantityss_increase_by.c test-string-quantityss_resize.c
+build_sources_program test-string-ranges_adjust.c test-string-ranges_append.c test-string-ranges_append_all.c test-string-ranges_decimate_by.c test-string-ranges_decrease_by.c test-string-ranges_increase.c test-string-ranges_increase_by.c test-string-ranges_resize.c test-string-rangess_adjust.c test-string-rangess_append.c test-string-rangess_append_all.c test-string-rangess_decimate_by.c test-string-rangess_decrease_by.c test-string-rangess_increase.c test-string-rangess_increase_by.c test-string-rangess_resize.c
+build_sources_program test-string-triples_adjust.c test-string-triples_append.c test-string-triples_append_all.c test-string-triples_decimate_by.c test-string-triples_decrease_by.c test-string-triples_increase.c test-string-triples_increase_by.c test-string-triples_resize.c test-string-tripless_adjust.c test-string-tripless_append.c test-string-tripless_append_all.c test-string-tripless_decimate_by.c test-string-tripless_decrease_by.c test-string-tripless_increase.c test-string-tripless_increase_by.c test-string-tripless_resize.c
+build_sources_program test-string.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_string
+ shell build/programs/shared/test-f_string
+
+ if exists build/programs/static/test-f_string
+ shell build/programs/static/test-f_string
+
+ if not exists build/programs/shared/test-f_string
+ and not exists build/programs/static/test-f_string
+ 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-string.h"
+#include "test-string-dynamics_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamics_adjust__works(void **state) {
+
+ const int length = 5;
+ f_string_dynamics_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_dynamics_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_dynamics_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_string__string_dynamics_adjust
+#define _TEST__F_string__string_dynamics_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamics_adjust()
+ */
+extern void test__f_string_dynamics_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamics_adjust()
+ */
+extern void test__f_string_dynamics_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_string__string_dynamics_adjust
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamics_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamics_append__works(void **state) {
+
+ const f_string_static_t source = macro_f_string_static_t_initialize("test", 0, 4);
+ f_string_dynamics_t destination = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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);
+ }
+
+ free((void *) destination.array[0].string);
+ free((void *) destination.array);
+}
+
+void test__f_string_dynamics_append__parameter_checking(void **state) {
+
+ const f_string_dynamic_t data = f_string_dynamic_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_dynamics_append_h
+#define _TEST__F_string_dynamics_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamics_append()
+ */
+extern void test__f_string_dynamics_append__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamics_append()
+ */
+extern void test__f_string_dynamics_append__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamics_append_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamics_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamics_append_all__works(void **state) {
+
+ const int length_inner = 2;
+ f_string_dynamics_t source = f_string_dynamics_t_initialize;
+ f_string_dynamics_t destination = f_string_dynamics_t_initialize;
+
+ const f_string_static_t test_sources[] = {
+ macro_f_string_static_t_initialize("test1", 0, 5),
+ macro_f_string_static_t_initialize("test2", 0, 5),
+ };
+
+ {
+ f_status_t status = f_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_string_dynamic_append(test_sources[source.used], &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+ assert_string_equal(source.array[source.used].string, test_sources[source.used].string);
+ assert_int_equal(source.array[source.used].used, test_sources[source.used].used);
+ } // for
+ }
+
+ {
+ const f_status_t status = f_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_string_dynamics_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_dynamics_t source = f_string_dynamics_t_initialize;
+ f_string_dynamics_t destination = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_dynamics_append_all__parameter_checking(void **state) {
+
+ const f_string_dynamics_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_dynamics_append_all_h
+#define _TEST__F_string_dynamics_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamics_append_all()
+ */
+extern void test__f_string_dynamics_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_dynamics_append_all()
+ */
+extern void test__f_string_dynamics_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamics_append_all()
+ */
+extern void test__f_string_dynamics_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamics_append_all_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamics_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamics_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_string_dynamics_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_dynamics_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_dynamics_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_dynamics_decimate_by()
+ */
+extern void test__f_string_dynamics_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamics_decimate_by()
+ */
+extern void test__f_string_dynamics_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_dynamics_decimate_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamics_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamics_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_string_dynamics_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_dynamics_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_dynamics_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_dynamics_decrease_by_h
+#define _TEST__F_string_dynamics_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamics_decrease_by()
+ */
+extern void test__f_string_dynamics_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamics_decrease_by()
+ */
+extern void test__f_string_dynamics_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamics_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamics_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamics_increase__works(void **state) {
+
+ const int length = 5;
+ f_string_dynamics_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_dynamics_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_dynamics_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_dynamics_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_dynamics_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_dynamics_increase_h
+#define _TEST__F_string_dynamics_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamics_increase()
+ */
+extern void test__f_string_dynamics_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_dynamics_increase()
+ */
+extern void test__f_string_dynamics_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamics_increase()
+ */
+extern void test__f_string_dynamics_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamics_increase_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamics_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamics_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_string_dynamics_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_dynamics_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_dynamics_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_dynamics_increase_by_h
+#define _TEST__F_string_dynamics_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamics_increase_by()
+ */
+extern void test__f_string_dynamics_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamics_increase_by()
+ */
+extern void test__f_string_dynamics_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamics_increase_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamics_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamics_resize__works(void **state) {
+
+ const int length = 5;
+ f_string_dynamics_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_dynamics_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_dynamics_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_dynamics_resize_h
+#define _TEST__F_string_dynamics_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamics_resize()
+ */
+extern void test__f_string_dynamics_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamics_resize()
+ */
+extern void test__f_string_dynamics_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamics_resize_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamicss_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamicss_adjust__works(void **state) {
+
+ const int length = 5;
+ f_string_dynamicss_t data = f_string_dynamicss_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_dynamicss_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_dynamicss_t data = f_string_dynamicss_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_dynamicss_adjust_h
+#define _TEST__F_string_dynamicss_adjust_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamicss_adjust()
+ */
+extern void test__f_string_dynamicss_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamicss_adjust()
+ */
+extern void test__f_string_dynamicss_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamicss_adjust_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamicss_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamicss_append__works(void **state) {
+
+ const int length_inner = 2;
+ f_string_dynamics_t source = f_string_dynamics_t_initialize;
+ f_string_dynamicss_t destination = f_string_dynamicss_t_initialize;
+
+ const f_string_static_t test_names[] = {
+ macro_f_string_static_t_initialize("test1", 0, 5),
+ macro_f_string_static_t_initialize("test2", 0, 5),
+ };
+
+ {
+ f_status_t status = f_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_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_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_string_dynamicss_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_dynamics_t source = f_string_dynamicss_t_initialize;
+ f_string_dynamicss_t destination = f_string_dynamicss_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_dynamicss_append__parameter_checking(void **state) {
+
+ f_string_dynamics_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_dynamicss_append_h
+#define _TEST__F_string_dynamicss_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamicss_append()
+ */
+extern void test__f_string_dynamicss_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_dynamicss_append()
+ */
+extern void test__f_string_dynamicss_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamicss_append()
+ */
+extern void test__f_string_dynamicss_append__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamicss_append_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamicss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamicss_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ const int length_outer = 2;
+ f_string_dynamicss_t source = f_string_dynamicss_t_initialize;
+ f_string_dynamicss_t destination = f_string_dynamicss_t_initialize;
+
+ const f_string_static_t test_names[] = {
+ macro_f_string_static_t_initialize("test1", 0, 5),
+ macro_f_string_static_t_initialize("test2", 0, 5),
+ };
+
+ {
+ f_status_t status = f_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_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_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_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_string_dynamicss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_dynamicss_t source = f_string_dynamicss_t_initialize;
+ f_string_dynamicss_t destination = f_string_dynamicss_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_dynamicss_append_all__parameter_checking(void **state) {
+
+ const f_string_dynamicss_t data = f_string_dynamicss_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_dynamicss_append_all_h
+#define _TEST__F_string_dynamicss_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamicss_append_all()
+ */
+extern void test__f_string_dynamicss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_dynamicss_append_all()
+ */
+extern void test__f_string_dynamicss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamicss_append_all()
+ */
+extern void test__f_string_dynamicss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamicss_append_all_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamicss_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamicss_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_string_dynamicss_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_dynamicss_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_dynamicss_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_dynamicss_decimate_by_h
+#define _TEST__F_string_dynamicss_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamicss_decimate_by()
+ */
+extern void test__f_string_dynamicss_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamicss_decimate_by()
+ */
+extern void test__f_string_dynamicss_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamicss_decimate_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamicss_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamicss_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_string_dynamicss_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_dynamicss_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_dynamicss_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_dynamicss_decrease_by_h
+#define _TEST__F_string_dynamicss_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamicss_decrease_by()
+ */
+extern void test__f_string_dynamicss_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamicss_decrease_by()
+ */
+extern void test__f_string_dynamicss_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamicss_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamicss_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamicss_increase__works(void **state) {
+
+ const int length = 5;
+ f_string_dynamicss_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_dynamicss_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_dynamicss_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_dynamicss_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_dynamicss_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_dynamicss_increase_h
+#define _TEST__F_string_dynamicss_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamicss_increase()
+ */
+extern void test__f_string_dynamicss_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_dynamicss_increase()
+ */
+extern void test__f_string_dynamicss_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamicss_increase()
+ */
+extern void test__f_string_dynamicss_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamicss_increase_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamicss_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamicss_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_string_dynamicss_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_dynamicss_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_dynamicss_t data = f_string_dynamics_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_dynamicss_increase_by_h
+#define _TEST__F_string_dynamicss_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamicss_increase_by()
+ */
+extern void test__f_string_dynamicss_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamicss_increase_by()
+ */
+extern void test__f_string_dynamicss_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamicss_increase_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-dynamicss_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_dynamicss_resize__works(void **state) {
+
+ const int length = 5;
+ f_string_dynamicss_t data = f_string_dynamicss_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_dynamicss_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_dynamicss_t data = f_string_dynamicss_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_dynamicss_resize_h
+#define _TEST__F_string_dynamicss_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_dynamicss_resize()
+ */
+extern void test__f_string_dynamicss_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_dynamicss_resize()
+ */
+extern void test__f_string_dynamicss_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_string_dynamicss_resize_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multis_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_map_multis_adjust__works(void **state) {
+
+ const int length = 5;
+ f_string_map_multis_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_map_multis_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_map_multis_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_string__string_map_multis_adjust
+#define _TEST__F_string__string_map_multis_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_map_multis_adjust()
+ */
+extern void test__f_string_map_multis_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_map_multis_adjust()
+ */
+extern void test__f_string_map_multis_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_string__string_map_multis_adjust
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multis_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_map_multis_append__works(void **state) {
+
+ const int length_values = 2;
+ f_string_map_multi_t source = f_string_map_multi_t_initialize;
+ f_string_map_multis_t destination = f_string_map_multis_t_initialize;
+
+ f_string_static_t test_value_array[] = {
+ macro_f_string_static_t_initialize("test_value1", 0, 11),
+ macro_f_string_static_t_initialize("test_value2", 0, 11),
+ };
+
+ const f_string_static_t test_name = macro_f_string_static_t_initialize("test_name", 0, 9);
+ const f_string_statics_t test_value = macro_f_string_statics_t_initialize(test_value_array, 0, length_values);
+
+ {
+ f_status_t status = f_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_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_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_string_map_multis_append__parameter_checking(void **state) {
+
+ const f_string_map_multi_t data = f_string_map_multi_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_map_multis_append_h
+#define _TEST__F_string_map_multis_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_map_multis_append()
+ */
+extern void test__f_string_map_multis_append__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_map_multis_append()
+ */
+extern void test__f_string_map_multis_append__parameter_checking(void **state);
+
+#endif // _TEST__F_string_map_multis_append_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multis_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_map_multis_append_all__works(void **state) {
+
+ const int length_values = 2;
+ const int length_inner = 2;
+ f_string_map_multis_t source = f_string_map_multis_t_initialize;
+ f_string_map_multis_t destination = f_string_map_multis_t_initialize;
+
+ f_string_static_t test_value_array[] = {
+ macro_f_string_static_t_initialize("test_value1", 0, 11),
+ macro_f_string_static_t_initialize("test_value2", 0, 11),
+ };
+
+ const f_string_static_t test_name = macro_f_string_static_t_initialize("test_name", 0, 9);
+ const f_string_statics_t test_value = macro_f_string_statics_t_initialize(test_value_array, 0, length_values);
+
+ {
+ f_status_t status = f_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_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_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_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_string_map_multis_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_map_multis_t source = f_string_map_multis_t_initialize;
+ f_string_map_multis_t destination = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_map_multis_append_all__parameter_checking(void **state) {
+
+ const f_string_map_multis_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_map_multis_append_all_h
+#define _TEST__F_string_map_multis_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_map_multis_append_all()
+ */
+extern void test__f_string_map_multis_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_map_multis_append_all()
+ */
+extern void test__f_string_map_multis_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_map_multis_append_all()
+ */
+extern void test__f_string_map_multis_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_string_map_multis_append_all_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multis_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_map_multis_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_string_map_multis_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_map_multis_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_map_multis_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_map_multis_decimate_by()
+ */
+extern void test__f_string_map_multis_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_map_multis_decimate_by()
+ */
+extern void test__f_string_map_multis_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_map_multis_decimate_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multis_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_map_multis_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_string_map_multis_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_map_multis_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_map_multis_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_map_multis_decrease_by_h
+#define _TEST__F_string_map_multis_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_map_multis_decrease_by()
+ */
+extern void test__f_string_map_multis_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_map_multis_decrease_by()
+ */
+extern void test__f_string_map_multis_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_map_multis_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multis_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_map_multis_increase__works(void **state) {
+
+ const int length = 5;
+ f_string_map_multis_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_map_multis_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_map_multis_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_map_multis_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_map_multis_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_map_multis_increase_h
+#define _TEST__F_string_map_multis_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_map_multis_increase()
+ */
+extern void test__f_string_map_multis_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_map_multis_increase()
+ */
+extern void test__f_string_map_multis_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_map_multis_increase()
+ */
+extern void test__f_string_map_multis_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_string_map_multis_increase_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multis_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_map_multis_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_string_map_multis_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_map_multis_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_map_multis_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_map_multis_increase_by_h
+#define _TEST__F_string_map_multis_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_map_multis_increase_by()
+ */
+extern void test__f_string_map_multis_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_map_multis_increase_by()
+ */
+extern void test__f_string_map_multis_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_map_multis_increase_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multis_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_map_multis_resize__works(void **state) {
+
+ const int length = 5;
+ f_string_map_multis_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_map_multis_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_map_multis_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_map_multis_resize_h
+#define _TEST__F_string_map_multis_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_map_multis_resize()
+ */
+extern void test__f_string_map_multis_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_map_multis_resize()
+ */
+extern void test__f_string_map_multis_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_string_map_multis_resize_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multiss_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_map_multiss_adjust__works(void **state) {
+
+ const int length = 5;
+ f_string_map_multiss_t data = f_string_map_multiss_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_map_multiss_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_map_multiss_t data = f_string_map_multiss_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_map_multiss_adjust_h
+#define _TEST__F_string_map_multiss_adjust_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_map_multiss_adjust()
+ */
+extern void test__f_string_map_multiss_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_map_multiss_adjust()
+ */
+extern void test__f_string_map_multiss_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_string_map_multiss_adjust_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multiss_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_map_multiss_append__works(void **state) {
+
+ const int length_values = 2;
+ const int length_values_set = 2;
+ const int length_inner = 2;
+ f_string_map_multis_t source = f_string_map_multis_t_initialize;
+ f_string_map_multiss_t destination = f_string_map_multiss_t_initialize;
+
+ f_string_static_t test_value_array1[] = {
+ macro_f_string_static_t_initialize("test_value1", 0, 11),
+ macro_f_string_static_t_initialize("test_value2", 0, 11),
+ };
+
+ f_string_static_t test_value_array2[] = {
+ macro_f_string_static_t_initialize("test_value3", 0, 11),
+ macro_f_string_static_t_initialize("test_value4", 0, 11),
+ };
+
+ const f_string_static_t test_names[] = {
+ macro_f_string_static_t_initialize("test_name1", 0, 10),
+ macro_f_string_static_t_initialize("test_name2", 0, 10),
+ };
+
+ const f_string_statics_t test_values[] = {
+ macro_f_string_statics_t_initialize(test_value_array1, 0, length_values),
+ macro_f_string_statics_t_initialize(test_value_array2, 0, length_values),
+ };
+
+ {
+ f_status_t status = f_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_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_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_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_string_map_multiss_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_map_multis_t source = f_string_map_multiss_t_initialize;
+ f_string_map_multiss_t destination = f_string_map_multiss_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_map_multiss_append__parameter_checking(void **state) {
+
+ f_string_map_multis_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_map_multiss_append_h
+#define _TEST__F_string_map_multiss_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_map_multiss_append()
+ */
+extern void test__f_string_map_multiss_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_map_multiss_append()
+ */
+extern void test__f_string_map_multiss_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_map_multiss_append()
+ */
+extern void test__f_string_map_multiss_append__parameter_checking(void **state);
+
+#endif // _TEST__F_string_map_multiss_append_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multiss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_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_string_map_multiss_t source = f_string_map_multiss_t_initialize;
+ f_string_map_multiss_t destination = f_string_map_multiss_t_initialize;
+
+ f_string_static_t test_value_array1[] = {
+ macro_f_string_static_t_initialize("test_value1", 0, 11),
+ macro_f_string_static_t_initialize("test_value2", 0, 11),
+ };
+
+ f_string_static_t test_value_array2[] = {
+ macro_f_string_static_t_initialize("test_value3", 0, 11),
+ macro_f_string_static_t_initialize("test_value4", 0, 11),
+ };
+
+ const f_string_static_t test_names[] = {
+ macro_f_string_static_t_initialize("test_name1", 0, 10),
+ macro_f_string_static_t_initialize("test_name2", 0, 10),
+ };
+
+ const f_string_statics_t test_values[] = {
+ macro_f_string_statics_t_initialize(test_value_array1, 0, length_values),
+ macro_f_string_statics_t_initialize(test_value_array2, 0, length_values),
+ };
+
+ {
+ f_status_t status = f_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_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_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_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_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_string_map_multiss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_map_multiss_t source = f_string_map_multiss_t_initialize;
+ f_string_map_multiss_t destination = f_string_map_multiss_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_map_multiss_append_all__parameter_checking(void **state) {
+
+ const f_string_map_multiss_t data = f_string_map_multiss_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_map_multiss_append_all_h
+#define _TEST__F_string_map_multiss_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_map_multiss_append_all()
+ */
+extern void test__f_string_map_multiss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_map_multiss_append_all()
+ */
+extern void test__f_string_map_multiss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_map_multiss_append_all()
+ */
+extern void test__f_string_map_multiss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_string_map_multiss_append_all_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multiss_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_map_multiss_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_string_map_multiss_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_map_multiss_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_map_multiss_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_map_multiss_decimate_by_h
+#define _TEST__F_string_map_multiss_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_map_multiss_decimate_by()
+ */
+extern void test__f_string_map_multiss_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_map_multiss_decimate_by()
+ */
+extern void test__f_string_map_multiss_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_map_multiss_decimate_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multiss_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_map_multiss_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_string_map_multiss_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_map_multiss_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_map_multiss_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_map_multiss_decrease_by_h
+#define _TEST__F_string_map_multiss_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_map_multiss_decrease_by()
+ */
+extern void test__f_string_map_multiss_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_map_multiss_decrease_by()
+ */
+extern void test__f_string_map_multiss_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_map_multiss_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multiss_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_map_multiss_increase__works(void **state) {
+
+ const int length = 5;
+ f_string_map_multiss_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_map_multiss_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_map_multiss_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_map_multiss_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_map_multiss_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_map_multiss_increase_h
+#define _TEST__F_string_map_multiss_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_map_multiss_increase()
+ */
+extern void test__f_string_map_multiss_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_map_multiss_increase()
+ */
+extern void test__f_string_map_multiss_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_map_multiss_increase()
+ */
+extern void test__f_string_map_multiss_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_string_map_multiss_increase_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multiss_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_map_multiss_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_string_map_multiss_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_map_multiss_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_map_multiss_t data = f_string_map_multis_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_map_multiss_increase_by_h
+#define _TEST__F_string_map_multiss_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_map_multiss_increase_by()
+ */
+extern void test__f_string_map_multiss_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_map_multiss_increase_by()
+ */
+extern void test__f_string_map_multiss_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_map_multiss_increase_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-map_multiss_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_map_multiss_resize__works(void **state) {
+
+ const int length = 5;
+ f_string_map_multiss_t data = f_string_map_multiss_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_map_multiss_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_map_multiss_t data = f_string_map_multiss_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_map_multiss_resize_h
+#define _TEST__F_string_map_multiss_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_map_multiss_resize()
+ */
+extern void test__f_string_map_multiss_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_map_multiss_resize()
+ */
+extern void test__f_string_map_multiss_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_string_map_multiss_resize_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-maps_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_maps_adjust__works(void **state) {
+
+ const int length = 5;
+ f_string_maps_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_maps_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_maps_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_string__string_maps_adjust
+#define _TEST__F_string__string_maps_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_maps_adjust()
+ */
+extern void test__f_string_maps_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_maps_adjust()
+ */
+extern void test__f_string_maps_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_string__string_maps_adjust
--- /dev/null
+#include "test-string.h"
+#include "test-string-maps_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_maps_append__works(void **state) {
+
+ f_string_map_t source = f_string_map_t_initialize;
+ f_string_maps_t destination = f_string_maps_t_initialize;
+
+ const f_string_static_t test_name = macro_f_string_static_t_initialize("test_name", 0, 9);
+ const f_string_static_t test_value = macro_f_string_static_t_initialize("test_value", 0, 10);
+
+ {
+ f_status_t status = f_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_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_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_string_maps_append__parameter_checking(void **state) {
+
+ const f_string_map_t data = f_string_map_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_maps_append_h
+#define _TEST__F_string_maps_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_maps_append()
+ */
+extern void test__f_string_maps_append__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_maps_append()
+ */
+extern void test__f_string_maps_append__parameter_checking(void **state);
+
+#endif // _TEST__F_string_maps_append_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-maps_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_maps_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_string_maps_t source = f_string_maps_t_initialize;
+ f_string_maps_t destination = f_string_maps_t_initialize;
+
+ const f_string_static_t test_name = macro_f_string_static_t_initialize("test_name", 0, 9);
+ const f_string_static_t test_value = macro_f_string_static_t_initialize("test_value", 0, 10);
+
+ {
+ f_status_t status = f_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_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_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_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_string_maps_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_maps_t source = f_string_maps_t_initialize;
+ f_string_maps_t destination = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_maps_append_all__parameter_checking(void **state) {
+
+ const f_string_maps_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_maps_append_all_h
+#define _TEST__F_string_maps_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_maps_append_all()
+ */
+extern void test__f_string_maps_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_maps_append_all()
+ */
+extern void test__f_string_maps_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_maps_append_all()
+ */
+extern void test__f_string_maps_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_string_maps_append_all_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-maps_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_maps_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_string_maps_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_maps_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_maps_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_maps_decimate_by()
+ */
+extern void test__f_string_maps_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_maps_decimate_by()
+ */
+extern void test__f_string_maps_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_maps_decimate_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-maps_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_maps_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_string_maps_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_maps_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_maps_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_maps_decrease_by_h
+#define _TEST__F_string_maps_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_maps_decrease_by()
+ */
+extern void test__f_string_maps_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_maps_decrease_by()
+ */
+extern void test__f_string_maps_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_maps_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-maps_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_maps_increase__works(void **state) {
+
+ const int length = 5;
+ f_string_maps_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_maps_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_maps_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_maps_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_maps_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_maps_increase_h
+#define _TEST__F_string_maps_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_maps_increase()
+ */
+extern void test__f_string_maps_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_maps_increase()
+ */
+extern void test__f_string_maps_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_maps_increase()
+ */
+extern void test__f_string_maps_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_string_maps_increase_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-maps_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_maps_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_string_maps_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_maps_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_maps_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_maps_increase_by_h
+#define _TEST__F_string_maps_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_maps_increase_by()
+ */
+extern void test__f_string_maps_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_maps_increase_by()
+ */
+extern void test__f_string_maps_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_maps_increase_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-maps_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_maps_resize__works(void **state) {
+
+ const int length = 5;
+ f_string_maps_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_maps_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_maps_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_maps_resize_h
+#define _TEST__F_string_maps_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_maps_resize()
+ */
+extern void test__f_string_maps_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_maps_resize()
+ */
+extern void test__f_string_maps_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_string_maps_resize_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-mapss_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_mapss_adjust__works(void **state) {
+
+ const int length = 5;
+ f_string_mapss_t data = f_string_mapss_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_mapss_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_mapss_t data = f_string_mapss_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_mapss_adjust_h
+#define _TEST__F_string_mapss_adjust_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_mapss_adjust()
+ */
+extern void test__f_string_mapss_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_mapss_adjust()
+ */
+extern void test__f_string_mapss_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_string_mapss_adjust_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-mapss_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_mapss_append__works(void **state) {
+
+ const int length_inner = 2;
+ f_string_maps_t source = f_string_maps_t_initialize;
+ f_string_mapss_t destination = f_string_mapss_t_initialize;
+
+ const f_string_static_t test_names[] = {
+ macro_f_string_static_t_initialize("test_name1", 0, 10),
+ macro_f_string_static_t_initialize("test_name2", 0, 10),
+ };
+
+ const f_string_static_t test_values[] = {
+ macro_f_string_static_t_initialize("test_value1", 0, 11),
+ macro_f_string_static_t_initialize("test_value2", 0, 11),
+ };
+
+ {
+ f_status_t status = f_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_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_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_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_string_mapss_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_maps_t source = f_string_mapss_t_initialize;
+ f_string_mapss_t destination = f_string_mapss_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_mapss_append__parameter_checking(void **state) {
+
+ f_string_maps_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_mapss_append_h
+#define _TEST__F_string_mapss_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_mapss_append()
+ */
+extern void test__f_string_mapss_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_mapss_append()
+ */
+extern void test__f_string_mapss_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_mapss_append()
+ */
+extern void test__f_string_mapss_append__parameter_checking(void **state);
+
+#endif // _TEST__F_string_mapss_append_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-mapss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_mapss_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ const int length_outer = 2;
+ f_string_mapss_t source = f_string_mapss_t_initialize;
+ f_string_mapss_t destination = f_string_mapss_t_initialize;
+
+ const f_string_static_t test_names[] = {
+ macro_f_string_static_t_initialize("test_name1", 0, 10),
+ macro_f_string_static_t_initialize("test_name2", 0, 10),
+ };
+
+ const f_string_static_t test_values[] = {
+ macro_f_string_static_t_initialize("test_value1", 0, 11),
+ macro_f_string_static_t_initialize("test_value2", 0, 11),
+ };
+
+ {
+ f_status_t status = f_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_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_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_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_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_string_mapss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_mapss_t source = f_string_mapss_t_initialize;
+ f_string_mapss_t destination = f_string_mapss_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_mapss_append_all__parameter_checking(void **state) {
+
+ const f_string_mapss_t data = f_string_mapss_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_mapss_append_all_h
+#define _TEST__F_string_mapss_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_mapss_append_all()
+ */
+extern void test__f_string_mapss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_mapss_append_all()
+ */
+extern void test__f_string_mapss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_mapss_append_all()
+ */
+extern void test__f_string_mapss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_string_mapss_append_all_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-mapss_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_mapss_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_string_mapss_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_mapss_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_mapss_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_mapss_decimate_by_h
+#define _TEST__F_string_mapss_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_mapss_decimate_by()
+ */
+extern void test__f_string_mapss_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_mapss_decimate_by()
+ */
+extern void test__f_string_mapss_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_mapss_decimate_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-mapss_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_mapss_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_string_mapss_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_mapss_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_mapss_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_mapss_decrease_by_h
+#define _TEST__F_string_mapss_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_mapss_decrease_by()
+ */
+extern void test__f_string_mapss_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_mapss_decrease_by()
+ */
+extern void test__f_string_mapss_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_mapss_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-mapss_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_mapss_increase__works(void **state) {
+
+ const int length = 5;
+ f_string_mapss_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_mapss_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_mapss_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_mapss_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_mapss_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_mapss_increase_h
+#define _TEST__F_string_mapss_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_mapss_increase()
+ */
+extern void test__f_string_mapss_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_mapss_increase()
+ */
+extern void test__f_string_mapss_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_mapss_increase()
+ */
+extern void test__f_string_mapss_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_string_mapss_increase_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-mapss_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_mapss_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_string_mapss_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_mapss_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_mapss_t data = f_string_maps_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_mapss_increase_by_h
+#define _TEST__F_string_mapss_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_mapss_increase_by()
+ */
+extern void test__f_string_mapss_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_mapss_increase_by()
+ */
+extern void test__f_string_mapss_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_mapss_increase_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-mapss_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_mapss_resize__works(void **state) {
+
+ const int length = 5;
+ f_string_mapss_t data = f_string_mapss_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_mapss_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_mapss_t data = f_string_mapss_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_mapss_resize_h
+#define _TEST__F_string_mapss_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_mapss_resize()
+ */
+extern void test__f_string_mapss_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_mapss_resize()
+ */
+extern void test__f_string_mapss_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_string_mapss_resize_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-quantitys_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_quantitys_adjust__works(void **state) {
+
+ const int length = 5;
+ f_string_quantitys_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantitys_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_string_quantitys_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_quantitys_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantitys_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_string__string_quantitys_adjust
+#define _TEST__F_string__string_quantitys_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_quantitys_adjust()
+ */
+extern void test__f_string_quantitys_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_quantitys_adjust()
+ */
+extern void test__f_string_quantitys_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_string__string_quantitys_adjust
--- /dev/null
+#include "test-string.h"
+#include "test-string-quantitys_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_quantitys_append__works(void **state) {
+
+ const f_string_quantity_t source = macro_f_string_quantity_t_initialize(1, 2);
+ f_string_quantitys_t destination = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantitys_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].start, source.start);
+ assert_int_equal(destination.array[0].total, source.total);
+ }
+
+ free((void *) destination.array);
+}
+
+void test__f_string_quantitys_append__parameter_checking(void **state) {
+
+ const f_string_quantity_t data = f_string_quantity_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantitys_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_string_quantitys_append_h
+#define _TEST__F_string_quantitys_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_quantitys_append()
+ */
+extern void test__f_string_quantitys_append__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_quantitys_append()
+ */
+extern void test__f_string_quantitys_append__parameter_checking(void **state);
+
+#endif // _TEST__F_string_quantitys_append_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-quantitys_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_quantitys_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_sources = 2;
+
+ f_string_quantity_t sources_array[] = {
+ macro_f_string_quantity_t_initialize(1, 2),
+ macro_f_string_quantity_t_initialize(3, 4),
+ };
+
+ const f_string_quantitys_t source = macro_f_string_quantitys_t_initialize(sources_array, 0, length_sources);
+ f_string_quantitys_t destination = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantitys_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].start, source.array[i].start);
+ assert_int_equal(destination.array[i].total, source.array[i].total);
+ } // for
+ }
+
+ free((void *) destination.array);
+}
+
+void test__f_string_quantitys_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_quantitys_t source = f_string_quantitys_t_initialize;
+ f_string_quantitys_t destination = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantitys_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_string_quantitys_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_string_quantitys_append_all__parameter_checking(void **state) {
+
+ const f_string_quantitys_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantitys_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_string_quantitys_append_all_h
+#define _TEST__F_string_quantitys_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_quantitys_append_all()
+ */
+extern void test__f_string_quantitys_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_quantitys_append_all()
+ */
+extern void test__f_string_quantitys_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_quantitys_append_all()
+ */
+extern void test__f_string_quantitys_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_string_quantitys_append_all_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-quantitys_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_quantitys_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_string_quantitys_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantitys_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_string_quantitys_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_string_quantitys_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_quantitys_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantitys_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_quantitys_decimate_by_h
+#define _TEST__F_quantitys_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_quantitys_decimate_by()
+ */
+extern void test__f_string_quantitys_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_quantitys_decimate_by()
+ */
+extern void test__f_string_quantitys_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_quantitys_decimate_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-quantitys_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_quantitys_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_string_quantitys_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantitys_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_string_quantitys_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_string_quantitys_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_quantitys_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantitys_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_string_quantitys_decrease_by_h
+#define _TEST__F_string_quantitys_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_quantitys_decrease_by()
+ */
+extern void test__f_string_quantitys_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_quantitys_decrease_by()
+ */
+extern void test__f_string_quantitys_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_quantitys_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-quantitys_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_quantitys_increase__works(void **state) {
+
+ const int length = 5;
+ f_string_quantitys_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantitys_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_string_quantitys_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_string_quantitys_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_quantitys_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantitys_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_string_quantitys_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_string_quantitys_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_quantitys_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantitys_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_string_quantitys_increase_h
+#define _TEST__F_string_quantitys_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_quantitys_increase()
+ */
+extern void test__f_string_quantitys_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_quantitys_increase()
+ */
+extern void test__f_string_quantitys_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_quantitys_increase()
+ */
+extern void test__f_string_quantitys_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_string_quantitys_increase_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-quantitys_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_quantitys_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_string_quantitys_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantitys_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_string_quantitys_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_string_quantitys_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_quantitys_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantitys_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_string_quantitys_increase_by_h
+#define _TEST__F_string_quantitys_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_quantitys_increase_by()
+ */
+extern void test__f_string_quantitys_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_quantitys_increase_by()
+ */
+extern void test__f_string_quantitys_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_quantitys_increase_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-quantitys_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_quantitys_resize__works(void **state) {
+
+ const int length = 5;
+ f_string_quantitys_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantitys_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_string_quantitys_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_quantitys_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantitys_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_string_quantitys_resize_h
+#define _TEST__F_string_quantitys_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_quantitys_resize()
+ */
+extern void test__f_string_quantitys_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_quantitys_resize()
+ */
+extern void test__f_string_quantitys_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_string_quantitys_resize_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-quantityss_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_quantityss_adjust__works(void **state) {
+
+ const int length = 5;
+ f_string_quantityss_t data = f_string_quantityss_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantityss_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_string_quantityss_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_quantityss_t data = f_string_quantityss_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantityss_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_string_quantityss_adjust_h
+#define _TEST__F_string_quantityss_adjust_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_quantityss_adjust()
+ */
+extern void test__f_string_quantityss_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_quantityss_adjust()
+ */
+extern void test__f_string_quantityss_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_string_quantityss_adjust_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-quantityss_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_quantityss_append__works(void **state) {
+
+ const int length_sources = 2;
+
+ f_string_quantity_t sources_array[] = {
+ macro_f_string_quantity_t_initialize(1, 2),
+ macro_f_string_quantity_t_initialize(3, 4),
+ };
+
+ const f_string_quantitys_t source = macro_f_string_quantitys_t_initialize(sources_array, 0, length_sources);
+ f_string_quantityss_t destination = f_string_quantityss_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantityss_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].start, sources_array[i].start);
+ assert_int_equal(destination.array[0].array[i].total, sources_array[i].total);
+ } // for
+ }
+
+ free((void *) destination.array[0].array);
+ free((void *) destination.array);
+}
+
+void test__f_string_quantityss_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_quantitys_t source = f_string_quantityss_t_initialize;
+ f_string_quantityss_t destination = f_string_quantityss_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantitys_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_string_quantityss_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_string_quantityss_append__parameter_checking(void **state) {
+
+ f_string_quantitys_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantityss_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_string_quantityss_append_h
+#define _TEST__F_string_quantityss_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_quantityss_append()
+ */
+extern void test__f_string_quantityss_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_quantityss_append()
+ */
+extern void test__f_string_quantityss_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_quantityss_append()
+ */
+extern void test__f_string_quantityss_append__parameter_checking(void **state);
+
+#endif // _TEST__F_string_quantityss_append_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-quantityss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_quantityss_append_all__works(void **state) {
+
+ const int length_sources = 2;
+ const int length_sources_set = 2;
+
+ f_string_quantity_t sources_array1[] = {
+ macro_f_string_quantity_t_initialize(1, 2),
+ macro_f_string_quantity_t_initialize(3, 4),
+ };
+
+ f_string_quantity_t sources_array2[] = {
+ macro_f_string_quantity_t_initialize(5, 6),
+ macro_f_string_quantity_t_initialize(7, 8),
+ };
+
+ f_string_quantitys_t sources_set_array[] = {
+ macro_f_string_quantitys_t_initialize(sources_array1, 0, length_sources),
+ macro_f_string_quantitys_t_initialize(sources_array2, 0, length_sources),
+ };
+
+ const f_string_quantityss_t source = macro_f_string_quantityss_t_initialize(sources_set_array, 0, length_sources_set);
+ f_string_quantityss_t destination = f_string_quantityss_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantityss_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].start, sources_set_array[j].array[i].start);
+ assert_int_equal(destination.array[j].array[i].total, sources_set_array[j].array[i].total);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) destination.array);
+}
+
+void test__f_string_quantityss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_quantityss_t source = f_string_quantityss_t_initialize;
+ f_string_quantityss_t destination = f_string_quantityss_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantityss_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_string_quantityss_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_string_quantityss_append_all__parameter_checking(void **state) {
+
+ const f_string_quantityss_t data = f_string_quantityss_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantityss_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_string_quantityss_append_all_h
+#define _TEST__F_string_quantityss_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_quantityss_append_all()
+ */
+extern void test__f_string_quantityss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_quantityss_append_all()
+ */
+extern void test__f_string_quantityss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_quantityss_append_all()
+ */
+extern void test__f_string_quantityss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_string_quantityss_append_all_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-quantityss_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_quantityss_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_string_quantityss_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantityss_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_string_quantityss_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_string_quantityss_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_quantityss_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantityss_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_string_quantityss_decimate_by_h
+#define _TEST__F_string_quantityss_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_quantityss_decimate_by()
+ */
+extern void test__f_string_quantityss_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_quantityss_decimate_by()
+ */
+extern void test__f_string_quantityss_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_quantityss_decimate_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-quantityss_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_quantityss_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_string_quantityss_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantityss_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_string_quantityss_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_string_quantityss_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_quantityss_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantityss_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_string_quantityss_decrease_by_h
+#define _TEST__F_string_quantityss_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_quantityss_decrease_by()
+ */
+extern void test__f_string_quantityss_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_quantityss_decrease_by()
+ */
+extern void test__f_string_quantityss_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_quantityss_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-quantityss_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_quantityss_increase__works(void **state) {
+
+ const int length = 5;
+ f_string_quantityss_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantityss_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_string_quantityss_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_string_quantityss_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_quantityss_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantityss_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_string_quantityss_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_string_quantityss_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_quantityss_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantityss_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_string_quantityss_increase_h
+#define _TEST__F_string_quantityss_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_quantityss_increase()
+ */
+extern void test__f_string_quantityss_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_quantityss_increase()
+ */
+extern void test__f_string_quantityss_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_quantityss_increase()
+ */
+extern void test__f_string_quantityss_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_string_quantityss_increase_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-quantityss_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_quantityss_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_string_quantityss_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantityss_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_string_quantityss_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_string_quantityss_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_quantityss_t data = f_string_quantitys_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantityss_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_string_quantityss_increase_by_h
+#define _TEST__F_string_quantityss_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_quantityss_increase_by()
+ */
+extern void test__f_string_quantityss_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_quantityss_increase_by()
+ */
+extern void test__f_string_quantityss_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_quantityss_increase_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-quantityss_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_quantityss_resize__works(void **state) {
+
+ const int length = 5;
+ f_string_quantityss_t data = f_string_quantityss_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantityss_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_string_quantityss_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_quantityss_t data = f_string_quantityss_t_initialize;
+
+ {
+ const f_status_t status = f_string_quantityss_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_string_quantityss_resize_h
+#define _TEST__F_string_quantityss_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_quantityss_resize()
+ */
+extern void test__f_string_quantityss_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_quantityss_resize()
+ */
+extern void test__f_string_quantityss_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_string_quantityss_resize_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-ranges_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_ranges_adjust__works(void **state) {
+
+ const int length = 5;
+ f_string_ranges_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_ranges_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_string_ranges_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_ranges_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_ranges_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_string__string_ranges_adjust
+#define _TEST__F_string__string_ranges_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_ranges_adjust()
+ */
+extern void test__f_string_ranges_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_ranges_adjust()
+ */
+extern void test__f_string_ranges_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_string__string_ranges_adjust
--- /dev/null
+#include "test-string.h"
+#include "test-string-ranges_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_ranges_append__works(void **state) {
+
+ const f_array_length_t length = 5;
+ const f_string_range_t source = macro_f_string_range_t_initialize(1, 2);
+ f_string_ranges_t destination = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_ranges_append(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].start, source.start);
+ assert_int_equal(destination.array[0].stop, source.stop);
+ }
+
+ free((void *) destination.array);
+}
+
+void test__f_string_ranges_append__parameter_checking(void **state) {
+
+ const f_string_range_t data = f_string_range_t_initialize;
+
+ {
+ const f_status_t status = f_string_ranges_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_string_ranges_append_h
+#define _TEST__F_string_ranges_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_ranges_append()
+ */
+extern void test__f_string_ranges_append__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_ranges_append()
+ */
+extern void test__f_string_ranges_append__parameter_checking(void **state);
+
+#endif // _TEST__F_string_ranges_append_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-ranges_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_ranges_append_all__works(void **state) {
+
+ const int length_sources = 2;
+
+ f_string_range_t sources_array[] = {
+ macro_f_string_range_t_initialize(1, 2),
+ macro_f_string_range_t_initialize(3, 4),
+ };
+
+ const f_string_ranges_t source = macro_f_string_ranges_t_initialize(sources_array, 0, length_sources);
+ f_string_ranges_t destination = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_ranges_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].start, source.array[i].start);
+ assert_int_equal(destination.array[i].stop, source.array[i].stop);
+ } // for
+ }
+
+ free((void *) destination.array);
+}
+
+void test__f_string_ranges_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_ranges_t source = f_string_ranges_t_initialize;
+ f_string_ranges_t destination = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_ranges_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_string_ranges_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_string_ranges_append_all__parameter_checking(void **state) {
+
+ const f_string_ranges_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_ranges_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_string_ranges_append_all_h
+#define _TEST__F_string_ranges_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_ranges_append_all()
+ */
+extern void test__f_string_ranges_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_ranges_append_all()
+ */
+extern void test__f_string_ranges_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_ranges_append_all()
+ */
+extern void test__f_string_ranges_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_string_ranges_append_all_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-ranges_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_ranges_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_string_ranges_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_ranges_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_string_ranges_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_string_ranges_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_ranges_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_ranges_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_ranges_decimate_by_h
+#define _TEST__F_ranges_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_ranges_decimate_by()
+ */
+extern void test__f_string_ranges_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_ranges_decimate_by()
+ */
+extern void test__f_string_ranges_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_ranges_decimate_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-ranges_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_ranges_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_string_ranges_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_ranges_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_string_ranges_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_string_ranges_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_ranges_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_ranges_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_string_ranges_decrease_by_h
+#define _TEST__F_string_ranges_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_ranges_decrease_by()
+ */
+extern void test__f_string_ranges_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_ranges_decrease_by()
+ */
+extern void test__f_string_ranges_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_ranges_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-ranges_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_ranges_increase__works(void **state) {
+
+ const int length = 5;
+ f_string_ranges_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_ranges_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_string_ranges_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_string_ranges_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_ranges_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_ranges_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_string_ranges_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_string_ranges_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_ranges_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_ranges_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_string_ranges_increase_h
+#define _TEST__F_string_ranges_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_ranges_increase()
+ */
+extern void test__f_string_ranges_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_ranges_increase()
+ */
+extern void test__f_string_ranges_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_ranges_increase()
+ */
+extern void test__f_string_ranges_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_string_ranges_increase_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-ranges_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_ranges_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_string_ranges_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_ranges_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_string_ranges_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_string_ranges_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_ranges_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_ranges_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_string_ranges_increase_by_h
+#define _TEST__F_string_ranges_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_ranges_increase_by()
+ */
+extern void test__f_string_ranges_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_ranges_increase_by()
+ */
+extern void test__f_string_ranges_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_ranges_increase_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-ranges_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_ranges_resize__works(void **state) {
+
+ const int length = 5;
+ f_string_ranges_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_ranges_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_string_ranges_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_ranges_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_ranges_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_string_ranges_resize_h
+#define _TEST__F_string_ranges_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_ranges_resize()
+ */
+extern void test__f_string_ranges_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_ranges_resize()
+ */
+extern void test__f_string_ranges_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_string_ranges_resize_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-rangess_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_rangess_adjust__works(void **state) {
+
+ const int length = 5;
+ f_string_rangess_t data = f_string_rangess_t_initialize;
+
+ {
+ const f_status_t status = f_string_rangess_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_string_rangess_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_rangess_t data = f_string_rangess_t_initialize;
+
+ {
+ const f_status_t status = f_string_rangess_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_string_rangess_adjust_h
+#define _TEST__F_string_rangess_adjust_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_rangess_adjust()
+ */
+extern void test__f_string_rangess_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_rangess_adjust()
+ */
+extern void test__f_string_rangess_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_string_rangess_adjust_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-rangess_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_rangess_append__works(void **state) {
+
+ const int length_sources = 2;
+
+ f_string_range_t sources_array[] = {
+ macro_f_string_range_t_initialize(1, 2),
+ macro_f_string_range_t_initialize(3, 4),
+ };
+
+ const f_string_ranges_t source = macro_f_string_ranges_t_initialize(sources_array, 0, length_sources);
+ f_string_rangess_t destination = f_string_rangess_t_initialize;
+
+ {
+ const f_status_t status = f_string_rangess_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].start, sources_array[i].start);
+ assert_int_equal(destination.array[0].array[i].stop, sources_array[i].stop);
+ } // for
+ }
+
+ free((void *) destination.array[0].array);
+ free((void *) destination.array);
+}
+
+void test__f_string_rangess_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_ranges_t source = f_string_rangess_t_initialize;
+ f_string_rangess_t destination = f_string_rangess_t_initialize;
+
+ {
+ const f_status_t status = f_string_ranges_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_string_rangess_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_string_rangess_append__parameter_checking(void **state) {
+
+ f_string_ranges_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_rangess_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_string_rangess_append_h
+#define _TEST__F_string_rangess_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_rangess_append()
+ */
+extern void test__f_string_rangess_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_rangess_append()
+ */
+extern void test__f_string_rangess_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_rangess_append()
+ */
+extern void test__f_string_rangess_append__parameter_checking(void **state);
+
+#endif // _TEST__F_string_rangess_append_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-rangess_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_rangess_append_all__works(void **state) {
+
+ const int length_sources = 2;
+ const int length_sources_set = 2;
+
+ f_string_range_t sources_array1[] = {
+ macro_f_string_range_t_initialize(1, 2),
+ macro_f_string_range_t_initialize(3, 4),
+ };
+
+ f_string_range_t sources_array2[] = {
+ macro_f_string_range_t_initialize(5, 6),
+ macro_f_string_range_t_initialize(7, 8),
+ };
+
+ f_string_ranges_t sources_set_array[] = {
+ macro_f_string_ranges_t_initialize(sources_array1, 0, length_sources),
+ macro_f_string_ranges_t_initialize(sources_array2, 0, length_sources),
+ };
+
+ const f_string_rangess_t source = macro_f_string_rangess_t_initialize(sources_set_array, 0, length_sources_set);
+ f_string_rangess_t destination = f_string_rangess_t_initialize;
+
+ {
+ const f_status_t status = f_string_rangess_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].start, sources_set_array[j].array[i].start);
+ assert_int_equal(destination.array[j].array[i].stop, sources_set_array[j].array[i].stop);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) destination.array);
+}
+
+void test__f_string_rangess_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_rangess_t source = f_string_rangess_t_initialize;
+ f_string_rangess_t destination = f_string_rangess_t_initialize;
+
+ {
+ const f_status_t status = f_string_rangess_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_string_rangess_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_string_rangess_append_all__parameter_checking(void **state) {
+
+ const f_string_rangess_t data = f_string_rangess_t_initialize;
+
+ {
+ const f_status_t status = f_string_rangess_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_string_rangess_append_all_h
+#define _TEST__F_string_rangess_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_rangess_append_all()
+ */
+extern void test__f_string_rangess_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_rangess_append_all()
+ */
+extern void test__f_string_rangess_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_rangess_append_all()
+ */
+extern void test__f_string_rangess_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_string_rangess_append_all_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-rangess_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_rangess_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_string_rangess_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_rangess_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_string_rangess_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_string_rangess_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_rangess_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_rangess_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_string_rangess_decimate_by_h
+#define _TEST__F_string_rangess_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_rangess_decimate_by()
+ */
+extern void test__f_string_rangess_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_rangess_decimate_by()
+ */
+extern void test__f_string_rangess_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_rangess_decimate_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-rangess_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_rangess_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_string_rangess_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_rangess_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_string_rangess_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_string_rangess_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_rangess_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_rangess_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_string_rangess_decrease_by_h
+#define _TEST__F_string_rangess_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_rangess_decrease_by()
+ */
+extern void test__f_string_rangess_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_rangess_decrease_by()
+ */
+extern void test__f_string_rangess_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_rangess_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-rangess_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_rangess_increase__works(void **state) {
+
+ const int length = 5;
+ f_string_rangess_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_rangess_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_string_rangess_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_string_rangess_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_rangess_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_rangess_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_string_rangess_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_string_rangess_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_rangess_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_rangess_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_string_rangess_increase_h
+#define _TEST__F_string_rangess_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_rangess_increase()
+ */
+extern void test__f_string_rangess_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_rangess_increase()
+ */
+extern void test__f_string_rangess_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_rangess_increase()
+ */
+extern void test__f_string_rangess_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_string_rangess_increase_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-rangess_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_rangess_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_string_rangess_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_rangess_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_string_rangess_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_string_rangess_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_rangess_t data = f_string_ranges_t_initialize;
+
+ {
+ const f_status_t status = f_string_rangess_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_string_rangess_increase_by_h
+#define _TEST__F_string_rangess_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_rangess_increase_by()
+ */
+extern void test__f_string_rangess_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_rangess_increase_by()
+ */
+extern void test__f_string_rangess_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_rangess_increase_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-rangess_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_rangess_resize__works(void **state) {
+
+ const int length = 5;
+ f_string_rangess_t data = f_string_rangess_t_initialize;
+
+ {
+ const f_status_t status = f_string_rangess_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_string_rangess_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_rangess_t data = f_string_rangess_t_initialize;
+
+ {
+ const f_status_t status = f_string_rangess_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_string_rangess_resize_h
+#define _TEST__F_string_rangess_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_rangess_resize()
+ */
+extern void test__f_string_rangess_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_rangess_resize()
+ */
+extern void test__f_string_rangess_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_string_rangess_resize_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-triples_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_triples_adjust__works(void **state) {
+
+ const int length = 5;
+ f_string_triples_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_triples_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_triples_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_string__string_triples_adjust
+#define _TEST__F_string__string_triples_adjust
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_triples_adjust()
+ */
+extern void test__f_string_triples_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_triples_adjust()
+ */
+extern void test__f_string_triples_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_string__string_triples_adjust
--- /dev/null
+#include "test-string.h"
+#include "test-string-triples_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_triples_append__works(void **state) {
+
+ const f_string_static_t test_a = macro_f_string_static_t_initialize("a", 0, 1);
+ const f_string_static_t test_b = macro_f_string_static_t_initialize("b", 0, 1);
+ const f_string_static_t test_c = macro_f_string_static_t_initialize("c", 0, 1);
+
+ const f_string_triple_t source = macro_f_string_triple_t_initialize(test_a, test_b, test_c);
+ f_string_triples_t destination = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_triples_append__parameter_checking(void **state) {
+
+ const f_string_triple_t data = f_string_triple_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_triples_append_h
+#define _TEST__F_string_triples_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_triples_append()
+ */
+extern void test__f_string_triples_append__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_triples_append()
+ */
+extern void test__f_string_triples_append__parameter_checking(void **state);
+
+#endif // _TEST__F_string_triples_append_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-triples_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_triples_append_all__works(void **state) {
+
+ const int length_sources = 2;
+
+ const f_string_static_t test_a = macro_f_string_static_t_initialize("a", 0, 1);
+ const f_string_static_t test_b = macro_f_string_static_t_initialize("b", 0, 1);
+ const f_string_static_t test_c = macro_f_string_static_t_initialize("c", 0, 1);
+
+ const f_string_static_t test_d = macro_f_string_static_t_initialize("d", 0, 1);
+ const f_string_static_t test_e = macro_f_string_static_t_initialize("e", 0, 1);
+ const f_string_static_t test_f = macro_f_string_static_t_initialize("f", 0, 1);
+
+ f_string_triple_t sources_array[] = {
+ macro_f_string_triple_t_initialize(test_a, test_b, test_c),
+ macro_f_string_triple_t_initialize(test_d, test_e, test_f),
+ };
+
+ const f_string_triples_t source = macro_f_string_triples_t_initialize(sources_array, 0, length_sources);
+ f_string_triples_t destination = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_triples_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_triples_t source = f_string_triples_t_initialize;
+ f_string_triples_t destination = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_triples_append_all__parameter_checking(void **state) {
+
+ const f_string_triples_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_triples_append_all_h
+#define _TEST__F_string_triples_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_triples_append_all()
+ */
+extern void test__f_string_triples_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_triples_append_all()
+ */
+extern void test__f_string_triples_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_triples_append_all()
+ */
+extern void test__f_string_triples_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_string_triples_append_all_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-triples_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_triples_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_string_triples_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_triples_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_triples_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_triples_decimate_by()
+ */
+extern void test__f_string_triples_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_triples_decimate_by()
+ */
+extern void test__f_string_triples_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_triples_decimate_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-triples_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_triples_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_string_triples_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_triples_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_triples_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_triples_decrease_by_h
+#define _TEST__F_string_triples_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_triples_decrease_by()
+ */
+extern void test__f_string_triples_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_triples_decrease_by()
+ */
+extern void test__f_string_triples_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_triples_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-triples_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_triples_increase__works(void **state) {
+
+ const int length = 5;
+ f_string_triples_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_triples_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_triples_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_triples_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_triples_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_triples_increase_h
+#define _TEST__F_string_triples_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_triples_increase()
+ */
+extern void test__f_string_triples_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_triples_increase()
+ */
+extern void test__f_string_triples_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_triples_increase()
+ */
+extern void test__f_string_triples_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_string_triples_increase_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-triples_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_triples_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_string_triples_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_triples_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_triples_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_triples_increase_by_h
+#define _TEST__F_string_triples_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_triples_increase_by()
+ */
+extern void test__f_string_triples_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_triples_increase_by()
+ */
+extern void test__f_string_triples_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_triples_increase_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-triples_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_triples_resize__works(void **state) {
+
+ const int length = 5;
+ f_string_triples_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_triples_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_triples_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_triples_resize_h
+#define _TEST__F_string_triples_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_triples_resize()
+ */
+extern void test__f_string_triples_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_triples_resize()
+ */
+extern void test__f_string_triples_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_string_triples_resize_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-tripless_adjust.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_tripless_adjust__works(void **state) {
+
+ const int length = 5;
+ f_string_tripless_t data = f_string_tripless_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_tripless_adjust__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_tripless_t data = f_string_tripless_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_tripless_adjust_h
+#define _TEST__F_string_tripless_adjust_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_tripless_adjust()
+ */
+extern void test__f_string_tripless_adjust__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_tripless_adjust()
+ */
+extern void test__f_string_tripless_adjust__parameter_checking(void **state);
+
+#endif // _TEST__F_string_tripless_adjust_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-tripless_append.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_tripless_append__works(void **state) {
+
+ const int length_sources = 2;
+
+ const f_string_static_t test_a = macro_f_string_static_t_initialize("a", 0, 1);
+ const f_string_static_t test_b = macro_f_string_static_t_initialize("b", 0, 1);
+ const f_string_static_t test_c = macro_f_string_static_t_initialize("c", 0, 1);
+
+ const f_string_static_t test_d = macro_f_string_static_t_initialize("d", 0, 1);
+ const f_string_static_t test_e = macro_f_string_static_t_initialize("e", 0, 1);
+ const f_string_static_t test_f = macro_f_string_static_t_initialize("f", 0, 1);
+
+ f_string_triple_t sources_array[] = {
+ macro_f_string_triple_t_initialize(test_a, test_b, test_c),
+ macro_f_string_triple_t_initialize(test_d, test_e, test_f),
+ };
+
+ const f_string_triples_t source = macro_f_string_triples_t_initialize(sources_array, 0, length_sources);
+ f_string_tripless_t destination = f_string_tripless_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_tripless_append__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_triples_t source = f_string_tripless_t_initialize;
+ f_string_tripless_t destination = f_string_tripless_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_tripless_append__parameter_checking(void **state) {
+
+ f_string_triples_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_tripless_append_h
+#define _TEST__F_string_tripless_append_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_tripless_append()
+ */
+extern void test__f_string_tripless_append__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_tripless_append()
+ */
+extern void test__f_string_tripless_append__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_tripless_append()
+ */
+extern void test__f_string_tripless_append__parameter_checking(void **state);
+
+#endif // _TEST__F_string_tripless_append_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-tripless_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_tripless_append_all__works(void **state) {
+
+ const int length_sources = 2;
+ const int length_sources_set = 2;
+
+ const f_string_static_t test_a = macro_f_string_static_t_initialize("a", 0, 1);
+ const f_string_static_t test_b = macro_f_string_static_t_initialize("b", 0, 1);
+ const f_string_static_t test_c = macro_f_string_static_t_initialize("c", 0, 1);
+
+ const f_string_static_t test_d = macro_f_string_static_t_initialize("d", 0, 1);
+ const f_string_static_t test_e = macro_f_string_static_t_initialize("e", 0, 1);
+ const f_string_static_t test_f = macro_f_string_static_t_initialize("f", 0, 1);
+
+ const f_string_static_t test_g = macro_f_string_static_t_initialize("g", 0, 1);
+ const f_string_static_t test_h = macro_f_string_static_t_initialize("h", 0, 1);
+ const f_string_static_t test_i = macro_f_string_static_t_initialize("i", 0, 1);
+
+ const f_string_static_t test_j = macro_f_string_static_t_initialize("j", 0, 1);
+ const f_string_static_t test_k = macro_f_string_static_t_initialize("k", 0, 1);
+ const f_string_static_t test_l = macro_f_string_static_t_initialize("l", 0, 1);
+
+ f_string_triple_t sources_array1[] = {
+ macro_f_string_triple_t_initialize(test_a, test_b, test_c),
+ macro_f_string_triple_t_initialize(test_d, test_e, test_f),
+ };
+
+ f_string_triple_t sources_array2[] = {
+ macro_f_string_triple_t_initialize(test_g, test_h, test_i),
+ macro_f_string_triple_t_initialize(test_j, test_k, test_l),
+ };
+
+ f_string_triples_t sources_set_array[] = {
+ macro_f_string_triples_t_initialize(sources_array1, 0, length_sources),
+ macro_f_string_triples_t_initialize(sources_array2, 0, length_sources),
+ };
+
+ const f_string_tripless_t source = macro_f_string_tripless_t_initialize(sources_set_array, 0, length_sources_set);
+ f_string_tripless_t destination = f_string_tripless_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_tripless_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_tripless_t source = f_string_tripless_t_initialize;
+ f_string_tripless_t destination = f_string_tripless_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_tripless_append_all__parameter_checking(void **state) {
+
+ const f_string_tripless_t data = f_string_tripless_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_tripless_append_all_h
+#define _TEST__F_string_tripless_append_all_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_tripless_append_all()
+ */
+extern void test__f_string_tripless_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_tripless_append_all()
+ */
+extern void test__f_string_tripless_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_tripless_append_all()
+ */
+extern void test__f_string_tripless_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_string_tripless_append_all_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-tripless_decimate_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_tripless_decimate_by__works(void **state) {
+
+ const int length = 5;
+ f_string_tripless_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_tripless_decimate_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_tripless_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_tripless_decimate_by_h
+#define _TEST__F_string_tripless_decimate_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_tripless_decimate_by()
+ */
+extern void test__f_string_tripless_decimate_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_tripless_decimate_by()
+ */
+extern void test__f_string_tripless_decimate_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_tripless_decimate_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-tripless_decrease_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_tripless_decrease_by__works(void **state) {
+
+ const int length = 5;
+ f_string_tripless_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_tripless_decrease_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_tripless_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_tripless_decrease_by_h
+#define _TEST__F_string_tripless_decrease_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_tripless_decrease_by()
+ */
+extern void test__f_string_tripless_decrease_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_tripless_decrease_by()
+ */
+extern void test__f_string_tripless_decrease_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_tripless_decrease_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-tripless_increase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_tripless_increase__works(void **state) {
+
+ const int length = 5;
+ f_string_tripless_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_tripless_increase__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_string_tripless_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_tripless_increase__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_tripless_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_tripless_increase_h
+#define _TEST__F_string_tripless_increase_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_tripless_increase()
+ */
+extern void test__f_string_tripless_increase__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_string_tripless_increase()
+ */
+extern void test__f_string_tripless_increase__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_tripless_increase()
+ */
+extern void test__f_string_tripless_increase__parameter_checking(void **state);
+
+#endif // _TEST__F_string_tripless_increase_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-tripless_increase_by.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_tripless_increase_by__works(void **state) {
+
+ const int length = 5;
+ f_string_tripless_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_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_string_tripless_increase_by__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_tripless_t data = f_string_triples_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_tripless_increase_by_h
+#define _TEST__F_string_tripless_increase_by_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_tripless_increase_by()
+ */
+extern void test__f_string_tripless_increase_by__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_tripless_increase_by()
+ */
+extern void test__f_string_tripless_increase_by__parameter_checking(void **state);
+
+#endif // _TEST__F_string_tripless_increase_by_h
--- /dev/null
+#include "test-string.h"
+#include "test-string-tripless_resize.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_string_tripless_resize__works(void **state) {
+
+ const int length = 5;
+ f_string_tripless_t data = f_string_tripless_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_tripless_resize__parameter_checking(void **state) {
+
+ const int length = 5;
+ f_string_tripless_t data = f_string_tripless_t_initialize;
+
+ {
+ const f_status_t status = f_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_string_tripless_resize_h
+#define _TEST__F_string_tripless_resize_h
+
+/**
+ * Test that the function works.
+ *
+ * @see f_string_tripless_resize()
+ */
+extern void test__f_string_tripless_resize__works(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_string_tripless_resize()
+ */
+extern void test__f_string_tripless_resize__parameter_checking(void **state);
+
+#endif // _TEST__F_string_tripless_resize_h
--- /dev/null
+#include "test-string.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_string_dynamics_adjust__works),
+ cmocka_unit_test(test__f_string_dynamics_append__works),
+ cmocka_unit_test(test__f_string_dynamics_append_all__works),
+ cmocka_unit_test(test__f_string_dynamics_append_all__returns_data_not),
+ cmocka_unit_test(test__f_string_dynamics_decimate_by__works),
+ cmocka_unit_test(test__f_string_dynamics_decrease_by__works),
+ cmocka_unit_test(test__f_string_dynamics_increase__works),
+ cmocka_unit_test(test__f_string_dynamics_increase__returns_data_not),
+ cmocka_unit_test(test__f_string_dynamics_increase_by__works),
+ cmocka_unit_test(test__f_string_dynamics_resize__works),
+
+ cmocka_unit_test(test__f_string_dynamicss_adjust__works),
+ cmocka_unit_test(test__f_string_dynamicss_append__works),
+ cmocka_unit_test(test__f_string_dynamicss_append__returns_data_not),
+ cmocka_unit_test(test__f_string_dynamicss_append_all__works),
+ cmocka_unit_test(test__f_string_dynamicss_append_all__returns_data_not),
+ cmocka_unit_test(test__f_string_dynamicss_decimate_by__works),
+ cmocka_unit_test(test__f_string_dynamicss_decrease_by__works),
+ cmocka_unit_test(test__f_string_dynamicss_increase__works),
+ cmocka_unit_test(test__f_string_dynamicss_increase__returns_data_not),
+ cmocka_unit_test(test__f_string_dynamicss_increase_by__works),
+ cmocka_unit_test(test__f_string_dynamicss_resize__works),
+
+ cmocka_unit_test(test__f_string_maps_adjust__works),
+ cmocka_unit_test(test__f_string_maps_append__works),
+ cmocka_unit_test(test__f_string_maps_append_all__works),
+ cmocka_unit_test(test__f_string_maps_append_all__returns_data_not),
+ cmocka_unit_test(test__f_string_maps_decimate_by__works),
+ cmocka_unit_test(test__f_string_maps_decrease_by__works),
+ cmocka_unit_test(test__f_string_maps_increase__works),
+ cmocka_unit_test(test__f_string_maps_increase__returns_data_not),
+ cmocka_unit_test(test__f_string_maps_increase_by__works),
+ cmocka_unit_test(test__f_string_maps_resize__works),
+
+ cmocka_unit_test(test__f_string_mapss_adjust__works),
+ cmocka_unit_test(test__f_string_mapss_append__works),
+ cmocka_unit_test(test__f_string_mapss_append__returns_data_not),
+ cmocka_unit_test(test__f_string_mapss_append_all__works),
+ cmocka_unit_test(test__f_string_mapss_append_all__returns_data_not),
+ cmocka_unit_test(test__f_string_mapss_decimate_by__works),
+ cmocka_unit_test(test__f_string_mapss_decrease_by__works),
+ cmocka_unit_test(test__f_string_mapss_increase__works),
+ cmocka_unit_test(test__f_string_mapss_increase__returns_data_not),
+ cmocka_unit_test(test__f_string_mapss_increase_by__works),
+ cmocka_unit_test(test__f_string_mapss_resize__works),
+
+ cmocka_unit_test(test__f_string_map_multis_adjust__works),
+ cmocka_unit_test(test__f_string_map_multis_append__works),
+ cmocka_unit_test(test__f_string_map_multis_append_all__works),
+ cmocka_unit_test(test__f_string_map_multis_append_all__returns_data_not),
+ cmocka_unit_test(test__f_string_map_multis_decimate_by__works),
+ cmocka_unit_test(test__f_string_map_multis_decrease_by__works),
+ cmocka_unit_test(test__f_string_map_multis_increase__works),
+ cmocka_unit_test(test__f_string_map_multis_increase__returns_data_not),
+ cmocka_unit_test(test__f_string_map_multis_increase_by__works),
+ cmocka_unit_test(test__f_string_map_multis_resize__works),
+
+ cmocka_unit_test(test__f_string_map_multiss_adjust__works),
+ cmocka_unit_test(test__f_string_map_multiss_append__works),
+ cmocka_unit_test(test__f_string_map_multiss_append__returns_data_not),
+ cmocka_unit_test(test__f_string_map_multiss_append_all__works),
+ cmocka_unit_test(test__f_string_map_multiss_append_all__returns_data_not),
+ cmocka_unit_test(test__f_string_map_multiss_decimate_by__works),
+ cmocka_unit_test(test__f_string_map_multiss_decrease_by__works),
+ cmocka_unit_test(test__f_string_map_multiss_increase__works),
+ cmocka_unit_test(test__f_string_map_multiss_increase__returns_data_not),
+ cmocka_unit_test(test__f_string_map_multiss_increase_by__works),
+ cmocka_unit_test(test__f_string_map_multiss_resize__works),
+
+ cmocka_unit_test(test__f_string_quantitys_adjust__works),
+ cmocka_unit_test(test__f_string_quantitys_append__works),
+ cmocka_unit_test(test__f_string_quantitys_append_all__works),
+ cmocka_unit_test(test__f_string_quantitys_append_all__returns_data_not),
+ cmocka_unit_test(test__f_string_quantitys_decimate_by__works),
+ cmocka_unit_test(test__f_string_quantitys_decrease_by__works),
+ cmocka_unit_test(test__f_string_quantitys_increase__works),
+ cmocka_unit_test(test__f_string_quantitys_increase__returns_data_not),
+ cmocka_unit_test(test__f_string_quantitys_increase_by__works),
+ cmocka_unit_test(test__f_string_quantitys_resize__works),
+
+ cmocka_unit_test(test__f_string_quantityss_adjust__works),
+ cmocka_unit_test(test__f_string_quantityss_append__works),
+ cmocka_unit_test(test__f_string_quantityss_append__returns_data_not),
+ cmocka_unit_test(test__f_string_quantityss_append_all__works),
+ cmocka_unit_test(test__f_string_quantityss_append_all__returns_data_not),
+ cmocka_unit_test(test__f_string_quantityss_decimate_by__works),
+ cmocka_unit_test(test__f_string_quantityss_decrease_by__works),
+ cmocka_unit_test(test__f_string_quantityss_increase__works),
+ cmocka_unit_test(test__f_string_quantityss_increase__returns_data_not),
+ cmocka_unit_test(test__f_string_quantityss_increase_by__works),
+ cmocka_unit_test(test__f_string_quantityss_resize__works),
+
+ cmocka_unit_test(test__f_string_ranges_adjust__works),
+ cmocka_unit_test(test__f_string_ranges_append__works),
+ cmocka_unit_test(test__f_string_ranges_append_all__works),
+ cmocka_unit_test(test__f_string_ranges_append_all__returns_data_not),
+ cmocka_unit_test(test__f_string_ranges_decimate_by__works),
+ cmocka_unit_test(test__f_string_ranges_decrease_by__works),
+ cmocka_unit_test(test__f_string_ranges_increase__works),
+ cmocka_unit_test(test__f_string_ranges_increase__returns_data_not),
+ cmocka_unit_test(test__f_string_ranges_increase_by__works),
+ cmocka_unit_test(test__f_string_ranges_resize__works),
+
+ cmocka_unit_test(test__f_string_rangess_adjust__works),
+ cmocka_unit_test(test__f_string_rangess_append__works),
+ cmocka_unit_test(test__f_string_rangess_append__returns_data_not),
+ cmocka_unit_test(test__f_string_rangess_append_all__works),
+ cmocka_unit_test(test__f_string_rangess_append_all__returns_data_not),
+ cmocka_unit_test(test__f_string_rangess_decimate_by__works),
+ cmocka_unit_test(test__f_string_rangess_decrease_by__works),
+ cmocka_unit_test(test__f_string_rangess_increase__works),
+ cmocka_unit_test(test__f_string_rangess_increase__returns_data_not),
+ cmocka_unit_test(test__f_string_rangess_increase_by__works),
+ cmocka_unit_test(test__f_string_rangess_resize__works),
+
+ cmocka_unit_test(test__f_string_triples_adjust__works),
+ cmocka_unit_test(test__f_string_triples_append__works),
+ cmocka_unit_test(test__f_string_triples_append_all__works),
+ cmocka_unit_test(test__f_string_triples_append_all__returns_data_not),
+ cmocka_unit_test(test__f_string_triples_decimate_by__works),
+ cmocka_unit_test(test__f_string_triples_decrease_by__works),
+ cmocka_unit_test(test__f_string_triples_increase__works),
+ cmocka_unit_test(test__f_string_triples_increase__returns_data_not),
+ cmocka_unit_test(test__f_string_triples_increase_by__works),
+ cmocka_unit_test(test__f_string_triples_resize__works),
+
+ cmocka_unit_test(test__f_string_tripless_adjust__works),
+ cmocka_unit_test(test__f_string_tripless_append__works),
+ cmocka_unit_test(test__f_string_tripless_append__returns_data_not),
+ cmocka_unit_test(test__f_string_tripless_append_all__works),
+ cmocka_unit_test(test__f_string_tripless_append_all__returns_data_not),
+ cmocka_unit_test(test__f_string_tripless_decimate_by__works),
+ cmocka_unit_test(test__f_string_tripless_decrease_by__works),
+ cmocka_unit_test(test__f_string_tripless_increase__works),
+ cmocka_unit_test(test__f_string_tripless_increase__returns_data_not),
+ cmocka_unit_test(test__f_string_tripless_increase_by__works),
+ cmocka_unit_test(test__f_string_tripless_resize__works),
+
+ #ifndef _di_level_0_parameter_checking_
+ cmocka_unit_test(test__f_string_dynamics_adjust__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamics_append__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamics_append_all__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamics_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamics_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamics_increase__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamics_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamics_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_string_dynamicss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamicss_append__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamicss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamicss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamicss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamicss_increase__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamicss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_string_dynamicss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_string_maps_adjust__parameter_checking),
+ cmocka_unit_test(test__f_string_maps_append__parameter_checking),
+ cmocka_unit_test(test__f_string_maps_append_all__parameter_checking),
+ cmocka_unit_test(test__f_string_maps_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_string_maps_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_string_maps_increase__parameter_checking),
+ cmocka_unit_test(test__f_string_maps_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_string_maps_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_string_mapss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_string_mapss_append__parameter_checking),
+ cmocka_unit_test(test__f_string_mapss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_string_mapss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_string_mapss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_string_mapss_increase__parameter_checking),
+ cmocka_unit_test(test__f_string_mapss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_string_mapss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_string_map_multis_adjust__parameter_checking),
+ cmocka_unit_test(test__f_string_map_multis_append__parameter_checking),
+ cmocka_unit_test(test__f_string_map_multis_append_all__parameter_checking),
+ cmocka_unit_test(test__f_string_map_multis_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_string_map_multis_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_string_map_multis_increase__parameter_checking),
+ cmocka_unit_test(test__f_string_map_multis_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_string_map_multis_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_string_map_multiss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_string_map_multiss_append__parameter_checking),
+ cmocka_unit_test(test__f_string_map_multiss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_string_map_multiss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_string_map_multiss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_string_map_multiss_increase__parameter_checking),
+ cmocka_unit_test(test__f_string_map_multiss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_string_map_multiss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_string_quantitys_adjust__parameter_checking),
+ cmocka_unit_test(test__f_string_quantitys_append__parameter_checking),
+ cmocka_unit_test(test__f_string_quantitys_append_all__parameter_checking),
+ cmocka_unit_test(test__f_string_quantitys_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_string_quantitys_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_string_quantitys_increase__parameter_checking),
+ cmocka_unit_test(test__f_string_quantitys_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_string_quantitys_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_string_quantityss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_string_quantityss_append__parameter_checking),
+ cmocka_unit_test(test__f_string_quantityss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_string_quantityss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_string_quantityss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_string_quantityss_increase__parameter_checking),
+ cmocka_unit_test(test__f_string_quantityss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_string_quantityss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_string_ranges_adjust__parameter_checking),
+ cmocka_unit_test(test__f_string_ranges_append__parameter_checking),
+ cmocka_unit_test(test__f_string_ranges_append_all__parameter_checking),
+ cmocka_unit_test(test__f_string_ranges_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_string_ranges_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_string_ranges_increase__parameter_checking),
+ cmocka_unit_test(test__f_string_ranges_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_string_ranges_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_string_rangess_adjust__parameter_checking),
+ cmocka_unit_test(test__f_string_rangess_append__parameter_checking),
+ cmocka_unit_test(test__f_string_rangess_append_all__parameter_checking),
+ cmocka_unit_test(test__f_string_rangess_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_string_rangess_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_string_rangess_increase__parameter_checking),
+ cmocka_unit_test(test__f_string_rangess_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_string_rangess_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_string_triples_adjust__parameter_checking),
+ cmocka_unit_test(test__f_string_triples_append__parameter_checking),
+ cmocka_unit_test(test__f_string_triples_append_all__parameter_checking),
+ cmocka_unit_test(test__f_string_triples_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_string_triples_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_string_triples_increase__parameter_checking),
+ cmocka_unit_test(test__f_string_triples_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_string_triples_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_string_tripless_adjust__parameter_checking),
+ cmocka_unit_test(test__f_string_tripless_append__parameter_checking),
+ cmocka_unit_test(test__f_string_tripless_append_all__parameter_checking),
+ cmocka_unit_test(test__f_string_tripless_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_string_tripless_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_string_tripless_increase__parameter_checking),
+ cmocka_unit_test(test__f_string_tripless_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_string_tripless_resize__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_string_h
+#define _TEST__F_string_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/string.h>
+
+// Mock includes.
+//#include "mock-string.h"
+
+// Test includes.
+#include "test-string-dynamics_adjust.h"
+#include "test-string-dynamics_append.h"
+#include "test-string-dynamics_append_all.h"
+#include "test-string-dynamics_decimate_by.h"
+#include "test-string-dynamics_decrease_by.h"
+#include "test-string-dynamics_increase.h"
+#include "test-string-dynamics_increase_by.h"
+#include "test-string-dynamics_resize.h"
+#include "test-string-dynamicss_adjust.h"
+#include "test-string-dynamicss_append.h"
+#include "test-string-dynamicss_append_all.h"
+#include "test-string-dynamicss_decimate_by.h"
+#include "test-string-dynamicss_decrease_by.h"
+#include "test-string-dynamicss_increase.h"
+#include "test-string-dynamicss_increase_by.h"
+#include "test-string-dynamicss_resize.h"
+#include "test-string-maps_adjust.h"
+#include "test-string-maps_append.h"
+#include "test-string-maps_append_all.h"
+#include "test-string-maps_decimate_by.h"
+#include "test-string-maps_decrease_by.h"
+#include "test-string-maps_increase.h"
+#include "test-string-maps_increase_by.h"
+#include "test-string-maps_resize.h"
+#include "test-string-mapss_adjust.h"
+#include "test-string-mapss_append.h"
+#include "test-string-mapss_append_all.h"
+#include "test-string-mapss_decimate_by.h"
+#include "test-string-mapss_decrease_by.h"
+#include "test-string-mapss_increase.h"
+#include "test-string-mapss_increase_by.h"
+#include "test-string-mapss_resize.h"
+#include "test-string-map_multis_adjust.h"
+#include "test-string-map_multis_append.h"
+#include "test-string-map_multis_append_all.h"
+#include "test-string-map_multis_decimate_by.h"
+#include "test-string-map_multis_decrease_by.h"
+#include "test-string-map_multis_increase.h"
+#include "test-string-map_multis_increase_by.h"
+#include "test-string-map_multis_resize.h"
+#include "test-string-map_multiss_adjust.h"
+#include "test-string-map_multiss_append.h"
+#include "test-string-map_multiss_append_all.h"
+#include "test-string-map_multiss_decimate_by.h"
+#include "test-string-map_multiss_decrease_by.h"
+#include "test-string-map_multiss_increase.h"
+#include "test-string-map_multiss_increase_by.h"
+#include "test-string-map_multiss_resize.h"
+#include "test-string-quantitys_adjust.h"
+#include "test-string-quantitys_append.h"
+#include "test-string-quantitys_append_all.h"
+#include "test-string-quantitys_decimate_by.h"
+#include "test-string-quantitys_decrease_by.h"
+#include "test-string-quantitys_increase.h"
+#include "test-string-quantitys_increase_by.h"
+#include "test-string-quantitys_resize.h"
+#include "test-string-quantityss_adjust.h"
+#include "test-string-quantityss_append.h"
+#include "test-string-quantityss_append_all.h"
+#include "test-string-quantityss_decimate_by.h"
+#include "test-string-quantityss_decrease_by.h"
+#include "test-string-quantityss_increase.h"
+#include "test-string-quantityss_increase_by.h"
+#include "test-string-quantityss_resize.h"
+#include "test-string-ranges_adjust.h"
+#include "test-string-ranges_append.h"
+#include "test-string-ranges_append_all.h"
+#include "test-string-ranges_decimate_by.h"
+#include "test-string-ranges_decrease_by.h"
+#include "test-string-ranges_increase.h"
+#include "test-string-ranges_increase_by.h"
+#include "test-string-ranges_resize.h"
+#include "test-string-rangess_adjust.h"
+#include "test-string-rangess_append.h"
+#include "test-string-rangess_append_all.h"
+#include "test-string-rangess_decimate_by.h"
+#include "test-string-rangess_decrease_by.h"
+#include "test-string-rangess_increase.h"
+#include "test-string-rangess_increase_by.h"
+#include "test-string-rangess_resize.h"
+#include "test-string-triples_adjust.h"
+#include "test-string-triples_append.h"
+#include "test-string-triples_append_all.h"
+#include "test-string-triples_decimate_by.h"
+#include "test-string-triples_decrease_by.h"
+#include "test-string-triples_increase.h"
+#include "test-string-triples_increase_by.h"
+#include "test-string-triples_resize.h"
+#include "test-string-tripless_adjust.h"
+#include "test-string-tripless_append.h"
+#include "test-string-tripless_append_all.h"
+#include "test-string-tripless_decimate_by.h"
+#include "test-string-tripless_decrease_by.h"
+#include "test-string-tripless_increase.h"
+#include "test-string-tripless_increase_by.h"
+#include "test-string-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_string_h
} // for
status = f_memory_adjust(attributes->size, length, sizeof(f_thread_attribute_t), (void **) & attributes->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- attributes->size = length;
+ attributes->size = length;
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
+ if (attributes->used > attributes->size) {
+ attributes->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_)
} // for
status = f_memory_resize(attributes->size, length, sizeof(f_thread_attribute_t), (void **) & attributes->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- attributes->size = length;
+ attributes->size = length;
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
+ if (attributes->used > attributes->size) {
+ attributes->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_attributes_decrease_) || !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_)
} // for
status = f_memory_adjust(barriers->size, length, sizeof(f_thread_barrier_t), (void **) & barriers->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- barriers->size = length;
+ barriers->size = length;
- if (barriers->used > barriers->size) {
- barriers->used = length;
- }
+ if (barriers->used > barriers->size) {
+ barriers->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_)
} // for
status = f_memory_resize(barriers->size, length, sizeof(f_thread_barrier_t), (void **) & barriers->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- barriers->size = length;
+ barriers->size = length;
- if (barriers->used > barriers->size) {
- barriers->used = length;
- }
+ if (barriers->used > barriers->size) {
+ barriers->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_)
} // for
status = f_memory_adjust(attributes->size, length, sizeof(f_thread_barrier_attribute_t), (void **) & attributes->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- attributes->size = length;
+ attributes->size = length;
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
+ if (attributes->used > attributes->size) {
+ attributes->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_)
} // for
status = f_memory_resize(attributes->size, length, sizeof(f_thread_barrier_attribute_t), (void **) & attributes->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- attributes->size = length;
+ attributes->size = length;
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
+ if (attributes->used > attributes->size) {
+ attributes->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_barrier_attributes_decrease_) || !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_)
} // for
status = f_memory_adjust(attributes->size, length, sizeof(f_thread_condition_attribute_t), (void **) & attributes->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- attributes->size = length;
+ attributes->size = length;
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
+ if (attributes->used > attributes->size) {
+ attributes->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_)
} // for
status = f_memory_resize(attributes->size, length, sizeof(f_thread_condition_attribute_t), (void **) & attributes->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- attributes->size = length;
+ attributes->size = length;
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
+ if (attributes->used > attributes->size) {
+ attributes->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_)
} // for
status = f_memory_adjust(conditions->size, length, sizeof(f_thread_condition_t), (void **) & conditions->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- conditions->size = length;
+ conditions->size = length;
- if (conditions->used > conditions->size) {
- conditions->used = length;
- }
+ if (conditions->used > conditions->size) {
+ conditions->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_)
} // for
status = f_memory_resize(conditions->size, length, sizeof(f_thread_condition_t), (void **) & conditions->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- conditions->size = length;
+ conditions->size = length;
- if (conditions->used > conditions->size) {
- conditions->used = length;
- }
+ if (conditions->used > conditions->size) {
+ conditions->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_conditions_decrease_) || !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_)
} // for
status = f_memory_adjust(keys->size, length, sizeof(f_thread_key_t), (void **) & keys->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- keys->size = length;
+ keys->size = length;
- if (keys->used > keys->size) {
- keys->used = length;
- }
+ if (keys->used > keys->size) {
+ keys->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_)
} // for
status = f_memory_resize(keys->size, length, sizeof(f_thread_key_t), (void **) & keys->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- keys->size = length;
+ keys->size = length;
- if (keys->used > keys->size) {
- keys->used = length;
- }
+ if (keys->used > keys->size) {
+ keys->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_keys_decrease_) || !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_)
} // for
status = f_memory_adjust(locks->size, length, sizeof(f_thread_lock_t), (void **) & locks->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- locks->size = length;
+ locks->size = length;
- if (locks->used > locks->size) {
- locks->used = length;
- }
+ if (locks->used > locks->size) {
+ locks->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_)
} // for
status = f_memory_resize(locks->size, length, sizeof(f_thread_lock_t), (void **) & locks->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- locks->size = length;
+ locks->size = length;
- if (locks->used > locks->size) {
- locks->used = length;
- }
+ if (locks->used > locks->size) {
+ locks->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_locks_decrease_) || !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_)
} // for
status = f_memory_adjust(attributes->size, length, sizeof(f_thread_lock_t), (void **) & attributes->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- attributes->size = length;
+ attributes->size = length;
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
+ if (attributes->used > attributes->size) {
+ attributes->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_)
} // for
status = f_memory_resize(attributes->size, length, sizeof(f_thread_lock_t), (void **) & attributes->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- attributes->size = length;
+ attributes->size = length;
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
+ if (attributes->used > attributes->size) {
+ attributes->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_lock_attributes_decrease_) || !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_)
} // for
status = f_memory_adjust(attributes->size, length, sizeof(f_thread_mutex_t), (void **) & attributes->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- attributes->size = length;
+ attributes->size = length;
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
+ if (attributes->used > attributes->size) {
+ attributes->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_)
} // for
status = f_memory_resize(attributes->size, length, sizeof(f_thread_mutex_t), (void **) & attributes->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- attributes->size = length;
+ attributes->size = length;
- if (attributes->used > attributes->size) {
- attributes->used = length;
- }
+ if (attributes->used > attributes->size) {
+ attributes->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_mutex_attributes_decrease_) || !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_)
} // for
status = f_memory_adjust(mutexs->size, length, sizeof(f_thread_mutex_t), (void **) & mutexs->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- mutexs->size = length;
+ mutexs->size = length;
- if (mutexs->used > mutexs->size) {
- mutexs->used = length;
- }
+ if (mutexs->used > mutexs->size) {
+ mutexs->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_)
} // for
status = f_memory_resize(mutexs->size, length, sizeof(f_thread_mutex_t), (void **) & mutexs->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- mutexs->size = length;
+ mutexs->size = length;
- if (mutexs->used > mutexs->size) {
- mutexs->used = length;
- }
+ if (mutexs->used > mutexs->size) {
+ mutexs->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_mutexs_decrease_) || !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_)
} // for
status = f_memory_resize(semaphores->size, length, sizeof(f_thread_semaphore_t), (void **) & semaphores->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- semaphores->size = length;
+ semaphores->size = length;
- if (semaphores->used > semaphores->size) {
- semaphores->used = length;
- }
+ if (semaphores->used > semaphores->size) {
+ semaphores->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_semaphores_decrease_) || !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_)
} // for
status = f_memory_adjust(sets->size, length, sizeof(f_thread_set_t), (void **) & sets->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- sets->size = length;
+ sets->size = length;
- if (sets->used > sets->size) {
- sets->used = length;
- }
+ if (sets->used > sets->size) {
+ sets->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_)
} // for
status = f_memory_resize(sets->size, length, sizeof(f_thread_set_t), (void **) & sets->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- sets->size = length;
+ sets->size = length;
- if (sets->used > sets->size) {
- sets->used = length;
- }
+ if (sets->used > sets->size) {
+ sets->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_sets_decrease_) || !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_)
} // for
status = f_memory_adjust(spins->size, length, sizeof(f_thread_spin_t), (void **) & spins->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- spins->size = length;
+ spins->size = length;
- if (spins->used > spins->size) {
- spins->used = length;
- }
+ if (spins->used > spins->size) {
+ spins->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_)
} // for
status = f_memory_resize(spins->size, length, sizeof(f_thread_spin_t), (void **) & spins->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- spins->size = length;
+ spins->size = length;
- if (spins->used > spins->size) {
- spins->used = length;
- }
+ if (spins->used > spins->size) {
+ spins->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_)
*/
#ifndef _di_f_status_t_
typedef uint16_t f_status_t;
+
+ #define f_status_t_initialize F_none
#endif // _di_f_status_t_
/**
* Provide a 128-bit type wrapper, which could be either 64-bit or 128-bit depending on support.
*
* This is __int128_t when 128-bit is supported and int64_t when not supported.
+ *
+ * This provides the types without the normal "f_" leading prefixes to be more in line with the core types like int64_t.
*/
#ifndef __SIZEOF_INT128__
#ifndef _di_int128_t_
- typedef __int128_t f_int128_t;
+ typedef __int128_t int128_t;
#endif // _di_int128_t_
#ifndef _di_uint128_t_
- typedef __uint128_t f_uint128_t;
+ typedef __uint128_t uint128_t;
#endif // _di_uint128_t_
#else // __SIZEOF_INT128__
#ifndef _di_int128_t_
- typedef int64_t f_int128_t;
+ typedef int64_t int128_t;
#endif // _di_int128_t_
#ifndef _di_uint128_t_
- typedef uint64_t f_uint128_t;
+ typedef uint64_t uint128_t;
#endif // _di_uint128_t_
#endif // __SIZEOF_INT128__
/**
- * An array of f_int128_t.
+ * An array of int128_t.
*
* The macros are defined in type_array.h or type_array-common.h.
*
- * array: The array of f_int128_t.
+ * array: The array of int128_t.
* size: Total amount of allocated space.
* used: Total number of allocated spaces used.
*/
#ifndef _di_int128s_t_
typedef struct {
- f_int128_t *array;
+ int128_t *array;
f_array_length_t size;
f_array_length_t used;
#endif // _di_int128s_t_
/**
- * An array of and array of f_int128_t.
+ * An array of and array of int128_t.
*
* The macros are defined in type_array.h or type_array-common.h.
*
- * array: The array of and array of f_int128_t.
+ * array: The array of and array of int128_t.
* size: Total amount of allocated space.
* used: Total number of allocated spaces used.
*/
#endif // _di_int128ss_t_
/**
- * An array of f_uint128_t.
+ * An array of uint128_t.
*
* The macros are defined in type_array.h or type_array-common.h.
*
- * array: The array of f_uint128_t.
+ * array: The array of uint128_t.
* size: Total amount of allocated space.
* used: Total number of allocated spaces used.
*/
#ifndef _di_uint128s_t_
typedef struct {
- f_uint128_t *array;
+ uint128_t *array;
f_array_length_t size;
f_array_length_t used;
#endif // _di_uint128s_t_
/**
- * An array of and array of f_uint128_t.
+ * An array of and array of uint128_t.
*
* The macros are defined in type_array.h or type_array-common.h.
*
- * array: The array of and array of f_uint128_t.
+ * array: The array of and array of uint128_t.
* size: Total amount of allocated space.
* used: Total number of allocated spaces used.
*/
* used: A representation of how many bytes in name are in used (if 0, then there is no name, thus this can be seen as not a valid identifier).
*/
#ifndef _di_f_fll_id_t_
+ #define f_fll_id_name_length_d 64
+
typedef struct {
- char name[64];
+ char name[f_fll_id_name_length_d];
uint16_t type;
uint8_t used;
#include <fll/level_0/type_array/int128.h>
#include <fll/level_0/type_array/state.h>
#include <fll/level_0/type_array/status.h>
+#include <fll/level_0/type_array/uint8.h>
+#include <fll/level_0/type_array/uint16.h>
+#include <fll/level_0/type_array/uint32.h>
+#include <fll/level_0/type_array/uint64.h>
+#include <fll/level_0/type_array/uint128.h>
#ifdef __cplusplus
extern "C" {
#endif // _di_f_array_lengths_adjust_
#ifndef _di_f_array_lengths_append_
- f_status_t f_array_lengths_append(const f_array_lengths_t source, f_array_lengths_t *destination) {
+ f_status_t f_array_lengths_append(const f_array_length_t source, f_array_lengths_t *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;
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_array_lengths_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
- return private_f_array_lengths_append(source, destination);
+ destination->array[destination->used++] = source;
+
+ return F_none;
}
#endif // _di_f_array_lengths_append_
+#ifndef _di_f_array_lengths_append_all_
+ f_status_t f_array_lengths_append_all(const f_array_lengths_t source, f_array_lengths_t *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_array_lengths_append_all(source, destination);
+ }
+#endif // _di_f_array_lengths_append_all_
+
#ifndef _di_f_array_lengths_decimate_by_
f_status_t f_array_lengths_decimate_by(const f_array_length_t amount, f_array_lengths_t *lengths) {
#ifndef _di_level_0_parameter_checking_
#endif // _di_f_array_lengthss_adjust_
#ifndef _di_f_array_lengthss_append_
- f_status_t f_array_lengthss_append(const f_array_lengthss_t source, f_array_lengthss_t *destination) {
+ f_status_t f_array_lengthss_append(const f_array_lengths_t source, f_array_lengthss_t *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_array_lengthss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ status = private_f_array_lengths_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_array_lengthss_append_
+
+#ifndef _di_f_array_lengthss_append_all_
+ f_status_t f_array_lengthss_append_all(const f_array_lengthss_t source, f_array_lengthss_t *destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
}
for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
- status = private_f_array_lengths_append(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
+
+ destination->array[destination->used].used = 0;
+
+ if (source.array[i].used) {
+ status = private_f_array_lengths_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
} // for
return F_none;
}
-#endif // _di_f_array_lengthss_append_
+#endif // _di_f_array_lengthss_append_all_
#ifndef _di_f_array_lengthss_decimate_by_
f_status_t f_array_lengthss_decimate_by(const f_array_length_t amount, f_array_lengthss_t *lengthss) {
#endif // _di_f_array_lengths_adjust_
/**
- * Append the source lengths onto the destination.
+ * Append the single source length onto the destination.
*
* @param source
- * The source lengths to append.
+ * The source length to append.
* @param destination
* The destination lengths the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_array_lengths_append_
- extern f_status_t f_array_lengths_append(const f_array_lengths_t source, f_array_lengths_t *destination);
+ extern f_status_t f_array_lengths_append(const f_array_length_t source, f_array_lengths_t *destination);
#endif // _di_f_array_lengths_append_
/**
+ * Append the source lengths onto the destination.
+ *
+ * @param source
+ * The source lengths to append.
+ * @param destination
+ * The destination lengths 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_array_lengths_append_all_
+ extern f_status_t f_array_lengths_append_all(const f_array_lengths_t source, f_array_lengths_t *destination);
+#endif // _di_f_array_lengths_append_all_
+
+/**
* Resize the string lengths array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
#endif // _di_f_array_lengthss_adjust_
/**
- * Append the source lengthss onto the destination.
+ * Append the single source lengths onto the destination.
*
* @param source
- * The source lengthss to append.
+ * The source lengths to append.
* @param destination
* The destination ranges the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_array_lengthss_append_
- extern f_status_t f_array_lengthss_append(const f_array_lengthss_t source, f_array_lengthss_t *destination);
+ extern f_status_t f_array_lengthss_append(const f_array_lengths_t source, f_array_lengthss_t *destination);
#endif // _di_f_array_lengthss_append_
/**
- * Resize the string lengthss array.
+ * Append the source lengthss onto the destination.
*
- * @param length
- * The new size to use.
- * @param lengthss
- * The string lengthss array to resize.
+ * @param source
+ * The source lengthss to append.
+ * @param destination
+ * The destination ranges 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.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_array_lengthss_adjust_
- extern f_status_t f_array_lengthss_adjust(const f_array_length_t length, f_array_lengthss_t *lengthss);
-#endif // _di_f_array_lengthss_adjust_
+#ifndef _di_f_array_lengthss_append_all_
+ extern f_status_t f_array_lengthss_append_all(const f_array_lengthss_t source, f_array_lengthss_t *destination);
+#endif // _di_f_array_lengthss_append_all_
/**
* Resize the string lengthss array to a smaller size.
#endif // _di_f_cells_adjust_
#ifndef _di_f_cells_append_
- f_status_t f_cells_append(const f_cells_t source, f_cells_t *destination) {
+ f_status_t f_cells_append(const f_cell_t source, f_cells_t *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_cells_append(source, destination);
}
#endif // _di_f_cells_append_
+#ifndef _di_f_cells_append_all_
+ f_status_t f_cells_append_all(const f_cells_t source, f_cells_t *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_cells_append_all(source, destination);
+ }
+#endif // _di_f_cells_append_all_
+
#ifndef _di_f_cells_decimate_by_
f_status_t f_cells_decimate_by(const f_array_length_t amount, f_cells_t *cells) {
#ifndef _di_level_0_parameter_checking_
#endif // _di_f_cellss_adjust_
#ifndef _di_f_cellss_append_
- f_status_t f_cellss_append(const f_cellss_t source, f_cellss_t *destination) {
+ f_status_t f_cellss_append(const f_cells_t source, f_cellss_t *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_cellss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ status = private_f_cells_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_cellss_append_
+
+#ifndef _di_f_cellss_append_all_
+ f_status_t f_cellss_append_all(const f_cellss_t source, f_cellss_t *destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
}
for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
- status = private_f_cells_append(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
+
+ destination->array[destination->used].used = 0;
+
+ if (source.array[i].used) {
+ status = private_f_cells_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
} // for
return F_none;
}
-#endif // _di_f_cellss_append_
+#endif // _di_f_cellss_append_all_
#ifndef _di_f_cellss_decimate_by_
f_status_t f_cellss_decimate_by(const f_array_length_t amount, f_cellss_t *cellss) {
#endif // _di_f_cells_adjust_
/**
- * Append the source cells onto the destination.
+ * Append the single source cell onto the destination.
*
* @param source
- * The source cells to append.
+ * The source cell to append.
* @param destination
* The destination cells the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_cells_append_
- extern f_status_t f_cells_append(const f_cells_t source, f_cells_t *destination);
+ extern f_status_t f_cells_append(const f_cell_t source, f_cells_t *destination);
#endif // _di_f_cells_append_
/**
+ * Append the source cells onto the destination.
+ *
+ * @param source
+ * The source cells to append.
+ * @param destination
+ * The destination cells 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_cells_append_all_
+ extern f_status_t f_cells_append_all(const f_cells_t source, f_cells_t *destination);
+#endif // _di_f_cells_append_all_
+
+/**
* Resize the string cells array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
#endif // _di_f_cellss_adjust_
/**
- * Append the source cellss onto the destination.
+ * Append the single source cells onto the destination.
*
* @param source
- * The source cellss to append.
+ * The source cells to append.
* @param destination
* The destination ranges the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_cellss_append_
- extern f_status_t f_cellss_append(const f_cellss_t source, f_cellss_t *destination);
+ extern f_status_t f_cellss_append(const f_cells_t source, f_cellss_t *destination);
#endif // _di_f_cellss_append_
/**
- * Resize the string cellss array.
+ * Append the source cellss onto the destination.
*
- * @param length
- * The new size to use.
- * @param cellss
- * The string cellss array to resize.
+ * @param source
+ * The source cellss to append.
+ * @param destination
+ * The destination ranges 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.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_cellss_adjust_
- extern f_status_t f_cellss_adjust(const f_array_length_t length, f_cellss_t *cellss);
-#endif // _di_f_cellss_adjust_
+#ifndef _di_f_cellss_append_all_
+ extern f_status_t f_cellss_append_all(const f_cellss_t source, f_cellss_t *destination);
+#endif // _di_f_cellss_append_all_
/**
* Resize the string cellss array to a smaller size.
#endif // _di_f_fll_ids_adjust_
#ifndef _di_f_fll_ids_append_
- f_status_t f_fll_ids_append(const f_fll_ids_t source, f_fll_ids_t *destination) {
+ f_status_t f_fll_ids_append(const f_fll_id_t source, f_fll_ids_t *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_fll_ids_append(source, destination);
}
#endif // _di_f_fll_ids_append_
+#ifndef _di_f_fll_ids_append_all_
+ f_status_t f_fll_ids_append_all(const f_fll_ids_t source, f_fll_ids_t *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_fll_ids_append_all(source, destination);
+ }
+#endif // _di_f_fll_ids_append_all_
+
#ifndef _di_f_fll_ids_decimate_by_
f_status_t f_fll_ids_decimate_by(const f_array_length_t amount, f_fll_ids_t *ids) {
#ifndef _di_level_0_parameter_checking_
#endif // _di_f_fll_idss_adjust_
#ifndef _di_f_fll_idss_append_
- f_status_t f_fll_idss_append(const f_fll_idss_t source, f_fll_idss_t *destination) {
+ f_status_t f_fll_idss_append(const f_fll_ids_t source, f_fll_idss_t *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_fll_idss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ status = private_f_fll_ids_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_fll_idss_append_
+
+#ifndef _di_f_fll_idss_append_all_
+ f_status_t f_fll_idss_append_all(const f_fll_idss_t source, f_fll_idss_t *destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
}
for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
- status = private_f_fll_ids_append(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
+
+ destination->array[destination->used].used = 0;
+
+ if (source.array[i].used) {
+ status = private_f_fll_ids_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
} // for
return F_none;
}
-#endif // _di_f_fll_idss_append_
+#endif // _di_f_fll_idss_append_all_
#ifndef _di_f_fll_idss_decimate_by_
f_status_t f_fll_idss_decimate_by(const f_array_length_t amount, f_fll_idss_t *idss) {
#endif // _di_f_fll_ids_adjust_
/**
- * Append the source ids onto the destination.
+ * Append the single source fll_id onto the destination.
*
* @param source
- * The source ids to append.
+ * The source fll_id to append.
* @param destination
- * The destination ids the source is appended onto.
+ * The destination fll_ids the source is appended onto.
*
* @return
* F_none on success.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_fll_ids_append_
- extern f_status_t f_fll_ids_append(const f_fll_ids_t source, f_fll_ids_t *destination);
+ extern f_status_t f_fll_ids_append(const f_fll_id_t source, f_fll_ids_t *destination);
#endif // _di_f_fll_ids_append_
/**
+ * Append the source fll_ids onto the destination.
+ *
+ * @param source
+ * The source fll_ids to append.
+ * @param destination
+ * The destination fll_ids 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_fll_ids_append_all_
+ extern f_status_t f_fll_ids_append_all(const f_fll_ids_t source, f_fll_ids_t *destination);
+#endif // _di_f_fll_ids_append_all_
+
+/**
* Resize the string ids array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
#endif // _di_f_fll_idss_adjust_
/**
- * Append the source idss onto the destination.
+ * Append the single source fll_ids onto the destination.
*
* @param source
- * The source idss to append.
+ * The source fll_ids to append.
* @param destination
* The destination ranges the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_fll_idss_append_
- extern f_status_t f_fll_idss_append(const f_fll_idss_t source, f_fll_idss_t *destination);
+ extern f_status_t f_fll_idss_append(const f_fll_ids_t source, f_fll_idss_t *destination);
#endif // _di_f_fll_idss_append_
/**
- * Resize the string idss array.
+ * Append the source fll_idss onto the destination.
*
- * @param length
- * The new size to use.
- * @param idss
- * The string idss array to resize.
+ * @param source
+ * The source fll_idss to append.
+ * @param destination
+ * The destination ranges 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.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_fll_idss_adjust_
- extern f_status_t f_fll_idss_adjust(const f_array_length_t length, f_fll_idss_t *idss);
-#endif // _di_f_fll_idss_adjust_
+#ifndef _di_f_fll_idss_append_all_
+ extern f_status_t f_fll_idss_append_all(const f_fll_idss_t source, f_fll_idss_t *destination);
+#endif // _di_f_fll_idss_append_all_
/**
* Resize the string idss array to a smaller size.
#endif // _di_f_int128s_adjust_
#ifndef _di_f_int128s_append_
- f_status_t f_int128s_append(const f_int128s_t source, f_int128s_t *destination) {
+ f_status_t f_int128s_append(const int128_t source, f_int128s_t *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_int128s_append(source, destination);
}
#endif // _di_f_int128s_append_
+#ifndef _di_f_int128s_append_all_
+ f_status_t f_int128s_append_all(const f_int128s_t source, f_int128s_t *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_int128s_append_all(source, destination);
+ }
+#endif // _di_f_int128s_append_all_
+
#ifndef _di_f_int128s_decimate_by_
f_status_t f_int128s_decimate_by(const f_array_length_t amount, f_int128s_t *int128s) {
#ifndef _di_level_0_parameter_checking_
#endif // _di_f_int128ss_adjust_
#ifndef _di_f_int128ss_append_
- f_status_t f_int128ss_append(const f_int128ss_t source, f_int128ss_t *destination) {
+ f_status_t f_int128ss_append(const f_int128s_t source, f_int128ss_t *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_int128ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ status = private_f_int128s_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_int128ss_append_
+
+#ifndef _di_f_int128ss_append_all_
+ f_status_t f_int128ss_append_all(const f_int128ss_t source, f_int128ss_t *destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
}
for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
- status = private_f_int128s_append(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
+
+ destination->array[destination->used].used = 0;
+
+ if (source.array[i].used) {
+ status = private_f_int128s_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
} // for
return F_none;
}
-#endif // _di_f_int128ss_append_
+#endif // _di_f_int128ss_append_all_
#ifndef _di_f_int128ss_decimate_by_
f_status_t f_int128ss_decimate_by(const f_array_length_t amount, f_int128ss_t *int128ss) {
}
#endif // _di_f_int128ss_resize_
-#ifndef _di_f_uint128s_adjust_
- f_status_t f_uint128s_adjust(const f_array_length_t length, f_uint128s_t *uint128s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint128s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint128s_adjust(length, uint128s);
- }
-#endif // _di_f_uint128s_adjust_
-
-#ifndef _di_f_uint128s_append_
- f_status_t f_uint128s_append(const f_uint128s_t source, f_uint128s_t *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_uint128s_append(source, destination);
- }
-#endif // _di_f_uint128s_append_
-
-#ifndef _di_f_uint128s_decimate_by_
- f_status_t f_uint128s_decimate_by(const f_array_length_t amount, f_uint128s_t *uint128s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint128s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint128s->size - amount > 0) {
- return private_f_uint128s_adjust(uint128s->size - amount, uint128s);
- }
-
- return private_f_uint128s_adjust(0, uint128s);
- }
-#endif // _di_f_uint128s_decimate_by_
-
-#ifndef _di_f_uint128s_decrease_by_
- f_status_t f_uint128s_decrease_by(const f_array_length_t amount, f_uint128s_t *uint128s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint128s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint128s->size - amount > 0) {
- return private_f_uint128s_resize(uint128s->size - amount, uint128s);
- }
-
- return private_f_uint128s_resize(0, uint128s);
- }
-#endif // _di_f_uint128s_decrease_by_
-
-#ifndef _di_f_uint128s_increase_
- f_status_t f_uint128s_increase(const f_array_length_t step, f_uint128s_t *uint128s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint128s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (step && uint128s->used + 1 > uint128s->size) {
- f_array_length_t size = uint128s->used + step;
-
- if (size > F_array_length_t_size_d) {
- if (uint128s->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_uint128s_resize(size, uint128s);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint128s_increase_
-
-#ifndef _di_f_uint128s_increase_by_
- f_status_t f_uint128s_increase_by(const f_array_length_t amount, f_uint128s_t *uint128s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint128s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint128s->used + amount > uint128s->size) {
- if (uint128s->used + amount > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_uint128s_resize(uint128s->used + amount, uint128s);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint128s_increase_by_
-
-#ifndef _di_f_uint128s_resize_
- f_status_t f_uint128s_resize(const f_array_length_t length, f_uint128s_t *uint128s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint128s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint128s_resize(length, uint128s);
- }
-#endif // _di_f_uint128s_resize_
-
-#ifndef _di_f_uint128ss_adjust_
- f_status_t f_uint128ss_adjust(const f_array_length_t length, f_uint128ss_t *uint128ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint128ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint128ss_adjust(length, uint128ss);
- }
-#endif // _di_f_uint128ss_adjust_
-
-#ifndef _di_f_uint128ss_append_
- f_status_t f_uint128ss_append(const f_uint128ss_t source, f_uint128ss_t *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_uint128ss_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) {
- status = private_f_uint128s_append(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
- } // for
-
- return F_none;
- }
-#endif // _di_f_uint128ss_append_
-
-#ifndef _di_f_uint128ss_decimate_by_
- f_status_t f_uint128ss_decimate_by(const f_array_length_t amount, f_uint128ss_t *uint128ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint128ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint128ss->size - amount > 0) {
- return private_f_uint128ss_adjust(uint128ss->size - amount, uint128ss);
- }
-
- return private_f_uint128ss_adjust(0, uint128ss);
- }
-#endif // _di_f_uint128ss_decimate_by_
-
-#ifndef _di_f_uint128ss_decrease_by_
- f_status_t f_uint128ss_decrease_by(const f_array_length_t amount, f_uint128ss_t *uint128ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint128ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint128ss->size - amount > 0) {
- return private_f_uint128ss_resize(uint128ss->size - amount, uint128ss);
- }
-
- return private_f_uint128ss_resize(0, uint128ss);
- }
-#endif // _di_f_uint128ss_decrease_by_
-
-#ifndef _di_f_uint128ss_increase_
- f_status_t f_uint128ss_increase(const f_array_length_t step, f_uint128ss_t *uint128ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint128ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (step && uint128ss->used + 1 > uint128ss->size) {
- f_array_length_t size = uint128ss->used + step;
-
- if (size > F_array_length_t_size_d) {
- if (uint128ss->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_uint128ss_resize(size, uint128ss);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint128ss_increase_
-
-#ifndef _di_f_uint128ss_increase_by_
- f_status_t f_uint128ss_increase_by(const f_array_length_t amount, f_uint128ss_t *uint128ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint128ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint128ss->used + amount > uint128ss->size) {
- if (uint128ss->used + amount > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_uint128ss_resize(uint128ss->used + amount, uint128ss);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint128ss_increase_by_
-
-#ifndef _di_f_uint128ss_resize_
- f_status_t f_uint128ss_resize(const f_array_length_t length, f_uint128ss_t *uint128ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint128ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint128ss_resize(length, uint128ss);
- }
-#endif // _di_f_uint128ss_resize_
-
#ifdef __cplusplus
} // extern "C"
#endif
#endif // _di_f_int128s_adjust_
/**
- * Append the source int128s onto the destination.
+ * Append the single source int128 onto the destination.
*
* @param source
- * The source int128s to append.
+ * The source int128 to append.
* @param destination
* The destination int128s the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_int128s_append_
- extern f_status_t f_int128s_append(const f_int128s_t source, f_int128s_t *destination);
+ extern f_status_t f_int128s_append(const int128_t source, f_int128s_t *destination);
#endif // _di_f_int128s_append_
/**
+ * Append the source int128s onto the destination.
+ *
+ * @param source
+ * The source int128s to append.
+ * @param destination
+ * The destination int128s 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_int128s_append_all_
+ extern f_status_t f_int128s_append_all(const f_int128s_t source, f_int128s_t *destination);
+#endif // _di_f_int128s_append_all_
+
+/**
* Resize the int128s array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
#endif // _di_f_int128ss_adjust_
/**
- * Append the source int128ss onto the destination.
+ * Append the single source int128 onto the destination.
*
* @param source
- * The source int128ss to append.
+ * The source int128s to append.
* @param destination
* The destination ranges the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_int128ss_append_
- extern f_status_t f_int128ss_append(const f_int128ss_t source, f_int128ss_t *destination);
+ extern f_status_t f_int128ss_append(const f_int128s_t source, f_int128ss_t *destination);
#endif // _di_f_int128ss_append_
/**
- * Resize the int128ss array.
+ * Append the source int128ss onto the destination.
*
- * @param length
- * The new size to use.
- * @param int128ss
- * The int128ss array to resize.
+ * @param source
+ * The source int128ss to append.
+ * @param destination
+ * The destination ranges 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.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_int128ss_adjust_
- extern f_status_t f_int128ss_adjust(const f_array_length_t length, f_int128ss_t *int128ss);
-#endif // _di_f_int128ss_adjust_
+#ifndef _di_f_int128ss_append_all_
+ extern f_status_t f_int128ss_append_all(const f_int128ss_t source, f_int128ss_t *destination);
+#endif // _di_f_int128ss_append_all_
/**
* Resize the int128ss array to a smaller size.
extern f_status_t f_int128ss_resize(const f_array_length_t length, f_int128ss_t *int128ss);
#endif // _di_f_int128ss_resize_
-/**
- * Resize the string uint128s array.
- *
- * @param length
- * The new size to use.
- * @param uint128s
- * The string uint128s 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_uint128s_adjust_
- extern f_status_t f_uint128s_adjust(const f_array_length_t length, f_uint128s_t *uint128s);
-#endif // _di_f_uint128s_adjust_
-
-/**
- * Append the source uint128s onto the destination.
- *
- * @param source
- * The source uint128s to append.
- * @param destination
- * The destination uint128s 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.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint128s_append_
- extern f_status_t f_uint128s_append(const f_uint128s_t source, f_uint128s_t *destination);
-#endif // _di_f_uint128s_append_
-
-/**
- * Resize the string uint128s 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 les than 0.
- *
- * @param amount
- * A positive number representing how much to decimate the size by.
- * @param uint128s
- * The string uint128s 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_adjust().
- */
-#ifndef _di_f_uint128s_decimate_by_
- extern f_status_t f_uint128s_decimate_by(const f_array_length_t amount, f_uint128s_t *uint128s);
-#endif // _di_f_uint128s_decimate_by_
-
-/**
- * Resize the string uint128s 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 les than 0.
- *
- * @param amount
- * A positive number representing how much to decrease the size by.
- * @param uint128s
- * The string uint128s 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_uint128s_decrease_by_
- extern f_status_t f_uint128s_decrease_by(const f_array_length_t amount, f_uint128s_t *uint128s);
-#endif // _di_f_uint128s_decrease_by_
-
-/**
- * Increase the size of the string uint128s array, but only if necesary.
- *
- * 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 uint128s
- * The string uint128s 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_uint128s_increase_
- extern f_status_t f_uint128s_increase(const f_array_length_t step, f_uint128s_t *uint128s);
-#endif // _di_f_uint128s_increase_
-
-/**
- * Resize the string uint128s 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 uint128s
- * The string uint128s 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_uint128s_increase_by_
- extern f_status_t f_uint128s_increase_by(const f_array_length_t amount, f_uint128s_t *uint128s);
-#endif // _di_f_uint128s_increase_by_
-
-/**
- * Resize the string uint128s array.
- *
- * @param length
- * The new size to use.
- * @param uint128s
- * The string uint128s 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_uint128s_resize_
- extern f_status_t f_uint128s_resize(const f_array_length_t length, f_uint128s_t *uint128s);
-#endif // _di_f_uint128s_resize_
-
-/**
- * Resize the string uint128ss array.
- *
- * @param length
- * The new size to use.
- * @param uint128ss
- * The string uint128ss 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().
- * Errors (with error bit) from: f_memory_destroy().
- */
-#ifndef _di_f_uint128ss_adjust_
- extern f_status_t f_uint128ss_adjust(const f_array_length_t length, f_uint128ss_t *uint128ss);
-#endif // _di_f_uint128ss_adjust_
-
-/**
- * Append the source uint128ss onto the destination.
- *
- * @param source
- * The source uint128ss to append.
- * @param destination
- * The destination ranges 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.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint128ss_append_
- extern f_status_t f_uint128ss_append(const f_uint128ss_t source, f_uint128ss_t *destination);
-#endif // _di_f_uint128ss_append_
-
-/**
- * Resize the string uint128ss array.
- *
- * @param length
- * The new size to use.
- * @param uint128ss
- * The string uint128ss 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().
- * Errors (with error bit) from: f_memory_destroy().
- */
-#ifndef _di_f_uint128ss_adjust_
- extern f_status_t f_uint128ss_adjust(const f_array_length_t length, f_uint128ss_t *uint128ss);
-#endif // _di_f_uint128ss_adjust_
-
-/**
- * Resize the string uint128ss 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 uint128ss
- * The string uint128ss 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().
- * Errors (with error bit) from: f_memory_destroy().
- */
-#ifndef _di_f_uint128ss_decimate_by_
- extern f_status_t f_uint128ss_decimate_by(const f_array_length_t amount, f_uint128ss_t *uint128ss);
-#endif // _di_f_uint128ss_decimate_by_
-
-/**
- * Resize the string uint128ss 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 uint128ss
- * The string uint128ss 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_delete().
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint128ss_decrease_by_
- extern f_status_t f_uint128ss_decrease_by(const f_array_length_t amount, f_uint128ss_t *uint128ss);
-#endif // _di_f_uint128ss_decrease_by_
-
-/**
- * Increase the size of the string uint128ss 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 uint128ss
- * The string uint128ss 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_uint128ss_increase_
- extern f_status_t f_uint128ss_increase(const f_array_length_t step, f_uint128ss_t *uint128ss);
-#endif // _di_f_uint128ss_increase_
-
-/**
- * Resize the string uint128ss 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 uint128ss
- * The string uint128ss 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_uint128ss_increase_by_
- extern f_status_t f_uint128ss_increase_by(const f_array_length_t amount, f_uint128ss_t *uint128ss);
-#endif // _di_f_uint128ss_increase_by_
-
-/**
- * Resize the string uint128ss array.
- *
- * @param length
- * The new size to use.
- * @param uint128ss
- * The string uint128ss 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_delete().
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint128ss_resize_
- extern f_status_t f_uint128ss_resize(const f_array_length_t length, f_uint128ss_t *uint128ss);
-#endif // _di_f_uint128ss_resize_
-
#ifdef __cplusplus
} // extern "C"
#endif
#endif // _di_f_int16s_adjust_
#ifndef _di_f_int16s_append_
- f_status_t f_int16s_append(const f_int16s_t source, f_int16s_t *destination) {
+ f_status_t f_int16s_append(const int16_t source, f_int16s_t *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_int16s_append(source, destination);
}
#endif // _di_f_int16s_append_
+#ifndef _di_f_int16s_append_all_
+ f_status_t f_int16s_append_all(const f_int16s_t source, f_int16s_t *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_int16s_append_all(source, destination);
+ }
+#endif // _di_f_int16s_append_all_
+
#ifndef _di_f_int16s_decimate_by_
f_status_t f_int16s_decimate_by(const f_array_length_t amount, f_int16s_t *int16s) {
#ifndef _di_level_0_parameter_checking_
#endif // _di_f_int16ss_adjust_
#ifndef _di_f_int16ss_append_
- f_status_t f_int16ss_append(const f_int16ss_t source, f_int16ss_t *destination) {
+ f_status_t f_int16ss_append(const f_int16s_t source, f_int16ss_t *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_int16ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ status = private_f_int16s_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_int16ss_append_
+
+#ifndef _di_f_int16ss_append_all_
+ f_status_t f_int16ss_append_all(const f_int16ss_t source, f_int16ss_t *destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
}
for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
- status = private_f_int16s_append(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
+
+ destination->array[destination->used].used = 0;
+
+ if (source.array[i].used) {
+ status = private_f_int16s_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
} // for
return F_none;
}
-#endif // _di_f_int16ss_append_
+#endif // _di_f_int16ss_append_all_
#ifndef _di_f_int16ss_decimate_by_
f_status_t f_int16ss_decimate_by(const f_array_length_t amount, f_int16ss_t *int16ss) {
}
#endif // _di_f_int16ss_resize_
-#ifndef _di_f_uint16s_adjust_
- f_status_t f_uint16s_adjust(const f_array_length_t length, f_uint16s_t *uint16s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint16s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint16s_adjust(length, uint16s);
- }
-#endif // _di_f_uint16s_adjust_
-
-#ifndef _di_f_uint16s_append_
- f_status_t f_uint16s_append(const f_uint16s_t source, f_uint16s_t *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_uint16s_append(source, destination);
- }
-#endif // _di_f_uint16s_append_
-
-#ifndef _di_f_uint16s_decimate_by_
- f_status_t f_uint16s_decimate_by(const f_array_length_t amount, f_uint16s_t *uint16s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint16s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint16s->size - amount > 0) {
- return private_f_uint16s_adjust(uint16s->size - amount, uint16s);
- }
-
- return private_f_uint16s_adjust(0, uint16s);
- }
-#endif // _di_f_uint16s_decimate_by_
-
-#ifndef _di_f_uint16s_decrease_by_
- f_status_t f_uint16s_decrease_by(const f_array_length_t amount, f_uint16s_t *uint16s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint16s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint16s->size - amount > 0) {
- return private_f_uint16s_resize(uint16s->size - amount, uint16s);
- }
-
- return private_f_uint16s_resize(0, uint16s);
- }
-#endif // _di_f_uint16s_decrease_by_
-
-#ifndef _di_f_uint16s_increase_
- f_status_t f_uint16s_increase(const f_array_length_t step, f_uint16s_t *uint16s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint16s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (step && uint16s->used + 1 > uint16s->size) {
- f_array_length_t size = uint16s->used + step;
-
- if (size > F_array_length_t_size_d) {
- if (uint16s->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_uint16s_resize(size, uint16s);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint16s_increase_
-
-#ifndef _di_f_uint16s_increase_by_
- f_status_t f_uint16s_increase_by(const f_array_length_t amount, f_uint16s_t *uint16s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint16s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint16s->used + amount > uint16s->size) {
- if (uint16s->used + amount > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_uint16s_resize(uint16s->used + amount, uint16s);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint16s_increase_by_
-
-#ifndef _di_f_uint16s_resize_
- f_status_t f_uint16s_resize(const f_array_length_t length, f_uint16s_t *uint16s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint16s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint16s_resize(length, uint16s);
- }
-#endif // _di_f_uint16s_resize_
-
-#ifndef _di_f_uint16ss_adjust_
- f_status_t f_uint16ss_adjust(const f_array_length_t length, f_uint16ss_t *uint16ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint16ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint16ss_adjust(length, uint16ss);
- }
-#endif // _di_f_uint16ss_adjust_
-
-#ifndef _di_f_uint16ss_append_
- f_status_t f_uint16ss_append(const f_uint16ss_t source, f_uint16ss_t *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_uint16ss_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) {
- status = private_f_uint16s_append(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
- } // for
-
- return F_none;
- }
-#endif // _di_f_uint16ss_append_
-
-#ifndef _di_f_uint16ss_decimate_by_
- f_status_t f_uint16ss_decimate_by(const f_array_length_t amount, f_uint16ss_t *uint16ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint16ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint16ss->size - amount > 0) {
- return private_f_uint16ss_adjust(uint16ss->size - amount, uint16ss);
- }
-
- return private_f_uint16ss_adjust(0, uint16ss);
- }
-#endif // _di_f_uint16ss_decimate_by_
-
-#ifndef _di_f_uint16ss_decrease_by_
- f_status_t f_uint16ss_decrease_by(const f_array_length_t amount, f_uint16ss_t *uint16ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint16ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint16ss->size - amount > 0) {
- return private_f_uint16ss_resize(uint16ss->size - amount, uint16ss);
- }
-
- return private_f_uint16ss_resize(0, uint16ss);
- }
-#endif // _di_f_uint16ss_decrease_by_
-
-#ifndef _di_f_uint16ss_increase_
- f_status_t f_uint16ss_increase(const f_array_length_t step, f_uint16ss_t *uint16ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint16ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (step && uint16ss->used + 1 > uint16ss->size) {
- f_array_length_t size = uint16ss->used + step;
-
- if (size > F_array_length_t_size_d) {
- if (uint16ss->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_uint16ss_resize(size, uint16ss);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint16ss_increase_
-
-#ifndef _di_f_uint16ss_increase_by_
- f_status_t f_uint16ss_increase_by(const f_array_length_t amount, f_uint16ss_t *uint16ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint16ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint16ss->used + amount > uint16ss->size) {
- if (uint16ss->used + amount > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_uint16ss_resize(uint16ss->used + amount, uint16ss);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint16ss_increase_by_
-
-#ifndef _di_f_uint16ss_resize_
- f_status_t f_uint16ss_resize(const f_array_length_t length, f_uint16ss_t *uint16ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint16ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint16ss_resize(length, uint16ss);
- }
-#endif // _di_f_uint16ss_resize_
-
#ifdef __cplusplus
} // extern "C"
#endif
#endif // _di_f_int16s_adjust_
/**
- * Append the source int16s onto the destination.
+ * Append the single source int16 onto the destination.
*
* @param source
- * The source int16s to append.
+ * The source int16 to append.
* @param destination
* The destination int16s the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_int16s_append_
- extern f_status_t f_int16s_append(const f_int16s_t source, f_int16s_t *destination);
+ extern f_status_t f_int16s_append(const int16_t source, f_int16s_t *destination);
#endif // _di_f_int16s_append_
/**
+ * Append the source int16s onto the destination.
+ *
+ * @param source
+ * The source int16s to append.
+ * @param destination
+ * The destination int16s 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_int16s_append_all_
+ extern f_status_t f_int16s_append_all(const f_int16s_t source, f_int16s_t *destination);
+#endif // _di_f_int16s_append_all_
+
+/**
* Resize the int16s array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
#endif // _di_f_int16ss_adjust_
/**
- * Append the source int16ss onto the destination.
+ * Append the single source int16s onto the destination.
*
* @param source
- * The source int16ss to append.
+ * The source int16s to append.
* @param destination
* The destination ranges the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_int16ss_append_
- extern f_status_t f_int16ss_append(const f_int16ss_t source, f_int16ss_t *destination);
+ extern f_status_t f_int16ss_append(const f_int16s_t source, f_int16ss_t *destination);
#endif // _di_f_int16ss_append_
/**
- * Resize the int16ss array.
+ * Append the source int16ss onto the destination.
*
- * @param length
- * The new size to use.
- * @param int16ss
- * The int16ss array to resize.
+ * @param source
+ * The source int16ss to append.
+ * @param destination
+ * The destination ranges 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.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_int16ss_adjust_
- extern f_status_t f_int16ss_adjust(const f_array_length_t length, f_int16ss_t *int16ss);
-#endif // _di_f_int16ss_adjust_
+#ifndef _di_f_int16ss_append_all_
+ extern f_status_t f_int16ss_append_all(const f_int16ss_t source, f_int16ss_t *destination);
+#endif // _di_f_int16ss_append_all_
/**
* Resize the int16ss array to a smaller size.
extern f_status_t f_int16ss_resize(const f_array_length_t length, f_int16ss_t *int16ss);
#endif // _di_f_int16ss_resize_
-/**
- * Resize the string uint16s array.
- *
- * @param length
- * The new size to use.
- * @param uint16s
- * The string uint16s 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_uint16s_adjust_
- extern f_status_t f_uint16s_adjust(const f_array_length_t length, f_uint16s_t *uint16s);
-#endif // _di_f_uint16s_adjust_
-
-/**
- * Append the source uint16s onto the destination.
- *
- * @param source
- * The source uint16s to append.
- * @param destination
- * The destination uint16s 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.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint16s_append_
- extern f_status_t f_uint16s_append(const f_uint16s_t source, f_uint16s_t *destination);
-#endif // _di_f_uint16s_append_
-
-/**
- * Resize the string uint16s 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 les than 0.
- *
- * @param amount
- * A positive number representing how much to decimate the size by.
- * @param uint16s
- * The string uint16s 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_adjust().
- */
-#ifndef _di_f_uint16s_decimate_by_
- extern f_status_t f_uint16s_decimate_by(const f_array_length_t amount, f_uint16s_t *uint16s);
-#endif // _di_f_uint16s_decimate_by_
-
-/**
- * Resize the string uint16s 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 les than 0.
- *
- * @param amount
- * A positive number representing how much to decrease the size by.
- * @param uint16s
- * The string uint16s 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_uint16s_decrease_by_
- extern f_status_t f_uint16s_decrease_by(const f_array_length_t amount, f_uint16s_t *uint16s);
-#endif // _di_f_uint16s_decrease_by_
-
-/**
- * Increase the size of the string uint16s array, but only if necesary.
- *
- * 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 uint16s
- * The string uint16s 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_uint16s_increase_
- extern f_status_t f_uint16s_increase(const f_array_length_t step, f_uint16s_t *uint16s);
-#endif // _di_f_uint16s_increase_
-
-/**
- * Resize the string uint16s 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 uint16s
- * The string uint16s 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_uint16s_increase_by_
- extern f_status_t f_uint16s_increase_by(const f_array_length_t amount, f_uint16s_t *uint16s);
-#endif // _di_f_uint16s_increase_by_
-
-/**
- * Resize the string uint16s array.
- *
- * @param length
- * The new size to use.
- * @param uint16s
- * The string uint16s 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_uint16s_resize_
- extern f_status_t f_uint16s_resize(const f_array_length_t length, f_uint16s_t *uint16s);
-#endif // _di_f_uint16s_resize_
-
-/**
- * Resize the string uint16ss array.
- *
- * @param length
- * The new size to use.
- * @param uint16ss
- * The string uint16ss 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().
- * Errors (with error bit) from: f_memory_destroy().
- */
-#ifndef _di_f_uint16ss_adjust_
- extern f_status_t f_uint16ss_adjust(const f_array_length_t length, f_uint16ss_t *uint16ss);
-#endif // _di_f_uint16ss_adjust_
-
-/**
- * Append the source uint16ss onto the destination.
- *
- * @param source
- * The source uint16ss to append.
- * @param destination
- * The destination ranges 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.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint16ss_append_
- extern f_status_t f_uint16ss_append(const f_uint16ss_t source, f_uint16ss_t *destination);
-#endif // _di_f_uint16ss_append_
-
-/**
- * Resize the string uint16ss array.
- *
- * @param length
- * The new size to use.
- * @param uint16ss
- * The string uint16ss 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().
- * Errors (with error bit) from: f_memory_destroy().
- */
-#ifndef _di_f_uint16ss_adjust_
- extern f_status_t f_uint16ss_adjust(const f_array_length_t length, f_uint16ss_t *uint16ss);
-#endif // _di_f_uint16ss_adjust_
-
-/**
- * Resize the string uint16ss 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 uint16ss
- * The string uint16ss 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_adjust().
- * Errors (with error bit) from: f_memory_destroy().
- */
-#ifndef _di_f_uint16ss_decimate_by_
- extern f_status_t f_uint16ss_decimate_by(const f_array_length_t amount, f_uint16ss_t *uint16ss);
-#endif // _di_f_uint16ss_decimate_by_
-
-/**
- * Resize the string uint16ss 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 uint16ss
- * The string uint16ss 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_delete().
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint16ss_decrease_by_
- extern f_status_t f_uint16ss_decrease_by(const f_array_length_t amount, f_uint16ss_t *uint16ss);
-#endif // _di_f_uint16ss_decrease_by_
-
-/**
- * Increase the size of the string uint16ss 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 uint16ss
- * The string uint16ss 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_uint16ss_increase_
- extern f_status_t f_uint16ss_increase(const f_array_length_t step, f_uint16ss_t *uint16ss);
-#endif // _di_f_uint16ss_increase_
-
-/**
- * Resize the string uint16ss 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 uint16ss
- * The string uint16ss 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_uint16ss_increase_by_
- extern f_status_t f_uint16ss_increase_by(const f_array_length_t amount, f_uint16ss_t *uint16ss);
-#endif // _di_f_uint16ss_increase_by_
-
-/**
- * Resize the string uint16ss array.
- *
- * @param length
- * The new size to use.
- * @param uint16ss
- * The string uint16ss 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_delete().
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint16ss_resize_
- extern f_status_t f_uint16ss_resize(const f_array_length_t length, f_uint16ss_t *uint16ss);
-#endif // _di_f_uint16ss_resize_
-
#ifdef __cplusplus
} // extern "C"
#endif
#endif // _di_f_int32s_adjust_
#ifndef _di_f_int32s_append_
- f_status_t f_int32s_append(const f_int32s_t source, f_int32s_t *destination) {
+ f_status_t f_int32s_append(const int32_t source, f_int32s_t *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_int32s_append(source, destination);
}
#endif // _di_f_int32s_append_
+#ifndef _di_f_int32s_append_all_
+ f_status_t f_int32s_append_all(const f_int32s_t source, f_int32s_t *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_int32s_append_all(source, destination);
+ }
+#endif // _di_f_int32s_append_all_
+
#ifndef _di_f_int32s_decimate_by_
f_status_t f_int32s_decimate_by(const f_array_length_t amount, f_int32s_t *int32s) {
#ifndef _di_level_0_parameter_checking_
#endif // _di_f_int32ss_adjust_
#ifndef _di_f_int32ss_append_
- f_status_t f_int32ss_append(const f_int32ss_t source, f_int32ss_t *destination) {
+ f_status_t f_int32ss_append(const f_int32s_t source, f_int32ss_t *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_int32ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ status = private_f_int32s_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_int32ss_append_
+
+#ifndef _di_f_int32ss_append_all_
+ f_status_t f_int32ss_append_all(const f_int32ss_t source, f_int32ss_t *destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
}
for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
- status = private_f_int32s_append(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
+
+ destination->array[destination->used].used = 0;
+
+ if (source.array[i].used) {
+ status = private_f_int32s_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
} // for
return F_none;
}
-#endif // _di_f_int32ss_append_
+#endif // _di_f_int32ss_append_all_
#ifndef _di_f_int32ss_decimate_by_
f_status_t f_int32ss_decimate_by(const f_array_length_t amount, f_int32ss_t *int32ss) {
}
#endif // _di_f_int32ss_resize_
-#ifndef _di_f_uint32s_adjust_
- f_status_t f_uint32s_adjust(const f_array_length_t length, f_uint32s_t *uint32s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint32s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint32s_adjust(length, uint32s);
- }
-#endif // _di_f_uint32s_adjust_
-
-#ifndef _di_f_uint32s_append_
- f_status_t f_uint32s_append(const f_uint32s_t source, f_uint32s_t *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_uint32s_append(source, destination);
- }
-#endif // _di_f_uint32s_append_
-
-#ifndef _di_f_uint32s_decimate_by_
- f_status_t f_uint32s_decimate_by(const f_array_length_t amount, f_uint32s_t *uint32s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint32s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint32s->size - amount > 0) {
- return private_f_uint32s_adjust(uint32s->size - amount, uint32s);
- }
-
- return private_f_uint32s_adjust(0, uint32s);
- }
-#endif // _di_f_uint32s_decimate_by_
-
-#ifndef _di_f_uint32s_decrease_by_
- f_status_t f_uint32s_decrease_by(const f_array_length_t amount, f_uint32s_t *uint32s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint32s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint32s->size - amount > 0) {
- return private_f_uint32s_resize(uint32s->size - amount, uint32s);
- }
-
- return private_f_uint32s_resize(0, uint32s);
- }
-#endif // _di_f_uint32s_decrease_by_
-
-#ifndef _di_f_uint32s_increase_
- f_status_t f_uint32s_increase(const f_array_length_t step, f_uint32s_t *uint32s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint32s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (step && uint32s->used + 1 > uint32s->size) {
- f_array_length_t size = uint32s->used + step;
-
- if (size > F_array_length_t_size_d) {
- if (uint32s->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_uint32s_resize(size, uint32s);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint32s_increase_
-
-#ifndef _di_f_uint32s_increase_by_
- f_status_t f_uint32s_increase_by(const f_array_length_t amount, f_uint32s_t *uint32s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint32s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint32s->used + amount > uint32s->size) {
- if (uint32s->used + amount > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_uint32s_resize(uint32s->used + amount, uint32s);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint32s_increase_by_
-
-#ifndef _di_f_uint32s_resize_
- f_status_t f_uint32s_resize(const f_array_length_t length, f_uint32s_t *uint32s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint32s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint32s_resize(length, uint32s);
- }
-#endif // _di_f_uint32s_resize_
-
-#ifndef _di_f_uint32ss_adjust_
- f_status_t f_uint32ss_adjust(const f_array_length_t length, f_uint32ss_t *uint32ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint32ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint32ss_adjust(length, uint32ss);
- }
-#endif // _di_f_uint32ss_adjust_
-
-#ifndef _di_f_uint32ss_append_
- f_status_t f_uint32ss_append(const f_uint32ss_t source, f_uint32ss_t *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_uint32ss_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) {
- status = private_f_uint32s_append(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
- } // for
-
- return F_none;
- }
-#endif // _di_f_uint32ss_append_
-
-#ifndef _di_f_uint32ss_decimate_by_
- f_status_t f_uint32ss_decimate_by(const f_array_length_t amount, f_uint32ss_t *uint32ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint32ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint32ss->size - amount > 0) {
- return private_f_uint32ss_adjust(uint32ss->size - amount, uint32ss);
- }
-
- return private_f_uint32ss_adjust(0, uint32ss);
- }
-#endif // _di_f_uint32ss_decimate_by_
-
-#ifndef _di_f_uint32ss_decrease_by_
- f_status_t f_uint32ss_decrease_by(const f_array_length_t amount, f_uint32ss_t *uint32ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint32ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint32ss->size - amount > 0) {
- return private_f_uint32ss_resize(uint32ss->size - amount, uint32ss);
- }
-
- return private_f_uint32ss_resize(0, uint32ss);
- }
-#endif // _di_f_uint32ss_decrease_by_
-
-#ifndef _di_f_uint32ss_increase_
- f_status_t f_uint32ss_increase(const f_array_length_t step, f_uint32ss_t *uint32ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint32ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (step && uint32ss->used + 1 > uint32ss->size) {
- f_array_length_t size = uint32ss->used + step;
-
- if (size > F_array_length_t_size_d) {
- if (uint32ss->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_uint32ss_resize(size, uint32ss);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint32ss_increase_
-
-#ifndef _di_f_uint32ss_increase_by_
- f_status_t f_uint32ss_increase_by(const f_array_length_t amount, f_uint32ss_t *uint32ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint32ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint32ss->used + amount > uint32ss->size) {
- if (uint32ss->used + amount > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_uint32ss_resize(uint32ss->used + amount, uint32ss);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint32ss_increase_by_
-
-#ifndef _di_f_uint32ss_resize_
- f_status_t f_uint32ss_resize(const f_array_length_t length, f_uint32ss_t *uint32ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint32ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint32ss_resize(length, uint32ss);
- }
-#endif // _di_f_uint32ss_resize_
-
#ifdef __cplusplus
} // extern "C"
#endif
#endif // _di_f_int32s_adjust_
/**
- * Append the source int32s onto the destination.
+ * Append the single source int32 onto the destination.
*
* @param source
- * The source int32s to append.
+ * The source int32 to append.
* @param destination
* The destination int32s the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_int32s_append_
- extern f_status_t f_int32s_append(const f_int32s_t source, f_int32s_t *destination);
+ extern f_status_t f_int32s_append(const int32_t source, f_int32s_t *destination);
#endif // _di_f_int32s_append_
/**
+ * Append the source int32s onto the destination.
+ *
+ * @param source
+ * The source int32s to append.
+ * @param destination
+ * The destination int32s 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_int32s_append_all_
+ extern f_status_t f_int32s_append_all(const f_int32s_t source, f_int32s_t *destination);
+#endif // _di_f_int32s_append_all_
+
+/**
* Resize the int32s array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
#endif // _di_f_int32ss_adjust_
/**
- * Append the source int32ss onto the destination.
+ * Append the single source int32s onto the destination.
*
* @param source
- * The source int32ss to append.
+ * The source int32s to append.
* @param destination
* The destination ranges the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_int32ss_append_
- extern f_status_t f_int32ss_append(const f_int32ss_t source, f_int32ss_t *destination);
+ extern f_status_t f_int32ss_append(const f_int32s_t source, f_int32ss_t *destination);
#endif // _di_f_int32ss_append_
/**
- * Resize the int32ss array.
+ * Append the source int32ss onto the destination.
*
- * @param length
- * The new size to use.
- * @param int32ss
- * The int32ss array to resize.
+ * @param source
+ * The source int32ss to append.
+ * @param destination
+ * The destination ranges 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.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_int32ss_adjust_
- extern f_status_t f_int32ss_adjust(const f_array_length_t length, f_int32ss_t *int32ss);
-#endif // _di_f_int32ss_adjust_
+#ifndef _di_f_int32ss_append_all_
+ extern f_status_t f_int32ss_append_all(const f_int32ss_t source, f_int32ss_t *destination);
+#endif // _di_f_int32ss_append_all_
/**
* Resize the int32ss array to a smaller size.
extern f_status_t f_int32ss_resize(const f_array_length_t length, f_int32ss_t *int32ss);
#endif // _di_f_int32ss_resize_
-/**
- * Resize the string uint32s array.
- *
- * @param length
- * The new size to use.
- * @param uint32s
- * The string uint32s 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_uint32s_adjust_
- extern f_status_t f_uint32s_adjust(const f_array_length_t length, f_uint32s_t *uint32s);
-#endif // _di_f_uint32s_adjust_
-
-/**
- * Append the source uint32s onto the destination.
- *
- * @param source
- * The source uint32s to append.
- * @param destination
- * The destination uint32s 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.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint32s_append_
- extern f_status_t f_uint32s_append(const f_uint32s_t source, f_uint32s_t *destination);
-#endif // _di_f_uint32s_append_
-
-/**
- * Resize the string uint32s 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 les than 0.
- *
- * @param amount
- * A positive number representing how much to decimate the size by.
- * @param uint32s
- * The string uint32s 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_adjust().
- */
-#ifndef _di_f_uint32s_decimate_by_
- extern f_status_t f_uint32s_decimate_by(const f_array_length_t amount, f_uint32s_t *uint32s);
-#endif // _di_f_uint32s_decimate_by_
-
-/**
- * Resize the string uint32s 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 les than 0.
- *
- * @param amount
- * A positive number representing how much to decrease the size by.
- * @param uint32s
- * The string uint32s 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_uint32s_decrease_by_
- extern f_status_t f_uint32s_decrease_by(const f_array_length_t amount, f_uint32s_t *uint32s);
-#endif // _di_f_uint32s_decrease_by_
-
-/**
- * Increase the size of the string uint32s array, but only if necesary.
- *
- * 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 uint32s
- * The string uint32s 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_uint32s_increase_
- extern f_status_t f_uint32s_increase(const f_array_length_t step, f_uint32s_t *uint32s);
-#endif // _di_f_uint32s_increase_
-
-/**
- * Resize the string uint32s 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 uint32s
- * The string uint32s 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_uint32s_increase_by_
- extern f_status_t f_uint32s_increase_by(const f_array_length_t amount, f_uint32s_t *uint32s);
-#endif // _di_f_uint32s_increase_by_
-
-/**
- * Resize the string uint32s array.
- *
- * @param length
- * The new size to use.
- * @param uint32s
- * The string uint32s 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_uint32s_resize_
- extern f_status_t f_uint32s_resize(const f_array_length_t length, f_uint32s_t *uint32s);
-#endif // _di_f_uint32s_resize_
-
-/**
- * Resize the string uint32ss array.
- *
- * @param length
- * The new size to use.
- * @param uint32ss
- * The string uint32ss 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().
- * Errors (with error bit) from: f_memory_destroy().
- */
-#ifndef _di_f_uint32ss_adjust_
- extern f_status_t f_uint32ss_adjust(const f_array_length_t length, f_uint32ss_t *uint32ss);
-#endif // _di_f_uint32ss_adjust_
-
-/**
- * Append the source uint32ss onto the destination.
- *
- * @param source
- * The source uint32ss to append.
- * @param destination
- * The destination ranges 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.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint32ss_append_
- extern f_status_t f_uint32ss_append(const f_uint32ss_t source, f_uint32ss_t *destination);
-#endif // _di_f_uint32ss_append_
-
-/**
- * Resize the string uint32ss array.
- *
- * @param length
- * The new size to use.
- * @param uint32ss
- * The string uint32ss 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().
- * Errors (with error bit) from: f_memory_destroy().
- */
-#ifndef _di_f_uint32ss_adjust_
- extern f_status_t f_uint32ss_adjust(const f_array_length_t length, f_uint32ss_t *uint32ss);
-#endif // _di_f_uint32ss_adjust_
-
-/**
- * Resize the string uint32ss 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 uint32ss
- * The string uint32ss 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_adjust().
- * Errors (with error bit) from: f_memory_destroy().
- */
-#ifndef _di_f_uint32ss_decimate_by_
- extern f_status_t f_uint32ss_decimate_by(const f_array_length_t amount, f_uint32ss_t *uint32ss);
-#endif // _di_f_uint32ss_decimate_by_
-
-/**
- * Resize the string uint32ss 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 uint32ss
- * The string uint32ss 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_delete().
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint32ss_decrease_by_
- extern f_status_t f_uint32ss_decrease_by(const f_array_length_t amount, f_uint32ss_t *uint32ss);
-#endif // _di_f_uint32ss_decrease_by_
-
-/**
- * Increase the size of the string uint32ss 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 uint32ss
- * The string uint32ss 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_uint32ss_increase_
- extern f_status_t f_uint32ss_increase(const f_array_length_t step, f_uint32ss_t *uint32ss);
-#endif // _di_f_uint32ss_increase_
-
-/**
- * Resize the string uint32ss 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 uint32ss
- * The string uint32ss 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_uint32ss_increase_by_
- extern f_status_t f_uint32ss_increase_by(const f_array_length_t amount, f_uint32ss_t *uint32ss);
-#endif // _di_f_uint32ss_increase_by_
-
-/**
- * Resize the string uint32ss array.
- *
- * @param length
- * The new size to use.
- * @param uint32ss
- * The string uint32ss 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_delete().
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint32ss_resize_
- extern f_status_t f_uint32ss_resize(const f_array_length_t length, f_uint32ss_t *uint32ss);
-#endif // _di_f_uint32ss_resize_
-
#ifdef __cplusplus
} // extern "C"
#endif
#endif // _di_f_int64s_adjust_
#ifndef _di_f_int64s_append_
- f_status_t f_int64s_append(const f_int64s_t source, f_int64s_t *destination) {
+ f_status_t f_int64s_append(const int64_t source, f_int64s_t *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_int64s_append(source, destination);
}
#endif // _di_f_int64s_append_
+#ifndef _di_f_int64s_append_all_
+ f_status_t f_int64s_append_all(const f_int64s_t source, f_int64s_t *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_int64s_append_all(source, destination);
+ }
+#endif // _di_f_int64s_append_all_
+
#ifndef _di_f_int64s_decimate_by_
f_status_t f_int64s_decimate_by(const f_array_length_t amount, f_int64s_t *int64s) {
#ifndef _di_level_0_parameter_checking_
#endif // _di_f_int64ss_adjust_
#ifndef _di_f_int64ss_append_
- f_status_t f_int64ss_append(const f_int64ss_t source, f_int64ss_t *destination) {
+ f_status_t f_int64ss_append(const f_int64s_t source, f_int64ss_t *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_int64ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ status = private_f_int64s_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_int64ss_append_
+
+#ifndef _di_f_int64ss_append_all_
+ f_status_t f_int64ss_append_all(const f_int64ss_t source, f_int64ss_t *destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
}
for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
- status = private_f_int64s_append(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
+
+ destination->array[destination->used].used = 0;
+
+ if (source.array[i].used) {
+ status = private_f_int64s_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
} // for
return F_none;
}
-#endif // _di_f_int64ss_append_
+#endif // _di_f_int64ss_append_all_
#ifndef _di_f_int64ss_decimate_by_
f_status_t f_int64ss_decimate_by(const f_array_length_t amount, f_int64ss_t *int64ss) {
}
#endif // _di_f_int64ss_resize_
-#ifndef _di_f_uint64s_adjust_
- f_status_t f_uint64s_adjust(const f_array_length_t length, f_uint64s_t *uint64s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint64s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint64s_adjust(length, uint64s);
- }
-#endif // _di_f_uint64s_adjust_
-
-#ifndef _di_f_uint64s_append_
- f_status_t f_uint64s_append(const f_uint64s_t source, f_uint64s_t *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_uint64s_append(source, destination);
- }
-#endif // _di_f_uint64s_append_
-
-#ifndef _di_f_uint64s_decimate_by_
- f_status_t f_uint64s_decimate_by(const f_array_length_t amount, f_uint64s_t *uint64s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint64s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint64s->size - amount > 0) {
- return private_f_uint64s_adjust(uint64s->size - amount, uint64s);
- }
-
- return private_f_uint64s_adjust(0, uint64s);
- }
-#endif // _di_f_uint64s_decimate_by_
-
-#ifndef _di_f_uint64s_decrease_by_
- f_status_t f_uint64s_decrease_by(const f_array_length_t amount, f_uint64s_t *uint64s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint64s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint64s->size - amount > 0) {
- return private_f_uint64s_resize(uint64s->size - amount, uint64s);
- }
-
- return private_f_uint64s_resize(0, uint64s);
- }
-#endif // _di_f_uint64s_decrease_by_
-
-#ifndef _di_f_uint64s_increase_
- f_status_t f_uint64s_increase(const f_array_length_t step, f_uint64s_t *uint64s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint64s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (step && uint64s->used + 1 > uint64s->size) {
- f_array_length_t size = uint64s->used + step;
-
- if (size > F_array_length_t_size_d) {
- if (uint64s->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_uint64s_resize(size, uint64s);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint64s_increase_
-
-#ifndef _di_f_uint64s_increase_by_
- f_status_t f_uint64s_increase_by(const f_array_length_t amount, f_uint64s_t *uint64s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint64s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint64s->used + amount > uint64s->size) {
- if (uint64s->used + amount > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_uint64s_resize(uint64s->used + amount, uint64s);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint64s_increase_by_
-
-#ifndef _di_f_uint64s_resize_
- f_status_t f_uint64s_resize(const f_array_length_t length, f_uint64s_t *uint64s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint64s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint64s_resize(length, uint64s);
- }
-#endif // _di_f_uint64s_resize_
-
-#ifndef _di_f_uint64ss_adjust_
- f_status_t f_uint64ss_adjust(const f_array_length_t length, f_uint64ss_t *uint64ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint64ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint64ss_adjust(length, uint64ss);
- }
-#endif // _di_f_uint64ss_adjust_
-
-#ifndef _di_f_uint64ss_append_
- f_status_t f_uint64ss_append(const f_uint64ss_t source, f_uint64ss_t *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_uint64ss_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) {
- status = private_f_uint64s_append(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
- } // for
-
- return F_none;
- }
-#endif // _di_f_uint64ss_append_
-
-#ifndef _di_f_uint64ss_decimate_by_
- f_status_t f_uint64ss_decimate_by(const f_array_length_t amount, f_uint64ss_t *uint64ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint64ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint64ss->size - amount > 0) {
- return private_f_uint64ss_adjust(uint64ss->size - amount, uint64ss);
- }
-
- return private_f_uint64ss_adjust(0, uint64ss);
- }
-#endif // _di_f_uint64ss_decimate_by_
-
-#ifndef _di_f_uint64ss_decrease_by_
- f_status_t f_uint64ss_decrease_by(const f_array_length_t amount, f_uint64ss_t *uint64ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint64ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint64ss->size - amount > 0) {
- return private_f_uint64ss_resize(uint64ss->size - amount, uint64ss);
- }
-
- return private_f_uint64ss_resize(0, uint64ss);
- }
-#endif // _di_f_uint64ss_decrease_by_
-
-#ifndef _di_f_uint64ss_increase_
- f_status_t f_uint64ss_increase(const f_array_length_t step, f_uint64ss_t *uint64ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint64ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (step && uint64ss->used + 1 > uint64ss->size) {
- f_array_length_t size = uint64ss->used + step;
-
- if (size > F_array_length_t_size_d) {
- if (uint64ss->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_uint64ss_resize(size, uint64ss);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint64ss_increase_
-
-#ifndef _di_f_uint64ss_increase_by_
- f_status_t f_uint64ss_increase_by(const f_array_length_t amount, f_uint64ss_t *uint64ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint64ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint64ss->used + amount > uint64ss->size) {
- if (uint64ss->used + amount > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_uint64ss_resize(uint64ss->used + amount, uint64ss);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint64ss_increase_by_
-
-#ifndef _di_f_uint64ss_resize_
- f_status_t f_uint64ss_resize(const f_array_length_t length, f_uint64ss_t *uint64ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint64ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint64ss_resize(length, uint64ss);
- }
-#endif // _di_f_uint64ss_resize_
-
#ifdef __cplusplus
} // extern "C"
#endif
#endif // _di_f_int64s_adjust_
/**
- * Append the source int64s onto the destination.
+ * Append the single source int64 onto the destination.
*
* @param source
- * The source int64s to append.
+ * The source int64 to append.
* @param destination
* The destination int64s the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_int64s_append_
- extern f_status_t f_int64s_append(const f_int64s_t source, f_int64s_t *destination);
+ extern f_status_t f_int64s_append(const int64_t source, f_int64s_t *destination);
#endif // _di_f_int64s_append_
/**
+ * Append the source int64s onto the destination.
+ *
+ * @param source
+ * The source int64s to append.
+ * @param destination
+ * The destination int64s 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_int64s_append_all_
+ extern f_status_t f_int64s_append_all(const f_int64s_t source, f_int64s_t *destination);
+#endif // _di_f_int64s_append_all_
+
+/**
* Resize the int64s array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
#endif // _di_f_int64ss_adjust_
/**
- * Append the source int64ss onto the destination.
+ * Append the single source int64s onto the destination.
*
* @param source
- * The source int64ss to append.
+ * The source int64s to append.
* @param destination
* The destination ranges the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_int64ss_append_
- extern f_status_t f_int64ss_append(const f_int64ss_t source, f_int64ss_t *destination);
+ extern f_status_t f_int64ss_append(const f_int64s_t source, f_int64ss_t *destination);
#endif // _di_f_int64ss_append_
/**
- * Resize the int64ss array.
+ * Append the source int64ss onto the destination.
*
- * @param length
- * The new size to use.
- * @param int64ss
- * The int64ss array to resize.
+ * @param source
+ * The source int64ss to append.
+ * @param destination
+ * The destination ranges 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.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_int64ss_adjust_
- extern f_status_t f_int64ss_adjust(const f_array_length_t length, f_int64ss_t *int64ss);
-#endif // _di_f_int64ss_adjust_
+#ifndef _di_f_int64ss_append_all_
+ extern f_status_t f_int64ss_append_all(const f_int64ss_t source, f_int64ss_t *destination);
+#endif // _di_f_int64ss_append_all_
/**
* Resize the int64ss array to a smaller size.
extern f_status_t f_int64ss_resize(const f_array_length_t length, f_int64ss_t *int64ss);
#endif // _di_f_int64ss_resize_
-/**
- * Resize the string uint64s array.
- *
- * @param length
- * The new size to use.
- * @param uint64s
- * The string uint64s 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_uint64s_adjust_
- extern f_status_t f_uint64s_adjust(const f_array_length_t length, f_uint64s_t *uint64s);
-#endif // _di_f_uint64s_adjust_
-
-/**
- * Append the source uint64s onto the destination.
- *
- * @param source
- * The source uint64s to append.
- * @param destination
- * The destination uint64s 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.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint64s_append_
- extern f_status_t f_uint64s_append(const f_uint64s_t source, f_uint64s_t *destination);
-#endif // _di_f_uint64s_append_
-
-/**
- * Resize the string uint64s 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 les than 0.
- *
- * @param amount
- * A positive number representing how much to decimate the size by.
- * @param uint64s
- * The string uint64s 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_adjust().
- */
-#ifndef _di_f_uint64s_decimate_by_
- extern f_status_t f_uint64s_decimate_by(const f_array_length_t amount, f_uint64s_t *uint64s);
-#endif // _di_f_uint64s_decimate_by_
-
-/**
- * Resize the string uint64s 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 les than 0.
- *
- * @param amount
- * A positive number representing how much to decrease the size by.
- * @param uint64s
- * The string uint64s 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_uint64s_decrease_by_
- extern f_status_t f_uint64s_decrease_by(const f_array_length_t amount, f_uint64s_t *uint64s);
-#endif // _di_f_uint64s_decrease_by_
-
-/**
- * Increase the size of the string uint64s array, but only if necesary.
- *
- * 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 uint64s
- * The string uint64s 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_uint64s_increase_
- extern f_status_t f_uint64s_increase(const f_array_length_t step, f_uint64s_t *uint64s);
-#endif // _di_f_uint64s_increase_
-
-/**
- * Resize the string uint64s 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 uint64s
- * The string uint64s 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_uint64s_increase_by_
- extern f_status_t f_uint64s_increase_by(const f_array_length_t amount, f_uint64s_t *uint64s);
-#endif // _di_f_uint64s_increase_by_
-
-/**
- * Resize the string uint64s array.
- *
- * @param length
- * The new size to use.
- * @param uint64s
- * The string uint64s 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_uint64s_resize_
- extern f_status_t f_uint64s_resize(const f_array_length_t length, f_uint64s_t *uint64s);
-#endif // _di_f_uint64s_resize_
-
-/**
- * Resize the string uint64ss array.
- *
- * @param length
- * The new size to use.
- * @param uint64ss
- * The string uint64ss 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().
- * Errors (with error bit) from: f_memory_destroy().
- */
-#ifndef _di_f_uint64ss_adjust_
- extern f_status_t f_uint64ss_adjust(const f_array_length_t length, f_uint64ss_t *uint64ss);
-#endif // _di_f_uint64ss_adjust_
-
-/**
- * Append the source uint64ss onto the destination.
- *
- * @param source
- * The source uint64ss to append.
- * @param destination
- * The destination ranges 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.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint64ss_append_
- extern f_status_t f_uint64ss_append(const f_uint64ss_t source, f_uint64ss_t *destination);
-#endif // _di_f_uint64ss_append_
-
-/**
- * Resize the string uint64ss array.
- *
- * @param length
- * The new size to use.
- * @param uint64ss
- * The string uint64ss 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().
- * Errors (with error bit) from: f_memory_destroy().
- */
-#ifndef _di_f_uint64ss_adjust_
- extern f_status_t f_uint64ss_adjust(const f_array_length_t length, f_uint64ss_t *uint64ss);
-#endif // _di_f_uint64ss_adjust_
-
-/**
- * Resize the string uint64ss 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 uint64ss
- * The string uint64ss 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_adjust().
- * Errors (with error bit) from: f_memory_destroy().
- */
-#ifndef _di_f_uint64ss_decimate_by_
- extern f_status_t f_uint64ss_decimate_by(const f_array_length_t amount, f_uint64ss_t *uint64ss);
-#endif // _di_f_uint64ss_decimate_by_
-
-/**
- * Resize the string uint64ss 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 uint64ss
- * The string uint64ss 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_delete().
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint64ss_decrease_by_
- extern f_status_t f_uint64ss_decrease_by(const f_array_length_t amount, f_uint64ss_t *uint64ss);
-#endif // _di_f_uint64ss_decrease_by_
-
-/**
- * Increase the size of the string uint64ss 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 uint64ss
- * The string uint64ss 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_uint64ss_increase_
- extern f_status_t f_uint64ss_increase(const f_array_length_t step, f_uint64ss_t *uint64ss);
-#endif // _di_f_uint64ss_increase_
-
-/**
- * Resize the string uint64ss 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 uint64ss
- * The string uint64ss 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_uint64ss_increase_by_
- extern f_status_t f_uint64ss_increase_by(const f_array_length_t amount, f_uint64ss_t *uint64ss);
-#endif // _di_f_uint64ss_increase_by_
-
-/**
- * Resize the string uint64ss array.
- *
- * @param length
- * The new size to use.
- * @param uint64ss
- * The string uint64ss 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_delete().
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint64ss_resize_
- extern f_status_t f_uint64ss_resize(const f_array_length_t length, f_uint64ss_t *uint64ss);
-#endif // _di_f_uint64ss_resize_
-
#ifdef __cplusplus
} // extern "C"
#endif
#endif // _di_f_int8s_adjust_
#ifndef _di_f_int8s_append_
- f_status_t f_int8s_append(const f_int8s_t source, f_int8s_t *destination) {
+ f_status_t f_int8s_append(const int8_t source, f_int8s_t *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_int8s_append(source, destination);
}
#endif // _di_f_int8s_append_
+#ifndef _di_f_int8s_append_all_
+ f_status_t f_int8s_append_all(const f_int8s_t source, f_int8s_t *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_int8s_append_all(source, destination);
+ }
+#endif // _di_f_int8s_append_all_
+
#ifndef _di_f_int8s_decimate_by_
f_status_t f_int8s_decimate_by(const f_array_length_t amount, f_int8s_t *int8s) {
#ifndef _di_level_0_parameter_checking_
#endif // _di_f_int8ss_adjust_
#ifndef _di_f_int8ss_append_
- f_status_t f_int8ss_append(const f_int8ss_t source, f_int8ss_t *destination) {
+ f_status_t f_int8ss_append(const f_int8s_t source, f_int8ss_t *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_int8ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ status = private_f_int8s_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_int8ss_append_
+
+#ifndef _di_f_int8ss_append_all_
+ f_status_t f_int8ss_append_all(const f_int8ss_t source, f_int8ss_t *destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
}
for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
- status = private_f_int8s_append(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
+
+ destination->array[destination->used].used = 0;
+
+ if (source.array[i].used) {
+ status = private_f_int8s_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
} // for
return F_none;
}
-#endif // _di_f_int8ss_append_
+#endif // _di_f_int8ss_append_all_
#ifndef _di_f_int8ss_decimate_by_
f_status_t f_int8ss_decimate_by(const f_array_length_t amount, f_int8ss_t *int8ss) {
}
#endif // _di_f_int8ss_resize_
-#ifndef _di_f_uint8s_adjust_
- f_status_t f_uint8s_adjust(const f_array_length_t length, f_uint8s_t *uint8s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint8s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint8s_adjust(length, uint8s);
- }
-#endif // _di_f_uint8s_adjust_
-
-#ifndef _di_f_uint8s_append_
- f_status_t f_uint8s_append(const f_uint8s_t source, f_uint8s_t *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_uint8s_append(source, destination);
- }
-#endif // _di_f_uint8s_append_
-
-#ifndef _di_f_uint8s_decimate_by_
- f_status_t f_uint8s_decimate_by(const f_array_length_t amount, f_uint8s_t *uint8s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint8s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint8s->size - amount > 0) {
- return private_f_uint8s_adjust(uint8s->size - amount, uint8s);
- }
-
- return private_f_uint8s_adjust(0, uint8s);
- }
-#endif // _di_f_uint8s_decimate_by_
-
-#ifndef _di_f_uint8s_decrease_by_
- f_status_t f_uint8s_decrease_by(const f_array_length_t amount, f_uint8s_t *uint8s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint8s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint8s->size - amount > 0) {
- return private_f_uint8s_resize(uint8s->size - amount, uint8s);
- }
-
- return private_f_uint8s_resize(0, uint8s);
- }
-#endif // _di_f_uint8s_decrease_by_
-
-#ifndef _di_f_uint8s_increase_
- f_status_t f_uint8s_increase(const f_array_length_t step, f_uint8s_t *uint8s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint8s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (step && uint8s->used + 1 > uint8s->size) {
- f_array_length_t size = uint8s->used + step;
-
- if (size > F_array_length_t_size_d) {
- if (uint8s->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_uint8s_resize(size, uint8s);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint8s_increase_
-
-#ifndef _di_f_uint8s_increase_by_
- f_status_t f_uint8s_increase_by(const f_array_length_t amount, f_uint8s_t *uint8s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint8s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint8s->used + amount > uint8s->size) {
- if (uint8s->used + amount > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_uint8s_resize(uint8s->used + amount, uint8s);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint8s_increase_by_
-
-#ifndef _di_f_uint8s_resize_
- f_status_t f_uint8s_resize(const f_array_length_t length, f_uint8s_t *uint8s) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint8s) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint8s_resize(length, uint8s);
- }
-#endif // _di_f_uint8s_resize_
-
-#ifndef _di_f_uint8ss_adjust_
- f_status_t f_uint8ss_adjust(const f_array_length_t length, f_uint8ss_t *uint8ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint8ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint8ss_adjust(length, uint8ss);
- }
-#endif // _di_f_uint8ss_adjust_
-
-#ifndef _di_f_uint8ss_append_
- f_status_t f_uint8ss_append(const f_uint8ss_t source, f_uint8ss_t *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_uint8ss_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) {
- status = private_f_uint8s_append(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
- } // for
-
- return F_none;
- }
-#endif // _di_f_uint8ss_append_
-
-#ifndef _di_f_uint8ss_decimate_by_
- f_status_t f_uint8ss_decimate_by(const f_array_length_t amount, f_uint8ss_t *uint8ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint8ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint8ss->size - amount > 0) {
- return private_f_uint8ss_adjust(uint8ss->size - amount, uint8ss);
- }
-
- return private_f_uint8ss_adjust(0, uint8ss);
- }
-#endif // _di_f_uint8ss_decimate_by_
-
-#ifndef _di_f_uint8ss_decrease_by_
- f_status_t f_uint8ss_decrease_by(const f_array_length_t amount, f_uint8ss_t *uint8ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint8ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint8ss->size - amount > 0) {
- return private_f_uint8ss_resize(uint8ss->size - amount, uint8ss);
- }
-
- return private_f_uint8ss_resize(0, uint8ss);
- }
-#endif // _di_f_uint8ss_decrease_by_
-
-#ifndef _di_f_uint8ss_increase_
- f_status_t f_uint8ss_increase(const f_array_length_t step, f_uint8ss_t *uint8ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint8ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (step && uint8ss->used + 1 > uint8ss->size) {
- f_array_length_t size = uint8ss->used + step;
-
- if (size > F_array_length_t_size_d) {
- if (uint8ss->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_uint8ss_resize(size, uint8ss);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint8ss_increase_
-
-#ifndef _di_f_uint8ss_increase_by_
- f_status_t f_uint8ss_increase_by(const f_array_length_t amount, f_uint8ss_t *uint8ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint8ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (!amount) {
- return F_data_not;
- }
-
- if (uint8ss->used + amount > uint8ss->size) {
- if (uint8ss->used + amount > F_array_length_t_size_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_uint8ss_resize(uint8ss->used + amount, uint8ss);
- }
-
- return F_data_not;
- }
-#endif // _di_f_uint8ss_increase_by_
-
-#ifndef _di_f_uint8ss_resize_
- f_status_t f_uint8ss_resize(const f_array_length_t length, f_uint8ss_t *uint8ss) {
- #ifndef _di_level_0_parameter_checking_
- if (!uint8ss) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_uint8ss_resize(length, uint8ss);
- }
-#endif // _di_f_uint8ss_resize_
-
#ifdef __cplusplus
} // extern "C"
#endif
#endif // _di_f_int8s_adjust_
/**
- * Append the source int8s onto the destination.
+ * Append the single source int8 onto the destination.
*
* @param source
- * The source int8s to append.
+ * The source int8 to append.
* @param destination
* The destination int8s the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_int8s_append_
- extern f_status_t f_int8s_append(const f_int8s_t source, f_int8s_t *destination);
+ extern f_status_t f_int8s_append(const int8_t source, f_int8s_t *destination);
#endif // _di_f_int8s_append_
/**
+ * Append the source int8s onto the destination.
+ *
+ * @param source
+ * The source int8s to append.
+ * @param destination
+ * The destination int8s 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_int8s_append_all_
+ extern f_status_t f_int8s_append_all(const f_int8s_t source, f_int8s_t *destination);
+#endif // _di_f_int8s_append_all_
+
+/**
* Resize the int8s array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
#endif // _di_f_int8ss_adjust_
/**
- * Append the source int8ss onto the destination.
+ * Append the single source int8s onto the destination.
*
* @param source
- * The source int8ss to append.
+ * The source int8s to append.
* @param destination
* The destination ranges the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_int8ss_append_
- extern f_status_t f_int8ss_append(const f_int8ss_t source, f_int8ss_t *destination);
+ extern f_status_t f_int8ss_append(const f_int8s_t source, f_int8ss_t *destination);
#endif // _di_f_int8ss_append_
/**
- * Resize the int8ss array.
+ * Append the source int8ss onto the destination.
*
- * @param length
- * The new size to use.
- * @param int8ss
- * The int8ss array to resize.
+ * @param source
+ * The source int8ss to append.
+ * @param destination
+ * The destination ranges 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.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_int8ss_adjust_
- extern f_status_t f_int8ss_adjust(const f_array_length_t length, f_int8ss_t *int8ss);
-#endif // _di_f_int8ss_adjust_
+#ifndef _di_f_int8ss_append_all_
+ extern f_status_t f_int8ss_append_all(const f_int8ss_t source, f_int8ss_t *destination);
+#endif // _di_f_int8ss_append_all_
/**
* Resize the int8ss array to a smaller size.
extern f_status_t f_int8ss_resize(const f_array_length_t length, f_int8ss_t *int8ss);
#endif // _di_f_int8ss_resize_
-/**
- * Resize the string uint8s array.
- *
- * @param length
- * The new size to use.
- * @param uint8s
- * The string uint8s 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_uint8s_adjust_
- extern f_status_t f_uint8s_adjust(const f_array_length_t length, f_uint8s_t *uint8s);
-#endif // _di_f_uint8s_adjust_
-
-/**
- * Append the source uint8s onto the destination.
- *
- * @param source
- * The source uint8s to append.
- * @param destination
- * The destination uint8s 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.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint8s_append_
- extern f_status_t f_uint8s_append(const f_uint8s_t source, f_uint8s_t *destination);
-#endif // _di_f_uint8s_append_
-
-/**
- * Resize the string uint8s 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 les than 0.
- *
- * @param amount
- * A positive number representing how much to decimate the size by.
- * @param uint8s
- * The string uint8s 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_adjust().
- */
-#ifndef _di_f_uint8s_decimate_by_
- extern f_status_t f_uint8s_decimate_by(const f_array_length_t amount, f_uint8s_t *uint8s);
-#endif // _di_f_uint8s_decimate_by_
-
-/**
- * Resize the string uint8s 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 les than 0.
- *
- * @param amount
- * A positive number representing how much to decrease the size by.
- * @param uint8s
- * The string uint8s 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_uint8s_decrease_by_
- extern f_status_t f_uint8s_decrease_by(const f_array_length_t amount, f_uint8s_t *uint8s);
-#endif // _di_f_uint8s_decrease_by_
-
-/**
- * Increase the size of the string uint8s array, but only if necesary.
- *
- * 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 uint8s
- * The string uint8s 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_uint8s_increase_
- extern f_status_t f_uint8s_increase(const f_array_length_t step, f_uint8s_t *uint8s);
-#endif // _di_f_uint8s_increase_
-
-/**
- * Resize the string uint8s 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 uint8s
- * The string uint8s 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_uint8s_increase_by_
- extern f_status_t f_uint8s_increase_by(const f_array_length_t amount, f_uint8s_t *uint8s);
-#endif // _di_f_uint8s_increase_by_
-
-/**
- * Resize the string uint8s array.
- *
- * @param length
- * The new size to use.
- * @param uint8s
- * The string uint8s 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_uint8s_resize_
- extern f_status_t f_uint8s_resize(const f_array_length_t length, f_uint8s_t *uint8s);
-#endif // _di_f_uint8s_resize_
-
-/**
- * Resize the string uint8ss array.
- *
- * @param length
- * The new size to use.
- * @param uint8ss
- * The string uint8ss 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().
- * Errors (with error bit) from: f_memory_destroy().
- */
-#ifndef _di_f_uint8ss_adjust_
- extern f_status_t f_uint8ss_adjust(const f_array_length_t length, f_uint8ss_t *uint8ss);
-#endif // _di_f_uint8ss_adjust_
-
-/**
- * Append the source uint8ss onto the destination.
- *
- * @param source
- * The source uint8ss to append.
- * @param destination
- * The destination ranges 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.
- *
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint8ss_append_
- extern f_status_t f_uint8ss_append(const f_uint8ss_t source, f_uint8ss_t *destination);
-#endif // _di_f_uint8ss_append_
-
-/**
- * Resize the string uint8ss array.
- *
- * @param length
- * The new size to use.
- * @param uint8ss
- * The string uint8ss 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().
- * Errors (with error bit) from: f_memory_destroy().
- */
-#ifndef _di_f_uint8ss_adjust_
- extern f_status_t f_uint8ss_adjust(const f_array_length_t length, f_uint8ss_t *uint8ss);
-#endif // _di_f_uint8ss_adjust_
-
-/**
- * Resize the string uint8ss 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 uint8ss
- * The string uint8ss 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_adjust().
- * Errors (with error bit) from: f_memory_destroy().
- */
-#ifndef _di_f_uint8ss_decimate_by_
- extern f_status_t f_uint8ss_decimate_by(const f_array_length_t amount, f_uint8ss_t *uint8ss);
-#endif // _di_f_uint8ss_decimate_by_
-
-/**
- * Resize the string uint8ss 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 uint8ss
- * The string uint8ss 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_delete().
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint8ss_decrease_by_
- extern f_status_t f_uint8ss_decrease_by(const f_array_length_t amount, f_uint8ss_t *uint8ss);
-#endif // _di_f_uint8ss_decrease_by_
-
-/**
- * Increase the size of the string uint8ss 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 uint8ss
- * The string uint8ss 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_uint8ss_increase_
- extern f_status_t f_uint8ss_increase(const f_array_length_t step, f_uint8ss_t *uint8ss);
-#endif // _di_f_uint8ss_increase_
-
-/**
- * Resize the string uint8ss 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 uint8ss
- * The string uint8ss 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_uint8ss_increase_by_
- extern f_status_t f_uint8ss_increase_by(const f_array_length_t amount, f_uint8ss_t *uint8ss);
-#endif // _di_f_uint8ss_increase_by_
-
-/**
- * Resize the string uint8ss array.
- *
- * @param length
- * The new size to use.
- * @param uint8ss
- * The string uint8ss 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_delete().
- * Errors (with error bit) from: f_memory_resize().
- */
-#ifndef _di_f_uint8ss_resize_
- extern f_status_t f_uint8ss_resize(const f_array_length_t length, f_uint8ss_t *uint8ss);
-#endif // _di_f_uint8ss_resize_
-
#ifdef __cplusplus
} // extern "C"
#endif
f_status_t private_f_array_lengths_adjust(const f_array_length_t length, f_array_lengths_t *array_lengths) {
const f_status_t status = f_memory_adjust(array_lengths->size, length, sizeof(f_array_length_t), (void **) & array_lengths->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- array_lengths->size = length;
+ array_lengths->size = length;
- if (array_lengths->used > array_lengths->size) {
- array_lengths->used = length;
- }
+ if (array_lengths->used > array_lengths->size) {
+ array_lengths->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_array_lengths_adjust_) || !defined(_di_f_array_lengths_decimate_by_)
#if !defined(_di_f_array_lengths_append_) || !defined(_di_f_array_lengthss_append_)
- extern f_status_t private_f_array_lengths_append(const f_array_lengths_t source, f_array_lengths_t *destination) {
+ extern f_status_t private_f_array_lengths_append(const f_array_length_t source, f_array_lengths_t *destination) {
- f_status_t status = F_none;
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_array_lengths_adjust(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used++] = source;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_array_lengths_append_) || !defined(_di_f_array_lengthss_append_)
+
+#if !defined(_di_f_array_lengths_append_) || !defined(_di_f_array_lengths_append_all_) || !defined(_di_f_array_lengthss_append_all_)
+ extern f_status_t private_f_array_lengths_append_all(const f_array_lengths_t source, f_array_lengths_t *destination) {
if (destination->used + source.used > destination->size) {
- status = private_f_array_lengths_adjust(destination->used + source.used, destination);
+ const f_status_t status = private_f_array_lengths_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] = source.array[i];
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ destination->array[destination->used++] = source.array[i];
} // for
return F_none;
}
-#endif // !defined(_di_f_array_lengths_append_) || !defined(_di_f_array_lengthss_append_)
+#endif // !defined(_di_f_array_lengths_append_) || !defined(_di_f_array_lengths_append_all_) || !defined(_di_f_array_lengthss_append_all_)
#if !defined(_di_f_array_lengths_resize_) || !defined(_di_f_array_lengths_append_) || !defined(_di_f_array_lengths_decimate_by_) || !defined(_di_f_array_lengthss_append_)
f_status_t private_f_array_lengths_resize(const f_array_length_t length, f_array_lengths_t *lengths) {
const f_status_t status = f_memory_resize(lengths->size, length, sizeof(f_array_length_t), (void **) & lengths->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- lengths->size = length;
+ lengths->size = length;
- if (lengths->used > lengths->size) {
- lengths->used = length;
- }
+ if (lengths->used > lengths->size) {
+ lengths->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_array_lengths_resize_) || !defined(_di_f_array_lengths_append_) || !defined(_di_f_array_lengths_decimate_by_) || !defined(_di_f_array_lengthss_append_)
} // for
status = f_memory_adjust(lengthss->size, length, sizeof(f_array_lengths_t), (void **) & lengthss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- lengthss->size = length;
+ lengthss->size = length;
- if (lengthss->used > lengthss->size) {
- lengthss->used = length;
- }
+ if (lengthss->used > lengthss->size) {
+ lengthss->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_array_lengthss_adjust_) || !defined(_di_f_array_lengthss_decimate_by_)
} // for
status = f_memory_resize(lengthss->size, length, sizeof(f_array_lengths_t), (void **) & lengthss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- lengthss->size = length;
+ lengthss->size = length;
- if (lengthss->used > lengthss->size) {
- lengthss->used = length;
- }
+ if (lengthss->used > lengthss->size) {
+ lengthss->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_array_lengthss_decrease_by_) || !defined(_di_f_array_lengthss_increase_) || !defined(_di_f_array_lengthss_increase_by_) || !defined(_di_f_array_lengthss_resize_)
* Intended to be shared to each of the different implementation variations.
*
* @param source
- * The source array_lengths to append.
+ * The source array_length to append.
* @param destination
* The destination lengths the source is appended onto.
*
*
* Errors (with error bit) from: f_memory_resize().
*
+ * @see f_memory_resize()
* @see f_array_lengths_append()
* @see f_array_lengthss_append()
*/
#if !defined(_di_f_array_lengths_append_) || !defined(_di_f_array_lengthss_append_)
- extern f_status_t private_f_array_lengths_append(const f_array_lengths_t source, f_array_lengths_t *destination) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_array_lengths_append(const f_array_length_t source, f_array_lengths_t *destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_array_lengths_append_) || !defined(_di_f_array_lengthss_append_)
/**
+ * Private implementation for appending the array_length array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source array_lengths to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_array_lengths_append_all()
+ * @see f_array_lengthss_append()
+ * @see f_array_lengthss_append_all()
+ */
+#if !defined(_di_f_array_lengths_append_) || !defined(_di_f_array_lengths_append_all_) || !defined(_di_f_array_lengthss_append_all_)
+ extern f_status_t private_f_array_lengths_append_all(const f_array_lengths_t source, f_array_lengths_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_array_lengths_append_) || !defined(_di_f_array_lengths_append_all_) || !defined(_di_f_array_lengthss_append_all_)
+
+/**
* Private implementation for resizing the array_lengths array.
*
* Intended to be shared to each of the different implementation variations.
f_status_t private_f_cells_adjust(const f_array_length_t length, f_cells_t *cells) {
const f_status_t status = f_memory_adjust(cells->size, length, sizeof(f_cell_t), (void **) & cells->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- cells->size = length;
+ cells->size = length;
- if (cells->used > cells->size) {
- cells->used = length;
- }
+ if (cells->used > cells->size) {
+ cells->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_cells_adjust_) || !defined(_di_f_cells_decimate_by_)
#if !defined(_di_f_cells_append_) || !defined(_di_f_cellss_append_)
- extern f_status_t private_f_cells_append(const f_cells_t source, f_cells_t *destination) {
+ extern f_status_t private_f_cells_append(const f_cell_t source, f_cells_t *destination) {
- f_status_t status = F_none;
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_cells_adjust(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used].row = source.row;
+ destination->array[destination->used++].column = source.column;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_cells_append_) || !defined(_di_f_cellss_append_)
+
+#if !defined(_di_f_cells_append_) || !defined(_di_f_cells_append_all_) || !defined(_di_f_cellss_append_all_)
+ extern f_status_t private_f_cells_append_all(const f_cells_t source, f_cells_t *destination) {
if (destination->used + source.used > destination->size) {
- status = private_f_cells_adjust(destination->used + source.used, destination);
+ const f_status_t status = private_f_cells_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] = source.array[i];
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+
+ destination->array[destination->used].row = source.array[i].row;
+ destination->array[destination->used++].column = source.array[i].column;
} // for
return F_none;
}
-#endif // !defined(_di_f_cells_append_) || !defined(_di_f_cellss_append_)
+#endif // !defined(_di_f_cells_append_) || !defined(_di_f_cells_append_all_) || !defined(_di_f_cellss_append_all_)
#if !defined(_di_f_cells_resize_) || !defined(_di_f_cells_append_) || !defined(_di_f_cells_decimate_by_) || !defined(_di_f_cellss_append_)
f_status_t private_f_cells_resize(const f_array_length_t length, f_cells_t *cells) {
const f_status_t status = f_memory_resize(cells->size, length, sizeof(f_cell_t), (void **) & cells->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- cells->size = length;
+ cells->size = length;
- if (cells->used > cells->size) {
- cells->used = length;
- }
+ if (cells->used > cells->size) {
+ cells->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_cells_resize_) || !defined(_di_f_cells_append_) || !defined(_di_f_cells_decimate_by_) || !defined(_di_f_cellss_append_)
} // for
status = f_memory_adjust(cellss->size, length, sizeof(f_cells_t), (void **) & cellss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- cellss->size = length;
+ cellss->size = length;
- if (cellss->used > cellss->size) {
- cellss->used = length;
- }
+ if (cellss->used > cellss->size) {
+ cellss->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_cellss_adjust_) || !defined(_di_f_cellss_decimate_by_)
} // for
status = f_memory_resize(cellss->size, length, sizeof(f_cells_t), (void **) & cellss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- cellss->size = length;
+ cellss->size = length;
- if (cellss->used > cellss->size) {
- cellss->used = length;
- }
+ if (cellss->used > cellss->size) {
+ cellss->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_cellss_decrease_by_) || !defined(_di_f_cellss_increase_) || !defined(_di_f_cellss_increase_by_) || !defined(_di_f_cellss_resize_)
* Intended to be shared to each of the different implementation variations.
*
* @param source
- * The source cells to append.
+ * The source cell to append.
* @param destination
- * The destination cells the source is appended onto.
+ * The destination lengths the source is appended onto.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*
+ * @see f_memory_resize()
* @see f_cells_append()
* @see f_cellss_append()
*/
#if !defined(_di_f_cells_append_) || !defined(_di_f_cellss_append_)
- extern f_status_t private_f_cells_append(const f_cells_t source, f_cells_t *destination) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_cells_append(const f_cell_t source, f_cells_t *destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_cells_append_) || !defined(_di_f_cellss_append_)
/**
+ * Private implementation for appending the cell array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source cells to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_cells_append_all()
+ * @see f_cellss_append()
+ * @see f_cellss_append_all()
+ */
+#if !defined(_di_f_cells_append_) || !defined(_di_f_cells_append_all_) || !defined(_di_f_cellss_append_all_)
+ extern f_status_t private_f_cells_append_all(const f_cells_t source, f_cells_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_cells_append_) || !defined(_di_f_cells_append_all_) || !defined(_di_f_cellss_append_all_)
+
+/**
* Private implementation for resizing the cells array.
*
* Intended to be shared to each of the different implementation variations.
f_status_t private_f_fll_ids_adjust(const f_array_length_t length, f_fll_ids_t *ids) {
const f_status_t status = f_memory_adjust(ids->size, length, sizeof(f_fll_id_t), (void **) & ids->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- ids->size = length;
+ ids->size = length;
- if (ids->used > ids->size) {
- ids->used = length;
- }
+ if (ids->used > ids->size) {
+ ids->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_fll_ids_adjust_) || !defined(_di_f_fll_ids_decimate_by_)
#if !defined(_di_f_fll_ids_append_) || !defined(_di_f_fll_idss_append_)
- extern f_status_t private_f_fll_ids_append(const f_fll_ids_t source, f_fll_ids_t *destination) {
+ extern f_status_t private_f_fll_ids_append(const f_fll_id_t source, f_fll_ids_t *destination) {
- f_status_t status = F_none;
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_fll_ids_adjust(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ memcpy(destination->array[destination->used].name, source.name, sizeof(char) * f_fll_id_name_length_d);
+
+ destination->array[destination->used].type = source.type;
+ destination->array[destination->used++].used = source.used;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_fll_ids_append_) || !defined(_di_f_fll_idss_append_)
+
+#if !defined(_di_f_fll_ids_append_) || !defined(_di_f_fll_ids_append_all_) || !defined(_di_f_fll_idss_append_all_)
+ extern f_status_t private_f_fll_ids_append_all(const f_fll_ids_t source, f_fll_ids_t *destination) {
if (destination->used + source.used > destination->size) {
- status = private_f_fll_ids_adjust(destination->used + source.used, destination);
+ const f_status_t status = private_f_fll_ids_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] = source.array[i];
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+
+ memcpy(destination->array[destination->used].name, source.array[i].name, sizeof(char) * f_fll_id_name_length_d);
+
+ destination->array[destination->used].type = source.array[i].type;
+ destination->array[destination->used++].used = source.array[i].used;
} // for
return F_none;
}
-#endif // !defined(_di_f_fll_ids_append_) || !defined(_di_f_fll_idss_append_)
+#endif // !defined(_di_f_fll_ids_append_) || !defined(_di_f_fll_ids_append_all_) || !defined(_di_f_fll_idss_append_all_)
#if !defined(_di_f_fll_ids_resize_) || !defined(_di_f_fll_ids_append_) || !defined(_di_f_fll_ids_decimate_by_) || !defined(_di_f_fll_idss_append_)
f_status_t private_f_fll_ids_resize(const f_array_length_t length, f_fll_ids_t *ids) {
const f_status_t status = f_memory_resize(ids->size, length, sizeof(f_fll_id_t), (void **) & ids->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- ids->size = length;
+ ids->size = length;
- if (ids->used > ids->size) {
- ids->used = length;
- }
+ if (ids->used > ids->size) {
+ ids->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_fll_ids_resize_) || !defined(_di_f_fll_ids_append_) || !defined(_di_f_fll_ids_decimate_by_) || !defined(_di_f_fll_idss_append_)
} // for
status = f_memory_adjust(idss->size, length, sizeof(f_fll_ids_t), (void **) & idss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- idss->size = length;
+ idss->size = length;
- if (idss->used > idss->size) {
- idss->used = length;
- }
+ if (idss->used > idss->size) {
+ idss->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_fll_idss_adjust_) || !defined(_di_f_fll_idss_decimate_by_)
} // for
status = f_memory_resize(idss->size, length, sizeof(f_fll_ids_t), (void **) & idss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- idss->size = length;
+ idss->size = length;
- if (idss->used > idss->size) {
- idss->used = length;
- }
+ if (idss->used > idss->size) {
+ idss->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_fll_idss_decrease_by_) || !defined(_di_f_fll_idss_increase_) || !defined(_di_f_fll_idss_increase_by_) || !defined(_di_f_fll_idss_resize_)
* Intended to be shared to each of the different implementation variations.
*
* @param source
- * The source fll_ids to append.
+ * The source fll_id to append.
* @param destination
- * The destination fll_ids the source is appended onto.
+ * The destination lengths the source is appended onto.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*
+ * @see f_memory_resize()
* @see f_fll_ids_append()
* @see f_fll_idss_append()
*/
#if !defined(_di_f_fll_ids_append_) || !defined(_di_f_fll_idss_append_)
- extern f_status_t private_f_fll_ids_append(const f_fll_ids_t source, f_fll_ids_t *destination) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_fll_ids_append(const f_fll_id_t source, f_fll_ids_t *destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_fll_ids_append_) || !defined(_di_f_fll_idss_append_)
/**
+ * Private implementation for appending the fll_id array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source fll_ids to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_fll_ids_append_all()
+ * @see f_fll_idss_append()
+ * @see f_fll_idss_append_all()
+ */
+#if !defined(_di_f_fll_ids_append_) || !defined(_di_f_fll_ids_append_all_) || !defined(_di_f_fll_idss_append_all_)
+ extern f_status_t private_f_fll_ids_append_all(const f_fll_ids_t source, f_fll_ids_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_fll_ids_append_) || !defined(_di_f_fll_ids_append_all_) || !defined(_di_f_fll_idss_append_all_)
+
+/**
* Private implementation for resizing the fll_ids array.
*
* Intended to be shared to each of the different implementation variations.
#if !defined(_di_f_int128s_adjust_) || !defined(_di_f_int128s_decimate_by_)
f_status_t private_f_int128s_adjust(const f_array_length_t length, f_int128s_t *int128s) {
- const f_status_t status = f_memory_adjust(int128s->size, length, sizeof(f_int128_t), (void **) & int128s->array);
+ const f_status_t status = f_memory_adjust(int128s->size, length, sizeof(f_int128s_t), (void **) & int128s->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int128s->size = length;
+ int128s->size = length;
- if (int128s->used > int128s->size) {
- int128s->used = length;
- }
+ if (int128s->used > int128s->size) {
+ int128s->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_int128s_adjust_) || !defined(_di_f_int128s_decimate_by_)
#if !defined(_di_f_int128s_append_) || !defined(_di_f_int128ss_append_)
- extern f_status_t private_f_int128s_append(const f_int128s_t source, f_int128s_t *destination) {
+ extern f_status_t private_f_int128s_append(const int128_t source, f_int128s_t *destination) {
- f_status_t status = F_none;
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_int128s_adjust(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used++] = source;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_int128s_append_) || !defined(_di_f_int128ss_append_)
+
+#if !defined(_di_f_int128s_append_) || !defined(_di_f_int128s_append_all_) || !defined(_di_f_int128ss_append_all_)
+ extern f_status_t private_f_int128s_append_all(const f_int128s_t source, f_int128s_t *destination) {
if (destination->used + source.used > destination->size) {
- status = private_f_int128s_adjust(destination->used + source.used, destination);
+ const f_status_t status = private_f_int128s_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] = source.array[i];
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ destination->array[destination->used++] = source.array[i];
} // for
return F_none;
}
-#endif // !defined(_di_f_int128s_append_) || !defined(_di_f_int128ss_append_)
+#endif // !defined(_di_f_int128s_append_) || !defined(_di_f_int128s_append_all_) || !defined(_di_f_int128ss_append_all_)
#if !defined(_di_f_int128s_resize_) || !defined(_di_f_int128s_append_) || !defined(_di_f_int128s_decimate_by_) || !defined(_di_f_int128ss_append_)
f_status_t private_f_int128s_resize(const f_array_length_t length, f_int128s_t *int128s) {
- const f_status_t status = f_memory_resize(int128s->size, length, sizeof(f_int128_t), (void **) & int128s->array);
+ const f_status_t status = f_memory_resize(int128s->size, length, sizeof(f_int128s_t), (void **) & int128s->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int128s->size = length;
+ int128s->size = length;
- if (int128s->used > int128s->size) {
- int128s->used = length;
- }
+ if (int128s->used > int128s->size) {
+ int128s->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_int128s_resize_) || !defined(_di_f_int128s_append_) || !defined(_di_f_int128s_decimate_by_) || !defined(_di_f_int128ss_append_)
} // for
status = f_memory_adjust(int128ss->size, length, sizeof(f_int128s_t), (void **) & int128ss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int128ss->size = length;
+ int128ss->size = length;
- if (int128ss->used > int128ss->size) {
- int128ss->used = length;
- }
+ if (int128ss->used > int128ss->size) {
+ int128ss->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_int128ss_adjust_) || !defined(_di_f_int128ss_decimate_by_)
} // for
status = f_memory_resize(int128ss->size, length, sizeof(f_int128s_t), (void **) & int128ss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int128ss->size = length;
-
- if (int128ss->used > int128ss->size) {
- int128ss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_int128ss_decrease_by_) || !defined(_di_f_int128ss_increase_) || !defined(_di_f_int128ss_increase_by_) || !defined(_di_f_int128ss_resize_)
-
-#if !defined(_di_f_uint128s_adjust_) || !defined(_di_f_uint128s_decimate_by_)
- f_status_t private_f_uint128s_adjust(const f_array_length_t length, f_uint128s_t *uint128s) {
-
- const f_status_t status = f_memory_adjust(uint128s->size, length, sizeof(f_uint128_t), (void **) & uint128s->array);
+ int128ss->size = length;
- if (F_status_is_error_not(status)) {
- uint128s->size = length;
-
- if (uint128s->used > uint128s->size) {
- uint128s->used = length;
- }
+ if (int128ss->used > int128ss->size) {
+ int128ss->used = length;
}
- return status;
- }
-#endif // !defined(_di_f_uint128s_adjust_) || !defined(_di_f_uint128s_decimate_by_)
-
-#if !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128ss_append_)
- extern f_status_t private_f_uint128s_append(const f_uint128s_t source, f_uint128s_t *destination) {
-
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_uint128s_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] = source.array[i];
- } // for
-
return F_none;
}
-#endif // !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128ss_append_)
-
-#if !defined(_di_f_uint128s_resize_) || !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128s_decimate_by_) || !defined(_di_f_uint128ss_append_)
- f_status_t private_f_uint128s_resize(const f_array_length_t length, f_uint128s_t *uint128s) {
-
- const f_status_t status = f_memory_resize(uint128s->size, length, sizeof(f_uint128_t), (void **) & uint128s->array);
-
- if (F_status_is_error_not(status)) {
- uint128s->size = length;
-
- if (uint128s->used > uint128s->size) {
- uint128s->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_uint128s_resize_) || !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128s_decimate_by_) || !defined(_di_f_uint128ss_append_)
-
-#if !defined(_di_f_uint128ss_adjust_) || !defined(_di_f_uint128ss_decimate_by_)
- f_status_t private_f_uint128ss_adjust(const f_array_length_t length, f_uint128ss_t *uint128ss) {
-
- f_status_t status = F_none;
-
- for (f_array_length_t i = length; i < uint128ss->size; ++i) {
-
- status = f_memory_destroy(uint128ss->array[i].size, sizeof(f_uint128s_t), (void **) & uint128ss->array[i].array);
- if (F_status_is_error(status)) return status;
-
- uint128ss->array[i].size = 0;
- uint128ss->array[i].used = 0;
- } // for
-
- status = f_memory_adjust(uint128ss->size, length, sizeof(f_uint128s_t), (void **) & uint128ss->array);
-
- if (F_status_is_error_not(status)) {
- uint128ss->size = length;
-
- if (uint128ss->used > uint128ss->size) {
- uint128ss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_uint128ss_adjust_) || !defined(_di_f_uint128ss_decimate_by_)
-
-#if !defined(_di_f_uint128ss_decrease_by_) || !defined(_di_f_uint128ss_increase_) || !defined(_di_f_uint128ss_increase_by_) || !defined(_di_f_uint128ss_resize_)
- f_status_t private_f_uint128ss_resize(const f_array_length_t length, f_uint128ss_t *uint128ss) {
-
- f_status_t status = F_none;
-
- for (f_array_length_t i = length; i < uint128ss->size; ++i) {
-
- status = f_memory_delete(uint128ss->array[i].size, sizeof(f_uint128s_t), (void **) & uint128ss->array[i].array);
- if (F_status_is_error(status)) return status;
-
- uint128ss->array[i].size = 0;
- uint128ss->array[i].used = 0;
- } // for
-
- status = f_memory_resize(uint128ss->size, length, sizeof(f_uint128s_t), (void **) & uint128ss->array);
-
- if (F_status_is_error_not(status)) {
- uint128ss->size = length;
-
- if (uint128ss->used > uint128ss->size) {
- uint128ss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_uint128ss_decrease_by_) || !defined(_di_f_uint128ss_increase_) || !defined(_di_f_uint128ss_increase_by_) || !defined(_di_f_uint128ss_resize_)
+#endif // !defined(_di_f_int128ss_decrease_by_) || !defined(_di_f_int128ss_increase_) || !defined(_di_f_int128ss_increase_by_) || !defined(_di_f_int128ss_resize_)
#ifdef __cplusplus
} // extern "C"
* Intended to be shared to each of the different implementation variations.
*
* @param source
- * The source int128s to append.
+ * The source int128 to append.
* @param destination
- * The destination int128s the source is appended onto.
+ * The destination lengths the source is appended onto.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*
+ * @see f_memory_resize()
* @see f_int128s_append()
* @see f_int128ss_append()
*/
#if !defined(_di_f_int128s_append_) || !defined(_di_f_int128ss_append_)
- extern f_status_t private_f_int128s_append(const f_int128s_t source, f_int128s_t *destination) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_int128s_append(const int128_t source, f_int128s_t *destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int128s_append_) || !defined(_di_f_int128ss_append_)
/**
+ * Private implementation for appending the int128 array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source int128s to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_int128s_append_all()
+ * @see f_int128ss_append()
+ * @see f_int128ss_append_all()
+ */
+#if !defined(_di_f_int128s_append_) || !defined(_di_f_int128s_append_all_) || !defined(_di_f_int128ss_append_all_)
+ extern f_status_t private_f_int128s_append_all(const f_int128s_t source, f_int128s_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_int128s_append_) || !defined(_di_f_int128s_append_all_) || !defined(_di_f_int128ss_append_all_)
+
+/**
* Private implementation for resizing the int128s array.
*
* Intended to be shared to each of the different implementation variations.
extern f_status_t private_f_int128ss_resize(const f_array_length_t length, f_int128ss_t *int128ss) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int128ss_decrease_by_) || !defined(_di_f_int128ss_increase_) || !defined(_di_f_int128ss_increase_by_) || !defined(_di_f_int128ss_resize_)
-/**
- * Private implementation for resizing the uint128s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint128s
- * The uint128s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_uint128s_adjust()
- * @see f_uint128s_decimate_by()
- */
-#if !defined(_di_f_uint128s_adjust_) || !defined(_di_f_uint128s_decimate_by_)
- extern f_status_t private_f_uint128s_adjust(const f_array_length_t length, f_uint128s_t *uint128s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint128s_adjust_) || !defined(_di_f_uint128s_decimate_by_)
-
-/**
- * Private implementation for appending the uint128 array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
- * The source uint128s to append.
- * @param destination
- * The destination uint128s the source is appended onto.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint128s_append()
- * @see f_uint128ss_append()
- */
-#if !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128ss_append_)
- extern f_status_t private_f_uint128s_append(const f_uint128s_t source, f_uint128s_t *destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128ss_append_)
-
-/**
- * Private implementation for resizing the uint128s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint128s
- * The uint128s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint128s_resize()
- * @see f_uint128s_append()
- * @see f_uint128s_decimate_by()
- * @see f_uint128ss_append()
- */
-#if !defined(_di_f_uint128s_resize_) || !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128s_decimate_by_) || !defined(_di_f_uint128ss_append_)
- extern f_status_t private_f_uint128s_resize(const f_array_length_t length, f_uint128s_t *uint128s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint128s_resize_) || !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128s_decimate_by_) || !defined(_di_f_uint128ss_append_)
-
-/**
- * Private implementation for resizing the uint128ss array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint128ss
- * The uint128ss array to adjust.
- *
- * @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 new length is larger than max array length.
- * F_memory_not (with error bit) on out of memory.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
- *
- * @see f_uint128ss_adjust()
- * @see f_uint128ss_decimate_by()
- */
-#if !defined(_di_f_uint128ss_adjust_) || !defined(_di_f_uint128ss_decimate_by_)
- extern f_status_t private_f_uint128ss_adjust(const f_array_length_t length, f_uint128ss_t *uint128ss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint128ss_adjust_) || !defined(_di_f_uint128ss_decimate_by_)
-
-/**
- * Private implementation for resizing the uint128ss array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to resize to.
- * @param uint128ss
- * The uint128ss 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 new length is larger than max array length.
- * F_memory_not (with error bit) on out of memory.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_delete().
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint128ss_decrease_by()
- * @see f_uint128ss_increase()
- * @see f_uint128ss_increase_by()
- * @see f_uint128ss_resize()
- */
-#if !defined(_di_f_uint128ss_decrease_by_) || !defined(_di_f_uint128ss_increase_) || !defined(_di_f_uint128ss_increase_by_) || !defined(_di_f_uint128ss_resize_)
- extern f_status_t private_f_uint128ss_resize(const f_array_length_t length, f_uint128ss_t *uint128ss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint128ss_decrease_by_) || !defined(_di_f_uint128ss_increase_) || !defined(_di_f_uint128ss_increase_by_) || !defined(_di_f_uint128ss_resize_)
-
#ifdef __cplusplus
} // extern "C"
#endif
f_status_t private_f_int16s_adjust(const f_array_length_t length, f_int16s_t *int16s) {
const f_status_t status = f_memory_adjust(int16s->size, length, sizeof(int16_t), (void **) & int16s->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int16s->size = length;
+ int16s->size = length;
- if (int16s->used > int16s->size) {
- int16s->used = length;
- }
+ if (int16s->used > int16s->size) {
+ int16s->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_int16s_adjust_) || !defined(_di_f_int16s_decimate_by_)
#if !defined(_di_f_int16s_append_) || !defined(_di_f_int16ss_append_)
- extern f_status_t private_f_int16s_append(const f_int16s_t source, f_int16s_t *destination) {
+ extern f_status_t private_f_int16s_append(const int16_t source, f_int16s_t *destination) {
- f_status_t status = F_none;
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_int16s_adjust(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used++] = source;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_int16s_append_) || !defined(_di_f_int16ss_append_)
+
+#if !defined(_di_f_int16s_append_) || !defined(_di_f_int16s_append_all_) || !defined(_di_f_int16ss_append_all_)
+ extern f_status_t private_f_int16s_append_all(const f_int16s_t source, f_int16s_t *destination) {
if (destination->used + source.used > destination->size) {
- status = private_f_int16s_adjust(destination->used + source.used, destination);
+ const f_status_t status = private_f_int16s_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] = source.array[i];
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ destination->array[destination->used++] = source.array[i];
} // for
return F_none;
}
-#endif // !defined(_di_f_int16s_append_) || !defined(_di_f_int16ss_append_)
+#endif // !defined(_di_f_int16s_append_) || !defined(_di_f_int16s_append_all_) || !defined(_di_f_int16ss_append_all_)
#if !defined(_di_f_int16s_resize_) || !defined(_di_f_int16s_append_) || !defined(_di_f_int16s_decimate_by_) || !defined(_di_f_int16ss_append_)
f_status_t private_f_int16s_resize(const f_array_length_t length, f_int16s_t *int16s) {
const f_status_t status = f_memory_resize(int16s->size, length, sizeof(int16_t), (void **) & int16s->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int16s->size = length;
+ int16s->size = length;
- if (int16s->used > int16s->size) {
- int16s->used = length;
- }
+ if (int16s->used > int16s->size) {
+ int16s->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_int16s_resize_) || !defined(_di_f_int16s_append_) || !defined(_di_f_int16s_decimate_by_) || !defined(_di_f_int16ss_append_)
} // for
status = f_memory_adjust(int16ss->size, length, sizeof(f_int16s_t), (void **) & int16ss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int16ss->size = length;
+ int16ss->size = length;
- if (int16ss->used > int16ss->size) {
- int16ss->used = length;
- }
+ if (int16ss->used > int16ss->size) {
+ int16ss->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_int16ss_adjust_) || !defined(_di_f_int16ss_decimate_by_)
} // for
status = f_memory_resize(int16ss->size, length, sizeof(f_int16s_t), (void **) & int16ss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int16ss->size = length;
-
- if (int16ss->used > int16ss->size) {
- int16ss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_int16ss_decrease_by_) || !defined(_di_f_int16ss_increase_) || !defined(_di_f_int16ss_increase_by_) || !defined(_di_f_int16ss_resize_)
-
-#if !defined(_di_f_uint16s_adjust_) || !defined(_di_f_uint16s_decimate_by_)
- f_status_t private_f_uint16s_adjust(const f_array_length_t length, f_uint16s_t *uint16s) {
-
- const f_status_t status = f_memory_adjust(uint16s->size, length, sizeof(uint16_t), (void **) & uint16s->array);
+ int16ss->size = length;
- if (F_status_is_error_not(status)) {
- uint16s->size = length;
-
- if (uint16s->used > uint16s->size) {
- uint16s->used = length;
- }
+ if (int16ss->used > int16ss->size) {
+ int16ss->used = length;
}
- return status;
- }
-#endif // !defined(_di_f_uint16s_adjust_) || !defined(_di_f_uint16s_decimate_by_)
-
-#if !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16ss_append_)
- extern f_status_t private_f_uint16s_append(const f_uint16s_t source, f_uint16s_t *destination) {
-
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_uint16s_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] = source.array[i];
- } // for
-
return F_none;
}
-#endif // !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16ss_append_)
-
-#if !defined(_di_f_uint16s_resize_) || !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16s_decimate_by_) || !defined(_di_f_uint16ss_append_)
- f_status_t private_f_uint16s_resize(const f_array_length_t length, f_uint16s_t *uint16s) {
-
- const f_status_t status = f_memory_resize(uint16s->size, length, sizeof(uint16_t), (void **) & uint16s->array);
-
- if (F_status_is_error_not(status)) {
- uint16s->size = length;
-
- if (uint16s->used > uint16s->size) {
- uint16s->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_uint16s_resize_) || !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16s_decimate_by_) || !defined(_di_f_uint16ss_append_)
-
-#if !defined(_di_f_uint16ss_adjust_) || !defined(_di_f_uint16ss_decimate_by_)
- f_status_t private_f_uint16ss_adjust(const f_array_length_t length, f_uint16ss_t *uint16ss) {
-
- f_status_t status = F_none;
-
- for (f_array_length_t i = length; i < uint16ss->size; ++i) {
-
- status = f_memory_destroy(uint16ss->array[i].size, sizeof(f_uint16s_t), (void **) & uint16ss->array[i].array);
- if (F_status_is_error(status)) return status;
-
- uint16ss->array[i].size = 0;
- uint16ss->array[i].used = 0;
- } // for
-
- status = f_memory_adjust(uint16ss->size, length, sizeof(f_uint16s_t), (void **) & uint16ss->array);
-
- if (F_status_is_error_not(status)) {
- uint16ss->size = length;
-
- if (uint16ss->used > uint16ss->size) {
- uint16ss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_uint16ss_adjust_) || !defined(_di_f_uint16ss_decimate_by_)
-
-#if !defined(_di_f_uint16ss_decrease_by_) || !defined(_di_f_uint16ss_increase_) || !defined(_di_f_uint16ss_increase_by_) || !defined(_di_f_uint16ss_resize_)
- f_status_t private_f_uint16ss_resize(const f_array_length_t length, f_uint16ss_t *uint16ss) {
-
- f_status_t status = F_none;
-
- for (f_array_length_t i = length; i < uint16ss->size; ++i) {
-
- status = f_memory_delete(uint16ss->array[i].size, sizeof(f_uint16s_t), (void **) & uint16ss->array[i].array);
- if (F_status_is_error(status)) return status;
-
- uint16ss->array[i].size = 0;
- uint16ss->array[i].used = 0;
- } // for
-
- status = f_memory_resize(uint16ss->size, length, sizeof(f_uint16s_t), (void **) & uint16ss->array);
-
- if (F_status_is_error_not(status)) {
- uint16ss->size = length;
-
- if (uint16ss->used > uint16ss->size) {
- uint16ss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_uint16ss_decrease_by_) || !defined(_di_f_uint16ss_increase_) || !defined(_di_f_uint16ss_increase_by_) || !defined(_di_f_uint16ss_resize_)
+#endif // !defined(_di_f_int16ss_decrease_by_) || !defined(_di_f_int16ss_increase_) || !defined(_di_f_int16ss_increase_by_) || !defined(_di_f_int16ss_resize_)
#ifdef __cplusplus
} // extern "C"
* Intended to be shared to each of the different implementation variations.
*
* @param source
- * The source int16s to append.
+ * The source int16 to append.
* @param destination
- * The destination int16s the source is appended onto.
+ * The destination lengths the source is appended onto.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*
+ * @see f_memory_resize()
* @see f_int16s_append()
* @see f_int16ss_append()
*/
#if !defined(_di_f_int16s_append_) || !defined(_di_f_int16ss_append_)
- extern f_status_t private_f_int16s_append(const f_int16s_t source, f_int16s_t *destination) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_int16s_append(const int16_t source, f_int16s_t *destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int16s_append_) || !defined(_di_f_int16ss_append_)
/**
+ * Private implementation for appending the int16 array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source int16s to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_int16s_append_all()
+ * @see f_int16ss_append()
+ * @see f_int16ss_append_all()
+ */
+#if !defined(_di_f_int16s_append_) || !defined(_di_f_int16s_append_all_) || !defined(_di_f_int16ss_append_all_)
+ extern f_status_t private_f_int16s_append_all(const f_int16s_t source, f_int16s_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_int16s_append_) || !defined(_di_f_int16s_append_all_) || !defined(_di_f_int16ss_append_all_)
+
+/**
* Private implementation for resizing the int16s array.
*
* Intended to be shared to each of the different implementation variations.
extern f_status_t private_f_int16ss_resize(const f_array_length_t length, f_int16ss_t *int16ss) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int16ss_decrease_by_) || !defined(_di_f_int16ss_increase_) || !defined(_di_f_int16ss_increase_by_) || !defined(_di_f_int16ss_resize_)
-/**
- * Private implementation for resizing the uint16s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint16s
- * The uint16s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_uint16s_adjust()
- * @see f_uint16s_decimate_by()
- */
-#if !defined(_di_f_uint16s_adjust_) || !defined(_di_f_uint16s_decimate_by_)
- extern f_status_t private_f_uint16s_adjust(const f_array_length_t length, f_uint16s_t *uint16s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint16s_adjust_) || !defined(_di_f_uint16s_decimate_by_)
-
-/**
- * Private implementation for appending the uint16 array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
- * The source uint16s to append.
- * @param destination
- * The destination uint16s the source is appended onto.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint16s_append()
- * @see f_uint16ss_append()
- */
-#if !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16ss_append_)
- extern f_status_t private_f_uint16s_append(const f_uint16s_t source, f_uint16s_t *destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16ss_append_)
-
-/**
- * Private implementation for resizing the uint16s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint16s
- * The uint16s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint16s_resize()
- * @see f_uint16s_append()
- * @see f_uint16s_decimate_by()
- * @see f_uint16ss_append()
- */
-#if !defined(_di_f_uint16s_resize_) || !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16s_decimate_by_) || !defined(_di_f_uint16ss_append_)
- extern f_status_t private_f_uint16s_resize(const f_array_length_t length, f_uint16s_t *uint16s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint16s_resize_) || !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16s_decimate_by_) || !defined(_di_f_uint16ss_append_)
-
-/**
- * Private implementation for resizing the uint16ss array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint16ss
- * The uint16ss array to adjust.
- *
- * @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 new length is larger than max array length.
- * F_memory_not (with error bit) on out of memory.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
- *
- * @see f_uint16ss_adjust()
- * @see f_uint16ss_decimate_by()
- */
-#if !defined(_di_f_uint16ss_adjust_) || !defined(_di_f_uint16ss_decimate_by_)
- extern f_status_t private_f_uint16ss_adjust(const f_array_length_t length, f_uint16ss_t *uint16ss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint16ss_adjust_) || !defined(_di_f_uint16ss_decimate_by_)
-
-/**
- * Private implementation for resizing the uint16ss array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to resize to.
- * @param uint16ss
- * The uint16ss 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 new length is larger than max array length.
- * F_memory_not (with error bit) on out of memory.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_delete().
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint16ss_decrease_by()
- * @see f_uint16ss_increase()
- * @see f_uint16ss_increase_by()
- * @see f_uint16ss_resize()
- */
-#if !defined(_di_f_uint16ss_decrease_by_) || !defined(_di_f_uint16ss_increase_) || !defined(_di_f_uint16ss_increase_by_) || !defined(_di_f_uint16ss_resize_)
- extern f_status_t private_f_uint16ss_resize(const f_array_length_t length, f_uint16ss_t *uint16ss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint16ss_decrease_by_) || !defined(_di_f_uint16ss_increase_) || !defined(_di_f_uint16ss_increase_by_) || !defined(_di_f_uint16ss_resize_)
-
#ifdef __cplusplus
} // extern "C"
#endif
f_status_t private_f_int32s_adjust(const f_array_length_t length, f_int32s_t *int32s) {
const f_status_t status = f_memory_adjust(int32s->size, length, sizeof(int32_t), (void **) & int32s->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int32s->size = length;
+ int32s->size = length;
- if (int32s->used > int32s->size) {
- int32s->used = length;
- }
+ if (int32s->used > int32s->size) {
+ int32s->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_int32s_adjust_) || !defined(_di_f_int32s_decimate_by_)
#if !defined(_di_f_int32s_append_) || !defined(_di_f_int32ss_append_)
- extern f_status_t private_f_int32s_append(const f_int32s_t source, f_int32s_t *destination) {
+ extern f_status_t private_f_int32s_append(const int32_t source, f_int32s_t *destination) {
- f_status_t status = F_none;
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_int32s_adjust(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used++] = source;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_int32s_append_) || !defined(_di_f_int32ss_append_)
+
+#if !defined(_di_f_int32s_append_) || !defined(_di_f_int32s_append_all_) || !defined(_di_f_int32ss_append_all_)
+ extern f_status_t private_f_int32s_append_all(const f_int32s_t source, f_int32s_t *destination) {
if (destination->used + source.used > destination->size) {
- status = private_f_int32s_adjust(destination->used + source.used, destination);
+ const f_status_t status = private_f_int32s_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] = source.array[i];
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ destination->array[destination->used++] = source.array[i];
} // for
return F_none;
}
-#endif // !defined(_di_f_int32s_append_) || !defined(_di_f_int32ss_append_)
+#endif // !defined(_di_f_int32s_append_) || !defined(_di_f_int32s_append_all_) || !defined(_di_f_int32ss_append_all_)
#if !defined(_di_f_int32s_resize_) || !defined(_di_f_int32s_append_) || !defined(_di_f_int32s_decimate_by_) || !defined(_di_f_int32ss_append_)
f_status_t private_f_int32s_resize(const f_array_length_t length, f_int32s_t *int32s) {
const f_status_t status = f_memory_resize(int32s->size, length, sizeof(int32_t), (void **) & int32s->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int32s->size = length;
+ int32s->size = length;
- if (int32s->used > int32s->size) {
- int32s->used = length;
- }
+ if (int32s->used > int32s->size) {
+ int32s->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_int32s_resize_) || !defined(_di_f_int32s_append_) || !defined(_di_f_int32s_decimate_by_) || !defined(_di_f_int32ss_append_)
} // for
status = f_memory_adjust(int32ss->size, length, sizeof(f_int32s_t), (void **) & int32ss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int32ss->size = length;
+ int32ss->size = length;
- if (int32ss->used > int32ss->size) {
- int32ss->used = length;
- }
+ if (int32ss->used > int32ss->size) {
+ int32ss->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_int32ss_adjust_) || !defined(_di_f_int32ss_decimate_by_)
} // for
status = f_memory_resize(int32ss->size, length, sizeof(f_int32s_t), (void **) & int32ss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int32ss->size = length;
-
- if (int32ss->used > int32ss->size) {
- int32ss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_int32ss_decrease_by_) || !defined(_di_f_int32ss_increase_) || !defined(_di_f_int32ss_increase_by_) || !defined(_di_f_int32ss_resize_)
-
-#if !defined(_di_f_uint32s_adjust_) || !defined(_di_f_uint32s_decimate_by_)
- f_status_t private_f_uint32s_adjust(const f_array_length_t length, f_uint32s_t *uint32s) {
-
- const f_status_t status = f_memory_adjust(uint32s->size, length, sizeof(uint32_t), (void **) & uint32s->array);
+ int32ss->size = length;
- if (F_status_is_error_not(status)) {
- uint32s->size = length;
-
- if (uint32s->used > uint32s->size) {
- uint32s->used = length;
- }
+ if (int32ss->used > int32ss->size) {
+ int32ss->used = length;
}
- return status;
- }
-#endif // !defined(_di_f_uint32s_adjust_) || !defined(_di_f_uint32s_decimate_by_)
-
-#if !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32ss_append_)
- extern f_status_t private_f_uint32s_append(const f_uint32s_t source, f_uint32s_t *destination) {
-
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_uint32s_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] = source.array[i];
- } // for
-
return F_none;
}
-#endif // !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32ss_append_)
-
-#if !defined(_di_f_uint32s_resize_) || !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32s_decimate_by_) || !defined(_di_f_uint32ss_append_)
- f_status_t private_f_uint32s_resize(const f_array_length_t length, f_uint32s_t *uint32s) {
-
- const f_status_t status = f_memory_resize(uint32s->size, length, sizeof(uint32_t), (void **) & uint32s->array);
-
- if (F_status_is_error_not(status)) {
- uint32s->size = length;
-
- if (uint32s->used > uint32s->size) {
- uint32s->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_uint32s_resize_) || !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32s_decimate_by_) || !defined(_di_f_uint32ss_append_)
-
-#if !defined(_di_f_uint32ss_adjust_) || !defined(_di_f_uint32ss_decimate_by_)
- f_status_t private_f_uint32ss_adjust(const f_array_length_t length, f_uint32ss_t *uint32ss) {
-
- f_status_t status = F_none;
-
- for (f_array_length_t i = length; i < uint32ss->size; ++i) {
-
- status = f_memory_destroy(uint32ss->array[i].size, sizeof(f_uint32s_t), (void **) & uint32ss->array[i].array);
- if (F_status_is_error(status)) return status;
-
- uint32ss->array[i].size = 0;
- uint32ss->array[i].used = 0;
- } // for
-
- status = f_memory_adjust(uint32ss->size, length, sizeof(f_uint32s_t), (void **) & uint32ss->array);
-
- if (F_status_is_error_not(status)) {
- uint32ss->size = length;
-
- if (uint32ss->used > uint32ss->size) {
- uint32ss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_uint32ss_adjust_) || !defined(_di_f_uint32ss_decimate_by_)
-
-#if !defined(_di_f_uint32ss_decrease_by_) || !defined(_di_f_uint32ss_increase_) || !defined(_di_f_uint32ss_increase_by_) || !defined(_di_f_uint32ss_resize_)
- f_status_t private_f_uint32ss_resize(const f_array_length_t length, f_uint32ss_t *uint32ss) {
-
- f_status_t status = F_none;
-
- for (f_array_length_t i = length; i < uint32ss->size; ++i) {
-
- status = f_memory_delete(uint32ss->array[i].size, sizeof(f_uint32s_t), (void **) & uint32ss->array[i].array);
- if (F_status_is_error(status)) return status;
-
- uint32ss->array[i].size = 0;
- uint32ss->array[i].used = 0;
- } // for
-
- status = f_memory_resize(uint32ss->size, length, sizeof(f_uint32s_t), (void **) & uint32ss->array);
-
- if (F_status_is_error_not(status)) {
- uint32ss->size = length;
-
- if (uint32ss->used > uint32ss->size) {
- uint32ss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_uint32ss_decrease_by_) || !defined(_di_f_uint32ss_increase_) || !defined(_di_f_uint32ss_increase_by_) || !defined(_di_f_uint32ss_resize_)
+#endif // !defined(_di_f_int32ss_decrease_by_) || !defined(_di_f_int32ss_increase_) || !defined(_di_f_int32ss_increase_by_) || !defined(_di_f_int32ss_resize_)
#ifdef __cplusplus
} // extern "C"
* Intended to be shared to each of the different implementation variations.
*
* @param source
- * The source int32s to append.
+ * The source int32 to append.
* @param destination
- * The destination int32s the source is appended onto.
+ * The destination lengths the source is appended onto.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*
+ * @see f_memory_resize()
* @see f_int32s_append()
* @see f_int32ss_append()
*/
#if !defined(_di_f_int32s_append_) || !defined(_di_f_int32ss_append_)
- extern f_status_t private_f_int32s_append(const f_int32s_t source, f_int32s_t *destination) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_int32s_append(const int32_t source, f_int32s_t *destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int32s_append_) || !defined(_di_f_int32ss_append_)
/**
+ * Private implementation for appending the int32 array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source int32s to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_int32s_append_all()
+ * @see f_int32ss_append()
+ * @see f_int32ss_append_all()
+ */
+#if !defined(_di_f_int32s_append_) || !defined(_di_f_int32s_append_all_) || !defined(_di_f_int32ss_append_all_)
+ extern f_status_t private_f_int32s_append_all(const f_int32s_t source, f_int32s_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_int32s_append_) || !defined(_di_f_int32s_append_all_) || !defined(_di_f_int32ss_append_all_)
+
+/**
* Private implementation for resizing the int32s array.
*
* Intended to be shared to each of the different implementation variations.
extern f_status_t private_f_int32ss_resize(const f_array_length_t length, f_int32ss_t *int32ss) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int32ss_decrease_by_) || !defined(_di_f_int32ss_increase_) || !defined(_di_f_int32ss_increase_by_) || !defined(_di_f_int32ss_resize_)
-/**
- * Private implementation for resizing the uint32s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint32s
- * The uint32s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_uint32s_adjust()
- * @see f_uint32s_decimate_by()
- */
-#if !defined(_di_f_uint32s_adjust_) || !defined(_di_f_uint32s_decimate_by_)
- extern f_status_t private_f_uint32s_adjust(const f_array_length_t length, f_uint32s_t *uint32s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint32s_adjust_) || !defined(_di_f_uint32s_decimate_by_)
-
-/**
- * Private implementation for appending the uint32 array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
- * The source uint32s to append.
- * @param destination
- * The destination uint32s the source is appended onto.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint32s_append()
- * @see f_uint32ss_append()
- */
-#if !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32ss_append_)
- extern f_status_t private_f_uint32s_append(const f_uint32s_t source, f_uint32s_t *destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32ss_append_)
-
-/**
- * Private implementation for resizing the uint32s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint32s
- * The uint32s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint32s_resize()
- * @see f_uint32s_append()
- * @see f_uint32s_decimate_by()
- * @see f_uint32ss_append()
- */
-#if !defined(_di_f_uint32s_resize_) || !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32s_decimate_by_) || !defined(_di_f_uint32ss_append_)
- extern f_status_t private_f_uint32s_resize(const f_array_length_t length, f_uint32s_t *uint32s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint32s_resize_) || !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32s_decimate_by_) || !defined(_di_f_uint32ss_append_)
-
-/**
- * Private implementation for resizing the uint32ss array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint32ss
- * The uint32ss array to adjust.
- *
- * @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 new length is larger than max array length.
- * F_memory_not (with error bit) on out of memory.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
- *
- * @see f_uint32ss_adjust()
- * @see f_uint32ss_decimate_by()
- */
-#if !defined(_di_f_uint32ss_adjust_) || !defined(_di_f_uint32ss_decimate_by_)
- extern f_status_t private_f_uint32ss_adjust(const f_array_length_t length, f_uint32ss_t *uint32ss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint32ss_adjust_) || !defined(_di_f_uint32ss_decimate_by_)
-
-/**
- * Private implementation for resizing the uint32ss array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to resize to.
- * @param uint32ss
- * The uint32ss 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 new length is larger than max array length.
- * F_memory_not (with error bit) on out of memory.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_delete().
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint32ss_decrease_by()
- * @see f_uint32ss_increase()
- * @see f_uint32ss_increase_by()
- * @see f_uint32ss_resize()
- */
-#if !defined(_di_f_uint32ss_decrease_by_) || !defined(_di_f_uint32ss_increase_) || !defined(_di_f_uint32ss_increase_by_) || !defined(_di_f_uint32ss_resize_)
- extern f_status_t private_f_uint32ss_resize(const f_array_length_t length, f_uint32ss_t *uint32ss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint32ss_decrease_by_) || !defined(_di_f_uint32ss_increase_) || !defined(_di_f_uint32ss_increase_by_) || !defined(_di_f_uint32ss_resize_)
-
#ifdef __cplusplus
} // extern "C"
#endif
f_status_t private_f_int64s_adjust(const f_array_length_t length, f_int64s_t *int64s) {
const f_status_t status = f_memory_adjust(int64s->size, length, sizeof(int64_t), (void **) & int64s->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int64s->size = length;
+ int64s->size = length;
- if (int64s->used > int64s->size) {
- int64s->used = length;
- }
+ if (int64s->used > int64s->size) {
+ int64s->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_int64s_adjust_) || !defined(_di_f_int64s_decimate_by_)
#if !defined(_di_f_int64s_append_) || !defined(_di_f_int64ss_append_)
- extern f_status_t private_f_int64s_append(const f_int64s_t source, f_int64s_t *destination) {
+ extern f_status_t private_f_int64s_append(const int64_t source, f_int64s_t *destination) {
- f_status_t status = F_none;
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_int64s_adjust(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used++] = source;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_int64s_append_) || !defined(_di_f_int64ss_append_)
+
+#if !defined(_di_f_int64s_append_) || !defined(_di_f_int64s_append_all_) || !defined(_di_f_int64ss_append_all_)
+ extern f_status_t private_f_int64s_append_all(const f_int64s_t source, f_int64s_t *destination) {
if (destination->used + source.used > destination->size) {
- status = private_f_int64s_adjust(destination->used + source.used, destination);
+ const f_status_t status = private_f_int64s_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] = source.array[i];
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ destination->array[destination->used++] = source.array[i];
} // for
return F_none;
}
-#endif // !defined(_di_f_int64s_append_) || !defined(_di_f_int64ss_append_)
+#endif // !defined(_di_f_int64s_append_) || !defined(_di_f_int64s_append_all_) || !defined(_di_f_int64ss_append_all_)
#if !defined(_di_f_int64s_resize_) || !defined(_di_f_int64s_append_) || !defined(_di_f_int64s_decimate_by_) || !defined(_di_f_int64ss_append_)
f_status_t private_f_int64s_resize(const f_array_length_t length, f_int64s_t *int64s) {
const f_status_t status = f_memory_resize(int64s->size, length, sizeof(int64_t), (void **) & int64s->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int64s->size = length;
+ int64s->size = length;
- if (int64s->used > int64s->size) {
- int64s->used = length;
- }
+ if (int64s->used > int64s->size) {
+ int64s->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_int64s_resize_) || !defined(_di_f_int64s_append_) || !defined(_di_f_int64s_decimate_by_) || !defined(_di_f_int64ss_append_)
} // for
status = f_memory_adjust(int64ss->size, length, sizeof(f_int64s_t), (void **) & int64ss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int64ss->size = length;
+ int64ss->size = length;
- if (int64ss->used > int64ss->size) {
- int64ss->used = length;
- }
+ if (int64ss->used > int64ss->size) {
+ int64ss->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_int64ss_adjust_) || !defined(_di_f_int64ss_decimate_by_)
} // for
status = f_memory_resize(int64ss->size, length, sizeof(f_int64s_t), (void **) & int64ss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int64ss->size = length;
-
- if (int64ss->used > int64ss->size) {
- int64ss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_int64ss_decrease_by_) || !defined(_di_f_int64ss_increase_) || !defined(_di_f_int64ss_increase_by_) || !defined(_di_f_int64ss_resize_)
-
-#if !defined(_di_f_uint64s_adjust_) || !defined(_di_f_uint64s_decimate_by_)
- f_status_t private_f_uint64s_adjust(const f_array_length_t length, f_uint64s_t *uint64s) {
-
- const f_status_t status = f_memory_adjust(uint64s->size, length, sizeof(uint64_t), (void **) & uint64s->array);
+ int64ss->size = length;
- if (F_status_is_error_not(status)) {
- uint64s->size = length;
-
- if (uint64s->used > uint64s->size) {
- uint64s->used = length;
- }
+ if (int64ss->used > int64ss->size) {
+ int64ss->used = length;
}
- return status;
- }
-#endif // !defined(_di_f_uint64s_adjust_) || !defined(_di_f_uint64s_decimate_by_)
-
-#if !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64ss_append_)
- extern f_status_t private_f_uint64s_append(const f_uint64s_t source, f_uint64s_t *destination) {
-
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_uint64s_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] = source.array[i];
- } // for
-
return F_none;
}
-#endif // !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64ss_append_)
-
-#if !defined(_di_f_uint64s_resize_) || !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64s_decimate_by_) || !defined(_di_f_uint64ss_append_)
- f_status_t private_f_uint64s_resize(const f_array_length_t length, f_uint64s_t *uint64s) {
-
- const f_status_t status = f_memory_resize(uint64s->size, length, sizeof(uint64_t), (void **) & uint64s->array);
-
- if (F_status_is_error_not(status)) {
- uint64s->size = length;
-
- if (uint64s->used > uint64s->size) {
- uint64s->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_uint64s_resize_) || !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64s_decimate_by_) || !defined(_di_f_uint64ss_append_)
-
-#if !defined(_di_f_uint64ss_adjust_) || !defined(_di_f_uint64ss_decimate_by_)
- f_status_t private_f_uint64ss_adjust(const f_array_length_t length, f_uint64ss_t *uint64ss) {
-
- f_status_t status = F_none;
-
- for (f_array_length_t i = length; i < uint64ss->size; ++i) {
-
- status = f_memory_destroy(uint64ss->array[i].size, sizeof(f_uint64s_t), (void **) & uint64ss->array[i].array);
- if (F_status_is_error(status)) return status;
-
- uint64ss->array[i].size = 0;
- uint64ss->array[i].used = 0;
- } // for
-
- status = f_memory_adjust(uint64ss->size, length, sizeof(f_uint64s_t), (void **) & uint64ss->array);
-
- if (F_status_is_error_not(status)) {
- uint64ss->size = length;
-
- if (uint64ss->used > uint64ss->size) {
- uint64ss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_uint64ss_adjust_) || !defined(_di_f_uint64ss_decimate_by_)
-
-#if !defined(_di_f_uint64ss_decrease_by_) || !defined(_di_f_uint64ss_increase_) || !defined(_di_f_uint64ss_increase_by_) || !defined(_di_f_uint64ss_resize_)
- f_status_t private_f_uint64ss_resize(const f_array_length_t length, f_uint64ss_t *uint64ss) {
-
- f_status_t status = F_none;
-
- for (f_array_length_t i = length; i < uint64ss->size; ++i) {
-
- status = f_memory_delete(uint64ss->array[i].size, sizeof(f_uint64s_t), (void **) & uint64ss->array[i].array);
- if (F_status_is_error(status)) return status;
-
- uint64ss->array[i].size = 0;
- uint64ss->array[i].used = 0;
- } // for
-
- status = f_memory_resize(uint64ss->size, length, sizeof(f_uint64s_t), (void **) & uint64ss->array);
-
- if (F_status_is_error_not(status)) {
- uint64ss->size = length;
-
- if (uint64ss->used > uint64ss->size) {
- uint64ss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_uint64ss_decrease_by_) || !defined(_di_f_uint64ss_increase_) || !defined(_di_f_uint64ss_increase_by_) || !defined(_di_f_uint64ss_resize_)
+#endif // !defined(_di_f_int64ss_decrease_by_) || !defined(_di_f_int64ss_increase_) || !defined(_di_f_int64ss_increase_by_) || !defined(_di_f_int64ss_resize_)
#ifdef __cplusplus
} // extern "C"
* Intended to be shared to each of the different implementation variations.
*
* @param source
- * The source int64s to append.
+ * The source int64 to append.
* @param destination
- * The destination int64s the source is appended onto.
+ * The destination lengths the source is appended onto.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*
+ * @see f_memory_resize()
* @see f_int64s_append()
* @see f_int64ss_append()
*/
#if !defined(_di_f_int64s_append_) || !defined(_di_f_int64ss_append_)
- extern f_status_t private_f_int64s_append(const f_int64s_t source, f_int64s_t *destination) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_int64s_append(const int64_t source, f_int64s_t *destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int64s_append_) || !defined(_di_f_int64ss_append_)
/**
+ * Private implementation for appending the int64 array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source int64s to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_int64s_append_all()
+ * @see f_int64ss_append()
+ * @see f_int64ss_append_all()
+ */
+#if !defined(_di_f_int64s_append_) || !defined(_di_f_int64s_append_all_) || !defined(_di_f_int64ss_append_all_)
+ extern f_status_t private_f_int64s_append_all(const f_int64s_t source, f_int64s_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_int64s_append_) || !defined(_di_f_int64s_append_all_) || !defined(_di_f_int64ss_append_all_)
+
+/**
* Private implementation for resizing the int64s array.
*
* Intended to be shared to each of the different implementation variations.
extern f_status_t private_f_int64ss_resize(const f_array_length_t length, f_int64ss_t *int64ss) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int64ss_decrease_by_) || !defined(_di_f_int64ss_increase_) || !defined(_di_f_int64ss_increase_by_) || !defined(_di_f_int64ss_resize_)
-/**
- * Private implementation for resizing the uint64s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint64s
- * The uint64s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_uint64s_adjust()
- * @see f_uint64s_decimate_by()
- */
-#if !defined(_di_f_uint64s_adjust_) || !defined(_di_f_uint64s_decimate_by_)
- extern f_status_t private_f_uint64s_adjust(const f_array_length_t length, f_uint64s_t *uint64s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint64s_adjust_) || !defined(_di_f_uint64s_decimate_by_)
-
-/**
- * Private implementation for appending the uint64 array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
- * The source uint64s to append.
- * @param destination
- * The destination uint64s the source is appended onto.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint64s_append()
- * @see f_uint64ss_append()
- */
-#if !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64ss_append_)
- extern f_status_t private_f_uint64s_append(const f_uint64s_t source, f_uint64s_t *destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64ss_append_)
-
-/**
- * Private implementation for resizing the uint64s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint64s
- * The uint64s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint64s_resize()
- * @see f_uint64s_append()
- * @see f_uint64s_decimate_by()
- * @see f_uint64ss_append()
- */
-#if !defined(_di_f_uint64s_resize_) || !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64s_decimate_by_) || !defined(_di_f_uint64ss_append_)
- extern f_status_t private_f_uint64s_resize(const f_array_length_t length, f_uint64s_t *uint64s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint64s_resize_) || !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64s_decimate_by_) || !defined(_di_f_uint64ss_append_)
-
-/**
- * Private implementation for resizing the uint64ss array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint64ss
- * The uint64ss array to adjust.
- *
- * @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 new length is larger than max array length.
- * F_memory_not (with error bit) on out of memory.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
- *
- * @see f_uint64ss_adjust()
- * @see f_uint64ss_decimate_by()
- */
-#if !defined(_di_f_uint64ss_adjust_) || !defined(_di_f_uint64ss_decimate_by_)
- extern f_status_t private_f_uint64ss_adjust(const f_array_length_t length, f_uint64ss_t *uint64ss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint64ss_adjust_) || !defined(_di_f_uint64ss_decimate_by_)
-
-/**
- * Private implementation for resizing the uint64ss array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to resize to.
- * @param uint64ss
- * The uint64ss 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 new length is larger than max array length.
- * F_memory_not (with error bit) on out of memory.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_delete().
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint64ss_decrease_by()
- * @see f_uint64ss_increase()
- * @see f_uint64ss_increase_by()
- * @see f_uint64ss_resize()
- */
-#if !defined(_di_f_uint64ss_decrease_by_) || !defined(_di_f_uint64ss_increase_) || !defined(_di_f_uint64ss_increase_by_) || !defined(_di_f_uint64ss_resize_)
- extern f_status_t private_f_uint64ss_resize(const f_array_length_t length, f_uint64ss_t *uint64ss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint64ss_decrease_by_) || !defined(_di_f_uint64ss_increase_) || !defined(_di_f_uint64ss_increase_by_) || !defined(_di_f_uint64ss_resize_)
-
#ifdef __cplusplus
} // extern "C"
#endif
f_status_t private_f_int8s_adjust(const f_array_length_t length, f_int8s_t *int8s) {
const f_status_t status = f_memory_adjust(int8s->size, length, sizeof(int8_t), (void **) & int8s->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int8s->size = length;
+ int8s->size = length;
- if (int8s->used > int8s->size) {
- int8s->used = length;
- }
+ if (int8s->used > int8s->size) {
+ int8s->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_int8s_adjust_) || !defined(_di_f_int8s_decimate_by_)
#if !defined(_di_f_int8s_append_) || !defined(_di_f_int8ss_append_)
- extern f_status_t private_f_int8s_append(const f_int8s_t source, f_int8s_t *destination) {
+ extern f_status_t private_f_int8s_append(const int8_t source, f_int8s_t *destination) {
- f_status_t status = F_none;
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_int8s_adjust(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used++] = source;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_int8s_append_) || !defined(_di_f_int8ss_append_)
+
+#if !defined(_di_f_int8s_append_) || !defined(_di_f_int8s_append_all_) || !defined(_di_f_int8ss_append_all_)
+ extern f_status_t private_f_int8s_append_all(const f_int8s_t source, f_int8s_t *destination) {
if (destination->used + source.used > destination->size) {
- status = private_f_int8s_adjust(destination->used + source.used, destination);
+ const f_status_t status = private_f_int8s_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] = source.array[i];
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ destination->array[destination->used++] = source.array[i];
} // for
return F_none;
}
-#endif // !defined(_di_f_int8s_append_) || !defined(_di_f_int8ss_append_)
+#endif // !defined(_di_f_int8s_append_) || !defined(_di_f_int8s_append_all_) || !defined(_di_f_int8ss_append_all_)
#if !defined(_di_f_int8s_resize_) || !defined(_di_f_int8s_append_) || !defined(_di_f_int8s_decimate_by_) || !defined(_di_f_int8ss_append_)
f_status_t private_f_int8s_resize(const f_array_length_t length, f_int8s_t *int8s) {
const f_status_t status = f_memory_resize(int8s->size, length, sizeof(int8_t), (void **) & int8s->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int8s->size = length;
+ int8s->size = length;
- if (int8s->used > int8s->size) {
- int8s->used = length;
- }
+ if (int8s->used > int8s->size) {
+ int8s->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_int8s_resize_) || !defined(_di_f_int8s_append_) || !defined(_di_f_int8s_decimate_by_) || !defined(_di_f_int8ss_append_)
} // for
status = f_memory_adjust(int8ss->size, length, sizeof(f_int8s_t), (void **) & int8ss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int8ss->size = length;
+ int8ss->size = length;
- if (int8ss->used > int8ss->size) {
- int8ss->used = length;
- }
+ if (int8ss->used > int8ss->size) {
+ int8ss->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_int8ss_adjust_) || !defined(_di_f_int8ss_decimate_by_)
} // for
status = f_memory_resize(int8ss->size, length, sizeof(f_int8s_t), (void **) & int8ss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- int8ss->size = length;
-
- if (int8ss->used > int8ss->size) {
- int8ss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_int8ss_decrease_by_) || !defined(_di_f_int8ss_increase_) || !defined(_di_f_int8ss_increase_by_) || !defined(_di_f_int8ss_resize_)
-
-#if !defined(_di_f_uint8s_adjust_) || !defined(_di_f_uint8s_decimate_by_)
- f_status_t private_f_uint8s_adjust(const f_array_length_t length, f_uint8s_t *uint8s) {
-
- const f_status_t status = f_memory_adjust(uint8s->size, length, sizeof(uint8_t), (void **) & uint8s->array);
+ int8ss->size = length;
- if (F_status_is_error_not(status)) {
- uint8s->size = length;
-
- if (uint8s->used > uint8s->size) {
- uint8s->used = length;
- }
+ if (int8ss->used > int8ss->size) {
+ int8ss->used = length;
}
- return status;
- }
-#endif // !defined(_di_f_uint8s_adjust_) || !defined(_di_f_uint8s_decimate_by_)
-
-#if !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8ss_append_)
- extern f_status_t private_f_uint8s_append(const f_uint8s_t source, f_uint8s_t *destination) {
-
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_uint8s_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] = source.array[i];
- } // for
-
return F_none;
}
-#endif // !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8ss_append_)
-
-#if !defined(_di_f_uint8s_resize_) || !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8s_decimate_by_) || !defined(_di_f_uint8ss_append_)
- f_status_t private_f_uint8s_resize(const f_array_length_t length, f_uint8s_t *uint8s) {
-
- const f_status_t status = f_memory_resize(uint8s->size, length, sizeof(uint8_t), (void **) & uint8s->array);
-
- if (F_status_is_error_not(status)) {
- uint8s->size = length;
-
- if (uint8s->used > uint8s->size) {
- uint8s->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_uint8s_resize_) || !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8s_decimate_by_) || !defined(_di_f_uint8ss_append_)
-
-#if !defined(_di_f_uint8ss_adjust_) || !defined(_di_f_uint8ss_decimate_by_)
- f_status_t private_f_uint8ss_adjust(const f_array_length_t length, f_uint8ss_t *uint8ss) {
-
- f_status_t status = F_none;
-
- for (f_array_length_t i = length; i < uint8ss->size; ++i) {
-
- status = f_memory_destroy(uint8ss->array[i].size, sizeof(f_uint8s_t), (void **) & uint8ss->array[i].array);
- if (F_status_is_error(status)) return status;
-
- uint8ss->array[i].size = 0;
- uint8ss->array[i].used = 0;
- } // for
-
- status = f_memory_adjust(uint8ss->size, length, sizeof(f_uint8s_t), (void **) & uint8ss->array);
-
- if (F_status_is_error_not(status)) {
- uint8ss->size = length;
-
- if (uint8ss->used > uint8ss->size) {
- uint8ss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_uint8ss_adjust_) || !defined(_di_f_uint8ss_decimate_by_)
-
-#if !defined(_di_f_uint8ss_decrease_by_) || !defined(_di_f_uint8ss_increase_) || !defined(_di_f_uint8ss_increase_by_) || !defined(_di_f_uint8ss_resize_)
- f_status_t private_f_uint8ss_resize(const f_array_length_t length, f_uint8ss_t *uint8ss) {
-
- f_status_t status = F_none;
-
- for (f_array_length_t i = length; i < uint8ss->size; ++i) {
-
- status = f_memory_delete(uint8ss->array[i].size, sizeof(f_uint8s_t), (void **) & uint8ss->array[i].array);
- if (F_status_is_error(status)) return status;
-
- uint8ss->array[i].size = 0;
- uint8ss->array[i].used = 0;
- } // for
-
- status = f_memory_resize(uint8ss->size, length, sizeof(f_uint8s_t), (void **) & uint8ss->array);
-
- if (F_status_is_error_not(status)) {
- uint8ss->size = length;
-
- if (uint8ss->used > uint8ss->size) {
- uint8ss->used = length;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_uint8ss_decrease_by_) || !defined(_di_f_uint8ss_increase_) || !defined(_di_f_uint8ss_increase_by_) || !defined(_di_f_uint8ss_resize_)
+#endif // !defined(_di_f_int8ss_decrease_by_) || !defined(_di_f_int8ss_increase_) || !defined(_di_f_int8ss_increase_by_) || !defined(_di_f_int8ss_resize_)
#ifdef __cplusplus
} // extern "C"
* Intended to be shared to each of the different implementation variations.
*
* @param source
- * The source int8s to append.
+ * The source int8 to append.
* @param destination
- * The destination int8s the source is appended onto.
+ * The destination lengths the source is appended onto.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*
+ * @see f_memory_resize()
* @see f_int8s_append()
* @see f_int8ss_append()
*/
#if !defined(_di_f_int8s_append_) || !defined(_di_f_int8ss_append_)
- extern f_status_t private_f_int8s_append(const f_int8s_t source, f_int8s_t *destination) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_int8s_append(const int8_t source, f_int8s_t *destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int8s_append_) || !defined(_di_f_int8ss_append_)
/**
+ * Private implementation for appending the int8 array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source int8s to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_int8s_append_all()
+ * @see f_int8ss_append()
+ * @see f_int8ss_append_all()
+ */
+#if !defined(_di_f_int8s_append_) || !defined(_di_f_int8s_append_all_) || !defined(_di_f_int8ss_append_all_)
+ extern f_status_t private_f_int8s_append_all(const f_int8s_t source, f_int8s_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_int8s_append_) || !defined(_di_f_int8s_append_all_) || !defined(_di_f_int8ss_append_all_)
+
+/**
* Private implementation for resizing the int8s array.
*
* Intended to be shared to each of the different implementation variations.
extern f_status_t private_f_int8ss_resize(const f_array_length_t length, f_int8ss_t *int8ss) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int8ss_decrease_by_) || !defined(_di_f_int8ss_increase_) || !defined(_di_f_int8ss_increase_by_) || !defined(_di_f_int8ss_resize_)
-/**
- * Private implementation for resizing the uint8s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint8s
- * The uint8s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_uint8s_adjust()
- * @see f_uint8s_decimate_by()
- */
-#if !defined(_di_f_uint8s_adjust_) || !defined(_di_f_uint8s_decimate_by_)
- extern f_status_t private_f_uint8s_adjust(const f_array_length_t length, f_uint8s_t *uint8s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint8s_adjust_) || !defined(_di_f_uint8s_decimate_by_)
-
-/**
- * Private implementation for appending the uint8 array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param source
- * The source uint8s to append.
- * @param destination
- * The destination uint8s the source is appended onto.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint8s_append()
- * @see f_uint8ss_append()
- */
-#if !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8ss_append_)
- extern f_status_t private_f_uint8s_append(const f_uint8s_t source, f_uint8s_t *destination) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8ss_append_)
-
-/**
- * Private implementation for resizing the uint8s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint8s
- * The uint8s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint8s_resize()
- * @see f_uint8s_append()
- * @see f_uint8s_decimate_by()
- * @see f_uint8ss_append()
- */
-#if !defined(_di_f_uint8s_resize_) || !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8s_decimate_by_) || !defined(_di_f_uint8ss_append_)
- extern f_status_t private_f_uint8s_resize(const f_array_length_t length, f_uint8s_t *uint8s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint8s_resize_) || !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8s_decimate_by_) || !defined(_di_f_uint8ss_append_)
-
-/**
- * Private implementation for resizing the uint8ss array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint8ss
- * The uint8ss array to adjust.
- *
- * @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 new length is larger than max array length.
- * F_memory_not (with error bit) on out of memory.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
- *
- * @see f_uint8ss_adjust()
- * @see f_uint8ss_decimate_by()
- */
-#if !defined(_di_f_uint8ss_adjust_) || !defined(_di_f_uint8ss_decimate_by_)
- extern f_status_t private_f_uint8ss_adjust(const f_array_length_t length, f_uint8ss_t *uint8ss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint8ss_adjust_) || !defined(_di_f_uint8ss_decimate_by_)
-
-/**
- * Private implementation for resizing the uint8ss array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to resize to.
- * @param uint8ss
- * The uint8ss 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 new length is larger than max array length.
- * F_memory_not (with error bit) on out of memory.
- * F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_memory_delete().
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint8ss_decrease_by()
- * @see f_uint8ss_increase()
- * @see f_uint8ss_increase_by()
- * @see f_uint8ss_resize()
- */
-#if !defined(_di_f_uint8ss_decrease_by_) || !defined(_di_f_uint8ss_increase_) || !defined(_di_f_uint8ss_increase_by_) || !defined(_di_f_uint8ss_resize_)
- extern f_status_t private_f_uint8ss_resize(const f_array_length_t length, f_uint8ss_t *uint8ss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint8ss_decrease_by_) || !defined(_di_f_uint8ss_increase_) || !defined(_di_f_uint8ss_increase_by_) || !defined(_di_f_uint8ss_resize_)
-
#ifdef __cplusplus
} // extern "C"
#endif
f_status_t private_f_states_adjust(const f_array_length_t length, f_states_t *states) {
const f_status_t status = f_memory_adjust(states->size, length, sizeof(f_state_t), (void **) & states->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- states->size = length;
+ states->size = length;
- if (states->used > states->size) {
- states->used = length;
- }
+ if (states->used > states->size) {
+ states->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_states_adjust_) || !defined(_di_f_states_decimate_by_)
#if !defined(_di_f_states_append_) || !defined(_di_f_statess_append_)
- extern f_status_t private_f_states_append(const f_states_t source, f_states_t *destination) {
+ extern f_status_t private_f_states_append(const f_state_t source, f_states_t *destination) {
- f_status_t status = F_none;
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_states_adjust(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used].step_large = source.step_large;
+ destination->array[destination->used].step_small = source.step_small;
+
+ destination->array[destination->used].handle = source.handle;
+ destination->array[destination->used].interrupt = source.interrupt;
+
+ destination->array[destination->used].callbacks = source.callbacks;
+ destination->array[destination->used].custom = source.custom;
+ destination->array[destination->used++].data = source.data;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_states_append_) || !defined(_di_f_statess_append_)
+
+#if !defined(_di_f_states_append_) || !defined(_di_f_states_append_all_) || !defined(_di_f_statess_append_all_)
+ extern f_status_t private_f_states_append_all(const f_states_t source, f_states_t *destination) {
if (destination->used + source.used > destination->size) {
- status = private_f_states_adjust(destination->used + source.used, destination);
+ const f_status_t status = private_f_states_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] = source.array[i];
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+
+ destination->array[destination->used].step_large = source.array[i].step_large;
+ destination->array[destination->used].step_small = source.array[i].step_small;
+
+ destination->array[destination->used].handle = source.array[i].handle;
+ destination->array[destination->used].interrupt = source.array[i].interrupt;
+
+ destination->array[destination->used].callbacks = source.array[i].callbacks;
+ destination->array[destination->used].custom = source.array[i].custom;
+ destination->array[destination->used++].data = source.array[i].data;
} // for
return F_none;
}
-#endif // !defined(_di_f_states_append_) || !defined(_di_f_statess_append_)
+#endif // !defined(_di_f_states_append_) || !defined(_di_f_states_append_all_) || !defined(_di_f_statess_append_all_)
#if !defined(_di_f_states_resize_) || !defined(_di_f_states_append_) || !defined(_di_f_states_decimate_by_) || !defined(_di_f_statess_append_)
f_status_t private_f_states_resize(const f_array_length_t length, f_states_t *states) {
const f_status_t status = f_memory_resize(states->size, length, sizeof(f_state_t), (void **) & states->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- states->size = length;
+ states->size = length;
- if (states->used > states->size) {
- states->used = length;
- }
+ if (states->used > states->size) {
+ states->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_states_resize_) || !defined(_di_f_states_append_) || !defined(_di_f_states_decimate_by_) || !defined(_di_f_statess_append_)
} // for
status = f_memory_adjust(statess->size, length, sizeof(f_states_t), (void **) & statess->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- statess->size = length;
+ statess->size = length;
- if (statess->used > statess->size) {
- statess->used = length;
- }
+ if (statess->used > statess->size) {
+ statess->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_statess_adjust_) || !defined(_di_f_statess_decimate_by_)
} // for
status = f_memory_resize(statess->size, length, sizeof(f_states_t), (void **) & statess->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- statess->size = length;
+ statess->size = length;
- if (statess->used > statess->size) {
- statess->used = length;
- }
+ if (statess->used > statess->size) {
+ statess->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_statess_decrease_by_) || !defined(_di_f_statess_increase_) || !defined(_di_f_statess_increase_by_) || !defined(_di_f_statess_resize_)
* Intended to be shared to each of the different implementation variations.
*
* @param source
- * The source states to append.
+ * The source state to append.
* @param destination
- * The destination states the source is appended onto.
+ * The destination lengths the source is appended onto.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*
+ * @see f_memory_resize()
* @see f_states_append()
* @see f_statess_append()
*/
#if !defined(_di_f_states_append_) || !defined(_di_f_statess_append_)
- extern f_status_t private_f_states_append(const f_states_t source, f_states_t *destination) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_states_append(const f_state_t source, f_states_t *destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_states_append_) || !defined(_di_f_statess_append_)
/**
+ * Private implementation for appending the state array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source states to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_states_append_all()
+ * @see f_statess_append()
+ * @see f_statess_append_all()
+ */
+#if !defined(_di_f_states_append_) || !defined(_di_f_states_append_all_) || !defined(_di_f_statess_append_all_)
+ extern f_status_t private_f_states_append_all(const f_states_t source, f_states_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_states_append_) || !defined(_di_f_states_append_all_) || !defined(_di_f_statess_append_all_)
+
+/**
* Private implementation for resizing the states array.
*
* Intended to be shared to each of the different implementation variations.
f_status_t private_f_statuss_adjust(const f_array_length_t length, f_statuss_t *statuss) {
const f_status_t status = f_memory_adjust(statuss->size, length, sizeof(f_status_t), (void **) & statuss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- statuss->size = length;
+ statuss->size = length;
- if (statuss->used > statuss->size) {
- statuss->used = length;
- }
+ if (statuss->used > statuss->size) {
+ statuss->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_statuss_adjust_) || !defined(_di_f_statuss_decimate_by_)
#if !defined(_di_f_statuss_append_) || !defined(_di_f_statusss_append_)
- extern f_status_t private_f_statuss_append(const f_statuss_t source, f_statuss_t *destination) {
+ extern f_status_t private_f_statuss_append(const f_status_t source, f_statuss_t *destination) {
- f_status_t status = F_none;
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_statuss_adjust(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used++] = source;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_statuss_append_) || !defined(_di_f_statusss_append_)
+
+#if !defined(_di_f_statuss_append_) || !defined(_di_f_statuss_append_all_) || !defined(_di_f_statusss_append_all_)
+ extern f_status_t private_f_statuss_append_all(const f_statuss_t source, f_statuss_t *destination) {
if (destination->used + source.used > destination->size) {
- status = private_f_statuss_adjust(destination->used + source.used, destination);
+ const f_status_t status = private_f_statuss_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] = source.array[i];
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ destination->array[destination->used++] = source.array[i];
} // for
return F_none;
}
-#endif // !defined(_di_f_statuss_append_) || !defined(_di_f_statusss_append_)
+#endif // !defined(_di_f_statuss_append_) || !defined(_di_f_statuss_append_all_) || !defined(_di_f_statusss_append_all_)
#if !defined(_di_f_statuss_resize_) || !defined(_di_f_statuss_append_) || !defined(_di_f_statuss_decimate_by_) || !defined(_di_f_statusss_append_)
f_status_t private_f_statuss_resize(const f_array_length_t length, f_statuss_t *statuss) {
const f_status_t status = f_memory_resize(statuss->size, length, sizeof(f_status_t), (void **) & statuss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- statuss->size = length;
+ statuss->size = length;
- if (statuss->used > statuss->size) {
- statuss->used = length;
- }
+ if (statuss->used > statuss->size) {
+ statuss->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_statuss_resize_) || !defined(_di_f_statuss_append_) || !defined(_di_f_statuss_decimate_by_) || !defined(_di_f_statusss_append_)
} // for
status = f_memory_adjust(statusss->size, length, sizeof(f_statuss_t), (void **) & statusss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- statusss->size = length;
+ statusss->size = length;
- if (statusss->used > statusss->size) {
- statusss->used = length;
- }
+ if (statusss->used > statusss->size) {
+ statusss->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_statusss_adjust_) || !defined(_di_f_statusss_decimate_by_)
} // for
status = f_memory_resize(statusss->size, length, sizeof(f_statuss_t), (void **) & statusss->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- statusss->size = length;
+ statusss->size = length;
- if (statusss->used > statusss->size) {
- statusss->used = length;
- }
+ if (statusss->used > statusss->size) {
+ statusss->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_statusss_decrease_by_) || !defined(_di_f_statusss_increase_) || !defined(_di_f_statusss_increase_by_) || !defined(_di_f_statusss_resize_)
* Intended to be shared to each of the different implementation variations.
*
* @param source
- * The source statuss to append.
+ * The source status to append.
* @param destination
- * The destination statuss the source is appended onto.
+ * The destination lengths the source is appended onto.
*
* @return
* F_none on success.
*
* Errors (with error bit) from: f_memory_resize().
*
+ * @see f_memory_resize()
* @see f_statuss_append()
* @see f_statusss_append()
*/
#if !defined(_di_f_statuss_append_) || !defined(_di_f_statusss_append_)
- extern f_status_t private_f_statuss_append(const f_statuss_t source, f_statuss_t *destination) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_statuss_append(const f_status_t source, f_statuss_t *destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_statuss_append_) || !defined(_di_f_statusss_append_)
/**
+ * Private implementation for appending the status array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source statuss to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_statuss_append_all()
+ * @see f_statusss_append()
+ * @see f_statusss_append_all()
+ */
+#if !defined(_di_f_statuss_append_) || !defined(_di_f_statuss_append_all_) || !defined(_di_f_statusss_append_all_)
+ extern f_status_t private_f_statuss_append_all(const f_statuss_t source, f_statuss_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_statuss_append_) || !defined(_di_f_statuss_append_all_) || !defined(_di_f_statusss_append_all_)
+
+/**
* Private implementation for resizing the statuss array.
*
* Intended to be shared to each of the different implementation variations.
--- /dev/null
+#include "../type_array.h"
+#include "private-uint128.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_uint128s_adjust_) || !defined(_di_f_uint128s_decimate_by_)
+ f_status_t private_f_uint128s_adjust(const f_array_length_t length, f_uint128s_t *uint128s) {
+
+ const f_status_t status = f_memory_adjust(uint128s->size, length, sizeof(f_uint128s_t), (void **) & uint128s->array);
+ if (F_status_is_error(status)) return status;
+
+ uint128s->size = length;
+
+ if (uint128s->used > uint128s->size) {
+ uint128s->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint128s_adjust_) || !defined(_di_f_uint128s_decimate_by_)
+
+#if !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128ss_append_)
+ extern f_status_t private_f_uint128s_append(const uint128_t source, f_uint128s_t *destination) {
+
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_uint128s_adjust(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used++] = source;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128ss_append_)
+
+#if !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128s_append_all_) || !defined(_di_f_uint128ss_append_all_)
+ extern f_status_t private_f_uint128s_append_all(const f_uint128s_t source, f_uint128s_t *destination) {
+
+ if (destination->used + source.used > destination->size) {
+ const f_status_t status = private_f_uint128s_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->array[destination->used++] = source.array[i];
+ } // for
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128s_append_all_) || !defined(_di_f_uint128ss_append_all_)
+
+#if !defined(_di_f_uint128s_resize_) || !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128s_decimate_by_) || !defined(_di_f_uint128ss_append_)
+ f_status_t private_f_uint128s_resize(const f_array_length_t length, f_uint128s_t *uint128s) {
+
+ const f_status_t status = f_memory_resize(uint128s->size, length, sizeof(f_uint128s_t), (void **) & uint128s->array);
+ if (F_status_is_error(status)) return status;
+
+ uint128s->size = length;
+
+ if (uint128s->used > uint128s->size) {
+ uint128s->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint128s_resize_) || !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128s_decimate_by_) || !defined(_di_f_uint128ss_append_)
+
+#if !defined(_di_f_uint128ss_adjust_) || !defined(_di_f_uint128ss_decimate_by_)
+ f_status_t private_f_uint128ss_adjust(const f_array_length_t length, f_uint128ss_t *uint128ss) {
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < uint128ss->size; ++i) {
+
+ status = f_memory_destroy(uint128ss->array[i].size, sizeof(f_uint128s_t), (void **) & uint128ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint128ss->array[i].size = 0;
+ uint128ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_adjust(uint128ss->size, length, sizeof(f_uint128s_t), (void **) & uint128ss->array);
+ if (F_status_is_error(status)) return status;
+
+ uint128ss->size = length;
+
+ if (uint128ss->used > uint128ss->size) {
+ uint128ss->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint128ss_adjust_) || !defined(_di_f_uint128ss_decimate_by_)
+
+#if !defined(_di_f_uint128ss_decrease_by_) || !defined(_di_f_uint128ss_increase_) || !defined(_di_f_uint128ss_increase_by_) || !defined(_di_f_uint128ss_resize_)
+ f_status_t private_f_uint128ss_resize(const f_array_length_t length, f_uint128ss_t *uint128ss) {
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < uint128ss->size; ++i) {
+
+ status = f_memory_delete(uint128ss->array[i].size, sizeof(f_uint128s_t), (void **) & uint128ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint128ss->array[i].size = 0;
+ uint128ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_resize(uint128ss->size, length, sizeof(f_uint128s_t), (void **) & uint128ss->array);
+ if (F_status_is_error(status)) return status;
+
+ uint128ss->size = length;
+
+ if (uint128ss->used > uint128ss->size) {
+ uint128ss->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint128ss_decrease_by_) || !defined(_di_f_uint128ss_increase_) || !defined(_di_f_uint128ss_increase_by_) || !defined(_di_f_uint128ss_resize_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * 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_type_array_uint128_h
+#define _PRIVATE_F_type_array_uint128_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for resizing the uint128s array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to adjust to.
+ * @param uint128s
+ * The uint128s array to adjust.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_uint128s_adjust()
+ * @see f_uint128s_decimate_by()
+ */
+#if !defined(_di_f_uint128s_adjust_) || !defined(_di_f_uint128s_decimate_by_)
+ extern f_status_t private_f_uint128s_adjust(const f_array_length_t length, f_uint128s_t *uint128s) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint128s_adjust_) || !defined(_di_f_uint128s_decimate_by_)
+
+/**
+ * Private implementation for appending the uint128 array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source uint128 to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_uint128s_append()
+ * @see f_uint128ss_append()
+ */
+#if !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128ss_append_)
+ extern f_status_t private_f_uint128s_append(const uint128_t source, f_uint128s_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128ss_append_)
+
+/**
+ * Private implementation for appending the uint128 array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source uint128s to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_uint128s_append_all()
+ * @see f_uint128ss_append()
+ * @see f_uint128ss_append_all()
+ */
+#if !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128s_append_all_) || !defined(_di_f_uint128ss_append_all_)
+ extern f_status_t private_f_uint128s_append_all(const f_uint128s_t source, f_uint128s_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128s_append_all_) || !defined(_di_f_uint128ss_append_all_)
+
+/**
+ * Private implementation for resizing the uint128s array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to adjust to.
+ * @param uint128s
+ * The uint128s array to adjust.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_uint128s_resize()
+ * @see f_uint128s_append()
+ * @see f_uint128s_decimate_by()
+ * @see f_uint128ss_append()
+ */
+#if !defined(_di_f_uint128s_resize_) || !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128s_decimate_by_) || !defined(_di_f_uint128ss_append_)
+ extern f_status_t private_f_uint128s_resize(const f_array_length_t length, f_uint128s_t *uint128s) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint128s_resize_) || !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128s_decimate_by_) || !defined(_di_f_uint128ss_append_)
+
+/**
+ * Private implementation for resizing the uint128ss array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to adjust to.
+ * @param uint128ss
+ * The uint128ss array to adjust.
+ *
+ * @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 new length is larger than max array length.
+ * F_memory_not (with error bit) on out of memory.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_destroy().
+ *
+ * @see f_uint128ss_adjust()
+ * @see f_uint128ss_decimate_by()
+ */
+#if !defined(_di_f_uint128ss_adjust_) || !defined(_di_f_uint128ss_decimate_by_)
+ extern f_status_t private_f_uint128ss_adjust(const f_array_length_t length, f_uint128ss_t *uint128ss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint128ss_adjust_) || !defined(_di_f_uint128ss_decimate_by_)
+
+/**
+ * Private implementation for resizing the uint128ss array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to resize to.
+ * @param uint128ss
+ * The uint128ss 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 new length is larger than max array length.
+ * F_memory_not (with error bit) on out of memory.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_delete().
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_uint128ss_decrease_by()
+ * @see f_uint128ss_increase()
+ * @see f_uint128ss_increase_by()
+ * @see f_uint128ss_resize()
+ */
+#if !defined(_di_f_uint128ss_decrease_by_) || !defined(_di_f_uint128ss_increase_) || !defined(_di_f_uint128ss_increase_by_) || !defined(_di_f_uint128ss_resize_)
+ extern f_status_t private_f_uint128ss_resize(const f_array_length_t length, f_uint128ss_t *uint128ss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint128ss_decrease_by_) || !defined(_di_f_uint128ss_increase_) || !defined(_di_f_uint128ss_increase_by_) || !defined(_di_f_uint128ss_resize_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_type_array_uint128_h
--- /dev/null
+#include "../type_array.h"
+#include "private-uint16.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_uint16s_adjust_) || !defined(_di_f_uint16s_decimate_by_)
+ f_status_t private_f_uint16s_adjust(const f_array_length_t length, f_uint16s_t *uint16s) {
+
+ const f_status_t status = f_memory_adjust(uint16s->size, length, sizeof(uint16_t), (void **) & uint16s->array);
+ if (F_status_is_error(status)) return status;
+
+ uint16s->size = length;
+
+ if (uint16s->used > uint16s->size) {
+ uint16s->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint16s_adjust_) || !defined(_di_f_uint16s_decimate_by_)
+
+#if !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16ss_append_)
+ extern f_status_t private_f_uint16s_append(const uint16_t source, f_uint16s_t *destination) {
+
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_uint16s_adjust(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used++] = source;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16ss_append_)
+
+#if !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16s_append_all_) || !defined(_di_f_uint16ss_append_all_)
+ extern f_status_t private_f_uint16s_append_all(const f_uint16s_t source, f_uint16s_t *destination) {
+
+ if (destination->used + source.used > destination->size) {
+ const f_status_t status = private_f_uint16s_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->array[destination->used++] = source.array[i];
+ } // for
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16s_append_all_) || !defined(_di_f_uint16ss_append_all_)
+
+#if !defined(_di_f_uint16s_resize_) || !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16s_decimate_by_) || !defined(_di_f_uint16ss_append_)
+ f_status_t private_f_uint16s_resize(const f_array_length_t length, f_uint16s_t *uint16s) {
+
+ const f_status_t status = f_memory_resize(uint16s->size, length, sizeof(uint16_t), (void **) & uint16s->array);
+ if (F_status_is_error(status)) return status;
+
+ uint16s->size = length;
+
+ if (uint16s->used > uint16s->size) {
+ uint16s->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint16s_resize_) || !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16s_decimate_by_) || !defined(_di_f_uint16ss_append_)
+
+#if !defined(_di_f_uint16ss_adjust_) || !defined(_di_f_uint16ss_decimate_by_)
+ f_status_t private_f_uint16ss_adjust(const f_array_length_t length, f_uint16ss_t *uint16ss) {
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < uint16ss->size; ++i) {
+
+ status = f_memory_destroy(uint16ss->array[i].size, sizeof(f_uint16s_t), (void **) & uint16ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint16ss->array[i].size = 0;
+ uint16ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_adjust(uint16ss->size, length, sizeof(f_uint16s_t), (void **) & uint16ss->array);
+ if (F_status_is_error(status)) return status;
+
+ uint16ss->size = length;
+
+ if (uint16ss->used > uint16ss->size) {
+ uint16ss->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint16ss_adjust_) || !defined(_di_f_uint16ss_decimate_by_)
+
+#if !defined(_di_f_uint16ss_decrease_by_) || !defined(_di_f_uint16ss_increase_) || !defined(_di_f_uint16ss_increase_by_) || !defined(_di_f_uint16ss_resize_)
+ f_status_t private_f_uint16ss_resize(const f_array_length_t length, f_uint16ss_t *uint16ss) {
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < uint16ss->size; ++i) {
+
+ status = f_memory_delete(uint16ss->array[i].size, sizeof(f_uint16s_t), (void **) & uint16ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint16ss->array[i].size = 0;
+ uint16ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_resize(uint16ss->size, length, sizeof(f_uint16s_t), (void **) & uint16ss->array);
+ if (F_status_is_error(status)) return status;
+
+ uint16ss->size = length;
+
+ if (uint16ss->used > uint16ss->size) {
+ uint16ss->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint16ss_decrease_by_) || !defined(_di_f_uint16ss_increase_) || !defined(_di_f_uint16ss_increase_by_) || !defined(_di_f_uint16ss_resize_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * 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_type_array_uint16_h
+#define _PRIVATE_F_type_array_uint16_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for resizing the uint16s array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to adjust to.
+ * @param uint16s
+ * The uint16s array to adjust.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_uint16s_adjust()
+ * @see f_uint16s_decimate_by()
+ */
+#if !defined(_di_f_uint16s_adjust_) || !defined(_di_f_uint16s_decimate_by_)
+ extern f_status_t private_f_uint16s_adjust(const f_array_length_t length, f_uint16s_t *uint16s) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint16s_adjust_) || !defined(_di_f_uint16s_decimate_by_)
+
+/**
+ * Private implementation for appending the uint16 array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source uint16 to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_uint16s_append()
+ * @see f_uint16ss_append()
+ */
+#if !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16ss_append_)
+ extern f_status_t private_f_uint16s_append(const uint16_t source, f_uint16s_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16ss_append_)
+
+/**
+ * Private implementation for appending the uint16 array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source uint16s to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_uint16s_append_all()
+ * @see f_uint16ss_append()
+ * @see f_uint16ss_append_all()
+ */
+#if !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16s_append_all_) || !defined(_di_f_uint16ss_append_all_)
+ extern f_status_t private_f_uint16s_append_all(const f_uint16s_t source, f_uint16s_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16s_append_all_) || !defined(_di_f_uint16ss_append_all_)
+
+/**
+ * Private implementation for resizing the uint16s array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to adjust to.
+ * @param uint16s
+ * The uint16s array to adjust.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_uint16s_resize()
+ * @see f_uint16s_append()
+ * @see f_uint16s_decimate_by()
+ * @see f_uint16ss_append()
+ */
+#if !defined(_di_f_uint16s_resize_) || !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16s_decimate_by_) || !defined(_di_f_uint16ss_append_)
+ extern f_status_t private_f_uint16s_resize(const f_array_length_t length, f_uint16s_t *uint16s) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint16s_resize_) || !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16s_decimate_by_) || !defined(_di_f_uint16ss_append_)
+
+/**
+ * Private implementation for resizing the uint16ss array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to adjust to.
+ * @param uint16ss
+ * The uint16ss array to adjust.
+ *
+ * @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 new length is larger than max array length.
+ * F_memory_not (with error bit) on out of memory.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_destroy().
+ *
+ * @see f_uint16ss_adjust()
+ * @see f_uint16ss_decimate_by()
+ */
+#if !defined(_di_f_uint16ss_adjust_) || !defined(_di_f_uint16ss_decimate_by_)
+ extern f_status_t private_f_uint16ss_adjust(const f_array_length_t length, f_uint16ss_t *uint16ss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint16ss_adjust_) || !defined(_di_f_uint16ss_decimate_by_)
+
+/**
+ * Private implementation for resizing the uint16ss array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to resize to.
+ * @param uint16ss
+ * The uint16ss 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 new length is larger than max array length.
+ * F_memory_not (with error bit) on out of memory.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_delete().
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_uint16ss_decrease_by()
+ * @see f_uint16ss_increase()
+ * @see f_uint16ss_increase_by()
+ * @see f_uint16ss_resize()
+ */
+#if !defined(_di_f_uint16ss_decrease_by_) || !defined(_di_f_uint16ss_increase_) || !defined(_di_f_uint16ss_increase_by_) || !defined(_di_f_uint16ss_resize_)
+ extern f_status_t private_f_uint16ss_resize(const f_array_length_t length, f_uint16ss_t *uint16ss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint16ss_decrease_by_) || !defined(_di_f_uint16ss_increase_) || !defined(_di_f_uint16ss_increase_by_) || !defined(_di_f_uint16ss_resize_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_type_array_uint16_h
--- /dev/null
+#include "../type_array.h"
+#include "private-uint32.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_uint32s_adjust_) || !defined(_di_f_uint32s_decimate_by_)
+ f_status_t private_f_uint32s_adjust(const f_array_length_t length, f_uint32s_t *uint32s) {
+
+ const f_status_t status = f_memory_adjust(uint32s->size, length, sizeof(uint32_t), (void **) & uint32s->array);
+ if (F_status_is_error(status)) return status;
+
+ uint32s->size = length;
+
+ if (uint32s->used > uint32s->size) {
+ uint32s->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint32s_adjust_) || !defined(_di_f_uint32s_decimate_by_)
+
+#if !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32ss_append_)
+ extern f_status_t private_f_uint32s_append(const uint32_t source, f_uint32s_t *destination) {
+
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_uint32s_adjust(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used++] = source;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32ss_append_)
+
+#if !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32s_append_all_) || !defined(_di_f_uint32ss_append_all_)
+ extern f_status_t private_f_uint32s_append_all(const f_uint32s_t source, f_uint32s_t *destination) {
+
+ if (destination->used + source.used > destination->size) {
+ const f_status_t status = private_f_uint32s_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->array[destination->used++] = source.array[i];
+ } // for
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32s_append_all_) || !defined(_di_f_uint32ss_append_all_)
+
+#if !defined(_di_f_uint32s_resize_) || !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32s_decimate_by_) || !defined(_di_f_uint32ss_append_)
+ f_status_t private_f_uint32s_resize(const f_array_length_t length, f_uint32s_t *uint32s) {
+
+ const f_status_t status = f_memory_resize(uint32s->size, length, sizeof(uint32_t), (void **) & uint32s->array);
+ if (F_status_is_error(status)) return status;
+
+ uint32s->size = length;
+
+ if (uint32s->used > uint32s->size) {
+ uint32s->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint32s_resize_) || !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32s_decimate_by_) || !defined(_di_f_uint32ss_append_)
+
+#if !defined(_di_f_uint32ss_adjust_) || !defined(_di_f_uint32ss_decimate_by_)
+ f_status_t private_f_uint32ss_adjust(const f_array_length_t length, f_uint32ss_t *uint32ss) {
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < uint32ss->size; ++i) {
+
+ status = f_memory_destroy(uint32ss->array[i].size, sizeof(f_uint32s_t), (void **) & uint32ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint32ss->array[i].size = 0;
+ uint32ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_adjust(uint32ss->size, length, sizeof(f_uint32s_t), (void **) & uint32ss->array);
+ if (F_status_is_error(status)) return status;
+
+ uint32ss->size = length;
+
+ if (uint32ss->used > uint32ss->size) {
+ uint32ss->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint32ss_adjust_) || !defined(_di_f_uint32ss_decimate_by_)
+
+#if !defined(_di_f_uint32ss_decrease_by_) || !defined(_di_f_uint32ss_increase_) || !defined(_di_f_uint32ss_increase_by_) || !defined(_di_f_uint32ss_resize_)
+ f_status_t private_f_uint32ss_resize(const f_array_length_t length, f_uint32ss_t *uint32ss) {
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < uint32ss->size; ++i) {
+
+ status = f_memory_delete(uint32ss->array[i].size, sizeof(f_uint32s_t), (void **) & uint32ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint32ss->array[i].size = 0;
+ uint32ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_resize(uint32ss->size, length, sizeof(f_uint32s_t), (void **) & uint32ss->array);
+ if (F_status_is_error(status)) return status;
+
+ uint32ss->size = length;
+
+ if (uint32ss->used > uint32ss->size) {
+ uint32ss->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint32ss_decrease_by_) || !defined(_di_f_uint32ss_increase_) || !defined(_di_f_uint32ss_increase_by_) || !defined(_di_f_uint32ss_resize_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * 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_type_array_uint32_h
+#define _PRIVATE_F_type_array_uint32_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for resizing the uint32s array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to adjust to.
+ * @param uint32s
+ * The uint32s array to adjust.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_uint32s_adjust()
+ * @see f_uint32s_decimate_by()
+ */
+#if !defined(_di_f_uint32s_adjust_) || !defined(_di_f_uint32s_decimate_by_)
+ extern f_status_t private_f_uint32s_adjust(const f_array_length_t length, f_uint32s_t *uint32s) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint32s_adjust_) || !defined(_di_f_uint32s_decimate_by_)
+
+/**
+ * Private implementation for appending the uint32 array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source uint32 to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_uint32s_append()
+ * @see f_uint32ss_append()
+ */
+#if !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32ss_append_)
+ extern f_status_t private_f_uint32s_append(const uint32_t source, f_uint32s_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32ss_append_)
+
+/**
+ * Private implementation for appending the uint32 array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source uint32s to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_uint32s_append_all()
+ * @see f_uint32ss_append()
+ * @see f_uint32ss_append_all()
+ */
+#if !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32s_append_all_) || !defined(_di_f_uint32ss_append_all_)
+ extern f_status_t private_f_uint32s_append_all(const f_uint32s_t source, f_uint32s_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32s_append_all_) || !defined(_di_f_uint32ss_append_all_)
+
+/**
+ * Private implementation for resizing the uint32s array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to adjust to.
+ * @param uint32s
+ * The uint32s array to adjust.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_uint32s_resize()
+ * @see f_uint32s_append()
+ * @see f_uint32s_decimate_by()
+ * @see f_uint32ss_append()
+ */
+#if !defined(_di_f_uint32s_resize_) || !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32s_decimate_by_) || !defined(_di_f_uint32ss_append_)
+ extern f_status_t private_f_uint32s_resize(const f_array_length_t length, f_uint32s_t *uint32s) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint32s_resize_) || !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32s_decimate_by_) || !defined(_di_f_uint32ss_append_)
+
+/**
+ * Private implementation for resizing the uint32ss array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to adjust to.
+ * @param uint32ss
+ * The uint32ss array to adjust.
+ *
+ * @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 new length is larger than max array length.
+ * F_memory_not (with error bit) on out of memory.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_destroy().
+ *
+ * @see f_uint32ss_adjust()
+ * @see f_uint32ss_decimate_by()
+ */
+#if !defined(_di_f_uint32ss_adjust_) || !defined(_di_f_uint32ss_decimate_by_)
+ extern f_status_t private_f_uint32ss_adjust(const f_array_length_t length, f_uint32ss_t *uint32ss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint32ss_adjust_) || !defined(_di_f_uint32ss_decimate_by_)
+
+/**
+ * Private implementation for resizing the uint32ss array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to resize to.
+ * @param uint32ss
+ * The uint32ss 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 new length is larger than max array length.
+ * F_memory_not (with error bit) on out of memory.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_delete().
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_uint32ss_decrease_by()
+ * @see f_uint32ss_increase()
+ * @see f_uint32ss_increase_by()
+ * @see f_uint32ss_resize()
+ */
+#if !defined(_di_f_uint32ss_decrease_by_) || !defined(_di_f_uint32ss_increase_) || !defined(_di_f_uint32ss_increase_by_) || !defined(_di_f_uint32ss_resize_)
+ extern f_status_t private_f_uint32ss_resize(const f_array_length_t length, f_uint32ss_t *uint32ss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint32ss_decrease_by_) || !defined(_di_f_uint32ss_increase_) || !defined(_di_f_uint32ss_increase_by_) || !defined(_di_f_uint32ss_resize_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_type_array_uint32_h
--- /dev/null
+#include "../type_array.h"
+#include "private-uint64.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_uint64s_adjust_) || !defined(_di_f_uint64s_decimate_by_)
+ f_status_t private_f_uint64s_adjust(const f_array_length_t length, f_uint64s_t *uint64s) {
+
+ const f_status_t status = f_memory_adjust(uint64s->size, length, sizeof(uint64_t), (void **) & uint64s->array);
+ if (F_status_is_error(status)) return status;
+
+ uint64s->size = length;
+
+ if (uint64s->used > uint64s->size) {
+ uint64s->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint64s_adjust_) || !defined(_di_f_uint64s_decimate_by_)
+
+#if !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64ss_append_)
+ extern f_status_t private_f_uint64s_append(const uint64_t source, f_uint64s_t *destination) {
+
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_uint64s_adjust(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used++] = source;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64ss_append_)
+
+#if !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64s_append_all_) || !defined(_di_f_uint64ss_append_all_)
+ extern f_status_t private_f_uint64s_append_all(const f_uint64s_t source, f_uint64s_t *destination) {
+
+ if (destination->used + source.used > destination->size) {
+ const f_status_t status = private_f_uint64s_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->array[destination->used++] = source.array[i];
+ } // for
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64s_append_all_) || !defined(_di_f_uint64ss_append_all_)
+
+#if !defined(_di_f_uint64s_resize_) || !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64s_decimate_by_) || !defined(_di_f_uint64ss_append_)
+ f_status_t private_f_uint64s_resize(const f_array_length_t length, f_uint64s_t *uint64s) {
+
+ const f_status_t status = f_memory_resize(uint64s->size, length, sizeof(uint64_t), (void **) & uint64s->array);
+ if (F_status_is_error(status)) return status;
+
+ uint64s->size = length;
+
+ if (uint64s->used > uint64s->size) {
+ uint64s->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint64s_resize_) || !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64s_decimate_by_) || !defined(_di_f_uint64ss_append_)
+
+#if !defined(_di_f_uint64ss_adjust_) || !defined(_di_f_uint64ss_decimate_by_)
+ f_status_t private_f_uint64ss_adjust(const f_array_length_t length, f_uint64ss_t *uint64ss) {
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < uint64ss->size; ++i) {
+
+ status = f_memory_destroy(uint64ss->array[i].size, sizeof(f_uint64s_t), (void **) & uint64ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint64ss->array[i].size = 0;
+ uint64ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_adjust(uint64ss->size, length, sizeof(f_uint64s_t), (void **) & uint64ss->array);
+ if (F_status_is_error(status)) return status;
+
+ uint64ss->size = length;
+
+ if (uint64ss->used > uint64ss->size) {
+ uint64ss->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint64ss_adjust_) || !defined(_di_f_uint64ss_decimate_by_)
+
+#if !defined(_di_f_uint64ss_decrease_by_) || !defined(_di_f_uint64ss_increase_) || !defined(_di_f_uint64ss_increase_by_) || !defined(_di_f_uint64ss_resize_)
+ f_status_t private_f_uint64ss_resize(const f_array_length_t length, f_uint64ss_t *uint64ss) {
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < uint64ss->size; ++i) {
+
+ status = f_memory_delete(uint64ss->array[i].size, sizeof(f_uint64s_t), (void **) & uint64ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint64ss->array[i].size = 0;
+ uint64ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_resize(uint64ss->size, length, sizeof(f_uint64s_t), (void **) & uint64ss->array);
+ if (F_status_is_error(status)) return status;
+
+ uint64ss->size = length;
+
+ if (uint64ss->used > uint64ss->size) {
+ uint64ss->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint64ss_decrease_by_) || !defined(_di_f_uint64ss_increase_) || !defined(_di_f_uint64ss_increase_by_) || !defined(_di_f_uint64ss_resize_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * 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_type_array_uint64_h
+#define _PRIVATE_F_type_array_uint64_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for resizing the uint64s array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to adjust to.
+ * @param uint64s
+ * The uint64s array to adjust.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_uint64s_adjust()
+ * @see f_uint64s_decimate_by()
+ */
+#if !defined(_di_f_uint64s_adjust_) || !defined(_di_f_uint64s_decimate_by_)
+ extern f_status_t private_f_uint64s_adjust(const f_array_length_t length, f_uint64s_t *uint64s) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint64s_adjust_) || !defined(_di_f_uint64s_decimate_by_)
+
+/**
+ * Private implementation for appending the uint64 array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source uint64 to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_uint64s_append()
+ * @see f_uint64ss_append()
+ */
+#if !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64ss_append_)
+ extern f_status_t private_f_uint64s_append(const uint64_t source, f_uint64s_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64ss_append_)
+
+/**
+ * Private implementation for appending the uint64 array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source uint64s to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_uint64s_append_all()
+ * @see f_uint64ss_append()
+ * @see f_uint64ss_append_all()
+ */
+#if !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64s_append_all_) || !defined(_di_f_uint64ss_append_all_)
+ extern f_status_t private_f_uint64s_append_all(const f_uint64s_t source, f_uint64s_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64s_append_all_) || !defined(_di_f_uint64ss_append_all_)
+
+/**
+ * Private implementation for resizing the uint64s array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to adjust to.
+ * @param uint64s
+ * The uint64s array to adjust.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_uint64s_resize()
+ * @see f_uint64s_append()
+ * @see f_uint64s_decimate_by()
+ * @see f_uint64ss_append()
+ */
+#if !defined(_di_f_uint64s_resize_) || !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64s_decimate_by_) || !defined(_di_f_uint64ss_append_)
+ extern f_status_t private_f_uint64s_resize(const f_array_length_t length, f_uint64s_t *uint64s) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint64s_resize_) || !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64s_decimate_by_) || !defined(_di_f_uint64ss_append_)
+
+/**
+ * Private implementation for resizing the uint64ss array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to adjust to.
+ * @param uint64ss
+ * The uint64ss array to adjust.
+ *
+ * @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 new length is larger than max array length.
+ * F_memory_not (with error bit) on out of memory.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_destroy().
+ *
+ * @see f_uint64ss_adjust()
+ * @see f_uint64ss_decimate_by()
+ */
+#if !defined(_di_f_uint64ss_adjust_) || !defined(_di_f_uint64ss_decimate_by_)
+ extern f_status_t private_f_uint64ss_adjust(const f_array_length_t length, f_uint64ss_t *uint64ss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint64ss_adjust_) || !defined(_di_f_uint64ss_decimate_by_)
+
+/**
+ * Private implementation for resizing the uint64ss array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to resize to.
+ * @param uint64ss
+ * The uint64ss 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 new length is larger than max array length.
+ * F_memory_not (with error bit) on out of memory.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_delete().
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_uint64ss_decrease_by()
+ * @see f_uint64ss_increase()
+ * @see f_uint64ss_increase_by()
+ * @see f_uint64ss_resize()
+ */
+#if !defined(_di_f_uint64ss_decrease_by_) || !defined(_di_f_uint64ss_increase_) || !defined(_di_f_uint64ss_increase_by_) || !defined(_di_f_uint64ss_resize_)
+ extern f_status_t private_f_uint64ss_resize(const f_array_length_t length, f_uint64ss_t *uint64ss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint64ss_decrease_by_) || !defined(_di_f_uint64ss_increase_) || !defined(_di_f_uint64ss_increase_by_) || !defined(_di_f_uint64ss_resize_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_type_array_uint64_h
--- /dev/null
+#include "../type_array.h"
+#include "private-uint8.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_di_f_uint8s_adjust_) || !defined(_di_f_uint8s_decimate_by_)
+ f_status_t private_f_uint8s_adjust(const f_array_length_t length, f_uint8s_t *uint8s) {
+
+ const f_status_t status = f_memory_adjust(uint8s->size, length, sizeof(uint8_t), (void **) & uint8s->array);
+ if (F_status_is_error(status)) return status;
+
+ uint8s->size = length;
+
+ if (uint8s->used > uint8s->size) {
+ uint8s->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint8s_adjust_) || !defined(_di_f_uint8s_decimate_by_)
+
+#if !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8ss_append_)
+ extern f_status_t private_f_uint8s_append(const uint8_t source, f_uint8s_t *destination) {
+
+ if (destination->used + 1 > destination->size) {
+ const f_status_t status = private_f_uint8s_adjust(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ destination->array[destination->used++] = source;
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8ss_append_)
+
+#if !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8s_append_all_) || !defined(_di_f_uint8ss_append_all_)
+ extern f_status_t private_f_uint8s_append_all(const f_uint8s_t source, f_uint8s_t *destination) {
+
+ if (destination->used + source.used > destination->size) {
+ const f_status_t status = private_f_uint8s_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->array[destination->used++] = source.array[i];
+ } // for
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8s_append_all_) || !defined(_di_f_uint8ss_append_all_)
+
+#if !defined(_di_f_uint8s_resize_) || !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8s_decimate_by_) || !defined(_di_f_uint8ss_append_)
+ f_status_t private_f_uint8s_resize(const f_array_length_t length, f_uint8s_t *uint8s) {
+
+ const f_status_t status = f_memory_resize(uint8s->size, length, sizeof(uint8_t), (void **) & uint8s->array);
+ if (F_status_is_error(status)) return status;
+
+ uint8s->size = length;
+
+ if (uint8s->used > uint8s->size) {
+ uint8s->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint8s_resize_) || !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8s_decimate_by_) || !defined(_di_f_uint8ss_append_)
+
+#if !defined(_di_f_uint8ss_adjust_) || !defined(_di_f_uint8ss_decimate_by_)
+ f_status_t private_f_uint8ss_adjust(const f_array_length_t length, f_uint8ss_t *uint8ss) {
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < uint8ss->size; ++i) {
+
+ status = f_memory_destroy(uint8ss->array[i].size, sizeof(f_uint8s_t), (void **) & uint8ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint8ss->array[i].size = 0;
+ uint8ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_adjust(uint8ss->size, length, sizeof(f_uint8s_t), (void **) & uint8ss->array);
+ if (F_status_is_error(status)) return status;
+
+ uint8ss->size = length;
+
+ if (uint8ss->used > uint8ss->size) {
+ uint8ss->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint8ss_adjust_) || !defined(_di_f_uint8ss_decimate_by_)
+
+#if !defined(_di_f_uint8ss_decrease_by_) || !defined(_di_f_uint8ss_increase_) || !defined(_di_f_uint8ss_increase_by_) || !defined(_di_f_uint8ss_resize_)
+ f_status_t private_f_uint8ss_resize(const f_array_length_t length, f_uint8ss_t *uint8ss) {
+
+ f_status_t status = F_none;
+
+ for (f_array_length_t i = length; i < uint8ss->size; ++i) {
+
+ status = f_memory_delete(uint8ss->array[i].size, sizeof(f_uint8s_t), (void **) & uint8ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint8ss->array[i].size = 0;
+ uint8ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_resize(uint8ss->size, length, sizeof(f_uint8s_t), (void **) & uint8ss->array);
+ if (F_status_is_error(status)) return status;
+
+ uint8ss->size = length;
+
+ if (uint8ss->used > uint8ss->size) {
+ uint8ss->used = length;
+ }
+
+ return F_none;
+ }
+#endif // !defined(_di_f_uint8ss_decrease_by_) || !defined(_di_f_uint8ss_increase_) || !defined(_di_f_uint8ss_increase_by_) || !defined(_di_f_uint8ss_resize_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * 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_type_array_uint8_h
+#define _PRIVATE_F_type_array_uint8_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Private implementation for resizing the uint8s array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to adjust to.
+ * @param uint8s
+ * The uint8s array to adjust.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ *
+ * @see f_uint8s_adjust()
+ * @see f_uint8s_decimate_by()
+ */
+#if !defined(_di_f_uint8s_adjust_) || !defined(_di_f_uint8s_decimate_by_)
+ extern f_status_t private_f_uint8s_adjust(const f_array_length_t length, f_uint8s_t *uint8s) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint8s_adjust_) || !defined(_di_f_uint8s_decimate_by_)
+
+/**
+ * Private implementation for appending the uint8 array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source uint8 to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_uint8s_append()
+ * @see f_uint8ss_append()
+ */
+#if !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8ss_append_)
+ extern f_status_t private_f_uint8s_append(const uint8_t source, f_uint8s_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8ss_append_)
+
+/**
+ * Private implementation for appending the uint8 array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param source
+ * The source uint8s to append.
+ * @param destination
+ * The destination lengths the source is appended onto.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_memory_resize()
+ * @see f_uint8s_append_all()
+ * @see f_uint8ss_append()
+ * @see f_uint8ss_append_all()
+ */
+#if !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8s_append_all_) || !defined(_di_f_uint8ss_append_all_)
+ extern f_status_t private_f_uint8s_append_all(const f_uint8s_t source, f_uint8s_t *destination) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8s_append_all_) || !defined(_di_f_uint8ss_append_all_)
+
+/**
+ * Private implementation for resizing the uint8s array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to adjust to.
+ * @param uint8s
+ * The uint8s array to adjust.
+ *
+ * @return
+ * F_none on success.
+ * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_uint8s_resize()
+ * @see f_uint8s_append()
+ * @see f_uint8s_decimate_by()
+ * @see f_uint8ss_append()
+ */
+#if !defined(_di_f_uint8s_resize_) || !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8s_decimate_by_) || !defined(_di_f_uint8ss_append_)
+ extern f_status_t private_f_uint8s_resize(const f_array_length_t length, f_uint8s_t *uint8s) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint8s_resize_) || !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8s_decimate_by_) || !defined(_di_f_uint8ss_append_)
+
+/**
+ * Private implementation for resizing the uint8ss array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to adjust to.
+ * @param uint8ss
+ * The uint8ss array to adjust.
+ *
+ * @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 new length is larger than max array length.
+ * F_memory_not (with error bit) on out of memory.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_destroy().
+ *
+ * @see f_uint8ss_adjust()
+ * @see f_uint8ss_decimate_by()
+ */
+#if !defined(_di_f_uint8ss_adjust_) || !defined(_di_f_uint8ss_decimate_by_)
+ extern f_status_t private_f_uint8ss_adjust(const f_array_length_t length, f_uint8ss_t *uint8ss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint8ss_adjust_) || !defined(_di_f_uint8ss_decimate_by_)
+
+/**
+ * Private implementation for resizing the uint8ss array.
+ *
+ * Intended to be shared to each of the different implementation variations.
+ *
+ * @param length
+ * The length to resize to.
+ * @param uint8ss
+ * The uint8ss 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 new length is larger than max array length.
+ * F_memory_not (with error bit) on out of memory.
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_delete().
+ * Errors (with error bit) from: f_memory_resize().
+ *
+ * @see f_uint8ss_decrease_by()
+ * @see f_uint8ss_increase()
+ * @see f_uint8ss_increase_by()
+ * @see f_uint8ss_resize()
+ */
+#if !defined(_di_f_uint8ss_decrease_by_) || !defined(_di_f_uint8ss_increase_) || !defined(_di_f_uint8ss_increase_by_) || !defined(_di_f_uint8ss_resize_)
+ extern f_status_t private_f_uint8ss_resize(const f_array_length_t length, f_uint8ss_t *uint8ss) F_attribute_visibility_internal_d;
+#endif // !defined(_di_f_uint8ss_decrease_by_) || !defined(_di_f_uint8ss_increase_) || !defined(_di_f_uint8ss_increase_by_) || !defined(_di_f_uint8ss_resize_)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_F_type_array_uint8_h
#endif // _di_f_states_adjust_
#ifndef _di_f_states_append_
- f_status_t f_states_append(const f_states_t source, f_states_t *destination) {
+ f_status_t f_states_append(const f_state_t source, f_states_t *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_states_append(source, destination);
}
#endif // _di_f_states_append_
+#ifndef _di_f_states_append_all_
+ f_status_t f_states_append_all(const f_states_t source, f_states_t *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_states_append_all(source, destination);
+ }
+#endif // _di_f_states_append_all_
+
#ifndef _di_f_states_decimate_by_
f_status_t f_states_decimate_by(const f_array_length_t amount, f_states_t *states) {
#ifndef _di_level_0_parameter_checking_
#endif // _di_f_statess_adjust_
#ifndef _di_f_statess_append_
- f_status_t f_statess_append(const f_statess_t source, f_statess_t *destination) {
+ f_status_t f_statess_append(const f_states_t source, f_statess_t *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_statess_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ status = private_f_states_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_statess_append_
+
+#ifndef _di_f_statess_append_all_
+ f_status_t f_statess_append_all(const f_statess_t source, f_statess_t *destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
}
for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
- status = private_f_states_append(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
+
+ destination->array[destination->used].used = 0;
+
+ if (source.array[i].used) {
+ status = private_f_states_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
} // for
return F_none;
}
-#endif // _di_f_statess_append_
+#endif // _di_f_statess_append_all_
#ifndef _di_f_statess_decimate_by_
f_status_t f_statess_decimate_by(const f_array_length_t amount, f_statess_t *statess) {
#endif // _di_f_states_adjust_
/**
- * Append the source states onto the destination.
+ * Append the single source state onto the destination.
*
* @param source
- * The source states to append.
+ * The source state to append.
* @param destination
* The destination states the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_states_append_
- extern f_status_t f_states_append(const f_states_t source, f_states_t *destination);
+ extern f_status_t f_states_append(const f_state_t source, f_states_t *destination);
#endif // _di_f_states_append_
/**
+ * Append the source states onto the destination.
+ *
+ * @param source
+ * The source states to append.
+ * @param destination
+ * The destination states 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_states_append_all_
+ extern f_status_t f_states_append_all(const f_states_t source, f_states_t *destination);
+#endif // _di_f_states_append_all_
+
+/**
* Resize the string states array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
#endif // _di_f_statess_adjust_
/**
- * Append the source statess onto the destination.
+ * Append the single source states onto the destination.
*
* @param source
- * The source statess to append.
+ * The source states to append.
* @param destination
* The destination ranges the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_statess_append_
- extern f_status_t f_statess_append(const f_statess_t source, f_statess_t *destination);
+ extern f_status_t f_statess_append(const f_states_t source, f_statess_t *destination);
#endif // _di_f_statess_append_
/**
- * Resize the string statess array.
+ * Append the source statess onto the destination.
*
- * @param length
- * The new size to use.
- * @param statess
- * The string statess array to resize.
+ * @param source
+ * The source statess to append.
+ * @param destination
+ * The destination ranges 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.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_statess_adjust_
- extern f_status_t f_statess_adjust(const f_array_length_t length, f_statess_t *statess);
-#endif // _di_f_statess_adjust_
+#ifndef _di_f_statess_append_all_
+ extern f_status_t f_statess_append_all(const f_statess_t source, f_statess_t *destination);
+#endif // _di_f_statess_append_all_
/**
* Resize the string statess array to a smaller size.
#endif // _di_f_statuss_adjust_
#ifndef _di_f_statuss_append_
- f_status_t f_statuss_append(const f_statuss_t source, f_statuss_t *destination) {
+ f_status_t f_statuss_append(const f_status_t source, f_statuss_t *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_statuss_append(source, destination);
}
#endif // _di_f_statuss_append_
+#ifndef _di_f_statuss_append_all_
+ f_status_t f_statuss_append_all(const f_statuss_t source, f_statuss_t *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_statuss_append_all(source, destination);
+ }
+#endif // _di_f_statuss_append_all_
+
#ifndef _di_f_statuss_decimate_by_
f_status_t f_statuss_decimate_by(const f_array_length_t amount, f_statuss_t *statuss) {
#ifndef _di_level_0_parameter_checking_
#endif // _di_f_statusss_adjust_
#ifndef _di_f_statusss_append_
- f_status_t f_statusss_append(const f_statusss_t source, f_statusss_t *destination) {
+ f_status_t f_statusss_append(const f_statuss_t source, f_statusss_t *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_statusss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ status = private_f_statuss_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_statusss_append_
+
+#ifndef _di_f_statusss_append_all_
+ f_status_t f_statusss_append_all(const f_statusss_t source, f_statusss_t *destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
}
for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) {
- status = private_f_statuss_append(source.array[i], &destination->array[destination->used]);
- if (F_status_is_error(status)) return status;
+
+ destination->array[destination->used].used = 0;
+
+ if (source.array[i].used) {
+ status = private_f_statuss_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
} // for
return F_none;
}
-#endif // _di_f_statusss_append_
+#endif // _di_f_statusss_append_all_
#ifndef _di_f_statusss_decimate_by_
f_status_t f_statusss_decimate_by(const f_array_length_t amount, f_statusss_t *statusss) {
#endif // _di_f_statuss_adjust_
/**
- * Append the source statuss onto the destination.
+ * Append the single source status onto the destination.
*
* @param source
- * The source statuss to append.
+ * The source status to append.
* @param destination
* The destination statuss the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_statuss_append_
- extern f_status_t f_statuss_append(const f_statuss_t source, f_statuss_t *destination);
+ extern f_status_t f_statuss_append(const f_status_t source, f_statuss_t *destination);
#endif // _di_f_statuss_append_
/**
+ * Append the source statuss onto the destination.
+ *
+ * @param source
+ * The source statuss to append.
+ * @param destination
+ * The destination statuss 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_statuss_append_all_
+ extern f_status_t f_statuss_append_all(const f_statuss_t source, f_statuss_t *destination);
+#endif // _di_f_statuss_append_all_
+
+/**
* Resize the string statuss array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
#endif // _di_f_statusss_adjust_
/**
- * Append the source statusss onto the destination.
+ * Append the single source statuss onto the destination.
*
* @param source
- * The source statusss to append.
+ * The source statuss to append.
* @param destination
* The destination ranges the source is appended onto.
*
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_statusss_append_
- extern f_status_t f_statusss_append(const f_statusss_t source, f_statusss_t *destination);
+ extern f_status_t f_statusss_append(const f_statuss_t source, f_statusss_t *destination);
#endif // _di_f_statusss_append_
/**
- * Resize the string statusss array.
+ * Append the source statusss onto the destination.
*
- * @param length
- * The new size to use.
- * @param statusss
- * The string statusss array to resize.
+ * @param source
+ * The source statusss to append.
+ * @param destination
+ * The destination ranges 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.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_resize().
*/
-#ifndef _di_f_statusss_adjust_
- extern f_status_t f_statusss_adjust(const f_array_length_t length, f_statusss_t *statusss);
-#endif // _di_f_statusss_adjust_
+#ifndef _di_f_statusss_append_all_
+ extern f_status_t f_statusss_append_all(const f_statusss_t source, f_statusss_t *destination);
+#endif // _di_f_statusss_append_all_
/**
* Resize the string statusss array to a smaller size.
--- /dev/null
+#include "../type_array.h"
+#include "uint128.h"
+#include "private-uint128.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_f_uint128s_adjust_
+ f_status_t f_uint128s_adjust(const f_array_length_t length, f_uint128s_t *uint128s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint128s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint128s_adjust(length, uint128s);
+ }
+#endif // _di_f_uint128s_adjust_
+
+#ifndef _di_f_uint128s_append_
+ f_status_t f_uint128s_append(const uint128_t source, f_uint128s_t *destination) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!destination) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint128s_append(source, destination);
+ }
+#endif // _di_f_uint128s_append_
+
+#ifndef _di_f_uint128s_append_all_
+ f_status_t f_uint128s_append_all(const f_uint128s_t source, f_uint128s_t *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_uint128s_append_all(source, destination);
+ }
+#endif // _di_f_uint128s_append_all_
+
+#ifndef _di_f_uint128s_decimate_by_
+ f_status_t f_uint128s_decimate_by(const f_array_length_t amount, f_uint128s_t *uint128s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint128s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint128s->size - amount > 0) {
+ return private_f_uint128s_adjust(uint128s->size - amount, uint128s);
+ }
+
+ return private_f_uint128s_adjust(0, uint128s);
+ }
+#endif // _di_f_uint128s_decimate_by_
+
+#ifndef _di_f_uint128s_decrease_by_
+ f_status_t f_uint128s_decrease_by(const f_array_length_t amount, f_uint128s_t *uint128s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint128s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint128s->size - amount > 0) {
+ return private_f_uint128s_resize(uint128s->size - amount, uint128s);
+ }
+
+ return private_f_uint128s_resize(0, uint128s);
+ }
+#endif // _di_f_uint128s_decrease_by_
+
+#ifndef _di_f_uint128s_increase_
+ f_status_t f_uint128s_increase(const f_array_length_t step, f_uint128s_t *uint128s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint128s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (step && uint128s->used + 1 > uint128s->size) {
+ f_array_length_t size = uint128s->used + step;
+
+ if (size > F_array_length_t_size_d) {
+ if (uint128s->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_uint128s_resize(size, uint128s);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint128s_increase_
+
+#ifndef _di_f_uint128s_increase_by_
+ f_status_t f_uint128s_increase_by(const f_array_length_t amount, f_uint128s_t *uint128s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint128s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint128s->used + amount > uint128s->size) {
+ if (uint128s->used + amount > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ return private_f_uint128s_resize(uint128s->used + amount, uint128s);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint128s_increase_by_
+
+#ifndef _di_f_uint128s_resize_
+ f_status_t f_uint128s_resize(const f_array_length_t length, f_uint128s_t *uint128s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint128s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint128s_resize(length, uint128s);
+ }
+#endif // _di_f_uint128s_resize_
+
+#ifndef _di_f_uint128ss_adjust_
+ f_status_t f_uint128ss_adjust(const f_array_length_t length, f_uint128ss_t *uint128ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint128ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint128ss_adjust(length, uint128ss);
+ }
+#endif // _di_f_uint128ss_adjust_
+
+#ifndef _di_f_uint128ss_append_
+ f_status_t f_uint128ss_append(const f_uint128s_t source, f_uint128ss_t *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_uint128ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ status = private_f_uint128s_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_uint128ss_append_
+
+#ifndef _di_f_uint128ss_append_all_
+ f_status_t f_uint128ss_append_all(const f_uint128ss_t source, f_uint128ss_t *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_uint128ss_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_uint128s_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+
+ return F_none;
+ }
+#endif // _di_f_uint128ss_append_all_
+
+#ifndef _di_f_uint128ss_decimate_by_
+ f_status_t f_uint128ss_decimate_by(const f_array_length_t amount, f_uint128ss_t *uint128ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint128ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint128ss->size - amount > 0) {
+ return private_f_uint128ss_adjust(uint128ss->size - amount, uint128ss);
+ }
+
+ return private_f_uint128ss_adjust(0, uint128ss);
+ }
+#endif // _di_f_uint128ss_decimate_by_
+
+#ifndef _di_f_uint128ss_decrease_by_
+ f_status_t f_uint128ss_decrease_by(const f_array_length_t amount, f_uint128ss_t *uint128ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint128ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint128ss->size - amount > 0) {
+ return private_f_uint128ss_resize(uint128ss->size - amount, uint128ss);
+ }
+
+ return private_f_uint128ss_resize(0, uint128ss);
+ }
+#endif // _di_f_uint128ss_decrease_by_
+
+#ifndef _di_f_uint128ss_increase_
+ f_status_t f_uint128ss_increase(const f_array_length_t step, f_uint128ss_t *uint128ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint128ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (step && uint128ss->used + 1 > uint128ss->size) {
+ f_array_length_t size = uint128ss->used + step;
+
+ if (size > F_array_length_t_size_d) {
+ if (uint128ss->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_uint128ss_resize(size, uint128ss);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint128ss_increase_
+
+#ifndef _di_f_uint128ss_increase_by_
+ f_status_t f_uint128ss_increase_by(const f_array_length_t amount, f_uint128ss_t *uint128ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint128ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint128ss->used + amount > uint128ss->size) {
+ if (uint128ss->used + amount > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ return private_f_uint128ss_resize(uint128ss->used + amount, uint128ss);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint128ss_increase_by_
+
+#ifndef _di_f_uint128ss_resize_
+ f_status_t f_uint128ss_resize(const f_array_length_t length, f_uint128ss_t *uint128ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint128ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint128ss_resize(length, uint128ss);
+ }
+#endif // _di_f_uint128ss_resize_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Defines data to be used for/by type (array) related functionality.
+ *
+ * This is auto-included by type_array.h and should not need to be explicitly included.
+ */
+#ifndef _F_type_array_uint128_h
+#define _F_type_array_uint128_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Resize the string uint128s array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint128s
+ * The string uint128s 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_uint128s_adjust_
+ extern f_status_t f_uint128s_adjust(const f_array_length_t length, f_uint128s_t *uint128s);
+#endif // _di_f_uint128s_adjust_
+
+/**
+ * Append the single source uint128 onto the destination.
+ *
+ * @param source
+ * The source uint128 to append.
+ * @param destination
+ * The destination uint128s 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint128s_append_
+ extern f_status_t f_uint128s_append(const uint128_t source, f_uint128s_t *destination);
+#endif // _di_f_uint128s_append_
+
+/**
+ * Append the source uint128s onto the destination.
+ *
+ * @param source
+ * The source uint128s to append.
+ * @param destination
+ * The destination uint128s 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint128s_append_all_
+ extern f_status_t f_uint128s_append_all(const f_uint128s_t source, f_uint128s_t *destination);
+#endif // _di_f_uint128s_append_all_
+
+/**
+ * Resize the string uint128s 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 les than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decimate the size by.
+ * @param uint128s
+ * The string uint128s 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_adjust().
+ */
+#ifndef _di_f_uint128s_decimate_by_
+ extern f_status_t f_uint128s_decimate_by(const f_array_length_t amount, f_uint128s_t *uint128s);
+#endif // _di_f_uint128s_decimate_by_
+
+/**
+ * Resize the string uint128s 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 les than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decrease the size by.
+ * @param uint128s
+ * The string uint128s 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_uint128s_decrease_by_
+ extern f_status_t f_uint128s_decrease_by(const f_array_length_t amount, f_uint128s_t *uint128s);
+#endif // _di_f_uint128s_decrease_by_
+
+/**
+ * Increase the size of the string uint128s array, but only if necesary.
+ *
+ * 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 uint128s
+ * The string uint128s 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_uint128s_increase_
+ extern f_status_t f_uint128s_increase(const f_array_length_t step, f_uint128s_t *uint128s);
+#endif // _di_f_uint128s_increase_
+
+/**
+ * Resize the string uint128s 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 uint128s
+ * The string uint128s 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_uint128s_increase_by_
+ extern f_status_t f_uint128s_increase_by(const f_array_length_t amount, f_uint128s_t *uint128s);
+#endif // _di_f_uint128s_increase_by_
+
+/**
+ * Resize the string uint128s array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint128s
+ * The string uint128s 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_uint128s_resize_
+ extern f_status_t f_uint128s_resize(const f_array_length_t length, f_uint128s_t *uint128s);
+#endif // _di_f_uint128s_resize_
+
+/**
+ * Resize the string uint128ss array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint128ss
+ * The string uint128ss 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().
+ * Errors (with error bit) from: f_memory_destroy().
+ */
+#ifndef _di_f_uint128ss_adjust_
+ extern f_status_t f_uint128ss_adjust(const f_array_length_t length, f_uint128ss_t *uint128ss);
+#endif // _di_f_uint128ss_adjust_
+
+/**
+ * Append the single source uint128s onto the destination.
+ *
+ * @param source
+ * The source uint128s to append.
+ * @param destination
+ * The destination ranges 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint128ss_append_
+ extern f_status_t f_uint128ss_append(const f_uint128s_t source, f_uint128ss_t *destination);
+#endif // _di_f_uint128ss_append_
+
+/**
+ * Append the source uint128ss onto the destination.
+ *
+ * @param source
+ * The source uint128ss to append.
+ * @param destination
+ * The destination ranges 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint128ss_append_all_
+ extern f_status_t f_uint128ss_append_all(const f_uint128ss_t source, f_uint128ss_t *destination);
+#endif // _di_f_uint128ss_append_all_
+
+/**
+ * Resize the string uint128ss 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 uint128ss
+ * The string uint128ss 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().
+ * Errors (with error bit) from: f_memory_destroy().
+ */
+#ifndef _di_f_uint128ss_decimate_by_
+ extern f_status_t f_uint128ss_decimate_by(const f_array_length_t amount, f_uint128ss_t *uint128ss);
+#endif // _di_f_uint128ss_decimate_by_
+
+/**
+ * Resize the string uint128ss 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 uint128ss
+ * The string uint128ss 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_delete().
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint128ss_decrease_by_
+ extern f_status_t f_uint128ss_decrease_by(const f_array_length_t amount, f_uint128ss_t *uint128ss);
+#endif // _di_f_uint128ss_decrease_by_
+
+/**
+ * Increase the size of the string uint128ss 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 uint128ss
+ * The string uint128ss 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_uint128ss_increase_
+ extern f_status_t f_uint128ss_increase(const f_array_length_t step, f_uint128ss_t *uint128ss);
+#endif // _di_f_uint128ss_increase_
+
+/**
+ * Resize the string uint128ss 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 uint128ss
+ * The string uint128ss 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_uint128ss_increase_by_
+ extern f_status_t f_uint128ss_increase_by(const f_array_length_t amount, f_uint128ss_t *uint128ss);
+#endif // _di_f_uint128ss_increase_by_
+
+/**
+ * Resize the string uint128ss array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint128ss
+ * The string uint128ss 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_delete().
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint128ss_resize_
+ extern f_status_t f_uint128ss_resize(const f_array_length_t length, f_uint128ss_t *uint128ss);
+#endif // _di_f_uint128ss_resize_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _F_type_array_uint128_h
--- /dev/null
+#include "../type_array.h"
+#include "uint16.h"
+#include "private-uint16.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_f_uint16s_adjust_
+ f_status_t f_uint16s_adjust(const f_array_length_t length, f_uint16s_t *uint16s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint16s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint16s_adjust(length, uint16s);
+ }
+#endif // _di_f_uint16s_adjust_
+
+#ifndef _di_f_uint16s_append_
+ f_status_t f_uint16s_append(const uint16_t source, f_uint16s_t *destination) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!destination) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint16s_append(source, destination);
+ }
+#endif // _di_f_uint16s_append_
+
+#ifndef _di_f_uint16s_append_all_
+ f_status_t f_uint16s_append_all(const f_uint16s_t source, f_uint16s_t *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_uint16s_append_all(source, destination);
+ }
+#endif // _di_f_uint16s_append_all_
+
+#ifndef _di_f_uint16s_decimate_by_
+ f_status_t f_uint16s_decimate_by(const f_array_length_t amount, f_uint16s_t *uint16s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint16s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint16s->size - amount > 0) {
+ return private_f_uint16s_adjust(uint16s->size - amount, uint16s);
+ }
+
+ return private_f_uint16s_adjust(0, uint16s);
+ }
+#endif // _di_f_uint16s_decimate_by_
+
+#ifndef _di_f_uint16s_decrease_by_
+ f_status_t f_uint16s_decrease_by(const f_array_length_t amount, f_uint16s_t *uint16s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint16s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint16s->size - amount > 0) {
+ return private_f_uint16s_resize(uint16s->size - amount, uint16s);
+ }
+
+ return private_f_uint16s_resize(0, uint16s);
+ }
+#endif // _di_f_uint16s_decrease_by_
+
+#ifndef _di_f_uint16s_increase_
+ f_status_t f_uint16s_increase(const f_array_length_t step, f_uint16s_t *uint16s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint16s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (step && uint16s->used + 1 > uint16s->size) {
+ f_array_length_t size = uint16s->used + step;
+
+ if (size > F_array_length_t_size_d) {
+ if (uint16s->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_uint16s_resize(size, uint16s);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint16s_increase_
+
+#ifndef _di_f_uint16s_increase_by_
+ f_status_t f_uint16s_increase_by(const f_array_length_t amount, f_uint16s_t *uint16s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint16s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint16s->used + amount > uint16s->size) {
+ if (uint16s->used + amount > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ return private_f_uint16s_resize(uint16s->used + amount, uint16s);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint16s_increase_by_
+
+#ifndef _di_f_uint16s_resize_
+ f_status_t f_uint16s_resize(const f_array_length_t length, f_uint16s_t *uint16s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint16s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint16s_resize(length, uint16s);
+ }
+#endif // _di_f_uint16s_resize_
+
+#ifndef _di_f_uint16ss_adjust_
+ f_status_t f_uint16ss_adjust(const f_array_length_t length, f_uint16ss_t *uint16ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint16ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint16ss_adjust(length, uint16ss);
+ }
+#endif // _di_f_uint16ss_adjust_
+
+#ifndef _di_f_uint16ss_append_
+ f_status_t f_uint16ss_append(const f_uint16s_t source, f_uint16ss_t *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_uint16ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ status = private_f_uint16s_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_uint16ss_append_
+
+#ifndef _di_f_uint16ss_append_all_
+ f_status_t f_uint16ss_append_all(const f_uint16ss_t source, f_uint16ss_t *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_uint16ss_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_uint16s_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+
+ return F_none;
+ }
+#endif // _di_f_uint16ss_append_all_
+
+#ifndef _di_f_uint16ss_decimate_by_
+ f_status_t f_uint16ss_decimate_by(const f_array_length_t amount, f_uint16ss_t *uint16ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint16ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint16ss->size - amount > 0) {
+ return private_f_uint16ss_adjust(uint16ss->size - amount, uint16ss);
+ }
+
+ return private_f_uint16ss_adjust(0, uint16ss);
+ }
+#endif // _di_f_uint16ss_decimate_by_
+
+#ifndef _di_f_uint16ss_decrease_by_
+ f_status_t f_uint16ss_decrease_by(const f_array_length_t amount, f_uint16ss_t *uint16ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint16ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint16ss->size - amount > 0) {
+ return private_f_uint16ss_resize(uint16ss->size - amount, uint16ss);
+ }
+
+ return private_f_uint16ss_resize(0, uint16ss);
+ }
+#endif // _di_f_uint16ss_decrease_by_
+
+#ifndef _di_f_uint16ss_increase_
+ f_status_t f_uint16ss_increase(const f_array_length_t step, f_uint16ss_t *uint16ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint16ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (step && uint16ss->used + 1 > uint16ss->size) {
+ f_array_length_t size = uint16ss->used + step;
+
+ if (size > F_array_length_t_size_d) {
+ if (uint16ss->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_uint16ss_resize(size, uint16ss);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint16ss_increase_
+
+#ifndef _di_f_uint16ss_increase_by_
+ f_status_t f_uint16ss_increase_by(const f_array_length_t amount, f_uint16ss_t *uint16ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint16ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint16ss->used + amount > uint16ss->size) {
+ if (uint16ss->used + amount > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ return private_f_uint16ss_resize(uint16ss->used + amount, uint16ss);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint16ss_increase_by_
+
+#ifndef _di_f_uint16ss_resize_
+ f_status_t f_uint16ss_resize(const f_array_length_t length, f_uint16ss_t *uint16ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint16ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint16ss_resize(length, uint16ss);
+ }
+#endif // _di_f_uint16ss_resize_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Defines data to be used for/by type (array) related functionality.
+ *
+ * This is auto-included by type_array.h and should not need to be explicitly included.
+ */
+#ifndef _F_type_array_uint16_h
+#define _F_type_array_uint16_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Resize the string uint16s array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint16s
+ * The string uint16s 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_uint16s_adjust_
+ extern f_status_t f_uint16s_adjust(const f_array_length_t length, f_uint16s_t *uint16s);
+#endif // _di_f_uint16s_adjust_
+
+/**
+ * Append the single source uint16 onto the destination.
+ *
+ * @param source
+ * The source uint16 to append.
+ * @param destination
+ * The destination uint16s 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint16s_append_
+ extern f_status_t f_uint16s_append(const uint16_t source, f_uint16s_t *destination);
+#endif // _di_f_uint16s_append_
+
+/**
+ * Append the source uint16s onto the destination.
+ *
+ * @param source
+ * The source uint16s to append.
+ * @param destination
+ * The destination uint16s 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint16s_append_all_
+ extern f_status_t f_uint16s_append_all(const f_uint16s_t source, f_uint16s_t *destination);
+#endif // _di_f_uint16s_append_all_
+
+/**
+ * Resize the string uint16s 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 les than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decimate the size by.
+ * @param uint16s
+ * The string uint16s 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_adjust().
+ */
+#ifndef _di_f_uint16s_decimate_by_
+ extern f_status_t f_uint16s_decimate_by(const f_array_length_t amount, f_uint16s_t *uint16s);
+#endif // _di_f_uint16s_decimate_by_
+
+/**
+ * Resize the string uint16s 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 les than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decrease the size by.
+ * @param uint16s
+ * The string uint16s 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_uint16s_decrease_by_
+ extern f_status_t f_uint16s_decrease_by(const f_array_length_t amount, f_uint16s_t *uint16s);
+#endif // _di_f_uint16s_decrease_by_
+
+/**
+ * Increase the size of the string uint16s array, but only if necesary.
+ *
+ * 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 uint16s
+ * The string uint16s 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_uint16s_increase_
+ extern f_status_t f_uint16s_increase(const f_array_length_t step, f_uint16s_t *uint16s);
+#endif // _di_f_uint16s_increase_
+
+/**
+ * Resize the string uint16s 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 uint16s
+ * The string uint16s 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_uint16s_increase_by_
+ extern f_status_t f_uint16s_increase_by(const f_array_length_t amount, f_uint16s_t *uint16s);
+#endif // _di_f_uint16s_increase_by_
+
+/**
+ * Resize the string uint16s array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint16s
+ * The string uint16s 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_uint16s_resize_
+ extern f_status_t f_uint16s_resize(const f_array_length_t length, f_uint16s_t *uint16s);
+#endif // _di_f_uint16s_resize_
+
+/**
+ * Resize the string uint16ss array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint16ss
+ * The string uint16ss 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().
+ * Errors (with error bit) from: f_memory_destroy().
+ */
+#ifndef _di_f_uint16ss_adjust_
+ extern f_status_t f_uint16ss_adjust(const f_array_length_t length, f_uint16ss_t *uint16ss);
+#endif // _di_f_uint16ss_adjust_
+
+/**
+ * Append the single source uint16s onto the destination.
+ *
+ * @param source
+ * The source uint16s to append.
+ * @param destination
+ * The destination ranges 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint16ss_append_
+ extern f_status_t f_uint16ss_append(const f_uint16s_t source, f_uint16ss_t *destination);
+#endif // _di_f_uint16ss_append_
+
+/**
+ * Append the source uint16ss onto the destination.
+ *
+ * @param source
+ * The source uint16ss to append.
+ * @param destination
+ * The destination ranges 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint16ss_append_all_
+ extern f_status_t f_uint16ss_append_all(const f_uint16ss_t source, f_uint16ss_t *destination);
+#endif // _di_f_uint16ss_append_all_
+
+/**
+ * Resize the string uint16ss 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 uint16ss
+ * The string uint16ss 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_adjust().
+ * Errors (with error bit) from: f_memory_destroy().
+ */
+#ifndef _di_f_uint16ss_decimate_by_
+ extern f_status_t f_uint16ss_decimate_by(const f_array_length_t amount, f_uint16ss_t *uint16ss);
+#endif // _di_f_uint16ss_decimate_by_
+
+/**
+ * Resize the string uint16ss 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 uint16ss
+ * The string uint16ss 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_delete().
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint16ss_decrease_by_
+ extern f_status_t f_uint16ss_decrease_by(const f_array_length_t amount, f_uint16ss_t *uint16ss);
+#endif // _di_f_uint16ss_decrease_by_
+
+/**
+ * Increase the size of the string uint16ss 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 uint16ss
+ * The string uint16ss 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_uint16ss_increase_
+ extern f_status_t f_uint16ss_increase(const f_array_length_t step, f_uint16ss_t *uint16ss);
+#endif // _di_f_uint16ss_increase_
+
+/**
+ * Resize the string uint16ss 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 uint16ss
+ * The string uint16ss 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_uint16ss_increase_by_
+ extern f_status_t f_uint16ss_increase_by(const f_array_length_t amount, f_uint16ss_t *uint16ss);
+#endif // _di_f_uint16ss_increase_by_
+
+/**
+ * Resize the string uint16ss array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint16ss
+ * The string uint16ss 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_delete().
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint16ss_resize_
+ extern f_status_t f_uint16ss_resize(const f_array_length_t length, f_uint16ss_t *uint16ss);
+#endif // _di_f_uint16ss_resize_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _F_type_array_uint16_h
--- /dev/null
+#include "../type_array.h"
+#include "uint32.h"
+#include "private-uint32.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_f_uint32s_adjust_
+ f_status_t f_uint32s_adjust(const f_array_length_t length, f_uint32s_t *uint32s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint32s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint32s_adjust(length, uint32s);
+ }
+#endif // _di_f_uint32s_adjust_
+
+#ifndef _di_f_uint32s_append_
+ f_status_t f_uint32s_append(const uint32_t source, f_uint32s_t *destination) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!destination) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint32s_append(source, destination);
+ }
+#endif // _di_f_uint32s_append_
+
+#ifndef _di_f_uint32s_append_all_
+ f_status_t f_uint32s_append_all(const f_uint32s_t source, f_uint32s_t *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_uint32s_append_all(source, destination);
+ }
+#endif // _di_f_uint32s_append_all_
+
+#ifndef _di_f_uint32s_decimate_by_
+ f_status_t f_uint32s_decimate_by(const f_array_length_t amount, f_uint32s_t *uint32s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint32s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint32s->size - amount > 0) {
+ return private_f_uint32s_adjust(uint32s->size - amount, uint32s);
+ }
+
+ return private_f_uint32s_adjust(0, uint32s);
+ }
+#endif // _di_f_uint32s_decimate_by_
+
+#ifndef _di_f_uint32s_decrease_by_
+ f_status_t f_uint32s_decrease_by(const f_array_length_t amount, f_uint32s_t *uint32s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint32s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint32s->size - amount > 0) {
+ return private_f_uint32s_resize(uint32s->size - amount, uint32s);
+ }
+
+ return private_f_uint32s_resize(0, uint32s);
+ }
+#endif // _di_f_uint32s_decrease_by_
+
+#ifndef _di_f_uint32s_increase_
+ f_status_t f_uint32s_increase(const f_array_length_t step, f_uint32s_t *uint32s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint32s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (step && uint32s->used + 1 > uint32s->size) {
+ f_array_length_t size = uint32s->used + step;
+
+ if (size > F_array_length_t_size_d) {
+ if (uint32s->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_uint32s_resize(size, uint32s);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint32s_increase_
+
+#ifndef _di_f_uint32s_increase_by_
+ f_status_t f_uint32s_increase_by(const f_array_length_t amount, f_uint32s_t *uint32s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint32s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint32s->used + amount > uint32s->size) {
+ if (uint32s->used + amount > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ return private_f_uint32s_resize(uint32s->used + amount, uint32s);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint32s_increase_by_
+
+#ifndef _di_f_uint32s_resize_
+ f_status_t f_uint32s_resize(const f_array_length_t length, f_uint32s_t *uint32s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint32s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint32s_resize(length, uint32s);
+ }
+#endif // _di_f_uint32s_resize_
+
+#ifndef _di_f_uint32ss_adjust_
+ f_status_t f_uint32ss_adjust(const f_array_length_t length, f_uint32ss_t *uint32ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint32ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint32ss_adjust(length, uint32ss);
+ }
+#endif // _di_f_uint32ss_adjust_
+
+#ifndef _di_f_uint32ss_append_
+ f_status_t f_uint32ss_append(const f_uint32s_t source, f_uint32ss_t *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_uint32ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ status = private_f_uint32s_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_uint32ss_append_
+
+#ifndef _di_f_uint32ss_append_all_
+ f_status_t f_uint32ss_append_all(const f_uint32ss_t source, f_uint32ss_t *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_uint32ss_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_uint32s_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+
+ return F_none;
+ }
+#endif // _di_f_uint32ss_append_all_
+
+#ifndef _di_f_uint32ss_decimate_by_
+ f_status_t f_uint32ss_decimate_by(const f_array_length_t amount, f_uint32ss_t *uint32ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint32ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint32ss->size - amount > 0) {
+ return private_f_uint32ss_adjust(uint32ss->size - amount, uint32ss);
+ }
+
+ return private_f_uint32ss_adjust(0, uint32ss);
+ }
+#endif // _di_f_uint32ss_decimate_by_
+
+#ifndef _di_f_uint32ss_decrease_by_
+ f_status_t f_uint32ss_decrease_by(const f_array_length_t amount, f_uint32ss_t *uint32ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint32ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint32ss->size - amount > 0) {
+ return private_f_uint32ss_resize(uint32ss->size - amount, uint32ss);
+ }
+
+ return private_f_uint32ss_resize(0, uint32ss);
+ }
+#endif // _di_f_uint32ss_decrease_by_
+
+#ifndef _di_f_uint32ss_increase_
+ f_status_t f_uint32ss_increase(const f_array_length_t step, f_uint32ss_t *uint32ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint32ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (step && uint32ss->used + 1 > uint32ss->size) {
+ f_array_length_t size = uint32ss->used + step;
+
+ if (size > F_array_length_t_size_d) {
+ if (uint32ss->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_uint32ss_resize(size, uint32ss);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint32ss_increase_
+
+#ifndef _di_f_uint32ss_increase_by_
+ f_status_t f_uint32ss_increase_by(const f_array_length_t amount, f_uint32ss_t *uint32ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint32ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint32ss->used + amount > uint32ss->size) {
+ if (uint32ss->used + amount > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ return private_f_uint32ss_resize(uint32ss->used + amount, uint32ss);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint32ss_increase_by_
+
+#ifndef _di_f_uint32ss_resize_
+ f_status_t f_uint32ss_resize(const f_array_length_t length, f_uint32ss_t *uint32ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint32ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint32ss_resize(length, uint32ss);
+ }
+#endif // _di_f_uint32ss_resize_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Defines data to be used for/by type (array) related functionality.
+ *
+ * This is auto-included by type_array.h and should not need to be explicitly included.
+ */
+#ifndef _F_type_array_uint32_h
+#define _F_type_array_uint32_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Resize the string uint32s array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint32s
+ * The string uint32s 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_uint32s_adjust_
+ extern f_status_t f_uint32s_adjust(const f_array_length_t length, f_uint32s_t *uint32s);
+#endif // _di_f_uint32s_adjust_
+
+/**
+ * Append the single source uint32 onto the destination.
+ *
+ * @param source
+ * The source uint32 to append.
+ * @param destination
+ * The destination uint32s 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint32s_append_
+ extern f_status_t f_uint32s_append(const uint32_t source, f_uint32s_t *destination);
+#endif // _di_f_uint32s_append_
+
+/**
+ * Append the source uint32s onto the destination.
+ *
+ * @param source
+ * The source uint32s to append.
+ * @param destination
+ * The destination uint32s 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint32s_append_all_
+ extern f_status_t f_uint32s_append_all(const f_uint32s_t source, f_uint32s_t *destination);
+#endif // _di_f_uint32s_append_all_
+
+/**
+ * Resize the string uint32s 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 les than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decimate the size by.
+ * @param uint32s
+ * The string uint32s 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_adjust().
+ */
+#ifndef _di_f_uint32s_decimate_by_
+ extern f_status_t f_uint32s_decimate_by(const f_array_length_t amount, f_uint32s_t *uint32s);
+#endif // _di_f_uint32s_decimate_by_
+
+/**
+ * Resize the string uint32s 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 les than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decrease the size by.
+ * @param uint32s
+ * The string uint32s 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_uint32s_decrease_by_
+ extern f_status_t f_uint32s_decrease_by(const f_array_length_t amount, f_uint32s_t *uint32s);
+#endif // _di_f_uint32s_decrease_by_
+
+/**
+ * Increase the size of the string uint32s array, but only if necesary.
+ *
+ * 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 uint32s
+ * The string uint32s 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_uint32s_increase_
+ extern f_status_t f_uint32s_increase(const f_array_length_t step, f_uint32s_t *uint32s);
+#endif // _di_f_uint32s_increase_
+
+/**
+ * Resize the string uint32s 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 uint32s
+ * The string uint32s 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_uint32s_increase_by_
+ extern f_status_t f_uint32s_increase_by(const f_array_length_t amount, f_uint32s_t *uint32s);
+#endif // _di_f_uint32s_increase_by_
+
+/**
+ * Resize the string uint32s array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint32s
+ * The string uint32s 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_uint32s_resize_
+ extern f_status_t f_uint32s_resize(const f_array_length_t length, f_uint32s_t *uint32s);
+#endif // _di_f_uint32s_resize_
+
+/**
+ * Resize the string uint32ss array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint32ss
+ * The string uint32ss 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().
+ * Errors (with error bit) from: f_memory_destroy().
+ */
+#ifndef _di_f_uint32ss_adjust_
+ extern f_status_t f_uint32ss_adjust(const f_array_length_t length, f_uint32ss_t *uint32ss);
+#endif // _di_f_uint32ss_adjust_
+
+/**
+ * Append the single source uint32s onto the destination.
+ *
+ * @param source
+ * The source uint32s to append.
+ * @param destination
+ * The destination ranges 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint32ss_append_
+ extern f_status_t f_uint32ss_append(const f_uint32s_t source, f_uint32ss_t *destination);
+#endif // _di_f_uint32ss_append_
+
+/**
+ * Append the source uint32ss onto the destination.
+ *
+ * @param source
+ * The source uint32ss to append.
+ * @param destination
+ * The destination ranges 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint32ss_append_all_
+ extern f_status_t f_uint32ss_append_all(const f_uint32ss_t source, f_uint32ss_t *destination);
+#endif // _di_f_uint32ss_append_all_
+
+/**
+ * Resize the string uint32ss 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 uint32ss
+ * The string uint32ss 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_adjust().
+ * Errors (with error bit) from: f_memory_destroy().
+ */
+#ifndef _di_f_uint32ss_decimate_by_
+ extern f_status_t f_uint32ss_decimate_by(const f_array_length_t amount, f_uint32ss_t *uint32ss);
+#endif // _di_f_uint32ss_decimate_by_
+
+/**
+ * Resize the string uint32ss 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 uint32ss
+ * The string uint32ss 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_delete().
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint32ss_decrease_by_
+ extern f_status_t f_uint32ss_decrease_by(const f_array_length_t amount, f_uint32ss_t *uint32ss);
+#endif // _di_f_uint32ss_decrease_by_
+
+/**
+ * Increase the size of the string uint32ss 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 uint32ss
+ * The string uint32ss 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_uint32ss_increase_
+ extern f_status_t f_uint32ss_increase(const f_array_length_t step, f_uint32ss_t *uint32ss);
+#endif // _di_f_uint32ss_increase_
+
+/**
+ * Resize the string uint32ss 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 uint32ss
+ * The string uint32ss 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_uint32ss_increase_by_
+ extern f_status_t f_uint32ss_increase_by(const f_array_length_t amount, f_uint32ss_t *uint32ss);
+#endif // _di_f_uint32ss_increase_by_
+
+/**
+ * Resize the string uint32ss array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint32ss
+ * The string uint32ss 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_delete().
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint32ss_resize_
+ extern f_status_t f_uint32ss_resize(const f_array_length_t length, f_uint32ss_t *uint32ss);
+#endif // _di_f_uint32ss_resize_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _F_type_array_uint32_h
--- /dev/null
+#include "../type_array.h"
+#include "uint64.h"
+#include "private-uint64.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_f_uint64s_adjust_
+ f_status_t f_uint64s_adjust(const f_array_length_t length, f_uint64s_t *uint64s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint64s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint64s_adjust(length, uint64s);
+ }
+#endif // _di_f_uint64s_adjust_
+
+#ifndef _di_f_uint64s_append_
+ f_status_t f_uint64s_append(const uint64_t source, f_uint64s_t *destination) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!destination) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint64s_append(source, destination);
+ }
+#endif // _di_f_uint64s_append_
+
+#ifndef _di_f_uint64s_append_all_
+ f_status_t f_uint64s_append_all(const f_uint64s_t source, f_uint64s_t *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_uint64s_append_all(source, destination);
+ }
+#endif // _di_f_uint64s_append_all_
+
+#ifndef _di_f_uint64s_decimate_by_
+ f_status_t f_uint64s_decimate_by(const f_array_length_t amount, f_uint64s_t *uint64s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint64s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint64s->size - amount > 0) {
+ return private_f_uint64s_adjust(uint64s->size - amount, uint64s);
+ }
+
+ return private_f_uint64s_adjust(0, uint64s);
+ }
+#endif // _di_f_uint64s_decimate_by_
+
+#ifndef _di_f_uint64s_decrease_by_
+ f_status_t f_uint64s_decrease_by(const f_array_length_t amount, f_uint64s_t *uint64s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint64s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint64s->size - amount > 0) {
+ return private_f_uint64s_resize(uint64s->size - amount, uint64s);
+ }
+
+ return private_f_uint64s_resize(0, uint64s);
+ }
+#endif // _di_f_uint64s_decrease_by_
+
+#ifndef _di_f_uint64s_increase_
+ f_status_t f_uint64s_increase(const f_array_length_t step, f_uint64s_t *uint64s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint64s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (step && uint64s->used + 1 > uint64s->size) {
+ f_array_length_t size = uint64s->used + step;
+
+ if (size > F_array_length_t_size_d) {
+ if (uint64s->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_uint64s_resize(size, uint64s);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint64s_increase_
+
+#ifndef _di_f_uint64s_increase_by_
+ f_status_t f_uint64s_increase_by(const f_array_length_t amount, f_uint64s_t *uint64s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint64s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint64s->used + amount > uint64s->size) {
+ if (uint64s->used + amount > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ return private_f_uint64s_resize(uint64s->used + amount, uint64s);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint64s_increase_by_
+
+#ifndef _di_f_uint64s_resize_
+ f_status_t f_uint64s_resize(const f_array_length_t length, f_uint64s_t *uint64s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint64s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint64s_resize(length, uint64s);
+ }
+#endif // _di_f_uint64s_resize_
+
+#ifndef _di_f_uint64ss_adjust_
+ f_status_t f_uint64ss_adjust(const f_array_length_t length, f_uint64ss_t *uint64ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint64ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint64ss_adjust(length, uint64ss);
+ }
+#endif // _di_f_uint64ss_adjust_
+
+#ifndef _di_f_uint64ss_append_
+ f_status_t f_uint64ss_append(const f_uint64s_t source, f_uint64ss_t *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_uint64ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ status = private_f_uint64s_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_uint64ss_append_
+
+#ifndef _di_f_uint64ss_append_all_
+ f_status_t f_uint64ss_append_all(const f_uint64ss_t source, f_uint64ss_t *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_uint64ss_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_uint64s_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+
+ return F_none;
+ }
+#endif // _di_f_uint64ss_append_all_
+
+#ifndef _di_f_uint64ss_decimate_by_
+ f_status_t f_uint64ss_decimate_by(const f_array_length_t amount, f_uint64ss_t *uint64ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint64ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint64ss->size - amount > 0) {
+ return private_f_uint64ss_adjust(uint64ss->size - amount, uint64ss);
+ }
+
+ return private_f_uint64ss_adjust(0, uint64ss);
+ }
+#endif // _di_f_uint64ss_decimate_by_
+
+#ifndef _di_f_uint64ss_decrease_by_
+ f_status_t f_uint64ss_decrease_by(const f_array_length_t amount, f_uint64ss_t *uint64ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint64ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint64ss->size - amount > 0) {
+ return private_f_uint64ss_resize(uint64ss->size - amount, uint64ss);
+ }
+
+ return private_f_uint64ss_resize(0, uint64ss);
+ }
+#endif // _di_f_uint64ss_decrease_by_
+
+#ifndef _di_f_uint64ss_increase_
+ f_status_t f_uint64ss_increase(const f_array_length_t step, f_uint64ss_t *uint64ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint64ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (step && uint64ss->used + 1 > uint64ss->size) {
+ f_array_length_t size = uint64ss->used + step;
+
+ if (size > F_array_length_t_size_d) {
+ if (uint64ss->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_uint64ss_resize(size, uint64ss);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint64ss_increase_
+
+#ifndef _di_f_uint64ss_increase_by_
+ f_status_t f_uint64ss_increase_by(const f_array_length_t amount, f_uint64ss_t *uint64ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint64ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint64ss->used + amount > uint64ss->size) {
+ if (uint64ss->used + amount > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ return private_f_uint64ss_resize(uint64ss->used + amount, uint64ss);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint64ss_increase_by_
+
+#ifndef _di_f_uint64ss_resize_
+ f_status_t f_uint64ss_resize(const f_array_length_t length, f_uint64ss_t *uint64ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint64ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint64ss_resize(length, uint64ss);
+ }
+#endif // _di_f_uint64ss_resize_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Defines data to be used for/by type (array) related functionality.
+ *
+ * This is auto-included by type_array.h and should not need to be explicitly included.
+ */
+#ifndef _F_type_array_uint64_h
+#define _F_type_array_uint64_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Resize the string uint64s array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint64s
+ * The string uint64s 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_uint64s_adjust_
+ extern f_status_t f_uint64s_adjust(const f_array_length_t length, f_uint64s_t *uint64s);
+#endif // _di_f_uint64s_adjust_
+
+/**
+ * Append the single source uint64 onto the destination.
+ *
+ * @param source
+ * The source uint64 to append.
+ * @param destination
+ * The destination uint64s 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint64s_append_
+ extern f_status_t f_uint64s_append(const uint64_t source, f_uint64s_t *destination);
+#endif // _di_f_uint64s_append_
+
+/**
+ * Append the source uint64s onto the destination.
+ *
+ * @param source
+ * The source uint64s to append.
+ * @param destination
+ * The destination uint64s 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint64s_append_all_
+ extern f_status_t f_uint64s_append_all(const f_uint64s_t source, f_uint64s_t *destination);
+#endif // _di_f_uint64s_append_all_
+
+/**
+ * Resize the string uint64s 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 les than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decimate the size by.
+ * @param uint64s
+ * The string uint64s 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_adjust().
+ */
+#ifndef _di_f_uint64s_decimate_by_
+ extern f_status_t f_uint64s_decimate_by(const f_array_length_t amount, f_uint64s_t *uint64s);
+#endif // _di_f_uint64s_decimate_by_
+
+/**
+ * Resize the string uint64s 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 les than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decrease the size by.
+ * @param uint64s
+ * The string uint64s 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_uint64s_decrease_by_
+ extern f_status_t f_uint64s_decrease_by(const f_array_length_t amount, f_uint64s_t *uint64s);
+#endif // _di_f_uint64s_decrease_by_
+
+/**
+ * Increase the size of the string uint64s array, but only if necesary.
+ *
+ * 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 uint64s
+ * The string uint64s 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_uint64s_increase_
+ extern f_status_t f_uint64s_increase(const f_array_length_t step, f_uint64s_t *uint64s);
+#endif // _di_f_uint64s_increase_
+
+/**
+ * Resize the string uint64s 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 uint64s
+ * The string uint64s 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_uint64s_increase_by_
+ extern f_status_t f_uint64s_increase_by(const f_array_length_t amount, f_uint64s_t *uint64s);
+#endif // _di_f_uint64s_increase_by_
+
+/**
+ * Resize the string uint64s array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint64s
+ * The string uint64s 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_uint64s_resize_
+ extern f_status_t f_uint64s_resize(const f_array_length_t length, f_uint64s_t *uint64s);
+#endif // _di_f_uint64s_resize_
+
+/**
+ * Resize the string uint64ss array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint64ss
+ * The string uint64ss 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().
+ * Errors (with error bit) from: f_memory_destroy().
+ */
+#ifndef _di_f_uint64ss_adjust_
+ extern f_status_t f_uint64ss_adjust(const f_array_length_t length, f_uint64ss_t *uint64ss);
+#endif // _di_f_uint64ss_adjust_
+
+/**
+ * Append the single source uint64s onto the destination.
+ *
+ * @param source
+ * The source uint64s to append.
+ * @param destination
+ * The destination ranges 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint64ss_append_
+ extern f_status_t f_uint64ss_append(const f_uint64s_t source, f_uint64ss_t *destination);
+#endif // _di_f_uint64ss_append_
+
+/**
+ * Append the source uint64ss onto the destination.
+ *
+ * @param source
+ * The source uint64ss to append.
+ * @param destination
+ * The destination ranges 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint64ss_append_all_
+ extern f_status_t f_uint64ss_append_all(const f_uint64ss_t source, f_uint64ss_t *destination);
+#endif // _di_f_uint64ss_append_all_
+
+/**
+ * Resize the string uint64ss 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 uint64ss
+ * The string uint64ss 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_adjust().
+ * Errors (with error bit) from: f_memory_destroy().
+ */
+#ifndef _di_f_uint64ss_decimate_by_
+ extern f_status_t f_uint64ss_decimate_by(const f_array_length_t amount, f_uint64ss_t *uint64ss);
+#endif // _di_f_uint64ss_decimate_by_
+
+/**
+ * Resize the string uint64ss 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 uint64ss
+ * The string uint64ss 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_delete().
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint64ss_decrease_by_
+ extern f_status_t f_uint64ss_decrease_by(const f_array_length_t amount, f_uint64ss_t *uint64ss);
+#endif // _di_f_uint64ss_decrease_by_
+
+/**
+ * Increase the size of the string uint64ss 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 uint64ss
+ * The string uint64ss 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_uint64ss_increase_
+ extern f_status_t f_uint64ss_increase(const f_array_length_t step, f_uint64ss_t *uint64ss);
+#endif // _di_f_uint64ss_increase_
+
+/**
+ * Resize the string uint64ss 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 uint64ss
+ * The string uint64ss 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_uint64ss_increase_by_
+ extern f_status_t f_uint64ss_increase_by(const f_array_length_t amount, f_uint64ss_t *uint64ss);
+#endif // _di_f_uint64ss_increase_by_
+
+/**
+ * Resize the string uint64ss array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint64ss
+ * The string uint64ss 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_delete().
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint64ss_resize_
+ extern f_status_t f_uint64ss_resize(const f_array_length_t length, f_uint64ss_t *uint64ss);
+#endif // _di_f_uint64ss_resize_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _F_type_array_uint64_h
--- /dev/null
+#include "../type_array.h"
+#include "uint8.h"
+#include "private-uint8.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_f_uint8s_adjust_
+ f_status_t f_uint8s_adjust(const f_array_length_t length, f_uint8s_t *uint8s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint8s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint8s_adjust(length, uint8s);
+ }
+#endif // _di_f_uint8s_adjust_
+
+#ifndef _di_f_uint8s_append_
+ f_status_t f_uint8s_append(const uint8_t source, f_uint8s_t *destination) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!destination) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint8s_append(source, destination);
+ }
+#endif // _di_f_uint8s_append_
+
+#ifndef _di_f_uint8s_append_all_
+ f_status_t f_uint8s_append_all(const f_uint8s_t source, f_uint8s_t *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_uint8s_append_all(source, destination);
+ }
+#endif // _di_f_uint8s_append_all_
+
+#ifndef _di_f_uint8s_decimate_by_
+ f_status_t f_uint8s_decimate_by(const f_array_length_t amount, f_uint8s_t *uint8s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint8s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint8s->size - amount > 0) {
+ return private_f_uint8s_adjust(uint8s->size - amount, uint8s);
+ }
+
+ return private_f_uint8s_adjust(0, uint8s);
+ }
+#endif // _di_f_uint8s_decimate_by_
+
+#ifndef _di_f_uint8s_decrease_by_
+ f_status_t f_uint8s_decrease_by(const f_array_length_t amount, f_uint8s_t *uint8s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint8s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint8s->size - amount > 0) {
+ return private_f_uint8s_resize(uint8s->size - amount, uint8s);
+ }
+
+ return private_f_uint8s_resize(0, uint8s);
+ }
+#endif // _di_f_uint8s_decrease_by_
+
+#ifndef _di_f_uint8s_increase_
+ f_status_t f_uint8s_increase(const f_array_length_t step, f_uint8s_t *uint8s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint8s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (step && uint8s->used + 1 > uint8s->size) {
+ f_array_length_t size = uint8s->used + step;
+
+ if (size > F_array_length_t_size_d) {
+ if (uint8s->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_uint8s_resize(size, uint8s);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint8s_increase_
+
+#ifndef _di_f_uint8s_increase_by_
+ f_status_t f_uint8s_increase_by(const f_array_length_t amount, f_uint8s_t *uint8s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint8s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint8s->used + amount > uint8s->size) {
+ if (uint8s->used + amount > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ return private_f_uint8s_resize(uint8s->used + amount, uint8s);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint8s_increase_by_
+
+#ifndef _di_f_uint8s_resize_
+ f_status_t f_uint8s_resize(const f_array_length_t length, f_uint8s_t *uint8s) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint8s) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint8s_resize(length, uint8s);
+ }
+#endif // _di_f_uint8s_resize_
+
+#ifndef _di_f_uint8ss_adjust_
+ f_status_t f_uint8ss_adjust(const f_array_length_t length, f_uint8ss_t *uint8ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint8ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint8ss_adjust(length, uint8ss);
+ }
+#endif // _di_f_uint8ss_adjust_
+
+#ifndef _di_f_uint8ss_append_
+ f_status_t f_uint8ss_append(const f_uint8s_t source, f_uint8ss_t *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_uint8ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ status = private_f_uint8s_append_all(source, &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+
+ ++destination->used;
+
+ return F_none;
+ }
+#endif // _di_f_uint8ss_append_
+
+#ifndef _di_f_uint8ss_append_all_
+ f_status_t f_uint8ss_append_all(const f_uint8ss_t source, f_uint8ss_t *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_uint8ss_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_uint8s_append_all(source.array[i], &destination->array[destination->used]);
+ if (F_status_is_error(status)) return status;
+ }
+ } // for
+
+ return F_none;
+ }
+#endif // _di_f_uint8ss_append_all_
+
+#ifndef _di_f_uint8ss_decimate_by_
+ f_status_t f_uint8ss_decimate_by(const f_array_length_t amount, f_uint8ss_t *uint8ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint8ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint8ss->size - amount > 0) {
+ return private_f_uint8ss_adjust(uint8ss->size - amount, uint8ss);
+ }
+
+ return private_f_uint8ss_adjust(0, uint8ss);
+ }
+#endif // _di_f_uint8ss_decimate_by_
+
+#ifndef _di_f_uint8ss_decrease_by_
+ f_status_t f_uint8ss_decrease_by(const f_array_length_t amount, f_uint8ss_t *uint8ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint8ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint8ss->size - amount > 0) {
+ return private_f_uint8ss_resize(uint8ss->size - amount, uint8ss);
+ }
+
+ return private_f_uint8ss_resize(0, uint8ss);
+ }
+#endif // _di_f_uint8ss_decrease_by_
+
+#ifndef _di_f_uint8ss_increase_
+ f_status_t f_uint8ss_increase(const f_array_length_t step, f_uint8ss_t *uint8ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint8ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (step && uint8ss->used + 1 > uint8ss->size) {
+ f_array_length_t size = uint8ss->used + step;
+
+ if (size > F_array_length_t_size_d) {
+ if (uint8ss->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_uint8ss_resize(size, uint8ss);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint8ss_increase_
+
+#ifndef _di_f_uint8ss_increase_by_
+ f_status_t f_uint8ss_increase_by(const f_array_length_t amount, f_uint8ss_t *uint8ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint8ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!amount) {
+ return F_data_not;
+ }
+
+ if (uint8ss->used + amount > uint8ss->size) {
+ if (uint8ss->used + amount > F_array_length_t_size_d) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ return private_f_uint8ss_resize(uint8ss->used + amount, uint8ss);
+ }
+
+ return F_data_not;
+ }
+#endif // _di_f_uint8ss_increase_by_
+
+#ifndef _di_f_uint8ss_resize_
+ f_status_t f_uint8ss_resize(const f_array_length_t length, f_uint8ss_t *uint8ss) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!uint8ss) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ return private_f_uint8ss_resize(length, uint8ss);
+ }
+#endif // _di_f_uint8ss_resize_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Type
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Defines data to be used for/by type (array) related functionality.
+ *
+ * This is auto-included by type_array.h and should not need to be explicitly included.
+ */
+#ifndef _F_type_array_uint8_h
+#define _F_type_array_uint8_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Resize the string uint8s array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint8s
+ * The string uint8s 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_uint8s_adjust_
+ extern f_status_t f_uint8s_adjust(const f_array_length_t length, f_uint8s_t *uint8s);
+#endif // _di_f_uint8s_adjust_
+
+/**
+ * Append the single source uint8 onto the destination.
+ *
+ * @param source
+ * The source uint8 to append.
+ * @param destination
+ * The destination uint8s 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint8s_append_
+ extern f_status_t f_uint8s_append(const uint8_t source, f_uint8s_t *destination);
+#endif // _di_f_uint8s_append_
+
+/**
+ * Append the source uint8s onto the destination.
+ *
+ * @param source
+ * The source uint8s to append.
+ * @param destination
+ * The destination uint8s 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint8s_append_all_
+ extern f_status_t f_uint8s_append_all(const f_uint8s_t source, f_uint8s_t *destination);
+#endif // _di_f_uint8s_append_all_
+
+/**
+ * Resize the string uint8s 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 les than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decimate the size by.
+ * @param uint8s
+ * The string uint8s 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_adjust().
+ */
+#ifndef _di_f_uint8s_decimate_by_
+ extern f_status_t f_uint8s_decimate_by(const f_array_length_t amount, f_uint8s_t *uint8s);
+#endif // _di_f_uint8s_decimate_by_
+
+/**
+ * Resize the string uint8s 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 les than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decrease the size by.
+ * @param uint8s
+ * The string uint8s 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_uint8s_decrease_by_
+ extern f_status_t f_uint8s_decrease_by(const f_array_length_t amount, f_uint8s_t *uint8s);
+#endif // _di_f_uint8s_decrease_by_
+
+/**
+ * Increase the size of the string uint8s array, but only if necesary.
+ *
+ * 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 uint8s
+ * The string uint8s 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_uint8s_increase_
+ extern f_status_t f_uint8s_increase(const f_array_length_t step, f_uint8s_t *uint8s);
+#endif // _di_f_uint8s_increase_
+
+/**
+ * Resize the string uint8s 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 uint8s
+ * The string uint8s 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_uint8s_increase_by_
+ extern f_status_t f_uint8s_increase_by(const f_array_length_t amount, f_uint8s_t *uint8s);
+#endif // _di_f_uint8s_increase_by_
+
+/**
+ * Resize the string uint8s array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint8s
+ * The string uint8s 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_uint8s_resize_
+ extern f_status_t f_uint8s_resize(const f_array_length_t length, f_uint8s_t *uint8s);
+#endif // _di_f_uint8s_resize_
+
+/**
+ * Resize the string uint8ss array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint8ss
+ * The string uint8ss 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().
+ * Errors (with error bit) from: f_memory_destroy().
+ */
+#ifndef _di_f_uint8ss_adjust_
+ extern f_status_t f_uint8ss_adjust(const f_array_length_t length, f_uint8ss_t *uint8ss);
+#endif // _di_f_uint8ss_adjust_
+
+/**
+ * Append the single source uint8s onto the destination.
+ *
+ * @param source
+ * The source uint8s to append.
+ * @param destination
+ * The destination ranges 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint8ss_append_
+ extern f_status_t f_uint8ss_append(const f_uint8s_t source, f_uint8ss_t *destination);
+#endif // _di_f_uint8ss_append_
+
+/**
+ * Append the source uint8ss onto the destination.
+ *
+ * @param source
+ * The source uint8ss to append.
+ * @param destination
+ * The destination ranges 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.
+ *
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint8ss_append_all_
+ extern f_status_t f_uint8ss_append_all(const f_uint8ss_t source, f_uint8ss_t *destination);
+#endif // _di_f_uint8ss_append_all_
+
+/**
+ * Resize the string uint8ss 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 uint8ss
+ * The string uint8ss 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_adjust().
+ * Errors (with error bit) from: f_memory_destroy().
+ */
+#ifndef _di_f_uint8ss_decimate_by_
+ extern f_status_t f_uint8ss_decimate_by(const f_array_length_t amount, f_uint8ss_t *uint8ss);
+#endif // _di_f_uint8ss_decimate_by_
+
+/**
+ * Resize the string uint8ss 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 uint8ss
+ * The string uint8ss 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_delete().
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint8ss_decrease_by_
+ extern f_status_t f_uint8ss_decrease_by(const f_array_length_t amount, f_uint8ss_t *uint8ss);
+#endif // _di_f_uint8ss_decrease_by_
+
+/**
+ * Increase the size of the string uint8ss 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 uint8ss
+ * The string uint8ss 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_uint8ss_increase_
+ extern f_status_t f_uint8ss_increase(const f_array_length_t step, f_uint8ss_t *uint8ss);
+#endif // _di_f_uint8ss_increase_
+
+/**
+ * Resize the string uint8ss 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 uint8ss
+ * The string uint8ss 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_uint8ss_increase_by_
+ extern f_status_t f_uint8ss_increase_by(const f_array_length_t amount, f_uint8ss_t *uint8ss);
+#endif // _di_f_uint8ss_increase_by_
+
+/**
+ * Resize the string uint8ss array.
+ *
+ * @param length
+ * The new size to use.
+ * @param uint8ss
+ * The string uint8ss 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_delete().
+ * Errors (with error bit) from: f_memory_resize().
+ */
+#ifndef _di_f_uint8ss_resize_
+ extern f_status_t f_uint8ss_resize(const f_array_length_t length, f_uint8ss_t *uint8ss);
+#endif // _di_f_uint8ss_resize_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _F_type_array_uint8_h
build_objects_program
build_objects_program_shared
build_objects_program_static
-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
-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
+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_shared
build_sources_library_static
build_sources_object
build_sources_program
build_sources_program_shared
build_sources_program_static
-build_sources_headers type_array.h type_array/common.h 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
+build_sources_headers type_array.h type_array/common.h 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_shared
build_sources_headers_static
build_sources_script
build_libraries-level -lfll_0
build_libraries-monolithic -lfll
-build_sources_program test-type_array-array_lengths_adjust.c test-type_array-array_lengths_append.c test-type_array-array_lengths_decimate_by.c test-type_array-array_lengths_decrease_by.c test-type_array-array_lengths_increase.c test-type_array-array_lengths_increase_by.c test-type_array-array_lengths_resize.c
-build_sources_program test-type_array-array_lengthss_adjust.c test-type_array-array_lengthss_append.c test-type_array-array_lengthss_decimate_by.c test-type_array-array_lengthss_decrease_by.c test-type_array-array_lengthss_increase.c test-type_array-array_lengthss_increase_by.c test-type_array-array_lengthss_resize.c
-build_sources_program test-type_array-fll_ids_adjust.c test-type_array-fll_ids_append.c test-type_array-fll_ids_decimate_by.c test-type_array-fll_ids_decrease_by.c test-type_array-fll_ids_increase.c test-type_array-fll_ids_increase_by.c test-type_array-fll_ids_resize.c
-build_sources_program test-type_array-fll_idss_adjust.c test-type_array-fll_idss_append.c test-type_array-fll_idss_decimate_by.c test-type_array-fll_idss_decrease_by.c test-type_array-fll_idss_increase.c test-type_array-fll_idss_increase_by.c test-type_array-fll_idss_resize.c
-build_sources_program test-type_array-cells_adjust.c test-type_array-cells_append.c test-type_array-cells_decimate_by.c test-type_array-cells_decrease_by.c test-type_array-cells_increase.c test-type_array-cells_increase_by.c test-type_array-cells_resize.c
-build_sources_program test-type_array-cellss_adjust.c test-type_array-cellss_append.c test-type_array-cellss_decimate_by.c test-type_array-cellss_decrease_by.c test-type_array-cellss_increase.c test-type_array-cellss_increase_by.c test-type_array-cellss_resize.c
-build_sources_program test-type_array-int8s_adjust.c test-type_array-int8s_append.c test-type_array-int8s_decimate_by.c test-type_array-int8s_decrease_by.c test-type_array-int8s_increase.c test-type_array-int8s_increase_by.c test-type_array-int8s_resize.c
-build_sources_program test-type_array-int8ss_adjust.c test-type_array-int8ss_append.c test-type_array-int8ss_decimate_by.c test-type_array-int8ss_decrease_by.c test-type_array-int8ss_increase.c test-type_array-int8ss_increase_by.c test-type_array-int8ss_resize.c
-build_sources_program test-type_array-int16s_adjust.c test-type_array-int16s_append.c test-type_array-int16s_decimate_by.c test-type_array-int16s_decrease_by.c test-type_array-int16s_increase.c test-type_array-int16s_increase_by.c test-type_array-int16s_resize.c
-build_sources_program test-type_array-int16ss_adjust.c test-type_array-int16ss_append.c test-type_array-int16ss_decimate_by.c test-type_array-int16ss_decrease_by.c test-type_array-int16ss_increase.c test-type_array-int16ss_increase_by.c test-type_array-int16ss_resize.c
-build_sources_program test-type_array-int32s_adjust.c test-type_array-int32s_append.c test-type_array-int32s_decimate_by.c test-type_array-int32s_decrease_by.c test-type_array-int32s_increase.c test-type_array-int32s_increase_by.c test-type_array-int32s_resize.c
-build_sources_program test-type_array-int32ss_adjust.c test-type_array-int32ss_append.c test-type_array-int32ss_decimate_by.c test-type_array-int32ss_decrease_by.c test-type_array-int32ss_increase.c test-type_array-int32ss_increase_by.c test-type_array-int32ss_resize.c
-build_sources_program test-type_array-int64s_adjust.c test-type_array-int64s_append.c test-type_array-int64s_decimate_by.c test-type_array-int64s_decrease_by.c test-type_array-int64s_increase.c test-type_array-int64s_increase_by.c test-type_array-int64s_resize.c
-build_sources_program test-type_array-int64ss_adjust.c test-type_array-int64ss_append.c test-type_array-int64ss_decimate_by.c test-type_array-int64ss_decrease_by.c test-type_array-int64ss_increase.c test-type_array-int64ss_increase_by.c test-type_array-int64ss_resize.c
-build_sources_program test-type_array-int128s_adjust.c test-type_array-int128s_append.c test-type_array-int128s_decimate_by.c test-type_array-int128s_decrease_by.c test-type_array-int128s_increase.c test-type_array-int128s_increase_by.c test-type_array-int128s_resize.c
-build_sources_program test-type_array-int128ss_adjust.c test-type_array-int128ss_append.c test-type_array-int128ss_decimate_by.c test-type_array-int128ss_decrease_by.c test-type_array-int128ss_increase.c test-type_array-int128ss_increase_by.c test-type_array-int128ss_resize.c
-build_sources_program test-type_array-states_adjust.c test-type_array-states_append.c test-type_array-states_decimate_by.c test-type_array-states_decrease_by.c test-type_array-states_increase.c test-type_array-states_increase_by.c test-type_array-states_resize.c
-build_sources_program test-type_array-statess_adjust.c test-type_array-statess_append.c test-type_array-statess_decimate_by.c test-type_array-statess_decrease_by.c test-type_array-statess_increase.c test-type_array-statess_increase_by.c test-type_array-statess_resize.c
-build_sources_program test-type_array-statuss_adjust.c test-type_array-statuss_append.c test-type_array-statuss_decimate_by.c test-type_array-statuss_decrease_by.c test-type_array-statuss_increase.c test-type_array-statuss_increase_by.c test-type_array-statuss_resize.c
-build_sources_program test-type_array-statusss_adjust.c test-type_array-statusss_append.c test-type_array-statusss_decimate_by.c test-type_array-statusss_decrease_by.c test-type_array-statusss_increase.c test-type_array-statusss_increase_by.c test-type_array-statusss_resize.c
-build_sources_program test-type_array-uint8s_adjust.c test-type_array-uint8s_append.c test-type_array-uint8s_decimate_by.c test-type_array-uint8s_decrease_by.c test-type_array-uint8s_increase.c test-type_array-uint8s_increase_by.c test-type_array-uint8s_resize.c
-build_sources_program test-type_array-uint8ss_adjust.c test-type_array-uint8ss_append.c test-type_array-uint8ss_decimate_by.c test-type_array-uint8ss_decrease_by.c test-type_array-uint8ss_increase.c test-type_array-uint8ss_increase_by.c test-type_array-uint8ss_resize.c
-build_sources_program test-type_array-uint16s_adjust.c test-type_array-uint16s_append.c test-type_array-uint16s_decimate_by.c test-type_array-uint16s_decrease_by.c test-type_array-uint16s_increase.c test-type_array-uint16s_increase_by.c test-type_array-uint16s_resize.c
-build_sources_program test-type_array-uint16ss_adjust.c test-type_array-uint16ss_append.c test-type_array-uint16ss_decimate_by.c test-type_array-uint16ss_decrease_by.c test-type_array-uint16ss_increase.c test-type_array-uint16ss_increase_by.c test-type_array-uint16ss_resize.c
-build_sources_program test-type_array-uint32s_adjust.c test-type_array-uint32s_append.c test-type_array-uint32s_decimate_by.c test-type_array-uint32s_decrease_by.c test-type_array-uint32s_increase.c test-type_array-uint32s_increase_by.c test-type_array-uint32s_resize.c
-build_sources_program test-type_array-uint32ss_adjust.c test-type_array-uint32ss_append.c test-type_array-uint32ss_decimate_by.c test-type_array-uint32ss_decrease_by.c test-type_array-uint32ss_increase.c test-type_array-uint32ss_increase_by.c test-type_array-uint32ss_resize.c
-build_sources_program test-type_array-uint64s_adjust.c test-type_array-uint64s_append.c test-type_array-uint64s_decimate_by.c test-type_array-uint64s_decrease_by.c test-type_array-uint64s_increase.c test-type_array-uint64s_increase_by.c test-type_array-uint64s_resize.c
-build_sources_program test-type_array-uint64ss_adjust.c test-type_array-uint64ss_append.c test-type_array-uint64ss_decimate_by.c test-type_array-uint64ss_decrease_by.c test-type_array-uint64ss_increase.c test-type_array-uint64ss_increase_by.c test-type_array-uint64ss_resize.c
-build_sources_program test-type_array-uint128s_adjust.c test-type_array-uint128s_append.c test-type_array-uint128s_decimate_by.c test-type_array-uint128s_decrease_by.c test-type_array-uint128s_increase.c test-type_array-uint128s_increase_by.c test-type_array-uint128s_resize.c
-build_sources_program test-type_array-uint128ss_adjust.c test-type_array-uint128ss_append.c test-type_array-uint128ss_decimate_by.c test-type_array-uint128ss_decrease_by.c test-type_array-uint128ss_increase.c test-type_array-uint128ss_increase_by.c test-type_array-uint128ss_resize.c
+build_sources_program test-type_array-array_lengths_adjust.c test-type_array-array_lengths_append.c test-type_array-array_lengths_append_all.c test-type_array-array_lengths_decimate_by.c test-type_array-array_lengths_decrease_by.c test-type_array-array_lengths_increase.c test-type_array-array_lengths_increase_by.c test-type_array-array_lengths_resize.c
+build_sources_program test-type_array-array_lengthss_adjust.c test-type_array-array_lengthss_append.c test-type_array-array_lengthss_append_all.c test-type_array-array_lengthss_decimate_by.c test-type_array-array_lengthss_decrease_by.c test-type_array-array_lengthss_increase.c test-type_array-array_lengthss_increase_by.c test-type_array-array_lengthss_resize.c
+build_sources_program test-type_array-fll_ids_adjust.c test-type_array-fll_ids_append.c test-type_array-fll_ids_append_all.c test-type_array-fll_ids_decimate_by.c test-type_array-fll_ids_decrease_by.c test-type_array-fll_ids_increase.c test-type_array-fll_ids_increase_by.c test-type_array-fll_ids_resize.c
+build_sources_program test-type_array-fll_idss_adjust.c test-type_array-fll_idss_append.c test-type_array-fll_idss_append_all.c test-type_array-fll_idss_decimate_by.c test-type_array-fll_idss_decrease_by.c test-type_array-fll_idss_increase.c test-type_array-fll_idss_increase_by.c test-type_array-fll_idss_resize.c
+build_sources_program test-type_array-cells_adjust.c test-type_array-cells_append.c test-type_array-cells_append_all.c test-type_array-cells_decimate_by.c test-type_array-cells_decrease_by.c test-type_array-cells_increase.c test-type_array-cells_increase_by.c test-type_array-cells_resize.c
+build_sources_program test-type_array-cellss_adjust.c test-type_array-cellss_append.c test-type_array-cellss_append_all.c test-type_array-cellss_decimate_by.c test-type_array-cellss_decrease_by.c test-type_array-cellss_increase.c test-type_array-cellss_increase_by.c test-type_array-cellss_resize.c
+build_sources_program test-type_array-int8s_adjust.c test-type_array-int8s_append.c test-type_array-int8s_append_all.c test-type_array-int8s_decimate_by.c test-type_array-int8s_decrease_by.c test-type_array-int8s_increase.c test-type_array-int8s_increase_by.c test-type_array-int8s_resize.c
+build_sources_program test-type_array-int8ss_adjust.c test-type_array-int8ss_append.c test-type_array-int8ss_append_all.c test-type_array-int8ss_decimate_by.c test-type_array-int8ss_decrease_by.c test-type_array-int8ss_increase.c test-type_array-int8ss_increase_by.c test-type_array-int8ss_resize.c
+build_sources_program test-type_array-int16s_adjust.c test-type_array-int16s_append.c test-type_array-int16s_append_all.c test-type_array-int16s_decimate_by.c test-type_array-int16s_decrease_by.c test-type_array-int16s_increase.c test-type_array-int16s_increase_by.c test-type_array-int16s_resize.c
+build_sources_program test-type_array-int16ss_adjust.c test-type_array-int16ss_append.c test-type_array-int16ss_append_all.c test-type_array-int16ss_decimate_by.c test-type_array-int16ss_decrease_by.c test-type_array-int16ss_increase.c test-type_array-int16ss_increase_by.c test-type_array-int16ss_resize.c
+build_sources_program test-type_array-int32s_adjust.c test-type_array-int32s_append.c test-type_array-int32s_append_all.c test-type_array-int32s_decimate_by.c test-type_array-int32s_decrease_by.c test-type_array-int32s_increase.c test-type_array-int32s_increase_by.c test-type_array-int32s_resize.c
+build_sources_program test-type_array-int32ss_adjust.c test-type_array-int32ss_append.c test-type_array-int32ss_append_all.c test-type_array-int32ss_decimate_by.c test-type_array-int32ss_decrease_by.c test-type_array-int32ss_increase.c test-type_array-int32ss_increase_by.c test-type_array-int32ss_resize.c
+build_sources_program test-type_array-int64s_adjust.c test-type_array-int64s_append.c test-type_array-int64s_append_all.c test-type_array-int64s_decimate_by.c test-type_array-int64s_decrease_by.c test-type_array-int64s_increase.c test-type_array-int64s_increase_by.c test-type_array-int64s_resize.c
+build_sources_program test-type_array-int64ss_adjust.c test-type_array-int64ss_append.c test-type_array-int64ss_append_all.c test-type_array-int64ss_decimate_by.c test-type_array-int64ss_decrease_by.c test-type_array-int64ss_increase.c test-type_array-int64ss_increase_by.c test-type_array-int64ss_resize.c
+build_sources_program test-type_array-int128s_adjust.c test-type_array-int128s_append.c test-type_array-int128s_append_all.c test-type_array-int128s_decimate_by.c test-type_array-int128s_decrease_by.c test-type_array-int128s_increase.c test-type_array-int128s_increase_by.c test-type_array-int128s_resize.c
+build_sources_program test-type_array-int128ss_adjust.c test-type_array-int128ss_append.c test-type_array-int128ss_append_all.c test-type_array-int128ss_decimate_by.c test-type_array-int128ss_decrease_by.c test-type_array-int128ss_increase.c test-type_array-int128ss_increase_by.c test-type_array-int128ss_resize.c
+build_sources_program test-type_array-states_adjust.c test-type_array-states_append.c test-type_array-states_append_all.c test-type_array-states_decimate_by.c test-type_array-states_decrease_by.c test-type_array-states_increase.c test-type_array-states_increase_by.c test-type_array-states_resize.c
+build_sources_program test-type_array-statess_adjust.c test-type_array-statess_append.c test-type_array-statess_append_all.c test-type_array-statess_decimate_by.c test-type_array-statess_decrease_by.c test-type_array-statess_increase.c test-type_array-statess_increase_by.c test-type_array-statess_resize.c
+build_sources_program test-type_array-statuss_adjust.c test-type_array-statuss_append.c test-type_array-statuss_append_all.c test-type_array-statuss_decimate_by.c test-type_array-statuss_decrease_by.c test-type_array-statuss_increase.c test-type_array-statuss_increase_by.c test-type_array-statuss_resize.c
+build_sources_program test-type_array-statusss_adjust.c test-type_array-statusss_append.c test-type_array-statusss_append_all.c test-type_array-statusss_decimate_by.c test-type_array-statusss_decrease_by.c test-type_array-statusss_increase.c test-type_array-statusss_increase_by.c test-type_array-statusss_resize.c
+build_sources_program test-type_array-uint8s_adjust.c test-type_array-uint8s_append.c test-type_array-uint8s_append_all.c test-type_array-uint8s_decimate_by.c test-type_array-uint8s_decrease_by.c test-type_array-uint8s_increase.c test-type_array-uint8s_increase_by.c test-type_array-uint8s_resize.c
+build_sources_program test-type_array-uint8ss_adjust.c test-type_array-uint8ss_append.c test-type_array-uint8ss_append_all.c test-type_array-uint8ss_decimate_by.c test-type_array-uint8ss_decrease_by.c test-type_array-uint8ss_increase.c test-type_array-uint8ss_increase_by.c test-type_array-uint8ss_resize.c
+build_sources_program test-type_array-uint16s_adjust.c test-type_array-uint16s_append.c test-type_array-uint16s_append_all.c test-type_array-uint16s_decimate_by.c test-type_array-uint16s_decrease_by.c test-type_array-uint16s_increase.c test-type_array-uint16s_increase_by.c test-type_array-uint16s_resize.c
+build_sources_program test-type_array-uint16ss_adjust.c test-type_array-uint16ss_append.c test-type_array-uint16ss_append_all.c test-type_array-uint16ss_decimate_by.c test-type_array-uint16ss_decrease_by.c test-type_array-uint16ss_increase.c test-type_array-uint16ss_increase_by.c test-type_array-uint16ss_resize.c
+build_sources_program test-type_array-uint32s_adjust.c test-type_array-uint32s_append.c test-type_array-uint32s_append_all.c test-type_array-uint32s_decimate_by.c test-type_array-uint32s_decrease_by.c test-type_array-uint32s_increase.c test-type_array-uint32s_increase_by.c test-type_array-uint32s_resize.c
+build_sources_program test-type_array-uint32ss_adjust.c test-type_array-uint32ss_append.c test-type_array-uint32ss_append_all.c test-type_array-uint32ss_decimate_by.c test-type_array-uint32ss_decrease_by.c test-type_array-uint32ss_increase.c test-type_array-uint32ss_increase_by.c test-type_array-uint32ss_resize.c
+build_sources_program test-type_array-uint64s_adjust.c test-type_array-uint64s_append.c test-type_array-uint64s_append_all.c test-type_array-uint64s_decimate_by.c test-type_array-uint64s_decrease_by.c test-type_array-uint64s_increase.c test-type_array-uint64s_increase_by.c test-type_array-uint64s_resize.c
+build_sources_program test-type_array-uint64ss_adjust.c test-type_array-uint64ss_append.c test-type_array-uint64ss_append_all.c test-type_array-uint64ss_decimate_by.c test-type_array-uint64ss_decrease_by.c test-type_array-uint64ss_increase.c test-type_array-uint64ss_increase_by.c test-type_array-uint64ss_resize.c
+build_sources_program test-type_array-uint128s_adjust.c test-type_array-uint128s_append.c test-type_array-uint128s_append_all.c test-type_array-uint128s_decimate_by.c test-type_array-uint128s_decrease_by.c test-type_array-uint128s_increase.c test-type_array-uint128s_increase_by.c test-type_array-uint128s_resize.c
+build_sources_program test-type_array-uint128ss_adjust.c test-type_array-uint128ss_append.c test-type_array-uint128ss_append_all.c test-type_array-uint128ss_decimate_by.c test-type_array-uint128ss_decrease_by.c test-type_array-uint128ss_increase.c test-type_array-uint128ss_increase_by.c test-type_array-uint128ss_resize.c
build_sources_program test-type_array.c
build_script no
free((void *) data.array);
}
-void test__f_type_array_array_lengths_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_array_lengths_adjust__parameter_checking(void **state) {
const int length = 5;
f_array_lengths_t data = f_array_lengths_t_initialize;
*
* @see f_type_array_array_lengths_adjust()
*/
-extern void test__f_type_array_array_lengths_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_array_lengths_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__array_lengths_adjust
void test__f_type_array_array_lengths_append__works(void **state) {
- const int length = 5;
- const int length_used = 2;
- f_array_lengths_t source = f_array_lengths_t_initialize;
+ const f_array_length_t source = 3;
f_array_lengths_t destination = f_array_lengths_t_initialize;
{
- const f_status_t status = f_array_lengths_resize(length, &source);
-
- assert_int_equal(status, F_none);
- assert_int_equal(source.used, 0);
- assert_int_equal(source.size, length);
- }
-
- for (; source.used < length_used; ++source.used) {
- source.array[source.used] = source.used + 1;
- } // for
-
- {
const f_status_t status = f_array_lengths_append(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 < source.used; ++i) {
- assert_int_equal(destination.array[i], i + 1);
- } // for
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0], source);
}
- free((void *) source.array);
free((void *) destination.array);
}
-void test__f_type_array_array_lengths_append__returns_data_not(void **state) {
+void test__f_type_array_array_lengths_append__parameter_checking(void **state) {
- const int length = 5;
- f_array_lengths_t source = f_array_lengths_t_initialize;
- f_array_lengths_t destination = f_array_lengths_t_initialize;
-
- {
- const f_status_t status = f_array_lengths_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_array_lengths_append(source, &destination);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(destination.used, 0);
- assert_int_equal(destination.size, 0);
- }
-
- free((void *) source.array);
- assert_null(destination.array);
-}
-
-void test__f_type_array_array_lengths_append__fails_on_invalid_parameter(void **state) {
-
- const int length = 5;
- f_array_lengths_t data = f_array_lengths_t_initialize;
+ const f_array_length_t data = f_array_length_t_initialize;
{
const f_status_t status = f_array_lengths_append(data, 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 void test__f_type_array_array_lengths_append__works(void **state);
/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_type_array_array_lengths_append()
- */
-extern void test__f_type_array_array_lengths_append__returns_data_not(void **state);
-
-/**
* Test that the function correctly fails on invalid parameter.
*
* @see f_type_array_array_lengths_append()
*/
-extern void test__f_type_array_array_lengths_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_array_lengths_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__array_lengths_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-array_lengths_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_array_lengths_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_used = 2;
+ f_array_lengths_t source = f_array_lengths_t_initialize;
+ f_array_lengths_t destination = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_array_lengths_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ for (; source.used < length_used; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
+
+ {
+ const f_status_t status = f_array_lengths_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 < source.used; ++i) {
+ assert_int_equal(destination.array[i], i + 1);
+ } // for
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_array_lengths_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_array_lengths_t source = f_array_lengths_t_initialize;
+ f_array_lengths_t destination = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_array_lengths_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_array_lengths_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_type_array_array_lengths_append_all__parameter_checking(void **state) {
+
+ const f_array_lengths_t data = f_array_lengths_t_initialize;
+
+ {
+ const f_status_t status = f_array_lengths_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_type_array__array_lengths_append_all
+#define _TEST__F_type_array__array_lengths_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_array_lengths_append_all()
+ */
+extern void test__f_type_array_array_lengths_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_array_lengths_append_all()
+ */
+extern void test__f_type_array_array_lengths_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_array_lengths_append_all()
+ */
+extern void test__f_type_array_array_lengths_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__array_lengths_append_all
assert_null(data.array);
}
-void test__f_type_array_array_lengths_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_array_lengths_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_array_lengths_t data = f_array_lengths_t_initialize;
*
* @see f_type_array_array_lengths_decimate_by()
*/
-extern void test__f_type_array_array_lengths_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_array_lengths_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__array_lengths_decimate_by
assert_null(data.array);
}
-void test__f_type_array_array_lengths_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_array_lengths_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_array_lengths_t data = f_array_lengths_t_initialize;
*
* @see f_type_array_array_lengths_decrease_by()
*/
-extern void test__f_type_array_array_lengths_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_array_lengths_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__array_lengths_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_array_lengths_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_array_lengths_increase__parameter_checking(void **state) {
const int length = 5;
f_array_lengths_t data = f_array_lengths_t_initialize;
*
* @see f_type_array_array_lengths_increase()
*/
-extern void test__f_type_array_array_lengths_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_array_lengths_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__array_lengths_increase
free((void *) data.array);
}
-void test__f_type_array_array_lengths_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_array_lengths_increase_by__parameter_checking(void **state) {
const int length = 5;
f_array_lengths_t data = f_array_lengths_t_initialize;
*
* @see f_type_array_array_lengths_increase_by()
*/
-extern void test__f_type_array_array_lengths_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_array_lengths_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__array_lengths_increase_by
free((void *) data.array);
}
-void test__f_type_array_array_lengths_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_array_lengths_resize__parameter_checking(void **state) {
const int length = 5;
f_array_lengths_t data = f_array_lengths_t_initialize;
*
* @see f_type_array_array_lengths_resize()
*/
-extern void test__f_type_array_array_lengths_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_array_lengths_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__array_lengths_resize
free((void *) data.array);
}
-void test__f_type_array_array_lengthss_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_array_lengthss_adjust__parameter_checking(void **state) {
const int length = 5;
f_array_lengthss_t data = f_array_lengthss_t_initialize;
*
* @see f_type_array_array_lengthss_adjust()
*/
-extern void test__f_type_array_array_lengthss_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_array_lengthss_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__array_lengthss_adjust
const int length = 5;
const int length_inner = 2;
- f_array_lengthss_t source = f_array_lengths_t_initialize;
- f_array_lengthss_t destination = f_array_lengths_t_initialize;
+ f_array_lengths_t source = f_array_lengths_t_initialize;
+ f_array_lengthss_t destination = f_array_lengthss_t_initialize;
{
- const f_status_t status = f_array_lengthss_resize(length, &source);
+ const f_status_t status = f_array_lengths_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
assert_int_equal(source.size, length);
}
- {
- for (; source.used < length; ++source.used) {
-
- const f_status_t status = f_array_lengths_resize(length_inner, &source.array[source.used]);
-
- assert_int_equal(status, F_none);
-
- for (f_array_length_t i = 0; i < length_inner; ++i) {
- source.array[source.used].array[source.array[source.used].used++] = i + 1;
- } // for
- } // for
- }
+ for (; source.used < length; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
{
const f_status_t status = f_array_lengthss_append(source, &destination);
assert_int_equal(status, F_none);
- assert_int_equal(destination.used, source.used);
- assert_int_equal(destination.size, source.used);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].used, source.used);
+ assert_int_equal(destination.array[0].size, source.used);
- for (f_array_length_t i = 0; i < destination.used; ++i) {
-
- assert_int_equal(destination.array[i].used, length_inner);
- assert_int_equal(destination.array[i].size, length_inner);
-
- for (f_array_length_t j = 0; j < length_inner; ++j) {
- assert_int_equal(destination.array[i].array[j], j + 1);
- } // for
+ for (f_array_length_t i = 0; i < destination.array[0].used; ++i) {
+ assert_int_equal(destination.array[0].array[i], i + 1);
} // for
}
- for (f_array_length_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].array);
- } // for
-
for (f_array_length_t i = 0; i < destination.used; ++i) {
free((void *) destination.array[i].array);
} // for
void test__f_type_array_array_lengthss_append__returns_data_not(void **state) {
const int length = 5;
- f_array_lengthss_t source = f_array_lengths_t_initialize;
- f_array_lengthss_t destination = f_array_lengths_t_initialize;
+ f_array_lengths_t source = f_array_lengths_t_initialize;
+ f_array_lengthss_t destination = f_array_lengthss_t_initialize;
{
- const f_status_t status = f_array_lengthss_resize(length, &source);
+ const f_status_t status = f_array_lengths_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
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);
- assert_null(destination.array);
}
-void test__f_type_array_array_lengthss_append__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_array_lengthss_append__parameter_checking(void **state) {
- const int length = 5;
- f_array_lengthss_t data = f_array_lengths_t_initialize;
+ const f_array_lengths_t data = f_array_lengths_t_initialize;
{
const f_status_t status = f_array_lengthss_append(data, 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
*
* @see f_type_array_array_lengthss_append()
*/
-extern void test__f_type_array_array_lengthss_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_array_lengthss_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__array_lengthss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-array_lengthss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_array_lengthss_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_array_lengthss_t source = f_array_lengthss_t_initialize;
+ f_array_lengthss_t destination = f_array_lengthss_t_initialize;
+
+ {
+ const f_status_t status = f_array_lengthss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_array_lengths_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ for (f_array_length_t i = 0; i < length_inner; ++i) {
+ source.array[source.used].array[source.array[source.used].used++] = i + 1;
+ } // for
+ } // for
+ }
+
+ {
+ const f_status_t status = f_array_lengthss_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 < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ for (f_array_length_t j = 0; j < length_inner; ++j) {
+ assert_int_equal(destination.array[i].array[j], j + 1);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_array_lengthss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_array_lengthss_t source = f_array_lengthss_t_initialize;
+ f_array_lengthss_t destination = f_array_lengthss_t_initialize;
+
+ {
+ const f_status_t status = f_array_lengthss_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_array_lengthss_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_type_array_array_lengthss_append_all__parameter_checking(void **state) {
+
+ const f_array_lengthss_t data = f_array_lengthss_t_initialize;
+
+ {
+ const f_status_t status = f_array_lengthss_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_type_array__array_lengthss_append_all
+#define _TEST__F_type_array__array_lengthss_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_array_lengthss_append_all()
+ */
+extern void test__f_type_array_array_lengthss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_array_lengthss_append_all()
+ */
+extern void test__f_type_array_array_lengthss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_array_lengthss_append_all()
+ */
+extern void test__f_type_array_array_lengthss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__array_lengthss_append_all
assert_null(data.array);
}
-void test__f_type_array_array_lengthss_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_array_lengthss_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_array_lengthss_t data = f_array_lengths_t_initialize;
*
* @see f_type_array_array_lengthss_decimate_by()
*/
-extern void test__f_type_array_array_lengthss_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_array_lengthss_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__array_lengthss_decimate_by
assert_null(data.array);
}
-void test__f_type_array_array_lengthss_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_array_lengthss_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_array_lengthss_t data = f_array_lengths_t_initialize;
*
* @see f_type_array_array_lengthss_decrease_by()
*/
-extern void test__f_type_array_array_lengthss_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_array_lengthss_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__array_lengthss_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_array_lengthss_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_array_lengthss_increase__parameter_checking(void **state) {
const int length = 5;
f_array_lengthss_t data = f_array_lengths_t_initialize;
*
* @see f_type_array_array_lengthss_increase()
*/
-extern void test__f_type_array_array_lengthss_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_array_lengthss_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__array_lengthss_increase
free((void *) data.array);
}
-void test__f_type_array_array_lengthss_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_array_lengthss_increase_by__parameter_checking(void **state) {
const int length = 5;
f_array_lengthss_t data = f_array_lengths_t_initialize;
*
* @see f_type_array_array_lengthss_increase_by()
*/
-extern void test__f_type_array_array_lengthss_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_array_lengthss_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__array_lengthss_increase_by
free((void *) data.array);
}
-void test__f_type_array_array_lengthss_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_array_lengthss_resize__parameter_checking(void **state) {
const int length = 5;
f_array_lengthss_t data = f_array_lengthss_t_initialize;
*
* @see f_type_array_array_lengthss_resize()
*/
-extern void test__f_type_array_array_lengthss_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_array_lengthss_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__array_lengthss_resize
free((void *) data.array);
}
-void test__f_type_array_cells_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_cells_adjust__parameter_checking(void **state) {
const int length = 5;
f_cells_t data = f_cells_t_initialize;
*
* @see f_type_array_cells_adjust()
*/
-extern void test__f_type_array_cells_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_cells_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__cells_adjust
void test__f_type_array_cells_append__works(void **state) {
- const int length = 5;
- f_cells_t source = f_cells_t_initialize;
+ const f_cell_t source = { .row = 1, .column = 2 };
f_cells_t destination = f_cells_t_initialize;
- const f_cell_t cell_0 = { .row = 1, .column = 2 };
- const f_cell_t cell_1 = { .row = 3, .column = 4 };
-
- {
- const f_status_t status = f_cells_resize(length, &source);
-
- assert_int_equal(status, F_none);
- assert_int_equal(source.used, 0);
- assert_int_equal(source.size, length);
- }
-
- memcpy(&source.array[source.used++], (void *) &cell_0, sizeof(f_cell_t));
- memcpy(&source.array[source.used++], (void *) &cell_1, sizeof(f_cell_t));
-
{
const f_status_t status = f_cells_append(source, &destination);
assert_int_equal(status, F_none);
- assert_int_equal(destination.used, source.used);
- assert_int_equal(destination.size, source.used);
-
- assert_int_equal(destination.array[0].row, cell_0.row);
- assert_int_equal(destination.array[0].column, cell_0.column);
-
- assert_int_equal(destination.array[1].row, cell_1.row);
- assert_int_equal(destination.array[1].column, cell_1.column);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].row, source.row);
+ assert_int_equal(destination.array[0].column, source.column);
}
- free((void *) source.array);
free((void *) destination.array);
}
-void test__f_type_array_cells_append__returns_data_not(void **state) {
+void test__f_type_array_cells_append__parameter_checking(void **state) {
- const int length = 5;
- f_cells_t source = f_cells_t_initialize;
- f_cells_t destination = f_cells_t_initialize;
-
- {
- const f_status_t status = f_cells_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_cells_append(source, &destination);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(destination.used, 0);
- assert_int_equal(destination.size, 0);
- }
-
- free((void *) source.array);
- assert_null(destination.array);
-}
-
-void test__f_type_array_cells_append__fails_on_invalid_parameter(void **state) {
-
- const int length = 5;
- f_cells_t data = f_cells_t_initialize;
+ const f_cell_t data = f_cell_t_initialize;
{
const f_status_t status = f_cells_append(data, 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 void test__f_type_array_cells_append__works(void **state);
/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_type_array_cells_append()
- */
-extern void test__f_type_array_cells_append__returns_data_not(void **state);
-
-/**
* Test that the function correctly fails on invalid parameter.
*
* @see f_type_array_cells_append()
*/
-extern void test__f_type_array_cells_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_cells_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__cells_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-cells_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_cells_append_all__works(void **state) {
+
+ const int length = 5;
+ f_cells_t source = f_cells_t_initialize;
+ f_cells_t destination = f_cells_t_initialize;
+
+ const f_cell_t cell_0 = { .row = 1, .column = 2 };
+ const f_cell_t cell_1 = { .row = 3, .column = 4 };
+
+ {
+ const f_status_t status = f_cells_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ memcpy(&source.array[source.used++], (void *) &cell_0, sizeof(f_cell_t));
+ memcpy(&source.array[source.used++], (void *) &cell_1, sizeof(f_cell_t));
+
+ {
+ const f_status_t status = f_cells_append_all(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+ assert_int_equal(destination.size, source.used);
+
+ assert_int_equal(destination.array[0].row, cell_0.row);
+ assert_int_equal(destination.array[0].column, cell_0.column);
+
+ assert_int_equal(destination.array[1].row, cell_1.row);
+ assert_int_equal(destination.array[1].column, cell_1.column);
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_cells_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_cells_t source = f_cells_t_initialize;
+ f_cells_t destination = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_cells_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_cells_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_type_array_cells_append_all__parameter_checking(void **state) {
+
+ const f_cells_t data = f_cells_t_initialize;
+
+ {
+ const f_status_t status = f_cells_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_type_array__cells_append_all
+#define _TEST__F_type_array__cells_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_cells_append_all()
+ */
+extern void test__f_type_array_cells_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_cells_append_all()
+ */
+extern void test__f_type_array_cells_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_cells_append_all()
+ */
+extern void test__f_type_array_cells_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__cells_append_all
assert_null(data.array);
}
-void test__f_type_array_cells_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_cells_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_cells_t data = f_cells_t_initialize;
*
* @see f_type_array_cells_decimate_by()
*/
-extern void test__f_type_array_cells_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_cells_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__cells_decimate_by
assert_null(data.array);
}
-void test__f_type_array_cells_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_cells_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_cells_t data = f_cells_t_initialize;
*
* @see f_type_array_cells_decrease_by()
*/
-extern void test__f_type_array_cells_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_cells_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__cells_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_cells_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_cells_increase__parameter_checking(void **state) {
const int length = 5;
f_cells_t data = f_cells_t_initialize;
*
* @see f_type_array_cells_increase()
*/
-extern void test__f_type_array_cells_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_cells_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__cells_increase
free((void *) data.array);
}
-void test__f_type_array_cells_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_cells_increase_by__parameter_checking(void **state) {
const int length = 5;
f_cells_t data = f_cells_t_initialize;
*
* @see f_type_array_cells_increase_by()
*/
-extern void test__f_type_array_cells_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_cells_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__cells_increase_by
free((void *) data.array);
}
-void test__f_type_array_cells_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_cells_resize__parameter_checking(void **state) {
const int length = 5;
f_cells_t data = f_cells_t_initialize;
*
* @see f_type_array_cells_resize()
*/
-extern void test__f_type_array_cells_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_cells_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__cells_resize
free((void *) data.array);
}
-void test__f_type_array_cellss_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_cellss_adjust__parameter_checking(void **state) {
const int length = 5;
f_cellss_t data = f_cellss_t_initialize;
*
* @see f_type_array_cellss_adjust()
*/
-extern void test__f_type_array_cellss_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_cellss_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__cellss_adjust
void test__f_type_array_cellss_append__works(void **state) {
const int length = 5;
- const int length_inner = 2;
- f_cellss_t source = f_cells_t_initialize;
- f_cellss_t destination = f_cells_t_initialize;
+ f_cells_t source = f_cells_t_initialize;
+ f_cellss_t destination = f_cellss_t_initialize;
- const f_cell_t cell_0 = { .row = 1, .column = 2 };
- const f_cell_t cell_1 = { .row = 3, .column = 4 };
+ const f_cell_t cell = { .row = 1, .column = 2 };
{
- const f_status_t status = f_cellss_resize(length, &source);
+ const f_status_t status = f_cells_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
assert_int_equal(source.size, length);
}
- {
- for (; source.used < length; ++source.used) {
-
- const f_status_t status = f_cells_resize(length_inner, &source.array[source.used]);
-
- assert_int_equal(status, F_none);
-
- memcpy(&source.array[source.used].array[source.array[source.used].used++], (void *) &cell_0, sizeof(f_cell_t));
- memcpy(&source.array[source.used].array[source.array[source.used].used++], (void *) &cell_1, sizeof(f_cell_t));
- } // for
- }
+ while (source.used < length) {
+ memcpy(&source.array[source.used++], (void *) &cell, sizeof(f_cell_t));
+ } // while
{
const f_status_t status = f_cellss_append(source, &destination);
assert_int_equal(status, F_none);
- assert_int_equal(destination.used, source.used);
- assert_int_equal(destination.size, source.used);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].used, source.used);
+ assert_int_equal(destination.array[0].size, source.used);
- for (f_array_length_t i = 0; i < destination.used; ++i) {
+ for (f_array_length_t i = 0; i < destination.array[0].used; ++i) {
- assert_int_equal(destination.array[i].used, length_inner);
- assert_int_equal(destination.array[i].size, length_inner);
-
- assert_int_equal(destination.array[i].array[0].row, cell_0.row);
- assert_int_equal(destination.array[i].array[0].column, cell_0.column);
-
- assert_int_equal(destination.array[i].array[1].row, cell_1.row);
- assert_int_equal(destination.array[i].array[1].column, cell_1.column);
+ assert_int_equal(destination.array[0].array[i].row, cell.row);
+ assert_int_equal(destination.array[0].array[i].column, cell.column);
} // for
}
- for (f_array_length_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].array);
- } // for
-
for (f_array_length_t i = 0; i < destination.used; ++i) {
free((void *) destination.array[i].array);
} // for
void test__f_type_array_cellss_append__returns_data_not(void **state) {
const int length = 5;
- f_cellss_t source = f_cells_t_initialize;
- f_cellss_t destination = f_cells_t_initialize;
+ f_cells_t source = f_cellss_t_initialize;
+ f_cellss_t destination = f_cellss_t_initialize;
{
- const f_status_t status = f_cellss_resize(length, &source);
+ const f_status_t status = f_cells_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
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);
- assert_null(destination.array);
}
-void test__f_type_array_cellss_append__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_cellss_append__parameter_checking(void **state) {
- const int length = 5;
- f_cellss_t data = f_cells_t_initialize;
+ f_cells_t data = f_cells_t_initialize;
{
const f_status_t status = f_cellss_append(data, 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
*
* @see f_type_array_cellss_append()
*/
-extern void test__f_type_array_cellss_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_cellss_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__cellss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-cellss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_cellss_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_cellss_t source = f_cellss_t_initialize;
+ f_cellss_t destination = f_cellss_t_initialize;
+
+ const f_cell_t cell_0 = { .row = 1, .column = 2 };
+ const f_cell_t cell_1 = { .row = 3, .column = 4 };
+
+ {
+ const f_status_t status = f_cellss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_cells_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ memcpy(&source.array[source.used].array[source.array[source.used].used++], (void *) &cell_0, sizeof(f_cell_t));
+ memcpy(&source.array[source.used].array[source.array[source.used].used++], (void *) &cell_1, sizeof(f_cell_t));
+ } // for
+ }
+
+ {
+ const f_status_t status = f_cellss_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 < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ assert_int_equal(destination.array[i].array[0].row, cell_0.row);
+ assert_int_equal(destination.array[i].array[0].column, cell_0.column);
+
+ assert_int_equal(destination.array[i].array[1].row, cell_1.row);
+ assert_int_equal(destination.array[i].array[1].column, cell_1.column);
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_cellss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_cellss_t source = f_cellss_t_initialize;
+ f_cellss_t destination = f_cellss_t_initialize;
+
+ {
+ const f_status_t status = f_cellss_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_cellss_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_type_array_cellss_append_all__parameter_checking(void **state) {
+
+ const f_cellss_t data = f_cellss_t_initialize;
+
+ {
+ const f_status_t status = f_cellss_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_type_array__cellss_append_all
+#define _TEST__F_type_array__cellss_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_cellss_append_all()
+ */
+extern void test__f_type_array_cellss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_cellss_append_all()
+ */
+extern void test__f_type_array_cellss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_cellss_append_all()
+ */
+extern void test__f_type_array_cellss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__cellss_append_all
assert_null(data.array);
}
-void test__f_type_array_cellss_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_cellss_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_cellss_t data = f_cells_t_initialize;
*
* @see f_type_array_cellss_decimate_by()
*/
-extern void test__f_type_array_cellss_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_cellss_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__cellss_decimate_by
assert_null(data.array);
}
-void test__f_type_array_cellss_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_cellss_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_cellss_t data = f_cells_t_initialize;
*
* @see f_type_array_cellss_decrease_by()
*/
-extern void test__f_type_array_cellss_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_cellss_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__cellss_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_cellss_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_cellss_increase__parameter_checking(void **state) {
const int length = 5;
f_cellss_t data = f_cells_t_initialize;
*
* @see f_type_array_cellss_increase()
*/
-extern void test__f_type_array_cellss_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_cellss_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__cellss_increase
free((void *) data.array);
}
-void test__f_type_array_cellss_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_cellss_increase_by__parameter_checking(void **state) {
const int length = 5;
f_cellss_t data = f_cells_t_initialize;
*
* @see f_type_array_cellss_increase_by()
*/
-extern void test__f_type_array_cellss_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_cellss_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__cellss_increase_by
free((void *) data.array);
}
-void test__f_type_array_cellss_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_cellss_resize__parameter_checking(void **state) {
const int length = 5;
f_cellss_t data = f_cellss_t_initialize;
*
* @see f_type_array_cellss_resize()
*/
-extern void test__f_type_array_cellss_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_cellss_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__cellss_resize
free((void *) data.array);
}
-void test__f_type_array_fll_ids_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_fll_ids_adjust__parameter_checking(void **state) {
const int length = 5;
f_fll_ids_t data = f_fll_ids_t_initialize;
*
* @see f_type_array_fll_ids_adjust()
*/
-extern void test__f_type_array_fll_ids_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_fll_ids_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__fll_ids_adjust
void test__f_type_array_fll_ids_append__works(void **state) {
const int length = 5;
- f_fll_ids_t source = f_fll_ids_t_initialize;
+ const f_fll_id_t source = { .name = "test", .type = 1, .used = 4 };
f_fll_ids_t destination = f_fll_ids_t_initialize;
- const f_fll_id_t fll_id_0 = { .name = "test", .type = 1, .used = 4 };
- const f_fll_id_t fll_id_1 = { .name = "other", .type = 2, .used = 5 };
-
- {
- const f_status_t status = f_fll_ids_resize(length, &source);
-
- assert_int_equal(status, F_none);
- assert_int_equal(source.used, 0);
- assert_int_equal(source.size, length);
- }
-
- memcpy(&source.array[source.used++], (void *) &fll_id_0, sizeof(f_fll_id_t));
- memcpy(&source.array[source.used++], (void *) &fll_id_1, sizeof(f_fll_id_t));
-
{
const f_status_t status = f_fll_ids_append(source, &destination);
assert_int_equal(status, F_none);
- assert_int_equal(destination.used, source.used);
- assert_int_equal(destination.size, source.used);
-
- assert_string_equal(destination.array[0].name, fll_id_0.name);
- assert_int_equal(destination.array[0].type, fll_id_0.type);
- assert_int_equal(destination.array[0].used, fll_id_0.used);
-
- assert_string_equal(destination.array[1].name, fll_id_1.name);
- assert_int_equal(destination.array[1].type, fll_id_1.type);
- assert_int_equal(destination.array[1].used, fll_id_1.used);
+ assert_int_equal(destination.used, 1);
+ assert_string_equal(destination.array[0].name, source.name);
+ assert_int_equal(destination.array[0].type, source.type);
+ assert_int_equal(destination.array[0].used, source.used);
}
- free((void *) source.array);
free((void *) destination.array);
}
-void test__f_type_array_fll_ids_append__returns_data_not(void **state) {
+void test__f_type_array_fll_ids_append__parameter_checking(void **state) {
- const int length = 5;
- f_fll_ids_t source = f_fll_ids_t_initialize;
- f_fll_ids_t destination = f_fll_ids_t_initialize;
-
- {
- const f_status_t status = f_fll_ids_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_fll_ids_append(source, &destination);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(destination.used, 0);
- assert_int_equal(destination.size, 0);
- }
-
- free((void *) source.array);
- assert_null(destination.array);
-}
-
-void test__f_type_array_fll_ids_append__fails_on_invalid_parameter(void **state) {
-
- const int length = 5;
- f_fll_ids_t data = f_fll_ids_t_initialize;
+ const f_fll_id_t data = f_fll_id_t_initialize;
{
const f_status_t status = f_fll_ids_append(data, 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 void test__f_type_array_fll_ids_append__works(void **state);
/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_type_array_fll_ids_append()
- */
-extern void test__f_type_array_fll_ids_append__returns_data_not(void **state);
-
-/**
* Test that the function correctly fails on invalid parameter.
*
* @see f_type_array_fll_ids_append()
*/
-extern void test__f_type_array_fll_ids_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_fll_ids_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__fll_ids_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-fll_ids_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_fll_ids_append_all__works(void **state) {
+
+ const int length = 5;
+ f_fll_ids_t source = f_fll_ids_t_initialize;
+ f_fll_ids_t destination = f_fll_ids_t_initialize;
+
+ const f_fll_id_t fll_id_0 = { .name = "test", .type = 1, .used = 4 };
+ const f_fll_id_t fll_id_1 = { .name = "other", .type = 2, .used = 5 };
+
+ {
+ const f_status_t status = f_fll_ids_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ memcpy(&source.array[source.used++], (void *) &fll_id_0, sizeof(f_fll_id_t));
+ memcpy(&source.array[source.used++], (void *) &fll_id_1, sizeof(f_fll_id_t));
+
+ {
+ const f_status_t status = f_fll_ids_append_all(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+ assert_int_equal(destination.size, source.used);
+
+ assert_string_equal(destination.array[0].name, fll_id_0.name);
+ assert_int_equal(destination.array[0].type, fll_id_0.type);
+ assert_int_equal(destination.array[0].used, fll_id_0.used);
+
+ assert_string_equal(destination.array[1].name, fll_id_1.name);
+ assert_int_equal(destination.array[1].type, fll_id_1.type);
+ assert_int_equal(destination.array[1].used, fll_id_1.used);
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_fll_ids_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_fll_ids_t source = f_fll_ids_t_initialize;
+ f_fll_ids_t destination = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_fll_ids_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_fll_ids_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_type_array_fll_ids_append_all__parameter_checking(void **state) {
+
+ const f_fll_ids_t data = f_fll_ids_t_initialize;
+
+ {
+ const f_status_t status = f_fll_ids_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_type_array__fll_ids_append_all
+#define _TEST__F_type_array__fll_ids_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_fll_ids_append_all()
+ */
+extern void test__f_type_array_fll_ids_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_fll_ids_append_all()
+ */
+extern void test__f_type_array_fll_ids_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_fll_ids_append_all()
+ */
+extern void test__f_type_array_fll_ids_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__fll_ids_append_all
assert_null(data.array);
}
-void test__f_type_array_fll_ids_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_fll_ids_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_fll_ids_t data = f_fll_ids_t_initialize;
*
* @see f_type_array_fll_ids_decimate_by()
*/
-extern void test__f_type_array_fll_ids_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_fll_ids_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__fll_ids_decimate_by
assert_null(data.array);
}
-void test__f_type_array_fll_ids_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_fll_ids_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_fll_ids_t data = f_fll_ids_t_initialize;
*
* @see f_type_array_fll_ids_decrease_by()
*/
-extern void test__f_type_array_fll_ids_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_fll_ids_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__fll_ids_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_fll_ids_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_fll_ids_increase__parameter_checking(void **state) {
const int length = 5;
f_fll_ids_t data = f_fll_ids_t_initialize;
*
* @see f_type_array_fll_ids_increase()
*/
-extern void test__f_type_array_fll_ids_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_fll_ids_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__fll_ids_increase
free((void *) data.array);
}
-void test__f_type_array_fll_ids_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_fll_ids_increase_by__parameter_checking(void **state) {
const int length = 5;
f_fll_ids_t data = f_fll_ids_t_initialize;
*
* @see f_type_array_fll_ids_increase_by()
*/
-extern void test__f_type_array_fll_ids_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_fll_ids_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__fll_ids_increase_by
free((void *) data.array);
}
-void test__f_type_array_fll_ids_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_fll_ids_resize__parameter_checking(void **state) {
const int length = 5;
f_fll_ids_t data = f_fll_ids_t_initialize;
*
* @see f_type_array_fll_ids_resize()
*/
-extern void test__f_type_array_fll_ids_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_fll_ids_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__fll_ids_resize
free((void *) data.array);
}
-void test__f_type_array_fll_idss_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_fll_idss_adjust__parameter_checking(void **state) {
const int length = 5;
f_fll_idss_t data = f_fll_idss_t_initialize;
*
* @see f_type_array_fll_idss_adjust()
*/
-extern void test__f_type_array_fll_idss_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_fll_idss_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__fll_idss_adjust
void test__f_type_array_fll_idss_append__works(void **state) {
const int length = 5;
- const int length_inner = 2;
- f_fll_idss_t source = f_fll_ids_t_initialize;
- f_fll_idss_t destination = f_fll_ids_t_initialize;
+ f_fll_ids_t source = f_fll_ids_t_initialize;
+ f_fll_idss_t destination = f_fll_idss_t_initialize;
- const f_fll_id_t fll_id_0 = { .name = "test", .type = 1, .used = 4 };
- const f_fll_id_t fll_id_1 = { .name = "other", .type = 2, .used = 5 };
+ const f_fll_id_t fll_id = { .name = "test", .type = 1, .used = 4 };
{
- const f_status_t status = f_fll_idss_resize(length, &source);
+ const f_status_t status = f_fll_ids_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
assert_int_equal(source.size, length);
}
- {
- for (; source.used < length; ++source.used) {
-
- const f_status_t status = f_fll_ids_resize(length_inner, &source.array[source.used]);
-
- assert_int_equal(status, F_none);
-
- memcpy(&source.array[source.used].array[source.array[source.used].used++], (void *) &fll_id_0, sizeof(f_fll_id_t));
- memcpy(&source.array[source.used].array[source.array[source.used].used++], (void *) &fll_id_1, sizeof(f_fll_id_t));
- } // for
- }
+ while (source.used < length) {
+ memcpy(&source.array[source.used++], (void *) &fll_id, sizeof(f_fll_id_t));
+ } // while
{
const f_status_t status = f_fll_idss_append(source, &destination);
assert_int_equal(status, F_none);
- assert_int_equal(destination.used, source.used);
- assert_int_equal(destination.size, source.used);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].used, source.used);
+ assert_int_equal(destination.array[0].size, source.used);
- for (f_array_length_t i = 0; i < destination.used; ++i) {
+ for (f_array_length_t i = 0; i < destination.array[0].used; ++i) {
- assert_int_equal(destination.array[i].used, length_inner);
- assert_int_equal(destination.array[i].size, length_inner);
-
- assert_string_equal(destination.array[i].array[0].name, fll_id_0.name);
- assert_int_equal(destination.array[i].array[0].type, fll_id_0.type);
- assert_int_equal(destination.array[i].array[0].used, fll_id_0.used);
-
- assert_string_equal(destination.array[i].array[1].name, fll_id_1.name);
- assert_int_equal(destination.array[i].array[1].type, fll_id_1.type);
- assert_int_equal(destination.array[i].array[1].used, fll_id_1.used);
+ assert_string_equal(destination.array[0].array[i].name, fll_id.name);
+ assert_int_equal(destination.array[0].array[i].type, fll_id.type);
+ assert_int_equal(destination.array[0].array[i].used, fll_id.used);
} // for
}
- for (f_array_length_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].array);
- } // for
-
for (f_array_length_t i = 0; i < destination.used; ++i) {
free((void *) destination.array[i].array);
} // for
void test__f_type_array_fll_idss_append__returns_data_not(void **state) {
const int length = 5;
- f_fll_idss_t source = f_fll_ids_t_initialize;
- f_fll_idss_t destination = f_fll_ids_t_initialize;
+ f_fll_ids_t source = f_fll_idss_t_initialize;
+ f_fll_idss_t destination = f_fll_idss_t_initialize;
{
- const f_status_t status = f_fll_idss_resize(length, &source);
+ const f_status_t status = f_fll_ids_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
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);
- assert_null(destination.array);
}
-void test__f_type_array_fll_idss_append__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_fll_idss_append__parameter_checking(void **state) {
- const int length = 5;
- f_fll_idss_t data = f_fll_ids_t_initialize;
+ f_fll_ids_t data = f_fll_ids_t_initialize;
{
const f_status_t status = f_fll_idss_append(data, 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
*
* @see f_type_array_fll_idss_append()
*/
-extern void test__f_type_array_fll_idss_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_fll_idss_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__fll_idss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-fll_idss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_fll_idss_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_fll_idss_t source = f_fll_idss_t_initialize;
+ f_fll_idss_t destination = f_fll_idss_t_initialize;
+
+ const f_fll_id_t fll_id_0 = { .name = "test", .type = 1, .used = 4 };
+ const f_fll_id_t fll_id_1 = { .name = "other", .type = 2, .used = 5 };
+
+ {
+ const f_status_t status = f_fll_idss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_fll_ids_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ memcpy(&source.array[source.used].array[source.array[source.used].used++], (void *) &fll_id_0, sizeof(f_fll_id_t));
+ memcpy(&source.array[source.used].array[source.array[source.used].used++], (void *) &fll_id_1, sizeof(f_fll_id_t));
+ } // for
+ }
+
+ {
+ const f_status_t status = f_fll_idss_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 < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ assert_string_equal(destination.array[i].array[0].name, fll_id_0.name);
+ assert_int_equal(destination.array[i].array[0].type, fll_id_0.type);
+ assert_int_equal(destination.array[i].array[0].used, fll_id_0.used);
+
+ assert_string_equal(destination.array[i].array[1].name, fll_id_1.name);
+ assert_int_equal(destination.array[i].array[1].type, fll_id_1.type);
+ assert_int_equal(destination.array[i].array[1].used, fll_id_1.used);
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_fll_idss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_fll_idss_t source = f_fll_idss_t_initialize;
+ f_fll_idss_t destination = f_fll_idss_t_initialize;
+
+ {
+ const f_status_t status = f_fll_idss_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_fll_idss_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_type_array_fll_idss_append_all__parameter_checking(void **state) {
+
+ const f_fll_idss_t data = f_fll_idss_t_initialize;
+
+ {
+ const f_status_t status = f_fll_idss_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_type_array__fll_idss_append_all
+#define _TEST__F_type_array__fll_idss_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_fll_idss_append_all()
+ */
+extern void test__f_type_array_fll_idss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_fll_idss_append_all()
+ */
+extern void test__f_type_array_fll_idss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_fll_idss_append_all()
+ */
+extern void test__f_type_array_fll_idss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__fll_idss_append_all
assert_null(data.array);
}
-void test__f_type_array_fll_idss_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_fll_idss_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_fll_idss_t data = f_fll_ids_t_initialize;
*
* @see f_type_array_fll_idss_decimate_by()
*/
-extern void test__f_type_array_fll_idss_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_fll_idss_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__fll_idss_decimate_by
assert_null(data.array);
}
-void test__f_type_array_fll_idss_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_fll_idss_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_fll_idss_t data = f_fll_ids_t_initialize;
*
* @see f_type_array_fll_idss_decrease_by()
*/
-extern void test__f_type_array_fll_idss_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_fll_idss_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__fll_idss_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_fll_idss_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_fll_idss_increase__parameter_checking(void **state) {
const int length = 5;
f_fll_idss_t data = f_fll_ids_t_initialize;
*
* @see f_type_array_fll_idss_increase()
*/
-extern void test__f_type_array_fll_idss_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_fll_idss_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__fll_idss_increase
free((void *) data.array);
}
-void test__f_type_array_fll_idss_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_fll_idss_increase_by__parameter_checking(void **state) {
const int length = 5;
f_fll_idss_t data = f_fll_ids_t_initialize;
*
* @see f_type_array_fll_idss_increase_by()
*/
-extern void test__f_type_array_fll_idss_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_fll_idss_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__fll_idss_increase_by
free((void *) data.array);
}
-void test__f_type_array_fll_idss_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_fll_idss_resize__parameter_checking(void **state) {
const int length = 5;
f_fll_idss_t data = f_fll_idss_t_initialize;
*
* @see f_type_array_fll_idss_resize()
*/
-extern void test__f_type_array_fll_idss_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_fll_idss_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__fll_idss_resize
free((void *) data.array);
}
-void test__f_type_array_int128s_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int128s_adjust__parameter_checking(void **state) {
const int length = 5;
f_int128s_t data = f_int128s_t_initialize;
*
* @see f_type_array_int128s_adjust()
*/
-extern void test__f_type_array_int128s_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int128s_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__int128s_adjust
void test__f_type_array_int128s_append__works(void **state) {
- const int length = 5;
- const int length_used = 2;
- f_int128s_t source = f_int128s_t_initialize;
+ const int128_t source = 3;
f_int128s_t destination = f_int128s_t_initialize;
{
- const f_status_t status = f_int128s_resize(length, &source);
-
- assert_int_equal(status, F_none);
- assert_int_equal(source.used, 0);
- assert_int_equal(source.size, length);
- }
-
- for (; source.used < length_used; ++source.used) {
- source.array[source.used] = source.used + 1;
- } // for
-
- {
const f_status_t status = f_int128s_append(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 < source.used; ++i) {
- assert_int_equal(destination.array[i], i + 1);
- } // for
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0], source);
}
- free((void *) source.array);
free((void *) destination.array);
}
-void test__f_type_array_int128s_append__returns_data_not(void **state) {
+void test__f_type_array_int128s_append__parameter_checking(void **state) {
- const int length = 5;
- f_int128s_t source = f_int128s_t_initialize;
- f_int128s_t destination = f_int128s_t_initialize;
-
- {
- const f_status_t status = f_int128s_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_int128s_append(source, &destination);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(destination.used, 0);
- assert_int_equal(destination.size, 0);
- }
-
- free((void *) source.array);
- assert_null(destination.array);
-}
-
-void test__f_type_array_int128s_append__fails_on_invalid_parameter(void **state) {
-
- const int length = 5;
- f_int128s_t data = f_int128s_t_initialize;
+ const uint128_t data = 0;
{
const f_status_t status = f_int128s_append(data, 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 void test__f_type_array_int128s_append__works(void **state);
/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_type_array_int128s_append()
- */
-extern void test__f_type_array_int128s_append__returns_data_not(void **state);
-
-/**
* Test that the function correctly fails on invalid parameter.
*
* @see f_type_array_int128s_append()
*/
-extern void test__f_type_array_int128s_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int128s_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__int128s_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-int128s_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_int128s_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_used = 2;
+ f_int128s_t source = f_int128s_t_initialize;
+ f_int128s_t destination = f_int128s_t_initialize;
+
+ {
+ const f_status_t status = f_int128s_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ for (; source.used < length_used; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
+
+ {
+ const f_status_t status = f_int128s_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 < source.used; ++i) {
+ assert_int_equal(destination.array[i], i + 1);
+ } // for
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_int128s_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_int128s_t source = f_int128s_t_initialize;
+ f_int128s_t destination = f_int128s_t_initialize;
+
+ {
+ const f_status_t status = f_int128s_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_int128s_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_type_array_int128s_append_all__parameter_checking(void **state) {
+
+ const f_int128s_t data = f_int128s_t_initialize;
+
+ {
+ const f_status_t status = f_int128s_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_type_array__int128s_append_all
+#define _TEST__F_type_array__int128s_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_int128s_append_all()
+ */
+extern void test__f_type_array_int128s_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_int128s_append_all()
+ */
+extern void test__f_type_array_int128s_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_int128s_append_all()
+ */
+extern void test__f_type_array_int128s_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__int128s_append_all
assert_null(data.array);
}
-void test__f_type_array_int128s_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int128s_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_int128s_t data = f_int128s_t_initialize;
*
* @see f_type_array_int128s_decimate_by()
*/
-extern void test__f_type_array_int128s_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int128s_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int128s_decimate_by
assert_null(data.array);
}
-void test__f_type_array_int128s_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int128s_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_int128s_t data = f_int128s_t_initialize;
*
* @see f_type_array_int128s_decrease_by()
*/
-extern void test__f_type_array_int128s_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int128s_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int128s_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_int128s_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int128s_increase__parameter_checking(void **state) {
const int length = 5;
f_int128s_t data = f_int128s_t_initialize;
*
* @see f_type_array_int128s_increase()
*/
-extern void test__f_type_array_int128s_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int128s_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__int128s_increase
free((void *) data.array);
}
-void test__f_type_array_int128s_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int128s_increase_by__parameter_checking(void **state) {
const int length = 5;
f_int128s_t data = f_int128s_t_initialize;
*
* @see f_type_array_int128s_increase_by()
*/
-extern void test__f_type_array_int128s_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int128s_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int128s_increase_by
free((void *) data.array);
}
-void test__f_type_array_int128s_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int128s_resize__parameter_checking(void **state) {
const int length = 5;
f_int128s_t data = f_int128s_t_initialize;
*
* @see f_type_array_int128s_resize()
*/
-extern void test__f_type_array_int128s_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int128s_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__int128s_resize
free((void *) data.array);
}
-void test__f_type_array_int128ss_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int128ss_adjust__parameter_checking(void **state) {
const int length = 5;
f_int128ss_t data = f_int128ss_t_initialize;
*
* @see f_type_array_int128ss_adjust()
*/
-extern void test__f_type_array_int128ss_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int128ss_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__int128ss_adjust
void test__f_type_array_int128ss_append__works(void **state) {
const int length = 5;
- const int length_inner = 2;
- f_int128ss_t source = f_int128s_t_initialize;
- f_int128ss_t destination = f_int128s_t_initialize;
+ f_int128s_t source = f_int128s_t_initialize;
+ f_int128ss_t destination = f_int128ss_t_initialize;
{
- const f_status_t status = f_int128ss_resize(length, &source);
+ const f_status_t status = f_int128s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
assert_int_equal(source.size, length);
}
- {
- for (; source.used < length; ++source.used) {
-
- const f_status_t status = f_int128s_resize(length_inner, &source.array[source.used]);
-
- assert_int_equal(status, F_none);
-
- for (f_array_length_t i = 0; i < length_inner; ++i) {
- source.array[source.used].array[source.array[source.used].used++] = i + 1;
- } // for
- } // for
- }
+ for (; source.used < length; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
{
const f_status_t status = f_int128ss_append(source, &destination);
assert_int_equal(status, F_none);
- assert_int_equal(destination.used, source.used);
- assert_int_equal(destination.size, source.used);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].used, source.used);
+ assert_int_equal(destination.array[0].size, source.used);
- for (f_array_length_t i = 0; i < destination.used; ++i) {
-
- assert_int_equal(destination.array[i].used, length_inner);
- assert_int_equal(destination.array[i].size, length_inner);
-
- for (f_array_length_t j = 0; j < length_inner; ++j) {
- assert_int_equal(destination.array[i].array[j], j + 1);
- } // for
+ for (f_array_length_t i = 0; i < destination.array[0].used; ++i) {
+ assert_int_equal(destination.array[0].array[i], i + 1);
} // for
}
- for (f_array_length_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].array);
- } // for
-
for (f_array_length_t i = 0; i < destination.used; ++i) {
free((void *) destination.array[i].array);
} // for
void test__f_type_array_int128ss_append__returns_data_not(void **state) {
const int length = 5;
- f_int128ss_t source = f_int128s_t_initialize;
- f_int128ss_t destination = f_int128s_t_initialize;
+ f_int128s_t source = f_int128s_t_initialize;
+ f_int128ss_t destination = f_int128ss_t_initialize;
{
- const f_status_t status = f_int128ss_resize(length, &source);
+ const f_status_t status = f_int128s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
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);
- assert_null(destination.array);
}
-void test__f_type_array_int128ss_append__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int128ss_append__parameter_checking(void **state) {
- const int length = 5;
- f_int128ss_t data = f_int128s_t_initialize;
+ f_int128s_t data = f_int128s_t_initialize;
{
const f_status_t status = f_int128ss_append(data, 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
*
* @see f_type_array_int128ss_append()
*/
-extern void test__f_type_array_int128ss_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int128ss_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__int128ss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-int128ss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_int128ss_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_int128ss_t source = f_int128ss_t_initialize;
+ f_int128ss_t destination = f_int128ss_t_initialize;
+
+ {
+ const f_status_t status = f_int128ss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_int128s_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ for (f_array_length_t i = 0; i < length_inner; ++i) {
+ source.array[source.used].array[source.array[source.used].used++] = i + 1;
+ } // for
+ } // for
+ }
+
+ {
+ const f_status_t status = f_int128ss_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 < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ for (f_array_length_t j = 0; j < length_inner; ++j) {
+ assert_int_equal(destination.array[i].array[j], j + 1);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_int128ss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_int128ss_t source = f_int128ss_t_initialize;
+ f_int128ss_t destination = f_int128ss_t_initialize;
+
+ {
+ const f_status_t status = f_int128ss_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_int128ss_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_type_array_int128ss_append_all__parameter_checking(void **state) {
+
+ const f_int128ss_t data = f_int128ss_t_initialize;
+
+ {
+ const f_status_t status = f_int128ss_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_type_array__int128ss_append_all
+#define _TEST__F_type_array__int128ss_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_int128ss_append_all()
+ */
+extern void test__f_type_array_int128ss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_int128ss_append_all()
+ */
+extern void test__f_type_array_int128ss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_int128ss_append_all()
+ */
+extern void test__f_type_array_int128ss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__int128ss_append_all
assert_null(data.array);
}
-void test__f_type_array_int128ss_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int128ss_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_int128ss_t data = f_int128s_t_initialize;
*
* @see f_type_array_int128ss_decimate_by()
*/
-extern void test__f_type_array_int128ss_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int128ss_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int128ss_decimate_by
assert_null(data.array);
}
-void test__f_type_array_int128ss_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int128ss_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_int128ss_t data = f_int128s_t_initialize;
*
* @see f_type_array_int128ss_decrease_by()
*/
-extern void test__f_type_array_int128ss_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int128ss_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int128ss_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_int128ss_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int128ss_increase__parameter_checking(void **state) {
const int length = 5;
f_int128ss_t data = f_int128s_t_initialize;
*
* @see f_type_array_int128ss_increase()
*/
-extern void test__f_type_array_int128ss_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int128ss_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__int128ss_increase
free((void *) data.array);
}
-void test__f_type_array_int128ss_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int128ss_increase_by__parameter_checking(void **state) {
const int length = 5;
f_int128ss_t data = f_int128s_t_initialize;
*
* @see f_type_array_int128ss_increase_by()
*/
-extern void test__f_type_array_int128ss_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int128ss_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int128ss_increase_by
free((void *) data.array);
}
-void test__f_type_array_int128ss_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int128ss_resize__parameter_checking(void **state) {
const int length = 5;
f_int128ss_t data = f_int128ss_t_initialize;
*
* @see f_type_array_int128ss_resize()
*/
-extern void test__f_type_array_int128ss_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int128ss_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__int128ss_resize
free((void *) data.array);
}
-void test__f_type_array_int16s_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int16s_adjust__parameter_checking(void **state) {
const int length = 5;
f_int16s_t data = f_int16s_t_initialize;
*
* @see f_type_array_int16s_adjust()
*/
-extern void test__f_type_array_int16s_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int16s_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__int16s_adjust
void test__f_type_array_int16s_append__works(void **state) {
- const int length = 5;
- const int length_used = 2;
- f_int16s_t source = f_int16s_t_initialize;
+ const uint16_t source = 3;
f_int16s_t destination = f_int16s_t_initialize;
{
- const f_status_t status = f_int16s_resize(length, &source);
-
- assert_int_equal(status, F_none);
- assert_int_equal(source.used, 0);
- assert_int_equal(source.size, length);
- }
-
- for (; source.used < length_used; ++source.used) {
- source.array[source.used] = source.used + 1;
- } // for
-
- {
const f_status_t status = f_int16s_append(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 < source.used; ++i) {
- assert_int_equal(destination.array[i], i + 1);
- } // for
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0], source);
}
- free((void *) source.array);
free((void *) destination.array);
}
-void test__f_type_array_int16s_append__returns_data_not(void **state) {
+void test__f_type_array_int16s_append__parameter_checking(void **state) {
- const int length = 5;
- f_int16s_t source = f_int16s_t_initialize;
- f_int16s_t destination = f_int16s_t_initialize;
-
- {
- const f_status_t status = f_int16s_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_int16s_append(source, &destination);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(destination.used, 0);
- assert_int_equal(destination.size, 0);
- }
-
- free((void *) source.array);
- assert_null(destination.array);
-}
-
-void test__f_type_array_int16s_append__fails_on_invalid_parameter(void **state) {
-
- const int length = 5;
- f_int16s_t data = f_int16s_t_initialize;
+ const uint16_t data = 0;
{
const f_status_t status = f_int16s_append(data, 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 void test__f_type_array_int16s_append__works(void **state);
/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_type_array_int16s_append()
- */
-extern void test__f_type_array_int16s_append__returns_data_not(void **state);
-
-/**
* Test that the function correctly fails on invalid parameter.
*
* @see f_type_array_int16s_append()
*/
-extern void test__f_type_array_int16s_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int16s_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__int16s_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-int16s_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_int16s_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_used = 2;
+ f_int16s_t source = f_int16s_t_initialize;
+ f_int16s_t destination = f_int16s_t_initialize;
+
+ {
+ const f_status_t status = f_int16s_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ for (; source.used < length_used; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
+
+ {
+ const f_status_t status = f_int16s_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 < source.used; ++i) {
+ assert_int_equal(destination.array[i], i + 1);
+ } // for
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_int16s_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_int16s_t source = f_int16s_t_initialize;
+ f_int16s_t destination = f_int16s_t_initialize;
+
+ {
+ const f_status_t status = f_int16s_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_int16s_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_type_array_int16s_append_all__parameter_checking(void **state) {
+
+ const f_int16s_t data = f_int16s_t_initialize;
+
+ {
+ const f_status_t status = f_int16s_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_type_array__int16s_append_all
+#define _TEST__F_type_array__int16s_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_int16s_append_all()
+ */
+extern void test__f_type_array_int16s_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_int16s_append_all()
+ */
+extern void test__f_type_array_int16s_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_int16s_append_all()
+ */
+extern void test__f_type_array_int16s_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__int16s_append_all
assert_null(data.array);
}
-void test__f_type_array_int16s_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int16s_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_int16s_t data = f_int16s_t_initialize;
*
* @see f_type_array_int16s_decimate_by()
*/
-extern void test__f_type_array_int16s_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int16s_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int16s_decimate_by
assert_null(data.array);
}
-void test__f_type_array_int16s_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int16s_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_int16s_t data = f_int16s_t_initialize;
*
* @see f_type_array_int16s_decrease_by()
*/
-extern void test__f_type_array_int16s_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int16s_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int16s_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_int16s_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int16s_increase__parameter_checking(void **state) {
const int length = 5;
f_int16s_t data = f_int16s_t_initialize;
*
* @see f_type_array_int16s_increase()
*/
-extern void test__f_type_array_int16s_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int16s_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__int16s_increase
free((void *) data.array);
}
-void test__f_type_array_int16s_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int16s_increase_by__parameter_checking(void **state) {
const int length = 5;
f_int16s_t data = f_int16s_t_initialize;
*
* @see f_type_array_int16s_increase_by()
*/
-extern void test__f_type_array_int16s_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int16s_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int16s_increase_by
free((void *) data.array);
}
-void test__f_type_array_int16s_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int16s_resize__parameter_checking(void **state) {
const int length = 5;
f_int16s_t data = f_int16s_t_initialize;
*
* @see f_type_array_int16s_resize()
*/
-extern void test__f_type_array_int16s_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int16s_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__int16s_resize
free((void *) data.array);
}
-void test__f_type_array_int16ss_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int16ss_adjust__parameter_checking(void **state) {
const int length = 5;
f_int16ss_t data = f_int16ss_t_initialize;
*
* @see f_type_array_int16ss_adjust()
*/
-extern void test__f_type_array_int16ss_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int16ss_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__int16ss_adjust
void test__f_type_array_int16ss_append__works(void **state) {
const int length = 5;
- const int length_inner = 2;
- f_int16ss_t source = f_int16s_t_initialize;
- f_int16ss_t destination = f_int16s_t_initialize;
+ f_int16s_t source = f_int16s_t_initialize;
+ f_int16ss_t destination = f_int16ss_t_initialize;
{
- const f_status_t status = f_int16ss_resize(length, &source);
+ const f_status_t status = f_int16s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
assert_int_equal(source.size, length);
}
- {
- for (; source.used < length; ++source.used) {
-
- const f_status_t status = f_int16s_resize(length_inner, &source.array[source.used]);
-
- assert_int_equal(status, F_none);
-
- for (f_array_length_t i = 0; i < length_inner; ++i) {
- source.array[source.used].array[source.array[source.used].used++] = i + 1;
- } // for
- } // for
- }
+ for (; source.used < length; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
{
const f_status_t status = f_int16ss_append(source, &destination);
assert_int_equal(status, F_none);
- assert_int_equal(destination.used, source.used);
- assert_int_equal(destination.size, source.used);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].used, source.used);
+ assert_int_equal(destination.array[0].size, source.used);
- for (f_array_length_t i = 0; i < destination.used; ++i) {
-
- assert_int_equal(destination.array[i].used, length_inner);
- assert_int_equal(destination.array[i].size, length_inner);
-
- for (f_array_length_t j = 0; j < length_inner; ++j) {
- assert_int_equal(destination.array[i].array[j], j + 1);
- } // for
+ for (f_array_length_t i = 0; i < destination.array[0].used; ++i) {
+ assert_int_equal(destination.array[0].array[i], i + 1);
} // for
}
- for (f_array_length_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].array);
- } // for
-
for (f_array_length_t i = 0; i < destination.used; ++i) {
free((void *) destination.array[i].array);
} // for
void test__f_type_array_int16ss_append__returns_data_not(void **state) {
const int length = 5;
- f_int16ss_t source = f_int16s_t_initialize;
- f_int16ss_t destination = f_int16s_t_initialize;
+ f_int16s_t source = f_int16s_t_initialize;
+ f_int16ss_t destination = f_int16ss_t_initialize;
{
- const f_status_t status = f_int16ss_resize(length, &source);
+ const f_status_t status = f_int16s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
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);
- assert_null(destination.array);
}
-void test__f_type_array_int16ss_append__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int16ss_append__parameter_checking(void **state) {
- const int length = 5;
- f_int16ss_t data = f_int16s_t_initialize;
+ f_int16s_t data = f_int16s_t_initialize;
{
const f_status_t status = f_int16ss_append(data, 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
*
* @see f_type_array_int16ss_append()
*/
-extern void test__f_type_array_int16ss_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int16ss_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__int16ss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-int16ss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_int16ss_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_int16ss_t source = f_int16ss_t_initialize;
+ f_int16ss_t destination = f_int16ss_t_initialize;
+
+ {
+ const f_status_t status = f_int16ss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_int16s_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ for (f_array_length_t i = 0; i < length_inner; ++i) {
+ source.array[source.used].array[source.array[source.used].used++] = i + 1;
+ } // for
+ } // for
+ }
+
+ {
+ const f_status_t status = f_int16ss_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 < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ for (f_array_length_t j = 0; j < length_inner; ++j) {
+ assert_int_equal(destination.array[i].array[j], j + 1);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_int16ss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_int16ss_t source = f_int16ss_t_initialize;
+ f_int16ss_t destination = f_int16ss_t_initialize;
+
+ {
+ const f_status_t status = f_int16ss_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_int16ss_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_type_array_int16ss_append_all__parameter_checking(void **state) {
+
+ const f_int16ss_t data = f_int16ss_t_initialize;
+
+ {
+ const f_status_t status = f_int16ss_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_type_array__int16ss_append_all
+#define _TEST__F_type_array__int16ss_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_int16ss_append_all()
+ */
+extern void test__f_type_array_int16ss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_int16ss_append_all()
+ */
+extern void test__f_type_array_int16ss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_int16ss_append_all()
+ */
+extern void test__f_type_array_int16ss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__int16ss_append_all
assert_null(data.array);
}
-void test__f_type_array_int16ss_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int16ss_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_int16ss_t data = f_int16s_t_initialize;
*
* @see f_type_array_int16ss_decimate_by()
*/
-extern void test__f_type_array_int16ss_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int16ss_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int16ss_decimate_by
assert_null(data.array);
}
-void test__f_type_array_int16ss_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int16ss_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_int16ss_t data = f_int16s_t_initialize;
*
* @see f_type_array_int16ss_decrease_by()
*/
-extern void test__f_type_array_int16ss_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int16ss_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int16ss_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_int16ss_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int16ss_increase__parameter_checking(void **state) {
const int length = 5;
f_int16ss_t data = f_int16s_t_initialize;
*
* @see f_type_array_int16ss_increase()
*/
-extern void test__f_type_array_int16ss_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int16ss_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__int16ss_increase
free((void *) data.array);
}
-void test__f_type_array_int16ss_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int16ss_increase_by__parameter_checking(void **state) {
const int length = 5;
f_int16ss_t data = f_int16s_t_initialize;
*
* @see f_type_array_int16ss_increase_by()
*/
-extern void test__f_type_array_int16ss_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int16ss_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int16ss_increase_by
free((void *) data.array);
}
-void test__f_type_array_int16ss_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int16ss_resize__parameter_checking(void **state) {
const int length = 5;
f_int16ss_t data = f_int16ss_t_initialize;
*
* @see f_type_array_int16ss_resize()
*/
-extern void test__f_type_array_int16ss_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int16ss_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__int16ss_resize
free((void *) data.array);
}
-void test__f_type_array_int32s_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int32s_adjust__parameter_checking(void **state) {
const int length = 5;
f_int32s_t data = f_int32s_t_initialize;
*
* @see f_type_array_int32s_adjust()
*/
-extern void test__f_type_array_int32s_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int32s_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__int32s_adjust
void test__f_type_array_int32s_append__works(void **state) {
- const int length = 5;
- const int length_used = 2;
- f_int32s_t source = f_int32s_t_initialize;
+ const int32_t source = 3;
f_int32s_t destination = f_int32s_t_initialize;
{
- const f_status_t status = f_int32s_resize(length, &source);
-
- assert_int_equal(status, F_none);
- assert_int_equal(source.used, 0);
- assert_int_equal(source.size, length);
- }
-
- for (; source.used < length_used; ++source.used) {
- source.array[source.used] = source.used + 1;
- } // for
-
- {
const f_status_t status = f_int32s_append(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 < source.used; ++i) {
- assert_int_equal(destination.array[i], i + 1);
- } // for
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0], source);
}
- free((void *) source.array);
free((void *) destination.array);
}
-void test__f_type_array_int32s_append__returns_data_not(void **state) {
+void test__f_type_array_int32s_append__parameter_checking(void **state) {
- const int length = 5;
- f_int32s_t source = f_int32s_t_initialize;
- f_int32s_t destination = f_int32s_t_initialize;
-
- {
- const f_status_t status = f_int32s_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_int32s_append(source, &destination);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(destination.used, 0);
- assert_int_equal(destination.size, 0);
- }
-
- free((void *) source.array);
- assert_null(destination.array);
-}
-
-void test__f_type_array_int32s_append__fails_on_invalid_parameter(void **state) {
-
- const int length = 5;
- f_int32s_t data = f_int32s_t_initialize;
+ const uint32_t data = 0;
{
const f_status_t status = f_int32s_append(data, 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 void test__f_type_array_int32s_append__works(void **state);
/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_type_array_int32s_append()
- */
-extern void test__f_type_array_int32s_append__returns_data_not(void **state);
-
-/**
* Test that the function correctly fails on invalid parameter.
*
* @see f_type_array_int32s_append()
*/
-extern void test__f_type_array_int32s_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int32s_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__int32s_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-int32s_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_int32s_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_used = 2;
+ f_int32s_t source = f_int32s_t_initialize;
+ f_int32s_t destination = f_int32s_t_initialize;
+
+ {
+ const f_status_t status = f_int32s_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ for (; source.used < length_used; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
+
+ {
+ const f_status_t status = f_int32s_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 < source.used; ++i) {
+ assert_int_equal(destination.array[i], i + 1);
+ } // for
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_int32s_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_int32s_t source = f_int32s_t_initialize;
+ f_int32s_t destination = f_int32s_t_initialize;
+
+ {
+ const f_status_t status = f_int32s_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_int32s_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_type_array_int32s_append_all__parameter_checking(void **state) {
+
+ const f_int32s_t data = f_int32s_t_initialize;
+
+ {
+ const f_status_t status = f_int32s_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_type_array__int32s_append_all
+#define _TEST__F_type_array__int32s_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_int32s_append_all()
+ */
+extern void test__f_type_array_int32s_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_int32s_append_all()
+ */
+extern void test__f_type_array_int32s_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_int32s_append_all()
+ */
+extern void test__f_type_array_int32s_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__int32s_append_all
assert_null(data.array);
}
-void test__f_type_array_int32s_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int32s_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_int32s_t data = f_int32s_t_initialize;
*
* @see f_type_array_int32s_decimate_by()
*/
-extern void test__f_type_array_int32s_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int32s_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int32s_decimate_by
assert_null(data.array);
}
-void test__f_type_array_int32s_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int32s_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_int32s_t data = f_int32s_t_initialize;
*
* @see f_type_array_int32s_decrease_by()
*/
-extern void test__f_type_array_int32s_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int32s_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int32s_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_int32s_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int32s_increase__parameter_checking(void **state) {
const int length = 5;
f_int32s_t data = f_int32s_t_initialize;
*
* @see f_type_array_int32s_increase()
*/
-extern void test__f_type_array_int32s_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int32s_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__int32s_increase
free((void *) data.array);
}
-void test__f_type_array_int32s_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int32s_increase_by__parameter_checking(void **state) {
const int length = 5;
f_int32s_t data = f_int32s_t_initialize;
*
* @see f_type_array_int32s_increase_by()
*/
-extern void test__f_type_array_int32s_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int32s_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int32s_increase_by
free((void *) data.array);
}
-void test__f_type_array_int32s_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int32s_resize__parameter_checking(void **state) {
const int length = 5;
f_int32s_t data = f_int32s_t_initialize;
*
* @see f_type_array_int32s_resize()
*/
-extern void test__f_type_array_int32s_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int32s_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__int32s_resize
free((void *) data.array);
}
-void test__f_type_array_int32ss_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int32ss_adjust__parameter_checking(void **state) {
const int length = 5;
f_int32ss_t data = f_int32ss_t_initialize;
*
* @see f_type_array_int32ss_adjust()
*/
-extern void test__f_type_array_int32ss_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int32ss_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__int32ss_adjust
void test__f_type_array_int32ss_append__works(void **state) {
const int length = 5;
- const int length_inner = 2;
- f_int32ss_t source = f_int32s_t_initialize;
- f_int32ss_t destination = f_int32s_t_initialize;
+ f_int32s_t source = f_int32s_t_initialize;
+ f_int32ss_t destination = f_int32ss_t_initialize;
{
- const f_status_t status = f_int32ss_resize(length, &source);
+ const f_status_t status = f_int32s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
assert_int_equal(source.size, length);
}
- {
- for (; source.used < length; ++source.used) {
-
- const f_status_t status = f_int32s_resize(length_inner, &source.array[source.used]);
-
- assert_int_equal(status, F_none);
-
- for (f_array_length_t i = 0; i < length_inner; ++i) {
- source.array[source.used].array[source.array[source.used].used++] = i + 1;
- } // for
- } // for
- }
+ for (; source.used < length; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
{
const f_status_t status = f_int32ss_append(source, &destination);
assert_int_equal(status, F_none);
- assert_int_equal(destination.used, source.used);
- assert_int_equal(destination.size, source.used);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].used, source.used);
+ assert_int_equal(destination.array[0].size, source.used);
- for (f_array_length_t i = 0; i < destination.used; ++i) {
-
- assert_int_equal(destination.array[i].used, length_inner);
- assert_int_equal(destination.array[i].size, length_inner);
-
- for (f_array_length_t j = 0; j < length_inner; ++j) {
- assert_int_equal(destination.array[i].array[j], j + 1);
- } // for
+ for (f_array_length_t i = 0; i < destination.array[0].used; ++i) {
+ assert_int_equal(destination.array[0].array[i], i + 1);
} // for
}
- for (f_array_length_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].array);
- } // for
-
for (f_array_length_t i = 0; i < destination.used; ++i) {
free((void *) destination.array[i].array);
} // for
void test__f_type_array_int32ss_append__returns_data_not(void **state) {
const int length = 5;
- f_int32ss_t source = f_int32s_t_initialize;
- f_int32ss_t destination = f_int32s_t_initialize;
+ f_int32s_t source = f_int32s_t_initialize;
+ f_int32ss_t destination = f_int32ss_t_initialize;
{
- const f_status_t status = f_int32ss_resize(length, &source);
+ const f_status_t status = f_int32s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
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);
- assert_null(destination.array);
}
-void test__f_type_array_int32ss_append__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int32ss_append__parameter_checking(void **state) {
- const int length = 5;
- f_int32ss_t data = f_int32s_t_initialize;
+ f_int32s_t data = f_int32s_t_initialize;
{
const f_status_t status = f_int32ss_append(data, 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
*
* @see f_type_array_int32ss_append()
*/
-extern void test__f_type_array_int32ss_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int32ss_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__int32ss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-int32ss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_int32ss_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_int32ss_t source = f_int32ss_t_initialize;
+ f_int32ss_t destination = f_int32ss_t_initialize;
+
+ {
+ const f_status_t status = f_int32ss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_int32s_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ for (f_array_length_t i = 0; i < length_inner; ++i) {
+ source.array[source.used].array[source.array[source.used].used++] = i + 1;
+ } // for
+ } // for
+ }
+
+ {
+ const f_status_t status = f_int32ss_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 < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ for (f_array_length_t j = 0; j < length_inner; ++j) {
+ assert_int_equal(destination.array[i].array[j], j + 1);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_int32ss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_int32ss_t source = f_int32ss_t_initialize;
+ f_int32ss_t destination = f_int32ss_t_initialize;
+
+ {
+ const f_status_t status = f_int32ss_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_int32ss_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_type_array_int32ss_append_all__parameter_checking(void **state) {
+
+ const f_int32ss_t data = f_int32ss_t_initialize;
+
+ {
+ const f_status_t status = f_int32ss_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_type_array__int32ss_append_all
+#define _TEST__F_type_array__int32ss_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_int32ss_append_all()
+ */
+extern void test__f_type_array_int32ss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_int32ss_append_all()
+ */
+extern void test__f_type_array_int32ss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_int32ss_append_all()
+ */
+extern void test__f_type_array_int32ss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__int32ss_append_all
assert_null(data.array);
}
-void test__f_type_array_int32ss_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int32ss_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_int32ss_t data = f_int32s_t_initialize;
*
* @see f_type_array_int32ss_decimate_by()
*/
-extern void test__f_type_array_int32ss_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int32ss_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int32ss_decimate_by
assert_null(data.array);
}
-void test__f_type_array_int32ss_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int32ss_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_int32ss_t data = f_int32s_t_initialize;
*
* @see f_type_array_int32ss_decrease_by()
*/
-extern void test__f_type_array_int32ss_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int32ss_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int32ss_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_int32ss_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int32ss_increase__parameter_checking(void **state) {
const int length = 5;
f_int32ss_t data = f_int32s_t_initialize;
*
* @see f_type_array_int32ss_increase()
*/
-extern void test__f_type_array_int32ss_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int32ss_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__int32ss_increase
free((void *) data.array);
}
-void test__f_type_array_int32ss_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int32ss_increase_by__parameter_checking(void **state) {
const int length = 5;
f_int32ss_t data = f_int32s_t_initialize;
*
* @see f_type_array_int32ss_increase_by()
*/
-extern void test__f_type_array_int32ss_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int32ss_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int32ss_increase_by
free((void *) data.array);
}
-void test__f_type_array_int32ss_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int32ss_resize__parameter_checking(void **state) {
const int length = 5;
f_int32ss_t data = f_int32ss_t_initialize;
*
* @see f_type_array_int32ss_resize()
*/
-extern void test__f_type_array_int32ss_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int32ss_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__int32ss_resize
free((void *) data.array);
}
-void test__f_type_array_int64s_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int64s_adjust__parameter_checking(void **state) {
const int length = 5;
f_int64s_t data = f_int64s_t_initialize;
*
* @see f_type_array_int64s_adjust()
*/
-extern void test__f_type_array_int64s_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int64s_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__int64s_adjust
void test__f_type_array_int64s_append__works(void **state) {
- const int length = 5;
- const int length_used = 2;
- f_int64s_t source = f_int64s_t_initialize;
+ const int64_t source = 3;
f_int64s_t destination = f_int64s_t_initialize;
{
- const f_status_t status = f_int64s_resize(length, &source);
-
- assert_int_equal(status, F_none);
- assert_int_equal(source.used, 0);
- assert_int_equal(source.size, length);
- }
-
- for (; source.used < length_used; ++source.used) {
- source.array[source.used] = source.used + 1;
- } // for
-
- {
const f_status_t status = f_int64s_append(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 < source.used; ++i) {
- assert_int_equal(destination.array[i], i + 1);
- } // for
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0], source);
}
- free((void *) source.array);
free((void *) destination.array);
}
-void test__f_type_array_int64s_append__returns_data_not(void **state) {
+void test__f_type_array_int64s_append__parameter_checking(void **state) {
- const int length = 5;
- f_int64s_t source = f_int64s_t_initialize;
- f_int64s_t destination = f_int64s_t_initialize;
-
- {
- const f_status_t status = f_int64s_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_int64s_append(source, &destination);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(destination.used, 0);
- assert_int_equal(destination.size, 0);
- }
-
- free((void *) source.array);
- assert_null(destination.array);
-}
-
-void test__f_type_array_int64s_append__fails_on_invalid_parameter(void **state) {
-
- const int length = 5;
- f_int64s_t data = f_int64s_t_initialize;
+ const uint64_t data = 0;
{
const f_status_t status = f_int64s_append(data, 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 void test__f_type_array_int64s_append__works(void **state);
/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_type_array_int64s_append()
- */
-extern void test__f_type_array_int64s_append__returns_data_not(void **state);
-
-/**
* Test that the function correctly fails on invalid parameter.
*
* @see f_type_array_int64s_append()
*/
-extern void test__f_type_array_int64s_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int64s_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__int64s_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-int64s_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_int64s_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_used = 2;
+ f_int64s_t source = f_int64s_t_initialize;
+ f_int64s_t destination = f_int64s_t_initialize;
+
+ {
+ const f_status_t status = f_int64s_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ for (; source.used < length_used; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
+
+ {
+ const f_status_t status = f_int64s_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 < source.used; ++i) {
+ assert_int_equal(destination.array[i], i + 1);
+ } // for
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_int64s_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_int64s_t source = f_int64s_t_initialize;
+ f_int64s_t destination = f_int64s_t_initialize;
+
+ {
+ const f_status_t status = f_int64s_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_int64s_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_type_array_int64s_append_all__parameter_checking(void **state) {
+
+ const f_int64s_t data = f_int64s_t_initialize;
+
+ {
+ const f_status_t status = f_int64s_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_type_array__int64s_append_all
+#define _TEST__F_type_array__int64s_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_int64s_append_all()
+ */
+extern void test__f_type_array_int64s_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_int64s_append_all()
+ */
+extern void test__f_type_array_int64s_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_int64s_append_all()
+ */
+extern void test__f_type_array_int64s_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__int64s_append_all
assert_null(data.array);
}
-void test__f_type_array_int64s_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int64s_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_int64s_t data = f_int64s_t_initialize;
*
* @see f_type_array_int64s_decimate_by()
*/
-extern void test__f_type_array_int64s_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int64s_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int64s_decimate_by
assert_null(data.array);
}
-void test__f_type_array_int64s_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int64s_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_int64s_t data = f_int64s_t_initialize;
*
* @see f_type_array_int64s_decrease_by()
*/
-extern void test__f_type_array_int64s_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int64s_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int64s_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_int64s_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int64s_increase__parameter_checking(void **state) {
const int length = 5;
f_int64s_t data = f_int64s_t_initialize;
*
* @see f_type_array_int64s_increase()
*/
-extern void test__f_type_array_int64s_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int64s_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__int64s_increase
free((void *) data.array);
}
-void test__f_type_array_int64s_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int64s_increase_by__parameter_checking(void **state) {
const int length = 5;
f_int64s_t data = f_int64s_t_initialize;
*
* @see f_type_array_int64s_increase_by()
*/
-extern void test__f_type_array_int64s_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int64s_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int64s_increase_by
free((void *) data.array);
}
-void test__f_type_array_int64s_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int64s_resize__parameter_checking(void **state) {
const int length = 5;
f_int64s_t data = f_int64s_t_initialize;
*
* @see f_type_array_int64s_resize()
*/
-extern void test__f_type_array_int64s_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int64s_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__int64s_resize
free((void *) data.array);
}
-void test__f_type_array_int64ss_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int64ss_adjust__parameter_checking(void **state) {
const int length = 5;
f_int64ss_t data = f_int64ss_t_initialize;
*
* @see f_type_array_int64ss_adjust()
*/
-extern void test__f_type_array_int64ss_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int64ss_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__int64ss_adjust
void test__f_type_array_int64ss_append__works(void **state) {
const int length = 5;
- const int length_inner = 2;
- f_int64ss_t source = f_int64s_t_initialize;
- f_int64ss_t destination = f_int64s_t_initialize;
+ f_int64s_t source = f_int64s_t_initialize;
+ f_int64ss_t destination = f_int64ss_t_initialize;
{
- const f_status_t status = f_int64ss_resize(length, &source);
+ const f_status_t status = f_int64s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
assert_int_equal(source.size, length);
}
- {
- for (; source.used < length; ++source.used) {
-
- const f_status_t status = f_int64s_resize(length_inner, &source.array[source.used]);
-
- assert_int_equal(status, F_none);
-
- for (f_array_length_t i = 0; i < length_inner; ++i) {
- source.array[source.used].array[source.array[source.used].used++] = i + 1;
- } // for
- } // for
- }
+ for (; source.used < length; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
{
const f_status_t status = f_int64ss_append(source, &destination);
assert_int_equal(status, F_none);
- assert_int_equal(destination.used, source.used);
- assert_int_equal(destination.size, source.used);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].used, source.used);
+ assert_int_equal(destination.array[0].size, source.used);
- for (f_array_length_t i = 0; i < destination.used; ++i) {
-
- assert_int_equal(destination.array[i].used, length_inner);
- assert_int_equal(destination.array[i].size, length_inner);
-
- for (f_array_length_t j = 0; j < length_inner; ++j) {
- assert_int_equal(destination.array[i].array[j], j + 1);
- } // for
+ for (f_array_length_t i = 0; i < destination.array[0].used; ++i) {
+ assert_int_equal(destination.array[0].array[i], i + 1);
} // for
}
- for (f_array_length_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].array);
- } // for
-
for (f_array_length_t i = 0; i < destination.used; ++i) {
free((void *) destination.array[i].array);
} // for
void test__f_type_array_int64ss_append__returns_data_not(void **state) {
const int length = 5;
- f_int64ss_t source = f_int64s_t_initialize;
- f_int64ss_t destination = f_int64s_t_initialize;
+ f_int64s_t source = f_int64s_t_initialize;
+ f_int64ss_t destination = f_int64ss_t_initialize;
{
- const f_status_t status = f_int64ss_resize(length, &source);
+ const f_status_t status = f_int64s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
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);
- assert_null(destination.array);
}
-void test__f_type_array_int64ss_append__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int64ss_append__parameter_checking(void **state) {
- const int length = 5;
- f_int64ss_t data = f_int64s_t_initialize;
+ f_int64s_t data = f_int64s_t_initialize;
{
const f_status_t status = f_int64ss_append(data, 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
*
* @see f_type_array_int64ss_append()
*/
-extern void test__f_type_array_int64ss_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int64ss_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__int64ss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-int64ss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_int64ss_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_int64ss_t source = f_int64ss_t_initialize;
+ f_int64ss_t destination = f_int64ss_t_initialize;
+
+ {
+ const f_status_t status = f_int64ss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_int64s_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ for (f_array_length_t i = 0; i < length_inner; ++i) {
+ source.array[source.used].array[source.array[source.used].used++] = i + 1;
+ } // for
+ } // for
+ }
+
+ {
+ const f_status_t status = f_int64ss_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 < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ for (f_array_length_t j = 0; j < length_inner; ++j) {
+ assert_int_equal(destination.array[i].array[j], j + 1);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_int64ss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_int64ss_t source = f_int64ss_t_initialize;
+ f_int64ss_t destination = f_int64ss_t_initialize;
+
+ {
+ const f_status_t status = f_int64ss_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_int64ss_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_type_array_int64ss_append_all__parameter_checking(void **state) {
+
+ const f_int64ss_t data = f_int64ss_t_initialize;
+
+ {
+ const f_status_t status = f_int64ss_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_type_array__int64ss_append_all
+#define _TEST__F_type_array__int64ss_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_int64ss_append_all()
+ */
+extern void test__f_type_array_int64ss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_int64ss_append_all()
+ */
+extern void test__f_type_array_int64ss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_int64ss_append_all()
+ */
+extern void test__f_type_array_int64ss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__int64ss_append_all
assert_null(data.array);
}
-void test__f_type_array_int64ss_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int64ss_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_int64ss_t data = f_int64s_t_initialize;
*
* @see f_type_array_int64ss_decimate_by()
*/
-extern void test__f_type_array_int64ss_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int64ss_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int64ss_decimate_by
assert_null(data.array);
}
-void test__f_type_array_int64ss_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int64ss_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_int64ss_t data = f_int64s_t_initialize;
*
* @see f_type_array_int64ss_decrease_by()
*/
-extern void test__f_type_array_int64ss_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int64ss_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int64ss_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_int64ss_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int64ss_increase__parameter_checking(void **state) {
const int length = 5;
f_int64ss_t data = f_int64s_t_initialize;
*
* @see f_type_array_int64ss_increase()
*/
-extern void test__f_type_array_int64ss_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int64ss_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__int64ss_increase
free((void *) data.array);
}
-void test__f_type_array_int64ss_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int64ss_increase_by__parameter_checking(void **state) {
const int length = 5;
f_int64ss_t data = f_int64s_t_initialize;
*
* @see f_type_array_int64ss_increase_by()
*/
-extern void test__f_type_array_int64ss_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int64ss_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int64ss_increase_by
free((void *) data.array);
}
-void test__f_type_array_int64ss_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int64ss_resize__parameter_checking(void **state) {
const int length = 5;
f_int64ss_t data = f_int64ss_t_initialize;
*
* @see f_type_array_int64ss_resize()
*/
-extern void test__f_type_array_int64ss_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int64ss_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__int64ss_resize
free((void *) data.array);
}
-void test__f_type_array_int8s_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int8s_adjust__parameter_checking(void **state) {
const int length = 5;
f_int8s_t data = f_int8s_t_initialize;
*
* @see f_type_array_int8s_adjust()
*/
-extern void test__f_type_array_int8s_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int8s_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__int8s_adjust
void test__f_type_array_int8s_append__works(void **state) {
- const int length = 5;
- const int length_used = 2;
- f_int8s_t source = f_int8s_t_initialize;
+ const int8_t source = 3;
f_int8s_t destination = f_int8s_t_initialize;
{
- const f_status_t status = f_int8s_resize(length, &source);
-
- assert_int_equal(status, F_none);
- assert_int_equal(source.used, 0);
- assert_int_equal(source.size, length);
- }
-
- for (; source.used < length_used; ++source.used) {
- source.array[source.used] = source.used + 1;
- } // for
-
- {
const f_status_t status = f_int8s_append(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 < source.used; ++i) {
- assert_int_equal(destination.array[i], i + 1);
- } // for
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0], source);
}
- free((void *) source.array);
free((void *) destination.array);
}
-void test__f_type_array_int8s_append__returns_data_not(void **state) {
+void test__f_type_array_int8s_append__parameter_checking(void **state) {
- const int length = 5;
- f_int8s_t source = f_int8s_t_initialize;
- f_int8s_t destination = f_int8s_t_initialize;
-
- {
- const f_status_t status = f_int8s_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_int8s_append(source, &destination);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(destination.used, 0);
- assert_int_equal(destination.size, 0);
- }
-
- free((void *) source.array);
- assert_null(destination.array);
-}
-
-void test__f_type_array_int8s_append__fails_on_invalid_parameter(void **state) {
-
- const int length = 5;
- f_int8s_t data = f_int8s_t_initialize;
+ const uint8_t data = 0;
{
const f_status_t status = f_int8s_append(data, 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 void test__f_type_array_int8s_append__works(void **state);
/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_type_array_int8s_append()
- */
-extern void test__f_type_array_int8s_append__returns_data_not(void **state);
-
-/**
* Test that the function correctly fails on invalid parameter.
*
* @see f_type_array_int8s_append()
*/
-extern void test__f_type_array_int8s_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int8s_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__int8s_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-int8s_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_int8s_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_used = 2;
+ f_int8s_t source = f_int8s_t_initialize;
+ f_int8s_t destination = f_int8s_t_initialize;
+
+ {
+ const f_status_t status = f_int8s_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ for (; source.used < length_used; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
+
+ {
+ const f_status_t status = f_int8s_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 < source.used; ++i) {
+ assert_int_equal(destination.array[i], i + 1);
+ } // for
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_int8s_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_int8s_t source = f_int8s_t_initialize;
+ f_int8s_t destination = f_int8s_t_initialize;
+
+ {
+ const f_status_t status = f_int8s_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_int8s_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_type_array_int8s_append_all__parameter_checking(void **state) {
+
+ const f_int8s_t data = f_int8s_t_initialize;
+
+ {
+ const f_status_t status = f_int8s_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_type_array__int8s_append_all
+#define _TEST__F_type_array__int8s_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_int8s_append_all()
+ */
+extern void test__f_type_array_int8s_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_int8s_append_all()
+ */
+extern void test__f_type_array_int8s_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_int8s_append_all()
+ */
+extern void test__f_type_array_int8s_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__int8s_append_all
assert_null(data.array);
}
-void test__f_type_array_int8s_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int8s_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_int8s_t data = f_int8s_t_initialize;
*
* @see f_type_array_int8s_decimate_by()
*/
-extern void test__f_type_array_int8s_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int8s_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int8s_decimate_by
assert_null(data.array);
}
-void test__f_type_array_int8s_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int8s_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_int8s_t data = f_int8s_t_initialize;
*
* @see f_type_array_int8s_decrease_by()
*/
-extern void test__f_type_array_int8s_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int8s_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int8s_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_int8s_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int8s_increase__parameter_checking(void **state) {
const int length = 5;
f_int8s_t data = f_int8s_t_initialize;
*
* @see f_type_array_int8s_increase()
*/
-extern void test__f_type_array_int8s_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int8s_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__int8s_increase
free((void *) data.array);
}
-void test__f_type_array_int8s_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int8s_increase_by__parameter_checking(void **state) {
const int length = 5;
f_int8s_t data = f_int8s_t_initialize;
*
* @see f_type_array_int8s_increase_by()
*/
-extern void test__f_type_array_int8s_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int8s_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int8s_increase_by
free((void *) data.array);
}
-void test__f_type_array_int8s_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int8s_resize__parameter_checking(void **state) {
const int length = 5;
f_int8s_t data = f_int8s_t_initialize;
*
* @see f_type_array_int8s_resize()
*/
-extern void test__f_type_array_int8s_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int8s_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__int8s_resize
free((void *) data.array);
}
-void test__f_type_array_int8ss_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int8ss_adjust__parameter_checking(void **state) {
const int length = 5;
f_int8ss_t data = f_int8ss_t_initialize;
*
* @see f_type_array_int8ss_adjust()
*/
-extern void test__f_type_array_int8ss_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int8ss_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__int8ss_adjust
void test__f_type_array_int8ss_append__works(void **state) {
const int length = 5;
- const int length_inner = 2;
- f_int8ss_t source = f_int8s_t_initialize;
- f_int8ss_t destination = f_int8s_t_initialize;
+ f_int8s_t source = f_int8s_t_initialize;
+ f_int8ss_t destination = f_int8ss_t_initialize;
{
- const f_status_t status = f_int8ss_resize(length, &source);
+ const f_status_t status = f_int8s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
assert_int_equal(source.size, length);
}
- {
- for (; source.used < length; ++source.used) {
-
- const f_status_t status = f_int8s_resize(length_inner, &source.array[source.used]);
-
- assert_int_equal(status, F_none);
-
- for (f_array_length_t i = 0; i < length_inner; ++i) {
- source.array[source.used].array[source.array[source.used].used++] = i + 1;
- } // for
- } // for
- }
+ for (; source.used < length; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
{
const f_status_t status = f_int8ss_append(source, &destination);
assert_int_equal(status, F_none);
- assert_int_equal(destination.used, source.used);
- assert_int_equal(destination.size, source.used);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].used, source.used);
+ assert_int_equal(destination.array[0].size, source.used);
- for (f_array_length_t i = 0; i < destination.used; ++i) {
-
- assert_int_equal(destination.array[i].used, length_inner);
- assert_int_equal(destination.array[i].size, length_inner);
-
- for (f_array_length_t j = 0; j < length_inner; ++j) {
- assert_int_equal(destination.array[i].array[j], j + 1);
- } // for
+ for (f_array_length_t i = 0; i < destination.array[0].used; ++i) {
+ assert_int_equal(destination.array[0].array[i], i + 1);
} // for
}
- for (f_array_length_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].array);
- } // for
-
for (f_array_length_t i = 0; i < destination.used; ++i) {
free((void *) destination.array[i].array);
} // for
void test__f_type_array_int8ss_append__returns_data_not(void **state) {
const int length = 5;
- f_int8ss_t source = f_int8s_t_initialize;
- f_int8ss_t destination = f_int8s_t_initialize;
+ f_int8s_t source = f_int8s_t_initialize;
+ f_int8ss_t destination = f_int8ss_t_initialize;
{
- const f_status_t status = f_int8ss_resize(length, &source);
+ const f_status_t status = f_int8s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
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);
- assert_null(destination.array);
}
-void test__f_type_array_int8ss_append__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int8ss_append__parameter_checking(void **state) {
- const int length = 5;
- f_int8ss_t data = f_int8s_t_initialize;
+ f_int8s_t data = f_int8s_t_initialize;
{
const f_status_t status = f_int8ss_append(data, 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
*
* @see f_type_array_int8ss_append()
*/
-extern void test__f_type_array_int8ss_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int8ss_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__int8ss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-int8ss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_int8ss_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_int8ss_t source = f_int8ss_t_initialize;
+ f_int8ss_t destination = f_int8ss_t_initialize;
+
+ {
+ const f_status_t status = f_int8ss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_int8s_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ for (f_array_length_t i = 0; i < length_inner; ++i) {
+ source.array[source.used].array[source.array[source.used].used++] = i + 1;
+ } // for
+ } // for
+ }
+
+ {
+ const f_status_t status = f_int8ss_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 < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ for (f_array_length_t j = 0; j < length_inner; ++j) {
+ assert_int_equal(destination.array[i].array[j], j + 1);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_int8ss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_int8ss_t source = f_int8ss_t_initialize;
+ f_int8ss_t destination = f_int8ss_t_initialize;
+
+ {
+ const f_status_t status = f_int8ss_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_int8ss_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_type_array_int8ss_append_all__parameter_checking(void **state) {
+
+ const f_int8ss_t data = f_int8ss_t_initialize;
+
+ {
+ const f_status_t status = f_int8ss_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_type_array__int8ss_append_all
+#define _TEST__F_type_array__int8ss_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_int8ss_append_all()
+ */
+extern void test__f_type_array_int8ss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_int8ss_append_all()
+ */
+extern void test__f_type_array_int8ss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_int8ss_append_all()
+ */
+extern void test__f_type_array_int8ss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__int8ss_append_all
assert_null(data.array);
}
-void test__f_type_array_int8ss_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int8ss_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_int8ss_t data = f_int8s_t_initialize;
*
* @see f_type_array_int8ss_decimate_by()
*/
-extern void test__f_type_array_int8ss_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int8ss_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int8ss_decimate_by
assert_null(data.array);
}
-void test__f_type_array_int8ss_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int8ss_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_int8ss_t data = f_int8s_t_initialize;
*
* @see f_type_array_int8ss_decrease_by()
*/
-extern void test__f_type_array_int8ss_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int8ss_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int8ss_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_int8ss_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int8ss_increase__parameter_checking(void **state) {
const int length = 5;
f_int8ss_t data = f_int8s_t_initialize;
*
* @see f_type_array_int8ss_increase()
*/
-extern void test__f_type_array_int8ss_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int8ss_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__int8ss_increase
free((void *) data.array);
}
-void test__f_type_array_int8ss_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int8ss_increase_by__parameter_checking(void **state) {
const int length = 5;
f_int8ss_t data = f_int8s_t_initialize;
*
* @see f_type_array_int8ss_increase_by()
*/
-extern void test__f_type_array_int8ss_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int8ss_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__int8ss_increase_by
free((void *) data.array);
}
-void test__f_type_array_int8ss_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_int8ss_resize__parameter_checking(void **state) {
const int length = 5;
f_int8ss_t data = f_int8ss_t_initialize;
*
* @see f_type_array_int8ss_resize()
*/
-extern void test__f_type_array_int8ss_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_int8ss_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__int8ss_resize
free((void *) data.array);
}
-void test__f_type_array_states_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_states_adjust__parameter_checking(void **state) {
const int length = 5;
f_states_t data = f_states_t_initialize;
*
* @see f_type_array_states_adjust()
*/
-extern void test__f_type_array_states_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_states_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__states_adjust
void test__f_type_array_states_append__works(void **state) {
- const int length = 5;
- f_states_t source = f_states_t_initialize;
- f_states_t destination = f_states_t_initialize;
-
- const f_state_t state_0 = { .step_large = 10, .step_small = 1, .handle = 0, .interrupt = 0, .callbacks = 0, .custom = 0, .data = 0 };
- const f_state_t state_1 = { .step_large = 20, .step_small = 2, .handle = 0, .interrupt = 0, .callbacks = 0, .custom = 0, .data = 0 };
-
- {
- const f_status_t status = f_states_resize(length, &source);
-
- assert_int_equal(status, F_none);
- assert_int_equal(source.used, 0);
- assert_int_equal(source.size, length);
- }
+ int fake_1 = 1;
+ int fake_2 = 2;
+ int fake_3 = 3;
- memcpy(&source.array[source.used++], (void *) &state_0, sizeof(f_state_t));
- memcpy(&source.array[source.used++], (void *) &state_1, sizeof(f_state_t));
+ const f_state_t source = macro_f_state_t_initialize(12, 6, 0, 0, (void *) &fake_1, (void *) &fake_2, (void *) &fake_3);
+ f_states_t destination = f_states_t_initialize;
{
const f_status_t status = f_states_append(source, &destination);
assert_int_equal(status, F_none);
- assert_int_equal(destination.used, source.used);
- assert_int_equal(destination.size, source.used);
-
- assert_int_equal(destination.array[0].step_large, state_0.step_large);
- assert_int_equal(destination.array[0].step_small, state_0.step_small);
- assert_null(destination.array[0].handle);
- assert_null(destination.array[0].interrupt);
- assert_null(destination.array[0].callbacks);
- assert_null(destination.array[0].custom);
- assert_null(destination.array[0].data);
-
- assert_int_equal(destination.array[1].step_large, state_1.step_large);
- assert_int_equal(destination.array[1].step_small, state_1.step_small);
- assert_null(destination.array[1].handle);
- assert_null(destination.array[1].interrupt);
- assert_null(destination.array[1].callbacks);
- assert_null(destination.array[1].custom);
- assert_null(destination.array[1].data);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].step_large, source.step_large);
+ assert_int_equal(destination.array[0].step_small, source.step_small);
+ assert_int_equal(destination.array[0].handle, source.handle);
+ assert_int_equal(destination.array[0].interrupt, source.interrupt);
+ assert_int_equal(destination.array[0].callbacks, source.callbacks);
+ assert_int_equal(destination.array[0].custom, source.custom);
+ assert_int_equal(destination.array[0].data, source.data);
}
- free((void *) source.array);
free((void *) destination.array);
}
-void test__f_type_array_states_append__returns_data_not(void **state) {
-
- const int length = 5;
- f_states_t source = f_states_t_initialize;
- f_states_t destination = f_states_t_initialize;
-
- {
- const f_status_t status = f_states_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_states_append(source, &destination);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(destination.used, 0);
- assert_int_equal(destination.size, 0);
- }
-
- free((void *) source.array);
- assert_null(destination.array);
-}
-
-void test__f_type_array_states_append__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_states_append__parameter_checking(void **state) {
- const int length = 5;
- f_states_t data = f_states_t_initialize;
+ const f_state_t data = f_state_t_initialize;
{
const f_status_t status = f_states_append(data, 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 void test__f_type_array_states_append__works(void **state);
/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_type_array_states_append()
- */
-extern void test__f_type_array_states_append__returns_data_not(void **state);
-
-/**
* Test that the function correctly fails on invalid parameter.
*
* @see f_type_array_states_append()
*/
-extern void test__f_type_array_states_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_states_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__states_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-states_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_states_append_all__works(void **state) {
+
+ const int length = 5;
+ f_states_t source = f_states_t_initialize;
+ f_states_t destination = f_states_t_initialize;
+
+ const f_state_t state_0 = { .step_large = 10, .step_small = 1, .handle = 0, .interrupt = 0, .callbacks = 0, .custom = 0, .data = 0 };
+ const f_state_t state_1 = { .step_large = 20, .step_small = 2, .handle = 0, .interrupt = 0, .callbacks = 0, .custom = 0, .data = 0 };
+
+ {
+ const f_status_t status = f_states_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ memcpy(&source.array[source.used++], (void *) &state_0, sizeof(f_state_t));
+ memcpy(&source.array[source.used++], (void *) &state_1, sizeof(f_state_t));
+
+ {
+ const f_status_t status = f_states_append_all(source, &destination);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(destination.used, source.used);
+ assert_int_equal(destination.size, source.used);
+
+ assert_int_equal(destination.array[0].step_large, state_0.step_large);
+ assert_int_equal(destination.array[0].step_small, state_0.step_small);
+ assert_null(destination.array[0].handle);
+ assert_null(destination.array[0].interrupt);
+ assert_null(destination.array[0].callbacks);
+ assert_null(destination.array[0].custom);
+ assert_null(destination.array[0].data);
+
+ assert_int_equal(destination.array[1].step_large, state_1.step_large);
+ assert_int_equal(destination.array[1].step_small, state_1.step_small);
+ assert_null(destination.array[1].handle);
+ assert_null(destination.array[1].interrupt);
+ assert_null(destination.array[1].callbacks);
+ assert_null(destination.array[1].custom);
+ assert_null(destination.array[1].data);
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_states_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_states_t source = f_states_t_initialize;
+ f_states_t destination = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_states_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_states_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_type_array_states_append_all__parameter_checking(void **state) {
+
+ const f_states_t data = f_states_t_initialize;
+
+ {
+ const f_status_t status = f_states_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_type_array__states_append_all
+#define _TEST__F_type_array__states_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_states_append_all()
+ */
+extern void test__f_type_array_states_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_states_append_all()
+ */
+extern void test__f_type_array_states_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_states_append_all()
+ */
+extern void test__f_type_array_states_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__states_append_all
assert_null(data.array);
}
-void test__f_type_array_states_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_states_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_states_t data = f_states_t_initialize;
*
* @see f_type_array_states_decimate_by()
*/
-extern void test__f_type_array_states_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_states_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__states_decimate_by
assert_null(data.array);
}
-void test__f_type_array_states_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_states_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_states_t data = f_states_t_initialize;
*
* @see f_type_array_states_decrease_by()
*/
-extern void test__f_type_array_states_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_states_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__states_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_states_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_states_increase__parameter_checking(void **state) {
const int length = 5;
f_states_t data = f_states_t_initialize;
*
* @see f_type_array_states_increase()
*/
-extern void test__f_type_array_states_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_states_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__states_increase
free((void *) data.array);
}
-void test__f_type_array_states_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_states_increase_by__parameter_checking(void **state) {
const int length = 5;
f_states_t data = f_states_t_initialize;
*
* @see f_type_array_states_increase_by()
*/
-extern void test__f_type_array_states_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_states_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__states_increase_by
free((void *) data.array);
}
-void test__f_type_array_states_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_states_resize__parameter_checking(void **state) {
const int length = 5;
f_states_t data = f_states_t_initialize;
*
* @see f_type_array_states_resize()
*/
-extern void test__f_type_array_states_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_states_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__states_resize
free((void *) data.array);
}
-void test__f_type_array_statess_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statess_adjust__parameter_checking(void **state) {
const int length = 5;
f_statess_t data = f_statess_t_initialize;
*
* @see f_type_array_statess_adjust()
*/
-extern void test__f_type_array_statess_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statess_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__statess_adjust
void test__f_type_array_statess_append__works(void **state) {
const int length = 5;
- const int length_inner = 2;
- f_statess_t source = f_states_t_initialize;
- f_statess_t destination = f_states_t_initialize;
+ f_states_t source = f_states_t_initialize;
+ f_statess_t destination = f_statess_t_initialize;
- const f_state_t state_0 = { .step_large = 10, .step_small = 1, .handle = 0, .interrupt = 0, .callbacks = 0, .custom = 0, .data = 0 };
- const f_state_t state_1 = { .step_large = 20, .step_small = 2, .handle = 0, .interrupt = 0, .callbacks = 0, .custom = 0, .data = 0 };
+ int fake_1 = 1;
+ int fake_2 = 2;
+ int fake_3 = 3;
+
+ const f_state_t state_data = macro_f_state_t_initialize(12, 6, 0, 0, (void *) &fake_1, (void *) &fake_2, (void *) &fake_3);
{
- const f_status_t status = f_statess_resize(length, &source);
+ const f_status_t status = f_states_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
assert_int_equal(source.size, length);
}
- {
- for (; source.used < length; ++source.used) {
-
- const f_status_t status = f_states_resize(length_inner, &source.array[source.used]);
-
- assert_int_equal(status, F_none);
-
- memcpy(&source.array[source.used].array[source.array[source.used].used++], (void *) &state_0, sizeof(f_state_t));
- memcpy(&source.array[source.used].array[source.array[source.used].used++], (void *) &state_1, sizeof(f_state_t));
- } // for
- }
+ while (source.used < length) {
+ memcpy(&source.array[source.used++], (void *) &state_data, sizeof(f_state_t));
+ } // while
{
const f_status_t status = f_statess_append(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 < destination.used; ++i) {
-
- assert_int_equal(destination.array[i].used, length_inner);
- assert_int_equal(destination.array[i].size, length_inner);
-
- assert_int_equal(destination.array[i].array[0].step_large, state_0.step_large);
- assert_int_equal(destination.array[i].array[0].step_small, state_0.step_small);
- assert_null(destination.array[i].array[0].handle);
- assert_null(destination.array[i].array[0].interrupt);
- assert_null(destination.array[i].array[0].callbacks);
- assert_null(destination.array[i].array[0].custom);
- assert_null(destination.array[i].array[0].data);
-
- assert_int_equal(destination.array[i].array[1].step_large, state_1.step_large);
- assert_int_equal(destination.array[i].array[1].step_small, state_1.step_small);
- assert_null(destination.array[i].array[1].handle);
- assert_null(destination.array[i].array[1].interrupt);
- assert_null(destination.array[i].array[1].callbacks);
- assert_null(destination.array[i].array[1].custom);
- assert_null(destination.array[i].array[1].data);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].used, source.used);
+ assert_int_equal(destination.array[0].size, source.used);
+
+ for (f_array_length_t i = 0; i < destination.array[0].used; ++i) {
+
+ assert_int_equal(destination.array[0].array[i].step_large, state_data.step_large);
+ assert_int_equal(destination.array[0].array[i].step_small, state_data.step_small);
+ assert_int_equal(destination.array[0].array[i].handle, state_data.handle);
+ assert_int_equal(destination.array[0].array[i].interrupt, state_data.interrupt);
+ assert_int_equal(destination.array[0].array[i].callbacks, state_data.callbacks);
+ assert_int_equal(destination.array[0].array[i].custom, state_data.custom);
+ assert_int_equal(destination.array[0].array[i].data, state_data.data);
} // for
}
- for (f_array_length_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].array);
- } // for
-
for (f_array_length_t i = 0; i < destination.used; ++i) {
free((void *) destination.array[i].array);
} // for
void test__f_type_array_statess_append__returns_data_not(void **state) {
const int length = 5;
- f_statess_t source = f_states_t_initialize;
- f_statess_t destination = f_states_t_initialize;
+ f_states_t source = f_states_t_initialize;
+ f_statess_t destination = f_statess_t_initialize;
{
- const f_status_t status = f_statess_resize(length, &source);
+ const f_status_t status = f_states_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
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);
- assert_null(destination.array);
}
-void test__f_type_array_statess_append__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statess_append__parameter_checking(void **state) {
- const int length = 5;
- f_statess_t data = f_states_t_initialize;
+ f_states_t data = f_states_t_initialize;
{
const f_status_t status = f_statess_append(data, 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
*
* @see f_type_array_statess_append()
*/
-extern void test__f_type_array_statess_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statess_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__statess_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statess_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statess_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_statess_t source = f_statess_t_initialize;
+ f_statess_t destination = f_statess_t_initialize;
+
+ const f_state_t state_0 = { .step_large = 10, .step_small = 1, .handle = 0, .interrupt = 0, .callbacks = 0, .custom = 0, .data = 0 };
+ const f_state_t state_1 = { .step_large = 20, .step_small = 2, .handle = 0, .interrupt = 0, .callbacks = 0, .custom = 0, .data = 0 };
+
+ {
+ const f_status_t status = f_statess_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_states_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ memcpy(&source.array[source.used].array[source.array[source.used].used++], (void *) &state_0, sizeof(f_state_t));
+ memcpy(&source.array[source.used].array[source.array[source.used].used++], (void *) &state_1, sizeof(f_state_t));
+ } // for
+ }
+
+ {
+ const f_status_t status = f_statess_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 < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ assert_int_equal(destination.array[i].array[0].step_large, state_0.step_large);
+ assert_int_equal(destination.array[i].array[0].step_small, state_0.step_small);
+ assert_null(destination.array[i].array[0].handle);
+ assert_null(destination.array[i].array[0].interrupt);
+ assert_null(destination.array[i].array[0].callbacks);
+ assert_null(destination.array[i].array[0].custom);
+ assert_null(destination.array[i].array[0].data);
+
+ assert_int_equal(destination.array[i].array[1].step_large, state_1.step_large);
+ assert_int_equal(destination.array[i].array[1].step_small, state_1.step_small);
+ assert_null(destination.array[i].array[1].handle);
+ assert_null(destination.array[i].array[1].interrupt);
+ assert_null(destination.array[i].array[1].callbacks);
+ assert_null(destination.array[i].array[1].custom);
+ assert_null(destination.array[i].array[1].data);
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_statess_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_statess_t source = f_statess_t_initialize;
+ f_statess_t destination = f_statess_t_initialize;
+
+ {
+ const f_status_t status = f_statess_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_statess_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_type_array_statess_append_all__parameter_checking(void **state) {
+
+ const f_statess_t data = f_statess_t_initialize;
+
+ {
+ const f_status_t status = f_statess_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_type_array__statess_append_all
+#define _TEST__F_type_array__statess_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statess_append_all()
+ */
+extern void test__f_type_array_statess_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_statess_append_all()
+ */
+extern void test__f_type_array_statess_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statess_append_all()
+ */
+extern void test__f_type_array_statess_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__statess_append_all
assert_null(data.array);
}
-void test__f_type_array_statess_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statess_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_statess_t data = f_states_t_initialize;
*
* @see f_type_array_statess_decimate_by()
*/
-extern void test__f_type_array_statess_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statess_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__statess_decimate_by
assert_null(data.array);
}
-void test__f_type_array_statess_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statess_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_statess_t data = f_states_t_initialize;
*
* @see f_type_array_statess_decrease_by()
*/
-extern void test__f_type_array_statess_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statess_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__statess_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_statess_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statess_increase__parameter_checking(void **state) {
const int length = 5;
f_statess_t data = f_states_t_initialize;
*
* @see f_type_array_statess_increase()
*/
-extern void test__f_type_array_statess_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statess_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__statess_increase
free((void *) data.array);
}
-void test__f_type_array_statess_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statess_increase_by__parameter_checking(void **state) {
const int length = 5;
f_statess_t data = f_states_t_initialize;
*
* @see f_type_array_statess_increase_by()
*/
-extern void test__f_type_array_statess_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statess_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__statess_increase_by
free((void *) data.array);
}
-void test__f_type_array_statess_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statess_resize__parameter_checking(void **state) {
const int length = 5;
f_statess_t data = f_statess_t_initialize;
*
* @see f_type_array_statess_resize()
*/
-extern void test__f_type_array_statess_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statess_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__statess_resize
free((void *) data.array);
}
-void test__f_type_array_statuss_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statuss_adjust__parameter_checking(void **state) {
const int length = 5;
f_statuss_t data = f_statuss_t_initialize;
*
* @see f_type_array_statuss_adjust()
*/
-extern void test__f_type_array_statuss_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statuss_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__statuss_adjust
void test__f_type_array_statuss_append__works(void **state) {
- const int length = 5;
- const int length_used = 2;
- f_statuss_t source = f_statuss_t_initialize;
+ const f_status_t source = 3;
f_statuss_t destination = f_statuss_t_initialize;
{
- const f_status_t status = f_statuss_resize(length, &source);
-
- assert_int_equal(status, F_none);
- assert_int_equal(source.used, 0);
- assert_int_equal(source.size, length);
- }
-
- for (; source.used < length_used; ++source.used) {
- source.array[source.used] = source.used + 1;
- } // for
-
- {
const f_status_t status = f_statuss_append(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 < source.used; ++i) {
- assert_int_equal(destination.array[i], i + 1);
- } // for
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0], source);
}
- free((void *) source.array);
free((void *) destination.array);
}
-void test__f_type_array_statuss_append__returns_data_not(void **state) {
+void test__f_type_array_statuss_append__parameter_checking(void **state) {
- const int length = 5;
- f_statuss_t source = f_statuss_t_initialize;
- f_statuss_t destination = f_statuss_t_initialize;
-
- {
- const f_status_t status = f_statuss_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_statuss_append(source, &destination);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(destination.used, 0);
- assert_int_equal(destination.size, 0);
- }
-
- free((void *) source.array);
- assert_null(destination.array);
-}
-
-void test__f_type_array_statuss_append__fails_on_invalid_parameter(void **state) {
-
- const int length = 5;
- f_statuss_t data = f_statuss_t_initialize;
+ const f_status_t data = f_status_t_initialize;
{
const f_status_t status = f_statuss_append(data, 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 void test__f_type_array_statuss_append__works(void **state);
/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_type_array_statuss_append()
- */
-extern void test__f_type_array_statuss_append__returns_data_not(void **state);
-
-/**
* Test that the function correctly fails on invalid parameter.
*
* @see f_type_array_statuss_append()
*/
-extern void test__f_type_array_statuss_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statuss_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__statuss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statuss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statuss_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_used = 2;
+ f_statuss_t source = f_statuss_t_initialize;
+ f_statuss_t destination = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_statuss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ for (; source.used < length_used; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
+
+ {
+ const f_status_t status = f_statuss_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 < source.used; ++i) {
+ assert_int_equal(destination.array[i], i + 1);
+ } // for
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_statuss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_statuss_t source = f_statuss_t_initialize;
+ f_statuss_t destination = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_statuss_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_statuss_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_type_array_statuss_append_all__parameter_checking(void **state) {
+
+ const f_statuss_t data = f_statuss_t_initialize;
+
+ {
+ const f_status_t status = f_statuss_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_type_array__statuss_append_all
+#define _TEST__F_type_array__statuss_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statuss_append_all()
+ */
+extern void test__f_type_array_statuss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_statuss_append_all()
+ */
+extern void test__f_type_array_statuss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statuss_append_all()
+ */
+extern void test__f_type_array_statuss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__statuss_append_all
assert_null(data.array);
}
-void test__f_type_array_statuss_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statuss_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_statuss_t data = f_statuss_t_initialize;
*
* @see f_type_array_statuss_decimate_by()
*/
-extern void test__f_type_array_statuss_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statuss_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__statuss_decimate_by
assert_null(data.array);
}
-void test__f_type_array_statuss_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statuss_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_statuss_t data = f_statuss_t_initialize;
*
* @see f_type_array_statuss_decrease_by()
*/
-extern void test__f_type_array_statuss_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statuss_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__statuss_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_statuss_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statuss_increase__parameter_checking(void **state) {
const int length = 5;
f_statuss_t data = f_statuss_t_initialize;
*
* @see f_type_array_statuss_increase()
*/
-extern void test__f_type_array_statuss_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statuss_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__statuss_increase
free((void *) data.array);
}
-void test__f_type_array_statuss_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statuss_increase_by__parameter_checking(void **state) {
const int length = 5;
f_statuss_t data = f_statuss_t_initialize;
*
* @see f_type_array_statuss_increase_by()
*/
-extern void test__f_type_array_statuss_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statuss_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__statuss_increase_by
free((void *) data.array);
}
-void test__f_type_array_statuss_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statuss_resize__parameter_checking(void **state) {
const int length = 5;
f_statuss_t data = f_statuss_t_initialize;
*
* @see f_type_array_statuss_resize()
*/
-extern void test__f_type_array_statuss_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statuss_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__statuss_resize
free((void *) data.array);
}
-void test__f_type_array_statusss_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statusss_adjust__parameter_checking(void **state) {
const int length = 5;
f_statusss_t data = f_statusss_t_initialize;
*
* @see f_type_array_statusss_adjust()
*/
-extern void test__f_type_array_statusss_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statusss_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__statusss_adjust
void test__f_type_array_statusss_append__works(void **state) {
const int length = 5;
- const int length_inner = 2;
- f_statusss_t source = f_statuss_t_initialize;
- f_statusss_t destination = f_statuss_t_initialize;
+ f_statuss_t source = f_statuss_t_initialize;
+ f_statusss_t destination = f_statusss_t_initialize;
{
- const f_status_t status = f_statusss_resize(length, &source);
+ const f_status_t status = f_statuss_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
assert_int_equal(source.size, length);
}
- {
- for (; source.used < length; ++source.used) {
-
- const f_status_t status = f_statuss_resize(length_inner, &source.array[source.used]);
-
- assert_int_equal(status, F_none);
-
- for (f_array_length_t i = 0; i < length_inner; ++i) {
- source.array[source.used].array[source.array[source.used].used++] = i + 1;
- } // for
- } // for
- }
+ for (; source.used < length; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
{
const f_status_t status = f_statusss_append(source, &destination);
assert_int_equal(status, F_none);
- assert_int_equal(destination.used, source.used);
- assert_int_equal(destination.size, source.used);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].used, source.used);
+ assert_int_equal(destination.array[0].size, source.used);
- for (f_array_length_t i = 0; i < destination.used; ++i) {
-
- assert_int_equal(destination.array[i].used, length_inner);
- assert_int_equal(destination.array[i].size, length_inner);
-
- for (f_array_length_t j = 0; j < length_inner; ++j) {
- assert_int_equal(destination.array[i].array[j], j + 1);
- } // for
+ for (f_array_length_t i = 0; i < destination.array[0].used; ++i) {
+ assert_int_equal(destination.array[0].array[i], i + 1);
} // for
}
- for (f_array_length_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].array);
- } // for
-
for (f_array_length_t i = 0; i < destination.used; ++i) {
free((void *) destination.array[i].array);
} // for
void test__f_type_array_statusss_append__returns_data_not(void **state) {
const int length = 5;
- f_statusss_t source = f_statuss_t_initialize;
- f_statusss_t destination = f_statuss_t_initialize;
+ f_statuss_t source = f_statuss_t_initialize;
+ f_statusss_t destination = f_statusss_t_initialize;
{
- const f_status_t status = f_statusss_resize(length, &source);
+ const f_status_t status = f_statuss_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
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);
- assert_null(destination.array);
}
-void test__f_type_array_statusss_append__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statusss_append__parameter_checking(void **state) {
- const int length = 5;
- f_statusss_t data = f_statuss_t_initialize;
+ f_statuss_t data = f_statuss_t_initialize;
{
const f_status_t status = f_statusss_append(data, 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
*
* @see f_type_array_statusss_append()
*/
-extern void test__f_type_array_statusss_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statusss_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__statusss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-statusss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_statusss_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_statusss_t source = f_statusss_t_initialize;
+ f_statusss_t destination = f_statusss_t_initialize;
+
+ {
+ const f_status_t status = f_statusss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_statuss_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ for (f_array_length_t i = 0; i < length_inner; ++i) {
+ source.array[source.used].array[source.array[source.used].used++] = i + 1;
+ } // for
+ } // for
+ }
+
+ {
+ const f_status_t status = f_statusss_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 < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ for (f_array_length_t j = 0; j < length_inner; ++j) {
+ assert_int_equal(destination.array[i].array[j], j + 1);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_statusss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_statusss_t source = f_statusss_t_initialize;
+ f_statusss_t destination = f_statusss_t_initialize;
+
+ {
+ const f_status_t status = f_statusss_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_statusss_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_type_array_statusss_append_all__parameter_checking(void **state) {
+
+ const f_statusss_t data = f_statusss_t_initialize;
+
+ {
+ const f_status_t status = f_statusss_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_type_array__statusss_append_all
+#define _TEST__F_type_array__statusss_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_statusss_append_all()
+ */
+extern void test__f_type_array_statusss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_statusss_append_all()
+ */
+extern void test__f_type_array_statusss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_statusss_append_all()
+ */
+extern void test__f_type_array_statusss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__statusss_append_all
assert_null(data.array);
}
-void test__f_type_array_statusss_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statusss_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_statusss_t data = f_statuss_t_initialize;
*
* @see f_type_array_statusss_decimate_by()
*/
-extern void test__f_type_array_statusss_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statusss_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__statusss_decimate_by
assert_null(data.array);
}
-void test__f_type_array_statusss_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statusss_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_statusss_t data = f_statuss_t_initialize;
*
* @see f_type_array_statusss_decrease_by()
*/
-extern void test__f_type_array_statusss_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statusss_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__statusss_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_statusss_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statusss_increase__parameter_checking(void **state) {
const int length = 5;
f_statusss_t data = f_statuss_t_initialize;
*
* @see f_type_array_statusss_increase()
*/
-extern void test__f_type_array_statusss_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statusss_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__statusss_increase
free((void *) data.array);
}
-void test__f_type_array_statusss_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statusss_increase_by__parameter_checking(void **state) {
const int length = 5;
f_statusss_t data = f_statuss_t_initialize;
*
* @see f_type_array_statusss_increase_by()
*/
-extern void test__f_type_array_statusss_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statusss_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__statusss_increase_by
free((void *) data.array);
}
-void test__f_type_array_statusss_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_statusss_resize__parameter_checking(void **state) {
const int length = 5;
f_statusss_t data = f_statusss_t_initialize;
*
* @see f_type_array_statusss_resize()
*/
-extern void test__f_type_array_statusss_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_statusss_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__statusss_resize
free((void *) data.array);
}
-void test__f_type_array_uint128s_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint128s_adjust__parameter_checking(void **state) {
const int length = 5;
f_uint128s_t data = f_uint128s_t_initialize;
*
* @see f_type_array_uint128s_adjust()
*/
-extern void test__f_type_array_uint128s_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint128s_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint128s_adjust
void test__f_type_array_uint128s_append__works(void **state) {
- const int length = 5;
- const int length_used = 2;
- f_uint128s_t source = f_uint128s_t_initialize;
+ const uint128_t source = 3;
f_uint128s_t destination = f_uint128s_t_initialize;
{
- const f_status_t status = f_uint128s_resize(length, &source);
-
- assert_int_equal(status, F_none);
- assert_int_equal(source.used, 0);
- assert_int_equal(source.size, length);
- }
-
- for (; source.used < length_used; ++source.used) {
- source.array[source.used] = source.used + 1;
- } // for
-
- {
const f_status_t status = f_uint128s_append(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 < source.used; ++i) {
- assert_int_equal(destination.array[i], i + 1);
- } // for
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0], source);
}
- free((void *) source.array);
free((void *) destination.array);
}
-void test__f_type_array_uint128s_append__returns_data_not(void **state) {
+void test__f_type_array_uint128s_append__parameter_checking(void **state) {
- const int length = 5;
- f_uint128s_t source = f_uint128s_t_initialize;
- f_uint128s_t destination = f_uint128s_t_initialize;
-
- {
- const f_status_t status = f_uint128s_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_uint128s_append(source, &destination);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(destination.used, 0);
- assert_int_equal(destination.size, 0);
- }
-
- free((void *) source.array);
- assert_null(destination.array);
-}
-
-void test__f_type_array_uint128s_append__fails_on_invalid_parameter(void **state) {
-
- const int length = 5;
- f_uint128s_t data = f_uint128s_t_initialize;
+ const uint128_t data = 0;
{
const f_status_t status = f_uint128s_append(data, 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 void test__f_type_array_uint128s_append__works(void **state);
/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_type_array_uint128s_append()
- */
-extern void test__f_type_array_uint128s_append__returns_data_not(void **state);
-
-/**
* Test that the function correctly fails on invalid parameter.
*
* @see f_type_array_uint128s_append()
*/
-extern void test__f_type_array_uint128s_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint128s_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint128s_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-uint128s_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_uint128s_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_used = 2;
+ f_uint128s_t source = f_uint128s_t_initialize;
+ f_uint128s_t destination = f_uint128s_t_initialize;
+
+ {
+ const f_status_t status = f_uint128s_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ for (; source.used < length_used; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
+
+ {
+ const f_status_t status = f_uint128s_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 < source.used; ++i) {
+ assert_int_equal(destination.array[i], i + 1);
+ } // for
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_uint128s_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_uint128s_t source = f_uint128s_t_initialize;
+ f_uint128s_t destination = f_uint128s_t_initialize;
+
+ {
+ const f_status_t status = f_uint128s_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_uint128s_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_type_array_uint128s_append_all__parameter_checking(void **state) {
+
+ const f_uint128s_t data = f_uint128s_t_initialize;
+
+ {
+ const f_status_t status = f_uint128s_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_type_array__uint128s_append_all
+#define _TEST__F_type_array__uint128s_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_uint128s_append_all()
+ */
+extern void test__f_type_array_uint128s_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_uint128s_append_all()
+ */
+extern void test__f_type_array_uint128s_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_uint128s_append_all()
+ */
+extern void test__f_type_array_uint128s_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__uint128s_append_all
assert_null(data.array);
}
-void test__f_type_array_uint128s_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint128s_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_uint128s_t data = f_uint128s_t_initialize;
*
* @see f_type_array_uint128s_decimate_by()
*/
-extern void test__f_type_array_uint128s_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint128s_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint128s_decimate_by
assert_null(data.array);
}
-void test__f_type_array_uint128s_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint128s_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_uint128s_t data = f_uint128s_t_initialize;
*
* @see f_type_array_uint128s_decrease_by()
*/
-extern void test__f_type_array_uint128s_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint128s_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint128s_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_uint128s_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint128s_increase__parameter_checking(void **state) {
const int length = 5;
f_uint128s_t data = f_uint128s_t_initialize;
*
* @see f_type_array_uint128s_increase()
*/
-extern void test__f_type_array_uint128s_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint128s_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint128s_increase
free((void *) data.array);
}
-void test__f_type_array_uint128s_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint128s_increase_by__parameter_checking(void **state) {
const int length = 5;
f_uint128s_t data = f_uint128s_t_initialize;
*
* @see f_type_array_uint128s_increase_by()
*/
-extern void test__f_type_array_uint128s_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint128s_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint128s_increase_by
free((void *) data.array);
}
-void test__f_type_array_uint128s_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint128s_resize__parameter_checking(void **state) {
const int length = 5;
f_uint128s_t data = f_uint128s_t_initialize;
*
* @see f_type_array_uint128s_resize()
*/
-extern void test__f_type_array_uint128s_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint128s_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint128s_resize
free((void *) data.array);
}
-void test__f_type_array_uint128ss_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint128ss_adjust__parameter_checking(void **state) {
const int length = 5;
f_uint128ss_t data = f_uint128ss_t_initialize;
*
* @see f_type_array_uint128ss_adjust()
*/
-extern void test__f_type_array_uint128ss_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint128ss_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint128ss_adjust
void test__f_type_array_uint128ss_append__works(void **state) {
const int length = 5;
- const int length_inner = 2;
- f_uint128ss_t source = f_uint128s_t_initialize;
- f_uint128ss_t destination = f_uint128s_t_initialize;
+ f_uint128s_t source = f_uint128s_t_initialize;
+ f_uint128ss_t destination = f_uint128ss_t_initialize;
{
- const f_status_t status = f_uint128ss_resize(length, &source);
+ const f_status_t status = f_uint128s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
assert_int_equal(source.size, length);
}
- {
- for (; source.used < length; ++source.used) {
-
- const f_status_t status = f_uint128s_resize(length_inner, &source.array[source.used]);
-
- assert_int_equal(status, F_none);
-
- for (f_array_length_t i = 0; i < length_inner; ++i) {
- source.array[source.used].array[source.array[source.used].used++] = i + 1;
- } // for
- } // for
- }
+ for (; source.used < length; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
{
const f_status_t status = f_uint128ss_append(source, &destination);
assert_int_equal(status, F_none);
- assert_int_equal(destination.used, source.used);
- assert_int_equal(destination.size, source.used);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].used, source.used);
+ assert_int_equal(destination.array[0].size, source.used);
- for (f_array_length_t i = 0; i < destination.used; ++i) {
-
- assert_int_equal(destination.array[i].used, length_inner);
- assert_int_equal(destination.array[i].size, length_inner);
-
- for (f_array_length_t j = 0; j < length_inner; ++j) {
- assert_int_equal(destination.array[i].array[j], j + 1);
- } // for
+ for (f_array_length_t i = 0; i < destination.array[0].used; ++i) {
+ assert_int_equal(destination.array[0].array[i], i + 1);
} // for
}
- for (f_array_length_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].array);
- } // for
-
for (f_array_length_t i = 0; i < destination.used; ++i) {
free((void *) destination.array[i].array);
} // for
void test__f_type_array_uint128ss_append__returns_data_not(void **state) {
const int length = 5;
- f_uint128ss_t source = f_uint128s_t_initialize;
- f_uint128ss_t destination = f_uint128s_t_initialize;
+ f_uint128s_t source = f_uint128s_t_initialize;
+ f_uint128ss_t destination = f_uint128ss_t_initialize;
{
- const f_status_t status = f_uint128ss_resize(length, &source);
+ const f_status_t status = f_uint128s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
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);
- assert_null(destination.array);
}
-void test__f_type_array_uint128ss_append__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint128ss_append__parameter_checking(void **state) {
- const int length = 5;
- f_uint128ss_t data = f_uint128s_t_initialize;
+ f_uint128s_t data = f_uint128s_t_initialize;
{
const f_status_t status = f_uint128ss_append(data, 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
*
* @see f_type_array_uint128ss_append()
*/
-extern void test__f_type_array_uint128ss_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint128ss_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint128ss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-uint128ss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_uint128ss_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_uint128ss_t source = f_uint128ss_t_initialize;
+ f_uint128ss_t destination = f_uint128ss_t_initialize;
+
+ {
+ const f_status_t status = f_uint128ss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_uint128s_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ for (f_array_length_t i = 0; i < length_inner; ++i) {
+ source.array[source.used].array[source.array[source.used].used++] = i + 1;
+ } // for
+ } // for
+ }
+
+ {
+ const f_status_t status = f_uint128ss_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 < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ for (f_array_length_t j = 0; j < length_inner; ++j) {
+ assert_int_equal(destination.array[i].array[j], j + 1);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_uint128ss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_uint128ss_t source = f_uint128ss_t_initialize;
+ f_uint128ss_t destination = f_uint128ss_t_initialize;
+
+ {
+ const f_status_t status = f_uint128ss_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_uint128ss_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_type_array_uint128ss_append_all__parameter_checking(void **state) {
+
+ const f_uint128ss_t data = f_uint128ss_t_initialize;
+
+ {
+ const f_status_t status = f_uint128ss_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_type_array__uint128ss_append_all
+#define _TEST__F_type_array__uint128ss_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_uint128ss_append_all()
+ */
+extern void test__f_type_array_uint128ss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_uint128ss_append_all()
+ */
+extern void test__f_type_array_uint128ss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_uint128ss_append_all()
+ */
+extern void test__f_type_array_uint128ss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__uint128ss_append_all
assert_null(data.array);
}
-void test__f_type_array_uint128ss_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint128ss_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_uint128ss_t data = f_uint128s_t_initialize;
*
* @see f_type_array_uint128ss_decimate_by()
*/
-extern void test__f_type_array_uint128ss_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint128ss_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint128ss_decimate_by
assert_null(data.array);
}
-void test__f_type_array_uint128ss_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint128ss_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_uint128ss_t data = f_uint128s_t_initialize;
*
* @see f_type_array_uint128ss_decrease_by()
*/
-extern void test__f_type_array_uint128ss_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint128ss_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint128ss_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_uint128ss_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint128ss_increase__parameter_checking(void **state) {
const int length = 5;
f_uint128ss_t data = f_uint128s_t_initialize;
*
* @see f_type_array_uint128ss_increase()
*/
-extern void test__f_type_array_uint128ss_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint128ss_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint128ss_increase
free((void *) data.array);
}
-void test__f_type_array_uint128ss_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint128ss_increase_by__parameter_checking(void **state) {
const int length = 5;
f_uint128ss_t data = f_uint128s_t_initialize;
*
* @see f_type_array_uint128ss_increase_by()
*/
-extern void test__f_type_array_uint128ss_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint128ss_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint128ss_increase_by
free((void *) data.array);
}
-void test__f_type_array_uint128ss_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint128ss_resize__parameter_checking(void **state) {
const int length = 5;
f_uint128ss_t data = f_uint128ss_t_initialize;
*
* @see f_type_array_uint128ss_resize()
*/
-extern void test__f_type_array_uint128ss_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint128ss_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint128ss_resize
free((void *) data.array);
}
-void test__f_type_array_uint16s_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint16s_adjust__parameter_checking(void **state) {
const int length = 5;
f_uint16s_t data = f_uint16s_t_initialize;
*
* @see f_type_array_uint16s_adjust()
*/
-extern void test__f_type_array_uint16s_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint16s_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint16s_adjust
void test__f_type_array_uint16s_append__works(void **state) {
- const int length = 5;
- const int length_used = 2;
- f_uint16s_t source = f_uint16s_t_initialize;
+ const uint16_t source = 3;
f_uint16s_t destination = f_uint16s_t_initialize;
{
- const f_status_t status = f_uint16s_resize(length, &source);
-
- assert_int_equal(status, F_none);
- assert_int_equal(source.used, 0);
- assert_int_equal(source.size, length);
- }
-
- for (; source.used < length_used; ++source.used) {
- source.array[source.used] = source.used + 1;
- } // for
-
- {
const f_status_t status = f_uint16s_append(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 < source.used; ++i) {
- assert_int_equal(destination.array[i], i + 1);
- } // for
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0], source);
}
- free((void *) source.array);
free((void *) destination.array);
}
-void test__f_type_array_uint16s_append__returns_data_not(void **state) {
+void test__f_type_array_uint16s_append__parameter_checking(void **state) {
- const int length = 5;
- f_uint16s_t source = f_uint16s_t_initialize;
- f_uint16s_t destination = f_uint16s_t_initialize;
-
- {
- const f_status_t status = f_uint16s_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_uint16s_append(source, &destination);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(destination.used, 0);
- assert_int_equal(destination.size, 0);
- }
-
- free((void *) source.array);
- assert_null(destination.array);
-}
-
-void test__f_type_array_uint16s_append__fails_on_invalid_parameter(void **state) {
-
- const int length = 5;
- f_uint16s_t data = f_uint16s_t_initialize;
+ const uint16_t data = 0;
{
const f_status_t status = f_uint16s_append(data, 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 void test__f_type_array_uint16s_append__works(void **state);
/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_type_array_uint16s_append()
- */
-extern void test__f_type_array_uint16s_append__returns_data_not(void **state);
-
-/**
* Test that the function correctly fails on invalid parameter.
*
* @see f_type_array_uint16s_append()
*/
-extern void test__f_type_array_uint16s_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint16s_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint16s_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-uint16s_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_uint16s_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_used = 2;
+ f_uint16s_t source = f_uint16s_t_initialize;
+ f_uint16s_t destination = f_uint16s_t_initialize;
+
+ {
+ const f_status_t status = f_uint16s_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ for (; source.used < length_used; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
+
+ {
+ const f_status_t status = f_uint16s_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 < source.used; ++i) {
+ assert_int_equal(destination.array[i], i + 1);
+ } // for
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_uint16s_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_uint16s_t source = f_uint16s_t_initialize;
+ f_uint16s_t destination = f_uint16s_t_initialize;
+
+ {
+ const f_status_t status = f_uint16s_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_uint16s_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_type_array_uint16s_append_all__parameter_checking(void **state) {
+
+ const f_uint16s_t data = f_uint16s_t_initialize;
+
+ {
+ const f_status_t status = f_uint16s_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_type_array__uint16s_append_all
+#define _TEST__F_type_array__uint16s_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_uint16s_append_all()
+ */
+extern void test__f_type_array_uint16s_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_uint16s_append_all()
+ */
+extern void test__f_type_array_uint16s_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_uint16s_append_all()
+ */
+extern void test__f_type_array_uint16s_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__uint16s_append_all
assert_null(data.array);
}
-void test__f_type_array_uint16s_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint16s_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_uint16s_t data = f_uint16s_t_initialize;
*
* @see f_type_array_uint16s_decimate_by()
*/
-extern void test__f_type_array_uint16s_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint16s_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint16s_decimate_by
assert_null(data.array);
}
-void test__f_type_array_uint16s_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint16s_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_uint16s_t data = f_uint16s_t_initialize;
*
* @see f_type_array_uint16s_decrease_by()
*/
-extern void test__f_type_array_uint16s_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint16s_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint16s_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_uint16s_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint16s_increase__parameter_checking(void **state) {
const int length = 5;
f_uint16s_t data = f_uint16s_t_initialize;
*
* @see f_type_array_uint16s_increase()
*/
-extern void test__f_type_array_uint16s_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint16s_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint16s_increase
free((void *) data.array);
}
-void test__f_type_array_uint16s_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint16s_increase_by__parameter_checking(void **state) {
const int length = 5;
f_uint16s_t data = f_uint16s_t_initialize;
*
* @see f_type_array_uint16s_increase_by()
*/
-extern void test__f_type_array_uint16s_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint16s_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint16s_increase_by
free((void *) data.array);
}
-void test__f_type_array_uint16s_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint16s_resize__parameter_checking(void **state) {
const int length = 5;
f_uint16s_t data = f_uint16s_t_initialize;
*
* @see f_type_array_uint16s_resize()
*/
-extern void test__f_type_array_uint16s_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint16s_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint16s_resize
free((void *) data.array);
}
-void test__f_type_array_uint16ss_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint16ss_adjust__parameter_checking(void **state) {
const int length = 5;
f_uint16ss_t data = f_uint16ss_t_initialize;
*
* @see f_type_array_uint16ss_adjust()
*/
-extern void test__f_type_array_uint16ss_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint16ss_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint16ss_adjust
void test__f_type_array_uint16ss_append__works(void **state) {
const int length = 5;
- const int length_inner = 2;
- f_uint16ss_t source = f_uint16s_t_initialize;
- f_uint16ss_t destination = f_uint16s_t_initialize;
+ f_uint16s_t source = f_uint16s_t_initialize;
+ f_uint16ss_t destination = f_uint16ss_t_initialize;
{
- const f_status_t status = f_uint16ss_resize(length, &source);
+ const f_status_t status = f_uint16s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
assert_int_equal(source.size, length);
}
- {
- for (; source.used < length; ++source.used) {
-
- const f_status_t status = f_uint16s_resize(length_inner, &source.array[source.used]);
-
- assert_int_equal(status, F_none);
-
- for (f_array_length_t i = 0; i < length_inner; ++i) {
- source.array[source.used].array[source.array[source.used].used++] = i + 1;
- } // for
- } // for
- }
+ for (; source.used < length; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
{
const f_status_t status = f_uint16ss_append(source, &destination);
assert_int_equal(status, F_none);
- assert_int_equal(destination.used, source.used);
- assert_int_equal(destination.size, source.used);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].used, source.used);
+ assert_int_equal(destination.array[0].size, source.used);
- for (f_array_length_t i = 0; i < destination.used; ++i) {
-
- assert_int_equal(destination.array[i].used, length_inner);
- assert_int_equal(destination.array[i].size, length_inner);
-
- for (f_array_length_t j = 0; j < length_inner; ++j) {
- assert_int_equal(destination.array[i].array[j], j + 1);
- } // for
+ for (f_array_length_t i = 0; i < destination.array[0].used; ++i) {
+ assert_int_equal(destination.array[0].array[i], i + 1);
} // for
}
- for (f_array_length_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].array);
- } // for
-
for (f_array_length_t i = 0; i < destination.used; ++i) {
free((void *) destination.array[i].array);
} // for
void test__f_type_array_uint16ss_append__returns_data_not(void **state) {
const int length = 5;
- f_uint16ss_t source = f_uint16s_t_initialize;
- f_uint16ss_t destination = f_uint16s_t_initialize;
+ f_uint16s_t source = f_uint16s_t_initialize;
+ f_uint16ss_t destination = f_uint16ss_t_initialize;
{
- const f_status_t status = f_uint16ss_resize(length, &source);
+ const f_status_t status = f_uint16s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
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);
- assert_null(destination.array);
}
-void test__f_type_array_uint16ss_append__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint16ss_append__parameter_checking(void **state) {
- const int length = 5;
- f_uint16ss_t data = f_uint16s_t_initialize;
+ f_uint16s_t data = f_uint16s_t_initialize;
{
const f_status_t status = f_uint16ss_append(data, 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
*
* @see f_type_array_uint16ss_append()
*/
-extern void test__f_type_array_uint16ss_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint16ss_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint16ss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-uint16ss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_uint16ss_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_uint16ss_t source = f_uint16ss_t_initialize;
+ f_uint16ss_t destination = f_uint16ss_t_initialize;
+
+ {
+ const f_status_t status = f_uint16ss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_uint16s_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ for (f_array_length_t i = 0; i < length_inner; ++i) {
+ source.array[source.used].array[source.array[source.used].used++] = i + 1;
+ } // for
+ } // for
+ }
+
+ {
+ const f_status_t status = f_uint16ss_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 < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ for (f_array_length_t j = 0; j < length_inner; ++j) {
+ assert_int_equal(destination.array[i].array[j], j + 1);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_uint16ss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_uint16ss_t source = f_uint16ss_t_initialize;
+ f_uint16ss_t destination = f_uint16ss_t_initialize;
+
+ {
+ const f_status_t status = f_uint16ss_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_uint16ss_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_type_array_uint16ss_append_all__parameter_checking(void **state) {
+
+ const f_uint16ss_t data = f_uint16ss_t_initialize;
+
+ {
+ const f_status_t status = f_uint16ss_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_type_array__uint16ss_append_all
+#define _TEST__F_type_array__uint16ss_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_uint16ss_append_all()
+ */
+extern void test__f_type_array_uint16ss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_uint16ss_append_all()
+ */
+extern void test__f_type_array_uint16ss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_uint16ss_append_all()
+ */
+extern void test__f_type_array_uint16ss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__uint16ss_append_all
assert_null(data.array);
}
-void test__f_type_array_uint16ss_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint16ss_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_uint16ss_t data = f_uint16s_t_initialize;
*
* @see f_type_array_uint16ss_decimate_by()
*/
-extern void test__f_type_array_uint16ss_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint16ss_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint16ss_decimate_by
assert_null(data.array);
}
-void test__f_type_array_uint16ss_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint16ss_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_uint16ss_t data = f_uint16s_t_initialize;
*
* @see f_type_array_uint16ss_decrease_by()
*/
-extern void test__f_type_array_uint16ss_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint16ss_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint16ss_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_uint16ss_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint16ss_increase__parameter_checking(void **state) {
const int length = 5;
f_uint16ss_t data = f_uint16s_t_initialize;
*
* @see f_type_array_uint16ss_increase()
*/
-extern void test__f_type_array_uint16ss_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint16ss_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint16ss_increase
free((void *) data.array);
}
-void test__f_type_array_uint16ss_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint16ss_increase_by__parameter_checking(void **state) {
const int length = 5;
f_uint16ss_t data = f_uint16s_t_initialize;
*
* @see f_type_array_uint16ss_increase_by()
*/
-extern void test__f_type_array_uint16ss_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint16ss_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint16ss_increase_by
free((void *) data.array);
}
-void test__f_type_array_uint16ss_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint16ss_resize__parameter_checking(void **state) {
const int length = 5;
f_uint16ss_t data = f_uint16ss_t_initialize;
*
* @see f_type_array_uint16ss_resize()
*/
-extern void test__f_type_array_uint16ss_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint16ss_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint16ss_resize
free((void *) data.array);
}
-void test__f_type_array_uint32s_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint32s_adjust__parameter_checking(void **state) {
const int length = 5;
f_uint32s_t data = f_uint32s_t_initialize;
*
* @see f_type_array_uint32s_adjust()
*/
-extern void test__f_type_array_uint32s_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint32s_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint32s_adjust
void test__f_type_array_uint32s_append__works(void **state) {
- const int length = 5;
- const int length_used = 2;
- f_uint32s_t source = f_uint32s_t_initialize;
+ const uint32_t source = 3;
f_uint32s_t destination = f_uint32s_t_initialize;
{
- const f_status_t status = f_uint32s_resize(length, &source);
-
- assert_int_equal(status, F_none);
- assert_int_equal(source.used, 0);
- assert_int_equal(source.size, length);
- }
-
- for (; source.used < length_used; ++source.used) {
- source.array[source.used] = source.used + 1;
- } // for
-
- {
const f_status_t status = f_uint32s_append(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 < source.used; ++i) {
- assert_int_equal(destination.array[i], i + 1);
- } // for
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0], source);
}
- free((void *) source.array);
free((void *) destination.array);
}
-void test__f_type_array_uint32s_append__returns_data_not(void **state) {
+void test__f_type_array_uint32s_append__parameter_checking(void **state) {
- const int length = 5;
- f_uint32s_t source = f_uint32s_t_initialize;
- f_uint32s_t destination = f_uint32s_t_initialize;
-
- {
- const f_status_t status = f_uint32s_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_uint32s_append(source, &destination);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(destination.used, 0);
- assert_int_equal(destination.size, 0);
- }
-
- free((void *) source.array);
- assert_null(destination.array);
-}
-
-void test__f_type_array_uint32s_append__fails_on_invalid_parameter(void **state) {
-
- const int length = 5;
- f_uint32s_t data = f_uint32s_t_initialize;
+ const uint32_t data = 0;
{
const f_status_t status = f_uint32s_append(data, 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 void test__f_type_array_uint32s_append__works(void **state);
/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_type_array_uint32s_append()
- */
-extern void test__f_type_array_uint32s_append__returns_data_not(void **state);
-
-/**
* Test that the function correctly fails on invalid parameter.
*
* @see f_type_array_uint32s_append()
*/
-extern void test__f_type_array_uint32s_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint32s_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint32s_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-uint32s_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_uint32s_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_used = 2;
+ f_uint32s_t source = f_uint32s_t_initialize;
+ f_uint32s_t destination = f_uint32s_t_initialize;
+
+ {
+ const f_status_t status = f_uint32s_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ for (; source.used < length_used; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
+
+ {
+ const f_status_t status = f_uint32s_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 < source.used; ++i) {
+ assert_int_equal(destination.array[i], i + 1);
+ } // for
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_uint32s_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_uint32s_t source = f_uint32s_t_initialize;
+ f_uint32s_t destination = f_uint32s_t_initialize;
+
+ {
+ const f_status_t status = f_uint32s_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_uint32s_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_type_array_uint32s_append_all__parameter_checking(void **state) {
+
+ const f_uint32s_t data = f_uint32s_t_initialize;
+
+ {
+ const f_status_t status = f_uint32s_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_type_array__uint32s_append_all
+#define _TEST__F_type_array__uint32s_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_uint32s_append_all()
+ */
+extern void test__f_type_array_uint32s_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_uint32s_append_all()
+ */
+extern void test__f_type_array_uint32s_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_uint32s_append_all()
+ */
+extern void test__f_type_array_uint32s_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__uint32s_append_all
assert_null(data.array);
}
-void test__f_type_array_uint32s_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint32s_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_uint32s_t data = f_uint32s_t_initialize;
*
* @see f_type_array_uint32s_decimate_by()
*/
-extern void test__f_type_array_uint32s_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint32s_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint32s_decimate_by
assert_null(data.array);
}
-void test__f_type_array_uint32s_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint32s_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_uint32s_t data = f_uint32s_t_initialize;
*
* @see f_type_array_uint32s_decrease_by()
*/
-extern void test__f_type_array_uint32s_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint32s_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint32s_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_uint32s_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint32s_increase__parameter_checking(void **state) {
const int length = 5;
f_uint32s_t data = f_uint32s_t_initialize;
*
* @see f_type_array_uint32s_increase()
*/
-extern void test__f_type_array_uint32s_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint32s_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint32s_increase
free((void *) data.array);
}
-void test__f_type_array_uint32s_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint32s_increase_by__parameter_checking(void **state) {
const int length = 5;
f_uint32s_t data = f_uint32s_t_initialize;
*
* @see f_type_array_uint32s_increase_by()
*/
-extern void test__f_type_array_uint32s_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint32s_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint32s_increase_by
free((void *) data.array);
}
-void test__f_type_array_uint32s_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint32s_resize__parameter_checking(void **state) {
const int length = 5;
f_uint32s_t data = f_uint32s_t_initialize;
*
* @see f_type_array_uint32s_resize()
*/
-extern void test__f_type_array_uint32s_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint32s_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint32s_resize
free((void *) data.array);
}
-void test__f_type_array_uint32ss_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint32ss_adjust__parameter_checking(void **state) {
const int length = 5;
f_uint32ss_t data = f_uint32ss_t_initialize;
*
* @see f_type_array_uint32ss_adjust()
*/
-extern void test__f_type_array_uint32ss_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint32ss_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint32ss_adjust
void test__f_type_array_uint32ss_append__works(void **state) {
const int length = 5;
- const int length_inner = 2;
- f_uint32ss_t source = f_uint32s_t_initialize;
- f_uint32ss_t destination = f_uint32s_t_initialize;
+ f_uint32s_t source = f_uint32s_t_initialize;
+ f_uint32ss_t destination = f_uint32ss_t_initialize;
{
- const f_status_t status = f_uint32ss_resize(length, &source);
+ const f_status_t status = f_uint32s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
assert_int_equal(source.size, length);
}
- {
- for (; source.used < length; ++source.used) {
-
- const f_status_t status = f_uint32s_resize(length_inner, &source.array[source.used]);
-
- assert_int_equal(status, F_none);
-
- for (f_array_length_t i = 0; i < length_inner; ++i) {
- source.array[source.used].array[source.array[source.used].used++] = i + 1;
- } // for
- } // for
- }
+ for (; source.used < length; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
{
const f_status_t status = f_uint32ss_append(source, &destination);
assert_int_equal(status, F_none);
- assert_int_equal(destination.used, source.used);
- assert_int_equal(destination.size, source.used);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].used, source.used);
+ assert_int_equal(destination.array[0].size, source.used);
- for (f_array_length_t i = 0; i < destination.used; ++i) {
-
- assert_int_equal(destination.array[i].used, length_inner);
- assert_int_equal(destination.array[i].size, length_inner);
-
- for (f_array_length_t j = 0; j < length_inner; ++j) {
- assert_int_equal(destination.array[i].array[j], j + 1);
- } // for
+ for (f_array_length_t i = 0; i < destination.array[0].used; ++i) {
+ assert_int_equal(destination.array[0].array[i], i + 1);
} // for
}
- for (f_array_length_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].array);
- } // for
-
for (f_array_length_t i = 0; i < destination.used; ++i) {
free((void *) destination.array[i].array);
} // for
void test__f_type_array_uint32ss_append__returns_data_not(void **state) {
const int length = 5;
- f_uint32ss_t source = f_uint32s_t_initialize;
- f_uint32ss_t destination = f_uint32s_t_initialize;
+ f_uint32s_t source = f_uint32s_t_initialize;
+ f_uint32ss_t destination = f_uint32ss_t_initialize;
{
- const f_status_t status = f_uint32ss_resize(length, &source);
+ const f_status_t status = f_uint32s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
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);
- assert_null(destination.array);
}
-void test__f_type_array_uint32ss_append__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint32ss_append__parameter_checking(void **state) {
- const int length = 5;
- f_uint32ss_t data = f_uint32s_t_initialize;
+ f_uint32s_t data = f_uint32s_t_initialize;
{
const f_status_t status = f_uint32ss_append(data, 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
*
* @see f_type_array_uint32ss_append()
*/
-extern void test__f_type_array_uint32ss_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint32ss_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint32ss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-uint32ss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_uint32ss_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_uint32ss_t source = f_uint32ss_t_initialize;
+ f_uint32ss_t destination = f_uint32ss_t_initialize;
+
+ {
+ const f_status_t status = f_uint32ss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_uint32s_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ for (f_array_length_t i = 0; i < length_inner; ++i) {
+ source.array[source.used].array[source.array[source.used].used++] = i + 1;
+ } // for
+ } // for
+ }
+
+ {
+ const f_status_t status = f_uint32ss_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 < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ for (f_array_length_t j = 0; j < length_inner; ++j) {
+ assert_int_equal(destination.array[i].array[j], j + 1);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_uint32ss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_uint32ss_t source = f_uint32ss_t_initialize;
+ f_uint32ss_t destination = f_uint32ss_t_initialize;
+
+ {
+ const f_status_t status = f_uint32ss_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_uint32ss_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_type_array_uint32ss_append_all__parameter_checking(void **state) {
+
+ const f_uint32ss_t data = f_uint32ss_t_initialize;
+
+ {
+ const f_status_t status = f_uint32ss_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_type_array__uint32ss_append_all
+#define _TEST__F_type_array__uint32ss_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_uint32ss_append_all()
+ */
+extern void test__f_type_array_uint32ss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_uint32ss_append_all()
+ */
+extern void test__f_type_array_uint32ss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_uint32ss_append_all()
+ */
+extern void test__f_type_array_uint32ss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__uint32ss_append_all
assert_null(data.array);
}
-void test__f_type_array_uint32ss_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint32ss_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_uint32ss_t data = f_uint32s_t_initialize;
*
* @see f_type_array_uint32ss_decimate_by()
*/
-extern void test__f_type_array_uint32ss_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint32ss_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint32ss_decimate_by
assert_null(data.array);
}
-void test__f_type_array_uint32ss_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint32ss_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_uint32ss_t data = f_uint32s_t_initialize;
*
* @see f_type_array_uint32ss_decrease_by()
*/
-extern void test__f_type_array_uint32ss_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint32ss_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint32ss_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_uint32ss_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint32ss_increase__parameter_checking(void **state) {
const int length = 5;
f_uint32ss_t data = f_uint32s_t_initialize;
*
* @see f_type_array_uint32ss_increase()
*/
-extern void test__f_type_array_uint32ss_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint32ss_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint32ss_increase
free((void *) data.array);
}
-void test__f_type_array_uint32ss_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint32ss_increase_by__parameter_checking(void **state) {
const int length = 5;
f_uint32ss_t data = f_uint32s_t_initialize;
*
* @see f_type_array_uint32ss_increase_by()
*/
-extern void test__f_type_array_uint32ss_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint32ss_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint32ss_increase_by
free((void *) data.array);
}
-void test__f_type_array_uint32ss_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint32ss_resize__parameter_checking(void **state) {
const int length = 5;
f_uint32ss_t data = f_uint32ss_t_initialize;
*
* @see f_type_array_uint32ss_resize()
*/
-extern void test__f_type_array_uint32ss_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint32ss_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint32ss_resize
free((void *) data.array);
}
-void test__f_type_array_uint64s_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint64s_adjust__parameter_checking(void **state) {
const int length = 5;
f_uint64s_t data = f_uint64s_t_initialize;
*
* @see f_type_array_uint64s_adjust()
*/
-extern void test__f_type_array_uint64s_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint64s_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint64s_adjust
void test__f_type_array_uint64s_append__works(void **state) {
- const int length = 5;
- const int length_used = 2;
- f_uint64s_t source = f_uint64s_t_initialize;
+ const uint64_t source = 3;
f_uint64s_t destination = f_uint64s_t_initialize;
{
- const f_status_t status = f_uint64s_resize(length, &source);
-
- assert_int_equal(status, F_none);
- assert_int_equal(source.used, 0);
- assert_int_equal(source.size, length);
- }
-
- for (; source.used < length_used; ++source.used) {
- source.array[source.used] = source.used + 1;
- } // for
-
- {
const f_status_t status = f_uint64s_append(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 < source.used; ++i) {
- assert_int_equal(destination.array[i], i + 1);
- } // for
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0], source);
}
- free((void *) source.array);
free((void *) destination.array);
}
-void test__f_type_array_uint64s_append__returns_data_not(void **state) {
+void test__f_type_array_uint64s_append__parameter_checking(void **state) {
- const int length = 5;
- f_uint64s_t source = f_uint64s_t_initialize;
- f_uint64s_t destination = f_uint64s_t_initialize;
-
- {
- const f_status_t status = f_uint64s_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_uint64s_append(source, &destination);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(destination.used, 0);
- assert_int_equal(destination.size, 0);
- }
-
- free((void *) source.array);
- assert_null(destination.array);
-}
-
-void test__f_type_array_uint64s_append__fails_on_invalid_parameter(void **state) {
-
- const int length = 5;
- f_uint64s_t data = f_uint64s_t_initialize;
+ const uint64_t data = 0;
{
const f_status_t status = f_uint64s_append(data, 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 void test__f_type_array_uint64s_append__works(void **state);
/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_type_array_uint64s_append()
- */
-extern void test__f_type_array_uint64s_append__returns_data_not(void **state);
-
-/**
* Test that the function correctly fails on invalid parameter.
*
* @see f_type_array_uint64s_append()
*/
-extern void test__f_type_array_uint64s_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint64s_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint64s_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-uint64s_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_uint64s_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_used = 2;
+ f_uint64s_t source = f_uint64s_t_initialize;
+ f_uint64s_t destination = f_uint64s_t_initialize;
+
+ {
+ const f_status_t status = f_uint64s_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ for (; source.used < length_used; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
+
+ {
+ const f_status_t status = f_uint64s_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 < source.used; ++i) {
+ assert_int_equal(destination.array[i], i + 1);
+ } // for
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_uint64s_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_uint64s_t source = f_uint64s_t_initialize;
+ f_uint64s_t destination = f_uint64s_t_initialize;
+
+ {
+ const f_status_t status = f_uint64s_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_uint64s_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_type_array_uint64s_append_all__parameter_checking(void **state) {
+
+ const f_uint64s_t data = f_uint64s_t_initialize;
+
+ {
+ const f_status_t status = f_uint64s_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_type_array__uint64s_append_all
+#define _TEST__F_type_array__uint64s_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_uint64s_append_all()
+ */
+extern void test__f_type_array_uint64s_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_uint64s_append_all()
+ */
+extern void test__f_type_array_uint64s_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_uint64s_append_all()
+ */
+extern void test__f_type_array_uint64s_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__uint64s_append_all
assert_null(data.array);
}
-void test__f_type_array_uint64s_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint64s_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_uint64s_t data = f_uint64s_t_initialize;
*
* @see f_type_array_uint64s_decimate_by()
*/
-extern void test__f_type_array_uint64s_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint64s_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint64s_decimate_by
assert_null(data.array);
}
-void test__f_type_array_uint64s_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint64s_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_uint64s_t data = f_uint64s_t_initialize;
*
* @see f_type_array_uint64s_decrease_by()
*/
-extern void test__f_type_array_uint64s_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint64s_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint64s_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_uint64s_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint64s_increase__parameter_checking(void **state) {
const int length = 5;
f_uint64s_t data = f_uint64s_t_initialize;
*
* @see f_type_array_uint64s_increase()
*/
-extern void test__f_type_array_uint64s_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint64s_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint64s_increase
free((void *) data.array);
}
-void test__f_type_array_uint64s_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint64s_increase_by__parameter_checking(void **state) {
const int length = 5;
f_uint64s_t data = f_uint64s_t_initialize;
*
* @see f_type_array_uint64s_increase_by()
*/
-extern void test__f_type_array_uint64s_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint64s_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint64s_increase_by
free((void *) data.array);
}
-void test__f_type_array_uint64s_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint64s_resize__parameter_checking(void **state) {
const int length = 5;
f_uint64s_t data = f_uint64s_t_initialize;
*
* @see f_type_array_uint64s_resize()
*/
-extern void test__f_type_array_uint64s_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint64s_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint64s_resize
free((void *) data.array);
}
-void test__f_type_array_uint64ss_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint64ss_adjust__parameter_checking(void **state) {
const int length = 5;
f_uint64ss_t data = f_uint64ss_t_initialize;
*
* @see f_type_array_uint64ss_adjust()
*/
-extern void test__f_type_array_uint64ss_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint64ss_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint64ss_adjust
void test__f_type_array_uint64ss_append__works(void **state) {
const int length = 5;
- const int length_inner = 2;
- f_uint64ss_t source = f_uint64s_t_initialize;
- f_uint64ss_t destination = f_uint64s_t_initialize;
+ f_uint64s_t source = f_uint64s_t_initialize;
+ f_uint64ss_t destination = f_uint64ss_t_initialize;
{
- const f_status_t status = f_uint64ss_resize(length, &source);
+ const f_status_t status = f_uint64s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
assert_int_equal(source.size, length);
}
- {
- for (; source.used < length; ++source.used) {
-
- const f_status_t status = f_uint64s_resize(length_inner, &source.array[source.used]);
-
- assert_int_equal(status, F_none);
-
- for (f_array_length_t i = 0; i < length_inner; ++i) {
- source.array[source.used].array[source.array[source.used].used++] = i + 1;
- } // for
- } // for
- }
+ for (; source.used < length; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
{
const f_status_t status = f_uint64ss_append(source, &destination);
assert_int_equal(status, F_none);
- assert_int_equal(destination.used, source.used);
- assert_int_equal(destination.size, source.used);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].used, source.used);
+ assert_int_equal(destination.array[0].size, source.used);
- for (f_array_length_t i = 0; i < destination.used; ++i) {
-
- assert_int_equal(destination.array[i].used, length_inner);
- assert_int_equal(destination.array[i].size, length_inner);
-
- for (f_array_length_t j = 0; j < length_inner; ++j) {
- assert_int_equal(destination.array[i].array[j], j + 1);
- } // for
+ for (f_array_length_t i = 0; i < destination.array[0].used; ++i) {
+ assert_int_equal(destination.array[0].array[i], i + 1);
} // for
}
- for (f_array_length_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].array);
- } // for
-
for (f_array_length_t i = 0; i < destination.used; ++i) {
free((void *) destination.array[i].array);
} // for
void test__f_type_array_uint64ss_append__returns_data_not(void **state) {
const int length = 5;
- f_uint64ss_t source = f_uint64s_t_initialize;
- f_uint64ss_t destination = f_uint64s_t_initialize;
+ f_uint64s_t source = f_uint64s_t_initialize;
+ f_uint64ss_t destination = f_uint64ss_t_initialize;
{
- const f_status_t status = f_uint64ss_resize(length, &source);
+ const f_status_t status = f_uint64s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
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);
- assert_null(destination.array);
}
-void test__f_type_array_uint64ss_append__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint64ss_append__parameter_checking(void **state) {
- const int length = 5;
- f_uint64ss_t data = f_uint64s_t_initialize;
+ f_uint64s_t data = f_uint64s_t_initialize;
{
const f_status_t status = f_uint64ss_append(data, 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
*
* @see f_type_array_uint64ss_append()
*/
-extern void test__f_type_array_uint64ss_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint64ss_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint64ss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-uint64ss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_uint64ss_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_uint64ss_t source = f_uint64ss_t_initialize;
+ f_uint64ss_t destination = f_uint64ss_t_initialize;
+
+ {
+ const f_status_t status = f_uint64ss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_uint64s_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ for (f_array_length_t i = 0; i < length_inner; ++i) {
+ source.array[source.used].array[source.array[source.used].used++] = i + 1;
+ } // for
+ } // for
+ }
+
+ {
+ const f_status_t status = f_uint64ss_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 < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ for (f_array_length_t j = 0; j < length_inner; ++j) {
+ assert_int_equal(destination.array[i].array[j], j + 1);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_uint64ss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_uint64ss_t source = f_uint64ss_t_initialize;
+ f_uint64ss_t destination = f_uint64ss_t_initialize;
+
+ {
+ const f_status_t status = f_uint64ss_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_uint64ss_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_type_array_uint64ss_append_all__parameter_checking(void **state) {
+
+ const f_uint64ss_t data = f_uint64ss_t_initialize;
+
+ {
+ const f_status_t status = f_uint64ss_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_type_array__uint64ss_append_all
+#define _TEST__F_type_array__uint64ss_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_uint64ss_append_all()
+ */
+extern void test__f_type_array_uint64ss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_uint64ss_append_all()
+ */
+extern void test__f_type_array_uint64ss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_uint64ss_append_all()
+ */
+extern void test__f_type_array_uint64ss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__uint64ss_append_all
assert_null(data.array);
}
-void test__f_type_array_uint64ss_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint64ss_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_uint64ss_t data = f_uint64s_t_initialize;
*
* @see f_type_array_uint64ss_decimate_by()
*/
-extern void test__f_type_array_uint64ss_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint64ss_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint64ss_decimate_by
assert_null(data.array);
}
-void test__f_type_array_uint64ss_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint64ss_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_uint64ss_t data = f_uint64s_t_initialize;
*
* @see f_type_array_uint64ss_decrease_by()
*/
-extern void test__f_type_array_uint64ss_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint64ss_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint64ss_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_uint64ss_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint64ss_increase__parameter_checking(void **state) {
const int length = 5;
f_uint64ss_t data = f_uint64s_t_initialize;
*
* @see f_type_array_uint64ss_increase()
*/
-extern void test__f_type_array_uint64ss_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint64ss_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint64ss_increase
free((void *) data.array);
}
-void test__f_type_array_uint64ss_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint64ss_increase_by__parameter_checking(void **state) {
const int length = 5;
f_uint64ss_t data = f_uint64s_t_initialize;
*
* @see f_type_array_uint64ss_increase_by()
*/
-extern void test__f_type_array_uint64ss_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint64ss_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint64ss_increase_by
free((void *) data.array);
}
-void test__f_type_array_uint64ss_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint64ss_resize__parameter_checking(void **state) {
const int length = 5;
f_uint64ss_t data = f_uint64ss_t_initialize;
*
* @see f_type_array_uint64ss_resize()
*/
-extern void test__f_type_array_uint64ss_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint64ss_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint64ss_resize
free((void *) data.array);
}
-void test__f_type_array_uint8s_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint8s_adjust__parameter_checking(void **state) {
const int length = 5;
f_uint8s_t data = f_uint8s_t_initialize;
*
* @see f_type_array_uint8s_adjust()
*/
-extern void test__f_type_array_uint8s_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint8s_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint8s_adjust
void test__f_type_array_uint8s_append__works(void **state) {
- const int length = 5;
- const int length_used = 2;
- f_uint8s_t source = f_uint8s_t_initialize;
+ const uint8_t source = 3;
f_uint8s_t destination = f_uint8s_t_initialize;
{
- const f_status_t status = f_uint8s_resize(length, &source);
-
- assert_int_equal(status, F_none);
- assert_int_equal(source.used, 0);
- assert_int_equal(source.size, length);
- }
-
- for (; source.used < length_used; ++source.used) {
- source.array[source.used] = source.used + 1;
- } // for
-
- {
const f_status_t status = f_uint8s_append(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 < source.used; ++i) {
- assert_int_equal(destination.array[i], i + 1);
- } // for
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0], source);
}
- free((void *) source.array);
free((void *) destination.array);
}
-void test__f_type_array_uint8s_append__returns_data_not(void **state) {
+void test__f_type_array_uint8s_append__parameter_checking(void **state) {
- const int length = 5;
- f_uint8s_t source = f_uint8s_t_initialize;
- f_uint8s_t destination = f_uint8s_t_initialize;
-
- {
- const f_status_t status = f_uint8s_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_uint8s_append(source, &destination);
-
- assert_int_equal(status, F_data_not);
- assert_int_equal(destination.used, 0);
- assert_int_equal(destination.size, 0);
- }
-
- free((void *) source.array);
- assert_null(destination.array);
-}
-
-void test__f_type_array_uint8s_append__fails_on_invalid_parameter(void **state) {
-
- const int length = 5;
- f_uint8s_t data = f_uint8s_t_initialize;
+ const uint8_t data = 0;
{
const f_status_t status = f_uint8s_append(data, 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 void test__f_type_array_uint8s_append__works(void **state);
/**
- * Test that the function returns F_data_not when asked to copy an empty structure.
- *
- * @see f_type_array_uint8s_append()
- */
-extern void test__f_type_array_uint8s_append__returns_data_not(void **state);
-
-/**
* Test that the function correctly fails on invalid parameter.
*
* @see f_type_array_uint8s_append()
*/
-extern void test__f_type_array_uint8s_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint8s_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint8s_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-uint8s_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_uint8s_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_used = 2;
+ f_uint8s_t source = f_uint8s_t_initialize;
+ f_uint8s_t destination = f_uint8s_t_initialize;
+
+ {
+ const f_status_t status = f_uint8s_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ for (; source.used < length_used; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
+
+ {
+ const f_status_t status = f_uint8s_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 < source.used; ++i) {
+ assert_int_equal(destination.array[i], i + 1);
+ } // for
+ }
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_uint8s_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_uint8s_t source = f_uint8s_t_initialize;
+ f_uint8s_t destination = f_uint8s_t_initialize;
+
+ {
+ const f_status_t status = f_uint8s_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_uint8s_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_type_array_uint8s_append_all__parameter_checking(void **state) {
+
+ const f_uint8s_t data = f_uint8s_t_initialize;
+
+ {
+ const f_status_t status = f_uint8s_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_type_array__uint8s_append_all
+#define _TEST__F_type_array__uint8s_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_uint8s_append_all()
+ */
+extern void test__f_type_array_uint8s_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_uint8s_append_all()
+ */
+extern void test__f_type_array_uint8s_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_uint8s_append_all()
+ */
+extern void test__f_type_array_uint8s_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__uint8s_append_all
assert_null(data.array);
}
-void test__f_type_array_uint8s_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint8s_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_uint8s_t data = f_uint8s_t_initialize;
*
* @see f_type_array_uint8s_decimate_by()
*/
-extern void test__f_type_array_uint8s_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint8s_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint8s_decimate_by
assert_null(data.array);
}
-void test__f_type_array_uint8s_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint8s_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_uint8s_t data = f_uint8s_t_initialize;
*
* @see f_type_array_uint8s_decrease_by()
*/
-extern void test__f_type_array_uint8s_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint8s_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint8s_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_uint8s_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint8s_increase__parameter_checking(void **state) {
const int length = 5;
f_uint8s_t data = f_uint8s_t_initialize;
*
* @see f_type_array_uint8s_increase()
*/
-extern void test__f_type_array_uint8s_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint8s_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint8s_increase
free((void *) data.array);
}
-void test__f_type_array_uint8s_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint8s_increase_by__parameter_checking(void **state) {
const int length = 5;
f_uint8s_t data = f_uint8s_t_initialize;
*
* @see f_type_array_uint8s_increase_by()
*/
-extern void test__f_type_array_uint8s_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint8s_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint8s_increase_by
free((void *) data.array);
}
-void test__f_type_array_uint8s_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint8s_resize__parameter_checking(void **state) {
const int length = 5;
f_uint8s_t data = f_uint8s_t_initialize;
*
* @see f_type_array_uint8s_resize()
*/
-extern void test__f_type_array_uint8s_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint8s_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint8s_resize
free((void *) data.array);
}
-void test__f_type_array_uint8ss_adjust__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint8ss_adjust__parameter_checking(void **state) {
const int length = 5;
f_uint8ss_t data = f_uint8ss_t_initialize;
*
* @see f_type_array_uint8ss_adjust()
*/
-extern void test__f_type_array_uint8ss_adjust__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint8ss_adjust__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint8ss_adjust
void test__f_type_array_uint8ss_append__works(void **state) {
const int length = 5;
- const int length_inner = 2;
- f_uint8ss_t source = f_uint8s_t_initialize;
- f_uint8ss_t destination = f_uint8s_t_initialize;
+ f_uint8s_t source = f_uint8s_t_initialize;
+ f_uint8ss_t destination = f_uint8ss_t_initialize;
{
- const f_status_t status = f_uint8ss_resize(length, &source);
+ const f_status_t status = f_uint8s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
assert_int_equal(source.size, length);
}
- {
- for (; source.used < length; ++source.used) {
-
- const f_status_t status = f_uint8s_resize(length_inner, &source.array[source.used]);
-
- assert_int_equal(status, F_none);
-
- for (f_array_length_t i = 0; i < length_inner; ++i) {
- source.array[source.used].array[source.array[source.used].used++] = i + 1;
- } // for
- } // for
- }
+ for (; source.used < length; ++source.used) {
+ source.array[source.used] = source.used + 1;
+ } // for
{
const f_status_t status = f_uint8ss_append(source, &destination);
assert_int_equal(status, F_none);
- assert_int_equal(destination.used, source.used);
- assert_int_equal(destination.size, source.used);
+ assert_int_equal(destination.used, 1);
+ assert_int_equal(destination.array[0].used, source.used);
+ assert_int_equal(destination.array[0].size, source.used);
- for (f_array_length_t i = 0; i < destination.used; ++i) {
-
- assert_int_equal(destination.array[i].used, length_inner);
- assert_int_equal(destination.array[i].size, length_inner);
-
- for (f_array_length_t j = 0; j < length_inner; ++j) {
- assert_int_equal(destination.array[i].array[j], j + 1);
- } // for
+ for (f_array_length_t i = 0; i < destination.array[0].used; ++i) {
+ assert_int_equal(destination.array[0].array[i], i + 1);
} // for
}
- for (f_array_length_t i = 0; i < source.used; ++i) {
- free((void *) source.array[i].array);
- } // for
-
for (f_array_length_t i = 0; i < destination.used; ++i) {
free((void *) destination.array[i].array);
} // for
void test__f_type_array_uint8ss_append__returns_data_not(void **state) {
const int length = 5;
- f_uint8ss_t source = f_uint8s_t_initialize;
- f_uint8ss_t destination = f_uint8s_t_initialize;
+ f_uint8s_t source = f_uint8s_t_initialize;
+ f_uint8ss_t destination = f_uint8ss_t_initialize;
{
- const f_status_t status = f_uint8ss_resize(length, &source);
+ const f_status_t status = f_uint8s_resize(length, &source);
assert_int_equal(status, F_none);
assert_int_equal(source.used, 0);
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);
- assert_null(destination.array);
}
-void test__f_type_array_uint8ss_append__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint8ss_append__parameter_checking(void **state) {
- const int length = 5;
- f_uint8ss_t data = f_uint8s_t_initialize;
+ f_uint8s_t data = f_uint8s_t_initialize;
{
const f_status_t status = f_uint8ss_append(data, 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
*
* @see f_type_array_uint8ss_append()
*/
-extern void test__f_type_array_uint8ss_append__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint8ss_append__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint8ss_append
--- /dev/null
+#include "test-type_array.h"
+#include "test-type_array-uint8ss_append_all.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_type_array_uint8ss_append_all__works(void **state) {
+
+ const int length = 5;
+ const int length_inner = 2;
+ f_uint8ss_t source = f_uint8ss_t_initialize;
+ f_uint8ss_t destination = f_uint8ss_t_initialize;
+
+ {
+ const f_status_t status = f_uint8ss_resize(length, &source);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(source.used, 0);
+ assert_int_equal(source.size, length);
+ }
+
+ {
+ for (; source.used < length; ++source.used) {
+
+ const f_status_t status = f_uint8s_resize(length_inner, &source.array[source.used]);
+
+ assert_int_equal(status, F_none);
+
+ for (f_array_length_t i = 0; i < length_inner; ++i) {
+ source.array[source.used].array[source.array[source.used].used++] = i + 1;
+ } // for
+ } // for
+ }
+
+ {
+ const f_status_t status = f_uint8ss_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 < destination.used; ++i) {
+
+ assert_int_equal(destination.array[i].used, length_inner);
+ assert_int_equal(destination.array[i].size, length_inner);
+
+ for (f_array_length_t j = 0; j < length_inner; ++j) {
+ assert_int_equal(destination.array[i].array[j], j + 1);
+ } // for
+ } // for
+ }
+
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ free((void *) source.array[i].array);
+ } // for
+
+ for (f_array_length_t i = 0; i < destination.used; ++i) {
+ free((void *) destination.array[i].array);
+ } // for
+
+ free((void *) source.array);
+ free((void *) destination.array);
+}
+
+void test__f_type_array_uint8ss_append_all__returns_data_not(void **state) {
+
+ const int length = 5;
+ f_uint8ss_t source = f_uint8ss_t_initialize;
+ f_uint8ss_t destination = f_uint8ss_t_initialize;
+
+ {
+ const f_status_t status = f_uint8ss_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_uint8ss_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_type_array_uint8ss_append_all__parameter_checking(void **state) {
+
+ const f_uint8ss_t data = f_uint8ss_t_initialize;
+
+ {
+ const f_status_t status = f_uint8ss_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_type_array__uint8ss_append_all
+#define _TEST__F_type_array__uint8ss_append_all
+
+/**
+ * Test that the function works.
+ *
+ * @see f_type_array_uint8ss_append_all()
+ */
+extern void test__f_type_array_uint8ss_append_all__works(void **state);
+
+/**
+ * Test that the function returns F_data_not when asked to copy an empty structure.
+ *
+ * @see f_type_array_uint8ss_append_all()
+ */
+extern void test__f_type_array_uint8ss_append_all__returns_data_not(void **state);
+
+/**
+ * Test that the function correctly fails on invalid parameter.
+ *
+ * @see f_type_array_uint8ss_append_all()
+ */
+extern void test__f_type_array_uint8ss_append_all__parameter_checking(void **state);
+
+#endif // _TEST__F_type_array__uint8ss_append_all
assert_null(data.array);
}
-void test__f_type_array_uint8ss_decimate_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint8ss_decimate_by__parameter_checking(void **state) {
const int length = 5;
f_uint8ss_t data = f_uint8s_t_initialize;
*
* @see f_type_array_uint8ss_decimate_by()
*/
-extern void test__f_type_array_uint8ss_decimate_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint8ss_decimate_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint8ss_decimate_by
assert_null(data.array);
}
-void test__f_type_array_uint8ss_decrease_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint8ss_decrease_by__parameter_checking(void **state) {
const int length = 5;
f_uint8ss_t data = f_uint8s_t_initialize;
*
* @see f_type_array_uint8ss_decrease_by()
*/
-extern void test__f_type_array_uint8ss_decrease_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint8ss_decrease_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint8ss_decrease_by
assert_int_equal(status, F_none);
assert_int_equal(data.used, length);
- assert_int_equal(data.size, length * 2);
+ assert_in_range(data.size, length + 1, length + 1 + F_memory_default_allocation_small_d);
}
free((void *) data.array);
free((void *) data.array);
}
-void test__f_type_array_uint8ss_increase__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint8ss_increase__parameter_checking(void **state) {
const int length = 5;
f_uint8ss_t data = f_uint8s_t_initialize;
*
* @see f_type_array_uint8ss_increase()
*/
-extern void test__f_type_array_uint8ss_increase__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint8ss_increase__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint8ss_increase
free((void *) data.array);
}
-void test__f_type_array_uint8ss_increase_by__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint8ss_increase_by__parameter_checking(void **state) {
const int length = 5;
f_uint8ss_t data = f_uint8s_t_initialize;
*
* @see f_type_array_uint8ss_increase_by()
*/
-extern void test__f_type_array_uint8ss_increase_by__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint8ss_increase_by__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint8ss_increase_by
free((void *) data.array);
}
-void test__f_type_array_uint8ss_resize__fails_on_invalid_parameter(void **state) {
+void test__f_type_array_uint8ss_resize__parameter_checking(void **state) {
const int length = 5;
f_uint8ss_t data = f_uint8ss_t_initialize;
*
* @see f_type_array_uint8ss_resize()
*/
-extern void test__f_type_array_uint8ss_resize__fails_on_invalid_parameter(void **state);
+extern void test__f_type_array_uint8ss_resize__parameter_checking(void **state);
#endif // _TEST__F_type_array__uint8ss_resize
const struct CMUnitTest tests[] = {
cmocka_unit_test(test__f_type_array_array_lengths_adjust__works),
- cmocka_unit_test(test__f_type_array_array_lengths_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_array_lengths_append__works),
- cmocka_unit_test(test__f_type_array_array_lengths_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_array_lengths_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_array_lengths_append_all__works),
+ cmocka_unit_test(test__f_type_array_array_lengths_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_array_lengths_decimate_by__works),
- cmocka_unit_test(test__f_type_array_array_lengths_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_array_lengths_decrease_by__works),
- cmocka_unit_test(test__f_type_array_array_lengths_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_array_lengths_increase__works),
cmocka_unit_test(test__f_type_array_array_lengths_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_array_lengths_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_array_lengths_increase_by__works),
- cmocka_unit_test(test__f_type_array_array_lengths_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_array_lengths_resize__works),
- cmocka_unit_test(test__f_type_array_array_lengths_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_array_lengthss_adjust__works),
- cmocka_unit_test(test__f_type_array_array_lengthss_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_array_lengthss_append__works),
cmocka_unit_test(test__f_type_array_array_lengthss_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_array_lengthss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_array_lengthss_append_all__works),
+ cmocka_unit_test(test__f_type_array_array_lengthss_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_array_lengthss_decimate_by__works),
- cmocka_unit_test(test__f_type_array_array_lengthss_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_array_lengthss_decrease_by__works),
- cmocka_unit_test(test__f_type_array_array_lengthss_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_array_lengthss_increase__works),
cmocka_unit_test(test__f_type_array_array_lengthss_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_array_lengthss_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_array_lengthss_increase_by__works),
- cmocka_unit_test(test__f_type_array_array_lengthss_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_array_lengthss_resize__works),
- cmocka_unit_test(test__f_type_array_array_lengthss_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_cells_adjust__works),
- cmocka_unit_test(test__f_type_array_cells_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_cells_append__works),
- cmocka_unit_test(test__f_type_array_cells_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_cells_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_cells_append_all__works),
+ cmocka_unit_test(test__f_type_array_cells_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_cells_decimate_by__works),
- cmocka_unit_test(test__f_type_array_cells_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_cells_decrease_by__works),
- cmocka_unit_test(test__f_type_array_cells_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_cells_increase__works),
cmocka_unit_test(test__f_type_array_cells_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_cells_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_cells_increase_by__works),
- cmocka_unit_test(test__f_type_array_cells_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_cells_resize__works),
- cmocka_unit_test(test__f_type_array_cells_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_cellss_adjust__works),
- cmocka_unit_test(test__f_type_array_cellss_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_cellss_append__works),
cmocka_unit_test(test__f_type_array_cellss_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_cellss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_cellss_append_all__works),
+ cmocka_unit_test(test__f_type_array_cellss_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_cellss_decimate_by__works),
- cmocka_unit_test(test__f_type_array_cellss_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_cellss_decrease_by__works),
- cmocka_unit_test(test__f_type_array_cellss_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_cellss_increase__works),
cmocka_unit_test(test__f_type_array_cellss_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_cellss_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_cellss_increase_by__works),
- cmocka_unit_test(test__f_type_array_cellss_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_cellss_resize__works),
- cmocka_unit_test(test__f_type_array_cellss_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_fll_ids_adjust__works),
- cmocka_unit_test(test__f_type_array_fll_ids_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_fll_ids_append__works),
- cmocka_unit_test(test__f_type_array_fll_ids_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_fll_ids_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_fll_ids_append_all__works),
+ cmocka_unit_test(test__f_type_array_fll_ids_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_fll_ids_decimate_by__works),
- cmocka_unit_test(test__f_type_array_fll_ids_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_fll_ids_decrease_by__works),
- cmocka_unit_test(test__f_type_array_fll_ids_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_fll_ids_increase__works),
cmocka_unit_test(test__f_type_array_fll_ids_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_fll_ids_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_fll_ids_increase_by__works),
- cmocka_unit_test(test__f_type_array_fll_ids_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_fll_ids_resize__works),
- cmocka_unit_test(test__f_type_array_fll_ids_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_fll_idss_adjust__works),
- cmocka_unit_test(test__f_type_array_fll_idss_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_fll_idss_append__works),
cmocka_unit_test(test__f_type_array_fll_idss_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_fll_idss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_fll_idss_append_all__works),
+ cmocka_unit_test(test__f_type_array_fll_idss_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_fll_idss_decimate_by__works),
- cmocka_unit_test(test__f_type_array_fll_idss_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_fll_idss_decrease_by__works),
- cmocka_unit_test(test__f_type_array_fll_idss_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_fll_idss_increase__works),
cmocka_unit_test(test__f_type_array_fll_idss_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_fll_idss_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_fll_idss_increase_by__works),
- cmocka_unit_test(test__f_type_array_fll_idss_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_fll_idss_resize__works),
- cmocka_unit_test(test__f_type_array_fll_idss_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int8s_adjust__works),
- cmocka_unit_test(test__f_type_array_int8s_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int8s_append__works),
- cmocka_unit_test(test__f_type_array_int8s_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_int8s_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_int8s_append_all__works),
+ cmocka_unit_test(test__f_type_array_int8s_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_int8s_decimate_by__works),
- cmocka_unit_test(test__f_type_array_int8s_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int8s_decrease_by__works),
- cmocka_unit_test(test__f_type_array_int8s_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int8s_increase__works),
cmocka_unit_test(test__f_type_array_int8s_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_int8s_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int8s_increase_by__works),
- cmocka_unit_test(test__f_type_array_int8s_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int8s_resize__works),
- cmocka_unit_test(test__f_type_array_int8s_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int8ss_adjust__works),
- cmocka_unit_test(test__f_type_array_int8ss_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int8ss_append__works),
cmocka_unit_test(test__f_type_array_int8ss_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_int8ss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_int8ss_append_all__works),
+ cmocka_unit_test(test__f_type_array_int8ss_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_int8ss_decimate_by__works),
- cmocka_unit_test(test__f_type_array_int8ss_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int8ss_decrease_by__works),
- cmocka_unit_test(test__f_type_array_int8ss_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int8ss_increase__works),
cmocka_unit_test(test__f_type_array_int8ss_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_int8ss_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int8ss_increase_by__works),
- cmocka_unit_test(test__f_type_array_int8ss_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int8ss_resize__works),
- cmocka_unit_test(test__f_type_array_int8ss_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int16s_adjust__works),
- cmocka_unit_test(test__f_type_array_int16s_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int16s_append__works),
- cmocka_unit_test(test__f_type_array_int16s_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_int16s_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_int16s_append_all__works),
+ cmocka_unit_test(test__f_type_array_int16s_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_int16s_decimate_by__works),
- cmocka_unit_test(test__f_type_array_int16s_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int16s_decrease_by__works),
- cmocka_unit_test(test__f_type_array_int16s_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int16s_increase__works),
cmocka_unit_test(test__f_type_array_int16s_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_int16s_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int16s_increase_by__works),
- cmocka_unit_test(test__f_type_array_int16s_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int16s_resize__works),
- cmocka_unit_test(test__f_type_array_int16s_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int16ss_adjust__works),
- cmocka_unit_test(test__f_type_array_int16ss_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int16ss_append__works),
cmocka_unit_test(test__f_type_array_int16ss_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_int16ss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_int16ss_append_all__works),
+ cmocka_unit_test(test__f_type_array_int16ss_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_int16ss_decimate_by__works),
- cmocka_unit_test(test__f_type_array_int16ss_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int16ss_decrease_by__works),
- cmocka_unit_test(test__f_type_array_int16ss_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int16ss_increase__works),
cmocka_unit_test(test__f_type_array_int16ss_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_int16ss_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int16ss_increase_by__works),
- cmocka_unit_test(test__f_type_array_int16ss_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int16ss_resize__works),
- cmocka_unit_test(test__f_type_array_int16ss_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int32s_adjust__works),
- cmocka_unit_test(test__f_type_array_int32s_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int32s_append__works),
- cmocka_unit_test(test__f_type_array_int32s_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_int32s_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_int32s_append_all__works),
+ cmocka_unit_test(test__f_type_array_int32s_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_int32s_decimate_by__works),
- cmocka_unit_test(test__f_type_array_int32s_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int32s_decrease_by__works),
- cmocka_unit_test(test__f_type_array_int32s_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int32s_increase__works),
cmocka_unit_test(test__f_type_array_int32s_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_int32s_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int32s_increase_by__works),
- cmocka_unit_test(test__f_type_array_int32s_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int32s_resize__works),
- cmocka_unit_test(test__f_type_array_int32s_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int32ss_adjust__works),
- cmocka_unit_test(test__f_type_array_int32ss_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int32ss_append__works),
cmocka_unit_test(test__f_type_array_int32ss_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_int32ss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_int32ss_append_all__works),
+ cmocka_unit_test(test__f_type_array_int32ss_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_int32ss_decimate_by__works),
- cmocka_unit_test(test__f_type_array_int32ss_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int32ss_decrease_by__works),
- cmocka_unit_test(test__f_type_array_int32ss_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int32ss_increase__works),
cmocka_unit_test(test__f_type_array_int32ss_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_int32ss_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int32ss_increase_by__works),
- cmocka_unit_test(test__f_type_array_int32ss_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int32ss_resize__works),
- cmocka_unit_test(test__f_type_array_int32ss_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int64s_adjust__works),
- cmocka_unit_test(test__f_type_array_int64s_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int64s_append__works),
- cmocka_unit_test(test__f_type_array_int64s_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_int64s_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_int64s_append_all__works),
+ cmocka_unit_test(test__f_type_array_int64s_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_int64s_decimate_by__works),
- cmocka_unit_test(test__f_type_array_int64s_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int64s_decrease_by__works),
- cmocka_unit_test(test__f_type_array_int64s_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int64s_increase__works),
cmocka_unit_test(test__f_type_array_int64s_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_int64s_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int64s_increase_by__works),
- cmocka_unit_test(test__f_type_array_int64s_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int64s_resize__works),
- cmocka_unit_test(test__f_type_array_int64s_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int64ss_adjust__works),
- cmocka_unit_test(test__f_type_array_int64ss_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int64ss_append__works),
cmocka_unit_test(test__f_type_array_int64ss_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_int64ss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_int64ss_append_all__works),
+ cmocka_unit_test(test__f_type_array_int64ss_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_int64ss_decimate_by__works),
- cmocka_unit_test(test__f_type_array_int64ss_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int64ss_decrease_by__works),
- cmocka_unit_test(test__f_type_array_int64ss_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int64ss_increase__works),
cmocka_unit_test(test__f_type_array_int64ss_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_int64ss_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int64ss_increase_by__works),
- cmocka_unit_test(test__f_type_array_int64ss_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int64ss_resize__works),
- cmocka_unit_test(test__f_type_array_int64ss_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int128s_adjust__works),
- cmocka_unit_test(test__f_type_array_int128s_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int128s_append__works),
- cmocka_unit_test(test__f_type_array_int128s_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_int128s_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_int128s_append_all__works),
+ cmocka_unit_test(test__f_type_array_int128s_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_int128s_decimate_by__works),
- cmocka_unit_test(test__f_type_array_int128s_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int128s_decrease_by__works),
- cmocka_unit_test(test__f_type_array_int128s_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int128s_increase__works),
cmocka_unit_test(test__f_type_array_int128s_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_int128s_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int128s_increase_by__works),
- cmocka_unit_test(test__f_type_array_int128s_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int128s_resize__works),
- cmocka_unit_test(test__f_type_array_int128s_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int128ss_adjust__works),
- cmocka_unit_test(test__f_type_array_int128ss_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int128ss_append__works),
cmocka_unit_test(test__f_type_array_int128ss_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_int128ss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_int128ss_append_all__works),
+ cmocka_unit_test(test__f_type_array_int128ss_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_int128ss_decimate_by__works),
- cmocka_unit_test(test__f_type_array_int128ss_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int128ss_decrease_by__works),
- cmocka_unit_test(test__f_type_array_int128ss_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int128ss_increase__works),
cmocka_unit_test(test__f_type_array_int128ss_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_int128ss_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int128ss_increase_by__works),
- cmocka_unit_test(test__f_type_array_int128ss_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_int128ss_resize__works),
- cmocka_unit_test(test__f_type_array_int128ss_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_states_adjust__works),
- cmocka_unit_test(test__f_type_array_states_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_states_append__works),
- cmocka_unit_test(test__f_type_array_states_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_states_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_states_append_all__works),
+ cmocka_unit_test(test__f_type_array_states_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_states_decimate_by__works),
- cmocka_unit_test(test__f_type_array_states_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_states_decrease_by__works),
- cmocka_unit_test(test__f_type_array_states_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_states_increase__works),
cmocka_unit_test(test__f_type_array_states_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_states_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_states_increase_by__works),
- cmocka_unit_test(test__f_type_array_states_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_states_resize__works),
- cmocka_unit_test(test__f_type_array_states_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_statess_adjust__works),
- cmocka_unit_test(test__f_type_array_statess_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_statess_append__works),
cmocka_unit_test(test__f_type_array_statess_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_statess_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statess_append_all__works),
+ cmocka_unit_test(test__f_type_array_statess_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_statess_decimate_by__works),
- cmocka_unit_test(test__f_type_array_statess_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_statess_decrease_by__works),
- cmocka_unit_test(test__f_type_array_statess_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_statess_increase__works),
cmocka_unit_test(test__f_type_array_statess_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_statess_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_statess_increase_by__works),
- cmocka_unit_test(test__f_type_array_statess_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_statess_resize__works),
- cmocka_unit_test(test__f_type_array_statess_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_statuss_adjust__works),
- cmocka_unit_test(test__f_type_array_statuss_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_statuss_append__works),
- cmocka_unit_test(test__f_type_array_statuss_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_statuss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statuss_append_all__works),
+ cmocka_unit_test(test__f_type_array_statuss_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_statuss_decimate_by__works),
- cmocka_unit_test(test__f_type_array_statuss_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_statuss_decrease_by__works),
- cmocka_unit_test(test__f_type_array_statuss_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_statuss_increase__works),
cmocka_unit_test(test__f_type_array_statuss_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_statuss_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_statuss_increase_by__works),
- cmocka_unit_test(test__f_type_array_statuss_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_statuss_resize__works),
- cmocka_unit_test(test__f_type_array_statuss_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_statusss_adjust__works),
- cmocka_unit_test(test__f_type_array_statusss_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_statusss_append__works),
cmocka_unit_test(test__f_type_array_statusss_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_statusss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_statusss_append_all__works),
+ cmocka_unit_test(test__f_type_array_statusss_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_statusss_decimate_by__works),
- cmocka_unit_test(test__f_type_array_statusss_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_statusss_decrease_by__works),
- cmocka_unit_test(test__f_type_array_statusss_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_statusss_increase__works),
cmocka_unit_test(test__f_type_array_statusss_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_statusss_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_statusss_increase_by__works),
- cmocka_unit_test(test__f_type_array_statusss_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_statusss_resize__works),
- cmocka_unit_test(test__f_type_array_statusss_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint8s_adjust__works),
- cmocka_unit_test(test__f_type_array_uint8s_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint8s_append__works),
- cmocka_unit_test(test__f_type_array_uint8s_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint8s_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_uint8s_append_all__works),
+ cmocka_unit_test(test__f_type_array_uint8s_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_uint8s_decimate_by__works),
- cmocka_unit_test(test__f_type_array_uint8s_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint8s_decrease_by__works),
- cmocka_unit_test(test__f_type_array_uint8s_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint8s_increase__works),
cmocka_unit_test(test__f_type_array_uint8s_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint8s_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint8s_increase_by__works),
- cmocka_unit_test(test__f_type_array_uint8s_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint8s_resize__works),
- cmocka_unit_test(test__f_type_array_uint8s_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint8ss_adjust__works),
- cmocka_unit_test(test__f_type_array_uint8ss_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint8ss_append__works),
cmocka_unit_test(test__f_type_array_uint8ss_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint8ss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_uint8ss_append_all__works),
+ cmocka_unit_test(test__f_type_array_uint8ss_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_uint8ss_decimate_by__works),
- cmocka_unit_test(test__f_type_array_uint8ss_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint8ss_decrease_by__works),
- cmocka_unit_test(test__f_type_array_uint8ss_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint8ss_increase__works),
cmocka_unit_test(test__f_type_array_uint8ss_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint8ss_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint8ss_increase_by__works),
- cmocka_unit_test(test__f_type_array_uint8ss_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint8ss_resize__works),
- cmocka_unit_test(test__f_type_array_uint8ss_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint16s_adjust__works),
- cmocka_unit_test(test__f_type_array_uint16s_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint16s_append__works),
- cmocka_unit_test(test__f_type_array_uint16s_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint16s_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_uint16s_append_all__works),
+ cmocka_unit_test(test__f_type_array_uint16s_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_uint16s_decimate_by__works),
- cmocka_unit_test(test__f_type_array_uint16s_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint16s_decrease_by__works),
- cmocka_unit_test(test__f_type_array_uint16s_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint16s_increase__works),
cmocka_unit_test(test__f_type_array_uint16s_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint16s_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint16s_increase_by__works),
- cmocka_unit_test(test__f_type_array_uint16s_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint16s_resize__works),
- cmocka_unit_test(test__f_type_array_uint16s_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint16ss_adjust__works),
- cmocka_unit_test(test__f_type_array_uint16ss_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint16ss_append__works),
cmocka_unit_test(test__f_type_array_uint16ss_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint16ss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_uint16ss_append_all__works),
+ cmocka_unit_test(test__f_type_array_uint16ss_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_uint16ss_decimate_by__works),
- cmocka_unit_test(test__f_type_array_uint16ss_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint16ss_decrease_by__works),
- cmocka_unit_test(test__f_type_array_uint16ss_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint16ss_increase__works),
cmocka_unit_test(test__f_type_array_uint16ss_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint16ss_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint16ss_increase_by__works),
- cmocka_unit_test(test__f_type_array_uint16ss_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint16ss_resize__works),
- cmocka_unit_test(test__f_type_array_uint16ss_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint32s_adjust__works),
- cmocka_unit_test(test__f_type_array_uint32s_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint32s_append__works),
- cmocka_unit_test(test__f_type_array_uint32s_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint32s_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_uint32s_append_all__works),
+ cmocka_unit_test(test__f_type_array_uint32s_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_uint32s_decimate_by__works),
- cmocka_unit_test(test__f_type_array_uint32s_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint32s_decrease_by__works),
- cmocka_unit_test(test__f_type_array_uint32s_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint32s_increase__works),
cmocka_unit_test(test__f_type_array_uint32s_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint32s_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint32s_increase_by__works),
- cmocka_unit_test(test__f_type_array_uint32s_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint32s_resize__works),
- cmocka_unit_test(test__f_type_array_uint32s_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint32ss_adjust__works),
- cmocka_unit_test(test__f_type_array_uint32ss_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint32ss_append__works),
cmocka_unit_test(test__f_type_array_uint32ss_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint32ss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_uint32ss_append_all__works),
+ cmocka_unit_test(test__f_type_array_uint32ss_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_uint32ss_decimate_by__works),
- cmocka_unit_test(test__f_type_array_uint32ss_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint32ss_decrease_by__works),
- cmocka_unit_test(test__f_type_array_uint32ss_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint32ss_increase__works),
cmocka_unit_test(test__f_type_array_uint32ss_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint32ss_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint32ss_increase_by__works),
- cmocka_unit_test(test__f_type_array_uint32ss_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint32ss_resize__works),
- cmocka_unit_test(test__f_type_array_uint32ss_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint64s_adjust__works),
- cmocka_unit_test(test__f_type_array_uint64s_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint64s_append__works),
- cmocka_unit_test(test__f_type_array_uint64s_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint64s_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_uint64s_append_all__works),
+ cmocka_unit_test(test__f_type_array_uint64s_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_uint64s_decimate_by__works),
- cmocka_unit_test(test__f_type_array_uint64s_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint64s_decrease_by__works),
- cmocka_unit_test(test__f_type_array_uint64s_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint64s_increase__works),
cmocka_unit_test(test__f_type_array_uint64s_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint64s_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint64s_increase_by__works),
- cmocka_unit_test(test__f_type_array_uint64s_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint64s_resize__works),
- cmocka_unit_test(test__f_type_array_uint64s_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint64ss_adjust__works),
- cmocka_unit_test(test__f_type_array_uint64ss_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint64ss_append__works),
cmocka_unit_test(test__f_type_array_uint64ss_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint64ss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_uint64ss_append_all__works),
+ cmocka_unit_test(test__f_type_array_uint64ss_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_uint64ss_decimate_by__works),
- cmocka_unit_test(test__f_type_array_uint64ss_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint64ss_decrease_by__works),
- cmocka_unit_test(test__f_type_array_uint64ss_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint64ss_increase__works),
cmocka_unit_test(test__f_type_array_uint64ss_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint64ss_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint64ss_increase_by__works),
- cmocka_unit_test(test__f_type_array_uint64ss_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint64ss_resize__works),
- cmocka_unit_test(test__f_type_array_uint64ss_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint128s_adjust__works),
- cmocka_unit_test(test__f_type_array_uint128s_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint128s_append__works),
- cmocka_unit_test(test__f_type_array_uint128s_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint128s_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_uint128s_append_all__works),
+ cmocka_unit_test(test__f_type_array_uint128s_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_uint128s_decimate_by__works),
- cmocka_unit_test(test__f_type_array_uint128s_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint128s_decrease_by__works),
- cmocka_unit_test(test__f_type_array_uint128s_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint128s_increase__works),
cmocka_unit_test(test__f_type_array_uint128s_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint128s_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint128s_increase_by__works),
- cmocka_unit_test(test__f_type_array_uint128s_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint128s_resize__works),
- cmocka_unit_test(test__f_type_array_uint128s_resize__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint128ss_adjust__works),
- cmocka_unit_test(test__f_type_array_uint128ss_adjust__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint128ss_append__works),
cmocka_unit_test(test__f_type_array_uint128ss_append__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint128ss_append__fails_on_invalid_parameter),
+ cmocka_unit_test(test__f_type_array_uint128ss_append_all__works),
+ cmocka_unit_test(test__f_type_array_uint128ss_append_all__returns_data_not),
cmocka_unit_test(test__f_type_array_uint128ss_decimate_by__works),
- cmocka_unit_test(test__f_type_array_uint128ss_decimate_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint128ss_decrease_by__works),
- cmocka_unit_test(test__f_type_array_uint128ss_decrease_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint128ss_increase__works),
cmocka_unit_test(test__f_type_array_uint128ss_increase__returns_data_not),
- cmocka_unit_test(test__f_type_array_uint128ss_increase__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint128ss_increase_by__works),
- cmocka_unit_test(test__f_type_array_uint128ss_increase_by__fails_on_invalid_parameter),
cmocka_unit_test(test__f_type_array_uint128ss_resize__works),
- cmocka_unit_test(test__f_type_array_uint128ss_resize__fails_on_invalid_parameter),
+
+ #ifndef _di_level_0_parameter_checking_
+ cmocka_unit_test(test__f_type_array_array_lengths_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_array_lengths_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_array_lengths_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_array_lengths_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_array_lengths_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_array_lengths_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_array_lengths_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_array_lengths_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_array_lengthss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_array_lengthss_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_array_lengthss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_array_lengthss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_array_lengthss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_array_lengthss_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_array_lengthss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_array_lengthss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_cells_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_cells_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_cells_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_cells_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_cells_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_cells_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_cells_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_cells_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_cellss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_cellss_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_cellss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_cellss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_cellss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_cellss_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_cellss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_cellss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_fll_ids_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_fll_ids_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_fll_ids_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_fll_ids_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_fll_ids_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_fll_ids_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_fll_ids_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_fll_ids_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_fll_idss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_fll_idss_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_fll_idss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_fll_idss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_fll_idss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_fll_idss_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_fll_idss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_fll_idss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_int8s_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int8s_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int8s_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int8s_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int8s_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int8s_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int8s_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int8s_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_int8ss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int8ss_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int8ss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int8ss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int8ss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int8ss_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int8ss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int8ss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_int16s_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int16s_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int16s_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int16s_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int16s_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int16s_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int16s_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int16s_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_int16ss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int16ss_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int16ss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int16ss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int16ss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int16ss_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int16ss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int16ss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_int32s_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int32s_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int32s_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int32s_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int32s_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int32s_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int32s_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int32s_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_int32ss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int32ss_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int32ss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int32ss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int32ss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int32ss_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int32ss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int32ss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_int64s_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int64s_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int64s_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int64s_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int64s_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int64s_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int64s_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int64s_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_int64ss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int64ss_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int64ss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int64ss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int64ss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int64ss_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int64ss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int64ss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_int128s_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int128s_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int128s_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int128s_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int128s_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int128s_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int128s_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int128s_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_int128ss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int128ss_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int128ss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int128ss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int128ss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int128ss_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int128ss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_int128ss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_states_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_states_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_states_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_states_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_states_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_states_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_states_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_states_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_statess_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statess_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statess_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statess_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statess_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statess_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statess_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statess_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_statuss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statuss_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statuss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statuss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statuss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statuss_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statuss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statuss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_statusss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statusss_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statusss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statusss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statusss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statusss_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statusss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_statusss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_uint8s_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint8s_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint8s_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint8s_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint8s_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint8s_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint8s_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint8s_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_uint8ss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint8ss_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint8ss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint8ss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint8ss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint8ss_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint8ss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint8ss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_uint16s_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint16s_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint16s_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint16s_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint16s_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint16s_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint16s_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint16s_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_uint16ss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint16ss_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint16ss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint16ss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint16ss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint16ss_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint16ss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint16ss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_uint32s_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint32s_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint32s_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint32s_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint32s_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint32s_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint32s_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint32s_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_uint32ss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint32ss_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint32ss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint32ss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint32ss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint32ss_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint32ss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint32ss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_uint64s_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint64s_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint64s_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint64s_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint64s_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint64s_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint64s_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint64s_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_uint64ss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint64ss_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint64ss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint64ss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint64ss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint64ss_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint64ss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint64ss_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_uint128s_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint128s_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint128s_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint128s_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint128s_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint128s_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint128s_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint128s_resize__parameter_checking),
+
+ cmocka_unit_test(test__f_type_array_uint128ss_adjust__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint128ss_append__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint128ss_append_all__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint128ss_decimate_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint128ss_decrease_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint128ss_increase__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint128ss_increase_by__parameter_checking),
+ cmocka_unit_test(test__f_type_array_uint128ss_resize__parameter_checking),
+ #endif // _di_level_0_parameter_checking_
};
return cmocka_run_group_tests(tests, setup, setdown);
// Test includes.
#include "test-type_array-array_lengths_adjust.h"
#include "test-type_array-array_lengths_append.h"
+#include "test-type_array-array_lengths_append_all.h"
#include "test-type_array-array_lengths_decimate_by.h"
#include "test-type_array-array_lengths_decrease_by.h"
#include "test-type_array-array_lengths_increase.h"
#include "test-type_array-array_lengths_resize.h"
#include "test-type_array-array_lengthss_adjust.h"
#include "test-type_array-array_lengthss_append.h"
+#include "test-type_array-array_lengthss_append_all.h"
#include "test-type_array-array_lengthss_decimate_by.h"
#include "test-type_array-array_lengthss_decrease_by.h"
#include "test-type_array-array_lengthss_increase.h"
#include "test-type_array-array_lengthss_resize.h"
#include "test-type_array-cells_adjust.h"
#include "test-type_array-cells_append.h"
+#include "test-type_array-cells_append_all.h"
#include "test-type_array-cells_decimate_by.h"
#include "test-type_array-cells_decrease_by.h"
#include "test-type_array-cells_increase.h"
#include "test-type_array-cells_resize.h"
#include "test-type_array-cellss_adjust.h"
#include "test-type_array-cellss_append.h"
+#include "test-type_array-cellss_append_all.h"
#include "test-type_array-cellss_decimate_by.h"
#include "test-type_array-cellss_decrease_by.h"
#include "test-type_array-cellss_increase.h"
#include "test-type_array-cellss_resize.h"
#include "test-type_array-fll_ids_adjust.h"
#include "test-type_array-fll_ids_append.h"
+#include "test-type_array-fll_ids_append_all.h"
#include "test-type_array-fll_ids_decimate_by.h"
#include "test-type_array-fll_ids_decrease_by.h"
#include "test-type_array-fll_ids_increase.h"
#include "test-type_array-fll_ids_resize.h"
#include "test-type_array-fll_idss_adjust.h"
#include "test-type_array-fll_idss_append.h"
+#include "test-type_array-fll_idss_append_all.h"
#include "test-type_array-fll_idss_decimate_by.h"
#include "test-type_array-fll_idss_decrease_by.h"
#include "test-type_array-fll_idss_increase.h"
#include "test-type_array-fll_idss_resize.h"
#include "test-type_array-int8s_adjust.h"
#include "test-type_array-int8s_append.h"
+#include "test-type_array-int8s_append_all.h"
#include "test-type_array-int8s_decimate_by.h"
#include "test-type_array-int8s_decrease_by.h"
#include "test-type_array-int8s_increase.h"
#include "test-type_array-int8s_resize.h"
#include "test-type_array-int8ss_adjust.h"
#include "test-type_array-int8ss_append.h"
+#include "test-type_array-int8ss_append_all.h"
#include "test-type_array-int8ss_decimate_by.h"
#include "test-type_array-int8ss_decrease_by.h"
#include "test-type_array-int8ss_increase.h"
#include "test-type_array-int8ss_resize.h"
#include "test-type_array-int16s_adjust.h"
#include "test-type_array-int16s_append.h"
+#include "test-type_array-int16s_append_all.h"
#include "test-type_array-int16s_decimate_by.h"
#include "test-type_array-int16s_decrease_by.h"
#include "test-type_array-int16s_increase.h"
#include "test-type_array-int16s_resize.h"
#include "test-type_array-int16ss_adjust.h"
#include "test-type_array-int16ss_append.h"
+#include "test-type_array-int16ss_append_all.h"
#include "test-type_array-int16ss_decimate_by.h"
#include "test-type_array-int16ss_decrease_by.h"
#include "test-type_array-int16ss_increase.h"
#include "test-type_array-int16ss_resize.h"
#include "test-type_array-int32s_adjust.h"
#include "test-type_array-int32s_append.h"
+#include "test-type_array-int32s_append_all.h"
#include "test-type_array-int32s_decimate_by.h"
#include "test-type_array-int32s_decrease_by.h"
#include "test-type_array-int32s_increase.h"
#include "test-type_array-int32s_resize.h"
#include "test-type_array-int32ss_adjust.h"
#include "test-type_array-int32ss_append.h"
+#include "test-type_array-int32ss_append_all.h"
#include "test-type_array-int32ss_decimate_by.h"
#include "test-type_array-int32ss_decrease_by.h"
#include "test-type_array-int32ss_increase.h"
#include "test-type_array-int32ss_resize.h"
#include "test-type_array-int64s_adjust.h"
#include "test-type_array-int64s_append.h"
+#include "test-type_array-int64s_append_all.h"
#include "test-type_array-int64s_decimate_by.h"
#include "test-type_array-int64s_decrease_by.h"
#include "test-type_array-int64s_increase.h"
#include "test-type_array-int64s_resize.h"
#include "test-type_array-int64ss_adjust.h"
#include "test-type_array-int64ss_append.h"
+#include "test-type_array-int64ss_append_all.h"
#include "test-type_array-int64ss_decimate_by.h"
#include "test-type_array-int64ss_decrease_by.h"
#include "test-type_array-int64ss_increase.h"
#include "test-type_array-int64ss_resize.h"
#include "test-type_array-int128s_adjust.h"
#include "test-type_array-int128s_append.h"
+#include "test-type_array-int128s_append_all.h"
#include "test-type_array-int128s_decimate_by.h"
#include "test-type_array-int128s_decrease_by.h"
#include "test-type_array-int128s_increase.h"
#include "test-type_array-int128s_resize.h"
#include "test-type_array-int128ss_adjust.h"
#include "test-type_array-int128ss_append.h"
+#include "test-type_array-int128ss_append_all.h"
#include "test-type_array-int128ss_decimate_by.h"
#include "test-type_array-int128ss_decrease_by.h"
#include "test-type_array-int128ss_increase.h"
#include "test-type_array-int128ss_resize.h"
#include "test-type_array-states_adjust.h"
#include "test-type_array-states_append.h"
+#include "test-type_array-states_append_all.h"
#include "test-type_array-states_decimate_by.h"
#include "test-type_array-states_decrease_by.h"
#include "test-type_array-states_increase.h"
#include "test-type_array-states_resize.h"
#include "test-type_array-statess_adjust.h"
#include "test-type_array-statess_append.h"
+#include "test-type_array-statess_append_all.h"
#include "test-type_array-statess_decimate_by.h"
#include "test-type_array-statess_decrease_by.h"
#include "test-type_array-statess_increase.h"
#include "test-type_array-statess_resize.h"
#include "test-type_array-statuss_adjust.h"
#include "test-type_array-statuss_append.h"
+#include "test-type_array-statuss_append_all.h"
#include "test-type_array-statuss_decimate_by.h"
#include "test-type_array-statuss_decrease_by.h"
#include "test-type_array-statuss_increase.h"
#include "test-type_array-statuss_resize.h"
#include "test-type_array-statusss_adjust.h"
#include "test-type_array-statusss_append.h"
+#include "test-type_array-statusss_append_all.h"
#include "test-type_array-statusss_decimate_by.h"
#include "test-type_array-statusss_decrease_by.h"
#include "test-type_array-statusss_increase.h"
#include "test-type_array-statusss_resize.h"
#include "test-type_array-uint8s_adjust.h"
#include "test-type_array-uint8s_append.h"
+#include "test-type_array-uint8s_append_all.h"
#include "test-type_array-uint8s_decimate_by.h"
#include "test-type_array-uint8s_decrease_by.h"
#include "test-type_array-uint8s_increase.h"
#include "test-type_array-uint8s_resize.h"
#include "test-type_array-uint8ss_adjust.h"
#include "test-type_array-uint8ss_append.h"
+#include "test-type_array-uint8ss_append_all.h"
#include "test-type_array-uint8ss_decimate_by.h"
#include "test-type_array-uint8ss_decrease_by.h"
#include "test-type_array-uint8ss_increase.h"
#include "test-type_array-uint8ss_resize.h"
#include "test-type_array-uint16s_adjust.h"
#include "test-type_array-uint16s_append.h"
+#include "test-type_array-uint16s_append_all.h"
#include "test-type_array-uint16s_decimate_by.h"
#include "test-type_array-uint16s_decrease_by.h"
#include "test-type_array-uint16s_increase.h"
#include "test-type_array-uint16s_resize.h"
#include "test-type_array-uint16ss_adjust.h"
#include "test-type_array-uint16ss_append.h"
+#include "test-type_array-uint16ss_append_all.h"
#include "test-type_array-uint16ss_decimate_by.h"
#include "test-type_array-uint16ss_decrease_by.h"
#include "test-type_array-uint16ss_increase.h"
#include "test-type_array-uint16ss_resize.h"
#include "test-type_array-uint32s_adjust.h"
#include "test-type_array-uint32s_append.h"
+#include "test-type_array-uint32s_append_all.h"
#include "test-type_array-uint32s_decimate_by.h"
#include "test-type_array-uint32s_decrease_by.h"
#include "test-type_array-uint32s_increase.h"
#include "test-type_array-uint32s_resize.h"
#include "test-type_array-uint32ss_adjust.h"
#include "test-type_array-uint32ss_append.h"
+#include "test-type_array-uint32ss_append_all.h"
#include "test-type_array-uint32ss_decimate_by.h"
#include "test-type_array-uint32ss_decrease_by.h"
#include "test-type_array-uint32ss_increase.h"
#include "test-type_array-uint32ss_resize.h"
#include "test-type_array-uint64s_adjust.h"
#include "test-type_array-uint64s_append.h"
+#include "test-type_array-uint64s_append_all.h"
#include "test-type_array-uint64s_decimate_by.h"
#include "test-type_array-uint64s_decrease_by.h"
#include "test-type_array-uint64s_increase.h"
#include "test-type_array-uint64s_resize.h"
#include "test-type_array-uint64ss_adjust.h"
#include "test-type_array-uint64ss_append.h"
+#include "test-type_array-uint64ss_append_all.h"
#include "test-type_array-uint64ss_decimate_by.h"
#include "test-type_array-uint64ss_decrease_by.h"
#include "test-type_array-uint64ss_increase.h"
#include "test-type_array-uint64ss_resize.h"
#include "test-type_array-uint128s_adjust.h"
#include "test-type_array-uint128s_append.h"
+#include "test-type_array-uint128s_append_all.h"
#include "test-type_array-uint128s_decimate_by.h"
#include "test-type_array-uint128s_decrease_by.h"
#include "test-type_array-uint128s_increase.h"
#include "test-type_array-uint128s_resize.h"
#include "test-type_array-uint128ss_adjust.h"
#include "test-type_array-uint128ss_append.h"
+#include "test-type_array-uint128ss_append_all.h"
#include "test-type_array-uint128ss_decimate_by.h"
#include "test-type_array-uint128ss_decrease_by.h"
#include "test-type_array-uint128ss_increase.h"
#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) {
- f_status_t status = f_memory_adjust(dynamic->size, length, sizeof(f_utf_string_t), (void **) & dynamic->string);
+ 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;
- if (F_status_is_error_not(status)) {
- dynamic->size = length;
+ dynamic->size = length;
- if (dynamic->used > dynamic->size) {
- dynamic->used = length;
- }
+ if (dynamic->used > dynamic->size) {
+ dynamic->used = length;
}
- return status;
+ 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_)
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;
- if (F_status_is_error_not(status)) {
- dynamic->size = length;
+ dynamic->size = length;
- if (dynamic->used > dynamic->size) {
- dynamic->used = length;
- }
+ if (dynamic->used > dynamic->size) {
+ dynamic->used = length;
}
- return status;
+ 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_)
} // 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;
- if (F_status_is_error_not(status)) {
- dynamics->size = length;
+ dynamics->size = length;
- if (dynamics->used > dynamics->size) {
- dynamics->used = length;
- }
+ if (dynamics->used > dynamics->size) {
+ dynamics->used = length;
}
- return status;
+ 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_)
} // 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;
- if (F_status_is_error_not(status)) {
- dynamics->size = length;
+ dynamics->size = length;
- if (dynamics->used > dynamics->size) {
- dynamics->used = length;
- }
+ if (dynamics->used > dynamics->size) {
+ dynamics->used = length;
}
- return status;
+ 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_)
} // 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;
- if (F_status_is_error_not(status)) {
- map_multis->size = length;
+ map_multis->size = length;
- if (map_multis->used > map_multis->size) {
- map_multis->used = length;
- }
+ if (map_multis->used > map_multis->size) {
+ map_multis->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_decimate_by_)
} // 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;
- if (F_status_is_error_not(status)) {
- map_multis->size = length;
+ map_multis->size = length;
- if (map_multis->used > map_multis->size) {
- map_multis->used = length;
- }
+ if (map_multis->used > map_multis->size) {
+ map_multis->used = length;
}
- return status;
+ 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_)
} // 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;
- if (F_status_is_error_not(status)) {
- maps->size = length;
+ maps->size = length;
- if (maps->used > maps->size) {
- maps->used = length;
- }
+ if (maps->used > maps->size) {
+ maps->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_utf_string_maps_adjust_) || !defined(_di_f_utf_string_maps_decimate_by_)
} // 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;
- if (F_status_is_error_not(status)) {
- maps->size = length;
+ maps->size = length;
- if (maps->used > maps->size) {
- maps->used = length;
- }
+ if (maps->used > maps->size) {
+ maps->used = length;
}
- return status;
+ 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_)
}
destination->used = 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_)
} // 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;
- if (F_status_is_error_not(status)) {
- triples->size = length;
+ triples->size = length;
- if (triples->used > triples->size) {
- triples->used = length;
- }
+ if (triples->used > triples->size) {
+ triples->used = length;
}
- return status;
+ return F_none;
}
#endif // !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_)
} // 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;
- if (F_status_is_error_not(status)) {
- triples->size = length;
+ triples->size = length;
- if (triples->used > triples->size) {
- triples->used = length;
- }
+ if (triples->used > triples->size) {
+ triples->used = length;
}
- return status;
+ 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_)
f_status_t private_fl_fss_basic_write_object_trim(const f_fss_quote_t quoted, const f_array_length_t used_start, f_state_t state, f_string_dynamic_t * const destination) {
f_status_t status = F_none;
- f_string_range_t destination_range = macro_f_string_range_t_initialize(destination->used);
+ f_string_range_t destination_range = macro_f_string_range_t_initialize2(destination->used);
f_array_length_t i = 0;
uint8_t width = 0;
f_status_t private_fl_fss_basic_list_write_object_trim(const f_array_length_t used_start, f_state_t state, f_string_dynamic_t * const destination) {
f_status_t status = F_none;
- f_string_range_t destination_range = macro_f_string_range_t_initialize(destination->used);
+ f_string_range_t destination_range = macro_f_string_range_t_initialize2(destination->used);
f_array_length_t i = 0;
uint8_t width = 0;
#endif // _di_level_2_parameter_checking_
f_status_t status = 0;
- f_string_range_t range = macro_f_string_range_t_initialize(object.used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(object.used);
status = fl_fss_basic_object_write(object, quote, f_fss_complete_full_e, state, &range, destination);
#endif // _di_level_2_parameter_checking_
f_status_t status = 0;
- f_string_range_t range = macro_f_string_range_t_initialize(object.used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(object.used);
status = fl_fss_basic_list_object_write(object, f_fss_complete_full_e, state, &range, destination);
#endif // _di_level_2_parameter_checking_
f_status_t status = 0;
- f_string_range_t range = macro_f_string_range_t_initialize(object.used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(object.used);
status = fl_fss_embedded_list_object_write(object, f_fss_complete_full_e, state, &range, destination);
#endif // _di_level_2_parameter_checking_
f_status_t status = 0;
- f_string_range_t range = macro_f_string_range_t_initialize(object.used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(object.used);
status = fl_fss_extended_object_write(object, quote, f_fss_complete_full_e, state, &range, destination);
#endif // _di_level_2_parameter_checking_
f_status_t status = 0;
- f_string_range_t range = macro_f_string_range_t_initialize(object.used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(object.used);
status = fl_fss_extended_list_object_write(object, f_fss_complete_full_e, state, &range, destination);
#endif // _di_level_2_parameter_checking_
f_status_t status = 0;
- f_string_range_t range = macro_f_string_range_t_initialize(object.used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(object.used);
status = fl_fss_basic_list_object_write(object, trim ? f_fss_complete_full_trim_e : f_fss_complete_full_e, state, &range, destination);
if (escaped->used > escaped->size) return F_status_set_error(F_parameter);
#endif // _di_level_2_parameter_checking_
- const f_string_range_t range = macro_f_string_range_t_initialize(content.used);
+ const f_string_range_t range = macro_f_string_range_t_initialize2(content.used);
return private_fll_iki_content_partial_escape(content, range, quote.string[0], escaped);
}
if (unescaped->used > unescaped->size) return F_status_set_error(F_parameter);
#endif // _di_level_2_parameter_checking_
- const f_string_range_t range = macro_f_string_range_t_initialize(content.used);
+ const f_string_range_t range = macro_f_string_range_t_initialize2(content.used);
return private_fll_iki_content_partial_unescape(content, range, quote.string[0], unescaped);
}
{
f_state_t state = macro_f_state_t_initialize(control_allocation_large_d, control_allocation_small_d, 0, &control_signal_state_interrupt_fss, 0, (void *) main, 0);
- f_string_range_t range_packet = macro_f_string_range_t_initialize(data->cache.large.used);
+ f_string_range_t range_packet = macro_f_string_range_t_initialize2(data->cache.large.used);
status = fll_fss_basic_list_read(data->cache.large, state, &range_packet, &data->cache.packet_objects, &data->cache.packet_contents, &data->cache.delimits, 0, 0);
if (F_status_is_error(status)) return status;
#ifndef _di_controller_pids_resize_
f_status_t controller_pids_resize(const f_array_length_t length, controller_pids_t * const pids) {
- f_status_t status = F_none;
-
- status = f_memory_resize(pids->size, length, sizeof(controller_rule_t), (void **) & pids->array);
+ const f_status_t status = f_memory_resize(pids->size, length, sizeof(controller_rule_t), (void **) & pids->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- pids->size = length;
+ pids->size = length;
- if (pids->used > pids->size) {
- pids->used = length;
- }
+ if (pids->used > pids->size) {
+ pids->used = length;
}
- return status;
+ return F_none;
}
#endif // _di_controller_pids_resize_
} // for
status = f_memory_resize(processs->size, length, sizeof(controller_process_t), (void **) & processs->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status) && length) {
-
+ if (length) {
controller_process_t *process = 0;
// The lock must be initialized, but only once, so initialize immediately upon allocation.
return status;
}
- else {
- for (f_array_length_t i = 0; i < controller_rule_action_type__enum_size_e; ++i) {
- process->rule.status[i] = F_known_not;
- } // for
- }
+
+ for (f_array_length_t i = 0; i < controller_rule_action_type__enum_size_e; ++i) {
+ process->rule.status[i] = F_known_not;
+ } // for
} // for
processs->size = length;
}
}
- return status;
+ return F_none;
}
#endif // _di_controller_processs_resize_
} // for
const f_status_t status = f_memory_resize(ons->size, length, sizeof(controller_rule_on_t), (void **) & ons->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- ons->size = length;
+ ons->size = length;
- if (ons->used > ons->size) {
- ons->used = length;
- }
+ if (ons->used > ons->size) {
+ ons->used = length;
}
- return status;
+ return F_none;
}
#endif // _di_controller_rule_ons_resize_
} // for
const f_status_t status = f_memory_resize(rules->size, length, sizeof(controller_rule_t), (void **) & rules->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- rules->size = length;
+ rules->size = length;
- if (rules->used > rules->size) {
- rules->used = length;
- }
+ if (rules->used > rules->size) {
+ rules->used = length;
}
- return status;
+ return F_none;
}
#endif // _di_controller_rules_resize_
} // for
const f_status_t status = f_memory_resize(tasks->size, length, sizeof(controller_task_t), (void **) & tasks->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- tasks->size = length;
+ tasks->size = length;
- if (tasks->used > tasks->size) {
- tasks->used = length;
- }
+ if (tasks->used > tasks->size) {
+ tasks->used = length;
}
- return status;
+ return F_none;
}
#endif // _di_controller_tasks_resize_
if (F_status_is_error_not(status)) {
f_number_unsigned_t number = 0;
- f_string_range_t range = macro_f_string_range_t_initialize(pid_buffer.used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(pid_buffer.used);
for (; range.start < pid_buffer.used; ++range.start) {
if (!isspace(pid_buffer.string[range.start])) break;
if (F_status_is_error_not(status)) {
f_number_unsigned_t number = 0;
- f_string_range_t range = macro_f_string_range_t_initialize(pid_buffer.used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(pid_buffer.used);
for (; range.start < pid_buffer.used; ++range.start) {
if (!isspace(pid_buffer.string[range.start])) break;
}
if (destination->used >= setting->path_current.used) {
- const f_string_range_t range = macro_f_string_range_t_initialize(setting->path_current.used);
+ const f_string_range_t range = macro_f_string_range_t_initialize2(setting->path_current.used);
if (fl_string_dynamic_partial_compare(*destination, setting->path_current, range, range) == F_equal_to) {
f_array_length_t length = destination->used - setting->path_current.used;
if (cache->buffer_file.used) {
controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_entry, global.thread);
f_state_t state = macro_f_state_t_initialize(controller_common_allocation_large_d, controller_common_allocation_small_d, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
- f_string_range_t range = macro_f_string_range_t_initialize(cache->buffer_file.used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(cache->buffer_file.used);
status = fll_fss_basic_list_read(cache->buffer_file, state, &range, &cache->object_items, &cache->content_items, &cache->delimits, 0, &cache->comments);
state.step_small = controller_common_allocation_iki_small_d;
state.interrupt = &controller_thread_signal_state_iki;
- f_string_range_t range_iki = macro_f_string_range_t_initialize(actions->array[actions->used].parameters.array[0].used);
+ f_string_range_t range_iki = macro_f_string_range_t_initialize2(actions->array[actions->used].parameters.array[0].used);
status = fl_iki_read(state, &actions->array[actions->used].parameters.array[0], &range_iki, &actions->array[actions->used].ikis.array[0]);
state.step_small = controller_common_allocation_iki_small_d;
state.interrupt = &controller_thread_signal_state_iki;
- f_string_range_t range_iki = macro_f_string_range_t_initialize(actions->array[actions->used].parameters.array[0].used);
+ f_string_range_t range_iki = macro_f_string_range_t_initialize2(actions->array[actions->used].parameters.array[0].used);
status = fl_iki_read(state, &actions->array[actions->used].parameters.array[0], &range_iki, &actions->array[actions->used].ikis.array[0]);
status = f_string_maps_append_all(source.parameter, &destination->parameter);
if (F_status_is_error(status)) return status;
- status = f_string_dynamics_append(source.environment, &destination->environment);
+ status = f_string_dynamics_append_all(source.environment, &destination->environment);
if (F_status_is_error(status)) return status;
if (source.ons.used) {
if (source.ons.array[i].need.used) {
destination->ons.array[i].need.used = 0;
- status = f_string_dynamics_append(source.ons.array[i].need, &destination->ons.array[i].need);
+ status = f_string_dynamics_append_all(source.ons.array[i].need, &destination->ons.array[i].need);
if (F_status_is_error(status)) return status;
}
if (source.ons.array[i].want.used) {
destination->ons.array[i].want.used = 0;
- status = f_string_dynamics_append(source.ons.array[i].want, &destination->ons.array[i].want);
+ status = f_string_dynamics_append_all(source.ons.array[i].want, &destination->ons.array[i].want);
if (F_status_is_error(status)) return status;
}
if (source.ons.array[i].wish.used) {
destination->ons.array[i].wish.used = 0;
- status = f_string_dynamics_append(source.ons.array[i].wish, &destination->ons.array[i].wish);
+ status = f_string_dynamics_append_all(source.ons.array[i].wish, &destination->ons.array[i].wish);
if (F_status_is_error(status)) return status;
}
} // for
destination->ons.used = source.ons.used;
}
- status = f_int32s_append(source.affinity, &destination->affinity);
+ status = f_int32s_append_all(source.affinity, &destination->affinity);
if (F_status_is_error(status)) return status;
if (source.capability) {
status = f_control_group_copy(source.cgroup, &destination->cgroup);
if (F_status_is_error(status)) return status;
- status = f_int32s_append(source.groups, &destination->groups);
+ status = f_int32s_append_all(source.groups, &destination->groups);
if (F_status_is_error(status)) return status;
status = f_limit_sets_copy(source.limits, &destination->limits);
if (F_status_is_error(status)) return status;
for (j = 0; j < controller_rule_action_type_execute__enum_size_e; ++j) {
+
item_destination->reruns[j].is = item_source->reruns[j].is;
item_destination->reruns[j].failure.count = item_source->reruns[j].failure.count;
item_destination->reruns[j].failure.delay = item_source->reruns[j].failure.delay;
action_destination->parameters.used = 0;
action_destination->ikis.used = 0;
- status = f_string_dynamics_append(action_source->parameters, &action_destination->parameters);
+ status = f_string_dynamics_append_all(action_source->parameters, &action_destination->parameters);
if (F_status_is_error(status)) return status;
- status = f_iki_datas_append(action_source->ikis, &action_destination->ikis);
+ status = f_iki_datas_append_all(action_source->ikis, &action_destination->ikis);
if (F_status_is_error(status)) return status;
} // for
f_status_t status = F_none;
controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_normal, global.thread);
f_state_t state = macro_f_state_t_initialize(controller_common_allocation_large_d, controller_common_allocation_small_d, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
- f_string_range_t range = macro_f_string_range_t_initialize(cache->buffer_item.used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(cache->buffer_item.used);
f_array_length_t last = 0;
uint8_t type = 0;
if (cache->buffer_file.used) {
controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_normal, global.thread);
f_state_t state = macro_f_state_t_initialize(controller_common_allocation_large_d, controller_common_allocation_small_d, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
- f_string_range_t range = macro_f_string_range_t_initialize(cache->buffer_file.used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(cache->buffer_file.used);
status = fll_fss_basic_list_read(cache->buffer_file, state, &range, &cache->object_items, &cache->content_items, &cache->delimits, 0, &cache->comments);
f_status_t status = F_none;
f_status_t status_return = F_none;
- f_string_range_t range = macro_f_string_range_t_initialize(cache->buffer_item.used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(cache->buffer_item.used);
f_string_range_t range2 = f_string_range_t_initialize;
{
*
* Errors (with error bit) from: f_capability_copy().
* Errors (with error bit) from: f_control_group_copy().
+ * Errors (with error bit) from: f_iki_datas_append_all().
+ * Errors (with error bit) from: f_int32s_append_all().
* Errors (with error bit) from: f_limit_sets_copy().
* Errors (with error bit) from: f_string_dynamic_append().
- * Errors (with error bit) from: f_string_dynamics_append().
+ * Errors (with error bit) from: f_string_dynamics_append_all().
* Errors (with error bit) from: f_string_maps_append_all().
- * Errors (with error bit) from: f_int32s_append().
*
* @see f_capability_copy()
* @see f_control_group_copy()
+ * @see f_iki_datas_append_all()
+ * @see f_int32s_append_all()
* @see f_limit_sets_append()
* @see f_string_dynamic_append()
- * @see f_string_dynamics_append()
+ * @see f_string_dynamics_append_all()
* @see f_string_maps_append_all()
- * @see f_int32s_append()
*/
#ifndef _di_controller_rule_copy_
extern f_status_t controller_rule_copy(const controller_rule_t source, controller_rule_t *destination) F_attribute_visibility_internal_d;
}
if (F_status_is_error_not(*status)) {
- f_string_range_t range = macro_f_string_range_t_initialize(buffer.used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(buffer.used);
f_fss_delimits_t delimits = f_fss_delimits_t_initialize;
{
f_fss_contents_t list_contents = f_fss_contents_t_initialize;
{
- f_string_range_t range = macro_f_string_range_t_initialize(data_make->buffer.used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(data_make->buffer.used);
f_fss_delimits_t delimits = f_fss_delimits_t_initialize;
f_fss_comments_t comments = f_fss_comments_t_initialize;
const f_string_static_t vocabulary_define = macro_f_string_static_t_initialize2(F_iki_vocabulary_0002_define_s, F_iki_vocabulary_0002_define_s_length);
const f_string_static_t vocabulary_parameter = macro_f_string_static_t_initialize2(F_iki_vocabulary_0002_parameter_s, F_iki_vocabulary_0002_parameter_s_length);
- const f_string_range_t range_context = macro_f_string_range_t_initialize(F_iki_vocabulary_0002_context_s_length);
- const f_string_range_t range_define = macro_f_string_range_t_initialize(F_iki_vocabulary_0002_define_s_length);
- const f_string_range_t range_parameter = macro_f_string_range_t_initialize(F_iki_vocabulary_0002_parameter_s_length);
+ const f_string_range_t range_context = macro_f_string_range_t_initialize2(F_iki_vocabulary_0002_context_s_length);
+ const f_string_range_t range_define = macro_f_string_range_t_initialize2(F_iki_vocabulary_0002_define_s_length);
+ const f_string_range_t range_parameter = macro_f_string_range_t_initialize2(F_iki_vocabulary_0002_parameter_s_length);
f_iki_data_t iki_data = f_iki_data_t_initialize;
return F_status_set_error(F_false);
}
- const f_string_range_t range = macro_f_string_range_t_initialize(data_make->path.stack.array[0].used);
+ const f_string_range_t range = macro_f_string_range_t_initialize2(data_make->path.stack.array[0].used);
if (range.start <= range.stop) {
status = fl_string_dynamic_partial_compare(data_make->path.stack.array[0], data_make->path_cache, range, range);
{
f_state_t state = f_state_t_initialize;
- f_string_range_t input = macro_f_string_range_t_initialize(local_buffer.used);
+ f_string_range_t input = macro_f_string_range_t_initialize2(local_buffer.used);
status = fll_fss_basic_read(local_buffer, state, &input, &basic_objects, &basic_contents, 0, &delimits, 0);
}
{
f_state_t state = f_state_t_initialize;
- f_string_range_t input = macro_f_string_range_t_initialize(local->buffer.used);
+ f_string_range_t input = macro_f_string_range_t_initialize2(local->buffer.used);
status = fll_fss_basic_list_read(local->buffer, state, &input, &local->chain_objects, &local->chain_contents, &delimits, 0, &comments);
}
--length;
}
- f_string_range_t range = macro_f_string_range_t_initialize(length);
+ f_string_range_t range = macro_f_string_range_t_initialize2(length);
// Ignore leading plus sign.
if (data.argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
} // for
const f_status_t status = f_memory_resize(depths->size, length, sizeof(fss_basic_list_read_depth_t), (void **) & depths->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- depths->size = length;
+ depths->size = length;
- if (depths->used > depths->size) {
- depths->used = length;
- }
+ if (depths->used > depths->size) {
+ depths->used = length;
}
- return status;
+ return F_none;
}
#endif // _di_fss_basic_list_read_depths_resize_
f_status_t fss_basic_list_read_load(fll_program_data_t * const main, fss_basic_list_read_data_t * const data) {
f_state_t state = macro_f_state_t_initialize(fss_basic_list_read_common_allocation_large_d, fss_basic_list_read_common_allocation_small_d, 0, 0, 0, 0, 0);
- f_string_range_t input = macro_f_string_range_t_initialize(data->buffer.used);
+ f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
data->delimits_object.used = 0;
data->delimits_content.used = 0;
const f_array_length_t index = main->parameters.array[fss_basic_list_write_parameter_prepend_e].values.array[main->parameters.array[fss_basic_list_write_parameter_prepend_e].values.used - 1];
if (main->parameters.arguments.array[index].used) {
- f_string_range_t range = macro_f_string_range_t_initialize(main->parameters.arguments.array[index].used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(main->parameters.arguments.array[index].used);
for (; range.start < main->parameters.arguments.array[index].used; ++range.start) {
--length;
}
- f_string_range_t range = macro_f_string_range_t_initialize(length);
+ f_string_range_t range = macro_f_string_range_t_initialize2(length);
// Ignore leading plus sign.
if (data.argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
} // for
const f_status_t status = f_memory_resize(depths->size, length, sizeof(fss_basic_read_depth_t), (void **) & depths->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- depths->size = length;
+ depths->size = length;
- if (depths->used > depths->size) {
- depths->used = length;
- }
+ if (depths->used > depths->size) {
+ depths->used = length;
}
- return status;
+ return F_none;
}
#endif // _di_fss_basic_read_depths_resize_
f_status_t fss_basic_read_load(fll_program_data_t * const main, fss_basic_read_data_t * const data) {
f_state_t state = macro_f_state_t_initialize(fss_basic_read_common_allocation_large_d, fss_basic_read_common_allocation_small_d, 0, 0, 0, 0, 0);
- f_string_range_t input = macro_f_string_range_t_initialize(data->buffer.used);
+ f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
data->delimits.used = 0;
data->quotes.used = 0;
// Even though this standard does not utilize this parameter, provide the validation for consistency.
if (argv[index].used) {
- f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(argv[index].used);
for (; range.start < argv[index].used; ++range.start) {
--length;
}
- f_string_range_t range = macro_f_string_range_t_initialize(length);
+ f_string_range_t range = macro_f_string_range_t_initialize2(length);
// Ignore leading plus sign.
if (argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
{
f_state_t state = macro_f_state_t_initialize(fss_embedded_list_read_common_allocation_large_d, fss_embedded_list_read_common_allocation_small_d, 0, 0, 0, 0, 0);
- f_string_range_t input = macro_f_string_range_t_initialize(main->buffer.used);
+ f_string_range_t input = macro_f_string_range_t_initialize2(main->buffer.used);
objects_delimits->used = 0;
contents_delimits->used = 0;
const f_array_length_t index = main->parameters.array[fss_embedded_list_write_parameter_prepend_e].values.array[main->parameters.array[fss_embedded_list_write_parameter_prepend_e].values.used - 1];
if (argv[index].used) {
- f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(argv[index].used);
for (; range.start < argv[index].used; ++range.start) {
--length;
}
- f_string_range_t range = macro_f_string_range_t_initialize(length);
+ f_string_range_t range = macro_f_string_range_t_initialize2(length);
// Ignore leading plus sign.
if (data.argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
} // for
const f_status_t status = f_memory_resize(depths->size, length, sizeof(fss_extended_list_read_depth_t), (void **) & depths->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- depths->size = length;
+ depths->size = length;
- if (depths->used > depths->size) {
- depths->used = length;
- }
+ if (depths->used > depths->size) {
+ depths->used = length;
}
- return status;
+ return F_none;
}
#endif // _di_fss_extended_list_read_depths_resize_
f_status_t fss_extended_list_read_load(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) {
f_state_t state = macro_f_state_t_initialize(fss_extended_list_read_common_allocation_large_d, fss_extended_list_read_common_allocation_small_d, 0, 0, 0, 0, 0);
- f_string_range_t input = macro_f_string_range_t_initialize(data->buffer.used);
+ f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
data->delimits_object.used = 0;
data->delimits_content.used = 0;
const f_array_length_t index = main->parameters.array[fss_extended_list_write_parameter_prepend_e].values.array[main->parameters.array[fss_extended_list_write_parameter_prepend_e].values.used - 1];
if (argv[index].used) {
- f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(argv[index].used);
for (; range.start < argv[index].used; ++range.start) {
--length;
}
- f_string_range_t range = macro_f_string_range_t_initialize(length);
+ f_string_range_t range = macro_f_string_range_t_initialize2(length);
// Ignore leading plus sign.
if (data.argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
} // for
const f_status_t status = f_memory_resize(depths->size, length, sizeof(fss_extended_read_depth_t), (void **) & depths->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- depths->size = length;
+ depths->size = length;
- if (depths->used > depths->size) {
- depths->used = length;
- }
+ if (depths->used > depths->size) {
+ depths->used = length;
}
- return status;
+ return F_none;
}
#endif // _di_fss_extended_read_depths_resize_
f_status_t fss_extended_read_load(fll_program_data_t * const main, fss_extended_read_data_t * const data) {
f_state_t state = macro_f_state_t_initialize(fss_extended_read_common_allocation_large_d, fss_extended_read_common_allocation_small_d, 0, 0, 0, 0, 0);
- f_string_range_t input = macro_f_string_range_t_initialize(data->buffer.used);
+ f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
data->delimits_object.used = 0;
data->delimits_content.used = 0;
// Even though this standard does not utilize this parameter, provide the validation for consistency.
if (argv[index].used) {
- f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(argv[index].used);
for (; range.start < argv[index].used; ++range.start) {
else if (main->parameters.array[fss_identify_parameter_name_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[fss_identify_parameter_name_e].values.array[main->parameters.array[fss_identify_parameter_name_e].values.used - 1];
const f_array_length_t length = data.argv[index].used;
- const f_string_range_t range = macro_f_string_range_t_initialize(length);
+ const f_string_range_t range = macro_f_string_range_t_initialize2(length);
if (length == 0) {
flockfile(main->error.to.stream);
if (mode) {
f_array_length_t number = 0;
- f_string_range_t range = macro_f_string_range_t_initialize(data->name.used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(data->name.used);
for (f_array_length_t i = 0; i < data->name.used; ++i) {
--length;
}
- f_string_range_t range = macro_f_string_range_t_initialize(length);
+ f_string_range_t range = macro_f_string_range_t_initialize2(length);
// Ignore leading plus sign.
if (data.argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
} // for
const f_status_t status = f_memory_resize(depths->size, length, sizeof(fss_payload_read_depth_t), (void **) & depths->array);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- depths->size = length;
+ depths->size = length;
- if (depths->used > depths->size) {
- depths->used = length;
- }
+ if (depths->used > depths->size) {
+ depths->used = length;
}
- return status;
+ return F_none;
}
#endif // _di_fss_payload_read_depths_resize_
f_status_t fss_payload_read_load(fll_program_data_t * const main, fss_payload_read_data_t * const data) {
f_state_t state = macro_f_state_t_initialize(fss_payload_read_common_allocation_large_d, fss_payload_read_common_allocation_small_d, 0, 0, 0, 0, 0);
- f_string_range_t input = macro_f_string_range_t_initialize(data->buffer.used);
+ f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
data->delimits_object.used = 0;
data->delimits_content.used = 0;
const f_array_length_t index = main->parameters.array[fss_payload_write_parameter_prepend_e].values.array[main->parameters.array[fss_payload_write_parameter_prepend_e].values.used - 1];
if (argv[index].used) {
- f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(argv[index].used);
for (; range.start < argv[index].used; range.start++) {
f_print_dynamic(substitutions.array[i].with, main->output.to.stream);
}
else {
- f_string_range_t range = macro_f_string_range_t_initialize2(iki_data.variable.array[index].start, iki_data.content.array[index].start - 1);
+ f_string_range_t range = macro_f_string_range_t_initialize(iki_data.variable.array[index].start, iki_data.content.array[index].start - 1);
f_print_dynamic_partial(main->buffer, range, main->output.to.stream);
f_iki_data_t iki_data = f_iki_data_t_initialize;
if (main->parameters.array[iki_read_parameter_whole_e].result == f_console_result_found_e) {
- f_string_range_t buffer_range = macro_f_string_range_t_initialize(main->buffer.used);
+ f_string_range_t buffer_range = macro_f_string_range_t_initialize2(main->buffer.used);
status = iki_read_process_at(main, &buffer_range);
status = iki_read_process_buffer_total(main, &iki_data);
}
else {
- f_string_range_t buffer_range = macro_f_string_range_t_initialize(main->buffer.used);
+ f_string_range_t buffer_range = macro_f_string_range_t_initialize2(main->buffer.used);
status = iki_read_process_at(main, &buffer_range);
} // for
if (name_missed) {
- macro_f_memory_structure_increment(status, names, 1, F_iki_default_allocation_step_d, macro_f_string_dynamics_t_resize, F_array_too_large);
+ macro_f_memory_structure_increment(status, names, 1, F_iki_default_allocation_small_d, macro_f_string_dynamics_t_resize, F_array_too_large);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "macro_f_memory_structure_increment", F_true);
f_status_t iki_read_process_buffer_total(iki_read_main_t * const main, f_iki_data_t *iki_data) {
f_status_t status = F_none;
- f_string_range_t range = macro_f_string_range_t_initialize(main->buffer.used);
+ f_string_range_t range = macro_f_string_range_t_initialize2(main->buffer.used);
status = iki_read_process_at(main, &range);
for (j = 0; j < vocabulary->used; ++j) {
if (fl_string_dynamic_partial_compare_string(main->parameters.arguments.array[index].string, main->buffer, main->parameters.arguments.array[index].used, vocabulary->array[j]) == F_equal_to) {
- macro_f_memory_structure_increment(status, substitutionss[j], 1, F_iki_default_allocation_step_d, macro_iki_read_substitutions_t_resize, F_array_too_large);
+ macro_f_memory_structure_increment(status, substitutionss[j], 1, F_iki_default_allocation_small_d, macro_iki_read_substitutions_t_resize, F_array_too_large);
if (F_status_is_error(status)) return status;
index = parameter->values.array[i + 1];