I originally tried to simplify things and have only F_array or F_buffer.
I have found myself wanting to use F_array, naturally, more and more.
Furthermore, the semantics of "array" and "buffer" are similar but not the same.
Add the F_array (and similar status codes).
Update existing code that should be using F_array instead of F_buffer.
// populate list of remaining parameters.parameter not associated with anything.
if (remaining->used == remaining->size) {
- f_macro_memory_structure_macro_increment(status, (*remaining), 1, f_console_default_allocation_step, f_macro_string_lengths_t_resize, F_buffer_too_large);
+ f_macro_memory_structure_macro_increment(status, (*remaining), 1, f_console_default_allocation_step, f_macro_string_lengths_t_resize, F_array_too_large);
if (F_status_is_error(status)) {
f_macro_string_lengths_t_delete_simple(needs_value);
return status;
* @return
* F_none on success.
* F_data_not if "values" parameters were expected but not found.
- * F_buffer_too_large (with error bit) if a buffer would exceed max length.
+ * F_array_too_large (with error bit) if a buffer would exceed max length.
* F_failure (with error bit) if width is not long enough to convert when processing arguments as UTF-8.
* F_parameter (with error bit) if a parameter is invalid.
* F_utf (with error bit) if character is an invalid UTF-8 character, when processing arguments.
}
if (names->used == names->size) {
- f_macro_memory_structure_macro_increment(status, (*names), 1, f_directory_default_allocation_step, f_macro_string_dynamics_t_resize, F_buffer_too_large);
+ f_macro_memory_structure_macro_increment(status, (*names), 1, f_directory_default_allocation_step, f_macro_string_dynamics_t_resize, F_array_too_large);
if (F_status_is_error(status)) break;
}
* @return
* F_none on success.
* F_data_not if directory is empty.
- * F_buffer_too_large (with error bit) if the directory buffer max length would be exceeded.
+ * F_array_too_large (with error bit) if the directory buffer max length would be exceeded.
* F_failure (with error bit) if failed to read directory information.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
width = f_macro_utf_byte_width(serialize.string[i]);
if (serialize.string[i] == f_serialize_simple_splitter || i + 1 >= serialize.used) {
- f_macro_memory_structure_macro_increment(status, (*strings), 1, f_serialize_default_allocation_step, f_macro_string_dynamics_t_resize, F_buffer_too_large);
+ f_macro_memory_structure_macro_increment(status, (*strings), 1, f_serialize_default_allocation_step, f_macro_string_dynamics_t_resize, F_array_too_large);
if (F_status_is_error(status)) return status;
if (start == i) {
width = f_macro_utf_byte_width(serialize.string[i]);
if (serialize.string[i] == f_serialize_simple_splitter || i + 1 >= serialize.used) {
- f_macro_memory_structure_macro_increment(status, (*locations), 1, f_serialize_default_allocation_step, f_macro_string_ranges_t_resize, F_buffer_too_large);
+ f_macro_memory_structure_macro_increment(status, (*locations), 1, f_serialize_default_allocation_step, f_macro_string_ranges_t_resize, F_array_too_large);
if (F_status_is_error(status)) return status;
if (start == i) {
* @return
* F_none on success.
* F_incomplete_utf_eos if end of sting is reached before a complete UTF-8 character can be processed.
- * F_buffer_too_large (with error bit) if a buffer would exceed maximum length.
+ * F_array_too_large (with error bit) if a buffer would exceed maximum length.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
*/
* @return
* F_none on success.
* F_incomplete_utf_eos if end of sting is reached before a complete UTF-8 character can be processed.
- * F_buffer_too_large (with error bit) if a buffer would exceed memory max length.
+ * F_array_too_large (with error bit) if a buffer would exceed memory max length.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
*/
F_write_only,
#endif // _di_F_status_basic_
+ #ifndef _di_F_status_array_
+ F_array,
+ F_array_too_large,
+ F_array_too_small,
+ #endif // _di_F_status_array_
+
#ifndef _di_F_status_busy_
F_busy,
F_busy_address,
const f_status_t status_failure = status;
- f_macro_memory_structure_macro_increment(status, (*recurse.failures), 1, f_memory_default_allocation_step, f_macro_directory_statuss_t_resize, F_buffer_too_large);
+ f_macro_memory_structure_macro_increment(status, (*recurse.failures), 1, f_memory_default_allocation_step, f_macro_directory_statuss_t_resize, F_array_too_large);
if (F_status_is_error(status)) return status;
f_directory_status_t failure = f_directory_status_t_initialize;
const f_status_t status_failure = status;
- f_macro_memory_structure_macro_increment(status, (*recurse.failures), 1, f_memory_default_allocation_step, f_macro_directory_statuss_t_resize, F_buffer_too_large);
+ f_macro_memory_structure_macro_increment(status, (*recurse.failures), 1, f_memory_default_allocation_step, f_macro_directory_statuss_t_resize, F_array_too_large);
if (F_status_is_error(status)) return status;
f_directory_status_t failure = f_directory_status_t_initialize;
*
* @return
* F_none on success.
+ * F_array_too_large (with error bit) if a buffer would exceed max length.
* F_failure (with error bit) for any other failure, failures might be populated with individual status codes.
*
* @see fl_directory_clone()
*
* @return
* F_none on success.
+ * F_array_too_large (with error bit) if a buffer would exceed max length.
* F_failure (with error bit) for any other failure, failures might be populated with individual status codes.
*
* @see fl_directory_copy()
// When PATH is "", this is actually a valid search path for PWD.
// Append an equivalent representation of PWD (string used length is 0).
- f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_t_resize, F_buffer_too_large);
+ f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_t_resize, F_array_too_large);
if (F_status_is_error(status)) return status;
f_macro_string_dynamic_t_clear(paths->array[paths->used]);
for (i = 0; i <= length; i++) {
if (i == length || path[i] == f_path_separator_variable[0]) {
- f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_t_resize, F_buffer_too_large);
+ f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_t_resize, F_array_too_large);
if (F_status_is_error(status)) return status;
if (!i) {
// When PATH is "", this is actually a valid search path for PWD.
// Therefore append an equivalent representation of PWD (string used length is 0).
- f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_t_resize, F_buffer_too_large);
+ f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_t_resize, F_array_too_large);
if (F_status_is_error(status)) return status;
f_macro_string_dynamic_t_clear(paths->array[paths->used]);
for (i = 0; i <= path.used; i++) {
if (i == path.used || path.string[i] == f_path_separator_variable[0]) {
- f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_t_resize, F_buffer_too_large);
+ f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_t_resize, F_array_too_large);
if (F_status_is_error(status)) return status;
if (!i) {
// When PATH is "", this is actually a valid search path for PWD.
// Therefore append an equivalent representation of PWD (string used length is 0).
- f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_t_resize, F_buffer_too_large);
+ f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_t_resize, F_array_too_large);
if (F_status_is_error(status)) return status;
paths->array[paths->used].string = 0;
j--;
if (!j || path[j] == f_path_separator_variable[0]) {
- f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_t_resize, F_buffer_too_large);
+ f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_t_resize, F_array_too_large);
if (F_status_is_error(status)) return status;
if (path[j] == f_path_separator_variable[0]) {
if (!path.used) {
// When PATH is "", this is actually a valid search path for PWD.
// Therefore append an equivalent representation of PWD (string used length is 0).
- f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_t_resize, F_buffer_too_large);
+ f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_t_resize, F_array_too_large);
if (F_status_is_error(status)) return status;
f_macro_string_dynamic_t_clear(paths->array[paths->used]);
j--;
if (!j || path.string[j] == f_path_separator_variable[0]) {
- f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_t_resize, F_buffer_too_large);
+ f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_t_resize, F_array_too_large);
if (F_status_is_error(status)) return status;
if (path.string[j] == f_path_separator_variable[0]) {
*
* @return
* F_none on success.
- * F_buffer_too_large (with error bit) if paths array is too large for further addressing.
+ * F_array_too_large (with error bit) if paths array is too large for further addressing.
* F_memory_reallocation (with error bit) on reallocation error.
* F_memory_allocation (with error bit) on allocation error.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
- * F_buffer_too_large (with error bit) if paths array is too large for further addressing.
+ * F_array_too_large (with error bit) if paths array is too large for further addressing.
* F_memory_reallocation (with error bit) on reallocation error.
* F_memory_allocation (with error bit) on allocation error.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
- * F_buffer_too_large (with error bit) if paths array is too large for further addressing.
+ * F_array_too_large (with error bit) if paths array is too large for further addressing.
* F_memory_reallocation (with error bit) on reallocation error.
* F_memory_allocation (with error bit) on allocation error.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
- * F_buffer_too_large (with error bit) if paths array is too large for further addressing.
+ * F_array_too_large (with error bit) if paths array is too large for further addressing.
* F_memory_reallocation (with error bit) on reallocation error.
* F_memory_allocation (with error bit) on allocation error.
* F_parameter (with error bit) if a parameter is invalid.
* F_data_not_stop no data found after reaching stopping point (essentially only comments are found).
* F_unterminated_group_eos if EOS was reached before the a group termination was reached.
* F_unterminated_group_stop if stop point was reached before the a group termination was reached.
- * F_buffer_too_large (with error bit) if a buffer is too large.
+ * F_array_too_large (with error bit) if a buffer is too large.
* F_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_incomplete_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed.
* F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_data_not_stop no data found after reaching stopping point (essentially only comments are found).
* F_unterminated_group_eos if EOS was reached before the a group termination was reached.
* F_unterminated_group_stop if stop point was reached before the a group termination was reached.
- * F_buffer_too_large (with error bit) if a buffer is too large.
+ * F_array_too_large (with error bit) if a buffer is too large.
* F_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_incomplete_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed.
* F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_data_not_stop no data found after reaching stopping point (essentially only comments are found).
* F_unterminated_group_eos if EOS was reached before the a group termination was reached.
* F_unterminated_group_stop if stop point was reached before the a group termination was reached.
- * F_buffer_too_large (with error bit) if a buffer is too large.
+ * F_array_too_large (with error bit) if a buffer is too large.
* F_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_incomplete_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed.
* F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_data_not_stop no data found after reaching stopping point (essentially only comments are found).
* F_unterminated_group_eos if EOS was reached before the a group termination was reached.
* F_unterminated_group_stop if stop point was reached before the a group termination was reached.
- * F_buffer_too_large (with error bit) if a buffer is too large.
+ * F_array_too_large (with error bit) if a buffer is too large.
* F_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_incomplete_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed.
* F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
if (nest->used + 1 > nest->size) {
if (nest->size + f_fss_default_allocation_step > f_array_length_t_size) {
if (nest->size + 1 > f_array_length_t_size) {
- return F_status_set_error(F_buffer_too_large);
+ return F_status_set_error(F_array_too_large);
}
f_macro_fss_nest_t_resize(status, (*nest), (nest->size + 1));
if (ranges->used + 1 > ranges->size) {
if (ranges->size + f_fss_default_allocation_step > f_array_length_t_size) {
if (ranges->size + 1 > f_array_length_t_size) {
- return F_status_set_error(F_buffer_too_large);
+ return F_status_set_error(F_array_too_large);
}
f_macro_string_ranges_t_resize(status, (*ranges), (ranges->size + 1));
* F_data_not_stop no data found after reaching stopping point (essentially only comments are found).
* F_unterminated_group_eos if EOS was reached before the a group termination was reached.
* F_unterminated_group_stop if stop point was reached before the a group termination was reached.
- * F_buffer_too_large (with error bit) if a buffer is too large.
+ * F_array_too_large (with error bit) if a buffer is too large.
* F_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_incomplete_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed.
* F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* @return
* F_none on success.
* F_memory_reallocation (with error bit) on reallocation error.
- * F_buffer_too_large (with error bit) if appended string length is too large to store in the delimits.
+ * F_array_too_large (with error bit) if appended string length is too large to store in the delimits.
*
* @see fl_fss_basic_object_write_string()
* @see fl_fss_basic_content_write_string()
* @return
* F_none on success.
* F_memory_reallocation (with error bit) on reallocation error.
- * F_buffer_too_large (with error bit) if increased string length is too large to store in the delimits.
+ * F_array_too_large (with error bit) if increased string length is too large to store in the delimits.
*
* @see fl_fss_basic_object_write_string()
* @see fl_fss_basic_content_write_string()
* @return
* F_none on success.
* F_memory_reallocation (with error bit) on reallocation error.
- * F_buffer_too_large (with error bit) if increased array length is too large to store in the range.
+ * F_array_too_large (with error bit) if increased array length is too large to store in the range.
*
* @see fl_fss_extended_list_object_read()
* @see fl_fss_extended_list_content_read()
* @return
* F_none on success.
* F_memory_reallocation (with error bit) on reallocation error.
- * F_buffer_too_large (with error bit) if increased array length is too large to store in the range.
+ * F_array_too_large (with error bit) if increased array length is too large to store in the range.
*
* @see fl_fss_basic_object_read()
* @see fl_fss_basic_content_read()
break;
#endif // _di_F_status_basic_
+ #ifndef _di_F_status_array_
+ case F_array:
+ *string = FL_status_string_array;
+ break;
+ case F_array_too_small:
+ *string = FL_status_string_array_too_small;
+ break;
+ case F_array_too_large:
+ *string = FL_status_string_array_too_large;
+ break;
+ #endif // _di_F_status_array_
+
#ifndef _di_F_status_busy_
case F_busy:
*string = FL_status_string_busy;
#define FL_status_string_write_only_length 12
#endif // _di_F_status_basic_
+ #ifndef _di_F_status_array_
+ #define FL_status_string_array "F_array"
+ #define FL_status_string_array_too_large "F_array_too_large"
+ #define FL_status_string_array_too_small "F_array_too_small"
+
+ #define FL_status_string_array_length 7
+ #define FL_status_string_array_too_large_length 17
+ #define FL_status_string_array_too_small_length 17
+ #endif // _di_F_status_array_
+
#ifndef _di_F_status_busy_
#define FL_status_string_busy "F_busy"
#define FL_status_string_busy_address "F_busy_address"
if (strings->size + f_memory_default_allocation_step > f_array_length_t_size) {
if (strings->size == f_array_length_t_size) {
- return F_status_set_error(F_buffer_too_large);
+ return F_status_set_error(F_array_too_large);
}
f_macro_string_dynamics_t_resize(status, (*strings), f_array_length_t_size);
- return F_buffer_too_large;
+ return F_array_too_large;
}
f_macro_string_dynamics_t_resize(status, (*strings), strings->size + f_memory_default_allocation_step);
if (strings->size + amount > f_array_length_t_size) {
if (strings->size == f_array_length_t_size) {
- return F_status_set_error(F_buffer_too_large);
+ return F_status_set_error(F_array_too_large);
}
f_macro_string_dynamics_t_resize(status, (*strings), f_array_length_t_size);
- return F_buffer_too_large;
+ return F_array_too_large;
}
f_macro_string_dynamics_t_resize(status, (*strings), strings->size + amount);
if (lengths->size + f_memory_default_allocation_step > f_array_length_t_size) {
if (lengths->size == f_array_length_t_size) {
- return F_status_set_error(F_buffer_too_large);
+ return F_status_set_error(F_array_too_large);
}
f_macro_string_lengths_t_resize(status, (*lengths), f_array_length_t_size);
- return F_buffer_too_large;
+ return F_array_too_large;
}
f_macro_string_lengths_t_resize(status, (*lengths), lengths->size + f_memory_default_allocation_step);
if (lengths->size + amount > f_array_length_t_size) {
if (lengths->size == f_array_length_t_size) {
- return F_status_set_error(F_buffer_too_large);
+ return F_status_set_error(F_array_too_large);
}
f_macro_string_lengths_t_resize(status, (*lengths), f_array_length_t_size);
- return F_buffer_too_large;
+ return F_array_too_large;
}
f_macro_string_lengths_t_resize(status, (*lengths), lengths->size + amount);
*
* @return
* F_none on success.
- * F_buffer_too_large on success, but the requested length is too large for the buffer.
+ * F_array_too_large on success, but the requested length is too large for the buffer.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * F_buffer_too_large (with error bit) if the new array length is too large.
+ * F_array_too_large (with error bit) if the new array length is too large.
*/
#ifndef _di_fl_string_dynamics_increase_
extern f_return_status fl_string_dynamics_increase(f_string_dynamics_t *strings);
*
* @return
* F_none on success.
- * F_buffer_too_large on success, but the requested length is too large for the buffer.
+ * F_array_too_large on success, but the requested length is too large for the buffer.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * F_buffer_too_large (with error bit) if the new array length is too large.
+ * F_array_too_large (with error bit) if the new array length is too large.
*/
#ifndef _di_fl_string_dynamics_increase_by_
extern f_return_status fl_string_dynamics_increase_by(const f_array_length_t amount, f_string_dynamics_t *strings);
*
* @return
* F_none on success.
- * F_buffer_too_large on success, but the requested length is too large for the buffer.
+ * F_array_too_large on success, but the requested length is too large for the buffer.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * F_buffer_too_large (with error bit) if the new array length is too large.
+ * F_array_too_large (with error bit) if the new array length is too large.
*/
#ifndef _di_fl_string_lengths_increase_
extern f_return_status fl_string_lengths_increase(f_string_lengths_t *lengths);
*
* @return
* F_none on success.
- * F_buffer_too_large on success, but the requested length is too large for the buffer.
+ * F_array_too_large on success, but the requested length is too large for the buffer.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
- * F_buffer_too_large (with error bit) if the new array length is too large.
+ * F_array_too_large (with error bit) if the new array length is too large.
*/
#ifndef _di_fl_string_lengths_increase_by_
extern f_return_status fl_string_lengths_increase_by(const f_array_length_t amount, f_string_lengths_t *lengths);
#if !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_) || !defined(_di_fll_error_number_print_)
f_return_status private_fll_error_print(const fll_error_print_t error, const f_status_t status, const f_string_t function, const bool fallback) {
+ if (status == F_array_too_large) {
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sMaximum array length reached while processing ", error.context.before->string, error.prefix ? error.prefix : "");
+
+ private_fll_error_print_function(error, function);
+
+ fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol[0]);
+ }
+
+ return F_false;
+ }
+
if (status == F_buffer_too_large) {
if (error.verbosity != f_console_verbosity_quiet) {
fprintf(error.to.stream, "%c", f_string_eol[0]);
* @return
* F_none on success.
* F_data_not if source length is 0.
- * F_buffer_too_large (with error bit) if arguments array is too large for further allocation.
+ * F_array_too_large (with error bit) if arguments array is too large for further allocation.
* F_memory_allocation (with error bit) on allocation error.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not if source length is 0.
- * F_buffer_too_large (with error bit) if arguments array is too large for further allocation.
+ * F_array_too_large (with error bit) if arguments array is too large for further allocation.
* F_memory_allocation (with error bit) on allocation error.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not if size is 0.
- * F_buffer_too_large (with error bit) if arguments array is too large for further allocation.
+ * F_array_too_large (with error bit) if arguments array is too large for further allocation.
* F_memory_allocation (with error bit) on allocation error.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not if size is 0.
- * F_buffer_too_large (with error bit) if arguments array is too large for further allocation.
+ * F_array_too_large (with error bit) if arguments array is too large for further allocation.
* F_memory_allocation (with error bit) on allocation error.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not if source length is 0.
- * F_buffer_too_large (with error bit) if arguments array is too large for further allocation.
+ * F_array_too_large (with error bit) if arguments array is too large for further allocation.
* F_memory_allocation (with error bit) on allocation error.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not if source length is 0.
- * F_buffer_too_large (with error bit) if arguments array is too large for further allocation.
+ * F_array_too_large (with error bit) if arguments array is too large for further allocation.
* F_memory_allocation (with error bit) on allocation error.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not if source length is 0.
- * F_buffer_too_large (with error bit) if arguments array is too large for further allocation.
+ * F_array_too_large (with error bit) if arguments array is too large for further allocation.
* F_memory_allocation (with error bit) on allocation error.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not if source length is 0.
- * F_buffer_too_large (with error bit) if arguments array is too large for further allocation.
+ * F_array_too_large (with error bit) if arguments array is too large for further allocation.
* F_memory_allocation (with error bit) on allocation error.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_access_denied (with error bit) on access denied for program_path.
- * F_buffer_too_large (with error bit) if paths array (generated from PATH) is too large for further addressing.
+ * F_array_too_large (with error bit) if paths array (generated from PATH) is too large for further addressing.
* F_directory (with error bit) on invalid directory in program_path.
* F_failure (with error bit) if result is non-zero.
* F_file_found_not (with error bit) if file does not exist at the program_path.
if (arguments->used == arguments->size) {
if (arguments->size + f_memory_default_allocation_step > f_array_length_t_size) {
- if (arguments->size + 1 > f_array_length_t_size) return F_status_set_error(F_buffer_too_large);
+ if (arguments->size + 1 > f_array_length_t_size) return F_status_set_error(F_array_too_large);
f_macro_string_dynamics_t_resize(status, (*arguments), arguments->size + 1);
}
else {
if (arguments->used + 1 >= arguments->size) {
if (arguments->size + f_memory_default_allocation_step > f_array_length_t_size) {
- if (arguments->size + 2 > f_array_length_t_size) return F_status_set_error(F_buffer_too_large);
+ if (arguments->size + 2 > f_array_length_t_size) return F_status_set_error(F_array_too_large);
f_macro_string_dynamics_t_resize(status, (*arguments), arguments->size + 2);
}
else {
* @return
* F_none on success.
* F_data_not if name_length is 0.
- * F_buffer_too_large (with error bit) if arguments array is too large for further allocation.
+ * F_array_too_large (with error bit) if arguments array is too large for further allocation.
* F_memory_allocation (with error bit) on allocation error.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not if name_length is 0.
- * F_buffer_too_large (with error bit) if arguments array is too large for further allocation.
+ * F_array_too_large (with error bit) if arguments array is too large for further allocation.
* F_memory_allocation (with error bit) on allocation error.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
if (values[j]->used + contents.array[i].used > values[j]->size) {
if (values[j]->used + contents.array[i].used > f_array_length_t_size) {
- return F_status_set_error(F_buffer_too_large);
+ return F_status_set_error(F_array_too_large);
}
f_macro_string_dynamics_t_resize(status, (*value), (values[j]->used + content->used));
if (values[j]->used + f_fss_default_allocation_step > f_array_length_t_size) {
if (values[j]->used == f_array_length_t_size) {
f_macro_string_dynamic_t_delete_simple(name);
- return F_status_set_error(F_buffer_too_large);
+ return F_status_set_error(F_array_too_large);
}
f_macro_string_maps_t_resize(status, (*values[j]), values[j]->used + 1);
if (values[j]->used == values[j]->size) {
if (values[j]->used + f_fss_default_allocation_step > f_array_length_t_size) {
if (values[j]->used == f_array_length_t_size) {
- return F_status_set_error(F_buffer_too_large);
+ return F_status_set_error(F_array_too_large);
}
f_macro_string_map_multis_t_resize(status, (*values[j]), values[j]->used + 1);
if (contents.array[i].used > 1) {
if (map_multi->value.used + contents.array[i].used - 1 > map_multi->value.size) {
- if (map_multi->value.used + contents.array[i].used - 1 > f_array_length_t_size) return F_status_set_error(F_buffer_too_large);
+ if (map_multi->value.used + contents.array[i].used - 1 > f_array_length_t_size) return F_status_set_error(F_array_too_large);
f_macro_string_dynamics_t_resize(status, map_multi->value, map_multi->value.used + contents.array[i].used - 1);
if (F_status_is_error(status)) return status;
if (values[j]->used == values[j]->size) {
if (values[j]->used + f_fss_default_allocation_step > f_array_length_t_size) {
if (values[j]->used == f_array_length_t_size) {
- return F_status_set_error(F_buffer_too_large);
+ return F_status_set_error(F_array_too_large);
}
f_macro_string_maps_t_resize(status, (*values[j]), values[j]->used + 1);
if (values[j]->used == values[j]->size) {
if (values[j]->used + f_fss_default_allocation_step > f_array_length_t_size) {
if (values[j]->used == f_array_length_t_size) {
- return F_status_set_error(F_buffer_too_large);
+ return F_status_set_error(F_array_too_large);
}
f_macro_string_map_multis_t_resize(status, (*values[j]), values[j]->used + 1);
if (map_multi->value.used == map_multi->value.size) {
if (map_multi->value.used == f_array_length_t_size) {
- return F_status_set_error(F_buffer_too_large);
+ return F_status_set_error(F_array_too_large);
}
f_macro_string_dynamics_t_resize(status, map_multi->value, map_multi->value.used + 1);
if (values[j]->used + f_fss_default_allocation_step > f_array_length_t_size) {
if (values[j]->used == f_array_length_t_size) {
f_macro_string_dynamic_t_delete_simple(name);
- return F_status_set_error(F_buffer_too_large);
+ return F_status_set_error(F_array_too_large);
}
f_macro_string_maps_t_resize(status, (*values[j]), values[j]->used + 1);
if (values[j]->used == values[j]->size) {
if (values[j]->used + f_fss_default_allocation_step > f_array_length_t_size) {
if (values[j]->used == f_array_length_t_size) {
- return F_status_set_error(F_buffer_too_large);
+ return F_status_set_error(F_array_too_large);
}
f_macro_string_dynamics_t_resize(status, (*values[j]), values[j]->used + 1);
status = F_none;
}
else {
- f_macro_memory_structure_macro_increment(status, (*destination), 1, f_console_default_allocation_step, f_macro_string_dynamics_t_resize, F_buffer_too_large);
+ f_macro_memory_structure_macro_increment(status, (*destination), 1, f_console_default_allocation_step, f_macro_string_dynamics_t_resize, F_array_too_large);
if (F_status_is_error(status)) break;
destination->array[destination->used] = ripped;
* @return
* F_none on success.
* F_data_not if nothing to rip, no allocations or reallocations are performed.
- * F_buffer_too_large (with error bit) if a buffer would exceed max length.
+ * F_array_too_large (with error bit) if a buffer would exceed max length.
* F_memory_allocation (with error bit) on memory allocation error.
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
}
#endif // _di_F_status_basic_
+ #ifndef _di_F_status_array_
+ if (fl_string_compare(string, FL_status_string_array, length, FL_status_string_array_length) == F_equal_to) {
+ *code = F_array;
+ return F_none;
+ }
+
+ if (fl_string_compare(string, FL_status_string_array_too_large, length, FL_status_string_array_too_large_length) == F_equal_to) {
+ *code = F_array_too_large;
+ return F_none;
+ }
+
+ if (fl_string_compare(string, FL_status_string_array_too_small, length, FL_status_string_array_too_small_length) == F_equal_to) {
+ *code = F_array_too_small;
+ return F_none;
+ }
+ #endif // _di_F_status_array_
+
#ifndef _di_F_status_busy_
if (fl_string_compare(string, FL_status_string_busy, length, FL_status_string_busy_length) == F_equal_to) {
*code = F_busy;
f_macro_string_dynamic_t_delete_simple(part);
f_macro_string_dynamics_t_delete_simple(names);
- *status = F_status_set_error(F_buffer_too_large);
+ *status = F_status_set_error(F_array_too_large);
return;
}
if (F_status_is_error_not(*status) && environment->names.used + 1 > environment->names.size) {
if (environment->names.size + f_memory_default_allocation_step > f_array_length_t_size) {
if (environment->names.size + 1 > f_array_length_t_size) {
- *status = F_status_set_error(F_buffer_too_large);
+ *status = F_status_set_error(F_array_too_large);
}
else {
f_macro_string_dynamics_t_resize(*status, environment->names, environment->names.size + 1);
if (data_make->path.stack.used == data_make->path.stack.size) {
*status = fl_string_dynamics_increase_by(f_memory_default_allocation_step, &data_make->path.stack);
- if (F_status_set_fine(*status) == F_buffer_too_large) {
- fake_print_message_section_operation_path_stack_max(data, data_make->error, F_buffer_too_large, "fl_string_lengths_increase_by", "path stack");
+ if (F_status_set_fine(*status) == F_array_too_large) {
+ fake_print_message_section_operation_path_stack_max(data, data_make->error, F_array_too_large, "fl_string_lengths_increase_by", "path stack");
return;
}
else if (F_status_is_error(*status)) {
void fake_print_message_section_operation_path_stack_max(const fake_data_t data, fll_error_print_t error, const f_status_t status, const f_string_t function, const f_string_t path) {
if (data.error.verbosity == f_console_verbosity_quiet || !error.to.stream) return;
- if (status == F_buffer_too_large) {
+ if (status == F_array_too_large) {
fprintf(error.to.stream, "%c", f_string_eol[0]);
fl_color_print(error.to.stream, data.error.context, "%s: Maximum stack size reached while processing path '", data.error.prefix);
fl_color_print(error.to.stream, data.context.set.notable, "%s", path);
status = fl_string_dynamics_increase_by(data->parameters[fss_extended_write_parameter_content].values.used, &contents);
- if (status == F_buffer_too_large) {
+ if (status == F_array_too_large) {
status = F_status_set_error(status);
}
} // for
if (name_missed) {
- f_macro_memory_structure_macro_increment(status, names, 1, f_iki_default_allocation_step, f_macro_string_dynamics_t_resize, F_buffer_too_large);
+ f_macro_memory_structure_macro_increment(status, names, 1, f_iki_default_allocation_step, f_macro_string_dynamics_t_resize, F_array_too_large);
if (F_status_is_error(status)) {
fll_error_print(data->error, F_status_set_fine(status), "iki_read_process_buffer_ranges_whole", F_true);
status = fl_string_compare(arguments.argv[index], data->buffer.string + vocabulary->array[j].start, length, (vocabulary->array[j].stop - vocabulary->array[j].start) + 1);
if (status == F_equal_to) {
- f_macro_memory_structure_macro_increment(status, substitutionss[j], 1, f_iki_default_allocation_step, macro_iki_read_substitutions_t_resize, F_buffer_too_large);
+ f_macro_memory_structure_macro_increment(status, substitutionss[j], 1, f_iki_default_allocation_step, macro_iki_read_substitutions_t_resize, F_array_too_large);
if (F_status_is_error(status)) return status;
index = parameter->values.array[i + 1];