first check-in of feisty meow codebase. many things broken still due to recent
[feisty_meow.git] / scripts / buildor / upgrade_hoople.sh
1 #!/bin/bash
2
3 file="$1"; shift
4 if [ ! -f "$file" ]; then
5   echo must pass filename on command line.
6   exit 3
7 fi
8
9 tempfile="$(mktemp "$TMP/zz_temp_codefix.XXXXXX")"
10
11 #echo temp file is $tempfile
12
13 cat "$file" \
14   | sed -e 's/command_line::__arg/application::__arg/g' \
15   | sed -e 's/IMPLEMENT_CLASS_NAME/DEFINE_CLASS_NAME/g' \
16   | sed -e 's/istring/astring/g' \
17   | sed -e 's/byte_format\([^t]\)/byte_formatter\1/g' \
18   | sed -e 's/isprintf/a_sprintf/g' \
19   | sed -e 's/portable::sleep_ms/time_control::sleep_ms/g' \
20   | sed -e 's/portable::env_string/environment::get/g' \
21   | sed -e 's/portable::launch_process/launch_process::run/g' \
22   | sed -e 's/portable::application_name/application_configuration::application_name/g' \
23   | sed -e 's/portable::process_id/application_configuration::process_id/g' \
24   | sed -e 's/log_base::platform_ending/parser_bits::platform_eol_to_chars/g' \
25   | sed -e 's/ithread/ethread/g' \
26   | sed -e 's/timed_object/timeable/g' \
27   | sed -e 's/utility::timestamp(/time_stamp::notarize(/g' \
28   | sed -e 's/anchor_window/hoople_service/g' \
29   | sed -e 's/basis::attach/structures::attach/g' \
30   | sed -e 's/basis::detach/structures::detach/g' \
31   | sed -e 's/portable::system_error/critical_events::system_error/g' \
32   | sed -e 's/basis::pack\([^a]\)/structures::pack_array\1/g' \
33   | sed -e 's/basis::unpack/structures::unpack_array/g' \
34   | sed -e 's/<data_struct/<structures/g' \
35   | sed -e 's/<basis\/set/<structures\/set/g' \
36   | sed -e 's/basis::set/structures::set/g' \
37   | sed -e 's/<basis\/object_base/<basis\/contracts/g' \
38   | sed -e 's/object_base/root_object/g' \
39   | sed -e 's/<basis\/function.h/<basis\/functions.h/g' \
40   | sed -e 's/^#include <basis\/portable.h> *$//g' \
41   | sed -e 's/^#include <basis\/log_base.h> *$//g' \
42   | sed -e 's/^#include <basis\/utility.h> *$//g' \
43   | sed -e 's/^#include <basis\/packable.h> *$//g' \
44   | sed -e 's/^#include <basis\/auto_synch.h> *$//g' \
45   | sed -e 's/class infoton_list;//g' \
46   | sed -e 's/^#include "[_a-zA-Z0-9]*_dll.h" *$//g' \
47   | sed -e 's/^#include "dll_[_a-zA-Z0-9]*.h" *$//g' \
48   | sed -e 's/^#ifndef .*IMPLEMENTATION_FILE *$//g' \
49   | sed -e 's/^#define .*IMPLEMENTATION_FILE *$//g' \
50   | sed -e 's/^#endif .*IMPLEMENTATION_FILE *$//g' \
51   | sed -e 's/convert_utf/utf_conversion/g' \
52   | sed -e 's/mechanisms\/time_stamp/timely\/time_stamp/g' \
53   | sed -e 's/mechanisms\/roller/structures\/roller/g' \
54   | sed -e 's/mechanisms\/safe_roller/processes\/safe_roller/g' \
55   | sed -e 's/basis.string_array/structures\/string_array/g' \
56   | sed -e 's/opsystem.application_shell/application\/application_shell/g' \
57   | sed -e 's/opsystem.filename/filesystem\/filename/g' \
58   | sed -e 's/opsystem.heavy_file_ops/filesystem\/heavy_file_ops/g' \
59   | sed -e 's/opsystem.huge_file/filesystem\/huge_file/g' \
60   | sed -e 's/opsystem.application_base/application\/base_application/g' \
61   | sed -e 's/opsystem.command_line/application\/command_line/g' \
62   | sed -e 's/opsystem.directory/filesystem\/directory/g' \
63   | sed -e 's/opsystem.rendezvous/application\/rendezvous/g' \
64   | sed -e 's/opsystem.singleton_application/application\/singleton_application/g' \
65   | sed -e 's/opsystem.timer_driver/timely\/timer_driver/g' \
66   | sed -e 's/opsystem.ini_config/configuration\/ini_configurator/g' \
67   | sed -e 's/opsystem.path_config/configuration\/application_config/g' \
68   | sed -e 's/opsystem.byte_filer/filesystem\/byte_filer/g' \
69   | sed -e 's/sockets.address/sockets\/internet_address/g' \
70   | sed -e 's/path_configuration/application_configuration/g' \
71   | sed -e 's/mechanisms.timer/timely\/stopwatch/g' \
72   | sed -e 's/mechanisms.ethread/processes\/ethread/g' \
73   | sed -e 's/mechanisms.safe_callback/processes\/safe_callback/g' \
74   | sed -e 's/mechanisms.thread_cabinet/processes\/thread_cabinet/g' \
75   | sed -e 's/basis.chaos/mathematics\/chaos/g' \
76   | sed -e 's/[A-Z_][A-Z_]*CLASS_STYLE //g' \
77   | sed -e 's/[A-Z_][A-Z_]*FUNCTION_STYLE //g' \
78   | sed -e 's/\([^:]\)u_int/\1basis::u_int/g' \
79   | sed -e 's/\([^:]\)u_short/\1basis::u_short/g' \
80   | sed -e 's/class astring;/#include <basis\/astring.h>/g' \
81   | sed -e 's/class int_set;/#include <structures\/set.h>/g' \
82   | sed -e 's/class int_roller;/#include <structures\/roller.h>/g' \
83   | sed -e 's/class outcome;/#include <basis\/outcome.h>/g' \
84   | sed -e 's/class mutex;/#include <basis\/mutex.h>/g' \
85   | sed -e 's/class ethread;/#include <processes\/ethread.h>/g' \
86   | sed -e 's/class byte_filer;/#include <filesystem\/byte_filer.h>/g' \
87   | sed -e 's/class string_array;/#include <structures\/string_array.h>/g' \
88   | sed -e 's/class string_table;/#include <structures\/string_table.h>/g' \
89   | sed -e 's/class byte_array;/#include <basis\/byte_array.h>/g' \
90   | sed -e 's/class string_set;/#include <structures\/set.h>/g' \
91   | sed -e 's/class time_stamp;/#include <timely\/time_stamp.h>/g' \
92   | sed -e 's/class directory_tree;/#include <filesystem\/directory_tree.h>/g' \
93   | sed -e 's/class filename_list;/#include <filesystem\/filename_list.h>/g' \
94   | sed -e 's/class chaos;/#include <mathematics\/chaos.h>/g' \
95   | sed -e 's/class configurator;/#include <configuration\/configurator.h>/g' \
96   | sed -e 's/class unique_int;/#include <structures\/unique_id.h>/g' \
97   | sed -e 's/class tcpip_stack;/#include <sockets\/tcpip_stack.h>/g' \
98   | sed -e 's/class safe_roller;/#include <processes\/safe_roller.h>/g' \
99   | sed -e 's/class blowfish_crypto;/#include <crypto\/blowfish_crypto.h>/g' \
100   | sed -e 's/class RSA_crypto;/#include <crypto\/RSA_crypto.h>/g' \
101   | sed -e 's/class entity_data_bin;/#include <octopus\/entity_data_bin.h>/g' \
102   | sed -e 's/class infoton;/#include <octopus\/infoton.h>/g' \
103   | sed -e 's/class octopus_request_id;/#include <octopus\/entity_defs.h>/g' \
104   | sed -e 's/class internet_address;/#include <sockets\/internet_address.h>/g' \
105   | sed -e 's/class machine_uid;/#include <sockets\/machine_uid.h>/g' \
106   | sed -e 's/class spocket;/#include <sockets\/spocket.h>/g' \
107   | sed -e 's/class encryption_tentacle;/#include <tentacles\/encryption_tentacle.h>/g' \
108   | sed -e 's/class login_tentacle;/#include <tentacles\/login_tentacle.h>/g' \
109   | sed -e 's/class thread_cabinet;/#include <processes\/thread_cabinet.h>/g' \
110   | sed -e 's/RSA_crypto/rsa_crypto/g' \
111   | sed -e 's/float_plus<double>/double_plus/g' \
112   | sed -e 's/basis::obscure_/structures::obscure_/g' \
113   | sed -e 's/program_wide_logger()/program_wide_logger::get()/g' \
114   | sed -e 's/textual.tokenizer/configuration\/tokenizer/g' \
115   | sed -e 's/\([^_]\)tokenizer/\1variable_tokenizer/g' \
116   | sed -e 's/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/[\/]*/\/\/\/\/\/\/\/\/\/\/\/\/\/\//g' \
117   >"$tempfile"
118
119 mv "$tempfile" "$file"
120
121