From a1b03120c9ee96ee9a12d859e9d1cc8a4e753b8b Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 28 Jul 2019 21:43:47 -0500 Subject: [PATCH] Feature: level-1: fl_program The version function is used between all programs in this project. Move that functionality into its own library: fl_program. --- build/level_1/settings | 4 +- level_1/fl_program/c/program.c | 17 +++++++++ level_1/fl_program/c/program.h | 43 ++++++++++++++++++++++ level_1/fl_program/data/build/dependencies | 3 ++ level_1/fl_program/data/build/settings | 23 ++++++++++++ level_3/firewall/c/firewall.c | 11 +----- level_3/firewall/c/firewall.h | 8 +--- level_3/firewall/data/build/dependencies | 17 +++++---- level_3/firewall/data/build/settings | 2 +- .../fss_basic_list_read/c/fss_basic_list_read.c | 11 +----- .../fss_basic_list_read/c/fss_basic_list_read.h | 8 +--- .../fss_basic_list_read/data/build/dependencies | 17 +++++---- level_3/fss_basic_list_read/data/build/settings | 2 +- .../fss_basic_list_write/c/fss_basic_list_write.c | 11 +----- .../fss_basic_list_write/c/fss_basic_list_write.h | 8 +--- .../fss_basic_list_write/data/build/dependencies | 17 +++++---- level_3/fss_basic_list_write/data/build/settings | 2 +- level_3/fss_basic_read/c/fss_basic_read.c | 11 +----- level_3/fss_basic_read/c/fss_basic_read.h | 8 +--- level_3/fss_basic_read/data/build/dependencies | 17 +++++---- level_3/fss_basic_read/data/build/settings | 2 +- level_3/fss_basic_write/c/fss_basic_write.c | 11 +----- level_3/fss_basic_write/c/fss_basic_write.h | 8 +--- level_3/fss_basic_write/data/build/dependencies | 17 +++++---- level_3/fss_basic_write/data/build/settings | 2 +- level_3/fss_extended_read/c/fss_extended_read.c | 11 +----- level_3/fss_extended_read/c/fss_extended_read.h | 8 +--- level_3/fss_extended_read/data/build/dependencies | 17 +++++---- level_3/fss_extended_read/data/build/settings | 2 +- level_3/fss_extended_write/c/fss_extended_write.c | 11 +----- level_3/fss_extended_write/c/fss_extended_write.h | 8 +--- level_3/fss_extended_write/data/build/dependencies | 17 +++++---- level_3/fss_extended_write/data/build/settings | 2 +- level_3/fss_return_code/c/fss_return_code.c | 11 +----- level_3/fss_return_code/c/fss_return_code.h | 8 +--- level_3/fss_return_code/data/build/dependencies | 16 +++++--- level_3/fss_return_code/data/build/settings | 2 +- level_3/init/data/build/dependencies | 17 +++++---- level_3/init/data/build/settings | 2 +- level_3/return_code/c/return_code.c | 11 +----- level_3/return_code/c/return_code.h | 8 +--- level_3/return_code/data/build/dependencies | 9 +++-- level_3/return_code/data/build/settings | 2 +- 43 files changed, 203 insertions(+), 239 deletions(-) create mode 100644 level_1/fl_program/c/program.c create mode 100644 level_1/fl_program/c/program.h create mode 100644 level_1/fl_program/data/build/dependencies create mode 100644 level_1/fl_program/data/build/settings diff --git a/build/level_1/settings b/build/level_1/settings index 8a430b1..9a938c8 100644 --- a/build/level_1/settings +++ b/build/level_1/settings @@ -10,9 +10,9 @@ version_micro 2 build_compiler gcc build_linker ar build_libraries -lc -lfll_0 -build_sources_library colors.c console.c directory.c errors.c file.c fss.c fss_basic.c fss_basic_list.c fss_extended.c serialized.c strings.c +build_sources_library colors.c console.c directory.c errors.c file.c fss.c fss_basic.c fss_basic_list.c fss_extended.c program.c serialized.c strings.c build_sources_program -build_sources_headers colors.h console.h directory.h errors.h file.h fss.h fss_basic.h fss_basic_list.h fss_errors.h fss_extended.h fss_macro.h serialized.h strings.h +build_sources_headers colors.h console.h directory.h errors.h file.h fss.h fss_basic.h fss_basic_list.h fss_errors.h fss_extended.h fss_macro.h program.h serialized.h strings.h build_shared yes build_static yes diff --git a/level_1/fl_program/c/program.c b/level_1/fl_program/c/program.c new file mode 100644 index 0000000..520a3d1 --- /dev/null +++ b/level_1/fl_program/c/program.c @@ -0,0 +1,17 @@ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_fl_program_print_version_ + f_return_status fl_program_print_version(const f_string version) { + printf("%s\n", version); + + return f_none; + } +#endif // _di_fl_program_print_version_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_1/fl_program/c/program.h b/level_1/fl_program/c/program.h new file mode 100644 index 0000000..51e289c --- /dev/null +++ b/level_1/fl_program/c/program.h @@ -0,0 +1,43 @@ +/** + * FLL - Level 1 + * + * Project: Program + * API Version: 0.5 + * Licenses: lgplv2.1 + * + * Provide functions commonly used by FLL based programs. + */ +#ifndef _FL_program_h +#define _FL_program_h + +// libc include +#include + +// fll-0 includes +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_fl_program_print_version_ + /** + * Print version. + * + * @param version + * The version number to print. + * + * @return + * f_none on success. + * Error bit is set on error. + */ + extern f_return_status fl_program_print_version(const f_string version); +#endif // _di_fl_program_print_version_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _FL_program_h diff --git a/level_1/fl_program/data/build/dependencies b/level_1/fl_program/data/build/dependencies new file mode 100644 index 0000000..90e12bc --- /dev/null +++ b/level_1/fl_program/data/build/dependencies @@ -0,0 +1,3 @@ +f_types +f_errors +f_strings diff --git a/level_1/fl_program/data/build/settings b/level_1/fl_program/data/build/settings new file mode 100644 index 0000000..1719a54 --- /dev/null +++ b/level_1/fl_program/data/build/settings @@ -0,0 +1,23 @@ +# fss-0000 + +project_name fl_program +project_level 1 + +version_major 0 +version_minor 5 +version_micro 0 + +build_compiler gcc +build_linker ar +build_libraries -lc +build_sources_library program.c +build_sources_program +build_sources_headers program.h +build_shared yes +build_static yes + +flags_all -z now +flags_shared +flags_static +flags_library -fPIC +flags_program -fPIE diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index 3f5569f..16a7658 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -11,15 +11,6 @@ extern "C" { #endif -// version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors -#ifndef _di_firewall_print_version_ - f_return_status firewall_print_version(const firewall_data data) { - printf("%s\n", firewall_version); - - return f_none; - } -#endif // _firewall_print_version_ - #ifndef _di_firewall_print_help_ f_return_status firewall_print_help(const firewall_data data) { printf("\n"); @@ -164,7 +155,7 @@ extern "C" { firewall_print_help(*data); } else if (data->parameters[firewall_parameter_version].result == f_console_result_found) { - firewall_print_version(*data); + fl_program_print_version(firewall_version); } else { // now determine which command was placed first diff --git a/level_3/firewall/c/firewall.h b/level_3/firewall/c/firewall.h index a2fc991..7c134ba 100644 --- a/level_3/firewall/c/firewall.h +++ b/level_3/firewall/c/firewall.h @@ -29,6 +29,7 @@ #include #include #include +#include #include // fll-2 includes @@ -296,13 +297,6 @@ extern "C" { } #endif // _di_firewall_data_ -#ifndef _di_firewall_print_version_ - /** - * Print version. - */ - extern f_return_status firewall_print_version(const firewall_data data); -#endif // _di_firewall_print_version_ - #ifndef _di_firewall_print_help_ /** * Print help. diff --git a/level_3/firewall/data/build/dependencies b/level_3/firewall/data/build/dependencies index 3d9fca4..55693f4 100644 --- a/level_3/firewall/data/build/dependencies +++ b/level_3/firewall/data/build/dependencies @@ -1,17 +1,18 @@ -f_types +f_console f_errors -f_strings +f_fss f_memory f_pipe f_print -f_console -f_fss -fl_console -fl_file -fl_strings +f_strings +f_types fl_colors +fl_console fl_directory +fl_file fl_fss +fl_program +fl_strings fll_colors -fll_fss fll_execute +fll_fss diff --git a/level_3/firewall/data/build/settings b/level_3/firewall/data/build/settings index 375aaa9..18f3d97 100644 --- a/level_3/firewall/data/build/settings +++ b/level_3/firewall/data/build/settings @@ -9,7 +9,7 @@ version_micro 2 build_compiler gcc build_linker ar -build_libraries -lfll_colors -lfll_fss -lfll_execute -lfl_directory -lfl_colors -lfl_strings -lfl_file -lfl_console -lfl_fss -lf_pipe -lf_file -lf_print -lf_conversion -lf_console -lf_memory -lc +build_libraries -lfll_colors -lfll_fss -lfll_execute -lfl_directory -lfl_colors -lfl_strings -lfl_file -lfl_console -lfl_fss -lfl_program -lf_pipe -lf_file -lf_print -lf_conversion -lf_console -lf_memory -lc build_sources_library firewall.c private-firewall.c build_sources_program main.c build_sources_headers firewall.h 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 4c1d541..141d9d1 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 @@ -4,15 +4,6 @@ extern "C" { #endif -// version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors -#ifndef _di_fss_basic_list_read_print_version_ - f_return_status fss_basic_list_read_print_version(const fss_basic_list_read_data data) { - printf("%s\n", fss_basic_list_read_version); - - return f_none; - } -#endif // _fss_basic_list_read_print_version_ - #ifndef _di_fss_basic_list_read_print_help_ f_return_status fss_basic_list_read_print_help(const fss_basic_list_read_data data) { printf("\n"); @@ -173,7 +164,7 @@ extern "C" { fss_basic_list_read_print_help(*data); } else if (data->parameters[fss_basic_list_read_parameter_version].result == f_console_result_found) { - fss_basic_list_read_print_version(*data); + fl_program_print_version(fss_basic_list_read_version); } else if (data->remaining.used > 0 || data->process_pipe) { f_string_length counter = 0; diff --git a/level_3/fss_basic_list_read/c/fss_basic_list_read.h b/level_3/fss_basic_list_read/c/fss_basic_list_read.h index 413253d..280d94b 100644 --- a/level_3/fss_basic_list_read/c/fss_basic_list_read.h +++ b/level_3/fss_basic_list_read/c/fss_basic_list_read.h @@ -30,6 +30,7 @@ #include #include #include +#include #include // fll-2 includes @@ -126,13 +127,6 @@ extern "C" { } #endif // _di_fss_basic_list_read_data_ -#ifndef _di_fss_basic_list_read_print_version_ - /** - * Print version. - */ - extern f_return_status fss_basic_list_read_print_version(const fss_basic_list_read_data data); -#endif // _di_fss_basic_list_read_print_version_ - #ifndef _di_fss_basic_list_read_print_help_ /** * Print help. diff --git a/level_3/fss_basic_list_read/data/build/dependencies b/level_3/fss_basic_list_read/data/build/dependencies index 3d9fca4..55693f4 100644 --- a/level_3/fss_basic_list_read/data/build/dependencies +++ b/level_3/fss_basic_list_read/data/build/dependencies @@ -1,17 +1,18 @@ -f_types +f_console f_errors -f_strings +f_fss f_memory f_pipe f_print -f_console -f_fss -fl_console -fl_file -fl_strings +f_strings +f_types fl_colors +fl_console fl_directory +fl_file fl_fss +fl_program +fl_strings fll_colors -fll_fss fll_execute +fll_fss diff --git a/level_3/fss_basic_list_read/data/build/settings b/level_3/fss_basic_list_read/data/build/settings index 3c878e8..2c0b92b 100644 --- a/level_3/fss_basic_list_read/data/build/settings +++ b/level_3/fss_basic_list_read/data/build/settings @@ -9,7 +9,7 @@ version_micro 2 build_compiler gcc build_linker ar -build_libraries -lfll_colors -lfll_fss -lfll_execute -lfl_directory -lfl_colors -lfl_strings -lfl_file -lfl_console -lfl_fss -lf_pipe -lf_file -lf_print -lf_conversion -lf_console -lf_memory -lc +build_libraries -lfll_colors -lfll_fss -lfll_execute -lfl_directory -lfl_colors -lfl_strings -lfl_file -lfl_console -lfl_program -lfl_fss -lf_pipe -lf_file -lf_print -lf_conversion -lf_console -lf_memory -lc build_sources_library fss_basic_list_read.c build_sources_program main.c build_sources_headers fss_basic_list_read.h diff --git a/level_3/fss_basic_list_write/c/fss_basic_list_write.c b/level_3/fss_basic_list_write/c/fss_basic_list_write.c index 0f728f2..2a53f1b 100644 --- a/level_3/fss_basic_list_write/c/fss_basic_list_write.c +++ b/level_3/fss_basic_list_write/c/fss_basic_list_write.c @@ -4,15 +4,6 @@ extern "C" { #endif -// version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors -#ifndef _di_fss_basic_list_write_print_version_ - f_return_status fss_basic_list_write_print_version(const fss_basic_list_write_data data) { - printf("%s\n", fss_basic_list_write_version); - - return f_none; - } -#endif // _fss_basic_list_write_print_version_ - #ifndef _di_fss_basic_list_write_print_help_ f_return_status fss_basic_list_write_print_help(const fss_basic_list_write_data data) { printf("\n"); @@ -145,7 +136,7 @@ extern "C" { fss_basic_list_write_print_help(*data); } else if (data->parameters[fss_basic_list_write_parameter_version].result == f_console_result_found) { - fss_basic_list_write_print_version(*data); + fl_program_print_version(fss_basic_list_write_version); } else { f_array_length counter = 0; diff --git a/level_3/fss_basic_list_write/c/fss_basic_list_write.h b/level_3/fss_basic_list_write/c/fss_basic_list_write.h index 8557deb..cfdb929 100644 --- a/level_3/fss_basic_list_write/c/fss_basic_list_write.h +++ b/level_3/fss_basic_list_write/c/fss_basic_list_write.h @@ -27,6 +27,7 @@ #include #include #include +#include #include // fll-2 includes @@ -102,13 +103,6 @@ extern "C" { } #endif // _di_fss_basic_list_write_data_ -#ifndef _di_fss_basic_list_write_print_version_ - /** - * Print version. - */ - extern f_return_status fss_basic_list_write_print_version(const fss_basic_list_write_data data); -#endif // _di_fss_basic_list_write_print_version_ - #ifndef _di_fss_basic_list_write_print_help_ /** * Print help. diff --git a/level_3/fss_basic_list_write/data/build/dependencies b/level_3/fss_basic_list_write/data/build/dependencies index 3d9fca4..55693f4 100644 --- a/level_3/fss_basic_list_write/data/build/dependencies +++ b/level_3/fss_basic_list_write/data/build/dependencies @@ -1,17 +1,18 @@ -f_types +f_console f_errors -f_strings +f_fss f_memory f_pipe f_print -f_console -f_fss -fl_console -fl_file -fl_strings +f_strings +f_types fl_colors +fl_console fl_directory +fl_file fl_fss +fl_program +fl_strings fll_colors -fll_fss fll_execute +fll_fss diff --git a/level_3/fss_basic_list_write/data/build/settings b/level_3/fss_basic_list_write/data/build/settings index e211017..d520c8e 100644 --- a/level_3/fss_basic_list_write/data/build/settings +++ b/level_3/fss_basic_list_write/data/build/settings @@ -9,7 +9,7 @@ version_micro 2 build_compiler gcc build_linker ar -build_libraries -lfll_colors -lfll_fss -lfl_fss -lfl_file -lfl_errors -lfl_colors -lfl_console -lf_file -lf_print -lf_pipe -lf_conversion -lf_console -lf_memory -lc +build_libraries -lfll_colors -lfll_fss -lfl_fss -lfl_file -lfl_errors -lfl_colors -lfl_console -lfl_program -lf_file -lf_print -lf_pipe -lf_conversion -lf_console -lf_memory -lc build_sources_library fss_basic_list_write.c build_sources_program main.c build_sources_headers fss_basic_list_write.h 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 313fac3..5f88489 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.c +++ b/level_3/fss_basic_read/c/fss_basic_read.c @@ -4,15 +4,6 @@ extern "C" { #endif -// version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors -#ifndef _di_fss_basic_read_print_version_ - f_return_status fss_basic_read_print_version(const fss_basic_read_data data) { - printf("%s\n", fss_basic_read_version); - - return f_none; - } -#endif // _fss_basic_read_print_version_ - #ifndef _di_fss_basic_read_print_help_ f_return_status fss_basic_read_print_help(const fss_basic_read_data data) { printf("\n"); @@ -159,7 +150,7 @@ extern "C" { fss_basic_read_print_help(*data); } else if (data->parameters[fss_basic_read_parameter_version].result == f_console_result_found) { - fss_basic_read_print_version(*data); + fl_program_print_version(fss_basic_read_version); } else if (data->remaining.used > 0 || data->process_pipe) { f_string_length counter = 0; diff --git a/level_3/fss_basic_read/c/fss_basic_read.h b/level_3/fss_basic_read/c/fss_basic_read.h index 3ae81f8..b258b9d 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.h +++ b/level_3/fss_basic_read/c/fss_basic_read.h @@ -30,6 +30,7 @@ #include #include #include +#include #include // fll-2 includes @@ -118,13 +119,6 @@ extern "C" { } #endif // _di_fss_basic_read_data_ -#ifndef _di_fss_basic_read_print_version_ - /** - * Print version. - */ - extern f_return_status fss_basic_read_print_version(const fss_basic_read_data data); -#endif // _di_fss_basic_read_print_version_ - #ifndef _di_fss_basic_read_print_help_ /** * Print help. diff --git a/level_3/fss_basic_read/data/build/dependencies b/level_3/fss_basic_read/data/build/dependencies index 3d9fca4..55693f4 100644 --- a/level_3/fss_basic_read/data/build/dependencies +++ b/level_3/fss_basic_read/data/build/dependencies @@ -1,17 +1,18 @@ -f_types +f_console f_errors -f_strings +f_fss f_memory f_pipe f_print -f_console -f_fss -fl_console -fl_file -fl_strings +f_strings +f_types fl_colors +fl_console fl_directory +fl_file fl_fss +fl_program +fl_strings fll_colors -fll_fss fll_execute +fll_fss diff --git a/level_3/fss_basic_read/data/build/settings b/level_3/fss_basic_read/data/build/settings index ca3b0ed..22071f2 100644 --- a/level_3/fss_basic_read/data/build/settings +++ b/level_3/fss_basic_read/data/build/settings @@ -9,7 +9,7 @@ version_micro 2 build_compiler gcc build_linker ar -build_libraries -lfll_colors -lfll_fss -lfll_execute -lfl_directory -lfl_colors -lfl_strings -lfl_file -lfl_console -lfl_fss -lf_print -lf_file -lf_pipe -lf_conversion -lf_console -lf_memory -lc +build_libraries -lfll_colors -lfll_fss -lfll_execute -lfl_directory -lfl_colors -lfl_strings -lfl_file -lfl_console -lfl_program -lfl_fss -lf_print -lf_file -lf_pipe -lf_conversion -lf_console -lf_memory -lc build_sources_library fss_basic_read.c build_sources_program main.c build_sources_headers fss_basic_read.h diff --git a/level_3/fss_basic_write/c/fss_basic_write.c b/level_3/fss_basic_write/c/fss_basic_write.c index 3dee730..8607d53 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -4,15 +4,6 @@ extern "C" { #endif -// version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors -#ifndef _di_fss_basic_write_print_version_ - f_return_status fss_basic_write_print_version(const fss_basic_write_data data) { - printf("%s\n", fss_basic_write_version); - - return f_none; - } -#endif // _fss_basic_write_print_version_ - #ifndef _di_fss_basic_write_print_help_ f_return_status fss_basic_write_print_help(const fss_basic_write_data data) { printf("\n"); @@ -145,7 +136,7 @@ extern "C" { fss_basic_write_print_help(*data); } else if (data->parameters[fss_basic_write_parameter_version].result == f_console_result_found) { - fss_basic_write_print_version(*data); + fl_program_print_version(fss_basic_write_version); } else { f_array_length counter = 0; diff --git a/level_3/fss_basic_write/c/fss_basic_write.h b/level_3/fss_basic_write/c/fss_basic_write.h index 5bcca41..268be2c 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.h +++ b/level_3/fss_basic_write/c/fss_basic_write.h @@ -26,6 +26,7 @@ #include #include #include +#include #include // fll-2 includes @@ -101,13 +102,6 @@ extern "C" { } #endif // _di_fss_basic_write_data_ -#ifndef _di_fss_basic_write_print_version_ - /** - * Print version. - */ - extern f_return_status fss_basic_write_print_version(const fss_basic_write_data data); -#endif // _di_fss_basic_write_print_version_ - #ifndef _di_fss_basic_write_print_help_ /** * Print help. diff --git a/level_3/fss_basic_write/data/build/dependencies b/level_3/fss_basic_write/data/build/dependencies index 3d9fca4..55693f4 100644 --- a/level_3/fss_basic_write/data/build/dependencies +++ b/level_3/fss_basic_write/data/build/dependencies @@ -1,17 +1,18 @@ -f_types +f_console f_errors -f_strings +f_fss f_memory f_pipe f_print -f_console -f_fss -fl_console -fl_file -fl_strings +f_strings +f_types fl_colors +fl_console fl_directory +fl_file fl_fss +fl_program +fl_strings fll_colors -fll_fss fll_execute +fll_fss diff --git a/level_3/fss_basic_write/data/build/settings b/level_3/fss_basic_write/data/build/settings index 350a4b1..b481bf3 100644 --- a/level_3/fss_basic_write/data/build/settings +++ b/level_3/fss_basic_write/data/build/settings @@ -9,7 +9,7 @@ version_micro 2 build_compiler gcc build_linker ar -build_libraries -lfll_colors -lfll_fss -lfl_fss -lfl_file -lfl_errors -lfl_colors -lfl_console -lf_file -lf_print -lf_pipe -lf_conversion -lf_console -lf_memory -lc +build_libraries -lfll_colors -lfll_fss -lfl_fss -lfl_file -lfl_errors -lfl_colors -lfl_console -lfl_program -lf_file -lf_print -lf_pipe -lf_conversion -lf_console -lf_memory -lc build_sources_library fss_basic_write.c build_sources_program main.c build_sources_headers fss_basic_write.h 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 8f3452c..c03314c 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.c +++ b/level_3/fss_extended_read/c/fss_extended_read.c @@ -4,15 +4,6 @@ extern "C" { #endif -// version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors -#ifndef _di_fss_extended_read_print_version_ - f_return_status fss_extended_read_print_version(const fss_extended_read_data data) { - printf("%s\n", fss_extended_read_version); - - return f_none; - } -#endif // _fss_extended_read_print_version_ - #ifndef _di_fss_extended_read_print_help_ f_return_status fss_extended_read_print_help(const fss_extended_read_data data) { printf("\n"); @@ -166,7 +157,7 @@ extern "C" { fss_extended_read_print_help(*data); } else if (data->parameters[fss_extended_read_parameter_version].result == f_console_result_found) { - fss_extended_read_print_version(*data); + fl_program_print_version(fss_extended_read_version); } else if (data->remaining.used > 0 || data->process_pipe) { f_string_length counter = 0; diff --git a/level_3/fss_extended_read/c/fss_extended_read.h b/level_3/fss_extended_read/c/fss_extended_read.h index 6ea6bf3..4d77c53 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.h +++ b/level_3/fss_extended_read/c/fss_extended_read.h @@ -30,6 +30,7 @@ #include #include #include +#include #include // fll-2 includes @@ -122,13 +123,6 @@ extern "C" { } #endif // _di_fss_extended_read_data_ -#ifndef _di_fss_extended_read_print_version_ - /** - * Print version. - */ - extern f_return_status fss_extended_read_print_version(const fss_extended_read_data data); -#endif // _di_fss_extended_read_print_version_ - #ifndef _di_fss_extended_read_print_help_ /** * Print help. diff --git a/level_3/fss_extended_read/data/build/dependencies b/level_3/fss_extended_read/data/build/dependencies index 3d9fca4..55693f4 100644 --- a/level_3/fss_extended_read/data/build/dependencies +++ b/level_3/fss_extended_read/data/build/dependencies @@ -1,17 +1,18 @@ -f_types +f_console f_errors -f_strings +f_fss f_memory f_pipe f_print -f_console -f_fss -fl_console -fl_file -fl_strings +f_strings +f_types fl_colors +fl_console fl_directory +fl_file fl_fss +fl_program +fl_strings fll_colors -fll_fss fll_execute +fll_fss diff --git a/level_3/fss_extended_read/data/build/settings b/level_3/fss_extended_read/data/build/settings index eac4c6d..ee9a219 100644 --- a/level_3/fss_extended_read/data/build/settings +++ b/level_3/fss_extended_read/data/build/settings @@ -9,7 +9,7 @@ version_micro 2 build_compiler gcc build_linker ar -build_libraries -lfll_colors -lfll_fss -lfll_execute -lfl_directory -lfl_colors -lfl_strings -lfl_file -lfl_console -lfl_fss -lf_pipe -lf_file -lf_print -lf_conversion -lf_console -lf_memory -lc +build_libraries -lfll_colors -lfll_fss -lfll_execute -lfl_directory -lfl_colors -lfl_strings -lfl_file -lfl_console -lfl_program -lfl_fss -lf_pipe -lf_file -lf_print -lf_conversion -lf_console -lf_memory -lc build_sources_library fss_extended_read.c build_sources_program main.c build_sources_headers fss_extended_read.h diff --git a/level_3/fss_extended_write/c/fss_extended_write.c b/level_3/fss_extended_write/c/fss_extended_write.c index 0ad4afd..08013ea 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -4,15 +4,6 @@ extern "C" { #endif -// version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors -#ifndef _di_fss_extended_write_print_version_ - f_return_status fss_extended_write_print_version(const fss_extended_write_data data) { - printf("%s\n", fss_extended_write_version); - - return f_none; - } -#endif // _fss_extended_write_print_version_ - #ifndef _di_fss_extended_write_print_help_ f_return_status fss_extended_write_print_help(const fss_extended_write_data data) { printf("\n"); @@ -152,7 +143,7 @@ extern "C" { fss_extended_write_print_help(*data); } else if (data->parameters[fss_extended_write_parameter_version].result == f_console_result_found) { - fss_extended_write_print_version(*data); + fl_program_print_version(fss_extended_write_version); } else { f_array_length counter = 0; diff --git a/level_3/fss_extended_write/c/fss_extended_write.h b/level_3/fss_extended_write/c/fss_extended_write.h index f8e2cbc..68f9049 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.h +++ b/level_3/fss_extended_write/c/fss_extended_write.h @@ -27,6 +27,7 @@ #include #include #include +#include #include // fll-2 includes @@ -106,13 +107,6 @@ extern "C" { } #endif // _di_fss_extended_write_data_ -#ifndef _di_fss_extended_write_print_version_ - /** - * Print version. - */ - extern f_return_status fss_extended_write_print_version(const fss_extended_write_data data); -#endif // _di_fss_extended_write_print_version_ - #ifndef _di_fss_extended_write_print_help_ /** * Print help. diff --git a/level_3/fss_extended_write/data/build/dependencies b/level_3/fss_extended_write/data/build/dependencies index 3d9fca4..55693f4 100644 --- a/level_3/fss_extended_write/data/build/dependencies +++ b/level_3/fss_extended_write/data/build/dependencies @@ -1,17 +1,18 @@ -f_types +f_console f_errors -f_strings +f_fss f_memory f_pipe f_print -f_console -f_fss -fl_console -fl_file -fl_strings +f_strings +f_types fl_colors +fl_console fl_directory +fl_file fl_fss +fl_program +fl_strings fll_colors -fll_fss fll_execute +fll_fss diff --git a/level_3/fss_extended_write/data/build/settings b/level_3/fss_extended_write/data/build/settings index fcc6a4d..a3fba1c 100644 --- a/level_3/fss_extended_write/data/build/settings +++ b/level_3/fss_extended_write/data/build/settings @@ -9,7 +9,7 @@ version_micro 2 build_compiler gcc build_linker ar -build_libraries -lfll_colors -lfll_fss -lfl_fss -lfl_file -lfl_errors -lfl_colors -lfl_console -lf_file -lf_print -lf_pipe -lf_conversion -lf_console -lf_memory -lc +build_libraries -lfll_colors -lfll_fss -lfl_fss -lfl_file -lfl_errors -lfl_colors -lfl_console -lfl_program -lf_file -lf_print -lf_pipe -lf_conversion -lf_console -lf_memory -lc build_sources_library fss_extended_write.c build_sources_program main.c build_sources_headers fss_extended_write.h diff --git a/level_3/fss_return_code/c/fss_return_code.c b/level_3/fss_return_code/c/fss_return_code.c index 941f2e3..66ec08d 100644 --- a/level_3/fss_return_code/c/fss_return_code.c +++ b/level_3/fss_return_code/c/fss_return_code.c @@ -4,15 +4,6 @@ extern "C" { #endif -// version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors -#ifndef _di_fss_return_code_print_version_ - f_return_status fss_return_code_print_version(const fss_return_code_data data) { - printf("%s\n", fss_return_code_version); - - return f_none; - } -#endif // _fss_return_code_print_version_ - #ifndef _di_fss_return_code_print_help_ f_return_status fss_return_code_print_help(const fss_return_code_data data) { printf("\n"); @@ -157,7 +148,7 @@ extern "C" { fss_return_code_print_help(*data); } else if (data->parameters[fss_return_code_parameter_version].result == f_console_result_found) { - fss_return_code_print_version(*data); + fl_program_print_version(fss_return_code_version); } else if (data->parameters[fss_return_code_parameter_is_error].result == f_console_result_found && data->remaining.used > 0) { f_array_length counter = 0; diff --git a/level_3/fss_return_code/c/fss_return_code.h b/level_3/fss_return_code/c/fss_return_code.h index 0359e66..1551925 100644 --- a/level_3/fss_return_code/c/fss_return_code.h +++ b/level_3/fss_return_code/c/fss_return_code.h @@ -25,6 +25,7 @@ #include #include #include +#include #include // fll-2 includes @@ -104,13 +105,6 @@ extern "C" { } #endif // _di_fss_return_code_data_ -#ifndef _di_fss_return_code_print_version_ - /** - * Print version. - */ - extern f_return_status fss_return_code_print_version(const fss_return_code_data data); -#endif // _di_fss_return_code_print_version_ - #ifndef _di_fss_return_code_print_help_ /** * Print help. diff --git a/level_3/fss_return_code/data/build/dependencies b/level_3/fss_return_code/data/build/dependencies index 048095b..55693f4 100644 --- a/level_3/fss_return_code/data/build/dependencies +++ b/level_3/fss_return_code/data/build/dependencies @@ -1,14 +1,18 @@ -f_types +f_console f_errors -f_strings +f_fss +f_memory f_pipe f_print -f_console -f_fss +f_strings +f_types +fl_colors fl_console +fl_directory fl_file -fl_strings -fl_colors fl_fss +fl_program +fl_strings fll_colors +fll_execute fll_fss diff --git a/level_3/fss_return_code/data/build/settings b/level_3/fss_return_code/data/build/settings index c801468..42ad005 100644 --- a/level_3/fss_return_code/data/build/settings +++ b/level_3/fss_return_code/data/build/settings @@ -9,7 +9,7 @@ version_micro 2 build_compiler gcc build_linker ar -build_libraries -lfll_colors -lfll_fss -lfl_fss -lfl_errors -lfl_colors -lfl_console -lf_print -lf_pipe -lf_conversion -lf_console -lf_memory -lc +build_libraries -lfll_colors -lfll_fss -lfl_fss -lfl_errors -lfl_colors -lfl_console -lfl_program -lf_print -lf_pipe -lf_conversion -lf_console -lf_memory -lc build_sources_library fss_return_code.c build_sources_program main.c build_sources_headers fss_return_code.h diff --git a/level_3/init/data/build/dependencies b/level_3/init/data/build/dependencies index 3d9fca4..55693f4 100644 --- a/level_3/init/data/build/dependencies +++ b/level_3/init/data/build/dependencies @@ -1,17 +1,18 @@ -f_types +f_console f_errors -f_strings +f_fss f_memory f_pipe f_print -f_console -f_fss -fl_console -fl_file -fl_strings +f_strings +f_types fl_colors +fl_console fl_directory +fl_file fl_fss +fl_program +fl_strings fll_colors -fll_fss fll_execute +fll_fss diff --git a/level_3/init/data/build/settings b/level_3/init/data/build/settings index 01d0835..9b1f009 100644 --- a/level_3/init/data/build/settings +++ b/level_3/init/data/build/settings @@ -9,7 +9,7 @@ version_micro 2 build_compiler gcc build_linker ar -build_libraries -lfll_colors -lfll_fss -lfll_execute -lfl_directory -lfl_colors -lfl_strings -lfl_file -lfl_console -lfl_fss -lf_pipe -lf_file -lf_print -lf_conversion -lf_console -lf_memory -lc +build_libraries -lfll_colors -lfll_fss -lfll_execute -lfl_directory -lfl_colors -lfl_strings -lfl_file -lfl_console -lfl_program -lfl_fss -lf_pipe -lf_file -lf_print -lf_conversion -lf_console -lf_memory -lc build_sources_library init.c private-init.c build_sources_program main.c build_sources_headers init.h diff --git a/level_3/return_code/c/return_code.c b/level_3/return_code/c/return_code.c index b053360..3b32672 100644 --- a/level_3/return_code/c/return_code.c +++ b/level_3/return_code/c/return_code.c @@ -4,15 +4,6 @@ extern "C" { #endif -// version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors -#ifndef _di_return_code_print_version_ - f_return_status return_code_print_version(const return_code_data data) { - printf("%s\n", return_code_version); - - return f_none; - } -#endif // _return_code_print_version_ - #ifndef _di_return_code_print_help_ f_return_status return_code_print_help(const return_code_data data) { printf("\n"); @@ -157,7 +148,7 @@ extern "C" { return_code_print_help(*data); } else if (data->parameters[return_code_parameter_version].result == f_console_result_found) { - return_code_print_version(*data); + fl_program_print_version(return_code_version); } else if (data->parameters[return_code_parameter_is_error].result == f_console_result_found && data->remaining.used > 0) { f_array_length counter = 0; diff --git a/level_3/return_code/c/return_code.h b/level_3/return_code/c/return_code.h index aa22951..0539c75 100644 --- a/level_3/return_code/c/return_code.h +++ b/level_3/return_code/c/return_code.h @@ -23,6 +23,7 @@ #include #include #include +#include #include // fll-2 includes @@ -101,13 +102,6 @@ extern "C" { } #endif // _di_return_code_data_ -#ifndef _di_return_code_print_version_ - /** - * Print version. - */ - extern f_return_status return_code_print_version(const return_code_data data); -#endif // _di_return_code_print_version_ - #ifndef _di_return_code_print_help_ /** * Print help. diff --git a/level_3/return_code/data/build/dependencies b/level_3/return_code/data/build/dependencies index 7164192..e50a1ed 100644 --- a/level_3/return_code/data/build/dependencies +++ b/level_3/return_code/data/build/dependencies @@ -1,11 +1,12 @@ -f_types +f_console f_errors -f_strings f_pipe f_print -f_console +f_strings +f_types +fl_colors fl_console fl_file +fl_program fl_strings -fl_colors fll_colors diff --git a/level_3/return_code/data/build/settings b/level_3/return_code/data/build/settings index 4c4e3c9..1da1361 100644 --- a/level_3/return_code/data/build/settings +++ b/level_3/return_code/data/build/settings @@ -9,7 +9,7 @@ version_micro 2 build_compiler gcc build_linker ar -build_libraries -lfll_colors -lfl_errors -lfl_colors -lfl_console -lf_print -lf_pipe -lf_conversion -lf_console -lf_memory -lc +build_libraries -lfll_colors -lfl_errors -lfl_colors -lfl_console -lfl_program -lf_print -lf_pipe -lf_conversion -lf_console -lf_memory -lc build_sources_library return_code.c build_sources_program main.c build_sources_headers return_code.h -- 1.8.3.1