Fix typo in documentation 'object' should be 'name'.
Remove *_quote_delete() and *_quote_destroy() functions.
When I fixed the logic in some of the macros and the recently added functions, I failed to do so for some of the memory structure functions.
This caused failures during the Featureless Make "make" compilation.
I decided to go ahead and expand the macros, which was necessary for exposing the bug but I decided to keep them expanded.
These are private functions and the macros are there for helpers not so much as a rule.
The expansions directly call the f_memory_delete() and f_memory_destroy() functions (good thing I decided to keep those!).
In some cases, use *_increase() functions where possible.
Get rid of moe of the old FSS private functions that are now functional duplicates of functionality now provided by the f_type_aray, f_string, and f_memory.
This will be an ongoing thing.
Remove stale comments referencing "f_memory_out".
A bug was discovered (not a regression) where I used incorrect logic and was acting on potentially unallocated memory when passing the contents_quoted to another function.
Call the appropriate *_increase() function before getting the memory address to a content quote.
This bug is also causing problems with the Featureless Make "make" process.
if (needs_value.used > 0) {
i = needs_value.array[0];
- if (parameters.parameter[i].values.used + 1 > parameters.parameter[i].values.size) {
- f_macro_array_lengths_t_resize(status, parameters.parameter[i].values, parameters.parameter[i].values.size + f_memory_default_allocation_step);
+ f_macro_array_lengths_t_increase(status, parameters.parameter[i].values)
- if (F_status_is_error(status)) {
- f_macro_string_lengths_t_delete_simple(needs_value);
- return status;
- }
+ if (F_status_is_error(status)) {
+ f_macro_string_lengths_t_delete_simple(needs_value);
+ return status;
}
parameters.parameter[i].result = f_console_result_additional;
continue;
}
- if (parameters.parameter[i].locations.used + 1 > parameters.parameter[i].locations.size) {
- f_macro_string_lengths_t_resize(status, parameters.parameter[i].locations, parameters.parameter[i].locations.size + f_memory_default_allocation_step);
+ f_macro_string_lengths_t_increase(status, parameters.parameter[i].locations)
- if (F_status_is_error(status)) {
- f_macro_string_lengths_t_delete_simple(needs_value);
- return status;
- }
+ if (F_status_is_error(status)) {
+ f_macro_string_lengths_t_delete_simple(needs_value);
+ return status;
}
- if (parameters.parameter[i].locations_sub.used == parameters.parameter[i].locations_sub.size) {
- f_macro_string_lengths_t_resize(status, parameters.parameter[i].locations_sub, parameters.parameter[i].locations_sub.size + f_memory_default_allocation_step);
+ f_macro_string_lengths_t_increase(status, parameters.parameter[i].locations_sub)
- if (F_status_is_error(status)) {
- f_macro_string_lengths_t_delete_simple(needs_value);
- return status;
- }
+ if (F_status_is_error(status)) {
+ f_macro_string_lengths_t_delete_simple(needs_value);
+ return status;
}
parameters.parameter[i].locations.array[parameters.parameter[i].locations.used++] = location;
if (strncmp(arguments.argv[location], parameters.parameter[i].symbol_other, argument_length + 1) != 0) continue;
- if (parameters.parameter[i].locations.used == parameters.parameter[i].locations.size) {
- f_macro_string_lengths_t_resize(status, parameters.parameter[i].locations, parameters.parameter[i].locations.size + f_memory_default_allocation_step);
+ f_macro_string_lengths_t_increase(status, parameters.parameter[i].locations)
- if (F_status_is_error(status)) {
- f_macro_string_lengths_t_delete_simple(needs_value);
- return status;
- }
+ if (F_status_is_error(status)) {
+ f_macro_string_lengths_t_delete_simple(needs_value);
+ return status;
}
- if (parameters.parameter[i].locations_sub.used == parameters.parameter[i].locations_sub.size) {
- f_macro_string_lengths_t_resize(status, parameters.parameter[i].locations_sub, parameters.parameter[i].locations_sub.size + f_memory_default_allocation_step);
+ f_macro_string_lengths_t_increase(status, parameters.parameter[i].locations_sub)
- if (F_status_is_error(status)) {
- f_macro_string_lengths_t_delete_simple(needs_value);
- return status;
- }
+ if (F_status_is_error(status)) {
+ f_macro_string_lengths_t_delete_simple(needs_value);
+ return status;
}
parameters.parameter[i].locations.array[parameters.parameter[i].locations.used++] = location;
* The objects, contents, and quotess should each be of the same used and size.
* Any deviation to this would require implementing custom equivelents to the standard management macros.
*
- * object: The name representing this set.
+ * name: The name representing this set.
* objects: The array of objects.
* contents: The array of contents.
* quotess: The array of quote for each content.
#define f_fss_named_t_initialize { f_fss_object_t_initialize, f_fss_objects_t_initialize, f_fss_contents_t_initialize, f_fss_quotess_t_initialize }
#define f_macro_fss_named_t_clear(named) \
- f_macro_fss_object_t_clear(named.object) \
+ f_macro_fss_object_t_clear(named.name) \
f_macro_fss_objects_t_clear(named.objects) \
f_macro_fss_contents_t_clear(named.contents) \
f_macro_fss_quotess_t_clear(named.quotess)
}
#endif // _di_f_fss_set_quote_decrease_by_
-#ifndef _di_f_fss_set_quote_delete_
- f_status_t f_fss_set_quote_delete(f_fss_set_quote_t *set_quote) {
- #ifndef _di_level_0_parameter_checking_
- if (!set_quote) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_fss_set_quote_resize(0, set_quote);
- }
-#endif // _di_f_fss_set_quote_delete_
-
-#ifndef _di_f_fss_set_quote_destroy_
- f_status_t f_fss_set_quote_destroy(f_fss_set_quote_t *set_quote) {
- #ifndef _di_level_0_parameter_checking_
- if (!set_quote) return F_status_set_error(F_parameter);
- #endif // _di_level_0_parameter_checking_
-
- return private_f_fss_set_quote_adjust(0, set_quote);
- }
-#endif // _di_f_fss_set_quote_destroy_
-
#ifndef _di_f_fss_set_quote_increase_
f_status_t f_fss_set_quote_increase(f_fss_set_quote_t *set_quote) {
#ifndef _di_level_0_parameter_checking_
#define f_macro_fss_set_quote_t_resize(status, set_quote, length) status = f_fss_set_quote_resize(length, &set_quote);
#define f_macro_fss_set_quote_t_adjust(status, set_quote, length) status = f_fss_set_quote_adjust(length, &set_quote);
- #define f_macro_fss_set_quote_t_delete_simple(set_quote) f_fss_set_quote_delete(&set_quote);
- #define f_macro_fss_set_quote_t_destroy_simple(set_quote) f_fss_set_quote_destroy(&set_quote);
+ #define f_macro_fss_set_quote_t_delete_simple(set_quote) f_fss_set_quote_resize(0, &set_quote);
+ #define f_macro_fss_set_quote_t_destroy_simple(set_quote) f_fss_set_quote_adjust(0, &set_quote);
#define f_macro_fss_set_quote_t_increase(status, set_quote) status = f_fss_set_quote_increase(&set_quote);
#define f_macro_fss_set_quote_t_increase_by(status, set_quote, amount) status = f_fss_set_quote_increase_by(amount, &set_quote);
#endif // _di_f_fss_set_quote_decrease_by_
/**
- * Delete the array of set_quote.
- *
- * @param ranges
- * The ranges to delete.
- *
- * @return
- * F_none on success.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_fss_set_quote_delete_
- extern f_status_t f_fss_set_quote_delete(f_fss_set_quote_t *ranges);
-#endif // _di_f_fss_set_quote_delete_
-
-/**
- * Delete the array of set_quote.
- *
- * @param set_quote
- * The set_quote to destroy.
- *
- * @return
- * F_none on success.
- *
- * F_parameter (with error bit) if a parameter is invalid.
- */
-#ifndef _di_f_fss_set_quote_destroy_
- extern f_status_t f_fss_set_quote_destroy(f_fss_set_quote_t *set_quote);
-#endif // _di_f_fss_set_quote_destroy_
-
-/**
* Increase the size of the set_quote array, but only if necessary.
*
* If the given length is too large for the buffer, then attempt to set_quote max buffer size (f_array_length_t_size).
#ifndef _di_f_macro_memory_structures_resize_
#define f_macro_memory_structures_resize(status, structures, type_structure, type_structures, length, type_length) \
status = F_none; \
- if (length < structures.size) { \
- for (register type_length _macro__i = structures.size - 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; \
- } \
+ 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_f_macro_memory_structures_resize_
#ifndef _di_f_macro_memory_structures_adjust_
#define f_macro_memory_structures_adjust(status, structures, type_structure, type_structures, length, type_length) \
status = F_none; \
- if (length < structures.size) { \
- for (register type_length _macro__i = structures.size - 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; \
- } \
+ 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_f_macro_memory_structures_adjust_
f_status_t private_f_type_cellss_adjust(const f_array_length_t length, f_cellss_t *cellss) {
f_status_t status = F_none;
- f_macro_memory_structures_adjust(status, (*cellss), f_cell_t, f_cells_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < cellss->size; ++i) {
+
+ status = f_memory_destroy(cellss->array[i].size, sizeof(f_cells_t), (void **) & cellss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ cellss->array[i].size = 0;
+ cellss->array[i].used = 0;
+ } // for
+
+ status = f_memory_adjust(cellss->size, length, sizeof(f_cells_t), (void **) & cellss->array);
+
+ if (F_status_is_error_not(status)) {
+ cellss->size = length;
+
+ if (cellss->used > cellss->size) {
+ cellss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_cellss_resize(const f_array_length_t length, f_cellss_t *cellss) {
f_status_t status = F_none;
- f_macro_memory_structures_resize(status, (*cellss), f_cell_t, f_cells_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < cellss->size; ++i) {
+
+ status = f_memory_delete(cellss->array[i].size, sizeof(f_cells_t), (void **) & cellss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ cellss->array[i].size = 0;
+ cellss->array[i].used = 0;
+ } // for
+
+ status = f_memory_resize(cellss->size, length, sizeof(f_cells_t), (void **) & cellss->array);
+
+ if (F_status_is_error_not(status)) {
+ cellss->size = length;
+
+ if (cellss->used > cellss->size) {
+ cellss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_array_lengthss_adjust(const f_array_length_t length, f_array_lengthss_t *array_lengthss) {
f_status_t status = F_none;
- f_macro_memory_structures_adjust(status, (*array_lengthss), f_array_length_t, f_array_lengths_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < array_lengthss->size; ++i) {
+
+ status = f_memory_destroy(array_lengthss->array[i].size, sizeof(f_array_lengths_t), (void **) & array_lengthss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ array_lengthss->array[i].size = 0;
+ array_lengthss->array[i].used = 0;
+ } // for
+
+ status = f_memory_adjust(array_lengthss->size, length, sizeof(f_array_lengths_t), (void **) & array_lengthss->array);
+
+ if (F_status_is_error_not(status)) {
+ array_lengthss->size = length;
+
+ if (array_lengthss->used > array_lengthss->size) {
+ array_lengthss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_array_lengthss_resize(const f_array_length_t length, f_array_lengthss_t *array_lengthss) {
f_status_t status = F_none;
- f_macro_memory_structures_resize(status, (*array_lengthss), f_array_length_t, f_array_lengths_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < array_lengthss->size; ++i) {
+
+ status = f_memory_delete(array_lengthss->array[i].size, sizeof(f_array_lengths_t), (void **) & array_lengthss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ array_lengthss->array[i].size = 0;
+ array_lengthss->array[i].used = 0;
+ } // for
+
+ status = f_memory_resize(array_lengthss->size, length, sizeof(f_array_lengths_t), (void **) & array_lengthss->array);
+
+ if (F_status_is_error_not(status)) {
+ array_lengthss->size = length;
+
+ if (array_lengthss->used > array_lengthss->size) {
+ array_lengthss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_int8ss_adjust(const f_array_length_t length, f_int8ss_t *int8ss) {
f_status_t status = F_none;
- f_macro_memory_structures_adjust(status, (*int8ss), int8_t, f_int8s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < int8ss->size; ++i) {
+
+ status = f_memory_destroy(int8ss->array[i].size, sizeof(f_int8s_t), (void **) & int8ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ int8ss->array[i].size = 0;
+ int8ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_adjust(int8ss->size, length, sizeof(f_int8s_t), (void **) & int8ss->array);
+
+ if (F_status_is_error_not(status)) {
+ int8ss->size = length;
+
+ if (int8ss->used > int8ss->size) {
+ int8ss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_int8ss_resize(const f_array_length_t length, f_int8ss_t *int8ss) {
f_status_t status = F_none;
- f_macro_memory_structures_resize(status, (*int8ss), int8_t, f_int8s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < int8ss->size; ++i) {
+
+ status = f_memory_delete(int8ss->array[i].size, sizeof(f_int8s_t), (void **) & int8ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ int8ss->array[i].size = 0;
+ int8ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_resize(int8ss->size, length, sizeof(f_int8s_t), (void **) & int8ss->array);
+
+ if (F_status_is_error_not(status)) {
+ int8ss->size = length;
+
+ if (int8ss->used > int8ss->size) {
+ int8ss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_uint8ss_adjust(const f_array_length_t length, f_uint8ss_t *uint8ss) {
f_status_t status = F_none;
- f_macro_memory_structures_adjust(status, (*uint8ss), uint8_t, f_uint8s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < uint8ss->size; ++i) {
+
+ status = f_memory_destroy(uint8ss->array[i].size, sizeof(f_uint8s_t), (void **) & uint8ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint8ss->array[i].size = 0;
+ uint8ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_adjust(uint8ss->size, length, sizeof(f_uint8s_t), (void **) & uint8ss->array);
+
+ if (F_status_is_error_not(status)) {
+ uint8ss->size = length;
+
+ if (uint8ss->used > uint8ss->size) {
+ uint8ss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_uint8ss_resize(const f_array_length_t length, f_uint8ss_t *uint8ss) {
f_status_t status = F_none;
- f_macro_memory_structures_resize(status, (*uint8ss), uint8_t, f_uint8s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < uint8ss->size; ++i) {
+
+ status = f_memory_delete(uint8ss->array[i].size, sizeof(f_uint8s_t), (void **) & uint8ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint8ss->array[i].size = 0;
+ uint8ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_resize(uint8ss->size, length, sizeof(f_uint8s_t), (void **) & uint8ss->array);
+
+ if (F_status_is_error_not(status)) {
+ uint8ss->size = length;
+
+ if (uint8ss->used > uint8ss->size) {
+ uint8ss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_int16ss_adjust(const f_array_length_t length, f_int16ss_t *int16ss) {
f_status_t status = F_none;
- f_macro_memory_structures_adjust(status, (*int16ss), int16_t, f_int16s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < int16ss->size; ++i) {
+
+ status = f_memory_destroy(int16ss->array[i].size, sizeof(f_int16s_t), (void **) & int16ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ int16ss->array[i].size = 0;
+ int16ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_adjust(int16ss->size, length, sizeof(f_int16s_t), (void **) & int16ss->array);
+
+ if (F_status_is_error_not(status)) {
+ int16ss->size = length;
+
+ if (int16ss->used > int16ss->size) {
+ int16ss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_int16ss_resize(const f_array_length_t length, f_int16ss_t *int16ss) {
f_status_t status = F_none;
- f_macro_memory_structures_resize(status, (*int16ss), int16_t, f_int16s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < int16ss->size; ++i) {
+
+ status = f_memory_delete(int16ss->array[i].size, sizeof(f_int16s_t), (void **) & int16ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ int16ss->array[i].size = 0;
+ int16ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_resize(int16ss->size, length, sizeof(f_int16s_t), (void **) & int16ss->array);
+
+ if (F_status_is_error_not(status)) {
+ int16ss->size = length;
+
+ if (int16ss->used > int16ss->size) {
+ int16ss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_uint16ss_adjust(const f_array_length_t length, f_uint16ss_t *uint16ss) {
f_status_t status = F_none;
- f_macro_memory_structures_adjust(status, (*uint16ss), uint16_t, f_uint16s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < uint16ss->size; ++i) {
+
+ status = f_memory_destroy(uint16ss->array[i].size, sizeof(f_uint16s_t), (void **) & uint16ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint16ss->array[i].size = 0;
+ uint16ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_adjust(uint16ss->size, length, sizeof(f_uint16s_t), (void **) & uint16ss->array);
+
+ if (F_status_is_error_not(status)) {
+ uint16ss->size = length;
+
+ if (uint16ss->used > uint16ss->size) {
+ uint16ss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_uint16ss_resize(const f_array_length_t length, f_uint16ss_t *uint16ss) {
f_status_t status = F_none;
- f_macro_memory_structures_resize(status, (*uint16ss), uint16_t, f_uint16s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < uint16ss->size; ++i) {
+
+ status = f_memory_delete(uint16ss->array[i].size, sizeof(f_uint8s_t), (void **) & uint16ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint16ss->array[i].size = 0;
+ uint16ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_resize(uint16ss->size, length, sizeof(f_uint8s_t), (void **) & uint16ss->array);
+
+ if (F_status_is_error_not(status)) {
+ uint16ss->size = length;
+
+ if (uint16ss->used > uint16ss->size) {
+ uint16ss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_int32ss_adjust(const f_array_length_t length, f_int32ss_t *int32ss) {
f_status_t status = F_none;
- f_macro_memory_structures_adjust(status, (*int32ss), int32_t, f_int32s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < int32ss->size; ++i) {
+
+ status = f_memory_destroy(int32ss->array[i].size, sizeof(f_int32s_t), (void **) & int32ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ int32ss->array[i].size = 0;
+ int32ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_adjust(int32ss->size, length, sizeof(f_int32s_t), (void **) & int32ss->array);
+
+ if (F_status_is_error_not(status)) {
+ int32ss->size = length;
+
+ if (int32ss->used > int32ss->size) {
+ int32ss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_int32ss_resize(const f_array_length_t length, f_int32ss_t *int32ss) {
f_status_t status = F_none;
- f_macro_memory_structures_resize(status, (*int32ss), int32_t, f_int32s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < int32ss->size; ++i) {
+
+ status = f_memory_delete(int32ss->array[i].size, sizeof(f_int32s_t), (void **) & int32ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ int32ss->array[i].size = 0;
+ int32ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_resize(int32ss->size, length, sizeof(f_int32s_t), (void **) & int32ss->array);
+
+ if (F_status_is_error_not(status)) {
+ int32ss->size = length;
+
+ if (int32ss->used > int32ss->size) {
+ int32ss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_uint32ss_adjust(const f_array_length_t length, f_uint32ss_t *uint32ss) {
f_status_t status = F_none;
- f_macro_memory_structures_adjust(status, (*uint32ss), uint32_t, f_uint32s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < uint32ss->size; ++i) {
+
+ status = f_memory_destroy(uint32ss->array[i].size, sizeof(f_uint32s_t), (void **) & uint32ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint32ss->array[i].size = 0;
+ uint32ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_adjust(uint32ss->size, length, sizeof(f_uint32s_t), (void **) & uint32ss->array);
+
+ if (F_status_is_error_not(status)) {
+ uint32ss->size = length;
+
+ if (uint32ss->used > uint32ss->size) {
+ uint32ss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_uint32ss_resize(const f_array_length_t length, f_uint32ss_t *uint32ss) {
f_status_t status = F_none;
- f_macro_memory_structures_resize(status, (*uint32ss), uint32_t, f_uint32s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < uint32ss->size; ++i) {
+
+ status = f_memory_delete(uint32ss->array[i].size, sizeof(f_uint32s_t), (void **) & uint32ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint32ss->array[i].size = 0;
+ uint32ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_resize(uint32ss->size, length, sizeof(f_uint32s_t), (void **) & uint32ss->array);
+
+ if (F_status_is_error_not(status)) {
+ uint32ss->size = length;
+
+ if (uint32ss->used > uint32ss->size) {
+ uint32ss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_int64ss_adjust(const f_array_length_t length, f_int64ss_t *int64ss) {
f_status_t status = F_none;
- f_macro_memory_structures_adjust(status, (*int64ss), int64_t, f_int64s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < int64ss->size; ++i) {
+
+ status = f_memory_destroy(int64ss->array[i].size, sizeof(f_int64s_t), (void **) & int64ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ int64ss->array[i].size = 0;
+ int64ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_adjust(int64ss->size, length, sizeof(f_int64s_t), (void **) & int64ss->array);
+
+ if (F_status_is_error_not(status)) {
+ int64ss->size = length;
+
+ if (int64ss->used > int64ss->size) {
+ int64ss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_int64ss_resize(const f_array_length_t length, f_int64ss_t *int64ss) {
f_status_t status = F_none;
- f_macro_memory_structures_resize(status, (*int64ss), int64_t, f_int64s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < int64ss->size; ++i) {
+
+ status = f_memory_delete(int64ss->array[i].size, sizeof(f_int64s_t), (void **) & int64ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ int64ss->array[i].size = 0;
+ int64ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_resize(int64ss->size, length, sizeof(f_int64s_t), (void **) & int64ss->array);
+
+ if (F_status_is_error_not(status)) {
+ int64ss->size = length;
+
+ if (int64ss->used > int64ss->size) {
+ int64ss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_uint64ss_adjust(const f_array_length_t length, f_uint64ss_t *uint64ss) {
f_status_t status = F_none;
- f_macro_memory_structures_adjust(status, (*uint64ss), uint64_t, f_uint64s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < uint64ss->size; ++i) {
+
+ status = f_memory_destroy(uint64ss->array[i].size, sizeof(f_uint64s_t), (void **) & uint64ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint64ss->array[i].size = 0;
+ uint64ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_adjust(uint64ss->size, length, sizeof(f_uint64s_t), (void **) & uint64ss->array);
+
+ if (F_status_is_error_not(status)) {
+ uint64ss->size = length;
+
+ if (uint64ss->used > uint64ss->size) {
+ uint64ss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_uint64ss_resize(const f_array_length_t length, f_uint64ss_t *uint64ss) {
f_status_t status = F_none;
- f_macro_memory_structures_resize(status, (*uint64ss), uint64_t, f_uint64s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < uint64ss->size; ++i) {
+
+ status = f_memory_delete(uint64ss->array[i].size, sizeof(f_uint64s_t), (void **) & uint64ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint64ss->array[i].size = 0;
+ uint64ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_resize(uint64ss->size, length, sizeof(f_uint64s_t), (void **) & uint64ss->array);
+
+ if (F_status_is_error_not(status)) {
+ uint64ss->size = length;
+
+ if (uint64ss->used > uint64ss->size) {
+ uint64ss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_int128ss_adjust(const f_array_length_t length, f_int128ss_t *int128ss) {
f_status_t status = F_none;
- f_macro_memory_structures_adjust(status, (*int128ss), f_int128_t, f_int128s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < int128ss->size; ++i) {
+
+ status = f_memory_destroy(int128ss->array[i].size, sizeof(f_int128s_t), (void **) & int128ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ int128ss->array[i].size = 0;
+ int128ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_adjust(int128ss->size, length, sizeof(f_int128s_t), (void **) & int128ss->array);
+
+ if (F_status_is_error_not(status)) {
+ int128ss->size = length;
+
+ if (int128ss->used > int128ss->size) {
+ int128ss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_int128ss_resize(const f_array_length_t length, f_int128ss_t *int128ss) {
f_status_t status = F_none;
- f_macro_memory_structures_resize(status, (*int128ss), f_int128_t, f_int128s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < int128ss->size; ++i) {
+
+ status = f_memory_delete(int128ss->array[i].size, sizeof(f_int128s_t), (void **) & int128ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ int128ss->array[i].size = 0;
+ int128ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_resize(int128ss->size, length, sizeof(f_int128s_t), (void **) & int128ss->array);
+
+ if (F_status_is_error_not(status)) {
+ int128ss->size = length;
+
+ if (int128ss->used > int128ss->size) {
+ int128ss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_uint128ss_adjust(const f_array_length_t length, f_uint128ss_t *uint128ss) {
f_status_t status = F_none;
- f_macro_memory_structures_adjust(status, (*uint128ss), f_uint128_t, f_uint128s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < uint128ss->size; ++i) {
+
+ status = f_memory_destroy(uint128ss->array[i].size, sizeof(f_uint128s_t), (void **) & uint128ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint128ss->array[i].size = 0;
+ uint128ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_adjust(uint128ss->size, length, sizeof(f_uint128s_t), (void **) & uint128ss->array);
+
+ if (F_status_is_error_not(status)) {
+ uint128ss->size = length;
+
+ if (uint128ss->used > uint128ss->size) {
+ uint128ss->used = length;
+ }
+ }
return status;
}
f_status_t private_f_type_uint128ss_resize(const f_array_length_t length, f_uint128ss_t *uint128ss) {
f_status_t status = F_none;
- f_macro_memory_structures_resize(status, (*uint128ss), f_uint128_t, f_uint128s_t, length, f_array_length_t)
+ for (f_array_length_t i = length; i < uint128ss->size; ++i) {
+
+ status = f_memory_delete(uint128ss->array[i].size, sizeof(f_uint128s_t), (void **) & uint128ss->array[i].array);
+ if (F_status_is_error(status)) return status;
+
+ uint128ss->array[i].size = 0;
+ uint128ss->array[i].used = 0;
+ } // for
+
+ status = f_memory_resize(uint128ss->size, length, sizeof(f_uint128s_t), (void **) & uint128ss->array);
+
+ if (F_status_is_error_not(status)) {
+ uint128ss->size = length;
+
+ if (uint128ss->used > uint128ss->size) {
+ uint128ss->used = length;
+ }
+ }
return status;
}
slash_count = 1;
if (do_prepend) {
- status = private_fl_fss_destination_prepend(prepend, destination);
+ status = f_string_dynamic_prepend(*prepend, destination);
if (F_status_is_error(status)) break;
do_prepend = F_false;
start = range->start++;
if (do_prepend) {
- status = private_fl_fss_destination_prepend(prepend, destination);
+ status = f_string_dynamic_prepend(*prepend, destination);
if (F_status_is_error(status)) break;
do_prepend = F_false;
if (content.string[range->start] != f_fss_delimit_placeholder) {
if (do_prepend) {
- status = private_fl_fss_destination_prepend(prepend, destination);
+ status = f_string_dynamic_prepend(*prepend, destination);
if (F_status_is_error(status)) break;
do_prepend = F_false;
return status;
}
- status = private_fl_fss_nest_increase(found);
+ f_macro_fss_nest_t_increase(status, (*found));
if (F_status_is_error(status)) return status;
f_string_lengths_t positions_start = f_string_lengths_t_initialize;
}
if (buffer.string[range->start] == f_fss_eol) {
- status = private_fl_fss_nest_increase(found);
+ f_macro_fss_nest_t_increase(status, (*found));
if (F_status_is_error(status)) break;
if (found->depth[depth].used == found->depth[depth].size) {
private_fl_macro_fss_nest_return_on_overflow_delimited((buffer), (*range), (*found), positions_start, objects, F_none_eos, F_none_stop)
f_macro_string_lengths_t_delete_simple(positions_start);
- private_fl_fss_objects_delete(&objects);
+ f_macro_fss_objects_t_delete_simple(objects);
return FL_fss_found_content;
}
} // while
f_macro_string_lengths_t_delete_simple(positions_start);
- private_fl_fss_objects_delete(&objects);
+ f_macro_fss_objects_t_delete_simple(objects);
delimits->used = delimits_used;
comments->used = comments_used;
slash_count = 1;
if (do_prepend) {
- status = private_fl_fss_destination_prepend(prepend, destination);
+ status = f_string_dynamic_prepend(*prepend, destination);
if (F_status_is_error(status)) break;
do_prepend = F_false;
start = range->start++;
if (do_prepend) {
- status = private_fl_fss_destination_prepend(prepend, destination);
+ status = f_string_dynamic_prepend(*prepend, destination);
if (F_status_is_error(status)) break;
do_prepend = F_false;
if (content.string[range->start] != f_fss_delimit_placeholder) {
if (do_prepend) {
- status = private_fl_fss_destination_prepend(prepend, destination);
+ status = f_string_dynamic_prepend(*prepend, destination);
if (F_status_is_error(status)) break;
do_prepend = F_false;
slash_count = 1;
if (do_prepend) {
- status = private_fl_fss_destination_prepend(prepend, destination);
+ status = f_string_dynamic_prepend(*prepend, destination);
if (F_status_is_error(status)) break;
do_prepend = F_false;
start = range->start++;
if (do_prepend) {
- status = private_fl_fss_destination_prepend(prepend, destination);
+ status = f_string_dynamic_prepend(*prepend, destination);
if (F_status_is_error(status)) break;
do_prepend = F_false;
if (content.string[range->start] != f_fss_delimit_placeholder) {
if (do_prepend) {
- status = private_fl_fss_destination_prepend(prepend, destination);
+ status = f_string_dynamic_prepend(*prepend, destination);
if (F_status_is_error(status)) break;
do_prepend = F_false;
}
#endif // !defined(_di_fl_fss_basic_object_write_string_) || !defined(_di_fl_fss_extended_object_write_string_) || !defined(_di_fl_fss_extended_content_write_string_)
-#if !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_)
- f_status_t private_fl_fss_destination_prepend(const f_string_static_t *prepend, f_string_dynamic_t *destination) {
-
- if (!prepend || !prepend->used) {
- return F_none;
- }
-
- {
- const f_status_t status = f_string_dynamic_increase_by(prepend->used, destination);
- if (F_status_is_error(status)) return status;
- }
-
- for (f_string_length_t i = 0; i < prepend->used; i++) {
- destination->string[destination->used++] = prepend->string[i];
- } // for
-
- return F_none;
- }
-#endif // !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_)
-
-#if !defined(_di_fl_fss_embedded_list_object_read_) || !defined(_di_fl_fss_embedded_list_content_read_)
- f_status_t private_fl_fss_nest_increase(f_fss_nest_t *nest) {
-
- if (nest->used + 1 > nest->size) {
- f_array_length_t size = nest->used + f_fss_default_allocation_step;
-
- if (size > f_string_length_t_size) {
- if (nest->used + 1 > f_array_length_t_size) {
- return F_status_set_error(F_array_too_large);
- }
-
- size = f_array_length_t_size;
- }
-
- f_status_t status = F_none;
-
- f_macro_fss_nest_t_resize(status, (*nest), size);
-
- return status;
- }
-
- return F_none;
- }
-#endif // !defined(_di_fl_fss_embedded_list_object_read_) || !defined(_di_fl_fss_embedded_list_content_read_)
-
-#if !defined(_di_fl_fss_embedded_list_content_read_)
- void private_fl_fss_objects_delete(f_fss_objects_t *objects) {
- f_macro_fss_objects_t_delete_simple((*objects));
- }
-#endif // !defined(_di_fl_fss_embedded_list_content_read_)
-
#ifdef __cplusplus
} // extern "C"
#endif
extern f_status_t private_fl_fss_basic_write(const bool object_as, const f_string_static_t object, const f_fss_quote_t quoted, f_string_range_t *range, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal;
#endif // !defined(fl_fss_basic_object_write_string) || !defined(fl_fss_extended_object_write_string) || !defined(_di_fl_fss_extended_content_write_string_)
-/**
- * Prepend the given string onto the destination buffer, allocating space as necessary.
- *
- * @param prepend
- * A string to prepend at the start of each line, such as spaces.
- * Set the pointer address to 0 to disable.
- * @param destination
- * The destination buffer to prepend to.
- *
- * @return
- * F_none on success.
- * F_memory_not (with error bit) on out of memory.
- * F_string_too_large (with error bit) if increased string length is too large to store in the destination.
- *
- * @see fl_fss_basic_list_content_write_string()
- * @see fl_fss_extended_list_content_write_string()
- */
-#if !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_)
- extern f_status_t private_fl_fss_destination_prepend(const f_string_static_t *prepend, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal;
-#endif // !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_)
-
-/**
- * Increase the size of a given nest buffer, but only if necessary.
- *
- * @param nest
- * The nest buffer to increment.
- *
- * @return
- * F_none on success.
- * F_memory_not (with error bit) on out of memory.
- * F_array_too_large (with error bit) if new length is larger than max array length.
- *
- * @see fl_fss_embedded_list_object_read()
- * @see fl_fss_embedded_list_content_read()
- */
-#if !defined(_di_fl_fss_embedded_list_object_read_) || !defined(_di_fl_fss_embedded_list_content_read_)
- extern f_status_t private_fl_fss_nest_increase(f_fss_nest_t *nest) f_gcc_attribute_visibility_internal;
-#endif // !defined(_di_fl_fss_embedded_list_object_read_) || !defined(_di_fl_fss_embedded_list_content_read_)
-
-/**
- * Private implementation for deleting fss objects.
- *
- * Intended to be shared to each of the different implementation variations.
- *
- * @param objects
- * The objects to delete.
- *
- * @see f_macro_fss_objects_t_delete_simple()
- * @see fl_fss_embedded_list_content_read()
- */
-#if !defined(_di_fl_fss_embedded_list_content_read_)
- extern void private_fl_fss_objects_delete(f_fss_objects_t *objects) f_gcc_attribute_visibility_internal;
-#endif // !defined(_di_fl_fss_embedded_list_content_read_)
-
#ifdef __cplusplus
} // extern "C"
#endif
delimits.used = delimits_used; \
comments.used = comments_used; \
f_macro_string_lengths_t_delete_simple(positions); \
- private_fl_fss_objects_delete(&objects); \
+ f_macro_fss_objects_t_delete_simple(objects); \
return eos_status; \
} \
else if (range.start > range.stop) { \
delimits.used = delimits_used; \
comments.used = comments_used; \
f_macro_string_lengths_t_delete_simple(positions); \
- private_fl_fss_objects_delete(&objects); \
+ f_macro_fss_objects_t_delete_simple(objects); \
return stop_status; \
}
#endif // _di_fl_macro_fss_nest_return_on_overflow_
#define private_fl_macro_fss_nest_return_on_overflow_delimited(buffer, range, found, positions, objects, eos_status, stop_status) \
if (range.start >= buffer.used) { \
f_macro_string_lengths_t_delete_simple(positions); \
- private_fl_fss_objects_delete(&objects); \
+ f_macro_fss_objects_t_delete_simple(objects); \
return eos_status; \
} \
else if (range.start > range.stop) { \
f_macro_string_lengths_t_delete_simple(positions); \
- private_fl_fss_objects_delete(&objects); \
+ f_macro_fss_objects_t_delete_simple(objects); \
return stop_status; \
}
#endif // _di_fl_macro_fss_nest_return_on_overflow_delimited_
* @return
* F_none on success.
* F_data_not if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
*
* @return
* F_none on success.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
*
* @return
* F_none on success.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not on success but only whitespace found.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
+ * F_data_not_eos if source length is 0..
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*/
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
* F_data_not_stop if range.start > range.stop.
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_complete_not_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_utf (with error bit) if a character in the string is an invalid UTF-8 character.
* F_data_not_stop if range.start > range.stop.
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_complete_not_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_utf (with error bit) if a character in the string is an invalid UTF-8 character.
objects_quoted->used++;
}
- if (contents->array[contents->used].used == contents->array[contents->used].size) {
- f_macro_fss_content_t_increase(status2, contents->array[contents->used])
- if (F_status_is_error(status2)) return status2;
- }
+ f_macro_fss_content_t_increase(status2, contents->array[contents->used])
+ if (F_status_is_error(status2)) return status2;
contents->used++;
else if (status == FL_fss_found_object_content_not) {
found_data = F_true;
- if (contents->array[contents->used].used == contents->array[contents->used].size) {
- f_macro_fss_content_t_increase(status2, contents->array[contents->used])
- if (F_status_is_error(status2)) return status2;
- }
+ f_macro_fss_content_t_increase(status2, contents->array[contents->used])
+ if (F_status_is_error(status2)) return status2;
break;
}
if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) {
objects->used++;
- if (contents->array[contents->used].used == contents->array[contents->used].size) {
- f_macro_fss_delimits_t_increase(status2, contents->array[contents->used])
- if (F_status_is_error(status2)) return status2;
- }
+ f_macro_fss_delimits_t_increase(status2, contents->array[contents->used])
+ if (F_status_is_error(status2)) return status2;
contents->used++;
else if (status == FL_fss_found_object_content_not) {
found_data = F_true;
- if (contents->array[contents->used].used == contents->array[contents->used].size) {
- f_macro_fss_content_t_increase(status2, contents->array[contents->used])
- if (F_status_is_error(status2)) return status2;
- }
+ f_macro_fss_content_t_increase(status2, contents->array[contents->used])
+ if (F_status_is_error(status2)) return status2;
break;
}
f_fss_quotes_t *quoted_content = 0;
do {
+
if (objects->used == objects->size) {
- f_macro_fss_objects_t_resize(status2, (*objects), objects->used + f_fss_default_allocation_step);
+ f_macro_fss_objects_t_increase(status2, (*objects));
if (F_status_is_error(status2)) return status2;
- f_macro_fss_contents_t_resize(status2, (*contents), contents->used + f_fss_default_allocation_step);
+ f_macro_fss_contents_t_increase(status2, (*contents));
if (F_status_is_error(status2)) return status2;
if (objects_quoted) {
- f_macro_fss_quotes_t_resize(status2, (*objects_quoted), objects_quoted->used + f_fss_default_allocation_step);
+ f_macro_fss_quotes_t_increase(status2, (*objects_quoted));
if (F_status_is_error(status2)) return status2;
}
if (contents_quoted) {
- f_macro_fss_quotess_t_resize(status2, (*contents_quoted), contents_quoted->used + f_fss_default_allocation_step);
+ f_macro_fss_quotess_t_increase(status2, (*contents_quoted));
if (F_status_is_error(status2)) return status2;
}
}
do {
+
if (objects_quoted) {
quoted_object = &objects_quoted->array[objects_quoted->used];
}
status = fl_fss_extended_object_read(buffer, range, &objects->array[objects->used], quoted_object, objects_delimits);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
if (range->start >= range->stop || range->start >= buffer.used) {
if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) {
objects_quoted->used++;
}
- if (contents->array[contents->used].used == contents->array[contents->used].size) {
- f_macro_fss_content_t_increase(status2, contents->array[contents->used])
- if (F_status_is_error(status2)) return status2;
- }
+ f_macro_fss_content_t_increase(status2, contents->array[contents->used])
+ if (F_status_is_error(status2)) return status2;
contents->used++;
if (contents_quoted) {
+ f_macro_fss_quotes_t_increase(status2, contents_quoted->array[contents_quoted->used])
+ if (F_status_is_error(status2)) return status2;
+
contents_quoted->used++;
}
return F_none_stop;
}
- else {
- if (range->start >= buffer.used) {
- return F_data_not_eos;
- }
- return F_data_not_stop;
+ if (range->start >= buffer.used) {
+ return F_data_not_eos;
}
+
+ return F_data_not_stop;
}
if (status == FL_fss_found_object) {
found_data = F_true;
if (contents_quoted) {
+ f_macro_fss_quotes_t_increase(status2, contents_quoted->array[contents_quoted->used])
+ if (F_status_is_error(status2)) return status2;
+
quoted_content = &contents_quoted->array[contents_quoted->used];
}
}
else if (status == FL_fss_found_object_content_not) {
found_data = F_true;
-
- if (contents->array[contents->used].used == contents->array[contents->used].size) {
- f_macro_fss_content_t_increase(status2, contents->array[contents->used])
- if (F_status_is_error(status2)) return status2;
- }
-
break;
}
if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) {
objects->used++;
- if (contents->array[contents->used].used == contents->array[contents->used].size) {
- f_macro_fss_content_t_increase(status2, contents->array[contents->used])
- if (F_status_is_error(status2)) return status2;
- }
+ f_macro_fss_content_t_increase(status2, contents->array[contents->used])
+ if (F_status_is_error(status2)) return status2;
contents->used++;
else if (status == FL_fss_found_object_content_not) {
found_data = F_true;
- if (contents->array[contents->used].used == contents->array[contents->used].size) {
- f_macro_fss_content_t_increase(status2, contents->array[contents->used])
- if (F_status_is_error(status2)) return status2;
- }
+ f_macro_fss_content_t_increase(status2, contents->array[contents->used])
+ if (F_status_is_error(status2)) return status2;
break;
}
status = F_none;
}
else {
- if (destination->used == destination->size) {
- f_macro_string_dynamics_t_resize(status, (*destination), destination->size + f_memory_default_allocation_step);
- if (F_status_is_error(status)) return status;
- }
+ f_macro_string_dynamics_t_increase(status, (*destination));
+ if (F_status_is_error(status)) return status;
destination->array[destination->used] = ripped;
destination->used++;
* F_none on success.
* F_data_not if nothing to rip, no allocations or reallocations are performed.
* F_array_too_large (with error bit) if a buffer would exceed max length.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
* F_data_not if nothing to rip, no allocations or reallocations are performed.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not if nothing to rip, no allocations or reallocations are performed.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
* F_data_not if nothing to rip, no allocations or reallocations are performed.
- * F_memory_out (with error bit) on out of memory.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
setting_mode_lengths[j] = settings_length[j] + 1 + modes->array[i].used;
- f_macro_string_dynamic_t_resize(*status, settings_mode_name_dynamic[j], setting_mode_lengths[j]);
+ f_macro_string_dynamic_t_resize(*status, settings_mode_name_dynamic[j], setting_mode_lengths[j]);
if (F_status_is_error(*status)) {
function = " f_macro_string_dynamic_t_resize";