From dfe0b06513e2a1fa8ed1716760adf019ffeaac1e Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Mon, 3 Jul 2023 22:59:07 -0500 Subject: [PATCH] Progress: Continue work regarding TacocaT. This further removes no longer supported functionality that was not previously fully removed. This adds the f_sockets_t in preparation for opening the sockets. --- data/build/tacocat/dependencies | 1 + data/build/tacocat/settings | 2 +- documents/readme.tacocat.txt | 18 +++++++----------- sources/c/tacocat/main/common/type.c | 7 +++---- sources/c/tacocat/main/common/type.h | 17 ++++++++--------- sources/c/tacocat/main/main.c | 2 +- sources/c/tacocat/main/process.c | 2 ++ sources/c/tacocat/main/tacocat.h | 1 + 8 files changed, 24 insertions(+), 26 deletions(-) diff --git a/data/build/tacocat/dependencies b/data/build/tacocat/dependencies index e8cbd07..a583830 100644 --- a/data/build/tacocat/dependencies +++ b/data/build/tacocat/dependencies @@ -15,6 +15,7 @@ f_path f_pipe f_print f_signal +f_socket f_thread fl_print diff --git a/data/build/tacocat/settings b/data/build/tacocat/settings index f768bac..154bf09 100644 --- a/data/build/tacocat/settings +++ b/data/build/tacocat/settings @@ -32,7 +32,7 @@ build_indexer_arguments rcs build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_print -lfll_program -lfl_print -lf_color -lf_compare -lf_console -lf_file -lf_memory -lf_network -lf_path -lf_pipe -lf_print -lf_signal -lf_string -lf_type_array -lf_utf +build_libraries-individual -lfll_error -lfll_print -lfll_program -lfl_print -lf_color -lf_compare -lf_console -lf_file -lf_memory -lf_network -lf_path -lf_pipe -lf_print -lf_signal -lf_socket -lf_string -lf_type_array -lf_utf build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll diff --git a/documents/readme.tacocat.txt b/documents/readme.tacocat.txt index d329bd5..34ca94f 100644 --- a/documents/readme.tacocat.txt +++ b/documents/readme.tacocat.txt @@ -2,26 +2,22 @@ # # license: cc-by-sa-4.0 # -# This file (assumed to be named readme.remove.txt) can be more easily read using the following iki_read commands: -# iki_read readme.tacocate.txt +Q -w -rrr FLL FLL PID PID DNS DNS -WW character "'" "'" code '"' '"' +# This file (assumed to be named readme.tacocat.txt) can be more easily read using the following iki_read commands: +# iki_read readme.tacocat.txt +Q -w -rr FLL FLL DNS DNS -WW character "'" "'" code '"' '"' # -# To read the "Remove Readme Documentation" section of this file, use this command sequence: -# fss_basic_list_read readme.tacocate.txt +Q -cn "TacocaT Readme Documentation" | iki_read +Q -w -rrr FLL FLL PID PID DNS DNS -WW character "'" "'" code '"' '"' +# To read the "TacocaT Readme Documentation" section of this file, use this command sequence: +# fss_basic_list_read readme.tacocat.txt +Q -cn "TacocaT Readme Documentation" | iki_read +Q -w -rr FLL FLL DNS DNS -WW character "'" "'" code '"' '"' # TacocaT Readme Documentation: The bold:"tacocat" is a program for sending and receiving files, mainly for testing purposes. - This program is similar to code:"netcat" or code:"nc". + This program is similar to code:"netcat" or code:"nc" but is not intended to function as a replacement for these tools. The primary use for this is to test bold:"Featureless Linux Library" and bold:"Kevux Tools" network functionality. The bold:"tacocat" program has the following arguments\: - The code:"--background" (code:"-b") causes this program to run in the background. - The code:"--from" (code:"-f") parameter is an address or socket file to listen to. - The code:"--pid" (code:"-p") causes this program to create a PID:"Process Identifier" file. - The code:"--pid_name" (code:"-N") parameter designates a custom PID:"Process Identifier" file name without the '.pid' extension or the directory path. - The code:"--pid_path" (code:"-P") parameter designates a custom PID:"Process Identifier" directory path.\ + The code:"--receive" (code:"-r") parameter is an address or socket file to listen to. The code:"--resolve" (code:"-R") parameter designates a DNS:"Domain Name Resolver" mode, such as code:"classic" or code:"kevux". - The code:"--to" (code:"-t") parameter is an address or socket file to transmit to. + The code:"--send" (code:"-s") parameter is an address or socket file to transmit to. diff --git a/sources/c/tacocat/main/common/type.c b/sources/c/tacocat/main/common/type.c index 194bf74..126f4e0 100644 --- a/sources/c/tacocat/main/common/type.c +++ b/sources/c/tacocat/main/common/type.c @@ -19,8 +19,6 @@ extern "C" { if (!setting) return F_status_set_error(F_parameter); - f_file_close(&setting->pid_file); - f_number_unsigned_t i = 0; for (; i < setting->file_receives.used ; ++i) { @@ -34,9 +32,10 @@ extern "C" { f_files_resize(0, &setting->file_receives); f_files_resize(0, &setting->file_sends); + f_sockets_resize(0, &setting->socket_receives); + f_sockets_resize(0, &setting->socket_sends); + f_string_dynamic_resize(0, &setting->buffer); - f_string_dynamic_resize(0, &setting->pid_path); - f_string_dynamic_resize(0, &setting->pid_name); f_string_dynamics_resize(0, &setting->receives); f_string_dynamics_resize(0, &setting->sends); diff --git a/sources/c/tacocat/main/common/type.h b/sources/c/tacocat/main/common/type.h index f15206d..0461bfe 100644 --- a/sources/c/tacocat/main/common/type.h +++ b/sources/c/tacocat/main/common/type.h @@ -30,13 +30,13 @@ extern "C" { * status_thread: A status used eclusively by the threaded signal handler. * state: The state data used when processing data. * - * pid_file: The PID file. * file_receives: An array of input files. * file_sends: An array of output files. * + * socket_receives: An array of the network sockets for receiving. + * socket_sends: An array of the network sockets for sending. + * * buffer: A string buffer used for caching purposes. - * pid_name: The name of the PID file without the path and without the file extension (.pid). - * pid_path: A file path to the directory containing the PID file. * * receives: An array of buffers for receiving data receive clients. * sends: An array of buffers for sending data send clients. @@ -51,13 +51,13 @@ extern "C" { f_status_t status_thread; f_state_t state; - f_file_t pid_file; f_files_t file_receives; f_files_t file_sends; + f_sockets_t socket_receives; + f_sockets_t socket_sends; + f_string_dynamic_t buffer; - f_string_dynamic_t pid_path; - f_string_dynamic_t pid_name; f_string_dynamics_t receives; f_string_dynamics_t sends; @@ -70,11 +70,10 @@ extern "C" { kt_tacocat_block_size_send_d, \ F_none, \ macro_f_state_t_initialize_1(kt_tacocat_allocation_large_d, kt_tacocat_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, 0, 0, 0), \ - f_file_t_initialize, \ f_files_t_initialize, \ f_files_t_initialize, \ - f_string_dynamic_t_initialize, \ - f_string_dynamic_t_initialize, \ + f_sockets_t_initialize, \ + f_sockets_t_initialize, \ f_string_dynamic_t_initialize, \ f_string_dynamics_t_initialize, \ f_string_dynamics_t_initialize, \ diff --git a/sources/c/tacocat/main/main.c b/sources/c/tacocat/main/main.c index 6461419..eccc190 100644 --- a/sources/c/tacocat/main/main.c +++ b/sources/c/tacocat/main/main.c @@ -43,7 +43,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { kt_tacocat_setting_load(arguments, &data); } - status_code_main(&data); + kt_tacocat_main(&data); #else { f_thread_id_t id_signal; diff --git a/sources/c/tacocat/main/process.c b/sources/c/tacocat/main/process.c index d457c60..2ff13dd 100644 --- a/sources/c/tacocat/main/process.c +++ b/sources/c/tacocat/main/process.c @@ -9,6 +9,8 @@ extern "C" { if (!main) return; + f_number_unsigned_t i = 0; + // @todo: // 1: Establish connections. // 2: read / write from files. diff --git a/sources/c/tacocat/main/tacocat.h b/sources/c/tacocat/main/tacocat.h index 2b63e94..92c32be 100644 --- a/sources/c/tacocat/main/tacocat.h +++ b/sources/c/tacocat/main/tacocat.h @@ -33,6 +33,7 @@ #include #include #include +#include #include // FLL-1 includes. -- 1.8.3.1