From 625cd1bceb663e324fbd81b387a790bc70b51f0a Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Mon, 21 Aug 2023 23:27:32 -0500 Subject: [PATCH] Update: Syncrhonize with latest FLL API changes to f_string_dynamic_t and related. --- sources/c/tacocat/main/common.c | 20 ++++++++++---------- sources/c/tacocat/main/common.h | 4 ---- sources/c/tacocat/main/common/print.c | 2 -- sources/c/tacocat/main/common/print.h | 2 -- sources/c/tacocat/main/common/type.c | 6 +++--- sources/c/tacocat/main/print/error.c | 14 +++++++------- sources/c/tacocat/main/print/warning.c | 2 +- sources/c/tacocat/main/receive.c | 8 ++++---- 8 files changed, 25 insertions(+), 33 deletions(-) diff --git a/sources/c/tacocat/main/common.c b/sources/c/tacocat/main/common.c index fdd47eb..30d35cb 100644 --- a/sources/c/tacocat/main/common.c +++ b/sources/c/tacocat/main/common.c @@ -263,13 +263,13 @@ extern "C" { macro_setting_load_handle_send_receive_error_continue_1(f_memory_array_increase_by); - main->setting.state.status = f_string_dynamics_increase_by(total, &sets[i]->names); + main->setting.state.status = f_memory_array_increase_by(total, sizeof(f_string_dynamic_t), (void **) &sets[i]->names.array, &sets[i]->names.used, &sets[i]->names.size); - macro_setting_load_handle_send_receive_error_continue_1(f_string_dynamics_increase_by); + macro_setting_load_handle_send_receive_error_continue_1(f_memory_array_increase_by); - main->setting.state.status = f_string_dynamics_increase_by(total, &sets[i]->buffers); + main->setting.state.status = f_memory_array_increase_by(total, sizeof(f_string_dynamic_t), (void **) &sets[i]->buffers.array, &sets[i]->buffers.used, &sets[i]->buffers.size); - macro_setting_load_handle_send_receive_error_continue_1(f_string_dynamics_increase_by); + macro_setting_load_handle_send_receive_error_continue_1(f_memory_array_increase_by); main->setting.state.status = f_memory_array_increase_by(total, sizeof(f_fss_simple_packet_t), (void **) &sets[i]->packets.array, &sets[i]->packets.used, &sets[i]->packets.size); @@ -309,9 +309,9 @@ extern "C" { if (main->program.parameters.arguments.array[index].used) { if (f_path_is_absolute(main->program.parameters.arguments.array[index]) == F_true || f_path_is_relative_current(main->program.parameters.arguments.array[index]) == F_true) { - main->setting.state.status = f_string_dynamic_increase_by(main->program.parameters.arguments.array[index].used + 2, &sets[i]->names.array[j]); + main->setting.state.status = f_memory_array_increase_by(main->program.parameters.arguments.array[index].used + 2, sizeof(f_char_t), (void **) &sets[i]->names.array[j].string, &sets[i]->names.array[j].used, &sets[i]->names.array[j].size); - macro_setting_load_handle_send_receive_error_continue_2(f_string_dynamic_increase_by); + macro_setting_load_handle_send_receive_error_continue_2(f_memory_array_increase_by); main->setting.state.status = f_string_dynamic_append_nulless(main->program.parameters.arguments.array[index], &sets[i]->names.array[j]); @@ -403,9 +403,9 @@ extern "C" { continue; } - main->setting.state.status = f_string_dynamic_increase_by(INET6_ADDRSTRLEN + 1, &sets[i]->names.array[j]); + main->setting.state.status = f_memory_array_increase_by(INET6_ADDRSTRLEN + 1, sizeof(f_char_t), (void **) &sets[i]->names.array[j].string, &sets[i]->names.array[j].used, &sets[i]->names.array[j].size); - macro_setting_load_handle_send_receive_error_continue_2(f_string_dynamic_increase_by); + macro_setting_load_handle_send_receive_error_continue_2(f_memory_array_increase_by); // Randomly select one of the addresses when there are more than one. if (host.h_addr_list[1]) { @@ -421,9 +421,9 @@ extern "C" { k = 0; } - main->setting.state.status = f_string_dynamic_increase_by(INET6_ADDRSTRLEN + 1, &sets[i]->names.array[j]); + main->setting.state.status = f_memory_array_increase_by(INET6_ADDRSTRLEN + 1, sizeof(f_char_t), (void **) &sets[i]->names.array[j].string, &sets[i]->names.array[j].used, &sets[i]->names.array[j].size); - macro_setting_load_handle_send_receive_error_continue_2(f_string_dynamic_increase_by); + macro_setting_load_handle_send_receive_error_continue_2(f_memory_array_increase_by); if (host.h_addrtype == f_socket_address_family_inet4_e) { family.type = f_network_family_ip_4_e; diff --git a/sources/c/tacocat/main/common.h b/sources/c/tacocat/main/common.h index ed1cbc0..dc4011a 100644 --- a/sources/c/tacocat/main/common.h +++ b/sources/c/tacocat/main/common.h @@ -77,8 +77,6 @@ extern "C" { * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_network_from_ip_name(). * Errors (with error bit) from: f_string_dynamic_append_nulless(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). - * Errors (with error bit) from: f_string_dynamics_increase_by(). * * Errors (with error bit) from: main.callback.setting_load_send_receive(). * @@ -87,8 +85,6 @@ extern "C" { * @see f_memory_array_increase_by() * @see f_network_from_ip_name() * @see f_string_dynamic_append_nulless() - * @see f_string_dynamic_increase_by() - * @see f_string_dynamics_increase_by() */ #ifndef _di_kt_tacocat_setting_load_send_receive_ extern void kt_tacocat_setting_load_send_receive(const f_console_arguments_t arguments, void * const main); diff --git a/sources/c/tacocat/main/common/print.c b/sources/c/tacocat/main/common/print.c index 6704dac..4b06e39 100644 --- a/sources/c/tacocat/main/common/print.c +++ b/sources/c/tacocat/main/common/print.c @@ -25,8 +25,6 @@ extern "C" { "f_string_append_nulless", "f_string_dynamic_append", "f_string_dynamic_append_nulless", - "f_string_dynamic_increase_by", - "f_string_dynamics_increase_by", "f_thread_create", "fl_conversion_dynamic_to_unsigned_detect", "fll_program_parameter_process_context", diff --git a/sources/c/tacocat/main/common/print.h b/sources/c/tacocat/main/common/print.h index 338a0ba..b450f90 100644 --- a/sources/c/tacocat/main/common/print.h +++ b/sources/c/tacocat/main/common/print.h @@ -58,8 +58,6 @@ extern "C" { kt_tacocat_f_f_string_append_nulless_e, kt_tacocat_f_f_string_dynamic_append_e, kt_tacocat_f_f_string_dynamic_append_nulless_e, - kt_tacocat_f_f_string_dynamic_increase_by_e, - kt_tacocat_f_f_string_dynamics_increase_by_e, kt_tacocat_f_f_thread_create_e, kt_tacocat_f_fl_conversion_dynamic_to_unsigned_detect_e, kt_tacocat_f_fll_program_parameter_process_context_e, diff --git a/sources/c/tacocat/main/common/type.c b/sources/c/tacocat/main/common/type.c index 30adbcb..1a8a3dc 100644 --- a/sources/c/tacocat/main/common/type.c +++ b/sources/c/tacocat/main/common/type.c @@ -44,13 +44,13 @@ extern "C" { f_memory_array_resize(0, sizeof(f_socket_t), (void **) &sets[i]->sockets.array, &sets[i]->sockets.used, &sets[i]->sockets.size); f_memory_array_resize(0, sizeof(f_status_t), (void **) &sets[i]->statuss.array, &sets[i]->statuss.used, &sets[i]->statuss.size); - f_string_dynamics_resize(0, &sets[i]->names); - f_string_dynamics_resize(0, &sets[i]->buffers); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &sets[i]->names.array, &sets[i]->names.used, &sets[i]->names.size, &f_string_dynamics_delete_callback); + f_memory_arrays_resize(0, sizeof(f_string_dynamic_t), (void **) &sets[i]->buffers.array, &sets[i]->buffers.used, &sets[i]->buffers.size, &f_string_dynamics_delete_callback); f_memory_array_resize(0, sizeof(f_fss_simple_packet_range_t), (void **) &sets[i]->packets.array, &sets[i]->packets.used, &sets[i]->packets.size); } // for } - f_string_dynamic_resize(0, &setting->buffer); + f_memory_array_resize(0, sizeof(f_char_t), (void **) &setting->buffer.string, &setting->buffer.used, &setting->buffer.size); return F_okay; } diff --git a/sources/c/tacocat/main/print/error.c b/sources/c/tacocat/main/print/error.c index 414f542..6ccd7a5 100644 --- a/sources/c/tacocat/main/print/error.c +++ b/sources/c/tacocat/main/print/error.c @@ -37,9 +37,9 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QNetwork error on%] ", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, on, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, on, print->set->notable); fl_print_format(" %[for '%]", print->to, print->set->error, print->set->error, f_string_eol_s); - fl_print_format("%[%Q%]", print->to, print->set->notable, network, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, network, print->set->notable); fl_print_format(" %['.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -61,11 +61,11 @@ extern "C" { fl_print_format("%[%QThe parameter%] ", print->to, print->set->error, print->prefix, print->set->error); fl_print_format("%[%Q%Q%]", print->to, print->set->notable, f_console_symbol_long_normal_s, kt_tacocat_long_resolve_s, print->set->notable); fl_print_format(" %[may only be either '%]", print->to, print->set->error, print->set->error, f_string_eol_s); - fl_print_format("%[%Q%]", print->to, print->set->notable, kt_tacocat_classic_s, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, kt_tacocat_classic_s, print->set->notable); fl_print_format("%' or '%]", print->to, print->set->error, print->set->error, f_string_eol_s); - fl_print_format("%[%Q%]", print->to, print->set->notable, kt_tacocat_kevux_s, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, kt_tacocat_kevux_s, print->set->notable); fl_print_format(" %[' but '%]", print->to, print->set->error, print->set->error, f_string_eol_s); - fl_print_format("%[%Q%]", print->to, print->set->notable, unknown, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, unknown, print->set->notable); fl_print_format(" %[' is given.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); @@ -83,7 +83,7 @@ extern "C" { f_file_stream_lock(print->to); fl_print_format("%[%QThe lengths of all%] ", print->to, print->set->error, print->prefix, print->set->error); - fl_print_format("%[%Q%]", print->to, print->set->notable, name, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, name, print->set->notable); fl_print_format(" %[arrays do not have the same length, name array length is '%]", print->to, print->set->error, print->set->error, f_string_eol_s); fl_print_format("%[%ul%]", print->to, print->set->notable, set.names.used, print->set->notable); fl_print_format("%', the buffer array length is '%]", print->to, print->set->error, print->set->error, f_string_eol_s); @@ -113,7 +113,7 @@ extern "C" { fl_print_format("%[%QUnsupported protocol%] ", print->to, print->set->error, print->prefix, print->set->error); fl_print_format("%[%lu%]", print->to, print->set->notable, protocol, print->set->notable); fl_print_format(" %[while processing '%]", print->to, print->set->error, print->set->error, f_string_eol_s); - fl_print_format("%[%Q%]", print->to, print->set->notable, name, print->set->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, name, print->set->notable); fl_print_format(" %['.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); diff --git a/sources/c/tacocat/main/print/warning.c b/sources/c/tacocat/main/print/warning.c index cdcf3cb..fb76bdf 100644 --- a/sources/c/tacocat/main/print/warning.c +++ b/sources/c/tacocat/main/print/warning.c @@ -14,7 +14,7 @@ extern "C" { fl_print_format("%[%QThe port number '%]", print->to, print->context, print->prefix, print->context); fl_print_format("%[%ul%]", print->to, print->notable, port, print->notable); fl_print_format("%[' from the address '%]", print->to, print->context, print->context); - fl_print_format("%[%Q%]", print->to, print->notable, address, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, address, print->notable); fl_print_format("%['is too large for this system and so the port is being autodetermined.%]%r", print->to, print->context, print->context, f_string_eol_s); f_file_stream_unlock(print->to); diff --git a/sources/c/tacocat/main/receive.c b/sources/c/tacocat/main/receive.c index 34e50b7..605d00d 100644 --- a/sources/c/tacocat/main/receive.c +++ b/sources/c/tacocat/main/receive.c @@ -78,10 +78,10 @@ extern "C" { //if (poll->revents & f_poll_urgent_e) { // handle out of band, via f_socket_flag_out_of_band_e? - *status = f_string_dynamic_increase_by(socket->size_read, buffer); + *status = f_memory_array_increase_by(socket->size_read, sizeof(f_char_t), (void **) &buffer->string, &buffer->used, &buffer->size); if (F_status_is_error(*status)) { - kt_tacocat_print_error_on(&main->program.error, macro_kt_tacocat_f(f_string_dynamic_increase_by), kt_tacocat_receive_s, *name, *status); + kt_tacocat_print_error_on(&main->program.error, macro_kt_tacocat_f(f_memory_array_increase_by), kt_tacocat_receive_s, *name, *status); return; } @@ -93,10 +93,10 @@ extern "C" { buffer->used = 0; } - *status = f_string_dynamic_increase_by(socket->size_read, buffer); + *status = f_memory_array_increase_by(socket->size_read, sizeof(f_char_t), (void **) &buffer->string, &buffer->used, &buffer->size); if (F_status_is_error(*status)) { - kt_tacocat_print_error_on(&main->program.error, macro_kt_tacocat_f(f_string_dynamic_increase_by), kt_tacocat_receive_s, *name, *status); + kt_tacocat_print_error_on(&main->program.error, macro_kt_tacocat_f(f_memory_array_increase_by), kt_tacocat_receive_s, *name, *status); return; } -- 1.8.3.1