Add the appropriate functions.
This file will need to be reviewed to have increase and decrease functions for all of the string types.
Fix documentation for FSS Basic and FSS Extended, which should state that the parameter is optional.
}
#endif // _di_fl_string_lengths_increase_
+#ifndef _di_fl_string_maps_decrease_
+ f_return_status fl_string_maps_decrease(f_string_maps_t *maps) {
+ #ifndef _di_level_1_parameter_checking_
+ if (!maps) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ f_status_t status = F_none;
+
+ if (maps->size - 1 > 0) {
+ f_macro_string_maps_t_resize(status, (*maps), maps->size - 1);
+ }
+ else {
+ f_macro_string_maps_t_delete(status, (*maps));
+ }
+
+ return status;
+ }
+#endif // _di_fl_string_maps_decrease_
+
+#ifndef _di_fl_string_maps_decrease_by_
+ f_return_status fl_string_maps_decrease_by(const f_array_length_t amount, f_string_maps_t *maps) {
+ #ifndef _di_level_1_parameter_checking_
+ if (!amount) return F_status_set_error(F_parameter);
+ if (!maps) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ f_status_t status = F_none;
+
+ if (maps->size - amount > 0) {
+ f_macro_string_maps_t_resize(status, (*maps), maps->size - amount);
+ }
+ else {
+ f_macro_string_maps_t_delete(status, (*maps));
+ }
+
+ return status;
+ }
+#endif // _di_fl_string_maps_decrease_by_
+
#ifndef _di_fl_string_lengths_increase_by_
f_return_status fl_string_lengths_increase_by(const f_array_length_t amount, f_string_lengths_t *lengths) {
#ifndef _di_level_1_parameter_checking_
}
#endif // _di_fl_string_lengths_increase_by_
+#ifndef _di_fl_string_maps_increase_
+ f_return_status fl_string_maps_increase(f_string_maps_t *maps) {
+ #ifndef _di_level_1_parameter_checking_
+ if (!maps) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ f_status_t status = F_none;
+
+ if (maps->size + f_memory_default_allocation_step > f_array_length_t_size) {
+ if (maps->size == f_array_length_t_size) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ f_macro_string_maps_t_resize(status, (*maps), f_array_length_t_size);
+ return F_array_too_large;
+ }
+
+ f_macro_string_maps_t_resize(status, (*maps), maps->size + f_memory_default_allocation_step);
+ return status;
+ }
+#endif // _di_fl_string_maps_increase_
+
+#ifndef _di_fl_string_maps_increase_by_
+ f_return_status fl_string_maps_increase_by(const f_array_length_t amount, f_string_maps_t *maps) {
+ #ifndef _di_level_1_parameter_checking_
+ if (!amount) return F_status_set_error(F_parameter);
+ if (!maps) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
+
+ f_status_t status = F_none;
+
+ if (maps->size + amount > f_array_length_t_size) {
+ if (maps->size == f_array_length_t_size) {
+ return F_status_set_error(F_array_too_large);
+ }
+
+ f_macro_string_maps_t_resize(status, (*maps), f_array_length_t_size);
+ return F_array_too_large;
+ }
+
+ f_macro_string_maps_t_resize(status, (*maps), maps->size + amount);
+ return status;
+ }
+#endif // _di_fl_string_maps_increase_by_
+
#ifndef _di_fl_string_mash_
f_return_status fl_string_mash(const f_string_t glue, const f_string_length_t glue_length, const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) {
#ifndef _di_level_1_parameter_checking_
#endif // _di_fl_string_lengths_increase_by_
/**
+ * Resize the string maps array to a smaller size, by 1.
+ *
+ * This will shrink the size by size - 1.
+ * This will not shrink the size to less than 0.
+ *
+ * @param maps
+ * The string maps array to resize.
+ *
+ * @return
+ * F_none on success.
+ * 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.
+ */
+#ifndef _di_fl_string_maps_decrease_
+ extern f_return_status fl_string_maps_decrease(f_string_maps_t *maps);
+#endif // _di_fl_string_maps_decrease_
+
+/**
+ * Resize the string maps array to a smaller size.
+ *
+ * This will resize making the array smaller based on (size - given length).
+ * If the given length is too small, then the resize will fail.
+ * This will not shrink the size to less than 0.
+ *
+ * @param amount
+ * A positive number representing how much to decrease the size by.
+ * @param maps
+ * The string maps array to resize.
+ *
+ * @return
+ * F_none on success.
+ * 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.
+ */
+#ifndef _di_fl_string_maps_decrease_by_
+ extern f_return_status fl_string_maps_decrease_by(const f_array_length_t amount, f_string_maps_t *maps);
+#endif // _di_fl_string_maps_decrease_by_
+
+/**
+ * Increase the size of the string maps array, but only if necessary.
+ *
+ * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size).
+ * If already set to the maximum buffer size, then the resize will fail.
+ *
+ * @param maps
+ * The string maps array to resize.
+ *
+ * @return
+ * F_none on success.
+ * 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_array_too_large (with error bit) if the new array length is too large.
+ */
+#ifndef _di_fl_string_maps_increase_
+ extern f_return_status fl_string_maps_increase(f_string_maps_t *maps);
+#endif // _di_fl_string_maps_increase_
+
+/**
+ * Resize the string maps array to a larger size.
+ *
+ * This will resize making the string larger based on the given length.
+ * If the given length is too large for the buffer, then attempt to set max buffer size (f_array_length_t_size).
+ * If already set to the maximum buffer size, then the resize will fail.
+ *
+ * @param amount
+ * A positive number representing how much to increase the size by.
+ * @param maps
+ * The string maps array to resize.
+ *
+ * @return
+ * F_none on success.
+ * 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_array_too_large (with error bit) if the new array length is too large.
+ */
+#ifndef _di_fl_string_maps_increase_by_
+ extern f_return_status fl_string_maps_increase_by(const f_array_length_t amount, f_string_maps_t *maps);
+#endif // _di_fl_string_maps_increase_by_
+
+/**
* Append the source string onto the destination with the glue in between.
*
* If the destination string is empty, then no glue is appended.
* @param contents
* This will be populated with all valid contents found.
* @param objects_quoted
- * An array mapped to each object in objects representing the quote discovered, if any.
+ * (optional) An array mapped to each object in objects representing the quote discovered, if any.
* Set the pointer address to 0 to disable.
* @param objects_delimits
* An array of delimits for objects detected during processing.
* @param contents
* This will be populated with all valid contents found.
* @param objects_quoted
- * An array mapped to each object in objects representing the quote discovered, if any.
+ * (optional) An array mapped to each object in objects representing the quote discovered, if any.
* Set the pointer address to 0 to disable.
* @param contents_quoted
- * An array mapped to each content in contents representing the quote discovered, if any.
+ * (optional) An array mapped to each content in contents representing the quote discovered, if any.
* Set the pointer address to 0 to disable.
* @param objects_delimits
* An array of delimits for objects detected during processing.