The f_memory_array set of functions now fully replaces the f_memory_structure functions and related macros.
I think those structure macros are nifty but they are not in use enough anymore and the f_memory_array structure is what I am going forward with.
There is still an enormouse amount of changes to do.
#define _di_f_fss_simple_packet_d_
#define _di_f_fss_simple_packet_identify_
#define _di_f_fss_simple_packet_ranges_adjust_
+#define _di_f_fss_simple_packet_ranges_append_
+#define _di_f_fss_simple_packet_ranges_append_all_
#define _di_f_fss_simple_packet_ranges_decimate_by_
#define _di_f_fss_simple_packet_ranges_decrease_by_
#define _di_f_fss_simple_packet_ranges_increase_
#define _di_f_fss_simple_packet_ranges_increase_by_
#define _di_f_fss_simple_packet_ranges_resize_
+#define _di_f_fss_simple_packet_rangess_adjust_
+#define _di_f_fss_simple_packet_rangess_append_
+#define _di_f_fss_simple_packet_rangess_append_all_
+#define _di_f_fss_simple_packet_rangess_decimate_by_
+#define _di_f_fss_simple_packet_rangess_decrease_by_
+#define _di_f_fss_simple_packet_rangess_increase_
+#define _di_f_fss_simple_packet_rangess_increase_by_
+#define _di_f_fss_simple_packet_rangess_resize_
+#define _di_f_fss_simple_packet_rangess_t_
#define _di_f_fss_simple_packet_ranges_t_
#define _di_f_fss_simple_packet_range_t_
#define _di_f_fss_skip_past_delimit_
#define _di_f_memory_adjust_
+#define _di_f_memory_array_adjust_
+#define _di_f_memory_array_decimate_by_
+#define _di_f_memory_array_decrease_by_
+#define _di_f_memory_array_increase_
+#define _di_f_memory_array_increase_by_
+#define _di_f_memory_array_resize_
#define _di_f_memory_default_d_
#define _di_f_memory_delete_
#define _di_f_memory_destroy_
#define _di_f_memory_new_
#define _di_f_memory_new_aligned_
#define _di_f_memory_resize_
-#define _di_f_memory_structure_adjust_
-#define _di_f_memory_structure_decimate_by_
-#define _di_f_memory_structure_decrease_by_
-#define _di_f_memory_structure_increase_
-#define _di_f_memory_structure_increase_by_
-#define _di_f_memory_structure_resize_
-#define _di_macro_f_memory_structure_adjust_
-#define _di_macro_f_memory_structure_clear_
-#define _di_macro_f_memory_structure_decimate_by_
-#define _di_macro_f_memory_structure_decrease_by_
-#define _di_macro_f_memory_structure_delete_
-#define _di_macro_f_memory_structure_delete_simple_
-#define _di_macro_f_memory_structure_destroy_
-#define _di_macro_f_memory_structure_destroy_simple_
-#define _di_macro_f_memory_structure_increase_
-#define _di_macro_f_memory_structure_increase_by_
-#define _di_macro_f_memory_structure_increment_
-#define _di_macro_f_memory_structure_resize_
-#define _di_macro_f_memory_structures_adjust_
-#define _di_macro_f_memory_structures_clear_
-#define _di_macro_f_memory_structures_decimate_by_
-#define _di_macro_f_memory_structures_decrease_by_
-#define _di_macro_f_memory_structures_delete_
-#define _di_macro_f_memory_structures_delete_simple_
-#define _di_macro_f_memory_structures_destroy_
-#define _di_macro_f_memory_structures_destroy_simple_
-#define _di_macro_f_memory_structures_increase_
-#define _di_macro_f_memory_structures_increase_by_
-#define _di_macro_f_memory_structures_resize_
build_sources_library fss/private-item.c fss/private-named.c fss/private-nest.c fss/private-set.c fss/private-set_quote.c fss/private-simple_packet.c
build_sources_library iki.c iki/common.c iki/data.c private-iki.c iki/private-data.c
build_sources_library limit.c limit/set.c limit/value.c limit/private-set.c limit/private-value.c
-build_sources_library memory.c memory/array.c memory/structure.c
+build_sources_library memory.c memory/array.c
build_sources_library private-memory.c memory/private-array.c
build_sources_library network.c
build_sources_library parse.c parse/utf.c
build_sources_headers fss.h fss/common.h fss/item.h fss/named.h fss/nest.h fss/quote.h fss/set.h fss/set_quote.h fss/simple_packet.h
build_sources_headers iki.h iki/common.h iki/data.h
build_sources_headers limit.h limit/set.h limit/value.h
-build_sources_headers memory.h memory/array.h memory/common.h memory/structure.h
+build_sources_headers memory.h memory/array.h memory/common.h
build_sources_headers network.h network/common.h
build_sources_headers parse.h parse/utf.h
build_sources_headers path.h path/common.h
build_sources_library level_0/fss/private-item.c level_0/fss/private-named.c level_0/fss/private-nest.c level_0/fss/private-set.c level_0/fss/private-set_quote.c level_0/fss/private-simple_packet.c
build_sources_library level_0/iki.c level_0/iki/common.c level_0/iki/data.c level_0/private-iki.c level_0/iki/private-data.c
build_sources_library level_0/limit.c level_0/limit/set.c level_0/limit/value.c level_0/limit/private-set.c level_0/limit/private-value.c
-build_sources_library level_0/memory.c level_0/memory/array.c level_0/memory/structure.c
+build_sources_library level_0/memory.c level_0/memory/array.c
build_sources_library level_0/private-memory.c level_0/memory/private-array.c
build_sources_library level_0/network.c
build_sources_library level_0/parse.c level_0/parse/utf.c
build_sources_headers level_0/fss.h level_0/fss/common.h level_0/fss/item.h level_0/fss/named.h level_0/fss/nest.h level_0/fss/quote.h level_0/fss/set.h level_0/fss/set_quote.h level_0/fss/simple_packet.h
build_sources_headers level_0/iki.h level_0/iki/common.h level_0/iki/data.h
build_sources_headers level_0/limit.h level_0/limit/set.h level_0/limit/value.h
-build_sources_headers level_0/memory.h level_0/memory/array.h level_0/memory/common.h level_0/memory/structure.h
+build_sources_headers level_0/memory.h level_0/memory/array.h level_0/memory/common.h
build_sources_headers level_0/network.h level_0/network/common.h
build_sources_headers level_0/parse.h level_0/parse/utf.h
build_sources_headers level_0/path.h level_0/path/common.h
//#define _di_f_file_name_directory_
//#define _di_f_file_open_
#define _di_f_file_open_at_
-//#define _di_f_file_open_mode_append_s_
//#define _di_f_file_open_mode_read_append_s_
//#define _di_f_file_open_mode_read_s_
//#define _di_f_file_open_mode_read_truncate_s_
//#define _di_f_file_open_mode_read_write_s_
//#define _di_f_file_open_mode_s_
-//#define _di_f_file_open_mode_truncate_s_
+//#define _di_f_file_open_mode_write_append_s_
+//#define _di_f_file_open_mode_write_truncate_s_
//#define _di_f_file_operation_access_s_
//#define _di_f_file_operation_analyze_s_
#define _di_f_file_operation_append_s_
#define _di_f_memory_array_decrease_by_
#define _di_f_memory_array_increase_
#define _di_f_memory_array_increase_by_
-#define _di_f_memory_array_resize_
+//#define _di_f_memory_array_resize_
//#define _di_f_memory_default_d_
//#define _di_f_memory_delete_
#define _di_f_memory_destroy_
#define _di_f_memory_new_
#define _di_f_memory_new_aligned_
//#define _di_f_memory_resize_
-#define _di_f_memory_structure_adjust_
-#define _di_f_memory_structure_decimate_by_
-#define _di_f_memory_structure_decrease_by_
-#define _di_f_memory_structure_increase_
-#define _di_f_memory_structure_increase_by_
-#define _di_f_memory_structure_resize_
//#define _di_f_mode_t_
#define _di_f_socket_message_flag_e_
#define _di_f_socket_name_host_
#define _di_f_socket_name_peer_
-#define _di_f_socket_option_d_
+#define _di_f_socket_option_e_
#define _di_f_socket_option_get_
#define _di_f_socket_option_set_
#define _di_f_socket_protocol_e_
#define _di_f_socketss_t_
#define _di_f_sockets_t_
#define _di_f_socket_t_
-#define _di_f_socket_type_d_
+#define _di_f_socket_type_e_
#define _di_f_socket_write_
#define _di_f_socket_write_message_
#define _di_f_socket_write_stream_
build_sources_program fll/level_0/fss/private-item.c fll/level_0/fss/private-named.c fll/level_0/fss/private-nest.c fll/level_0/fss/private-set.c fll/level_0/fss/private-set_quote.c fll/level_0/fss/private-simple_packet.c
build_sources_program fll/level_0/iki.c fll/level_0/private-iki.c fll/level_0/iki/common.c fll/level_0/iki/private-data.c fll/level_0/iki/data.c
build_sources_program fll/level_0/limit.c fll/level_0/limit/set.c fll/level_0/limit/value.c fll/level_0/limit/private-set.c fll/level_0/limit/private-value.c
-build_sources_program fll/level_0/memory.c fll/level_0/private-memory.c fll/level_0/memory/structure.c
+build_sources_program fll/level_0/memory.c fll/level_0/memory/array.c
+build_sources_program fll/level_0/private-memory.c fll/level_0/memory/private-array.c
build_sources_program fll/level_0/parse.c fll/level_0/parse/utf.c
build_sources_program fll/level_0/path.c fll/level_0/private-path.c fll/level_0/path/common.c
build_sources_program fll/level_0/pipe.c
#if !defined(_di_f_directory_statuss_adjust_) || !defined(_di_f_directory_statuss_decimate_by_)
f_status_t private_f_directory_statuss_adjust(const f_number_unsigned_t length, f_directory_statuss_t * const statuss) {
- f_status_t status = F_none;
+ {
+ f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < statuss->size; ++i) {
+ for (f_number_unsigned_t i = length; i < statuss->size; ++i) {
- status = f_string_dynamic_adjust(0, &statuss->array[i].path);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(statuss->size, length, sizeof(f_directory_status_t), (void **) & statuss->array);
-
- if (F_status_is_error_not(status)) {
- statuss->size = length;
-
- if (statuss->used > statuss->size) {
- statuss->used = length;
- }
+ status = f_string_dynamic_adjust(0, &statuss->array[i].path);
+ if (F_status_is_error(status)) return status;
+ } // for
}
- if (F_status_is_error(status)) return status;
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_directory_status_t), (void **) &statuss->array, &statuss->used, &statuss->size);
}
#endif // !defined(_di_f_directory_statuss_adjust_) || !defined(_di_f_directory_statuss_decimate_by_)
-#if !defined(_di_f_directory_statuss_decrease_by_) || !defined(_di_f_directory_statuss_increase_) || !defined(_di_f_directory_statuss_increase_by_) || !defined(_di_f_directory_statuss_resize_)
+#if !defined(_di_f_directory_statuss_decrease_by_) || !defined(_di_f_directory_statuss_resize_)
f_status_t private_f_directory_statuss_resize(const f_number_unsigned_t length, f_directory_statuss_t * const statuss) {
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < statuss->size; ++i) {
-
- status = f_string_dynamic_resize(0, &statuss->array[i].path);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(statuss->size, length, sizeof(f_directory_status_t), (void **) & statuss->array);
- if (F_status_is_error(status)) return status;
+ {
+ f_status_t status = F_none;
- statuss->size = length;
+ for (f_number_unsigned_t i = length; i < statuss->size; ++i) {
- if (statuss->used > statuss->size) {
- statuss->used = length;
+ status = f_string_dynamic_resize(0, &statuss->array[i].path);
+ if (F_status_is_error(status)) return status;
+ } // for
}
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_directory_status_t), (void **) &statuss->array, &statuss->used, &statuss->size);
}
-#endif // !defined(_di_f_directory_statuss_decrease_by_) || !defined(_di_f_directory_statuss_increase_) || !defined(_di_f_directory_statuss_increase_by_) || !defined(_di_f_directory_statuss_resize_)
+#endif // !defined(_di_f_directory_statuss_decrease_by_) || !defined(_di_f_directory_statuss_resize_)
#ifdef __cplusplus
} // extern "C"
* The statuss to adjust.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_adjust().
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: private_f_directory_status_adjust().
+ * F_parameter (with error bit) if a parameter is invalid.
*
- * @see private_f_directory_status_adjust()
+ * Errors (with error bit) from: f_memory_array_adjust().
+ * Errors (with error bit) from: f_string_dynamic_adjust().
+ *
+ * @see f_memory_array_adjust()
+ * @see f_string_dynamic_adjust()
*
* @see f_directory_statuss_adjust()
* @see f_directory_statuss_decimate_by()
- * @see f_memory_adjust()
*/
#if !defined(_di_f_directory_statuss_adjust_) || !defined(_di_f_directory_statuss_decimate_by_)
extern f_status_t private_f_directory_statuss_adjust(const f_number_unsigned_t length, f_directory_statuss_t * const statuss) F_attribute_visibility_internal_d;
* The statuss to resize.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_resize().
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*
+ * Errors (with error bit) from: f_memory_array_resize().
* Errors (with error bit) from: f_string_dynamic_resize().
*
+ * @see f_memory_array_resize()
* @see f_string_dynamic_resize()
*
- * @see f_directory_statuss_decrease_by()
- * @see f_directory_statuss_increase()
- * @see f_directory_statuss_increase_by()
* @see f_directory_statuss_resize()
- * @see f_memory_resize()
+ * @see f_directory_statuss_decimate_by()
*/
-#if !defined(_di_f_directory_statuss_decrease_by_) || !defined(_di_f_directory_statuss_increase_) || !defined(_di_f_directory_statuss_increase_by_) || !defined(_di_f_directory_statuss_resize_)
+#if !defined(_di_f_directory_statuss_decrease_by_) || !defined(_di_f_directory_statuss_resize_)
extern f_status_t private_f_directory_statuss_resize(const f_number_unsigned_t length, f_directory_statuss_t * const statuss) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_directory_statuss_decrease_by_) || !defined(_di_f_directory_statuss_increase_) || !defined(_di_f_directory_statuss_increase_by_) || !defined(_di_f_directory_statuss_resize_)
+#endif // !defined(_di_f_directory_statuss_decrease_by_) || !defined(_di_f_directory_statuss_resize_)
#ifdef __cplusplus
} // extern "C"
if (!amount) return F_data_not;
- if (statuss->size - amount > 0) {
- return private_f_directory_statuss_adjust(statuss->size - amount, statuss);
- }
-
- return private_f_directory_statuss_adjust(0, statuss);
+ return private_f_directory_statuss_adjust((statuss->size - amount > 0) ? statuss->size - amount : 0, statuss);
}
#endif // _di_f_directory_statuss_decimate_by_
if (!amount) return F_data_not;
- if (statuss->size - amount > 0) {
- return private_f_directory_statuss_resize(statuss->size - amount, statuss);
- }
-
- return private_f_directory_statuss_resize(0, statuss);
+ return private_f_directory_statuss_resize((statuss->size - amount > 0) ? statuss->size - amount : 0, statuss);
}
#endif // _di_f_directory_statuss_decrease_by_
if (!statuss) 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_directory_statuss_resize(size, statuss);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(f_directory_status_t), (void **) &statuss->array, &statuss->used, &statuss->size);
}
#endif // _di_f_directory_statuss_increase_
if (!statuss) 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_directory_statuss_resize(statuss->used + amount, statuss);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(f_directory_status_t), (void **) &statuss->array, &statuss->used, &statuss->size);
}
#endif // _di_f_directory_statuss_increase_by_
* The statuss structure to adjust.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_adjust().
*
- * Errors (with error bit) from: f_memory_resize().
- * Errors (with error bit) from: f_string_dynamic_resize().
+ * F_parameter (with error bit) if a parameter is invalid.
*
- * @see f_memory_resize()
- * @see f_string_dynamic_resize()
+ * Errors (with error bit) from: f_memory_array_adjust().
+ * Errors (with error bit) from: f_string_dynamic_adjust().
+ *
+ * @see f_memory_array_adjust()
+ * @see f_string_dynamic_adjust()
*/
#ifndef _di_f_directory_statuss_adjust_
extern f_status_t f_directory_statuss_adjust(const f_number_unsigned_t length, f_directory_statuss_t * const statuss);
* The statuss array to resize.
*
* @return
- * F_none on success.
- * F_data_not if amount is 0.
+ * Success from f_memory_array_adjust().
*
- * Errors (with error bit) from: f_memory_resize().
- * Errors (with error bit) from: f_string_dynamic_resize().
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_array_adjust().
+ * Errors (with error bit) from: f_string_dynamic_adjust().
*
- * @see f_memory_resize()
- * @see f_string_dynamic_resize()
+ * @see f_memory_array_adjust()
+ * @see f_string_dynamic_adjust()
*/
#ifndef _di_f_directory_statuss_decimate_by_
extern f_status_t f_directory_statuss_decimate_by(const f_number_unsigned_t amount, f_directory_statuss_t * const statuss);
* The statuss array to resize.
*
* @return
- * F_none on success.
- * F_data_not if amount is 0.
+ * Success from f_memory_array_resize().
+ *
+ * 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().
* Errors (with error bit) from: f_string_dynamic_resize().
*
- * @see f_memory_resize()
- * @see f_string_dynamic_resize()
+ * @see f_memory_array_resize()
+ * @see f_string_dynamic_resize()
*/
#ifndef _di_f_directory_statuss_decrease_by_
extern f_status_t f_directory_statuss_decrease_by(const f_number_unsigned_t amount, f_directory_statuss_t * const statuss);
* The statuss array to resize.
*
* @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ * Success from f_memory_array_increase().
*
- * Errors (with error bit) from: f_memory_resize().
- * Errors (with error bit) from: f_string_dynamic_resize().
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_array_increase().
*
- * @see f_memory_resize()
- * @see f_string_dynamic_resize()
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_directory_statuss_increase_
extern f_status_t f_directory_statuss_increase(const f_number_unsigned_t step, f_directory_statuss_t * const statuss);
* The statuss array to resize.
*
* @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + amount <= size).
+ * Success from f_memory_array_increase_by().
*
- * Errors (with error bit) from: f_memory_resize().
- * Errors (with error bit) from: f_string_dynamic_resize().
+ * F_parameter (with error bit) if a parameter is invalid.
*
- * @see f_memory_resize()
- * @see f_string_dynamic_resize()
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_directory_statuss_increase_by_
extern f_status_t f_directory_statuss_increase_by(const f_number_unsigned_t amount, f_directory_statuss_t * const statuss);
* The directory status array to resize.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_resize().
*
- * Errors (with error bit) from: f_memory_resize().
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_array_resize().
* Errors (with error bit) from: f_string_dynamic_resize().
*
- * @see f_memory_resize()
- * @see f_string_dynamic_resize()
+ * @see f_memory_array_resize()
+ * @see f_string_dynamic_resize()
*/
#ifndef _di_f_directory_statuss_resize_
extern f_status_t f_directory_statuss_resize(const f_number_unsigned_t length, f_directory_statuss_t * const statuss);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (items->size > amount) return private_f_fss_items_adjust(items->size - amount, items);
- return private_f_fss_items_adjust(0, items);
+ return private_f_fss_items_adjust((items->size > amount) ? items->size - amount : 0, items);
}
#endif // _di_f_fss_items_decimate_by_
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (items->size > amount) return private_f_fss_items_resize(items->size - amount, items);
- return private_f_fss_items_resize(0, items);
+ return private_f_fss_items_resize((items->size > amount) ? items->size - amount : 0, items);
}
#endif // _di_f_fss_items_decrease_by_
if (!items) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && items->used + 1 > items->size) {
- f_number_unsigned_t size = items->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (items->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_fss_items_resize(size, items);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(f_fss_item_t), (void **) &items->array, &items->used, &items->size);
}
#endif // _di_f_fss_items_increase_
if (!items) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (items->used + amount > items->size) {
- if (items->used + amount > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
- return private_f_fss_items_resize(items->used + amount, items);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(f_fss_item_t), (void **) &items->array, &items->used, &items->size);
}
#endif // _di_f_fss_items_increase_by_
#define macro_f_fss_items_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_fss_items_t_initialize_2(array, length) { array, length, length }
- #define macro_f_fss_items_t_clear(items) macro_f_memory_structure_clear(items)
-
#define macro_f_fss_items_t_resize(status, items, length) status = f_fss_items_resize(length, &items);
#define macro_f_fss_items_t_adjust(status, items, length) status = f_fss_items_adjust(length, &items);
* The items array to resize.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_adjust().
*
- * 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_array_adjust().
+ * Errors (with error bit) from: f_string_dynamic_adjust().
+ *
+ * @see f_memory_array_adjust()
+ * @see f_string_dynamic_adjust()
*/
#ifndef _di_f_fss_items_decrease_by_
extern f_status_t f_fss_items_decrease_by(const f_number_unsigned_t amount, f_fss_items_t * const items);
* The items array to resize.
*
* @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ * Success from f_memory_array_increase().
*
- * 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.
+ *
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_fss_items_increase_
extern f_status_t f_fss_items_increase(const f_number_unsigned_t step, f_fss_items_t * const items);
* The items array to resize.
*
* @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + amount <= size).
+ * Success from f_memory_array_increase_by().
*
- * F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
- * F_array_too_large (with error bit) if the new array length is too large.
+ *
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_fss_items_increase_by_
extern f_status_t f_fss_items_increase_by(const f_number_unsigned_t amount, f_fss_items_t * const items);
* @param length
* The new size to use.
* @param items
- * The items array to adjust.
+ * The items array to resize.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_resize().
*
- * 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_array_resize().
+ * Errors (with error bit) from: f_string_dynamic_resize().
+ *
+ * @see f_memory_array_resize()
+ * @see f_string_dynamic_resize()
*/
#ifndef _di_f_fss_items_resize_
extern f_status_t f_fss_items_resize(const f_number_unsigned_t length, f_fss_items_t * const items);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (named->objects.size - amount > 0) return private_f_fss_named_adjust(named->objects.size - amount, named);
- return private_f_fss_named_adjust(0, named);
+ return private_f_fss_named_adjust((named->objects.size - amount > 0) ? named->objects.size - amount : 0, named);
}
#endif // _di_f_fss_named_decimate_by_
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (named->objects.size - amount > 0) return private_f_fss_named_resize(named->objects.size - amount, named);
- return private_f_fss_named_resize(0, named);
+ return private_f_fss_named_resize((named->objects.size - amount > 0) ? named->objects.size - amount : 0, named);
}
#endif // _di_f_fss_named_decrease_by_
#endif // _di_level_0_parameter_checking_
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;
if (size > F_number_t_size_unsigned_d) {
if (!named) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (named->objects.used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ const f_number_unsigned_t length = named->objects.used + amount;
- if (named->objects.used + amount > named->objects.size) {
- if (named->objects.used + amount > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (length > named->objects.size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- return private_f_fss_named_resize(named->objects.used + amount, named);
+ return private_f_fss_named_resize(length, named);
+ }
}
return F_data_not;
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (nameds->size > amount) return private_f_fss_nameds_adjust(nameds->size - amount, nameds);
- return private_f_fss_nameds_adjust(0, nameds);
+ return private_f_fss_nameds_adjust((nameds->size > amount) ? nameds->size - amount : 0, nameds);
}
#endif // _di_f_fss_nameds_decimate_by_
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (nameds->size > amount) return private_f_fss_nameds_resize(nameds->size - amount, nameds);
- return private_f_fss_nameds_resize(0, nameds);
+ return private_f_fss_nameds_resize((nameds->size > amount) ? nameds->size - amount : 0, nameds);
}
#endif // _di_f_fss_nameds_decrease_by_
if (!nameds) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && nameds->used + 1 > nameds->size) {
- f_number_unsigned_t size = nameds->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (nameds->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_fss_nameds_resize(size, nameds);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(f_fss_named_t), (void **) &nameds->array, &nameds->used, &nameds->size);
}
#endif // _di_f_fss_nameds_increase_
if (!nameds) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (nameds->used + amount > nameds->size) {
- if (nameds->used + amount > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
- return private_f_fss_nameds_resize(nameds->used + amount, nameds);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(f_fss_named_t), (void **) &nameds->array, &nameds->used, &nameds->size);
}
#endif // _di_f_fss_nameds_increase_by_
#define macro_f_fss_nameds_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_fss_nameds_t_initialize_2(array, length) { array, length, length }
- #define macro_f_fss_nameds_t_clear(nameds) macro_f_memory_structure_clear(nameds);
-
#define macro_f_fss_nameds_t_resize(status, nameds, length) status = f_fss_nameds_resize(length, &nameds);
#define macro_f_fss_nameds_t_adjust(status, nameds, length) status = f_fss_nameds_adjust(length, &nameds);
#endif // _di_f_fss_named_resize_
/**
- * Resize the named array.
+ * Adjust the named array.
*
* @param length
* The new size to use.
* @param nameds
- * The nameds array to resize.
+ * The nameds array to adjust.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_resize().
*
- * 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_array_resize().
+ * Errors (with error bit) from: f_string_ranges_resize().
+ * Errors (with error bit) from: f_string_rangess_resize().
+ * Errors (with error bit) from: f_uint8ss_resize().
+ *
+ * @see f_memory_array_resize()
+ * @see f_string_ranges_resize()
+ * @see f_string_rangess_resize()
+ * @see f_uint8ss_resize()
*/
#ifndef _di_f_fss_nameds_adjust_
extern f_status_t f_fss_nameds_adjust(const f_number_unsigned_t length, f_fss_nameds_t * const nameds);
* The nameds array to resize.
*
* @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ * Success from f_memory_array_increase().
*
- * 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.
+ *
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_fss_nameds_increase_
extern f_status_t f_fss_nameds_increase(const f_number_unsigned_t step, f_fss_nameds_t * const nameds);
* The nameds array to resize.
*
* @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + amount <= size).
+ * Success from f_memory_array_increase_by().
*
- * F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
- * F_array_too_large (with error bit) if the new array length is too large.
+ *
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_fss_nameds_increase_by_
extern f_status_t f_fss_nameds_increase_by(const f_number_unsigned_t amount, f_fss_nameds_t * const nameds);
* @param length
* The new size to use.
* @param nameds
- * The nameds array to adjust.
+ * The nameds array to resize.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_resize().
*
- * 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_array_resize().
+ * Errors (with error bit) from: f_string_ranges_resize().
+ * Errors (with error bit) from: f_string_rangess_resize().
+ * Errors (with error bit) from: f_uint8ss_resize().
+ *
+ * @see f_memory_array_resize()
+ * @see f_string_ranges_resize()
+ * @see f_string_rangess_resize()
+ * @see f_uint8ss_resize()
*/
#ifndef _di_f_fss_nameds_resize_
extern f_status_t f_fss_nameds_resize(const f_number_unsigned_t length, f_fss_nameds_t * const nameds);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (nest->size > amount) return private_f_fss_nest_adjust(nest->size - amount, nest);
- return private_f_fss_nest_adjust(0, nest);
+ return private_f_fss_nest_adjust((nest->size > amount) ? nest->size - amount : 0, nest);
}
#endif // _di_f_fss_nest_decimate_by_
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (nest->size > amount) return private_f_fss_nest_resize(nest->size - amount, nest);
- return private_f_fss_nest_resize(0, nest);
+ return private_f_fss_nest_resize((nest->size > amount) ? nest->size - amount : 0, nest);
}
#endif // _di_f_fss_nest_decrease_by_
#endif // _di_level_0_parameter_checking_
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;
if (size > F_number_t_size_unsigned_d) {
if (!nest) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (nest->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (nest->used + amount > nest->size) {
- if (nest->used + amount > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ const f_number_unsigned_t length = nest->used + amount;
- return private_f_fss_nest_resize(nest->used + amount, nest);
+ if (length > nest->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_fss_nest_resize(length, nest);
+ }
}
return F_data_not;
#endif // _di_level_0_parameter_checking_
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;
if (size > F_number_t_size_unsigned_d) {
if (!nests) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (nests->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (nests->used + amount > nests->size) {
- if (nests->used + amount > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ const f_number_unsigned_t length = nests->used + amount;
- return private_f_fss_nests_resize(nests->used + amount, nests);
+ if (length > nests->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_fss_nests_resize(length, nests);
+ }
}
return F_data_not;
* @param length
* The new size to use.
* @param nests
- * The nests array to resize.
+ * The nests array to adjust.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_adjust().
*
- * 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_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_fss_nests_adjust_
extern f_status_t f_fss_nests_adjust(const f_number_unsigned_t length, f_fss_nests_t * const nests);
* The nests array to resize.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_adjust().
*
- * 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_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*/
#ifndef _di_f_fss_nests_decimate_by_
extern f_status_t f_fss_nests_decimate_by(const f_number_unsigned_t amount, f_fss_nests_t * const nests);
* The nests array to resize.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_resize().
*
- * 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_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_fss_nests_decrease_by_
extern f_status_t f_fss_nests_decrease_by(const f_number_unsigned_t amount, f_fss_nests_t * const nests);
* The nests array to resize.
*
* @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ * Success from f_memory_array_increase().
*
- * 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.
+ *
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_fss_nests_increase_
extern f_status_t f_fss_nests_increase(const f_number_unsigned_t step, f_fss_nests_t * const nests);
* The nests array to resize.
*
* @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + amount <= size).
+ * Success from f_memory_array_increase_by().
*
- * F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
- * F_array_too_large (with error bit) if the new array length is too large.
+ *
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_fss_nests_increase_by_
extern f_status_t f_fss_nests_increase_by(const f_number_unsigned_t amount, f_fss_nests_t * const nests);
* @param length
* The new size to use.
* @param nests
- * The nests array to adjust.
+ * The nests array to resize.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_resize().
*
- * 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_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_fss_nests_resize_
extern f_status_t f_fss_nests_resize(const f_number_unsigned_t length, f_fss_nests_t * const nests);
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_adjust(items->size, length, sizeof(f_fss_item_t), (void **) & items->array);
- if (F_status_is_error(status)) return status;
-
- items->size = length;
-
- if (items->used > items->size) {
- items->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_fss_item_t), (void **) &items->array, &items->used, &items->size);
}
#endif // !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_)
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_resize(items->size, length, sizeof(f_fss_item_t), (void **) & items->array);
- if (F_status_is_error(status)) return status;
-
- items->size = length;
-
- if (items->used > items->size) {
- items->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_fss_item_t), (void **) &items->array, &items->used, &items->size);
}
#endif // !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_increase_) || !defined(_di_f_fss_items_increase_by_) || !defined(_di_f_fss_items_resize_)
* The items to adjust.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_adjust().
*
- * Errors (with error bit) from: macro_f_fss_item_t_adjust().
- * Errors (with error bit) from: f_memory_adjust().
+ * F_parameter (with error bit) if a parameter is invalid.
*
- * @see macro_f_fss_item_t_adjust()
+ * Errors (with error bit) from: f_memory_array_adjust().
+ * Errors (with error bit) from: f_string_dynamic_adjust().
*
- * @see f_fss_items_adjust()
- * @see f_fss_items_decimate_by()
- * @see f_memory_adjust()
+ * @see f_memory_array_adjust()
+ * @see f_string_dynamic_adjust()
*/
#if !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_)
extern f_status_t private_f_fss_items_adjust(const f_number_unsigned_t length, f_fss_items_t * const items) F_attribute_visibility_internal_d;
* The items to resize.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_resize().
*
- * Errors (with error bit) from: macro_f_fss_item_t_resize().
- * Errors (with error bit) from: f_memory_resize().
+ * F_parameter (with error bit) if a parameter is invalid.
*
- * @see macro_f_fss_item_t_resize()
+ * Errors (with error bit) from: f_memory_array_resize().
+ * Errors (with error bit) from: f_string_dynamic_resize().
*
- * @see f_fss_items_decrease_by()
- * @see f_fss_items_increase()
- * @see f_fss_items_increase_by()
- * @see f_fss_items_resize()
- * @see f_memory_resize()
+ * @see f_memory_array_resize()
+ * @see f_string_dynamic_resize()
*/
-#if !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_increase_) || !defined(_di_f_fss_items_increase_by_) || !defined(_di_f_fss_items_resize_)
+#if !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_resize_)
extern f_status_t private_f_fss_items_resize(const f_number_unsigned_t length, f_fss_items_t * const items) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_increase_) || !defined(_di_f_fss_items_increase_by_) || !defined(_di_f_fss_items_resize_)
+#endif // !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_resize_)
#ifdef __cplusplus
} // extern "C"
}
#endif // !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_)
-#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_)
+#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_resize_)
f_status_t private_f_fss_named_resize(const f_number_unsigned_t length, f_fss_named_t * const named) {
f_status_t status = f_string_ranges_resize(length, &named->objects);
return F_none;
}
-#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_)
+#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_resize_)
#if !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_)
f_status_t private_f_fss_nameds_adjust(const f_number_unsigned_t length, f_fss_nameds_t * const nameds) {
- f_status_t status = F_none;
+ {
+ f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < nameds->size; ++i) {
+ for (f_number_unsigned_t i = length; i < nameds->size; ++i) {
- status = private_f_fss_named_adjust(0, &nameds->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(nameds->size, length, sizeof(f_fss_named_t), (void **) & nameds->array);
- if (F_status_is_error(status)) return status;
-
- nameds->size = length;
-
- if (nameds->used > nameds->size) {
- nameds->used = length;
+ status = private_f_fss_named_adjust(0, &nameds->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
}
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_fss_named_t), (void **) &nameds->array, &nameds->used, &nameds->size);
}
#endif // !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_)
-#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_)
+#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_resize_)
f_status_t private_f_fss_nameds_resize(const f_number_unsigned_t length, f_fss_nameds_t * const nameds) {
- f_status_t status = F_none;
+ {
+ f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < nameds->size; ++i) {
+ for (f_number_unsigned_t i = length; i < nameds->size; ++i) {
- status = private_f_fss_named_resize(0, &nameds->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(nameds->size, length, sizeof(f_fss_named_t), (void **) & nameds->array);
- if (F_status_is_error(status)) return status;
-
- nameds->size = length;
-
- if (nameds->used > nameds->size) {
- nameds->used = length;
+ status = private_f_fss_named_resize(0, &nameds->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
}
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_fss_named_t), (void **) &nameds->array, &nameds->used, &nameds->size);
}
-#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_)
+#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_resize_)
#ifdef __cplusplus
} // extern "C"
* @return
* F_none on success.
*
- * Errors (with error bit) from: macro_f_string_ranges_t_resize().
- * Errors (with error bit) from: macro_f_string_rangess_t_resize().
- * Errors (with error bit) from: macro_f_uint8ss_t_resize().
+ * Errors (with error bit) from: f_string_ranges_resize().
+ * Errors (with error bit) from: f_string_rangess_resize().
+ * Errors (with error bit) from: f_uint8ss_resize().
*
- * @see macro_f_string_ranges_t_resize()
- * @see macro_f_string_rangess_t_resize()
- * @see macro_f_uint8ss_t_resize()
+ * @see f_string_ranges_resize()
+ * @see f_string_rangess_resize()
+ * @see f_uint8ss_resize()
*
* @see f_fss_nameds_decrease_by()
- * @see f_fss_nameds_incease()
- * @see f_fss_nameds_incease_by()
* @see f_fss_nameds_resize()
*/
-#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_)
+#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_resize_)
extern f_status_t private_f_fss_named_resize(const f_number_unsigned_t length, f_fss_named_t * const named) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_)
+#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_resize_)
/**
* Private implementation for resizing.
* The nameds to adjust.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_adjust().
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: private_f_fss_named_adjust().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ * Errors (with error bit) from: f_string_ranges_resize().
+ * Errors (with error bit) from: f_string_rangess_resize().
+ * Errors (with error bit) from: f_uint8ss_resize().
*
- * @see private_f_fss_named_adjust()
+ * @see f_string_ranges_resize()
+ * @see f_string_rangess_resize()
+ * @see f_uint8ss_resize()
+ * @see f_memory_array_adjust()
*
* @see f_fss_nameds_adjust()
* @see f_fss_nameds_decimate_by()
- * @see f_memory_adjust()
*/
#if !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_)
extern f_status_t private_f_fss_nameds_adjust(const f_number_unsigned_t length, f_fss_nameds_t * const nameds) F_attribute_visibility_internal_d;
* The nameds to resize.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_resize().
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
- * Errors (with error bit) from: private_f_fss_named_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ * Errors (with error bit) from: f_string_ranges_resize().
+ * Errors (with error bit) from: f_string_rangess_resize().
+ * Errors (with error bit) from: f_uint8ss_resize().
*
- * @see private_f_fss_named_resize()
+ * @see f_memory_array_resize()
+ * @see f_string_ranges_resize()
+ * @see f_string_rangess_resize()
+ * @see f_uint8ss_resize()
*
* @see f_fss_nameds_decrease_by()
- * @see f_fss_nameds_increase()
- * @see f_fss_nameds_increase_by()
* @see f_fss_nameds_resize()
- * @see f_memory_resize()
*/
-#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_)
+#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_resize_)
extern f_status_t private_f_fss_nameds_resize(const f_number_unsigned_t length, f_fss_nameds_t * const nameds) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_)
+#endif // !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_resize_)
#ifdef __cplusplus
} // extern "C"
#if !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_)
f_status_t private_f_fss_nest_adjust(const f_number_unsigned_t length, f_fss_nest_t * const nest) {
- f_status_t status = F_none;
+ {
+ f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < nest->size; ++i) {
+ for (f_number_unsigned_t i = length; i < nest->size; ++i) {
- status = private_f_fss_items_adjust(0, &nest->depth[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(nest->size, length, sizeof(f_fss_items_t), (void **) & nest->depth);
- if (F_status_is_error(status)) return status;
-
- nest->size = length;
-
- if (nest->used > nest->size) {
- nest->used = length;
+ status = private_f_fss_items_adjust(0, &nest->depth[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
}
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_fss_items_t), (void **) &nest->depth, &nest->used, &nest->size);
}
#endif // !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_)
-#if !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_increase_) || !defined(_di_f_fss_nest_increase_by_) || !defined(_di_f_fss_nest_resize_)
+#if !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_resize_)
f_status_t private_f_fss_nest_resize(const f_number_unsigned_t length, f_fss_nest_t * const nest) {
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < nest->size; ++i) {
-
- status = private_f_fss_items_resize(0, &nest->depth[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(nest->size, length, sizeof(f_fss_items_t), (void **) & nest->depth);
- if (F_status_is_error(status)) return status;
+ {
+ f_status_t status = F_none;
- nest->size = length;
+ for (f_number_unsigned_t i = length; i < nest->size; ++i) {
- if (nest->used > nest->size) {
- nest->used = length;
+ status = private_f_fss_items_resize(0, &nest->depth[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
}
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_fss_items_t), (void **) &nest->depth, &nest->used, &nest->size);
}
-#endif // !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_increase_) || !defined(_di_f_fss_nest_increase_by_) || !defined(_di_f_fss_nest_resize_)
+#endif // !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_resize_)
#if !defined(_di_f_fss_nests_adjust_) || !defined(_di_f_fss_nests_decimate_by_)
f_status_t private_f_fss_nests_adjust(const f_number_unsigned_t length, f_fss_nests_t *nests) {
- f_status_t status = F_none;
+ {
+ f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < nests->size; ++i) {
+ for (f_number_unsigned_t i = length; i < nests->size; ++i) {
- status = private_f_fss_nest_adjust(0, &nests->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(nests->size, length, sizeof(f_fss_nest_t), (void **) & nests->array);
- if (F_status_is_error(status)) return status;
-
- nests->size = length;
-
- if (nests->used > nests->size) {
- nests->used = length;
+ status = private_f_fss_nest_adjust(0, &nests->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
}
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_fss_nest_t), (void **) &nests->array, &nests->used, &nests->size);
}
#endif // !defined(_di_f_fss_nests_adjust_) || !defined(_di_f_fss_nests_decimate_by_)
-#if !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_)
+#if !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_resize_)
f_status_t private_f_fss_nests_resize(const f_number_unsigned_t length, f_fss_nests_t * const nests) {
- f_status_t status = F_none;
-
- for (f_number_unsigned_t i = length; i < nests->size; ++i) {
-
- status = private_f_fss_nest_resize(0, &nests->array[i]);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(nests->size, length, sizeof(f_fss_nest_t), (void **) & nests->array);
- if (F_status_is_error(status)) return status;
+ {
+ f_status_t status = F_none;
- nests->size = length;
+ for (f_number_unsigned_t i = length; i < nests->size; ++i) {
- if (nests->used > nests->size) {
- nests->used = length;
+ status = private_f_fss_nest_resize(0, &nests->array[i]);
+ if (F_status_is_error(status)) return status;
+ } // for
}
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_fss_nest_t), (void **) &nests->array, &nests->used, &nests->size);
}
-#endif // !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_)
+#endif // !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_resize_)
#ifdef __cplusplus
} // extern "C"
* The nest to adjust.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_adjust().
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: macro_f_fss_nest_t_adjust().
+ * F_parameter (with error bit) if a parameter is invalid.
*
- * @see macro_f_fss_nest_t_adjust()
+ * Errors (with error bit) from: f_memory_array_adjust().
+ * Errors (with error bit) from: f_string_dynamic_adjust().
*
- * @see f_fss_nest_adjust()
- * @see f_fss_nest_decimate_by()
- * @see f_memory_adjust()
+ * @see f_memory_array_adjust()
+ * @see f_string_dynamic_adjust()
+ *
+ * @see f_fss_nests_adjust()
+ * @see f_fss_nests_decimate_by()
*/
#if !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_)
extern f_status_t private_f_fss_nest_adjust(const f_number_unsigned_t length, f_fss_nest_t * const nest) F_attribute_visibility_internal_d;
* The nest to resize.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_resize().
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
- * Errors (with error bit) from: macro_f_fss_nest_t_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ * Errors (with error bit) from: f_string_dynamic_resize().
*
- * @see macro_f_fss_nest_t_resize()
+ * @see f_memory_array_resize()
+ * @see f_string_dynamic_resize()
*
- * @see f_fss_nest_decrease_by()
- * @see f_fss_nest_increase()
- * @see f_fss_nest_increase_by()
- * @see f_fss_nest_resize()
- * @see f_memory_resize()
+ * @see f_fss_nests_decrease_by()
+ * @see f_fss_nests_resize()
*/
-#if !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_increase_) || !defined(_di_f_fss_nest_increase_by_) || !defined(_di_f_fss_nest_resize_)
+#if !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_resize_)
extern f_status_t private_f_fss_nest_resize(const f_number_unsigned_t length, f_fss_nest_t * const nest) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_increase_) || !defined(_di_f_fss_nest_increase_by_) || !defined(_di_f_fss_nest_resize_)
+#endif // !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_resize_)
/**
* Private implementation for resizing.
* The nests to adjust.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_adjust().
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: macro_f_fss_nest_t_adjust().
+ * F_parameter (with error bit) if a parameter is invalid.
*
- * @see macro_f_fss_nest_t_adjust()
+ * Errors (with error bit) from: f_memory_array_adjust().
+ * Errors (with error bit) from: f_string_dynamic_adjust().
+ *
+ * @see f_memory_array_adjust()
+ * @see f_string_dynamic_adjust()
*
* @see f_fss_nests_adjust()
* @see f_fss_nests_decimate_by()
- * @see f_memory_adjust()
*/
#if !defined(_di_f_fss_nests_adjust_) || !defined(_di_f_fss_nests_decimate_by_)
extern f_status_t private_f_fss_nests_adjust(const f_number_unsigned_t length, f_fss_nests_t * const nests) F_attribute_visibility_internal_d;
* The nests to resize.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_resize().
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_resize().
- * Errors (with error bit) from: macro_f_fss_nest_t_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ * Errors (with error bit) from: f_string_dynamic_resize().
*
- * @see macro_f_fss_nest_t_resize()
+ * @see f_memory_array_resize()
+ * @see f_string_dynamic_resize()
*
* @see f_fss_nests_decrease_by()
- * @see f_fss_nests_increase()
- * @see f_fss_nests_increase_by()
* @see f_fss_nests_resize()
- * @see f_memory_resize()
*/
-#if !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_)
+#if !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_resize_)
extern f_status_t private_f_fss_nests_resize(const f_number_unsigned_t length, f_fss_nests_t * const nests) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_)
+#endif // !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_resize_)
#ifdef __cplusplus
} // extern "C"
}
#endif // !defined(_di_f_fss_set_adjust_) || !defined(_di_f_fss_set_decimate_by_)
-#if !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_)
+#if !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_resize_)
f_status_t private_f_fss_set_resize(const f_number_unsigned_t length, f_fss_set_t *set) {
f_status_t status = f_string_ranges_resize(length, &set->objects);
return F_none;
}
-#endif // !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_)
+#endif // !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_resize_)
#if !defined(_di_f_fss_sets_adjust_) || !defined(_di_f_fss_sets_decimate_by_)
f_status_t private_f_fss_sets_adjust(const f_number_unsigned_t length, f_fss_sets_t * const sets) {
- f_status_t status = F_none;
+ {
+ 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 < sets->size; ++i) {
- status = f_string_ranges_adjust(0, &sets->array[i].objects);
- if (F_status_is_error(status)) return status;
+ status = f_string_ranges_adjust(0, &sets->array[i].objects);
+ if (F_status_is_error(status)) return status;
- status = f_string_rangess_adjust(0, &sets->array[i].contents);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(sets->size, length, sizeof(f_fss_set_t), (void **) & sets->array);
- if (F_status_is_error(status)) return status;
-
- sets->size = length;
-
- if (sets->used > sets->size) {
- sets->used = length;
+ status = f_string_rangess_adjust(0, &sets->array[i].contents);
+ if (F_status_is_error(status)) return status;
+ } // for
}
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_fss_set_t), (void **) &sets->array, &sets->used, &sets->size);
}
#endif // !defined(_di_f_fss_sets_adjust_) || !defined(_di_f_fss_sets_decimate_by_)
-#if !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_increase_) || !defined(_di_f_fss_sets_increase_by_) || !defined(_di_f_fss_sets_resize_)
+#if !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_resize_)
f_status_t private_f_fss_sets_resize(const f_number_unsigned_t length, f_fss_sets_t * const sets) {
- f_status_t status = F_none;
+ {
+ 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 < sets->size; ++i) {
- status = f_string_ranges_resize(0, &sets->array[i].objects);
- if (F_status_is_error(status)) return status;
+ status = f_string_ranges_resize(0, &sets->array[i].objects);
+ if (F_status_is_error(status)) return status;
- status = f_string_rangess_resize(0, &sets->array[i].contents);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(sets->size, length, sizeof(f_fss_set_t), (void **) & sets->array);
- if (F_status_is_error(status)) return status;
-
- sets->size = length;
-
- if (sets->used > sets->size) {
- sets->used = length;
+ status = f_string_rangess_resize(0, &sets->array[i].contents);
+ if (F_status_is_error(status)) return status;
+ } // for
}
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_fss_set_t), (void **) &sets->array, &sets->used, &sets->size);
}
-#endif // !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_increase_) || !defined(_di_f_fss_sets_increase_by_) || !defined(_di_f_fss_sets_resize_)
+#endif // !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_resize_)
#ifdef __cplusplus
} // extern "C"
* @return
* F_none on success.
*
- * Errors (with error bit) from: macro_f_string_rangess_t_adjust().
- * Errors (with error bit) from: macro_f_string_ranges_t_adjust().
+ * Errors (with error bit) from: f_string_ranges_adjust().
+ * Errors (with error bit) from: f_string_rangess_adjust().
*
- * @see macro_f_string_rangess_t_adjust()
- * @see macro_f_string_ranges_t_adjust()
+ * @see f_string_ranges_adjust()
+ * @see f_string_rangess_adjust()
*
* @see f_fss_set_adjust()
* @see f_fss_set_decimate_by()
* @return
* F_none on success.
*
- * Errors (with error bit) from: macro_f_string_rangess_t_resize().
- * Errors (with error bit) from: macro_f_string_ranges_t_resize().
+ * Errors (with error bit) from: f_string_ranges_resize().
+ * Errors (with error bit) from: f_string_rangess_resize().
*
- * @see macro_f_string_rangess_t_resize()
- * @see macro_f_string_ranges_t_resize()
+ * @see f_string_ranges_resize
+ * @see f_string_rangess_resize()()
*
* @see f_fss_set_decrease_by()
- * @see f_fss_set_increase()
- * @see f_fss_set_increase_by()
* @see f_fss_set_resize()
*/
-#if !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_)
+#if !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_resize_)
extern f_status_t private_f_fss_set_resize(const f_number_unsigned_t length, f_fss_set_t * const set) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_)
+#endif // !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_resize_)
/**
* Private implementation for resizing.
* The sets to adjust.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_adjust().
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: macro_f_string_rangess_t_adjust().
- * Errors (with error bit) from: macro_f_string_ranges_t_adjust().
- * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ * Errors (with error bit) from: f_string_ranges_adjust().
+ * Errors (with error bit) from: f_string_rangess_adjust().
*
- * @see macro_f_string_rangess_t_adjust()
- * @see macro_f_string_ranges_t_adjust()
+ * @see f_memory_array_adjust()
+ * @see f_string_ranges_adjust()
+ * @see f_string_rangess_adjust()
*
* @see f_fss_sets_adjust()
* @see f_fss_sets_decimate_by()
- * @see f_memory_adjust()
*/
#if !defined(_di_f_fss_sets_adjust_) || !defined(_di_f_fss_sets_decimate_by_)
extern f_status_t private_f_fss_sets_adjust(const f_number_unsigned_t length, f_fss_sets_t * const sets) F_attribute_visibility_internal_d;
* The sets to resize.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_resize().
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: macro_f_string_rangess_t_resize().
- * Errors (with error bit) from: macro_f_string_ranges_t_resize().
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ * Errors (with error bit) from: f_string_ranges_resize().
+ * Errors (with error bit) from: f_string_rangess_resize().
*
- * @see macro_f_string_rangess_t_resize()
- * @see macro_f_string_ranges_t_resize()
+ * @see f_memory_array_resize()
+ * @see f_string_ranges_resize()
+ * @see f_string_rangess_resize()
*
* @see f_fss_sets_decrease_by()
- * @see f_fss_sets_increase()
- * @see f_fss_sets_increase_by()
* @see f_fss_sets_resize()
- * @see f_memory_resize()
*/
-#if !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_increase_) || !defined(_di_f_fss_sets_increase_by_) || !defined(_di_f_fss_sets_resize_)
+#if !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_resize_)
extern f_status_t private_f_fss_sets_resize(const f_number_unsigned_t length, f_fss_sets_t * const sets) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_increase_) || !defined(_di_f_fss_sets_increase_by_) || !defined(_di_f_fss_sets_resize_)
+#endif // !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_resize_)
#ifdef __cplusplus
} // extern "C"
}
#endif // !defined(_di_f_fss_set_quote_adjust_) || !defined(_di_f_fss_set_quote_decimate_by_)
-#if !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_)
+#if !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_resize_)
f_status_t private_f_fss_set_quote_resize(const f_number_unsigned_t length, f_fss_set_quote_t * const set_quote) {
f_status_t status = f_string_ranges_resize(length, &set_quote->objects);
return F_none;
}
-#endif // !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_)
+#endif // !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_resize_)
#if !defined(_di_f_fss_set_quotes_adjust_) || !defined(_di_f_fss_set_quotes_decimate_by_)
f_status_t private_f_fss_set_quotes_adjust(const f_number_unsigned_t length, f_fss_set_quotes_t * const set_quotes) {
- f_status_t status = F_none;
+ {
+ f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < set_quotes->size; ++i) {
+ for (f_number_unsigned_t i = length; i < set_quotes->size; ++i) {
- status = f_string_ranges_adjust(0, &set_quotes->array[i].objects);
- if (F_status_is_error(status)) return status;
+ status = f_string_ranges_adjust(0, &set_quotes->array[i].objects);
+ if (F_status_is_error(status)) return status;
- status = f_string_rangess_adjust(0, &set_quotes->array[i].contents);
- if (F_status_is_error(status)) return status;
+ status = f_string_rangess_adjust(0, &set_quotes->array[i].contents);
+ if (F_status_is_error(status)) return status;
- status = f_uint8s_adjust(0, &set_quotes->array[i].objects_quote);
- if (F_status_is_error(status)) return status;
+ status = f_uint8s_adjust(0, &set_quotes->array[i].objects_quote);
+ if (F_status_is_error(status)) return status;
- status = f_uint8ss_adjust(0, &set_quotes->array[i].contents_quote);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_adjust(set_quotes->size, length, sizeof(f_fss_set_quote_t), (void **) & set_quotes->array);
- if (F_status_is_error(status)) return status;
-
- set_quotes->size = length;
-
- if (set_quotes->used > set_quotes->size) {
- set_quotes->used = length;
+ status = f_uint8ss_adjust(0, &set_quotes->array[i].contents_quote);
+ if (F_status_is_error(status)) return status;
+ } // for
}
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_fss_set_quote_t), (void **) &set_quotes->array, &set_quotes->used, &set_quotes->size);
}
#endif // !defined(_di_f_fss_set_quotes_adjust_) || !defined(_di_f_fss_set_quotes_decimate_by_)
-#if !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_increase_) || !defined(_di_f_fss_set_quotes_increase_by_) || !defined(_di_f_fss_set_quotes_resize_)
+#if !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_resize_)
f_status_t private_f_fss_set_quotes_resize(const f_number_unsigned_t length, f_fss_set_quotes_t * const set_quotes) {
- f_status_t status = F_none;
+ {
+ f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < set_quotes->size; ++i) {
+ for (f_number_unsigned_t i = length; i < set_quotes->size; ++i) {
- status = f_string_ranges_resize(0, &set_quotes->array[i].objects);
- if (F_status_is_error(status)) return status;
+ status = f_string_ranges_resize(0, &set_quotes->array[i].objects);
+ if (F_status_is_error(status)) return status;
- status = f_string_rangess_resize(0, &set_quotes->array[i].contents);
- if (F_status_is_error(status)) return status;
+ status = f_string_rangess_resize(0, &set_quotes->array[i].contents);
+ if (F_status_is_error(status)) return status;
- status = f_uint8s_resize(0, &set_quotes->array[i].objects_quote);
- if (F_status_is_error(status)) return status;
+ status = f_uint8s_resize(0, &set_quotes->array[i].objects_quote);
+ if (F_status_is_error(status)) return status;
- status = f_uint8ss_resize(0, &set_quotes->array[i].contents_quote);
- if (F_status_is_error(status)) return status;
- } // for
-
- status = f_memory_resize(set_quotes->size, length, sizeof(f_fss_set_quote_t), (void **) & set_quotes->array);
- if (F_status_is_error(status)) return status;
-
- set_quotes->size = length;
-
- if (set_quotes->used > set_quotes->size) {
- set_quotes->used = length;
+ status = f_uint8ss_resize(0, &set_quotes->array[i].contents_quote);
+ if (F_status_is_error(status)) return status;
+ } // for
}
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_fss_set_quote_t), (void **) &set_quotes->array, &set_quotes->used, &set_quotes->size);
}
-#endif // !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_increase_) || !defined(_di_f_fss_set_quotes_increase_by_) || !defined(_di_f_fss_set_quotes_resize_)
+#endif // !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_resize_)
#ifdef __cplusplus
} // extern "C"
* @return
* F_none on success.
*
- * Errors (with error bit) from: macro_f_string_rangess_t_adjust().
- * Errors (with error bit) from: macro_f_string_ranges_t_adjust().
- * Errors (with error bit) from: macro_f_uint8s_t_adjust().
- * Errors (with error bit) from: macro_f_uint8ss_t_adjust().
+ * Errors (with error bit) from: f_string_ranges_adjust().
+ * Errors (with error bit) from: f_string_rangess_adjust().
+ * Errors (with error bit) from: f_uint8s_adjust().
+ * Errors (with error bit) from: f_uint8ss_adjust().
*
- * @see macro_f_string_rangess_t_adjust()
- * @see macro_f_string_ranges_t_adjust()
- * @see macro_f_uint8s_t_adjust()
- * @see macro_f_uint8ss_t_adjust()
+ * @see f_string_ranges_adjust()
+ * @see f_string_rangess_adjust()
+ * @see f_uint8s_adjust()
+ * @see f_uint8ss_adjust()
*
* @see f_fss_set_quote_adjust()
* @see f_fss_set_quote_decimate_by()
* @return
* F_none on success.
*
- * Errors (with error bit) from: macro_f_string_rangess_t_resize().
- * Errors (with error bit) from: macro_f_string_ranges_t_resize().
- * Errors (with error bit) from: macro_f_uint8s_t_resize().
- * Errors (with error bit) from: macro_f_uint8ss_t_resize().
+ * Errors (with error bit) from: f_string_ranges_resize().
+ * Errors (with error bit) from: f_string_rangess_resize().
+ * Errors (with error bit) from: f_uint8s_resize().
+ * Errors (with error bit) from: f_uint8ss_resize().
*
- * @see macro_f_string_rangess_t_resize()
- * @see macro_f_string_ranges_t_resize()
- * @see macro_f_uint8s_t_resize()
- * @see macro_f_uint8ss_t_resize()
+ * @see f_string_ranges_resize()
+ * @see f_string_rangess_resize()
+ * @see f_uint8s_resize()
+ * @see f_uint8ss_resize()
*
* @see f_fss_set_quote_decrease_by()
- * @see f_fss_set_quote_increase()
- * @see f_fss_set_quote_increase_by()
* @see f_fss_set_quote_resize()
*/
-#if !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_)
+#if !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_resize_)
extern f_status_t private_f_fss_set_quote_resize(const f_number_unsigned_t length, f_fss_set_quote_t * const set_quote) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_)
+#endif // !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_resize_)
/**
* Private implementation for resizing.
* The set_quotes to adjust.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_adjust().
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: macro_f_string_rangess_t_adjust().
- * Errors (with error bit) from: macro_f_string_ranges_t_adjust().
- * Errors (with error bit) from: macro_f_uint8s_t_adjust().
- * Errors (with error bit) from: macro_f_uint8ss_t_adjust().
- * Errors (with error bit) from: f_memory_adjust().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ * Errors (with error bit) from: f_string_ranges_adjust().
+ * Errors (with error bit) from: f_string_rangess_adjust().
+ * Errors (with error bit) from: f_uint8s_adjust().
+ * Errors (with error bit) from: f_uint8ss_adjust().
*
- * @see macro_f_string_rangess_t_adjust()
- * @see macro_f_string_ranges_t_adjust()
- * @see macro_f_uint8s_t_adjust()
- * @see macro_f_uint8ss_t_adjust()
+ * @see f_memory_array_adjust()
+ * @see f_string_ranges_adjust()
+ * @see f_string_rangess_adjust()
+ * @see f_uint8s_adjust()
+ * @see f_uint8ss_adjust()
*
+ * @see f_fss_set_quotes_decrease_by()
* @see f_fss_set_quotes_adjust()
- * @see f_fss_set_quotes_decimate_by()
* @see f_memory_adjust()
*/
#if !defined(_di_f_fss_set_quotes_adjust_) || !defined(_di_f_fss_set_quotes_decimate_by_)
* The set_quotes to resize.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_resize().
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: macro_f_string_rangess_t_resize().
- * Errors (with error bit) from: macro_f_string_ranges_t_resize().
- * Errors (with error bit) from: macro_f_uint8s_t_resize().
- * Errors (with error bit) from: macro_f_uint8ss_t_resize().
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ * Errors (with error bit) from: f_string_ranges_adjust().
+ * Errors (with error bit) from: f_string_rangess_adjust().
+ * Errors (with error bit) from: f_uint8s_adjust().
+ * Errors (with error bit) from: f_uint8ss_adjust().
*
- * @see macro_f_string_rangess_t_resize()
- * @see macro_f_string_ranges_t_resize()
- * @see macro_f_uint8s_t_resize()
- * @see macro_f_uint8ss_t_resize()
+ * @see f_memory_array_resize()
+ * @see f_string_ranges_adjust()
+ * @see f_string_rangess_adjust()
+ * @see f_uint8s_adjust()
+ * @see f_uint8ss_adjust()
*
* @see f_fss_set_quotes_decrease_by()
- * @see f_fss_set_quotes_increase()
- * @see f_fss_set_quotes_increase_by()
* @see f_fss_set_quotes_resize()
* @see f_memory_resize()
*/
-#if !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_increase_) || !defined(_di_f_fss_set_quotes_increase_by_) || !defined(_di_f_fss_set_quotes_resize_)
+#if !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_resize_)
extern f_status_t private_f_fss_set_quotes_resize(const f_number_unsigned_t length, f_fss_set_quotes_t * const set_quotes) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_increase_) || !defined(_di_f_fss_set_quotes_increase_by_) || !defined(_di_f_fss_set_quotes_resize_)
+#endif // !defined(_di_f_fss_set_quotes_decrease_by_) || !defined(_di_f_fss_set_quotes_resize_)
#ifdef __cplusplus
} // extern "C"
#if !defined(_di_f_fss_simple_packet_ranges_append_) || !defined(_di_f_fss_simple_packet_ranges_append_all_) || !defined(_di_f_fss_simple_packet_rangess_append_all_)
extern f_status_t private_f_fss_simple_packet_ranges_append_all(const f_fss_simple_packet_ranges_t source, f_fss_simple_packet_ranges_t *destination) {
- const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_fss_simple_packet_range_t), (void **) &destination->array, &destination->used, &destination->size);
- if (F_status_is_error(status)) return status;
+ {
+ const f_status_t status = f_memory_array_increase_by(source.used, sizeof(f_fss_simple_packet_range_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++] = source.array[i];
#if !defined(_di_f_fss_simple_packet_rangess_adjust_) || !defined(_di_f_fss_simple_packet_rangess_decimate_by_)
f_status_t private_f_fss_simple_packet_rangess_adjust(const f_number_unsigned_t length, f_fss_simple_packet_rangess_t *rangess) {
- f_status_t status = F_none;
+ {
+ f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < rangess->size; ++i) {
+ for (f_number_unsigned_t i = length; i < rangess->size; ++i) {
- status = f_memory_array_adjust(0, sizeof(f_fss_simple_packet_range_t), (void **) &rangess->array[i].array, &rangess->array[i].used, &rangess->array[i].size);
- if (F_status_is_error(status)) return status;
- } // for
+ status = f_memory_array_adjust(0, sizeof(f_fss_simple_packet_range_t), (void **) &rangess->array[i].array, &rangess->array[i].used, &rangess->array[i].size);
+ if (F_status_is_error(status)) return status;
+ } // for
+ }
return f_memory_array_adjust(length, sizeof(f_fss_simple_packet_ranges_t), (void **) &rangess->array, &rangess->used, &rangess->size);
}
#endif // !defined(_di_f_fss_simple_packet_rangess_adjust_) || !defined(_di_f_fss_simple_packet_rangess_decimate_by_)
-#if !defined(_di_f_fss_simple_packet_rangess_decrease_by_) || !defined(_di_f_fss_simple_packet_rangess_increase_) || !defined(_di_f_fss_simple_packet_rangess_increase_by_) || !defined(_di_f_fss_simple_packet_rangess_resize_)
+#if !defined(_di_f_fss_simple_packet_rangess_decrease_by_) || !defined(_di_f_fss_simple_packet_rangess_resize_)
f_status_t private_f_fss_simple_packet_rangess_resize(const f_number_unsigned_t length, f_fss_simple_packet_rangess_t *rangess) {
- f_status_t status = F_none;
+ {
+ f_status_t status = F_none;
- for (f_number_unsigned_t i = length; i < rangess->size; ++i) {
+ for (f_number_unsigned_t i = length; i < rangess->size; ++i) {
- status = f_memory_array_resize(0, sizeof(f_fss_simple_packet_range_t), (void **) &rangess->array[i].array, &rangess->array[i].used, &rangess->array[i].size);
- if (F_status_is_error(status)) return status;
- } // for
+ status = f_memory_array_resize(0, sizeof(f_fss_simple_packet_range_t), (void **) &rangess->array[i].array, &rangess->array[i].used, &rangess->array[i].size);
+ if (F_status_is_error(status)) return status;
+ } // for
+ }
return f_memory_array_resize(length, sizeof(f_fss_simple_packet_ranges_t), (void **) &rangess->array, &rangess->used, &rangess->size);
}
-#endif // !defined(_di_f_fss_simple_packet_rangess_decrease_by_) || !defined(_di_f_fss_simple_packet_rangess_increase_) || !defined(_di_f_fss_simple_packet_rangess_increase_by_) || !defined(_di_f_fss_simple_packet_rangess_resize_)
+#endif // !defined(_di_f_fss_simple_packet_rangess_decrease_by_) || !defined(_di_f_fss_simple_packet_rangess_resize_)
#ifdef __cplusplus
} // extern "C"
* The destination lengths the source is appended onto.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_increase().
*
- * Errors (with error bit) from: f_memory_resize().
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*
- * @see f_memory_resize()
* @see f_fss_simple_packet_ranges_append()
* @see f_fss_simple_packet_rangess_append()
*/
* The destination lengths the source is appended onto.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_increase_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_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*
- * @see f_memory_resize()
* @see f_fss_simple_packet_ranges_append_all()
* @see f_fss_simple_packet_rangess_append()
* @see f_fss_simple_packet_rangess_append_all()
* The rangess array to adjust.
*
* @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ * Success from f_memory_array_adjust().
*
- * F_array_too_large (with error bit) if new length is larger than max array length.
- * F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_adjust().
- * Errors (with error bit) from: f_memory_destroy().
+ * Errors (with error bit) from: f_memory_array_adjust().
+ *
+ * @see f_memory_array_adjust()
*
+ * @see f_fss_simple_packet_rangess_decrease_by()
* @see f_fss_simple_packet_rangess_adjust()
- * @see f_fss_simple_packet_rangess_decimate_by()
*/
#if !defined(_di_f_fss_simple_packet_rangess_adjust_) || !defined(_di_f_fss_simple_packet_rangess_decimate_by_)
extern f_status_t private_f_fss_simple_packet_rangess_adjust(const f_number_unsigned_t length, f_fss_simple_packet_rangess_t *rangess) F_attribute_visibility_internal_d;
* The rangess array to resize.
*
* @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
+ * Success from f_memory_array_resize().
*
- * F_array_too_large (with error bit) if new length is larger than max array length.
- * F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
- * Errors (with error bit) from: f_memory_delete().
- * Errors (with error bit) from: f_memory_resize().
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*
* @see f_fss_simple_packet_rangess_decrease_by()
- * @see f_fss_simple_packet_rangess_increase()
- * @see f_fss_simple_packet_rangess_increase_by()
* @see f_fss_simple_packet_rangess_resize()
*/
-#if !defined(_di_f_fss_simple_packet_rangess_decrease_by_) || !defined(_di_f_fss_simple_packet_rangess_increase_) || !defined(_di_f_fss_simple_packet_rangess_increase_by_) || !defined(_di_f_fss_simple_packet_rangess_resize_)
+#if !defined(_di_f_fss_simple_packet_rangess_decrease_by_) || !defined(_di_f_fss_simple_packet_rangess_resize_)
extern f_status_t private_f_fss_simple_packet_rangess_resize(const f_number_unsigned_t length, f_fss_simple_packet_rangess_t *rangess) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_fss_simple_packet_rangess_decrease_by_) || !defined(_di_f_fss_simple_packet_rangess_increase_) || !defined(_di_f_fss_simple_packet_rangess_increase_by_) || !defined(_di_f_fss_simple_packet_rangess_resize_)
+#endif // !defined(_di_f_fss_simple_packet_rangess_decrease_by_) || !defined(_di_f_fss_simple_packet_rangess_resize_)
#ifdef __cplusplus
} // extern "C"
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (set->objects.size - amount > 0) return private_f_fss_set_adjust(set->objects.size - amount, set);
- return private_f_fss_set_adjust(0, set);
+ return private_f_fss_set_adjust((set->objects.size - amount > 0) ? set->objects.size - amount : 0, set);
}
#endif // _di_f_fss_set_decimate_by_
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (set->objects.size - amount > 0) return private_f_fss_set_resize(set->objects.size - amount, set);
- return private_f_fss_set_resize(0, set);
+ return private_f_fss_set_resize((set->objects.size - amount > 0) ? set->objects.size - amount : 0, set);
}
#endif // _di_f_fss_set_decrease_by_
#endif // _di_level_0_parameter_checking_
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;
if (size > F_number_t_size_unsigned_d) {
if (!set) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (set->objects.used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ const f_number_unsigned_t length = set->objects.used + amount;
- if (set->objects.used + amount > set->objects.size) {
- if (set->objects.used + amount > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (length > set->objects.size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- return private_f_fss_set_resize(set->objects.used + amount, set);
+ return private_f_fss_set_resize(length, set);
+ }
}
return F_data_not;
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (sets->size - amount > 0) return private_f_fss_sets_adjust(sets->size - amount, sets);
- return private_f_fss_sets_adjust(0, sets);
+ return private_f_fss_sets_adjust((sets->size > amount) ? sets->size - amount : 0, sets);
}
#endif // _di_f_fss_sets_decimate_by_
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (sets->size - amount > 0) return private_f_fss_sets_resize(sets->size - amount, sets);
- return private_f_fss_sets_resize(0, sets);
+ return private_f_fss_sets_resize((sets->size > amount) ? sets->size - amount : 0, sets);
}
#endif // _di_f_fss_sets_decrease_by_
if (!sets) 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 (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);
-
- size = F_number_t_size_unsigned_d;
- }
-
- return private_f_fss_sets_resize(size, sets);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(f_fss_set_t), (void **) &sets->array, &sets->used, &sets->size);
}
#endif // _di_f_fss_sets_increase_
if (!sets) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (sets->used + amount > sets->size) {
- if (sets->used + amount > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
- return private_f_fss_sets_resize(sets->used + amount, sets);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(f_fss_set_t), (void **) &sets->array, &sets->used, &sets->size);
}
#endif // _di_f_fss_sets_increase_by_
#define macro_f_fss_sets_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_fss_sets_t_initialize_2(array, length) { array, length, length }
- #define macro_f_fss_sets_t_clear(sets) macro_f_memory_structure_t_clear(set.objects)
-
#define macro_f_fss_sets_t_resize(status, sets, length) status = f_fss_sets_resize(length, &sets);
#define macro_f_fss_sets_t_adjust(status, sets, length) status = f_fss_sets_adjust(length, &sets);
* @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_string_ranges_adjust().
+ * Errors (with error bit) from: f_string_rangess_adjust().
+ *
+ * @see f_string_ranges_adjust()
+ * @see f_string_rangess_adjust()
*/
#ifndef _di_f_fss_set_adjust_
extern f_status_t f_fss_set_adjust(const f_number_unsigned_t length, f_fss_set_t * const set);
* F_none on success.
* F_data_not if amount is 0.
*
- * 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_string_ranges_adjust().
+ * Errors (with error bit) from: f_string_rangess_adjust().
+ *
+ * @see f_string_ranges_adjust()
+ * @see f_string_rangess_adjust()
*/
#ifndef _di_f_fss_set_decimate_by_
extern f_status_t f_fss_set_decimate_by(const f_number_unsigned_t amount, f_fss_set_t * const set);
*
* @return
* F_none on success.
+ * F_data_not if amount is 0.
*
- * 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_string_ranges_resize().
+ * Errors (with error bit) from: f_string_rangess_resize().
+ *
+ * @see f_string_ranges_resize()
+ * @see f_string_rangess_resize()
*/
#ifndef _di_f_fss_set_decrease_by_
extern f_status_t f_fss_set_decrease_by(const f_number_unsigned_t amount, f_fss_set_t * const set);
* 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.
+ *
+ * @return
+ * Success from f_memory_array_resize().
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_fss_set_increase_
extern f_status_t f_fss_set_increase(const f_number_unsigned_t step, f_fss_set_t * const set);
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_array_too_large (with error bit) if the new array length is too large.
+ *
+ * @return
+ * Success from f_memory_array_resize().
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_fss_set_increase_by_
extern f_status_t f_fss_set_increase_by(const f_number_unsigned_t amount, f_fss_set_t * const set);
*
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @return
+ * Success from f_memory_array_resize().
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_fss_set_resize_
extern f_status_t f_fss_set_resize(const f_number_unsigned_t length, f_fss_set_t * const set);
*
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @return
+ * Success from f_memory_array_resize().
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_fss_sets_adjust_
extern f_status_t f_fss_sets_adjust(const f_number_unsigned_t length, f_fss_sets_t * const sets);
*
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @return
+ * Success from f_memory_array_resize().
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_fss_sets_decimate_by_
extern f_status_t f_fss_sets_decimate_by(const f_number_unsigned_t amount, f_fss_sets_t * const sets);
*
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @return
+ * Success from f_memory_array_resize().
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_fss_sets_decrease_by_
extern f_status_t f_fss_sets_decrease_by(const f_number_unsigned_t amount, f_fss_sets_t * const sets);
* 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.
+ *
+ * @return
+ * Success from f_memory_array_increase().
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_array_increase().
+ *
+ * @see f_memory_array_increase()
*/
#ifndef _di_f_fss_sets_increase_
extern f_status_t f_fss_sets_increase(const f_number_unsigned_t step, f_fss_sets_t * const sets);
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_array_too_large (with error bit) if the new array length is too large.
+ *
+ * @return
+ * Success from f_memory_array_increase_by().
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ *
+ * @see f_memory_array_increase_by()
*/
#ifndef _di_f_fss_sets_increase_by_
extern f_status_t f_fss_sets_increase_by(const f_number_unsigned_t amount, f_fss_sets_t * const sets);
* @param length
* The new size to use.
* @param sets
- * The sets array to adjust.
+ * The sets array to resize.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_resize().
*
- * 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_array_resize().
+ *
+ * @see f_memory_array_resize()
*/
#ifndef _di_f_fss_sets_resize_
extern f_status_t f_fss_sets_resize(const f_number_unsigned_t length, f_fss_sets_t * const sets);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (set_quote->objects.size - amount > 0) return private_f_fss_set_quote_adjust(set_quote->objects.size - amount, set_quote);
- return private_f_fss_set_quote_adjust(0, set_quote);
+ return private_f_fss_set_quote_adjust((set_quote->objects.size - amount > 0) ? set_quote->objects.size - amount : 0, set_quote);
}
#endif // _di_f_fss_set_quote_decimate_by_
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (set_quote->objects.size - amount > 0) return private_f_fss_set_quote_resize(set_quote->objects.size - amount, set_quote);
- return private_f_fss_set_quote_resize(0, set_quote);
+ return private_f_fss_set_quote_resize((set_quote->objects.size - amount > 0) ? set_quote->objects.size - amount : 0, set_quote);
}
#endif // _di_f_fss_set_quote_decrease_by_
#endif // _di_level_0_parameter_checking_
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;
if (size > F_number_t_size_unsigned_d) {
if (!set_quote) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (set_quote->objects.used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ const f_number_unsigned_t length = set_quote->objects.used + amount;
- if (set_quote->objects.used + amount > set_quote->objects.size) {
- if (set_quote->objects.used + amount > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (length > set_quote->objects.size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- return private_f_fss_set_quote_resize(set_quote->objects.used + amount, set_quote);
+ return private_f_fss_set_quote_resize(length, set_quote);
+ }
}
return F_data_not;
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (set_quotes->size - amount > 0) return private_f_fss_set_quotes_adjust(set_quotes->size - amount, set_quotes);
- return private_f_fss_set_quotes_adjust(0, set_quotes);
+ return private_f_fss_set_quotes_adjust((set_quotes->size > amount) ? set_quotes->size - amount : 0, set_quotes);
}
#endif // _di_f_fss_set_quotes_decimate_by_
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (set_quotes->size - amount > 0) return private_f_fss_set_quotes_resize(set_quotes->size - amount, set_quotes);
- return private_f_fss_set_quotes_resize(0, set_quotes);
+ return private_f_fss_set_quotes_resize((set_quotes->size > amount) ? set_quotes->size - amount : 0, set_quotes);
}
#endif // _di_f_fss_set_quotes_decrease_by_
if (!set_quotes) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (step && set_quotes->used + 1 > set_quotes->size) {
- f_number_unsigned_t size = set_quotes->used + step;
-
- if (size > F_number_t_size_unsigned_d) {
- if (set_quotes->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_fss_set_quotes_resize(size, set_quotes);
- }
-
- return F_data_not;
+ return f_memory_array_increase(step, sizeof(f_fss_set_quote_t), (void **) &set_quotes->array, &set_quotes->used, &set_quotes->size);
}
#endif // _di_f_fss_set_quotes_increase_
if (!set_quotes) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
-
- if (set_quotes->used + amount > set_quotes->size) {
- if (set_quotes->used + amount > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
- return private_f_fss_set_quotes_resize(set_quotes->used + amount, set_quotes);
- }
-
- return F_data_not;
+ return f_memory_array_increase_by(amount, sizeof(f_fss_set_quote_t), (void **) &set_quotes->array, &set_quotes->used, &set_quotes->size);
}
#endif // _di_f_fss_set_quotes_increase_by_
#define macro_f_fss_set_quotes_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_fss_set_quotes_t_initialize_2(array, length) { array, length, length }
- #define macro_f_fss_set_quotes_t_clear(nameds) macro_f_memory_structure_clear(nameds)
-
#define macro_f_fss_set_quotes_t_resize(status, set_quotes, length) status = f_fss_set_quotes_resize(length, &set_quotes);
#define macro_f_fss_set_quotes_t_adjust(status, set_quotes, length) status = f_fss_set_quotes_adjust(length, &set_quotes);
*
* 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_string_ranges_adjust().
+ * Errors (with error bit) from: f_string_rangess_adjust().
+ * Errors (with error bit) from: f_uint8s_adjust().
+ * Errors (with error bit) from: f_uint8ss_adjust().
+ *
+ * @see f_string_ranges_adjust()
+ * @see f_string_rangess_adjust()
+ * @see f_uint8s_adjust()
+ * @see f_uint8ss_adjust()
*/
#ifndef _di_f_fss_set_quote_adjust_
extern f_status_t f_fss_set_quote_adjust(const f_number_unsigned_t length, f_fss_set_quote_t * const set_quote);
*
* 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_string_ranges_adjust().
+ * Errors (with error bit) from: f_string_rangess_adjust().
+ * Errors (with error bit) from: f_uint8s_adjust().
+ * Errors (with error bit) from: f_uint8ss_adjust().
+ *
+ * @see f_string_ranges_adjust()
+ * @see f_string_rangess_adjust()
+ * @see f_uint8s_adjust()
+ * @see f_uint8ss_adjust()
*/
#ifndef _di_f_fss_set_quote_decimate_by_
extern f_status_t f_fss_set_quote_decimate_by(const f_number_unsigned_t amount, f_fss_set_quote_t * const set_quote);
*
* 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_string_ranges_resize().
+ * Errors (with error bit) from: f_string_rangess_resize().
+ * Errors (with error bit) from: f_uint8s_resize().
+ * Errors (with error bit) from: f_uint8ss_resize().
+ *
+ * @see f_string_ranges_resize()
+ * @see f_string_rangess_resize()
+ * @see f_uint8s_resize()
+ * @see f_uint8ss_resize()
*/
#ifndef _di_f_fss_set_quote_decrease_by_
extern f_status_t f_fss_set_quote_decrease_by(const f_number_unsigned_t amount, f_fss_set_quote_t * const set_quote);
* 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.
+ *
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_string_ranges_resize().
+ * Errors (with error bit) from: f_string_rangess_resize().
+ * Errors (with error bit) from: f_uint8s_resize().
+ * Errors (with error bit) from: f_uint8ss_resize().
+ *
+ * @see f_memory_array_increase()
+ * @see f_string_ranges_resize()
+ * @see f_string_rangess_resize()
+ * @see f_uint8s_resize()
+ * @see f_uint8ss_resize()
*/
#ifndef _di_f_fss_set_quote_increase_
extern f_status_t f_fss_set_quote_increase(const f_number_unsigned_t step, f_fss_set_quote_t * const set_quote);
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_array_too_large (with error bit) if the new array length is too large.
+ *
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ * Errors (with error bit) from: f_string_ranges_resize().
+ * Errors (with error bit) from: f_string_rangess_resize().
+ * Errors (with error bit) from: f_uint8s_resize().
+ * Errors (with error bit) from: f_uint8ss_resize().
+ *
+ * @see f_memory_array_increase_by()
+ * @see f_string_ranges_resize()
+ * @see f_string_rangess_resize()
+ * @see f_uint8s_resize()
+ * @see f_uint8ss_resize()
*/
#ifndef _di_f_fss_set_quote_increase_by_
extern f_status_t f_fss_set_quote_increase_by(const f_number_unsigned_t amount, f_fss_set_quote_t * const set_quote);
*
* 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_string_ranges_resize().
+ * Errors (with error bit) from: f_string_rangess_resize().
+ * Errors (with error bit) from: f_uint8s_resize().
+ * Errors (with error bit) from: f_uint8ss_resize().
+ *
+ * @see f_string_ranges_resize()
+ * @see f_string_rangess_resize()
+ * @see f_uint8s_resize()
+ * @see f_uint8ss_resize()
*/
#ifndef _di_f_fss_set_quote_resize_
extern f_status_t f_fss_set_quote_resize(const f_number_unsigned_t length, f_fss_set_quote_t * const set_quote);
*
* 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_string_ranges_adjust().
+ * Errors (with error bit) from: f_string_rangess_adjust().
+ * Errors (with error bit) from: f_uint8s_adjust().
+ * Errors (with error bit) from: f_uint8ss_adjust().
+ *
+ * @see f_string_ranges_adjust()
+ * @see f_string_rangess_adjust()
+ * @see f_uint8s_adjust()
+ * @see f_uint8ss_adjust()
*/
#ifndef _di_f_fss_set_quotes_adjust_
extern f_status_t f_fss_set_quotes_adjust(const f_number_unsigned_t length, f_fss_set_quotes_t * const set_quotes);
*
* 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_string_ranges_adjust().
+ * Errors (with error bit) from: f_string_rangess_adjust().
+ * Errors (with error bit) from: f_uint8s_adjust().
+ * Errors (with error bit) from: f_uint8ss_adjust().
+ *
+ * @see f_string_ranges_adjust()
+ * @see f_string_rangess_adjust()
+ * @see f_uint8s_adjust()
+ * @see f_uint8ss_adjust()
*/
#ifndef _di_f_fss_set_quotes_decimate_by_
extern f_status_t f_fss_set_quotes_decimate_by(const f_number_unsigned_t amount, f_fss_set_quotes_t * const set_quotes);
*
* 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_string_ranges_resize().
+ * Errors (with error bit) from: f_string_rangess_resize().
+ * Errors (with error bit) from: f_uint8s_resize().
+ * Errors (with error bit) from: f_uint8ss_resize().
+ *
+ * @see f_string_ranges_resize()
+ * @see f_string_rangess_resize()
+ * @see f_uint8s_resize()
+ * @see f_uint8ss_resize()
*/
#ifndef _di_f_fss_set_quotes_decrease_by_
extern f_status_t f_fss_set_quotes_decrease_by(const f_number_unsigned_t amount, f_fss_set_quotes_t * const set_quotes);
* 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.
+ *
+ * Errors (with error bit) from: f_memory_array_increase().
+ * Errors (with error bit) from: f_string_ranges_resize().
+ * Errors (with error bit) from: f_string_rangess_resize().
+ * Errors (with error bit) from: f_uint8s_resize().
+ * Errors (with error bit) from: f_uint8ss_resize().
+ *
+ * @see f_memory_array_increase()
+ * @see f_string_ranges_resize()
+ * @see f_string_rangess_resize()
+ * @see f_uint8s_resize()
+ * @see f_uint8ss_resize()
*/
#ifndef _di_f_fss_set_quotes_increase_
extern f_status_t f_fss_set_quotes_increase(const f_number_unsigned_t step, f_fss_set_quotes_t * const set_quotes);
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_array_too_large (with error bit) if the new array length is too large.
+ *
+ * Errors (with error bit) from: f_memory_array_increase_by().
+ * Errors (with error bit) from: f_string_ranges_resize().
+ * Errors (with error bit) from: f_string_rangess_resize().
+ * Errors (with error bit) from: f_uint8s_resize().
+ * Errors (with error bit) from: f_uint8ss_resize().
+ *
+ * @see f_memory_array_increase_by()
+ * @see f_string_ranges_resize()
+ * @see f_string_rangess_resize()
+ * @see f_uint8s_resize()
+ * @see f_uint8ss_resize()
*/
#ifndef _di_f_fss_set_quotes_increase_by_
extern f_status_t f_fss_set_quotes_increase_by(const f_number_unsigned_t amount, f_fss_set_quotes_t * const set_quotes);
* @param length
* The new size to use.
* @param set_quotes
- * The set_quotes array to adjust.
+ * The set_quotes array to resize.
*
* @return
- * F_none on success.
+ * Success from f_memory_array_resize().
*
- * 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_string_ranges_resize().
+ * Errors (with error bit) from: f_string_rangess_resize().
+ * Errors (with error bit) from: f_uint8s_resize().
+ * Errors (with error bit) from: f_uint8ss_resize().
+ *
+ * @see f_string_ranges_resize()
+ * @see f_string_rangess_resize()
+ * @see f_uint8s_resize()
+ * @see f_uint8ss_resize()
*/
#ifndef _di_f_fss_set_quotes_resize_
extern f_status_t f_fss_set_quotes_resize(const f_number_unsigned_t length, f_fss_set_quotes_t * const set_quotes);
#define macro_f_fss_simple_packet_ranges_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_fss_simple_packet_ranges_t_initialize_2(array, length) { array, length, length }
- #define macro_f_fss_simple_packet_ranges_t_clear(simple_packet_ranges) macro_f_memory_structure_t_clear(simple_packet_range.objects)
-
#define macro_f_fss_simple_packet_ranges_t_resize(status, simple_packet_ranges, length) status = f_fss_simple_packet_ranges_resize(length, &simple_packet_ranges);
#define macro_f_fss_simple_packet_ranges_t_adjust(status, simple_packet_ranges, length) status = f_fss_simple_packet_ranges_adjust(length, &simple_packet_ranges);
#define macro_f_fss_simple_packet_rangess_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_fss_simple_packet_rangess_t_initialize_2(array, length) { array, length, length }
- #define macro_f_fss_simple_packet_rangess_t_clear(simple_packet_rangess) macro_f_memory_structure_t_clear(simple_packet_ranges.objects)
-
#define macro_f_fss_simple_packet_rangess_t_resize(status, simple_packet_rangess, length) status = f_fss_simple_packet_rangess_resize(length, &simple_packet_rangess);
#define macro_f_fss_simple_packet_rangess_t_adjust(status, simple_packet_rangess, length) status = f_fss_simple_packet_rangess_adjust(length, &simple_packet_rangess);
* @param length
* The new size to use.
* @param rangess
- * The rangess array to adjust.
+ * The rangess array to resize.
*
* @return
* Success from f_memory_array_resize().
#define macro_f_iki_datas_t_initialize_1(content, size, used) { array, size, used }
#define macro_f_iki_datas_t_initialize_2(array, length) { array, length, length }
- #define macro_f_iki_datas_t_clear(datas) macro_f_memory_structure_clear(datas)
-
#define macro_f_iki_datas_t_resize(status, datas, length) status = f_iki_datas_resize(length, &datas);
#define macro_f_iki_datas_t_adjust(status, datas, length) status = f_iki_datas_adjust(length, &datas);
#define macro_f_iki_datass_t_initialize_1(content, size, used) { array, size, used }
#define macro_f_iki_datass_t_initialize_2(array, length) { array, length, length }
- #define macro_f_iki_datass_t_clear(datas) macro_f_memory_structure_clear(datas)
-
#define macro_f_iki_datass_t_resize(status, datas, length) status = f_iki_datass_resize(length, &datas);
#define macro_f_iki_datass_t_adjust(status, datas, length) status = f_iki_datass_adjust(length, &datas);
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
-
- if (datas->size > amount) {
- return private_f_iki_datas_adjust(datas->size - amount, datas);
- }
+ if (datas->size > amount) return private_f_iki_datas_adjust(datas->size - amount, datas);
return private_f_iki_datas_adjust(0, datas);
}
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
-
- if (datas->size > amount) {
- return private_f_iki_datas_resize(datas->size - amount, datas);
- }
+ if (datas->size > amount) return private_f_iki_datas_resize(datas->size - amount, datas);
return private_f_iki_datas_resize(0, datas);
}
#endif // _di_level_0_parameter_checking_
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;
if (size > 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);
- }
+ 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;
}
if (!datas) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (datas->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (datas->used + amount > datas->size) {
- if (datas->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = datas->used + amount;
- return private_f_iki_datas_resize(datas->used + amount, datas);
+ if (length > datas->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_iki_datas_resize(length, datas);
+ }
}
return F_data_not;
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
-
- if (datass->size > amount) {
- return private_f_iki_datass_adjust(datass->size - amount, datass);
- }
+ if (datass->size > amount) return private_f_iki_datass_adjust(datass->size - amount, datass);
return private_f_iki_datass_adjust(0, datass);
}
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
-
- if (datass->size > amount) {
- return private_f_iki_datass_resize(datass->size - amount, datass);
- }
+ if (datass->size > amount) return private_f_iki_datass_resize(datass->size - amount, datass);
return private_f_iki_datass_resize(0, datass);
}
#endif // _di_level_0_parameter_checking_
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;
if (size > 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);
- }
+ 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;
}
if (!datass) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (datass->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (datass->used + amount > datass->size) {
- if (datass->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = datass->used + amount;
- return private_f_iki_datass_resize(datass->used + amount, datass);
+ if (length > datass->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_iki_datass_resize(length, datass);
+ }
}
return F_data_not;
#if !defined(_di_f_iki_datas_adjust_) || !defined(_di_f_iki_datas_decimate_by_)
f_status_t private_f_iki_datas_adjust(const f_number_unsigned_t length, f_iki_datas_t *datas) {
- if (datas->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (datas->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (datas->used + length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
f_status_t status = F_none;
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_adjust(datas->size, length, sizeof(f_iki_data_t), (void **) & datas->array);
- if (F_status_is_error(status)) return status;
-
- datas->size = length;
-
- if (datas->used > datas->size) {
- datas->used = length;
- }
-
- return F_none;
+ return f_memory_array_adjust(length, sizeof(f_iki_data_t), (void **) &datas->array, &datas->used, &datas->size);
}
#endif // !defined(_di_f_iki_datas_adjust_) || !defined(_di_f_iki_datas_decimate_by_)
#if !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datas_decrease_by_) || !defined(_di_f_iki_datas_increase_) || !defined(_di_f_iki_datas_increase_by_) || !defined(_di_f_iki_datas_resize_)
f_status_t private_f_iki_datas_resize(const f_number_unsigned_t length, f_iki_datas_t *datas) {
- if (datas->used + length > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (datas->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (datas->used + length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
f_status_t status = F_none;
if (F_status_is_error(status)) return status;
} // for
- status = f_memory_resize(datas->size, length, sizeof(f_iki_data_t), (void **) & datas->array);
- if (F_status_is_error(status)) return status;
-
- datas->size = length;
-
- if (datas->used > datas->size) {
- datas->used = length;
- }
-
- return F_none;
+ return f_memory_array_resize(length, sizeof(f_iki_data_t), (void **) &datas->array, &datas->used, &datas->size);
}
#endif // !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datas_decrease_by_) || !defined(_di_f_iki_datas_increase_) || !defined(_di_f_iki_datas_increase_by_) || !defined(_di_f_iki_datas_resize_)
for (f_number_unsigned_t i = length; i < datass->size; ++i) {
- status = f_memory_destroy(datass->array[i].size, sizeof(f_iki_datas_t), (void **) & datass->array[i].array);
+ status = private_f_iki_datas_adjust(0, &datass->array[i]);
if (F_status_is_error(status)) return status;
-
- datass->array[i].size = 0;
- datass->array[i].used = 0;
} // for
status = f_memory_adjust(datass->size, length, sizeof(f_iki_datas_t), (void **) & datass->array);
#define macro_f_limit_sets_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_limit_sets_t_initialize_2(array, length) { array, length, length }
- #define macro_f_limit_sets_t_clear(sets) macro_f_memory_structure_clear(sets)
-
#define macro_f_limit_sets_t_resize(status, sets, length) status = f_limit_sets_resize(length, &sets);
#define macro_f_limit_sets_t_adjust(status, sets, length) status = f_limit_sets_adjust(length, &sets);
#define macro_f_limit_setss_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_limit_setss_t_initialize_2(array, length) { array, length, length }
- #define macro_f_limit_setss_t_clear(setss) macro_f_memory_structure_clear(setss);
-
#define macro_f_limit_setss_t_resize(status, setss, length) status = f_limit_setss_resize(length, &setss);
#define macro_f_limit_setss_t_adjust(status, setss, length) status = f_limit_setss_adjust(length, &setss);
#define macro_f_limit_values_t_initialize_1(content, size, used) { array, size, used }
#define macro_f_limit_values_t_initialize_2(array, length) { array, length, length }
- #define macro_f_limit_values_t_clear(values) macro_f_memory_structure_clear(values)
-
#define macro_f_limit_values_t_resize(status, values, length) status = f_limit_values_resize(length, &values);
#define macro_f_limit_values_t_adjust(status, values, length) status = f_limit_values_adjust(length, &values);
#define macro_f_limit_valuess_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_limit_valuess_t_initialize_2(array, length) { array, length, length }
- #define macro_f_limit_valuess_t_clear(valuess) macro_f_memory_structure_clear(valuess);
-
#define macro_f_limit_valuess_t_resize(status, valuess, length) status = f_limit_valuess_resize(length, &valuess);
#define macro_f_limit_valuess_t_adjust(status, valuess, length) status = f_limit_valuess_adjust(length, &valuess);
// FLL-0 memory includes.
#include <fll/level_0/memory/common.h>
#include <fll/level_0/memory/array.h>
-#include <fll/level_0/memory/structure.h>
#ifdef __cplusplus
extern "C" {
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (*size > amount) return private_f_memory_array_adjust(*size - amount, width, array, used, size);
- return private_f_memory_array_adjust(0, width, array, used, size);
+ return private_f_memory_array_adjust((*size > amount) ? *size - amount : 0, width, array, used, size);
}
#endif // _di_f_memory_array_decimate_by_
#endif // _di_level_0_parameter_checking_
if (!amount) return F_data_not;
- if (*size > amount) return private_f_memory_array_resize(*size - amount, width, array, used, size);
- return private_f_memory_array_resize(0, width, array, used, size);
+ return private_f_memory_array_resize((*size > amount) ? *size - amount : 0, width, array, used, size);
}
#endif // _di_f_memory_array_decrease_by_
#endif // _di_level_0_parameter_checking_
if (step && *used + 1 > *size) {
- f_number_unsigned_t length = *used + step;
+ if (*used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (step > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ f_number_unsigned_t length = *used + step;
- if (*size > F_number_t_size_unsigned_d) {
+ if (length > F_number_t_size_unsigned_d) {
if (*used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (*used + length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
length = F_number_t_size_unsigned_d;
}
if (!size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (*used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (*used + amount > *size) {
- if (*used + amount > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ const f_number_unsigned_t length = *used + amount;
- return private_f_memory_array_resize(*used + amount, width, array, used, size);
+ if (length > *size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_memory_array_resize(length, width, array, used, size);
+ }
}
return F_data_not;
if (!size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
+ if (*used > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
return private_f_memory_array_resize(length, width, array, used, size);
#define F_memory_default_allocation_small_d 8
#endif // _di_f_memory_default_d_
-/**
- * Reset a generic memory stucture to 0 (clear all values).
- *
- * This does not deallocate memory, be certain that memory is not allocated before calling this to avoid potential memory leaks.
- *
- * structure: the structure to operate on.
- */
-#ifndef _di_macro_f_memory_structure_clear_
- #define macro_f_memory_structure_clear(structure) \
- structure.array = 0; \
- structure.size = 0; \
- structure.used = 0;
-#endif // _di_macro_f_memory_structure_clear_
-
-/**
- * Resize a generic memory structure.
- *
- * status: the status to return.
- * structure: the structure to operate on.
- * type: the structure type.
- * length: the new size of the array.
- */
-#ifndef _di_macro_f_memory_structure_resize_
- #define macro_f_memory_structure_resize(status, structure, type, length) \
- status = f_memory_structure_resize(length, sizeof(type), (void **) &structure.array, &structure.used, &structure.size);
-#endif // _di_macro_f_memory_structure_resize_
-
-/**
- * Adjust a generic memory structure.
- *
- * status: the status to return.
- * structure: the structure to operate on.
- * type: the structure type.
- * length: the new size of the array.
- */
-#ifndef _di_macro_f_memory_structure_adjust_
- #define macro_f_memory_structure_adjust(status, structure, type, length) \
- status = f_memory_structure_adjust(length, sizeof(type), (void **) &structure.array, &structure.used, &structure.size);
-#endif // _di_macro_f_memory_structure_adjust_
-
-/**
- * Delete a generic memory structure.
- *
- * status: the status to return.
- * structure: the structure to operate on.
- * type: the structure type.
- */
-#ifndef _di_macro_f_memory_structure_delete_
- #define macro_f_memory_structure_delete(status, structure, type) \
- status = f_memory_structure_resize(0, sizeof(type), (void **) &structure.array, &structure.used, &structure.size);
-#endif // _di_macro_f_memory_structure_delete_
-
-/**
- * Destroy a generic memory structure.
- *
- * status: the status to return.
- * structure: the structure to operate on.
- * type: the structure type.
- */
-#ifndef _di_macro_f_memory_structure_destroy_
- #define macro_f_memory_structure_destroy(status, structure, type) \
- status = f_memory_structure_adjust(0, sizeof(type), (void **) &structure.array, &structure.used, &structure.size);
-#endif // _di_macro_f_memory_structure_destroy_
-
-/**
- * Delete a generic memory structure.
- *
- * structure: the structure to operate on.
- * type: the structure type.
- */
-#ifndef _di_macro_f_memory_structure_delete_simple_
- #define macro_f_memory_structure_delete_simple(structure, type) \
- f_memory_structure_resize(0, sizeof(type), (void **) &structure.array, &structure.used, &structure.size);
-#endif // _di_macro_f_memory_structure_delete_simple_
-
-/**
- * Destroy a generic memory structure.
- *
- * structure: the structure to operate on.
- * type: the structure type.
- */
-#ifndef _di_macro_f_memory_structure_destroy_simple_
- #define macro_f_memory_structure_destroy_simple(structure, type) \
- f_memory_structure_adjust(0, sizeof(type), (void **) &structure.array, &structure.used, &structure.size);
-#endif // _di_macro_f_memory_structure_destroy_simple_
-
-/**
- * Increase a generic memory structure.
- *
- * status: The status to return.
- * step: The allocation step.
- * structure: The structure to operate on.
- * type: The structure type.
- */
-#ifndef _di_macro_f_memory_structure_increase_
- #define macro_f_memory_structure_increase(status, step, structure, type) \
- status = f_memory_structure_increase(step, sizeof(type), (void **) &structure.array, &structure.used, &structure.size);
-#endif // _di_macro_f_memory_structure_increase_
-
-/**
- * Increase a generic memory structure by some amount.
- *
- * status: The status to return.
- * structure: The structure to operate on.
- * type: The structure type.
- * amount: The amount to increase the size of the array by.
- */
-#ifndef _di_macro_f_memory_structure_increase_by_
- #define macro_f_memory_structure_increase_by(status, structure, type, amount) \
- status = f_memory_structure_increase_by(amount, sizeof(type), (void **) &structure.array, &structure.used, &structure.size);
-#endif // _di_macro_f_memory_structure_increase_by_
-
-/**
- * Decrease a generic memory structure by some amount.
- *
- * status: The status to return.
- * structure: The structure to operate on.
- * type: The structure type.
- * amount: The amount to decrease the size of the array by.
- */
-#ifndef _di_macro_f_memory_structure_decrease_by_
- #define macro_f_memory_structure_decrease_by(status, structure, type, amount) \
- status = f_memory_structure_decrease_by(amount, sizeof(type), (void **) &structure.array, &structure.used, &structure.size);
-#endif // _di_macro_f_memory_structure_decrease_by_
-
-/**
- * Decimate a generic memory structure by some amount.
- *
- * status: The status to return.
- * structure: The structure to operate on.
- * type: The structure type.
- * amount: The amount to decimate the size of the array by.
- */
-#ifndef _di_macro_f_memory_structure_decimate_by_
- #define macro_f_memory_structure_decimate_by(status, structure, type, amount) \
- status = f_memory_structure_decimate_by(amount, sizeof(type), (void **) &structure.array, &structure.used, &structure.size);
-#endif // _di_macro_f_memory_structure_decimate_by_
-
-/**
- * Reset a generic memory stuctures to 0 (clear all values).
- *
- * This does not deallocate memory, be certain that memory is not allocated before calling this to avoid potential memory leaks.
- *
- * structures: the structures to operate on.
- */
-#ifndef _di_macro_f_memory_structures_clear_
- #define macro_f_memory_structures_clear(structures) \
- structures.array = 0; \
- structures.size = 0; \
- structures.used = 0;
-#endif // _di_macro_f_memory_structures_clear_
-
-/**
- * Resize a generic memory structures.
- *
- * status: The status to return.
- * structures: The structures to operate on.
- * type_stucture: The structure type.
- * type_stuctures: The structures type.
- * length: The new size of the array.
- * type_length: The data type of the length variable type.
- */
-#ifndef _di_macro_f_memory_structures_resize_
- #define macro_f_memory_structures_resize(status, structures, type_structure, type_structures, length, type_length) \
- status = F_none; \
- for (register type_length _macro__i = length; _macro__i < structures.size; ++_macro__i) { \
- status = f_memory_structure_resize(0, sizeof(type_structure), (void **) &structures.array[_macro__i].array, &structures.array[_macro__i].used, &structures.array[_macro__i].size); \
- if (F_status_is_error(status)) break; \
- } \
- if (F_status_is_error_not(status)) status = f_memory_structure_resize(0, sizeof(type_structures), (void **) &structures.array, &structures.used, &structures.size);
-#endif // _di_macro_f_memory_structures_resize_
-
-/**
- * Adjust a generic memory structures.
- *
- * status: The status to return.
- * structures: The structures to operate on.
- * type_stucture: The structure type.
- * type_stuctures: The structures type.
- * length: The new size of the array.
- * type_length: The data type of the length variable type.
- */
-#ifndef _di_macro_f_memory_structures_adjust_
- #define macro_f_memory_structures_adjust(status, structures, type_structure, type_structures, length, type_length) \
- status = F_none; \
- for (register type_length _macro__i = length; _macro__i < structures.size; ++_macro__i) { \
- status = f_memory_structure_adjust(0, sizeof(type_structure), (void **) &structures.array[_macro__i].array, &structures.array[_macro__i].used, &structures.array[_macro__i].size); \
- if (F_status_is_error(status)) break; \
- } \
- if (F_status_is_error_not(status)) status = f_memory_structure_adjust(0, sizeof(type_structures), (void **) &structures.array, &structures.used, &structures.size);
-#endif // _di_macro_f_memory_structures_adjust_
-
-/**
- * Delete a generic memory structures.
- *
- * status: The status to return.
- * structures: The structures to operate on.
- * type_stucture: The structure type.
- * type_stuctures: The structures type.
- */
-#ifndef _di_macro_f_memory_structures_delete_
- #define macro_f_memory_structures_delete(status, structures, type_structure, type_structures) \
- structures.used = structures.size; \
- while (structures.used) { \
- --structures.used; \
- status = f_memory_structure_resize(0, sizeof(type_structure), (void **) &structures.array[structures.used].array, &structures.array[structures.used].used, &structures.array[structures.used].size); \
- if (F_status_is_error(status)) break; \
- } \
- if (F_status_is_error_not(status)) status = f_memory_structure_resize(0, sizeof(type_structures), (void **) & structures.array, &structures.used, &structures.size);
-#endif // _di_macro_f_memory_structures_delete_
-
-/**
- * Destroy a generic memory structures.
- *
- * status: The status to return.
- * structures: The structures to operate on.
- * type_stucture: The structure type.
- * type_stuctures: The structures type.
- */
-#ifndef _di_macro_f_memory_structures_destroy_
- #define macro_f_memory_structures_destroy(status, structures, type_structure, type_structures) \
- structures.used = structures.size; \
- while (structures.used) { \
- --structures.used; \
- status = f_memory_structure_adjust(0, sizeof(type_structure), (void **) &structures.array[structures.used].array, &structures.array[structures.used].used, &structures.array[structures.used].size); \
- if (F_status_is_error(status)) break; \
- } \
- if (F_status_is_error_not(status)) status = f_memory_structure_adjust(0, sizeof(type_structures), (void **) & structures.array, &structures.used, &structures.size);
-#endif // _di_macro_f_memory_structures_destroy_
-
-/**
- * Delete a generic memory structures.
- *
- * structures: The structures to operate on.
- * type_stucture: The structure type.
- * type_stuctures: The structures type.
- */
-#ifndef _di_macro_f_memory_structures_delete_simple_
- #define macro_f_memory_structures_delete_simple(structures, type_structure, type_structures) \
- structures.used = structures.size; \
- while (structures.used) { \
- --structures.used; \
- f_memory_structure_resize(0, sizeof(type_structure), (void **) &structures.array[structures.used].array, &structures.array[structures.used].used, &structures.array[structures.used].size); \
- } \
- f_memory_structure_resize(0, sizeof(type_structures), (void **) & structures.array, &structures.used, &structures.size);
-#endif // _di_macro_f_memory_structures_delete_simple_
-
-/**
- * Destroy a generic memory structures.
- *
- * structures: The structures to operate on.
- * type_stucture: The structure type.
- * type_stuctures: The structures type.
- */
-#ifndef _di_macro_f_memory_structures_destroy_simple_
- #define macro_f_memory_structures_destroy_simple(structures, type_structure, type_structures) \
- structures.used = structures.size; \
- while (structures.used) { \
- --structures.used; \
- f_memory_structure_adjust(0, sizeof(type_structure), (void **) &structures.array[structures.used].array, &structures.array[structures.used].used, &structures.array[structures.used].size); \
- } \
- f_memory_structure_adjust(0, sizeof(type_structures), (void **) & structures.array, &structures.used, &structures.size);
-#endif // _di_macro_f_memory_structures_destroy_simple_
-
-/**
- * Increase a generic memory structures by 1.
- *
- * This only increases if the structure.used + 1 is greater than structure.size.
- *
- * status: The status to return.
- * structures: The structures to operate on.
- * type_stuctures: The structures type.
- * type_length: The data type of the length variable type.
- */
-#ifndef _di_macro_f_memory_structures_increase_
- #define macro_f_memory_structures_increase(status, structures, type_structures, type_length) \
- status = f_memory_structure_increase(sizeof(type_structures), (void **) &structures.array, &structures.used, &structures.size);
-#endif // _di_macro_f_memory_structures_increase_
-
-/**
- * Increase a generic memory structures by the given amount.
- *
- * This only increases if the structure.used + amount is greater than structure.size.
- *
- * status: The status to return.
- * structures: The structures to operate on.
- * type_stuctures: The structures type.
- * type_length: The data type of the length variable type.
- * amount: The amount to increase by.
- */
-#ifndef _di_macro_f_memory_structures_increase_by_
- #define macro_f_memory_structures_increase_by(status, structures, type_structures, type_length, amount) \
- status = f_memory_structure_increase_by(amount, sizeof(type_structures), (void **) &structures.array, &structures.used, &structures.size);
-#endif // _di_macro_f_memory_structures_increase_by_
-
-/**
- * Decrease a generic memory structures by the given amount.
- *
- * status: The status to return.
- * structures: The structures to operate on.
- * type_stucture: The structure type.
- * type_stuctures: The structures type.
- * type_length: The data type of the length variable type.
- * amount: The amount to decrease by.
- */
-#ifndef _di_macro_f_memory_structures_decrease_by_
- #define macro_f_memory_structures_decrease_by(status, structures, type_structure, type_structures, type_length, amount) \
- if (amount && structures.size) { \
- macro_f_memory_structures_resize(status, structures, type_structure, type_structures, (amount < structures.size ? structures.size - amount : 0), type_length); \
- } \
- status = f_memory_structure_decrease_by(amount, sizeof(type_structures), (void **) &structures.array, &structures.used, &structures.size);
-#endif // _di_macro_f_memory_structures_decrease_by_
-
-/**
- * Decimate a generic memory structures by the given amount.
- *
- * status: The status to return.
- * structures: The structures to operate on.
- * type_stucture: The structure type.
- * type_stuctures: The structures type.
- * type_length: The data type of the length variable type.
- * amount: The amount to decimate by.
- */
-#ifndef _di_macro_f_memory_structures_decimate_by_
- #define macro_f_memory_structures_decimate_by(status, structures, type_structure, type_structures, type_length, amount) \
- if (amount && structures.size) { \
- macro_f_memory_structures_adjust(status, structures, type_structure, type_structures, (amount < structures.size ? structures.size - amount : 0), type_length); \
- } \
- status = f_memory_structure_decimate_by(amount, sizeof(type_structures), (void **) &structures.array, &structures.used, &structures.size);
-#endif // _di_macro_f_memory_structures_decimate_by_
-
-/**
- * Provide a macro for calling other macros for incrementing a buffer.
- *
- * If the used + step is greater than size, then increase by step_default.
- * If step_default exceeds F_number_t_size_unsigned_d, then attempt to increment by step.
- * If step exceeds F_number_t_size_unsigned_d, set status to error_too_large.
- *
- * Be sure to check size for error after calling this.
- *
- * status: The status to return.
- * structures: The structures to operate on.
- * step: The step to increase by, must be less than or equal to step_default.
- * step_default: The default step to increase by if memory allows.
- * macro_resize: The resize structure macro to call that excepts the exact arguments: (status, structure, length).
- * error_too_large: The error status to return when F_number_t_size_unsigned_d would be exceeded.
- */
-#ifndef _di_macro_f_memory_structure_increment_
- #define macro_f_memory_structure_increment(status, structure, step, step_default, macro_resize, error_too_large) \
- if (structure.used + step > structure.size) { \
- if (structure.used + step_default > F_number_t_size_unsigned_d) { \
- if (structure.used + step > F_number_t_size_unsigned_d) { \
- status = F_status_set_error(error_too_large); \
- } \
- else { \
- macro_resize(status, structure, structure.used + step); \
- } \
- } \
- else { \
- macro_resize(status, structure, structure.size + step_default); \
- } \
- }
-#endif // _di_macro_f_memory_structure_increment_
-
#ifdef __cplusplus
} // extern "C"
#endif
+++ /dev/null
-#include "../memory.h"
-#include "../private-memory.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _di_f_memory_structure_adjust_
- f_status_t f_memory_structure_adjust(const size_t length_new, const size_t type_size, void ** const structure, f_number_unsigned_t * const used, f_number_unsigned_t * const size) {
- #ifndef _di_level_0_parameter_checking_
- if (!type_size) return F_status_set_error(F_parameter);
- if (!structure) return F_status_set_error(F_parameter);
- if (!used) return F_status_set_error(F_parameter);
- if (!size) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- // Prevent double-frees and unnecessary frees.
- if (!*structure && !length_new || *size == length_new) return F_data_not;
-
- return private_f_memory_structure_adjust(length_new, type_size, structure, used, size);
- }
-#endif // _di_f_memory_structure_adjust_
-
-#ifndef _di_f_memory_structure_decimate_by_
- f_status_t f_memory_structure_decimate_by(const f_number_unsigned_t amount, const size_t type_size, void ** const structure, f_number_unsigned_t * const used, f_number_unsigned_t * const size) {
- #ifndef _di_level_0_parameter_checking_
- if (!type_size) return F_status_set_error(F_parameter);
- if (!structure) return F_status_set_error(F_parameter);
- if (!used) return F_status_set_error(F_parameter);
- if (!size) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (amount && *size) return private_f_memory_structure_adjust(amount <= *size ? *size - amount : 0, type_size, structure, used, size);
-
- return F_data_not;
- }
-#endif // _di_f_memory_structure_decimate_by_
-
-#ifndef _di_f_memory_structure_decrease_by_
- f_status_t f_memory_structure_decrease_by(const f_number_unsigned_t amount, const size_t type_size, void ** const structure, f_number_unsigned_t * const used, f_number_unsigned_t * const size) {
- #ifndef _di_level_0_parameter_checking_
- if (!type_size) return F_status_set_error(F_parameter);
- if (!structure) return F_status_set_error(F_parameter);
- if (!used) return F_status_set_error(F_parameter);
- if (!size) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (amount && *size) return private_f_memory_structure_resize(amount <= *size ? *size - amount : 0, type_size, structure, used, size);
-
- return F_data_not;
- }
-#endif // _di_f_memory_structure_decrease_by_
-
-#ifndef _di_f_memory_structure_increase_
- f_status_t f_memory_structure_increase(const f_number_unsigned_t step, const size_t type_size, void ** const structure, f_number_unsigned_t * const used, f_number_unsigned_t * const size) {
- #ifndef _di_level_0_parameter_checking_
- if (!step) return F_status_set_error(F_parameter);
- if (!type_size) return F_status_set_error(F_parameter);
- if (!structure) return F_status_set_error(F_parameter);
- if (!used) return F_status_set_error(F_parameter);
- if (!size) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (*used + 1 > *size) {
- f_number_unsigned_t length_new = *used + step;
-
- if (length_new > F_number_t_size_unsigned_d) {
- if (*used + 1 > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
- length_new = F_number_t_size_unsigned_d;
- }
-
- return private_f_memory_structure_resize(length_new, type_size, structure, used, size);
- }
-
- return F_data_not;
- }
-#endif // _di_f_memory_structure_increase_
-
-#ifndef _di_f_memory_structure_increase_by_
- f_status_t f_memory_structure_increase_by(const f_number_unsigned_t amount, const size_t type_size, void ** const structure, f_number_unsigned_t * const used, f_number_unsigned_t * const size) {
- #ifndef _di_level_0_parameter_checking_
- if (!type_size) return F_status_set_error(F_parameter);
- if (!structure) return F_status_set_error(F_parameter);
- if (!used) return F_status_set_error(F_parameter);
- if (!size) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- if (amount && *used + amount > *size) {
- if (*used + amount > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
-
- return private_f_memory_structure_resize(*used + amount, type_size, structure, used, size);
- }
-
- return F_data_not;
- }
-#endif // _di_f_memory_structure_increase_by_
-
-#ifndef _di_f_memory_structure_resize_
- f_status_t f_memory_structure_resize(const size_t length_new, const size_t type_size, void ** const structure, f_number_unsigned_t * const used, f_number_unsigned_t * const size) {
- #ifndef _di_level_0_parameter_checking_
- if (!type_size) return F_status_set_error(F_parameter);
- if (!structure) return F_status_set_error(F_parameter);
- if (!used) return F_status_set_error(F_parameter);
- if (!size) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- // Prevent double-frees and unnecessary frees.
- if (!*structure && !length_new || *size == length_new) return F_data_not;
-
- return private_f_memory_structure_resize(length_new, type_size, structure, used, size);
- }
-#endif // _di_f_memory_structure_resize_
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 0
- *
- * Project: Memory
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- *
- * Defines memory structure data.
- *
- * This is auto-included by memory.h and should not need to be explicitly included.
- */
-#ifndef _F_memory_structure_h
-#define _F_memory_structure_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Resize the structure.
- *
- * Memory being deleted will be wiped.
- *
- * @param length_new
- * The new size of the structure array.
- * Setting a length of 0 will result in the deletion (freeing) of the structure.
- * @param type_size
- * The size of the structure type (such as: sizeof(structure_size)).
- * Must be greater than 0.
- * @param structure
- * The structure to delete.
- * @param used
- * The amount of data used by the structure.
- * @param size
- * The amount of data allocated to the structure.
- *
- * @return
- * F_none on success.
- *
- * F_memory_not (with error bit) on allocation error.
- *
- * @see calloc()
- * @see free()
- * @see memset()
- */
-#ifndef _di_f_memory_structure_adjust_
- extern f_status_t f_memory_structure_adjust(const size_t length_new, const size_t type_size, void ** const structure, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
-#endif // _di_f_memory_structure_adjust_
-
-/**
- * Resize the structure to a smaller size, by the given amount.
- *
- * This will not shrink the size to less than 0.
- * Memory being deleted will be wiped.
- *
- * @param amount
- * A positive number representing how much to decimate the size by.
- * @param type_size
- * The size of the structure type (such as: sizeof(structure_size)).
- * Must be greater than 0.
- * @param structure
- * The structure to delete.
- * @param used
- * The amount of data used by the structure.
- * @param size
- * The amount of data allocated to the structure.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to decimate size (amount = 0 or size = 0).
- *
- * F_memory_not (with error bit) on out of memory.
- *
- * @see calloc()
- * @see free()
- * @see memset()
- */
-#ifndef _di_f_memory_structure_decimate_by_
- extern f_status_t f_memory_structure_decimate_by(const f_number_unsigned_t amount, const size_t type_size, void ** const structure, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
-#endif // _di_f_memory_structure_decimate_by_
-
-/**
- * Resize the structure to a smaller size, by the given amount.
- *
- * This will not shrink the size to less than 0.
- * Memory being deleted will not be wiped.
- *
- * @param amount
- * A positive number representing how much to decrease by.
- * @param type_size
- * The size of the structure type (such as: sizeof(structure_size)).
- * Must be greater than 0.
- * @param structure
- * The structure to delete.
- * @param used
- * The amount of data used by the structure.
- * @param size
- * The amount of data allocated to the structure.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to decrease size (amount = 0 or size = 0).
- *
- * F_memory_not (with error bit) on allocation error.
- *
- * @see calloc()
- * @see free()
- * @see memset()
- */
-#ifndef _di_f_memory_structure_decrease_by_
- extern f_status_t f_memory_structure_decrease_by(const f_number_unsigned_t amount, const size_t type_size, void ** const structure, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
-#endif // _di_f_memory_structure_decrease_by_
-
-/**
- * Increase the size of the structure, 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 type_size
- * The size of the structure type (such as: sizeof(structure_size)).
- * Must be greater than 0.
- * @param structure
- * The structure to delete.
- * @param used
- * The amount of data used by the structure.
- * @param size
- * The amount of data allocated to the structure.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (used + 1 <= size).
- *
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_memory_not (with error bit) on allocation error.
- *
- * @see calloc()
- * @see free()
- * @see memset()
- */
-#ifndef _di_f_memory_structure_increase_
- extern f_status_t f_memory_structure_increase(const f_number_unsigned_t step, const size_t type_size, void ** const structure, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
-#endif // _di_f_memory_structure_increase_
-
-/**
- * Resize the structure 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).
- * If already set to the maximum buffer size, then the resize will fail.
- *
- * @param amount
- * A positive number representing how much to increase the size by.
- * @param type_size
- * The size of the structure type (such as: sizeof(structure_size)).
- * Must be greater than 0.
- * @param structure
- * The structure to delete.
- * @param used
- * The amount of data used by the structure.
- * @param size
- * The amount of data allocated to the structure.
- *
- * @return
- * F_none on success.
- * F_data_not on success, but there is no reason to increase size (amount = 0 or used + 1 <= size).
- *
- * F_array_too_large (with error bit) if the new array length is too large.
- * F_memory_not (with error bit) on allocation error.
- *
- * @see calloc()
- * @see free()
- * @see memset()
- */
-#ifndef _di_f_memory_structure_increase_by_
- extern f_status_t f_memory_structure_increase_by(const f_number_unsigned_t amount, const size_t type_size, void ** const structure, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
-#endif // _di_f_memory_structure_increase_by_
-
-/**
- * Resize the structure.
- *
- * Memory being deleted will not be wiped.
- *
- * @param length_new
- * The new size of the structure array.
- * Setting a length of 0 will result in the deletion (freeing) of the structure.
- * @param type_size
- * The size of the structure type (such as: sizeof(structure_size)).
- * @param structure
- * The structure to delete.
- * @param used
- * The amount of data used by the structure.
- * @param size
- * The amount of data allocated to the structure.
- *
- * @return
- * F_none on success.
- *
- * F_memory_not (with error bit) on allocation error.
- *
- * @see calloc()
- * @see free()
- * @see memset()
- */
-#ifndef _di_f_memory_structure_resize_
- extern f_status_t f_memory_structure_resize(const size_t length_new, const size_t type_size, void ** const structure, f_number_unsigned_t * const used, f_number_unsigned_t * const size);
-#endif // _di_f_memory_structure_resize_
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _F_memory_structure_h
extern "C" {
#endif
-#if !defined(_di_f_memory_adjust_) || !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_by_)
+#if !defined(_di_f_memory_adjust_) || defined(_f_memory_FORCE_secure_memory_)
f_status_t private_f_memory_adjust(const size_t length_old, const size_t length_new, const size_t type_size, void ** const pointer) {
// When old length is 0 and the pointer is not NULL, then consider this pointer stale and reset it to NULL.
return F_status_set_error(F_memory_not);
}
-#endif // !defined(_di_f_memory_adjust_) || !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_by_)
+#endif // !defined(_di_f_memory_adjust_) || defined(_f_memory_FORCE_secure_memory_)
-#if !defined(_di_f_memory_resize_) || !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_)
+#if !defined(_di_f_memory_resize_) || defined(_f_memory_FORCE_fast_memory_)
f_status_t private_f_memory_resize(const size_t length_old, const size_t length_new, const size_t type_size, void ** const pointer) {
// When old length is 0 and the pointer is not NULL, then consider this pointer stale and reset it to NULL.
return F_status_set_error(F_memory_not);
}
-#endif // !defined(_di_f_memory_resize_) || !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_)
-
-#if !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_by_)
- f_status_t private_f_memory_structure_adjust(const size_t length_new, const size_t type_size, void ** const structure, f_number_unsigned_t * const used, f_number_unsigned_t * const size) {
-
- const f_status_t status = private_f_memory_adjust(*size, length_new, type_size, structure);
-
- if (F_status_is_error_not(status)) {
- *size = length_new;
-
- if (*used > *size) {
- *used = *size;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_by_)
-
-#if !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_)
- f_status_t private_f_memory_structure_resize(const size_t length_new, const size_t type_size, void ** const structure, f_number_unsigned_t * const used, f_number_unsigned_t * const size) {
-
- const f_status_t status = private_f_memory_resize(*size, length_new, type_size, structure);
-
- if (F_status_is_error_not(status)) {
- *size = length_new;
-
- if (*used > *size) {
- *used = *size;
- }
- }
-
- return status;
- }
-#endif // !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_)
+#endif // !!defined(_di_f_memory_resize_) || defined(_f_memory_FORCE_fast_memory_)
#ifdef __cplusplus
} // extern "C"
* @see memset()
*
* @see f_memory_adjust()
- * @see f_memory_structure_adjust()
- * @see f_memory_structure_decimate_by()
+ * @see f_memory_resize()
*/
-#if !defined(_di_f_memory_adjust_) || !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_by_)
+#if !defined(_di_f_memory_adjust_) || defined(_f_memory_FORCE_secure_memory_)
extern f_status_t private_f_memory_adjust(const size_t length_old, const size_t length_new, const size_t type_size, void ** const pointer) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_memory_adjust_) || !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_by_)
+#endif // !defined(_di_f_memory_adjust_) || defined(_f_memory_FORCE_secure_memory_)
/**
* Private implementation for resizing.
* @see free()
* @see memset()
*
+ * @see f_memory_adjust()
* @see f_memory_resize()
- * @see f_memory_structure_decrease_by()
- * @see f_memory_structure_increase()
- * @see f_memory_structure_increase_by()
- * @see f_memory_structure_resize()
- *
- * @see private_f_memory_structure_resize()
*/
-#if !defined(_di_f_memory_resize_) || !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_)
+#if !defined(_di_f_memory_resize_) || defined(_f_memory_FORCE_fast_memory_)
extern f_status_t private_f_memory_resize(const size_t length_old, const size_t length_new, const size_t type_size, void ** const pointer) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_memory_resize_) || !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_)
-
-/**
- * Private implementation for resizing a structure.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length_new
- * The new size of the structure array.
- * Setting a length of 0 will result in the deletion (freeing) of the structure.
- * @param type_size
- * The size of the structure type (such as: sizeof(structure_size)).
- * @param structure
- * The structure to delete.
- * @param used
- * The amount of data used by the structure.
- * @param size
- * The amount of data allocated to the structure.
- *
- * @return
- * Return from: private_f_memory_adjust().
- *
- * Errors (with error bit) from: private_f_memory_adjust().
- *
- * @see f_memory_structure_adjust()
- * @see f_memory_structure_decimate_by()
- *
- * @see private_f_memory_adjust()
- */
-#if !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_by_)
- extern f_status_t private_f_memory_structure_adjust(const size_t length_new, const size_t type_size, void ** const structure, f_number_unsigned_t * const used, f_number_unsigned_t * const size) F_attribute_visibility_internal_d;
-#endif // !defined(_di_f_memory_structure_adjust_) || !defined(_di_f_memory_structure_decimate_by_)
-
-/**
- * Private implementation for resizing a structure.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param length_new
- * The new size of the structure array.
- * Setting a length of 0 will result in the deletion (freeing) of the structure.
- * @param type_size
- * The size of the structure type (such as: sizeof(structure_size)).
- * @param structure
- * The structure to delete.
- * @param used
- * The amount of data used by the structure.
- * @param size
- * The amount of data allocated to the structure.
- *
- * @return
- * Return from: private_f_memory_resize().
- *
- * Errors (with error bit) from: private_f_memory_structure_resize().
- *
- * @see f_memory_structure_decrease_by()
- * @see f_memory_structure_increase()
- * @see f_memory_structure_increase_by()
- * @see f_memory_structure_resize()
- *
- * @see private_f_memory_resize()
- */
-#if !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_)
- extern f_status_t private_f_memory_structure_resize(const size_t length_new, const size_t type_size, void ** const structure, f_number_unsigned_t * const used, f_number_unsigned_t * const size) F_attribute_visibility_internal_d;
-#endif // !defined(_di_memory_structure_decrease_by_) || !defined(_di_memory_structure_increase_) || !defined(_di_memory_structure_increase_by_) || !defined(_di_f_memory_structure_resize_)
+#endif // !defined(_di_f_memory_resize_) || defined(_f_memory_FORCE_fast_memory_)
#ifdef __cplusplus
} // extern "C"
build_libraries -lc
-build_sources_library memory.c memory/array.c memory/structure.c
+build_sources_library memory.c memory/array.c
build_sources_library private-memory.c memory/private-array.c
-build_sources_headers memory.h memory/array.h memory/common.h memory/structure.h
+build_sources_headers memory.h memory/array.h memory/common.h
build_script yes
build_shared yes
const f_number_unsigned_t length = F_number_t_size_unsigned_d + 1;
test_memory_array_t data = test_memory_array_t_initialize;
+ data.used = F_number_t_size_unsigned_d;
+
{
const f_status_t status = f_memory_array_increase(length, sizeof(int), (void **) &data.array, &data.used, &data.size);
assert_int_equal(status, F_status_set_error(F_array_too_large));
- assert_int_equal(data.used, 0);
+ assert_int_equal(data.used, F_number_t_size_unsigned_d);
assert_int_equal(data.size, 0);
}
}
if (!dynamics) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (dynamics->used + amount > dynamics->size) {
- if (dynamics->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (amount) {
+ if (dynamics->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ const f_number_unsigned_t length = dynamics->used + amount;
- return private_f_string_dynamics_resize(dynamics->used + amount, dynamics);
+ if (length > dynamics->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_string_dynamics_resize(dynamics->used + amount, dynamics);
+ }
}
return F_data_not;
if (!dynamicss) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (dynamicss->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (dynamicss->used + amount > dynamicss->size) {
- if (dynamicss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = dynamicss->used + amount;
- return private_f_string_dynamicss_resize(dynamicss->used + amount, dynamicss);
+ if (length > dynamicss->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_string_dynamicss_resize(dynamicss->used + amount, dynamicss);
+ }
}
return F_data_not;
if (!map_multis) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (map_multis->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (map_multis->used + amount > map_multis->size) {
- if (map_multis->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = map_multis->used + amount;
- return private_f_string_map_multis_resize(map_multis->used + amount, map_multis);
+ if (length > map_multis->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_string_map_multis_resize(length, map_multis);
+ }
}
return F_data_not;
#define macro_f_string_map_multis_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_string_map_multis_t_initialize_2(array, length) { array, length, length }
- #define macro_f_string_map_multis_t_clear(map_multis) macro_f_memory_structure_clear(map_multis)
-
#define macro_f_string_map_multis_t_resize(status, map_multis, length) status = f_string_map_multis_resize(length, &map_multis);
#define macro_f_string_map_multis_t_adjust(status, map_multis, length) status = f_string_map_multis_adjust(length, &map_multis);
if (!map_multiss) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (map_multiss->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (map_multiss->used + amount > map_multiss->size) {
- if (map_multiss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = map_multiss->used + amount;
- return private_f_string_map_multiss_resize(map_multiss->used + amount, map_multiss);
+ if (length > map_multiss->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_string_map_multiss_resize(length, map_multiss);
+ }
}
return F_data_not;
#define macro_f_string_map_multiss_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_string_map_multiss_t_initialize_2(array, length) { array, length, length }
- #define macro_f_string_map_multiss_t_clear(map_multis) macro_f_memory_structure_clear(map_multis)
-
#define macro_f_string_map_multiss_t_resize(status, map_multis, length) status = f_string_map_multiss_resize(length, &map_multis);
#define macro_f_string_map_multiss_t_adjust(status, map_multis, length) status = f_string_map_multiss_adjust(length, &map_multis);
if (!maps) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (maps->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (maps->used + amount > maps->size) {
- if (maps->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = maps->used + amount;
- return private_f_string_maps_resize(maps->used + amount, maps);
+ if (length > maps->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_string_maps_resize(length, maps);
+ }
}
return F_data_not;
#define macro_f_string_maps_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_string_maps_t_initialize_2(array, length) { array, length, length }
- #define macro_f_string_maps_t_clear(maps) macro_f_memory_structure_clear(maps)
-
#define macro_f_string_maps_t_resize(status, maps, length) status = f_string_maps_resize(length, &maps);
#define macro_f_string_maps_t_adjust(status, maps, length) status = f_string_maps_adjust(length, &maps);
if (!mapss) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (mapss->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (mapss->used + amount > mapss->size) {
- if (mapss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = mapss->used + amount;
- return private_f_string_mapss_resize(mapss->used + amount, mapss);
+ if (length > mapss->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_string_mapss_resize(length, mapss);
+ }
}
return F_data_not;
#define macro_f_string_mapss_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_string_mapss_t_initialize_2(array, length) { array, length, length }
- #define macro_f_string_mapss_t_clear(maps) macro_f_memory_structure_clear(maps)
-
#define macro_f_string_mapss_t_resize(status, maps, length) status = f_string_mapss_resize(length, &maps);
#define macro_f_string_mapss_t_adjust(status, maps, length) status = f_string_mapss_adjust(length, &maps);
#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
f_status_t private_f_string_dynamic_increase_by(const f_number_unsigned_t amount, f_string_dynamic_t * const dynamic) {
- if (dynamic->used + amount > dynamic->size) {
- if (dynamic->used + amount > F_string_t_size_d) {
- return F_status_set_error(F_string_too_large);
- }
+ const f_number_unsigned_t length = dynamic->used + amount;
- return private_f_string_dynamic_resize(dynamic->used + amount, dynamic);
+ if (length > dynamic->size) {
+ if (length > F_string_t_size_d) return F_status_set_error(F_string_too_large);
+
+ return private_f_string_dynamic_resize(length, dynamic);
}
return F_data_not;
#if !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
f_status_t private_f_string_dynamics_adjust(const f_number_unsigned_t length, f_string_dynamics_t * const dynamics) {
- if (dynamics->used + length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
f_status_t status = F_none;
#if !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_) || !defined(f_string_dynamics_resize) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_map_multis_append_all_) || !defined(_di_f_string_map_multis_decrease_by_) || !defined(_di_f_string_map_multis_increase_) || !defined(_di_f_string_map_multis_increase_by_) || !defined(_di_f_string_map_multis_resize_) || !defined(_di_f_string_map_multiss_append_) || !defined(_di_f_string_map_multiss_append_all_) || !defined(_di_f_string_map_multiss_decrease_by_) || !defined(_di_f_string_map_multiss_increase_) || !defined(_di_f_string_map_multiss_increase_by_)
f_status_t private_f_string_dynamics_resize(const f_number_unsigned_t length, f_string_dynamics_t * const dynamics) {
- if (dynamics->used + length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
f_status_t status = F_none;
#if !defined(_di_f_string_dynamicss_adjust_) || !defined(_di_f_string_dynamicss_append_) || !defined(_di_f_string_dynamicss_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
f_status_t private_f_string_dynamicss_adjust(const f_number_unsigned_t length, f_string_dynamicss_t * const dynamicss) {
- if (dynamicss->used + length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
f_status_t status = F_none;
#if !defined(_di_f_string_dynamicss_decrease_by_) || !defined(_di_f_string_dynamicss_increase_) || !defined(_di_f_string_dynamicss_increase_by_) || !defined(_di_f_string_dynamicss_append_all_) || !defined(_di_f_string_map_multis_append_all_)
f_status_t private_f_string_dynamicss_resize(const f_number_unsigned_t length, f_string_dynamicss_t * const dynamicss) {
- if (dynamicss->used + length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
f_status_t status = F_none;
if (!quantitys) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (quantitys->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (quantitys->used + amount > quantitys->size) {
- if (quantitys->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = quantitys->used + amount;
- return private_f_string_quantitys_resize(quantitys->used + amount, quantitys);
+ if (length > quantitys->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_string_quantitys_resize(length, quantitys);
+ }
}
return F_data_not;
#define macro_f_string_quantitys_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_string_quantitys_t_initialize_2(array, length) { array, length, length }
- #define macro_f_string_quantitys_t_clear(quantitys) macro_f_memory_structure_clear(quantitys)
-
#define macro_f_string_quantitys_t_resize(status, quantitys, length) status = f_string_quantitys_resize(length, &quantitys);
#define macro_f_string_quantitys_t_adjust(status, quantitys, length) status = f_string_quantitys_adjust(length, &quantitys);
if (!quantityss) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (quantityss->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (quantityss->used + amount > quantityss->size) {
- if (quantityss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = quantityss->used + amount;
- return private_f_string_quantityss_resize(quantityss->used + amount, quantityss);
+ if (length > quantityss->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_string_quantityss_resize(length, quantityss);
+ }
}
return F_data_not;
if (!ranges) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (ranges->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (ranges->used + amount > ranges->size) {
- if (ranges->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = ranges->used + amount;
- return private_f_string_ranges_resize(ranges->used + amount, ranges);
+ if (length > ranges->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_string_ranges_resize(length, ranges);
+ }
}
return F_data_not;
#define macro_f_string_ranges_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_string_ranges_t_initialize_2(array, length) { array, length, length }
- #define macro_f_string_ranges_t_clear(ranges) macro_f_memory_structure_clear(ranges)
-
#define macro_f_string_ranges_t_resize(status, ranges, length) status = f_string_ranges_resize(length, &ranges);
#define macro_f_string_ranges_t_adjust(status, ranges, length) status = f_string_ranges_adjust(length, &ranges);
if (!rangess) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (rangess->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (rangess->used + amount > rangess->size) {
- if (rangess->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = rangess->used + amount;
- return private_f_string_rangess_resize(rangess->used + amount, rangess);
+ if (length > rangess->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_string_rangess_resize(length, rangess);
+ }
}
return F_data_not;
if (!triples) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (triples->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (triples->used + amount > triples->size) {
- if (triples->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = triples->used + amount;
- return private_f_string_triples_resize(triples->used + amount, triples);
+ if (length > triples->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_string_triples_resize(length, triples);
+ }
}
return F_data_not;
#define macro_f_string_triples_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_string_triples_t_initialize_2(array, length) { array, length, length }
- #define macro_f_string_triples_t_clear(triples) macro_f_memory_structure_clear(triples)
-
#define macro_f_string_triples_t_resize(status, triples, length) status = f_string_triples_resize(length, &triples);
#define macro_f_string_triples_t_adjust(status, triples, length) status = f_string_triples_adjust(length, &triples);
if (!tripless) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (tripless->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (tripless->used + amount > tripless->size) {
- if (tripless->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = tripless->used + amount;
- return private_f_string_tripless_resize(tripless->used + amount, tripless);
+ if (length > tripless->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_string_tripless_resize(length, tripless);
+ }
}
return F_data_not;
#define macro_f_string_tripless_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_string_tripless_t_initialize_2(array, length) { array, length, length }
- #define macro_f_string_tripless_t_clear(tripless) macro_f_memory_structure_clear(tripless)
-
#define macro_f_string_tripless_t_resize(status, tripless, length) status = f_string_tripless_resize(length, &tripless);
#define macro_f_string_tripless_t_adjust(status, tripless, length) status = f_string_tripless_adjust(length, &tripless);
if (!attributes) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (attributes->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (attributes->used + amount > attributes->size) {
- if (attributes->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = attributes->used + amount;
- return private_f_thread_attributes_resize(attributes->used + amount, attributes);
+ if (length > attributes->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 F_data_not;
#define macro_f_thread_attributes_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_thread_attributes_t_initialize_2(array, length) { array, length, length }
- #define macro_f_thread_attributes_t_clear(attributes) macro_f_memory_structure_clear(attributes)
-
#define macro_f_thread_attributes_t_resize(status, attributes, length) status = f_thread_attributes_resize(length, &attributes);
#define macro_f_thread_attributes_t_adjust(status, attributes, length) status = f_thread_attributes_adjust(length, &attributes);
if (!barriers) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (barriers->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (barriers->used + amount > barriers->size) {
- if (barriers->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = barriers->used + amount;
- return private_f_thread_barriers_resize(barriers->used + amount, barriers);
+ if (length > barriers->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 F_data_not;
#define macro_f_thread_barriers_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_thread_barriers_t_initialize_2(array, length) { array, length, length }
- #define macro_f_thread_barriers_t_clear(barriers) macro_f_memory_structure_clear(barriers)
-
#define macro_f_thread_barriers_t_resize(status, barriers, length) status = f_thread_barriers_resize(length, &barriers);
#define macro_f_thread_barriers_t_adjust(status, barriers, length) status = f_thread_barriers_adjust(length, &barriers);
if (!attributes) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (attributes->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (attributes->used + amount > attributes->size) {
- if (attributes->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = attributes->used + amount;
- return private_f_thread_barrier_attributes_resize(attributes->used + amount, attributes);
+ if (length > attributes->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 F_data_not;
#define macro_f_thread_barrier_attributes_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_thread_barrier_attributes_t_initialize_2(array, length) { array, length, length }
- #define macro_f_thread_barrier_attributes_t_clear(barrier_attributes) macro_f_memory_structure_clear(barrier_attributes)
-
#define macro_f_thread_barrier_attributes_t_resize(status, barrier_attributes, length) status = f_thread_barrier_attributes_resize(length, &barrier_attributes);
#define macro_f_thread_barrier_attributes_t_adjust(status, barrier_attributes, length) status = f_thread_barrier_attributes_adjust(length, &barrier_attributes);
if (!conditions) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (conditions->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (conditions->used + amount > conditions->size) {
- if (conditions->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = conditions->used + amount;
- return private_f_thread_conditions_resize(conditions->used + amount, conditions);
+ if (length > conditions->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 F_data_not;
#define macro_f_thread_conditions_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_thread_conditions_t_initialize_2(array, length) { array, length, length }
- #define macro_f_thread_conditions_t_clear(conditions) macro_f_memory_structure_clear(conditions)
-
#define macro_f_thread_conditions_t_resize(status, conditions, length) status = f_thread_conditions_resize(length, &conditions);
#define macro_f_thread_conditions_t_adjust(status, conditions, length) status = f_thread_conditions_adjust(length, &conditions);
if (!attributes) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (attributes->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (attributes->used + amount > attributes->size) {
- if (attributes->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = attributes->used + amount;
- return private_f_thread_condition_attributes_resize(attributes->used + amount, attributes);
+ if (length > attributes->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 F_data_not;
#define macro_f_thread_condition_attributes_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_thread_condition_attributes_t_initialize_2(array, length) { array, length, length }
- #define macro_f_thread_condition_attributes_t_clear(attributes) macro_f_memory_structure_clear(attributes)
-
#define macro_f_thread_condition_attributes_t_resize(status, attributes, length) status = f_thread_condition_attributes_resize(length, &attributes);
#define macro_f_thread_condition_attributes_t_adjust(status, attributes, length) status = f_thread_condition_attributes_adjust(length, &attributes);
if (!ids) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (ids->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- 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);
- }
+ const f_number_unsigned_t length = ids->used + amount;
- return private_f_thread_ids_resize(ids->used + amount, ids);
+ 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;
#define macro_f_thread_ids_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_thread_ids_t_initialize_2(array, length) { array, length, length }
- #define macro_f_thread_ids_t_clear(attributes) macro_f_memory_structure_clear(attributes)
-
#define macro_f_thread_ids_t_resize(status, attributes, length) status = f_thread_ids_resize(length, &attributes);
#define macro_f_thread_ids_t_adjust(status, attributes, length) status = f_thread_ids_adjust(length, &attributes);
if (!keys) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (keys->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (keys->used + amount > keys->size) {
- if (keys->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = keys->used + amount;
- return private_f_thread_keys_resize(keys->used + amount, keys);
+ if (length > keys->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 F_data_not;
#define macro_f_thread_keys_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_thread_keys_t_initialize_2(array, length) { array, length, length }
- #define macro_f_thread_keys_t_clear(keys) macro_f_memory_structure_clear(keys)
-
#define macro_f_thread_keys_t_resize(status, keys, length) status = f_thread_keys_resize(length, &keys);
#define macro_f_thread_keys_t_adjust(status, keys, length) status = f_thread_keys_adjust(length, &keys);
if (!locks) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (locks->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (locks->used + amount > locks->size) {
- if (locks->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = locks->used + amount;
- return private_f_thread_locks_resize(locks->used + amount, locks);
+ if (length > locks->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 F_data_not;
#define macro_f_thread_locks_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_thread_locks_t_initialize_2(array, length) { array, length, length }
- #define macro_f_thread_locks_t_resize(status, locks, length) macro_f_memory_structure_resize(status, locks, f_thread_lock_t, length)
- #define macro_f_thread_locks_t_adjust(status, locks, length) macro_f_memory_structure_adjust(status, locks, f_thread_lock_t, length)
+ #define macro_f_thread_locks_t_adjust(status, locks, length) status = f_memory_array_adjust(length, sizeof(f_thread_lock_t), (void **) & locks.array, locks.used, locks.size)
+ #define macro_f_thread_locks_t_resize(status, locks, length) status = f_memory_array_resize(length, sizeof(f_thread_lock_t), (void **) & locks.array, locks.used, locks.size)
- #define macro_f_thread_locks_t_delete_simple(locks) macro_f_memory_structure_delete_simple(locks, f_thread_lock_t)
- #define macro_f_thread_locks_t_destroy_simple(locks) macro_f_memory_structure_destroy_simple(locks, f_thread_lock_t)
+ #define macro_f_thread_locks_t_delete_simple(locks) f_memory_array_resize(0, sizeof(f_thread_lock_t), (void **) & locks.array, locks.used, locks.size)
+ #define macro_f_thread_locks_t_destroy_simple(locks) f_memory_array_adjust(0, sizeof(f_thread_lock_t), (void **) & locks.array, locks.used, locks.size)
- #define macro_f_thread_locks_t_increase(status, step, locks) macro_f_memory_structure_increase(status, step, locks, f_thread_lock_t)
- #define macro_f_thread_locks_t_increase_by(status, locks, amount) macro_f_memory_structure_increase_by(status, locks, f_thread_lock_t, amount)
- #define macro_f_thread_locks_t_decrease_by(status, locks, amount) macro_f_memory_structure_decrease_by(status, locks, f_thread_lock_t, amount)
- #define macro_f_thread_locks_t_decimate_by(status, locks, amount) macro_f_memory_structure_decimate_by(status, locks, f_thread_lock_t, amount)
+ #define macro_f_thread_locks_t_increase(status, step, locks) status = f_memory_array_increase(step, sizeof(f_thread_lock_t), (void **) & locks.array, locks.used, locks.size)
+ #define macro_f_thread_locks_t_increase_by(status, locks, amount) status = f_memory_array_increase_by(amount, sizeof(f_thread_lock_t), (void **) & locks.array, locks.used, locks.size)
+ #define macro_f_thread_locks_t_decrease_by(status, locks, amount) status = f_memory_array_decrease_by(amount, sizeof(f_thread_lock_t), (void **) & locks.array, locks.used, locks.size)
+ #define macro_f_thread_locks_t_decimate_by(status, locks, amount) status = f_memory_array_decimate_by(amount, sizeof(f_thread_lock_t), (void **) & locks.array, locks.used, locks.size)
#endif // _di_f_thread_locks_t_
/**
if (!attributes) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (attributes->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (attributes->used + amount > attributes->size) {
- if (attributes->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = attributes->used + amount;
- return private_f_thread_lock_attributes_resize(attributes->used + amount, attributes);
+ if (length > attributes->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 F_data_not;
#define macro_f_thread_lock_attributes_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_thread_lock_attributes_t_initialize_2(array, length) { array, length, length }
- #define macro_f_thread_lock_attributes_t_clear(attributes) macro_f_memory_structure_clear(attributes)
-
#define macro_f_thread_lock_attributes_t_resize(status, attributes, length) status = f_thread_lock_attributes_resize(length, &attributes);
#define macro_f_thread_lock_attributes_t_adjust(status, attributes, length) status = f_thread_lock_attributes_adjust(length, &attributes);
if (!mutexs) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (mutexs->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (mutexs->used + amount > mutexs->size) {
- if (mutexs->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = mutexs->used + amount;
- return private_f_thread_mutexs_resize(mutexs->used + amount, mutexs);
+ if (length > mutexs->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 F_data_not;
#define macro_f_thread_mutexs_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_thread_mutexs_t_initialize_2(array, length) { array, length, length }
- #define macro_f_thread_mutexs_t_clear(mutexs) macro_f_memory_structure_clear(mutexs)
-
#define macro_f_thread_mutexs_t_resize(status, mutexs, length) status = f_thread_mutexs_resize(length, &mutexs);
#define macro_f_thread_mutexs_t_adjust(status, mutexs, length) status = f_thread_mutexs_adjust(length, &mutexs);
if (!attributes) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (attributes->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (attributes->used + amount > attributes->size) {
- if (attributes->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = attributes->used + amount;
- return private_f_thread_mutex_attributes_resize(attributes->used + amount, attributes);
+ if (length > attributes->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 F_data_not;
#define macro_f_thread_mutex_attributes_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_thread_mutex_attributes_t_initialize_2(array, length) { array, length, length }
- #define macro_f_thread_mutex_attributes_t_clear(attributes) macro_f_memory_structure_clear(attributes)
-
#define macro_f_thread_mutex_attributes_t_resize(status, attributes, length) status = f_thread_mutex_attributes_resize(length, &attributes);
#define macro_f_thread_mutex_attributes_t_adjust(status, attributes, length) status = f_thread_mutex_attributes_adjust(length, &attributes);
if (!onces) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (onces->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (onces->used + amount > onces->size) {
- if (onces->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = onces->used + amount;
- return private_f_thread_onces_resize(onces->used + amount, onces);
+ 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;
#define macro_f_thread_onces_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_thread_onces_t_initialize_2(array, length) { array, length, length }
- #define macro_f_thread_onces_t_clear(onces) macro_f_memory_structure_clear(onces)
-
#define macro_f_thread_onces_t_resize(status, onces, length) status = f_thread_onces_resize(length, &onces);
#define macro_f_thread_onces_t_adjust(status, onces, length) status = f_thread_onces_adjust(length, &onces);
if (!semaphores) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (semaphores->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (semaphores->used + amount > semaphores->size) {
- if (semaphores->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = semaphores->used + amount;
- return private_f_thread_semaphores_resize(semaphores->used + amount, semaphores);
+ if (length > semaphores->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 F_data_not;
#define macro_f_thread_semaphores_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_thread_semaphores_t_initialize_2(array, length) { array, length, length }
- #define macro_f_thread_semaphores_t_clear(semaphores) macro_f_memory_structure_clear(semaphores)
-
#define macro_f_thread_semaphores_t_resize(status, semaphores, length) status = f_thread_semaphores_resize(length, &semaphores);
#define macro_f_thread_semaphores_t_adjust(status, semaphores, length) status = f_thread_semaphores_adjust(length, &semaphores);
if (!sets) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (sets->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (sets->used + amount > sets->size) {
- if (sets->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = sets->used + amount;
- return private_f_thread_sets_resize(sets->used + amount, sets);
+ if (length > sets->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 F_data_not;
#define macro_f_thread_sets_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_thread_sets_t_initialize_2(array, length) { array, length, length }
- #define macro_f_thread_sets_t_clear(sets) macro_f_memory_structure_clear(sets)
-
#define macro_f_thread_sets_t_resize(status, sets, length) status = f_thread_sets_resize(length, &sets);
#define macro_f_thread_sets_t_adjust(status, sets, length) status = f_thread_sets_adjust(length, &sets);
if (!spins) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (spins->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (spins->used + amount > spins->size) {
- if (spins->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = spins->used + amount;
- return private_f_thread_spins_resize(spins->used + amount, spins);
+ if (length > spins->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 F_data_not;
#define macro_f_thread_spins_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_thread_spins_t_initialize_2(array, length) { array, length, length }
- #define macro_f_thread_spins_t_clear(spins) macro_f_memory_structure_clear(spins)
-
#define macro_f_thread_spins_t_resize(status, spins, length) status = f_thread_spins_resize(length, &spins);
#define macro_f_thread_spins_t_adjust(status, spins, length) status = f_thread_spins_adjust(length, &spins);
#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) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (polls->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (polls->used + amount > polls->size) {
- if (polls->used + amount > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ const f_number_unsigned_t length = polls->used + amount;
- return private_f_polls_resize(polls->used + amount, polls);
+ 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;
#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);
+
f_number_unsigned_t size = pollss->used + step;
if (size > F_number_t_size_unsigned_d) {
if (!pollss) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (pollss->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (pollss->used + amount > pollss->size) {
- if (pollss->used + amount > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+ const f_number_unsigned_t length = pollss->used + amount;
- return private_f_pollss_resize(pollss->used + amount, pollss);
+ if (length > pollss->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 F_data_not;
if (!dynamics) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (dynamics->used + amount > dynamics->size) {
- if (dynamics->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (amount) {
+ if (dynamics->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ const f_number_unsigned_t length = dynamics->used + amount;
- return private_f_utf_string_dynamics_resize(dynamics->used + amount, dynamics);
+ if (length > dynamics->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_utf_string_dynamics_resize(length, dynamics);
+ }
}
return F_data_not;
if (!dynamicss) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (dynamicss->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (dynamicss->used + amount > dynamicss->size) {
- if (dynamicss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = dynamicss->used + amount;
- return private_f_utf_string_dynamicss_resize(dynamicss->used + amount, dynamicss);
+ if (length > dynamicss->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_utf_string_dynamicss_resize(length, dynamicss);
+ }
}
return F_data_not;
if (!map_multis) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (map_multis->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (map_multis->used + amount > map_multis->size) {
- if (map_multis->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = map_multis->used + amount;
- return private_f_utf_string_map_multis_resize(map_multis->used + amount, map_multis);
+ if (length > map_multis->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_utf_string_map_multis_resize(length, map_multis);
+ }
}
return F_data_not;
#define macro_f_utf_string_map_multis_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_utf_string_map_multis_t_initialize_2(array, length) { array, length, length }
- #define macro_f_utf_string_map_multis_t_clear(map_multis) macro_f_memory_structure_clear(map_multis)
-
#define macro_f_utf_string_map_multis_t_resize(status, map_multis, length) status = f_utf_string_map_multis_resize(length, &map_multis);
#define macro_f_utf_string_map_multis_t_adjust(status, map_multis, length) status = f_utf_string_map_multis_adjust(length, &map_multis);
if (!map_multiss) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (map_multiss->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (map_multiss->used + amount > map_multiss->size) {
- if (map_multiss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = map_multiss->used + amount;
- return private_f_utf_string_map_multiss_resize(map_multiss->used + amount, map_multiss);
+ if (length > map_multiss->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_utf_string_map_multiss_resize(length, map_multiss);
+ }
}
return F_data_not;
#define macro_f_utf_string_map_multiss_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_utf_string_map_multiss_t_initialize_2(array, length) { array, length, length }
- #define macro_f_utf_string_map_multiss_t_clear(map_multis) macro_f_memory_structure_clear(map_multis)
-
#define macro_f_utf_string_map_multiss_t_resize(status, map_multis, length) status = f_utf_string_map_multiss_resize(length, &map_multis);
#define macro_f_utf_string_map_multiss_t_adjust(status, map_multis, length) status = f_utf_string_map_multiss_adjust(length, &map_multis);
if (!maps) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (maps->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (maps->used + amount > maps->size) {
- if (maps->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = maps->used + amount;
- return private_f_utf_string_maps_resize(maps->used + amount, maps);
+ if (length > maps->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_utf_string_maps_resize(length, maps);
+ }
}
return F_data_not;
#define macro_f_utf_string_maps_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_utf_string_maps_t_initialize_2(array, length) { array, length, length }
- #define macro_f_utf_string_maps_t_clear(maps) macro_f_memory_structure_clear(maps)
-
#define macro_f_utf_string_maps_t_resize(status, maps, length) status = f_utf_string_maps_resize(length, &maps);
#define macro_f_utf_string_maps_t_adjust(status, maps, length) status = f_utf_string_maps_adjust(length, &maps);
if (!mapss) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (mapss->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (mapss->used + amount > mapss->size) {
- if (mapss->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = mapss->used + amount;
- return private_f_utf_string_mapss_resize(mapss->used + amount, mapss);
+ if (length > mapss->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_utf_string_mapss_resize(length, mapss);
+ }
}
return F_data_not;
#define macro_f_utf_string_mapss_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_utf_string_mapss_t_initialize_2(array, length) { array, length, length }
- #define macro_f_utf_string_mapss_t_clear(maps) macro_f_memory_structure_clear(maps)
-
#define macro_f_utf_string_mapss_t_resize(status, maps, length) status = f_utf_string_mapss_resize(length, &maps);
#define macro_f_utf_string_mapss_t_adjust(status, maps, length) status = f_utf_string_mapss_adjust(length, &maps);
#if !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_assure_nulless_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(_di_f_utf_string_dynamic_mish_) || !defined(_di_f_utf_string_dynamic_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_append_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_partial_mash_nulless_) || !defined(_di_f_utf_string_dynamic_partial_mish_) || !defined(_di_f_utf_string_dynamic_partial_mish_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_assure_) || !defined(_di_f_utf_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_append_all_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_map_multis_append_all_) || !defined(_di_f_utf_string_map_multiss_append_) || !defined(_di_f_utf_string_map_multiss_append_all_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_maps_append_all_) || !defined(_di_f_utf_string_mapss_append_) || !defined(_di_f_utf_string_mapss_append_all_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_mish_) || !defined(_di_f_utf_string_mish_nulless_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_assure_) || !defined(_di_f_utf_string_prepend_assure_nulless_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_) || !defined(_di_f_utf_string_triples_append_all_) || !defined(_di_f_utf_string_tripless_append_) || !defined(_di_f_utf_string_tripless_append_all_)
f_status_t private_f_utf_string_dynamic_increase_by(const f_number_unsigned_t amount, f_utf_string_dynamic_t * const dynamic) {
- if (dynamic->used + amount > dynamic->size) {
- if (dynamic->used + amount > F_string_t_size_d) {
- return F_status_set_error(F_string_too_large);
- }
+ const f_number_unsigned_t length = dynamic->used + amount;
- return private_f_utf_string_dynamic_resize(dynamic->used + amount, dynamic);
+ if (length > dynamic->size) {
+ if (length > F_string_t_size_d) return F_status_set_error(F_string_too_large);
+
+ return private_f_utf_string_dynamic_resize(length, dynamic);
}
return F_data_not;
if (!triples) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (triples->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (triples->used + amount > triples->size) {
- if (triples->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = triples->used + amount;
- return private_f_utf_string_triples_resize(triples->used + amount, triples);
+ if (length > triples->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_utf_string_triples_resize(length, triples);
+ }
}
return F_data_not;
#define macro_f_utf_string_triples_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_utf_string_triples_t_initialize_2(array, length) { array, length, length }
- #define macro_f_utf_string_triples_t_clear(triples) macro_f_memory_structure_clear(triples)
-
#define macro_f_utf_string_triples_t_resize(status, triples, length) status = f_utf_string_triples_resize(length, &triples);
#define macro_f_utf_string_triples_t_adjust(status, triples, length) status = f_utf_string_triples_adjust(length, &triples);
if (!tripless) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!amount) return F_data_not;
+ if (amount) {
+ if (tripless->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- if (tripless->used + amount > tripless->size) {
- if (tripless->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ const f_number_unsigned_t length = tripless->used + amount;
- return private_f_utf_string_tripless_resize(tripless->used + amount, tripless);
+ if (length > tripless->size) {
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
+
+ return private_f_utf_string_tripless_resize(length, tripless);
+ }
}
return F_data_not;
#define macro_f_utf_string_tripless_t_initialize_1(array, size, used) { array, size, used }
#define macro_f_utf_string_tripless_t_initialize_2(array, length) { array, length, length }
- #define macro_f_utf_string_tripless_t_clear(tripless) macro_f_memory_structure_clear(tripless)
-
#define macro_f_utf_string_tripless_t_resize(status, tripless, length) status = f_utf_string_tripless_resize(length, &tripless);
#define macro_f_utf_string_tripless_t_adjust(status, tripless, length) status = f_utf_string_tripless_adjust(length, &tripless);
#ifndef _di_controller_entry_actions_increase_by_
f_status_t controller_entry_actions_increase_by(const f_number_unsigned_t amount, controller_entry_actions_t * const actions) {
- if (actions->used + amount > actions->size) {
- if (actions->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (amount) {
+ if (actions->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- const f_status_t status = f_memory_resize(actions->size, actions->used + amount, sizeof(controller_entry_action_t), (void **) & actions->array);
+ const f_number_unsigned_t length = actions->used + amount;
- if (F_status_is_error_not(status)) {
- actions->size = actions->used + amount;
- }
+ if (length > actions->size) {
+ const f_status_t status = f_memory_resize(actions->size, length, sizeof(controller_entry_action_t), (void **) & actions->array);
- return status;
+ if (F_status_is_error_not(status)) {
+ actions->size = actions->used + amount;
+ }
+
+ return status;
+ }
}
return F_data_not;
#ifndef _di_controller_entry_items_increase_by_
f_status_t controller_entry_items_increase_by(const f_number_unsigned_t amount, controller_entry_items_t * const items) {
- if (items->used + amount > items->size) {
- if (items->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (amount) {
+ if (items->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- const f_status_t status = f_memory_resize(items->size, items->used + amount, sizeof(controller_entry_item_t), (void **) & items->array);
+ const f_number_unsigned_t length = items->used + amount;
- if (F_status_is_error_not(status)) {
- items->size = items->used + amount;
- }
+ if (length > items->size) {
+ const f_status_t status = f_memory_resize(items->size, length, sizeof(controller_entry_item_t), (void **) & items->array);
- return status;
+ if (F_status_is_error_not(status)) {
+ items->size = items->used + amount;
+ }
+
+ return status;
+ }
}
return F_data_not;
#ifndef _di_controller_rule_actions_increase_by_
f_status_t controller_rule_actions_increase_by(const f_number_unsigned_t amount, controller_rule_actions_t * const actions) {
- if (actions->used + amount > actions->size) {
- if (actions->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (amount) {
+ if (actions->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- const f_status_t status = f_memory_resize(actions->size, actions->used + amount, sizeof(controller_rule_action_t), (void **) & actions->array);
+ const f_number_unsigned_t length = actions->used + amount;
- if (F_status_is_error_not(status)) {
- actions->size = actions->used + amount;
- }
+ if (length > actions->size) {
+ const f_status_t status = f_memory_resize(actions->size, length, sizeof(controller_rule_action_t), (void **) & actions->array);
- return status;
+ if (F_status_is_error_not(status)) {
+ actions->size = actions->used + amount;
+ }
+
+ return status;
+ }
}
return F_data_not;
#ifndef _di_controller_rule_items_increase_by_
f_status_t controller_rule_items_increase_by(const f_number_unsigned_t amount, controller_rule_items_t * const items) {
- if (items->used + amount > items->size) {
- if (items->used + amount > F_number_t_size_unsigned_d) {
- return F_status_set_error(F_array_too_large);
- }
+ if (amount) {
+ if (items->used >= F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
- const f_status_t status = f_memory_resize(items->size, items->used + amount, sizeof(controller_rule_item_t), (void **) & items->array);
+ const f_number_unsigned_t length = items->used + amount;
- if (F_status_is_error_not(status)) {
- items->size = items->used + amount;
- }
+ if (length > items->size) {
+ const f_status_t status = f_memory_resize(items->size, length, sizeof(controller_rule_item_t), (void **) & items->array);
- return status;
+ if (F_status_is_error_not(status)) {
+ items->size = items->used + amount;
+ }
+
+ return status;
+ }
}
return F_data_not;
f_status_t fss_read_depths_resize(const f_number_unsigned_t length, fss_read_depths_t * const depths) {
if (!depths) return F_status_set_error(F_parameter);
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
if (depths->used + length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
for (f_number_unsigned_t i = length; i < depths->size; ++i) {
f_status_t fss_read_files_resize(const f_number_unsigned_t length, fss_read_files_t * const files) {
if (!files) return F_status_set_error(F_parameter);
+ if (length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
if (files->used + length > F_number_t_size_unsigned_d) return F_status_set_error(F_array_too_large);
const f_status_t status = f_memory_adjust(files->size, length, sizeof(fss_read_file_t), (void **) & files->array);
} fss_read_depths_t;
#define fss_read_depths_t_initialize { 0, 0, 0 }
-
- #define macro_fss_read_depths_t_clear(depths) macro_f_memory_structure_clear(depths)
#endif // _di_fss_read_depths_t_
/**