}
#endif // _di_fll_program_parameter_process_
+#ifndef _di_fll_program_parameter_additional_mash_
+ f_return_status fll_program_parameter_additional_mash(const f_string glue, const f_string_length glue_length, const f_string *argv, const f_string_lengths additional, f_string_dynamic *destination) {
+ #ifndef _di_level_2_parameter_checking_
+ if (glue_length < 1) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_2_parameter_checking_
+
+ f_status status = f_none;
+
+ f_string_length length = 0;
+
+ for (f_string_length i = 0; i < additional.used; i++) {
+ length = strnlen(argv[additional.array[i]], f_console_max_size);
+
+ if (length > 0) {
+ status = fl_string_mash(glue, glue_length, argv[additional.array[i]], length, destination);
+
+ if (f_status_is_error(status)) return f_status_set_error(f_string_too_large);
+ }
+ } // for
+
+ return status;
+ }
+#endif // _di_fll_program_parameter_additional_mash_
+
+#ifndef _di_fll_program_parameter_additional_trim_mash_
+ f_return_status fll_program_parameter_additional_trim_mash(const f_string glue, const f_string_length glue_length, const f_string *argv, const f_string_lengths additional, f_string_dynamic *destination) {
+ #ifndef _di_level_2_parameter_checking_
+ if (glue_length < 1) return f_status_set_error(f_invalid_parameter);
+ if (destination == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_2_parameter_checking_
+
+ f_status status = f_none;
+
+ f_string_dynamic ripped = f_string_dynamic_initialize;
+
+ for (f_string_length i = 0; i < additional.used; i++) {
+ status = fl_string_rip_trim(argv[additional.array[i]], 0, strnlen(argv[additional.array[i]], f_console_max_size), &ripped);
+
+ if (f_status_is_error(status)) {
+ f_macro_string_dynamic_delete_simple(ripped);
+ return status;
+ }
+
+ if (ripped.used > 0) {
+ status = fl_string_dynamic_mash(glue, glue_length, ripped, destination);
+
+ if (f_status_is_error(status)) {
+ f_macro_string_dynamic_delete_simple(ripped);
+ return f_status_set_error(f_string_too_large);
+ }
+ }
+ } // for
+
+ if (ripped.size) {
+ f_macro_string_dynamic_delete(status, ripped);
+ }
+
+ return status;
+ }
+#endif // _di_fll_program_parameter_additional_trim_mash_
+
#ifdef __cplusplus
} // extern "C"
#endif
// fll-1 includes
#include <level_1/color.h>
+#include <level_1/string.h>
#ifdef __cplusplus
extern "C" {
extern f_return_status fll_program_parameter_process(const f_console_arguments arguments, f_console_parameters parameters, const f_console_parameter_ids choices, f_string_lengths *remaining, fl_color_context *context);
#endif // _di_fll_program_parameter_process_
+/**
+ * Mash together all additional arguments associated with a given console parameter.
+ *
+ * @param glue
+ * A string to append between the source and destination, such as a space: ' '.
+ * @param glue_length
+ * The number of bytes the glue takes up.
+ * @param argv
+ * The program argument array to parse.
+ * @param destination
+ * The destination string the source and glue are appended onto.
+ *
+ * @return
+ * f_none on success.
+ * f_string_max_size (with error bit) if the combined string is too large.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_error_allocation (with error bit) on memory allocation error.
+ * f_error_reallocation (with error bit) on memory reallocation error.
+ */
+#ifndef _di_fll_program_parameter_additional_mash_
+ extern f_return_status fll_program_parameter_additional_mash(const f_string glue, const f_string_length glue_length, const f_string *argv, const f_string_lengths additional, f_string_dynamic *destination);
+#endif // _di_fll_program_parameter_additional_mash_
+
+/**
+ * Mash together all additional arguments associated with a given console parameter.
+ *
+ * The console parameter is trimmed before mashing.
+ *
+ * @param glue
+ * A string to append between the source and destination, such as a space: ' '.
+ * @param glue_length
+ * The number of bytes the glue takes up.
+ * @param argv
+ * The program argument array to parse.
+ * @param destination
+ * The destination string the source and glue are appended onto.
+ *
+ * @return
+ * f_none on success.
+ * f_string_max_size (with error bit) if the combined string is too large.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_error_allocation (with error bit) on memory allocation error.
+ * f_error_reallocation (with error bit) on memory reallocation error.
+ */
+#ifndef _di_fll_program_parameter_additional_trim_mash_
+ extern f_return_status fll_program_parameter_additional_trim_mash(const f_string glue, const f_string_length glue_length, const f_string *argv, const f_string_lengths additional, f_string_dynamic *destination);
+#endif // _di_fll_program_parameter_additional_trim_mash_
+
#ifdef __cplusplus
} // extern "C"
#endif