From 0404bb52e1c604ae154a16724a08bd3ca42be2f6 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 29 Apr 2020 21:53:04 -0500 Subject: [PATCH] Cleanup: add missing parameter documentation and swap mash with trim in names The additional parameter documentation is missing. Be consistent with other functions in how the string '_trim' is appended to function names. --- level_2/fll_program/c/program.c | 8 +++++--- level_2/fll_program/c/program.h | 11 +++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/level_2/fll_program/c/program.c b/level_2/fll_program/c/program.c index 3cfb828..7be4ba9 100644 --- a/level_2/fll_program/c/program.c +++ b/level_2/fll_program/c/program.c @@ -153,6 +153,7 @@ extern "C" { #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 (argv == 0) return f_status_set_error(f_invalid_parameter); 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_ @@ -175,9 +176,10 @@ extern "C" { } #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_fll_program_parameter_additional_mash_trim_ + f_return_status fll_program_parameter_additional_mash_trim(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 (argv == 0) return f_status_set_error(f_invalid_parameter); 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_ @@ -210,7 +212,7 @@ extern "C" { return status; } -#endif // _di_fll_program_parameter_additional_trim_mash_ +#endif // _di_fll_program_parameter_additional_mash_trim_ #ifdef __cplusplus } // extern "C" diff --git a/level_2/fll_program/c/program.h b/level_2/fll_program/c/program.h index 5b23300..52583e1 100644 --- a/level_2/fll_program/c/program.h +++ b/level_2/fll_program/c/program.h @@ -168,6 +168,8 @@ extern "C" { * The number of bytes the glue takes up. * @param argv * The program argument array to parse. + * @param additional + * The string locations where the console parameters are found. * @param destination * The destination string the source and glue are appended onto. * @@ -181,7 +183,6 @@ extern "C" { #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. * @@ -193,6 +194,8 @@ extern "C" { * The number of bytes the glue takes up. * @param argv * The program argument array to parse. + * @param additional + * The string locations where the console parameters are found. * @param destination * The destination string the source and glue are appended onto. * @@ -203,9 +206,9 @@ extern "C" { * 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_ +#ifndef _di_fll_program_parameter_additional_mash_trim_ + extern f_return_status fll_program_parameter_additional_mash_trim(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_trim_ #ifdef __cplusplus } // extern "C" -- 1.8.3.1