From 8fef4128c71a3010d4facf05f0d801118add5f7a Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 29 Feb 2012 19:29:07 -0600 Subject: [PATCH] Update: replace f_string_length with f_array_length where appropriate The f_string_lengths length variable should be an f_array_length (this would otherwise be called f_string_lengths_length) Replace all code that used the f_string_lengths length variables with f_array_length. --- level_0/f_strings/c/strings.h | 12 ++++++------ level_1/fl_console/c/console.c | 12 ++++++------ level_1/fl_console/c/console.h | 2 +- level_1/fl_execute/c/execute.h | 4 ++-- level_1/fl_fss/c/fss_basic.c | 2 +- level_1/fl_fss/c/fss_extended.c | 2 +- level_3/fss_basic_list_read/c/fss_basic_list_read.c | 2 +- level_3/fss_basic_list_read/c/main.c | 2 +- level_3/fss_basic_read/c/fss_basic_read.c | 2 +- level_3/fss_basic_read/c/main.c | 2 +- level_3/fss_extended_read/c/fss_extended_read.c | 2 +- level_3/fss_extended_read/c/main.c | 2 +- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/level_0/f_strings/c/strings.h b/level_0/f_strings/c/strings.h index d626988..15e1277 100644 --- a/level_0/f_strings/c/strings.h +++ b/level_0/f_strings/c/strings.h @@ -97,11 +97,11 @@ extern "C"{ #ifndef _di_f_string_lengths_ typedef struct { f_string_length *array; - f_string_length size; // total amount of allocated space - f_string_length used; // total number of allocated spaces used + f_array_length size; // total amount of allocated space + f_array_length used; // total number of allocated spaces used } f_string_lengths; - #define f_string_lengths_initialize { f_string_length_initialize, f_string_length_initialize, f_string_length_initialize } + #define f_string_lengths_initialize { f_string_length_initialize, f_array_length_initialize, f_array_length_initialize } #define f_delete_string_lengths(status, lengths) \ f_delete_structure(status, lengths, f_string_length) @@ -141,11 +141,11 @@ extern "C"{ #ifndef _di_f_string_locations_ typedef struct { f_string_location *array; // the array of string locations - f_string_length size; // total amount of allocated space - f_string_length used; // total number of allocated spaces used + f_array_length size; // total amount of allocated space + f_array_length used; // total number of allocated spaces used } f_string_locations; - #define f_string_locations_initialize {0, f_string_length_initialize, f_string_length_initialize} + #define f_string_locations_initialize {0, f_array_length_initialize, f_array_length_initialize} #define f_delete_string_locations(status, locations) \ f_delete_structure(status, locations, f_string_location) diff --git a/level_1/fl_console/c/console.c b/level_1/fl_console/c/console.c index f11101c..99f63ec 100644 --- a/level_1/fl_console/c/console.c +++ b/level_1/fl_console/c/console.c @@ -11,7 +11,7 @@ extern "C"{ #endif #ifndef _di_fl_process_parameters_ - f_return_status fl_process_parameters(const f_u_int argc, const f_string argv[], f_console_parameter parameters[], const f_u_int total_parameters, f_string_lengths *remaining){ + f_return_status fl_process_parameters(const f_array_length argc, const f_string argv[], f_console_parameter parameters[], const f_u_int total_parameters, f_string_lengths *remaining){ #ifndef _di_level_1_parameter_checking_ if (remaining == f_null) return f_invalid_parameter; #endif // _di_level_1_parameter_checking_ @@ -20,11 +20,11 @@ extern "C"{ f_console_id result = 0; f_bool found = f_false; - f_u_int location = 1; // parameter 0 represents the program name so skip it - f_u_int sub_location = 0; - f_u_int increments = 0; - f_u_int string_length = 0; - f_u_int parameter_counter = 0; + f_array_length location = 1; // parameter 0 represents the program name so skip it + f_string_length sub_location = 0; + f_string_length increments = 0; + f_string_length string_length = 0; + f_array_length parameter_counter = 0; f_string_lengths extra_initiator = f_string_lengths_initialize; diff --git a/level_1/fl_console/c/console.h b/level_1/fl_console/c/console.h index abb7b44..e9f0b01 100644 --- a/level_1/fl_console/c/console.h +++ b/level_1/fl_console/c/console.h @@ -24,7 +24,7 @@ extern "C"{ #endif #ifndef _di_fl_process_parameters_ - extern f_return_status fl_process_parameters(const f_u_int argc, const f_string argv[], f_console_parameter parameters[], const f_u_int total_parameters, f_string_lengths *remaining); + extern f_return_status fl_process_parameters(const f_array_length argc, const f_string argv[], f_console_parameter parameters[], const f_array_length total_parameters, f_string_lengths *remaining); #endif // _di_fl_process_parameters_ diff --git a/level_1/fl_execute/c/execute.h b/level_1/fl_execute/c/execute.h index bea4b77..3325132 100644 --- a/level_1/fl_execute/c/execute.h +++ b/level_1/fl_execute/c/execute.h @@ -31,8 +31,8 @@ extern "C"{ #endif // _di_fl_execute_path_ #ifndef _di_fl_execute_program_ - // TODO: this will find the program based on PATH environment so that static paths do not have to be used as with f_execute_path - //f_return_status fl_execute_program(const f_string program_name, const f_string arguments[], f_s_int *results); + // This will find the program based on PATH environment so that static paths do not have to be used as with f_execute_path + extern f_return_status fl_execute_program(const f_string program_name, const f_string arguments[], f_s_int *results); #endif // _di_fl_execute_program_ #ifdef __cplusplus diff --git a/level_1/fl_fss/c/fss_basic.c b/level_1/fl_fss/c/fss_basic.c index 3c52381..e358e54 100644 --- a/level_1/fl_fss/c/fss_basic.c +++ b/level_1/fl_fss/c/fss_basic.c @@ -172,7 +172,7 @@ extern "C"{ } if (delimits.used > 0) { - f_string_length counter = 0; + f_array_length counter = 0; for (; counter < delimits.used; counter++) { buffer->string[delimits.array[counter]] = f_fss_delimit_placeholder; diff --git a/level_1/fl_fss/c/fss_extended.c b/level_1/fl_fss/c/fss_extended.c index 4b50013..6147229 100644 --- a/level_1/fl_fss/c/fss_extended.c +++ b/level_1/fl_fss/c/fss_extended.c @@ -172,7 +172,7 @@ extern "C"{ } if (delimits.used > 0) { - f_string_length counter = 0; + f_array_length counter = 0; for (; counter < delimits.used; counter++) { buffer->string[delimits.array[counter]] = f_fss_delimit_placeholder; diff --git a/level_3/fss_basic_list_read/c/fss_basic_list_read.c b/level_3/fss_basic_list_read/c/fss_basic_list_read.c index cbadded..e7dafe4 100644 --- a/level_3/fss_basic_list_read/c/fss_basic_list_read.c +++ b/level_3/fss_basic_list_read/c/fss_basic_list_read.c @@ -129,7 +129,7 @@ extern "C"{ #endif // _di_fss_basic_list_read_print_help_ #ifndef _di_fss_basic_list_read_main_ - f_return_status fss_basic_list_read_main(const f_s_int argc, const f_string argv[], fss_basic_list_read_data *data){ + f_return_status fss_basic_list_read_main(const f_array_length argc, const f_string argv[], fss_basic_list_read_data *data){ f_status status = f_status_initialize; f_status allocation_status = f_status_initialize; diff --git a/level_3/fss_basic_list_read/c/main.c b/level_3/fss_basic_list_read/c/main.c index bd82af9..ed8ba20 100644 --- a/level_3/fss_basic_list_read/c/main.c +++ b/level_3/fss_basic_list_read/c/main.c @@ -1,6 +1,6 @@ #include -int main(const f_s_int argc, const f_string argv[]){ +int main(const f_array_length argc, const f_string argv[]){ f_status status = f_status_initialize; fss_basic_list_read_data data = fss_basic_list_read_data_initialize; diff --git a/level_3/fss_basic_read/c/fss_basic_read.c b/level_3/fss_basic_read/c/fss_basic_read.c index 27481f4..2b36c73 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.c +++ b/level_3/fss_basic_read/c/fss_basic_read.c @@ -115,7 +115,7 @@ extern "C"{ #endif // _di_fss_basic_read_print_help_ #ifndef _di_fss_basic_read_main_ - f_return_status fss_basic_read_main(const f_s_int argc, const f_string argv[], fss_basic_read_data *data){ + f_return_status fss_basic_read_main(const f_array_length argc, const f_string argv[], fss_basic_read_data *data){ f_status status = f_status_initialize; f_status allocation_status = f_status_initialize; diff --git a/level_3/fss_basic_read/c/main.c b/level_3/fss_basic_read/c/main.c index 2149f61..f1c8121 100644 --- a/level_3/fss_basic_read/c/main.c +++ b/level_3/fss_basic_read/c/main.c @@ -1,6 +1,6 @@ #include -int main(const f_s_int argc, const f_string argv[]){ +int main(const f_array_length argc, const f_string argv[]){ f_status status = f_status_initialize; fss_basic_read_data data = fss_basic_read_data_initialize; diff --git a/level_3/fss_extended_read/c/fss_extended_read.c b/level_3/fss_extended_read/c/fss_extended_read.c index d9522ae..611ca23 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.c +++ b/level_3/fss_extended_read/c/fss_extended_read.c @@ -122,7 +122,7 @@ extern "C"{ #endif // _di_fss_extended_read_print_help_ #ifndef _di_fss_extended_read_main_ - f_return_status fss_extended_read_main(const f_s_int argc, const f_string argv[], fss_extended_read_data *data){ + f_return_status fss_extended_read_main(const f_array_length argc, const f_string argv[], fss_extended_read_data *data){ f_status status = f_status_initialize; f_status allocation_status = f_status_initialize; diff --git a/level_3/fss_extended_read/c/main.c b/level_3/fss_extended_read/c/main.c index b427a41..c7e67a0 100644 --- a/level_3/fss_extended_read/c/main.c +++ b/level_3/fss_extended_read/c/main.c @@ -1,6 +1,6 @@ #include -int main(const f_s_int argc, const f_string argv[]){ +int main(const f_array_length argc, const f_string argv[]){ f_status status = f_status_initialize; fss_extended_read_data data = fss_extended_read_data_initialize; -- 1.8.3.1