From 581c0008a48eb8b182a6fc4d371e08cfd53a7e05 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 13 Dec 2020 15:47:18 -0600 Subject: [PATCH] Feature: the execute functions now support custom pipes. This is necessary for the parent process to directly pipe date to/from a child process. One of the intended goals is for something like the controller program to directly execute a bash script from a string generated by the parent (where this is no file). The standard input can be used by the child process as pipe data. When a pipe is passed then the execute functions are asynchronous instead of blocking. The caller must properly handling all blocking operations as appropriate. The pipe functionality is optional. --- build/level_0/settings | 2 +- build/monolithic/settings | 2 +- level_0/f_color/data/build/settings | 2 +- level_0/f_execute/c/execute-common.h | 49 ++++++++++++ level_0/f_execute/c/execute.h | 30 +++++++ level_0/f_execute/data/build/defines | 1 + level_0/f_execute/data/build/dependencies | 5 ++ level_0/f_execute/data/build/settings | 55 +++++++++++++ level_0/f_signal/c/signal.h | 6 +- level_2/fll_execute/c/execute.c | 16 ++-- level_2/fll_execute/c/execute.h | 92 +++++++++++++++++----- level_2/fll_execute/c/private-execute.c | 52 ++++++++++-- level_2/fll_execute/c/private-execute.h | 24 ++++-- level_2/fll_execute/data/build/dependencies | 1 + level_3/fake/c/fake.h | 1 + level_3/fake/c/private-build.c | 2 +- level_3/fake/c/private-fake.c | 2 +- level_3/fake/c/private-make.c | 4 +- level_3/fake/data/build/dependencies | 1 + level_3/firewall/c/firewall.c | 21 ++++- level_3/firewall/c/firewall.h | 1 + level_3/firewall/c/private-firewall.c | 14 ++-- level_3/firewall/data/build/dependencies | 1 + .../fss_basic_list_read/c/fss_basic_list_read.h | 1 - .../fss_basic_list_read/data/build/dependencies | 1 - level_3/fss_basic_list_read/data/build/settings | 2 +- .../fss_basic_list_write/data/build/dependencies | 1 - level_3/fss_basic_list_write/data/build/settings | 2 +- level_3/fss_basic_read/c/fss_basic_read.h | 1 - level_3/fss_basic_read/data/build/dependencies | 1 - level_3/fss_basic_read/data/build/settings | 2 +- level_3/fss_basic_write/data/build/dependencies | 1 - level_3/fss_basic_write/data/build/settings | 2 +- .../c/fss_embedded_list_read.h | 1 - .../fss_embedded_list_read/data/build/dependencies | 1 - level_3/fss_embedded_list_read/data/build/settings | 2 +- .../data/build/dependencies | 1 - .../fss_embedded_list_write/data/build/settings | 2 +- .../c/fss_extended_list_read.h | 1 - .../fss_extended_list_read/data/build/dependencies | 1 - level_3/fss_extended_list_read/data/build/settings | 2 +- .../data/build/dependencies | 1 - .../fss_extended_list_write/data/build/settings | 2 +- level_3/fss_extended_read/c/fss_extended_read.h | 1 - level_3/fss_extended_read/data/build/dependencies | 1 - level_3/fss_extended_read/data/build/settings | 2 +- level_3/fss_extended_write/data/build/dependencies | 1 - level_3/fss_extended_write/data/build/settings | 2 +- level_3/fss_status_code/data/build/dependencies | 1 - level_3/fss_status_code/data/build/settings | 2 +- 50 files changed, 334 insertions(+), 88 deletions(-) create mode 100644 level_0/f_execute/c/execute-common.h create mode 100644 level_0/f_execute/c/execute.h create mode 100644 level_0/f_execute/data/build/defines create mode 100644 level_0/f_execute/data/build/dependencies create mode 100644 level_0/f_execute/data/build/settings diff --git a/build/level_0/settings b/build/level_0/settings index e1ad525..d4b781b 100644 --- a/build/level_0/settings +++ b/build/level_0/settings @@ -22,7 +22,7 @@ build_libraries -lc build_libraries-level build_sources_library account.c console.c conversion.c directory.c private-directory.c environment.c private-environment.c file.c private-file.c fss.c iki.c private-iki.c memory.c path.c private-path.c pipe.c print.c private-print.c process.c serialize.c private-serialize.c signal.c socket.c utf.c private-utf.c build_sources_program -build_sources_headers account.h account-common.h color.h console.h console-common.h conversion.h conversion-common.h directory.h directory_type.h directory-common.h environment.h environment-common.h file.h file-common.h fss.h fss-common.h fss_comment.h fss_delimit.h fss_named.h fss_nest.h fss_quote.h fss_set.h iki.h iki-common.h memory.h memory_structure.h path.h path-common.h pipe.h print.h process.h process-common.h serialize.h serialize-common.h signal.h signal-common.h socket.h socket-common.h status.h status_array.h string.h string-common.h string_dynamic.h string_map.h string_quantity.h string_range.h string_triple.h type.h type_array.h utf.h utf-common.h +build_sources_headers account.h account-common.h color.h console.h console-common.h conversion.h conversion-common.h directory.h directory_type.h directory-common.h environment.h environment-common.h execute.h execute-common.h file.h file-common.h fss.h fss-common.h fss_comment.h fss_delimit.h fss_named.h fss_nest.h fss_quote.h fss_set.h iki.h iki-common.h memory.h memory_structure.h path.h path-common.h pipe.h print.h process.h process-common.h serialize.h serialize-common.h signal.h signal-common.h socket.h socket-common.h status.h status_array.h string.h string-common.h string_dynamic.h string_map.h string_quantity.h string_range.h string_triple.h type.h type_array.h utf.h utf-common.h build_sources_script build_sources_setting build_script yes diff --git a/build/monolithic/settings b/build/monolithic/settings index e1615e5..590ee7b 100644 --- a/build/monolithic/settings +++ b/build/monolithic/settings @@ -22,7 +22,7 @@ build_libraries -lc build_libraries-monolithic build_sources_library level_0/account.c level_0/console.c level_0/conversion.c level_0/directory.c level_0/private-directory.c level_0/environment.c level_0/private-environment.c level_0/file.c level_0/private-file.c level_0/fss.c level_0/iki.c level_0/private-iki.c level_0/memory.c level_0/path.c level_0/private-path.c level_0/pipe.c level_0/print.c level_0/private-print.c level_0/process.c level_0/serialize.c level_0/private-serialize.c level_0/signal.c level_0/socket.c level_0/utf.c level_0/private-utf.c level_1/color.c level_1/console.c level_1/conversion.c level_1/directory.c level_1/private-directory.c level_1/environment.c level_1/private-fss.c level_1/fss_basic.c level_1/fss_basic_list.c level_1/fss_embedded_list.c level_1/fss_extended.c level_1/fss_extended_list.c level_1/iki.c level_1/print.c level_1/private-print.c level_1/status.c level_1/string.c level_1/private-string.c level_1/type.c level_1/utf.c level_1/private-utf.c level_1/utf_file.c level_1/private-utf_file.c level_2/error.c level_2/private-error.c level_2/execute.c level_2/private-execute.c level_2/file.c level_2/private-file.c level_2/fss.c level_2/private-fss.c level_2/fss_basic.c level_2/fss_basic_list.c level_2/fss_embedded_list.c level_2/fss_extended.c level_2/fss_extended_list.c level_2/fss_status.c level_2/iki.c level_2/private-iki.c level_2/path.c level_2/program.c level_2/status.c build_sources_program -build_sources_headers level_0/account.h level_0/account-common.h level_0/color.h level_0/console.h level_0/console-common.h level_0/conversion.h level_0/conversion-common.h level_0/directory.h level_0/directory_type.h level_0/directory-common.h level_0/environment.h level_0/environment-common.h level_0/file.h level_0/file-common.h level_0/fss.h level_0/fss-common.h level_0/fss_comment.h level_0/fss_delimit.h level_0/fss_named.h level_0/fss_nest.h level_0/fss_quote.h level_0/fss_set.h level_0/iki.h level_0/iki-common.h level_0/memory.h level_0/memory_structure.h level_0/path.h level_0/path-common.h level_0/pipe.h level_0/print.h level_0/process.h level_0/process-common.h level_0/serialize.h level_0/serialize-common.h level_0/signal.h level_0/signal-common.h level_0/socket.h level_0/socket-common.h level_0/status.h level_0/status_array.h level_0/string.h level_0/string-common.h level_0/string_dynamic.h level_0/string_map.h level_0/string_quantity.h level_0/string_range.h level_0/string_triple.h level_0/type.h level_0/type_array.h level_0/utf.h level_0/utf-common.h level_1/color.h level_1/console.h level_1/conversion.h level_1/directory.h level_1/environment.h level_1/fss.h level_1/fss_basic.h level_1/fss_basic_list.h level_1/fss_embedded_list.h level_1/fss_extended.h level_1/fss_extended_list.h level_1/fss_macro.h level_1/fss_status.h level_1/iki.h level_1/print.h level_1/status.h level_1/string.h level_1/type.h level_1/utf.h level_1/utf_file.h level_2/error.h level_2/error-common.h level_2/execute.h level_2/file.h level_2/fss.h level_2/fss_basic.h level_2/fss_basic_list.h level_2/fss_embedded_list.h level_2/fss_extended.h level_2/fss_extended_list.h level_2/fss_status.h level_2/iki.h level_2/path.h level_2/program.h level_2/status.h +build_sources_headers level_0/account.h level_0/account-common.h level_0/color.h level_0/console.h level_0/console-common.h level_0/conversion.h level_0/conversion-common.h level_0/directory.h level_0/directory_type.h level_0/directory-common.h level_0/environment.h level_0/environment-common.h level_0/execute.h level_0/execute-common.h level_0/file.h level_0/file-common.h level_0/fss.h level_0/fss-common.h level_0/fss_comment.h level_0/fss_delimit.h level_0/fss_named.h level_0/fss_nest.h level_0/fss_quote.h level_0/fss_set.h level_0/iki.h level_0/iki-common.h level_0/memory.h level_0/memory_structure.h level_0/path.h level_0/path-common.h level_0/pipe.h level_0/print.h level_0/process.h level_0/process-common.h level_0/serialize.h level_0/serialize-common.h level_0/signal.h level_0/signal-common.h level_0/socket.h level_0/socket-common.h level_0/status.h level_0/status_array.h level_0/string.h level_0/string-common.h level_0/string_dynamic.h level_0/string_map.h level_0/string_quantity.h level_0/string_range.h level_0/string_triple.h level_0/type.h level_0/type_array.h level_0/utf.h level_0/utf-common.h level_1/color.h level_1/console.h level_1/conversion.h level_1/directory.h level_1/environment.h level_1/fss.h level_1/fss_basic.h level_1/fss_basic_list.h level_1/fss_embedded_list.h level_1/fss_extended.h level_1/fss_extended_list.h level_1/fss_macro.h level_1/fss_status.h level_1/iki.h level_1/print.h level_1/status.h level_1/string.h level_1/type.h level_1/utf.h level_1/utf_file.h level_2/error.h level_2/error-common.h level_2/execute.h level_2/file.h level_2/fss.h level_2/fss_basic.h level_2/fss_basic_list.h level_2/fss_embedded_list.h level_2/fss_extended.h level_2/fss_extended_list.h level_2/fss_status.h level_2/iki.h level_2/path.h level_2/program.h level_2/status.h build_sources_script build_sources_setting build_script yes diff --git a/level_0/f_color/data/build/settings b/level_0/f_color/data/build/settings index 3ad9dd7..e8a552e 100644 --- a/level_0/f_color/data/build/settings +++ b/level_0/f_color/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual +build_libraries-individual -lf_memory build_sources_library build_sources_program build_sources_headers color.h diff --git a/level_0/f_execute/c/execute-common.h b/level_0/f_execute/c/execute-common.h new file mode 100644 index 0000000..cbd291b --- /dev/null +++ b/level_0/f_execute/c/execute-common.h @@ -0,0 +1,49 @@ +/** + * FLL - Level 0 + * + * Project: Execute + * API Version: 0.5 + * Licenses: lgplv2.1 + * + * Defines common data to be used for/by project execute. + * + * This is auto-included by execute.h and should not need to be explicitly included. + */ +#ifndef _F_execute_common_h +#define _F_execute_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * A set containing the three standard descriptors for use in pipes. + * + * Future versions may suppot stdwarn and stddebug if there ever is such a thing. + * + * Descriptors always use -1 to designate not used because 0 represent a valid descriptor. + * + * input: the input file descriptor. + * output: the output file descriptor. + * error: the error file descriptor. + */ +#ifndef _di_f_execute_pipe_t_ + typedef struct { + int input; + int output; + int error; + } f_execute_pipe_t; + + #define f_execute_pipe_t_initialize { -1, -1, -1 } + + #define f_execute_pipe_t_clear(set) \ + set.input = -1; \ + set.output = -1; \ + set.error = -1; +#endif // _di_f_execute_pipe_t_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _F_execute_common_h diff --git a/level_0/f_execute/c/execute.h b/level_0/f_execute/c/execute.h new file mode 100644 index 0000000..60e6abb --- /dev/null +++ b/level_0/f_execute/c/execute.h @@ -0,0 +1,30 @@ +/** + * FLL - Level 0 + * + * Project: Execute + * API Version: 0.5 + * Licenses: lgplv2.1 + * + * Provides execute processing functionality. + */ +#ifndef _F_execute_h +#define _F_execute_h + +// libc includes + +// fll-0 includes +#include +#include + +// fll-0 execute includes +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _F_execute_h diff --git a/level_0/f_execute/data/build/defines b/level_0/f_execute/data/build/defines new file mode 100644 index 0000000..4f13080 --- /dev/null +++ b/level_0/f_execute/data/build/defines @@ -0,0 +1 @@ +# fss-0000 diff --git a/level_0/f_execute/data/build/dependencies b/level_0/f_execute/data/build/dependencies new file mode 100644 index 0000000..c06dda5 --- /dev/null +++ b/level_0/f_execute/data/build/dependencies @@ -0,0 +1,5 @@ +# fss-0000 + +f_type +f_status +f_string diff --git a/level_0/f_execute/data/build/settings b/level_0/f_execute/data/build/settings new file mode 100644 index 0000000..0267e24 --- /dev/null +++ b/level_0/f_execute/data/build/settings @@ -0,0 +1,55 @@ +# fss-0001 + +project_name f_execute + +version_major 0 +version_minor 5 +version_micro 2 +version_target major + +environment + +process_pre +process_post + +modes individual +modes_default individual + +build_compiler gcc +build_indexer ar +build_language c +build_libraries -lc +build_libraries-individual -lf_memory +build_sources_library +build_sources_program +build_sources_headers execute.h execute-common.h +build_sources_script +build_sources_setting +build_script yes +build_shared yes +build_static yes + +path_headers level_0 +path_headers_preserve no +path_library_script script +path_library_shared shared +path_library_static static +path_program_script script +path_program_shared shared +path_program_static static +path_sources +path_standard yes + +search_exclusive yes +search_shared yes +search_static yes + +defines_all +defines_static +defines_shared + +flags_all -z now -g -fdiagnostics-color=always +flags_shared +flags_static +flags_library -fPIC +flags_program -fPIE diff --git a/level_0/f_signal/c/signal.h b/level_0/f_signal/c/signal.h index bba3a68..6e35860 100644 --- a/level_0/f_signal/c/signal.h +++ b/level_0/f_signal/c/signal.h @@ -21,13 +21,13 @@ #include #include +// fll-0 signal includes +#include + #ifdef __cplusplus extern "C" { #endif -// fll-0 signal includes -#include - /** * Close an open signal descriptor. * diff --git a/level_2/fll_execute/c/execute.c b/level_2/fll_execute/c/execute.c index c0b78ee..90879b0 100644 --- a/level_2/fll_execute/c/execute.c +++ b/level_2/fll_execute/c/execute.c @@ -130,7 +130,7 @@ extern "C" { #endif // _di_fll_execute_arguments_dynamic_add_set_ #ifndef _di_fll_execute_path_ - f_return_status fll_execute_path(const f_string_t program_path, const f_string_statics_t arguments, const f_signal_how_t *signals, int *result) { + f_return_status fll_execute_path(const f_string_t program_path, const f_string_statics_t arguments, const f_signal_how_t *signals, f_execute_pipe_t * const pipe, int *result) { #ifndef _di_level_2_parameter_checking_ if (!result) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ @@ -158,12 +158,12 @@ extern "C" { } } - return private_fll_execute_fork(program_name, fixed_arguments, F_false, signals, result); + return private_fll_execute_fork(program_name, fixed_arguments, F_false, signals, pipe, result); } #endif // _di_fll_execute_path_ #ifndef _di_fll_execute_path_environment_ - f_return_status fll_execute_path_environment(const f_string_t program_path, const f_string_statics_t arguments, const f_string_statics_t names, const f_string_statics_t values, const f_signal_how_t *signals, int *result) { + f_return_status fll_execute_path_environment(const f_string_t program_path, const f_string_statics_t arguments, const f_string_statics_t names, const f_string_statics_t values, const f_signal_how_t *signals, f_execute_pipe_t * const pipe, int *result) { #ifndef _di_level_2_parameter_checking_ if (!result) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ @@ -189,12 +189,12 @@ extern "C" { } } - return private_fll_execute_fork_environment(program_name, fixed_arguments, F_false, names, values, signals, result); + return private_fll_execute_fork_environment(program_name, fixed_arguments, F_false, names, values, signals, pipe, result); } #endif // _di_fll_execute_path_environment_ #ifndef _di_fll_execute_program_ - f_return_status fll_execute_program(const f_string_t program_name, const f_string_statics_t arguments, const f_signal_how_t *signals, int *result) { + f_return_status fll_execute_program(const f_string_t program_name, const f_string_statics_t arguments, const f_signal_how_t *signals, f_execute_pipe_t * const pipe, int *result) { #ifndef _di_level_2_parameter_checking_ if (!result) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ @@ -211,12 +211,12 @@ extern "C" { // insert the required array terminated. fixed_arguments[arguments.used + 1] = 0; - return private_fll_execute_fork(program_name, fixed_arguments, F_true, signals, result); + return private_fll_execute_fork(program_name, fixed_arguments, F_true, signals, pipe, result); } #endif // _di_fll_execute_program_ #ifndef _di_fll_execute_program_environment_ - f_return_status fll_execute_program_environment(const f_string_t program_name, const f_string_statics_t arguments, const f_string_statics_t names, const f_string_statics_t values, const f_signal_how_t *signals, int *result) { + f_return_status fll_execute_program_environment(const f_string_t program_name, const f_string_statics_t arguments, const f_string_statics_t names, const f_string_statics_t values, const f_signal_how_t *signals, f_execute_pipe_t * const pipe, int *result) { #ifndef _di_level_2_parameter_checking_ if (!result) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ @@ -315,7 +315,7 @@ extern "C" { f_macro_string_dynamics_t_delete(status, paths); if (F_status_is_error(status)) return status; - return private_fll_execute_fork_environment(program_name, fixed_arguments, F_true, names, values, signals, result); + return private_fll_execute_fork_environment(program_name, fixed_arguments, F_true, names, values, signals, pipe, result); } #endif // _di_fll_execute_program_environment_ diff --git a/level_2/fll_execute/c/execute.h b/level_2/fll_execute/c/execute.h index 756965b..fe72024 100644 --- a/level_2/fll_execute/c/execute.h +++ b/level_2/fll_execute/c/execute.h @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -350,25 +351,38 @@ extern "C" { * Instead, this returns F_child and assigns the child's return code to result. * The caller is expected to handle the appropriate exit procedures and memory deallocation. * + * When the passed pipe parameter is not NULL, this function is effectively asynchronous and will not block. + * The caller is then expected to handle all read/write operations to/from the pipe. + * The caller is expected to appropriately call waitpid() or similar as needed. + * The caller is expected to handle both parent and child process (status is F_parent for parent and F_child for child.). + * When the passed paremeter is NULL, then this function is effectively synchronous and blocks until child exits. + * * @param program_path * The entire path to the program. * @param arguments * An array of strings representing the arguments. - * @param set_signal + * @param signals * (optional) A pointer to the set of signals. * Set to 0 to disable. + * @param pipe + * (optional) A pointer to the set of pipe desciptors (I/O) to be used by the child process. + * When a non-zero address, the child process will assign these as the standard I/O file descriptors for piping to/from the parent/child. + * For each pipe, setting a value of -1 means to use the default pipe. + * Set to 0 to disable. * @param result * The code returned after finishing execution of program_path. * * @return * F_none on success. - * F_child on success but this is the child thread (this may happen when calling scripts rather than executing a binary). - * F_failure (with error bit) if result is non-zero. - * F_fork (with error bit) if fork failed. + * F_child on success but this is the child thread. + * F_parent on success but this is the parent thread and pipe is non-zero (function is not blocking). + * F_failure (with error bit set) on execution failure. + * F_fork (with error bit set) on fork failure. * * Errors (with error bit) from: f_file_exists(). * Errors (with error bit) from: f_signal_set_handle(). * + * @see dup2() * @see execv() * @see exit() * @see fork() @@ -380,7 +394,7 @@ extern "C" { * @see f_signal_set_handle() */ #ifndef _di_fll_execute_path_ - extern f_return_status fll_execute_path(const f_string_t program_path, const f_string_statics_t arguments, const f_signal_how_t *signals, int *result); + extern f_return_status fll_execute_path(const f_string_t program_path, const f_string_statics_t arguments, const f_signal_how_t *signals, f_execute_pipe_t * const pipe, int *result); #endif // _di_fll_execute_path_ /** @@ -394,6 +408,12 @@ extern "C" { * Instead, this returns F_child and assigns the child's return code to result. * The caller is expected to handle the appropriate exit procedures and memory deallocation. * + * When the passed pipe parameter is not NULL, this function is effectively asynchronous and will not block. + * The caller is then expected to handle all read/write operations to/from the pipe. + * The caller is expected to appropriately call waitpid() or similar as needed. + * The caller is expected to handle both parent and child process (status is F_parent for parent and F_child for child.). + * When the passed paremeter is NULL, then this function is effectively synchronous and blocks until child exits. + * * @param program_path * The entire path to the program. * @param arguments @@ -409,21 +429,28 @@ extern "C" { * @param signals * (optional) A pointer to the set of signals. * Set to 0 to disable. + * @param pipe + * (optional) A pointer to the set of pipe desciptors (I/O) to be used by the child process. + * When a non-zero address, the child process will assign these as the standard I/O file descriptors for piping to/from the parent/child. + * For each pipe, setting a value of -1 means to use the default pipe. + * Set to 0 to disable. * @param result * The code returned after finishing execution of program_path. * * @return * F_none on success. - * F_child on success but this is the child thread (this may happen when calling scripts rather than executing a binary). - * F_failure (with error bit) if result is non-zero. - * F_fork (with error bit) if fork failed. + * F_child on success but this is the child thread. + * F_parent on success but this is the parent thread and pipe is non-zero (function is not blocking). + * F_failure (with error bit set) on execution failure. + * F_fork (with error bit set) on fork failure. * * Errors (with error bit) from: f_environment_set_dynamic(). * Errors (with error bit) from: f_file_exists(). * Errors (with error bit) from: f_signal_set_handle(). * - * @see execv() * @see clearenv() + * @see dup2() + * @see execv() * @see fork() * @see memcpy() * @see strnlen() @@ -434,7 +461,7 @@ extern "C" { * @see f_signal_set_handle() */ #ifndef _di_fll_execute_path_environment_ - extern f_return_status fll_execute_path_environment(const f_string_t program_path, const f_string_statics_t arguments, const f_string_statics_t names, const f_string_statics_t values, const f_signal_how_t *signals, int *result); + extern f_return_status fll_execute_path_environment(const f_string_t program_path, const f_string_statics_t arguments, const f_string_statics_t names, const f_string_statics_t values, const f_signal_how_t *signals, f_execute_pipe_t * const pipe, int *result); #endif // _di_fll_execute_path_environment_ /** @@ -446,25 +473,38 @@ extern "C" { * Instead, this returns F_child and assigns the child's return code to result. * The caller is expected to handle the appropriate exit procedures and memory deallocation. * + * When the passed pipe parameter is not NULL, this function is effectively asynchronous and will not block. + * The caller is then expected to handle all read/write operations to/from the pipe. + * The caller is expected to appropriately call waitpid() or similar as needed. + * The caller is expected to handle both parent and child process (status is F_parent for parent and F_child for child.). + * When the passed paremeter is NULL, then this function is effectively synchronous and blocks until child exits. + * * @param program_name * The name of the program. * @param arguments * An array of strings representing the arguments. - * @param set_signal + * @param signals * (optional) A pointer to the set of signals. * Set to 0 to disable. + * @param pipe + * (optional) A pointer to the set of pipe desciptors (I/O) to be used by the child process. + * When a non-zero address, the child process will assign these as the standard I/O file descriptors for piping to/from the parent/child. + * For each pipe, setting a value of -1 means to use the default pipe. + * Set to 0 to disable. * @param result * The code returned after finishing execution of program. * * @return * F_none on success. - * F_child on success but this is the child thread (this may happen when calling scripts rather than executing a binary). - * F_failure (with error bit) if result is non-zero. - * F_fork (with error bit) if fork failed. + * F_child on success but this is the child thread. + * F_parent on success but this is the parent thread and pipe is non-zero (function is not blocking). + * F_failure (with error bit set) on execution failure. + * F_fork (with error bit set) on fork failure. * * Errors (with error bit) from: f_file_exists(). * Errors (with error bit) from: f_signal_set_handle(). * + * @see dup2() * @see execvp() * @see fork() * @see strnlen() @@ -474,7 +514,7 @@ extern "C" { * @see f_signal_set_handle() */ #ifndef _di_fll_execute_program_ - extern f_return_status fll_execute_program(const f_string_t program_name, const f_string_statics_t arguments, const f_signal_how_t *signals, int *result); + extern f_return_status fll_execute_program(const f_string_t program_name, const f_string_statics_t arguments, const f_signal_how_t *signals, f_execute_pipe_t * const pipe, int *result); #endif // _di_fll_execute_program_ /** @@ -490,6 +530,12 @@ extern "C" { * Instead, this returns F_child and assigns the child's return code to result. * The caller is expected to handle the appropriate exit procedures and memory deallocation. * + * When the passed pipe parameter is not NULL, this function is effectively asynchronous and will not block. + * The caller is then expected to handle all read/write operations to/from the pipe. + * The caller is expected to appropriately call waitpid() or similar as needed. + * The caller is expected to handle both parent and child process (status is F_parent for parent and F_child for child.). + * When the passed paremeter is NULL, then this function is effectively synchronous and blocks until child exits. + * * @param program_name * The name of the program. * @param arguments @@ -505,14 +551,20 @@ extern "C" { * @param signals * (optional) A pointer to the set of signals. * Set to 0 to disable. + * @param pipe + * (optional) A pointer to the set of pipe desciptors (I/O) to be used by the child process. + * When a non-zero address, the child process will assign these as the standard I/O file descriptors for piping to/from the parent/child. + * For each pipe, setting a value of -1 means to use the default pipe. + * Set to 0 to disable. * @param result * The code returned after finishing execution of program. * * @return * F_none on success. - * F_child on success but this is the child thread (this may happen when calling scripts rather than executing a binary). - * F_failure (with error bit) if result is non-zero. - * F_fork (with error bit) if fork failed. + * F_child on success but this is the child thread. + * F_parent on success but this is the parent thread and pipe is non-zero (function is not blocking). + * F_failure (with error bit set) on execution failure. + * F_fork (with error bit set) on fork failure. * * Errors (with error bit) from: f_environment_get(). * Errors (with error bit) from: f_file_exists(). @@ -523,6 +575,8 @@ extern "C" { * Errors (with error bit) from: fl_string_append(). * Errors (with error bit) from: fl_string_dynamic_terminate(). * + * @see clearenv() + * @see dup2() * @see execvp() * @see fork() * @see memcpy() @@ -537,7 +591,7 @@ extern "C" { * @see fl_string_dynamic_terminate() */ #ifndef _di_fll_execute_program_environment_ - extern f_return_status fll_execute_program_environment(const f_string_t program_name, const f_string_statics_t arguments, const f_string_statics_t names, const f_string_statics_t values, const f_signal_how_t *signals, int *result); + extern f_return_status fll_execute_program_environment(const f_string_t program_name, const f_string_statics_t arguments, const f_string_statics_t names, const f_string_statics_t values, const f_signal_how_t *signals, f_execute_pipe_t * const pipe, int *result); #endif // _di_fll_execute_program_environment_ #ifdef __cplusplus diff --git a/level_2/fll_execute/c/private-execute.c b/level_2/fll_execute/c/private-execute.c index 11e12dc..7c9ebd7 100644 --- a/level_2/fll_execute/c/private-execute.c +++ b/level_2/fll_execute/c/private-execute.c @@ -111,7 +111,7 @@ extern "C" { #endif // !defined(_di_fll_execute_arguments_add_parameter_) || !defined(_di_fll_execute_arguments_add_parameter_set_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_set_) #if !defined(_di_fll_execute_path_) || !defined(_di_fll_execute_program_) - f_return_status private_fll_execute_fork(const f_string_t program_path, const f_string_t fixed_arguments[], const bool execute_program, const f_signal_how_t *signals, int *result) { + f_return_status private_fll_execute_fork(const f_string_t program_path, const f_string_t fixed_arguments[], const bool program_is, const f_signal_how_t *signals, f_execute_pipe_t * const pipe, int *result) { const pid_t process_id = fork(); @@ -119,15 +119,33 @@ extern "C" { return F_status_set_error(F_fork); } - // child process. - if (!process_id) { + if (process_id) { + if (pipe) { + return F_parent; + } + } + else { if (signals) { f_signal_set_handle(SIG_BLOCK, &signals->block); f_signal_set_handle(SIG_UNBLOCK, &signals->block_not); } - const int code = execute_program ? execvp(program_path, fixed_arguments) : execv(program_path, fixed_arguments); + if (pipe) { + if (pipe->input != -1) { + dup2(pipe->input, f_type_descriptor_input); + } + + if (pipe->output != -1) { + dup2(pipe->input, f_type_descriptor_output); + } + + if (pipe->error != -1) { + dup2(pipe->error, f_type_descriptor_error); + } + } + + const int code = program_is ? execvp(program_path, fixed_arguments) : execv(program_path, fixed_arguments); if (result) { *result = code; @@ -152,7 +170,7 @@ extern "C" { #endif // !defined(_di_fll_execute_path_) || !defined(_di_fll_execute_program_) #if !defined(_di_fll_execute_path_environment_) || !defined(_di_fll_execute_program_environment_) - f_return_status private_fll_execute_fork_environment(const f_string_t program_path, const f_string_t fixed_arguments[], const bool execute_program, const f_string_statics_t names, const f_string_statics_t values, const f_signal_how_t *signals, int *result) { + f_return_status private_fll_execute_fork_environment(const f_string_t program_path, const f_string_t fixed_arguments[], const bool program_is, const f_string_statics_t names, const f_string_statics_t values, const f_signal_how_t *signals, f_execute_pipe_t * const pipe, int *result) { const pid_t process_id = fork(); @@ -160,8 +178,12 @@ extern "C" { return F_status_set_error(F_fork); } - // child process. - if (!process_id) { + if (process_id) { + if (pipe) { + return F_parent; + } + } + else { if (signals) { f_signal_set_handle(SIG_BLOCK, &signals->block); f_signal_set_handle(SIG_UNBLOCK, &signals->block_not); @@ -173,7 +195,21 @@ extern "C" { f_environment_set_dynamic(names.array[i], values.array[i], F_true); } // for - const int code = execute_program ? execvp(program_path, fixed_arguments) : execv(program_path, fixed_arguments); + if (pipe) { + if (pipe->input != -1) { + dup2(pipe->input, f_type_descriptor_input); + } + + if (pipe->output != -1) { + dup2(pipe->input, f_type_descriptor_output); + } + + if (pipe->error != -1) { + dup2(pipe->error, f_type_descriptor_error); + } + } + + const int code = program_is ? execvp(program_path, fixed_arguments) : execv(program_path, fixed_arguments); if (result) { *result = code; diff --git a/level_2/fll_execute/c/private-execute.h b/level_2/fll_execute/c/private-execute.h index 0b7df63..c8327e2 100644 --- a/level_2/fll_execute/c/private-execute.h +++ b/level_2/fll_execute/c/private-execute.h @@ -115,20 +115,26 @@ extern "C" { * The part of the path to the program representing the program name to copy from. * @param fixed_arguments * A fixed array of strings representing the arguments. - * @param execute_path + * @param program_is * If TRUE then execvp() is called to perform execution. * If FALSE then execv() is called to perform execution. * @param set_signal * (optional) A pointer to the set of signals. * Set to 0 to disable. + * @param pipe + * (optional) A pointer to the set of pipe desciptors (I/O) to be used by the child process. + * When a non-zero address, the child process will assign these as the standard I/O file descriptors for piping to/from the parent/child. + * For each pipe, setting a value of -1 means to use the default pipe. + * Set to 0 to disable. * @param result * The code returned after finishing execution of program_path. * * @return * F_none on success. * F_child on success but this is the child thread. - * F_fork (with error bit set) on fork failure. + * F_parent on success but this is the parent thread and pipe is non-zero (function is not blocking). * F_failure (with error bit set) on execution failure. + * F_fork (with error bit set) on fork failure. * * @see execv() * @see execvp() @@ -136,7 +142,7 @@ extern "C" { * @see fll_execute_program() */ #if !defined(_di_fll_execute_path_) || !defined(_di_fll_execute_program_) - extern f_return_status private_fll_execute_fork(const f_string_t program_path, const f_string_t fixed_arguments[], const bool execute_path, const f_signal_how_t *signals, int *result) f_gcc_attribute_visibility_internal; + extern f_return_status private_fll_execute_fork(const f_string_t program_path, const f_string_t fixed_arguments[], const bool program_is, const f_signal_how_t *signals, f_execute_pipe_t * const pipe, int *result) f_gcc_attribute_visibility_internal; #endif // !defined(_di_fll_execute_path_) || !defined(_di_fll_execute_program_) /** @@ -146,7 +152,7 @@ extern "C" { * The part of the path to the program representing the program name to copy from. * @param fixed_arguments * A fixed array of strings representing the arguments. - * @param execute_program + * @param program_is * If TRUE then execvp() is called to perform execution. * If FALSE then execv() is called to perform execution. * @param names @@ -160,14 +166,20 @@ extern "C" { * @param signals * (optional) A pointer to the set of signals. * Set to 0 to disable. + * @param pipe + * (optional) A pointer to the set of pipe desciptors (I/O) to be used by the child process. + * When a non-zero address, the child process will assign these as the standard I/O file descriptors for piping to/from the parent/child. + * For each pipe, setting a value of -1 means to use the default pipe. + * Set to 0 to disable. * @param result * The code returned after finishing execution of program_path. * * @return * F_none on success. * F_child on success but this is the child thread. - * F_fork (with error bit set) on fork failure. + * F_parent on success but this is the parent thread and pipe is non-zero (function is not blocking). * F_failure (with error bit set) on execution failure. + * F_fork (with error bit set) on fork failure. * * @see execv() * @see execvpe() @@ -175,7 +187,7 @@ extern "C" { * @see fll_execute_program_environment() */ #if !defined(_di_fll_execute_path_environment_) || !defined(_di_fll_execute_program_environment_) - extern f_return_status private_fll_execute_fork_environment(const f_string_t program_path, const f_string_t fixed_arguments[], const bool execute_program, const f_string_statics_t names, const f_string_statics_t values, const f_signal_how_t *signals, int *result) f_gcc_attribute_visibility_internal; + extern f_return_status private_fll_execute_fork_environment(const f_string_t program_path, const f_string_t fixed_arguments[], const bool program_is, const f_string_statics_t names, const f_string_statics_t values, const f_signal_how_t *signals, f_execute_pipe_t * const pipe, int *result) f_gcc_attribute_visibility_internal; #endif // !defined(_di_fll_execute_path_environment_) || !defined(_di_fll_execute_program_environment_) /** diff --git a/level_2/fll_execute/data/build/dependencies b/level_2/fll_execute/data/build/dependencies index b94e28a..862211b 100644 --- a/level_2/fll_execute/data/build/dependencies +++ b/level_2/fll_execute/data/build/dependencies @@ -5,6 +5,7 @@ f_status f_memory f_string f_environment +f_execute f_file f_path f_signal diff --git a/level_3/fake/c/fake.h b/level_3/fake/c/fake.h index 6e6f91a..67fcb93 100644 --- a/level_3/fake/c/fake.h +++ b/level_3/fake/c/fake.h @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index fcee29f..24e5968 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -664,7 +664,7 @@ extern "C" { f_signal_set_empty(&signals.block); f_signal_set_fill(&signals.block_not); - *status = fll_execute_path_environment(path.string, arguments, data_build.environment.names, data_build.environment.values, &signals, &return_code); + *status = fll_execute_path_environment(path.string, arguments, data_build.environment.names, data_build.environment.values, &signals, 0, &return_code); f_macro_string_dynamics_t_delete_simple(arguments); diff --git a/level_3/fake/c/private-fake.c b/level_3/fake/c/private-fake.c index 9e56f0f..e8c5601 100644 --- a/level_3/fake/c/private-fake.c +++ b/level_3/fake/c/private-fake.c @@ -41,7 +41,7 @@ extern "C" { f_signal_set_empty(&signals.block); f_signal_set_fill(&signals.block_not); - *status = fll_execute_program_environment(program.string, arguments, environment.names, environment.values, &signals, &return_code); + *status = fll_execute_program_environment(program.string, arguments, environment.names, environment.values, &signals, 0, &return_code); if (fake_signal_received(data)) { *status = F_status_set_error(F_signal); diff --git a/level_3/fake/c/private-make.c b/level_3/fake/c/private-make.c index 67ce461..0ba2eb0 100644 --- a/level_3/fake/c/private-make.c +++ b/level_3/fake/c/private-make.c @@ -3847,10 +3847,10 @@ extern "C" { f_signal_set_fill(&signals.block_not); if (as_shell) { - status = fll_execute_path_environment(program.string, arguments, data_make->environment.names, data_make->environment.values, &signals, &return_code); + status = fll_execute_path_environment(program.string, arguments, data_make->environment.names, data_make->environment.values, &signals, 0, &return_code); } else { - status = fll_execute_program_environment(program.string, arguments, data_make->environment.names, data_make->environment.values, &signals, &return_code); + status = fll_execute_program_environment(program.string, arguments, data_make->environment.names, data_make->environment.values, &signals, 0, &return_code); } if (status == F_status_set_error(F_signal)) { diff --git a/level_3/fake/data/build/dependencies b/level_3/fake/data/build/dependencies index 04a8d94..f10db60 100644 --- a/level_3/fake/data/build/dependencies +++ b/level_3/fake/data/build/dependencies @@ -11,6 +11,7 @@ f_console f_conversion f_directory f_environment +f_execute f_fss f_file f_iki diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index b2a2a90..2abbb7e 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -251,7 +251,12 @@ extern "C" { parameters.array[4].used = 9; parameters.array[5].used = 6; - status = fll_execute_program((f_string_t) firewall_tool_iptables, parameters, 0, &return_code); + status = fll_execute_program((f_string_t) firewall_tool_iptables, parameters, 0, 0, &return_code); + + // immediately exit child process, @todo this may require additional memory deallocation and relating changes. + if (status == F_child) { + exit(return_code); + } fprintf(data->output.stream, "\n"); fflush(data->output.stream); @@ -279,7 +284,12 @@ extern "C" { parameters.array[4].used = 9; parameters.array[5].used = 6; - status = fll_execute_program((f_string_t) firewall_tool_iptables, parameters, 0, &return_code); + status = fll_execute_program((f_string_t) firewall_tool_iptables, parameters, 0, 0, &return_code); + + // immediately exit child process, @todo this may require additional memory deallocation and relating changes. + if (status == F_child) { + exit(return_code); + } fprintf(data->output.stream, "\n"); fflush(data->output.stream); @@ -303,7 +313,12 @@ extern "C" { parameters.array[2].used = 9; parameters.array[3].used = 6; - status = fll_execute_program((f_string_t) firewall_tool_iptables, parameters, 0, &return_code); + status = fll_execute_program((f_string_t) firewall_tool_iptables, parameters, 0, 0, &return_code); + + // immediately exit child process, @todo this may require additional memory deallocation and relating changes. + if (status == F_child) { + exit(return_code); + } fprintf(data->output.stream, "\n"); fflush(data->output.stream); diff --git a/level_3/firewall/c/firewall.h b/level_3/firewall/c/firewall.h index 51b5a13..2e193f9 100644 --- a/level_3/firewall/c/firewall.h +++ b/level_3/firewall/c/firewall.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/level_3/firewall/c/private-firewall.c b/level_3/firewall/c/private-firewall.c index 6f8beb0..13f7b05 100644 --- a/level_3/firewall/c/private-firewall.c +++ b/level_3/firewall/c/private-firewall.c @@ -752,7 +752,7 @@ f_return_status firewall_perform_commands(const firewall_local_data_t local, con fprintf(f_type_debug, "\n"); } - status = fll_execute_program((f_string_t) current_tool, arguments, 0, &return_code); + status = fll_execute_program((f_string_t) current_tool, arguments, 0, 0, &return_code); // immediately exit child process, @todo this may require additional memory deallocation and relating changes. if (status == F_child) { @@ -826,7 +826,7 @@ f_return_status firewall_perform_commands(const firewall_local_data_t local, con fprintf(f_type_debug, "\n"); } - status = fll_execute_program(current_tool, arguments, 0, &return_code); + status = fll_execute_program(current_tool, arguments, 0, 0, &return_code); // immediately exit child process, @todo this may require additional memory deallocation and relating changes. if (status == F_child) { @@ -1070,7 +1070,7 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains_t *reserv } tool = firewall_program_iptables; - status = fll_execute_program((f_string_t) firewall_tool_iptables, arguments, 0, &return_code); + status = fll_execute_program((f_string_t) firewall_tool_iptables, arguments, 0, 0, &return_code); // immediately exit child process, @todo this may require additional memory deallocation and relating changes. if (status == F_child) { @@ -1091,7 +1091,7 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains_t *reserv } tool = firewall_program_ip6tables; - status = fll_execute_program((f_string_t) firewall_tool_ip6tables, arguments, 0, &return_code); + status = fll_execute_program((f_string_t) firewall_tool_ip6tables, arguments, 0, 0, &return_code); // immediately exit child process, @todo this may require additional memory deallocation and relating changes. if (status == F_child) { @@ -1179,7 +1179,7 @@ f_return_status firewall_delete_chains(const firewall_data_t data) { fprintf(f_type_debug, "\n"); } - status = fll_execute_program(tools[i], arguments, 0, &return_code); + status = fll_execute_program(tools[i], arguments, 0, 0, &return_code); // immediately exit child process, @todo this may require additional memory deallocation and relating changes. if (status == F_child) { @@ -1239,7 +1239,7 @@ f_return_status firewall_delete_chains(const firewall_data_t data) { fprintf(f_type_debug, "\n"); } - status = fll_execute_program(tools[i], arguments, 0, &return_code); + status = fll_execute_program(tools[i], arguments, 0, 0, &return_code); // immediately exit child process, @todo this may require additional memory deallocation and relating changes. if (status == F_child) { @@ -1321,7 +1321,7 @@ f_return_status firewall_default_lock(const firewall_data_t data) { fprintf(f_type_debug, "\n"); } - status = fll_execute_program(tools[j], arguments, 0, &return_code); + status = fll_execute_program(tools[j], arguments, 0, 0, &return_code); // immediately exit child process, @todo this may require additional memory deallocation and relating changes. if (status == F_child) { diff --git a/level_3/firewall/data/build/dependencies b/level_3/firewall/data/build/dependencies index 66e5d36..f58c5d8 100644 --- a/level_3/firewall/data/build/dependencies +++ b/level_3/firewall/data/build/dependencies @@ -9,6 +9,7 @@ f_color f_console f_directory f_environment +f_execute f_file f_fss f_path 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 7ce5951..f8e2782 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 @@ -41,7 +41,6 @@ // fll-2 includes #include -#include #include #include #include diff --git a/level_3/fss_basic_list_read/data/build/dependencies b/level_3/fss_basic_list_read/data/build/dependencies index 4f23c89..501975c 100644 --- a/level_3/fss_basic_list_read/data/build/dependencies +++ b/level_3/fss_basic_list_read/data/build/dependencies @@ -21,7 +21,6 @@ fl_print fl_status fl_string fll_error -fll_execute fll_file fll_fss fll_program diff --git a/level_3/fss_basic_list_read/data/build/settings b/level_3/fss_basic_list_read/data/build/settings index 87dd4dc..a4cc3f9 100644 --- a/level_3/fss_basic_list_read/data/build/settings +++ b/level_3/fss_basic_list_read/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_execute -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_print -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_basic_list_read.c private-fss_basic_list_read.c diff --git a/level_3/fss_basic_list_write/data/build/dependencies b/level_3/fss_basic_list_write/data/build/dependencies index 35c97b5..df503dc 100644 --- a/level_3/fss_basic_list_write/data/build/dependencies +++ b/level_3/fss_basic_list_write/data/build/dependencies @@ -20,7 +20,6 @@ fl_fss fl_status fl_string fll_error -fll_execute fll_file fll_fss fll_program diff --git a/level_3/fss_basic_list_write/data/build/settings b/level_3/fss_basic_list_write/data/build/settings index 906aa1f..b866403 100644 --- a/level_3/fss_basic_list_write/data/build/settings +++ b/level_3/fss_basic_list_write/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_execute -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_basic_list_write.c private-fss_basic_list_write.c 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 c473b13..e1df109 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.h +++ b/level_3/fss_basic_read/c/fss_basic_read.h @@ -41,7 +41,6 @@ // fll-2 includes #include -#include #include #include #include diff --git a/level_3/fss_basic_read/data/build/dependencies b/level_3/fss_basic_read/data/build/dependencies index 4f23c89..501975c 100644 --- a/level_3/fss_basic_read/data/build/dependencies +++ b/level_3/fss_basic_read/data/build/dependencies @@ -21,7 +21,6 @@ fl_print fl_status fl_string fll_error -fll_execute fll_file fll_fss fll_program diff --git a/level_3/fss_basic_read/data/build/settings b/level_3/fss_basic_read/data/build/settings index a9bb147..6664909 100644 --- a/level_3/fss_basic_read/data/build/settings +++ b/level_3/fss_basic_read/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_execute -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_print -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_basic_read.c private-fss_basic_read.c diff --git a/level_3/fss_basic_write/data/build/dependencies b/level_3/fss_basic_write/data/build/dependencies index 35c97b5..df503dc 100644 --- a/level_3/fss_basic_write/data/build/dependencies +++ b/level_3/fss_basic_write/data/build/dependencies @@ -20,7 +20,6 @@ fl_fss fl_status fl_string fll_error -fll_execute fll_file fll_fss fll_program diff --git a/level_3/fss_basic_write/data/build/settings b/level_3/fss_basic_write/data/build/settings index 6635285..e0b36db 100644 --- a/level_3/fss_basic_write/data/build/settings +++ b/level_3/fss_basic_write/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_execute -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_basic_write.c private-fss_basic_write.c diff --git a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.h b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.h index 09a09da..1551fef 100644 --- a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.h +++ b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.h @@ -41,7 +41,6 @@ // fll-2 includes #include -#include #include #include #include diff --git a/level_3/fss_embedded_list_read/data/build/dependencies b/level_3/fss_embedded_list_read/data/build/dependencies index 4f23c89..501975c 100644 --- a/level_3/fss_embedded_list_read/data/build/dependencies +++ b/level_3/fss_embedded_list_read/data/build/dependencies @@ -21,7 +21,6 @@ fl_print fl_status fl_string fll_error -fll_execute fll_file fll_fss fll_program diff --git a/level_3/fss_embedded_list_read/data/build/settings b/level_3/fss_embedded_list_read/data/build/settings index fd9b43c..3c36c6a 100644 --- a/level_3/fss_embedded_list_read/data/build/settings +++ b/level_3/fss_embedded_list_read/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_execute -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_print -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_embedded_list_read.c private-fss_embedded_list_read.c diff --git a/level_3/fss_embedded_list_write/data/build/dependencies b/level_3/fss_embedded_list_write/data/build/dependencies index 35c97b5..df503dc 100644 --- a/level_3/fss_embedded_list_write/data/build/dependencies +++ b/level_3/fss_embedded_list_write/data/build/dependencies @@ -20,7 +20,6 @@ fl_fss fl_status fl_string fll_error -fll_execute fll_file fll_fss fll_program diff --git a/level_3/fss_embedded_list_write/data/build/settings b/level_3/fss_embedded_list_write/data/build/settings index 2ff7829..c2283be 100644 --- a/level_3/fss_embedded_list_write/data/build/settings +++ b/level_3/fss_embedded_list_write/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_execute -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_embedded_list_write.c private-fss_embedded_list_write.c diff --git a/level_3/fss_extended_list_read/c/fss_extended_list_read.h b/level_3/fss_extended_list_read/c/fss_extended_list_read.h index 62f9d89..79b2929 100644 --- a/level_3/fss_extended_list_read/c/fss_extended_list_read.h +++ b/level_3/fss_extended_list_read/c/fss_extended_list_read.h @@ -41,7 +41,6 @@ // fll-2 includes #include -#include #include #include #include diff --git a/level_3/fss_extended_list_read/data/build/dependencies b/level_3/fss_extended_list_read/data/build/dependencies index 4f23c89..501975c 100644 --- a/level_3/fss_extended_list_read/data/build/dependencies +++ b/level_3/fss_extended_list_read/data/build/dependencies @@ -21,7 +21,6 @@ fl_print fl_status fl_string fll_error -fll_execute fll_file fll_fss fll_program diff --git a/level_3/fss_extended_list_read/data/build/settings b/level_3/fss_extended_list_read/data/build/settings index f2ed020..66bb70b 100644 --- a/level_3/fss_extended_list_read/data/build/settings +++ b/level_3/fss_extended_list_read/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_execute -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_print -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_extended_list_read.c private-fss_extended_list_read.c diff --git a/level_3/fss_extended_list_write/data/build/dependencies b/level_3/fss_extended_list_write/data/build/dependencies index 35c97b5..df503dc 100644 --- a/level_3/fss_extended_list_write/data/build/dependencies +++ b/level_3/fss_extended_list_write/data/build/dependencies @@ -20,7 +20,6 @@ fl_fss fl_status fl_string fll_error -fll_execute fll_file fll_fss fll_program diff --git a/level_3/fss_extended_list_write/data/build/settings b/level_3/fss_extended_list_write/data/build/settings index 08f0016..f8eecf5 100644 --- a/level_3/fss_extended_list_write/data/build/settings +++ b/level_3/fss_extended_list_write/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_execute -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_extended_list_write.c private-fss_extended_list_write.c 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 6126350..c9bd1dd 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.h +++ b/level_3/fss_extended_read/c/fss_extended_read.h @@ -41,7 +41,6 @@ // fll-2 includes #include -#include #include #include #include diff --git a/level_3/fss_extended_read/data/build/dependencies b/level_3/fss_extended_read/data/build/dependencies index 9843cb6..de0c727 100644 --- a/level_3/fss_extended_read/data/build/dependencies +++ b/level_3/fss_extended_read/data/build/dependencies @@ -21,7 +21,6 @@ fl_print fl_status fl_string fll_error -fll_execute fll_file fll_fss fll_program diff --git a/level_3/fss_extended_read/data/build/settings b/level_3/fss_extended_read/data/build/settings index 3af122f..a881b2b 100644 --- a/level_3/fss_extended_read/data/build/settings +++ b/level_3/fss_extended_read/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_execute -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_print -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_extended_read.c private-fss_extended_read.c diff --git a/level_3/fss_extended_write/data/build/dependencies b/level_3/fss_extended_write/data/build/dependencies index 4346cad..1f1706b 100644 --- a/level_3/fss_extended_write/data/build/dependencies +++ b/level_3/fss_extended_write/data/build/dependencies @@ -19,7 +19,6 @@ fl_fss fl_status fl_string fll_error -fll_execute fll_file fll_fss fll_program diff --git a/level_3/fss_extended_write/data/build/settings b/level_3/fss_extended_write/data/build/settings index 810c1ac..2073547 100644 --- a/level_3/fss_extended_write/data/build/settings +++ b/level_3/fss_extended_write/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_execute -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfl_color -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_extended_write.c private-fss_extended_write.c diff --git a/level_3/fss_status_code/data/build/dependencies b/level_3/fss_status_code/data/build/dependencies index eaeb226..6b134dd 100644 --- a/level_3/fss_status_code/data/build/dependencies +++ b/level_3/fss_status_code/data/build/dependencies @@ -22,7 +22,6 @@ fl_status fl_string fl_utf fll_error -fll_execute fll_file fll_fss fll_program diff --git a/level_3/fss_status_code/data/build/settings b/level_3/fss_status_code/data/build/settings index 01e1b20..2f83ad9 100644 --- a/level_3/fss_status_code/data/build/settings +++ b/level_3/fss_status_code/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_execute -lfll_file -lfll_fss -lfll_program -lfll_status -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_status -lfl_string -lfl_utf -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_utf +build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_program -lfll_status -lfl_color -lfl_console -lfl_conversion -lfl_directory -lfl_fss -lfl_status -lfl_string -lfl_utf -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_status_code.c private-fss_status_code.c -- 1.8.3.1