if (step && named->objects.used + 1 > named->objects.size) {
if (named->objects.used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- f_number_unsigned_t size = named->objects.used + step;
+ f_number_unsigned_t length = named->objects.used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (named->objects.used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_fss_named_resize(size, named);
+ return private_f_fss_named_resize(length, named);
}
return F_data_not;
if (step && nest->used + 1 > nest->size) {
if (nest->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- f_number_unsigned_t size = nest->used + step;
+ f_number_unsigned_t length = nest->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (nest->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_fss_nest_resize(size, nest);
+ return private_f_fss_nest_resize(length, nest);
}
return F_data_not;
if (step && nests->used + 1 > nests->size) {
if (nests->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- f_number_unsigned_t size = nests->used + step;
+ f_number_unsigned_t length = nests->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (nests->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_fss_nests_resize(size, nests);
+ return private_f_fss_nests_resize(length, nests);
}
return F_data_not;
if (step && set->objects.used + 1 > set->objects.size) {
if (set->objects.used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- f_number_unsigned_t size = set->objects.used + step;
+ f_number_unsigned_t length = set->objects.used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (set->objects.used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_fss_set_resize(size, set);
+ return private_f_fss_set_resize(length, set);
}
return F_data_not;
if (step && set_quote->objects.used + 1 > set_quote->objects.size) {
if (set_quote->objects.used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- f_number_unsigned_t size = set_quote->objects.used + step;
+ f_number_unsigned_t length = set_quote->objects.used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (set_quote->objects.used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_fss_set_quote_resize(size, set_quote);
+ return private_f_fss_set_quote_resize(length, set_quote);
}
return F_data_not;
if (step && datas->used + 1 > datas->size) {
if (datas->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- f_number_unsigned_t size = datas->used + step;
+ f_number_unsigned_t length = datas->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (datas->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_iki_datas_resize(size, datas);
+ return private_f_iki_datas_resize(length, datas);
}
return F_data_not;
if (step && datass->used + 1 > datass->size) {
if (datass->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- f_number_unsigned_t size = datass->used + step;
+ f_number_unsigned_t length = datass->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (datass->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_iki_datass_resize(size, datass);
+ return private_f_iki_datass_resize(length, datass);
}
return F_data_not;
#include "../memory.h"
+#include "../private-memory.h"
#include "private-array.h"
#ifdef __cplusplus
#if !defined(_di_f_memory_array_adjust_) || !defined(_di_f_memory_array_decimate_by_)
f_status_t private_f_memory_array_adjust(const f_number_unsigned_t length, const size_t width, void ** array, f_number_unsigned_t * const used, f_number_unsigned_t * const size) {
- const f_status_t status = f_memory_adjust(*size, length, width, array);
+ const f_status_t status = private_f_memory_adjust(*size, length, width, array);
if (F_status_is_error(status)) return status;
*size = length;
#if !defined(_di_f_memory_array_decrease_by_) || !defined(_di_f_memory_array_increase_) || !defined(_di_f_memory_array_increase_by_) || !defined(_di_f_memory_array_resize_)
f_status_t private_f_memory_array_resize(const f_number_unsigned_t length, const size_t width, void ** array, f_number_unsigned_t * const used, f_number_unsigned_t * const size) {
- const f_status_t status = f_memory_resize(*size, length, width, array);
+ const f_status_t status = private_f_memory_resize(*size, length, width, array);
if (F_status_is_error(status)) return status;
*size = length;
if (!step) return F_data_not;
if (dynamics->used + 1 > dynamics->size) {
- f_number_unsigned_t size = dynamics->used + step;
+ f_number_unsigned_t length = dynamics->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (dynamics->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_string_dynamics_resize(size, dynamics);
+ return private_f_string_dynamics_resize(length, dynamics);
}
return F_data_not;
if (!step) return F_data_not;
if (dynamicss->used + 1 > dynamicss->size) {
- f_number_unsigned_t size = dynamicss->used + step;
+ f_number_unsigned_t length = dynamicss->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (dynamicss->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_string_dynamicss_resize(size, dynamicss);
+ return private_f_string_dynamicss_resize(length, dynamicss);
}
return F_data_not;
#endif // _di_level_0_parameter_checking_
if (step && map_multis->used + 1 > map_multis->size) {
- f_number_unsigned_t size = map_multis->used + step;
+ f_number_unsigned_t length = map_multis->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (map_multis->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_string_map_multis_resize(size, map_multis);
+ return private_f_string_map_multis_resize(length, map_multis);
}
return F_data_not;
#endif // _di_level_0_parameter_checking_
if (step && map_multiss->used + 1 > map_multiss->size) {
- f_number_unsigned_t size = map_multiss->used + step;
+ f_number_unsigned_t length = map_multiss->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (map_multiss->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_string_map_multiss_resize(size, map_multiss);
+ return private_f_string_map_multiss_resize(length, map_multiss);
}
return F_data_not;
#endif // _di_level_0_parameter_checking_
if (step && maps->used + 1 > maps->size) {
- f_number_unsigned_t size = maps->used + step;
+ f_number_unsigned_t length = maps->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (maps->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_string_maps_resize(size, maps);
+ return private_f_string_maps_resize(length, maps);
}
return F_data_not;
#endif // _di_level_0_parameter_checking_
if (step && mapss->used + 1 > mapss->size) {
- f_number_unsigned_t size = mapss->used + step;
+ f_number_unsigned_t length = mapss->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (mapss->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_string_mapss_resize(size, mapss);
+ return private_f_string_mapss_resize(length, mapss);
}
return F_data_not;
#endif // _di_level_0_parameter_checking_
if (step && quantityss->used + 1 > quantityss->size) {
- f_number_unsigned_t size = quantityss->used + step;
+ f_number_unsigned_t length = quantityss->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (quantityss->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_string_quantityss_resize(size, quantityss);
+ return private_f_string_quantityss_resize(length, quantityss);
}
return F_data_not;
#endif // _di_level_0_parameter_checking_
if (step && rangess->used + 1 > rangess->size) {
- f_number_unsigned_t size = rangess->used + step;
+ f_number_unsigned_t length = rangess->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (rangess->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_string_rangess_resize(size, rangess);
+ return private_f_string_rangess_resize(length, rangess);
}
return F_data_not;
#endif // _di_level_0_parameter_checking_
if (step && triples->used + 1 > triples->size) {
- f_number_unsigned_t size = triples->used + F_memory_default_allocation_small_d;
+ f_number_unsigned_t length = triples->used + F_memory_default_allocation_small_d;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (triples->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_string_triples_resize(size, triples);
+ return private_f_string_triples_resize(length, triples);
}
return F_data_not;
#endif // _di_level_0_parameter_checking_
if (step && tripless->used + 1 > tripless->size) {
- f_number_unsigned_t size = tripless->used + step;
+ f_number_unsigned_t length = tripless->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (tripless->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_string_tripless_resize(size, tripless);
+ return private_f_string_tripless_resize(length, tripless);
}
return F_data_not;
#endif
#ifndef _di_f_thread_attributes_adjust_
- f_status_t f_thread_attributes_adjust(const f_number_unsigned_t length, f_thread_attributes_t * const attributes) {
+ f_status_t f_thread_attributes_adjust(const f_number_unsigned_t length, f_thread_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_attributes_adjust(length, attributes);
+ return private_f_thread_attributes_adjust(length, structure);
}
#endif // _di_f_thread_attributes_adjust_
#ifndef _di_f_thread_attributes_decimate_by_
- f_status_t f_thread_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_attributes_t * const attributes) {
+ f_status_t f_thread_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- return private_f_thread_attributes_adjust((attributes->size > amount) ? attributes->size - amount : 0, attributes);
+ return private_f_thread_attributes_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_attributes_decimate_by_
#ifndef _di_f_thread_attributes_decrease_by_
- f_status_t f_thread_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_attributes_t * const attributes) {
+ f_status_t f_thread_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- return private_f_thread_attributes_resize((attributes->size > amount) ? attributes->size - amount : 0, attributes);
+ return private_f_thread_attributes_resize((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_attributes_decrease_by_
#ifndef _di_f_thread_attributes_increase_
- f_status_t f_thread_attributes_increase(const f_number_unsigned_t step, f_thread_attributes_t * const attributes) {
+ f_status_t f_thread_attributes_increase(const f_number_unsigned_t step, f_thread_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && attributes->used + 1 > attributes->size) {
- f_number_unsigned_t size = attributes->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (attributes->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_thread_attributes_resize(size, attributes);
+ return private_f_thread_attributes_resize(length, structure);
}
return F_data_not;
#endif // _di_f_thread_attributes_increase_
#ifndef _di_f_thread_attributes_increase_by_
- f_status_t f_thread_attributes_increase_by(const f_number_unsigned_t amount, f_thread_attributes_t * const attributes) {
+ f_status_t f_thread_attributes_increase_by(const f_number_unsigned_t amount, f_thread_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (amount) {
- if (attributes->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- const f_number_unsigned_t length = attributes->used + amount;
+ const f_number_unsigned_t length = structure->used + amount;
- if (length > attributes->size) {
+ if (length > structure->size) {
if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- return private_f_thread_attributes_resize(length, attributes);
+ return private_f_thread_attributes_resize(length, structure);
}
}
#endif // _di_f_thread_attributes_increase_by_
#ifndef _di_f_thread_attributes_resize_
- f_status_t f_thread_attributes_resize(const f_number_unsigned_t length, f_thread_attributes_t * const attributes) {
+ f_status_t f_thread_attributes_resize(const f_number_unsigned_t length, f_thread_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_attributes_resize(length, attributes);
+ return private_f_thread_attributes_resize(length, structure);
}
#endif // _di_f_thread_attributes_resize_
*
* @param length
* The new size to use.
- * @param attributes
- * The string attributes array to resize.
+ * @param structure
+ * The thread attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_attributes_adjust_
- extern f_status_t f_thread_attributes_adjust(const f_number_unsigned_t length, f_thread_attributes_t * const attributes);
+ extern f_status_t f_thread_attributes_adjust(const f_number_unsigned_t length, f_thread_attributes_t * const structure);
#endif // _di_f_thread_attributes_adjust_
/**
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param attributes
- * The string attributes array to resize.
+ * @param structure
+ * The thread attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_attributes_decimate_by_
- extern f_status_t f_thread_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_attributes_t * const attributes);
+ extern f_status_t f_thread_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_attributes_t * const structure);
#endif // _di_f_thread_attributes_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param attributes
- * The string attributes array to resize.
+ * @param structure
+ * The thread attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_attributes_decrease_by_
- extern f_status_t f_thread_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_attributes_t * const attributes);
+ extern f_status_t f_thread_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_attributes_t * const structure);
#endif // _di_f_thread_attributes_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param attributes
- * The string attributes array to resize.
+ * @param structure
+ * The thread attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_attributes_increase_
- extern f_status_t f_thread_attributes_increase(const f_number_unsigned_t step, f_thread_attributes_t * const attributes);
+ extern f_status_t f_thread_attributes_increase(const f_number_unsigned_t step, f_thread_attributes_t * const structure);
#endif // _di_f_thread_attributes_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param attributes
- * The string attributes array to resize.
+ * @param structure
+ * The thread attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_attributes_increase_by_
- extern f_status_t f_thread_attributes_increase_by(const f_number_unsigned_t amount, f_thread_attributes_t * const attributes);
+ extern f_status_t f_thread_attributes_increase_by(const f_number_unsigned_t amount, f_thread_attributes_t * const structure);
#endif // _di_f_thread_attributes_increase_by_
/**
*
* @param length
* The new size to use.
- * @param attributes
- * The string attributes array to adjust.
+ * @param structure
+ * The thread attributes array to adjust.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_attributes_resize_
- extern f_status_t f_thread_attributes_resize(const f_number_unsigned_t length, f_thread_attributes_t * const attributes);
+ extern f_status_t f_thread_attributes_resize(const f_number_unsigned_t length, f_thread_attributes_t * const structure);
#endif // _di_f_thread_attributes_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_thread_barriers_adjust_
- f_status_t f_thread_barriers_adjust(const f_number_unsigned_t length, f_thread_barriers_t * const barriers) {
+ f_status_t f_thread_barriers_adjust(const f_number_unsigned_t length, f_thread_barriers_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!barriers) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_barriers_adjust(length, barriers);
+ return private_f_thread_barriers_adjust(length, structure);
}
#endif // _di_f_thread_barriers_adjust_
#ifndef _di_f_thread_barriers_decimate_by_
- f_status_t f_thread_barriers_decimate_by(const f_number_unsigned_t amount, f_thread_barriers_t * const barriers) {
+ f_status_t f_thread_barriers_decimate_by(const f_number_unsigned_t amount, f_thread_barriers_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!barriers) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (barriers->size > amount) {
- return private_f_thread_barriers_adjust(barriers->size - amount, barriers);
- }
-
- return private_f_thread_barriers_adjust(0, barriers);
+ return private_f_thread_barriers_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_barriers_decimate_by_
#ifndef _di_f_thread_barriers_decrease_by_
- f_status_t f_thread_barriers_decrease_by(const f_number_unsigned_t amount, f_thread_barriers_t * const barriers) {
+ f_status_t f_thread_barriers_decrease_by(const f_number_unsigned_t amount, f_thread_barriers_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!barriers) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (barriers->size > amount) {
- return private_f_thread_barriers_resize(barriers->size - amount, barriers);
- }
-
- return private_f_thread_barriers_resize(0, barriers);
+ return private_f_thread_barriers_resize((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_barriers_decrease_by_
#ifndef _di_f_thread_barriers_increase_
- f_status_t f_thread_barriers_increase(const f_number_unsigned_t step, f_thread_barriers_t * const barriers) {
+ f_status_t f_thread_barriers_increase(const f_number_unsigned_t step, f_thread_barriers_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!barriers) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && barriers->used + 1 > barriers->size) {
- f_number_unsigned_t size = barriers->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (barriers->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_thread_barriers_resize(size, barriers);
+ return private_f_thread_barriers_resize(length, structure);
}
return F_data_not;
#endif // _di_f_thread_barriers_increase_
#ifndef _di_f_thread_barriers_increase_by_
- f_status_t f_thread_barriers_increase_by(const f_number_unsigned_t amount, f_thread_barriers_t * const barriers) {
+ f_status_t f_thread_barriers_increase_by(const f_number_unsigned_t amount, f_thread_barriers_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!barriers) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (amount) {
- if (barriers->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- const f_number_unsigned_t length = barriers->used + amount;
+ const f_number_unsigned_t length = structure->used + amount;
- if (length > barriers->size) {
+ if (length > structure->size) {
if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- return private_f_thread_barriers_resize(barriers->used + amount, barriers);
+ return private_f_thread_barriers_resize(length, structure);
}
}
#endif // _di_f_thread_barriers_increase_by_
#ifndef _di_f_thread_barriers_resize_
- f_status_t f_thread_barriers_resize(const f_number_unsigned_t length, f_thread_barriers_t * const barriers) {
+ f_status_t f_thread_barriers_resize(const f_number_unsigned_t length, f_thread_barriers_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!barriers) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_barriers_resize(length, barriers);
+ return private_f_thread_barriers_resize(length, structure);
}
#endif // _di_f_thread_barriers_resize_
*
* @param length
* The new size to use.
- * @param barriers
+ * @param structure
* The thread barriers array to resize.
*
* @return
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_barriers_adjust_
- extern f_status_t f_thread_barriers_adjust(const f_number_unsigned_t length, f_thread_barriers_t * const barriers);
+ extern f_status_t f_thread_barriers_adjust(const f_number_unsigned_t length, f_thread_barriers_t * const structure);
#endif // _di_f_thread_barriers_adjust_
/**
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param barriers
+ * @param structure
* The thread barriers array to resize.
*
* @return
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_barriers_decimate_by_
- extern f_status_t f_thread_barriers_decimate_by(const f_number_unsigned_t amount, f_thread_barriers_t * const barriers);
+ extern f_status_t f_thread_barriers_decimate_by(const f_number_unsigned_t amount, f_thread_barriers_t * const structure);
#endif // _di_f_thread_barriers_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param barriers
+ * @param structure
* The thread barriers array to resize.
*
* @return
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_barriers_decrease_by_
- extern f_status_t f_thread_barriers_decrease_by(const f_number_unsigned_t amount, f_thread_barriers_t * const barriers);
+ extern f_status_t f_thread_barriers_decrease_by(const f_number_unsigned_t amount, f_thread_barriers_t * const structure);
#endif // _di_f_thread_barriers_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param barriers
+ * @param structure
* The thread barriers array to resize.
*
* @return
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_barriers_increase_
- extern f_status_t f_thread_barriers_increase(const f_number_unsigned_t step, f_thread_barriers_t * const barriers);
+ extern f_status_t f_thread_barriers_increase(const f_number_unsigned_t step, f_thread_barriers_t * const structure);
#endif // _di_f_thread_barriers_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param barriers
+ * @param structure
* The thread barriers array to resize.
*
* @return
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_barriers_increase_by_
- extern f_status_t f_thread_barriers_increase_by(const f_number_unsigned_t amount, f_thread_barriers_t * const barriers);
+ extern f_status_t f_thread_barriers_increase_by(const f_number_unsigned_t amount, f_thread_barriers_t * const structure);
#endif // _di_f_thread_barriers_increase_by_
/**
*
* @param length
* The new size to use.
- * @param barriers
+ * @param structure
* The thread barriers array to adjust.
*
* @return
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_barriers_resize_
- extern f_status_t f_thread_barriers_resize(const f_number_unsigned_t length, f_thread_barriers_t * const barriers);
+ extern f_status_t f_thread_barriers_resize(const f_number_unsigned_t length, f_thread_barriers_t * const structure);
#endif // _di_f_thread_barriers_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_thread_barrier_attributes_adjust_
- f_status_t f_thread_barrier_attributes_adjust(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const attributes) {
+ f_status_t f_thread_barrier_attributes_adjust(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_barrier_attributes_adjust(length, attributes);
+ return private_f_thread_barrier_attributes_adjust(length, structure);
}
#endif // _di_f_thread_barrier_attributes_adjust_
#ifndef _di_f_thread_barrier_attributes_decimate_by_
- f_status_t f_thread_barrier_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_barrier_attributes_t * const attributes) {
+ f_status_t f_thread_barrier_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_barrier_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (attributes->size > amount) {
- return private_f_thread_barrier_attributes_adjust(attributes->size - amount, attributes);
- }
-
- return private_f_thread_barrier_attributes_adjust(0, attributes);
+ return private_f_thread_barrier_attributes_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_barrier_attributes_decimate_by_
#ifndef _di_f_thread_barrier_attributes_decrease_by_
- f_status_t f_thread_barrier_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_barrier_attributes_t * const attributes) {
+ f_status_t f_thread_barrier_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_barrier_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (attributes->size > amount) {
- return private_f_thread_barrier_attributes_resize(attributes->size - amount, attributes);
- }
-
- return private_f_thread_barrier_attributes_resize(0, attributes);
+ return private_f_thread_barrier_attributes_resize((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_barrier_attributes_decrease_by_
#ifndef _di_f_thread_barrier_attributes_increase_
- f_status_t f_thread_barrier_attributes_increase(const f_number_unsigned_t step, f_thread_barrier_attributes_t * const attributes) {
+ f_status_t f_thread_barrier_attributes_increase(const f_number_unsigned_t step, f_thread_barrier_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && attributes->used + 1 > attributes->size) {
- f_number_unsigned_t size = attributes->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (attributes->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_thread_barrier_attributes_resize(size, attributes);
+ return private_f_thread_barrier_attributes_resize(length, structure);
}
return F_data_not;
#endif // _di_f_thread_barrier_attributes_increase_
#ifndef _di_f_thread_barrier_attributes_increase_by_
- f_status_t f_thread_barrier_attributes_increase_by(const f_number_unsigned_t amount, f_thread_barrier_attributes_t * const attributes) {
+ f_status_t f_thread_barrier_attributes_increase_by(const f_number_unsigned_t amount, f_thread_barrier_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (amount) {
- if (attributes->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- const f_number_unsigned_t length = attributes->used + amount;
+ const f_number_unsigned_t length = structure->used + amount;
- if (length > attributes->size) {
+ if (length > structure->size) {
if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- return private_f_thread_barrier_attributes_resize(attributes->used + amount, attributes);
+ return private_f_thread_barrier_attributes_resize(length, structure);
}
}
#endif // _di_f_thread_barrier_attributes_increase_by_
#ifndef _di_f_thread_barrier_attributes_resize_
- f_status_t f_thread_barrier_attributes_resize(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const attributes) {
+ f_status_t f_thread_barrier_attributes_resize(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_barrier_attributes_resize(length, attributes);
+ return private_f_thread_barrier_attributes_resize(length, structure);
}
#endif // _di_f_thread_barrier_attributes_resize_
#endif // _di_f_thread_barrier_attributes_t_
/**
- * Resize the thread barrier attributes array.
+ * Resize the thread barrier_attributes array.
*
* @param length
* The new size to use.
- * @param attributes
- * The thread attributes array to resize.
+ * @param structure
+ * The thread barrier_attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_barrier_attributes_adjust_
- extern f_status_t f_thread_barrier_attributes_adjust(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const attributes);
+ extern f_status_t f_thread_barrier_attributes_adjust(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const structure);
#endif // _di_f_thread_barrier_attributes_adjust_
/**
- * Resize the thread barrier attributes array to a smaller size.
+ * Resize the thread barrier_attributes array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param attributes
- * The thread attributes array to resize.
+ * @param structure
+ * The thread barrier_attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_barrier_attributes_decimate_by_
- extern f_status_t f_thread_barrier_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_barrier_attributes_t * const attributes);
+ extern f_status_t f_thread_barrier_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_barrier_attributes_t * const structure);
#endif // _di_f_thread_barrier_attributes_decimate_by_
/**
- * Resize the thread barrier attributes array to a smaller size.
+ * Resize the thread barrier_attributes array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param attributes
- * The thread attributes array to resize.
+ * @param structure
+ * The thread barrier_attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_barrier_attributes_decrease_by_
- extern f_status_t f_thread_barrier_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_barrier_attributes_t * const attributes);
+ extern f_status_t f_thread_barrier_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_barrier_attributes_t * const structure);
#endif // _di_f_thread_barrier_attributes_decrease_by_
/**
- * Increase the size of the thread barrier attributes array, but only if necessary.
+ * Increase the size of the thread barrier_attributes array, but only if necessary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param attributes
- * The thread attributes array to resize.
+ * @param structure
+ * The thread barrier_attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_barrier_attributes_increase_
- extern f_status_t f_thread_barrier_attributes_increase(const f_number_unsigned_t step, f_thread_barrier_attributes_t * const attributes);
+ extern f_status_t f_thread_barrier_attributes_increase(const f_number_unsigned_t step, f_thread_barrier_attributes_t * const structure);
#endif // _di_f_thread_barrier_attributes_increase_
/**
- * Resize the thread barrier attributes array to a larger size.
+ * Resize the thread barrier_attributes array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param attributes
- * The thread attributes array to resize.
+ * @param structure
+ * The thread barrier_attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_barrier_attributes_increase_by_
- extern f_status_t f_thread_barrier_attributes_increase_by(const f_number_unsigned_t amount, f_thread_barrier_attributes_t * const attributes);
+ extern f_status_t f_thread_barrier_attributes_increase_by(const f_number_unsigned_t amount, f_thread_barrier_attributes_t * const structure);
#endif // _di_f_thread_barrier_attributes_increase_by_
/**
- * Resize the thread barrier attributes array.
+ * Resize the thread barrier_attributes array.
*
* @param length
* The new size to use.
- * @param attributes
- * The thread attributes array to adjust.
+ * @param structure
+ * The thread barrier_attributes array to adjust.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_barrier_attributes_resize_
- extern f_status_t f_thread_barrier_attributes_resize(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const attributes);
+ extern f_status_t f_thread_barrier_attributes_resize(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const structure);
#endif // _di_f_thread_barrier_attributes_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_thread_conditions_adjust_
- f_status_t f_thread_conditions_adjust(const f_number_unsigned_t length, f_thread_conditions_t * const conditions) {
+ f_status_t f_thread_conditions_adjust(const f_number_unsigned_t length, f_thread_conditions_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!conditions) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_conditions_adjust(length, conditions);
+ return private_f_thread_conditions_adjust(length, structure);
}
#endif // _di_f_thread_conditions_adjust_
#ifndef _di_f_thread_conditions_decimate_by_
- f_status_t f_thread_conditions_decimate_by(const f_number_unsigned_t amount, f_thread_conditions_t * const conditions) {
+ f_status_t f_thread_conditions_decimate_by(const f_number_unsigned_t amount, f_thread_conditions_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!conditions) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (conditions->size > amount) {
- return private_f_thread_conditions_adjust(conditions->size - amount, conditions);
- }
-
- return private_f_thread_conditions_adjust(0, conditions);
+ return private_f_thread_conditions_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_conditions_decimate_by_
#ifndef _di_f_thread_conditions_decrease_by_
- f_status_t f_thread_conditions_decrease_by(const f_number_unsigned_t amount, f_thread_conditions_t * const conditions) {
+ f_status_t f_thread_conditions_decrease_by(const f_number_unsigned_t amount, f_thread_conditions_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!conditions) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (conditions->size > amount) {
- return private_f_thread_conditions_resize(conditions->size - amount, conditions);
- }
-
- return private_f_thread_conditions_resize(0, conditions);
+ return private_f_thread_conditions_resize((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_conditions_decrease_by_
#ifndef _di_f_thread_conditions_increase_
- f_status_t f_thread_conditions_increase(const f_number_unsigned_t step, f_thread_conditions_t * const conditions) {
+ f_status_t f_thread_conditions_increase(const f_number_unsigned_t step, f_thread_conditions_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!conditions) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && conditions->used + 1 > conditions->size) {
- f_number_unsigned_t size = conditions->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (conditions->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_thread_conditions_resize(size, conditions);
+ return private_f_thread_conditions_resize(length, structure);
}
return F_data_not;
#endif // _di_f_thread_conditions_increase_
#ifndef _di_f_thread_conditions_increase_by_
- f_status_t f_thread_conditions_increase_by(const f_number_unsigned_t amount, f_thread_conditions_t * const conditions) {
+ f_status_t f_thread_conditions_increase_by(const f_number_unsigned_t amount, f_thread_conditions_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!conditions) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (amount) {
- if (conditions->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- const f_number_unsigned_t length = conditions->used + amount;
+ const f_number_unsigned_t length = structure->used + amount;
- if (length > conditions->size) {
+ if (length > structure->size) {
if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- return private_f_thread_conditions_resize(conditions->used + amount, conditions);
+ return private_f_thread_conditions_resize(length, structure);
}
}
#endif // _di_f_thread_conditions_increase_by_
#ifndef _di_f_thread_conditions_resize_
- f_status_t f_thread_conditions_resize(const f_number_unsigned_t length, f_thread_conditions_t * const conditions) {
+ f_status_t f_thread_conditions_resize(const f_number_unsigned_t length, f_thread_conditions_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!conditions) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_conditions_resize(length, conditions);
+ return private_f_thread_conditions_resize(length, structure);
}
#endif // _di_f_thread_conditions_resize_
*
* @param length
* The new size to use.
- * @param conditions
- * The string conditions array to resize.
+ * @param structure
+ * The thread conditions array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_conditions_adjust_
- extern f_status_t f_thread_conditions_adjust(const f_number_unsigned_t length, f_thread_conditions_t * const conditions);
+ extern f_status_t f_thread_conditions_adjust(const f_number_unsigned_t length, f_thread_conditions_t * const structure);
#endif // _di_f_thread_conditions_adjust_
/**
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param conditions
- * The string conditions array to resize.
+ * @param structure
+ * The thread conditions array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_conditions_decimate_by_
- extern f_status_t f_thread_conditions_decimate_by(const f_number_unsigned_t amount, f_thread_conditions_t * const conditions);
+ extern f_status_t f_thread_conditions_decimate_by(const f_number_unsigned_t amount, f_thread_conditions_t * const structure);
#endif // _di_f_thread_conditions_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param conditions
- * The string conditions array to resize.
+ * @param structure
+ * The thread conditions array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_conditions_decrease_by_
- extern f_status_t f_thread_conditions_decrease_by(const f_number_unsigned_t amount, f_thread_conditions_t * const conditions);
+ extern f_status_t f_thread_conditions_decrease_by(const f_number_unsigned_t amount, f_thread_conditions_t * const structure);
#endif // _di_f_thread_conditions_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param conditions
- * The string conditions array to resize.
+ * @param structure
+ * The thread conditions array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_conditions_increase_
- extern f_status_t f_thread_conditions_increase(const f_number_unsigned_t step, f_thread_conditions_t * const conditions);
+ extern f_status_t f_thread_conditions_increase(const f_number_unsigned_t step, f_thread_conditions_t * const structure);
#endif // _di_f_thread_conditions_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param conditions
- * The string conditions array to resize.
+ * @param structure
+ * The thread conditions array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_conditions_increase_by_
- extern f_status_t f_thread_conditions_increase_by(const f_number_unsigned_t amount, f_thread_conditions_t * const conditions);
+ extern f_status_t f_thread_conditions_increase_by(const f_number_unsigned_t amount, f_thread_conditions_t * const structure);
#endif // _di_f_thread_conditions_increase_by_
/**
*
* @param length
* The new size to use.
- * @param conditions
- * The string conditions array to adjust.
+ * @param structure
+ * The thread conditions array to adjust.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_conditions_resize_
- extern f_status_t f_thread_conditions_resize(const f_number_unsigned_t length, f_thread_conditions_t * const conditions);
+ extern f_status_t f_thread_conditions_resize(const f_number_unsigned_t length, f_thread_conditions_t * const structure);
#endif // _di_f_thread_conditions_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_thread_condition_attributes_adjust_
- f_status_t f_thread_condition_attributes_adjust(const f_number_unsigned_t length, f_thread_condition_attributes_t * const attributes) {
+ f_status_t f_thread_condition_attributes_adjust(const f_number_unsigned_t length, f_thread_condition_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_condition_attributes_adjust(length, attributes);
+ return private_f_thread_condition_attributes_adjust(length, structure);
}
#endif // _di_f_thread_condition_attributes_adjust_
#ifndef _di_f_thread_condition_attributes_decimate_by_
- f_status_t f_thread_condition_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_condition_attributes_t * const attributes) {
+ f_status_t f_thread_condition_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_condition_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (attributes->size > amount) {
- return private_f_thread_condition_attributes_adjust(attributes->size - amount, attributes);
- }
-
- return private_f_thread_condition_attributes_adjust(0, attributes);
+ return private_f_thread_condition_attributes_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_condition_attributes_decimate_by_
#ifndef _di_f_thread_condition_attributes_decrease_by_
- f_status_t f_thread_condition_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_condition_attributes_t * const attributes) {
+ f_status_t f_thread_condition_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_condition_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (attributes->size > amount) {
- return private_f_thread_condition_attributes_resize(attributes->size - amount, attributes);
- }
-
- return private_f_thread_condition_attributes_resize(0, attributes);
+ return private_f_thread_condition_attributes_resize((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_condition_attributes_decrease_by_
#ifndef _di_f_thread_condition_attributes_increase_
- f_status_t f_thread_condition_attributes_increase(const f_number_unsigned_t step, f_thread_condition_attributes_t * const attributes) {
+ f_status_t f_thread_condition_attributes_increase(const f_number_unsigned_t step, f_thread_condition_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && attributes->used + 1 > attributes->size) {
- f_number_unsigned_t size = attributes->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (attributes->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_thread_condition_attributes_resize(size, attributes);
+ return private_f_thread_condition_attributes_resize(length, structure);
}
return F_data_not;
#endif // _di_f_thread_condition_attributes_increase_
#ifndef _di_f_thread_condition_attributes_increase_by_
- f_status_t f_thread_condition_attributes_increase_by(const f_number_unsigned_t amount, f_thread_condition_attributes_t * const attributes) {
+ f_status_t f_thread_condition_attributes_increase_by(const f_number_unsigned_t amount, f_thread_condition_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (amount) {
- if (attributes->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- const f_number_unsigned_t length = attributes->used + amount;
+ const f_number_unsigned_t length = structure->used + amount;
- if (length > attributes->size) {
+ if (length > structure->size) {
if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- return private_f_thread_condition_attributes_resize(attributes->used + amount, attributes);
+ return private_f_thread_condition_attributes_resize(length, structure);
}
}
#endif // _di_f_thread_condition_attributes_increase_by_
#ifndef _di_f_thread_condition_attributes_resize_
- f_status_t f_thread_condition_attributes_resize(const f_number_unsigned_t length, f_thread_condition_attributes_t * const attributes) {
+ f_status_t f_thread_condition_attributes_resize(const f_number_unsigned_t length, f_thread_condition_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_condition_attributes_resize(length, attributes);
+ return private_f_thread_condition_attributes_resize(length, structure);
}
#endif // _di_f_thread_condition_attributes_resize_
#endif // _di_f_thread_condition_attributes_t_
/**
- * Resize the thread attributes array.
+ * Resize the thread condition_attributes array.
*
* @param length
* The new size to use.
- * @param attributes
- * The string attributes array to resize.
+ * @param structure
+ * The thread condition_attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_condition_attributes_adjust_
- extern f_status_t f_thread_condition_attributes_adjust(const f_number_unsigned_t length, f_thread_condition_attributes_t * const attributes);
+ extern f_status_t f_thread_condition_attributes_adjust(const f_number_unsigned_t length, f_thread_condition_attributes_t * const structure);
#endif // _di_f_thread_condition_attributes_adjust_
/**
- * Resize the thread attributes array to a smaller size.
+ * Resize the thread condition_attributes array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param attributes
- * The string attributes array to resize.
+ * @param structure
+ * The thread condition_attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_condition_attributes_decimate_by_
- extern f_status_t f_thread_condition_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_condition_attributes_t * const attributes);
+ extern f_status_t f_thread_condition_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_condition_attributes_t * const structure);
#endif // _di_f_thread_condition_attributes_decimate_by_
/**
- * Resize the thread attributes array to a smaller size.
+ * Resize the thread condition_attributes array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param attributes
- * The string attributes array to resize.
+ * @param structure
+ * The thread condition_attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_condition_attributes_decrease_by_
- extern f_status_t f_thread_condition_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_condition_attributes_t * const attributes);
+ extern f_status_t f_thread_condition_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_condition_attributes_t * const structure);
#endif // _di_f_thread_condition_attributes_decrease_by_
/**
- * Increase the size of the thread attributes array, but only if necessary.
+ * Increase the size of the thread condition_attributes array, but only if necessary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param attributes
- * The string attributes array to resize.
+ * @param structure
+ * The thread condition_attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_condition_attributes_increase_
- extern f_status_t f_thread_condition_attributes_increase(const f_number_unsigned_t step, f_thread_condition_attributes_t * const attributes);
+ extern f_status_t f_thread_condition_attributes_increase(const f_number_unsigned_t step, f_thread_condition_attributes_t * const structure);
#endif // _di_f_thread_condition_attributes_increase_
/**
- * Resize the thread attributes array to a larger size.
+ * Resize the thread condition_attributes array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param attributes
- * The string attributes array to resize.
+ * @param structure
+ * The thread condition_attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_condition_attributes_increase_by_
- extern f_status_t f_thread_condition_attributes_increase_by(const f_number_unsigned_t amount, f_thread_condition_attributes_t * const attributes);
+ extern f_status_t f_thread_condition_attributes_increase_by(const f_number_unsigned_t amount, f_thread_condition_attributes_t * const structure);
#endif // _di_f_thread_condition_attributes_increase_by_
/**
- * Resize the thread attributes array.
+ * Resize the thread condition_attributes array.
*
* @param length
* The new size to use.
- * @param attributes
- * The string attributes array to adjust.
+ * @param structure
+ * The thread condition_attributes array to adjust.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_condition_attributes_resize_
- extern f_status_t f_thread_condition_attributes_resize(const f_number_unsigned_t length, f_thread_condition_attributes_t * const attributes);
+ extern f_status_t f_thread_condition_attributes_resize(const f_number_unsigned_t length, f_thread_condition_attributes_t * const structure);
#endif // _di_f_thread_condition_attributes_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_thread_ids_adjust_
- f_status_t f_thread_ids_adjust(const f_number_unsigned_t length, f_thread_ids_t * const ids) {
+ f_status_t f_thread_ids_adjust(const f_number_unsigned_t length, f_thread_ids_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!ids) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_ids_adjust(length, ids);
+ return f_memory_array_adjust(length, sizeof(f_thread_id_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_thread_ids_adjust_
#ifndef _di_f_thread_ids_decimate_by_
- f_status_t f_thread_ids_decimate_by(const f_number_unsigned_t amount, f_thread_ids_t * const ids) {
+ f_status_t f_thread_ids_decimate_by(const f_number_unsigned_t amount, f_thread_ids_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!ids) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (ids->size > amount) {
- return private_f_thread_ids_adjust(ids->size - amount, ids);
- }
-
- return private_f_thread_ids_adjust(0, ids);
+ return f_memory_array_decrease_by(amount, sizeof(f_thread_id_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_thread_ids_decimate_by_
#ifndef _di_f_thread_ids_decrease_by_
- f_status_t f_thread_ids_decrease_by(const f_number_unsigned_t amount, f_thread_ids_t * const ids) {
+ f_status_t f_thread_ids_decrease_by(const f_number_unsigned_t amount, f_thread_ids_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!ids) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (ids->size > amount) {
- return private_f_thread_ids_resize(ids->size - amount, ids);
- }
-
- return private_f_thread_ids_resize(0, ids);
+ return f_memory_array_decrease_by(amount, sizeof(f_thread_id_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_thread_ids_decrease_by_
#ifndef _di_f_thread_ids_increase_
- f_status_t f_thread_ids_increase(const f_number_unsigned_t step, f_thread_ids_t * const ids) {
+ f_status_t f_thread_ids_increase(const f_number_unsigned_t step, f_thread_ids_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!ids) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && ids->used + 1 > ids->size) {
- f_number_unsigned_t size = ids->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (ids->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_thread_ids_resize(size, ids);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(f_thread_id_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_thread_ids_increase_
#ifndef _di_f_thread_ids_increase_by_
- f_status_t f_thread_ids_increase_by(const f_number_unsigned_t amount, f_thread_ids_t * const ids) {
+ f_status_t f_thread_ids_increase_by(const f_number_unsigned_t amount, f_thread_ids_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!ids) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (amount) {
- if (ids->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
- const f_number_unsigned_t length = ids->used + amount;
-
- if (length > ids->size) {
- if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
- return private_f_thread_ids_resize(length, ids);
- }
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(f_thread_id_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_thread_ids_increase_by_
#ifndef _di_f_thread_ids_resize_
- f_status_t f_thread_ids_resize(const f_number_unsigned_t length, f_thread_ids_t * const ids) {
+ f_status_t f_thread_ids_resize(const f_number_unsigned_t length, f_thread_ids_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!ids) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_ids_resize(length, ids);
+ return f_memory_array_resize(length, sizeof(f_thread_id_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_thread_ids_resize_
*
* @param length
* The new size to use.
- * @param ids
+ * @param structure
* The thread ids array to resize.
*
* @return
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_ids_adjust_
- extern f_status_t f_thread_ids_adjust(const f_number_unsigned_t length, f_thread_ids_t * const ids);
+ extern f_status_t f_thread_ids_adjust(const f_number_unsigned_t length, f_thread_ids_t * const structure);
#endif // _di_f_thread_ids_adjust_
/**
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param ids
+ * @param structure
* The thread ids array to resize.
*
* @return
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_ids_decimate_by_
- extern f_status_t f_thread_ids_decimate_by(const f_number_unsigned_t amount, f_thread_ids_t * const ids);
+ extern f_status_t f_thread_ids_decimate_by(const f_number_unsigned_t amount, f_thread_ids_t * const structure);
#endif // _di_f_thread_ids_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param ids
+ * @param structure
* The thread ids array to resize.
*
* @return
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_ids_decrease_by_
- extern f_status_t f_thread_ids_decrease_by(const f_number_unsigned_t amount, f_thread_ids_t * const ids);
+ extern f_status_t f_thread_ids_decrease_by(const f_number_unsigned_t amount, f_thread_ids_t * const structure);
#endif // _di_f_thread_ids_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param ids
+ * @param structure
* The thread ids array to resize.
*
* @return
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_ids_increase_
- extern f_status_t f_thread_ids_increase(const f_number_unsigned_t step, f_thread_ids_t * const ids);
+ extern f_status_t f_thread_ids_increase(const f_number_unsigned_t step, f_thread_ids_t * const structure);
#endif // _di_f_thread_ids_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param ids
+ * @param structure
* The thread ids array to resize.
*
* @return
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_ids_increase_by_
- extern f_status_t f_thread_ids_increase_by(const f_number_unsigned_t amount, f_thread_ids_t * const ids);
+ extern f_status_t f_thread_ids_increase_by(const f_number_unsigned_t amount, f_thread_ids_t * const structure);
#endif // _di_f_thread_ids_increase_by_
/**
*
* @param length
* The new size to use.
- * @param ids
+ * @param structure
* The thread ids array to adjust.
*
* @return
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_ids_resize_
- extern f_status_t f_thread_ids_resize(const f_number_unsigned_t length, f_thread_ids_t * const ids);
+ extern f_status_t f_thread_ids_resize(const f_number_unsigned_t length, f_thread_ids_t * const structure);
#endif // _di_f_thread_ids_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_thread_keys_adjust_
- f_status_t f_thread_keys_adjust(const f_number_unsigned_t length, f_thread_keys_t * const keys) {
+ f_status_t f_thread_keys_adjust(const f_number_unsigned_t length, f_thread_keys_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!keys) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_keys_adjust(length, keys);
+ return private_f_thread_keys_adjust(length, structure);
}
#endif // _di_f_thread_keys_adjust_
#ifndef _di_f_thread_keys_decimate_by_
- f_status_t f_thread_keys_decimate_by(const f_number_unsigned_t amount, f_thread_keys_t * const keys) {
+ f_status_t f_thread_keys_decimate_by(const f_number_unsigned_t amount, f_thread_keys_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!keys) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (keys->size > amount) {
- return private_f_thread_keys_adjust(keys->size - amount, keys);
- }
-
- return private_f_thread_keys_adjust(0, keys);
+ return private_f_thread_keys_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_keys_decimate_by_
#ifndef _di_f_thread_keys_decrease_by_
- f_status_t f_thread_keys_decrease_by(const f_number_unsigned_t amount, f_thread_keys_t * const keys) {
+ f_status_t f_thread_keys_decrease_by(const f_number_unsigned_t amount, f_thread_keys_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!keys) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (keys->size > amount) {
- return private_f_thread_keys_resize(keys->size - amount, keys);
- }
-
- return private_f_thread_keys_resize(0, keys);
+ return private_f_thread_keys_resize((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_keys_decrease_by_
#ifndef _di_f_thread_keys_increase_
- f_status_t f_thread_keys_increase(const f_number_unsigned_t step, f_thread_keys_t * const keys) {
+ f_status_t f_thread_keys_increase(const f_number_unsigned_t step, f_thread_keys_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!keys) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && keys->used + 1 > keys->size) {
- f_number_unsigned_t size = keys->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (keys->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_thread_keys_resize(size, keys);
+ return private_f_thread_keys_resize(length, structure);
}
return F_data_not;
#endif // _di_f_thread_keys_increase_
#ifndef _di_f_thread_keys_increase_by_
- f_status_t f_thread_keys_increase_by(const f_number_unsigned_t amount, f_thread_keys_t * const keys) {
+ f_status_t f_thread_keys_increase_by(const f_number_unsigned_t amount, f_thread_keys_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!keys) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (amount) {
- if (keys->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- const f_number_unsigned_t length = keys->used + amount;
+ const f_number_unsigned_t length = structure->used + amount;
- if (length > keys->size) {
+ if (length > structure->size) {
if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- return private_f_thread_keys_resize(length, keys);
+ return private_f_thread_keys_resize(length, structure);
}
}
#endif // _di_f_thread_keys_increase_by_
#ifndef _di_f_thread_keys_resize_
- f_status_t f_thread_keys_resize(const f_number_unsigned_t length, f_thread_keys_t * const keys) {
+ f_status_t f_thread_keys_resize(const f_number_unsigned_t length, f_thread_keys_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!keys) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_keys_resize(length, keys);
+ return private_f_thread_keys_resize(length, structure);
}
#endif // _di_f_thread_keys_resize_
*
* @param length
* The new size to use.
- * @param keys
- * The string keys array to resize.
+ * @param structure
+ * The thread keys array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_keys_adjust_
- extern f_status_t f_thread_keys_adjust(const f_number_unsigned_t length, f_thread_keys_t * const keys);
+ extern f_status_t f_thread_keys_adjust(const f_number_unsigned_t length, f_thread_keys_t * const structure);
#endif // _di_f_thread_keys_adjust_
/**
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param keys
- * The string keys array to resize.
+ * @param structure
+ * The thread keys array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_keys_decimate_by_
- extern f_status_t f_thread_keys_decimate_by(const f_number_unsigned_t amount, f_thread_keys_t * const keys);
+ extern f_status_t f_thread_keys_decimate_by(const f_number_unsigned_t amount, f_thread_keys_t * const structure);
#endif // _di_f_thread_keys_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param keys
- * The string keys array to resize.
+ * @param structure
+ * The thread keys array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_keys_decrease_by_
- extern f_status_t f_thread_keys_decrease_by(const f_number_unsigned_t amount, f_thread_keys_t * const keys);
+ extern f_status_t f_thread_keys_decrease_by(const f_number_unsigned_t amount, f_thread_keys_t * const structure);
#endif // _di_f_thread_keys_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param keys
- * The string keys array to resize.
+ * @param structure
+ * The thread keys array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_keys_increase_
- extern f_status_t f_thread_keys_increase(const f_number_unsigned_t step, f_thread_keys_t * const keys);
+ extern f_status_t f_thread_keys_increase(const f_number_unsigned_t step, f_thread_keys_t * const structure);
#endif // _di_f_thread_keys_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param keys
- * The string keys array to resize.
+ * @param structure
+ * The thread keys array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_keys_increase_by_
- extern f_status_t f_thread_keys_increase_by(const f_number_unsigned_t amount, f_thread_keys_t * const keys);
+ extern f_status_t f_thread_keys_increase_by(const f_number_unsigned_t amount, f_thread_keys_t * const structure);
#endif // _di_f_thread_keys_increase_by_
/**
*
* @param length
* The new size to use.
- * @param keys
- * The string keys array to adjust.
+ * @param structure
+ * The thread keys array to adjust.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_keys_resize_
- extern f_status_t f_thread_keys_resize(const f_number_unsigned_t length, f_thread_keys_t * const keys);
+ extern f_status_t f_thread_keys_resize(const f_number_unsigned_t length, f_thread_keys_t * const structure);
#endif // _di_f_thread_keys_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_thread_locks_adjust_
- f_status_t f_thread_locks_adjust(const f_number_unsigned_t length, f_thread_locks_t * const locks) {
+ f_status_t f_thread_locks_adjust(const f_number_unsigned_t length, f_thread_locks_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!locks) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_locks_adjust(length, locks);
+ return private_f_thread_locks_adjust(length, structure);
}
#endif // _di_f_thread_locks_adjust_
#ifndef _di_f_thread_locks_decimate_by_
- f_status_t f_thread_locks_decimate_by(const f_number_unsigned_t amount, f_thread_locks_t * const locks) {
+ f_status_t f_thread_locks_decimate_by(const f_number_unsigned_t amount, f_thread_locks_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!locks) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (locks->size > amount) {
- return private_f_thread_locks_adjust(locks->size - amount, locks);
- }
-
- return private_f_thread_locks_adjust(0, locks);
+ return private_f_thread_locks_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_locks_decimate_by_
#ifndef _di_f_thread_locks_decrease_by_
- f_status_t f_thread_locks_decrease_by(const f_number_unsigned_t amount, f_thread_locks_t * const locks) {
+ f_status_t f_thread_locks_decrease_by(const f_number_unsigned_t amount, f_thread_locks_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!locks) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (locks->size > amount) {
- return private_f_thread_locks_resize(locks->size - amount, locks);
- }
-
- return private_f_thread_locks_resize(0, locks);
+ return private_f_thread_locks_resize((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_locks_decrease_by_
#ifndef _di_f_thread_locks_increase_
- f_status_t f_thread_locks_increase(const f_number_unsigned_t step, f_thread_locks_t * const locks) {
+ f_status_t f_thread_locks_increase(const f_number_unsigned_t step, f_thread_locks_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!locks) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && locks->used + 1 > locks->size) {
- f_number_unsigned_t size = locks->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (locks->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_thread_locks_resize(size, locks);
+ return private_f_thread_locks_resize(length, structure);
}
return F_data_not;
#endif // _di_f_thread_locks_increase_
#ifndef _di_f_thread_locks_increase_by_
- f_status_t f_thread_locks_increase_by(const f_number_unsigned_t amount, f_thread_locks_t * const locks) {
+ f_status_t f_thread_locks_increase_by(const f_number_unsigned_t amount, f_thread_locks_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!locks) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (amount) {
- if (locks->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- const f_number_unsigned_t length = locks->used + amount;
+ const f_number_unsigned_t length = structure->used + amount;
- if (length > locks->size) {
+ if (length > structure->size) {
if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- return private_f_thread_locks_resize(length, locks);
+ return private_f_thread_locks_resize(length, structure);
}
}
#endif // _di_f_thread_locks_increase_by_
#ifndef _di_f_thread_locks_resize_
- f_status_t f_thread_locks_resize(const f_number_unsigned_t length, f_thread_locks_t * const locks) {
+ f_status_t f_thread_locks_resize(const f_number_unsigned_t length, f_thread_locks_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!locks) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_locks_resize(length, locks);
+ return private_f_thread_locks_resize(length, structure);
}
#endif // _di_f_thread_locks_resize_
#endif // _di_f_thread_locks_t_
/**
- * Resize the read/write locks array.
+ * Resize the thread locks array.
*
* @param length
* The new size to use.
- * @param locks
- * The string locks array to resize.
+ * @param structure
+ * The thread locks array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_locks_adjust_
- extern f_status_t f_thread_locks_adjust(const f_number_unsigned_t length, f_thread_locks_t * const locks);
+ extern f_status_t f_thread_locks_adjust(const f_number_unsigned_t length, f_thread_locks_t * const structure);
#endif // _di_f_thread_locks_adjust_
/**
- * Resize the read/write locks array to a smaller size.
+ * Resize the thread locks array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param locks
- * The string locks array to resize.
+ * @param structure
+ * The thread locks array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_locks_decimate_by_
- extern f_status_t f_thread_locks_decimate_by(const f_number_unsigned_t amount, f_thread_locks_t * const locks);
+ extern f_status_t f_thread_locks_decimate_by(const f_number_unsigned_t amount, f_thread_locks_t * const structure);
#endif // _di_f_thread_locks_decimate_by_
/**
- * Resize the read/write locks array to a smaller size.
+ * Resize the thread locks array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param locks
- * The string locks array to resize.
+ * @param structure
+ * The thread locks array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_locks_decrease_by_
- extern f_status_t f_thread_locks_decrease_by(const f_number_unsigned_t amount, f_thread_locks_t * const locks);
+ extern f_status_t f_thread_locks_decrease_by(const f_number_unsigned_t amount, f_thread_locks_t * const structure);
#endif // _di_f_thread_locks_decrease_by_
/**
- * Increase the size of the read/write array, but only if necessary.
+ * Increase the size of the thread locks array, but only if necessary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param locks
- * The string locks array to resize.
+ * @param structure
+ * The thread locks array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_locks_increase_
- extern f_status_t f_thread_locks_increase(const f_number_unsigned_t step, f_thread_locks_t * const locks);
+ extern f_status_t f_thread_locks_increase(const f_number_unsigned_t step, f_thread_locks_t * const structure);
#endif // _di_f_thread_locks_increase_
/**
- * Resize the read/write locks array to a larger size.
+ * Resize the thread locks array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param locks
- * The string locks array to resize.
+ * @param structure
+ * The thread locks array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_locks_increase_by_
- extern f_status_t f_thread_locks_increase_by(const f_number_unsigned_t amount, f_thread_locks_t * const locks);
+ extern f_status_t f_thread_locks_increase_by(const f_number_unsigned_t amount, f_thread_locks_t * const structure);
#endif // _di_f_thread_locks_increase_by_
/**
- * Resize the read/write locks array.
+ * Resize the thread locks array.
*
* @param length
* The new size to use.
- * @param locks
- * The string locks array to adjust.
+ * @param structure
+ * The thread locks array to adjust.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_locks_resize_
- extern f_status_t f_thread_locks_resize(const f_number_unsigned_t length, f_thread_locks_t * const locks);
+ extern f_status_t f_thread_locks_resize(const f_number_unsigned_t length, f_thread_locks_t * const structure);
#endif // _di_f_thread_locks_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_thread_lock_attributes_adjust_
- f_status_t f_thread_lock_attributes_adjust(const f_number_unsigned_t length, f_thread_lock_attributes_t * const attributes) {
+ f_status_t f_thread_lock_attributes_adjust(const f_number_unsigned_t length, f_thread_lock_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_lock_attributes_adjust(length, attributes);
+ return private_f_thread_lock_attributes_adjust(length, structure);
}
#endif // _di_f_thread_lock_attributes_adjust_
#ifndef _di_f_thread_lock_attributes_decimate_by_
- f_status_t f_thread_lock_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_lock_attributes_t * const attributes) {
+ f_status_t f_thread_lock_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_lock_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (attributes->size > amount) {
- return private_f_thread_lock_attributes_adjust(attributes->size - amount, attributes);
- }
-
- return private_f_thread_lock_attributes_adjust(0, attributes);
+ return private_f_thread_lock_attributes_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_lock_attributes_decimate_by_
#ifndef _di_f_thread_lock_attributes_decrease_by_
- f_status_t f_thread_lock_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_lock_attributes_t * const attributes) {
+ f_status_t f_thread_lock_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_lock_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (attributes->size > amount) {
- return private_f_thread_lock_attributes_resize(attributes->size - amount, attributes);
- }
-
- return private_f_thread_lock_attributes_resize(0, attributes);
+ return private_f_thread_lock_attributes_resize((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_lock_attributes_decrease_by_
#ifndef _di_f_thread_lock_attributes_increase_
- f_status_t f_thread_lock_attributes_increase(const f_number_unsigned_t step, f_thread_lock_attributes_t * const attributes) {
+ f_status_t f_thread_lock_attributes_increase(const f_number_unsigned_t step, f_thread_lock_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && attributes->used + 1 > attributes->size) {
- f_number_unsigned_t size = attributes->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (attributes->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_thread_lock_attributes_resize(size, attributes);
+ return private_f_thread_lock_attributes_resize(length, structure);
}
return F_data_not;
#endif // _di_f_thread_lock_attributes_increase_
#ifndef _di_f_thread_lock_attributes_increase_by_
- f_status_t f_thread_lock_attributes_increase_by(const f_number_unsigned_t amount, f_thread_lock_attributes_t * const attributes) {
+ f_status_t f_thread_lock_attributes_increase_by(const f_number_unsigned_t amount, f_thread_lock_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (amount) {
- if (attributes->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- const f_number_unsigned_t length = attributes->used + amount;
+ const f_number_unsigned_t length = structure->used + amount;
- if (length > attributes->size) {
+ if (length > structure->size) {
if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- return private_f_thread_lock_attributes_resize(length, attributes);
+ return private_f_thread_lock_attributes_resize(length, structure);
}
}
#endif // _di_f_thread_lock_attributes_increase_by_
#ifndef _di_f_thread_lock_attributes_resize_
- f_status_t f_thread_lock_attributes_resize(const f_number_unsigned_t length, f_thread_lock_attributes_t * const attributes) {
+ f_status_t f_thread_lock_attributes_resize(const f_number_unsigned_t length, f_thread_lock_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_lock_attributes_resize(length, attributes);
+ return private_f_thread_lock_attributes_resize(length, structure);
}
#endif // _di_f_thread_lock_attributes_resize_
#endif // _di_f_thread_lock_attributes_t_
/**
- * Resize the thread attributes array.
+ * Resize the thread lock_attributes array.
*
* @param length
* The new size to use.
- * @param attributes
- * The string attributes array to resize.
+ * @param structure
+ * The thread lock_attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_lock_attributes_adjust_
- extern f_status_t f_thread_lock_attributes_adjust(const f_number_unsigned_t length, f_thread_lock_attributes_t * const attributes);
+ extern f_status_t f_thread_lock_attributes_adjust(const f_number_unsigned_t length, f_thread_lock_attributes_t * const structure);
#endif // _di_f_thread_lock_attributes_adjust_
/**
- * Resize the thread attributes array to a smaller size.
+ * Resize the thread lock_attributes array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param attributes
- * The string attributes array to resize.
+ * @param structure
+ * The thread lock_attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_lock_attributes_decimate_by_
- extern f_status_t f_thread_lock_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_lock_attributes_t * const attributes);
+ extern f_status_t f_thread_lock_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_lock_attributes_t * const structure);
#endif // _di_f_thread_lock_attributes_decimate_by_
/**
- * Resize the thread attributes array to a smaller size.
+ * Resize the thread lock_attributes array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param attributes
- * The string attributes array to resize.
+ * @param structure
+ * The thread lock_attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_lock_attributes_decrease_by_
- extern f_status_t f_thread_lock_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_lock_attributes_t * const attributes);
+ extern f_status_t f_thread_lock_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_lock_attributes_t * const structure);
#endif // _di_f_thread_lock_attributes_decrease_by_
/**
- * Increase the size of the thread attributes array, but only if necessary.
+ * Increase the size of the thread lock_attributes array, but only if necessary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param attributes
- * The string attributes array to resize.
+ * @param structure
+ * The thread lock_attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_lock_attributes_increase_
- extern f_status_t f_thread_lock_attributes_increase(const f_number_unsigned_t step, f_thread_lock_attributes_t * const attributes);
+ extern f_status_t f_thread_lock_attributes_increase(const f_number_unsigned_t step, f_thread_lock_attributes_t * const structure);
#endif // _di_f_thread_lock_attributes_increase_
/**
- * Resize the thread attributes array to a larger size.
+ * Resize the thread lock_attributes array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param attributes
- * The string attributes array to resize.
+ * @param structure
+ * The thread lock_attributes 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_array_too_large (with error bit) if the new array length is too large.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_lock_attributes_increase_by_
- extern f_status_t f_thread_lock_attributes_increase_by(const f_number_unsigned_t amount, f_thread_lock_attributes_t * const attributes);
+ extern f_status_t f_thread_lock_attributes_increase_by(const f_number_unsigned_t amount, f_thread_lock_attributes_t * const structure);
#endif // _di_f_thread_lock_attributes_increase_by_
/**
- * Resize the thread attributes array.
+ * Resize the thread lock_attributes array.
*
* @param length
* The new size to use.
- * @param attributes
- * The string attributes array to adjust.
+ * @param structure
+ * The thread lock_attributes array to adjust.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_lock_attributes_resize_
- extern f_status_t f_thread_lock_attributes_resize(const f_number_unsigned_t length, f_thread_lock_attributes_t * const attributes);
+ extern f_status_t f_thread_lock_attributes_resize(const f_number_unsigned_t length, f_thread_lock_attributes_t * const structure);
#endif // _di_f_thread_lock_attributes_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_thread_mutexs_adjust_
- f_status_t f_thread_mutexs_adjust(const f_number_unsigned_t length, f_thread_mutexs_t * const mutexs) {
+ f_status_t f_thread_mutexs_adjust(const f_number_unsigned_t length, f_thread_mutexs_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!mutexs) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_mutexs_adjust(length, mutexs);
+ return private_f_thread_mutexs_adjust(length, structure);
}
#endif // _di_f_thread_mutexs_adjust_
#ifndef _di_f_thread_mutexs_decimate_by_
- f_status_t f_thread_mutexs_decimate_by(const f_number_unsigned_t amount, f_thread_mutexs_t * const mutexs) {
+ f_status_t f_thread_mutexs_decimate_by(const f_number_unsigned_t amount, f_thread_mutexs_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!mutexs) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (mutexs->size > amount) {
- return private_f_thread_mutexs_adjust(mutexs->size - amount, mutexs);
- }
-
- return private_f_thread_mutexs_adjust(0, mutexs);
+ return private_f_thread_mutexs_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_mutexs_decimate_by_
#ifndef _di_f_thread_mutexs_decrease_by_
- f_status_t f_thread_mutexs_decrease_by(const f_number_unsigned_t amount, f_thread_mutexs_t * const mutexs) {
+ f_status_t f_thread_mutexs_decrease_by(const f_number_unsigned_t amount, f_thread_mutexs_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!mutexs) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (mutexs->size > amount) {
- return private_f_thread_mutexs_resize(mutexs->size - amount, mutexs);
- }
-
- return private_f_thread_mutexs_resize(0, mutexs);
+ return private_f_thread_mutexs_resize((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_mutexs_decrease_by_
#ifndef _di_f_thread_mutexs_increase_
- f_status_t f_thread_mutexs_increase(const f_number_unsigned_t step, f_thread_mutexs_t * const mutexs) {
+ f_status_t f_thread_mutexs_increase(const f_number_unsigned_t step, f_thread_mutexs_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!mutexs) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && mutexs->used + 1 > mutexs->size) {
- f_number_unsigned_t size = mutexs->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (mutexs->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_thread_mutexs_resize(size, mutexs);
+ return private_f_thread_mutexs_resize(length, structure);
}
return F_data_not;
#endif // _di_f_thread_mutexs_increase_
#ifndef _di_f_thread_mutexs_increase_by_
- f_status_t f_thread_mutexs_increase_by(const f_number_unsigned_t amount, f_thread_mutexs_t * const mutexs) {
+ f_status_t f_thread_mutexs_increase_by(const f_number_unsigned_t amount, f_thread_mutexs_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!mutexs) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (amount) {
- if (mutexs->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- const f_number_unsigned_t length = mutexs->used + amount;
+ const f_number_unsigned_t length = structure->used + amount;
- if (length > mutexs->size) {
+ if (length > structure->size) {
if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- return private_f_thread_mutexs_resize(length, mutexs);
+ return private_f_thread_mutexs_resize(length, structure);
}
}
#endif // _di_f_thread_mutexs_increase_by_
#ifndef _di_f_thread_mutexs_resize_
- f_status_t f_thread_mutexs_resize(const f_number_unsigned_t length, f_thread_mutexs_t * const mutexs) {
+ f_status_t f_thread_mutexs_resize(const f_number_unsigned_t length, f_thread_mutexs_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!mutexs) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_mutexs_resize(length, mutexs);
+ return private_f_thread_mutexs_resize(length, structure);
}
#endif // _di_f_thread_mutexs_resize_
*
* @param length
* The new size to use.
- * @param mutexs
- * The string mutexs array to resize.
+ * @param structure
+ * The thread mutexs array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_mutexs_adjust_
- extern f_status_t f_thread_mutexs_adjust(const f_number_unsigned_t length, f_thread_mutexs_t * const mutexs);
+ extern f_status_t f_thread_mutexs_adjust(const f_number_unsigned_t length, f_thread_mutexs_t * const structure);
#endif // _di_f_thread_mutexs_adjust_
/**
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param mutexs
- * The string mutexs array to resize.
+ * @param structure
+ * The thread mutexs array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_mutexs_decimate_by_
- extern f_status_t f_thread_mutexs_decimate_by(const f_number_unsigned_t amount, f_thread_mutexs_t * const mutexs);
+ extern f_status_t f_thread_mutexs_decimate_by(const f_number_unsigned_t amount, f_thread_mutexs_t * const structure);
#endif // _di_f_thread_mutexs_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param mutexs
- * The string mutexs array to resize.
+ * @param structure
+ * The thread mutexs array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_mutexs_decrease_by_
- extern f_status_t f_thread_mutexs_decrease_by(const f_number_unsigned_t amount, f_thread_mutexs_t * const mutexs);
+ extern f_status_t f_thread_mutexs_decrease_by(const f_number_unsigned_t amount, f_thread_mutexs_t * const structure);
#endif // _di_f_thread_mutexs_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param mutexs
- * The string mutexs array to resize.
+ * @param structure
+ * The thread mutexs array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_mutexs_increase_
- extern f_status_t f_thread_mutexs_increase(const f_number_unsigned_t step, f_thread_mutexs_t * const mutexs);
+ extern f_status_t f_thread_mutexs_increase(const f_number_unsigned_t step, f_thread_mutexs_t * const structure);
#endif // _di_f_thread_mutexs_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param mutexs
- * The string mutexs array to resize.
+ * @param structure
+ * The thread mutexs array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_mutexs_increase_by_
- extern f_status_t f_thread_mutexs_increase_by(const f_number_unsigned_t amount, f_thread_mutexs_t * const mutexs);
+ extern f_status_t f_thread_mutexs_increase_by(const f_number_unsigned_t amount, f_thread_mutexs_t * const structure);
#endif // _di_f_thread_mutexs_increase_by_
/**
*
* @param length
* The new size to use.
- * @param mutexs
- * The string mutexs array to adjust.
+ * @param structure
+ * The thread mutexs array to adjust.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_mutexs_resize_
- extern f_status_t f_thread_mutexs_resize(const f_number_unsigned_t length, f_thread_mutexs_t * const mutexs);
+ extern f_status_t f_thread_mutexs_resize(const f_number_unsigned_t length, f_thread_mutexs_t * const structure);
#endif // _di_f_thread_mutexs_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_thread_mutex_attributes_adjust_
- f_status_t f_thread_mutex_attributes_adjust(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const attributes) {
+ f_status_t f_thread_mutex_attributes_adjust(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_mutex_attributes_adjust(length, attributes);
+ return private_f_thread_mutex_attributes_adjust(length, structure);
}
#endif // _di_f_thread_mutex_attributes_adjust_
#ifndef _di_f_thread_mutex_attributes_decimate_by_
- f_status_t f_thread_mutex_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_mutex_attributes_t * const attributes) {
+ f_status_t f_thread_mutex_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_mutex_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (attributes->size > amount) {
- return private_f_thread_mutex_attributes_adjust(attributes->size - amount, attributes);
- }
-
- return private_f_thread_mutex_attributes_adjust(0, attributes);
+ return private_f_thread_mutex_attributes_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_mutex_attributes_decimate_by_
#ifndef _di_f_thread_mutex_attributes_decrease_by_
- f_status_t f_thread_mutex_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_mutex_attributes_t * const attributes) {
+ f_status_t f_thread_mutex_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_mutex_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (attributes->size > amount) {
- return private_f_thread_mutex_attributes_resize(attributes->size - amount, attributes);
- }
-
- return private_f_thread_mutex_attributes_resize(0, attributes);
+ return private_f_thread_mutex_attributes_resize((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_mutex_attributes_decrease_by_
#ifndef _di_f_thread_mutex_attributes_increase_
- f_status_t f_thread_mutex_attributes_increase(const f_number_unsigned_t step, f_thread_mutex_attributes_t * const attributes) {
+ f_status_t f_thread_mutex_attributes_increase(const f_number_unsigned_t step, f_thread_mutex_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && attributes->used + 1 > attributes->size) {
- f_number_unsigned_t size = attributes->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (attributes->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_thread_mutex_attributes_resize(size, attributes);
+ return private_f_thread_mutex_attributes_resize(length, structure);
}
return F_data_not;
#endif // _di_f_thread_mutex_attributes_increase_
#ifndef _di_f_thread_mutex_attributes_increase_by_
- f_status_t f_thread_mutex_attributes_increase_by(const f_number_unsigned_t amount, f_thread_mutex_attributes_t * const attributes) {
+ f_status_t f_thread_mutex_attributes_increase_by(const f_number_unsigned_t amount, f_thread_mutex_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (amount) {
- if (attributes->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- const f_number_unsigned_t length = attributes->used + amount;
+ const f_number_unsigned_t length = structure->used + amount;
- if (length > attributes->size) {
+ if (length > structure->size) {
if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- return private_f_thread_mutex_attributes_resize(length, attributes);
+ return private_f_thread_mutex_attributes_resize(length, structure);
}
}
#endif // _di_f_thread_mutex_attributes_increase_by_
#ifndef _di_f_thread_mutex_attributes_resize_
- f_status_t f_thread_mutex_attributes_resize(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const attributes) {
+ f_status_t f_thread_mutex_attributes_resize(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!attributes) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_mutex_attributes_resize(length, attributes);
+ return private_f_thread_mutex_attributes_resize(length, structure);
}
#endif // _di_f_thread_mutex_attributes_resize_
#endif // _di_f_thread_mutex_attributes_t_
/**
- * Resize the thread attributes array.
+ * Resize the thread mutex_attributes array.
*
* @param length
* The new size to use.
- * @param attributes
- * The thread mutex attributes array to resize.
+ * @param structure
+ * The thread mutex_attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_mutex_attributes_adjust_
- extern f_status_t f_thread_mutex_attributes_adjust(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const attributes);
+ extern f_status_t f_thread_mutex_attributes_adjust(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const structure);
#endif // _di_f_thread_mutex_attributes_adjust_
/**
- * Resize the thread attributes array to a smaller size.
+ * Resize the thread mutex_attributes array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param attributes
- * The thread mutex attributes array to resize.
+ * @param structure
+ * The thread mutex_attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_mutex_attributes_decimate_by_
- extern f_status_t f_thread_mutex_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_mutex_attributes_t * const attributes);
+ extern f_status_t f_thread_mutex_attributes_decimate_by(const f_number_unsigned_t amount, f_thread_mutex_attributes_t * const structure);
#endif // _di_f_thread_mutex_attributes_decimate_by_
/**
- * Resize the thread attributes array to a smaller size.
+ * Resize the thread mutex_attributes array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param attributes
- * The thread mutex attributes array to resize.
+ * @param structure
+ * The thread mutex_attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_mutex_attributes_decrease_by_
- extern f_status_t f_thread_mutex_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_mutex_attributes_t * const attributes);
+ extern f_status_t f_thread_mutex_attributes_decrease_by(const f_number_unsigned_t amount, f_thread_mutex_attributes_t * const structure);
#endif // _di_f_thread_mutex_attributes_decrease_by_
/**
- * Increase the size of the thread attributes array, but only if necessary.
+ * Increase the size of the thread mutex_attributes array, but only if necessary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param attributes
- * The thread mutex attributes array to resize.
+ * @param structure
+ * The thread mutex_attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_mutex_attributes_increase_
- extern f_status_t f_thread_mutex_attributes_increase(const f_number_unsigned_t step, f_thread_mutex_attributes_t * const attributes);
+ extern f_status_t f_thread_mutex_attributes_increase(const f_number_unsigned_t step, f_thread_mutex_attributes_t * const structure);
#endif // _di_f_thread_mutex_attributes_increase_
/**
- * Resize the thread attributes array to a larger size.
+ * Resize the thread mutex_attributes array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param attributes
- * The thread mutex attributes array to resize.
+ * @param structure
+ * The thread mutex_attributes array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_mutex_attributes_increase_by_
- extern f_status_t f_thread_mutex_attributes_increase_by(const f_number_unsigned_t amount, f_thread_mutex_attributes_t * const attributes);
+ extern f_status_t f_thread_mutex_attributes_increase_by(const f_number_unsigned_t amount, f_thread_mutex_attributes_t * const structure);
#endif // _di_f_thread_mutex_attributes_increase_by_
/**
- * Resize the thread attributes array.
+ * Resize the thread mutex_attributes array.
*
* @param length
* The new size to use.
- * @param attributes
- * The thread mutex attributes array to adjust.
+ * @param structure
+ * The thread mutex_attributes array to adjust.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_mutex_attributes_resize_
- extern f_status_t f_thread_mutex_attributes_resize(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const attributes);
+ extern f_status_t f_thread_mutex_attributes_resize(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const structure);
#endif // _di_f_thread_mutex_attributes_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_thread_onces_adjust_
- f_status_t f_thread_onces_adjust(const f_number_unsigned_t length, f_thread_onces_t * const onces) {
+ f_status_t f_thread_onces_adjust(const f_number_unsigned_t length, f_thread_onces_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!onces) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_onces_adjust(length, onces);
+ return f_memory_array_adjust(length, sizeof(f_thread_once_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_thread_onces_adjust_
#ifndef _di_f_thread_onces_decimate_by_
- f_status_t f_thread_onces_decimate_by(const f_number_unsigned_t amount, f_thread_onces_t * const onces) {
+ f_status_t f_thread_onces_decimate_by(const f_number_unsigned_t amount, f_thread_onces_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!onces) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (onces->size > amount) {
- return private_f_thread_onces_adjust(onces->size - amount, onces);
- }
-
- return private_f_thread_onces_adjust(0, onces);
+ return f_memory_array_decimate_by(amount, sizeof(f_thread_once_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_thread_onces_decimate_by_
#ifndef _di_f_thread_onces_decrease_by_
- f_status_t f_thread_onces_decrease_by(const f_number_unsigned_t amount, f_thread_onces_t * const onces) {
+ f_status_t f_thread_onces_decrease_by(const f_number_unsigned_t amount, f_thread_onces_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!onces) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (onces->size > amount) {
- return private_f_thread_onces_resize(onces->size - amount, onces);
- }
-
- return private_f_thread_onces_resize(0, onces);
+ return f_memory_array_decrease_by(amount, sizeof(f_thread_once_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_thread_onces_decrease_by_
#ifndef _di_f_thread_onces_increase_
- f_status_t f_thread_onces_increase(const f_number_unsigned_t step, f_thread_onces_t * const onces) {
+ f_status_t f_thread_onces_increase(const f_number_unsigned_t step, f_thread_onces_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!onces) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && onces->used + 1 > onces->size) {
- f_number_unsigned_t size = onces->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (onces->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_thread_onces_resize(size, onces);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(f_thread_once_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_thread_onces_increase_
#ifndef _di_f_thread_onces_increase_by_
- f_status_t f_thread_onces_increase_by(const f_number_unsigned_t amount, f_thread_onces_t * const onces) {
+ f_status_t f_thread_onces_increase_by(const f_number_unsigned_t amount, f_thread_onces_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!onces) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (amount) {
- if (onces->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
- const f_number_unsigned_t length = onces->used + amount;
-
- if (length > onces->size) {
- if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
- return private_f_thread_onces_resize(length, onces);
- }
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(f_thread_once_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_thread_onces_increase_by_
#ifndef _di_f_thread_onces_resize_
- f_status_t f_thread_onces_resize(const f_number_unsigned_t length, f_thread_onces_t * const onces) {
+ f_status_t f_thread_onces_resize(const f_number_unsigned_t length, f_thread_onces_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!onces) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_onces_resize(length, onces);
+ return f_memory_array_resize(length, sizeof(f_thread_once_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_thread_onces_resize_
*
* @param length
* The new size to use.
- * @param onces
+ * @param structure
* The thread onces array to resize.
*
* @return
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_onces_adjust_
- extern f_status_t f_thread_onces_adjust(const f_number_unsigned_t length, f_thread_onces_t * const onces);
+ extern f_status_t f_thread_onces_adjust(const f_number_unsigned_t length, f_thread_onces_t * const structure);
#endif // _di_f_thread_onces_adjust_
/**
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param onces
+ * @param structure
* The thread onces array to resize.
*
* @return
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_onces_decimate_by_
- extern f_status_t f_thread_onces_decimate_by(const f_number_unsigned_t amount, f_thread_onces_t * const onces);
+ extern f_status_t f_thread_onces_decimate_by(const f_number_unsigned_t amount, f_thread_onces_t * const structure);
#endif // _di_f_thread_onces_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param onces
+ * @param structure
* The thread onces array to resize.
*
* @return
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_onces_decrease_by_
- extern f_status_t f_thread_onces_decrease_by(const f_number_unsigned_t amount, f_thread_onces_t * const onces);
+ extern f_status_t f_thread_onces_decrease_by(const f_number_unsigned_t amount, f_thread_onces_t * const structure);
#endif // _di_f_thread_onces_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param onces
+ * @param structure
* The thread onces array to resize.
*
* @return
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_onces_increase_
- extern f_status_t f_thread_onces_increase(const f_number_unsigned_t step, f_thread_onces_t * const onces);
+ extern f_status_t f_thread_onces_increase(const f_number_unsigned_t step, f_thread_onces_t * const structure);
#endif // _di_f_thread_onces_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param onces
+ * @param structure
* The thread onces array to resize.
*
* @return
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_onces_increase_by_
- extern f_status_t f_thread_onces_increase_by(const f_number_unsigned_t amount, f_thread_onces_t * const onces);
+ extern f_status_t f_thread_onces_increase_by(const f_number_unsigned_t amount, f_thread_onces_t * const structure);
#endif // _di_f_thread_onces_increase_by_
/**
*
* @param length
* The new size to use.
- * @param onces
+ * @param structure
* The thread onces array to adjust.
*
* @return
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_onces_resize_
- extern f_status_t f_thread_onces_resize(const f_number_unsigned_t length, f_thread_onces_t * const onces);
+ extern f_status_t f_thread_onces_resize(const f_number_unsigned_t length, f_thread_onces_t * const structure);
#endif // _di_f_thread_onces_resize_
#ifdef __cplusplus
#endif
#if !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_) || !defined(_di_f_thread_attributes_decrease_) || !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_) || !defined(_di_f_thread_attributes_resize_) || !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_) || !defined(_di_f_thread_sets_decrease_) || !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_) || !defined(_di_f_thread_sets_resize_)
- f_status_t private_f_thread_attribute_delete(f_thread_attribute_t *attribute) {
+ f_status_t private_f_thread_attribute_delete(f_thread_attribute_t *structure) {
- if (pthread_attr_destroy(attribute)) return F_status_set_error(F_failure);
-
- attribute = 0;
+ if (pthread_attr_destroy(structure)) return F_status_set_error(F_failure);
return F_none;
}
*
* @param length
* The new size to use.
- * @param attributes
- * The attributes to adjust.
+ * @param structure
+ * The thread attribute to delete.
*
* @return
* F_none on success.
* @see f_thread_sets_resize()
*/
#if !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_) || !defined(_di_f_thread_attributes_decrease_) || !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_) || !defined(_di_f_thread_attributes_resize_) || !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_) || !defined(_di_f_thread_sets_decrease_) || !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_) || !defined(_di_f_thread_sets_resize_)
- extern f_status_t private_f_thread_attribute_delete(f_thread_attribute_t *attribute) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_attribute_delete(f_thread_attribute_t *structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_attributes_adjust_) || !defined(_di_f_thread_attributes_decimate_by_) || !defined(_di_f_thread_attributes_decrease_) || !defined(_di_f_thread_attributes_decrease_by_) || !defined(_di_f_thread_attributes_increase_) || !defined(_di_f_thread_attributes_increase_by_) || !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_) || !defined(_di_f_thread_sets_decrease_) || !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_)
/**
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*
- * @see f_memory_adjust()
* @see f_thread_barriers_adjust()
* @see f_thread_barriers_decimate_by()
*/
#endif
#if !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_) || !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_) || !defined(_di_f_thread_barriers_resize_)
- f_status_t private_f_thread_barrier_delete(f_thread_barrier_t *barrier) {
+ f_status_t private_f_thread_barrier_delete(f_thread_barrier_t *structure) {
- const int error = pthread_barrier_destroy(barrier);
+ const int error = pthread_barrier_destroy(structure);
if (error) {
if (error == EBUSY) return F_status_set_error(F_busy);
return F_status_set_error(F_failure);
}
- barrier = 0;
-
return F_none;
}
#endif // !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_) || !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_) || !defined(_di_f_thread_barriers_resize_)
#if !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_)
- f_status_t private_f_thread_barriers_adjust(const f_number_unsigned_t length, f_thread_barriers_t * const barriers) {
+ f_status_t private_f_thread_barriers_adjust(const f_number_unsigned_t length, f_thread_barriers_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < barriers->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_barrier_delete(&barriers->array[i]);
+ status = private_f_thread_barrier_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_adjust(length, sizeof(f_thread_barrier_t), (void **) &barriers->array, &barriers->used, &barriers->size);
+ return f_memory_array_adjust(length, sizeof(f_thread_barrier_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_)
#if !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_)
- f_status_t private_f_thread_barriers_resize(const f_number_unsigned_t length, f_thread_barriers_t * const barriers) {
+ f_status_t private_f_thread_barriers_resize(const f_number_unsigned_t length, f_thread_barriers_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < barriers->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_barrier_delete(&barriers->array[i]);
+ status = private_f_thread_barrier_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_resize(length, sizeof(f_thread_barrier_t), (void **) &barriers->array, &barriers->used, &barriers->size);
+ return f_memory_array_resize(length, sizeof(f_thread_barrier_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_)
*
* @param length
* The new size to use.
- * @param barriers
- * The barriers to adjust.
+ * @param structure
+ * The barrier to delete.
*
* @return
* F_none on success.
* @see f_thread_barriers_resize()
*/
#if !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_) || !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_) || !defined(_di_f_thread_barriers_resize_)
- extern f_status_t private_f_thread_barrier_delete(f_thread_barrier_t *barrier) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_barrier_delete(f_thread_barrier_t *structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_) || !defined(_di_f_thread_barriers_decrease_) || !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_) || !defined(_di_f_thread_barriers_resize_)
/**
*
* @param length
* The new size to use.
- * @param barriers
+ * @param structure
* The barriers to adjust.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_adjust()
* @see f_thread_barriers_adjust()
* @see f_thread_barriers_decimate_by()
*/
#if !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_)
- extern f_status_t private_f_thread_barriers_adjust(const f_number_unsigned_t length, f_thread_barriers_t * const barriers) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_barriers_adjust(const f_number_unsigned_t length, f_thread_barriers_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_barriers_adjust_) || !defined(_di_f_thread_barriers_decimate_by_)
/**
*
* @param length
* The new size to use.
- * @param barriers
+ * @param structure
* The barriers to resize.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_resize()
* @see f_thread_barriers_decrease_by()
* @see f_thread_barriers_increase()
* @see f_thread_barriers_increase_by()
*/
#if !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_)
- extern f_status_t private_f_thread_barriers_resize(const f_number_unsigned_t length, f_thread_barriers_t * const barriers) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_barriers_resize(const f_number_unsigned_t length, f_thread_barriers_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_barriers_decrease_by_) || !defined(_di_f_thread_barriers_increase_) || !defined(_di_f_thread_barriers_increase_by_)
#ifdef __cplusplus
#endif
#if !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_) || !defined(_di_f_thread_barrier_attributes_decrease_) || !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_) || !defined(_di_f_thread_barrier_attributes_resize_)
- f_status_t private_f_thread_barrier_attribute_delete(f_thread_barrier_attribute_t *attribute) {
+ f_status_t private_f_thread_barrier_attribute_delete(f_thread_barrier_attribute_t *structure) {
- if (pthread_barrierattr_destroy(attribute)) return F_status_set_error(F_failure);
-
- attribute = 0;
+ if (pthread_barrierattr_destroy(structure)) return F_status_set_error(F_failure);
return F_none;
}
*
* @param length
* The new size to use.
- * @param attributes
- * The attributes to adjust.
+ * @param structure
+ * The attribute to delete.
*
* @return
* F_none on success.
* @see f_thread_barrier_attributes_resize()
*/
#if !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_) || !defined(_di_f_thread_barrier_attributes_decrease_) || !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_) || !defined(_di_f_thread_barrier_attributes_resize_)
- extern f_status_t private_f_thread_barrier_attribute_delete(f_thread_barrier_attribute_t *attribute) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_barrier_attribute_delete(f_thread_barrier_attribute_t *structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_) || !defined(_di_f_thread_barrier_attributes_decrease_) || !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_) || !defined(_di_f_thread_barrier_attributes_resize_)
/**
*
* @param length
* The new size to use.
- * @param attributes
- * The attributes to adjust.
+ * @param structure
+ * The barrier_attributes to adjust.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_adjust()
* @see f_thread_barrier_attributes_adjust()
* @see f_thread_barrier_attributes_decimate_by()
*/
#if !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_)
- extern f_status_t private_f_thread_barrier_attributes_adjust(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const attributes) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_barrier_attributes_adjust(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_barrier_attributes_adjust_) || !defined(_di_f_thread_barrier_attributes_decimate_by_)
/**
*
* @param length
* The new size to use.
- * @param attributes
- * The attributes to resize.
+ * @param structure
+ * The barrier_attributes to resize.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_resize()
* @see f_thread_barrier_attributes_decrease_by()
* @see f_thread_barrier_attributes_increase()
* @see f_thread_barrier_attributes_increase_by()
*/
#if !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_)
- extern f_status_t private_f_thread_barrier_attributes_resize(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const attributes) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_barrier_attributes_resize(const f_number_unsigned_t length, f_thread_barrier_attributes_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_barrier_attributes_decrease_by_) || !defined(_di_f_thread_barrier_attributes_increase_) || !defined(_di_f_thread_barrier_attributes_increase_by_)
#ifdef __cplusplus
#endif // !defined(_di_f_thread_condition_delete_) || !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_) || !defined(_di_f_thread_conditions_decrease_) || !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_) || !defined(_di_f_thread_conditions_resize_)
#if !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_)
- f_status_t private_f_thread_conditions_adjust(const f_number_unsigned_t length, f_thread_conditions_t * const conditions) {
+ f_status_t private_f_thread_conditions_adjust(const f_number_unsigned_t length, f_thread_conditions_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < conditions->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_condition_delete(&conditions->array[i]);
+ status = private_f_thread_condition_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_adjust(length, sizeof(f_thread_condition_t), (void **) &conditions->array, &conditions->used, &conditions->size);
+ return f_memory_array_adjust(length, sizeof(f_thread_condition_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_)
#if !defined(_di_f_thread_conditions_decrease_) || !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_)
- f_status_t private_f_thread_conditions_resize(const f_number_unsigned_t length, f_thread_conditions_t * const conditions) {
+ f_status_t private_f_thread_conditions_resize(const f_number_unsigned_t length, f_thread_conditions_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < conditions->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_condition_delete(&conditions->array[i]);
+ status = private_f_thread_condition_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_resize(length, sizeof(f_thread_condition_t), (void **) &conditions->array, &conditions->used, &conditions->size);
+ return f_memory_array_resize(length, sizeof(f_thread_condition_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_conditions_decrease_) || !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_)
*
* @param length
* The new size to use.
- * @param conditions
+ * @param structure
* The conditions to adjust.
*
* @return
* @see f_thread_conditions_resize()
*/
#if !defined(_di_f_thread_condition_delete_) || !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_) || !defined(_di_f_thread_conditions_decrease_) || !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_) || !defined(_di_f_thread_conditions_resize_)
- extern f_status_t private_f_thread_condition_delete(f_thread_condition_t *condition) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_condition_delete(f_thread_condition_t *structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_condition_delete_) || !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_) || !defined(_di_f_thread_conditions_decrease_) || !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_) || !defined(_di_f_thread_conditions_resize_)
/**
*
* @param length
* The new size to use.
- * @param conditions
+ * @param structure
* The conditions to adjust.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_adjust()
* @see f_thread_conditions_adjust()
* @see f_thread_conditions_decimate_by()
*/
#if !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_)
- extern f_status_t private_f_thread_conditions_adjust(const f_number_unsigned_t length, f_thread_conditions_t * const conditions) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_conditions_adjust(const f_number_unsigned_t length, f_thread_conditions_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_conditions_adjust_) || !defined(_di_f_thread_conditions_decimate_by_)
/**
*
* @param length
* The new size to use.
- * @param conditions
+ * @param structure
* The conditions to resize.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_resize()
* @see f_thread_conditions_decrease_by()
* @see f_thread_conditions_increase()
* @see f_thread_conditions_increase_by()
*/
#if !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_)
- extern f_status_t private_f_thread_conditions_resize(const f_number_unsigned_t length, f_thread_conditions_t * const conditions) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_conditions_resize(const f_number_unsigned_t length, f_thread_conditions_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_conditions_decrease_by_) || !defined(_di_f_thread_conditions_increase_) || !defined(_di_f_thread_conditions_increase_by_)
#ifdef __cplusplus
#endif // !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_) || !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_) || !defined(_di_f_thread_condition_attributes_resize_)
#if !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_)
- f_status_t private_f_thread_condition_attributes_adjust(const f_number_unsigned_t length, f_thread_condition_attributes_t * const attributes) {
+ f_status_t private_f_thread_condition_attributes_adjust(const f_number_unsigned_t length, f_thread_condition_attributes_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_condition_attribute_delete(&attributes->array[i]);
+ status = private_f_thread_condition_attribute_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_adjust(length, sizeof(f_thread_condition_attribute_t), (void **) &attributes->array, &attributes->used, &attributes->size);
+ return f_memory_array_adjust(length, sizeof(f_thread_condition_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_)
#if !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_)
- f_status_t private_f_thread_condition_attributes_resize(const f_number_unsigned_t length, f_thread_condition_attributes_t * const attributes) {
+ f_status_t private_f_thread_condition_attributes_resize(const f_number_unsigned_t length, f_thread_condition_attributes_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_condition_attribute_delete(&attributes->array[i]);
+ status = private_f_thread_condition_attribute_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_resize(length, sizeof(f_thread_condition_attribute_t), (void **) &attributes->array, &attributes->used, &attributes->size);
+ return f_memory_array_resize(length, sizeof(f_thread_condition_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_)
*
* @param length
* The new size to use.
- * @param attribute
- * The attribute to adjust.
+ * @param structure
+ * The attribute to delete.
*
* @return
* F_none on success.
* @see f_thread_condition_attributes_resize()
*/
#if !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_) || !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_) || !defined(_di_f_thread_condition_attributes_resize_)
- extern f_status_t private_f_thread_condition_attribute_delete(f_thread_condition_attribute_t *attribute) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_condition_attribute_delete(f_thread_condition_attribute_t *structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_) || !defined(_di_f_thread_condition_attributes_decrease_) || !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_) || !defined(_di_f_thread_condition_attributes_resize_)
/**
*
* @param length
* The new size to use.
- * @param attributes
- * The attributes to adjust.
+ * @param structure
+ * The condition_attributes to adjust.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_adjust()
* @see f_thread_condition_attributes_adjust()
* @see f_thread_condition_attributes_decimate_by()
*/
#if !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_)
- extern f_status_t private_f_thread_condition_attributes_adjust(const f_number_unsigned_t length, f_thread_condition_attributes_t * const attributes) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_condition_attributes_adjust(const f_number_unsigned_t length, f_thread_condition_attributes_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_condition_attributes_adjust_) || !defined(_di_f_thread_condition_attributes_decimate_by_)
/**
*
* @param length
* The new size to use.
- * @param attributes
- * The attributes to resize.
+ * @param structure
+ * The condition_attributes to resize.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_resize()
* @see f_thread_condition_attributes_decrease_by()
* @see f_thread_condition_attributes_increase()
* @see f_thread_condition_attributes_increase_by()
*/
#if !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_)
- extern f_status_t private_f_thread_condition_attributes_resize(const f_number_unsigned_t length, f_thread_condition_attributes_t * const attributes) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_condition_attributes_resize(const f_number_unsigned_t length, f_thread_condition_attributes_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_condition_attributes_decrease_by_) || !defined(_di_f_thread_condition_attributes_increase_) || !defined(_di_f_thread_condition_attributes_increase_by_)
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(_di_f_thread_ids_adjust_) || !defined(_di_f_thread_ids_decimate_by_)
- f_status_t private_f_thread_ids_adjust(const f_number_unsigned_t length, f_thread_ids_t * const ids) {
-
- if (ids->size) {
- memset(ids->array, 0, sizeof(f_thread_id_t) * ids->size);
- }
-
- return f_memory_array_adjust(length, sizeof(f_thread_id_t), (void **) &ids->array, &ids->used, &ids->size);
- }
-#endif // !defined(_di_f_thread_ids_adjust_) || !defined(_di_f_thread_ids_decimate_by_)
-
-#if !defined(_di_f_thread_ids_decrease_) || !defined(_di_f_thread_ids_decrease_by_) || !defined(_di_f_thread_ids_increase_) || !defined(_di_f_thread_ids_increase_by_)
- f_status_t private_f_thread_ids_resize(const f_number_unsigned_t length, f_thread_ids_t * const ids) {
-
- return f_memory_array_resize(length, sizeof(f_thread_id_t), (void **) &ids->array, &ids->used, &ids->size);
- }
-#endif // !defined(_di_f_thread_ids_decrease_) || !defined(_di_f_thread_ids_decrease_by_) || !defined(_di_f_thread_ids_increase_) || !defined(_di_f_thread_ids_increase_by_)
-
#ifdef __cplusplus
} // extern "C"
#endif
extern "C" {
#endif
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param ids
- * The ids to adjust.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_thread_ids_adjust()
- * @see f_thread_ids_decimate_by()
- */
-#if !defined(_di_f_thread_ids_adjust_) || !defined(_di_f_thread_ids_decimate_by_)
- extern f_status_t private_f_thread_ids_adjust(const f_number_unsigned_t length, f_thread_ids_t * const ids) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_ids_adjust_) || !defined(_di_f_thread_ids_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param ids
- * The ids to resize.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_thread_ids_decrease_by()
- * @see f_thread_ids_increase()
- * @see f_thread_ids_increase_by()
- */
-#if !defined(_di_f_thread_ids_decrease_by_) || !defined(_di_f_thread_ids_increase_) || !defined(_di_f_thread_ids_increase_by_)
- extern f_status_t private_f_thread_ids_resize(const f_number_unsigned_t length, f_thread_ids_t * const ids) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_ids_decrease_by_) || !defined(_di_f_thread_ids_increase_) || !defined(_di_f_thread_ids_increase_by_)
-
#ifdef __cplusplus
} // extern "C"
#endif
#endif
#if !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_) || !defined(_di_f_thread_keys_decrease_) || !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_) || !defined(_di_f_thread_keys_resize_)
- f_status_t private_f_thread_key_delete(f_thread_key_t *key) {
+ f_status_t private_f_thread_key_delete(f_thread_key_t *structure) {
- if (pthread_key_delete(*key)) return F_status_set_error(F_failure);
+ if (pthread_key_delete(*structure)) return F_status_set_error(F_failure);
- *key = 0;
+ *structure = 0;
return F_none;
}
#endif // !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_) || !defined(_di_f_thread_keys_decrease_) || !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_) || !defined(_di_f_thread_keys_resize_)
#if !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_)
- f_status_t private_f_thread_keys_adjust(const f_number_unsigned_t length, f_thread_keys_t * const keys) {
+ f_status_t private_f_thread_keys_adjust(const f_number_unsigned_t length, f_thread_keys_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < keys->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_key_delete(&keys->array[i]);
+ status = private_f_thread_key_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_adjust(length, sizeof(f_thread_key_t), (void **) &keys->array, &keys->used, &keys->size);
+ return f_memory_array_adjust(length, sizeof(f_thread_key_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_)
#if !defined(_di_f_thread_keys_decrease_) || !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_)
- f_status_t private_f_thread_keys_resize(const f_number_unsigned_t length, f_thread_keys_t * const keys) {
+ f_status_t private_f_thread_keys_resize(const f_number_unsigned_t length, f_thread_keys_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < keys->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_key_delete(&keys->array[i]);
+ status = private_f_thread_key_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_resize(length, sizeof(f_thread_key_t), (void **) &keys->array, &keys->used, &keys->size);
+ return f_memory_array_resize(length, sizeof(f_thread_key_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_keys_decrease_) || !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_)
*
* Intended to be shared to each of the different implementation variations.
*
- * @param key
- * The keys to delete.
+ * @param structure
+ * The key to delete.
*
* @return
* F_none on success.
* @see f_thread_keys_resize()
*/
#if !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_) || !defined(_di_f_thread_keys_decrease_) || !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_) || !defined(_di_f_thread_keys_resize_)
- extern f_status_t private_f_thread_key_delete(f_thread_key_t *key) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_key_delete(f_thread_key_t *structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_) || !defined(_di_f_thread_keys_decrease_) || !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_) || !defined(_di_f_thread_keys_resize_)
/**
*
* @param length
* The new size to use.
- * @param keys
+ * @param structure
* The keys to adjust.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_adjust()
* @see f_thread_keys_adjust()
* @see f_thread_keys_decimate_by()
*/
#if !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_)
- extern f_status_t private_f_thread_keys_adjust(const f_number_unsigned_t length, f_thread_keys_t * const keys) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_keys_adjust(const f_number_unsigned_t length, f_thread_keys_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_keys_adjust_) || !defined(_di_f_thread_keys_decimate_by_)
/**
*
* @param length
* The new size to use.
- * @param keys
+ * @param structure
* The keys to resize.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_resize()
* @see f_thread_keys_decrease_by()
* @see f_thread_keys_increase()
* @see f_thread_keys_increase_by()
*/
#if !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_)
- extern f_status_t private_f_thread_keys_resize(const f_number_unsigned_t length, f_thread_keys_t * const keys) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_keys_resize(const f_number_unsigned_t length, f_thread_keys_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_keys_decrease_by_) || !defined(_di_f_thread_keys_increase_) || !defined(_di_f_thread_keys_increase_by_)
#ifdef __cplusplus
#endif
#if !defined(_di_f_thread_lock_delete_) || !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_) || !defined(_di_f_thread_locks_decrease_) || !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_) || !defined(_di_f_thread_locks_resize_)
- f_status_t private_f_thread_lock_delete(f_thread_lock_t *lock) {
+ f_status_t private_f_thread_lock_delete(f_thread_lock_t *structure) {
- const int error = pthread_rwlock_destroy(lock);
+ const int error = pthread_rwlock_destroy(structure);
if (error) {
if (error == EBUSY) return F_status_set_error(F_busy);
#endif // !defined(_di_f_thread_lock_delete_) || !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_) || !defined(_di_f_thread_locks_decrease_) || !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_) || !defined(_di_f_thread_locks_resize_)
#if !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_)
- f_status_t private_f_thread_locks_adjust(const f_number_unsigned_t length, f_thread_locks_t * const locks) {
+ f_status_t private_f_thread_locks_adjust(const f_number_unsigned_t length, f_thread_locks_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < locks->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_lock_delete(&locks->array[i]);
+ status = private_f_thread_lock_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_adjust(length, sizeof(f_thread_lock_t), (void **) &locks->array, &locks->used, &locks->size);
+ return f_memory_array_adjust(length, sizeof(f_thread_lock_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_)
#if !defined(_di_f_thread_locks_decrease_) || !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_)
- f_status_t private_f_thread_locks_resize(const f_number_unsigned_t length, f_thread_locks_t * const locks) {
+ f_status_t private_f_thread_locks_resize(const f_number_unsigned_t length, f_thread_locks_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < locks->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_lock_delete(&locks->array[i]);
+ status = private_f_thread_lock_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_resize(length, sizeof(f_thread_lock_t), (void **) &locks->array, &locks->used, &locks->size);
+ return f_memory_array_resize(length, sizeof(f_thread_lock_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_locks_decrease_) || !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_)
*
* Intended to be shared to each of the different implementation variations.
*
- * @param lock
- * The locks to delete.
+ * @param structure
+ * The lock to delete.
*
* @return
* F_none on success.
* @see f_thread_locks_resize()
*/
#if !defined(_di_f_thread_lock_delete_) || !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_) || !defined(_di_f_thread_locks_decrease_) || !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_) || !defined(_di_f_thread_locks_resize_)
- extern f_status_t private_f_thread_lock_delete(f_thread_lock_t *lock) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_lock_delete(f_thread_lock_t *structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_lock_delete_) || !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_) || !defined(_di_f_thread_locks_decrease_) || !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_) || !defined(_di_f_thread_locks_resize_)
/**
*
* @param length
* The new size to use.
- * @param locks
+ * @param structure
* The locks to adjust.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_adjust()
* @see f_thread_locks_adjust()
* @see f_thread_locks_decimate_by()
*/
#if !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_)
- extern f_status_t private_f_thread_locks_adjust(const f_number_unsigned_t length, f_thread_locks_t * const locks) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_locks_adjust(const f_number_unsigned_t length, f_thread_locks_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_locks_adjust_) || !defined(_di_f_thread_locks_decimate_by_)
/**
*
* @param length
* The new size to use.
- * @param locks
+ * @param structure
* The locks to resize.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_resize()
* @see f_thread_locks_decrease_by()
* @see f_thread_locks_increase()
* @see f_thread_locks_increase_by()
*/
#if !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_)
- extern f_status_t private_f_thread_locks_resize(const f_number_unsigned_t length, f_thread_locks_t * const locks) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_locks_resize(const f_number_unsigned_t length, f_thread_locks_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_locks_decrease_by_) || !defined(_di_f_thread_locks_increase_) || !defined(_di_f_thread_locks_increase_by_)
#ifdef __cplusplus
#endif
#if !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_) || !defined(_di_f_thread_lock_attributes_decrease_) || !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_) || !defined(_di_f_thread_lock_attributes_resize_)
- f_status_t private_f_thread_lock_attribute_delete(f_thread_lock_attribute_t *attribute) {
+ f_status_t private_f_thread_lock_attribute_delete(f_thread_lock_attribute_t *structure) {
- const int error = pthread_rwlockattr_destroy(attribute);
+ const int error = pthread_rwlockattr_destroy(structure);
if (error) {
if (error == EBUSY) return F_status_set_error(F_busy);
#endif // !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_) || !defined(_di_f_thread_lock_attributes_decrease_) || !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_) || !defined(_di_f_thread_lock_attributes_resize_)
#if !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_)
- f_status_t private_f_thread_lock_attributes_adjust(const f_number_unsigned_t length, f_thread_lock_attributes_t * const attributes) {
+ f_status_t private_f_thread_lock_attributes_adjust(const f_number_unsigned_t length, f_thread_lock_attributes_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_lock_attribute_delete(&attributes->array[i]);
+ status = private_f_thread_lock_attribute_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_adjust(length, sizeof(f_thread_lock_attribute_t), (void **) &attributes->array, &attributes->used, &attributes->size);
+ return f_memory_array_adjust(length, sizeof(f_thread_lock_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_)
#if !defined(_di_f_thread_lock_attributes_decrease_) || !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_)
- f_status_t private_f_thread_lock_attributes_resize(const f_number_unsigned_t length, f_thread_lock_attributes_t * const attributes) {
+ f_status_t private_f_thread_lock_attributes_resize(const f_number_unsigned_t length, f_thread_lock_attributes_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_lock_attribute_delete(&attributes->array[i]);
+ status = private_f_thread_lock_attribute_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_resize(length, sizeof(f_thread_lock_attribute_t), (void **) &attributes->array, &attributes->used, &attributes->size);
+ return f_memory_array_resize(length, sizeof(f_thread_lock_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_lock_attributes_decrease_) || !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_)
*
* Intended to be shared to each of the different implementation variations.
*
- * @param attribute
+ * @param structure
* The attribute to delete.
*
* @return
* @see f_thread_lock_attributes_resize()
*/
#if !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_) || !defined(_di_f_thread_lock_attributes_decrease_) || !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_) || !defined(_di_f_thread_lock_attributes_resize_)
- extern f_status_t private_f_thread_lock_attribute_delete(f_thread_lock_attribute_t *attribute) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_lock_attribute_delete(f_thread_lock_attribute_t *structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_) || !defined(_di_f_thread_lock_attributes_decrease_) || !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_) || !defined(_di_f_thread_lock_attributes_resize_)
/**
*
* @param length
* The new size to use.
- * @param attributes
- * The attributes to adjust.
+ * @param structure
+ * The lock_attributes to adjust.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_adjust()
* @see f_thread_lock_attributes_adjust()
* @see f_thread_lock_attributes_decimate_by()
*/
#if !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_)
- extern f_status_t private_f_thread_lock_attributes_adjust(const f_number_unsigned_t length, f_thread_lock_attributes_t * const attributes) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_lock_attributes_adjust(const f_number_unsigned_t length, f_thread_lock_attributes_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_lock_attributes_adjust_) || !defined(_di_f_thread_lock_attributes_decimate_by_)
/**
*
* @param length
* The new size to use.
- * @param attributes
- * The attributes to resize.
+ * @param structure
+ * The lock_attributes to resize.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_resize()
* @see f_thread_lock_attributes_decrease_by()
* @see f_thread_lock_attributes_increase()
* @see f_thread_lock_attributes_increase_by()
*/
#if !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_)
- extern f_status_t private_f_thread_lock_attributes_resize(const f_number_unsigned_t length, f_thread_lock_attributes_t * const attributes) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_lock_attributes_resize(const f_number_unsigned_t length, f_thread_lock_attributes_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_lock_attributes_decrease_by_) || !defined(_di_f_thread_lock_attributes_increase_) || !defined(_di_f_thread_lock_attributes_increase_by_)
#ifdef __cplusplus
#endif
#if !defined(_di_f_thread_mutex_delete_) || !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_) || !defined(_di_f_thread_mutexs_decrease_) || !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_) || !defined(_di_f_thread_mutexs_resize_)
- f_status_t private_f_thread_mutex_delete(f_thread_mutex_t *mutex) {
+ f_status_t private_f_thread_mutex_delete(f_thread_mutex_t *structure) {
- const int error = pthread_mutex_destroy(mutex);
+ const int error = pthread_mutex_destroy(structure);
if (error) {
if (error == EBUSY) return F_status_set_error(F_busy);
#endif // !defined(_di_f_thread_mutex_delete_) || !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_) || !defined(_di_f_thread_mutexs_decrease_) || !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_) || !defined(_di_f_thread_mutexs_resize_)
#if !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_)
- f_status_t private_f_thread_mutexs_adjust(const f_number_unsigned_t length, f_thread_mutexs_t * const mutexs) {
+ f_status_t private_f_thread_mutexs_adjust(const f_number_unsigned_t length, f_thread_mutexs_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < mutexs->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_mutex_delete(&mutexs->array[i]);
+ status = private_f_thread_mutex_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_adjust(length, sizeof(f_thread_mutex_t), (void **) &mutexs->array, &mutexs->used, &mutexs->size);
+ return f_memory_array_adjust(length, sizeof(f_thread_mutex_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_)
#if !defined(_di_f_thread_mutexs_decrease_) || !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_)
- f_status_t private_f_thread_mutexs_resize(const f_number_unsigned_t length, f_thread_mutexs_t * const mutexs) {
+ f_status_t private_f_thread_mutexs_resize(const f_number_unsigned_t length, f_thread_mutexs_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < mutexs->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_mutex_delete(&mutexs->array[i]);
+ status = private_f_thread_mutex_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_resize(length, sizeof(f_thread_mutex_t), (void **) &mutexs->array, &mutexs->used, &mutexs->size);
+ return f_memory_array_resize(length, sizeof(f_thread_mutex_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_mutexs_decrease_) || !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_)
*
* Intended to be shared to each of the different implementation variations.
*
- * @param mutex
- * The mutexs to delete.
+ * @param structure
+ * The mutex to delete.
*
* @return
* F_none on success.
* @see f_thread_mutexs_resize()
*/
#if !defined(_di_f_thread_mutex_delete_) || !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_) || !defined(_di_f_thread_mutexs_decrease_) || !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_) || !defined(_di_f_thread_mutexs_resize_)
- extern f_status_t private_f_thread_mutex_delete(f_thread_mutex_t *mutex) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_mutex_delete(f_thread_mutex_t *structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_mutex_delete_) || !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_) || !defined(_di_f_thread_mutexs_decrease_) || !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_) || !defined(_di_f_thread_mutexs_resize_)
/**
*
* @param length
* The new size to use.
- * @param mutexs
+ * @param structure
* The mutexs to adjust.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_adjust()
* @see f_thread_mutexs_adjust()
* @see f_thread_mutexs_decimate_by()
*/
#if !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_)
- extern f_status_t private_f_thread_mutexs_adjust(const f_number_unsigned_t length, f_thread_mutexs_t * const mutexs) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_mutexs_adjust(const f_number_unsigned_t length, f_thread_mutexs_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_mutexs_adjust_) || !defined(_di_f_thread_mutexs_decimate_by_)
/**
*
* @param length
* The new size to use.
- * @param mutexs
+ * @param structure
* The mutexs to resize.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_resize()
* @see f_thread_mutexs_decrease_by()
* @see f_thread_mutexs_increase()
* @see f_thread_mutexs_increase_by()
*/
#if !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_)
- extern f_status_t private_f_thread_mutexs_resize(const f_number_unsigned_t length, f_thread_mutexs_t * const mutexs) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_mutexs_resize(const f_number_unsigned_t length, f_thread_mutexs_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_mutexs_decrease_by_) || !defined(_di_f_thread_mutexs_increase_) || !defined(_di_f_thread_mutexs_increase_by_)
#ifdef __cplusplus
#endif
#if !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_) || !defined(_di_f_thread_mutex_attributes_decrease_) || !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_) || !defined(_di_f_thread_mutex_attributes_resize_)
- f_status_t private_f_thread_mutex_attribute_delete(f_thread_mutex_attribute_t *attribute) {
+ f_status_t private_f_thread_mutex_attribute_delete(f_thread_mutex_attribute_t *structure) {
- const int error = pthread_mutexattr_destroy(attribute);
+ const int error = pthread_mutexattr_destroy(structure);
if (error) {
if (error == EBUSY) return F_status_set_error(F_busy);
#endif // !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_) || !defined(_di_f_thread_mutex_attributes_decrease_) || !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_) || !defined(_di_f_thread_mutex_attributes_resize_)
#if !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_)
- f_status_t private_f_thread_mutex_attributes_adjust(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const attributes) {
+ f_status_t private_f_thread_mutex_attributes_adjust(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_mutex_attribute_delete(&attributes->array[i]);
+ status = private_f_thread_mutex_attribute_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_adjust(length, sizeof(f_thread_mutex_attribute_t), (void **) &attributes->array, &attributes->used, &attributes->size);
+ return f_memory_array_adjust(length, sizeof(f_thread_mutex_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_)
#if !defined(_di_f_thread_mutex_attributes_decrease_) || !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_)
- f_status_t private_f_thread_mutex_attributes_resize(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const attributes) {
+ f_status_t private_f_thread_mutex_attributes_resize(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < attributes->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_mutex_attribute_delete(&attributes->array[i]);
+ status = private_f_thread_mutex_attribute_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_resize(length, sizeof(f_thread_mutex_attribute_t), (void **) &attributes->array, &attributes->used, &attributes->size);
+ return f_memory_array_resize(length, sizeof(f_thread_mutex_attribute_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_mutex_attributes_decrease_) || !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_)
*
* Intended to be shared to each of the different implementation variations.
*
- * @param attribute
+ * @param structure
* The attribute to delete.
*
* @return
* @see f_thread_mutex_attributes_resize()
*/
#if !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_) || !defined(_di_f_thread_mutex_attributes_decrease_) || !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_) || !defined(_di_f_thread_mutex_attributes_resize_)
- extern f_status_t private_f_thread_mutex_attribute_delete(f_thread_mutex_attribute_t *attribute) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_mutex_attribute_delete(f_thread_mutex_attribute_t *structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_) || !defined(_di_f_thread_mutex_attributes_decrease_) || !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_) || !defined(_di_f_thread_mutex_attributes_resize_)
/**
*
* @param length
* The new size to use.
- * @param attributes
- * The attributes to adjust.
+ * @param structure
+ * The mutex_attributes to adjust.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_adjust()
* @see f_thread_mutex_attributes_adjust()
* @see f_thread_mutex_attributes_decimate_by()
*/
#if !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_)
- extern f_status_t private_f_thread_mutex_attributes_adjust(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const attributes) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_mutex_attributes_adjust(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_mutex_attributes_adjust_) || !defined(_di_f_thread_mutex_attributes_decimate_by_)
/**
*
* @param length
* The new size to use.
- * @param attributes
- * The attributes to resize.
+ * @param structure
+ * The mutex_attributes to resize.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_resize()
* @see f_thread_mutex_attributes_decrease_by()
* @see f_thread_mutex_attributes_increase()
* @see f_thread_mutex_attributes_increase_by()
*/
#if !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_)
- extern f_status_t private_f_thread_mutex_attributes_resize(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const attributes) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_mutex_attributes_resize(const f_number_unsigned_t length, f_thread_mutex_attributes_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_mutex_attributes_decrease_by_) || !defined(_di_f_thread_mutex_attributes_increase_) || !defined(_di_f_thread_mutex_attributes_increase_by_)
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(_di_f_thread_onces_adjust_) || !defined(_di_f_thread_onces_decimate_by_)
- f_status_t private_f_thread_onces_adjust(const f_number_unsigned_t length, f_thread_onces_t * const onces) {
-
- if (onces->size) {
- memset(onces->array, 0, sizeof(f_thread_once_t) * onces->size);
- }
-
- return f_memory_array_adjust(length, sizeof(f_thread_once_t), (void **) &onces->array, &onces->used, &onces->size);
- }
-#endif // !defined(_di_f_thread_onces_adjust_) || !defined(_di_f_thread_onces_decimate_by_)
-
-#if !defined(_di_f_thread_onces_decrease_) || !defined(_di_f_thread_onces_decrease_by_) || !defined(_di_f_thread_onces_increase_) || !defined(_di_f_thread_onces_increase_by_)
- f_status_t private_f_thread_onces_resize(const f_number_unsigned_t length, f_thread_onces_t * const onces) {
-
- return f_memory_array_resize(length, sizeof(f_thread_once_t), (void **) &onces->array, &onces->used, &onces->size);
- }
-#endif // !defined(_di_f_thread_onces_decrease_) || !defined(_di_f_thread_onces_decrease_by_) || !defined(_di_f_thread_onces_increase_) || !defined(_di_f_thread_onces_increase_by_)
-
#ifdef __cplusplus
} // extern "C"
#endif
extern "C" {
#endif
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param onces
- * The onces to adjust.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_memory_adjust()
- * @see f_thread_onces_adjust()
- * @see f_thread_onces_decimate_by()
- */
-#if !defined(_di_f_thread_onces_adjust_) || !defined(_di_f_thread_onces_decimate_by_)
- extern f_status_t private_f_thread_onces_adjust(const f_number_unsigned_t length, f_thread_onces_t * const onces) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_onces_adjust_) || !defined(_di_f_thread_onces_decimate_by_)
-
-/**
- * Private implementation for resizing.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The new size to use.
- * @param onces
- * The onces to resize.
- *
- * @return
- * F_none on success.
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_memory_resize()
- * @see f_thread_onces_decrease_by()
- * @see f_thread_onces_increase()
- * @see f_thread_onces_increase_by()
- */
-#if !defined(_di_f_thread_onces_decrease_by_) || !defined(_di_f_thread_onces_increase_) || !defined(_di_f_thread_onces_increase_by_)
- extern f_status_t private_f_thread_onces_resize(const f_number_unsigned_t length, f_thread_onces_t * const onces) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_thread_onces_decrease_by_) || !defined(_di_f_thread_onces_increase_) || !defined(_di_f_thread_onces_increase_by_)
-
#ifdef __cplusplus
} // extern "C"
#endif
#endif
#if !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_) || !defined(_di_f_thread_semaphores_decrease_) || !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_) || !defined(_di_f_thread_semaphores_resize_)
- f_status_t private_f_thread_semaphore_delete(f_thread_semaphore_t *semaphore) {
+ f_status_t private_f_thread_semaphore_delete(f_thread_semaphore_t *structure) {
- const int result = sem_destroy(semaphore);
+ const int result = sem_destroy(structure);
if (result == -1) {
if (errno == EINVAL) return F_status_set_error(F_parameter);
#endif // !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_) || !defined(_di_f_thread_semaphores_decrease_) || !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_) || !defined(_di_f_thread_semaphores_resize_)
#if !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_)
- f_status_t private_f_thread_semaphores_adjust(const f_number_unsigned_t length, f_thread_semaphores_t * const semaphores) {
+ f_status_t private_f_thread_semaphores_adjust(const f_number_unsigned_t length, f_thread_semaphores_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < semaphores->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_semaphore_delete(&semaphores->array[i]);
+ status = private_f_thread_semaphore_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_adjust(length, sizeof(f_thread_semaphore_t), (void **) &semaphores->array, &semaphores->used, &semaphores->size);
+ return f_memory_array_adjust(length, sizeof(f_thread_semaphore_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_)
#if !defined(_di_f_thread_semaphores_decrease_) || !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_)
- f_status_t private_f_thread_semaphores_resize(const f_number_unsigned_t length, f_thread_semaphores_t * const semaphores) {
+ f_status_t private_f_thread_semaphores_resize(const f_number_unsigned_t length, f_thread_semaphores_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < semaphores->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_semaphore_delete(&semaphores->array[i]);
+ status = private_f_thread_semaphore_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_resize(length, sizeof(f_thread_semaphore_t), (void **) &semaphores->array, &semaphores->used, &semaphores->size);
+ return f_memory_array_resize(length, sizeof(f_thread_semaphore_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_semaphores_decrease_) || !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_)
*
* Intended to be shared to each of the different implementation variations.
*
- * @param semaphore
+ * @param structure
* The semaphores to delete.
*
* @return
* @see f_thread_semaphores_resize()
*/
#if !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_) || !defined(_di_f_thread_semaphores_decrease_) || !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_) || !defined(_di_f_thread_semaphores_resize_)
- extern f_status_t private_f_thread_semaphore_delete(f_thread_semaphore_t *semaphore) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_semaphore_delete(f_thread_semaphore_t *structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_) || !defined(_di_f_thread_semaphores_decrease_) || !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_) || !defined(_di_f_thread_semaphores_resize_)
/**
*
* @param length
* The new size to use.
- * @param semaphores
+ * @param structure
* The semaphores to adjust.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_adjust()
* @see f_thread_semaphores_adjust()
* @see f_thread_semaphores_decimate_by()
*/
#if !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_)
- extern f_status_t private_f_thread_semaphores_adjust(const f_number_unsigned_t length, f_thread_semaphores_t * const semaphores) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_semaphores_adjust(const f_number_unsigned_t length, f_thread_semaphores_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_semaphores_adjust_) || !defined(_di_f_thread_semaphores_decimate_by_)
/**
*
* @param length
* The new size to use.
- * @param semaphores
+ * @param structure
* The semaphores to resize.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_resize()
* @see f_thread_semaphores_decrease_by()
* @see f_thread_semaphores_increase()
* @see f_thread_semaphores_increase_by()
*/
#if !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_)
- extern f_status_t private_f_thread_semaphores_resize(const f_number_unsigned_t length, f_thread_semaphores_t * const semaphores) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_semaphores_resize(const f_number_unsigned_t length, f_thread_semaphores_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_semaphores_decrease_by_) || !defined(_di_f_thread_semaphores_increase_) || !defined(_di_f_thread_semaphores_increase_by_)
#ifdef __cplusplus
#endif
#if !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_)
- f_status_t private_f_thread_sets_adjust(const f_number_unsigned_t length, f_thread_sets_t * const sets) {
+ f_status_t private_f_thread_sets_adjust(const f_number_unsigned_t length, f_thread_sets_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < sets->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_attribute_delete(&sets->array[i].attribute);
+ status = private_f_thread_attribute_delete(&structure->array[i].attribute);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_adjust(length, sizeof(f_thread_set_t), (void **) &sets->array, &sets->used, &sets->size);
+ return f_memory_array_adjust(length, sizeof(f_thread_set_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_)
#if !defined(_di_f_thread_sets_decrease_) || !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_)
- f_status_t private_f_thread_sets_resize(const f_number_unsigned_t length, f_thread_sets_t * const sets) {
+ f_status_t private_f_thread_sets_resize(const f_number_unsigned_t length, f_thread_sets_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < sets->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_attribute_delete(&sets->array[i].attribute);
+ status = private_f_thread_attribute_delete(&structure->array[i].attribute);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_resize(length, sizeof(f_thread_set_t), (void **) &sets->array, &sets->used, &sets->size);
+ return f_memory_array_resize(length, sizeof(f_thread_set_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_sets_decrease_) || !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_)
*
* @param length
* The new size to use.
- * @param sets
+ * @param structure
* The sets to adjust.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_adjust()
* @see f_thread_sets_adjust()
* @see f_thread_sets_decimate_by()
*/
#if !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_)
- extern f_status_t private_f_thread_sets_adjust(const f_number_unsigned_t length, f_thread_sets_t * const sets) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_sets_adjust(const f_number_unsigned_t length, f_thread_sets_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_sets_adjust_) || !defined(_di_f_thread_sets_decimate_by_)
/**
*
* @param length
* The new size to use.
- * @param sets
+ * @param structure
* The sets to resize.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_resize()
* @see f_thread_sets_decrease_by()
* @see f_thread_sets_increase()
* @see f_thread_sets_increase_by()
*/
#if !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_)
- extern f_status_t private_f_thread_sets_resize(const f_number_unsigned_t length, f_thread_sets_t * const sets) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_sets_resize(const f_number_unsigned_t length, f_thread_sets_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_sets_decrease_by_) || !defined(_di_f_thread_sets_increase_) || !defined(_di_f_thread_sets_increase_by_)
#ifdef __cplusplus
#endif
#if !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_) || !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_) || !defined(_di_f_thread_spins_resize_)
- f_status_t private_f_thread_spin_delete(f_thread_spin_t *spin) {
+ f_status_t private_f_thread_spin_delete(f_thread_spin_t *structure) {
- const int error = pthread_spin_destroy(spin);
+ const int error = pthread_spin_destroy(structure);
if (error) {
if (error == EBUSY) return F_status_set_error(F_busy);
#endif // !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_) || !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_) || !defined(_di_f_thread_spins_resize_)
#if !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_)
- f_status_t private_f_thread_spins_adjust(const f_number_unsigned_t length, f_thread_spins_t * const spins) {
+ f_status_t private_f_thread_spins_adjust(const f_number_unsigned_t length, f_thread_spins_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < spins->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_spin_delete(&spins->array[i]);
+ status = private_f_thread_spin_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_adjust(length, sizeof(f_thread_spin_t), (void **) &spins->array, &spins->used, &spins->size);
+ return f_memory_array_adjust(length, sizeof(f_thread_spin_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_)
#if !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_)
- f_status_t private_f_thread_spins_resize(const f_number_unsigned_t length, f_thread_spins_t * const spins) {
+ f_status_t private_f_thread_spins_resize(const f_number_unsigned_t length, f_thread_spins_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < spins->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = private_f_thread_spin_delete(&spins->array[i]);
+ status = private_f_thread_spin_delete(&structure->array[i]);
if (F_status_is_error(status)) return status;
} // for
- return f_memory_array_resize(length, sizeof(f_thread_spin_t), (void **) &spins->array, &spins->used, &spins->size);
+ return f_memory_array_resize(length, sizeof(f_thread_spin_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_)
*
* Intended to be shared to each of the different implementation variations.
*
- * @param spin
+ * @param structure
* The spins to delete.
*
* @return
* @see f_thread_spins_resize()
*/
#if !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_) || !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_) || !defined(_di_f_thread_spins_resize_)
- extern f_status_t private_f_thread_spin_delete(f_thread_spin_t *spin) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_spin_delete(f_thread_spin_t *structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_) || !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_) || !defined(_di_f_thread_spins_resize_)
/**
*
* @param length
* The new size to use.
- * @param spins
+ * @param structure
* The spins to adjust.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_adjust()
* @see f_thread_spins_adjust()
* @see f_thread_spins_decimate_by()
*/
#if !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_)
- extern f_status_t private_f_thread_spins_adjust(const f_number_unsigned_t length, f_thread_spins_t * const spins) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_spins_adjust(const f_number_unsigned_t length, f_thread_spins_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_spins_adjust_) || !defined(_di_f_thread_spins_decimate_by_)
/**
*
* @param length
* The new size to use.
- * @param spins
+ * @param structure
* The spins to resize.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
- * @see f_memory_resize()
* @see f_thread_spins_decrease_by()
* @see f_thread_spins_increase()
* @see f_thread_spins_increase_by()
*/
#if !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_)
- extern f_status_t private_f_thread_spins_resize(const f_number_unsigned_t length, f_thread_spins_t * const spins) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_thread_spins_resize(const f_number_unsigned_t length, f_thread_spins_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_)
#ifdef __cplusplus
#endif
#ifndef _di_f_thread_semaphores_adjust_
- f_status_t f_thread_semaphores_adjust(const f_number_unsigned_t length, f_thread_semaphores_t * const semaphores) {
+ f_status_t f_thread_semaphores_adjust(const f_number_unsigned_t length, f_thread_semaphores_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!semaphores) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_semaphores_adjust(length, semaphores);
+ return private_f_thread_semaphores_adjust(length, structure);
}
#endif // _di_f_thread_semaphores_adjust_
#ifndef _di_f_thread_semaphores_decimate_by_
- f_status_t f_thread_semaphores_decimate_by(const f_number_unsigned_t amount, f_thread_semaphores_t * const semaphores) {
+ f_status_t f_thread_semaphores_decimate_by(const f_number_unsigned_t amount, f_thread_semaphores_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!semaphores) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- return private_f_thread_semaphores_adjust((semaphores->size > amount) ? semaphores->size - amount : 0, semaphores);
+ return private_f_thread_semaphores_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_semaphores_decimate_by_
#ifndef _di_f_thread_semaphores_decrease_by_
- f_status_t f_thread_semaphores_decrease_by(const f_number_unsigned_t amount, f_thread_semaphores_t * const semaphores) {
+ f_status_t f_thread_semaphores_decrease_by(const f_number_unsigned_t amount, f_thread_semaphores_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!semaphores) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- return private_f_thread_semaphores_resize((semaphores->size > amount) ? semaphores->size - amount : 0, semaphores);
+ return private_f_thread_semaphores_resize((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_semaphores_decrease_by_
#ifndef _di_f_thread_semaphores_increase_
- f_status_t f_thread_semaphores_increase(const f_number_unsigned_t step, f_thread_semaphores_t * const semaphores) {
+ f_status_t f_thread_semaphores_increase(const f_number_unsigned_t step, f_thread_semaphores_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!semaphores) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && semaphores->used + 1 > semaphores->size) {
- f_number_unsigned_t size = semaphores->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (semaphores->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_thread_semaphores_resize(size, semaphores);
+ return private_f_thread_semaphores_resize(length, structure);
}
return F_data_not;
#endif // _di_f_thread_semaphores_increase_
#ifndef _di_f_thread_semaphores_increase_by_
- f_status_t f_thread_semaphores_increase_by(const f_number_unsigned_t amount, f_thread_semaphores_t * const semaphores) {
+ f_status_t f_thread_semaphores_increase_by(const f_number_unsigned_t amount, f_thread_semaphores_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!semaphores) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (amount) {
- if (semaphores->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- const f_number_unsigned_t length = semaphores->used + amount;
+ const f_number_unsigned_t length = structure->used + amount;
- if (length > semaphores->size) {
+ if (length > structure->size) {
if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- return private_f_thread_semaphores_resize(length, semaphores);
+ return private_f_thread_semaphores_resize(length, structure);
}
}
#endif // _di_f_thread_semaphores_increase_by_
#ifndef _di_f_thread_semaphores_resize_
- f_status_t f_thread_semaphores_resize(const f_number_unsigned_t length, f_thread_semaphores_t * const semaphores) {
+ f_status_t f_thread_semaphores_resize(const f_number_unsigned_t length, f_thread_semaphores_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!semaphores) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_semaphores_resize(length, semaphores);
+ return private_f_thread_semaphores_resize(length, structure);
}
#endif // _di_f_thread_semaphores_resize_
*
* @param length
* The new size to use.
- * @param semaphores
- * The string semaphores array to resize.
+ * @param structure
+ * The thread semaphores array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_semaphores_adjust_
- extern f_status_t f_thread_semaphores_adjust(const f_number_unsigned_t length, f_thread_semaphores_t * const semaphores);
+ extern f_status_t f_thread_semaphores_adjust(const f_number_unsigned_t length, f_thread_semaphores_t * const structure);
#endif // _di_f_thread_semaphores_adjust_
/**
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param semaphores
- * The string semaphores array to resize.
+ * @param structure
+ * The thread semaphores array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_semaphores_decimate_by_
- extern f_status_t f_thread_semaphores_decimate_by(const f_number_unsigned_t amount, f_thread_semaphores_t * const semaphores);
+ extern f_status_t f_thread_semaphores_decimate_by(const f_number_unsigned_t amount, f_thread_semaphores_t * const structure);
#endif // _di_f_thread_semaphores_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param semaphores
- * The string semaphores array to resize.
+ * @param structure
+ * The thread semaphores array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_semaphores_decrease_by_
- extern f_status_t f_thread_semaphores_decrease_by(const f_number_unsigned_t amount, f_thread_semaphores_t * const semaphores);
+ extern f_status_t f_thread_semaphores_decrease_by(const f_number_unsigned_t amount, f_thread_semaphores_t * const structure);
#endif // _di_f_thread_semaphores_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param semaphores
- * The string semaphores array to resize.
+ * @param structure
+ * The thread semaphores array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_semaphores_increase_
- extern f_status_t f_thread_semaphores_increase(const f_number_unsigned_t step, f_thread_semaphores_t * const semaphores);
+ extern f_status_t f_thread_semaphores_increase(const f_number_unsigned_t step, f_thread_semaphores_t * const structure);
#endif // _di_f_thread_semaphores_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param semaphores
- * The string semaphores array to resize.
+ * @param structure
+ * The thread semaphores array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_semaphores_increase_by_
- extern f_status_t f_thread_semaphores_increase_by(const f_number_unsigned_t amount, f_thread_semaphores_t * const semaphores);
+ extern f_status_t f_thread_semaphores_increase_by(const f_number_unsigned_t amount, f_thread_semaphores_t * const structure);
#endif // _di_f_thread_semaphores_increase_by_
/**
*
* @param length
* The new size to use.
- * @param semaphores
- * The string semaphores array to adjust.
+ * @param structure
+ * The thread semaphores array to adjust.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_semaphores_resize_
- extern f_status_t f_thread_semaphores_resize(const f_number_unsigned_t length, f_thread_semaphores_t * const semaphores);
+ extern f_status_t f_thread_semaphores_resize(const f_number_unsigned_t length, f_thread_semaphores_t * const structure);
#endif // _di_f_thread_semaphores_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_thread_sets_adjust_
- f_status_t f_thread_sets_adjust(const f_number_unsigned_t length, f_thread_sets_t * const sets) {
+ f_status_t f_thread_sets_adjust(const f_number_unsigned_t length, f_thread_sets_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!sets) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_sets_adjust(length, sets);
+ return private_f_thread_sets_adjust(length, structure);
}
#endif // _di_f_thread_sets_adjust_
#ifndef _di_f_thread_sets_decimate_by_
- f_status_t f_thread_sets_decimate_by(const f_number_unsigned_t amount, f_thread_sets_t * const sets) {
+ f_status_t f_thread_sets_decimate_by(const f_number_unsigned_t amount, f_thread_sets_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!sets) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- return private_f_thread_sets_adjust((sets->size > amount) ? sets->size - amount : 0, sets);
+ return private_f_thread_sets_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_sets_decimate_by_
#ifndef _di_f_thread_sets_decrease_by_
- f_status_t f_thread_sets_decrease_by(const f_number_unsigned_t amount, f_thread_sets_t * const sets) {
+ f_status_t f_thread_sets_decrease_by(const f_number_unsigned_t amount, f_thread_sets_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!sets) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- return private_f_thread_sets_resize((sets->size > amount) ? sets->size - amount : 0, sets);
+ return private_f_thread_sets_resize((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_sets_decrease_by_
#ifndef _di_f_thread_sets_increase_
- f_status_t f_thread_sets_increase(const f_number_unsigned_t step, f_thread_sets_t * const sets) {
+ f_status_t f_thread_sets_increase(const f_number_unsigned_t step, f_thread_sets_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!sets) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && sets->used + 1 > sets->size) {
- f_number_unsigned_t size = sets->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (sets->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_thread_sets_resize(size, sets);
+ return private_f_thread_sets_resize(length, structure);
}
return F_data_not;
#endif // _di_f_thread_sets_increase_
#ifndef _di_f_thread_sets_increase_by_
- f_status_t f_thread_sets_increase_by(const f_number_unsigned_t amount, f_thread_sets_t * const sets) {
+ f_status_t f_thread_sets_increase_by(const f_number_unsigned_t amount, f_thread_sets_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!sets) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (amount) {
- if (sets->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- const f_number_unsigned_t length = sets->used + amount;
+ const f_number_unsigned_t length = structure->used + amount;
- if (length > sets->size) {
+ if (length > structure->size) {
if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- return private_f_thread_sets_resize(length, sets);
+ return private_f_thread_sets_resize(length, structure);
}
}
#endif // _di_f_thread_sets_increase_by_
#ifndef _di_f_thread_sets_resize_
- f_status_t f_thread_sets_resize(const f_number_unsigned_t length, f_thread_sets_t * const sets) {
+ f_status_t f_thread_sets_resize(const f_number_unsigned_t length, f_thread_sets_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!sets) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_sets_resize(length, sets);
+ return private_f_thread_sets_resize(length, structure);
}
#endif // _di_f_thread_sets_resize_
*
* @param length
* The new size to use.
- * @param sets
- * The string sets array to resize.
+ * @param structure
+ * The thread sets array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_sets_adjust_
- extern f_status_t f_thread_sets_adjust(const f_number_unsigned_t length, f_thread_sets_t * const sets);
+ extern f_status_t f_thread_sets_adjust(const f_number_unsigned_t length, f_thread_sets_t * const structure);
#endif // _di_f_thread_sets_adjust_
/**
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param sets
- * The string sets array to resize.
+ * @param structure
+ * The thread sets array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_sets_decimate_by_
- extern f_status_t f_thread_sets_decimate_by(const f_number_unsigned_t amount, f_thread_sets_t * const sets);
+ extern f_status_t f_thread_sets_decimate_by(const f_number_unsigned_t amount, f_thread_sets_t * const structure);
#endif // _di_f_thread_sets_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param sets
- * The string sets array to resize.
+ * @param structure
+ * The thread sets array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_sets_decrease_by_
- extern f_status_t f_thread_sets_decrease_by(const f_number_unsigned_t amount, f_thread_sets_t * const sets);
+ extern f_status_t f_thread_sets_decrease_by(const f_number_unsigned_t amount, f_thread_sets_t * const structure);
#endif // _di_f_thread_sets_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param sets
- * The string sets array to resize.
+ * @param structure
+ * The thread sets array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_sets_increase_
- extern f_status_t f_thread_sets_increase(const f_number_unsigned_t step, f_thread_sets_t * const sets);
+ extern f_status_t f_thread_sets_increase(const f_number_unsigned_t step, f_thread_sets_t * const structure);
#endif // _di_f_thread_sets_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param sets
- * The string sets array to resize.
+ * @param structure
+ * The thread sets array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_sets_increase_by_
- extern f_status_t f_thread_sets_increase_by(const f_number_unsigned_t amount, f_thread_sets_t * const sets);
+ extern f_status_t f_thread_sets_increase_by(const f_number_unsigned_t amount, f_thread_sets_t * const structure);
#endif // _di_f_thread_sets_increase_by_
/**
*
* @param length
* The new size to use.
- * @param sets
- * The string sets array to adjust.
+ * @param structure
+ * The thread sets array to adjust.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_sets_resize_
- extern f_status_t f_thread_sets_resize(const f_number_unsigned_t length, f_thread_sets_t * const sets);
+ extern f_status_t f_thread_sets_resize(const f_number_unsigned_t length, f_thread_sets_t * const structure);
#endif // _di_f_thread_sets_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_thread_spins_adjust_
- f_status_t f_thread_spins_adjust(const f_number_unsigned_t length, f_thread_spins_t * const spins) {
+ f_status_t f_thread_spins_adjust(const f_number_unsigned_t length, f_thread_spins_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!spins) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_spins_adjust(length, spins);
+ return private_f_thread_spins_adjust(length, structure);
}
#endif // _di_f_thread_spins_adjust_
#ifndef _di_f_thread_spins_decimate_by_
- f_status_t f_thread_spins_decimate_by(const f_number_unsigned_t amount, f_thread_spins_t * const spins) {
+ f_status_t f_thread_spins_decimate_by(const f_number_unsigned_t amount, f_thread_spins_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!spins) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- return private_f_thread_spins_adjust((spins->size > amount) ? spins->size - amount : 0, spins);
+ return private_f_thread_spins_adjust((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_spins_decimate_by_
#ifndef _di_f_thread_spins_decrease_by_
- f_status_t f_thread_spins_decrease_by(const f_number_unsigned_t amount, f_thread_spins_t * const spins) {
+ f_status_t f_thread_spins_decrease_by(const f_number_unsigned_t amount, f_thread_spins_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!spins) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- return private_f_thread_spins_resize((spins->size > amount) ? spins->size - amount : 0, spins);
+ return private_f_thread_spins_resize((structure->size > amount) ? structure->size - amount : 0, structure);
}
#endif // _di_f_thread_spins_decrease_by_
#ifndef _di_f_thread_spins_increase_
- f_status_t f_thread_spins_increase(const f_number_unsigned_t step, f_thread_spins_t * const spins) {
+ f_status_t f_thread_spins_increase(const f_number_unsigned_t step, f_thread_spins_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!spins) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && spins->used + 1 > spins->size) {
- f_number_unsigned_t size = spins->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (spins->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_thread_spins_resize(size, spins);
+ return private_f_thread_spins_resize(length, structure);
}
return F_data_not;
#endif // _di_f_thread_spins_increase_
#ifndef _di_f_thread_spins_increase_by_
- f_status_t f_thread_spins_increase_by(const f_number_unsigned_t amount, f_thread_spins_t * const spins) {
+ f_status_t f_thread_spins_increase_by(const f_number_unsigned_t amount, f_thread_spins_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!spins) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (amount) {
- if (spins->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- const f_number_unsigned_t length = spins->used + amount;
+ const f_number_unsigned_t length = structure->used + amount;
- if (length > spins->size) {
+ if (length > structure->size) {
if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- return private_f_thread_spins_resize(length, spins);
+ return private_f_thread_spins_resize(length, structure);
}
}
#endif // _di_f_thread_spins_increase_by_
#ifndef _di_f_thread_spins_resize_
- f_status_t f_thread_spins_resize(const f_number_unsigned_t length, f_thread_spins_t * const spins) {
+ f_status_t f_thread_spins_resize(const f_number_unsigned_t length, f_thread_spins_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!spins) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_thread_spins_resize(length, spins);
+ return private_f_thread_spins_resize(length, structure);
}
#endif // _di_f_thread_spins_resize_
#endif // _di_f_thread_spins_t_
/**
- * Resize the thread spin locks array.
+ * Resize the thread spins array.
*
* @param length
* The new size to use.
- * @param spins
- * The string spins array to resize.
+ * @param structure
+ * The thread spins array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_spins_adjust_
- extern f_status_t f_thread_spins_adjust(const f_number_unsigned_t length, f_thread_spins_t * const spins);
+ extern f_status_t f_thread_spins_adjust(const f_number_unsigned_t length, f_thread_spins_t * const structure);
#endif // _di_f_thread_spins_adjust_
/**
- * Resize the thread spin locks array to a smaller size.
+ * Resize the thread spins array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param spins
- * The string spins array to resize.
+ * @param structure
+ * The thread spins array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_spins_decimate_by_
- extern f_status_t f_thread_spins_decimate_by(const f_number_unsigned_t amount, f_thread_spins_t * const spins);
+ extern f_status_t f_thread_spins_decimate_by(const f_number_unsigned_t amount, f_thread_spins_t * const structure);
#endif // _di_f_thread_spins_decimate_by_
/**
- * Resize the thread spin locks array to a smaller size.
+ * Resize the thread spins array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param spins
- * The string spins array to resize.
+ * @param structure
+ * The thread spins array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_spins_decrease_by_
- extern f_status_t f_thread_spins_decrease_by(const f_number_unsigned_t amount, f_thread_spins_t * const spins);
+ extern f_status_t f_thread_spins_decrease_by(const f_number_unsigned_t amount, f_thread_spins_t * const structure);
#endif // _di_f_thread_spins_decrease_by_
/**
- * Increase the size of the thread spin locks array, but only if necessary.
+ * Increase the size of the thread spins array, but only if necessary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param spins
- * The string spins array to resize.
+ * @param structure
+ * The thread spins array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_spins_increase_
- extern f_status_t f_thread_spins_increase(const f_number_unsigned_t step, f_thread_spins_t * const spins);
+ extern f_status_t f_thread_spins_increase(const f_number_unsigned_t step, f_thread_spins_t * const structure);
#endif // _di_f_thread_spins_increase_
/**
- * Resize the thread spin locks array to a larger size.
+ * Resize the thread spins array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param spins
- * The string spins array to resize.
+ * @param structure
+ * The thread spins array to resize.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_spins_increase_by_
- extern f_status_t f_thread_spins_increase_by(const f_number_unsigned_t amount, f_thread_spins_t * const spins);
+ extern f_status_t f_thread_spins_increase_by(const f_number_unsigned_t amount, f_thread_spins_t * const structure);
#endif // _di_f_thread_spins_increase_by_
/**
- * Resize the thread spin locks array.
+ * Resize the thread spins array.
*
* @param length
* The new size to use.
- * @param spins
- * The string spins array to adjust.
+ * @param structure
+ * The thread spins array to adjust.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_thread_spins_resize_
- extern f_status_t f_thread_spins_resize(const f_number_unsigned_t length, f_thread_spins_t * const spins);
+ extern f_status_t f_thread_spins_resize(const f_number_unsigned_t length, f_thread_spins_t * const structure);
#endif // _di_f_thread_spins_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_cells_adjust_
- f_status_t f_cells_adjust(const f_number_unsigned_t length, f_cells_t * const cells) {
+ f_status_t f_cells_adjust(const f_number_unsigned_t length, f_cells_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!cells) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_cells_adjust(length, cells);
+ return f_memory_array_adjust(length, sizeof(f_cell_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_cells_adjust_
#endif // _di_f_cells_append_all_
#ifndef _di_f_cells_decimate_by_
- f_status_t f_cells_decimate_by(const f_number_unsigned_t amount, f_cells_t * const cells) {
+ f_status_t f_cells_decimate_by(const f_number_unsigned_t amount, f_cells_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!cells) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (cells->size - amount > 0) {
- return private_f_cells_adjust(cells->size - amount, cells);
- }
-
- return private_f_cells_adjust(0, cells);
+ return f_memory_array_decimate_by(amount, sizeof(f_cell_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_cells_decimate_by_
#ifndef _di_f_cells_decrease_by_
- f_status_t f_cells_decrease_by(const f_number_unsigned_t amount, f_cells_t * const cells) {
+ f_status_t f_cells_decrease_by(const f_number_unsigned_t amount, f_cells_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!cells) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (cells->size - amount > 0) {
- return private_f_cells_resize(cells->size - amount, cells);
- }
-
- return private_f_cells_resize(0, cells);
+ return f_memory_array_decrease_by(amount, sizeof(f_cell_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_cells_decrease_by_
#ifndef _di_f_cells_increase_
- f_status_t f_cells_increase(const f_number_unsigned_t step, f_cells_t * const cells) {
+ f_status_t f_cells_increase(const f_number_unsigned_t step, f_cells_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!cells) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && cells->used + 1 > cells->size) {
- f_number_unsigned_t size = cells->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (cells->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_cells_resize(size, cells);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(f_cell_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_cells_increase_
#ifndef _di_f_cells_increase_by_
- f_status_t f_cells_increase_by(const f_number_unsigned_t amount, f_cells_t * const cells) {
+ f_status_t f_cells_increase_by(const f_number_unsigned_t amount, f_cells_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!cells) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (cells->used + amount > cells->size) {
- if (cells->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_cells_resize(cells->used + amount, cells);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(f_cell_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_cells_increase_by_
#ifndef _di_f_cells_resize_
- f_status_t f_cells_resize(const f_number_unsigned_t length, f_cells_t * const cells) {
+ f_status_t f_cells_resize(const f_number_unsigned_t length, f_cells_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!cells) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_cells_resize(length, cells);
+ return f_memory_array_resize(length, sizeof(f_cell_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_cells_resize_
#ifndef _di_f_cellss_adjust_
- f_status_t f_cellss_adjust(const f_number_unsigned_t length, f_cellss_t * const cellss) {
+ f_status_t f_cellss_adjust(const f_number_unsigned_t length, f_cellss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!cellss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_cellss_adjust(length, cellss);
+ return private_f_cellss_adjust(length, structure);
}
#endif // _di_f_cellss_adjust_
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_cellss_resize(destination->used + F_memory_default_allocation_small_d, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_cells_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
status = private_f_cells_append_all(source, &destination->array[destination->used]);
if (F_status_is_error(status)) return status;
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_cellss_resize(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_cells_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
#endif // _di_f_cellss_append_all_
#ifndef _di_f_cellss_decimate_by_
- f_status_t f_cellss_decimate_by(const f_number_unsigned_t amount, f_cellss_t * const cellss) {
+ f_status_t f_cellss_decimate_by(const f_number_unsigned_t amount, f_cellss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!cellss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (cellss->size - amount > 0) {
- return private_f_cellss_adjust(cellss->size - amount, cellss);
- }
-
- return private_f_cellss_adjust(0, cellss);
+ return private_f_cellss_adjust((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_cellss_decimate_by_
#ifndef _di_f_cellss_decrease_by_
- f_status_t f_cellss_decrease_by(const f_number_unsigned_t amount, f_cellss_t * const cellss) {
+ f_status_t f_cellss_decrease_by(const f_number_unsigned_t amount, f_cellss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!cellss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (cellss->size - amount > 0) {
- return private_f_cellss_resize(cellss->size - amount, cellss);
- }
-
- return private_f_cellss_resize(0, cellss);
+ return private_f_cellss_resize((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_cellss_decrease_by_
#ifndef _di_f_cellss_increase_
- f_status_t f_cellss_increase(const f_number_unsigned_t step, f_cellss_t * const cellss) {
+ f_status_t f_cellss_increase(const f_number_unsigned_t step, f_cellss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!cellss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && cellss->used + 1 > cellss->size) {
- f_number_unsigned_t size = cellss->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (cellss->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_cellss_resize(size, cellss);
+ return private_f_cellss_resize(length, structure);
}
return F_data_not;
#endif // _di_f_cellss_increase_
#ifndef _di_f_cellss_increase_by_
- f_status_t f_cellss_increase_by(const f_number_unsigned_t amount, f_cellss_t * const cellss) {
+ f_status_t f_cellss_increase_by(const f_number_unsigned_t amount, f_cellss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!cellss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (cellss->used + amount > cellss->size) {
- if (cellss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = structure->used + amount;
- return private_f_cellss_resize(cellss->used + amount, cellss);
+ if (length > structure->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_cellss_resize(structure->used + amount, structure);
+ }
}
return F_data_not;
#endif // _di_f_cellss_increase_by_
#ifndef _di_f_cellss_resize_
- f_status_t f_cellss_resize(const f_number_unsigned_t length, f_cellss_t * const cellss) {
+ f_status_t f_cellss_resize(const f_number_unsigned_t length, f_cellss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!cellss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_cellss_resize(length, cellss);
+ return private_f_cellss_resize(length, structure);
}
#endif // _di_f_cellss_resize_
*
* @param length
* The new size to use.
- * @param cells
+ * @param structure
* The string cells array to resize.
*
* @return
*
* 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_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_cells_adjust_
- extern f_status_t f_cells_adjust(const f_number_unsigned_t length, f_cells_t * const cells);
+ extern f_status_t f_cells_adjust(const f_number_unsigned_t length, f_cells_t * const structure);
#endif // _di_f_cells_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_cells_append_
extern f_status_t f_cells_append(const f_cell_t source, f_cells_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_cells_append_all_
extern f_status_t f_cells_append_all(const f_cells_t source, f_cells_t * const destination);
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param cells
+ * @param structure
* The string cells array to resize.
*
* @return
*
* 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_array_decimate_by().
+ *
+ * @see f_memory_array_decimate_by()
*/
#ifndef _di_f_cells_decimate_by_
- extern f_status_t f_cells_decimate_by(const f_number_unsigned_t amount, f_cells_t * const cells);
+ extern f_status_t f_cells_decimate_by(const f_number_unsigned_t amount, f_cells_t * const structure);
#endif // _di_f_cells_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param cells
+ * @param structure
* The string cells array to resize.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_decrease_by().
+ *
+ * @see f_memory_array_decrease_by()
*/
#ifndef _di_f_cells_decrease_by_
- extern f_status_t f_cells_decrease_by(const f_number_unsigned_t amount, f_cells_t * const cells);
+ extern f_status_t f_cells_decrease_by(const f_number_unsigned_t amount, f_cells_t * const structure);
#endif // _di_f_cells_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param cells
+ * @param structure
* The string cells array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_cells_increase_
- extern f_status_t f_cells_increase(const f_number_unsigned_t step, f_cells_t * const cells);
+ extern f_status_t f_cells_increase(const f_number_unsigned_t step, f_cells_t * const structure);
#endif // _di_f_cells_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param cells
+ * @param structure
* The string cells array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_cells_increase_by_
- extern f_status_t f_cells_increase_by(const f_number_unsigned_t amount, f_cells_t * const cells);
+ extern f_status_t f_cells_increase_by(const f_number_unsigned_t amount, f_cells_t * const structure);
#endif // _di_f_cells_increase_by_
/**
*
* @param length
* The new size to use.
- * @param cells
+ * @param structure
* The string cells array to adjust.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_cells_resize_
- extern f_status_t f_cells_resize(const f_number_unsigned_t length, f_cells_t * const cells);
+ extern f_status_t f_cells_resize(const f_number_unsigned_t length, f_cells_t * const structure);
#endif // _di_f_cells_resize_
/**
*
* @param length
* The new size to use.
- * @param cellss
+ * @param structure
* The string cellss array to resize.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_cellss_adjust_
- extern f_status_t f_cellss_adjust(const f_number_unsigned_t length, f_cellss_t * const cellss);
+ extern f_status_t f_cellss_adjust(const f_number_unsigned_t length, f_cellss_t * const structure);
#endif // _di_f_cellss_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_cellss_append_
extern f_status_t f_cellss_append(const f_cells_t source, f_cellss_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_cellss_append_all_
extern f_status_t f_cellss_append_all(const f_cellss_t source, f_cellss_t * const destination);
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param cellss
+ * @param structure
* The string cellss array to resize.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_cellss_decimate_by_
- extern f_status_t f_cellss_decimate_by(const f_number_unsigned_t amount, f_cellss_t * const cellss);
+ extern f_status_t f_cellss_decimate_by(const f_number_unsigned_t amount, f_cellss_t * const structure);
#endif // _di_f_cellss_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param cellss
+ * @param structure
* The string cellss array to resize.
*
* @return
*
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_cellss_decrease_by_
- extern f_status_t f_cellss_decrease_by(const f_number_unsigned_t amount, f_cellss_t * const cellss);
+ extern f_status_t f_cellss_decrease_by(const f_number_unsigned_t amount, f_cellss_t * const structure);
#endif // _di_f_cellss_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param cellss
+ * @param structure
* The string cellss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_cellss_increase_
- extern f_status_t f_cellss_increase(const f_number_unsigned_t step, f_cellss_t * const cellss);
+ extern f_status_t f_cellss_increase(const f_number_unsigned_t step, f_cellss_t * const structure);
#endif // _di_f_cellss_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param cellss
+ * @param structure
* The string cellss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_cellss_increase_by_
- extern f_status_t f_cellss_increase_by(const f_number_unsigned_t amount, f_cellss_t * const cellss);
+ extern f_status_t f_cellss_increase_by(const f_number_unsigned_t amount, f_cellss_t * const structure);
#endif // _di_f_cellss_increase_by_
/**
*
* @param length
* The new size to use.
- * @param cellss
+ * @param structure
* The string cellss array to adjust.
*
* @return
*
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_cellss_resize_
- extern f_status_t f_cellss_resize(const f_number_unsigned_t length, f_cellss_t * const cellss);
+ extern f_status_t f_cellss_resize(const f_number_unsigned_t length, f_cellss_t * const structure);
#endif // _di_f_cellss_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_files_adjust_
- f_status_t f_files_adjust(const f_number_unsigned_t length, f_files_t * const files) {
+ f_status_t f_files_adjust(const f_number_unsigned_t length, f_files_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!files) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_files_adjust(length, files);
+ return f_memory_array_adjust(length, sizeof(f_file_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_files_adjust_
#endif // _di_f_files_append_all_
#ifndef _di_f_files_decimate_by_
- f_status_t f_files_decimate_by(const f_number_unsigned_t amount, f_files_t * const files) {
+ f_status_t f_files_decimate_by(const f_number_unsigned_t amount, f_files_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!files) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (files->size - amount > 0) {
- return private_f_files_adjust(files->size - amount, files);
- }
-
- return private_f_files_adjust(0, files);
+ return f_memory_array_decimate_by(amount, sizeof(f_file_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_files_decimate_by_
#ifndef _di_f_files_decrease_by_
- f_status_t f_files_decrease_by(const f_number_unsigned_t amount, f_files_t * const files) {
+ f_status_t f_files_decrease_by(const f_number_unsigned_t amount, f_files_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!files) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (files->size - amount > 0) {
- return private_f_files_resize(files->size - amount, files);
- }
-
- return private_f_files_resize(0, files);
+ return f_memory_array_decrease_by(amount, sizeof(f_file_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_files_decrease_by_
#ifndef _di_f_files_increase_
- f_status_t f_files_increase(const f_number_unsigned_t step, f_files_t * const files) {
+ f_status_t f_files_increase(const f_number_unsigned_t step, f_files_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!files) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && files->used + 1 > files->size) {
- f_number_unsigned_t size = files->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (files->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_files_resize(size, files);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(f_file_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_files_increase_
#ifndef _di_f_files_increase_by_
- f_status_t f_files_increase_by(const f_number_unsigned_t amount, f_files_t * const files) {
+ f_status_t f_files_increase_by(const f_number_unsigned_t amount, f_files_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!files) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (files->used + amount > files->size) {
- if (files->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_files_resize(files->used + amount, files);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(f_file_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_files_increase_by_
#ifndef _di_f_files_resize_
- f_status_t f_files_resize(const f_number_unsigned_t length, f_files_t * const files) {
+ f_status_t f_files_resize(const f_number_unsigned_t length, f_files_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!files) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_files_resize(length, files);
+ return f_memory_array_resize(length, sizeof(f_file_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_files_resize_
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_filess_resize(destination->used + F_memory_default_allocation_small_d, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_files_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
status = private_f_files_append_all(source, &destination->array[destination->used]);
if (F_status_is_error(status)) return status;
f_status_t status = F_none;
- if (destination->used + source.used > destination->size) {
- status = private_f_filess_resize(destination->used + source.used, destination);
+ {
+ status = f_memory_array_increase_by(source.used, sizeof(f_files_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
if (!amount) return F_data_not;
- if (filess->size - amount > 0) {
- return private_f_filess_adjust(filess->size - amount, filess);
- }
-
- return private_f_filess_adjust(0, filess);
+ return private_f_filess_adjust((filess->size - amount > 0) ? filess->size - amount : 0, filess);
}
#endif // _di_f_filess_decimate_by_
if (!amount) return F_data_not;
- if (filess->size - amount > 0) {
- return private_f_filess_resize(filess->size - amount, filess);
- }
-
- return private_f_filess_resize(0, filess);
+ return private_f_filess_resize((filess->size - amount > 0) ? filess->size - amount : 0, filess);
}
#endif // _di_f_filess_decrease_by_
#endif // _di_level_0_parameter_checking_
if (step && filess->used + 1 > filess->size) {
- f_number_unsigned_t size = filess->used + step;
+ f_number_unsigned_t length = filess->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (filess->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (filess->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_filess_resize(size, filess);
+ return private_f_filess_resize(length, filess);
}
return F_data_not;
if (!amount) return F_data_not;
if (filess->used + amount > filess->size) {
- if (filess->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (filess->used + amount > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
return private_f_filess_resize(filess->used + amount, filess);
}
*
* @param length
* The new size to use.
- * @param files
+ * @param structure
* The files array to resize.
*
* @return
*
* 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_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_files_adjust_
- extern f_status_t f_files_adjust(const f_number_unsigned_t length, f_files_t * const files);
+ extern f_status_t f_files_adjust(const f_number_unsigned_t length, f_files_t * const structure);
#endif // _di_f_files_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_files_append_
extern f_status_t f_files_append(const f_file_t source, f_files_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_files_append_all_
extern f_status_t f_files_append_all(const f_files_t source, f_files_t * const destination);
*
* 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_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_files_decimate_by_
- extern f_status_t f_files_decimate_by(const f_number_unsigned_t amount, f_files_t * const files);
+ extern f_status_t f_files_decimate_by(const f_number_unsigned_t amount, f_files_t * const structure);
#endif // _di_f_files_decimate_by_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_files_decrease_by_
extern f_status_t f_files_decrease_by(const f_number_unsigned_t amount, f_files_t * const files);
* 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().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_files_increase_
extern f_status_t f_files_increase(const f_number_unsigned_t step, f_files_t * const files);
* 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().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_files_increase_by_
extern f_status_t f_files_increase_by(const f_number_unsigned_t amount, f_files_t * const files);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_files_resize_
extern f_status_t f_files_resize(const f_number_unsigned_t length, f_files_t * const files);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_filess_adjust_
extern f_status_t f_filess_adjust(const f_number_unsigned_t length, f_filess_t * const filess);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_filess_append_
extern f_status_t f_filess_append(const f_files_t source, f_filess_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_filess_append_all_
extern f_status_t f_filess_append_all(const f_filess_t source, f_filess_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_filess_decimate_by_
extern f_status_t f_filess_decimate_by(const f_number_unsigned_t amount, f_filess_t * const filess);
*
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_filess_decrease_by_
extern f_status_t f_filess_decrease_by(const f_number_unsigned_t amount, f_filess_t * const filess);
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_filess_increase_
extern f_status_t f_filess_increase(const f_number_unsigned_t step, f_filess_t * const filess);
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_filess_increase_by_
extern f_status_t f_filess_increase_by(const f_number_unsigned_t amount, f_filess_t * const filess);
*
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_filess_resize_
extern f_status_t f_filess_resize(const f_number_unsigned_t length, f_filess_t * const filess);
#endif
#ifndef _di_f_fll_ids_adjust_
- f_status_t f_fll_ids_adjust(const f_number_unsigned_t length, f_fll_ids_t * const ids) {
+ f_status_t f_fll_ids_adjust(const f_number_unsigned_t length, f_fll_ids_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!ids) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_fll_ids_adjust(length, ids);
+ return f_memory_array_adjust(length, sizeof(f_fll_id_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_fll_ids_adjust_
#endif // _di_f_fll_ids_append_all_
#ifndef _di_f_fll_ids_decimate_by_
- f_status_t f_fll_ids_decimate_by(const f_number_unsigned_t amount, f_fll_ids_t * const ids) {
+ f_status_t f_fll_ids_decimate_by(const f_number_unsigned_t amount, f_fll_ids_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!ids) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (ids->size - amount > 0) {
- return private_f_fll_ids_adjust(ids->size - amount, ids);
- }
-
- return private_f_fll_ids_adjust(0, ids);
+ return f_memory_array_decimate_by(amount, sizeof(f_fll_id_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_fll_ids_decimate_by_
#ifndef _di_f_fll_ids_decrease_by_
- f_status_t f_fll_ids_decrease_by(const f_number_unsigned_t amount, f_fll_ids_t * const ids) {
+ f_status_t f_fll_ids_decrease_by(const f_number_unsigned_t amount, f_fll_ids_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!ids) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (ids->size - amount > 0) {
- return private_f_fll_ids_resize(ids->size - amount, ids);
- }
-
- return private_f_fll_ids_resize(0, ids);
+ return f_memory_array_decrease_by(amount, sizeof(f_fll_id_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_fll_ids_decrease_by_
#ifndef _di_f_fll_ids_increase_
- f_status_t f_fll_ids_increase(const f_number_unsigned_t step, f_fll_ids_t * const ids) {
+ f_status_t f_fll_ids_increase(const f_number_unsigned_t step, f_fll_ids_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!ids) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && ids->used + 1 > ids->size) {
- f_number_unsigned_t size = ids->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (ids->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_fll_ids_resize(size, ids);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(f_fll_id_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_fll_ids_increase_
#ifndef _di_f_fll_ids_increase_by_
- f_status_t f_fll_ids_increase_by(const f_number_unsigned_t amount, f_fll_ids_t * const ids) {
+ f_status_t f_fll_ids_increase_by(const f_number_unsigned_t amount, f_fll_ids_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!ids) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (ids->used + amount > ids->size) {
- if (ids->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_fll_ids_resize(ids->used + amount, ids);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(f_fll_id_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_fll_ids_increase_by_
#ifndef _di_f_fll_ids_resize_
- f_status_t f_fll_ids_resize(const f_number_unsigned_t length, f_fll_ids_t * const ids) {
+ f_status_t f_fll_ids_resize(const f_number_unsigned_t length, f_fll_ids_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!ids) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_fll_ids_resize(length, ids);
+ return f_memory_array_resize(length, sizeof(f_fll_id_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_fll_ids_resize_
#ifndef _di_f_fll_idss_adjust_
- f_status_t f_fll_idss_adjust(const f_number_unsigned_t length, f_fll_idss_t * const idss) {
+ f_status_t f_fll_idss_adjust(const f_number_unsigned_t length, f_fll_idss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!idss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_fll_idss_adjust(length, idss);
+ return private_f_fll_idss_adjust(length, structure);
}
#endif // _di_f_fll_idss_adjust_
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_fll_idss_resize(destination->used + F_memory_default_allocation_small_d, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_fll_ids_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
status = private_f_fll_ids_append_all(source, &destination->array[destination->used]);
if (F_status_is_error(status)) return status;
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_fll_idss_resize(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_fll_ids_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
#endif // _di_f_fll_idss_append_all_
#ifndef _di_f_fll_idss_decimate_by_
- f_status_t f_fll_idss_decimate_by(const f_number_unsigned_t amount, f_fll_idss_t * const idss) {
+ f_status_t f_fll_idss_decimate_by(const f_number_unsigned_t amount, f_fll_idss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!idss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (idss->size - amount > 0) {
- return private_f_fll_idss_adjust(idss->size - amount, idss);
- }
-
- return private_f_fll_idss_adjust(0, idss);
+ return private_f_fll_idss_adjust((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_fll_idss_decimate_by_
#ifndef _di_f_fll_idss_decrease_by_
- f_status_t f_fll_idss_decrease_by(const f_number_unsigned_t amount, f_fll_idss_t * const idss) {
+ f_status_t f_fll_idss_decrease_by(const f_number_unsigned_t amount, f_fll_idss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!idss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (idss->size - amount > 0) {
- return private_f_fll_idss_resize(idss->size - amount, idss);
- }
-
- return private_f_fll_idss_resize(0, idss);
+ return private_f_fll_idss_resize((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_fll_idss_decrease_by_
#ifndef _di_f_fll_idss_increase_
- f_status_t f_fll_idss_increase(const f_number_unsigned_t step, f_fll_idss_t * const idss) {
+ f_status_t f_fll_idss_increase(const f_number_unsigned_t step, f_fll_idss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!idss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && idss->used + 1 > idss->size) {
- f_number_unsigned_t size = idss->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (idss->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_fll_idss_resize(size, idss);
+ return private_f_fll_idss_resize(length, structure);
}
return F_data_not;
#endif // _di_f_fll_idss_increase_
#ifndef _di_f_fll_idss_increase_by_
- f_status_t f_fll_idss_increase_by(const f_number_unsigned_t amount, f_fll_idss_t * const idss) {
+ f_status_t f_fll_idss_increase_by(const f_number_unsigned_t amount, f_fll_idss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!idss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (idss->used + amount > idss->size) {
- if (idss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = structure->used + amount;
- return private_f_fll_idss_resize(idss->used + amount, idss);
+ if (length > structure->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_fll_idss_resize(structure->used + amount, structure);
+ }
}
return F_data_not;
#endif // _di_f_fll_idss_increase_by_
#ifndef _di_f_fll_idss_resize_
- f_status_t f_fll_idss_resize(const f_number_unsigned_t length, f_fll_idss_t * const idss) {
+ f_status_t f_fll_idss_resize(const f_number_unsigned_t length, f_fll_idss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!idss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_fll_idss_resize(length, idss);
+ return private_f_fll_idss_resize(length, structure);
}
#endif // _di_f_fll_idss_resize_
#endif
/**
- * Resize the string ids array.
+ * Resize the string fll_ids array.
*
* @param length
* The new size to use.
- * @param ids
- * The string ids array to resize.
+ * @param structure
+ * The string fll_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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_fll_ids_adjust_
- extern f_status_t f_fll_ids_adjust(const f_number_unsigned_t length, f_fll_ids_t * const ids);
+ extern f_status_t f_fll_ids_adjust(const f_number_unsigned_t length, f_fll_ids_t * const structure);
#endif // _di_f_fll_ids_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_fll_ids_append_
extern f_status_t f_fll_ids_append(const f_fll_id_t source, f_fll_ids_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_fll_ids_append_all_
extern f_status_t f_fll_ids_append_all(const f_fll_ids_t source, f_fll_ids_t * const destination);
#endif // _di_f_fll_ids_append_all_
/**
- * Resize the string ids array to a smaller size.
+ * Resize the string fll_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.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param ids
- * The string ids array to resize.
+ * @param structure
+ * The string fll_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().
+ * Errors (with error bit) from: f_memory_array_decimate_by().
+ *
+ * @see f_memory_array_decimate_by()
*/
#ifndef _di_f_fll_ids_decimate_by_
- extern f_status_t f_fll_ids_decimate_by(const f_number_unsigned_t amount, f_fll_ids_t * const ids);
+ extern f_status_t f_fll_ids_decimate_by(const f_number_unsigned_t amount, f_fll_ids_t * const structure);
#endif // _di_f_fll_ids_decimate_by_
/**
- * Resize the string ids array to a smaller size.
+ * Resize the string fll_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.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param ids
- * The string ids array to resize.
+ * @param structure
+ * The string fll_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().
+ * Errors (with error bit) from: f_memory_array_decrease_by().
+ *
+ * @see f_memory_array_decrease_by()
*/
#ifndef _di_f_fll_ids_decrease_by_
- extern f_status_t f_fll_ids_decrease_by(const f_number_unsigned_t amount, f_fll_ids_t * const ids);
+ extern f_status_t f_fll_ids_decrease_by(const f_number_unsigned_t amount, f_fll_ids_t * const structure);
#endif // _di_f_fll_ids_decrease_by_
/**
- * Increase the size of the string ids array, but only if necesary.
+ * Increase the size of the string fll_ids array, but only if necesary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param ids
- * The string ids array to resize.
+ * @param structure
+ * The string fll_ids array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_fll_ids_increase_
- extern f_status_t f_fll_ids_increase(const f_number_unsigned_t step, f_fll_ids_t * const ids);
+ extern f_status_t f_fll_ids_increase(const f_number_unsigned_t step, f_fll_ids_t * const structure);
#endif // _di_f_fll_ids_increase_
/**
- * Resize the string ids array to a larger size.
+ * Resize the string fll_ids array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param ids
- * The string ids array to resize.
+ * @param structure
+ * The string fll_ids array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_fll_ids_increase_by_
- extern f_status_t f_fll_ids_increase_by(const f_number_unsigned_t amount, f_fll_ids_t * const ids);
+ extern f_status_t f_fll_ids_increase_by(const f_number_unsigned_t amount, f_fll_ids_t * const structure);
#endif // _di_f_fll_ids_increase_by_
/**
- * Resize the string ids array.
+ * Resize the string fll_ids array.
*
* @param length
* The new size to use.
- * @param ids
- * The string ids array to adjust.
+ * @param structure
+ * The string fll_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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_fll_ids_resize_
- extern f_status_t f_fll_ids_resize(const f_number_unsigned_t length, f_fll_ids_t * const ids);
+ extern f_status_t f_fll_ids_resize(const f_number_unsigned_t length, f_fll_ids_t * const structure);
#endif // _di_f_fll_ids_resize_
/**
- * Resize the string idss array.
+ * Resize the string fll_idss array.
*
* @param length
* The new size to use.
- * @param idss
- * The string idss array to resize.
+ * @param structure
+ * The string fll_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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_fll_idss_adjust_
- extern f_status_t f_fll_idss_adjust(const f_number_unsigned_t length, f_fll_idss_t * const idss);
+ extern f_status_t f_fll_idss_adjust(const f_number_unsigned_t length, f_fll_idss_t * const structure);
#endif // _di_f_fll_idss_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_fll_idss_append_
extern f_status_t f_fll_idss_append(const f_fll_ids_t source, f_fll_idss_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_fll_idss_append_all_
extern f_status_t f_fll_idss_append_all(const f_fll_idss_t source, f_fll_idss_t * const destination);
#endif // _di_f_fll_idss_append_all_
/**
- * Resize the string idss array to a smaller size.
+ * Resize the string fll_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.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param idss
- * The string idss array to resize.
+ * @param structure
+ * The string fll_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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_fll_idss_decimate_by_
- extern f_status_t f_fll_idss_decimate_by(const f_number_unsigned_t amount, f_fll_idss_t * const idss);
+ extern f_status_t f_fll_idss_decimate_by(const f_number_unsigned_t amount, f_fll_idss_t * const structure);
#endif // _di_f_fll_idss_decimate_by_
/**
- * Resize the string idss array to a smaller size.
+ * Resize the string fll_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.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param idss
- * The string idss array to resize.
+ * @param structure
+ * The string fll_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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_fll_idss_decrease_by_
- extern f_status_t f_fll_idss_decrease_by(const f_number_unsigned_t amount, f_fll_idss_t * const idss);
+ extern f_status_t f_fll_idss_decrease_by(const f_number_unsigned_t amount, f_fll_idss_t * const structure);
#endif // _di_f_fll_idss_decrease_by_
/**
- * Increase the size of the string idss array, but only if necessary.
+ * Increase the size of the string fll_idss array, but only if necessary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param idss
- * The string idss array to resize.
+ * @param structure
+ * The string fll_idss array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_fll_idss_increase_
- extern f_status_t f_fll_idss_increase(const f_number_unsigned_t step, f_fll_idss_t * const idss);
+ extern f_status_t f_fll_idss_increase(const f_number_unsigned_t step, f_fll_idss_t * const structure);
#endif // _di_f_fll_idss_increase_
/**
- * Resize the string idss array to a larger size.
+ * Resize the string fll_idss array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param idss
- * The string idss array to resize.
+ * @param structure
+ * The string fll_idss array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_fll_idss_increase_by_
- extern f_status_t f_fll_idss_increase_by(const f_number_unsigned_t amount, f_fll_idss_t * const idss);
+ extern f_status_t f_fll_idss_increase_by(const f_number_unsigned_t amount, f_fll_idss_t * const structure);
#endif // _di_f_fll_idss_increase_by_
/**
- * Resize the string idss array.
+ * Resize the string fll_idss array.
*
* @param length
* The new size to use.
- * @param idss
- * The string idss array to adjust.
+ * @param structure
+ * The string fll_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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_fll_idss_resize_
- extern f_status_t f_fll_idss_resize(const f_number_unsigned_t length, f_fll_idss_t * const idss);
+ extern f_status_t f_fll_idss_resize(const f_number_unsigned_t length, f_fll_idss_t * const structure);
#endif // _di_f_fll_idss_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_int128s_adjust_
- f_status_t f_int128s_adjust(const f_number_unsigned_t length, f_int128s_t * const int128s) {
+ f_status_t f_int128s_adjust(const f_number_unsigned_t length, f_int128s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int128s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int128s_adjust(length, int128s);
+ return f_memory_array_adjust(length, sizeof(int128_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int128s_adjust_
#endif // _di_f_int128s_append_all_
#ifndef _di_f_int128s_decimate_by_
- f_status_t f_int128s_decimate_by(const f_number_unsigned_t amount, f_int128s_t * const int128s) {
+ f_status_t f_int128s_decimate_by(const f_number_unsigned_t amount, f_int128s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int128s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (int128s->size - amount > 0) {
- return private_f_int128s_adjust(int128s->size - amount, int128s);
- }
-
- return private_f_int128s_adjust(0, int128s);
+ return f_memory_array_decimate_by(amount, sizeof(int128_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int128s_decimate_by_
#ifndef _di_f_int128s_decrease_by_
- f_status_t f_int128s_decrease_by(const f_number_unsigned_t amount, f_int128s_t * const int128s) {
+ f_status_t f_int128s_decrease_by(const f_number_unsigned_t amount, f_int128s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int128s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (int128s->size - amount > 0) {
- return private_f_int128s_resize(int128s->size - amount, int128s);
- }
-
- return private_f_int128s_resize(0, int128s);
+ return f_memory_array_decrease_by(amount, sizeof(int128_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int128s_decrease_by_
#ifndef _di_f_int128s_increase_
- f_status_t f_int128s_increase(const f_number_unsigned_t step, f_int128s_t * const int128s) {
+ f_status_t f_int128s_increase(const f_number_unsigned_t step, f_int128s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int128s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && int128s->used + 1 > int128s->size) {
- f_number_unsigned_t size = int128s->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (int128s->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_int128s_resize(size, int128s);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(int128_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int128s_increase_
#ifndef _di_f_int128s_increase_by_
- f_status_t f_int128s_increase_by(const f_number_unsigned_t amount, f_int128s_t * const int128s) {
+ f_status_t f_int128s_increase_by(const f_number_unsigned_t amount, f_int128s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int128s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (int128s->used + amount > int128s->size) {
- if (int128s->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_int128s_resize(int128s->used + amount, int128s);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(int128_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int128s_increase_by_
#ifndef _di_f_int128s_resize_
- f_status_t f_int128s_resize(const f_number_unsigned_t length, f_int128s_t * const int128s) {
+ f_status_t f_int128s_resize(const f_number_unsigned_t length, f_int128s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int128s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int128s_resize(length, int128s);
+ return f_memory_array_resize(length, sizeof(int128_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int128s_resize_
#ifndef _di_f_int128ss_adjust_
- f_status_t f_int128ss_adjust(const f_number_unsigned_t length, f_int128ss_t * const int128ss) {
+ f_status_t f_int128ss_adjust(const f_number_unsigned_t length, f_int128ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int128ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int128ss_adjust(length, int128ss);
+ return private_f_int128ss_adjust(length, structure);
}
#endif // _di_f_int128ss_adjust_
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_int128ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_int128s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
status = private_f_int128s_append_all(source, &destination->array[destination->used]);
if (F_status_is_error(status)) return status;
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_int128ss_resize(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_int128s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
#endif // _di_f_int128ss_append_all_
#ifndef _di_f_int128ss_decimate_by_
- f_status_t f_int128ss_decimate_by(const f_number_unsigned_t amount, f_int128ss_t * const int128ss) {
+ f_status_t f_int128ss_decimate_by(const f_number_unsigned_t amount, f_int128ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int128ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (int128ss->size - amount > 0) {
- return private_f_int128ss_adjust(int128ss->size - amount, int128ss);
- }
-
- return private_f_int128ss_adjust(0, int128ss);
+ return private_f_int128ss_adjust((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_int128ss_decimate_by_
#ifndef _di_f_int128ss_decrease_by_
- f_status_t f_int128ss_decrease_by(const f_number_unsigned_t amount, f_int128ss_t * const int128ss) {
+ f_status_t f_int128ss_decrease_by(const f_number_unsigned_t amount, f_int128ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int128ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (int128ss->size - amount > 0) {
- return private_f_int128ss_resize(int128ss->size - amount, int128ss);
- }
-
- return private_f_int128ss_resize(0, int128ss);
+ return private_f_int128ss_resize((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_int128ss_decrease_by_
#ifndef _di_f_int128ss_increase_
- f_status_t f_int128ss_increase(const f_number_unsigned_t step, f_int128ss_t * const int128ss) {
+ f_status_t f_int128ss_increase(const f_number_unsigned_t step, f_int128ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int128ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && int128ss->used + 1 > int128ss->size) {
- f_number_unsigned_t size = int128ss->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (int128ss->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_int128ss_resize(size, int128ss);
+ return private_f_int128ss_resize(length, structure);
}
return F_data_not;
#endif // _di_f_int128ss_increase_
#ifndef _di_f_int128ss_increase_by_
- f_status_t f_int128ss_increase_by(const f_number_unsigned_t amount, f_int128ss_t * const int128ss) {
+ f_status_t f_int128ss_increase_by(const f_number_unsigned_t amount, f_int128ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int128ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (int128ss->used + amount > int128ss->size) {
- if (int128ss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = structure->used + amount;
- return private_f_int128ss_resize(int128ss->used + amount, int128ss);
+ if (length > structure->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_int128ss_resize(structure->used + amount, structure);
+ }
}
return F_data_not;
#endif // _di_f_int128ss_increase_by_
#ifndef _di_f_int128ss_resize_
- f_status_t f_int128ss_resize(const f_number_unsigned_t length, f_int128ss_t * const int128ss) {
+ f_status_t f_int128ss_resize(const f_number_unsigned_t length, f_int128ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int128ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int128ss_resize(length, int128ss);
+ return private_f_int128ss_resize(length, structure);
}
#endif // _di_f_int128ss_resize_
#endif
/**
- * Resize the int128s array.
+ * Resize the string int128s array.
*
* @param length
* The new size to use.
- * @param int128s
- * The int128s array to resize.
+ * @param structure
+ * The string int128s 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_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_int128s_adjust_
- extern f_status_t f_int128s_adjust(const f_number_unsigned_t length, f_int128s_t * const int128s);
+ extern f_status_t f_int128s_adjust(const f_number_unsigned_t length, f_int128s_t * const structure);
#endif // _di_f_int128s_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_int128s_append_
extern f_status_t f_int128s_append(const int128_t source, f_int128s_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int128s_append_all_
extern f_status_t f_int128s_append_all(const f_int128s_t source, f_int128s_t * const destination);
#endif // _di_f_int128s_append_all_
/**
- * Resize the int128s array to a smaller size.
+ * Resize the string int128s array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param int128s
- * The int128s array to resize.
+ * @param structure
+ * The string int128s 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_array_decimate_by().
+ *
+ * @see f_memory_array_decimate_by()
*/
#ifndef _di_f_int128s_decimate_by_
- extern f_status_t f_int128s_decimate_by(const f_number_unsigned_t amount, f_int128s_t * const int128s);
+ extern f_status_t f_int128s_decimate_by(const f_number_unsigned_t amount, f_int128s_t * const structure);
#endif // _di_f_int128s_decimate_by_
/**
- * Resize the int128s array to a smaller size.
+ * Resize the string int128s array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param int128s
- * The int128s array to resize.
+ * @param structure
+ * The string int128s 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().
+ * Errors (with error bit) from: f_memory_array_decrease_by().
+ *
+ * @see f_memory_array_decrease_by()
*/
#ifndef _di_f_int128s_decrease_by_
- extern f_status_t f_int128s_decrease_by(const f_number_unsigned_t amount, f_int128s_t * const int128s);
+ extern f_status_t f_int128s_decrease_by(const f_number_unsigned_t amount, f_int128s_t * const structure);
#endif // _di_f_int128s_decrease_by_
/**
- * Increase the size of the int128s array, but only if necesary.
+ * Increase the size of the string int128s array, but only if necesary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param int128s
- * The int128s array to resize.
+ * @param structure
+ * The string int128s array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_int128s_increase_
- extern f_status_t f_int128s_increase(const f_number_unsigned_t step, f_int128s_t * const int128s);
+ extern f_status_t f_int128s_increase(const f_number_unsigned_t step, f_int128s_t * const structure);
#endif // _di_f_int128s_increase_
/**
- * Resize the int128s array to a larger size.
+ * Resize the string int128s array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param int128s
- * The int128s array to resize.
+ * @param structure
+ * The string int128s array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int128s_increase_by_
- extern f_status_t f_int128s_increase_by(const f_number_unsigned_t amount, f_int128s_t * const int128s);
+ extern f_status_t f_int128s_increase_by(const f_number_unsigned_t amount, f_int128s_t * const structure);
#endif // _di_f_int128s_increase_by_
/**
- * Resize the int128s array.
+ * Resize the string int128s array.
*
* @param length
* The new size to use.
- * @param int128s
- * The int128s array to adjust.
+ * @param structure
+ * The string int128s 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int128s_resize_
- extern f_status_t f_int128s_resize(const f_number_unsigned_t length, f_int128s_t * const int128s);
+ extern f_status_t f_int128s_resize(const f_number_unsigned_t length, f_int128s_t * const structure);
#endif // _di_f_int128s_resize_
/**
- * Resize the int128ss array.
+ * Resize the string int128ss array.
*
* @param length
* The new size to use.
- * @param int128ss
- * The int128ss array to resize.
+ * @param structure
+ * The string int128ss 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_int128ss_adjust_
- extern f_status_t f_int128ss_adjust(const f_number_unsigned_t length, f_int128ss_t * const int128ss);
+ extern f_status_t f_int128ss_adjust(const f_number_unsigned_t length, f_int128ss_t * const structure);
#endif // _di_f_int128ss_adjust_
/**
- * Append the single source int128 onto the destination.
+ * Append the single source int128s onto the destination.
*
* @param source
* The source int128s to append.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int128ss_append_
extern f_status_t f_int128ss_append(const f_int128s_t source, f_int128ss_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int128ss_append_all_
extern f_status_t f_int128ss_append_all(const f_int128ss_t source, f_int128ss_t * const destination);
#endif // _di_f_int128ss_append_all_
/**
- * Resize the int128ss array to a smaller size.
+ * Resize the string int128ss array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param int128ss
- * The int128ss array to resize.
+ * @param structure
+ * The string int128ss 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_int128ss_decimate_by_
- extern f_status_t f_int128ss_decimate_by(const f_number_unsigned_t amount, f_int128ss_t * const int128ss);
+ extern f_status_t f_int128ss_decimate_by(const f_number_unsigned_t amount, f_int128ss_t * const structure);
#endif // _di_f_int128ss_decimate_by_
/**
- * Resize the int128ss array to a smaller size.
+ * Resize the string int128ss array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param int128ss
- * The int128ss array to resize.
+ * @param structure
+ * The string int128ss 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int128ss_decrease_by_
- extern f_status_t f_int128ss_decrease_by(const f_number_unsigned_t amount, f_int128ss_t * const int128ss);
+ extern f_status_t f_int128ss_decrease_by(const f_number_unsigned_t amount, f_int128ss_t * const structure);
#endif // _di_f_int128ss_decrease_by_
/**
- * Increase the size of the int128ss array, but only if necessary.
+ * Increase the size of the string int128ss array, but only if necessary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param int128ss
- * The int128ss array to resize.
+ * @param structure
+ * The string int128ss array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int128ss_increase_
- extern f_status_t f_int128ss_increase(const f_number_unsigned_t step, f_int128ss_t * const int128ss);
+ extern f_status_t f_int128ss_increase(const f_number_unsigned_t step, f_int128ss_t * const structure);
#endif // _di_f_int128ss_increase_
/**
- * Resize the int128ss array to a larger size.
+ * Resize the string int128ss array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param int128ss
- * The int128ss array to resize.
+ * @param structure
+ * The string int128ss array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int128ss_increase_by_
- extern f_status_t f_int128ss_increase_by(const f_number_unsigned_t amount, f_int128ss_t * const int128ss);
+ extern f_status_t f_int128ss_increase_by(const f_number_unsigned_t amount, f_int128ss_t * const structure);
#endif // _di_f_int128ss_increase_by_
/**
- * Resize the int128ss array.
+ * Resize the string int128ss array.
*
* @param length
* The new size to use.
- * @param int128ss
- * The int128ss array to adjust.
+ * @param structure
+ * The string int128ss 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int128ss_resize_
- extern f_status_t f_int128ss_resize(const f_number_unsigned_t length, f_int128ss_t * const int128ss);
+ extern f_status_t f_int128ss_resize(const f_number_unsigned_t length, f_int128ss_t * const structure);
#endif // _di_f_int128ss_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_int16s_adjust_
- f_status_t f_int16s_adjust(const f_number_unsigned_t length, f_int16s_t * const int16s) {
+ f_status_t f_int16s_adjust(const f_number_unsigned_t length, f_int16s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int16s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int16s_adjust(length, int16s);
+ return f_memory_array_adjust(length, sizeof(int16_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int16s_adjust_
#endif // _di_f_int16s_append_all_
#ifndef _di_f_int16s_decimate_by_
- f_status_t f_int16s_decimate_by(const f_number_unsigned_t amount, f_int16s_t * const int16s) {
+ f_status_t f_int16s_decimate_by(const f_number_unsigned_t amount, f_int16s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int16s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (int16s->size - amount > 0) {
- return private_f_int16s_adjust(int16s->size - amount, int16s);
- }
-
- return private_f_int16s_adjust(0, int16s);
+ return f_memory_array_decimate_by(amount, sizeof(int16_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int16s_decimate_by_
#ifndef _di_f_int16s_decrease_by_
- f_status_t f_int16s_decrease_by(const f_number_unsigned_t amount, f_int16s_t * const int16s) {
+ f_status_t f_int16s_decrease_by(const f_number_unsigned_t amount, f_int16s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int16s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (int16s->size - amount > 0) {
- return private_f_int16s_resize(int16s->size - amount, int16s);
- }
-
- return private_f_int16s_resize(0, int16s);
+ return f_memory_array_decrease_by(amount, sizeof(int16_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int16s_decrease_by_
#ifndef _di_f_int16s_increase_
- f_status_t f_int16s_increase(const f_number_unsigned_t step, f_int16s_t * const int16s) {
+ f_status_t f_int16s_increase(const f_number_unsigned_t step, f_int16s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int16s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && int16s->used + 1 > int16s->size) {
- f_number_unsigned_t size = int16s->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (int16s->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_int16s_resize(size, int16s);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(int16_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int16s_increase_
#ifndef _di_f_int16s_increase_by_
- f_status_t f_int16s_increase_by(const f_number_unsigned_t amount, f_int16s_t * const int16s) {
+ f_status_t f_int16s_increase_by(const f_number_unsigned_t amount, f_int16s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int16s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (int16s->used + amount > int16s->size) {
- if (int16s->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_int16s_resize(int16s->used + amount, int16s);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(int16_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int16s_increase_by_
#ifndef _di_f_int16s_resize_
- f_status_t f_int16s_resize(const f_number_unsigned_t length, f_int16s_t * const int16s) {
+ f_status_t f_int16s_resize(const f_number_unsigned_t length, f_int16s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int16s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int16s_resize(length, int16s);
+ return f_memory_array_resize(length, sizeof(int16_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int16s_resize_
#ifndef _di_f_int16ss_adjust_
- f_status_t f_int16ss_adjust(const f_number_unsigned_t length, f_int16ss_t * const int16ss) {
+ f_status_t f_int16ss_adjust(const f_number_unsigned_t length, f_int16ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int16ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int16ss_adjust(length, int16ss);
+ return private_f_int16ss_adjust(length, structure);
}
#endif // _di_f_int16ss_adjust_
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_int16ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_int16s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
status = private_f_int16s_append_all(source, &destination->array[destination->used]);
if (F_status_is_error(status)) return status;
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_int16ss_resize(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_int16s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
#endif // _di_f_int16ss_append_all_
#ifndef _di_f_int16ss_decimate_by_
- f_status_t f_int16ss_decimate_by(const f_number_unsigned_t amount, f_int16ss_t * const int16ss) {
+ f_status_t f_int16ss_decimate_by(const f_number_unsigned_t amount, f_int16ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int16ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (int16ss->size - amount > 0) {
- return private_f_int16ss_adjust(int16ss->size - amount, int16ss);
- }
-
- return private_f_int16ss_adjust(0, int16ss);
+ return private_f_int16ss_adjust((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_int16ss_decimate_by_
#ifndef _di_f_int16ss_decrease_by_
- f_status_t f_int16ss_decrease_by(const f_number_unsigned_t amount, f_int16ss_t * const int16ss) {
+ f_status_t f_int16ss_decrease_by(const f_number_unsigned_t amount, f_int16ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int16ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (int16ss->size - amount > 0) {
- return private_f_int16ss_resize(int16ss->size - amount, int16ss);
- }
-
- return private_f_int16ss_resize(0, int16ss);
+ return private_f_int16ss_resize((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_int16ss_decrease_by_
#ifndef _di_f_int16ss_increase_
- f_status_t f_int16ss_increase(const f_number_unsigned_t step, f_int16ss_t * const int16ss) {
+ f_status_t f_int16ss_increase(const f_number_unsigned_t step, f_int16ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int16ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && int16ss->used + 1 > int16ss->size) {
- f_number_unsigned_t size = int16ss->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (int16ss->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_int16ss_resize(size, int16ss);
+ return private_f_int16ss_resize(length, structure);
}
return F_data_not;
#endif // _di_f_int16ss_increase_
#ifndef _di_f_int16ss_increase_by_
- f_status_t f_int16ss_increase_by(const f_number_unsigned_t amount, f_int16ss_t * const int16ss) {
+ f_status_t f_int16ss_increase_by(const f_number_unsigned_t amount, f_int16ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int16ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (int16ss->used + amount > int16ss->size) {
- if (int16ss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = structure->used + amount;
- return private_f_int16ss_resize(int16ss->used + amount, int16ss);
+ if (length > structure->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_int16ss_resize(structure->used + amount, structure);
+ }
}
return F_data_not;
#endif // _di_f_int16ss_increase_by_
#ifndef _di_f_int16ss_resize_
- f_status_t f_int16ss_resize(const f_number_unsigned_t length, f_int16ss_t * const int16ss) {
+ f_status_t f_int16ss_resize(const f_number_unsigned_t length, f_int16ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int16ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int16ss_resize(length, int16ss);
+ return private_f_int16ss_resize(length, structure);
}
#endif // _di_f_int16ss_resize_
#endif
/**
- * Resize the int16s array.
+ * Resize the string int16s array.
*
* @param length
* The new size to use.
- * @param int16s
- * The int16s array to resize.
+ * @param structure
+ * The string int16s 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_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_int16s_adjust_
- extern f_status_t f_int16s_adjust(const f_number_unsigned_t length, f_int16s_t * const int16s);
+ extern f_status_t f_int16s_adjust(const f_number_unsigned_t length, f_int16s_t * const structure);
#endif // _di_f_int16s_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_int16s_append_
extern f_status_t f_int16s_append(const int16_t source, f_int16s_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int16s_append_all_
extern f_status_t f_int16s_append_all(const f_int16s_t source, f_int16s_t * const destination);
#endif // _di_f_int16s_append_all_
/**
- * Resize the int16s array to a smaller size.
+ * Resize the string int16s array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param int16s
- * The int16s array to resize.
+ * @param structure
+ * The string int16s 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_array_decimate_by().
+ *
+ * @see f_memory_array_decimate_by()
*/
#ifndef _di_f_int16s_decimate_by_
- extern f_status_t f_int16s_decimate_by(const f_number_unsigned_t amount, f_int16s_t * const int16s);
+ extern f_status_t f_int16s_decimate_by(const f_number_unsigned_t amount, f_int16s_t * const structure);
#endif // _di_f_int16s_decimate_by_
/**
- * Resize the int16s array to a smaller size.
+ * Resize the string int16s array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param int16s
- * The int16s array to resize.
+ * @param structure
+ * The string int16s 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().
+ * Errors (with error bit) from: f_memory_array_decrease_by().
+ *
+ * @see f_memory_array_decrease_by()
*/
#ifndef _di_f_int16s_decrease_by_
- extern f_status_t f_int16s_decrease_by(const f_number_unsigned_t amount, f_int16s_t * const int16s);
+ extern f_status_t f_int16s_decrease_by(const f_number_unsigned_t amount, f_int16s_t * const structure);
#endif // _di_f_int16s_decrease_by_
/**
- * Increase the size of the int16s array, but only if necesary.
+ * Increase the size of the string int16s array, but only if necesary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param int16s
- * The int16s array to resize.
+ * @param structure
+ * The string int16s array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_int16s_increase_
- extern f_status_t f_int16s_increase(const f_number_unsigned_t step, f_int16s_t * const int16s);
+ extern f_status_t f_int16s_increase(const f_number_unsigned_t step, f_int16s_t * const structure);
#endif // _di_f_int16s_increase_
/**
- * Resize the int16s array to a larger size.
+ * Resize the string int16s array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param int16s
- * The int16s array to resize.
+ * @param structure
+ * The string int16s array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int16s_increase_by_
- extern f_status_t f_int16s_increase_by(const f_number_unsigned_t amount, f_int16s_t * const int16s);
+ extern f_status_t f_int16s_increase_by(const f_number_unsigned_t amount, f_int16s_t * const structure);
#endif // _di_f_int16s_increase_by_
/**
- * Resize the int16s array.
+ * Resize the string int16s array.
*
* @param length
* The new size to use.
- * @param int16s
- * The int16s array to adjust.
+ * @param structure
+ * The string int16s 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int16s_resize_
- extern f_status_t f_int16s_resize(const f_number_unsigned_t length, f_int16s_t * const int16s);
+ extern f_status_t f_int16s_resize(const f_number_unsigned_t length, f_int16s_t * const structure);
#endif // _di_f_int16s_resize_
/**
- * Resize the int16ss array.
+ * Resize the string int16ss array.
*
* @param length
* The new size to use.
- * @param int16ss
- * The int16ss array to resize.
+ * @param structure
+ * The string int16ss 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_int16ss_adjust_
- extern f_status_t f_int16ss_adjust(const f_number_unsigned_t length, f_int16ss_t * const int16ss);
+ extern f_status_t f_int16ss_adjust(const f_number_unsigned_t length, f_int16ss_t * const structure);
#endif // _di_f_int16ss_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int16ss_append_
extern f_status_t f_int16ss_append(const f_int16s_t source, f_int16ss_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int16ss_append_all_
extern f_status_t f_int16ss_append_all(const f_int16ss_t source, f_int16ss_t * const destination);
#endif // _di_f_int16ss_append_all_
/**
- * Resize the int16ss array to a smaller size.
+ * Resize the string int16ss array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param int16ss
- * The int16ss array to resize.
+ * @param structure
+ * The string int16ss array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_int16ss_decimate_by_
- extern f_status_t f_int16ss_decimate_by(const f_number_unsigned_t amount, f_int16ss_t * const int16ss);
+ extern f_status_t f_int16ss_decimate_by(const f_number_unsigned_t amount, f_int16ss_t * const structure);
#endif // _di_f_int16ss_decimate_by_
/**
- * Resize the int16ss array to a smaller size.
+ * Resize the string int16ss array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param int16ss
- * The int16ss array to resize.
+ * @param structure
+ * The string int16ss array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_delete().
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int16ss_decrease_by_
- extern f_status_t f_int16ss_decrease_by(const f_number_unsigned_t amount, f_int16ss_t * const int16ss);
+ extern f_status_t f_int16ss_decrease_by(const f_number_unsigned_t amount, f_int16ss_t * const structure);
#endif // _di_f_int16ss_decrease_by_
/**
- * Increase the size of the int16ss array, but only if necessary.
+ * Increase the size of the string int16ss array, but only if necessary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param int16ss
- * The int16ss array to resize.
+ * @param structure
+ * The string int16ss array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int16ss_increase_
- extern f_status_t f_int16ss_increase(const f_number_unsigned_t step, f_int16ss_t * const int16ss);
+ extern f_status_t f_int16ss_increase(const f_number_unsigned_t step, f_int16ss_t * const structure);
#endif // _di_f_int16ss_increase_
/**
- * Resize the int16ss array to a larger size.
+ * Resize the string int16ss array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param int16ss
- * The int16ss array to resize.
+ * @param structure
+ * The string int16ss array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int16ss_increase_by_
- extern f_status_t f_int16ss_increase_by(const f_number_unsigned_t amount, f_int16ss_t * const int16ss);
+ extern f_status_t f_int16ss_increase_by(const f_number_unsigned_t amount, f_int16ss_t * const structure);
#endif // _di_f_int16ss_increase_by_
/**
- * Resize the int16ss array.
+ * Resize the string int16ss array.
*
* @param length
* The new size to use.
- * @param int16ss
- * The int16ss array to adjust.
+ * @param structure
+ * The string int16ss 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int16ss_resize_
- extern f_status_t f_int16ss_resize(const f_number_unsigned_t length, f_int16ss_t * const int16ss);
+ extern f_status_t f_int16ss_resize(const f_number_unsigned_t length, f_int16ss_t * const structure);
#endif // _di_f_int16ss_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_int32s_adjust_
- f_status_t f_int32s_adjust(const f_number_unsigned_t length, f_int32s_t * const int32s) {
+ f_status_t f_int32s_adjust(const f_number_unsigned_t length, f_int32s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int32s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int32s_adjust(length, int32s);
+ return f_memory_array_adjust(length, sizeof(int32_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int32s_adjust_
#endif // _di_f_int32s_append_all_
#ifndef _di_f_int32s_decimate_by_
- f_status_t f_int32s_decimate_by(const f_number_unsigned_t amount, f_int32s_t * const int32s) {
+ f_status_t f_int32s_decimate_by(const f_number_unsigned_t amount, f_int32s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int32s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (int32s->size - amount > 0) {
- return private_f_int32s_adjust(int32s->size - amount, int32s);
- }
-
- return private_f_int32s_adjust(0, int32s);
+ return f_memory_array_decimate_by(amount, sizeof(int32_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int32s_decimate_by_
#ifndef _di_f_int32s_decrease_by_
- f_status_t f_int32s_decrease_by(const f_number_unsigned_t amount, f_int32s_t * const int32s) {
+ f_status_t f_int32s_decrease_by(const f_number_unsigned_t amount, f_int32s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int32s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (int32s->size - amount > 0) {
- return private_f_int32s_resize(int32s->size - amount, int32s);
- }
-
- return private_f_int32s_resize(0, int32s);
+ return f_memory_array_decrease_by(amount, sizeof(int32_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int32s_decrease_by_
#ifndef _di_f_int32s_increase_
- f_status_t f_int32s_increase(const f_number_unsigned_t step, f_int32s_t * const int32s) {
+ f_status_t f_int32s_increase(const f_number_unsigned_t step, f_int32s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int32s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && int32s->used + 1 > int32s->size) {
- f_number_unsigned_t size = int32s->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (int32s->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_int32s_resize(size, int32s);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(int32_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int32s_increase_
#ifndef _di_f_int32s_increase_by_
- f_status_t f_int32s_increase_by(const f_number_unsigned_t amount, f_int32s_t * const int32s) {
+ f_status_t f_int32s_increase_by(const f_number_unsigned_t amount, f_int32s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int32s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (int32s->used + amount > int32s->size) {
- if (int32s->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_int32s_resize(int32s->used + amount, int32s);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(int32_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int32s_increase_by_
#ifndef _di_f_int32s_resize_
- f_status_t f_int32s_resize(const f_number_unsigned_t length, f_int32s_t * const int32s) {
+ f_status_t f_int32s_resize(const f_number_unsigned_t length, f_int32s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int32s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int32s_resize(length, int32s);
+ return f_memory_array_resize(length, sizeof(int32_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int32s_resize_
#ifndef _di_f_int32ss_adjust_
- f_status_t f_int32ss_adjust(const f_number_unsigned_t length, f_int32ss_t * const int32ss) {
+ f_status_t f_int32ss_adjust(const f_number_unsigned_t length, f_int32ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int32ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int32ss_adjust(length, int32ss);
+ return private_f_int32ss_adjust(length, structure);
}
#endif // _di_f_int32ss_adjust_
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_int32ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_int32s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
status = private_f_int32s_append_all(source, &destination->array[destination->used]);
if (F_status_is_error(status)) return status;
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_int32ss_resize(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_int32s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
#endif // _di_f_int32ss_append_all_
#ifndef _di_f_int32ss_decimate_by_
- f_status_t f_int32ss_decimate_by(const f_number_unsigned_t amount, f_int32ss_t * const int32ss) {
+ f_status_t f_int32ss_decimate_by(const f_number_unsigned_t amount, f_int32ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int32ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (int32ss->size - amount > 0) {
- return private_f_int32ss_adjust(int32ss->size - amount, int32ss);
- }
-
- return private_f_int32ss_adjust(0, int32ss);
+ return private_f_int32ss_adjust((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_int32ss_decimate_by_
#ifndef _di_f_int32ss_decrease_by_
- f_status_t f_int32ss_decrease_by(const f_number_unsigned_t amount, f_int32ss_t * const int32ss) {
+ f_status_t f_int32ss_decrease_by(const f_number_unsigned_t amount, f_int32ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int32ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (int32ss->size - amount > 0) {
- return private_f_int32ss_resize(int32ss->size - amount, int32ss);
- }
-
- return private_f_int32ss_resize(0, int32ss);
+ return private_f_int32ss_resize((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_int32ss_decrease_by_
#ifndef _di_f_int32ss_increase_
- f_status_t f_int32ss_increase(const f_number_unsigned_t step, f_int32ss_t * const int32ss) {
+ f_status_t f_int32ss_increase(const f_number_unsigned_t step, f_int32ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int32ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && int32ss->used + 1 > int32ss->size) {
- f_number_unsigned_t size = int32ss->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (int32ss->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_int32ss_resize(size, int32ss);
+ return private_f_int32ss_resize(length, structure);
}
return F_data_not;
#endif // _di_f_int32ss_increase_
#ifndef _di_f_int32ss_increase_by_
- f_status_t f_int32ss_increase_by(const f_number_unsigned_t amount, f_int32ss_t * const int32ss) {
+ f_status_t f_int32ss_increase_by(const f_number_unsigned_t amount, f_int32ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int32ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (int32ss->used + amount > int32ss->size) {
- if (int32ss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = structure->used + amount;
- return private_f_int32ss_resize(int32ss->used + amount, int32ss);
+ if (length > structure->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_int32ss_resize(structure->used + amount, structure);
+ }
}
return F_data_not;
#endif // _di_f_int32ss_increase_by_
#ifndef _di_f_int32ss_resize_
- f_status_t f_int32ss_resize(const f_number_unsigned_t length, f_int32ss_t * const int32ss) {
+ f_status_t f_int32ss_resize(const f_number_unsigned_t length, f_int32ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int32ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int32ss_resize(length, int32ss);
+ return private_f_int32ss_resize(length, structure);
}
#endif // _di_f_int32ss_resize_
#endif
/**
- * Resize the int32s array.
+ * Resize the string int32s array.
*
* @param length
* The new size to use.
- * @param int32s
- * The int32s array to resize.
+ * @param structure
+ * The string int32s 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_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_int32s_adjust_
- extern f_status_t f_int32s_adjust(const f_number_unsigned_t length, f_int32s_t * const int32s);
+ extern f_status_t f_int32s_adjust(const f_number_unsigned_t length, f_int32s_t * const structure);
#endif // _di_f_int32s_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_int32s_append_
extern f_status_t f_int32s_append(const int32_t source, f_int32s_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int32s_append_all_
extern f_status_t f_int32s_append_all(const f_int32s_t source, f_int32s_t * const destination);
#endif // _di_f_int32s_append_all_
/**
- * Resize the int32s array to a smaller size.
+ * Resize the string int32s array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param int32s
- * The int32s array to resize.
+ * @param structure
+ * The string int32s 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_array_decimate_by().
+ *
+ * @see f_memory_array_decimate_by()
*/
#ifndef _di_f_int32s_decimate_by_
- extern f_status_t f_int32s_decimate_by(const f_number_unsigned_t amount, f_int32s_t * const int32s);
+ extern f_status_t f_int32s_decimate_by(const f_number_unsigned_t amount, f_int32s_t * const structure);
#endif // _di_f_int32s_decimate_by_
/**
- * Resize the int32s array to a smaller size.
+ * Resize the string int32s array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param int32s
- * The int32s array to resize.
+ * @param structure
+ * The string int32s array to resize.
*
* @return
* F_none on success.
+ * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_decrease_by().
+ *
+ * @see f_memory_array_decrease_by()
*/
#ifndef _di_f_int32s_decrease_by_
- extern f_status_t f_int32s_decrease_by(const f_number_unsigned_t amount, f_int32s_t * const int32s);
+ extern f_status_t f_int32s_decrease_by(const f_number_unsigned_t amount, f_int32s_t * const structure);
#endif // _di_f_int32s_decrease_by_
/**
- * Increase the size of the int32s array, but only if necesary.
+ * Increase the size of the string int32s array, but only if necesary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param int32s
- * The int32s array to resize.
+ * @param structure
+ * The string int32s array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_int32s_increase_
- extern f_status_t f_int32s_increase(const f_number_unsigned_t step, f_int32s_t * const int32s);
+ extern f_status_t f_int32s_increase(const f_number_unsigned_t step, f_int32s_t * const structure);
#endif // _di_f_int32s_increase_
/**
- * Resize the int32s array to a larger size.
+ * Resize the string int32s array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param int32s
- * The int32s array to resize.
+ * @param structure
+ * The string int32s array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int32s_increase_by_
- extern f_status_t f_int32s_increase_by(const f_number_unsigned_t amount, f_int32s_t * const int32s);
+ extern f_status_t f_int32s_increase_by(const f_number_unsigned_t amount, f_int32s_t * const structure);
#endif // _di_f_int32s_increase_by_
/**
- * Resize the int32s array.
+ * Resize the string int32s array.
*
* @param length
* The new size to use.
- * @param int32s
- * The int32s array to adjust.
+ * @param structure
+ * The string int32s 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int32s_resize_
- extern f_status_t f_int32s_resize(const f_number_unsigned_t length, f_int32s_t * const int32s);
+ extern f_status_t f_int32s_resize(const f_number_unsigned_t length, f_int32s_t * const structure);
#endif // _di_f_int32s_resize_
/**
- * Resize the int32ss array.
+ * Resize the string int32ss array.
*
* @param length
* The new size to use.
- * @param int32ss
- * The int32ss array to resize.
+ * @param structure
+ * The string int32ss 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_int32ss_adjust_
- extern f_status_t f_int32ss_adjust(const f_number_unsigned_t length, f_int32ss_t * const int32ss);
+ extern f_status_t f_int32ss_adjust(const f_number_unsigned_t length, f_int32ss_t * const structure);
#endif // _di_f_int32ss_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int32ss_append_
extern f_status_t f_int32ss_append(const f_int32s_t source, f_int32ss_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int32ss_append_all_
extern f_status_t f_int32ss_append_all(const f_int32ss_t source, f_int32ss_t * const destination);
#endif // _di_f_int32ss_append_all_
/**
- * Resize the int32ss array to a smaller size.
+ * Resize the string int32ss array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param int32ss
- * The int32ss array to resize.
+ * @param structure
+ * The string int32ss array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_int32ss_decimate_by_
- extern f_status_t f_int32ss_decimate_by(const f_number_unsigned_t amount, f_int32ss_t * const int32ss);
+ extern f_status_t f_int32ss_decimate_by(const f_number_unsigned_t amount, f_int32ss_t * const structure);
#endif // _di_f_int32ss_decimate_by_
/**
- * Resize the int32ss array to a smaller size.
+ * Resize the string int32ss array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param int32ss
- * The int32ss array to resize.
+ * @param structure
+ * The string int32ss 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int32ss_decrease_by_
- extern f_status_t f_int32ss_decrease_by(const f_number_unsigned_t amount, f_int32ss_t * const int32ss);
+ extern f_status_t f_int32ss_decrease_by(const f_number_unsigned_t amount, f_int32ss_t * const structure);
#endif // _di_f_int32ss_decrease_by_
/**
- * Increase the size of the int32ss array, but only if necessary.
+ * Increase the size of the string int32ss array, but only if necessary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param int32ss
- * The int32ss array to resize.
+ * @param structure
+ * The string int32ss array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int32ss_increase_
- extern f_status_t f_int32ss_increase(const f_number_unsigned_t step, f_int32ss_t * const int32ss);
+ extern f_status_t f_int32ss_increase(const f_number_unsigned_t step, f_int32ss_t * const structure);
#endif // _di_f_int32ss_increase_
/**
- * Resize the int32ss array to a larger size.
+ * Resize the string int32ss array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param int32ss
- * The int32ss array to resize.
+ * @param structure
+ * The string int32ss array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int32ss_increase_by_
- extern f_status_t f_int32ss_increase_by(const f_number_unsigned_t amount, f_int32ss_t * const int32ss);
+ extern f_status_t f_int32ss_increase_by(const f_number_unsigned_t amount, f_int32ss_t * const structure);
#endif // _di_f_int32ss_increase_by_
/**
- * Resize the int32ss array.
+ * Resize the string int32ss array.
*
* @param length
* The new size to use.
- * @param int32ss
- * The int32ss array to adjust.
+ * @param structure
+ * The string int32ss 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int32ss_resize_
- extern f_status_t f_int32ss_resize(const f_number_unsigned_t length, f_int32ss_t * const int32ss);
+ extern f_status_t f_int32ss_resize(const f_number_unsigned_t length, f_int32ss_t * const structure);
#endif // _di_f_int32ss_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_int64s_adjust_
- f_status_t f_int64s_adjust(const f_number_unsigned_t length, f_int64s_t * const int64s) {
+ f_status_t f_int64s_adjust(const f_number_unsigned_t length, f_int64s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int64s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int64s_adjust(length, int64s);
+ return f_memory_array_adjust(length, sizeof(int64_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int64s_adjust_
#endif // _di_f_int64s_append_all_
#ifndef _di_f_int64s_decimate_by_
- f_status_t f_int64s_decimate_by(const f_number_unsigned_t amount, f_int64s_t * const int64s) {
+ f_status_t f_int64s_decimate_by(const f_number_unsigned_t amount, f_int64s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int64s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (int64s->size - amount > 0) {
- return private_f_int64s_adjust(int64s->size - amount, int64s);
- }
-
- return private_f_int64s_adjust(0, int64s);
+ return f_memory_array_decimate_by(amount, sizeof(int64_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int64s_decimate_by_
#ifndef _di_f_int64s_decrease_by_
- f_status_t f_int64s_decrease_by(const f_number_unsigned_t amount, f_int64s_t * const int64s) {
+ f_status_t f_int64s_decrease_by(const f_number_unsigned_t amount, f_int64s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int64s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (int64s->size - amount > 0) {
- return private_f_int64s_resize(int64s->size - amount, int64s);
- }
-
- return private_f_int64s_resize(0, int64s);
+ return f_memory_array_decrease_by(amount, sizeof(int64_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int64s_decrease_by_
#ifndef _di_f_int64s_increase_
- f_status_t f_int64s_increase(const f_number_unsigned_t step, f_int64s_t * const int64s) {
+ f_status_t f_int64s_increase(const f_number_unsigned_t step, f_int64s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int64s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && int64s->used + 1 > int64s->size) {
- f_number_unsigned_t size = int64s->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (int64s->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_int64s_resize(size, int64s);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(int64_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int64s_increase_
#ifndef _di_f_int64s_increase_by_
- f_status_t f_int64s_increase_by(const f_number_unsigned_t amount, f_int64s_t * const int64s) {
+ f_status_t f_int64s_increase_by(const f_number_unsigned_t amount, f_int64s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int64s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (int64s->used + amount > int64s->size) {
- if (int64s->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_int64s_resize(int64s->used + amount, int64s);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(int64_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int64s_increase_by_
#ifndef _di_f_int64s_resize_
- f_status_t f_int64s_resize(const f_number_unsigned_t length, f_int64s_t * const int64s) {
+ f_status_t f_int64s_resize(const f_number_unsigned_t length, f_int64s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int64s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int64s_resize(length, int64s);
+ return f_memory_array_resize(length, sizeof(int64_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int64s_resize_
#ifndef _di_f_int64ss_adjust_
- f_status_t f_int64ss_adjust(const f_number_unsigned_t length, f_int64ss_t * const int64ss) {
+ f_status_t f_int64ss_adjust(const f_number_unsigned_t length, f_int64ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int64ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int64ss_adjust(length, int64ss);
+ return private_f_int64ss_adjust(length, structure);
}
#endif // _di_f_int64ss_adjust_
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_int64ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_int64s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
status = private_f_int64s_append_all(source, &destination->array[destination->used]);
if (F_status_is_error(status)) return status;
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_int64ss_resize(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_int64s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
#endif // _di_f_int64ss_append_all_
#ifndef _di_f_int64ss_decimate_by_
- f_status_t f_int64ss_decimate_by(const f_number_unsigned_t amount, f_int64ss_t * const int64ss) {
+ f_status_t f_int64ss_decimate_by(const f_number_unsigned_t amount, f_int64ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int64ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (int64ss->size - amount > 0) {
- return private_f_int64ss_adjust(int64ss->size - amount, int64ss);
- }
-
- return private_f_int64ss_adjust(0, int64ss);
+ return private_f_int64ss_adjust((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_int64ss_decimate_by_
#ifndef _di_f_int64ss_decrease_by_
- f_status_t f_int64ss_decrease_by(const f_number_unsigned_t amount, f_int64ss_t * const int64ss) {
+ f_status_t f_int64ss_decrease_by(const f_number_unsigned_t amount, f_int64ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int64ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (int64ss->size - amount > 0) {
- return private_f_int64ss_resize(int64ss->size - amount, int64ss);
- }
-
- return private_f_int64ss_resize(0, int64ss);
+ return private_f_int64ss_resize((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_int64ss_decrease_by_
#ifndef _di_f_int64ss_increase_
- f_status_t f_int64ss_increase(const f_number_unsigned_t step, f_int64ss_t * const int64ss) {
+ f_status_t f_int64ss_increase(const f_number_unsigned_t step, f_int64ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int64ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && int64ss->used + 1 > int64ss->size) {
- f_number_unsigned_t size = int64ss->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (int64ss->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_int64ss_resize(size, int64ss);
+ return private_f_int64ss_resize(length, structure);
}
return F_data_not;
#endif // _di_f_int64ss_increase_
#ifndef _di_f_int64ss_increase_by_
- f_status_t f_int64ss_increase_by(const f_number_unsigned_t amount, f_int64ss_t * const int64ss) {
+ f_status_t f_int64ss_increase_by(const f_number_unsigned_t amount, f_int64ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int64ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (int64ss->used + amount > int64ss->size) {
- if (int64ss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = structure->used + amount;
- return private_f_int64ss_resize(int64ss->used + amount, int64ss);
+ if (length > structure->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_int64ss_resize(structure->used + amount, structure);
+ }
}
return F_data_not;
#endif // _di_f_int64ss_increase_by_
#ifndef _di_f_int64ss_resize_
- f_status_t f_int64ss_resize(const f_number_unsigned_t length, f_int64ss_t * const int64ss) {
+ f_status_t f_int64ss_resize(const f_number_unsigned_t length, f_int64ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int64ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int64ss_resize(length, int64ss);
+ return private_f_int64ss_resize(length, structure);
}
#endif // _di_f_int64ss_resize_
#endif
/**
- * Resize the int64s array.
+ * Resize the string int64s array.
*
* @param length
* The new size to use.
- * @param int64s
- * The int64s array to resize.
+ * @param structure
+ * The string int64s 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_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_int64s_adjust_
- extern f_status_t f_int64s_adjust(const f_number_unsigned_t length, f_int64s_t * const int64s);
+ extern f_status_t f_int64s_adjust(const f_number_unsigned_t length, f_int64s_t * const structure);
#endif // _di_f_int64s_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_int64s_append_
extern f_status_t f_int64s_append(const int64_t source, f_int64s_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int64s_append_all_
extern f_status_t f_int64s_append_all(const f_int64s_t source, f_int64s_t * const destination);
#endif // _di_f_int64s_append_all_
/**
- * Resize the int64s array to a smaller size.
+ * Resize the string int64s array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param int64s
- * The int64s array to resize.
+ * @param structure
+ * The string int64s 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_array_decimate_by().
+ *
+ * @see f_memory_array_decimate_by()
*/
#ifndef _di_f_int64s_decimate_by_
- extern f_status_t f_int64s_decimate_by(const f_number_unsigned_t amount, f_int64s_t * const int64s);
+ extern f_status_t f_int64s_decimate_by(const f_number_unsigned_t amount, f_int64s_t * const structure);
#endif // _di_f_int64s_decimate_by_
/**
- * Resize the int64s array to a smaller size.
+ * Resize the string int64s array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param int64s
- * The int64s array to resize.
+ * @param structure
+ * The string int64s 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().
+ * Errors (with error bit) from: f_memory_array_decrease_by().
+ *
+ * @see f_memory_array_decrease_by()
*/
#ifndef _di_f_int64s_decrease_by_
- extern f_status_t f_int64s_decrease_by(const f_number_unsigned_t amount, f_int64s_t * const int64s);
+ extern f_status_t f_int64s_decrease_by(const f_number_unsigned_t amount, f_int64s_t * const structure);
#endif // _di_f_int64s_decrease_by_
/**
- * Increase the size of the int64s array, but only if necesary.
+ * Increase the size of the string int64s array, but only if necesary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param int64s
- * The int64s array to resize.
+ * @param structure
+ * The string int64s array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_int64s_increase_
- extern f_status_t f_int64s_increase(const f_number_unsigned_t step, f_int64s_t * const int64s);
+ extern f_status_t f_int64s_increase(const f_number_unsigned_t step, f_int64s_t * const structure);
#endif // _di_f_int64s_increase_
/**
- * Resize the int64s array to a larger size.
+ * Resize the string int64s array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param int64s
- * The int64s array to resize.
+ * @param structure
+ * The string int64s array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int64s_increase_by_
- extern f_status_t f_int64s_increase_by(const f_number_unsigned_t amount, f_int64s_t * const int64s);
+ extern f_status_t f_int64s_increase_by(const f_number_unsigned_t amount, f_int64s_t * const structure);
#endif // _di_f_int64s_increase_by_
/**
- * Resize the int64s array.
+ * Resize the string int64s array.
*
* @param length
* The new size to use.
- * @param int64s
- * The int64s array to adjust.
+ * @param structure
+ * The string int64s 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int64s_resize_
- extern f_status_t f_int64s_resize(const f_number_unsigned_t length, f_int64s_t * const int64s);
+ extern f_status_t f_int64s_resize(const f_number_unsigned_t length, f_int64s_t * const structure);
#endif // _di_f_int64s_resize_
/**
- * Resize the int64ss array.
+ * Resize the string int64ss array.
*
* @param length
* The new size to use.
- * @param int64ss
- * The int64ss array to resize.
+ * @param structure
+ * The string int64ss 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_int64ss_adjust_
- extern f_status_t f_int64ss_adjust(const f_number_unsigned_t length, f_int64ss_t * const int64ss);
+ extern f_status_t f_int64ss_adjust(const f_number_unsigned_t length, f_int64ss_t * const structure);
#endif // _di_f_int64ss_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int64ss_append_
extern f_status_t f_int64ss_append(const f_int64s_t source, f_int64ss_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int64ss_append_all_
extern f_status_t f_int64ss_append_all(const f_int64ss_t source, f_int64ss_t * const destination);
#endif // _di_f_int64ss_append_all_
/**
- * Resize the int64ss array to a smaller size.
+ * Resize the string int64ss array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param int64ss
- * The int64ss array to resize.
+ * @param structure
+ * The string int64ss array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_int64ss_decimate_by_
- extern f_status_t f_int64ss_decimate_by(const f_number_unsigned_t amount, f_int64ss_t * const int64ss);
+ extern f_status_t f_int64ss_decimate_by(const f_number_unsigned_t amount, f_int64ss_t * const structure);
#endif // _di_f_int64ss_decimate_by_
/**
- * Resize the int64ss array to a smaller size.
+ * Resize the string int64ss array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param int64ss
- * The int64ss array to resize.
+ * @param structure
+ * The string int64ss array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_delete().
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int64ss_decrease_by_
- extern f_status_t f_int64ss_decrease_by(const f_number_unsigned_t amount, f_int64ss_t * const int64ss);
+ extern f_status_t f_int64ss_decrease_by(const f_number_unsigned_t amount, f_int64ss_t * const structure);
#endif // _di_f_int64ss_decrease_by_
/**
- * Increase the size of the int64ss array, but only if necessary.
+ * Increase the size of the string int64ss array, but only if necessary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param int64ss
- * The int64ss array to resize.
+ * @param structure
+ * The string int64ss array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int64ss_increase_
- extern f_status_t f_int64ss_increase(const f_number_unsigned_t step, f_int64ss_t * const int64ss);
+ extern f_status_t f_int64ss_increase(const f_number_unsigned_t step, f_int64ss_t * const structure);
#endif // _di_f_int64ss_increase_
/**
- * Resize the int64ss array to a larger size.
+ * Resize the string int64ss array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param int64ss
- * The int64ss array to resize.
+ * @param structure
+ * The string int64ss array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int64ss_increase_by_
- extern f_status_t f_int64ss_increase_by(const f_number_unsigned_t amount, f_int64ss_t * const int64ss);
+ extern f_status_t f_int64ss_increase_by(const f_number_unsigned_t amount, f_int64ss_t * const structure);
#endif // _di_f_int64ss_increase_by_
/**
- * Resize the int64ss array.
+ * Resize the string int64ss array.
*
* @param length
* The new size to use.
- * @param int64ss
- * The int64ss array to adjust.
+ * @param structure
+ * The string int64ss 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int64ss_resize_
- extern f_status_t f_int64ss_resize(const f_number_unsigned_t length, f_int64ss_t * const int64ss);
+ extern f_status_t f_int64ss_resize(const f_number_unsigned_t length, f_int64ss_t * const structure);
#endif // _di_f_int64ss_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_int8s_adjust_
- f_status_t f_int8s_adjust(const f_number_unsigned_t length, f_int8s_t * const int8s) {
+ f_status_t f_int8s_adjust(const f_number_unsigned_t length, f_int8s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int8s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int8s_adjust(length, int8s);
+ return f_memory_array_adjust(length, sizeof(int8_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int8s_adjust_
#endif // _di_f_int8s_append_all_
#ifndef _di_f_int8s_decimate_by_
- f_status_t f_int8s_decimate_by(const f_number_unsigned_t amount, f_int8s_t * const int8s) {
+ f_status_t f_int8s_decimate_by(const f_number_unsigned_t amount, f_int8s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int8s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (int8s->size - amount > 0) {
- return private_f_int8s_adjust(int8s->size - amount, int8s);
- }
-
- return private_f_int8s_adjust(0, int8s);
+ return f_memory_array_decimate_by(amount, sizeof(int8_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int8s_decimate_by_
#ifndef _di_f_int8s_decrease_by_
- f_status_t f_int8s_decrease_by(const f_number_unsigned_t amount, f_int8s_t * const int8s) {
+ f_status_t f_int8s_decrease_by(const f_number_unsigned_t amount, f_int8s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int8s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (int8s->size - amount > 0) {
- return private_f_int8s_resize(int8s->size - amount, int8s);
- }
-
- return private_f_int8s_resize(0, int8s);
+ return f_memory_array_decrease_by(amount, sizeof(int8_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int8s_decrease_by_
#ifndef _di_f_int8s_increase_
- f_status_t f_int8s_increase(const f_number_unsigned_t step, f_int8s_t * const int8s) {
+ f_status_t f_int8s_increase(const f_number_unsigned_t step, f_int8s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int8s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && int8s->used + 1 > int8s->size) {
- f_number_unsigned_t size = int8s->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (int8s->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_int8s_resize(size, int8s);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(int8_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int8s_increase_
#ifndef _di_f_int8s_increase_by_
- f_status_t f_int8s_increase_by(const f_number_unsigned_t amount, f_int8s_t * const int8s) {
+ f_status_t f_int8s_increase_by(const f_number_unsigned_t amount, f_int8s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int8s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (int8s->used + amount > int8s->size) {
- if (int8s->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_int8s_resize(int8s->used + amount, int8s);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(int8_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int8s_increase_by_
#ifndef _di_f_int8s_resize_
- f_status_t f_int8s_resize(const f_number_unsigned_t length, f_int8s_t * const int8s) {
+ f_status_t f_int8s_resize(const f_number_unsigned_t length, f_int8s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int8s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int8s_resize(length, int8s);
+ return f_memory_array_resize(length, sizeof(int8_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_int8s_resize_
#ifndef _di_f_int8ss_adjust_
- f_status_t f_int8ss_adjust(const f_number_unsigned_t length, f_int8ss_t * const int8ss) {
+ f_status_t f_int8ss_adjust(const f_number_unsigned_t length, f_int8ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int8ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int8ss_adjust(length, int8ss);
+ return private_f_int8ss_adjust(length, structure);
}
#endif // _di_f_int8ss_adjust_
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_int8ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_int8s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
status = private_f_int8s_append_all(source, &destination->array[destination->used]);
if (F_status_is_error(status)) return status;
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_int8ss_resize(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_int8s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
#endif // _di_f_int8ss_append_all_
#ifndef _di_f_int8ss_decimate_by_
- f_status_t f_int8ss_decimate_by(const f_number_unsigned_t amount, f_int8ss_t * const int8ss) {
+ f_status_t f_int8ss_decimate_by(const f_number_unsigned_t amount, f_int8ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int8ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (int8ss->size - amount > 0) {
- return private_f_int8ss_adjust(int8ss->size - amount, int8ss);
- }
-
- return private_f_int8ss_adjust(0, int8ss);
+ return private_f_int8ss_adjust((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_int8ss_decimate_by_
#ifndef _di_f_int8ss_decrease_by_
- f_status_t f_int8ss_decrease_by(const f_number_unsigned_t amount, f_int8ss_t * const int8ss) {
+ f_status_t f_int8ss_decrease_by(const f_number_unsigned_t amount, f_int8ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int8ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (int8ss->size - amount > 0) {
- return private_f_int8ss_resize(int8ss->size - amount, int8ss);
- }
-
- return private_f_int8ss_resize(0, int8ss);
+ return private_f_int8ss_resize((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_int8ss_decrease_by_
#ifndef _di_f_int8ss_increase_
- f_status_t f_int8ss_increase(const f_number_unsigned_t step, f_int8ss_t * const int8ss) {
+ f_status_t f_int8ss_increase(const f_number_unsigned_t step, f_int8ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int8ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && int8ss->used + 1 > int8ss->size) {
- f_number_unsigned_t size = int8ss->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (int8ss->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_int8ss_resize(size, int8ss);
+ return private_f_int8ss_resize(length, structure);
}
return F_data_not;
#endif // _di_f_int8ss_increase_
#ifndef _di_f_int8ss_increase_by_
- f_status_t f_int8ss_increase_by(const f_number_unsigned_t amount, f_int8ss_t * const int8ss) {
+ f_status_t f_int8ss_increase_by(const f_number_unsigned_t amount, f_int8ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int8ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (int8ss->used + amount > int8ss->size) {
- if (int8ss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = structure->used + amount;
- return private_f_int8ss_resize(int8ss->used + amount, int8ss);
+ if (length > structure->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_int8ss_resize(structure->used + amount, structure);
+ }
}
return F_data_not;
#endif // _di_f_int8ss_increase_by_
#ifndef _di_f_int8ss_resize_
- f_status_t f_int8ss_resize(const f_number_unsigned_t length, f_int8ss_t * const int8ss) {
+ f_status_t f_int8ss_resize(const f_number_unsigned_t length, f_int8ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!int8ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_int8ss_resize(length, int8ss);
+ return private_f_int8ss_resize(length, structure);
}
#endif // _di_f_int8ss_resize_
#endif
/**
- * Resize the int8s array.
+ * Resize the string int8s array.
*
* @param length
* The new size to use.
- * @param int8s
- * The int8s array to resize.
+ * @param structure
+ * The string int8s 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_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_int8s_adjust_
- extern f_status_t f_int8s_adjust(const f_number_unsigned_t length, f_int8s_t * const int8s);
+ extern f_status_t f_int8s_adjust(const f_number_unsigned_t length, f_int8s_t * const structure);
#endif // _di_f_int8s_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_int8s_append_
extern f_status_t f_int8s_append(const int8_t source, f_int8s_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int8s_append_all_
extern f_status_t f_int8s_append_all(const f_int8s_t source, f_int8s_t * const destination);
#endif // _di_f_int8s_append_all_
/**
- * Resize the int8s array to a smaller size.
+ * Resize the string int8s array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param int8s
- * The int8s array to resize.
+ * @param structure
+ * The string int8s 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_array_decimate_by().
+ *
+ * @see f_memory_array_decimate_by()
*/
#ifndef _di_f_int8s_decimate_by_
- extern f_status_t f_int8s_decimate_by(const f_number_unsigned_t amount, f_int8s_t * const int8s);
+ extern f_status_t f_int8s_decimate_by(const f_number_unsigned_t amount, f_int8s_t * const structure);
#endif // _di_f_int8s_decimate_by_
/**
- * Resize the int8s array to a smaller size.
+ * Resize the string int8s array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param int8s
- * The int8s array to resize.
+ * @param structure
+ * The string int8s 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().
+ * Errors (with error bit) from: f_memory_array_decrease_by().
+ *
+ * @see f_memory_array_decrease_by()
*/
#ifndef _di_f_int8s_decrease_by_
- extern f_status_t f_int8s_decrease_by(const f_number_unsigned_t amount, f_int8s_t * const int8s);
+ extern f_status_t f_int8s_decrease_by(const f_number_unsigned_t amount, f_int8s_t * const structure);
#endif // _di_f_int8s_decrease_by_
/**
- * Increase the size of the int8s array, but only if necesary.
+ * Increase the size of the string int8s array, but only if necesary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param int8s
- * The int8s array to resize.
+ * @param structure
+ * The string int8s array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_int8s_increase_
- extern f_status_t f_int8s_increase(const f_number_unsigned_t step, f_int8s_t * const int8s);
+ extern f_status_t f_int8s_increase(const f_number_unsigned_t step, f_int8s_t * const structure);
#endif // _di_f_int8s_increase_
/**
- * Resize the int8s array to a larger size.
+ * Resize the string int8s array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param int8s
- * The int8s array to resize.
+ * @param structure
+ * The string int8s array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int8s_increase_by_
- extern f_status_t f_int8s_increase_by(const f_number_unsigned_t amount, f_int8s_t * const int8s);
+ extern f_status_t f_int8s_increase_by(const f_number_unsigned_t amount, f_int8s_t * const structure);
#endif // _di_f_int8s_increase_by_
/**
- * Resize the int8s array.
+ * Resize the string int8s array.
*
* @param length
* The new size to use.
- * @param int8s
- * The int8s array to adjust.
+ * @param structure
+ * The string int8s 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int8s_resize_
- extern f_status_t f_int8s_resize(const f_number_unsigned_t length, f_int8s_t * const int8s);
+ extern f_status_t f_int8s_resize(const f_number_unsigned_t length, f_int8s_t * const structure);
#endif // _di_f_int8s_resize_
/**
- * Resize the int8ss array.
+ * Resize the string int8ss array.
*
* @param length
* The new size to use.
- * @param int8ss
- * The int8ss array to resize.
+ * @param structure
+ * The string int8ss 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_int8ss_adjust_
- extern f_status_t f_int8ss_adjust(const f_number_unsigned_t length, f_int8ss_t * const int8ss);
+ extern f_status_t f_int8ss_adjust(const f_number_unsigned_t length, f_int8ss_t * const structure);
#endif // _di_f_int8ss_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int8ss_append_
extern f_status_t f_int8ss_append(const f_int8s_t source, f_int8ss_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_int8ss_append_all_
extern f_status_t f_int8ss_append_all(const f_int8ss_t source, f_int8ss_t * const destination);
#endif // _di_f_int8ss_append_all_
/**
- * Resize the int8ss array to a smaller size.
+ * Resize the string int8ss array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param int8ss
- * The int8ss array to resize.
+ * @param structure
+ * The string int8ss array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_int8ss_decimate_by_
- extern f_status_t f_int8ss_decimate_by(const f_number_unsigned_t amount, f_int8ss_t * const int8ss);
+ extern f_status_t f_int8ss_decimate_by(const f_number_unsigned_t amount, f_int8ss_t * const structure);
#endif // _di_f_int8ss_decimate_by_
/**
- * Resize the int8ss array to a smaller size.
+ * Resize the string int8ss array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param int8ss
- * The int8ss array to resize.
+ * @param structure
+ * The string int8ss array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_delete().
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int8ss_decrease_by_
- extern f_status_t f_int8ss_decrease_by(const f_number_unsigned_t amount, f_int8ss_t * const int8ss);
+ extern f_status_t f_int8ss_decrease_by(const f_number_unsigned_t amount, f_int8ss_t * const structure);
#endif // _di_f_int8ss_decrease_by_
/**
- * Increase the size of the int8ss array, but only if necessary.
+ * Increase the size of the string int8ss array, but only if necessary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param int8ss
- * The int8ss array to resize.
+ * @param structure
+ * The string int8ss array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int8ss_increase_
- extern f_status_t f_int8ss_increase(const f_number_unsigned_t step, f_int8ss_t * const int8ss);
+ extern f_status_t f_int8ss_increase(const f_number_unsigned_t step, f_int8ss_t * const structure);
#endif // _di_f_int8ss_increase_
/**
- * Resize the int8ss array to a larger size.
+ * Resize the string int8ss array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param int8ss
- * The int8ss array to resize.
+ * @param structure
+ * The string int8ss array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int8ss_increase_by_
- extern f_status_t f_int8ss_increase_by(const f_number_unsigned_t amount, f_int8ss_t * const int8ss);
+ extern f_status_t f_int8ss_increase_by(const f_number_unsigned_t amount, f_int8ss_t * const structure);
#endif // _di_f_int8ss_increase_by_
/**
- * Resize the int8ss array.
+ * Resize the string int8ss array.
*
* @param length
* The new size to use.
- * @param int8ss
- * The int8ss array to adjust.
+ * @param structure
+ * The string int8ss 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_int8ss_resize_
- extern f_status_t f_int8ss_resize(const f_number_unsigned_t length, f_int8ss_t * const int8ss);
+ extern f_status_t f_int8ss_resize(const f_number_unsigned_t length, f_int8ss_t * const structure);
#endif // _di_f_int8ss_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_number_unsigneds_adjust_
- f_status_t f_number_unsigneds_adjust(const f_number_unsigned_t length, f_number_unsigneds_t * const lengths) {
+ f_status_t f_number_unsigneds_adjust(const f_number_unsigned_t length, f_number_unsigneds_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!lengths) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_number_unsigneds_adjust(length, lengths);
+ return f_memory_array_adjust(length, sizeof(f_number_unsigned_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_number_unsigneds_adjust_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_number_unsigneds_resize(destination->used + F_memory_default_allocation_small_d, destination);
- if (F_status_is_error(status)) return status;
- }
-
- destination->array[destination->used++] = source;
-
- return F_none;
+ return private_f_number_unsigneds_append(source, destination);
}
#endif // _di_f_number_unsigneds_append_
#endif // _di_f_number_unsigneds_append_all_
#ifndef _di_f_number_unsigneds_decimate_by_
- f_status_t f_number_unsigneds_decimate_by(const f_number_unsigned_t amount, f_number_unsigneds_t * const lengths) {
+ f_status_t f_number_unsigneds_decimate_by(const f_number_unsigned_t amount, f_number_unsigneds_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!lengths) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (lengths->size - amount > 0) {
- return private_f_number_unsigneds_adjust(lengths->size - amount, lengths);
- }
-
- return private_f_number_unsigneds_adjust(0, lengths);
+ return f_memory_array_decimate_by(amount, sizeof(f_number_unsigned_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_number_unsigneds_decimate_by_
#ifndef _di_f_number_unsigneds_decrease_by_
- f_status_t f_number_unsigneds_decrease_by(const f_number_unsigned_t amount, f_number_unsigneds_t * const lengths) {
+ f_status_t f_number_unsigneds_decrease_by(const f_number_unsigned_t amount, f_number_unsigneds_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!lengths) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (lengths->size - amount > 0) {
- return private_f_number_unsigneds_resize(lengths->size - amount, lengths);
- }
-
- return private_f_number_unsigneds_resize(0, lengths);
+ return f_memory_array_decrease_by(amount, sizeof(f_number_unsigned_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_number_unsigneds_decrease_by_
#ifndef _di_f_number_unsigneds_increase_
- f_status_t f_number_unsigneds_increase(const f_number_unsigned_t step, f_number_unsigneds_t * const lengths) {
+ f_status_t f_number_unsigneds_increase(const f_number_unsigned_t step, f_number_unsigneds_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!lengths) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && lengths->used + 1 > lengths->size) {
- f_number_unsigned_t size = lengths->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (lengths->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_number_unsigneds_resize(size, lengths);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(f_number_unsigned_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_number_unsigneds_increase_
#ifndef _di_f_number_unsigneds_increase_by_
- f_status_t f_number_unsigneds_increase_by(const f_number_unsigned_t amount, f_number_unsigneds_t * const lengths) {
+ f_status_t f_number_unsigneds_increase_by(const f_number_unsigned_t amount, f_number_unsigneds_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!lengths) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (lengths->used + amount > lengths->size) {
- if (lengths->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_number_unsigneds_resize(lengths->used + amount, lengths);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(f_number_unsigned_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_number_unsigneds_increase_by_
#ifndef _di_f_number_unsigneds_resize_
- f_status_t f_number_unsigneds_resize(const f_number_unsigned_t length, f_number_unsigneds_t * const lengths) {
+ f_status_t f_number_unsigneds_resize(const f_number_unsigned_t length, f_number_unsigneds_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!lengths) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_number_unsigneds_resize(length, lengths);
+ return f_memory_array_resize(length, sizeof(f_number_unsigned_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_number_unsigneds_resize_
#ifndef _di_f_number_unsignedss_adjust_
- f_status_t f_number_unsignedss_adjust(const f_number_unsigned_t length, f_number_unsignedss_t * const lengthss) {
+ f_status_t f_number_unsignedss_adjust(const f_number_unsigned_t length, f_number_unsignedss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!lengthss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_number_unsignedss_adjust(length, lengthss);
+ return private_f_number_unsignedss_adjust(length, structure);
}
#endif // _di_f_number_unsignedss_adjust_
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_number_unsignedss_resize(destination->used + F_memory_default_allocation_small_d, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_number_unsigneds_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
status = private_f_number_unsigneds_append_all(source, &destination->array[destination->used]);
if (F_status_is_error(status)) return status;
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_number_unsignedss_resize(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_number_unsigneds_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
#endif // _di_f_number_unsignedss_append_all_
#ifndef _di_f_number_unsignedss_decimate_by_
- f_status_t f_number_unsignedss_decimate_by(const f_number_unsigned_t amount, f_number_unsignedss_t * const lengthss) {
+ f_status_t f_number_unsignedss_decimate_by(const f_number_unsigned_t amount, f_number_unsignedss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!lengthss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (lengthss->size - amount > 0) {
- return private_f_number_unsignedss_adjust(lengthss->size - amount, lengthss);
- }
-
- return private_f_number_unsignedss_adjust(0, lengthss);
+ return private_f_number_unsignedss_adjust((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_number_unsignedss_decimate_by_
#ifndef _di_f_number_unsignedss_decrease_by_
- f_status_t f_number_unsignedss_decrease_by(const f_number_unsigned_t amount, f_number_unsignedss_t * const lengthss) {
+ f_status_t f_number_unsignedss_decrease_by(const f_number_unsigned_t amount, f_number_unsignedss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!lengthss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (lengthss->size - amount > 0) {
- return private_f_number_unsignedss_resize(lengthss->size - amount, lengthss);
- }
-
- return private_f_number_unsignedss_resize(0, lengthss);
+ return private_f_number_unsignedss_resize((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_number_unsignedss_decrease_by_
#ifndef _di_f_number_unsignedss_increase_
- f_status_t f_number_unsignedss_increase(const f_number_unsigned_t step, f_number_unsignedss_t * const lengthss) {
+ f_status_t f_number_unsignedss_increase(const f_number_unsigned_t step, f_number_unsignedss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!lengthss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && lengthss->used + 1 > lengthss->size) {
- f_number_unsigned_t size = lengthss->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (size > F_number_t_size_unsigned_d) {
- if (lengthss->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ f_number_unsigned_t length = structure->used + step;
- size = F_number_t_size_unsigned_d;
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ length = F_number_t_size_unsigned_d;
}
- return private_f_number_unsignedss_resize(size, lengthss);
+ return private_f_number_unsignedss_resize(length, structure);
}
return F_data_not;
#endif // _di_f_number_unsignedss_increase_
#ifndef _di_f_number_unsignedss_increase_by_
- f_status_t f_number_unsignedss_increase_by(const f_number_unsigned_t amount, f_number_unsignedss_t * const lengthss) {
+ f_status_t f_number_unsignedss_increase_by(const f_number_unsigned_t amount, f_number_unsignedss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!lengthss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (lengthss->used + amount > lengthss->size) {
- if (lengthss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = structure->used + amount;
- return private_f_number_unsignedss_resize(lengthss->used + amount, lengthss);
+ if (length > structure->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_number_unsignedss_resize(structure->used + amount, structure);
+ }
}
return F_data_not;
#endif // _di_f_number_unsignedss_increase_by_
#ifndef _di_f_number_unsignedss_resize_
- f_status_t f_number_unsignedss_resize(const f_number_unsigned_t length, f_number_unsignedss_t * const lengthss) {
+ f_status_t f_number_unsignedss_resize(const f_number_unsigned_t length, f_number_unsignedss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!lengthss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_number_unsignedss_resize(length, lengthss);
+ return private_f_number_unsignedss_resize(length, structure);
}
#endif // _di_f_number_unsignedss_resize_
#endif
/**
- * Resize the string lengths array.
+ * Resize the string number_unsigneds array.
*
* @param length
* The new size to use.
- * @param lengths
- * The string lengths array to resize.
+ * @param structure
+ * The string number_unsigneds 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_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_number_unsigneds_adjust_
- extern f_status_t f_number_unsigneds_adjust(const f_number_unsigned_t length, f_number_unsigneds_t * const lengths);
+ extern f_status_t f_number_unsigneds_adjust(const f_number_unsigned_t length, f_number_unsigneds_t * const structure);
#endif // _di_f_number_unsigneds_adjust_
/**
- * Append the single source length onto the destination.
+ * Append the single source number_unsigned onto the destination.
*
* @param source
- * The source length to append.
+ * The source number_unsigned to append.
* @param destination
- * The destination lengths the source is appended onto.
+ * The destination number_unsigneds the source is appended onto.
*
* @return
* F_none on success.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_number_unsigneds_append_
extern f_status_t f_number_unsigneds_append(const f_number_unsigned_t source, f_number_unsigneds_t * const destination);
#endif // _di_f_number_unsigneds_append_
/**
- * Append the source lengths onto the destination.
+ * Append the source number_unsigneds onto the destination.
*
* @param source
- * The source lengths to append.
+ * The source number_unsigneds to append.
* @param destination
- * The destination lengths the source is appended onto.
+ * The destination number_unsigneds the source is appended onto.
*
* @return
* F_none on success.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_number_unsigneds_append_all_
extern f_status_t f_number_unsigneds_append_all(const f_number_unsigneds_t source, f_number_unsigneds_t * const destination);
#endif // _di_f_number_unsigneds_append_all_
/**
- * Resize the string lengths array to a smaller size.
+ * Resize the string number_unsigneds array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param lengths
- * The string lengths array to resize.
+ * @param structure
+ * The string number_unsigneds array to resize.
*
* @return
* F_none on success.
+ * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_array_decimate_by().
+ *
+ * @see f_memory_array_decimate_by()
*/
#ifndef _di_f_number_unsigneds_decimate_by_
- extern f_status_t f_number_unsigneds_decimate_by(const f_number_unsigned_t amount, f_number_unsigneds_t * const lengths);
+ extern f_status_t f_number_unsigneds_decimate_by(const f_number_unsigned_t amount, f_number_unsigneds_t * const structure);
#endif // _di_f_number_unsigneds_decimate_by_
/**
- * Resize the string lengths array to a smaller size.
+ * Resize the string number_unsigneds array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param lengths
- * The string lengths array to resize.
+ * @param structure
+ * The string number_unsigneds array to resize.
*
* @return
* F_none on success.
+ * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_decrease_by().
+ *
+ * @see f_memory_array_decrease_by()
*/
#ifndef _di_f_number_unsigneds_decrease_by_
- extern f_status_t f_number_unsigneds_decrease_by(const f_number_unsigned_t amount, f_number_unsigneds_t * const lengths);
+ extern f_status_t f_number_unsigneds_decrease_by(const f_number_unsigned_t amount, f_number_unsigneds_t * const structure);
#endif // _di_f_number_unsigneds_decrease_by_
/**
- * Increase the size of the string lengths array, but only if necesary.
+ * Increase the size of the string number_unsigneds array, but only if necesary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param lengths
- * The string lengths array to resize.
+ * @param structure
+ * The string number_unsigneds array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_number_unsigneds_increase_
- extern f_status_t f_number_unsigneds_increase(const f_number_unsigned_t step, f_number_unsigneds_t * const lengths);
+ extern f_status_t f_number_unsigneds_increase(const f_number_unsigned_t step, f_number_unsigneds_t * const structure);
#endif // _di_f_number_unsigneds_increase_
/**
- * Resize the string lengths array to a larger size.
+ * Resize the string number_unsigneds array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param lengths
- * The string lengths array to resize.
+ * @param structure
+ * The string number_unsigneds array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_number_unsigneds_increase_by_
- extern f_status_t f_number_unsigneds_increase_by(const f_number_unsigned_t amount, f_number_unsigneds_t * const lengths);
+ extern f_status_t f_number_unsigneds_increase_by(const f_number_unsigned_t amount, f_number_unsigneds_t * const structure);
#endif // _di_f_number_unsigneds_increase_by_
/**
- * Resize the string lengths array.
+ * Resize the string number_unsigneds array.
*
* @param length
* The new size to use.
- * @param lengths
- * The string lengths array to adjust.
+ * @param structure
+ * The string number_unsigneds 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_number_unsigneds_resize_
- extern f_status_t f_number_unsigneds_resize(const f_number_unsigned_t length, f_number_unsigneds_t * const lengths);
+ extern f_status_t f_number_unsigneds_resize(const f_number_unsigned_t length, f_number_unsigneds_t * const structure);
#endif // _di_f_number_unsigneds_resize_
/**
- * Resize the string lengthss array.
+ * Resize the string number_unsignedss array.
*
* @param length
* The new size to use.
- * @param lengthss
- * The string lengthss array to resize.
+ * @param structure
+ * The string number_unsignedss 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_number_unsignedss_adjust_
- extern f_status_t f_number_unsignedss_adjust(const f_number_unsigned_t length, f_number_unsignedss_t * const lengthss);
+ extern f_status_t f_number_unsignedss_adjust(const f_number_unsigned_t length, f_number_unsignedss_t * const structure);
#endif // _di_f_number_unsignedss_adjust_
/**
- * Append the single source lengths onto the destination.
+ * Append the single source number_unsigneds onto the destination.
*
* @param source
- * The source lengths to append.
+ * The source number_unsigneds to append.
* @param destination
* The destination ranges the source is appended onto.
*
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_number_unsignedss_append_
extern f_status_t f_number_unsignedss_append(const f_number_unsigneds_t source, f_number_unsignedss_t * const destination);
#endif // _di_f_number_unsignedss_append_
/**
- * Append the source lengthss onto the destination.
+ * Append the source number_unsignedss onto the destination.
*
* @param source
- * The source lengthss to append.
+ * The source number_unsignedss to append.
* @param destination
* The destination ranges the source is appended onto.
*
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_number_unsignedss_append_all_
extern f_status_t f_number_unsignedss_append_all(const f_number_unsignedss_t source, f_number_unsignedss_t * const destination);
#endif // _di_f_number_unsignedss_append_all_
/**
- * Resize the string lengthss array to a smaller size.
+ * Resize the string number_unsignedss array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param lengthss
- * The string lengthss array to resize.
+ * @param structure
+ * The string number_unsignedss array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_number_unsignedss_decimate_by_
- extern f_status_t f_number_unsignedss_decimate_by(const f_number_unsigned_t amount, f_number_unsignedss_t * const lengthss);
+ extern f_status_t f_number_unsignedss_decimate_by(const f_number_unsigned_t amount, f_number_unsignedss_t * const structure);
#endif // _di_f_number_unsignedss_decimate_by_
/**
- * Resize the string lengthss array to a smaller size.
+ * Resize the string number_unsignedss array to a smaller size.
*
* This will resize making the array smaller based on (size - given length).
* If the given length is too small, then the resize will fail.
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param lengthss
- * The string lengthss array to resize.
+ * @param structure
+ * The string number_unsignedss array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_delete().
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_number_unsignedss_decrease_by_
- extern f_status_t f_number_unsignedss_decrease_by(const f_number_unsigned_t amount, f_number_unsignedss_t * const lengthss);
+ extern f_status_t f_number_unsignedss_decrease_by(const f_number_unsigned_t amount, f_number_unsignedss_t * const structure);
#endif // _di_f_number_unsignedss_decrease_by_
/**
- * Increase the size of the string lengthss array, but only if necessary.
+ * Increase the size of the string number_unsignedss array, but only if necessary.
*
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
* If already set to the maximum buffer size, then the resize will fail.
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param lengthss
- * The string lengthss array to resize.
+ * @param structure
+ * The string number_unsignedss array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_number_unsignedss_increase_
- extern f_status_t f_number_unsignedss_increase(const f_number_unsigned_t step, f_number_unsignedss_t * const lengthss);
+ extern f_status_t f_number_unsignedss_increase(const f_number_unsigned_t step, f_number_unsignedss_t * const structure);
#endif // _di_f_number_unsignedss_increase_
/**
- * Resize the string lengthss array to a larger size.
+ * Resize the string number_unsignedss array to a larger size.
*
* This will resize making the array larger based on the given length.
* If the given length is too large for the buffer, then attempt to set max buffer size (F_number_t_size_unsigned_d).
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param lengthss
- * The string lengthss array to resize.
+ * @param structure
+ * The string number_unsignedss array to resize.
*
* @return
* F_none on success.
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_number_unsignedss_increase_by_
- extern f_status_t f_number_unsignedss_increase_by(const f_number_unsigned_t amount, f_number_unsignedss_t * const lengthss);
+ extern f_status_t f_number_unsignedss_increase_by(const f_number_unsigned_t amount, f_number_unsignedss_t * const structure);
#endif // _di_f_number_unsignedss_increase_by_
/**
- * Resize the string lengthss array.
+ * Resize the string number_unsignedss array.
*
* @param length
* The new size to use.
- * @param lengthss
- * The string lengthss array to adjust.
+ * @param structure
+ * The string number_unsignedss 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_number_unsignedss_resize_
- extern f_status_t f_number_unsignedss_resize(const f_number_unsigned_t length, f_number_unsignedss_t * const lengthss);
+ extern f_status_t f_number_unsignedss_resize(const f_number_unsigned_t length, f_number_unsignedss_t * const structure);
#endif // _di_f_number_unsignedss_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_polls_adjust_
- f_status_t f_polls_adjust(const f_number_unsigned_t length, f_polls_t * const polls) {
+ f_status_t f_polls_adjust(const f_number_unsigned_t length, f_polls_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!polls) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_polls_adjust(length, polls);
+ return f_memory_array_adjust(length, sizeof(f_poll_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_polls_adjust_
#endif // _di_f_polls_append_all_
#ifndef _di_f_polls_decimate_by_
- f_status_t f_polls_decimate_by(const f_number_unsigned_t amount, f_polls_t * const polls) {
+ f_status_t f_polls_decimate_by(const f_number_unsigned_t amount, f_polls_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!polls) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
- if (polls->size - amount > 0) return private_f_polls_adjust(polls->size - amount, polls);
-
- return private_f_polls_adjust(0, polls);
+ return f_memory_array_decimate_by(amount, sizeof(f_poll_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_polls_decimate_by_
#ifndef _di_f_polls_decrease_by_
- f_status_t f_polls_decrease_by(const f_number_unsigned_t amount, f_polls_t * const polls) {
+ f_status_t f_polls_decrease_by(const f_number_unsigned_t amount, f_polls_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!polls) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
- if (polls->size - amount > 0) return private_f_polls_resize(polls->size - amount, polls);
-
- return private_f_polls_resize(0, polls);
+ return f_memory_array_decrease_by(amount, sizeof(f_poll_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_polls_decrease_by_
#ifndef _di_f_polls_increase_
- f_status_t f_polls_increase(const f_number_unsigned_t step, f_polls_t * const polls) {
+ f_status_t f_polls_increase(const f_number_unsigned_t step, f_polls_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!polls) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && polls->used + 1 > polls->size) {
- if (polls->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
- f_number_unsigned_t size = polls->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (polls->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_polls_resize(size, polls);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(f_poll_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_polls_increase_
#ifndef _di_f_polls_increase_by_
- f_status_t f_polls_increase_by(const f_number_unsigned_t amount, f_polls_t * const polls) {
+ f_status_t f_polls_increase_by(const f_number_unsigned_t amount, f_polls_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!polls) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (amount) {
- if (polls->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
- const f_number_unsigned_t length = polls->used + amount;
-
- if (length > polls->size) {
- if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
- return private_f_polls_resize(length, polls);
- }
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(f_poll_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_polls_increase_by_
#ifndef _di_f_polls_resize_
- f_status_t f_polls_resize(const f_number_unsigned_t length, f_polls_t * const polls) {
+ f_status_t f_polls_resize(const f_number_unsigned_t length, f_polls_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!polls) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_polls_resize(length, polls);
+ return f_memory_array_resize(length, sizeof(f_poll_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_polls_resize_
#ifndef _di_f_pollss_adjust_
- f_status_t f_pollss_adjust(const f_number_unsigned_t length, f_pollss_t * const pollss) {
+ f_status_t f_pollss_adjust(const f_number_unsigned_t length, f_pollss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!pollss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_pollss_adjust(length, pollss);
+ return private_f_pollss_adjust(length, structure);
}
#endif // _di_f_pollss_adjust_
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_pollss_resize(destination->used + F_memory_default_allocation_small_d, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_polls_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
status = private_f_polls_append_all(source, &destination->array[destination->used]);
if (F_status_is_error(status)) return status;
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_pollss_resize(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_polls_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
#endif // _di_f_pollss_append_all_
#ifndef _di_f_pollss_decimate_by_
- f_status_t f_pollss_decimate_by(const f_number_unsigned_t amount, f_pollss_t * const pollss) {
+ f_status_t f_pollss_decimate_by(const f_number_unsigned_t amount, f_pollss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!pollss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (pollss->size - amount > 0) return private_f_pollss_adjust(pollss->size - amount, pollss);
- return private_f_pollss_adjust(0, pollss);
+ return private_f_pollss_adjust((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_pollss_decimate_by_
#ifndef _di_f_pollss_decrease_by_
- f_status_t f_pollss_decrease_by(const f_number_unsigned_t amount, f_pollss_t * const pollss) {
+ f_status_t f_pollss_decrease_by(const f_number_unsigned_t amount, f_pollss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!pollss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (pollss->size - amount > 0) return private_f_pollss_resize(pollss->size - amount, pollss);
- return private_f_pollss_resize(0, pollss);
+ return private_f_pollss_resize((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_pollss_decrease_by_
#ifndef _di_f_pollss_increase_
- f_status_t f_pollss_increase(const f_number_unsigned_t step, f_pollss_t * const pollss) {
+ f_status_t f_pollss_increase(const f_number_unsigned_t step, f_pollss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!pollss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && pollss->used + 1 > pollss->size) {
- if (pollss->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (step && structure->used + 1 > structure->size) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- f_number_unsigned_t size = pollss->used + step;
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (pollss->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_pollss_resize(size, pollss);
+ return private_f_pollss_resize(length, structure);
}
return F_data_not;
#endif // _di_f_pollss_increase_
#ifndef _di_f_pollss_increase_by_
- f_status_t f_pollss_increase_by(const f_number_unsigned_t amount, f_pollss_t * const pollss) {
+ f_status_t f_pollss_increase_by(const f_number_unsigned_t amount, f_pollss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!pollss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (amount) {
- if (pollss->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- const f_number_unsigned_t length = pollss->used + amount;
+ const f_number_unsigned_t length = structure->used + amount;
- if (length > pollss->size) {
+ if (length > structure->size) {
if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- return private_f_pollss_resize(length, pollss);
+ return private_f_pollss_resize(structure->used + amount, structure);
}
}
#endif // _di_f_pollss_increase_by_
#ifndef _di_f_pollss_resize_
- f_status_t f_pollss_resize(const f_number_unsigned_t length, f_pollss_t * const pollss) {
+ f_status_t f_pollss_resize(const f_number_unsigned_t length, f_pollss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!pollss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_pollss_resize(length, pollss);
+ return private_f_pollss_resize(length, structure);
}
#endif // _di_f_pollss_resize_
*
* @param length
* The new size to use.
- * @param polls
+ * @param structure
* The string polls array to resize.
*
* @return
*
* 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_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_polls_adjust_
- extern f_status_t f_polls_adjust(const f_number_unsigned_t length, f_polls_t * const polls);
+ extern f_status_t f_polls_adjust(const f_number_unsigned_t length, f_polls_t * const structure);
#endif // _di_f_polls_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_polls_append_
extern f_status_t f_polls_append(const f_poll_t source, f_polls_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_polls_append_all_
extern f_status_t f_polls_append_all(const f_polls_t source, f_polls_t * const destination);
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param polls
+ * @param structure
* The string polls array to resize.
*
* @return
*
* 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_array_decimate_by().
+ *
+ * @see f_memory_array_decimate_by()
*/
#ifndef _di_f_polls_decimate_by_
- extern f_status_t f_polls_decimate_by(const f_number_unsigned_t amount, f_polls_t * const polls);
+ extern f_status_t f_polls_decimate_by(const f_number_unsigned_t amount, f_polls_t * const structure);
#endif // _di_f_polls_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param polls
+ * @param structure
* The string polls array to resize.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_decrease_by().
+ *
+ * @see f_memory_array_decrease_by()
*/
#ifndef _di_f_polls_decrease_by_
- extern f_status_t f_polls_decrease_by(const f_number_unsigned_t amount, f_polls_t * const polls);
+ extern f_status_t f_polls_decrease_by(const f_number_unsigned_t amount, f_polls_t * const structure);
#endif // _di_f_polls_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param polls
+ * @param structure
* The string polls array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_polls_increase_
- extern f_status_t f_polls_increase(const f_number_unsigned_t step, f_polls_t * const polls);
+ extern f_status_t f_polls_increase(const f_number_unsigned_t step, f_polls_t * const structure);
#endif // _di_f_polls_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param polls
+ * @param structure
* The string polls array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_polls_increase_by_
- extern f_status_t f_polls_increase_by(const f_number_unsigned_t amount, f_polls_t * const polls);
+ extern f_status_t f_polls_increase_by(const f_number_unsigned_t amount, f_polls_t * const structure);
#endif // _di_f_polls_increase_by_
/**
*
* @param length
* The new size to use.
- * @param polls
+ * @param structure
* The string polls array to adjust.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_polls_resize_
- extern f_status_t f_polls_resize(const f_number_unsigned_t length, f_polls_t * const polls);
+ extern f_status_t f_polls_resize(const f_number_unsigned_t length, f_polls_t * const structure);
#endif // _di_f_polls_resize_
/**
*
* @param length
* The new size to use.
- * @param pollss
+ * @param structure
* The string pollss array to resize.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_pollss_adjust_
- extern f_status_t f_pollss_adjust(const f_number_unsigned_t length, f_pollss_t * const pollss);
+ extern f_status_t f_pollss_adjust(const f_number_unsigned_t length, f_pollss_t * const structure);
#endif // _di_f_pollss_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_pollss_append_
extern f_status_t f_pollss_append(const f_polls_t source, f_pollss_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_pollss_append_all_
extern f_status_t f_pollss_append_all(const f_pollss_t source, f_pollss_t * const destination);
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param pollss
+ * @param structure
* The string pollss array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_pollss_decimate_by_
- extern f_status_t f_pollss_decimate_by(const f_number_unsigned_t amount, f_pollss_t * const pollss);
+ extern f_status_t f_pollss_decimate_by(const f_number_unsigned_t amount, f_pollss_t * const structure);
#endif // _di_f_pollss_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param pollss
+ * @param structure
* The string pollss array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_delete().
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_pollss_decrease_by_
- extern f_status_t f_pollss_decrease_by(const f_number_unsigned_t amount, f_pollss_t * const pollss);
+ extern f_status_t f_pollss_decrease_by(const f_number_unsigned_t amount, f_pollss_t * const structure);
#endif // _di_f_pollss_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param pollss
+ * @param structure
* The string pollss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_pollss_increase_
- extern f_status_t f_pollss_increase(const f_number_unsigned_t step, f_pollss_t * const pollss);
+ extern f_status_t f_pollss_increase(const f_number_unsigned_t step, f_pollss_t * const structure);
#endif // _di_f_pollss_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param pollss
+ * @param structure
* The string pollss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_pollss_increase_by_
- extern f_status_t f_pollss_increase_by(const f_number_unsigned_t amount, f_pollss_t * const pollss);
+ extern f_status_t f_pollss_increase_by(const f_number_unsigned_t amount, f_pollss_t * const structure);
#endif // _di_f_pollss_increase_by_
/**
*
* @param length
* The new size to use.
- * @param pollss
+ * @param structure
* The string pollss array to adjust.
*
* @return
*
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_pollss_resize_
- extern f_status_t f_pollss_resize(const f_number_unsigned_t length, f_pollss_t * const pollss);
+ extern f_status_t f_pollss_resize(const f_number_unsigned_t length, f_pollss_t * const structure);
#endif // _di_f_pollss_resize_
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(_di_f_cells_adjust_) || !defined(_di_f_cells_decimate_by_)
- f_status_t private_f_cells_adjust(const f_number_unsigned_t length, f_cells_t * const cells) {
-
- const f_status_t status = f_memory_adjust(cells->size, length, sizeof(f_cell_t), (void **) & cells->array);
- if (F_status_is_error(status)) return status;
-
- cells->size = length;
-
- if (cells->used > cells->size) {
- cells->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_cells_adjust_) || !defined(_di_f_cells_decimate_by_)
-
#if !defined(_di_f_cells_append_) || !defined(_di_f_cellss_append_)
extern f_status_t private_f_cells_append(const f_cell_t source, f_cells_t * const destination) {
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_cells_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_cell_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
- destination->array[destination->used].row = source.row;
- destination->array[destination->used++].column = source.column;
+ destination->array[destination->used++] = source;
return F_none;
}
#if !defined(_di_f_cells_append_) || !defined(_di_f_cells_append_all_) || !defined(_di_f_cellss_append_all_)
extern f_status_t private_f_cells_append_all(const f_cells_t source, f_cells_t * const destination) {
- if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_cells_resize(destination->used + source.used, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_cell_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
}
#endif // !defined(_di_f_cells_append_) || !defined(_di_f_cells_append_all_) || !defined(_di_f_cellss_append_all_)
-#if !defined(_di_f_cells_resize_) || !defined(_di_f_cells_append_) || !defined(_di_f_cells_decrease_by_) || !defined(_di_f_cellss_append_)
- f_status_t private_f_cells_resize(const f_number_unsigned_t length, f_cells_t * const cells) {
-
- const f_status_t status = f_memory_resize(cells->size, length, sizeof(f_cell_t), (void **) & cells->array);
- if (F_status_is_error(status)) return status;
-
- cells->size = length;
-
- if (cells->used > cells->size) {
- cells->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_cells_resize_) || !defined(_di_f_cells_append_) || !defined(_di_f_cells_decrease_by_) || !defined(_di_f_cellss_append_)
-
#if !defined(_di_f_cellss_adjust_) || !defined(_di_f_cellss_decimate_by_)
- f_status_t private_f_cellss_adjust(const f_number_unsigned_t length, f_cellss_t * const cellss) {
+ f_status_t private_f_cellss_adjust(const f_number_unsigned_t length, f_cellss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < cellss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_destroy(cellss->array[i].size, sizeof(f_cells_t), (void **) & cellss->array[i].array);
+ status = f_memory_array_adjust(0, sizeof(f_cell_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- cellss->array[i].size = 0;
- cellss->array[i].used = 0;
} // for
- status = f_memory_adjust(cellss->size, length, sizeof(f_cells_t), (void **) & cellss->array);
- if (F_status_is_error(status)) return status;
-
- cellss->size = length;
-
- if (cellss->used > cellss->size) {
- cellss->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_cells_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_cellss_adjust_) || !defined(_di_f_cellss_decimate_by_)
#if !defined(_di_f_cellss_decrease_by_) || !defined(_di_f_cellss_increase_) || !defined(_di_f_cellss_increase_by_) || !defined(_di_f_cellss_resize_)
- f_status_t private_f_cellss_resize(const f_number_unsigned_t length, f_cellss_t * const cellss) {
+ f_status_t private_f_cellss_resize(const f_number_unsigned_t length, f_cellss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < cellss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_delete(cellss->array[i].size, sizeof(f_cells_t), (void **) & cellss->array[i].array);
+ status = f_memory_array_resize(0, sizeof(f_cell_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- cellss->array[i].size = 0;
- cellss->array[i].used = 0;
} // for
- status = f_memory_resize(cellss->size, length, sizeof(f_cells_t), (void **) & cellss->array);
- if (F_status_is_error(status)) return status;
-
- cellss->size = length;
-
- if (cellss->used > cellss->size) {
- cellss->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_cells_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_cellss_decrease_by_) || !defined(_di_f_cellss_increase_) || !defined(_di_f_cellss_increase_by_) || !defined(_di_f_cellss_resize_)
#endif
/**
- * Private implementation for resizing the cells array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param cells
- * The cells 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_cells_adjust()
- * @see f_cells_decimate_by()
- */
-#if !defined(_di_f_cells_adjust_) || !defined(_di_f_cells_decimate_by_)
- extern f_status_t private_f_cells_adjust(const f_number_unsigned_t length, f_cells_t * const cells) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_cells_adjust_) || !defined(_di_f_cells_decimate_by_)
-
-/**
* Private implementation for appending the cell array.
*
* Intended to be shared to each of the different implementation variations.
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*
- * @see f_memory_resize()
* @see f_cells_append()
* @see f_cellss_append()
*/
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*
- * @see f_memory_resize()
* @see f_cells_append_all()
* @see f_cellss_append()
* @see f_cellss_append_all()
#endif // !defined(_di_f_cells_append_) || !defined(_di_f_cells_append_all_) || !defined(_di_f_cellss_append_all_)
/**
- * Private implementation for resizing the cells array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param cells
- * The cells 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_cells_resize()
- * @see f_cells_append()
- * @see f_cells_decrease_by()
- * @see f_cellss_append()
- */
-#if !defined(_di_f_cells_resize_) || !defined(_di_f_cells_append_) || !defined(_di_f_cells_decrease_by_) || !defined(_di_f_cellss_append_)
- extern f_status_t private_f_cells_resize(const f_number_unsigned_t length, f_cells_t * const cells) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_cells_resize_) || !defined(_di_f_cells_append_) || !defined(_di_f_cells_decrease_by_) || !defined(_di_f_cellss_append_)
-
-/**
* Private implementation for resizing the cellss array.
*
* Intended to be shared to each of the different implementation variations.
*
* @param length
* The length to adjust to.
- * @param cellss
+ * @param structure
* The cellss array to adjust.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*
* @see f_cellss_adjust()
* @see f_cellss_decimate_by()
*/
#if !defined(_di_f_cellss_adjust_) || !defined(_di_f_cellss_decimate_by_)
- extern f_status_t private_f_cellss_adjust(const f_number_unsigned_t length, f_cellss_t * const cellss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_cellss_adjust(const f_number_unsigned_t length, f_cellss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_cellss_adjust_) || !defined(_di_f_cellss_decimate_by_)
/**
*
* @param length
* The length to resize to.
- * @param cellss
+ * @param structure
* The cellss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
* @see f_cellss_decrease_by()
* @see f_cellss_increase()
* @see f_cellss_resize()
*/
#if !defined(_di_f_cellss_decrease_by_) || !defined(_di_f_cellss_increase_) || !defined(_di_f_cellss_increase_by_) || !defined(_di_f_cellss_resize_)
- extern f_status_t private_f_cellss_resize(const f_number_unsigned_t length, f_cellss_t * const cellss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_cellss_resize(const f_number_unsigned_t length, f_cellss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_cellss_decrease_by_) || !defined(_di_f_cellss_increase_) || !defined(_di_f_cellss_increase_by_) || !defined(_di_f_cellss_resize_)
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(_di_f_files_adjust_) || !defined(_di_f_files_decimate_by_)
- f_status_t private_f_files_adjust(const f_number_unsigned_t length, f_files_t * const files) {
-
- const f_status_t status = f_memory_adjust(files->size, length, sizeof(f_file_t), (void **) & files->array);
- if (F_status_is_error(status)) return status;
-
- files->size = length;
-
- if (files->used > files->size) {
- files->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_files_adjust_) || !defined(_di_f_files_decimate_by_)
-
#if !defined(_di_f_files_append_) || !defined(_di_f_filess_append_)
extern f_status_t private_f_files_append(const f_file_t source, f_files_t * const destination) {
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_files_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_file_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
#if !defined(_di_f_files_append_) || !defined(_di_f_files_append_all_) || !defined(_di_f_filess_append_all_)
extern f_status_t private_f_files_append_all(const f_files_t source, f_files_t * const destination) {
- if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_files_resize(destination->used + source.used, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_file_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
}
#endif // !defined(_di_f_files_append_) || !defined(_di_f_files_append_all_) || !defined(_di_f_filess_append_all_)
-#if !defined(_di_f_files_append_) || !defined(_di_f_files_append_all_) || !defined(_di_f_files_decrease_by_) || !defined(_di_f_files_increase_) || !defined(_di_f_files_increase_by_) || !defined(_di_f_files_resize_) || !defined(_di_f_filess_append_) || !defined(_di_f_filess_append_all_)
- f_status_t private_f_files_resize(const f_number_unsigned_t length, f_files_t * const files) {
-
- const f_status_t status = f_memory_resize(files->size, length, sizeof(f_file_t), (void **) & files->array);
- if (F_status_is_error(status)) return status;
-
- files->size = length;
-
- if (files->used > files->size) {
- files->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_files_append_) || !defined(_di_f_files_append_all_) || !defined(_di_f_files_decrease_by_) || !defined(_di_f_files_increase_) || !defined(_di_f_files_increase_by_) || !defined(_di_f_files_resize_) || !defined(_di_f_filess_append_) || !defined(_di_f_filess_append_all_)
-
#if !defined(_di_f_filess_adjust_) || !defined(_di_f_filess_decimate_by_)
- f_status_t private_f_filess_adjust(const f_number_unsigned_t length, f_filess_t * const filess) {
+ f_status_t private_f_filess_adjust(const f_number_unsigned_t length, f_filess_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < filess->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_destroy(filess->array[i].size, sizeof(f_files_t), (void **) & filess->array[i].array);
+ status = f_memory_array_adjust(0, sizeof(f_file_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- filess->array[i].size = 0;
- filess->array[i].used = 0;
} // for
- status = f_memory_adjust(filess->size, length, sizeof(f_files_t), (void **) & filess->array);
- if (F_status_is_error(status)) return status;
-
- filess->size = length;
-
- if (filess->used > filess->size) {
- filess->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_files_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_filess_adjust_) || !defined(_di_f_filess_decimate_by_)
#if !defined(_di_f_filess_decrease_by_) || !defined(_di_f_filess_increase_) || !defined(_di_f_filess_increase_by_) || !defined(_di_f_filess_resize_)
- f_status_t private_f_filess_resize(const f_number_unsigned_t length, f_filess_t * const filess) {
+ f_status_t private_f_filess_resize(const f_number_unsigned_t length, f_filess_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < filess->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_delete(filess->array[i].size, sizeof(f_files_t), (void **) & filess->array[i].array);
+ status = f_memory_array_resize(0, sizeof(f_file_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- filess->array[i].size = 0;
- filess->array[i].used = 0;
} // for
- status = f_memory_resize(filess->size, length, sizeof(f_files_t), (void **) & filess->array);
- if (F_status_is_error(status)) return status;
-
- filess->size = length;
-
- if (filess->used > filess->size) {
- filess->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_files_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_filess_decrease_by_) || !defined(_di_f_filess_increase_) || !defined(_di_f_filess_increase_by_) || !defined(_di_f_filess_resize_)
*
* @param length
* The length to adjust to.
- * @param files
+ * @param structure
* The files 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().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*
* @see f_files_adjust()
* @see f_files_decimate_by()
*/
#if !defined(_di_f_files_adjust_) || !defined(_di_f_files_decimate_by_)
- extern f_status_t private_f_files_adjust(const f_number_unsigned_t length, f_files_t * const files) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_files_adjust(const f_number_unsigned_t length, f_files_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_files_adjust_) || !defined(_di_f_files_decimate_by_)
/**
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*
- * @see f_memory_resize()
* @see f_files_append()
* @see f_filess_append()
*/
*
* @param length
* The length to adjust to.
- * @param files
+ * @param structure
* The files array to adjust.
*
* @return
*
*/
#if !defined(_di_f_files_append_) || !defined(_di_f_files_append_all_) || !defined(_di_f_files_decrease_by_) || !defined(_di_f_files_increase_) || !defined(_di_f_files_increase_by_) || !defined(_di_f_files_resize_) || !defined(_di_f_filess_append_) || !defined(_di_f_filess_append_all_)
- extern f_status_t private_f_files_resize(const f_number_unsigned_t length, f_files_t * const files) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_files_resize(const f_number_unsigned_t length, f_files_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_files_append_) || !defined(_di_f_files_append_all_) || !defined(_di_f_files_decrease_by_) || !defined(_di_f_files_increase_) || !defined(_di_f_files_increase_by_) || !defined(_di_f_files_resize_) || !defined(_di_f_filess_append_) || !defined(_di_f_filess_append_all_)
/**
*
* @param length
* The length to adjust to.
- * @param filess
+ * @param structure
* The filess array to adjust.
*
* @return
* @see f_filess_decimate_by()
*/
#if !defined(_di_f_filess_adjust_) || !defined(_di_f_filess_decimate_by_)
- extern f_status_t private_f_filess_adjust(const f_number_unsigned_t length, f_filess_t * const filess) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_filess_adjust(const f_number_unsigned_t length, f_filess_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_filess_adjust_) || !defined(_di_f_filess_decimate_by_)
/**
*
* @param length
* The length to resize to.
- * @param filess
+ * @param structure
* The filess array to resize.
*
* @return
* @see f_filess_resize()
*/
#if !defined(_di_f_filess_decrease_by_) || !defined(_di_f_filess_increase_) || !defined(_di_f_filess_increase_by_) || !defined(_di_f_filess_resize_)
- extern f_status_t private_f_filess_resize(const f_number_unsigned_t length, f_filess_t * const filess) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_filess_resize(const f_number_unsigned_t length, f_filess_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_filess_decrease_by_) || !defined(_di_f_filess_increase_) || !defined(_di_f_filess_increase_by_) || !defined(_di_f_filess_resize_)
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(_di_f_fll_ids_adjust_) || !defined(_di_f_fll_ids_decimate_by_)
- f_status_t private_f_fll_ids_adjust(const f_number_unsigned_t length, f_fll_ids_t * const ids) {
-
- const f_status_t status = f_memory_adjust(ids->size, length, sizeof(f_fll_id_t), (void **) & ids->array);
- if (F_status_is_error(status)) return status;
-
- ids->size = length;
-
- if (ids->used > ids->size) {
- ids->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_fll_ids_adjust_) || !defined(_di_f_fll_ids_decimate_by_)
-
#if !defined(_di_f_fll_ids_append_) || !defined(_di_f_fll_idss_append_)
extern f_status_t private_f_fll_ids_append(const f_fll_id_t source, f_fll_ids_t * const destination) {
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_fll_ids_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_fll_id_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
#if !defined(_di_f_fll_ids_append_) || !defined(_di_f_fll_ids_append_all_) || !defined(_di_f_fll_idss_append_all_)
extern f_status_t private_f_fll_ids_append_all(const f_fll_ids_t source, f_fll_ids_t * const destination) {
- if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_fll_ids_resize(destination->used + source.used, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_fll_id_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
}
#endif // !defined(_di_f_fll_ids_append_) || !defined(_di_f_fll_ids_append_all_) || !defined(_di_f_fll_idss_append_all_)
-#if !defined(_di_f_fll_ids_resize_) || !defined(_di_f_fll_ids_append_) || !defined(_di_f_fll_ids_decrease_by_) || !defined(_di_f_fll_idss_append_)
- f_status_t private_f_fll_ids_resize(const f_number_unsigned_t length, f_fll_ids_t * const ids) {
-
- const f_status_t status = f_memory_resize(ids->size, length, sizeof(f_fll_id_t), (void **) & ids->array);
- if (F_status_is_error(status)) return status;
-
- ids->size = length;
-
- if (ids->used > ids->size) {
- ids->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_fll_ids_resize_) || !defined(_di_f_fll_ids_append_) || !defined(_di_f_fll_ids_decrease_by_) || !defined(_di_f_fll_idss_append_)
-
#if !defined(_di_f_fll_idss_adjust_) || !defined(_di_f_fll_idss_decimate_by_)
- f_status_t private_f_fll_idss_adjust(const f_number_unsigned_t length, f_fll_idss_t * const idss) {
+ f_status_t private_f_fll_idss_adjust(const f_number_unsigned_t length, f_fll_idss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < idss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_destroy(idss->array[i].size, sizeof(f_fll_ids_t), (void **) & idss->array[i].array);
+ status = f_memory_array_adjust(0, sizeof(f_fll_id_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
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(status)) return status;
-
- idss->size = length;
-
- if (idss->used > idss->size) {
- idss->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_fll_ids_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_fll_idss_adjust_) || !defined(_di_f_fll_idss_decimate_by_)
#if !defined(_di_f_fll_idss_decrease_by_) || !defined(_di_f_fll_idss_increase_) || !defined(_di_f_fll_idss_increase_by_) || !defined(_di_f_fll_idss_resize_)
- f_status_t private_f_fll_idss_resize(const f_number_unsigned_t length, f_fll_idss_t * const idss) {
+ f_status_t private_f_fll_idss_resize(const f_number_unsigned_t length, f_fll_idss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < idss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_delete(idss->array[i].size, sizeof(f_fll_ids_t), (void **) & idss->array[i].array);
+ status = f_memory_array_resize(0, sizeof(f_fll_id_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
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(status)) return status;
-
- idss->size = length;
-
- if (idss->used > idss->size) {
- idss->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_fll_ids_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_fll_idss_decrease_by_) || !defined(_di_f_fll_idss_increase_) || !defined(_di_f_fll_idss_increase_by_) || !defined(_di_f_fll_idss_resize_)
#endif
/**
- * Private implementation for resizing the fll_ids array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param fll_ids
- * The fll_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_fll_ids_adjust()
- * @see f_fll_ids_decimate_by()
- */
-#if !defined(_di_f_fll_ids_adjust_) || !defined(_di_f_fll_ids_decimate_by_)
- extern f_status_t private_f_fll_ids_adjust(const f_number_unsigned_t length, f_fll_ids_t * const fll_ids) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fll_ids_adjust_) || !defined(_di_f_fll_ids_decimate_by_)
-
-/**
* Private implementation for appending the fll_id array.
*
* Intended to be shared to each of the different implementation variations.
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*
- * @see f_memory_resize()
* @see f_fll_ids_append()
* @see f_fll_idss_append()
*/
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*
- * @see f_memory_resize()
* @see f_fll_ids_append_all()
* @see f_fll_idss_append()
* @see f_fll_idss_append_all()
#endif // !defined(_di_f_fll_ids_append_) || !defined(_di_f_fll_ids_append_all_) || !defined(_di_f_fll_idss_append_all_)
/**
- * Private implementation for resizing the fll_ids array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param fll_ids
- * The fll_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_fll_ids_resize()
- * @see f_fll_ids_append()
- * @see f_fll_ids_decrease_by()
- * @see f_fll_idss_append()
- */
-#if !defined(_di_f_fll_ids_resize_) || !defined(_di_f_fll_ids_append_) || !defined(_di_f_fll_ids_decrease_by_) || !defined(_di_f_fll_idss_append_)
- extern f_status_t private_f_fll_ids_resize(const f_number_unsigned_t length, f_fll_ids_t * const fll_ids) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fll_ids_resize_) || !defined(_di_f_fll_ids_append_) || !defined(_di_f_fll_ids_decrease_by_) || !defined(_di_f_fll_idss_append_)
-
-/**
* Private implementation for resizing the fll_idss array.
*
* Intended to be shared to each of the different implementation variations.
*
* @param length
* The length to adjust to.
- * @param fll_idss
+ * @param structure
* The fll_idss array to adjust.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*
* @see f_fll_idss_adjust()
* @see f_fll_idss_decimate_by()
*/
#if !defined(_di_f_fll_idss_adjust_) || !defined(_di_f_fll_idss_decimate_by_)
- extern f_status_t private_f_fll_idss_adjust(const f_number_unsigned_t length, f_fll_idss_t * const fll_idss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_fll_idss_adjust(const f_number_unsigned_t length, f_fll_idss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_fll_idss_adjust_) || !defined(_di_f_fll_idss_decimate_by_)
/**
*
* @param length
* The length to resize to.
- * @param fll_idss
+ * @param structure
* The fll_idss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
* @see f_fll_idss_decrease_by()
* @see f_fll_idss_increase()
* @see f_fll_idss_resize()
*/
#if !defined(_di_f_fll_idss_decrease_by_) || !defined(_di_f_fll_idss_increase_) || !defined(_di_f_fll_idss_increase_by_) || !defined(_di_f_fll_idss_resize_)
- extern f_status_t private_f_fll_idss_resize(const f_number_unsigned_t length, f_fll_idss_t * const fll_idss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_fll_idss_resize(const f_number_unsigned_t length, f_fll_idss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_fll_idss_decrease_by_) || !defined(_di_f_fll_idss_increase_) || !defined(_di_f_fll_idss_increase_by_) || !defined(_di_f_fll_idss_resize_)
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(_di_f_int128s_adjust_) || !defined(_di_f_int128s_decimate_by_)
- f_status_t private_f_int128s_adjust(const f_number_unsigned_t length, f_int128s_t * const int128s) {
-
- const f_status_t status = f_memory_adjust(int128s->size, length, sizeof(f_int128s_t), (void **) & int128s->array);
- if (F_status_is_error(status)) return status;
-
- int128s->size = length;
-
- if (int128s->used > int128s->size) {
- int128s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_int128s_adjust_) || !defined(_di_f_int128s_decimate_by_)
-
#if !defined(_di_f_int128s_append_) || !defined(_di_f_int128ss_append_)
extern f_status_t private_f_int128s_append(const int128_t source, f_int128s_t * const destination) {
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_int128s_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(int128_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
#if !defined(_di_f_int128s_append_) || !defined(_di_f_int128s_append_all_) || !defined(_di_f_int128ss_append_all_)
extern f_status_t private_f_int128s_append_all(const f_int128s_t source, f_int128s_t * const destination) {
- if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_int128s_resize(destination->used + source.used, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(int128_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
}
#endif // !defined(_di_f_int128s_append_) || !defined(_di_f_int128s_append_all_) || !defined(_di_f_int128ss_append_all_)
-#if !defined(_di_f_int128s_resize_) || !defined(_di_f_int128s_append_) || !defined(_di_f_int128s_decrease_by_) || !defined(_di_f_int128ss_append_)
- f_status_t private_f_int128s_resize(const f_number_unsigned_t length, f_int128s_t * const int128s) {
-
- const f_status_t status = f_memory_resize(int128s->size, length, sizeof(f_int128s_t), (void **) & int128s->array);
- if (F_status_is_error(status)) return status;
-
- int128s->size = length;
-
- if (int128s->used > int128s->size) {
- int128s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_int128s_resize_) || !defined(_di_f_int128s_append_) || !defined(_di_f_int128s_decrease_by_) || !defined(_di_f_int128ss_append_)
-
#if !defined(_di_f_int128ss_adjust_) || !defined(_di_f_int128ss_decimate_by_)
- f_status_t private_f_int128ss_adjust(const f_number_unsigned_t length, f_int128ss_t * const int128ss) {
+ f_status_t private_f_int128ss_adjust(const f_number_unsigned_t length, f_int128ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < int128ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_destroy(int128ss->array[i].size, sizeof(f_int128s_t), (void **) & int128ss->array[i].array);
+ status = f_memory_array_adjust(0, sizeof(int128_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- int128ss->array[i].size = 0;
- int128ss->array[i].used = 0;
} // for
- status = f_memory_adjust(int128ss->size, length, sizeof(f_int128s_t), (void **) & int128ss->array);
- if (F_status_is_error(status)) return status;
-
- int128ss->size = length;
-
- if (int128ss->used > int128ss->size) {
- int128ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_int128s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_int128ss_adjust_) || !defined(_di_f_int128ss_decimate_by_)
#if !defined(_di_f_int128ss_decrease_by_) || !defined(_di_f_int128ss_increase_) || !defined(_di_f_int128ss_increase_by_) || !defined(_di_f_int128ss_resize_)
- f_status_t private_f_int128ss_resize(const f_number_unsigned_t length, f_int128ss_t * const int128ss) {
+ f_status_t private_f_int128ss_resize(const f_number_unsigned_t length, f_int128ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < int128ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_delete(int128ss->array[i].size, sizeof(f_int128s_t), (void **) & int128ss->array[i].array);
+ status = f_memory_array_resize(0, sizeof(int128_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- int128ss->array[i].size = 0;
- int128ss->array[i].used = 0;
} // for
- status = f_memory_resize(int128ss->size, length, sizeof(f_int128s_t), (void **) & int128ss->array);
- if (F_status_is_error(status)) return status;
-
- int128ss->size = length;
-
- if (int128ss->used > int128ss->size) {
- int128ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_int128s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_int128ss_decrease_by_) || !defined(_di_f_int128ss_increase_) || !defined(_di_f_int128ss_increase_by_) || !defined(_di_f_int128ss_resize_)
#endif
/**
- * Private implementation for resizing the int128s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param int128s
- * The int128s 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_int128s_adjust()
- * @see f_int128s_decimate_by()
- */
-#if !defined(_di_f_int128s_adjust_) || !defined(_di_f_int128s_decimate_by_)
- extern f_status_t private_f_int128s_adjust(const f_number_unsigned_t length, f_int128s_t * const int128s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_int128s_adjust_) || !defined(_di_f_int128s_decimate_by_)
-
-/**
* Private implementation for appending the int128 array.
*
* Intended to be shared to each of the different implementation variations.
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*
- * @see f_memory_resize()
* @see f_int128s_append()
* @see f_int128ss_append()
*/
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*
- * @see f_memory_resize()
* @see f_int128s_append_all()
* @see f_int128ss_append()
* @see f_int128ss_append_all()
#endif // !defined(_di_f_int128s_append_) || !defined(_di_f_int128s_append_all_) || !defined(_di_f_int128ss_append_all_)
/**
- * Private implementation for resizing the int128s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param int128s
- * The int128s 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_int128s_resize()
- * @see f_int128s_append()
- * @see f_int128s_decrease_by()
- * @see f_int128ss_append()
- */
-#if !defined(_di_f_int128s_resize_) || !defined(_di_f_int128s_append_) || !defined(_di_f_int128s_decrease_by_) || !defined(_di_f_int128ss_append_)
- extern f_status_t private_f_int128s_resize(const f_number_unsigned_t length, f_int128s_t * const int128s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_int128s_resize_) || !defined(_di_f_int128s_append_) || !defined(_di_f_int128s_decrease_by_) || !defined(_di_f_int128ss_append_)
-
-/**
* Private implementation for resizing the int128ss array.
*
* Intended to be shared to each of the different implementation variations.
*
* @param length
* The length to adjust to.
- * @param int128ss
+ * @param structure
* The int128ss array to adjust.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*
* @see f_int128ss_adjust()
* @see f_int128ss_decimate_by()
*/
#if !defined(_di_f_int128ss_adjust_) || !defined(_di_f_int128ss_decimate_by_)
- extern f_status_t private_f_int128ss_adjust(const f_number_unsigned_t length, f_int128ss_t * const int128ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_int128ss_adjust(const f_number_unsigned_t length, f_int128ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int128ss_adjust_) || !defined(_di_f_int128ss_decimate_by_)
/**
*
* @param length
* The length to resize to.
- * @param int128ss
+ * @param structure
* The int128ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
* @see f_int128ss_decrease_by()
* @see f_int128ss_increase()
* @see f_int128ss_resize()
*/
#if !defined(_di_f_int128ss_decrease_by_) || !defined(_di_f_int128ss_increase_) || !defined(_di_f_int128ss_increase_by_) || !defined(_di_f_int128ss_resize_)
- extern f_status_t private_f_int128ss_resize(const f_number_unsigned_t length, f_int128ss_t * const int128ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_int128ss_resize(const f_number_unsigned_t length, f_int128ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int128ss_decrease_by_) || !defined(_di_f_int128ss_increase_) || !defined(_di_f_int128ss_increase_by_) || !defined(_di_f_int128ss_resize_)
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(_di_f_int16s_adjust_) || !defined(_di_f_int16s_decimate_by_)
- f_status_t private_f_int16s_adjust(const f_number_unsigned_t length, f_int16s_t * const int16s) {
-
- const f_status_t status = f_memory_adjust(int16s->size, length, sizeof(int16_t), (void **) & int16s->array);
- if (F_status_is_error(status)) return status;
-
- int16s->size = length;
-
- if (int16s->used > int16s->size) {
- int16s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_int16s_adjust_) || !defined(_di_f_int16s_decimate_by_)
-
#if !defined(_di_f_int16s_append_) || !defined(_di_f_int16ss_append_)
extern f_status_t private_f_int16s_append(const int16_t source, f_int16s_t * const destination) {
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_int16s_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(int16_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
#if !defined(_di_f_int16s_append_) || !defined(_di_f_int16s_append_all_) || !defined(_di_f_int16ss_append_all_)
extern f_status_t private_f_int16s_append_all(const f_int16s_t source, f_int16s_t * const destination) {
- if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_int16s_resize(destination->used + source.used, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(int16_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
}
#endif // !defined(_di_f_int16s_append_) || !defined(_di_f_int16s_append_all_) || !defined(_di_f_int16ss_append_all_)
-#if !defined(_di_f_int16s_resize_) || !defined(_di_f_int16s_append_) || !defined(_di_f_int16s_decrease_by_) || !defined(_di_f_int16ss_append_)
- f_status_t private_f_int16s_resize(const f_number_unsigned_t length, f_int16s_t * const int16s) {
-
- const f_status_t status = f_memory_resize(int16s->size, length, sizeof(int16_t), (void **) & int16s->array);
- if (F_status_is_error(status)) return status;
-
- int16s->size = length;
-
- if (int16s->used > int16s->size) {
- int16s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_int16s_resize_) || !defined(_di_f_int16s_append_) || !defined(_di_f_int16s_decrease_by_) || !defined(_di_f_int16ss_append_)
-
#if !defined(_di_f_int16ss_adjust_) || !defined(_di_f_int16ss_decimate_by_)
- f_status_t private_f_int16ss_adjust(const f_number_unsigned_t length, f_int16ss_t * const int16ss) {
+ f_status_t private_f_int16ss_adjust(const f_number_unsigned_t length, f_int16ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < int16ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_destroy(int16ss->array[i].size, sizeof(f_int16s_t), (void **) & int16ss->array[i].array);
+ status = f_memory_array_adjust(0, sizeof(int16_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- int16ss->array[i].size = 0;
- int16ss->array[i].used = 0;
} // for
- status = f_memory_adjust(int16ss->size, length, sizeof(f_int16s_t), (void **) & int16ss->array);
- if (F_status_is_error(status)) return status;
-
- int16ss->size = length;
-
- if (int16ss->used > int16ss->size) {
- int16ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_int16s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_int16ss_adjust_) || !defined(_di_f_int16ss_decimate_by_)
#if !defined(_di_f_int16ss_decrease_by_) || !defined(_di_f_int16ss_increase_) || !defined(_di_f_int16ss_increase_by_) || !defined(_di_f_int16ss_resize_)
- f_status_t private_f_int16ss_resize(const f_number_unsigned_t length, f_int16ss_t * const int16ss) {
+ f_status_t private_f_int16ss_resize(const f_number_unsigned_t length, f_int16ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < int16ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_delete(int16ss->array[i].size, sizeof(f_int16s_t), (void **) & int16ss->array[i].array);
+ status = f_memory_array_resize(0, sizeof(int16_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- int16ss->array[i].size = 0;
- int16ss->array[i].used = 0;
} // for
- status = f_memory_resize(int16ss->size, length, sizeof(f_int16s_t), (void **) & int16ss->array);
- if (F_status_is_error(status)) return status;
-
- int16ss->size = length;
-
- if (int16ss->used > int16ss->size) {
- int16ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_int16s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_int16ss_decrease_by_) || !defined(_di_f_int16ss_increase_) || !defined(_di_f_int16ss_increase_by_) || !defined(_di_f_int16ss_resize_)
#endif
/**
- * Private implementation for resizing the int16s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param int16s
- * The int16s 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_int16s_adjust()
- * @see f_int16s_decimate_by()
- */
-#if !defined(_di_f_int16s_adjust_) || !defined(_di_f_int16s_decimate_by_)
- extern f_status_t private_f_int16s_adjust(const f_number_unsigned_t length, f_int16s_t * const int16s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_int16s_adjust_) || !defined(_di_f_int16s_decimate_by_)
-
-/**
* Private implementation for appending the int16 array.
*
* Intended to be shared to each of the different implementation variations.
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*
- * @see f_memory_resize()
* @see f_int16s_append()
* @see f_int16ss_append()
*/
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*
- * @see f_memory_resize()
* @see f_int16s_append_all()
* @see f_int16ss_append()
* @see f_int16ss_append_all()
#endif // !defined(_di_f_int16s_append_) || !defined(_di_f_int16s_append_all_) || !defined(_di_f_int16ss_append_all_)
/**
- * Private implementation for resizing the int16s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param int16s
- * The int16s 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_int16s_resize()
- * @see f_int16s_append()
- * @see f_int16s_decrease_by()
- * @see f_int16ss_append()
- */
-#if !defined(_di_f_int16s_resize_) || !defined(_di_f_int16s_append_) || !defined(_di_f_int16s_decrease_by_) || !defined(_di_f_int16ss_append_)
- extern f_status_t private_f_int16s_resize(const f_number_unsigned_t length, f_int16s_t * const int16s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_int16s_resize_) || !defined(_di_f_int16s_append_) || !defined(_di_f_int16s_decrease_by_) || !defined(_di_f_int16ss_append_)
-
-/**
* Private implementation for resizing the int16ss array.
*
* Intended to be shared to each of the different implementation variations.
*
* @param length
* The length to adjust to.
- * @param int16ss
+ * @param structure
* The int16ss array to adjust.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*
* @see f_int16ss_adjust()
* @see f_int16ss_decimate_by()
*/
#if !defined(_di_f_int16ss_adjust_) || !defined(_di_f_int16ss_decimate_by_)
- extern f_status_t private_f_int16ss_adjust(const f_number_unsigned_t length, f_int16ss_t * const int16ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_int16ss_adjust(const f_number_unsigned_t length, f_int16ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int16ss_adjust_) || !defined(_di_f_int16ss_decimate_by_)
/**
*
* @param length
* The length to resize to.
- * @param int16ss
+ * @param structure
* The int16ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
* @see f_int16ss_decrease_by()
* @see f_int16ss_increase()
* @see f_int16ss_resize()
*/
#if !defined(_di_f_int16ss_decrease_by_) || !defined(_di_f_int16ss_increase_) || !defined(_di_f_int16ss_increase_by_) || !defined(_di_f_int16ss_resize_)
- extern f_status_t private_f_int16ss_resize(const f_number_unsigned_t length, f_int16ss_t * const int16ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_int16ss_resize(const f_number_unsigned_t length, f_int16ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int16ss_decrease_by_) || !defined(_di_f_int16ss_increase_) || !defined(_di_f_int16ss_increase_by_) || !defined(_di_f_int16ss_resize_)
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(_di_f_int32s_adjust_) || !defined(_di_f_int32s_decimate_by_)
- f_status_t private_f_int32s_adjust(const f_number_unsigned_t length, f_int32s_t * const int32s) {
-
- const f_status_t status = f_memory_adjust(int32s->size, length, sizeof(int32_t), (void **) & int32s->array);
- if (F_status_is_error(status)) return status;
-
- int32s->size = length;
-
- if (int32s->used > int32s->size) {
- int32s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_int32s_adjust_) || !defined(_di_f_int32s_decimate_by_)
-
#if !defined(_di_f_int32s_append_) || !defined(_di_f_int32ss_append_)
extern f_status_t private_f_int32s_append(const int32_t source, f_int32s_t * const destination) {
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_int32s_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(int32_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
#if !defined(_di_f_int32s_append_) || !defined(_di_f_int32s_append_all_) || !defined(_di_f_int32ss_append_all_)
extern f_status_t private_f_int32s_append_all(const f_int32s_t source, f_int32s_t * const destination) {
- if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_int32s_resize(destination->used + source.used, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(int32_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
}
#endif // !defined(_di_f_int32s_append_) || !defined(_di_f_int32s_append_all_) || !defined(_di_f_int32ss_append_all_)
-#if !defined(_di_f_int32s_resize_) || !defined(_di_f_int32s_append_) || !defined(_di_f_int32s_decrease_by_) || !defined(_di_f_int32ss_append_)
- f_status_t private_f_int32s_resize(const f_number_unsigned_t length, f_int32s_t * const int32s) {
-
- const f_status_t status = f_memory_resize(int32s->size, length, sizeof(int32_t), (void **) & int32s->array);
- if (F_status_is_error(status)) return status;
-
- int32s->size = length;
-
- if (int32s->used > int32s->size) {
- int32s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_int32s_resize_) || !defined(_di_f_int32s_append_) || !defined(_di_f_int32s_decrease_by_) || !defined(_di_f_int32ss_append_)
-
#if !defined(_di_f_int32ss_adjust_) || !defined(_di_f_int32ss_decimate_by_)
- f_status_t private_f_int32ss_adjust(const f_number_unsigned_t length, f_int32ss_t * const int32ss) {
+ f_status_t private_f_int32ss_adjust(const f_number_unsigned_t length, f_int32ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < int32ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_destroy(int32ss->array[i].size, sizeof(f_int32s_t), (void **) & int32ss->array[i].array);
+ status = f_memory_array_adjust(0, sizeof(int32_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- int32ss->array[i].size = 0;
- int32ss->array[i].used = 0;
} // for
- status = f_memory_adjust(int32ss->size, length, sizeof(f_int32s_t), (void **) & int32ss->array);
- if (F_status_is_error(status)) return status;
-
- int32ss->size = length;
-
- if (int32ss->used > int32ss->size) {
- int32ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_int32s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_int32ss_adjust_) || !defined(_di_f_int32ss_decimate_by_)
#if !defined(_di_f_int32ss_decrease_by_) || !defined(_di_f_int32ss_increase_) || !defined(_di_f_int32ss_increase_by_) || !defined(_di_f_int32ss_resize_)
- f_status_t private_f_int32ss_resize(const f_number_unsigned_t length, f_int32ss_t * const int32ss) {
+ f_status_t private_f_int32ss_resize(const f_number_unsigned_t length, f_int32ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < int32ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_delete(int32ss->array[i].size, sizeof(f_int32s_t), (void **) & int32ss->array[i].array);
+ status = f_memory_array_resize(0, sizeof(int32_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- int32ss->array[i].size = 0;
- int32ss->array[i].used = 0;
} // for
- status = f_memory_resize(int32ss->size, length, sizeof(f_int32s_t), (void **) & int32ss->array);
- if (F_status_is_error(status)) return status;
-
- int32ss->size = length;
-
- if (int32ss->used > int32ss->size) {
- int32ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_int32s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_int32ss_decrease_by_) || !defined(_di_f_int32ss_increase_) || !defined(_di_f_int32ss_increase_by_) || !defined(_di_f_int32ss_resize_)
#endif
/**
- * Private implementation for resizing the int32s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param int32s
- * The int32s 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_int32s_adjust()
- * @see f_int32s_decimate_by()
- */
-#if !defined(_di_f_int32s_adjust_) || !defined(_di_f_int32s_decimate_by_)
- extern f_status_t private_f_int32s_adjust(const f_number_unsigned_t length, f_int32s_t * const int32s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_int32s_adjust_) || !defined(_di_f_int32s_decimate_by_)
-
-/**
* Private implementation for appending the int32 array.
*
* Intended to be shared to each of the different implementation variations.
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*
- * @see f_memory_resize()
* @see f_int32s_append()
* @see f_int32ss_append()
*/
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*
- * @see f_memory_resize()
* @see f_int32s_append_all()
* @see f_int32ss_append()
* @see f_int32ss_append_all()
#endif // !defined(_di_f_int32s_append_) || !defined(_di_f_int32s_append_all_) || !defined(_di_f_int32ss_append_all_)
/**
- * Private implementation for resizing the int32s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param int32s
- * The int32s 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_int32s_resize()
- * @see f_int32s_append()
- * @see f_int32s_decrease_by()
- * @see f_int32ss_append()
- */
-#if !defined(_di_f_int32s_resize_) || !defined(_di_f_int32s_append_) || !defined(_di_f_int32s_decrease_by_) || !defined(_di_f_int32ss_append_)
- extern f_status_t private_f_int32s_resize(const f_number_unsigned_t length, f_int32s_t * const int32s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_int32s_resize_) || !defined(_di_f_int32s_append_) || !defined(_di_f_int32s_decrease_by_) || !defined(_di_f_int32ss_append_)
-
-/**
* Private implementation for resizing the int32ss array.
*
* Intended to be shared to each of the different implementation variations.
*
* @param length
* The length to adjust to.
- * @param int32ss
+ * @param structure
* The int32ss array to adjust.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*
* @see f_int32ss_adjust()
* @see f_int32ss_decimate_by()
*/
#if !defined(_di_f_int32ss_adjust_) || !defined(_di_f_int32ss_decimate_by_)
- extern f_status_t private_f_int32ss_adjust(const f_number_unsigned_t length, f_int32ss_t * const int32ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_int32ss_adjust(const f_number_unsigned_t length, f_int32ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int32ss_adjust_) || !defined(_di_f_int32ss_decimate_by_)
/**
*
* @param length
* The length to resize to.
- * @param int32ss
+ * @param structure
* The int32ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
* @see f_int32ss_decrease_by()
* @see f_int32ss_increase()
* @see f_int32ss_resize()
*/
#if !defined(_di_f_int32ss_decrease_by_) || !defined(_di_f_int32ss_increase_) || !defined(_di_f_int32ss_increase_by_) || !defined(_di_f_int32ss_resize_)
- extern f_status_t private_f_int32ss_resize(const f_number_unsigned_t length, f_int32ss_t * const int32ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_int32ss_resize(const f_number_unsigned_t length, f_int32ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int32ss_decrease_by_) || !defined(_di_f_int32ss_increase_) || !defined(_di_f_int32ss_increase_by_) || !defined(_di_f_int32ss_resize_)
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(_di_f_int64s_adjust_) || !defined(_di_f_int64s_decimate_by_)
- f_status_t private_f_int64s_adjust(const f_number_unsigned_t length, f_int64s_t * const int64s) {
-
- const f_status_t status = f_memory_adjust(int64s->size, length, sizeof(int64_t), (void **) & int64s->array);
- if (F_status_is_error(status)) return status;
-
- int64s->size = length;
-
- if (int64s->used > int64s->size) {
- int64s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_int64s_adjust_) || !defined(_di_f_int64s_decimate_by_)
-
#if !defined(_di_f_int64s_append_) || !defined(_di_f_int64ss_append_)
extern f_status_t private_f_int64s_append(const int64_t source, f_int64s_t * const destination) {
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_int64s_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(int64_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
#if !defined(_di_f_int64s_append_) || !defined(_di_f_int64s_append_all_) || !defined(_di_f_int64ss_append_all_)
extern f_status_t private_f_int64s_append_all(const f_int64s_t source, f_int64s_t * const destination) {
- if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_int64s_resize(destination->used + source.used, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(int64_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
}
#endif // !defined(_di_f_int64s_append_) || !defined(_di_f_int64s_append_all_) || !defined(_di_f_int64ss_append_all_)
-#if !defined(_di_f_int64s_resize_) || !defined(_di_f_int64s_append_) || !defined(_di_f_int64s_decrease_by_) || !defined(_di_f_int64ss_append_)
- f_status_t private_f_int64s_resize(const f_number_unsigned_t length, f_int64s_t * const int64s) {
-
- const f_status_t status = f_memory_resize(int64s->size, length, sizeof(int64_t), (void **) & int64s->array);
- if (F_status_is_error(status)) return status;
-
- int64s->size = length;
-
- if (int64s->used > int64s->size) {
- int64s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_int64s_resize_) || !defined(_di_f_int64s_append_) || !defined(_di_f_int64s_decrease_by_) || !defined(_di_f_int64ss_append_)
-
#if !defined(_di_f_int64ss_adjust_) || !defined(_di_f_int64ss_decimate_by_)
- f_status_t private_f_int64ss_adjust(const f_number_unsigned_t length, f_int64ss_t * const int64ss) {
+ f_status_t private_f_int64ss_adjust(const f_number_unsigned_t length, f_int64ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < int64ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_destroy(int64ss->array[i].size, sizeof(f_int64s_t), (void **) & int64ss->array[i].array);
+ status = f_memory_array_adjust(0, sizeof(int64_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- int64ss->array[i].size = 0;
- int64ss->array[i].used = 0;
} // for
- status = f_memory_adjust(int64ss->size, length, sizeof(f_int64s_t), (void **) & int64ss->array);
- if (F_status_is_error(status)) return status;
-
- int64ss->size = length;
-
- if (int64ss->used > int64ss->size) {
- int64ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_int64s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_int64ss_adjust_) || !defined(_di_f_int64ss_decimate_by_)
#if !defined(_di_f_int64ss_decrease_by_) || !defined(_di_f_int64ss_increase_) || !defined(_di_f_int64ss_increase_by_) || !defined(_di_f_int64ss_resize_)
- f_status_t private_f_int64ss_resize(const f_number_unsigned_t length, f_int64ss_t * const int64ss) {
+ f_status_t private_f_int64ss_resize(const f_number_unsigned_t length, f_int64ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < int64ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_delete(int64ss->array[i].size, sizeof(f_int64s_t), (void **) & int64ss->array[i].array);
+ status = f_memory_array_resize(0, sizeof(int64_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- int64ss->array[i].size = 0;
- int64ss->array[i].used = 0;
} // for
- status = f_memory_resize(int64ss->size, length, sizeof(f_int64s_t), (void **) & int64ss->array);
- if (F_status_is_error(status)) return status;
-
- int64ss->size = length;
-
- if (int64ss->used > int64ss->size) {
- int64ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_int64s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_int64ss_decrease_by_) || !defined(_di_f_int64ss_increase_) || !defined(_di_f_int64ss_increase_by_) || !defined(_di_f_int64ss_resize_)
#endif
/**
- * Private implementation for resizing the int64s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param int64s
- * The int64s 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_int64s_adjust()
- * @see f_int64s_decimate_by()
- */
-#if !defined(_di_f_int64s_adjust_) || !defined(_di_f_int64s_decimate_by_)
- extern f_status_t private_f_int64s_adjust(const f_number_unsigned_t length, f_int64s_t * const int64s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_int64s_adjust_) || !defined(_di_f_int64s_decimate_by_)
-
-/**
* Private implementation for appending the int64 array.
*
* Intended to be shared to each of the different implementation variations.
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*
- * @see f_memory_resize()
* @see f_int64s_append()
* @see f_int64ss_append()
*/
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*
- * @see f_memory_resize()
* @see f_int64s_append_all()
* @see f_int64ss_append()
* @see f_int64ss_append_all()
#endif // !defined(_di_f_int64s_append_) || !defined(_di_f_int64s_append_all_) || !defined(_di_f_int64ss_append_all_)
/**
- * Private implementation for resizing the int64s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param int64s
- * The int64s 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_int64s_resize()
- * @see f_int64s_append()
- * @see f_int64s_decrease_by()
- * @see f_int64ss_append()
- */
-#if !defined(_di_f_int64s_resize_) || !defined(_di_f_int64s_append_) || !defined(_di_f_int64s_decrease_by_) || !defined(_di_f_int64ss_append_)
- extern f_status_t private_f_int64s_resize(const f_number_unsigned_t length, f_int64s_t * const int64s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_int64s_resize_) || !defined(_di_f_int64s_append_) || !defined(_di_f_int64s_decrease_by_) || !defined(_di_f_int64ss_append_)
-
-/**
* Private implementation for resizing the int64ss array.
*
* Intended to be shared to each of the different implementation variations.
*
* @param length
* The length to adjust to.
- * @param int64ss
+ * @param structure
* The int64ss array to adjust.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*
* @see f_int64ss_adjust()
* @see f_int64ss_decimate_by()
*/
#if !defined(_di_f_int64ss_adjust_) || !defined(_di_f_int64ss_decimate_by_)
- extern f_status_t private_f_int64ss_adjust(const f_number_unsigned_t length, f_int64ss_t * const int64ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_int64ss_adjust(const f_number_unsigned_t length, f_int64ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int64ss_adjust_) || !defined(_di_f_int64ss_decimate_by_)
/**
*
* @param length
* The length to resize to.
- * @param int64ss
+ * @param structure
* The int64ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
* @see f_int64ss_decrease_by()
* @see f_int64ss_increase()
* @see f_int64ss_resize()
*/
#if !defined(_di_f_int64ss_decrease_by_) || !defined(_di_f_int64ss_increase_) || !defined(_di_f_int64ss_increase_by_) || !defined(_di_f_int64ss_resize_)
- extern f_status_t private_f_int64ss_resize(const f_number_unsigned_t length, f_int64ss_t * const int64ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_int64ss_resize(const f_number_unsigned_t length, f_int64ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int64ss_decrease_by_) || !defined(_di_f_int64ss_increase_) || !defined(_di_f_int64ss_increase_by_) || !defined(_di_f_int64ss_resize_)
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(_di_f_int8s_adjust_) || !defined(_di_f_int8s_decimate_by_)
- f_status_t private_f_int8s_adjust(const f_number_unsigned_t length, f_int8s_t * const int8s) {
-
- const f_status_t status = f_memory_adjust(int8s->size, length, sizeof(int8_t), (void **) & int8s->array);
- if (F_status_is_error(status)) return status;
-
- int8s->size = length;
-
- if (int8s->used > int8s->size) {
- int8s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_int8s_adjust_) || !defined(_di_f_int8s_decimate_by_)
-
#if !defined(_di_f_int8s_append_) || !defined(_di_f_int8ss_append_)
extern f_status_t private_f_int8s_append(const int8_t source, f_int8s_t * const destination) {
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_int8s_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(int8_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
#if !defined(_di_f_int8s_append_) || !defined(_di_f_int8s_append_all_) || !defined(_di_f_int8ss_append_all_)
extern f_status_t private_f_int8s_append_all(const f_int8s_t source, f_int8s_t * const destination) {
- if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_int8s_resize(destination->used + source.used, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(int8_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
}
#endif // !defined(_di_f_int8s_append_) || !defined(_di_f_int8s_append_all_) || !defined(_di_f_int8ss_append_all_)
-#if !defined(_di_f_int8s_append_) || !defined(_di_f_int8s_append_all_) || !defined(_di_f_int8s_decrease_by_) || !defined(_di_f_int8s_increase_) || !defined(_di_f_int8s_increase_by_) || !defined(_di_f_int8s_resize_) || !defined(_di_f_int8ss_append_) || !defined(_di_f_int8ss_append_all_)
- f_status_t private_f_int8s_resize(const f_number_unsigned_t length, f_int8s_t * const int8s) {
-
- const f_status_t status = f_memory_resize(int8s->size, length, sizeof(int8_t), (void **) & int8s->array);
- if (F_status_is_error(status)) return status;
-
- int8s->size = length;
-
- if (int8s->used > int8s->size) {
- int8s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_int8s_append_) || !defined(_di_f_int8s_append_all_) || !defined(_di_f_int8s_decrease_by_) || !defined(_di_f_int8s_increase_) || !defined(_di_f_int8s_increase_by_) || !defined(_di_f_int8s_resize_) || !defined(_di_f_int8ss_append_) || !defined(_di_f_int8ss_append_all_)
-
#if !defined(_di_f_int8ss_adjust_) || !defined(_di_f_int8ss_decimate_by_)
- f_status_t private_f_int8ss_adjust(const f_number_unsigned_t length, f_int8ss_t * const int8ss) {
+ f_status_t private_f_int8ss_adjust(const f_number_unsigned_t length, f_int8ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < int8ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_destroy(int8ss->array[i].size, sizeof(f_int8s_t), (void **) & int8ss->array[i].array);
+ status = f_memory_array_adjust(0, sizeof(int8_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- int8ss->array[i].size = 0;
- int8ss->array[i].used = 0;
} // for
- status = f_memory_adjust(int8ss->size, length, sizeof(f_int8s_t), (void **) & int8ss->array);
- if (F_status_is_error(status)) return status;
-
- int8ss->size = length;
-
- if (int8ss->used > int8ss->size) {
- int8ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_int8s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_int8ss_adjust_) || !defined(_di_f_int8ss_decimate_by_)
#if !defined(_di_f_int8ss_decrease_by_) || !defined(_di_f_int8ss_increase_) || !defined(_di_f_int8ss_increase_by_) || !defined(_di_f_int8ss_resize_)
- f_status_t private_f_int8ss_resize(const f_number_unsigned_t length, f_int8ss_t * const int8ss) {
+ f_status_t private_f_int8ss_resize(const f_number_unsigned_t length, f_int8ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < int8ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_delete(int8ss->array[i].size, sizeof(f_int8s_t), (void **) & int8ss->array[i].array);
+ status = f_memory_array_resize(0, sizeof(int8_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- int8ss->array[i].size = 0;
- int8ss->array[i].used = 0;
} // for
- status = f_memory_resize(int8ss->size, length, sizeof(f_int8s_t), (void **) & int8ss->array);
- if (F_status_is_error(status)) return status;
-
- int8ss->size = length;
-
- if (int8ss->used > int8ss->size) {
- int8ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_int8s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_int8ss_decrease_by_) || !defined(_di_f_int8ss_increase_) || !defined(_di_f_int8ss_increase_by_) || !defined(_di_f_int8ss_resize_)
#endif
/**
- * Private implementation for resizing the int8s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param int8s
- * The int8s 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_int8s_adjust()
- * @see f_int8s_decimate_by()
- */
-#if !defined(_di_f_int8s_adjust_) || !defined(_di_f_int8s_decimate_by_)
- extern f_status_t private_f_int8s_adjust(const f_number_unsigned_t length, f_int8s_t * const int8s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_int8s_adjust_) || !defined(_di_f_int8s_decimate_by_)
-
-/**
* Private implementation for appending the int8 array.
*
* Intended to be shared to each of the different implementation variations.
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*
- * @see f_memory_resize()
* @see f_int8s_append()
* @see f_int8ss_append()
*/
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*
- * @see f_memory_resize()
* @see f_int8s_append_all()
* @see f_int8ss_append()
* @see f_int8ss_append_all()
#endif // !defined(_di_f_int8s_append_) || !defined(_di_f_int8s_append_all_) || !defined(_di_f_int8ss_append_all_)
/**
- * Private implementation for resizing the int8s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param int8s
- * The int8s 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_int8s_append()
- * @see f_int8s_append_all()
- * @see f_int8s_decrease_by()
- * @see f_int8s_increase()
- * @see f_int8s_increase_by()
- * @see f_int8s_resize()
- * @see f_int8ss_append()
- * @see f_int8ss_append_all()
- *
- */
-#if !defined(_di_f_int8s_append_) || !defined(_di_f_int8s_append_all_) || !defined(_di_f_int8s_decrease_by_) || !defined(_di_f_int8s_increase_) || !defined(_di_f_int8s_increase_by_) || !defined(_di_f_int8s_resize_) || !defined(_di_f_int8ss_append_) || !defined(_di_f_int8ss_append_all_)
- extern f_status_t private_f_int8s_resize(const f_number_unsigned_t length, f_int8s_t * const int8s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_int8s_append_) || !defined(_di_f_int8s_append_all_) || !defined(_di_f_int8s_decrease_by_) || !defined(_di_f_int8s_increase_) || !defined(_di_f_int8s_increase_by_) || !defined(_di_f_int8s_resize_) || !defined(_di_f_int8ss_append_) || !defined(_di_f_int8ss_append_all_)
-
-/**
* Private implementation for resizing the int8ss array.
*
* Intended to be shared to each of the different implementation variations.
*
* @param length
* The length to adjust to.
- * @param int8ss
+ * @param structure
* The int8ss array to adjust.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*
* @see f_int8ss_adjust()
* @see f_int8ss_decimate_by()
*/
#if !defined(_di_f_int8ss_adjust_) || !defined(_di_f_int8ss_decimate_by_)
- extern f_status_t private_f_int8ss_adjust(const f_number_unsigned_t length, f_int8ss_t * const int8ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_int8ss_adjust(const f_number_unsigned_t length, f_int8ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int8ss_adjust_) || !defined(_di_f_int8ss_decimate_by_)
/**
*
* @param length
* The length to resize to.
- * @param int8ss
+ * @param structure
* The int8ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
* @see f_int8ss_decrease_by()
* @see f_int8ss_increase()
* @see f_int8ss_resize()
*/
#if !defined(_di_f_int8ss_decrease_by_) || !defined(_di_f_int8ss_increase_) || !defined(_di_f_int8ss_increase_by_) || !defined(_di_f_int8ss_resize_)
- extern f_status_t private_f_int8ss_resize(const f_number_unsigned_t length, f_int8ss_t * const int8ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_int8ss_resize(const f_number_unsigned_t length, f_int8ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_int8ss_decrease_by_) || !defined(_di_f_int8ss_increase_) || !defined(_di_f_int8ss_increase_by_) || !defined(_di_f_int8ss_resize_)
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(_di_f_number_unsigneds_adjust_) || !defined(_di_f_number_unsigneds_decimate_by_)
- f_status_t private_f_number_unsigneds_adjust(const f_number_unsigned_t length, f_number_unsigneds_t * const number_unsigneds) {
-
- const f_status_t status = f_memory_adjust(number_unsigneds->size, length, sizeof(f_number_unsigned_t), (void **) & number_unsigneds->array);
- if (F_status_is_error(status)) return status;
-
- number_unsigneds->size = length;
-
- if (number_unsigneds->used > number_unsigneds->size) {
- number_unsigneds->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_number_unsigneds_adjust_) || !defined(_di_f_number_unsigneds_decimate_by_)
-
#if !defined(_di_f_number_unsigneds_append_) || !defined(_di_f_number_unsignedss_append_)
extern f_status_t private_f_number_unsigneds_append(const f_number_unsigned_t source, f_number_unsigneds_t * const destination) {
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_number_unsigneds_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_number_unsigned_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
#if !defined(_di_f_number_unsigneds_append_) || !defined(_di_f_number_unsigneds_append_all_) || !defined(_di_f_number_unsignedss_append_all_)
extern f_status_t private_f_number_unsigneds_append_all(const f_number_unsigneds_t source, f_number_unsigneds_t * const destination) {
- if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_number_unsigneds_resize(destination->used + source.used, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_number_unsigned_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
}
#endif // !defined(_di_f_number_unsigneds_append_) || !defined(_di_f_number_unsigneds_append_all_) || !defined(_di_f_number_unsignedss_append_all_)
-#if !defined(_di_f_number_unsigneds_resize_) || !defined(_di_f_number_unsigneds_append_) || !defined(_di_f_number_unsigneds_decrease_by_) || !defined(_di_f_number_unsignedss_append_)
- f_status_t private_f_number_unsigneds_resize(const f_number_unsigned_t length, f_number_unsigneds_t * const lengths) {
-
- const f_status_t status = f_memory_resize(lengths->size, length, sizeof(f_number_unsigned_t), (void **) & lengths->array);
- if (F_status_is_error(status)) return status;
-
- lengths->size = length;
-
- if (lengths->used > lengths->size) {
- lengths->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_number_unsigneds_resize_) || !defined(_di_f_number_unsigneds_append_) || !defined(_di_f_number_unsigneds_decrease_by_) || !defined(_di_f_number_unsignedss_append_)
-
#if !defined(_di_f_number_unsignedss_adjust_) || !defined(_di_f_number_unsignedss_decimate_by_)
- f_status_t private_f_number_unsignedss_adjust(const f_number_unsigned_t length, f_number_unsignedss_t * const lengthss) {
+ f_status_t private_f_number_unsignedss_adjust(const f_number_unsigned_t length, f_number_unsignedss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < lengthss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_destroy(lengthss->array[i].size, sizeof(f_number_unsigneds_t), (void **) & lengthss->array[i].array);
+ status = f_memory_array_adjust(0, sizeof(f_number_unsigned_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- lengthss->array[i].size = 0;
- lengthss->array[i].used = 0;
} // for
- status = f_memory_adjust(lengthss->size, length, sizeof(f_number_unsigneds_t), (void **) & lengthss->array);
- if (F_status_is_error(status)) return status;
-
- lengthss->size = length;
-
- if (lengthss->used > lengthss->size) {
- lengthss->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_number_unsigneds_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_number_unsignedss_adjust_) || !defined(_di_f_number_unsignedss_decimate_by_)
#if !defined(_di_f_number_unsignedss_decrease_by_) || !defined(_di_f_number_unsignedss_increase_) || !defined(_di_f_number_unsignedss_increase_by_) || !defined(_di_f_number_unsignedss_resize_)
- f_status_t private_f_number_unsignedss_resize(const f_number_unsigned_t length, f_number_unsignedss_t * const lengthss) {
+ f_status_t private_f_number_unsignedss_resize(const f_number_unsigned_t length, f_number_unsignedss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < lengthss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_delete(lengthss->array[i].size, sizeof(f_number_unsigneds_t), (void **) & lengthss->array[i].array);
+ status = f_memory_array_resize(0, sizeof(f_number_unsigned_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- lengthss->array[i].size = 0;
- lengthss->array[i].used = 0;
} // for
- status = f_memory_resize(lengthss->size, length, sizeof(f_number_unsigneds_t), (void **) & lengthss->array);
- if (F_status_is_error(status)) return status;
-
- lengthss->size = length;
-
- if (lengthss->used > lengthss->size) {
- lengthss->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_number_unsigneds_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_number_unsignedss_decrease_by_) || !defined(_di_f_number_unsignedss_increase_) || !defined(_di_f_number_unsignedss_increase_by_) || !defined(_di_f_number_unsignedss_resize_)
#endif
/**
- * Private implementation for resizing the number array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param lengths
- * The lengths 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_number_unsigneds_adjust()
- * @see f_number_unsigneds_decimate_by()
- */
-#if !defined(_di_f_number_unsigneds_adjust_) || !defined(_di_f_number_unsigneds_decimate_by_)
- extern f_status_t private_f_number_unsigneds_adjust(const f_number_unsigned_t length, f_number_unsigneds_t * const lengths) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_number_unsigneds_adjust_) || !defined(_di_f_number_unsigneds_decimate_by_)
-
-/**
- * Private implementation for appending the number array.
+ * Private implementation for appending the number_unsigned array.
*
* Intended to be shared to each of the different implementation variations.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*
- * @see f_memory_resize()
* @see f_number_unsigneds_append()
* @see f_number_unsignedss_append()
*/
#endif // !defined(_di_f_number_unsigneds_append_) || !defined(_di_f_number_unsignedss_append_)
/**
- * Private implementation for appending the number array.
+ * Private implementation for appending the number_unsigned array.
*
* Intended to be shared to each of the different implementation variations.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*
- * @see f_memory_resize()
* @see f_number_unsigneds_append_all()
* @see f_number_unsignedss_append()
* @see f_number_unsignedss_append_all()
#endif // !defined(_di_f_number_unsigneds_append_) || !defined(_di_f_number_unsigneds_append_all_) || !defined(_di_f_number_unsignedss_append_all_)
/**
- * Private implementation for resizing the number array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param lengths
- * The lengths 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_number_unsigneds_resize()
- * @see f_number_unsigneds_append()
- * @see f_number_unsigneds_decrease_by()
- * @see f_number_unsignedss_append()
- */
-#if !defined(_di_f_number_unsigneds_resize_) || !defined(_di_f_number_unsigneds_append_) || !defined(_di_f_number_unsigneds_decrease_by_) || !defined(_di_f_number_unsignedss_append_)
- extern f_status_t private_f_number_unsigneds_resize(const f_number_unsigned_t length, f_number_unsigneds_t * const lengths) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_number_unsigneds_resize_) || !defined(_di_f_number_unsigneds_append_) || !defined(_di_f_number_unsigneds_decrease_by_) || !defined(_di_f_number_unsignedss_append_)
-
-/**
- * Private implementation for resizing the number array.
+ * Private implementation for resizing the number_unsignedss array.
*
* Intended to be shared to each of the different implementation variations.
*
* @param length
* The length to adjust to.
- * @param lengthss
- * The number array to adjust.
+ * @param structure
+ * The number_unsignedss array to adjust.
*
* @return
* F_none on success.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*
* @see f_number_unsignedss_adjust()
* @see f_number_unsignedss_decimate_by()
*/
#if !defined(_di_f_number_unsignedss_adjust_) || !defined(_di_f_number_unsignedss_decimate_by_)
- extern f_status_t private_f_number_unsignedss_adjust(const f_number_unsigned_t length, f_number_unsignedss_t * const lengthss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_number_unsignedss_adjust(const f_number_unsigned_t length, f_number_unsignedss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_number_unsignedss_adjust_) || !defined(_di_f_number_unsignedss_decimate_by_)
/**
- * Private implementation for resizing the number array.
+ * Private implementation for resizing the number_unsignedss array.
*
* Intended to be shared to each of the different implementation variations.
*
* @param length
* The length to resize to.
- * @param lengthss
- * The number array to resize.
+ * @param structure
+ * The number_unsignedss array to resize.
*
* @return
* F_none on success.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_delete().
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
* @see f_number_unsignedss_decrease_by()
* @see f_number_unsignedss_increase()
* @see f_number_unsignedss_resize()
*/
#if !defined(_di_f_number_unsignedss_decrease_by_) || !defined(_di_f_number_unsignedss_increase_) || !defined(_di_f_number_unsignedss_increase_by_) || !defined(_di_f_number_unsignedss_resize_)
- extern f_status_t private_f_number_unsignedss_resize(const f_number_unsigned_t length, f_number_unsignedss_t * const lengthss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_number_unsignedss_resize(const f_number_unsigned_t length, f_number_unsignedss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_number_unsignedss_decrease_by_) || !defined(_di_f_number_unsignedss_increase_) || !defined(_di_f_number_unsignedss_increase_by_) || !defined(_di_f_number_unsignedss_resize_)
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(_di_f_polls_adjust_) || !defined(_di_f_polls_decimate_by_)
- f_status_t private_f_polls_adjust(const f_number_unsigned_t length, f_polls_t * const polls) {
-
- const f_status_t status = f_memory_adjust(polls->size, length, sizeof(f_poll_t), (void **) & polls->array);
- if (F_status_is_error(status)) return status;
-
- polls->size = length;
-
- if (polls->used > polls->size) {
- polls->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_polls_adjust_) || !defined(_di_f_polls_decimate_by_)
-
#if !defined(_di_f_polls_append_) || !defined(_di_f_pollss_append_)
extern f_status_t private_f_polls_append(const f_poll_t source, f_polls_t * const destination) {
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_polls_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_poll_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
#if !defined(_di_f_polls_append_) || !defined(_di_f_polls_append_all_) || !defined(_di_f_pollss_append_all_)
extern f_status_t private_f_polls_append_all(const f_polls_t source, f_polls_t * const destination) {
- if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_polls_resize(destination->used + source.used, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_poll_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
}
#endif // !defined(_di_f_polls_append_) || !defined(_di_f_polls_append_all_) || !defined(_di_f_pollss_append_all_)
-#if !defined(_di_f_polls_resize_) || !defined(_di_f_polls_append_) || !defined(_di_f_polls_decrease_by_) || !defined(_di_f_pollss_append_)
- f_status_t private_f_polls_resize(const f_number_unsigned_t length, f_polls_t * const polls) {
-
- const f_status_t status = f_memory_resize(polls->size, length, sizeof(f_poll_t), (void **) & polls->array);
- if (F_status_is_error(status)) return status;
-
- polls->size = length;
-
- if (polls->used > polls->size) {
- polls->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_polls_resize_) || !defined(_di_f_polls_append_) || !defined(_di_f_polls_decrease_by_) || !defined(_di_f_pollss_append_)
-
#if !defined(_di_f_pollss_adjust_) || !defined(_di_f_pollss_decimate_by_)
- f_status_t private_f_pollss_adjust(const f_number_unsigned_t length, f_pollss_t * const pollss) {
+ f_status_t private_f_pollss_adjust(const f_number_unsigned_t length, f_pollss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < pollss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_destroy(pollss->array[i].size, sizeof(f_polls_t), (void **) & pollss->array[i].array);
+ status = f_memory_array_adjust(0, sizeof(f_poll_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- pollss->array[i].size = 0;
- pollss->array[i].used = 0;
} // for
- status = f_memory_adjust(pollss->size, length, sizeof(f_polls_t), (void **) & pollss->array);
- if (F_status_is_error(status)) return status;
-
- pollss->size = length;
-
- if (pollss->used > pollss->size) {
- pollss->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_polls_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_pollss_adjust_) || !defined(_di_f_pollss_decimate_by_)
#if !defined(_di_f_pollss_decrease_by_) || !defined(_di_f_pollss_increase_) || !defined(_di_f_pollss_increase_by_) || !defined(_di_f_pollss_resize_)
- f_status_t private_f_pollss_resize(const f_number_unsigned_t length, f_pollss_t * const pollss) {
+ f_status_t private_f_pollss_resize(const f_number_unsigned_t length, f_pollss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < pollss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_delete(pollss->array[i].size, sizeof(f_polls_t), (void **) & pollss->array[i].array);
+ status = f_memory_array_resize(0, sizeof(f_poll_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- pollss->array[i].size = 0;
- pollss->array[i].used = 0;
} // for
- status = f_memory_resize(pollss->size, length, sizeof(f_polls_t), (void **) & pollss->array);
- if (F_status_is_error(status)) return status;
-
- pollss->size = length;
-
- if (pollss->used > pollss->size) {
- pollss->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_polls_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_pollss_decrease_by_) || !defined(_di_f_pollss_increase_) || !defined(_di_f_pollss_increase_by_) || !defined(_di_f_pollss_resize_)
#endif
/**
- * Private implementation for resizing the polls array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param polls
- * The polls 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_polls_adjust()
- * @see f_polls_decimate_by()
- */
-#if !defined(_di_f_polls_adjust_) || !defined(_di_f_polls_decimate_by_)
- extern f_status_t private_f_polls_adjust(const f_number_unsigned_t length, f_polls_t * const polls) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_polls_adjust_) || !defined(_di_f_polls_decimate_by_)
-
-/**
* Private implementation for appending the poll array.
*
* Intended to be shared to each of the different implementation variations.
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*
- * @see f_memory_resize()
* @see f_polls_append()
* @see f_pollss_append()
*/
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*
- * @see f_memory_resize()
* @see f_polls_append_all()
* @see f_pollss_append()
* @see f_pollss_append_all()
#endif // !defined(_di_f_polls_append_) || !defined(_di_f_polls_append_all_) || !defined(_di_f_pollss_append_all_)
/**
- * Private implementation for resizing the polls array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param polls
- * The polls 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_polls_resize()
- * @see f_polls_append()
- * @see f_polls_decrease_by()
- * @see f_pollss_append()
- */
-#if !defined(_di_f_polls_resize_) || !defined(_di_f_polls_append_) || !defined(_di_f_polls_decrease_by_) || !defined(_di_f_pollss_append_)
- extern f_status_t private_f_polls_resize(const f_number_unsigned_t length, f_polls_t * const polls) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_polls_resize_) || !defined(_di_f_polls_append_) || !defined(_di_f_polls_decrease_by_) || !defined(_di_f_pollss_append_)
-
-/**
* Private implementation for resizing the pollss array.
*
* Intended to be shared to each of the different implementation variations.
*
* @param length
* The length to adjust to.
- * @param pollss
+ * @param structure
* The pollss array to adjust.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*
* @see f_pollss_adjust()
* @see f_pollss_decimate_by()
*/
#if !defined(_di_f_pollss_adjust_) || !defined(_di_f_pollss_decimate_by_)
- extern f_status_t private_f_pollss_adjust(const f_number_unsigned_t length, f_pollss_t * const pollss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_pollss_adjust(const f_number_unsigned_t length, f_pollss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_pollss_adjust_) || !defined(_di_f_pollss_decimate_by_)
/**
*
* @param length
* The length to resize to.
- * @param pollss
+ * @param structure
* The pollss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
* @see f_pollss_decrease_by()
* @see f_pollss_increase()
* @see f_pollss_resize()
*/
#if !defined(_di_f_pollss_decrease_by_) || !defined(_di_f_pollss_increase_) || !defined(_di_f_pollss_increase_by_) || !defined(_di_f_pollss_resize_)
- extern f_status_t private_f_pollss_resize(const f_number_unsigned_t length, f_pollss_t * const pollss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_pollss_resize(const f_number_unsigned_t length, f_pollss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_pollss_decrease_by_) || !defined(_di_f_pollss_increase_) || !defined(_di_f_pollss_increase_by_) || !defined(_di_f_pollss_resize_)
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(_di_f_states_adjust_) || !defined(_di_f_states_decimate_by_)
- f_status_t private_f_states_adjust(const f_number_unsigned_t length, f_states_t * const states) {
-
- const f_status_t status = f_memory_adjust(states->size, length, sizeof(f_state_t), (void **) & states->array);
- if (F_status_is_error(status)) return status;
-
- states->size = length;
-
- if (states->used > states->size) {
- states->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_states_adjust_) || !defined(_di_f_states_decimate_by_)
-
#if !defined(_di_f_states_append_) || !defined(_di_f_statess_append_)
extern f_status_t private_f_states_append(const f_state_t source, f_states_t * const destination) {
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_states_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_state_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
- destination->array[destination->used].step_large = source.step_large;
- destination->array[destination->used].step_small = source.step_small;
-
- destination->array[destination->used].handle = source.handle;
- destination->array[destination->used].interrupt = source.interrupt;
-
- destination->array[destination->used].callbacks = source.callbacks;
- destination->array[destination->used].custom = source.custom;
- destination->array[destination->used++].data = source.data;
+ destination->array[destination->used++] = source;
return F_none;
}
#if !defined(_di_f_states_append_) || !defined(_di_f_states_append_all_) || !defined(_di_f_statess_append_all_)
extern f_status_t private_f_states_append_all(const f_states_t source, f_states_t * const destination) {
- if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_states_resize(destination->used + source.used, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_state_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
for (f_number_unsigned_t i = 0; i < source.used; ++i) {
-
- destination->array[destination->used].step_large = source.array[i].step_large;
- destination->array[destination->used].step_small = source.array[i].step_small;
-
- destination->array[destination->used].handle = source.array[i].handle;
- destination->array[destination->used].interrupt = source.array[i].interrupt;
-
- destination->array[destination->used].callbacks = source.array[i].callbacks;
- destination->array[destination->used].custom = source.array[i].custom;
- destination->array[destination->used++].data = source.array[i].data;
+ destination->array[destination->used++] = source.array[i];
} // for
return F_none;
}
#endif // !defined(_di_f_states_append_) || !defined(_di_f_states_append_all_) || !defined(_di_f_statess_append_all_)
-#if !defined(_di_f_states_resize_) || !defined(_di_f_states_append_) || !defined(_di_f_states_decrease_by_) || !defined(_di_f_statess_append_)
- f_status_t private_f_states_resize(const f_number_unsigned_t length, f_states_t * const states) {
-
- const f_status_t status = f_memory_resize(states->size, length, sizeof(f_state_t), (void **) & states->array);
- if (F_status_is_error(status)) return status;
-
- states->size = length;
-
- if (states->used > states->size) {
- states->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_states_resize_) || !defined(_di_f_states_append_) || !defined(_di_f_states_decrease_by_) || !defined(_di_f_statess_append_)
-
#if !defined(_di_f_statess_adjust_) || !defined(_di_f_statess_decimate_by_)
- f_status_t private_f_statess_adjust(const f_number_unsigned_t length, f_statess_t * const statess) {
+ f_status_t private_f_statess_adjust(const f_number_unsigned_t length, f_statess_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < statess->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_destroy(statess->array[i].size, sizeof(f_states_t), (void **) & statess->array[i].array);
+ status = f_memory_array_adjust(0, sizeof(f_state_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
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(status)) return status;
-
- statess->size = length;
-
- if (statess->used > statess->size) {
- statess->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_states_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_statess_adjust_) || !defined(_di_f_statess_decimate_by_)
#if !defined(_di_f_statess_decrease_by_) || !defined(_di_f_statess_increase_) || !defined(_di_f_statess_increase_by_) || !defined(_di_f_statess_resize_)
- f_status_t private_f_statess_resize(const f_number_unsigned_t length, f_statess_t * const statess) {
+ f_status_t private_f_statess_resize(const f_number_unsigned_t length, f_statess_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < statess->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_delete(statess->array[i].size, sizeof(f_states_t), (void **) & statess->array[i].array);
+ status = f_memory_array_resize(0, sizeof(f_state_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
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(status)) return status;
-
- statess->size = length;
-
- if (statess->used > statess->size) {
- statess->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_states_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_statess_decrease_by_) || !defined(_di_f_statess_increase_) || !defined(_di_f_statess_increase_by_) || !defined(_di_f_statess_resize_)
#endif
/**
- * 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_states_adjust()
- * @see f_states_decimate_by()
- */
-#if !defined(_di_f_states_adjust_) || !defined(_di_f_states_decimate_by_)
- extern f_status_t private_f_states_adjust(const f_number_unsigned_t length, f_states_t * const states) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_states_adjust_) || !defined(_di_f_states_decimate_by_)
-
-/**
* Private implementation for appending the state array.
*
* Intended to be shared to each of the different implementation variations.
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*
- * @see f_memory_resize()
* @see f_states_append()
* @see f_statess_append()
*/
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*
- * @see f_memory_resize()
* @see f_states_append_all()
* @see f_statess_append()
* @see f_statess_append_all()
#endif // !defined(_di_f_states_append_) || !defined(_di_f_states_append_all_) || !defined(_di_f_statess_append_all_)
/**
- * Private implementation for resizing the states array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @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_states_resize()
- * @see f_states_append()
- * @see f_states_decrease_by()
- * @see f_statess_append()
- */
-#if !defined(_di_f_states_resize_) || !defined(_di_f_states_append_) || !defined(_di_f_states_decrease_by_) || !defined(_di_f_statess_append_)
- extern f_status_t private_f_states_resize(const f_number_unsigned_t length, f_states_t * const states) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_states_resize_) || !defined(_di_f_states_append_) || !defined(_di_f_states_decrease_by_) || !defined(_di_f_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
+ * @param structure
* The statess array to adjust.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*
* @see f_statess_adjust()
* @see f_statess_decimate_by()
*/
#if !defined(_di_f_statess_adjust_) || !defined(_di_f_statess_decimate_by_)
- extern f_status_t private_f_statess_adjust(const f_number_unsigned_t length, f_statess_t * const statess) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_statess_adjust(const f_number_unsigned_t length, f_statess_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_statess_adjust_) || !defined(_di_f_statess_decimate_by_)
/**
*
* @param length
* The length to resize to.
- * @param statess
+ * @param structure
* The statess array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
* @see f_statess_decrease_by()
* @see f_statess_increase()
* @see f_statess_resize()
*/
#if !defined(_di_f_statess_decrease_by_) || !defined(_di_f_statess_increase_) || !defined(_di_f_statess_increase_by_) || !defined(_di_f_statess_resize_)
- extern f_status_t private_f_statess_resize(const f_number_unsigned_t length, f_statess_t * const statess) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_statess_resize(const f_number_unsigned_t length, f_statess_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_statess_decrease_by_) || !defined(_di_f_statess_increase_) || !defined(_di_f_statess_increase_by_) || !defined(_di_f_statess_resize_)
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(_di_f_statuss_adjust_) || !defined(_di_f_statuss_decimate_by_)
- f_status_t private_f_statuss_adjust(const f_number_unsigned_t length, f_statuss_t * const statuss) {
-
- const f_status_t status = f_memory_adjust(statuss->size, length, sizeof(f_status_t), (void **) & statuss->array);
- if (F_status_is_error(status)) return status;
-
- statuss->size = length;
-
- if (statuss->used > statuss->size) {
- statuss->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_statuss_adjust_) || !defined(_di_f_statuss_decimate_by_)
-
#if !defined(_di_f_statuss_append_) || !defined(_di_f_statusss_append_)
extern f_status_t private_f_statuss_append(const f_status_t source, f_statuss_t * const destination) {
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_statuss_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_status_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
#if !defined(_di_f_statuss_append_) || !defined(_di_f_statuss_append_all_) || !defined(_di_f_statusss_append_all_)
extern f_status_t private_f_statuss_append_all(const f_statuss_t source, f_statuss_t * const destination) {
- if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_statuss_resize(destination->used + source.used, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_status_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
}
#endif // !defined(_di_f_statuss_append_) || !defined(_di_f_statuss_append_all_) || !defined(_di_f_statusss_append_all_)
-#if !defined(_di_f_statuss_resize_) || !defined(_di_f_statuss_append_) || !defined(_di_f_statuss_decrease_by_) || !defined(_di_f_statusss_append_)
- f_status_t private_f_statuss_resize(const f_number_unsigned_t length, f_statuss_t * const statuss) {
-
- const f_status_t status = f_memory_resize(statuss->size, length, sizeof(f_status_t), (void **) & statuss->array);
- if (F_status_is_error(status)) return status;
-
- statuss->size = length;
-
- if (statuss->used > statuss->size) {
- statuss->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_statuss_resize_) || !defined(_di_f_statuss_append_) || !defined(_di_f_statuss_decrease_by_) || !defined(_di_f_statusss_append_)
-
#if !defined(_di_f_statusss_adjust_) || !defined(_di_f_statusss_decimate_by_)
- f_status_t private_f_statusss_adjust(const f_number_unsigned_t length, f_statusss_t * const statusss) {
+ f_status_t private_f_statusss_adjust(const f_number_unsigned_t length, f_statusss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < statusss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_destroy(statusss->array[i].size, sizeof(f_statuss_t), (void **) & statusss->array[i].array);
+ status = f_memory_array_adjust(0, sizeof(f_status_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
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(status)) return status;
-
- statusss->size = length;
-
- if (statusss->used > statusss->size) {
- statusss->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_statuss_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_statusss_adjust_) || !defined(_di_f_statusss_decimate_by_)
#if !defined(_di_f_statusss_decrease_by_) || !defined(_di_f_statusss_increase_) || !defined(_di_f_statusss_increase_by_) || !defined(_di_f_statusss_resize_)
- f_status_t private_f_statusss_resize(const f_number_unsigned_t length, f_statusss_t * const statusss) {
+ f_status_t private_f_statusss_resize(const f_number_unsigned_t length, f_statusss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < statusss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_delete(statusss->array[i].size, sizeof(f_statuss_t), (void **) & statusss->array[i].array);
+ status = f_memory_array_resize(0, sizeof(f_status_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
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(status)) return status;
-
- statusss->size = length;
-
- if (statusss->used > statusss->size) {
- statusss->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_statuss_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_statusss_decrease_by_) || !defined(_di_f_statusss_increase_) || !defined(_di_f_statusss_increase_by_) || !defined(_di_f_statusss_resize_)
#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_statuss_adjust()
- * @see f_statuss_decimate_by()
- */
-#if !defined(_di_f_statuss_adjust_) || !defined(_di_f_statuss_decimate_by_)
- extern f_status_t private_f_statuss_adjust(const f_number_unsigned_t length, f_statuss_t * const statuss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_statuss_adjust_) || !defined(_di_f_statuss_decimate_by_)
-
-/**
* Private implementation for appending the status array.
*
* Intended to be shared to each of the different implementation variations.
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*
- * @see f_memory_resize()
* @see f_statuss_append()
* @see f_statusss_append()
*/
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*
- * @see f_memory_resize()
* @see f_statuss_append_all()
* @see f_statusss_append()
* @see f_statusss_append_all()
#endif // !defined(_di_f_statuss_append_) || !defined(_di_f_statuss_append_all_) || !defined(_di_f_statusss_append_all_)
/**
- * Private implementation for resizing the statuss array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @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_statuss_resize()
- * @see f_statuss_append()
- * @see f_statuss_decrease_by()
- * @see f_statusss_append()
- */
-#if !defined(_di_f_statuss_resize_) || !defined(_di_f_statuss_append_) || !defined(_di_f_statuss_decrease_by_) || !defined(_di_f_statusss_append_)
- extern f_status_t private_f_statuss_resize(const f_number_unsigned_t length, f_statuss_t * const statuss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_statuss_resize_) || !defined(_di_f_statuss_append_) || !defined(_di_f_statuss_decrease_by_) || !defined(_di_f_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
+ * @param structure
* The statusss array to adjust.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*
* @see f_statusss_adjust()
* @see f_statusss_decimate_by()
*/
#if !defined(_di_f_statusss_adjust_) || !defined(_di_f_statusss_decimate_by_)
- extern f_status_t private_f_statusss_adjust(const f_number_unsigned_t length, f_statusss_t * const statusss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_statusss_adjust(const f_number_unsigned_t length, f_statusss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_statusss_adjust_) || !defined(_di_f_statusss_decimate_by_)
/**
*
* @param length
* The length to resize to.
- * @param statusss
+ * @param structure
* The statusss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
* @see f_statusss_decrease_by()
* @see f_statusss_increase()
* @see f_statusss_resize()
*/
#if !defined(_di_f_statusss_decrease_by_) || !defined(_di_f_statusss_increase_) || !defined(_di_f_statusss_increase_by_) || !defined(_di_f_statusss_resize_)
- extern f_status_t private_f_statusss_resize(const f_number_unsigned_t length, f_statusss_t * const statusss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_statusss_resize(const f_number_unsigned_t length, f_statusss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_statusss_decrease_by_) || !defined(_di_f_statusss_increase_) || !defined(_di_f_statusss_increase_by_) || !defined(_di_f_statusss_resize_)
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(_di_f_uint128s_adjust_) || !defined(_di_f_uint128s_decimate_by_)
- f_status_t private_f_uint128s_adjust(const f_number_unsigned_t length, f_uint128s_t * const uint128s) {
-
- const f_status_t status = f_memory_adjust(uint128s->size, length, sizeof(f_uint128s_t), (void **) & uint128s->array);
- if (F_status_is_error(status)) return status;
-
- uint128s->size = length;
-
- if (uint128s->used > uint128s->size) {
- uint128s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_uint128s_adjust_) || !defined(_di_f_uint128s_decimate_by_)
-
#if !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128ss_append_)
extern f_status_t private_f_uint128s_append(const uint128_t source, f_uint128s_t * const destination) {
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_uint128s_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(uint128_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
#if !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128s_append_all_) || !defined(_di_f_uint128ss_append_all_)
extern f_status_t private_f_uint128s_append_all(const f_uint128s_t source, f_uint128s_t * const destination) {
- if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_uint128s_resize(destination->used + source.used, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(uint128_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
}
#endif // !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128s_append_all_) || !defined(_di_f_uint128ss_append_all_)
-#if !defined(_di_f_uint128s_resize_) || !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128s_decrease_by_) || !defined(_di_f_uint128ss_append_)
- f_status_t private_f_uint128s_resize(const f_number_unsigned_t length, f_uint128s_t * const uint128s) {
-
- const f_status_t status = f_memory_resize(uint128s->size, length, sizeof(f_uint128s_t), (void **) & uint128s->array);
- if (F_status_is_error(status)) return status;
-
- uint128s->size = length;
-
- if (uint128s->used > uint128s->size) {
- uint128s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_uint128s_resize_) || !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128s_decrease_by_) || !defined(_di_f_uint128ss_append_)
-
#if !defined(_di_f_uint128ss_adjust_) || !defined(_di_f_uint128ss_decimate_by_)
- f_status_t private_f_uint128ss_adjust(const f_number_unsigned_t length, f_uint128ss_t * const uint128ss) {
+ f_status_t private_f_uint128ss_adjust(const f_number_unsigned_t length, f_uint128ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < uint128ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_destroy(uint128ss->array[i].size, sizeof(f_uint128s_t), (void **) & uint128ss->array[i].array);
+ status = f_memory_array_adjust(0, sizeof(uint128_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- uint128ss->array[i].size = 0;
- uint128ss->array[i].used = 0;
} // for
- status = f_memory_adjust(uint128ss->size, length, sizeof(f_uint128s_t), (void **) & uint128ss->array);
- if (F_status_is_error(status)) return status;
-
- uint128ss->size = length;
-
- if (uint128ss->used > uint128ss->size) {
- uint128ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_uint128s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_uint128ss_adjust_) || !defined(_di_f_uint128ss_decimate_by_)
#if !defined(_di_f_uint128ss_decrease_by_) || !defined(_di_f_uint128ss_increase_) || !defined(_di_f_uint128ss_increase_by_) || !defined(_di_f_uint128ss_resize_)
- f_status_t private_f_uint128ss_resize(const f_number_unsigned_t length, f_uint128ss_t * const uint128ss) {
+ f_status_t private_f_uint128ss_resize(const f_number_unsigned_t length, f_uint128ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < uint128ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_delete(uint128ss->array[i].size, sizeof(f_uint128s_t), (void **) & uint128ss->array[i].array);
+ status = f_memory_array_resize(0, sizeof(uint128_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- uint128ss->array[i].size = 0;
- uint128ss->array[i].used = 0;
} // for
- status = f_memory_resize(uint128ss->size, length, sizeof(f_uint128s_t), (void **) & uint128ss->array);
- if (F_status_is_error(status)) return status;
-
- uint128ss->size = length;
-
- if (uint128ss->used > uint128ss->size) {
- uint128ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_uint128s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_uint128ss_decrease_by_) || !defined(_di_f_uint128ss_increase_) || !defined(_di_f_uint128ss_increase_by_) || !defined(_di_f_uint128ss_resize_)
#endif
/**
- * Private implementation for resizing the uint128s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint128s
- * The uint128s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_uint128s_adjust()
- * @see f_uint128s_decimate_by()
- */
-#if !defined(_di_f_uint128s_adjust_) || !defined(_di_f_uint128s_decimate_by_)
- extern f_status_t private_f_uint128s_adjust(const f_number_unsigned_t length, f_uint128s_t * const uint128s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint128s_adjust_) || !defined(_di_f_uint128s_decimate_by_)
-
-/**
* Private implementation for appending the uint128 array.
*
* Intended to be shared to each of the different implementation variations.
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*
- * @see f_memory_resize()
* @see f_uint128s_append()
* @see f_uint128ss_append()
*/
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*
- * @see f_memory_resize()
* @see f_uint128s_append_all()
* @see f_uint128ss_append()
* @see f_uint128ss_append_all()
#endif // !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128s_append_all_) || !defined(_di_f_uint128ss_append_all_)
/**
- * Private implementation for resizing the uint128s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint128s
- * The uint128s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint128s_resize()
- * @see f_uint128s_append()
- * @see f_uint128s_decrease_by()
- * @see f_uint128ss_append()
- */
-#if !defined(_di_f_uint128s_resize_) || !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128s_decrease_by_) || !defined(_di_f_uint128ss_append_)
- extern f_status_t private_f_uint128s_resize(const f_number_unsigned_t length, f_uint128s_t * const uint128s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint128s_resize_) || !defined(_di_f_uint128s_append_) || !defined(_di_f_uint128s_decrease_by_) || !defined(_di_f_uint128ss_append_)
-
-/**
* Private implementation for resizing the uint128ss array.
*
* Intended to be shared to each of the different implementation variations.
*
* @param length
* The length to adjust to.
- * @param uint128ss
+ * @param structure
* The uint128ss array to adjust.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*
* @see f_uint128ss_adjust()
* @see f_uint128ss_decimate_by()
*/
#if !defined(_di_f_uint128ss_adjust_) || !defined(_di_f_uint128ss_decimate_by_)
- extern f_status_t private_f_uint128ss_adjust(const f_number_unsigned_t length, f_uint128ss_t * const uint128ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_uint128ss_adjust(const f_number_unsigned_t length, f_uint128ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_uint128ss_adjust_) || !defined(_di_f_uint128ss_decimate_by_)
/**
*
* @param length
* The length to resize to.
- * @param uint128ss
+ * @param structure
* The uint128ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
* @see f_uint128ss_decrease_by()
* @see f_uint128ss_increase()
* @see f_uint128ss_resize()
*/
#if !defined(_di_f_uint128ss_decrease_by_) || !defined(_di_f_uint128ss_increase_) || !defined(_di_f_uint128ss_increase_by_) || !defined(_di_f_uint128ss_resize_)
- extern f_status_t private_f_uint128ss_resize(const f_number_unsigned_t length, f_uint128ss_t * const uint128ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_uint128ss_resize(const f_number_unsigned_t length, f_uint128ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_uint128ss_decrease_by_) || !defined(_di_f_uint128ss_increase_) || !defined(_di_f_uint128ss_increase_by_) || !defined(_di_f_uint128ss_resize_)
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(_di_f_uint16s_adjust_) || !defined(_di_f_uint16s_decimate_by_)
- f_status_t private_f_uint16s_adjust(const f_number_unsigned_t length, f_uint16s_t * const uint16s) {
-
- const f_status_t status = f_memory_adjust(uint16s->size, length, sizeof(uint16_t), (void **) & uint16s->array);
- if (F_status_is_error(status)) return status;
-
- uint16s->size = length;
-
- if (uint16s->used > uint16s->size) {
- uint16s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_uint16s_adjust_) || !defined(_di_f_uint16s_decimate_by_)
-
#if !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16ss_append_)
extern f_status_t private_f_uint16s_append(const uint16_t source, f_uint16s_t * const destination) {
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_uint16s_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(uint16_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
#if !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16s_append_all_) || !defined(_di_f_uint16ss_append_all_)
extern f_status_t private_f_uint16s_append_all(const f_uint16s_t source, f_uint16s_t * const destination) {
- if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_uint16s_resize(destination->used + source.used, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(uint16_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
}
#endif // !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16s_append_all_) || !defined(_di_f_uint16ss_append_all_)
-#if !defined(_di_f_uint16s_resize_) || !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16s_decrease_by_) || !defined(_di_f_uint16ss_append_)
- f_status_t private_f_uint16s_resize(const f_number_unsigned_t length, f_uint16s_t * const uint16s) {
-
- const f_status_t status = f_memory_resize(uint16s->size, length, sizeof(uint16_t), (void **) & uint16s->array);
- if (F_status_is_error(status)) return status;
-
- uint16s->size = length;
-
- if (uint16s->used > uint16s->size) {
- uint16s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_uint16s_resize_) || !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16s_decrease_by_) || !defined(_di_f_uint16ss_append_)
-
#if !defined(_di_f_uint16ss_adjust_) || !defined(_di_f_uint16ss_decimate_by_)
- f_status_t private_f_uint16ss_adjust(const f_number_unsigned_t length, f_uint16ss_t * const uint16ss) {
+ f_status_t private_f_uint16ss_adjust(const f_number_unsigned_t length, f_uint16ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < uint16ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_destroy(uint16ss->array[i].size, sizeof(f_uint16s_t), (void **) & uint16ss->array[i].array);
+ status = f_memory_array_adjust(0, sizeof(uint16_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- uint16ss->array[i].size = 0;
- uint16ss->array[i].used = 0;
} // for
- status = f_memory_adjust(uint16ss->size, length, sizeof(f_uint16s_t), (void **) & uint16ss->array);
- if (F_status_is_error(status)) return status;
-
- uint16ss->size = length;
-
- if (uint16ss->used > uint16ss->size) {
- uint16ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_uint16s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_uint16ss_adjust_) || !defined(_di_f_uint16ss_decimate_by_)
#if !defined(_di_f_uint16ss_decrease_by_) || !defined(_di_f_uint16ss_increase_) || !defined(_di_f_uint16ss_increase_by_) || !defined(_di_f_uint16ss_resize_)
- f_status_t private_f_uint16ss_resize(const f_number_unsigned_t length, f_uint16ss_t * const uint16ss) {
+ f_status_t private_f_uint16ss_resize(const f_number_unsigned_t length, f_uint16ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < uint16ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_delete(uint16ss->array[i].size, sizeof(f_uint16s_t), (void **) & uint16ss->array[i].array);
+ status = f_memory_array_resize(0, sizeof(uint16_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- uint16ss->array[i].size = 0;
- uint16ss->array[i].used = 0;
} // for
- status = f_memory_resize(uint16ss->size, length, sizeof(f_uint16s_t), (void **) & uint16ss->array);
- if (F_status_is_error(status)) return status;
-
- uint16ss->size = length;
-
- if (uint16ss->used > uint16ss->size) {
- uint16ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_uint16s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_uint16ss_decrease_by_) || !defined(_di_f_uint16ss_increase_) || !defined(_di_f_uint16ss_increase_by_) || !defined(_di_f_uint16ss_resize_)
#endif
/**
- * Private implementation for resizing the uint16s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint16s
- * The uint16s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_uint16s_adjust()
- * @see f_uint16s_decimate_by()
- */
-#if !defined(_di_f_uint16s_adjust_) || !defined(_di_f_uint16s_decimate_by_)
- extern f_status_t private_f_uint16s_adjust(const f_number_unsigned_t length, f_uint16s_t * const uint16s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint16s_adjust_) || !defined(_di_f_uint16s_decimate_by_)
-
-/**
* Private implementation for appending the uint16 array.
*
* Intended to be shared to each of the different implementation variations.
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*
- * @see f_memory_resize()
* @see f_uint16s_append()
* @see f_uint16ss_append()
*/
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*
- * @see f_memory_resize()
* @see f_uint16s_append_all()
* @see f_uint16ss_append()
* @see f_uint16ss_append_all()
#endif // !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16s_append_all_) || !defined(_di_f_uint16ss_append_all_)
/**
- * Private implementation for resizing the uint16s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint16s
- * The uint16s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint16s_resize()
- * @see f_uint16s_append()
- * @see f_uint16s_decrease_by()
- * @see f_uint16ss_append()
- */
-#if !defined(_di_f_uint16s_resize_) || !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16s_decrease_by_) || !defined(_di_f_uint16ss_append_)
- extern f_status_t private_f_uint16s_resize(const f_number_unsigned_t length, f_uint16s_t * const uint16s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint16s_resize_) || !defined(_di_f_uint16s_append_) || !defined(_di_f_uint16s_decrease_by_) || !defined(_di_f_uint16ss_append_)
-
-/**
* Private implementation for resizing the uint16ss array.
*
* Intended to be shared to each of the different implementation variations.
*
* @param length
* The length to adjust to.
- * @param uint16ss
+ * @param structure
* The uint16ss array to adjust.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*
* @see f_uint16ss_adjust()
* @see f_uint16ss_decimate_by()
*/
#if !defined(_di_f_uint16ss_adjust_) || !defined(_di_f_uint16ss_decimate_by_)
- extern f_status_t private_f_uint16ss_adjust(const f_number_unsigned_t length, f_uint16ss_t * const uint16ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_uint16ss_adjust(const f_number_unsigned_t length, f_uint16ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_uint16ss_adjust_) || !defined(_di_f_uint16ss_decimate_by_)
/**
*
* @param length
* The length to resize to.
- * @param uint16ss
+ * @param structure
* The uint16ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
* @see f_uint16ss_decrease_by()
* @see f_uint16ss_increase()
* @see f_uint16ss_resize()
*/
#if !defined(_di_f_uint16ss_decrease_by_) || !defined(_di_f_uint16ss_increase_) || !defined(_di_f_uint16ss_increase_by_) || !defined(_di_f_uint16ss_resize_)
- extern f_status_t private_f_uint16ss_resize(const f_number_unsigned_t length, f_uint16ss_t * const uint16ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_uint16ss_resize(const f_number_unsigned_t length, f_uint16ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_uint16ss_decrease_by_) || !defined(_di_f_uint16ss_increase_) || !defined(_di_f_uint16ss_increase_by_) || !defined(_di_f_uint16ss_resize_)
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(_di_f_uint32s_adjust_) || !defined(_di_f_uint32s_decimate_by_)
- f_status_t private_f_uint32s_adjust(const f_number_unsigned_t length, f_uint32s_t * const uint32s) {
-
- const f_status_t status = f_memory_adjust(uint32s->size, length, sizeof(uint32_t), (void **) & uint32s->array);
- if (F_status_is_error(status)) return status;
-
- uint32s->size = length;
-
- if (uint32s->used > uint32s->size) {
- uint32s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_uint32s_adjust_) || !defined(_di_f_uint32s_decimate_by_)
-
#if !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32ss_append_)
extern f_status_t private_f_uint32s_append(const uint32_t source, f_uint32s_t * const destination) {
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_uint32s_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(uint32_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
#if !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32s_append_all_) || !defined(_di_f_uint32ss_append_all_)
extern f_status_t private_f_uint32s_append_all(const f_uint32s_t source, f_uint32s_t * const destination) {
- if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_uint32s_resize(destination->used + source.used, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(uint32_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
}
#endif // !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32s_append_all_) || !defined(_di_f_uint32ss_append_all_)
-#if !defined(_di_f_uint32s_resize_) || !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32s_decrease_by_) || !defined(_di_f_uint32ss_append_)
- f_status_t private_f_uint32s_resize(const f_number_unsigned_t length, f_uint32s_t * const uint32s) {
-
- const f_status_t status = f_memory_resize(uint32s->size, length, sizeof(uint32_t), (void **) & uint32s->array);
- if (F_status_is_error(status)) return status;
-
- uint32s->size = length;
-
- if (uint32s->used > uint32s->size) {
- uint32s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_uint32s_resize_) || !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32s_decrease_by_) || !defined(_di_f_uint32ss_append_)
-
#if !defined(_di_f_uint32ss_adjust_) || !defined(_di_f_uint32ss_decimate_by_)
- f_status_t private_f_uint32ss_adjust(const f_number_unsigned_t length, f_uint32ss_t * const uint32ss) {
+ f_status_t private_f_uint32ss_adjust(const f_number_unsigned_t length, f_uint32ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < uint32ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_destroy(uint32ss->array[i].size, sizeof(f_uint32s_t), (void **) & uint32ss->array[i].array);
+ status = f_memory_array_adjust(0, sizeof(uint32_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- uint32ss->array[i].size = 0;
- uint32ss->array[i].used = 0;
} // for
- status = f_memory_adjust(uint32ss->size, length, sizeof(f_uint32s_t), (void **) & uint32ss->array);
- if (F_status_is_error(status)) return status;
-
- uint32ss->size = length;
-
- if (uint32ss->used > uint32ss->size) {
- uint32ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_uint32s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_uint32ss_adjust_) || !defined(_di_f_uint32ss_decimate_by_)
#if !defined(_di_f_uint32ss_decrease_by_) || !defined(_di_f_uint32ss_increase_) || !defined(_di_f_uint32ss_increase_by_) || !defined(_di_f_uint32ss_resize_)
- f_status_t private_f_uint32ss_resize(const f_number_unsigned_t length, f_uint32ss_t * const uint32ss) {
+ f_status_t private_f_uint32ss_resize(const f_number_unsigned_t length, f_uint32ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < uint32ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_delete(uint32ss->array[i].size, sizeof(f_uint32s_t), (void **) & uint32ss->array[i].array);
+ status = f_memory_array_resize(0, sizeof(uint32_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- uint32ss->array[i].size = 0;
- uint32ss->array[i].used = 0;
} // for
- status = f_memory_resize(uint32ss->size, length, sizeof(f_uint32s_t), (void **) & uint32ss->array);
- if (F_status_is_error(status)) return status;
-
- uint32ss->size = length;
-
- if (uint32ss->used > uint32ss->size) {
- uint32ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_uint32s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_uint32ss_decrease_by_) || !defined(_di_f_uint32ss_increase_) || !defined(_di_f_uint32ss_increase_by_) || !defined(_di_f_uint32ss_resize_)
#endif
/**
- * Private implementation for resizing the uint32s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint32s
- * The uint32s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_uint32s_adjust()
- * @see f_uint32s_decimate_by()
- */
-#if !defined(_di_f_uint32s_adjust_) || !defined(_di_f_uint32s_decimate_by_)
- extern f_status_t private_f_uint32s_adjust(const f_number_unsigned_t length, f_uint32s_t * const uint32s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint32s_adjust_) || !defined(_di_f_uint32s_decimate_by_)
-
-/**
* Private implementation for appending the uint32 array.
*
* Intended to be shared to each of the different implementation variations.
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*
- * @see f_memory_resize()
* @see f_uint32s_append()
* @see f_uint32ss_append()
*/
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*
- * @see f_memory_resize()
* @see f_uint32s_append_all()
* @see f_uint32ss_append()
* @see f_uint32ss_append_all()
#endif // !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32s_append_all_) || !defined(_di_f_uint32ss_append_all_)
/**
- * Private implementation for resizing the uint32s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint32s
- * The uint32s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint32s_resize()
- * @see f_uint32s_append()
- * @see f_uint32s_decrease_by()
- * @see f_uint32ss_append()
- */
-#if !defined(_di_f_uint32s_resize_) || !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32s_decrease_by_) || !defined(_di_f_uint32ss_append_)
- extern f_status_t private_f_uint32s_resize(const f_number_unsigned_t length, f_uint32s_t * const uint32s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint32s_resize_) || !defined(_di_f_uint32s_append_) || !defined(_di_f_uint32s_decrease_by_) || !defined(_di_f_uint32ss_append_)
-
-/**
* Private implementation for resizing the uint32ss array.
*
* Intended to be shared to each of the different implementation variations.
*
* @param length
* The length to adjust to.
- * @param uint32ss
+ * @param structure
* The uint32ss array to adjust.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*
* @see f_uint32ss_adjust()
* @see f_uint32ss_decimate_by()
*/
#if !defined(_di_f_uint32ss_adjust_) || !defined(_di_f_uint32ss_decimate_by_)
- extern f_status_t private_f_uint32ss_adjust(const f_number_unsigned_t length, f_uint32ss_t * const uint32ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_uint32ss_adjust(const f_number_unsigned_t length, f_uint32ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_uint32ss_adjust_) || !defined(_di_f_uint32ss_decimate_by_)
/**
*
* @param length
* The length to resize to.
- * @param uint32ss
+ * @param structure
* The uint32ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
* @see f_uint32ss_decrease_by()
* @see f_uint32ss_increase()
* @see f_uint32ss_resize()
*/
#if !defined(_di_f_uint32ss_decrease_by_) || !defined(_di_f_uint32ss_increase_) || !defined(_di_f_uint32ss_increase_by_) || !defined(_di_f_uint32ss_resize_)
- extern f_status_t private_f_uint32ss_resize(const f_number_unsigned_t length, f_uint32ss_t * const uint32ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_uint32ss_resize(const f_number_unsigned_t length, f_uint32ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_uint32ss_decrease_by_) || !defined(_di_f_uint32ss_increase_) || !defined(_di_f_uint32ss_increase_by_) || !defined(_di_f_uint32ss_resize_)
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(_di_f_uint64s_adjust_) || !defined(_di_f_uint64s_decimate_by_)
- f_status_t private_f_uint64s_adjust(const f_number_unsigned_t length, f_uint64s_t * const uint64s) {
-
- const f_status_t status = f_memory_adjust(uint64s->size, length, sizeof(uint64_t), (void **) & uint64s->array);
- if (F_status_is_error(status)) return status;
-
- uint64s->size = length;
-
- if (uint64s->used > uint64s->size) {
- uint64s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_uint64s_adjust_) || !defined(_di_f_uint64s_decimate_by_)
-
#if !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64ss_append_)
extern f_status_t private_f_uint64s_append(const uint64_t source, f_uint64s_t * const destination) {
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_uint64s_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(uint64_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
#if !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64s_append_all_) || !defined(_di_f_uint64ss_append_all_)
extern f_status_t private_f_uint64s_append_all(const f_uint64s_t source, f_uint64s_t * const destination) {
- if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_uint64s_resize(destination->used + source.used, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(uint64_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
}
#endif // !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64s_append_all_) || !defined(_di_f_uint64ss_append_all_)
-#if !defined(_di_f_uint64s_resize_) || !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64s_decrease_by_) || !defined(_di_f_uint64ss_append_)
- f_status_t private_f_uint64s_resize(const f_number_unsigned_t length, f_uint64s_t * const uint64s) {
-
- const f_status_t status = f_memory_resize(uint64s->size, length, sizeof(uint64_t), (void **) & uint64s->array);
- if (F_status_is_error(status)) return status;
-
- uint64s->size = length;
-
- if (uint64s->used > uint64s->size) {
- uint64s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_uint64s_resize_) || !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64s_decrease_by_) || !defined(_di_f_uint64ss_append_)
-
#if !defined(_di_f_uint64ss_adjust_) || !defined(_di_f_uint64ss_decimate_by_)
- f_status_t private_f_uint64ss_adjust(const f_number_unsigned_t length, f_uint64ss_t * const uint64ss) {
+ f_status_t private_f_uint64ss_adjust(const f_number_unsigned_t length, f_uint64ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < uint64ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_destroy(uint64ss->array[i].size, sizeof(f_uint64s_t), (void **) & uint64ss->array[i].array);
+ status = f_memory_array_adjust(0, sizeof(uint64_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- uint64ss->array[i].size = 0;
- uint64ss->array[i].used = 0;
} // for
- status = f_memory_adjust(uint64ss->size, length, sizeof(f_uint64s_t), (void **) & uint64ss->array);
- if (F_status_is_error(status)) return status;
-
- uint64ss->size = length;
-
- if (uint64ss->used > uint64ss->size) {
- uint64ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_uint64s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_uint64ss_adjust_) || !defined(_di_f_uint64ss_decimate_by_)
#if !defined(_di_f_uint64ss_decrease_by_) || !defined(_di_f_uint64ss_increase_) || !defined(_di_f_uint64ss_increase_by_) || !defined(_di_f_uint64ss_resize_)
- f_status_t private_f_uint64ss_resize(const f_number_unsigned_t length, f_uint64ss_t * const uint64ss) {
+ f_status_t private_f_uint64ss_resize(const f_number_unsigned_t length, f_uint64ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < uint64ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_delete(uint64ss->array[i].size, sizeof(f_uint64s_t), (void **) & uint64ss->array[i].array);
+ status = f_memory_array_resize(0, sizeof(uint64_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- uint64ss->array[i].size = 0;
- uint64ss->array[i].used = 0;
} // for
- status = f_memory_resize(uint64ss->size, length, sizeof(f_uint64s_t), (void **) & uint64ss->array);
- if (F_status_is_error(status)) return status;
-
- uint64ss->size = length;
-
- if (uint64ss->used > uint64ss->size) {
- uint64ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_uint64s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_uint64ss_decrease_by_) || !defined(_di_f_uint64ss_increase_) || !defined(_di_f_uint64ss_increase_by_) || !defined(_di_f_uint64ss_resize_)
#endif
/**
- * Private implementation for resizing the uint64s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint64s
- * The uint64s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_uint64s_adjust()
- * @see f_uint64s_decimate_by()
- */
-#if !defined(_di_f_uint64s_adjust_) || !defined(_di_f_uint64s_decimate_by_)
- extern f_status_t private_f_uint64s_adjust(const f_number_unsigned_t length, f_uint64s_t * const uint64s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint64s_adjust_) || !defined(_di_f_uint64s_decimate_by_)
-
-/**
* Private implementation for appending the uint64 array.
*
* Intended to be shared to each of the different implementation variations.
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*
- * @see f_memory_resize()
* @see f_uint64s_append()
* @see f_uint64ss_append()
*/
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*
- * @see f_memory_resize()
* @see f_uint64s_append_all()
* @see f_uint64ss_append()
* @see f_uint64ss_append_all()
#endif // !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64s_append_all_) || !defined(_di_f_uint64ss_append_all_)
/**
- * Private implementation for resizing the uint64s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint64s
- * The uint64s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint64s_resize()
- * @see f_uint64s_append()
- * @see f_uint64s_decrease_by()
- * @see f_uint64ss_append()
- */
-#if !defined(_di_f_uint64s_resize_) || !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64s_decrease_by_) || !defined(_di_f_uint64ss_append_)
- extern f_status_t private_f_uint64s_resize(const f_number_unsigned_t length, f_uint64s_t * const uint64s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint64s_resize_) || !defined(_di_f_uint64s_append_) || !defined(_di_f_uint64s_decrease_by_) || !defined(_di_f_uint64ss_append_)
-
-/**
* Private implementation for resizing the uint64ss array.
*
* Intended to be shared to each of the different implementation variations.
*
* @param length
* The length to adjust to.
- * @param uint64ss
+ * @param structure
* The uint64ss array to adjust.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*
* @see f_uint64ss_adjust()
* @see f_uint64ss_decimate_by()
*/
#if !defined(_di_f_uint64ss_adjust_) || !defined(_di_f_uint64ss_decimate_by_)
- extern f_status_t private_f_uint64ss_adjust(const f_number_unsigned_t length, f_uint64ss_t * const uint64ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_uint64ss_adjust(const f_number_unsigned_t length, f_uint64ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_uint64ss_adjust_) || !defined(_di_f_uint64ss_decimate_by_)
/**
*
* @param length
* The length to resize to.
- * @param uint64ss
+ * @param structure
* The uint64ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
* @see f_uint64ss_decrease_by()
* @see f_uint64ss_increase()
* @see f_uint64ss_resize()
*/
#if !defined(_di_f_uint64ss_decrease_by_) || !defined(_di_f_uint64ss_increase_) || !defined(_di_f_uint64ss_increase_by_) || !defined(_di_f_uint64ss_resize_)
- extern f_status_t private_f_uint64ss_resize(const f_number_unsigned_t length, f_uint64ss_t * const uint64ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_uint64ss_resize(const f_number_unsigned_t length, f_uint64ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_uint64ss_decrease_by_) || !defined(_di_f_uint64ss_increase_) || !defined(_di_f_uint64ss_increase_by_) || !defined(_di_f_uint64ss_resize_)
#ifdef __cplusplus
extern "C" {
#endif
-#if !defined(_di_f_uint8s_adjust_) || !defined(_di_f_uint8s_decimate_by_)
- f_status_t private_f_uint8s_adjust(const f_number_unsigned_t length, f_uint8s_t * const uint8s) {
-
- const f_status_t status = f_memory_adjust(uint8s->size, length, sizeof(uint8_t), (void **) & uint8s->array);
- if (F_status_is_error(status)) return status;
-
- uint8s->size = length;
-
- if (uint8s->used > uint8s->size) {
- uint8s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_uint8s_adjust_) || !defined(_di_f_uint8s_decimate_by_)
-
#if !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8ss_append_)
extern f_status_t private_f_uint8s_append(const uint8_t source, f_uint8s_t * const destination) {
- if (destination->used + 1 > destination->size) {
- const f_status_t status = private_f_uint8s_resize(destination->used + F_memory_default_allocation_small_d, destination);
+ {
+ const f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(uint8_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
#if !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8s_append_all_) || !defined(_di_f_uint8ss_append_all_)
extern f_status_t private_f_uint8s_append_all(const f_uint8s_t source, f_uint8s_t * const destination) {
- if (destination->used + source.used > destination->size) {
- const f_status_t status = private_f_uint8s_resize(destination->used + source.used, destination);
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(uint8_t), (void **) &destination->array, &destination->used, &destination->size);
if (F_status_is_error(status)) return status;
}
}
#endif // !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8s_append_all_) || !defined(_di_f_uint8ss_append_all_)
-#if !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8s_append_all_) || !defined(_di_f_uint8s_decrease_by_) || !defined(_di_f_uint8s_increase_) || !defined(_di_f_uint8s_increase_by_) || !defined(_di_f_uint8s_resize_) || !defined(_di_f_uint8ss_append_) || !defined(_di_f_uint8ss_append_all_)
- f_status_t private_f_uint8s_resize(const f_number_unsigned_t length, f_uint8s_t * const uint8s) {
-
- const f_status_t status = f_memory_resize(uint8s->size, length, sizeof(uint8_t), (void **) & uint8s->array);
- if (F_status_is_error(status)) return status;
-
- uint8s->size = length;
-
- if (uint8s->used > uint8s->size) {
- uint8s->used = length;
- }
-
- return F_none;
- }
-#endif // !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8s_append_all_) || !defined(_di_f_uint8s_decrease_by_) || !defined(_di_f_uint8s_increase_) || !defined(_di_f_uint8s_increase_by_) || !defined(_di_f_uint8s_resize_) || !defined(_di_f_uint8ss_append_) || !defined(_di_f_uint8ss_append_all_)
-
#if !defined(_di_f_uint8ss_adjust_) || !defined(_di_f_uint8ss_decimate_by_)
- f_status_t private_f_uint8ss_adjust(const f_number_unsigned_t length, f_uint8ss_t * const uint8ss) {
+ f_status_t private_f_uint8ss_adjust(const f_number_unsigned_t length, f_uint8ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < uint8ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_destroy(uint8ss->array[i].size, sizeof(f_uint8s_t), (void **) & uint8ss->array[i].array);
+ status = f_memory_array_adjust(0, sizeof(uint8_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- uint8ss->array[i].size = 0;
- uint8ss->array[i].used = 0;
} // for
- status = f_memory_adjust(uint8ss->size, length, sizeof(f_uint8s_t), (void **) & uint8ss->array);
- if (F_status_is_error(status)) return status;
-
- uint8ss->size = length;
-
- if (uint8ss->used > uint8ss->size) {
- uint8ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_uint8s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_uint8ss_adjust_) || !defined(_di_f_uint8ss_decimate_by_)
#if !defined(_di_f_uint8ss_decrease_by_) || !defined(_di_f_uint8ss_increase_) || !defined(_di_f_uint8ss_increase_by_) || !defined(_di_f_uint8ss_resize_)
- f_status_t private_f_uint8ss_resize(const f_number_unsigned_t length, f_uint8ss_t * const uint8ss) {
+ f_status_t private_f_uint8ss_resize(const f_number_unsigned_t length, f_uint8ss_t * const structure) {
f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < uint8ss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < structure->size; ++i) {
- status = f_memory_delete(uint8ss->array[i].size, sizeof(f_uint8s_t), (void **) & uint8ss->array[i].array);
+ status = f_memory_array_resize(0, sizeof(uint8_t), (void **) &structure->array[i].array, &structure->array[i].used, &structure->array[i].size);
if (F_status_is_error(status)) return status;
-
- uint8ss->array[i].size = 0;
- uint8ss->array[i].used = 0;
} // for
- status = f_memory_resize(uint8ss->size, length, sizeof(f_uint8s_t), (void **) & uint8ss->array);
- if (F_status_is_error(status)) return status;
-
- uint8ss->size = length;
-
- if (uint8ss->used > uint8ss->size) {
- uint8ss->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_uint8s_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // !defined(_di_f_uint8ss_decrease_by_) || !defined(_di_f_uint8ss_increase_) || !defined(_di_f_uint8ss_increase_by_) || !defined(_di_f_uint8ss_resize_)
#endif
/**
- * Private implementation for resizing the uint8s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint8s
- * The uint8s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_adjust().
- *
- * @see f_uint8s_adjust()
- * @see f_uint8s_decimate_by()
- */
-#if !defined(_di_f_uint8s_adjust_) || !defined(_di_f_uint8s_decimate_by_)
- extern f_status_t private_f_uint8s_adjust(const f_number_unsigned_t length, f_uint8s_t * const uint8s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint8s_adjust_) || !defined(_di_f_uint8s_decimate_by_)
-
-/**
* Private implementation for appending the uint8 array.
*
* Intended to be shared to each of the different implementation variations.
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*
- * @see f_memory_resize()
* @see f_uint8s_append()
* @see f_uint8ss_append()
*/
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*
- * @see f_memory_resize()
* @see f_uint8s_append_all()
* @see f_uint8ss_append()
* @see f_uint8ss_append_all()
#endif // !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8s_append_all_) || !defined(_di_f_uint8ss_append_all_)
/**
- * Private implementation for resizing the uint8s array.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length
- * The length to adjust to.
- * @param uint8s
- * The uint8s array to adjust.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * Errors (with error bit) from: f_memory_resize().
- *
- * @see f_uint8s_append()
- * @see f_uint8s_append_all()
- * @see f_uint8s_decrease_by()
- * @see f_uint8s_increase()
- * @see f_uint8s_increase_by()
- * @see f_uint8s_resize()
- * @see f_uint8ss_append()
- * @see f_uint8ss_append_all()
- *
- */
-#if !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8s_append_all_) || !defined(_di_f_uint8s_decrease_by_) || !defined(_di_f_uint8s_increase_) || !defined(_di_f_uint8s_increase_by_) || !defined(_di_f_uint8s_resize_) || !defined(_di_f_uint8ss_append_) || !defined(_di_f_uint8ss_append_all_)
- extern f_status_t private_f_uint8s_resize(const f_number_unsigned_t length, f_uint8s_t * const uint8s) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_uint8s_append_) || !defined(_di_f_uint8s_append_all_) || !defined(_di_f_uint8s_decrease_by_) || !defined(_di_f_uint8s_increase_) || !defined(_di_f_uint8s_increase_by_) || !defined(_di_f_uint8s_resize_) || !defined(_di_f_uint8ss_append_) || !defined(_di_f_uint8ss_append_all_)
-
-/**
* Private implementation for resizing the uint8ss array.
*
* Intended to be shared to each of the different implementation variations.
*
* @param length
* The length to adjust to.
- * @param uint8ss
+ * @param structure
* The uint8ss array to adjust.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*
* @see f_uint8ss_adjust()
* @see f_uint8ss_decimate_by()
*/
#if !defined(_di_f_uint8ss_adjust_) || !defined(_di_f_uint8ss_decimate_by_)
- extern f_status_t private_f_uint8ss_adjust(const f_number_unsigned_t length, f_uint8ss_t * const uint8ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_uint8ss_adjust(const f_number_unsigned_t length, f_uint8ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_uint8ss_adjust_) || !defined(_di_f_uint8ss_decimate_by_)
/**
*
* @param length
* The length to resize to.
- * @param uint8ss
+ * @param structure
* The uint8ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
* @see f_uint8ss_decrease_by()
* @see f_uint8ss_increase()
* @see f_uint8ss_resize()
*/
#if !defined(_di_f_uint8ss_decrease_by_) || !defined(_di_f_uint8ss_increase_) || !defined(_di_f_uint8ss_increase_by_) || !defined(_di_f_uint8ss_resize_)
- extern f_status_t private_f_uint8ss_resize(const f_number_unsigned_t length, f_uint8ss_t * const uint8ss) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_uint8ss_resize(const f_number_unsigned_t length, f_uint8ss_t * const structure) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_uint8ss_decrease_by_) || !defined(_di_f_uint8ss_increase_) || !defined(_di_f_uint8ss_increase_by_) || !defined(_di_f_uint8ss_resize_)
#ifdef __cplusplus
#endif
#ifndef _di_f_states_adjust_
- f_status_t f_states_adjust(const f_number_unsigned_t length, f_states_t * const states) {
+ f_status_t f_states_adjust(const f_number_unsigned_t length, f_states_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!states) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_states_adjust(length, states);
+ return f_memory_array_adjust(length, sizeof(f_state_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_states_adjust_
#endif // _di_f_states_append_all_
#ifndef _di_f_states_decimate_by_
- f_status_t f_states_decimate_by(const f_number_unsigned_t amount, f_states_t * const states) {
+ f_status_t f_states_decimate_by(const f_number_unsigned_t amount, f_states_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!states) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (states->size - amount > 0) {
- return private_f_states_adjust(states->size - amount, states);
- }
-
- return private_f_states_adjust(0, states);
+ return f_memory_array_decimate_by(amount, sizeof(f_state_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_states_decimate_by_
#ifndef _di_f_states_decrease_by_
- f_status_t f_states_decrease_by(const f_number_unsigned_t amount, f_states_t * const states) {
+ f_status_t f_states_decrease_by(const f_number_unsigned_t amount, f_states_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!states) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (states->size - amount > 0) {
- return private_f_states_resize(states->size - amount, states);
- }
-
- return private_f_states_resize(0, states);
+ return f_memory_array_decrease_by(amount, sizeof(f_state_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_states_decrease_by_
#ifndef _di_f_states_increase_
- f_status_t f_states_increase(const f_number_unsigned_t step, f_states_t * const states) {
+ f_status_t f_states_increase(const f_number_unsigned_t step, f_states_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!states) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && states->used + 1 > states->size) {
- f_number_unsigned_t size = states->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (states->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_states_resize(size, states);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(f_state_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_states_increase_
#ifndef _di_f_states_increase_by_
- f_status_t f_states_increase_by(const f_number_unsigned_t amount, f_states_t * const states) {
+ f_status_t f_states_increase_by(const f_number_unsigned_t amount, f_states_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!states) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (states->used + amount > states->size) {
- if (states->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_states_resize(states->used + amount, states);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(f_state_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_states_increase_by_
#ifndef _di_f_states_resize_
- f_status_t f_states_resize(const f_number_unsigned_t length, f_states_t * const states) {
+ f_status_t f_states_resize(const f_number_unsigned_t length, f_states_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!states) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_states_resize(length, states);
+ return f_memory_array_resize(length, sizeof(f_state_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_states_resize_
#ifndef _di_f_statess_adjust_
- f_status_t f_statess_adjust(const f_number_unsigned_t length, f_statess_t * const statess) {
+ f_status_t f_statess_adjust(const f_number_unsigned_t length, f_statess_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!statess) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_statess_adjust(length, statess);
+ return private_f_statess_adjust(length, structure);
}
#endif // _di_f_statess_adjust_
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_statess_resize(destination->used + F_memory_default_allocation_small_d, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_states_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
status = private_f_states_append_all(source, &destination->array[destination->used]);
if (F_status_is_error(status)) return status;
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_statess_resize(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_states_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
#endif // _di_f_statess_append_all_
#ifndef _di_f_statess_decimate_by_
- f_status_t f_statess_decimate_by(const f_number_unsigned_t amount, f_statess_t * const statess) {
+ f_status_t f_statess_decimate_by(const f_number_unsigned_t amount, f_statess_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!statess) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (statess->size - amount > 0) {
- return private_f_statess_adjust(statess->size - amount, statess);
- }
-
- return private_f_statess_adjust(0, statess);
+ return private_f_statess_adjust((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_statess_decimate_by_
#ifndef _di_f_statess_decrease_by_
- f_status_t f_statess_decrease_by(const f_number_unsigned_t amount, f_statess_t * const statess) {
+ f_status_t f_statess_decrease_by(const f_number_unsigned_t amount, f_statess_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!statess) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (statess->size - amount > 0) {
- return private_f_statess_resize(statess->size - amount, statess);
- }
-
- return private_f_statess_resize(0, statess);
+ return private_f_statess_resize((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_statess_decrease_by_
#ifndef _di_f_statess_increase_
- f_status_t f_statess_increase(const f_number_unsigned_t step, f_statess_t * const statess) {
+ f_status_t f_statess_increase(const f_number_unsigned_t step, f_statess_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!statess) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && statess->used + 1 > statess->size) {
- f_number_unsigned_t size = statess->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (statess->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_statess_resize(size, statess);
+ return private_f_statess_resize(length, structure);
}
return F_data_not;
#endif // _di_f_statess_increase_
#ifndef _di_f_statess_increase_by_
- f_status_t f_statess_increase_by(const f_number_unsigned_t amount, f_statess_t * const statess) {
+ f_status_t f_statess_increase_by(const f_number_unsigned_t amount, f_statess_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!statess) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (statess->used + amount > statess->size) {
- if (statess->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = structure->used + amount;
- return private_f_statess_resize(statess->used + amount, statess);
+ if (length > structure->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_statess_resize(structure->used + amount, structure);
+ }
}
return F_data_not;
#endif // _di_f_statess_increase_by_
#ifndef _di_f_statess_resize_
- f_status_t f_statess_resize(const f_number_unsigned_t length, f_statess_t * const statess) {
+ f_status_t f_statess_resize(const f_number_unsigned_t length, f_statess_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!statess) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_statess_resize(length, statess);
+ return private_f_statess_resize(length, structure);
}
#endif // _di_f_statess_resize_
*
* @param length
* The new size to use.
- * @param states
+ * @param structure
* The string states array to resize.
*
* @return
*
* 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_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_states_adjust_
- extern f_status_t f_states_adjust(const f_number_unsigned_t length, f_states_t * const states);
+ extern f_status_t f_states_adjust(const f_number_unsigned_t length, f_states_t * const structure);
#endif // _di_f_states_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_states_append_
extern f_status_t f_states_append(const f_state_t source, f_states_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_states_append_all_
extern f_status_t f_states_append_all(const f_states_t source, f_states_t * const destination);
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param states
+ * @param structure
* The string states array to resize.
*
* @return
*
* 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_array_decimate_by().
+ *
+ * @see f_memory_array_decimate_by()
*/
#ifndef _di_f_states_decimate_by_
- extern f_status_t f_states_decimate_by(const f_number_unsigned_t amount, f_states_t * const states);
+ extern f_status_t f_states_decimate_by(const f_number_unsigned_t amount, f_states_t * const structure);
#endif // _di_f_states_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param states
+ * @param structure
* The string states array to resize.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_decrease_by().
+ *
+ * @see f_memory_array_decrease_by()
*/
#ifndef _di_f_states_decrease_by_
- extern f_status_t f_states_decrease_by(const f_number_unsigned_t amount, f_states_t * const states);
+ extern f_status_t f_states_decrease_by(const f_number_unsigned_t amount, f_states_t * const structure);
#endif // _di_f_states_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param states
+ * @param structure
* The string states array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_states_increase_
- extern f_status_t f_states_increase(const f_number_unsigned_t step, f_states_t * const states);
+ extern f_status_t f_states_increase(const f_number_unsigned_t step, f_states_t * const structure);
#endif // _di_f_states_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param states
+ * @param structure
* The string states array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_states_increase_by_
- extern f_status_t f_states_increase_by(const f_number_unsigned_t amount, f_states_t * const states);
+ extern f_status_t f_states_increase_by(const f_number_unsigned_t amount, f_states_t * const structure);
#endif // _di_f_states_increase_by_
/**
*
* @param length
* The new size to use.
- * @param states
+ * @param structure
* The string states array to adjust.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_states_resize_
- extern f_status_t f_states_resize(const f_number_unsigned_t length, f_states_t * const states);
+ extern f_status_t f_states_resize(const f_number_unsigned_t length, f_states_t * const structure);
#endif // _di_f_states_resize_
/**
*
* @param length
* The new size to use.
- * @param statess
+ * @param structure
* The string statess array to resize.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_statess_adjust_
- extern f_status_t f_statess_adjust(const f_number_unsigned_t length, f_statess_t * const statess);
+ extern f_status_t f_statess_adjust(const f_number_unsigned_t length, f_statess_t * const structure);
#endif // _di_f_statess_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_statess_append_
extern f_status_t f_statess_append(const f_states_t source, f_statess_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_statess_append_all_
extern f_status_t f_statess_append_all(const f_statess_t source, f_statess_t * const destination);
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param statess
+ * @param structure
* The string statess array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_statess_decimate_by_
- extern f_status_t f_statess_decimate_by(const f_number_unsigned_t amount, f_statess_t * const statess);
+ extern f_status_t f_statess_decimate_by(const f_number_unsigned_t amount, f_statess_t * const structure);
#endif // _di_f_statess_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param statess
+ * @param structure
* The string statess array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_delete().
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_statess_decrease_by_
- extern f_status_t f_statess_decrease_by(const f_number_unsigned_t amount, f_statess_t * const statess);
+ extern f_status_t f_statess_decrease_by(const f_number_unsigned_t amount, f_statess_t * const structure);
#endif // _di_f_statess_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param statess
+ * @param structure
* The string statess array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_statess_increase_
- extern f_status_t f_statess_increase(const f_number_unsigned_t step, f_statess_t * const statess);
+ extern f_status_t f_statess_increase(const f_number_unsigned_t step, f_statess_t * const structure);
#endif // _di_f_statess_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param statess
+ * @param structure
* The string statess array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_statess_increase_by_
- extern f_status_t f_statess_increase_by(const f_number_unsigned_t amount, f_statess_t * const statess);
+ extern f_status_t f_statess_increase_by(const f_number_unsigned_t amount, f_statess_t * const structure);
#endif // _di_f_statess_increase_by_
/**
*
* @param length
* The new size to use.
- * @param statess
+ * @param structure
* The string statess array to adjust.
*
* @return
*
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_statess_resize_
- extern f_status_t f_statess_resize(const f_number_unsigned_t length, f_statess_t * const statess);
+ extern f_status_t f_statess_resize(const f_number_unsigned_t length, f_statess_t * const structure);
#endif // _di_f_statess_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_statuss_adjust_
- f_status_t f_statuss_adjust(const f_number_unsigned_t length, f_statuss_t * const statuss) {
+ f_status_t f_statuss_adjust(const f_number_unsigned_t length, f_statuss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!statuss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_statuss_adjust(length, statuss);
+ return f_memory_array_adjust(length, sizeof(f_status_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_statuss_adjust_
#endif // _di_f_statuss_append_all_
#ifndef _di_f_statuss_decimate_by_
- f_status_t f_statuss_decimate_by(const f_number_unsigned_t amount, f_statuss_t * const statuss) {
+ f_status_t f_statuss_decimate_by(const f_number_unsigned_t amount, f_statuss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!statuss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (statuss->size - amount > 0) {
- return private_f_statuss_adjust(statuss->size - amount, statuss);
- }
-
- return private_f_statuss_adjust(0, statuss);
+ return f_memory_array_decimate_by(amount, sizeof(f_status_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_statuss_decimate_by_
#ifndef _di_f_statuss_decrease_by_
- f_status_t f_statuss_decrease_by(const f_number_unsigned_t amount, f_statuss_t * const statuss) {
+ f_status_t f_statuss_decrease_by(const f_number_unsigned_t amount, f_statuss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!statuss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (statuss->size - amount > 0) {
- return private_f_statuss_resize(statuss->size - amount, statuss);
- }
-
- return private_f_statuss_resize(0, statuss);
+ return f_memory_array_decrease_by(amount, sizeof(f_status_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_statuss_decrease_by_
#ifndef _di_f_statuss_increase_
- f_status_t f_statuss_increase(const f_number_unsigned_t step, f_statuss_t * const statuss) {
+ f_status_t f_statuss_increase(const f_number_unsigned_t step, f_statuss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!statuss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && statuss->used + 1 > statuss->size) {
- f_number_unsigned_t size = statuss->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (statuss->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_statuss_resize(size, statuss);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(f_status_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_statuss_increase_
#ifndef _di_f_statuss_increase_by_
- f_status_t f_statuss_increase_by(const f_number_unsigned_t amount, f_statuss_t * const statuss) {
+ f_status_t f_statuss_increase_by(const f_number_unsigned_t amount, f_statuss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!statuss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (statuss->used + amount > statuss->size) {
- if (statuss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_statuss_resize(statuss->used + amount, statuss);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(f_status_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_statuss_increase_by_
#ifndef _di_f_statuss_resize_
- f_status_t f_statuss_resize(const f_number_unsigned_t length, f_statuss_t * const statuss) {
+ f_status_t f_statuss_resize(const f_number_unsigned_t length, f_statuss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!statuss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_statuss_resize(length, statuss);
+ return f_memory_array_resize(length, sizeof(f_status_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_statuss_resize_
#ifndef _di_f_statusss_adjust_
- f_status_t f_statusss_adjust(const f_number_unsigned_t length, f_statusss_t * const statusss) {
+ f_status_t f_statusss_adjust(const f_number_unsigned_t length, f_statusss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!statusss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_statusss_adjust(length, statusss);
+ return private_f_statusss_adjust(length, structure);
}
#endif // _di_f_statusss_adjust_
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_statusss_resize(destination->used + F_memory_default_allocation_small_d, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_statuss_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
status = private_f_statuss_append_all(source, &destination->array[destination->used]);
if (F_status_is_error(status)) return status;
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_statusss_resize(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_statuss_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
#endif // _di_f_statusss_append_all_
#ifndef _di_f_statusss_decimate_by_
- f_status_t f_statusss_decimate_by(const f_number_unsigned_t amount, f_statusss_t * const statusss) {
+ f_status_t f_statusss_decimate_by(const f_number_unsigned_t amount, f_statusss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!statusss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (statusss->size - amount > 0) {
- return private_f_statusss_adjust(statusss->size - amount, statusss);
- }
-
- return private_f_statusss_adjust(0, statusss);
+ return private_f_statusss_adjust((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_statusss_decimate_by_
#ifndef _di_f_statusss_decrease_by_
- f_status_t f_statusss_decrease_by(const f_number_unsigned_t amount, f_statusss_t * const statusss) {
+ f_status_t f_statusss_decrease_by(const f_number_unsigned_t amount, f_statusss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!statusss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (statusss->size - amount > 0) {
- return private_f_statusss_resize(statusss->size - amount, statusss);
- }
-
- return private_f_statusss_resize(0, statusss);
+ return private_f_statusss_resize((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_statusss_decrease_by_
#ifndef _di_f_statusss_increase_
- f_status_t f_statusss_increase(const f_number_unsigned_t step, f_statusss_t * const statusss) {
+ f_status_t f_statusss_increase(const f_number_unsigned_t step, f_statusss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!statusss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && statusss->used + 1 > statusss->size) {
- f_number_unsigned_t size = statusss->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (statusss->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_statusss_resize(size, statusss);
+ return private_f_statusss_resize(length, structure);
}
return F_data_not;
#endif // _di_f_statusss_increase_
#ifndef _di_f_statusss_increase_by_
- f_status_t f_statusss_increase_by(const f_number_unsigned_t amount, f_statusss_t * const statusss) {
+ f_status_t f_statusss_increase_by(const f_number_unsigned_t amount, f_statusss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!statusss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (statusss->used + amount > statusss->size) {
- if (statusss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = structure->used + amount;
- return private_f_statusss_resize(statusss->used + amount, statusss);
+ if (length > structure->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_statusss_resize(structure->used + amount, structure);
+ }
}
return F_data_not;
#endif // _di_f_statusss_increase_by_
#ifndef _di_f_statusss_resize_
- f_status_t f_statusss_resize(const f_number_unsigned_t length, f_statusss_t * const statusss) {
+ f_status_t f_statusss_resize(const f_number_unsigned_t length, f_statusss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!statusss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_statusss_resize(length, statusss);
+ return private_f_statusss_resize(length, structure);
}
#endif // _di_f_statusss_resize_
*
* @param length
* The new size to use.
- * @param statuss
+ * @param structure
* The string statuss array to resize.
*
* @return
*
* 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_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_statuss_adjust_
- extern f_status_t f_statuss_adjust(const f_number_unsigned_t length, f_statuss_t * const statuss);
+ extern f_status_t f_statuss_adjust(const f_number_unsigned_t length, f_statuss_t * const structure);
#endif // _di_f_statuss_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_statuss_append_
extern f_status_t f_statuss_append(const f_status_t source, f_statuss_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_statuss_append_all_
extern f_status_t f_statuss_append_all(const f_statuss_t source, f_statuss_t * const destination);
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param statuss
+ * @param structure
* The string statuss array to resize.
*
* @return
*
* 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_array_decimate_by().
+ *
+ * @see f_memory_array_decimate_by()
*/
#ifndef _di_f_statuss_decimate_by_
- extern f_status_t f_statuss_decimate_by(const f_number_unsigned_t amount, f_statuss_t * const statuss);
+ extern f_status_t f_statuss_decimate_by(const f_number_unsigned_t amount, f_statuss_t * const structure);
#endif // _di_f_statuss_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param statuss
+ * @param structure
* The string statuss array to resize.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_decrease_by().
+ *
+ * @see f_memory_array_decrease_by()
*/
#ifndef _di_f_statuss_decrease_by_
- extern f_status_t f_statuss_decrease_by(const f_number_unsigned_t amount, f_statuss_t * const statuss);
+ extern f_status_t f_statuss_decrease_by(const f_number_unsigned_t amount, f_statuss_t * const structure);
#endif // _di_f_statuss_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param statuss
+ * @param structure
* The string statuss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_statuss_increase_
- extern f_status_t f_statuss_increase(const f_number_unsigned_t step, f_statuss_t * const statuss);
+ extern f_status_t f_statuss_increase(const f_number_unsigned_t step, f_statuss_t * const structure);
#endif // _di_f_statuss_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param statuss
+ * @param structure
* The string statuss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_statuss_increase_by_
- extern f_status_t f_statuss_increase_by(const f_number_unsigned_t amount, f_statuss_t * const statuss);
+ extern f_status_t f_statuss_increase_by(const f_number_unsigned_t amount, f_statuss_t * const structure);
#endif // _di_f_statuss_increase_by_
/**
*
* @param length
* The new size to use.
- * @param statuss
+ * @param structure
* The string statuss array to adjust.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_statuss_resize_
- extern f_status_t f_statuss_resize(const f_number_unsigned_t length, f_statuss_t * const statuss);
+ extern f_status_t f_statuss_resize(const f_number_unsigned_t length, f_statuss_t * const structure);
#endif // _di_f_statuss_resize_
/**
*
* @param length
* The new size to use.
- * @param statusss
+ * @param structure
* The string statusss array to resize.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_statusss_adjust_
- extern f_status_t f_statusss_adjust(const f_number_unsigned_t length, f_statusss_t * const statusss);
+ extern f_status_t f_statusss_adjust(const f_number_unsigned_t length, f_statusss_t * const structure);
#endif // _di_f_statusss_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_statusss_append_
extern f_status_t f_statusss_append(const f_statuss_t source, f_statusss_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_statusss_append_all_
extern f_status_t f_statusss_append_all(const f_statusss_t source, f_statusss_t * const destination);
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param statusss
+ * @param structure
* The string statusss array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_statusss_decimate_by_
- extern f_status_t f_statusss_decimate_by(const f_number_unsigned_t amount, f_statusss_t * const statusss);
+ extern f_status_t f_statusss_decimate_by(const f_number_unsigned_t amount, f_statusss_t * const structure);
#endif // _di_f_statusss_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param statusss
+ * @param structure
* The string statusss array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_delete().
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_statusss_decrease_by_
- extern f_status_t f_statusss_decrease_by(const f_number_unsigned_t amount, f_statusss_t * const statusss);
+ extern f_status_t f_statusss_decrease_by(const f_number_unsigned_t amount, f_statusss_t * const structure);
#endif // _di_f_statusss_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param statusss
+ * @param structure
* The string statusss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_statusss_increase_
- extern f_status_t f_statusss_increase(const f_number_unsigned_t step, f_statusss_t * const statusss);
+ extern f_status_t f_statusss_increase(const f_number_unsigned_t step, f_statusss_t * const structure);
#endif // _di_f_statusss_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param statusss
+ * @param structure
* The string statusss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_statusss_increase_by_
- extern f_status_t f_statusss_increase_by(const f_number_unsigned_t amount, f_statusss_t * const statusss);
+ extern f_status_t f_statusss_increase_by(const f_number_unsigned_t amount, f_statusss_t * const structure);
#endif // _di_f_statusss_increase_by_
/**
*
* @param length
* The new size to use.
- * @param statusss
+ * @param structure
* The string statusss array to adjust.
*
* @return
*
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_statusss_resize_
- extern f_status_t f_statusss_resize(const f_number_unsigned_t length, f_statusss_t * const statusss);
+ extern f_status_t f_statusss_resize(const f_number_unsigned_t length, f_statusss_t * const structure);
#endif // _di_f_statusss_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_uint128s_adjust_
- f_status_t f_uint128s_adjust(const f_number_unsigned_t length, f_uint128s_t * const uint128s) {
+ f_status_t f_uint128s_adjust(const f_number_unsigned_t length, f_uint128s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint128s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint128s_adjust(length, uint128s);
+ return f_memory_array_adjust(length, sizeof(uint128_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint128s_adjust_
#endif // _di_f_uint128s_append_all_
#ifndef _di_f_uint128s_decimate_by_
- f_status_t f_uint128s_decimate_by(const f_number_unsigned_t amount, f_uint128s_t * const uint128s) {
+ f_status_t f_uint128s_decimate_by(const f_number_unsigned_t amount, f_uint128s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint128s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (uint128s->size - amount > 0) {
- return private_f_uint128s_adjust(uint128s->size - amount, uint128s);
- }
-
- return private_f_uint128s_adjust(0, uint128s);
+ return f_memory_array_decimate_by(amount, sizeof(uint128_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint128s_decimate_by_
#ifndef _di_f_uint128s_decrease_by_
- f_status_t f_uint128s_decrease_by(const f_number_unsigned_t amount, f_uint128s_t * const uint128s) {
+ f_status_t f_uint128s_decrease_by(const f_number_unsigned_t amount, f_uint128s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint128s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (uint128s->size - amount > 0) {
- return private_f_uint128s_resize(uint128s->size - amount, uint128s);
- }
-
- return private_f_uint128s_resize(0, uint128s);
+ return f_memory_array_decrease_by(amount, sizeof(uint128_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint128s_decrease_by_
#ifndef _di_f_uint128s_increase_
- f_status_t f_uint128s_increase(const f_number_unsigned_t step, f_uint128s_t * const uint128s) {
+ f_status_t f_uint128s_increase(const f_number_unsigned_t step, f_uint128s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint128s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && uint128s->used + 1 > uint128s->size) {
- f_number_unsigned_t size = uint128s->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (uint128s->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_uint128s_resize(size, uint128s);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(uint128_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint128s_increase_
#ifndef _di_f_uint128s_increase_by_
- f_status_t f_uint128s_increase_by(const f_number_unsigned_t amount, f_uint128s_t * const uint128s) {
+ f_status_t f_uint128s_increase_by(const f_number_unsigned_t amount, f_uint128s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint128s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (uint128s->used + amount > uint128s->size) {
- if (uint128s->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_uint128s_resize(uint128s->used + amount, uint128s);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(uint128_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint128s_increase_by_
#ifndef _di_f_uint128s_resize_
- f_status_t f_uint128s_resize(const f_number_unsigned_t length, f_uint128s_t * const uint128s) {
+ f_status_t f_uint128s_resize(const f_number_unsigned_t length, f_uint128s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint128s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint128s_resize(length, uint128s);
+ return f_memory_array_resize(length, sizeof(uint128_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint128s_resize_
#ifndef _di_f_uint128ss_adjust_
- f_status_t f_uint128ss_adjust(const f_number_unsigned_t length, f_uint128ss_t * const uint128ss) {
+ f_status_t f_uint128ss_adjust(const f_number_unsigned_t length, f_uint128ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint128ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint128ss_adjust(length, uint128ss);
+ return private_f_uint128ss_adjust(length, structure);
}
#endif // _di_f_uint128ss_adjust_
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_uint128ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_uint128s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
status = private_f_uint128s_append_all(source, &destination->array[destination->used]);
if (F_status_is_error(status)) return status;
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_uint128ss_resize(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_uint128s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
#endif // _di_f_uint128ss_append_all_
#ifndef _di_f_uint128ss_decimate_by_
- f_status_t f_uint128ss_decimate_by(const f_number_unsigned_t amount, f_uint128ss_t * const uint128ss) {
+ f_status_t f_uint128ss_decimate_by(const f_number_unsigned_t amount, f_uint128ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint128ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (uint128ss->size - amount > 0) {
- return private_f_uint128ss_adjust(uint128ss->size - amount, uint128ss);
- }
-
- return private_f_uint128ss_adjust(0, uint128ss);
+ return private_f_uint128ss_adjust((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_uint128ss_decimate_by_
#ifndef _di_f_uint128ss_decrease_by_
- f_status_t f_uint128ss_decrease_by(const f_number_unsigned_t amount, f_uint128ss_t * const uint128ss) {
+ f_status_t f_uint128ss_decrease_by(const f_number_unsigned_t amount, f_uint128ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint128ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (uint128ss->size - amount > 0) {
- return private_f_uint128ss_resize(uint128ss->size - amount, uint128ss);
- }
-
- return private_f_uint128ss_resize(0, uint128ss);
+ return private_f_uint128ss_resize((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_uint128ss_decrease_by_
#ifndef _di_f_uint128ss_increase_
- f_status_t f_uint128ss_increase(const f_number_unsigned_t step, f_uint128ss_t * const uint128ss) {
+ f_status_t f_uint128ss_increase(const f_number_unsigned_t step, f_uint128ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint128ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && uint128ss->used + 1 > uint128ss->size) {
- f_number_unsigned_t size = uint128ss->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (uint128ss->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_uint128ss_resize(size, uint128ss);
+ return private_f_uint128ss_resize(length, structure);
}
return F_data_not;
#endif // _di_f_uint128ss_increase_
#ifndef _di_f_uint128ss_increase_by_
- f_status_t f_uint128ss_increase_by(const f_number_unsigned_t amount, f_uint128ss_t * const uint128ss) {
+ f_status_t f_uint128ss_increase_by(const f_number_unsigned_t amount, f_uint128ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint128ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (uint128ss->used + amount > uint128ss->size) {
- if (uint128ss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = structure->used + amount;
- return private_f_uint128ss_resize(uint128ss->used + amount, uint128ss);
+ if (length > structure->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_uint128ss_resize(structure->used + amount, structure);
+ }
}
return F_data_not;
#endif // _di_f_uint128ss_increase_by_
#ifndef _di_f_uint128ss_resize_
- f_status_t f_uint128ss_resize(const f_number_unsigned_t length, f_uint128ss_t * const uint128ss) {
+ f_status_t f_uint128ss_resize(const f_number_unsigned_t length, f_uint128ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint128ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint128ss_resize(length, uint128ss);
+ return private_f_uint128ss_resize(length, structure);
}
#endif // _di_f_uint128ss_resize_
*
* @param length
* The new size to use.
- * @param uint128s
+ * @param structure
* The string uint128s array to resize.
*
* @return
*
* 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_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_uint128s_adjust_
- extern f_status_t f_uint128s_adjust(const f_number_unsigned_t length, f_uint128s_t * const uint128s);
+ extern f_status_t f_uint128s_adjust(const f_number_unsigned_t length, f_uint128s_t * const structure);
#endif // _di_f_uint128s_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_uint128s_append_
extern f_status_t f_uint128s_append(const uint128_t source, f_uint128s_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint128s_append_all_
extern f_status_t f_uint128s_append_all(const f_uint128s_t source, f_uint128s_t * const destination);
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param uint128s
+ * @param structure
* The string uint128s array to resize.
*
* @return
*
* 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_array_decimate_by().
+ *
+ * @see f_memory_array_decimate_by()
*/
#ifndef _di_f_uint128s_decimate_by_
- extern f_status_t f_uint128s_decimate_by(const f_number_unsigned_t amount, f_uint128s_t * const uint128s);
+ extern f_status_t f_uint128s_decimate_by(const f_number_unsigned_t amount, f_uint128s_t * const structure);
#endif // _di_f_uint128s_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param uint128s
+ * @param structure
* The string uint128s array to resize.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_decrease_by().
+ *
+ * @see f_memory_array_decrease_by()
*/
#ifndef _di_f_uint128s_decrease_by_
- extern f_status_t f_uint128s_decrease_by(const f_number_unsigned_t amount, f_uint128s_t * const uint128s);
+ extern f_status_t f_uint128s_decrease_by(const f_number_unsigned_t amount, f_uint128s_t * const structure);
#endif // _di_f_uint128s_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param uint128s
+ * @param structure
* The string uint128s array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_uint128s_increase_
- extern f_status_t f_uint128s_increase(const f_number_unsigned_t step, f_uint128s_t * const uint128s);
+ extern f_status_t f_uint128s_increase(const f_number_unsigned_t step, f_uint128s_t * const structure);
#endif // _di_f_uint128s_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param uint128s
+ * @param structure
* The string uint128s array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint128s_increase_by_
- extern f_status_t f_uint128s_increase_by(const f_number_unsigned_t amount, f_uint128s_t * const uint128s);
+ extern f_status_t f_uint128s_increase_by(const f_number_unsigned_t amount, f_uint128s_t * const structure);
#endif // _di_f_uint128s_increase_by_
/**
*
* @param length
* The new size to use.
- * @param uint128s
+ * @param structure
* The string uint128s array to adjust.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint128s_resize_
- extern f_status_t f_uint128s_resize(const f_number_unsigned_t length, f_uint128s_t * const uint128s);
+ extern f_status_t f_uint128s_resize(const f_number_unsigned_t length, f_uint128s_t * const structure);
#endif // _di_f_uint128s_resize_
/**
*
* @param length
* The new size to use.
- * @param uint128ss
+ * @param structure
* The string uint128ss array to resize.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_uint128ss_adjust_
- extern f_status_t f_uint128ss_adjust(const f_number_unsigned_t length, f_uint128ss_t * const uint128ss);
+ extern f_status_t f_uint128ss_adjust(const f_number_unsigned_t length, f_uint128ss_t * const structure);
#endif // _di_f_uint128ss_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint128ss_append_
extern f_status_t f_uint128ss_append(const f_uint128s_t source, f_uint128ss_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint128ss_append_all_
extern f_status_t f_uint128ss_append_all(const f_uint128ss_t source, f_uint128ss_t * const destination);
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param uint128ss
+ * @param structure
* The string uint128ss array to resize.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_uint128ss_decimate_by_
- extern f_status_t f_uint128ss_decimate_by(const f_number_unsigned_t amount, f_uint128ss_t * const uint128ss);
+ extern f_status_t f_uint128ss_decimate_by(const f_number_unsigned_t amount, f_uint128ss_t * const structure);
#endif // _di_f_uint128ss_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param uint128ss
+ * @param structure
* The string uint128ss array to resize.
*
* @return
*
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint128ss_decrease_by_
- extern f_status_t f_uint128ss_decrease_by(const f_number_unsigned_t amount, f_uint128ss_t * const uint128ss);
+ extern f_status_t f_uint128ss_decrease_by(const f_number_unsigned_t amount, f_uint128ss_t * const structure);
#endif // _di_f_uint128ss_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param uint128ss
+ * @param structure
* The string uint128ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint128ss_increase_
- extern f_status_t f_uint128ss_increase(const f_number_unsigned_t step, f_uint128ss_t * const uint128ss);
+ extern f_status_t f_uint128ss_increase(const f_number_unsigned_t step, f_uint128ss_t * const structure);
#endif // _di_f_uint128ss_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param uint128ss
+ * @param structure
* The string uint128ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint128ss_increase_by_
- extern f_status_t f_uint128ss_increase_by(const f_number_unsigned_t amount, f_uint128ss_t * const uint128ss);
+ extern f_status_t f_uint128ss_increase_by(const f_number_unsigned_t amount, f_uint128ss_t * const structure);
#endif // _di_f_uint128ss_increase_by_
/**
*
* @param length
* The new size to use.
- * @param uint128ss
+ * @param structure
* The string uint128ss array to adjust.
*
* @return
*
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint128ss_resize_
- extern f_status_t f_uint128ss_resize(const f_number_unsigned_t length, f_uint128ss_t * const uint128ss);
+ extern f_status_t f_uint128ss_resize(const f_number_unsigned_t length, f_uint128ss_t * const structure);
#endif // _di_f_uint128ss_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_uint16s_adjust_
- f_status_t f_uint16s_adjust(const f_number_unsigned_t length, f_uint16s_t * const uint16s) {
+ f_status_t f_uint16s_adjust(const f_number_unsigned_t length, f_uint16s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint16s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint16s_adjust(length, uint16s);
+ return f_memory_array_adjust(length, sizeof(uint16_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint16s_adjust_
#endif // _di_f_uint16s_append_all_
#ifndef _di_f_uint16s_decimate_by_
- f_status_t f_uint16s_decimate_by(const f_number_unsigned_t amount, f_uint16s_t * const uint16s) {
+ f_status_t f_uint16s_decimate_by(const f_number_unsigned_t amount, f_uint16s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint16s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (uint16s->size - amount > 0) {
- return private_f_uint16s_adjust(uint16s->size - amount, uint16s);
- }
-
- return private_f_uint16s_adjust(0, uint16s);
+ return f_memory_array_decimate_by(amount, sizeof(uint16_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint16s_decimate_by_
#ifndef _di_f_uint16s_decrease_by_
- f_status_t f_uint16s_decrease_by(const f_number_unsigned_t amount, f_uint16s_t * const uint16s) {
+ f_status_t f_uint16s_decrease_by(const f_number_unsigned_t amount, f_uint16s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint16s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (uint16s->size - amount > 0) {
- return private_f_uint16s_resize(uint16s->size - amount, uint16s);
- }
-
- return private_f_uint16s_resize(0, uint16s);
+ return f_memory_array_decrease_by(amount, sizeof(uint16_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint16s_decrease_by_
#ifndef _di_f_uint16s_increase_
- f_status_t f_uint16s_increase(const f_number_unsigned_t step, f_uint16s_t * const uint16s) {
+ f_status_t f_uint16s_increase(const f_number_unsigned_t step, f_uint16s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint16s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && uint16s->used + 1 > uint16s->size) {
- f_number_unsigned_t size = uint16s->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (uint16s->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_uint16s_resize(size, uint16s);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(uint16_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint16s_increase_
#ifndef _di_f_uint16s_increase_by_
- f_status_t f_uint16s_increase_by(const f_number_unsigned_t amount, f_uint16s_t * const uint16s) {
+ f_status_t f_uint16s_increase_by(const f_number_unsigned_t amount, f_uint16s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint16s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (uint16s->used + amount > uint16s->size) {
- if (uint16s->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_uint16s_resize(uint16s->used + amount, uint16s);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(uint16_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint16s_increase_by_
#ifndef _di_f_uint16s_resize_
- f_status_t f_uint16s_resize(const f_number_unsigned_t length, f_uint16s_t * const uint16s) {
+ f_status_t f_uint16s_resize(const f_number_unsigned_t length, f_uint16s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint16s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint16s_resize(length, uint16s);
+ return f_memory_array_resize(length, sizeof(uint16_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint16s_resize_
#ifndef _di_f_uint16ss_adjust_
- f_status_t f_uint16ss_adjust(const f_number_unsigned_t length, f_uint16ss_t * const uint16ss) {
+ f_status_t f_uint16ss_adjust(const f_number_unsigned_t length, f_uint16ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint16ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint16ss_adjust(length, uint16ss);
+ return private_f_uint16ss_adjust(length, structure);
}
#endif // _di_f_uint16ss_adjust_
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_uint16ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_uint16s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
status = private_f_uint16s_append_all(source, &destination->array[destination->used]);
if (F_status_is_error(status)) return status;
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_uint16ss_resize(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_uint16s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
#endif // _di_f_uint16ss_append_all_
#ifndef _di_f_uint16ss_decimate_by_
- f_status_t f_uint16ss_decimate_by(const f_number_unsigned_t amount, f_uint16ss_t * const uint16ss) {
+ f_status_t f_uint16ss_decimate_by(const f_number_unsigned_t amount, f_uint16ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint16ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (uint16ss->size - amount > 0) {
- return private_f_uint16ss_adjust(uint16ss->size - amount, uint16ss);
- }
-
- return private_f_uint16ss_adjust(0, uint16ss);
+ return private_f_uint16ss_adjust((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_uint16ss_decimate_by_
#ifndef _di_f_uint16ss_decrease_by_
- f_status_t f_uint16ss_decrease_by(const f_number_unsigned_t amount, f_uint16ss_t * const uint16ss) {
+ f_status_t f_uint16ss_decrease_by(const f_number_unsigned_t amount, f_uint16ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint16ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (uint16ss->size - amount > 0) {
- return private_f_uint16ss_resize(uint16ss->size - amount, uint16ss);
- }
-
- return private_f_uint16ss_resize(0, uint16ss);
+ return private_f_uint16ss_resize((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_uint16ss_decrease_by_
#ifndef _di_f_uint16ss_increase_
- f_status_t f_uint16ss_increase(const f_number_unsigned_t step, f_uint16ss_t * const uint16ss) {
+ f_status_t f_uint16ss_increase(const f_number_unsigned_t step, f_uint16ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint16ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && uint16ss->used + 1 > uint16ss->size) {
- f_number_unsigned_t size = uint16ss->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (uint16ss->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_uint16ss_resize(size, uint16ss);
+ return private_f_uint16ss_resize(length, structure);
}
return F_data_not;
#endif // _di_f_uint16ss_increase_
#ifndef _di_f_uint16ss_increase_by_
- f_status_t f_uint16ss_increase_by(const f_number_unsigned_t amount, f_uint16ss_t * const uint16ss) {
+ f_status_t f_uint16ss_increase_by(const f_number_unsigned_t amount, f_uint16ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint16ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (uint16ss->used + amount > uint16ss->size) {
- if (uint16ss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = structure->used + amount;
- return private_f_uint16ss_resize(uint16ss->used + amount, uint16ss);
+ if (length > structure->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_uint16ss_resize(structure->used + amount, structure);
+ }
}
return F_data_not;
#endif // _di_f_uint16ss_increase_by_
#ifndef _di_f_uint16ss_resize_
- f_status_t f_uint16ss_resize(const f_number_unsigned_t length, f_uint16ss_t * const uint16ss) {
+ f_status_t f_uint16ss_resize(const f_number_unsigned_t length, f_uint16ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint16ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint16ss_resize(length, uint16ss);
+ return private_f_uint16ss_resize(length, structure);
}
#endif // _di_f_uint16ss_resize_
*
* @param length
* The new size to use.
- * @param uint16s
+ * @param structure
* The string uint16s array to resize.
*
* @return
*
* 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_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_uint16s_adjust_
- extern f_status_t f_uint16s_adjust(const f_number_unsigned_t length, f_uint16s_t * const uint16s);
+ extern f_status_t f_uint16s_adjust(const f_number_unsigned_t length, f_uint16s_t * const structure);
#endif // _di_f_uint16s_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_uint16s_append_
extern f_status_t f_uint16s_append(const uint16_t source, f_uint16s_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint16s_append_all_
extern f_status_t f_uint16s_append_all(const f_uint16s_t source, f_uint16s_t * const destination);
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param uint16s
+ * @param structure
* The string uint16s array to resize.
*
* @return
*
* 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_array_decimate_by().
+ *
+ * @see f_memory_array_decimate_by()
*/
#ifndef _di_f_uint16s_decimate_by_
- extern f_status_t f_uint16s_decimate_by(const f_number_unsigned_t amount, f_uint16s_t * const uint16s);
+ extern f_status_t f_uint16s_decimate_by(const f_number_unsigned_t amount, f_uint16s_t * const structure);
#endif // _di_f_uint16s_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param uint16s
+ * @param structure
* The string uint16s array to resize.
*
* @return
* F_none on success.
+ * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_decrease_by().
+ *
+ * @see f_memory_array_decrease_by()
*/
#ifndef _di_f_uint16s_decrease_by_
- extern f_status_t f_uint16s_decrease_by(const f_number_unsigned_t amount, f_uint16s_t * const uint16s);
+ extern f_status_t f_uint16s_decrease_by(const f_number_unsigned_t amount, f_uint16s_t * const structure);
#endif // _di_f_uint16s_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param uint16s
+ * @param structure
* The string uint16s array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_uint16s_increase_
- extern f_status_t f_uint16s_increase(const f_number_unsigned_t step, f_uint16s_t * const uint16s);
+ extern f_status_t f_uint16s_increase(const f_number_unsigned_t step, f_uint16s_t * const structure);
#endif // _di_f_uint16s_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param uint16s
+ * @param structure
* The string uint16s array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint16s_increase_by_
- extern f_status_t f_uint16s_increase_by(const f_number_unsigned_t amount, f_uint16s_t * const uint16s);
+ extern f_status_t f_uint16s_increase_by(const f_number_unsigned_t amount, f_uint16s_t * const structure);
#endif // _di_f_uint16s_increase_by_
/**
*
* @param length
* The new size to use.
- * @param uint16s
+ * @param structure
* The string uint16s array to adjust.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint16s_resize_
- extern f_status_t f_uint16s_resize(const f_number_unsigned_t length, f_uint16s_t * const uint16s);
+ extern f_status_t f_uint16s_resize(const f_number_unsigned_t length, f_uint16s_t * const structure);
#endif // _di_f_uint16s_resize_
/**
*
* @param length
* The new size to use.
- * @param uint16ss
+ * @param structure
* The string uint16ss array to resize.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_uint16ss_adjust_
- extern f_status_t f_uint16ss_adjust(const f_number_unsigned_t length, f_uint16ss_t * const uint16ss);
+ extern f_status_t f_uint16ss_adjust(const f_number_unsigned_t length, f_uint16ss_t * const structure);
#endif // _di_f_uint16ss_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint16ss_append_
extern f_status_t f_uint16ss_append(const f_uint16s_t source, f_uint16ss_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint16ss_append_all_
extern f_status_t f_uint16ss_append_all(const f_uint16ss_t source, f_uint16ss_t * const destination);
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param uint16ss
+ * @param structure
* The string uint16ss array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_uint16ss_decimate_by_
- extern f_status_t f_uint16ss_decimate_by(const f_number_unsigned_t amount, f_uint16ss_t * const uint16ss);
+ extern f_status_t f_uint16ss_decimate_by(const f_number_unsigned_t amount, f_uint16ss_t * const structure);
#endif // _di_f_uint16ss_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param uint16ss
+ * @param structure
* The string uint16ss array to resize.
*
* @return
*
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint16ss_decrease_by_
- extern f_status_t f_uint16ss_decrease_by(const f_number_unsigned_t amount, f_uint16ss_t * const uint16ss);
+ extern f_status_t f_uint16ss_decrease_by(const f_number_unsigned_t amount, f_uint16ss_t * const structure);
#endif // _di_f_uint16ss_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param uint16ss
+ * @param structure
* The string uint16ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint16ss_increase_
- extern f_status_t f_uint16ss_increase(const f_number_unsigned_t step, f_uint16ss_t * const uint16ss);
+ extern f_status_t f_uint16ss_increase(const f_number_unsigned_t step, f_uint16ss_t * const structure);
#endif // _di_f_uint16ss_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param uint16ss
+ * @param structure
* The string uint16ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint16ss_increase_by_
- extern f_status_t f_uint16ss_increase_by(const f_number_unsigned_t amount, f_uint16ss_t * const uint16ss);
+ extern f_status_t f_uint16ss_increase_by(const f_number_unsigned_t amount, f_uint16ss_t * const structure);
#endif // _di_f_uint16ss_increase_by_
/**
*
* @param length
* The new size to use.
- * @param uint16ss
+ * @param structure
* The string uint16ss array to adjust.
*
* @return
*
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint16ss_resize_
- extern f_status_t f_uint16ss_resize(const f_number_unsigned_t length, f_uint16ss_t * const uint16ss);
+ extern f_status_t f_uint16ss_resize(const f_number_unsigned_t length, f_uint16ss_t * const structure);
#endif // _di_f_uint16ss_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_uint32s_adjust_
- f_status_t f_uint32s_adjust(const f_number_unsigned_t length, f_uint32s_t * const uint32s) {
+ f_status_t f_uint32s_adjust(const f_number_unsigned_t length, f_uint32s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint32s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint32s_adjust(length, uint32s);
+ return f_memory_array_adjust(length, sizeof(uint32_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint32s_adjust_
#endif // _di_f_uint32s_append_all_
#ifndef _di_f_uint32s_decimate_by_
- f_status_t f_uint32s_decimate_by(const f_number_unsigned_t amount, f_uint32s_t * const uint32s) {
+ f_status_t f_uint32s_decimate_by(const f_number_unsigned_t amount, f_uint32s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint32s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (uint32s->size - amount > 0) {
- return private_f_uint32s_adjust(uint32s->size - amount, uint32s);
- }
-
- return private_f_uint32s_adjust(0, uint32s);
+ return f_memory_array_decimate_by(amount, sizeof(uint32_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint32s_decimate_by_
#ifndef _di_f_uint32s_decrease_by_
- f_status_t f_uint32s_decrease_by(const f_number_unsigned_t amount, f_uint32s_t * const uint32s) {
+ f_status_t f_uint32s_decrease_by(const f_number_unsigned_t amount, f_uint32s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint32s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (uint32s->size - amount > 0) {
- return private_f_uint32s_resize(uint32s->size - amount, uint32s);
- }
-
- return private_f_uint32s_resize(0, uint32s);
+ return f_memory_array_decrease_by(amount, sizeof(uint32_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint32s_decrease_by_
#ifndef _di_f_uint32s_increase_
- f_status_t f_uint32s_increase(const f_number_unsigned_t step, f_uint32s_t * const uint32s) {
+ f_status_t f_uint32s_increase(const f_number_unsigned_t step, f_uint32s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint32s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && uint32s->used + 1 > uint32s->size) {
- f_number_unsigned_t size = uint32s->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (uint32s->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_uint32s_resize(size, uint32s);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(uint32_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint32s_increase_
#ifndef _di_f_uint32s_increase_by_
- f_status_t f_uint32s_increase_by(const f_number_unsigned_t amount, f_uint32s_t * const uint32s) {
+ f_status_t f_uint32s_increase_by(const f_number_unsigned_t amount, f_uint32s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint32s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (uint32s->used + amount > uint32s->size) {
- if (uint32s->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_uint32s_resize(uint32s->used + amount, uint32s);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(uint32_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint32s_increase_by_
#ifndef _di_f_uint32s_resize_
- f_status_t f_uint32s_resize(const f_number_unsigned_t length, f_uint32s_t * const uint32s) {
+ f_status_t f_uint32s_resize(const f_number_unsigned_t length, f_uint32s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint32s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint32s_resize(length, uint32s);
+ return f_memory_array_resize(length, sizeof(uint32_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint32s_resize_
#ifndef _di_f_uint32ss_adjust_
- f_status_t f_uint32ss_adjust(const f_number_unsigned_t length, f_uint32ss_t * const uint32ss) {
+ f_status_t f_uint32ss_adjust(const f_number_unsigned_t length, f_uint32ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint32ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint32ss_adjust(length, uint32ss);
+ return private_f_uint32ss_adjust(length, structure);
}
#endif // _di_f_uint32ss_adjust_
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_uint32ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_uint32s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
status = private_f_uint32s_append_all(source, &destination->array[destination->used]);
if (F_status_is_error(status)) return status;
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_uint32ss_resize(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_uint32s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
#endif // _di_f_uint32ss_append_all_
#ifndef _di_f_uint32ss_decimate_by_
- f_status_t f_uint32ss_decimate_by(const f_number_unsigned_t amount, f_uint32ss_t * const uint32ss) {
+ f_status_t f_uint32ss_decimate_by(const f_number_unsigned_t amount, f_uint32ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint32ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (uint32ss->size - amount > 0) {
- return private_f_uint32ss_adjust(uint32ss->size - amount, uint32ss);
- }
-
- return private_f_uint32ss_adjust(0, uint32ss);
+ return private_f_uint32ss_adjust((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_uint32ss_decimate_by_
#ifndef _di_f_uint32ss_decrease_by_
- f_status_t f_uint32ss_decrease_by(const f_number_unsigned_t amount, f_uint32ss_t * const uint32ss) {
+ f_status_t f_uint32ss_decrease_by(const f_number_unsigned_t amount, f_uint32ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint32ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (uint32ss->size - amount > 0) {
- return private_f_uint32ss_resize(uint32ss->size - amount, uint32ss);
- }
-
- return private_f_uint32ss_resize(0, uint32ss);
+ return private_f_uint32ss_resize((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_uint32ss_decrease_by_
#ifndef _di_f_uint32ss_increase_
- f_status_t f_uint32ss_increase(const f_number_unsigned_t step, f_uint32ss_t * const uint32ss) {
+ f_status_t f_uint32ss_increase(const f_number_unsigned_t step, f_uint32ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint32ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && uint32ss->used + 1 > uint32ss->size) {
- f_number_unsigned_t size = uint32ss->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (uint32ss->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_uint32ss_resize(size, uint32ss);
+ return private_f_uint32ss_resize(length, structure);
}
return F_data_not;
#endif // _di_f_uint32ss_increase_
#ifndef _di_f_uint32ss_increase_by_
- f_status_t f_uint32ss_increase_by(const f_number_unsigned_t amount, f_uint32ss_t * const uint32ss) {
+ f_status_t f_uint32ss_increase_by(const f_number_unsigned_t amount, f_uint32ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint32ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (uint32ss->used + amount > uint32ss->size) {
- if (uint32ss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = structure->used + amount;
- return private_f_uint32ss_resize(uint32ss->used + amount, uint32ss);
+ if (length > structure->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_uint32ss_resize(structure->used + amount, structure);
+ }
}
return F_data_not;
#endif // _di_f_uint32ss_increase_by_
#ifndef _di_f_uint32ss_resize_
- f_status_t f_uint32ss_resize(const f_number_unsigned_t length, f_uint32ss_t * const uint32ss) {
+ f_status_t f_uint32ss_resize(const f_number_unsigned_t length, f_uint32ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint32ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint32ss_resize(length, uint32ss);
+ return private_f_uint32ss_resize(length, structure);
}
#endif // _di_f_uint32ss_resize_
*
* @param length
* The new size to use.
- * @param uint32s
+ * @param structure
* The string uint32s array to resize.
*
* @return
*
* 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_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_uint32s_adjust_
- extern f_status_t f_uint32s_adjust(const f_number_unsigned_t length, f_uint32s_t * const uint32s);
+ extern f_status_t f_uint32s_adjust(const f_number_unsigned_t length, f_uint32s_t * const structure);
#endif // _di_f_uint32s_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_uint32s_append_
extern f_status_t f_uint32s_append(const uint32_t source, f_uint32s_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint32s_append_all_
extern f_status_t f_uint32s_append_all(const f_uint32s_t source, f_uint32s_t * const destination);
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param uint32s
+ * @param structure
* The string uint32s array to resize.
*
* @return
*
* 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_array_decimate_by().
+ *
+ * @see f_memory_array_decimate_by()
*/
#ifndef _di_f_uint32s_decimate_by_
- extern f_status_t f_uint32s_decimate_by(const f_number_unsigned_t amount, f_uint32s_t * const uint32s);
+ extern f_status_t f_uint32s_decimate_by(const f_number_unsigned_t amount, f_uint32s_t * const structure);
#endif // _di_f_uint32s_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param uint32s
+ * @param structure
* The string uint32s array to resize.
*
* @return
* F_none on success.
+ * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_decrease_by().
+ *
+ * @see f_memory_array_decrease_by()
*/
#ifndef _di_f_uint32s_decrease_by_
- extern f_status_t f_uint32s_decrease_by(const f_number_unsigned_t amount, f_uint32s_t * const uint32s);
+ extern f_status_t f_uint32s_decrease_by(const f_number_unsigned_t amount, f_uint32s_t * const structure);
#endif // _di_f_uint32s_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param uint32s
+ * @param structure
* The string uint32s array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_uint32s_increase_
- extern f_status_t f_uint32s_increase(const f_number_unsigned_t step, f_uint32s_t * const uint32s);
+ extern f_status_t f_uint32s_increase(const f_number_unsigned_t step, f_uint32s_t * const structure);
#endif // _di_f_uint32s_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param uint32s
+ * @param structure
* The string uint32s array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint32s_increase_by_
- extern f_status_t f_uint32s_increase_by(const f_number_unsigned_t amount, f_uint32s_t * const uint32s);
+ extern f_status_t f_uint32s_increase_by(const f_number_unsigned_t amount, f_uint32s_t * const structure);
#endif // _di_f_uint32s_increase_by_
/**
*
* @param length
* The new size to use.
- * @param uint32s
+ * @param structure
* The string uint32s array to adjust.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint32s_resize_
- extern f_status_t f_uint32s_resize(const f_number_unsigned_t length, f_uint32s_t * const uint32s);
+ extern f_status_t f_uint32s_resize(const f_number_unsigned_t length, f_uint32s_t * const structure);
#endif // _di_f_uint32s_resize_
/**
*
* @param length
* The new size to use.
- * @param uint32ss
+ * @param structure
* The string uint32ss array to resize.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_uint32ss_adjust_
- extern f_status_t f_uint32ss_adjust(const f_number_unsigned_t length, f_uint32ss_t * const uint32ss);
+ extern f_status_t f_uint32ss_adjust(const f_number_unsigned_t length, f_uint32ss_t * const structure);
#endif // _di_f_uint32ss_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint32ss_append_
extern f_status_t f_uint32ss_append(const f_uint32s_t source, f_uint32ss_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint32ss_append_all_
extern f_status_t f_uint32ss_append_all(const f_uint32ss_t source, f_uint32ss_t * const destination);
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param uint32ss
+ * @param structure
* The string uint32ss array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_uint32ss_decimate_by_
- extern f_status_t f_uint32ss_decimate_by(const f_number_unsigned_t amount, f_uint32ss_t * const uint32ss);
+ extern f_status_t f_uint32ss_decimate_by(const f_number_unsigned_t amount, f_uint32ss_t * const structure);
#endif // _di_f_uint32ss_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param uint32ss
+ * @param structure
* The string uint32ss array to resize.
*
* @return
*
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint32ss_decrease_by_
- extern f_status_t f_uint32ss_decrease_by(const f_number_unsigned_t amount, f_uint32ss_t * const uint32ss);
+ extern f_status_t f_uint32ss_decrease_by(const f_number_unsigned_t amount, f_uint32ss_t * const structure);
#endif // _di_f_uint32ss_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param uint32ss
+ * @param structure
* The string uint32ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint32ss_increase_
- extern f_status_t f_uint32ss_increase(const f_number_unsigned_t step, f_uint32ss_t * const uint32ss);
+ extern f_status_t f_uint32ss_increase(const f_number_unsigned_t step, f_uint32ss_t * const structure);
#endif // _di_f_uint32ss_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param uint32ss
+ * @param structure
* The string uint32ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint32ss_increase_by_
- extern f_status_t f_uint32ss_increase_by(const f_number_unsigned_t amount, f_uint32ss_t * const uint32ss);
+ extern f_status_t f_uint32ss_increase_by(const f_number_unsigned_t amount, f_uint32ss_t * const structure);
#endif // _di_f_uint32ss_increase_by_
/**
*
* @param length
* The new size to use.
- * @param uint32ss
+ * @param structure
* The string uint32ss array to adjust.
*
* @return
*
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint32ss_resize_
- extern f_status_t f_uint32ss_resize(const f_number_unsigned_t length, f_uint32ss_t * const uint32ss);
+ extern f_status_t f_uint32ss_resize(const f_number_unsigned_t length, f_uint32ss_t * const structure);
#endif // _di_f_uint32ss_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_uint64s_adjust_
- f_status_t f_uint64s_adjust(const f_number_unsigned_t length, f_uint64s_t * const uint64s) {
+ f_status_t f_uint64s_adjust(const f_number_unsigned_t length, f_uint64s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint64s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint64s_adjust(length, uint64s);
+ return f_memory_array_adjust(length, sizeof(uint64_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint64s_adjust_
#endif // _di_f_uint64s_append_all_
#ifndef _di_f_uint64s_decimate_by_
- f_status_t f_uint64s_decimate_by(const f_number_unsigned_t amount, f_uint64s_t * const uint64s) {
+ f_status_t f_uint64s_decimate_by(const f_number_unsigned_t amount, f_uint64s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint64s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (uint64s->size - amount > 0) {
- return private_f_uint64s_adjust(uint64s->size - amount, uint64s);
- }
-
- return private_f_uint64s_adjust(0, uint64s);
+ return f_memory_array_decimate_by(amount, sizeof(uint64_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint64s_decimate_by_
#ifndef _di_f_uint64s_decrease_by_
- f_status_t f_uint64s_decrease_by(const f_number_unsigned_t amount, f_uint64s_t * const uint64s) {
+ f_status_t f_uint64s_decrease_by(const f_number_unsigned_t amount, f_uint64s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint64s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (uint64s->size - amount > 0) {
- return private_f_uint64s_resize(uint64s->size - amount, uint64s);
- }
-
- return private_f_uint64s_resize(0, uint64s);
+ return f_memory_array_decrease_by(amount, sizeof(uint64_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint64s_decrease_by_
#ifndef _di_f_uint64s_increase_
- f_status_t f_uint64s_increase(const f_number_unsigned_t step, f_uint64s_t * const uint64s) {
+ f_status_t f_uint64s_increase(const f_number_unsigned_t step, f_uint64s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint64s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && uint64s->used + 1 > uint64s->size) {
- f_number_unsigned_t size = uint64s->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (uint64s->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_uint64s_resize(size, uint64s);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(uint64_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint64s_increase_
#ifndef _di_f_uint64s_increase_by_
- f_status_t f_uint64s_increase_by(const f_number_unsigned_t amount, f_uint64s_t * const uint64s) {
+ f_status_t f_uint64s_increase_by(const f_number_unsigned_t amount, f_uint64s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint64s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (uint64s->used + amount > uint64s->size) {
- if (uint64s->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_uint64s_resize(uint64s->used + amount, uint64s);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(uint64_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint64s_increase_by_
#ifndef _di_f_uint64s_resize_
- f_status_t f_uint64s_resize(const f_number_unsigned_t length, f_uint64s_t * const uint64s) {
+ f_status_t f_uint64s_resize(const f_number_unsigned_t length, f_uint64s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint64s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint64s_resize(length, uint64s);
+ return f_memory_array_resize(length, sizeof(uint64_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint64s_resize_
#ifndef _di_f_uint64ss_adjust_
- f_status_t f_uint64ss_adjust(const f_number_unsigned_t length, f_uint64ss_t * const uint64ss) {
+ f_status_t f_uint64ss_adjust(const f_number_unsigned_t length, f_uint64ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint64ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint64ss_adjust(length, uint64ss);
+ return private_f_uint64ss_adjust(length, structure);
}
#endif // _di_f_uint64ss_adjust_
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_uint64ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_uint64s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
status = private_f_uint64s_append_all(source, &destination->array[destination->used]);
if (F_status_is_error(status)) return status;
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_uint64ss_resize(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_uint64s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
#endif // _di_f_uint64ss_append_all_
#ifndef _di_f_uint64ss_decimate_by_
- f_status_t f_uint64ss_decimate_by(const f_number_unsigned_t amount, f_uint64ss_t * const uint64ss) {
+ f_status_t f_uint64ss_decimate_by(const f_number_unsigned_t amount, f_uint64ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint64ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (uint64ss->size - amount > 0) {
- return private_f_uint64ss_adjust(uint64ss->size - amount, uint64ss);
- }
-
- return private_f_uint64ss_adjust(0, uint64ss);
+ return private_f_uint64ss_adjust((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_uint64ss_decimate_by_
#ifndef _di_f_uint64ss_decrease_by_
- f_status_t f_uint64ss_decrease_by(const f_number_unsigned_t amount, f_uint64ss_t * const uint64ss) {
+ f_status_t f_uint64ss_decrease_by(const f_number_unsigned_t amount, f_uint64ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint64ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (uint64ss->size - amount > 0) {
- return private_f_uint64ss_resize(uint64ss->size - amount, uint64ss);
- }
-
- return private_f_uint64ss_resize(0, uint64ss);
+ return private_f_uint64ss_resize((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_uint64ss_decrease_by_
#ifndef _di_f_uint64ss_increase_
- f_status_t f_uint64ss_increase(const f_number_unsigned_t step, f_uint64ss_t * const uint64ss) {
+ f_status_t f_uint64ss_increase(const f_number_unsigned_t step, f_uint64ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint64ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && uint64ss->used + 1 > uint64ss->size) {
- f_number_unsigned_t size = uint64ss->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (uint64ss->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_uint64ss_resize(size, uint64ss);
+ return private_f_uint64ss_resize(length, structure);
}
return F_data_not;
#endif // _di_f_uint64ss_increase_
#ifndef _di_f_uint64ss_increase_by_
- f_status_t f_uint64ss_increase_by(const f_number_unsigned_t amount, f_uint64ss_t * const uint64ss) {
+ f_status_t f_uint64ss_increase_by(const f_number_unsigned_t amount, f_uint64ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint64ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (uint64ss->used + amount > uint64ss->size) {
- if (uint64ss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = structure->used + amount;
- return private_f_uint64ss_resize(uint64ss->used + amount, uint64ss);
+ if (length > structure->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_uint64ss_resize(structure->used + amount, structure);
+ }
}
return F_data_not;
#endif // _di_f_uint64ss_increase_by_
#ifndef _di_f_uint64ss_resize_
- f_status_t f_uint64ss_resize(const f_number_unsigned_t length, f_uint64ss_t * const uint64ss) {
+ f_status_t f_uint64ss_resize(const f_number_unsigned_t length, f_uint64ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint64ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint64ss_resize(length, uint64ss);
+ return private_f_uint64ss_resize(length, structure);
}
#endif // _di_f_uint64ss_resize_
*
* @param length
* The new size to use.
- * @param uint64s
+ * @param structure
* The string uint64s array to resize.
*
* @return
*
* 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_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_uint64s_adjust_
- extern f_status_t f_uint64s_adjust(const f_number_unsigned_t length, f_uint64s_t * const uint64s);
+ extern f_status_t f_uint64s_adjust(const f_number_unsigned_t length, f_uint64s_t * const structure);
#endif // _di_f_uint64s_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_uint64s_append_
extern f_status_t f_uint64s_append(const uint64_t source, f_uint64s_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint64s_append_all_
extern f_status_t f_uint64s_append_all(const f_uint64s_t source, f_uint64s_t * const destination);
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param uint64s
+ * @param structure
* The string uint64s array to resize.
*
* @return
*
* 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_array_decimate_by().
+ *
+ * @see f_memory_array_decimate_by()
*/
#ifndef _di_f_uint64s_decimate_by_
- extern f_status_t f_uint64s_decimate_by(const f_number_unsigned_t amount, f_uint64s_t * const uint64s);
+ extern f_status_t f_uint64s_decimate_by(const f_number_unsigned_t amount, f_uint64s_t * const structure);
#endif // _di_f_uint64s_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param uint64s
+ * @param structure
* The string uint64s array to resize.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_decrease_by().
+ *
+ * @see f_memory_array_decrease_by()
*/
#ifndef _di_f_uint64s_decrease_by_
- extern f_status_t f_uint64s_decrease_by(const f_number_unsigned_t amount, f_uint64s_t * const uint64s);
+ extern f_status_t f_uint64s_decrease_by(const f_number_unsigned_t amount, f_uint64s_t * const structure);
#endif // _di_f_uint64s_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param uint64s
+ * @param structure
* The string uint64s array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_uint64s_increase_
- extern f_status_t f_uint64s_increase(const f_number_unsigned_t step, f_uint64s_t * const uint64s);
+ extern f_status_t f_uint64s_increase(const f_number_unsigned_t step, f_uint64s_t * const structure);
#endif // _di_f_uint64s_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param uint64s
+ * @param structure
* The string uint64s array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint64s_increase_by_
- extern f_status_t f_uint64s_increase_by(const f_number_unsigned_t amount, f_uint64s_t * const uint64s);
+ extern f_status_t f_uint64s_increase_by(const f_number_unsigned_t amount, f_uint64s_t * const structure);
#endif // _di_f_uint64s_increase_by_
/**
*
* @param length
* The new size to use.
- * @param uint64s
+ * @param structure
* The string uint64s array to adjust.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint64s_resize_
- extern f_status_t f_uint64s_resize(const f_number_unsigned_t length, f_uint64s_t * const uint64s);
+ extern f_status_t f_uint64s_resize(const f_number_unsigned_t length, f_uint64s_t * const structure);
#endif // _di_f_uint64s_resize_
/**
*
* @param length
* The new size to use.
- * @param uint64ss
+ * @param structure
* The string uint64ss array to resize.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_uint64ss_adjust_
- extern f_status_t f_uint64ss_adjust(const f_number_unsigned_t length, f_uint64ss_t * const uint64ss);
+ extern f_status_t f_uint64ss_adjust(const f_number_unsigned_t length, f_uint64ss_t * const structure);
#endif // _di_f_uint64ss_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint64ss_append_
extern f_status_t f_uint64ss_append(const f_uint64s_t source, f_uint64ss_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint64ss_append_all_
extern f_status_t f_uint64ss_append_all(const f_uint64ss_t source, f_uint64ss_t * const destination);
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param uint64ss
+ * @param structure
* The string uint64ss array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_uint64ss_decimate_by_
- extern f_status_t f_uint64ss_decimate_by(const f_number_unsigned_t amount, f_uint64ss_t * const uint64ss);
+ extern f_status_t f_uint64ss_decimate_by(const f_number_unsigned_t amount, f_uint64ss_t * const structure);
#endif // _di_f_uint64ss_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param uint64ss
+ * @param structure
* The string uint64ss array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_delete().
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint64ss_decrease_by_
- extern f_status_t f_uint64ss_decrease_by(const f_number_unsigned_t amount, f_uint64ss_t * const uint64ss);
+ extern f_status_t f_uint64ss_decrease_by(const f_number_unsigned_t amount, f_uint64ss_t * const structure);
#endif // _di_f_uint64ss_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param uint64ss
+ * @param structure
* The string uint64ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint64ss_increase_
- extern f_status_t f_uint64ss_increase(const f_number_unsigned_t step, f_uint64ss_t * const uint64ss);
+ extern f_status_t f_uint64ss_increase(const f_number_unsigned_t step, f_uint64ss_t * const structure);
#endif // _di_f_uint64ss_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param uint64ss
+ * @param structure
* The string uint64ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint64ss_increase_by_
- extern f_status_t f_uint64ss_increase_by(const f_number_unsigned_t amount, f_uint64ss_t * const uint64ss);
+ extern f_status_t f_uint64ss_increase_by(const f_number_unsigned_t amount, f_uint64ss_t * const structure);
#endif // _di_f_uint64ss_increase_by_
/**
*
* @param length
* The new size to use.
- * @param uint64ss
+ * @param structure
* The string uint64ss array to adjust.
*
* @return
*
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint64ss_resize_
- extern f_status_t f_uint64ss_resize(const f_number_unsigned_t length, f_uint64ss_t * const uint64ss);
+ extern f_status_t f_uint64ss_resize(const f_number_unsigned_t length, f_uint64ss_t * const structure);
#endif // _di_f_uint64ss_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_uint8s_adjust_
- f_status_t f_uint8s_adjust(const f_number_unsigned_t length, f_uint8s_t * const uint8s) {
+ f_status_t f_uint8s_adjust(const f_number_unsigned_t length, f_uint8s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint8s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint8s_adjust(length, uint8s);
+ return f_memory_array_adjust(length, sizeof(uint8_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint8s_adjust_
#endif // _di_f_uint8s_append_all_
#ifndef _di_f_uint8s_decimate_by_
- f_status_t f_uint8s_decimate_by(const f_number_unsigned_t amount, f_uint8s_t * const uint8s) {
+ f_status_t f_uint8s_decimate_by(const f_number_unsigned_t amount, f_uint8s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint8s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (uint8s->size - amount > 0) {
- return private_f_uint8s_adjust(uint8s->size - amount, uint8s);
- }
-
- return private_f_uint8s_adjust(0, uint8s);
+ return f_memory_array_decimate_by(amount, sizeof(uint8_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint8s_decimate_by_
#ifndef _di_f_uint8s_decrease_by_
- f_status_t f_uint8s_decrease_by(const f_number_unsigned_t amount, f_uint8s_t * const uint8s) {
+ f_status_t f_uint8s_decrease_by(const f_number_unsigned_t amount, f_uint8s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint8s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (uint8s->size - amount > 0) {
- return private_f_uint8s_resize(uint8s->size - amount, uint8s);
- }
-
- return private_f_uint8s_resize(0, uint8s);
+ return f_memory_array_decrease_by(amount, sizeof(uint8_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint8s_decrease_by_
#ifndef _di_f_uint8s_increase_
- f_status_t f_uint8s_increase(const f_number_unsigned_t step, f_uint8s_t * const uint8s) {
+ f_status_t f_uint8s_increase(const f_number_unsigned_t step, f_uint8s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint8s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && uint8s->used + 1 > uint8s->size) {
- f_number_unsigned_t size = uint8s->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (uint8s->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_uint8s_resize(size, uint8s);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(uint8_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint8s_increase_
#ifndef _di_f_uint8s_increase_by_
- f_status_t f_uint8s_increase_by(const f_number_unsigned_t amount, f_uint8s_t * const uint8s) {
+ f_status_t f_uint8s_increase_by(const f_number_unsigned_t amount, f_uint8s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint8s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (uint8s->used + amount > uint8s->size) {
- if (uint8s->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
-
- return private_f_uint8s_resize(uint8s->used + amount, uint8s);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(uint8_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint8s_increase_by_
#ifndef _di_f_uint8s_resize_
- f_status_t f_uint8s_resize(const f_number_unsigned_t length, f_uint8s_t * const uint8s) {
+ f_status_t f_uint8s_resize(const f_number_unsigned_t length, f_uint8s_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint8s) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint8s_resize(length, uint8s);
+ return f_memory_array_resize(length, sizeof(uint8_t), (void **) &structure->array, &structure->used, &structure->size);
}
#endif // _di_f_uint8s_resize_
#ifndef _di_f_uint8ss_adjust_
- f_status_t f_uint8ss_adjust(const f_number_unsigned_t length, f_uint8ss_t * const uint8ss) {
+ f_status_t f_uint8ss_adjust(const f_number_unsigned_t length, f_uint8ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint8ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint8ss_adjust(length, uint8ss);
+ return private_f_uint8ss_adjust(length, structure);
}
#endif // _di_f_uint8ss_adjust_
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + 1 > destination->size) {
- status = private_f_uint8ss_resize(destination->used + F_memory_default_allocation_small_d, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_uint8s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
status = private_f_uint8s_append_all(source, &destination->array[destination->used]);
if (F_status_is_error(status)) return status;
if (!source.used) return F_data_not;
- f_status_t status = F_none;
-
- if (destination->used + source.used > destination->size) {
- status = private_f_uint8ss_resize(destination->used + source.used, destination);
- if (F_status_is_error(status)) return status;
- }
+ f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_uint8s_t), (void **) &destination->array, &destination->used, &destination->size);
+ if (F_status_is_error(status)) return status;
for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) {
#endif // _di_f_uint8ss_append_all_
#ifndef _di_f_uint8ss_decimate_by_
- f_status_t f_uint8ss_decimate_by(const f_number_unsigned_t amount, f_uint8ss_t * const uint8ss) {
+ f_status_t f_uint8ss_decimate_by(const f_number_unsigned_t amount, f_uint8ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint8ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (uint8ss->size - amount > 0) {
- return private_f_uint8ss_adjust(uint8ss->size - amount, uint8ss);
- }
-
- return private_f_uint8ss_adjust(0, uint8ss);
+ return private_f_uint8ss_adjust((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_uint8ss_decimate_by_
#ifndef _di_f_uint8ss_decrease_by_
- f_status_t f_uint8ss_decrease_by(const f_number_unsigned_t amount, f_uint8ss_t * const uint8ss) {
+ f_status_t f_uint8ss_decrease_by(const f_number_unsigned_t amount, f_uint8ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint8ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (uint8ss->size - amount > 0) {
- return private_f_uint8ss_resize(uint8ss->size - amount, uint8ss);
- }
-
- return private_f_uint8ss_resize(0, uint8ss);
+ return private_f_uint8ss_resize((structure->size - amount > 0) ? structure->size - amount : 0, structure);
}
#endif // _di_f_uint8ss_decrease_by_
#ifndef _di_f_uint8ss_increase_
- f_status_t f_uint8ss_increase(const f_number_unsigned_t step, f_uint8ss_t * const uint8ss) {
+ f_status_t f_uint8ss_increase(const f_number_unsigned_t step, f_uint8ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint8ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && uint8ss->used + 1 > uint8ss->size) {
- f_number_unsigned_t size = uint8ss->used + step;
+ if (step && structure->used + 1 > structure->size) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ f_number_unsigned_t length = structure->used + step;
- if (size > F_number_t_size_unsigned_d) {
- if (uint8ss->used + 1 > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (length > F_number_t_size_unsigned_d) {
+ if (structure->used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_uint8ss_resize(size, uint8ss);
+ return private_f_uint8ss_resize(length, structure);
}
return F_data_not;
#endif // _di_f_uint8ss_increase_
#ifndef _di_f_uint8ss_increase_by_
- f_status_t f_uint8ss_increase_by(const f_number_unsigned_t amount, f_uint8ss_t * const uint8ss) {
+ f_status_t f_uint8ss_increase_by(const f_number_unsigned_t amount, f_uint8ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint8ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (structure->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (uint8ss->used + amount > uint8ss->size) {
- if (uint8ss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = structure->used + amount;
- return private_f_uint8ss_resize(uint8ss->used + amount, uint8ss);
+ if (length > structure->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_uint8ss_resize(structure->used + amount, structure);
+ }
}
return F_data_not;
#endif // _di_f_uint8ss_increase_by_
#ifndef _di_f_uint8ss_resize_
- f_status_t f_uint8ss_resize(const f_number_unsigned_t length, f_uint8ss_t * const uint8ss) {
+ f_status_t f_uint8ss_resize(const f_number_unsigned_t length, f_uint8ss_t * const structure) {
#ifndef _di_level_0_parameter_checking_
- if (!uint8ss) return F_status_set_error(F_parameter);
+ if (!structure) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_uint8ss_resize(length, uint8ss);
+ return private_f_uint8ss_resize(length, structure);
}
#endif // _di_f_uint8ss_resize_
*
* @param length
* The new size to use.
- * @param uint8s
+ * @param structure
* The string uint8s array to resize.
*
* @return
*
* 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_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_uint8s_adjust_
- extern f_status_t f_uint8s_adjust(const f_number_unsigned_t length, f_uint8s_t * const uint8s);
+ extern f_status_t f_uint8s_adjust(const f_number_unsigned_t length, f_uint8s_t * const structure);
#endif // _di_f_uint8s_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_uint8s_append_
extern f_status_t f_uint8s_append(const uint8_t source, f_uint8s_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint8s_append_all_
extern f_status_t f_uint8s_append_all(const f_uint8s_t source, f_uint8s_t * const destination);
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param uint8s
+ * @param structure
* The string uint8s array to resize.
*
* @return
*
* 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_array_decimate_by().
+ *
+ * @see f_memory_array_decimate_by()
*/
#ifndef _di_f_uint8s_decimate_by_
- extern f_status_t f_uint8s_decimate_by(const f_number_unsigned_t amount, f_uint8s_t * const uint8s);
+ extern f_status_t f_uint8s_decimate_by(const f_number_unsigned_t amount, f_uint8s_t * const structure);
#endif // _di_f_uint8s_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param uint8s
+ * @param structure
* The string uint8s array to resize.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_decrease_by().
+ *
+ * @see f_memory_array_decrease_by()
*/
#ifndef _di_f_uint8s_decrease_by_
- extern f_status_t f_uint8s_decrease_by(const f_number_unsigned_t amount, f_uint8s_t * const uint8s);
+ extern f_status_t f_uint8s_decrease_by(const f_number_unsigned_t amount, f_uint8s_t * const structure);
#endif // _di_f_uint8s_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param uint8s
+ * @param structure
* The string uint8s array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_uint8s_increase_
- extern f_status_t f_uint8s_increase(const f_number_unsigned_t step, f_uint8s_t * const uint8s);
+ extern f_status_t f_uint8s_increase(const f_number_unsigned_t step, f_uint8s_t * const structure);
#endif // _di_f_uint8s_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param uint8s
+ * @param structure
* The string uint8s array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint8s_increase_by_
- extern f_status_t f_uint8s_increase_by(const f_number_unsigned_t amount, f_uint8s_t * const uint8s);
+ extern f_status_t f_uint8s_increase_by(const f_number_unsigned_t amount, f_uint8s_t * const structure);
#endif // _di_f_uint8s_increase_by_
/**
*
* @param length
* The new size to use.
- * @param uint8s
+ * @param structure
* The string uint8s array to adjust.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint8s_resize_
- extern f_status_t f_uint8s_resize(const f_number_unsigned_t length, f_uint8s_t * const uint8s);
+ extern f_status_t f_uint8s_resize(const f_number_unsigned_t length, f_uint8s_t * const structure);
#endif // _di_f_uint8s_resize_
/**
*
* @param length
* The new size to use.
- * @param uint8ss
+ * @param structure
* The string uint8ss array to resize.
*
* @return
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_uint8ss_adjust_
- extern f_status_t f_uint8ss_adjust(const f_number_unsigned_t length, f_uint8ss_t * const uint8ss);
+ extern f_status_t f_uint8ss_adjust(const f_number_unsigned_t length, f_uint8ss_t * const structure);
#endif // _di_f_uint8ss_adjust_
/**
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase()
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint8ss_append_
extern f_status_t f_uint8ss_append(const f_uint8s_t source, f_uint8ss_t * const destination);
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_uint8ss_append_all_
extern f_status_t f_uint8ss_append_all(const f_uint8ss_t source, f_uint8ss_t * const destination);
*
* @param amount
* A positive number representing how much to decimate the size by.
- * @param uint8ss
+ * @param structure
* The string uint8ss array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_uint8ss_decimate_by_
- extern f_status_t f_uint8ss_decimate_by(const f_number_unsigned_t amount, f_uint8ss_t * const uint8ss);
+ extern f_status_t f_uint8ss_decimate_by(const f_number_unsigned_t amount, f_uint8ss_t * const structure);
#endif // _di_f_uint8ss_decimate_by_
/**
*
* @param amount
* A positive number representing how much to decrease the size by.
- * @param uint8ss
+ * @param structure
* The string uint8ss array to resize.
*
* @return
* F_none on success.
- * F_data_not if amount is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_delete().
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint8ss_decrease_by_
- extern f_status_t f_uint8ss_decrease_by(const f_number_unsigned_t amount, f_uint8ss_t * const uint8ss);
+ extern f_status_t f_uint8ss_decrease_by(const f_number_unsigned_t amount, f_uint8ss_t * const structure);
#endif // _di_f_uint8ss_decrease_by_
/**
* @param step
* The allocation step to use.
* Must be greater than 0.
- * @param uint8ss
+ * @param structure
* The string uint8ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint8ss_increase_
- extern f_status_t f_uint8ss_increase(const f_number_unsigned_t step, f_uint8ss_t * const uint8ss);
+ extern f_status_t f_uint8ss_increase(const f_number_unsigned_t step, f_uint8ss_t * const structure);
#endif // _di_f_uint8ss_increase_
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param uint8ss
+ * @param structure
* The string uint8ss array to resize.
*
* @return
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint8ss_increase_by_
- extern f_status_t f_uint8ss_increase_by(const f_number_unsigned_t amount, f_uint8ss_t * const uint8ss);
+ extern f_status_t f_uint8ss_increase_by(const f_number_unsigned_t amount, f_uint8ss_t * const structure);
#endif // _di_f_uint8ss_increase_by_
/**
*
* @param length
* The new size to use.
- * @param uint8ss
+ * @param structure
* The string uint8ss array to adjust.
*
* @return
*
* 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().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_uint8ss_resize_
- extern f_status_t f_uint8ss_resize(const f_number_unsigned_t length, f_uint8ss_t * const uint8ss);
+ extern f_status_t f_uint8ss_resize(const f_number_unsigned_t length, f_uint8ss_t * const structure);
#endif // _di_f_uint8ss_resize_
#ifdef __cplusplus
#endif // _di_level_0_parameter_checking_
if (step && dynamic->used + 1 > dynamic->size) {
- f_number_unsigned_t size = dynamic->used + step;
+ f_number_unsigned_t length = dynamic->used + step;
- if (size > F_string_t_size_d) {
+ if (length > F_string_t_size_d) {
if (dynamic->used + 1 > F_string_t_size_d) {
return F_status_set_error(F_string_too_large);
}
- size = F_string_t_size_d;
+ length = F_string_t_size_d;
}
- return private_f_utf_string_dynamic_resize(size, dynamic);
+ return private_f_utf_string_dynamic_resize(length, dynamic);
}
return F_data_not;
if (!step) return F_data_not;
if (dynamics->used + 1 > dynamics->size) {
- f_number_unsigned_t size = dynamics->used + step;
+ f_number_unsigned_t length = dynamics->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (dynamics->used + 1 > F_number_t_size_unsigned_d) {
return F_status_set_error(F_array_too_large);
}
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_utf_string_dynamics_resize(size, dynamics);
+ return private_f_utf_string_dynamics_resize(length, dynamics);
}
return F_data_not;
if (!step) return F_data_not;
if (dynamicss->used + 1 > dynamicss->size) {
- f_number_unsigned_t size = dynamicss->used + step;
+ f_number_unsigned_t length = dynamicss->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (dynamicss->used + 1 > F_number_t_size_unsigned_d) {
return F_status_set_error(F_array_too_large);
}
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_utf_string_dynamicss_resize(size, dynamicss);
+ return private_f_utf_string_dynamicss_resize(length, dynamicss);
}
return F_data_not;
#endif // _di_level_0_parameter_checking_
if (step && map_multis->used + 1 > map_multis->size) {
- f_number_unsigned_t size = map_multis->used + step;
+ f_number_unsigned_t length = map_multis->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (map_multis->used + 1 > F_number_t_size_unsigned_d) {
return F_status_set_error(F_array_too_large);
}
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_utf_string_map_multis_resize(size, map_multis);
+ return private_f_utf_string_map_multis_resize(length, map_multis);
}
return F_data_not;
#endif // _di_level_0_parameter_checking_
if (step && map_multiss->used + 1 > map_multiss->size) {
- f_number_unsigned_t size = map_multiss->used + step;
+ f_number_unsigned_t length = map_multiss->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (map_multiss->used + 1 > F_number_t_size_unsigned_d) {
return F_status_set_error(F_array_too_large);
}
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_utf_string_map_multiss_resize(size, map_multiss);
+ return private_f_utf_string_map_multiss_resize(length, map_multiss);
}
return F_data_not;
#endif // _di_level_0_parameter_checking_
if (step && maps->used + 1 > maps->size) {
- f_number_unsigned_t size = maps->used + step;
+ f_number_unsigned_t length = maps->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (maps->used + 1 > F_number_t_size_unsigned_d) {
return F_status_set_error(F_array_too_large);
}
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_utf_string_maps_resize(size, maps);
+ return private_f_utf_string_maps_resize(length, maps);
}
return F_data_not;
#endif // _di_level_0_parameter_checking_
if (step && mapss->used + 1 > mapss->size) {
- f_number_unsigned_t size = mapss->used + step;
+ f_number_unsigned_t length = mapss->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (mapss->used + 1 > F_number_t_size_unsigned_d) {
return F_status_set_error(F_array_too_large);
}
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_utf_string_mapss_resize(size, mapss);
+ return private_f_utf_string_mapss_resize(length, mapss);
}
return F_data_not;
#endif // _di_level_0_parameter_checking_
if (step && triples->used + 1 > triples->size) {
- f_number_unsigned_t size = triples->used + F_memory_default_allocation_small_d;
+ f_number_unsigned_t length = triples->used + F_memory_default_allocation_small_d;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (triples->used + 1 > F_number_t_size_unsigned_d) {
return F_status_set_error(F_array_too_large);
}
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_utf_string_triples_resize(size, triples);
+ return private_f_utf_string_triples_resize(length, triples);
}
return F_data_not;
#endif // _di_level_0_parameter_checking_
if (step && tripless->used + 1 > tripless->size) {
- f_number_unsigned_t size = tripless->used + step;
+ f_number_unsigned_t length = tripless->used + step;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (tripless->used + 1 > F_number_t_size_unsigned_d) {
return F_status_set_error(F_array_too_large);
}
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return private_f_utf_string_tripless_resize(size, tripless);
+ return private_f_utf_string_tripless_resize(length, tripless);
}
return F_data_not;
f_status_t controller_pids_increase(controller_pids_t * const pids) {
if (pids->used + 1 > pids->size) {
- f_number_unsigned_t size = pids->used + controller_common_allocation_small_d;
+ f_number_unsigned_t length = pids->used + controller_common_allocation_small_d;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (pids->used + 1 > F_number_t_size_unsigned_d) {
return F_status_set_error(F_array_too_large);
}
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return controller_pids_resize(size, pids);
+ return controller_pids_resize(length, pids);
}
return F_data_not;
f_status_t controller_processs_increase(controller_processs_t * const processs) {
if (processs->used + 1 > processs->size) {
- f_number_unsigned_t size = processs->used + controller_common_allocation_small_d;
+ f_number_unsigned_t length = processs->used + controller_common_allocation_small_d;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (processs->used + 1 > F_number_t_size_unsigned_d) {
return F_status_set_error(F_array_too_large);
}
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return controller_processs_resize(size, processs);
+ return controller_processs_resize(length, processs);
}
return F_data_not;
f_status_t controller_rule_ons_increase(controller_rule_ons_t * const ons) {
if (ons->used + 1 > ons->size) {
- f_number_unsigned_t size = ons->used + controller_common_allocation_small_d;
+ f_number_unsigned_t length = ons->used + controller_common_allocation_small_d;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (ons->used + 1 > F_number_t_size_unsigned_d) {
return F_status_set_error(F_array_too_large);
}
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return controller_rule_ons_resize(size, ons);
+ return controller_rule_ons_resize(length, ons);
}
return F_data_not;
f_status_t controller_rules_increase(controller_rules_t * const rules) {
if (rules->used + 1 > rules->size) {
- f_number_unsigned_t size = rules->used + controller_common_allocation_small_d;
+ f_number_unsigned_t length = rules->used + controller_common_allocation_small_d;
- if (size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (rules->used + 1 > F_number_t_size_unsigned_d) {
return F_status_set_error(F_array_too_large);
}
- size = F_number_t_size_unsigned_d;
+ length = F_number_t_size_unsigned_d;
}
- return controller_rules_resize(size, rules);
+ return controller_rules_resize(length, rules);
}
return F_data_not;