From d09a79e83b426d1e6071be917797cec4d470f51c Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 29 May 2021 22:22:45 -0500 Subject: [PATCH] Update: Additional FLL Identifier changes along with type fixes. I didn't like manually specifying the id.name[X] for all 64 X when clearing the f_fll_id_t. Instead, take a minimalistic approach and set id.name[0] to NULL. This is not a complete clear, but it is simple for use in macros. Document that memset() should be used for a more complete/correct clear. I completely forgot to implement the array and array of arrays support as is standard practice now. While doing this I then noticed that the other type arrays and array of arrays were not fully migrated to having functions rather than be pure macros. This further exposed some bugs being hidden by the macros. There were some resize (or similar) macros that were using the wrong macro to initialize. When macros were changed to expand to a function, this exposed that the wrong types were being used and there is a likelihood of incorrect allocations or deallocations. Things may have previously worked due to the sizes potentially being coincidentally identical. There is also a bug where some macros expanded the *_increase_by() macro to a *_increase() function. These should instead expand to an appropriate *_increase_by() function. --- level_0/f_type/c/type.h | 110 ++- level_0/f_type_array/c/private-type_array.c | 360 ++++++++++ level_0/f_type_array/c/private-type_array.h | 383 +++++++++++ level_0/f_type_array/c/type_array-common.h | 386 ++++++----- level_0/f_type_array/c/type_array.c | 673 +++++++++++++++++++ level_0/f_type_array/c/type_array.h | 996 ++++++++++++++++++++++++++++ level_1/fl_string/c/string.h | 5 + level_3/controller/c/private-rule.c | 2 +- 8 files changed, 2673 insertions(+), 242 deletions(-) diff --git a/level_0/f_type/c/type.h b/level_0/f_type/c/type.h index 1268adf..a5ccffd 100644 --- a/level_0/f_type/c/type.h +++ b/level_0/f_type/c/type.h @@ -1060,8 +1060,9 @@ extern "C" { * * This intentionally utilizes a fixed array to avoid the need of dynamic allocation. * - * The macro_f_fll_id_t_clear() is provided for "consistency in design" reasons. - * However, it is probably a better idea to use memset to clear the name array. + * The macro_f_fll_id_t_clear() only performs a minimalistic clear on the id.name string. + * The first character in the string array is assigned to NULL. + * For a more accurate clear, use memset() or something similar. * * The name must only be "word" characters (therefore "-" is not allowed). * @@ -1085,72 +1086,49 @@ extern "C" { #define macro_f_fll_id_t_clear(id) \ id.name[0] = 0; \ - id.name[1] = 0; \ - id.name[2] = 0; \ - id.name[3] = 0; \ - id.name[4] = 0; \ - id.name[5] = 0; \ - id.name[6] = 0; \ - id.name[7] = 0; \ - id.name[8] = 0; \ - id.name[9] = 0; \ - id.name[10] = 0; \ - id.name[11] = 0; \ - id.name[12] = 0; \ - id.name[13] = 0; \ - id.name[14] = 0; \ - id.name[15] = 0; \ - id.name[16] = 0; \ - id.name[17] = 0; \ - id.name[18] = 0; \ - id.name[19] = 0; \ - id.name[20] = 0; \ - id.name[21] = 0; \ - id.name[22] = 0; \ - id.name[23] = 0; \ - id.name[24] = 0; \ - id.name[25] = 0; \ - id.name[26] = 0; \ - id.name[27] = 0; \ - id.name[28] = 0; \ - id.name[29] = 0; \ - id.name[30] = 0; \ - id.name[31] = 0; \ - id.name[32] = 0; \ - id.name[33] = 0; \ - id.name[34] = 0; \ - id.name[35] = 0; \ - id.name[36] = 0; \ - id.name[37] = 0; \ - id.name[38] = 0; \ - id.name[39] = 0; \ - id.name[40] = 0; \ - id.name[41] = 0; \ - id.name[42] = 0; \ - id.name[43] = 0; \ - id.name[44] = 0; \ - id.name[45] = 0; \ - id.name[46] = 0; \ - id.name[47] = 0; \ - id.name[48] = 0; \ - id.name[49] = 0; \ - id.name[50] = 0; \ - id.name[51] = 0; \ - id.name[52] = 0; \ - id.name[53] = 0; \ - id.name[54] = 0; \ - id.name[55] = 0; \ - id.name[56] = 0; \ - id.name[57] = 0; \ - id.name[58] = 0; \ - id.name[59] = 0; \ - id.name[60] = 0; \ - id.name[61] = 0; \ - id.name[62] = 0; \ - id.name[63] = 0; \ id.type = 0; \ id.used = 0; -#endif // _di_f_fll_id_t__ +#endif // _di_f_fll_id_t_ + +/** + * An array of f_fll_id_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: The array of f_fll_id_t. + * size: Total amount of allocated space. + * used: Total number of allocated spaces used. + */ +#ifndef _di_f_fll_ids_t_ + typedef struct { + f_fll_id_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_fll_ids_t; + + #define f_fll_ids_t_initialize { 0, 0, 0 } +#endif // _di_f_fll_ids_t_ + +/** + * This holds an array of f_fll_ids_t. + * + * The macros are defined in type_array.h or type_array-common.h. + * + * array: The array of f_fll_id_t arrays. + * size: Total amount of allocated space. + * used: Total number of allocated spaces used. + */ +#ifndef _di_f_fll_idss_t_ + typedef struct { + f_fll_ids_t *array; + + f_array_length_t size; + f_array_length_t used; + } f_fll_idss_t; + + #define f_fll_idss_t_initialize { 0, 0, 0 } +#endif // _di_f_fll_idss_t_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_type_array/c/private-type_array.c b/level_0/f_type_array/c/private-type_array.c index 2cf049b..982e1c6 100644 --- a/level_0/f_type_array/c/private-type_array.c +++ b/level_0/f_type_array/c/private-type_array.c @@ -5,6 +5,222 @@ extern "C" { #endif +#if !defined(_di_f_type_statuss_adjust_) || !defined(_di_f_type_statuss_decimate_by_) + f_status_t private_f_type_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_statuss_t), (void **) & statuss->array); + + if (F_status_is_error_not(status)) { + statuss->size = length; + + if (statuss->used > statuss->size) { + statuss->used = length; + } + } + + return status; + } +#endif // !defined(_di_f_type_statuss_adjust_) || !defined(_di_f_type_statuss_decimate_by_) + +#if !defined(_di_f_type_statuss_append_) || !defined(_di_f_type_statusss_append_) + extern f_status_t private_f_type_statuss_append(const f_statuss_t source, f_statuss_t *destination) { + + f_status_t status = F_none; + + if (destination->used + source.used > destination->size) { + status = private_f_type_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 + + return F_none; + } +#endif // !defined(_di_f_type_statuss_append_) || !defined(_di_f_type_statusss_append_) + +#if !defined(_di_f_type_statuss_resize_) || !defined(_di_f_type_statuss_append_) || !defined(_di_f_type_statuss_decimate_by_) || !defined(_di_f_type_statusss_append_) + f_status_t private_f_type_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_statuss_t), (void **) & statuss->array); + + if (F_status_is_error_not(status)) { + statuss->size = length; + + if (statuss->used > statuss->size) { + statuss->used = length; + } + } + + return status; + } +#endif // !defined(_di_f_type_statuss_resize_) || !defined(_di_f_type_statuss_append_) || !defined(_di_f_type_statuss_decimate_by_) || !defined(_di_f_type_statusss_append_) + +#if !defined(_di_f_type_statusss_adjust_) || !defined(_di_f_type_statusss_decimate_by_) + f_status_t private_f_type_statusss_adjust(const f_array_length_t length, f_statusss_t *statusss) { + + f_status_t status = F_none; + + for (f_array_length_t i = length; i < statusss->size; ++i) { + + status = f_memory_destroy(statusss->array[i].size, sizeof(f_statuss_t), (void **) & statusss->array[i].array); + if (F_status_is_error(status)) return status; + + statusss->array[i].size = 0; + statusss->array[i].used = 0; + } // for + + status = f_memory_adjust(statusss->size, length, sizeof(f_statuss_t), (void **) & statusss->array); + + if (F_status_is_error_not(status)) { + statusss->size = length; + + if (statusss->used > statusss->size) { + statusss->used = length; + } + } + + return status; + } +#endif // !defined(_di_f_type_statusss_adjust_) || !defined(_di_f_type_statusss_decimate_by_) + +#if !defined(_di_f_type_statusss_decrease_by_) || !defined(_di_f_type_statusss_increase_) || !defined(_di_f_type_statusss_increase_by_) || !defined(_di_f_type_statusss_resize_) + f_status_t private_f_type_statusss_resize(const f_array_length_t length, f_statusss_t *statusss) { + + f_status_t status = F_none; + + for (f_array_length_t i = length; i < statusss->size; ++i) { + + status = f_memory_delete(statusss->array[i].size, sizeof(f_statuss_t), (void **) & statusss->array[i].array); + if (F_status_is_error(status)) return status; + + statusss->array[i].size = 0; + statusss->array[i].used = 0; + } // for + + status = f_memory_resize(statusss->size, length, sizeof(f_statuss_t), (void **) & statusss->array); + + if (F_status_is_error_not(status)) { + statusss->size = length; + + if (statusss->used > statusss->size) { + statusss->used = length; + } + } + + return status; + } +#endif // !defined(_di_f_type_statusss_decrease_by_) || !defined(_di_f_type_statusss_increase_) || !defined(_di_f_type_statusss_increase_by_) || !defined(_di_f_type_statusss_resize_) + +#if !defined(_di_f_type_states_adjust_) || !defined(_di_f_type_states_decimate_by_) + f_status_t private_f_type_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_states_t), (void **) & states->array); + + if (F_status_is_error_not(status)) { + states->size = length; + + if (states->used > states->size) { + states->used = length; + } + } + + return status; + } +#endif // !defined(_di_f_type_states_adjust_) || !defined(_di_f_type_states_decimate_by_) + +#if !defined(_di_f_type_states_append_) || !defined(_di_f_type_statess_append_) + extern f_status_t private_f_type_states_append(const f_states_t source, f_states_t *destination) { + + f_status_t status = F_none; + + if (destination->used + source.used > destination->size) { + status = private_f_type_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 + + return F_none; + } +#endif // !defined(_di_f_type_states_append_) || !defined(_di_f_type_statess_append_) + +#if !defined(_di_f_type_states_resize_) || !defined(_di_f_type_states_append_) || !defined(_di_f_type_states_decimate_by_) || !defined(_di_f_type_statess_append_) + f_status_t private_f_type_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_states_t), (void **) & states->array); + + if (F_status_is_error_not(status)) { + states->size = length; + + if (states->used > states->size) { + states->used = length; + } + } + + return status; + } +#endif // !defined(_di_f_type_states_resize_) || !defined(_di_f_type_states_append_) || !defined(_di_f_type_states_decimate_by_) || !defined(_di_f_type_statess_append_) + +#if !defined(_di_f_type_statess_adjust_) || !defined(_di_f_type_statess_decimate_by_) + f_status_t private_f_type_statess_adjust(const f_array_length_t length, f_statess_t *statess) { + + f_status_t status = F_none; + + for (f_array_length_t i = length; i < statess->size; ++i) { + + status = f_memory_destroy(statess->array[i].size, sizeof(f_states_t), (void **) & statess->array[i].array); + if (F_status_is_error(status)) return status; + + statess->array[i].size = 0; + statess->array[i].used = 0; + } // for + + status = f_memory_adjust(statess->size, length, sizeof(f_states_t), (void **) & statess->array); + + if (F_status_is_error_not(status)) { + statess->size = length; + + if (statess->used > statess->size) { + statess->used = length; + } + } + + return status; + } +#endif // !defined(_di_f_type_statess_adjust_) || !defined(_di_f_type_statess_decimate_by_) + +#if !defined(_di_f_type_statess_decrease_by_) || !defined(_di_f_type_statess_increase_) || !defined(_di_f_type_statess_increase_by_) || !defined(_di_f_type_statess_resize_) + f_status_t private_f_type_statess_resize(const f_array_length_t length, f_statess_t *statess) { + + f_status_t status = F_none; + + for (f_array_length_t i = length; i < statess->size; ++i) { + + status = f_memory_delete(statess->array[i].size, sizeof(f_states_t), (void **) & statess->array[i].array); + if (F_status_is_error(status)) return status; + + statess->array[i].size = 0; + statess->array[i].used = 0; + } // for + + status = f_memory_resize(statess->size, length, sizeof(f_states_t), (void **) & statess->array); + + if (F_status_is_error_not(status)) { + statess->size = length; + + if (statess->used > statess->size) { + statess->used = length; + } + } + + return status; + } +#endif // !defined(_di_f_type_statess_decrease_by_) || !defined(_di_f_type_statess_increase_) || !defined(_di_f_type_statess_increase_by_) || !defined(_di_f_type_statess_resize_) + #if !defined(_di_f_type_cells_adjust_) || !defined(_di_f_type_cells_decimate_by_) f_status_t private_f_type_cells_adjust(const f_array_length_t length, f_cells_t *cells) { @@ -24,6 +240,7 @@ extern "C" { #if !defined(_di_f_type_cells_append_) || !defined(_di_f_type_cellss_append_) extern f_status_t private_f_type_cells_append(const f_cells_t source, f_cells_t *destination) { + f_status_t status = F_none; if (destination->used + source.used > destination->size) { @@ -58,6 +275,7 @@ extern "C" { #if !defined(_di_f_type_cellss_adjust_) || !defined(_di_f_type_cellss_decimate_by_) f_status_t private_f_type_cellss_adjust(const f_array_length_t length, f_cellss_t *cellss) { + f_status_t status = F_none; for (f_array_length_t i = length; i < cellss->size; ++i) { @@ -85,6 +303,7 @@ extern "C" { #if !defined(_di_f_type_cellss_decrease_by_) || !defined(_di_f_type_cellss_increase_) || !defined(_di_f_type_cellss_increase_by_) || !defined(_di_f_type_cellss_resize_) f_status_t private_f_type_cellss_resize(const f_array_length_t length, f_cellss_t *cellss) { + f_status_t status = F_none; for (f_array_length_t i = length; i < cellss->size; ++i) { @@ -110,6 +329,114 @@ extern "C" { } #endif // !defined(_di_f_type_cellss_decrease_by_) || !defined(_di_f_type_cellss_increase_) || !defined(_di_f_type_cellss_increase_by_) || !defined(_di_f_type_cellss_resize_) +#if !defined(_di_f_type_fll_ids_adjust_) || !defined(_di_f_type_fll_ids_decimate_by_) + f_status_t private_f_type_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_ids_t), (void **) & ids->array); + + if (F_status_is_error_not(status)) { + ids->size = length; + + if (ids->used > ids->size) { + ids->used = length; + } + } + + return status; + } +#endif // !defined(_di_f_type_fll_ids_adjust_) || !defined(_di_f_type_fll_ids_decimate_by_) + +#if !defined(_di_f_type_fll_ids_append_) || !defined(_di_f_type_fll_idss_append_) + extern f_status_t private_f_type_fll_ids_append(const f_fll_ids_t source, f_fll_ids_t *destination) { + + f_status_t status = F_none; + + if (destination->used + source.used > destination->size) { + status = private_f_type_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 + + return F_none; + } +#endif // !defined(_di_f_type_fll_ids_append_) || !defined(_di_f_type_fll_idss_append_) + +#if !defined(_di_f_type_fll_ids_resize_) || !defined(_di_f_type_fll_ids_append_) || !defined(_di_f_type_fll_ids_decimate_by_) || !defined(_di_f_type_fll_idss_append_) + f_status_t private_f_type_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_ids_t), (void **) & ids->array); + + if (F_status_is_error_not(status)) { + ids->size = length; + + if (ids->used > ids->size) { + ids->used = length; + } + } + + return status; + } +#endif // !defined(_di_f_type_fll_ids_resize_) || !defined(_di_f_type_fll_ids_append_) || !defined(_di_f_type_fll_ids_decimate_by_) || !defined(_di_f_type_fll_idss_append_) + +#if !defined(_di_f_type_fll_idss_adjust_) || !defined(_di_f_type_fll_idss_decimate_by_) + f_status_t private_f_type_fll_idss_adjust(const f_array_length_t length, f_fll_idss_t *idss) { + + f_status_t status = F_none; + + for (f_array_length_t i = length; i < idss->size; ++i) { + + status = f_memory_destroy(idss->array[i].size, sizeof(f_fll_ids_t), (void **) & idss->array[i].array); + if (F_status_is_error(status)) return status; + + idss->array[i].size = 0; + idss->array[i].used = 0; + } // for + + status = f_memory_adjust(idss->size, length, sizeof(f_fll_ids_t), (void **) & idss->array); + + if (F_status_is_error_not(status)) { + idss->size = length; + + if (idss->used > idss->size) { + idss->used = length; + } + } + + return status; + } +#endif // !defined(_di_f_type_fll_idss_adjust_) || !defined(_di_f_type_fll_idss_decimate_by_) + +#if !defined(_di_f_type_fll_idss_decrease_by_) || !defined(_di_f_type_fll_idss_increase_) || !defined(_di_f_type_fll_idss_increase_by_) || !defined(_di_f_type_fll_idss_resize_) + f_status_t private_f_type_fll_idss_resize(const f_array_length_t length, f_fll_idss_t *idss) { + + f_status_t status = F_none; + + for (f_array_length_t i = length; i < idss->size; ++i) { + + status = f_memory_delete(idss->array[i].size, sizeof(f_fll_ids_t), (void **) & idss->array[i].array); + if (F_status_is_error(status)) return status; + + idss->array[i].size = 0; + idss->array[i].used = 0; + } // for + + status = f_memory_resize(idss->size, length, sizeof(f_fll_ids_t), (void **) & idss->array); + + if (F_status_is_error_not(status)) { + idss->size = length; + + if (idss->used > idss->size) { + idss->used = length; + } + } + + return status; + } +#endif // !defined(_di_f_type_fll_idss_decrease_by_) || !defined(_di_f_type_fll_idss_increase_) || !defined(_di_f_type_fll_idss_increase_by_) || !defined(_di_f_type_fll_idss_resize_) + #if !defined(_di_f_type_array_lengths_adjust_) || !defined(_di_f_type_array_lengths_decimate_by_) f_status_t private_f_type_array_lengths_adjust(const f_array_length_t length, f_array_lengths_t *array_lengths) { @@ -129,6 +456,7 @@ extern "C" { #if !defined(_di_f_type_array_lengths_append_) || !defined(_di_f_type_array_lengthss_append_) extern f_status_t private_f_type_array_lengths_append(const f_array_lengths_t source, f_array_lengths_t *destination) { + f_status_t status = F_none; if (destination->used + source.used > destination->size) { @@ -163,6 +491,7 @@ extern "C" { #if !defined(_di_f_type_array_lengthss_adjust_) || !defined(_di_f_type_array_lengthss_decimate_by_) f_status_t private_f_type_array_lengthss_adjust(const f_array_length_t length, f_array_lengthss_t *lengthss) { + f_status_t status = F_none; for (f_array_length_t i = length; i < lengthss->size; ++i) { @@ -190,6 +519,7 @@ extern "C" { #if !defined(_di_f_type_array_lengthss_decrease_by_) || !defined(_di_f_type_array_lengthss_increase_) || !defined(_di_f_type_array_lengthss_increase_by_) || !defined(_di_f_type_array_lengthss_resize_) f_status_t private_f_type_array_lengthss_resize(const f_array_length_t length, f_array_lengthss_t *lengthss) { + f_status_t status = F_none; for (f_array_length_t i = length; i < lengthss->size; ++i) { @@ -234,6 +564,7 @@ extern "C" { #if !defined(_di_f_type_int8s_append_) || !defined(_di_f_type_int8ss_append_) extern f_status_t private_f_type_int8s_append(const f_int8s_t source, f_int8s_t *destination) { + f_status_t status = F_none; if (destination->used + source.used > destination->size) { @@ -268,6 +599,7 @@ extern "C" { #if !defined(_di_f_type_int8ss_adjust_) || !defined(_di_f_type_int8ss_decimate_by_) f_status_t private_f_type_int8ss_adjust(const f_array_length_t length, f_int8ss_t *int8ss) { + f_status_t status = F_none; for (f_array_length_t i = length; i < int8ss->size; ++i) { @@ -295,6 +627,7 @@ extern "C" { #if !defined(_di_f_type_int8ss_decrease_by_) || !defined(_di_f_type_int8ss_increase_) || !defined(_di_f_type_int8ss_increase_by_) || !defined(_di_f_type_int8ss_resize_) f_status_t private_f_type_int8ss_resize(const f_array_length_t length, f_int8ss_t *int8ss) { + f_status_t status = F_none; for (f_array_length_t i = length; i < int8ss->size; ++i) { @@ -339,6 +672,7 @@ extern "C" { #if !defined(_di_f_type_uint8s_append_) || !defined(_di_f_type_uint8ss_append_) extern f_status_t private_f_type_uint8s_append(const f_uint8s_t source, f_uint8s_t *destination) { + f_status_t status = F_none; if (destination->used + source.used > destination->size) { @@ -373,6 +707,7 @@ extern "C" { #if !defined(_di_f_type_uint8ss_adjust_) || !defined(_di_f_type_uint8ss_decimate_by_) f_status_t private_f_type_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) { @@ -400,6 +735,7 @@ extern "C" { #if !defined(_di_f_type_uint8ss_decrease_by_) || !defined(_di_f_type_uint8ss_increase_) || !defined(_di_f_type_uint8ss_increase_by_) || !defined(_di_f_type_uint8ss_resize_) f_status_t private_f_type_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) { @@ -444,6 +780,7 @@ extern "C" { #if !defined(_di_f_type_int16s_append_) || !defined(_di_f_type_int16ss_append_) extern f_status_t private_f_type_int16s_append(const f_int16s_t source, f_int16s_t *destination) { + f_status_t status = F_none; if (destination->used + source.used > destination->size) { @@ -478,6 +815,7 @@ extern "C" { #if !defined(_di_f_type_int16ss_adjust_) || !defined(_di_f_type_int16ss_decimate_by_) f_status_t private_f_type_int16ss_adjust(const f_array_length_t length, f_int16ss_t *int16ss) { + f_status_t status = F_none; for (f_array_length_t i = length; i < int16ss->size; ++i) { @@ -505,6 +843,7 @@ extern "C" { #if !defined(_di_f_type_int16ss_decrease_by_) || !defined(_di_f_type_int16ss_increase_) || !defined(_di_f_type_int16ss_increase_by_) || !defined(_di_f_type_int16ss_resize_) f_status_t private_f_type_int16ss_resize(const f_array_length_t length, f_int16ss_t *int16ss) { + f_status_t status = F_none; for (f_array_length_t i = length; i < int16ss->size; ++i) { @@ -549,6 +888,7 @@ extern "C" { #if !defined(_di_f_type_uint16s_append_) || !defined(_di_f_type_uint16ss_append_) extern f_status_t private_f_type_uint16s_append(const f_uint16s_t source, f_uint16s_t *destination) { + f_status_t status = F_none; if (destination->used + source.used > destination->size) { @@ -583,6 +923,7 @@ extern "C" { #if !defined(_di_f_type_uint16ss_adjust_) || !defined(_di_f_type_uint16ss_decimate_by_) f_status_t private_f_type_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) { @@ -610,6 +951,7 @@ extern "C" { #if !defined(_di_f_type_uint16ss_decrease_by_) || !defined(_di_f_type_uint16ss_increase_) || !defined(_di_f_type_uint16ss_increase_by_) || !defined(_di_f_type_uint16ss_resize_) f_status_t private_f_type_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) { @@ -654,6 +996,7 @@ extern "C" { #if !defined(_di_f_type_int32s_append_) || !defined(_di_f_type_int32ss_append_) extern f_status_t private_f_type_int32s_append(const f_int32s_t source, f_int32s_t *destination) { + f_status_t status = F_none; if (destination->used + source.used > destination->size) { @@ -688,6 +1031,7 @@ extern "C" { #if !defined(_di_f_type_int32ss_adjust_) || !defined(_di_f_type_int32ss_decimate_by_) f_status_t private_f_type_int32ss_adjust(const f_array_length_t length, f_int32ss_t *int32ss) { + f_status_t status = F_none; for (f_array_length_t i = length; i < int32ss->size; ++i) { @@ -715,6 +1059,7 @@ extern "C" { #if !defined(_di_f_type_int32ss_decrease_by_) || !defined(_di_f_type_int32ss_increase_) || !defined(_di_f_type_int32ss_increase_by_) || !defined(_di_f_type_int32ss_resize_) f_status_t private_f_type_int32ss_resize(const f_array_length_t length, f_int32ss_t *int32ss) { + f_status_t status = F_none; for (f_array_length_t i = length; i < int32ss->size; ++i) { @@ -759,6 +1104,7 @@ extern "C" { #if !defined(_di_f_type_uint32s_append_) || !defined(_di_f_type_uint32ss_append_) extern f_status_t private_f_type_uint32s_append(const f_uint32s_t source, f_uint32s_t *destination) { + f_status_t status = F_none; if (destination->used + source.used > destination->size) { @@ -793,6 +1139,7 @@ extern "C" { #if !defined(_di_f_type_uint32ss_adjust_) || !defined(_di_f_type_uint32ss_decimate_by_) f_status_t private_f_type_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) { @@ -820,6 +1167,7 @@ extern "C" { #if !defined(_di_f_type_uint32ss_decrease_by_) || !defined(_di_f_type_uint32ss_increase_) || !defined(_di_f_type_uint32ss_increase_by_) || !defined(_di_f_type_uint32ss_resize_) f_status_t private_f_type_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) { @@ -864,6 +1212,7 @@ extern "C" { #if !defined(_di_f_type_int64s_append_) || !defined(_di_f_type_int64ss_append_) extern f_status_t private_f_type_int64s_append(const f_int64s_t source, f_int64s_t *destination) { + f_status_t status = F_none; if (destination->used + source.used > destination->size) { @@ -898,6 +1247,7 @@ extern "C" { #if !defined(_di_f_type_int64ss_adjust_) || !defined(_di_f_type_int64ss_decimate_by_) f_status_t private_f_type_int64ss_adjust(const f_array_length_t length, f_int64ss_t *int64ss) { + f_status_t status = F_none; for (f_array_length_t i = length; i < int64ss->size; ++i) { @@ -925,6 +1275,7 @@ extern "C" { #if !defined(_di_f_type_int64ss_decrease_by_) || !defined(_di_f_type_int64ss_increase_) || !defined(_di_f_type_int64ss_increase_by_) || !defined(_di_f_type_int64ss_resize_) f_status_t private_f_type_int64ss_resize(const f_array_length_t length, f_int64ss_t *int64ss) { + f_status_t status = F_none; for (f_array_length_t i = length; i < int64ss->size; ++i) { @@ -969,6 +1320,7 @@ extern "C" { #if !defined(_di_f_type_uint64s_append_) || !defined(_di_f_type_uint64ss_append_) extern f_status_t private_f_type_uint64s_append(const f_uint64s_t source, f_uint64s_t *destination) { + f_status_t status = F_none; if (destination->used + source.used > destination->size) { @@ -1003,6 +1355,7 @@ extern "C" { #if !defined(_di_f_type_uint64ss_adjust_) || !defined(_di_f_type_uint64ss_decimate_by_) f_status_t private_f_type_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) { @@ -1030,6 +1383,7 @@ extern "C" { #if !defined(_di_f_type_uint64ss_decrease_by_) || !defined(_di_f_type_uint64ss_increase_) || !defined(_di_f_type_uint64ss_increase_by_) || !defined(_di_f_type_uint64ss_resize_) f_status_t private_f_type_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) { @@ -1074,6 +1428,7 @@ extern "C" { #if !defined(_di_f_type_int128s_append_) || !defined(_di_f_type_int128ss_append_) extern f_status_t private_f_type_int128s_append(const f_int128s_t source, f_int128s_t *destination) { + f_status_t status = F_none; if (destination->used + source.used > destination->size) { @@ -1108,6 +1463,7 @@ extern "C" { #if !defined(_di_f_type_int128ss_adjust_) || !defined(_di_f_type_int128ss_decimate_by_) f_status_t private_f_type_int128ss_adjust(const f_array_length_t length, f_int128ss_t *int128ss) { + f_status_t status = F_none; for (f_array_length_t i = length; i < int128ss->size; ++i) { @@ -1135,6 +1491,7 @@ extern "C" { #if !defined(_di_f_type_int128ss_decrease_by_) || !defined(_di_f_type_int128ss_increase_) || !defined(_di_f_type_int128ss_increase_by_) || !defined(_di_f_type_int128ss_resize_) f_status_t private_f_type_int128ss_resize(const f_array_length_t length, f_int128ss_t *int128ss) { + f_status_t status = F_none; for (f_array_length_t i = length; i < int128ss->size; ++i) { @@ -1179,6 +1536,7 @@ extern "C" { #if !defined(_di_f_type_uint128s_append_) || !defined(_di_f_type_uint128ss_append_) extern f_status_t private_f_type_uint128s_append(const f_uint128s_t source, f_uint128s_t *destination) { + f_status_t status = F_none; if (destination->used + source.used > destination->size) { @@ -1213,6 +1571,7 @@ extern "C" { #if !defined(_di_f_type_uint128ss_adjust_) || !defined(_di_f_type_uint128ss_decimate_by_) f_status_t private_f_type_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) { @@ -1240,6 +1599,7 @@ extern "C" { #if !defined(_di_f_type_uint128ss_decrease_by_) || !defined(_di_f_type_uint128ss_increase_) || !defined(_di_f_type_uint128ss_increase_by_) || !defined(_di_f_type_uint128ss_resize_) f_status_t private_f_type_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) { diff --git a/level_0/f_type_array/c/private-type_array.h b/level_0/f_type_array/c/private-type_array.h index 8645447..42b059a 100644 --- a/level_0/f_type_array/c/private-type_array.h +++ b/level_0/f_type_array/c/private-type_array.h @@ -16,6 +16,262 @@ extern "C" { #endif /** + * Private implementation for resizing the statuss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param statuss + * The statuss 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_type_statuss_adjust() + * @see f_type_statuss_decimate_by() + */ +#if !defined(_di_f_type_statuss_adjust_) || !defined(_di_f_type_statuss_decimate_by_) + extern f_status_t private_f_type_statuss_adjust(const f_array_length_t length, f_statuss_t *statuss) f_attribute_visibility_internal; +#endif // !defined(_di_f_type_statuss_adjust_) || !defined(_di_f_type_statuss_decimate_by_) + +/** + * 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 statuss the source is appended onto. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_memory_resize(). + * + * @see f_type_statuss_append() + * @see f_type_statusss_append() + */ +#if !defined(_di_f_type_statuss_append_) || !defined(_di_f_type_statusss_append_) + extern f_status_t private_f_type_statuss_append(const f_statuss_t source, f_statuss_t *destination) f_attribute_visibility_internal; +#endif // !defined(_di_f_type_statuss_append_) || !defined(_di_f_type_statusss_append_) + +/** + * Private implementation for resizing the statuss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param statuss + * The statuss 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_type_statuss_resize() + * @see f_type_statuss_append() + * @see f_type_statuss_decimate_by() + * @see f_type_statusss_append() + */ +#if !defined(_di_f_type_statuss_resize_) || !defined(_di_f_type_statuss_append_) || !defined(_di_f_type_statuss_decimate_by_) || !defined(_di_f_type_statusss_append_) + extern f_status_t private_f_type_statuss_resize(const f_array_length_t length, f_statuss_t *statuss) f_attribute_visibility_internal; +#endif // !defined(_di_f_type_statuss_resize_) || !defined(_di_f_type_statuss_append_) || !defined(_di_f_type_statuss_decimate_by_) || !defined(_di_f_type_statusss_append_) + +/** + * Private implementation for resizing the statusss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param statusss + * The statusss 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_type_statusss_adjust() + * @see f_type_statusss_decimate_by() + */ +#if !defined(_di_f_type_statusss_adjust_) || !defined(_di_f_type_statusss_decimate_by_) + extern f_status_t private_f_type_statusss_adjust(const f_array_length_t length, f_statusss_t *statusss) f_attribute_visibility_internal; +#endif // !defined(_di_f_type_statusss_adjust_) || !defined(_di_f_type_statusss_decimate_by_) + +/** + * Private implementation for resizing the statusss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to resize to. + * @param statusss + * The statusss 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_type_statusss_decrease_by() + * @see f_type_statusss_increase() + * @see f_type_statusss_increase_by() + * @see f_type_statusss_resize() + */ +#if !defined(_di_f_type_statusss_decrease_by_) || !defined(_di_f_type_statusss_increase_) || !defined(_di_f_type_statusss_increase_by_) || !defined(_di_f_type_statusss_resize_) + extern f_status_t private_f_type_statusss_resize(const f_array_length_t length, f_statusss_t *statusss) f_attribute_visibility_internal; +#endif // !defined(_di_f_type_statusss_decrease_by_) || !defined(_di_f_type_statusss_increase_) || !defined(_di_f_type_statusss_increase_by_) || !defined(_di_f_type_statusss_resize_) + +/** + * Private implementation for resizing the states array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param states + * The states 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_type_states_adjust() + * @see f_type_states_decimate_by() + */ +#if !defined(_di_f_type_states_adjust_) || !defined(_di_f_type_states_decimate_by_) + extern f_status_t private_f_type_states_adjust(const f_array_length_t length, f_states_t *states) f_attribute_visibility_internal; +#endif // !defined(_di_f_type_states_adjust_) || !defined(_di_f_type_states_decimate_by_) + +/** + * 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 states the source is appended onto. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_memory_resize(). + * + * @see f_type_states_append() + * @see f_type_statess_append() + */ +#if !defined(_di_f_type_states_append_) || !defined(_di_f_type_statess_append_) + extern f_status_t private_f_type_states_append(const f_states_t source, f_states_t *destination) f_attribute_visibility_internal; +#endif // !defined(_di_f_type_states_append_) || !defined(_di_f_type_statess_append_) + +/** + * Private implementation for resizing the states array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param states + * The states 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_type_states_resize() + * @see f_type_states_append() + * @see f_type_states_decimate_by() + * @see f_type_statess_append() + */ +#if !defined(_di_f_type_states_resize_) || !defined(_di_f_type_states_append_) || !defined(_di_f_type_states_decimate_by_) || !defined(_di_f_type_statess_append_) + extern f_status_t private_f_type_states_resize(const f_array_length_t length, f_states_t *states) f_attribute_visibility_internal; +#endif // !defined(_di_f_type_states_resize_) || !defined(_di_f_type_states_append_) || !defined(_di_f_type_states_decimate_by_) || !defined(_di_f_type_statess_append_) + +/** + * Private implementation for resizing the statess array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param statess + * The statess 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_type_statess_adjust() + * @see f_type_statess_decimate_by() + */ +#if !defined(_di_f_type_statess_adjust_) || !defined(_di_f_type_statess_decimate_by_) + extern f_status_t private_f_type_statess_adjust(const f_array_length_t length, f_statess_t *statess) f_attribute_visibility_internal; +#endif // !defined(_di_f_type_statess_adjust_) || !defined(_di_f_type_statess_decimate_by_) + +/** + * Private implementation for resizing the statess array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to resize to. + * @param statess + * The statess 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_type_statess_decrease_by() + * @see f_type_statess_increase() + * @see f_type_statess_increase_by() + * @see f_type_statess_resize() + */ +#if !defined(_di_f_type_statess_decrease_by_) || !defined(_di_f_type_statess_increase_) || !defined(_di_f_type_statess_increase_by_) || !defined(_di_f_type_statess_resize_) + extern f_status_t private_f_type_statess_resize(const f_array_length_t length, f_statess_t *statess) f_attribute_visibility_internal; +#endif // !defined(_di_f_type_statess_decrease_by_) || !defined(_di_f_type_statess_increase_) || !defined(_di_f_type_statess_increase_by_) || !defined(_di_f_type_statess_resize_) + +/** * Private implementation for resizing the cells array. * * Intended to be shared to each of the different implementation variations. @@ -144,6 +400,133 @@ extern "C" { #endif // !defined(_di_f_type_cellss_decrease_by_) || !defined(_di_f_type_cellss_increase_) || !defined(_di_f_type_cellss_increase_by_) || !defined(_di_f_type_cellss_resize_) /** + * Private implementation for resizing the ids array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param ids + * The ids 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_type_fll_ids_adjust() + * @see f_type_fll_ids_decimate_by() + */ +#if !defined(_di_f_type_fll_ids_adjust_) || !defined(_di_f_type_fll_ids_decimate_by_) + extern f_status_t private_f_type_fll_ids_adjust(const f_array_length_t length, f_fll_ids_t *ids) f_attribute_visibility_internal; +#endif // !defined(_di_f_type_fll_ids_adjust_) || !defined(_di_f_type_fll_ids_decimate_by_) + +/** + * Private implementation for appending the fll_id array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param source + * The source ids to append. + * @param destination + * The destination ids the source is appended onto. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_memory_resize(). + * + * @see f_type_fll_ids_append() + * @see f_type_fll_idss_append() + */ +#if !defined(_di_f_type_fll_ids_append_) || !defined(_di_f_type_fll_idss_append_) + extern f_status_t private_f_type_fll_ids_append(const f_fll_ids_t source, f_fll_ids_t *destination) f_attribute_visibility_internal; +#endif // !defined(_di_f_type_fll_ids_append_) || !defined(_di_f_type_fll_idss_append_) + +/** + * Private implementation for resizing the ids array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param ids + * The ids 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_type_fll_ids_resize() + * @see f_type_fll_ids_append() + * @see f_type_fll_ids_decimate_by() + * @see f_type_fll_idss_append() + */ +#if !defined(_di_f_type_fll_ids_resize_) || !defined(_di_f_type_fll_ids_append_) || !defined(_di_f_type_fll_ids_decimate_by_) || !defined(_di_f_type_fll_idss_append_) + extern f_status_t private_f_type_fll_ids_resize(const f_array_length_t length, f_fll_ids_t *ids) f_attribute_visibility_internal; +#endif // !defined(_di_f_type_fll_ids_resize_) || !defined(_di_f_type_fll_ids_append_) || !defined(_di_f_type_fll_ids_decimate_by_) || !defined(_di_f_type_fll_idss_append_) + +/** + * Private implementation for resizing the idss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to adjust to. + * @param idss + * The idss 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_type_fll_idss_adjust() + * @see f_type_fll_idss_decimate_by() + */ +#if !defined(_di_f_type_fll_idss_adjust_) || !defined(_di_f_type_fll_idss_decimate_by_) + extern f_status_t private_f_type_fll_idss_adjust(const f_array_length_t length, f_fll_idss_t *idss) f_attribute_visibility_internal; +#endif // !defined(_di_f_type_fll_idss_adjust_) || !defined(_di_f_type_fll_idss_decimate_by_) + +/** + * Private implementation for resizing the idss array. + * + * Intended to be shared to each of the different implementation variations. + * + * @param length + * The length to resize to. + * @param idss + * The idss 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_type_fll_idss_decrease_by() + * @see f_type_fll_idss_increase() + * @see f_type_fll_idss_increase_by() + * @see f_type_fll_idss_resize() + */ +#if !defined(_di_f_type_fll_idss_decrease_by_) || !defined(_di_f_type_fll_idss_increase_) || !defined(_di_f_type_fll_idss_increase_by_) || !defined(_di_f_type_fll_idss_resize_) + extern f_status_t private_f_type_fll_idss_resize(const f_array_length_t length, f_fll_idss_t *idss) f_attribute_visibility_internal; +#endif // !defined(_di_f_type_fll_idss_decrease_by_) || !defined(_di_f_type_fll_idss_increase_) || !defined(_di_f_type_fll_idss_increase_by_) || !defined(_di_f_type_fll_idss_resize_) +/** * Private implementation for resizing the array_lengths array. * * Intended to be shared to each of the different implementation variations. diff --git a/level_0/f_type_array/c/type_array-common.h b/level_0/f_type_array/c/type_array-common.h index 0ac3b11..e2e1063 100644 --- a/level_0/f_type_array/c/type_array-common.h +++ b/level_0/f_type_array/c/type_array-common.h @@ -20,25 +20,25 @@ extern "C" { * Macros for f_statuss_t, see type.h for typedefs. */ #ifndef _di_f_statuss_t_ - #define macro_f_statuss_t_clear(statuss) macro_f_memory_structure_clear(statuss) + #define macro_f_statuss_t_clear(statuss) macro_f_memory_structures_clear(statuss) - #define macro_f_statuss_t_resize(status, statuss, length) macro_f_memory_structure_resize(status, statuss, f_status_t, length) - #define macro_f_statuss_t_adjust(status, statuss, length) macro_f_memory_structure_adjust(status, statuss, f_status_t, length) + #define macro_f_statuss_t_resize(status, statuss, length) status = f_type_statuss_resize(length, &statuss); + #define macro_f_statuss_t_adjust(status, statuss, length) status = f_type_statuss_adjust(length, &statuss); - #define macro_f_statuss_t_delete_simple(statuss) macro_f_memory_structure_delete_simple(statuss, f_status_t) - #define macro_f_statuss_t_destroy_simple(statuss) macro_f_memory_structure_destroy_simple(statuss, f_status_t) + #define macro_f_statuss_t_delete_simple(statuss) f_type_statuss_resize(0, &statuss); + #define macro_f_statuss_t_destroy_simple(statuss) f_type_statuss_adjust(0, &statuss); - #define macro_f_statuss_t_increase(status, step, statuss) macro_f_memory_structure_increase(status, step, statuss, f_status_t) - #define macro_f_statuss_t_increase_by(status, statuss, amount) macro_f_memory_structure_increase_by(status, statuss, f_status_t, amount) - #define macro_f_statuss_t_decrease_by(status, statuss, amount) macro_f_memory_structure_decrease_by(status, statuss, f_status_t, amount) - #define macro_f_statuss_t_decimate_by(status, statuss, amount) macro_f_memory_structure_decimate_by(status, statuss, f_status_t, amount) + #define macro_f_statuss_t_increase(status, step, statuss) status = f_type_statuss_increase(step, &statuss); + #define macro_f_statuss_t_increase_by(status, statuss, amount) status = f_type_statuss_increase_by(amount, &statuss); + #define macro_f_statuss_t_decrease_by(status, statuss, amount) status = f_type_statuss_decrease_by(amount, &statuss); + #define macro_f_statuss_t_decimate_by(status, statuss, amount) status = f_type_statuss_decimate_by(amount, &statuss); #endif // _di_f_statuss_t_ /** * Macros for f_statusss_t, see type.h for typedefs. */ #ifndef _di_f_statusss_t_ - #define macro_f_statusss_t_clear(rangess) macro_f_memory_structures_clear(rangess) + #define macro_f_statusss_t_clear(statusss) macro_f_memory_structures_clear(statusss) #define macro_f_statusss_t_resize(status, statusss, length) status = f_type_statusss_resize(length, &statusss); #define macro_f_statusss_t_adjust(status, statusss, length) status = f_type_statusss_adjust(length, &statusss); @@ -56,25 +56,25 @@ extern "C" { * Macros for f_states_t, see type.h for typedefs. */ #ifndef _di_f_states_t_ - #define macro_f_states_t_clear(states) macro_f_memory_structure_clear(states) + #define macro_f_states_t_clear(states) macro_f_memory_structures_clear(states) - #define macro_f_states_t_resize(status, states, length) macro_f_memory_structure_resize(status, states, f_state_t, length) - #define macro_f_states_t_adjust(status, states, length) macro_f_memory_structure_adjust(status, states, f_state_t, length) + #define macro_f_states_t_resize(status, states, length) status = f_type_states_resize(length, &states); + #define macro_f_states_t_adjust(status, states, length) status = f_type_states_adjust(length, &states); - #define macro_f_states_t_delete_simple(states) macro_f_memory_structure_delete_simple(states, f_state_t) - #define macro_f_states_t_destroy_simple(states) macro_f_memory_structure_destroy_simple(states, f_state_t) + #define macro_f_states_t_delete_simple(states) f_type_states_resize(0, &states); + #define macro_f_states_t_destroy_simple(states) f_type_states_adjust(0, &states); - #define macro_f_states_t_increase(status,step, states) macro_f_memory_structure_increase(status, step, states, f_state_t) - #define macro_f_states_t_increase_by(status, states, amount) macro_f_memory_structure_increase_by(status, states, f_state_t, amount) - #define macro_f_states_t_decrease_by(status, states, amount) macro_f_memory_structure_decrease_by(status, states, f_state_t, amount) - #define macro_f_states_t_decimate_by(status, states, amount) macro_f_memory_structure_decimate_by(status, states, f_state_t, amount) + #define macro_f_states_t_increase(status, step, states) status = f_type_states_increase(step, &states); + #define macro_f_states_t_increase_by(status, states, amount) status = f_type_states_increase_by(amount, &states); + #define macro_f_states_t_decrease_by(status, states, amount) status = f_type_states_decrease_by(amount, &states); + #define macro_f_states_t_decimate_by(status, states, amount) status = f_type_states_decimate_by(amount, &states); #endif // _di_f_states_t_ /** * Macros for f_statess_t, see type.h for typedefs. */ #ifndef _di_f_statess_t_ - #define macro_f_statess_t_clear(rangess) macro_f_memory_structures_clear(rangess) + #define macro_f_statess_t_clear(statess) macro_f_memory_structures_clear(statess) #define macro_f_statess_t_resize(status, statess, length) status = f_type_statess_resize(length, &statess); #define macro_f_statess_t_adjust(status, statess, length) status = f_type_statess_adjust(length, &statess); @@ -89,64 +89,28 @@ extern "C" { #endif // _di_f_statess_t_ /** - * Macros for f_array_lengths_t, see type.h for typedefs. - */ -#ifndef _di_f_array_lengths_t_ - #define macro_f_array_lengths_t_clear(lengths) macro_f_memory_structure_clear(lengths) - - #define macro_f_array_lengths_t_resize(status, lengths, length) macro_f_memory_structure_resize(status, lengths, f_array_length_t, length) - #define macro_f_array_lengths_t_adjust(status, lengths, length) macro_f_memory_structure_adjust(status, lengths, f_array_length_t, length) - - #define macro_f_array_lengths_t_delete_simple(lengths) macro_f_memory_structure_delete_simple(lengths, f_array_length_t) - #define macro_f_array_lengths_t_destroy_simple(lengths) macro_f_memory_structure_destroy_simple(lengths, f_array_length_t) - - #define macro_f_array_lengths_t_increase(status, step, lengths) macro_f_memory_structure_increase(status, step, lengths, f_array_length_t) - #define macro_f_array_lengths_t_increase_by(status, lengths, amount) macro_f_memory_structure_increase_by(status, lengths, f_array_length_t, amount) - #define macro_f_array_lengths_t_decrease_by(status, lengths, amount) macro_f_memory_structure_decrease_by(status, lengths, f_array_length_t, amount) - #define macro_f_array_lengths_t_decimate_by(status, lengths, amount) macro_f_memory_structure_decimate_by(status, lengths, f_array_length_t, amount) -#endif // _di_f_array_lengths_t_ - -/** - * Macros for f_array_lengths_t, see type.h for typedefs. - */ -#ifndef _di_f_array_lengthss_t_ - #define macro_f_array_lengthss_t_clear(lengths) macro_f_memory_structures_clear(lengths) - - #define macro_f_array_lengthss_t_resize(status, lengths, length) status = f_type_array_lengthss_resize(length, &lengths); - #define macro_f_array_lengthss_t_adjust(status, lengths, length) status = f_type_array_lengthss_adjust(length, &lengths); - - #define macro_f_array_lengthss_t_delete_simple(lengths) f_type_array_lengthss_resize(0, &lengths); - #define macro_f_array_lengthss_t_destroy_simple(lengths) f_type_array_lengthss_adjust(0, &lengths); - - #define macro_f_array_lengthss_t_increase(status, step, lengths) status = f_type_array_lengthss_increase(step, &lengths); - #define macro_f_array_lengthss_t_increase_by(status, lengths, amount) status = f_type_array_lengthss_increase_by(amount, &lengths); - #define macro_f_array_lengthss_t_decrease_by(status, lengths, amount) status = f_type_array_lengthss_decrease_by(amount, &lengths); - #define macro_f_array_lengthss_t_decimate_by(status, lengths, amount) status = f_type_array_lengthss_decimate_by(amount, &lengths); -#endif // _di_f_array_lengthss_t_ - -/** * Macros for f_cells_t, see type.h for typedefs. */ #ifndef _di_f_cells_t_ - #define macro_f_cells_t_clear(cells) macro_f_memory_structure_clear(cells) + #define macro_f_cells_t_clear(cells) macro_f_memory_structures_clear(cells) - #define macro_f_cells_t_resize(status, cells, length) macro_f_memory_structure_resize(status, cells, f_cell_t, length) - #define macro_f_cells_t_adjust(status, cells, length) macro_f_memory_structure_adjust(status, cells, f_cell_t, length) + #define macro_f_cells_t_resize(status, cells, length) status = f_type_cells_resize(length, &cells); + #define macro_f_cells_t_adjust(status, cells, length) status = f_type_cells_adjust(length, &cells); - #define macro_f_cells_t_delete_simple(cells) macro_f_memory_structure_delete_simple(cells, f_cell_t) - #define macro_f_cells_t_destroy_simple(cells) macro_f_memory_structure_destroy_simple(cells, f_cell_t) + #define macro_f_cells_t_delete_simple(cells) f_type_cells_resize(0, &cells); + #define macro_f_cells_t_destroy_simple(cells) f_type_cells_adjust(0, &cells); - #define macro_f_cells_t_increase(status, step, cells) macro_f_memory_structure_increase(status, step, cells, f_cell_t) - #define macro_f_cells_t_increase_by(status, cells, amount) macro_f_memory_structure_increase_by(status, cells, f_cell_t, amount) - #define macro_f_cells_t_decrease_by(status, cells, amount) macro_f_memory_structure_decrease_by(status, cells, f_cell_t, amount) - #define macro_f_cells_t_decimate_by(status, cells, amount) macro_f_memory_structure_decimate_by(status, cells, f_cell_t, amount) + #define macro_f_cells_t_increase(status, step, cells) status = f_type_cells_increase(step, &cells); + #define macro_f_cells_t_increase_by(status, cells, amount) status = f_type_cells_increase_by(amount, &cells); + #define macro_f_cells_t_decrease_by(status, cells, amount) status = f_type_cells_decrease_by(amount, &cells); + #define macro_f_cells_t_decimate_by(status, cells, amount) status = f_type_cells_decimate_by(amount, &cells); #endif // _di_f_cells_t_ /** * Macros for f_cellss_t, see type.h for typedefs. */ #ifndef _di_f_cellss_t_ - #define macro_f_cellss_t_clear(rangess) macro_f_memory_structures_clear(rangess) + #define macro_f_cellss_t_clear(cellss) macro_f_memory_structures_clear(cellss) #define macro_f_cellss_t_resize(status, cellss, length) status = f_type_cellss_resize(length, &cellss); #define macro_f_cellss_t_adjust(status, cellss, length) status = f_type_cellss_adjust(length, &cellss); @@ -161,28 +125,100 @@ extern "C" { #endif // _di_f_cellss_t_ /** + * Macros for f_fll_ids_t, see type.h for typedefs. + */ +#ifndef _di_f_fll_ids_t_ + #define macro_f_fll_ids_t_clear(fll_ids) macro_f_memory_structures_clear(fll_ids) + + #define macro_f_fll_ids_t_resize(status, fll_ids, length) status = f_type_fll_ids_resize(length, &fll_ids); + #define macro_f_fll_ids_t_adjust(status, fll_ids, length) status = f_type_fll_ids_adjust(length, &fll_ids); + + #define macro_f_fll_ids_t_delete_simple(fll_ids) f_type_fll_ids_resize(0, &fll_ids); + #define macro_f_fll_ids_t_destroy_simple(fll_ids) f_type_fll_ids_adjust(0, &fll_ids); + + #define macro_f_fll_ids_t_increase(status, step, fll_ids) status = f_type_fll_ids_increase(step, &fll_ids); + #define macro_f_fll_ids_t_increase_by(status, fll_ids, amount) status = f_type_fll_ids_increase_by(amount, &fll_ids); + #define macro_f_fll_ids_t_decrease_by(status, fll_ids, amount) status = f_type_fll_ids_decrease_by(amount, &fll_ids); + #define macro_f_fll_ids_t_decimate_by(status, fll_ids, amount) status = f_type_fll_ids_decimate_by(amount, &fll_ids); +#endif // _di_f_fll_ids_t_ + +/** + * Macros for f_fll_idss_t, see type.h for typedefs. + */ +#ifndef _di_f_fll_idss_t_ + #define macro_f_fll_idss_t_clear(fll_idss) macro_f_memory_structures_clear(fll_idss) + + #define macro_f_fll_idss_t_resize(status, fll_idss, length) status = f_type_fll_idss_resize(length, &fll_idss); + #define macro_f_fll_idss_t_adjust(status, fll_idss, length) status = f_type_fll_idss_adjust(length, &fll_idss); + + #define macro_f_fll_idss_t_delete_simple(fll_idss) f_type_fll_idss_resize(0, &fll_idss); + #define macro_f_fll_idss_t_destroy_simple(fll_idss) f_type_fll_idss_adjust(0, &fll_idss); + + #define macro_f_fll_idss_t_increase(status, step, fll_idss) status = f_type_fll_idss_increase(step, &fll_idss); + #define macro_f_fll_idss_t_increase_by(status, fll_idss, amount) status = f_type_fll_idss_increase_by(amount, &fll_idss); + #define macro_f_fll_idss_t_decrease_by(status, fll_idss, amount) status = f_type_fll_idss_decrease_by(amount, &fll_idss); + #define macro_f_fll_idss_t_decimate_by(status, fll_idss, amount) status = f_type_fll_idss_decimate_by(amount, &fll_idss); +#endif // _di_f_fll_idss_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_f_array_lengths_t_ + #define macro_f_array_lengths_t_clear(lengths) macro_f_memory_structures_clear(lengths) + + #define macro_f_array_lengths_t_resize(status, lengths, length) status = f_type_array_lengths_resize(length, &lengths); + #define macro_f_array_lengths_t_adjust(status, lengths, length) status = f_type_array_lengths_adjust(length, &lengths); + + #define macro_f_array_lengths_t_delete_simple(lengths) f_type_array_lengths_resize(0, &lengths); + #define macro_f_array_lengths_t_destroy_simple(lengths) f_type_array_lengths_adjust(0, &lengths); + + #define macro_f_array_lengths_t_increase(status, step, lengths) status = f_type_array_lengths_increase(step, &lengths); + #define macro_f_array_lengths_t_increase_by(status, lengths, amount) status = f_type_array_lengths_increase_by(amount, &lengths); + #define macro_f_array_lengths_t_decrease_by(status, lengths, amount) status = f_type_array_lengths_decrease_by(amount, &lengths); + #define macro_f_array_lengths_t_decimate_by(status, lengths, amount) status = f_type_array_lengths_decimate_by(amount, &lengths); +#endif // _di_f_array_lengths_t_ + +/** + * Macros for f_array_lengths_t, see type.h for typedefs. + */ +#ifndef _di_f_array_lengthss_t_ + #define macro_f_array_lengthss_t_clear(lengthss) macro_f_memory_structures_clear(lengthss) + + #define macro_f_array_lengthss_t_resize(status, lengths, length) status = f_type_array_lengthss_resize(length, &lengths); + #define macro_f_array_lengthss_t_adjust(status, lengths, length) status = f_type_array_lengthss_adjust(length, &lengths); + + #define macro_f_array_lengthss_t_delete_simple(lengths) f_type_array_lengthss_resize(0, &lengths); + #define macro_f_array_lengthss_t_destroy_simple(lengths) f_type_array_lengthss_adjust(0, &lengths); + + #define macro_f_array_lengthss_t_increase(status, step, lengths) status = f_type_array_lengthss_increase(step, &lengths); + #define macro_f_array_lengthss_t_increase_by(status, lengths, amount) status = f_type_array_lengthss_increase_by(amount, &lengths); + #define macro_f_array_lengthss_t_decrease_by(status, lengths, amount) status = f_type_array_lengthss_decrease_by(amount, &lengths); + #define macro_f_array_lengthss_t_decimate_by(status, lengths, amount) status = f_type_array_lengthss_decimate_by(amount, &lengths); +#endif // _di_f_array_lengthss_t_ + +/** * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_f_array_t_int8_t_ - #define macro_f_int8s_t_clear(int8s) macro_f_memory_structure_clear(int8s) + #define macro_f_int8s_t_clear(int8s) macro_f_memory_structures_clear(int8s) - #define macro_f_int8s_t_resize(status, int8s, length) macro_f_memory_structure_resize(status, int8s, int8_t, length) - #define macro_f_int8s_t_adjust(status, int8s, length) macro_f_memory_structure_adjust(status, int8s, int8_t, length) + #define macro_f_int8s_t_resize(status, int8s, length) status = f_type_int8s_resize(length, &int8s); + #define macro_f_int8s_t_adjust(status, int8s, length) status = f_type_int8s_adjust(length, &int8s); - #define macro_f_int8s_t_delete_simple(int8s) macro_f_memory_structure_delete_simple(int8s, int8_t) - #define macro_f_int8s_t_destroy_simple(int8s) macro_f_memory_structure_destroy_simple(int8s, int8_t) + #define macro_f_int8s_t_increase(status, step, int8s) status = f_type_int8s_increase(step, &int8s); + #define macro_f_int8s_t_increase_by(status, int8s, amount) status = f_type_int8s_increase_by(amount, &int8s); + #define macro_f_int8s_t_decrease_by(status, int8s, amount) status = f_type_int8s_decrease_by(amount, &int8s); + #define macro_f_int8s_t_decimate_by(status, int8s, amount) status = f_type_int8s_decimate_by(amount, &int8s); - #define macro_f_int8s_t_increase(status, step, int8s) macro_f_memory_structure_increase(status, step, int8s, int8_t) - #define macro_f_int8s_t_increase_by(status, int8s, amount) macro_f_memory_structure_increase_by(status, int8s, int8_t, amount) - #define macro_f_int8s_t_decrease_by(status, int8s, amount) macro_f_memory_structure_decrease_by(status, int8s, int8_t, amount) - #define macro_f_int8s_t_decimate_by(status, int8s, amount) macro_f_memory_structure_decimate_by(status, int8s, int8_t, amount) + #define macro_f_int8s_t_delete_simple(int8s) f_type_int8s_resize(0, &int8s); + #define macro_f_int8s_t_destroy_simple(int8s) f_type_int8s_adjust(0, &int8s); #endif // _di_int8s_t_ /** * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_int8ss_t_ - #define macro_f_int8ss_t_clear(numbers) macro_f_memory_structures_clear(numbers) + #define macro_f_int8ss_t_clear(int8ss) macro_f_memory_structures_clear(int8ss) #define macro_f_int8ss_t_resize(status, int8ss, length) status = f_type_int8ss_resize(length, &int8ss); #define macro_f_int8ss_t_adjust(status, int8ss, length) status = f_type_int8ss_adjust(length, &int8ss); @@ -200,25 +236,25 @@ extern "C" { * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_uint8s_t_ - #define macro_f_uint8s_t_clear(uint8s) macro_f_memory_structure_clear(uint8s) + #define macro_f_uint8s_t_clear(uint8s) macro_f_memory_structures_clear(uint8s) - #define macro_f_uint8s_t_resize(status, uint8s, length) macro_f_memory_structure_resize(status, uint8s, uint8_t, length) - #define macro_f_uint8s_t_adjust(status, uint8s, length) macro_f_memory_structure_adjust(status, uint8s, uint8_t, length) + #define macro_f_uint8s_t_resize(status, uint8s, length) status = f_type_uint8s_resize(length, &uint8s); + #define macro_f_uint8s_t_adjust(status, uint8s, length) status = f_type_uint8s_adjust(length, &uint8s); - #define macro_f_uint8s_t_increase(status, step, uint8s) macro_f_memory_structure_increase(status, step, uint8s, uint8_t) - #define macro_f_uint8s_t_increase_by(status, uint8s, amount) macro_f_memory_structure_increase_by(status, uint8s, uint8_t, amount) - #define macro_f_uint8s_t_decrease_by(status, uint8s, amount) macro_f_memory_structure_decrease_by(status, uint8s, uint8_t, amount) - #define macro_f_uint8s_t_decimate_by(status, uint8s, amount) macro_f_memory_structure_decimate_by(status, uint8s, uint8_t, amount) + #define macro_f_uint8s_t_delete_simple(uint8s) f_type_uint8s_resize(0, &uint8s); + #define macro_f_uint8s_t_destroy_simple(uint8s) f_type_uint8s_adjust(0, &uint8s); - #define macro_f_uint8s_t_delete_simple(uint8s) macro_f_memory_structure_delete_simple(uint8s, uint8_t) - #define macro_f_uint8s_t_destroy_simple(uint8s) macro_f_memory_structure_destroy_simple(uint8s, uint8_t) + #define macro_f_uint8s_t_increase(status, step, uint8s) status = f_type_uint8s_increase(step, &uint8s); + #define macro_f_uint8s_t_increase_by(status, uint8s, amount) status = f_type_uint8s_increase_by(amount, &uint8s); + #define macro_f_uint8s_t_decrease_by(status, uint8s, amount) status = f_type_uint8s_decrease_by(amount, &uint8s); + #define macro_f_uint8s_t_decimate_by(status, uint8s, amount) status = f_type_uint8s_decimate_by(amount, &uint8s); #endif // _di_uint8s_t_ /** * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_uint8ss_t_ - #define macro_f_uint8ss_t_clear(numbers) macro_f_memory_structures_clear(numbers) + #define macro_f_uint8ss_t_clear(uint8ss) macro_f_memory_structures_clear(uint8ss) #define macro_f_uint8ss_t_resize(status, uint8ss, length) status = f_type_uint8ss_resize(length, &uint8ss); #define macro_f_uint8ss_t_adjust(status, uint8ss, length) status = f_type_uint8ss_adjust(length, &uint8ss); @@ -227,7 +263,7 @@ extern "C" { #define macro_f_uint8ss_t_destroy_simple(uint8ss) f_type_uint8ss_adjust(0, &uint8ss); #define macro_f_uint8ss_t_increase(status, step, uint8ss) status = f_type_uint8ss_increase(step, &uint8ss); - #define macro_f_uint8ss_t_increase_by(status, uint8ss, amount) status = f_type_uint8ss_increase(amount, &uint8ss); + #define macro_f_uint8ss_t_increase_by(status, uint8ss, amount) status = f_type_uint8ss_increase_by(amount, &uint8ss); #define macro_f_uint8ss_t_decrease_by(status, uint8ss, amount) status = f_type_uint8ss_decrease_by(amount, &uint8ss); #define macro_f_uint8ss_t_decimate_by(status, uint8ss, amount) status = f_type_uint8ss_decimate_by(amount, &uint8ss); #endif // _di_uint8ss_t_ @@ -236,31 +272,31 @@ extern "C" { * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_int16s_t_ - #define macro_f_int16s_t_clear(int16s) macro_f_memory_structure_clear(int16s) + #define macro_f_int16s_t_clear(int16s) macro_f_memory_structures_clear(int16s) - #define macro_f_int16s_t_resize(status, int16s, length) macro_f_memory_structure_resize(status, int16s, int16_t, length) - #define macro_f_int16s_t_adjust(status, int16s, length) macro_f_memory_structure_adjust(status, int16s, int16_t, length) + #define macro_f_int16s_t_resize(status, int16s, length) status = f_type_int16s_resize(length, &int16s); + #define macro_f_int16s_t_adjust(status, int16s, length) status = f_type_int16s_adjust(length, &int16s); - #define macro_f_int16s_t_delete_simple(int16s) macro_f_memory_structure_delete_simple(int16s, int16_t) - #define macro_f_int16s_t_destroy_simple(int16s) macro_f_memory_structure_destroy_simple(int16s, int16_t) + #define macro_f_int16s_t_increase(status, step, int16s) status = f_type_int16s_increase(step, &int16s); + #define macro_f_int16s_t_increase_by(status, int16s, amount) status = f_type_int16s_increase_by(amount, &int16s); + #define macro_f_int16s_t_decrease_by(status, int16s, amount) status = f_type_int16s_decrease_by(amount, &int16s); + #define macro_f_int16s_t_decimate_by(status, int16s, amount) status = f_type_int16s_decimate_by(amount, &int16s); - #define macro_f_int16s_t_increase(status, step, int16s) macro_f_memory_structure_increase(status, step, int16s, int16_t) - #define macro_f_int16s_t_increase_by(status, int16s, amount) macro_f_memory_structure_increase_by(status, int16s, int16_t, amount) - #define macro_f_int16s_t_decrease_by(status, int16s, amount) macro_f_memory_structure_decrease_by(status, int16s, int16_t, amount) - #define macro_f_int16s_t_decimate_by(status, int16s, amount) macro_f_memory_structure_decimate_by(status, int16s, int16_t, amount) + #define macro_f_int16s_t_delete_simple(int16s) f_type_int16s_resize(0, &int16s); + #define macro_f_int16s_t_destroy_simple(int16s) f_type_int16s_adjust(0, &int16s); #endif // _di_int16s_t_ /** * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_int16ss_t_ - #define macro_f_int16ss_t_clear(numbers) macro_f_memory_structures_clear(numbers) + #define macro_f_int16ss_t_clear(int16ss) macro_f_memory_structures_clear(int16ss) #define macro_f_int16ss_t_resize(status, int16ss, length) status = f_type_int16ss_resize(length, &int16ss); #define macro_f_int16ss_t_adjust(status, int16ss, length) status = f_type_int16ss_adjust(length, &int16ss); #define macro_f_int16ss_t_increase(status, step, int16ss) status = f_type_int16ss_increase(step, &int16ss); - #define macro_f_int16ss_t_increase_by(status, int16ss, amount) status = f_type_int16ss_increase(amount, &int16ss); + #define macro_f_int16ss_t_increase_by(status, int16ss, amount) status = f_type_int16ss_increase_by(amount, &int16ss); #define macro_f_int16ss_t_decrease_by(status, int16ss, amount) status = f_type_int16ss_decrease_by(amount, &int16ss); #define macro_f_int16ss_t_decimate_by(status, int16ss, amount) status = f_type_int16ss_decimate_by(amount, &int16ss); @@ -272,25 +308,25 @@ extern "C" { * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_uint16s_t_ - #define macro_f_uint16s_t_clear(uint16s) macro_f_memory_structure_clear(uint16s) + #define macro_f_uint16s_t_clear(uint16s) macro_f_memory_structures_clear(uint16s) - #define macro_f_uint16s_t_resize(status, uint16s, length) macro_f_memory_structure_resize(status, uint16s, uint16_t, length) - #define macro_f_uint16s_t_adjust(status, uint16s, length) macro_f_memory_structure_adjust(status, uint16s, uint16_t, length) + #define macro_f_uint16s_t_resize(status, uint16s, length) status = f_type_uint16s_resize(length, &uint16s); + #define macro_f_uint16s_t_adjust(status, uint16s, length) status = f_type_uint16s_adjust(length, &uint16s); - #define macro_f_uint16s_t_delete_simple(uint16s) macro_f_memory_structure_delete_simple(uint16s, uint16_t) - #define macro_f_uint16s_t_destroy_simple(uint16s) macro_f_memory_structure_destroy_simple(uint16s, uint16_t) + #define macro_f_uint16s_t_delete_simple(uint16s) f_type_uint16s_resize(0, &uint16s); + #define macro_f_uint16s_t_destroy_simple(uint16s) f_type_uint16s_adjust(0, &uint16s); - #define macro_f_uint16s_t_increase(status, step, uint16s) macro_f_memory_structure_increase(status, step, uint16s, uint16_t) - #define macro_f_uint16s_t_increase_by(status, uint16s, amount) macro_f_memory_structure_increase_by(status, uint16s, uint16_t, amount) - #define macro_f_uint16s_t_decrease_by(status, uint16s, amount) macro_f_memory_structure_decrease_by(status, uint16s, uint16_t, amount) - #define macro_f_uint16s_t_decimate_by(status, uint16s, amount) macro_f_memory_structure_decimate_by(status, uint16s, uint16_t, amount) + #define macro_f_uint16s_t_increase(status, step, uint16s) status = f_type_uint16s_increase(step, &uint16s); + #define macro_f_uint16s_t_increase_by(status, uint16s, amount) status = f_type_uint16s_increase_by(amount, &uint16s); + #define macro_f_uint16s_t_decrease_by(status, uint16s, amount) status = f_type_uint16s_decrease_by(amount, &uint16s); + #define macro_f_uint16s_t_decimate_by(status, uint16s, amount) status = f_type_uint16s_decimate_by(amount, &uint16s); #endif // _di_uint16s_t_ /** * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_uint16ss_t_ - #define macro_f_uint16ss_t_clear(numbers) macro_f_memory_structures_clear(numbers) + #define macro_f_uint16ss_t_clear(uint16ss) macro_f_memory_structures_clear(uint16ss) #define macro_f_uint16ss_t_resize(status, uint16ss, length) status = f_type_uint16ss_resize(length, &uint16ss); #define macro_f_uint16ss_t_adjust(status, uint16ss, length) status = f_type_uint16ss_adjust(length, &uint16ss); @@ -299,7 +335,7 @@ extern "C" { #define macro_f_uint16ss_t_destroy_simple(uint16ss) f_type_uint16ss_adjust(0, &uint16ss); #define macro_f_uint16ss_t_increase(status, step, uint16ss) status = f_type_uint16ss_increase(step, &uint16ss); - #define macro_f_uint16ss_t_increase_by(status, uint16ss, amount) status = f_type_uint16ss_increase(amount, &uint16ss); + #define macro_f_uint16ss_t_increase_by(status, uint16ss, amount) status = f_type_uint16ss_increase_by(amount, &uint16ss); #define macro_f_uint16ss_t_decrease_by(status, uint16ss, amount) status = f_type_uint16ss_decrease_by(amount, &uint16ss); #define macro_f_uint16ss_t_decimate_by(status, uint16ss, amount) status = f_type_uint16ss_decimate_by(amount, &uint16ss); #endif // _di_uint16ss_t_ @@ -308,25 +344,25 @@ extern "C" { * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_int32s_t_ - #define macro_f_int32s_t_clear(int32s) macro_f_memory_structure_clear(int32s) + #define macro_f_int32s_t_clear(int32s) macro_f_memory_structures_clear(int32s) - #define macro_f_int32s_t_resize(status, int32s, length) macro_f_memory_structure_resize(status, int32s, int32_t, length) - #define macro_f_int32s_t_adjust(status, int32s, length) macro_f_memory_structure_adjust(status, int32s, int32_t, length) + #define macro_f_int32s_t_resize(status, int32s, length) status = f_type_int32s_resize(length, &int32s); + #define macro_f_int32s_t_adjust(status, int32s, length) status = f_type_int32s_adjust(length, &int32s); - #define macro_f_int32s_t_delete_simple(int32s) macro_f_memory_structure_delete_simple(int32s, int32_t) - #define macro_f_int32s_t_destroy_simple(int32s) macro_f_memory_structure_destroy_simple(int32s, int32_t) + #define macro_f_int32s_t_delete_simple(int32s) f_type_int32s_resize(0, &int32s); + #define macro_f_int32s_t_destroy_simple(int32s) f_type_int32s_adjust(0, &int32s); - #define macro_f_int32s_t_increase(status, step, int32s) macro_f_memory_structure_increase(status, step, int32s, int32_t) - #define macro_f_int32s_t_increase_by(status, int32s, amount) macro_f_memory_structure_increase_by(status, int32s, int32_t, amount) - #define macro_f_int32s_t_decrease_by(status, int32s, amount) macro_f_memory_structure_decrease_by(status, int32s, int32_t, amount) - #define macro_f_int32s_t_decimate_by(status, int32s, amount) macro_f_memory_structure_decimate_by(status, int32s, int32_t, amount) + #define macro_f_int32s_t_increase(status, step, int32s) status = f_type_int32s_increase(step, &int32s); + #define macro_f_int32s_t_increase_by(status, int32s, amount) status = f_type_int32s_increase_by(amount, &int32s); + #define macro_f_int32s_t_decrease_by(status, int32s, amount) status = f_type_int32s_decrease_by(amount, &int32s); + #define macro_f_int32s_t_decimate_by(status, int32s, amount) status = f_type_int32s_decimate_by(amount, &int32s); #endif // _di_int32s_t_ /** * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_int32ss_t_ - #define macro_f_int32ss_t_clear(numbers) macro_f_memory_structures_clear(numbers) + #define macro_f_int32ss_t_clear(int32ss) macro_f_memory_structures_clear(int32ss) #define macro_f_int32ss_t_resize(status, int32ss, length) status = f_type_int32ss_resize(length, &int32ss); #define macro_f_int32ss_t_adjust(status, int32ss, length) status = f_type_int32ss_adjust(length, &int32ss); @@ -335,7 +371,7 @@ extern "C" { #define macro_f_int32ss_t_destroy_simple(int32ss) f_type_int32ss_adjust(0, &int32ss); #define macro_f_int32ss_t_increase(status, step, int32ss) status = f_type_int32ss_increase(step, &int32ss); - #define macro_f_int32ss_t_increase_by(status, int32ss, amount) status = f_type_int32ss_increase(amount, &int32ss); + #define macro_f_int32ss_t_increase_by(status, int32ss, amount) status = f_type_int32ss_increase_by(amount, &int32ss); #define macro_f_int32ss_t_decrease_by(status, int32ss, amount) status = f_type_int32ss_decrease_by(amount, &int32ss); #define macro_f_int32ss_t_decimate_by(status, int32ss, amount) status = f_type_int32ss_decimate_by(amount, &int32ss); #endif // _di_int32ss_t_ @@ -344,25 +380,25 @@ extern "C" { * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_uint32s_t_ - #define macro_f_uint32s_t_clear(uint32s) macro_f_memory_structure_clear(uint32s) + #define macro_f_uint32s_t_clear(uint32s) macro_f_memory_structures_clear(uint32s) - #define macro_f_uint32s_t_resize(status, uint32s, length) macro_f_memory_structure_resize(status, uint32s, uint32_t, length) - #define macro_f_uint32s_t_adjust(status, uint32s, length) macro_f_memory_structure_adjust(status, uint32s, uint32_t, length) + #define macro_f_uint32s_t_resize(status, uint32s, length) status = f_type_uint32s_resize(length, &uint32s); + #define macro_f_uint32s_t_adjust(status, uint32s, length) status = f_type_uint32s_adjust(length, &uint32s); - #define macro_f_uint32s_t_delete_simple(uint32s) macro_f_memory_structure_delete_simple(uint32s, uint32_t) - #define macro_f_uint32s_t_destroy_simple(uint32s) macro_f_memory_structure_destroy_simple(uint32s, uint32_t) + #define macro_f_uint32s_t_delete_simple(uint32s) f_type_uint32s_resize(0, &uint32s); + #define macro_f_uint32s_t_destroy_simple(uint32s) f_type_uint32s_adjust(0, &uint32s); - #define macro_f_uint32s_t_increase(status, step, uint32s) macro_f_memory_structure_increase(status, step, uint32s, uint32_t) - #define macro_f_uint32s_t_increase_by(status, uint32s, amount) macro_f_memory_structure_increase_by(status, uint32s, uint32_t, amount) - #define macro_f_uint32s_t_decrease_by(status, uint32s, amount) macro_f_memory_structure_decrease_by(status, uint32s, uint32_t, amount) - #define macro_f_uint32s_t_decimate_by(status, uint32s, amount) macro_f_memory_structure_decimate_by(status, uint32s, uint32_t, amount) + #define macro_f_uint32s_t_increase(status, step, uint32s) status = f_type_uint32s_increase(step, &uint32s); + #define macro_f_uint32s_t_increase_by(status, uint32s, amount) status = f_type_uint32s_increase_by(amount, &uint32s); + #define macro_f_uint32s_t_decrease_by(status, uint32s, amount) status = f_type_uint32s_decrease_by(amount, &uint32s); + #define macro_f_uint32s_t_decimate_by(status, uint32s, amount) status = f_type_uint32s_decimate_by(amount, &uint32s); #endif // _di_uint32s_t_ /** * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_uint32ss_t_ - #define macro_f_uint32ss_t_clear(numbers) macro_f_memory_structures_clear(numbers) + #define macro_f_uint32ss_t_clear(uint32ss) macro_f_memory_structures_clear(uint32ss) #define macro_f_uint32ss_t_resize(status, uint32ss, length) status = f_type_uint32ss_resize(length, &uint32ss); #define macro_f_uint32ss_t_adjust(status, uint32ss, length) status = f_type_uint32ss_adjust(length, &uint32ss); @@ -371,7 +407,7 @@ extern "C" { #define macro_f_uint32ss_t_destroy_simple(uint32ss) f_type_uint32ss_adjust(0, &uint32ss); #define macro_f_uint32ss_t_increase(status, step, uint32ss) status = f_type_uint32ss_increase(step, &uint32ss); - #define macro_f_uint32ss_t_increase_by(status, uint32ss, amount) status = f_type_uint32ss_increase(amount, &uint32ss); + #define macro_f_uint32ss_t_increase_by(status, uint32ss, amount) status = f_type_uint32ss_increase_by(amount, &uint32ss); #define macro_f_uint32ss_t_decrease_by(status, uint32ss, amount) status = f_type_uint32ss_decrease_by(amount, &uint32ss); #define macro_f_uint32ss_t_decimate_by(status, uint32ss, amount) status = f_type_uint32ss_decimate_by(amount, &uint32ss); #endif // _di_uint32ss_t_ @@ -380,31 +416,31 @@ extern "C" { * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_int64s_t_ - #define macro_f_int64s_t_clear(int64s) macro_f_memory_structure_clear(int64s) + #define macro_f_int64s_t_clear(int64s) macro_f_memory_structures_clear(int64s) - #define macro_f_int64s_t_adjust(status, int64s, length) macro_f_memory_structure_adjust(status, int64s, int64_t, length) - #define macro_f_int64s_t_resize(status, int64s, length) macro_f_memory_structure_resize(status, int64s, int64_t, length) + #define macro_f_int64s_t_resize(status, int64s, length) status = f_type_int64s_resize(length, &int64s); + #define macro_f_int64s_t_adjust(status, int64s, length) status = f_type_int64s_adjust(length, &int64s); - #define macro_f_int64s_t_delete_simple(int64s) macro_f_memory_structure_delete_simple(int64s, int64_t) - #define macro_f_int64s_t_destroy_simple(int64s) macro_f_memory_structure_destroy_simple(int64s, int64_t) + #define macro_f_int64s_t_increase(status, step, int64s) status = f_type_int64s_increase(step, &int64s); + #define macro_f_int64s_t_increase_by(status, int64s, amount) status = f_type_int64s_increase_by(amount, &int64s); + #define macro_f_int64s_t_decrease_by(status, int64s, amount) status = f_type_int64s_decrease_by(amount, &int64s); + #define macro_f_int64s_t_decimate_by(status, int64s, amount) status = f_type_int64s_decimate_by(amount, &int64s); - #define macro_f_int64s_t_increase(status, step, int64s) macro_f_memory_structure_increase(status, step, int64s, int64_t) - #define macro_f_int64s_t_increase_by(status, int64s, amount) macro_f_memory_structure_increase_by(status, int64s, int64_t, amount) - #define macro_f_int64s_t_decrease_by(status, int64s, amount) macro_f_memory_structure_decrease_by(status, int64s, int64_t, amount) - #define macro_f_int64s_t_decimate_by(status, int64s, amount) macro_f_memory_structure_decimate_by(status, int64s, int64_t, amount) + #define macro_f_int64s_t_delete_simple(int64s) f_type_int64s_resize(0, &int64s); + #define macro_f_int64s_t_destroy_simple(int64s) f_type_int64s_adjust(0, &int64s); #endif // _di_int64s_t_ /** * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_int64ss_t_ - #define macro_f_int64ss_t_clear(numbers) macro_f_memory_structures_clear(numbers) + #define macro_f_int64ss_t_clear(int64ss) macro_f_memory_structures_clear(int64ss) #define macro_f_int64ss_t_resize(status, int64ss, length) status = f_type_int64ss_resize(length, &int64ss); #define macro_f_int64ss_t_adjust(status, int64ss, length) status = f_type_int64ss_adjust(length, &int64ss); #define macro_f_int64ss_t_increase(status, step, int64ss) status = f_type_int64ss_increase(step, &int64ss); - #define macro_f_int64ss_t_increase_by(status, int64ss, amount) status = f_type_int64ss_increase(amount, &int64ss); + #define macro_f_int64ss_t_increase_by(status, int64ss, amount) status = f_type_int64ss_increase_by(amount, &int64ss); #define macro_f_int64ss_t_decrease_by(status, int64ss, amount) status = f_type_int64ss_decrease_by(amount, &int64ss); #define macro_f_int64ss_t_decimate_by(status, int64ss, amount) status = f_type_int64ss_decimate_by(amount, &int64ss); @@ -416,31 +452,31 @@ extern "C" { * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_uint64s_t_ - #define macro_f_uint64s_t_clear(uint64s) macro_f_memory_structure_clear(uint64s) + #define macro_f_uint64s_t_clear(uint64s) macro_f_memory_structures_clear(uint64s) - #define macro_f_uint64s_t_adjust(status, uint64s, length) macro_f_memory_structure_adjust(status, uint64s, uint64_t, length) - #define macro_f_uint64s_t_resize(status, uint64s, length) macro_f_memory_structure_resize(status, uint64s, uint64_t, length) + #define macro_f_uint64s_t_resize(status, uint64s, length) status = f_type_uint64s_resize(length, &uint64s); + #define macro_f_uint64s_t_adjust(status, uint64s, length) status = f_type_uint64s_adjust(length, &uint64s); - #define macro_f_uint64s_t_delete_simple(uint64s) macro_f_memory_structure_delete_simple(uint64s, uint64_t) - #define macro_f_uint64s_t_destroy_simple(uint64s) macro_f_memory_structure_destroy_simple(uint64s, uint64_t) + #define macro_f_uint64s_t_increase(status, step, uint64s) status = f_type_uint64s_increase(step, &uint64s); + #define macro_f_uint64s_t_increase_by(status, uint64s, amount) status = f_type_uint64s_increase_by(amount, &uint64s); + #define macro_f_uint64s_t_decrease_by(status, uint64s, amount) status = f_type_uint64s_decrease_by(amount, &uint64s); + #define macro_f_uint64s_t_decimate_by(status, uint64s, amount) status = f_type_uint64s_decimate_by(amount, &uint64s); - #define macro_f_uint64s_t_increase(status, step, uint64s) macro_f_memory_structure_increase(status, step, uint64s, uint64_t) - #define macro_f_uint64s_t_increase_by(status, uint64s, amount) macro_f_memory_structure_increase_by(status, uint64s, uint64_t, amount) - #define macro_f_uint64s_t_decrease_by(status, uint64s, amount) macro_f_memory_structure_decrease_by(status, uint64s, uint64_t, amount) - #define macro_f_uint64s_t_decimate_by(status, uint64s, amount) macro_f_memory_structure_decimate_by(status, uint64s, uint64_t, amount) + #define macro_f_uint64s_t_delete_simple(uint64s) f_type_uint64s_resize(0, &uint64s); + #define macro_f_uint64s_t_destroy_simple(uint64s) f_type_uint64s_adjust(0, &uint64s); #endif // _di_uint64s_t_ /** * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_uint64ss_t_ - #define macro_f_uint64ss_t_clear(numbers) macro_f_memory_structures_clear(numbers) + #define macro_f_uint64ss_t_clear(uint64ss) macro_f_memory_structures_clear(uint64ss) #define macro_f_uint64ss_t_resize(status, uint64ss, length) status = f_type_uint64ss_resize(length, &uint64ss); #define macro_f_uint64ss_t_adjust(status, uint64ss, length) status = f_type_uint64ss_adjust(length, &uint64ss); #define macro_f_uint64ss_t_increase(status, step, uint64ss) status = f_type_uint64ss_increase(step, &uint64ss); - #define macro_f_uint64ss_t_increase_by(status, uint64ss, amount) status = f_type_uint64ss_increase(amount, &uint64ss); + #define macro_f_uint64ss_t_increase_by(status, uint64ss, amount) status = f_type_uint64ss_increase_by(amount, &uint64ss); #define macro_f_uint64ss_t_decrease_by(status, uint64ss, amount) status = f_type_uint64ss_decrease_by(amount, &uint64ss); #define macro_f_uint64ss_t_decimate_by(status, uint64ss, amount) status = f_type_uint64ss_decimate_by(amount, &uint64ss); @@ -452,25 +488,25 @@ extern "C" { * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_int128s_t_ - #define macro_f_int128s_t_clear(int128s) macro_f_memory_structure_clear(int128s) + #define macro_f_int128s_t_clear(int128s) macro_f_memory_structures_clear(int128s) - #define macro_f_int128s_t_adjust(status, int128s, length) macro_f_memory_structure_adjust(status, int128s, f_int128_t, length) - #define macro_f_int128s_t_resize(status, int128s, length) macro_f_memory_structure_resize(status, int128s, f_int128_t, length) + #define macro_f_int128s_t_resize(status, int128s, length) status = f_type_int128s_resize(length, &int128s); + #define macro_f_int128s_t_adjust(status, int128s, length) status = f_type_int128s_adjust(length, &int128s); - #define macro_f_int128s_t_delete_simple(int128s) macro_f_memory_structure_delete_simple(int128s, f_int128_t) - #define macro_f_int128s_t_destroy_simple(int128s) macro_f_memory_structure_destroy_simple(int128s, f_int128_t) + #define macro_f_int128s_t_delete_simple(int128s) f_type_int128s_resize(0, &int128s); + #define macro_f_int128s_t_destroy_simple(int128s) f_type_int128s_adjust(0, &int128s); - #define macro_f_int128s_t_increase(status, step, int128s) macro_f_memory_structure_increase(status, step, int128s, f_int128_t) - #define macro_f_int128s_t_increase_by(status, int128s, amount) macro_f_memory_structure_increase_by(status, int128s, f_int128_t, amount) - #define macro_f_int128s_t_decrease_by(status, int128s, amount) macro_f_memory_structure_decrease_by(status, int128s, f_int128_t, amount) - #define macro_f_int128s_t_decimate_by(status, int128s, amount) macro_f_memory_structure_decimate_by(status, int128s, f_int128_t, amount) + #define macro_f_int128s_t_increase(status, step, int128s) status = f_type_int128s_increase(step, &int128s); + #define macro_f_int128s_t_increase_by(status, int128s, amount) status = f_type_int128s_increase_by(amount, &int128s); + #define macro_f_int128s_t_decrease_by(status, int128s, amount) status = f_type_int128s_decrease_by(amount, &int128s); + #define macro_f_int128s_t_decimate_by(status, int128s, amount) status = f_type_int128s_decimate_by(amount, &int128s); #endif // _di_int128s_t_ /** * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_int128ss_t_ - #define macro_f_int128ss_t_clear(numbers) macro_f_memory_structures_clear(numbers) + #define macro_f_int128ss_t_clear(int128ss) macro_f_memory_structures_clear(int128ss) #define macro_f_int128ss_t_resize(status, int128ss, length) status = f_type_int128ss_resize(length, &int128ss); #define macro_f_int128ss_t_adjust(status, int128ss, length) status = f_type_int128ss_adjust(length, &int128ss); @@ -479,7 +515,7 @@ extern "C" { #define macro_f_int128ss_t_destroy_simple(int128ss) f_type_int128ss_adjust(0, &int128ss); #define macro_f_int128ss_t_increase(status, step, int128ss) status = f_type_int128ss_increase(step, &int128ss); - #define macro_f_int128ss_t_increase_by(status, int128ss, amount) status = f_type_int128ss_increase(amount, &int128ss); + #define macro_f_int128ss_t_increase_by(status, int128ss, amount) status = f_type_int128ss_increase_by(amount, &int128ss); #define macro_f_int128ss_t_decrease_by(status, int128ss, amount) status = f_type_int128ss_decrease_by(amount, &int128ss); #define macro_f_int128ss_t_decimate_by(status, int128ss, amount) status = f_type_int128ss_decimate_by(amount, &int128ss); #endif // _di_int128ss_t_ @@ -488,25 +524,25 @@ extern "C" { * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_uint128s_t_ - #define macro_f_uint128s_t_clear(uint128s) macro_f_memory_structure_clear(uint128s) + #define macro_f_uint128s_t_clear(uint128s) macro_f_memory_structures_clear(uint128s) - #define macro_f_uint128s_t_adjust(status, uint128s, length) macro_f_memory_structure_adjust(status, uint128s, f_uint128_t, length) - #define macro_f_uint128s_t_resize(status, uint128s, length) macro_f_memory_structure_resize(status, uint128s, f_uint128_t, length) + #define macro_f_uint128s_t_resize(status, uint128s, length) status = f_type_uint128s_resize(length, &uint128s); + #define macro_f_uint128s_t_adjust(status, uint128s, length) status = f_type_uint128s_adjust(length, &uint128s); - #define macro_f_uint128s_t_delete_simple(uint128s) macro_f_memory_structure_delete_simple(uint128s, f_uint128_t) - #define macro_f_uint128s_t_destroy_simple(uint128s) macro_f_memory_structure_destroy_simple(uint128s, f_uint128_t) + #define macro_f_uint128s_t_delete_simple(uint128s) f_type_uint128s_resize(0, &uint128s); + #define macro_f_uint128s_t_destroy_simple(uint128s) f_type_uint128s_adjust(0, &uint128s); - #define macro_f_uint128s_t_increase(status, step, uint128s) macro_f_memory_structure_increase(status, step, uint128s, f_uint128_t) - #define macro_f_uint128s_t_increase_by(status, uint128s, amount) macro_f_memory_structure_increase_by(status, uint128s, f_uint128_t, amount) - #define macro_f_uint128s_t_decrease_by(status, uint128s, amount) macro_f_memory_structure_decrease_by(status, uint128s, f_uint128_t, amount) - #define macro_f_uint128s_t_decimate_by(status, uint128s, amount) macro_f_memory_structure_decimate_by(status, uint128s, f_uint128_t, amount) + #define macro_f_uint128s_t_increase(status, step, uint128s) status = f_type_uint128s_increase(step, &uint128s); + #define macro_f_uint128s_t_increase_by(status, uint128s, amount) status = f_type_uint128s_increase_by(amount, &uint128s); + #define macro_f_uint128s_t_decrease_by(status, uint128s, amount) status = f_type_uint128s_decrease_by(amount, &uint128s); + #define macro_f_uint128s_t_decimate_by(status, uint128s, amount) status = f_type_uint128s_decimate_by(amount, &uint128s); #endif // _di_uint128s_t_ /** * Macros for f_array_lengths_t, see type.h for typedefs. */ #ifndef _di_uint128ss_t_ - #define macro_f_uint128ss_t_clear(numbers) macro_f_memory_structures_clear(numbers) + #define macro_f_uint128ss_t_clear(uint128ss) macro_f_memory_structures_clear(uint128ss) #define macro_f_uint128ss_t_resize(status, uint128ss, length) status = f_type_uint128ss_resize(length, &uint128ss); #define macro_f_uint128ss_t_adjust(status, uint128ss, length) status = f_type_uint128ss_adjust(length, &uint128ss); @@ -515,7 +551,7 @@ extern "C" { #define macro_f_uint128ss_t_destroy_simple(uint128ss) f_type_uint128ss_adjust(0, &uint128ss); #define macro_f_uint128ss_t_increase(status, step, uint128ss) status = f_type_uint128ss_increase(step, &uint128ss); - #define macro_f_uint128ss_t_increase_by(status, uint128ss, amount) status = f_type_uint128ss_increase(amount, &uint128ss); + #define macro_f_uint128ss_t_increase_by(status, uint128ss, amount) status = f_type_uint128ss_increase_by(amount, &uint128ss); #define macro_f_uint128ss_t_decrease_by(status, uint128ss, amount) status = f_type_uint128ss_decrease_by(amount, &uint128ss); #define macro_f_uint128ss_t_decimate_by(status, uint128ss, amount) status = f_type_uint128ss_decimate_by(amount, &uint128ss); #endif // _di_uint128ss_t_ diff --git a/level_0/f_type_array/c/type_array.c b/level_0/f_type_array/c/type_array.c index e8f14cc..eb3625c 100644 --- a/level_0/f_type_array/c/type_array.c +++ b/level_0/f_type_array/c/type_array.c @@ -4,6 +4,455 @@ #ifdef __cplusplus extern "C" { #endif + +#ifndef _di_f_type_statuss_adjust_ + f_status_t f_type_statuss_adjust(const f_array_length_t length, f_statuss_t *statuss) { + #ifndef _di_level_0_parameter_checking_ + if (!statuss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_statuss_adjust(length, statuss); + } +#endif // _di_f_type_statuss_adjust_ + +#ifndef _di_f_type_statuss_append_ + f_status_t f_type_statuss_append(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_type_statuss_append(source, destination); + } +#endif // _di_f_type_statuss_append_ + +#ifndef _di_f_type_statuss_decimate_by_ + f_status_t f_type_statuss_decimate_by(const f_array_length_t amount, f_statuss_t *statuss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!statuss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (statuss->size - amount > 0) { + return private_f_type_statuss_adjust(statuss->size - amount, statuss); + } + + return private_f_type_statuss_adjust(0, statuss); + } +#endif // _di_f_type_statuss_decimate_by_ + +#ifndef _di_f_type_statuss_decrease_by_ + f_status_t f_type_statuss_decrease_by(const f_array_length_t amount, f_statuss_t *statuss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!statuss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (statuss->size - amount > 0) { + return private_f_type_statuss_resize(statuss->size - amount, statuss); + } + + return private_f_type_statuss_resize(0, statuss); + } +#endif // _di_f_type_statuss_decrease_by_ + +#ifndef _di_f_type_statuss_increase_ + f_status_t f_type_statuss_increase(const uint16_t step, f_statuss_t *statuss) { + #ifndef _di_level_0_parameter_checking_ + if (!step) return F_status_set_error(F_parameter); + if (!statuss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (statuss->used + 1 > statuss->size) { + f_array_length_t size = statuss->used + step; + + if (size > f_array_length_t_size) { + if (statuss->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_type_statuss_resize(size, statuss); + } + + return F_data_not; + } +#endif // _di_f_type_statuss_increase_ + +#ifndef _di_f_type_statuss_increase_by_ + f_status_t f_type_statuss_increase_by(const f_array_length_t amount, f_statuss_t *statuss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!statuss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (statuss->used + amount > statuss->size) { + if (statuss->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_type_statuss_resize(statuss->used + amount, statuss); + } + + return F_data_not; + } +#endif // _di_f_type_statuss_increase_by_ + +#ifndef _di_f_type_statuss_resize_ + f_status_t f_type_statuss_resize(const f_array_length_t length, f_statuss_t *statuss) { + #ifndef _di_level_0_parameter_checking_ + if (!statuss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_statuss_resize(length, statuss); + } +#endif // _di_f_type_statuss_resize_ + +#ifndef _di_f_type_statusss_adjust_ + f_status_t f_type_statusss_adjust(const f_array_length_t length, f_statusss_t *statusss) { + #ifndef _di_level_0_parameter_checking_ + if (!statusss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_statusss_adjust(length, statusss); + } +#endif // _di_f_type_statusss_adjust_ + +#ifndef _di_f_type_statusss_append_ + f_status_t f_type_statusss_append(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_ + + if (!source.used) return F_data_not; + + f_status_t status = F_none; + + if (destination->used + source.used > destination->size) { + status = private_f_type_statusss_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_type_statuss_append(source.array[i], &destination->array[destination->used]); + if (F_status_is_error(status)) return status; + } // for + + return F_none; + } +#endif // _di_f_type_statusss_append_ + +#ifndef _di_f_type_statusss_decimate_by_ + f_status_t f_type_statusss_decimate_by(const f_array_length_t amount, f_statusss_t *statusss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!statusss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (statusss->size - amount > 0) { + return private_f_type_statusss_adjust(statusss->size - amount, statusss); + } + + return private_f_type_statusss_adjust(0, statusss); + } +#endif // _di_f_type_statusss_decimate_by_ + +#ifndef _di_f_type_statusss_decrease_by_ + f_status_t f_type_statusss_decrease_by(const f_array_length_t amount, f_statusss_t *statusss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!statusss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (statusss->size - amount > 0) { + return private_f_type_statusss_resize(statusss->size - amount, statusss); + } + + return private_f_type_statusss_resize(0, statusss); + } +#endif // _di_f_type_statusss_decrease_by_ + +#ifndef _di_f_type_statusss_increase_ + f_status_t f_type_statusss_increase(const uint16_t step, f_statusss_t *statusss) { + #ifndef _di_level_0_parameter_checking_ + if (!step) return F_status_set_error(F_parameter); + if (!statusss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (statusss->used + 1 > statusss->size) { + f_array_length_t size = statusss->used + step; + + if (size > f_array_length_t_size) { + if (statusss->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_type_statusss_resize(size, statusss); + } + + return F_data_not; + } +#endif // _di_f_type_statusss_increase_ + +#ifndef _di_f_type_statusss_increase_by_ + f_status_t f_type_statusss_increase_by(const f_array_length_t amount, f_statusss_t *statusss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!statusss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (statusss->used + amount > statusss->size) { + if (statusss->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_type_statusss_resize(statusss->used + amount, statusss); + } + + return F_data_not; + } +#endif // _di_f_type_statusss_increase_by_ + +#ifndef _di_f_type_statusss_resize_ + f_status_t f_type_statusss_resize(const f_array_length_t length, f_statusss_t *statusss) { + #ifndef _di_level_0_parameter_checking_ + if (!statusss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_statusss_resize(length, statusss); + } +#endif // _di_f_type_statusss_resize_ + +#ifndef _di_f_type_states_adjust_ + f_status_t f_type_states_adjust(const f_array_length_t length, f_states_t *states) { + #ifndef _di_level_0_parameter_checking_ + if (!states) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_states_adjust(length, states); + } +#endif // _di_f_type_states_adjust_ + +#ifndef _di_f_type_states_append_ + f_status_t f_type_states_append(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_type_states_append(source, destination); + } +#endif // _di_f_type_states_append_ + +#ifndef _di_f_type_states_decimate_by_ + f_status_t f_type_states_decimate_by(const f_array_length_t amount, f_states_t *states) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!states) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (states->size - amount > 0) { + return private_f_type_states_adjust(states->size - amount, states); + } + + return private_f_type_states_adjust(0, states); + } +#endif // _di_f_type_states_decimate_by_ + +#ifndef _di_f_type_states_decrease_by_ + f_status_t f_type_states_decrease_by(const f_array_length_t amount, f_states_t *states) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!states) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (states->size - amount > 0) { + return private_f_type_states_resize(states->size - amount, states); + } + + return private_f_type_states_resize(0, states); + } +#endif // _di_f_type_states_decrease_by_ + +#ifndef _di_f_type_states_increase_ + f_status_t f_type_states_increase(const uint16_t step, f_states_t *states) { + #ifndef _di_level_0_parameter_checking_ + if (!step) return F_status_set_error(F_parameter); + if (!states) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (states->used + 1 > states->size) { + f_array_length_t size = states->used + step; + + if (size > f_array_length_t_size) { + if (states->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_type_states_resize(size, states); + } + + return F_data_not; + } +#endif // _di_f_type_states_increase_ + +#ifndef _di_f_type_states_increase_by_ + f_status_t f_type_states_increase_by(const f_array_length_t amount, f_states_t *states) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!states) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (states->used + amount > states->size) { + if (states->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_type_states_resize(states->used + amount, states); + } + + return F_data_not; + } +#endif // _di_f_type_states_increase_by_ + +#ifndef _di_f_type_states_resize_ + f_status_t f_type_states_resize(const f_array_length_t length, f_states_t *states) { + #ifndef _di_level_0_parameter_checking_ + if (!states) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_states_resize(length, states); + } +#endif // _di_f_type_states_resize_ + +#ifndef _di_f_type_statess_adjust_ + f_status_t f_type_statess_adjust(const f_array_length_t length, f_statess_t *statess) { + #ifndef _di_level_0_parameter_checking_ + if (!statess) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_statess_adjust(length, statess); + } +#endif // _di_f_type_statess_adjust_ + +#ifndef _di_f_type_statess_append_ + f_status_t f_type_statess_append(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_ + + if (!source.used) return F_data_not; + + f_status_t status = F_none; + + if (destination->used + source.used > destination->size) { + status = private_f_type_statess_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_type_states_append(source.array[i], &destination->array[destination->used]); + if (F_status_is_error(status)) return status; + } // for + + return F_none; + } +#endif // _di_f_type_statess_append_ + +#ifndef _di_f_type_statess_decimate_by_ + f_status_t f_type_statess_decimate_by(const f_array_length_t amount, f_statess_t *statess) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!statess) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (statess->size - amount > 0) { + return private_f_type_statess_adjust(statess->size - amount, statess); + } + + return private_f_type_statess_adjust(0, statess); + } +#endif // _di_f_type_statess_decimate_by_ + +#ifndef _di_f_type_statess_decrease_by_ + f_status_t f_type_statess_decrease_by(const f_array_length_t amount, f_statess_t *statess) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!statess) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (statess->size - amount > 0) { + return private_f_type_statess_resize(statess->size - amount, statess); + } + + return private_f_type_statess_resize(0, statess); + } +#endif // _di_f_type_statess_decrease_by_ + +#ifndef _di_f_type_statess_increase_ + f_status_t f_type_statess_increase(const uint16_t step, f_statess_t *statess) { + #ifndef _di_level_0_parameter_checking_ + if (!step) return F_status_set_error(F_parameter); + if (!statess) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (statess->used + 1 > statess->size) { + f_array_length_t size = statess->used + step; + + if (size > f_array_length_t_size) { + if (statess->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_type_statess_resize(size, statess); + } + + return F_data_not; + } +#endif // _di_f_type_statess_increase_ + +#ifndef _di_f_type_statess_increase_by_ + f_status_t f_type_statess_increase_by(const f_array_length_t amount, f_statess_t *statess) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!statess) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (statess->used + amount > statess->size) { + if (statess->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_type_statess_resize(statess->used + amount, statess); + } + + return F_data_not; + } +#endif // _di_f_type_statess_increase_by_ + +#ifndef _di_f_type_statess_resize_ + f_status_t f_type_statess_resize(const f_array_length_t length, f_statess_t *statess) { + #ifndef _di_level_0_parameter_checking_ + if (!statess) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_statess_resize(length, statess); + } +#endif // _di_f_type_statess_resize_ + #ifndef _di_f_type_cells_adjust_ f_status_t f_type_cells_adjust(const f_array_length_t length, f_cells_t *cells) { #ifndef _di_level_0_parameter_checking_ @@ -228,6 +677,230 @@ extern "C" { } #endif // _di_f_type_cellss_resize_ +#ifndef _di_f_type_fll_ids_adjust_ + f_status_t f_type_fll_ids_adjust(const f_array_length_t length, f_fll_ids_t *ids) { + #ifndef _di_level_0_parameter_checking_ + if (!ids) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_fll_ids_adjust(length, ids); + } +#endif // _di_f_type_fll_ids_adjust_ + +#ifndef _di_f_type_fll_ids_append_ + f_status_t f_type_fll_ids_append(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_type_fll_ids_append(source, destination); + } +#endif // _di_f_type_fll_ids_append_ + +#ifndef _di_f_type_fll_ids_decimate_by_ + f_status_t f_type_fll_ids_decimate_by(const f_array_length_t amount, f_fll_ids_t *ids) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!ids) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (ids->size - amount > 0) { + return private_f_type_fll_ids_adjust(ids->size - amount, ids); + } + + return private_f_type_fll_ids_adjust(0, ids); + } +#endif // _di_f_type_fll_ids_decimate_by_ + +#ifndef _di_f_type_fll_ids_decrease_by_ + f_status_t f_type_fll_ids_decrease_by(const f_array_length_t amount, f_fll_ids_t *ids) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!ids) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (ids->size - amount > 0) { + return private_f_type_fll_ids_resize(ids->size - amount, ids); + } + + return private_f_type_fll_ids_resize(0, ids); + } +#endif // _di_f_type_fll_ids_decrease_by_ + +#ifndef _di_f_type_fll_ids_increase_ + f_status_t f_type_fll_ids_increase(const uint16_t step, f_fll_ids_t *ids) { + #ifndef _di_level_0_parameter_checking_ + if (!step) return F_status_set_error(F_parameter); + if (!ids) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (ids->used + 1 > ids->size) { + f_array_length_t size = ids->used + step; + + if (size > f_array_length_t_size) { + if (ids->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_type_fll_ids_resize(size, ids); + } + + return F_data_not; + } +#endif // _di_f_type_fll_ids_increase_ + +#ifndef _di_f_type_fll_ids_increase_by_ + f_status_t f_type_fll_ids_increase_by(const f_array_length_t amount, f_fll_ids_t *ids) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!ids) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (ids->used + amount > ids->size) { + if (ids->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_type_fll_ids_resize(ids->used + amount, ids); + } + + return F_data_not; + } +#endif // _di_f_type_fll_ids_increase_by_ + +#ifndef _di_f_type_fll_ids_resize_ + f_status_t f_type_fll_ids_resize(const f_array_length_t length, f_fll_ids_t *ids) { + #ifndef _di_level_0_parameter_checking_ + if (!ids) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_fll_ids_resize(length, ids); + } +#endif // _di_f_type_fll_ids_resize_ + +#ifndef _di_f_type_fll_idss_adjust_ + f_status_t f_type_fll_idss_adjust(const f_array_length_t length, f_fll_idss_t *idss) { + #ifndef _di_level_0_parameter_checking_ + if (!idss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_fll_idss_adjust(length, idss); + } +#endif // _di_f_type_fll_idss_adjust_ + +#ifndef _di_f_type_fll_idss_append_ + f_status_t f_type_fll_idss_append(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_ + + if (!source.used) return F_data_not; + + f_status_t status = F_none; + + if (destination->used + source.used > destination->size) { + status = private_f_type_fll_idss_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_type_fll_ids_append(source.array[i], &destination->array[destination->used]); + if (F_status_is_error(status)) return status; + } // for + + return F_none; + } +#endif // _di_f_type_fll_idss_append_ + +#ifndef _di_f_type_fll_idss_decimate_by_ + f_status_t f_type_fll_idss_decimate_by(const f_array_length_t amount, f_fll_idss_t *idss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!idss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (idss->size - amount > 0) { + return private_f_type_fll_idss_adjust(idss->size - amount, idss); + } + + return private_f_type_fll_idss_adjust(0, idss); + } +#endif // _di_f_type_fll_idss_decimate_by_ + +#ifndef _di_f_type_fll_idss_decrease_by_ + f_status_t f_type_fll_idss_decrease_by(const f_array_length_t amount, f_fll_idss_t *idss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!idss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (idss->size - amount > 0) { + return private_f_type_fll_idss_resize(idss->size - amount, idss); + } + + return private_f_type_fll_idss_resize(0, idss); + } +#endif // _di_f_type_fll_idss_decrease_by_ + +#ifndef _di_f_type_fll_idss_increase_ + f_status_t f_type_fll_idss_increase(const uint16_t step, f_fll_idss_t *idss) { + #ifndef _di_level_0_parameter_checking_ + if (!step) return F_status_set_error(F_parameter); + if (!idss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (idss->used + 1 > idss->size) { + f_array_length_t size = idss->used + step; + + if (size > f_array_length_t_size) { + if (idss->used + 1 > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + size = f_array_length_t_size; + } + + return private_f_type_fll_idss_resize(size, idss); + } + + return F_data_not; + } +#endif // _di_f_type_fll_idss_increase_ + +#ifndef _di_f_type_fll_idss_increase_by_ + f_status_t f_type_fll_idss_increase_by(const f_array_length_t amount, f_fll_idss_t *idss) { + #ifndef _di_level_0_parameter_checking_ + if (!amount) return F_status_set_error(F_parameter); + if (!idss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (idss->used + amount > idss->size) { + if (idss->used + amount > f_array_length_t_size) { + return F_status_set_error(F_array_too_large); + } + + return private_f_type_fll_idss_resize(idss->used + amount, idss); + } + + return F_data_not; + } +#endif // _di_f_type_fll_idss_increase_by_ + +#ifndef _di_f_type_fll_idss_resize_ + f_status_t f_type_fll_idss_resize(const f_array_length_t length, f_fll_idss_t *idss) { + #ifndef _di_level_0_parameter_checking_ + if (!idss) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + return private_f_type_fll_idss_resize(length, idss); + } +#endif // _di_f_type_fll_idss_resize_ + #ifndef _di_f_type_array_lengths_adjust_ f_status_t f_type_array_lengths_adjust(const f_array_length_t length, f_array_lengths_t *lengths) { #ifndef _di_level_0_parameter_checking_ diff --git a/level_0/f_type_array/c/type_array.h b/level_0/f_type_array/c/type_array.h index ecd41b5..2340312 100644 --- a/level_0/f_type_array/c/type_array.h +++ b/level_0/f_type_array/c/type_array.h @@ -25,6 +25,670 @@ extern "C" { #endif /** + * Resize the string statuss array. + * + * @param length + * The new size to use. + * @param statuss + * The string statuss 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_type_statuss_adjust_ + extern f_status_t f_type_statuss_adjust(const f_array_length_t length, f_statuss_t *statuss); +#endif // _di_f_type_statuss_adjust_ + +/** + * 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_type_statuss_append_ + extern f_status_t f_type_statuss_append(const f_statuss_t source, f_statuss_t *destination); +#endif // _di_f_type_statuss_append_ + +/** + * Resize the string statuss 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 statuss + * The string statuss 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_type_statuss_decimate_by_ + extern f_status_t f_type_statuss_decimate_by(const f_array_length_t amount, f_statuss_t *statuss); +#endif // _di_f_type_statuss_decimate_by_ + +/** + * Resize the string statuss 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 statuss + * The string statuss 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_type_statuss_decrease_by_ + extern f_status_t f_type_statuss_decrease_by(const f_array_length_t amount, f_statuss_t *statuss); +#endif // _di_f_type_statuss_decrease_by_ + +/** + * Increase the size of the string statuss 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). + * 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 statuss + * The string statuss 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_type_statuss_increase_ + extern f_status_t f_type_statuss_increase(const uint16_t step, f_statuss_t *statuss); +#endif // _di_f_type_statuss_increase_ + +/** + * Resize the string statuss 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). + * 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 statuss + * The string statuss 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_type_statuss_increase_by_ + extern f_status_t f_type_statuss_increase_by(const f_array_length_t amount, f_statuss_t *statuss); +#endif // _di_f_type_statuss_increase_by_ + +/** + * Resize the string statuss array. + * + * @param length + * The new size to use. + * @param statuss + * The string statuss 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_type_statuss_resize_ + extern f_status_t f_type_statuss_resize(const f_array_length_t length, f_statuss_t *statuss); +#endif // _di_f_type_statuss_resize_ + +/** + * Resize the string statusss array. + * + * @param length + * The new size to use. + * @param statusss + * The string statusss 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_type_statusss_adjust_ + extern f_status_t f_type_statusss_adjust(const f_array_length_t length, f_statusss_t *statusss); +#endif // _di_f_type_statusss_adjust_ + +/** + * Append the source statusss onto the destination. + * + * @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_resize(). + */ +#ifndef _di_f_type_statusss_append_ + extern f_status_t f_type_statusss_append(const f_statusss_t source, f_statusss_t *destination); +#endif // _di_f_type_statusss_append_ + +/** + * Resize the string statusss array. + * + * @param length + * The new size to use. + * @param statusss + * The string statusss 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_type_statusss_adjust_ + extern f_status_t f_type_statusss_adjust(const f_array_length_t length, f_statusss_t *statusss); +#endif // _di_f_type_statusss_adjust_ + +/** + * Resize the string statusss 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 statusss + * The string statusss 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_type_statusss_decimate_by_ + extern f_status_t f_type_statusss_decimate_by(const f_array_length_t amount, f_statusss_t *statusss); +#endif // _di_f_type_statusss_decimate_by_ + +/** + * Resize the string statusss 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 statusss + * The string statusss 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_type_statusss_decrease_by_ + extern f_status_t f_type_statusss_decrease_by(const f_array_length_t amount, f_statusss_t *statusss); +#endif // _di_f_type_statusss_decrease_by_ + +/** + * Increase the size of the string statusss 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). + * 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 statusss + * The string statusss 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_type_statusss_increase_ + extern f_status_t f_type_statusss_increase(const uint16_t step, f_statusss_t *statusss); +#endif // _di_f_type_statusss_increase_ + +/** + * Resize the string statusss 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). + * 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 statusss + * The string statusss 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_type_statusss_increase_by_ + extern f_status_t f_type_statusss_increase_by(const f_array_length_t amount, f_statusss_t *statusss); +#endif // _di_f_type_statusss_increase_by_ + +/** + * Resize the string statusss array. + * + * @param length + * The new size to use. + * @param statusss + * The string statusss 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_type_statusss_resize_ + extern f_status_t f_type_statusss_resize(const f_array_length_t length, f_statusss_t *statusss); +#endif // _di_f_type_statusss_resize_ + +/** + * Resize the string states array. + * + * @param length + * The new size to use. + * @param states + * The string states 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_type_states_adjust_ + extern f_status_t f_type_states_adjust(const f_array_length_t length, f_states_t *states); +#endif // _di_f_type_states_adjust_ + +/** + * 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_type_states_append_ + extern f_status_t f_type_states_append(const f_states_t source, f_states_t *destination); +#endif // _di_f_type_states_append_ + +/** + * Resize the string states 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 states + * The string states 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_type_states_decimate_by_ + extern f_status_t f_type_states_decimate_by(const f_array_length_t amount, f_states_t *states); +#endif // _di_f_type_states_decimate_by_ + +/** + * Resize the string states 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 states + * The string states 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_type_states_decrease_by_ + extern f_status_t f_type_states_decrease_by(const f_array_length_t amount, f_states_t *states); +#endif // _di_f_type_states_decrease_by_ + +/** + * Increase the size of the string states 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). + * 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 states + * The string states 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_type_states_increase_ + extern f_status_t f_type_states_increase(const uint16_t step, f_states_t *states); +#endif // _di_f_type_states_increase_ + +/** + * Resize the string states 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). + * 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 states + * The string states 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_type_states_increase_by_ + extern f_status_t f_type_states_increase_by(const f_array_length_t amount, f_states_t *states); +#endif // _di_f_type_states_increase_by_ + +/** + * Resize the string states array. + * + * @param length + * The new size to use. + * @param states + * The string states 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_type_states_resize_ + extern f_status_t f_type_states_resize(const f_array_length_t length, f_states_t *states); +#endif // _di_f_type_states_resize_ + +/** + * Resize the string statess array. + * + * @param length + * The new size to use. + * @param statess + * The string statess 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_type_statess_adjust_ + extern f_status_t f_type_statess_adjust(const f_array_length_t length, f_statess_t *statess); +#endif // _di_f_type_statess_adjust_ + +/** + * Append the source statess onto the destination. + * + * @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_resize(). + */ +#ifndef _di_f_type_statess_append_ + extern f_status_t f_type_statess_append(const f_statess_t source, f_statess_t *destination); +#endif // _di_f_type_statess_append_ + +/** + * Resize the string statess array. + * + * @param length + * The new size to use. + * @param statess + * The string statess 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_type_statess_adjust_ + extern f_status_t f_type_statess_adjust(const f_array_length_t length, f_statess_t *statess); +#endif // _di_f_type_statess_adjust_ + +/** + * Resize the string statess 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 statess + * The string statess 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_type_statess_decimate_by_ + extern f_status_t f_type_statess_decimate_by(const f_array_length_t amount, f_statess_t *statess); +#endif // _di_f_type_statess_decimate_by_ + +/** + * Resize the string statess 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 statess + * The string statess 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_type_statess_decrease_by_ + extern f_status_t f_type_statess_decrease_by(const f_array_length_t amount, f_statess_t *statess); +#endif // _di_f_type_statess_decrease_by_ + +/** + * Increase the size of the string statess 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). + * 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 statess + * The string statess 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_type_statess_increase_ + extern f_status_t f_type_statess_increase(const uint16_t step, f_statess_t *statess); +#endif // _di_f_type_statess_increase_ + +/** + * Resize the string statess 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). + * 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 statess + * The string statess 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_type_statess_increase_by_ + extern f_status_t f_type_statess_increase_by(const f_array_length_t amount, f_statess_t *statess); +#endif // _di_f_type_statess_increase_by_ + +/** + * Resize the string statess array. + * + * @param length + * The new size to use. + * @param statess + * The string statess 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_type_statess_resize_ + extern f_status_t f_type_statess_resize(const f_array_length_t length, f_statess_t *statess); +#endif // _di_f_type_statess_resize_ + +/** * Resize the string cells array. * * @param length @@ -357,6 +1021,338 @@ extern "C" { #endif // _di_f_type_cellss_resize_ /** + * Resize the string ids array. + * + * @param length + * The new size to use. + * @param ids + * The string ids 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_type_fll_ids_adjust_ + extern f_status_t f_type_fll_ids_adjust(const f_array_length_t length, f_fll_ids_t *ids); +#endif // _di_f_type_fll_ids_adjust_ + +/** + * Append the source ids onto the destination. + * + * @param source + * The source ids to append. + * @param destination + * The destination 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_type_fll_ids_append_ + extern f_status_t f_type_fll_ids_append(const f_fll_ids_t source, f_fll_ids_t *destination); +#endif // _di_f_type_fll_ids_append_ + +/** + * Resize the string ids 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 ids + * The string ids 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_type_fll_ids_decimate_by_ + extern f_status_t f_type_fll_ids_decimate_by(const f_array_length_t amount, f_fll_ids_t *ids); +#endif // _di_f_type_fll_ids_decimate_by_ + +/** + * Resize the string ids 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 ids + * The string ids 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_type_fll_ids_decrease_by_ + extern f_status_t f_type_fll_ids_decrease_by(const f_array_length_t amount, f_fll_ids_t *ids); +#endif // _di_f_type_fll_ids_decrease_by_ + +/** + * Increase the size of the string ids 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). + * 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 ids + * The string ids 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_type_fll_ids_increase_ + extern f_status_t f_type_fll_ids_increase(const uint16_t step, f_fll_ids_t *ids); +#endif // _di_f_type_fll_ids_increase_ + +/** + * Resize the string ids 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). + * 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 ids + * The string ids 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_type_fll_ids_increase_by_ + extern f_status_t f_type_fll_ids_increase_by(const f_array_length_t amount, f_fll_ids_t *ids); +#endif // _di_f_type_fll_ids_increase_by_ + +/** + * Resize the string ids array. + * + * @param length + * The new size to use. + * @param ids + * The string ids 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_type_fll_ids_resize_ + extern f_status_t f_type_fll_ids_resize(const f_array_length_t length, f_fll_ids_t *ids); +#endif // _di_f_type_fll_ids_resize_ + +/** + * Resize the string idss array. + * + * @param length + * The new size to use. + * @param idss + * The string idss 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_type_fll_idss_adjust_ + extern f_status_t f_type_fll_idss_adjust(const f_array_length_t length, f_fll_idss_t *idss); +#endif // _di_f_type_fll_idss_adjust_ + +/** + * Append the source idss onto the destination. + * + * @param source + * The source 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_resize(). + */ +#ifndef _di_f_type_fll_idss_append_ + extern f_status_t f_type_fll_idss_append(const f_fll_idss_t source, f_fll_idss_t *destination); +#endif // _di_f_type_fll_idss_append_ + +/** + * Resize the string idss array. + * + * @param length + * The new size to use. + * @param idss + * The string idss 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_type_fll_idss_adjust_ + extern f_status_t f_type_fll_idss_adjust(const f_array_length_t length, f_fll_idss_t *idss); +#endif // _di_f_type_fll_idss_adjust_ + +/** + * Resize the string idss 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 idss + * The string idss 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_type_fll_idss_decimate_by_ + extern f_status_t f_type_fll_idss_decimate_by(const f_array_length_t amount, f_fll_idss_t *idss); +#endif // _di_f_type_fll_idss_decimate_by_ + +/** + * Resize the string idss 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 idss + * The string idss 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_type_fll_idss_decrease_by_ + extern f_status_t f_type_fll_idss_decrease_by(const f_array_length_t amount, f_fll_idss_t *idss); +#endif // _di_f_type_fll_idss_decrease_by_ + +/** + * Increase the size of the string idss 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). + * 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 idss + * The string idss 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_type_fll_idss_increase_ + extern f_status_t f_type_fll_idss_increase(const uint16_t step, f_fll_idss_t *idss); +#endif // _di_f_type_fll_idss_increase_ + +/** + * Resize the string idss 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). + * 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 idss + * The string idss 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_type_fll_idss_increase_by_ + extern f_status_t f_type_fll_idss_increase_by(const f_array_length_t amount, f_fll_idss_t *idss); +#endif // _di_f_type_fll_idss_increase_by_ + +/** + * Resize the string idss array. + * + * @param length + * The new size to use. + * @param idss + * The string idss 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_type_fll_idss_resize_ + extern f_status_t f_type_fll_idss_resize(const f_array_length_t length, f_fll_idss_t *idss); +#endif // _di_f_type_fll_idss_resize_ + +/** * Resize the string lengths array. * * @param length diff --git a/level_1/fl_string/c/string.h b/level_1/fl_string/c/string.h index 60a5f8c..71ecad7 100644 --- a/level_1/fl_string/c/string.h +++ b/level_1/fl_string/c/string.h @@ -928,6 +928,8 @@ extern "C" { * * A valid FLL Identifier must terminate on either whitespace, EOL, or the stop point (length). * + * The id.name may not be NULL terminated and this function will skip over NULLs in the buffer when processing. + * * @param buffer * The string to process. * @param length @@ -946,6 +948,9 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if character is an invalid UTF-8 character. * + * Errors (with error bit) from: f_utf_is_whitespace(). + * Errors (with error bit) from: f_utf_is_word(). + * * @see isxdigit() * * @see f_utf_is_whitespace() diff --git a/level_3/controller/c/private-rule.c b/level_3/controller/c/private-rule.c index f65276d..c0778ba 100644 --- a/level_3/controller/c/private-rule.c +++ b/level_3/controller/c/private-rule.c @@ -4664,7 +4664,7 @@ extern "C" { for (j = 0; j < cache->content_actions.array[i].used; ++j) { - macro_f_array_lengths_t_increase_by(status, rule->groups, controller_common_allocation_small) + macro_f_int32s_t_increase_by(status, rule->groups, controller_common_allocation_small) if (F_status_is_error(status)) { controller_rule_error_print(global.main->error, cache->action, F_status_set_fine(status), "macro_f_array_lengths_t_increase_by", F_true, F_false, global.thread); -- 1.8.3.1