From: Fred T. Hamster Date: Sat, 7 Feb 2026 15:09:34 +0000 (-0500) Subject: working towards easier porting X-Git-Tag: 2.140.190^2~34 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=40c63239d2088cb132f94112b48656139d72731a;p=feisty_meow.git working towards easier porting updated the porting script, and now it mentions the actual product it's porting to (feisty meow). got break signal test app compiling and working now too. --- diff --git a/nucleus/library/tests_application/makefile b/nucleus/library/tests_application/makefile index d27e52f1..d5b4c23b 100644 --- a/nucleus/library/tests_application/makefile +++ b/nucleus/library/tests_application/makefile @@ -4,8 +4,9 @@ include cpp/variables.def PROJECT = tests_application TYPE = test -TARGETS = test_command_line.exe \ -#test_break_signal.exe test_byte_filer.exe +TARGETS = test_break_signal.exe test_command_line.exe + +#test_byte_filer.exe # test_directory.exe test_directory_tree.exe test_dirtree_fcopy.exe test_filename.exe \ # test_huge_file.exe test_ini_configurator.exe test_ini_parser.exe test_logger.exe \ # test_path_configuration.exe test_registry_configurator.exe test_redirection.exe \ diff --git a/nucleus/library/tests_application/test_break_signal.cpp b/nucleus/library/tests_application/test_break_signal.cpp index e835b3c2..5e8e4224 100644 --- a/nucleus/library/tests_application/test_break_signal.cpp +++ b/nucleus/library/tests_application/test_break_signal.cpp @@ -12,27 +12,45 @@ * Please send any updates to: fred@gruntose.com * \*****************************************************************************/ -#include +#include #include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include -#include +#include +#include +#include +#include +#include #include +//hmmm: much better if we had signal handling wrapped in a class instead of using bare calls to the OS signal library. #include +//hmmm: also a flush mechanism for i/o being inside feisty code would be better than this call to stdio. -#define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger(), s) + +using namespace application; +using namespace basis; +//using namespace configuration; +//using namespace filesystem; +using namespace loggers; +//using namespace structures; +//using namespace textual; +using namespace timely; +using namespace unit_test; + +#define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s) static bool _leave_now = false; -class test_break_signal : public application_shell +class test_break_signal : virtual public unit_base, virtual public application_shell { public: - test_break_signal() : application_shell(class_name()) {} - IMPLEMENT_CLASS_NAME("test_break_signal"); + test_break_signal() : application_shell() {} + DEFINE_CLASS_NAME("test_break_signal"); virtual int execute(); }; @@ -53,13 +71,13 @@ int test_break_signal::execute() LOG("starting loop--hit ctrl-C to exit or wait for timeout."); time_stamp leave_time(20 * SECOND_ms); while (!_leave_now && (time_stamp() < leave_time) ) { - portable::sleep_ms(20); + time_control::sleep_ms(20); } // we jump to here when catching the signal. - istring to_print("break_signal:: works for those functions tested."); - guards::alert_message(to_print.s()); - fflush(NIL); + astring to_print("break_signal:: works for those functions tested."); + critical_events::alert_message(to_print.s()); + fflush(NULL_POINTER); return 0; } diff --git a/scripts/buildor/upgrade_hoople_to_feistymeow.sh b/scripts/buildor/upgrade_hoople_to_feistymeow.sh new file mode 100644 index 00000000..f6d9a763 --- /dev/null +++ b/scripts/buildor/upgrade_hoople_to_feistymeow.sh @@ -0,0 +1,157 @@ +#!/usr/bin/env bash + +# this is a helper script for migrations of my own code. +# +# the original codebase was called hoople, i think? and then there was hoople 2, so the original became known +# as hoople 1. and then there was the yeti codebase, which was a newer name (and style) at the time. +# finally, the overarching megacorporation of feisty meow concerns ltd was born, and this subsumed all the +# older code. +# +# not all the original hoople features have been ported yet; some were some really gross windoze pieces. + +# state of this script: +# just rediscovered it and found it still really helps out in porting. got the command line tester working with it. +# that being said, there are still many improvements it could make, like: +# (top priority) +# + just doing the right names for things that have changed more recently. +# (lower priority) +# + auto-including header files. +# + auto-using the appropriate namespaces. + +# sentinel value that gets set to non-empty if we did any work of any sort. +did_anything= + +while true; do + + file="$1"; shift + if [ ! -f "$file" ]; then + if [ -z "$did_anything" ]; then + # we didn't do a thing here. just complain and bail. + echo " +$(basename $0): this script requires at least one filename on the +command line. the file will be ported to the newer feisty meow codebase +standards and usages." + exit 3 + fi + # if we already hit at least one file, then we can bow out now. + break + fi + + # we can safely say that we got a parameter and found it's a file, so now + # we can proceed to try to do something, and remember that we did. + did_anything=true + + tempfile="$(mktemp "$TMP/zz_temp_codefix.XXXXXX")" + +#echo temp file is $tempfile + + cat "$file" \ + | sed -e 's/command_line::__arg/application::__arg/g' \ + | sed -e 's/IMPLEMENT_CLASS_NAME/DEFINE_CLASS_NAME/g' \ + | sed -e 's/istring/astring/g' \ + | sed -e 's/byte_format\([^t]\)/byte_formatter\1/g' \ + | sed -e 's/isprintf/a_sprintf/g' \ + | sed -e 's/portable::sleep_ms/time_control::sleep_ms/g' \ + | sed -e 's/portable::env_string/environment::get/g' \ + | sed -e 's/portable::launch_process/launch_process::run/g' \ + | sed -e 's/portable::application_name/application_configuration::application_name/g' \ + | sed -e 's/portable::process_id/application_configuration::process_id/g' \ + | sed -e 's/log_base::platform_ending/parser_bits::platform_eol_to_chars/g' \ + | sed -e 's/ithread/ethread/g' \ + | sed -e 's/timed_object/timeable/g' \ + | sed -e 's/utility::timestamp(/time_stamp::notarize(/g' \ + | sed -e 's/anchor_window/hoople_service/g' \ + | sed -e 's/basis::attach/structures::attach/g' \ + | sed -e 's/basis::detach/structures::detach/g' \ + | sed -e 's/portable::system_error/critical_events::system_error/g' \ + | sed -e 's/basis::pack\([^a]\)/structures::pack_array\1/g' \ + | sed -e 's/basis::unpack/structures::unpack_array/g' \ + | sed -e 's/ *$//g' \ + | sed -e 's/^#include *$//g' \ + | sed -e 's/^#include *$//g' \ + | sed -e 's/^#include *$//g' \ + | sed -e 's/^#include *$//g' \ + | sed -e 's/class infoton_list;//g' \ + | sed -e 's/^#include "[_a-zA-Z0-9]*_dll.h" *$//g' \ + | sed -e 's/^#include "dll_[_a-zA-Z0-9]*.h" *$//g' \ + | sed -e 's/^#ifndef .*IMPLEMENTATION_FILE *$//g' \ + | sed -e 's/^#define .*IMPLEMENTATION_FILE *$//g' \ + | sed -e 's/^#endif .*IMPLEMENTATION_FILE *$//g' \ + | sed -e 's/convert_utf/utf_conversion/g' \ + | sed -e 's/mechanisms\/time_stamp/timely\/time_stamp/g' \ + | sed -e 's/mechanisms\/roller/structures\/roller/g' \ + | sed -e 's/mechanisms\/safe_roller/processes\/safe_roller/g' \ + | sed -e 's/basis.string_array/structures\/string_array/g' \ + | sed -e 's/opsystem.application_shell/application\/application_shell/g' \ + | sed -e 's/opsystem.filename/filesystem\/filename/g' \ + | sed -e 's/opsystem.heavy_file_ops/filesystem\/heavy_file_ops/g' \ + | sed -e 's/opsystem.huge_file/filesystem\/huge_file/g' \ + | sed -e 's/opsystem.application_base/application\/base_application/g' \ + | sed -e 's/opsystem.command_line/application\/command_line/g' \ + | sed -e 's/opsystem.directory/filesystem\/directory/g' \ + | sed -e 's/opsystem.rendezvous/application\/rendezvous/g' \ + | sed -e 's/opsystem.singleton_application/application\/singleton_application/g' \ + | sed -e 's/opsystem.timer_driver/timely\/timer_driver/g' \ + | sed -e 's/opsystem.ini_config/configuration\/ini_configurator/g' \ + | sed -e 's/opsystem.path_config/configuration\/application_config/g' \ + | sed -e 's/opsystem.byte_filer/filesystem\/byte_filer/g' \ + | sed -e 's/sockets.address/sockets\/internet_address/g' \ + | sed -e 's/path_configuration/application_configuration/g' \ + | sed -e 's/mechanisms.timer/timely\/stopwatch/g' \ + | sed -e 's/mechanisms.ethread/processes\/ethread/g' \ + | sed -e 's/mechanisms.safe_callback/processes\/safe_callback/g' \ + | sed -e 's/mechanisms.thread_cabinet/processes\/thread_cabinet/g' \ + | sed -e 's/basis.chaos/mathematics\/chaos/g' \ + | sed -e 's/[A-Z_][A-Z_]*CLASS_STYLE //g' \ + | sed -e 's/[A-Z_][A-Z_]*FUNCTION_STYLE //g' \ + | sed -e 's/\([^:]\)u_int/\1basis::u_int/g' \ + | sed -e 's/\([^:]\)u_short/\1basis::u_short/g' \ + | sed -e 's/class astring;/#include /g' \ + | sed -e 's/class int_set;/#include /g' \ + | sed -e 's/class int_roller;/#include /g' \ + | sed -e 's/class outcome;/#include /g' \ + | sed -e 's/class mutex;/#include /g' \ + | sed -e 's/class ethread;/#include /g' \ + | sed -e 's/class byte_filer;/#include /g' \ + | sed -e 's/class string_array;/#include /g' \ + | sed -e 's/class string_table;/#include /g' \ + | sed -e 's/class byte_array;/#include /g' \ + | sed -e 's/class string_set;/#include /g' \ + | sed -e 's/class time_stamp;/#include /g' \ + | sed -e 's/class directory_tree;/#include /g' \ + | sed -e 's/class filename_list;/#include /g' \ + | sed -e 's/class chaos;/#include /g' \ + | sed -e 's/class configurator;/#include /g' \ + | sed -e 's/class unique_int;/#include /g' \ + | sed -e 's/class tcpip_stack;/#include /g' \ + | sed -e 's/class safe_roller;/#include /g' \ + | sed -e 's/class blowfish_crypto;/#include /g' \ + | sed -e 's/class RSA_crypto;/#include /g' \ + | sed -e 's/class entity_data_bin;/#include /g' \ + | sed -e 's/class infoton;/#include /g' \ + | sed -e 's/class octopus_request_id;/#include /g' \ + | sed -e 's/class internet_address;/#include /g' \ + | sed -e 's/class machine_uid;/#include /g' \ + | sed -e 's/class spocket;/#include /g' \ + | sed -e 's/class encryption_tentacle;/#include /g' \ + | sed -e 's/class login_tentacle;/#include /g' \ + | sed -e 's/class thread_cabinet;/#include /g' \ + | sed -e 's/RSA_crypto/rsa_crypto/g' \ + | sed -e 's/float_plus/double_plus/g' \ + | sed -e 's/basis::obscure_/structures::obscure_/g' \ + | sed -e 's/program_wide_logger()/program_wide_logger::get()/g' \ + | sed -e 's/textual.tokenizer/configuration\/tokenizer/g' \ + | sed -e 's/\([^_]\)tokenizer/\1variable_tokenizer/g' \ + | sed -e 's/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/[\/]*/\/\/\/\/\/\/\/\/\/\/\/\/\/\//g' \ + >"$tempfile" + + mv "$tempfile" "$file" + +done + diff --git a/scripts/buildor/upgrade_hoople_to_yeti.sh b/scripts/buildor/upgrade_hoople_to_yeti.sh deleted file mode 100644 index 4c2d0002..00000000 --- a/scripts/buildor/upgrade_hoople_to_yeti.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/env bash - -file="$1"; shift -if [ ! -f "$file" ]; then - echo must pass filename on command line. - exit 3 -fi - -tempfile="$(mktemp "$TMP/zz_temp_codefix.XXXXXX")" - -#echo temp file is $tempfile - -cat "$file" \ - | sed -e 's/command_line::__arg/application::__arg/g' \ - | sed -e 's/IMPLEMENT_CLASS_NAME/DEFINE_CLASS_NAME/g' \ - | sed -e 's/istring/astring/g' \ - | sed -e 's/byte_format\([^t]\)/byte_formatter\1/g' \ - | sed -e 's/isprintf/a_sprintf/g' \ - | sed -e 's/portable::sleep_ms/time_control::sleep_ms/g' \ - | sed -e 's/portable::env_string/environment::get/g' \ - | sed -e 's/portable::launch_process/launch_process::run/g' \ - | sed -e 's/portable::application_name/application_configuration::application_name/g' \ - | sed -e 's/portable::process_id/application_configuration::process_id/g' \ - | sed -e 's/log_base::platform_ending/parser_bits::platform_eol_to_chars/g' \ - | sed -e 's/ithread/ethread/g' \ - | sed -e 's/timed_object/timeable/g' \ - | sed -e 's/utility::timestamp(/time_stamp::notarize(/g' \ - | sed -e 's/anchor_window/hoople_service/g' \ - | sed -e 's/basis::attach/structures::attach/g' \ - | sed -e 's/basis::detach/structures::detach/g' \ - | sed -e 's/portable::system_error/critical_events::system_error/g' \ - | sed -e 's/basis::pack\([^a]\)/structures::pack_array\1/g' \ - | sed -e 's/basis::unpack/structures::unpack_array/g' \ - | sed -e 's/ *$//g' \ - | sed -e 's/^#include *$//g' \ - | sed -e 's/^#include *$//g' \ - | sed -e 's/^#include *$//g' \ - | sed -e 's/^#include *$//g' \ - | sed -e 's/class infoton_list;//g' \ - | sed -e 's/^#include "[_a-zA-Z0-9]*_dll.h" *$//g' \ - | sed -e 's/^#include "dll_[_a-zA-Z0-9]*.h" *$//g' \ - | sed -e 's/^#ifndef .*IMPLEMENTATION_FILE *$//g' \ - | sed -e 's/^#define .*IMPLEMENTATION_FILE *$//g' \ - | sed -e 's/^#endif .*IMPLEMENTATION_FILE *$//g' \ - | sed -e 's/convert_utf/utf_conversion/g' \ - | sed -e 's/mechanisms\/time_stamp/timely\/time_stamp/g' \ - | sed -e 's/mechanisms\/roller/structures\/roller/g' \ - | sed -e 's/mechanisms\/safe_roller/processes\/safe_roller/g' \ - | sed -e 's/basis.string_array/structures\/string_array/g' \ - | sed -e 's/opsystem.application_shell/application\/application_shell/g' \ - | sed -e 's/opsystem.filename/filesystem\/filename/g' \ - | sed -e 's/opsystem.heavy_file_ops/filesystem\/heavy_file_ops/g' \ - | sed -e 's/opsystem.huge_file/filesystem\/huge_file/g' \ - | sed -e 's/opsystem.application_base/application\/base_application/g' \ - | sed -e 's/opsystem.command_line/application\/command_line/g' \ - | sed -e 's/opsystem.directory/filesystem\/directory/g' \ - | sed -e 's/opsystem.rendezvous/application\/rendezvous/g' \ - | sed -e 's/opsystem.singleton_application/application\/singleton_application/g' \ - | sed -e 's/opsystem.timer_driver/timely\/timer_driver/g' \ - | sed -e 's/opsystem.ini_config/configuration\/ini_configurator/g' \ - | sed -e 's/opsystem.path_config/configuration\/application_config/g' \ - | sed -e 's/opsystem.byte_filer/filesystem\/byte_filer/g' \ - | sed -e 's/sockets.address/sockets\/internet_address/g' \ - | sed -e 's/path_configuration/application_configuration/g' \ - | sed -e 's/mechanisms.timer/timely\/stopwatch/g' \ - | sed -e 's/mechanisms.ethread/processes\/ethread/g' \ - | sed -e 's/mechanisms.safe_callback/processes\/safe_callback/g' \ - | sed -e 's/mechanisms.thread_cabinet/processes\/thread_cabinet/g' \ - | sed -e 's/basis.chaos/mathematics\/chaos/g' \ - | sed -e 's/[A-Z_][A-Z_]*CLASS_STYLE //g' \ - | sed -e 's/[A-Z_][A-Z_]*FUNCTION_STYLE //g' \ - | sed -e 's/\([^:]\)u_int/\1basis::u_int/g' \ - | sed -e 's/\([^:]\)u_short/\1basis::u_short/g' \ - | sed -e 's/class astring;/#include /g' \ - | sed -e 's/class int_set;/#include /g' \ - | sed -e 's/class int_roller;/#include /g' \ - | sed -e 's/class outcome;/#include /g' \ - | sed -e 's/class mutex;/#include /g' \ - | sed -e 's/class ethread;/#include /g' \ - | sed -e 's/class byte_filer;/#include /g' \ - | sed -e 's/class string_array;/#include /g' \ - | sed -e 's/class string_table;/#include /g' \ - | sed -e 's/class byte_array;/#include /g' \ - | sed -e 's/class string_set;/#include /g' \ - | sed -e 's/class time_stamp;/#include /g' \ - | sed -e 's/class directory_tree;/#include /g' \ - | sed -e 's/class filename_list;/#include /g' \ - | sed -e 's/class chaos;/#include /g' \ - | sed -e 's/class configurator;/#include /g' \ - | sed -e 's/class unique_int;/#include /g' \ - | sed -e 's/class tcpip_stack;/#include /g' \ - | sed -e 's/class safe_roller;/#include /g' \ - | sed -e 's/class blowfish_crypto;/#include /g' \ - | sed -e 's/class RSA_crypto;/#include /g' \ - | sed -e 's/class entity_data_bin;/#include /g' \ - | sed -e 's/class infoton;/#include /g' \ - | sed -e 's/class octopus_request_id;/#include /g' \ - | sed -e 's/class internet_address;/#include /g' \ - | sed -e 's/class machine_uid;/#include /g' \ - | sed -e 's/class spocket;/#include /g' \ - | sed -e 's/class encryption_tentacle;/#include /g' \ - | sed -e 's/class login_tentacle;/#include /g' \ - | sed -e 's/class thread_cabinet;/#include /g' \ - | sed -e 's/RSA_crypto/rsa_crypto/g' \ - | sed -e 's/float_plus/double_plus/g' \ - | sed -e 's/basis::obscure_/structures::obscure_/g' \ - | sed -e 's/program_wide_logger()/program_wide_logger::get()/g' \ - | sed -e 's/textual.tokenizer/configuration\/tokenizer/g' \ - | sed -e 's/\([^_]\)tokenizer/\1variable_tokenizer/g' \ - | sed -e 's/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/[\/]*/\/\/\/\/\/\/\/\/\/\/\/\/\/\//g' \ - >"$tempfile" - -mv "$tempfile" "$file" - -