Commit a1854e26de923b95fe0eababf0cb5cd7584b0af5
1 parent
7ac04a10
Exists in
master
and in
3 other branches
Limpando códigos antigos e não mais usados
Showing
10 changed files
with
210 additions
and
198 deletions
Show diff stats
actions.c
appres.h
| @@ -107,7 +107,7 @@ typedef struct { | @@ -107,7 +107,7 @@ typedef struct { | ||
| 107 | */ | 107 | */ |
| 108 | #if defined(X3270_DISPLAY) || defined(C3270) | 108 | #if defined(X3270_DISPLAY) || defined(C3270) |
| 109 | // char *key_map; | 109 | // char *key_map; |
| 110 | - char *compose_map; | 110 | +// char *compose_map; |
| 111 | // char *printer_lu; | 111 | // char *printer_lu; |
| 112 | #endif | 112 | #endif |
| 113 | /* | 113 | /* |
| @@ -136,30 +136,31 @@ typedef struct { | @@ -136,30 +136,31 @@ typedef struct { | ||
| 136 | #endif | 136 | #endif |
| 137 | #endif | 137 | #endif |
| 138 | */ | 138 | */ |
| 139 | -#if defined(X3270_DBCS) /*[*/ | ||
| 140 | - char *local_encoding; | ||
| 141 | -#endif /*]*/ | 139 | +//#if defined(X3270_DBCS) |
| 140 | +// char *local_encoding; | ||
| 141 | +//#endif | ||
| 142 | + | ||
| 142 | #if defined(C3270) /*[*/ | 143 | #if defined(C3270) /*[*/ |
| 143 | - char *meta_escape; | ||
| 144 | - char *all_bold; | 144 | +// char *meta_escape; |
| 145 | +// char *all_bold; | ||
| 145 | // char *altscreen; | 146 | // char *altscreen; |
| 146 | // char *defscreen; | 147 | // char *defscreen; |
| 147 | #endif /*]*/ | 148 | #endif /*]*/ |
| 148 | - char *conf_dir; | 149 | +// char *conf_dir; |
| 149 | char *model; | 150 | char *model; |
| 150 | // char *hostsfile; | 151 | // char *hostsfile; |
| 151 | // char *port; | 152 | // char *port; |
| 152 | // char *charset; | 153 | // char *charset; |
| 153 | // char *termname; | 154 | // char *termname; |
| 154 | // char *login_macro; | 155 | // char *login_macro; |
| 155 | - char *macros; | 156 | +// char *macros; |
| 156 | #if defined(X3270_TRACE) /*[*/ | 157 | #if defined(X3270_TRACE) /*[*/ |
| 157 | -#if !defined(_WIN32) /*[*/ | ||
| 158 | - char *trace_dir; | ||
| 159 | -#endif /*]*/ | ||
| 160 | - char *trace_file; | ||
| 161 | - char *screentrace_file; | ||
| 162 | - char *trace_file_size; | 158 | +//#if !defined(_WIN32) |
| 159 | +// char *trace_dir; | ||
| 160 | +//#endif | ||
| 161 | +// char *trace_file; | ||
| 162 | +// char *screentrace_file; | ||
| 163 | +// char *trace_file_size; | ||
| 163 | /* | 164 | /* |
| 164 | #if defined(X3270_DISPLAY) || defined(WC3270) | 165 | #if defined(X3270_DISPLAY) || defined(WC3270) |
| 165 | char trace_monitor; | 166 | char trace_monitor; |
| @@ -169,13 +170,13 @@ typedef struct { | @@ -169,13 +170,13 @@ typedef struct { | ||
| 169 | #endif /*]*/ | 170 | #endif /*]*/ |
| 170 | // char *oversize; | 171 | // char *oversize; |
| 171 | #if defined(X3270_FT) /*[*/ | 172 | #if defined(X3270_FT) /*[*/ |
| 172 | - char *ft_command; | 173 | +// char *ft_command; |
| 173 | int dft_buffer_size; | 174 | int dft_buffer_size; |
| 174 | #endif /*]*/ | 175 | #endif /*]*/ |
| 175 | - char *connectfile_name; | ||
| 176 | - char *idle_command; | ||
| 177 | - char idle_command_enabled; | ||
| 178 | - char *idle_timeout; | 176 | +// char *connectfile_name; |
| 177 | +// char *idle_command; | ||
| 178 | +// char idle_command_enabled; | ||
| 179 | +// char *idle_timeout; | ||
| 179 | 180 | ||
| 180 | /* | 181 | /* |
| 181 | #if defined(X3270_SCRIPT) | 182 | #if defined(X3270_SCRIPT) |
| @@ -86,7 +86,7 @@ Boolean remap_flag = True; // Remap ASCII<->EBCDIC | @@ -86,7 +86,7 @@ Boolean remap_flag = True; // Remap ASCII<->EBCDIC | ||
| 86 | unsigned long ft_length = 0; // Length of transfer | 86 | unsigned long ft_length = 0; // Length of transfer |
| 87 | static Boolean ft_is_cut; // File transfer is CUT-style | 87 | static Boolean ft_is_cut; // File transfer is CUT-style |
| 88 | 88 | ||
| 89 | -static struct timeval starting_time; // Starting time | 89 | +// static struct timeval starting_time; // Starting time |
| 90 | 90 | ||
| 91 | // static const struct filetransfer_callbacks *callbacks = NULL; // Callbacks to main application | 91 | // static const struct filetransfer_callbacks *callbacks = NULL; // Callbacks to main application |
| 92 | 92 | ||
| @@ -193,7 +193,7 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); | @@ -193,7 +193,7 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); | ||
| 193 | { | 193 | { |
| 194 | H3270FT * ftHandle = NULL; | 194 | H3270FT * ftHandle = NULL; |
| 195 | FILE * ft_local_file = NULL; | 195 | FILE * ft_local_file = NULL; |
| 196 | - unsigned long ft_length = 0L; | 196 | +// unsigned long length = 0L; |
| 197 | 197 | ||
| 198 | // trace("%s(%s)",__FUNCTION__,local); | 198 | // trace("%s(%s)",__FUNCTION__,local); |
| 199 | if(!lib3270_connected(session)) | 199 | if(!lib3270_connected(session)) |
| @@ -248,7 +248,6 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); | @@ -248,7 +248,6 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); | ||
| 248 | ftHandle->host = session; | 248 | ftHandle->host = session; |
| 249 | ftHandle->flags = flags; | 249 | ftHandle->flags = flags; |
| 250 | ftHandle->local_file = ft_local_file; | 250 | ftHandle->local_file = ft_local_file; |
| 251 | - ftHandle->length = ft_length; | ||
| 252 | ftHandle->state = LIB3270_FT_STATE_AWAIT_ACK; | 251 | ftHandle->state = LIB3270_FT_STATE_AWAIT_ACK; |
| 253 | ftHandle->complete = def_complete; | 252 | ftHandle->complete = def_complete; |
| 254 | ftHandle->message = def_message; | 253 | ftHandle->message = def_message; |
| @@ -306,9 +305,10 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); | @@ -306,9 +305,10 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); | ||
| 306 | return errno ? errno : -1; | 305 | return errno ? errno : -1; |
| 307 | } | 306 | } |
| 308 | 307 | ||
| 309 | - ft_length = ftell(ft->local_file); | 308 | + ft->length = ftell(ft->local_file); |
| 310 | 309 | ||
| 311 | - lib3270_write_log(ft->host,"ft","Sending file %s (%ld bytes)",ft->local,ft_length); | 310 | + |
| 311 | + lib3270_write_log(ft->host,"ft","Sending file %s (%ld bytes)",ft->local,ft->length); | ||
| 312 | rewind(ft->local_file); | 312 | rewind(ft->local_file); |
| 313 | } | 313 | } |
| 314 | 314 | ||
| @@ -414,8 +414,8 @@ void ft_complete(H3270FT *session, const char *errmsg) | @@ -414,8 +414,8 @@ void ft_complete(H3270FT *session, const char *errmsg) | ||
| 414 | 414 | ||
| 415 | (void) gettimeofday(&t1, (struct timezone *)NULL); | 415 | (void) gettimeofday(&t1, (struct timezone *)NULL); |
| 416 | kbytes_sec = (double)ft_length / 1024.0 / | 416 | kbytes_sec = (double)ft_length / 1024.0 / |
| 417 | - ((double)(t1.tv_sec - starting_time.tv_sec) + | ||
| 418 | - (double)(t1.tv_usec - starting_time.tv_usec) / 1.0e6); | 417 | + ((double)(t1.tv_sec - session->starting_time.tv_sec) + |
| 418 | + (double)(t1.tv_usec - session->starting_time.tv_usec) / 1.0e6); | ||
| 419 | 419 | ||
| 420 | // Close the local file. | 420 | // Close the local file. |
| 421 | if(session->local_file) | 421 | if(session->local_file) |
| @@ -470,8 +470,8 @@ void ft_update_length(H3270FT *session) | @@ -470,8 +470,8 @@ void ft_update_length(H3270FT *session) | ||
| 470 | 470 | ||
| 471 | (void) gettimeofday(&t1, (struct timezone *)NULL); | 471 | (void) gettimeofday(&t1, (struct timezone *)NULL); |
| 472 | kbytes_sec = (double)ft_length / 1024.0 / | 472 | kbytes_sec = (double)ft_length / 1024.0 / |
| 473 | - ((double)(t1.tv_sec - starting_time.tv_sec) + | ||
| 474 | - (double)(t1.tv_usec - starting_time.tv_usec) / 1.0e6); | 473 | + ((double)(t1.tv_sec - session->starting_time.tv_sec) + |
| 474 | + (double)(t1.tv_usec - session->starting_time.tv_usec) / 1.0e6); | ||
| 475 | } | 475 | } |
| 476 | 476 | ||
| 477 | session->update(session,ft_length,session->length,kbytes_sec); | 477 | session->update(session,ft_length,session->length,kbytes_sec); |
| @@ -486,7 +486,7 @@ void ft_running(H3270FT *h, Boolean is_cut) | @@ -486,7 +486,7 @@ void ft_running(H3270FT *h, Boolean is_cut) | ||
| 486 | ft_is_cut = is_cut; | 486 | ft_is_cut = is_cut; |
| 487 | ft_length = 0; | 487 | ft_length = 0; |
| 488 | 488 | ||
| 489 | - (void) gettimeofday(&starting_time, (struct timezone *)NULL); | 489 | + gettimeofday(&h->starting_time, (struct timezone *)NULL); |
| 490 | 490 | ||
| 491 | if (h->state == FT_AWAIT_ACK) | 491 | if (h->state == FT_AWAIT_ACK) |
| 492 | set_ft_state(h,FT_RUNNING); | 492 | set_ft_state(h,FT_RUNNING); |
globals.h
| @@ -158,7 +158,7 @@ LIB3270_INTERNAL const char * build_rpq_timestamp; | @@ -158,7 +158,7 @@ LIB3270_INTERNAL const char * build_rpq_timestamp; | ||
| 158 | LIB3270_INTERNAL const char * build_rpq_version; | 158 | LIB3270_INTERNAL const char * build_rpq_version; |
| 159 | LIB3270_INTERNAL const char * build_rpq_revision; | 159 | LIB3270_INTERNAL const char * build_rpq_revision; |
| 160 | 160 | ||
| 161 | -LIB3270_INTERNAL int children; | 161 | +// LIB3270_INTERNAL int children; |
| 162 | 162 | ||
| 163 | #if defined(X3270_DBCS) /*[*/ | 163 | #if defined(X3270_DBCS) /*[*/ |
| 164 | LIB3270_INTERNAL Boolean dbcs; | 164 | LIB3270_INTERNAL Boolean dbcs; |
| @@ -170,7 +170,7 @@ LIB3270_INTERNAL int children; | @@ -170,7 +170,7 @@ LIB3270_INTERNAL int children; | ||
| 170 | 170 | ||
| 171 | // LIB3270_INTERNAL char *efontname; | 171 | // LIB3270_INTERNAL char *efontname; |
| 172 | LIB3270_INTERNAL Boolean ever_3270; | 172 | LIB3270_INTERNAL Boolean ever_3270; |
| 173 | -LIB3270_INTERNAL Boolean exiting; | 173 | +// LIB3270_INTERNAL Boolean exiting; |
| 174 | 174 | ||
| 175 | /* | 175 | /* |
| 176 | #if defined(X3270_DISPLAY) | 176 | #if defined(X3270_DISPLAY) |
| @@ -192,7 +192,7 @@ LIB3270_INTERNAL Boolean exiting; | @@ -192,7 +192,7 @@ LIB3270_INTERNAL Boolean exiting; | ||
| 192 | //LIB3270_INTERNAL char *hostname; | 192 | //LIB3270_INTERNAL char *hostname; |
| 193 | 193 | ||
| 194 | #if defined(X3270_DBCS) /*[*/ | 194 | #if defined(X3270_DBCS) /*[*/ |
| 195 | - LIB3270_INTERNAL char *local_encoding; | 195 | +// LIB3270_INTERNAL char *local_encoding; |
| 196 | 196 | ||
| 197 | #if defined(X3270_DISPLAY) /*[*/ | 197 | #if defined(X3270_DISPLAY) /*[*/ |
| 198 | LIB3270_INTERNAL char *locale_name; | 198 | LIB3270_INTERNAL char *locale_name; |
glue.c
| @@ -49,6 +49,7 @@ | @@ -49,6 +49,7 @@ | ||
| 49 | 49 | ||
| 50 | #include <signal.h> | 50 | #include <signal.h> |
| 51 | #include <errno.h> | 51 | #include <errno.h> |
| 52 | +#include <stdarg.h> | ||
| 52 | 53 | ||
| 53 | #include "appres.h" | 54 | #include "appres.h" |
| 54 | #include "3270ds.h" | 55 | #include "3270ds.h" |
| @@ -100,15 +101,15 @@ | @@ -100,15 +101,15 @@ | ||
| 100 | #define LAST_ARG "--" | 101 | #define LAST_ARG "--" |
| 101 | 102 | ||
| 102 | /*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/ | 103 | /*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/ |
| 103 | - const char * programname; | 104 | +// const char * programname; |
| 104 | AppRes appres; | 105 | AppRes appres; |
| 105 | - int children = 0; | ||
| 106 | - Boolean exiting = False; | 106 | +// int children = 0; |
| 107 | +// Boolean exiting = False; | ||
| 107 | // char * command_string = CN; | 108 | // char * command_string = CN; |
| 108 | 109 | ||
| 109 | -#if defined(WC3270) || defined(LIB3270)/*[*/ | ||
| 110 | -char *profile_name = CN; | ||
| 111 | -#endif /*]*/ | 110 | +// #if defined(WC3270) || defined(LIB3270) |
| 111 | +// char *profile_name = CN; | ||
| 112 | +// #endif | ||
| 112 | 113 | ||
| 113 | /* | 114 | /* |
| 114 | * Set default options | 115 | * Set default options |
| @@ -163,9 +164,9 @@ static void initialize(void) | @@ -163,9 +164,9 @@ static void initialize(void) | ||
| 163 | // appres.typeahead = True; | 164 | // appres.typeahead = True; |
| 164 | appres.debug_tracing = True; | 165 | appres.debug_tracing = True; |
| 165 | 166 | ||
| 166 | -#if defined(C3270) /*[*/ | ||
| 167 | - appres.compose_map = "latin1"; | ||
| 168 | -#endif /*]*/ | 167 | +//#if defined(C3270) |
| 168 | +// appres.compose_map = "latin1"; | ||
| 169 | +//#endif | ||
| 169 | 170 | ||
| 170 | appres.model = ""; | 171 | appres.model = ""; |
| 171 | // appres.hostsfile = CN; | 172 | // appres.hostsfile = CN; |
| @@ -182,13 +183,15 @@ static void initialize(void) | @@ -182,13 +183,15 @@ static void initialize(void) | ||
| 182 | //#endif /*]*/ | 183 | //#endif /*]*/ |
| 183 | 184 | ||
| 184 | // appres.termname = CN; | 185 | // appres.termname = CN; |
| 185 | - appres.macros = CN; | 186 | +// appres.macros = CN; |
| 186 | 187 | ||
| 187 | #if defined(X3270_TRACE) /*[*/ | 188 | #if defined(X3270_TRACE) /*[*/ |
| 188 | 189 | ||
| 189 | -#if !defined(_WIN32) /*[*/ | 190 | +/* |
| 191 | +#if !defined(_WIN32) | ||
| 190 | appres.trace_dir = "/tmp"; | 192 | appres.trace_dir = "/tmp"; |
| 191 | -#endif /*]*/ | 193 | +#endif |
| 194 | +*/ | ||
| 192 | 195 | ||
| 193 | /* | 196 | /* |
| 194 | #if defined(X3270_DISPLAY) || defined(WC3270) | 197 | #if defined(X3270_DISPLAY) || defined(WC3270) |
| @@ -201,7 +204,7 @@ static void initialize(void) | @@ -201,7 +204,7 @@ static void initialize(void) | ||
| 201 | // appres.oversize = CN; | 204 | // appres.oversize = CN; |
| 202 | 205 | ||
| 203 | #if defined(C3270) /*[*/ | 206 | #if defined(C3270) /*[*/ |
| 204 | - appres.meta_escape = "auto"; | 207 | +// appres.meta_escape = "auto"; |
| 205 | // appres.curses_keypad = True; | 208 | // appres.curses_keypad = True; |
| 206 | // appres.cbreak_mode = False; | 209 | // appres.cbreak_mode = False; |
| 207 | #endif /*]*/ | 210 | #endif /*]*/ |
| @@ -291,79 +294,84 @@ int lib3270_unloaded(void) | @@ -291,79 +294,84 @@ int lib3270_unloaded(void) | ||
| 291 | #define offset(n) (void *) &appres.n | 294 | #define offset(n) (void *) &appres.n |
| 292 | #define toggle_offset(index) offset(toggle[index].value) | 295 | #define toggle_offset(index) offset(toggle[index].value) |
| 293 | 296 | ||
| 297 | +/* | ||
| 298 | + | ||
| 294 | static const struct lib3270_option options[] = | 299 | static const struct lib3270_option options[] = |
| 295 | { | 300 | { |
| 296 | // TODO (perry#5#): Add option descriptions. | 301 | // TODO (perry#5#): Add option descriptions. |
| 297 | -//#if defined(C3270) /*[*/ | 302 | +//#if defined(C3270) |
| 298 | // { OptAllBold, OPT_BOOLEAN, True, ResAllBold, offset(all_bold_on), NULL }, | 303 | // { OptAllBold, OPT_BOOLEAN, True, ResAllBold, offset(all_bold_on), NULL }, |
| 299 | // { OptAltScreen,OPT_STRING, False, ResAltScreen, offset(altscreen), NULL }, | 304 | // { OptAltScreen,OPT_STRING, False, ResAltScreen, offset(altscreen), NULL }, |
| 300 | -//#endif /*]*/ | 305 | +//#endif |
| 301 | // { OptAplMode, OPT_BOOLEAN, True, ResAplMode, offset(apl_mode), NULL }, | 306 | // { OptAplMode, OPT_BOOLEAN, True, ResAplMode, offset(apl_mode), NULL }, |
| 302 | -#if defined(C3270) /*[*/ | 307 | +#if defined(C3270) |
| 303 | // { OptCbreak, OPT_BOOLEAN, True, ResCbreak, offset(cbreak_mode), NULL }, | 308 | // { OptCbreak, OPT_BOOLEAN, True, ResCbreak, offset(cbreak_mode), NULL }, |
| 304 | -#endif /*]*/ | ||
| 305 | -#if defined(HAVE_LIBSSL) /*[*/ | 309 | +#endif |
| 310 | +#if defined(HAVE_LIBSSL) | ||
| 306 | { OptCertFile, OPT_STRING, False, ResCertFile, offset(cert_file), NULL }, | 311 | { OptCertFile, OPT_STRING, False, ResCertFile, offset(cert_file), NULL }, |
| 307 | -#endif /*]*/ | 312 | +#endif |
| 308 | // { OptCharset, OPT_STRING, False, ResCharset, offset(charset), NULL }, | 313 | // { OptCharset, OPT_STRING, False, ResCharset, offset(charset), NULL }, |
| 309 | { OptClear, OPT_SKIP2, False, NULL, NULL, NULL }, | 314 | { OptClear, OPT_SKIP2, False, NULL, NULL, NULL }, |
| 310 | // { OptDefScreen,OPT_STRING, False, ResDefScreen, offset(defscreen), NULL }, | 315 | // { OptDefScreen,OPT_STRING, False, ResDefScreen, offset(defscreen), NULL }, |
| 311 | //#if defined(X3270_TRACE) | 316 | //#if defined(X3270_TRACE) |
| 312 | // { OptDsTrace, OPT_BOOLEAN, True, ResDsTrace, toggle_offset(DS_TRACE), NULL }, | 317 | // { OptDsTrace, OPT_BOOLEAN, True, ResDsTrace, toggle_offset(DS_TRACE), NULL }, |
| 313 | -//#endif /*]*/ | 318 | +//#endif |
| 314 | // { OptHostsFile,OPT_STRING, False, ResHostsFile, offset(hostsfile), NULL }, | 319 | // { OptHostsFile,OPT_STRING, False, ResHostsFile, offset(hostsfile), NULL }, |
| 315 | //#if defined(C3270) | 320 | //#if defined(C3270) |
| 316 | // { OptKeymap, OPT_STRING, False, ResKeymap, offset(key_map), N_( "Specifies a keymap name and optional modifiers." ) }, | 321 | // { OptKeymap, OPT_STRING, False, ResKeymap, offset(key_map), N_( "Specifies a keymap name and optional modifiers." ) }, |
| 317 | // #endif | 322 | // #endif |
| 318 | 323 | ||
| 319 | -// #if defined(X3270_DBCS) /*[*/ | 324 | +// #if defined(X3270_DBCS) |
| 320 | // { OptLocalEncoding,OPT_STRING,False,ResLocalEncoding,offset(local_encoding), NULL }, | 325 | // { OptLocalEncoding,OPT_STRING,False,ResLocalEncoding,offset(local_encoding), NULL }, |
| 321 | -//#endif /*]*/ | ||
| 322 | - { OptModel, OPT_STRING, False, ResKeymap, offset(model), N_( "Set terminal model (screen size)" ) }, | ||
| 323 | -// #if !defined(_WIN32) /*[*/ | 326 | +//#endif |
| 327 | +// { OptModel, OPT_STRING, False, ResKeymap, offset(model), N_( "Set terminal model (screen size)" ) }, | ||
| 328 | +// #if !defined(_WIN32) | ||
| 324 | // { OptMono, OPT_BOOLEAN, True, ResMono, offset(mono), N_( "Forces monochrome display" ) }, | 329 | // { OptMono, OPT_BOOLEAN, True, ResMono, offset(mono), N_( "Forces monochrome display" ) }, |
| 325 | -// #endif /*]*/ | 330 | +// #endif |
| 326 | // { OptOnce, OPT_BOOLEAN, True, ResOnce, offset(once), NULL }, | 331 | // { OptOnce, OPT_BOOLEAN, True, ResOnce, offset(once), NULL }, |
| 327 | // { OptOversize, OPT_STRING, False, ResOversize, offset(oversize), N_( "Sets the screen dimensions to be larger than the default for the chosen model (COLSxROWS)." ) }, | 332 | // { OptOversize, OPT_STRING, False, ResOversize, offset(oversize), N_( "Sets the screen dimensions to be larger than the default for the chosen model (COLSxROWS)." ) }, |
| 328 | // { OptPort, OPT_STRING, False, ResPort, offset(port), N_( "The name of the default TCP port to connect" ) }, | 333 | // { OptPort, OPT_STRING, False, ResPort, offset(port), N_( "The name of the default TCP port to connect" ) }, |
| 329 | -#if defined(C3270) && !defined(LIB3270) /*[*/ | 334 | +#if defined(C3270) && !defined(LIB3270) |
| 330 | // { OptPrinterLu,OPT_STRING, False, ResPrinterLu, offset(printer_lu), NULL }, | 335 | // { OptPrinterLu,OPT_STRING, False, ResPrinterLu, offset(printer_lu), NULL }, |
| 331 | -#endif /*]*/ | 336 | +#endif |
| 332 | // { OptProxy, OPT_STRING, False, ResProxy, offset(proxy), N_( "Proxy server (type:host[:port])" ) }, | 337 | // { OptProxy, OPT_STRING, False, ResProxy, offset(proxy), N_( "Proxy server (type:host[:port])" ) }, |
| 333 | -#if defined(S3270) /*[*/ | 338 | +#if defined(S3270) |
| 334 | { OptScripted, OPT_NOP, False, ResScripted, NULL, NULL }, | 339 | { OptScripted, OPT_NOP, False, ResScripted, NULL, NULL }, |
| 335 | -#endif /*]*/ | ||
| 336 | -//#if defined(C3270) /*[*/ | 340 | +#endif |
| 341 | +//#if defined(C3270) | ||
| 337 | // { OptSecure, OPT_BOOLEAN, True, ResSecure, offset(secure), NULL }, | 342 | // { OptSecure, OPT_BOOLEAN, True, ResSecure, offset(secure), NULL }, |
| 338 | -//#endif /*]*/ | ||
| 339 | - { OptSet, OPT_SKIP2, False, NULL, NULL, NULL }, | ||
| 340 | -#if defined(X3270_SCRIPT) /*[*/ | ||
| 341 | - { OptSocket, OPT_BOOLEAN, True, ResSocket, offset(socket), NULL }, | ||
| 342 | -#endif /*]*/ | 343 | +//#endif |
| 344 | +// { OptSet, OPT_SKIP2, False, NULL, NULL, NULL }, | ||
| 345 | +#if defined(X3270_SCRIPT) | ||
| 346 | +// { OptSocket, OPT_BOOLEAN, True, ResSocket, offset(socket), NULL }, | ||
| 347 | +#endif | ||
| 343 | 348 | ||
| 344 | // { OptTermName, OPT_STRING, False, ResTermName, offset(termname), N_( "Specifies the terminal name to be transmitted over the telnet connection." ) }, | 349 | // { OptTermName, OPT_STRING, False, ResTermName, offset(termname), N_( "Specifies the terminal name to be transmitted over the telnet connection." ) }, |
| 345 | 350 | ||
| 346 | -#if defined(WC3270) /*[*/ | ||
| 347 | - { OptTitle, OPT_STRING, False, ResTitle, offset(title), NULL }, | ||
| 348 | -#endif /*]*/ | ||
| 349 | -#if defined(X3270_TRACE) /*[*/ | ||
| 350 | - { OptTraceFile,OPT_STRING, False, ResTraceFile, offset(trace_file), NULL }, | ||
| 351 | - { OptTraceFileSize,OPT_STRING,False,ResTraceFileSize,offset(trace_file_size), NULL }, | ||
| 352 | -#endif /*]*/ | 351 | +#if defined(WC3270) |
| 352 | +// { OptTitle, OPT_STRING, False, ResTitle, offset(title), NULL }, | ||
| 353 | +#endif | ||
| 354 | +#if defined(X3270_TRACE) | ||
| 355 | +// { OptTraceFile,OPT_STRING, False, ResTraceFile, offset(trace_file), NULL }, | ||
| 356 | +// { OptTraceFileSize,OPT_STRING,False,ResTraceFileSize,offset(trace_file_size), NULL }, | ||
| 357 | +#endif | ||
| 353 | { "-xrm", OPT_XRM, False, NULL, NULL, NULL }, | 358 | { "-xrm", OPT_XRM, False, NULL, NULL, NULL }, |
| 354 | { LAST_ARG, OPT_DONE, False, NULL, NULL, NULL }, | 359 | { LAST_ARG, OPT_DONE, False, NULL, NULL, NULL }, |
| 355 | { CN, OPT_SKIP2, False, NULL, NULL, NULL } | 360 | { CN, OPT_SKIP2, False, NULL, NULL, NULL } |
| 356 | }; | 361 | }; |
| 362 | +*/ | ||
| 357 | 363 | ||
| 358 | /* | 364 | /* |
| 359 | * Get library option table | 365 | * Get library option table |
| 360 | */ | 366 | */ |
| 367 | + /* | ||
| 361 | const struct lib3270_option * get_3270_option_table(int sz) | 368 | const struct lib3270_option * get_3270_option_table(int sz) |
| 362 | { | 369 | { |
| 363 | if(sz == sizeof(struct lib3270_option)) | 370 | if(sz == sizeof(struct lib3270_option)) |
| 364 | return options; | 371 | return options; |
| 365 | return NULL; | 372 | return NULL; |
| 366 | } | 373 | } |
| 374 | +*/ | ||
| 367 | 375 | ||
| 368 | /* | 376 | /* |
| 369 | * Parse '-xrm' options. | 377 | * Parse '-xrm' options. |
| @@ -371,110 +379,111 @@ const struct lib3270_option * get_3270_option_table(int sz) | @@ -371,110 +379,111 @@ const struct lib3270_option * get_3270_option_table(int sz) | ||
| 371 | * {c,s,tcl}3270.<resourcename>: value | 379 | * {c,s,tcl}3270.<resourcename>: value |
| 372 | * Asterisks and class names need not apply. | 380 | * Asterisks and class names need not apply. |
| 373 | */ | 381 | */ |
| 374 | - | 382 | +/* |
| 375 | static struct { | 383 | static struct { |
| 376 | const char *name; | 384 | const char *name; |
| 377 | void *address; | 385 | void *address; |
| 378 | enum resource_type { XRM_STRING, XRM_BOOLEAN, XRM_INT } type; | 386 | enum resource_type { XRM_STRING, XRM_BOOLEAN, XRM_INT } type; |
| 379 | } resources[] = { | 387 | } resources[] = { |
| 380 | - { ResAllBold, offset(all_bold), XRM_STRING }, | 388 | +// { ResAllBold, offset(all_bold), XRM_STRING }, |
| 381 | // { ResAltScreen, offset(altscreen), XRM_STRING }, | 389 | // { ResAltScreen, offset(altscreen), XRM_STRING }, |
| 382 | // { ResBsdTm, offset(bsd_tm), XRM_BOOLEAN }, | 390 | // { ResBsdTm, offset(bsd_tm), XRM_BOOLEAN }, |
| 383 | -#if defined(HAVE_LIBSSL) /*[*/ | 391 | +#if defined(HAVE_LIBSSL) |
| 384 | { ResCertFile, offset(cert_file), XRM_STRING }, | 392 | { ResCertFile, offset(cert_file), XRM_STRING }, |
| 385 | -#endif /*]*/ | 393 | +#endif |
| 386 | // { ResCharset, offset(charset), XRM_STRING }, | 394 | // { ResCharset, offset(charset), XRM_STRING }, |
| 387 | // { ResColor8, offset(color8), XRM_BOOLEAN }, | 395 | // { ResColor8, offset(color8), XRM_BOOLEAN }, |
| 388 | - { ResConfDir, offset(conf_dir), XRM_STRING }, | 396 | +// { ResConfDir, offset(conf_dir), XRM_STRING }, |
| 389 | // { ResDefScreen, offset(defscreen), XRM_STRING }, | 397 | // { ResDefScreen, offset(defscreen), XRM_STRING }, |
| 390 | -#if defined(X3270_ANSI) /*[*/ | 398 | +#if defined(X3270_ANSI) |
| 391 | // { ResEof, offset(eof), XRM_STRING }, | 399 | // { ResEof, offset(eof), XRM_STRING }, |
| 392 | // { ResErase, offset(erase), XRM_STRING }, | 400 | // { ResErase, offset(erase), XRM_STRING }, |
| 393 | -#endif /*]*/ | 401 | +#endif |
| 394 | // { ResExtended, offset(extended), XRM_BOOLEAN }, | 402 | // { ResExtended, offset(extended), XRM_BOOLEAN }, |
| 395 | -#if defined(X3270_FT) /*[*/ | ||
| 396 | - { ResFtCommand, offset(ft_command), XRM_STRING }, | 403 | +#if defined(X3270_FT) |
| 404 | +// { ResFtCommand, offset(ft_command), XRM_STRING }, | ||
| 397 | { ResDftBufferSize,offset(dft_buffer_size),XRM_INT }, | 405 | { ResDftBufferSize,offset(dft_buffer_size),XRM_INT }, |
| 398 | -#endif /*]*/ | ||
| 399 | -#if defined(WC3270) /*[*/ | ||
| 400 | - { "hostname", offset(hostname), XRM_STRING }, | ||
| 401 | -#endif /*]*/ | 406 | +#endif |
| 407 | +//#if defined(WC3270) | ||
| 408 | +// { "hostname", offset(hostname), XRM_STRING }, | ||
| 409 | +//#endif | ||
| 402 | // { ResHostsFile, offset(hostsfile), XRM_STRING }, | 410 | // { ResHostsFile, offset(hostsfile), XRM_STRING }, |
| 403 | -#if defined(X3270_ANSI) /*[*/ | 411 | +#if defined(X3270_ANSI) |
| 404 | // { ResIcrnl, offset(icrnl), XRM_BOOLEAN }, | 412 | // { ResIcrnl, offset(icrnl), XRM_BOOLEAN }, |
| 405 | // { ResInlcr, offset(inlcr), XRM_BOOLEAN }, | 413 | // { ResInlcr, offset(inlcr), XRM_BOOLEAN }, |
| 406 | // { ResOnlcr, offset(onlcr), XRM_BOOLEAN }, | 414 | // { ResOnlcr, offset(onlcr), XRM_BOOLEAN }, |
| 407 | // { ResIntr, offset(intr), XRM_STRING }, | 415 | // { ResIntr, offset(intr), XRM_STRING }, |
| 408 | -#endif /*]*/ | ||
| 409 | -#if defined(X3270_SCRIPT) /*[*/ | ||
| 410 | - { ResPluginCommand, offset(plugin_command), XRM_STRING }, | ||
| 411 | -#endif /*]*/ | 416 | +#endif |
| 417 | +//#if defined(X3270_SCRIPT) | ||
| 418 | +// { ResPluginCommand, offset(plugin_command), XRM_STRING }, | ||
| 419 | +//#endif | ||
| 412 | //#if defined(C3270) && defined(_WIN32) | 420 | //#if defined(C3270) && defined(_WIN32) |
| 413 | // { ResHighlightUnderline, offset(highlight_underline), XRM_BOOLEAN }, | 421 | // { ResHighlightUnderline, offset(highlight_underline), XRM_BOOLEAN }, |
| 414 | //#endif | 422 | //#endif |
| 415 | -#if defined(C3270) && defined(X3270_SCRIPT) /*[*/ | 423 | +#if defined(C3270) && defined(X3270_SCRIPT) |
| 416 | { ResIdleCommand,offset(idle_command), XRM_STRING }, | 424 | { ResIdleCommand,offset(idle_command), XRM_STRING }, |
| 417 | { ResIdleCommandEnabled,offset(idle_command_enabled), XRM_BOOLEAN }, | 425 | { ResIdleCommandEnabled,offset(idle_command_enabled), XRM_BOOLEAN }, |
| 418 | { ResIdleTimeout,offset(idle_timeout), XRM_STRING }, | 426 | { ResIdleTimeout,offset(idle_timeout), XRM_STRING }, |
| 419 | -#endif /*]*/ | ||
| 420 | -#if defined(C3270) /*[*/ | 427 | +#endif |
| 428 | +#if defined(C3270) | ||
| 421 | // { ResKeymap, offset(key_map), XRM_STRING }, | 429 | // { ResKeymap, offset(key_map), XRM_STRING }, |
| 422 | - { ResMetaEscape,offset(meta_escape), XRM_STRING }, | 430 | +// { ResMetaEscape,offset(meta_escape), XRM_STRING }, |
| 423 | // { ResCursesKeypad,offset(curses_keypad),XRM_BOOLEAN }, | 431 | // { ResCursesKeypad,offset(curses_keypad),XRM_BOOLEAN }, |
| 424 | // { ResCbreak, offset(cbreak_mode), XRM_BOOLEAN }, | 432 | // { ResCbreak, offset(cbreak_mode), XRM_BOOLEAN }, |
| 425 | -#endif /*]*/ | ||
| 426 | -#if defined(X3270_ANSI) /*[*/ | 433 | +#endif |
| 434 | +#if defined(X3270_ANSI) | ||
| 427 | // { ResKill, offset(kill), XRM_STRING }, | 435 | // { ResKill, offset(kill), XRM_STRING }, |
| 428 | // { ResLnext, offset(lnext), XRM_STRING }, | 436 | // { ResLnext, offset(lnext), XRM_STRING }, |
| 429 | -#endif /*]*/ | 437 | +#endif |
| 430 | // { ResLoginMacro,offset(login_macro), XRM_STRING }, | 438 | // { ResLoginMacro,offset(login_macro), XRM_STRING }, |
| 431 | // { ResM3279, offset(m3279), XRM_BOOLEAN }, | 439 | // { ResM3279, offset(m3279), XRM_BOOLEAN }, |
| 432 | // { ResModel, offset(model), XRM_STRING }, | 440 | // { ResModel, offset(model), XRM_STRING }, |
| 433 | // { ResModifiedSel, offset(modified_sel), XRM_BOOLEAN }, | 441 | // { ResModifiedSel, offset(modified_sel), XRM_BOOLEAN }, |
| 434 | -//#if defined(C3270) && !defined(_WIN32) /*[*/ | 442 | +//#if defined(C3270) && !defined(_WIN32) |
| 435 | // { ResMono, offset(mono), XRM_BOOLEAN }, | 443 | // { ResMono, offset(mono), XRM_BOOLEAN }, |
| 436 | -//#endif /*]*/ | 444 | +//#endif |
| 437 | // { ResNumericLock, offset(numeric_lock), XRM_BOOLEAN }, | 445 | // { ResNumericLock, offset(numeric_lock), XRM_BOOLEAN }, |
| 438 | // { ResOerrLock, offset(oerr_lock), XRM_BOOLEAN }, | 446 | // { ResOerrLock, offset(oerr_lock), XRM_BOOLEAN }, |
| 439 | // { ResOversize, offset(oversize), XRM_STRING }, | 447 | // { ResOversize, offset(oversize), XRM_STRING }, |
| 440 | // { ResPort, offset(port), XRM_STRING }, | 448 | // { ResPort, offset(port), XRM_STRING }, |
| 441 | -#if defined(C3270) /*[*/ | 449 | +#if defined(C3270) |
| 442 | // { ResPrinterLu, offset(printer_lu), XRM_STRING }, | 450 | // { ResPrinterLu, offset(printer_lu), XRM_STRING }, |
| 443 | { ResPrintTextCommand, NULL, XRM_STRING }, | 451 | { ResPrintTextCommand, NULL, XRM_STRING }, |
| 444 | -#endif /*]*/ | 452 | +#endif |
| 445 | // { ResProxy, offset(proxy), XRM_STRING }, | 453 | // { ResProxy, offset(proxy), XRM_STRING }, |
| 446 | -#if defined(X3270_ANSI) /*[*/ | 454 | +#if defined(X3270_ANSI) |
| 447 | // { ResQuit, offset(quit), XRM_STRING }, | 455 | // { ResQuit, offset(quit), XRM_STRING }, |
| 448 | // { ResRprnt, offset(rprnt), XRM_STRING }, | 456 | // { ResRprnt, offset(rprnt), XRM_STRING }, |
| 449 | -#endif /*]*/ | 457 | +#endif |
| 450 | // { ResSecure, offset(secure), XRM_BOOLEAN }, | 458 | // { ResSecure, offset(secure), XRM_BOOLEAN }, |
| 451 | // { ResTermName, offset(termname), XRM_STRING }, | 459 | // { ResTermName, offset(termname), XRM_STRING }, |
| 452 | -#if defined(WC3270) /*[*/ | 460 | +#if defined(WC3270) |
| 453 | { ResTitle, offset(title), XRM_STRING }, | 461 | { ResTitle, offset(title), XRM_STRING }, |
| 454 | -#endif /*]*/ | ||
| 455 | -#if defined(X3270_TRACE) /*[*/ | ||
| 456 | -#if !defined(_WIN32) /*[*/ | ||
| 457 | - { ResTraceDir, offset(trace_dir), XRM_STRING }, | ||
| 458 | -#endif /*]*/ | ||
| 459 | - { ResTraceFile, offset(trace_file), XRM_STRING }, | ||
| 460 | - { ResTraceFileSize,offset(trace_file_size),XRM_STRING }, | ||
| 461 | -#if defined(WC3270) /*[*/ | 462 | +#endif |
| 463 | +#if defined(X3270_TRACE) | ||
| 464 | +//#if !defined(_WIN32) | ||
| 465 | +// { ResTraceDir, offset(trace_dir), XRM_STRING }, | ||
| 466 | +//#endif | ||
| 467 | +// { ResTraceFile, offset(trace_file), XRM_STRING }, | ||
| 468 | +// { ResTraceFileSize,offset(trace_file_size),XRM_STRING }, | ||
| 469 | +#if defined(WC3270) | ||
| 462 | { ResTraceMonitor,offset(trace_monitor),XRM_BOOLEAN }, | 470 | { ResTraceMonitor,offset(trace_monitor),XRM_BOOLEAN }, |
| 463 | -#endif /*]*/ | ||
| 464 | -#endif /*]*/ | 471 | +#endif |
| 472 | +#endif | ||
| 465 | // { ResTypeahead, offset(typeahead), XRM_BOOLEAN }, | 473 | // { ResTypeahead, offset(typeahead), XRM_BOOLEAN }, |
| 466 | // { ResUnlockDelay,offset(unlock_delay), XRM_BOOLEAN }, | 474 | // { ResUnlockDelay,offset(unlock_delay), XRM_BOOLEAN }, |
| 467 | -#if defined(X3270_ANSI) /*[*/ | 475 | +#if defined(X3270_ANSI) |
| 468 | // { ResWerase, offset(werase), XRM_STRING }, | 476 | // { ResWerase, offset(werase), XRM_STRING }, |
| 469 | -#endif /*]*/ | 477 | +#endif |
| 470 | 478 | ||
| 471 | { CN, 0, XRM_STRING } | 479 | { CN, 0, XRM_STRING } |
| 472 | }; | 480 | }; |
| 481 | +*/ | ||
| 473 | 482 | ||
| 474 | /* | 483 | /* |
| 475 | * Compare two strings, allowing the second to differ by uppercasing the | 484 | * Compare two strings, allowing the second to differ by uppercasing the |
| 476 | * first character of the second. | 485 | * first character of the second. |
| 477 | - */ | 486 | + */ /* |
| 478 | static int | 487 | static int |
| 479 | strncapcmp(const char *known, const char *unknown, unsigned unk_len) | 488 | strncapcmp(const char *known, const char *unknown, unsigned unk_len) |
| 480 | { | 489 | { |
| @@ -488,7 +497,7 @@ strncapcmp(const char *known, const char *unknown, unsigned unk_len) | @@ -488,7 +497,7 @@ strncapcmp(const char *known, const char *unknown, unsigned unk_len) | ||
| 488 | return 0; | 497 | return 0; |
| 489 | return -1; | 498 | return -1; |
| 490 | } | 499 | } |
| 491 | - | 500 | +*/ |
| 492 | 501 | ||
| 493 | #if !defined(ME) /*[*/ | 502 | #if !defined(ME) /*[*/ |
| 494 | #if defined(C3270) /*[*/ | 503 | #if defined(C3270) /*[*/ |
| @@ -504,6 +513,7 @@ strncapcmp(const char *known, const char *unknown, unsigned unk_len) | @@ -504,6 +513,7 @@ strncapcmp(const char *known, const char *unknown, unsigned unk_len) | ||
| 504 | #endif /*]*/ | 513 | #endif /*]*/ |
| 505 | #endif /*]*/ | 514 | #endif /*]*/ |
| 506 | 515 | ||
| 516 | +/* | ||
| 507 | void | 517 | void |
| 508 | parse_xrm(const char *arg, const char *where) | 518 | parse_xrm(const char *arg, const char *where) |
| 509 | { | 519 | { |
| @@ -516,13 +526,13 @@ parse_xrm(const char *arg, const char *where) | @@ -516,13 +526,13 @@ parse_xrm(const char *arg, const char *where) | ||
| 516 | char *t; | 526 | char *t; |
| 517 | void *address = NULL; | 527 | void *address = NULL; |
| 518 | enum resource_type type = XRM_STRING; | 528 | enum resource_type type = XRM_STRING; |
| 519 | -#if defined(C3270) /*[*/ | 529 | +#if defined(C3270) |
| 520 | char *add_buf = CN; | 530 | char *add_buf = CN; |
| 521 | char *hide; | 531 | char *hide; |
| 522 | Boolean arbitrary = False; | 532 | Boolean arbitrary = False; |
| 523 | -#endif /*]*/ | 533 | +#endif |
| 524 | 534 | ||
| 525 | - /* Enforce "-3270." or "-3270*" or "*". */ | 535 | + // Enforce "-3270." or "-3270*" or "*". |
| 526 | if (!strncmp(arg, me_dot, sizeof(me_dot)-1)) | 536 | if (!strncmp(arg, me_dot, sizeof(me_dot)-1)) |
| 527 | match_len = sizeof(me_dot)-1; | 537 | match_len = sizeof(me_dot)-1; |
| 528 | else if (!strncmp(arg, me_star, sizeof(me_star)-1)) | 538 | else if (!strncmp(arg, me_star, sizeof(me_star)-1)) |
| @@ -536,7 +546,7 @@ parse_xrm(const char *arg, const char *where) | @@ -536,7 +546,7 @@ parse_xrm(const char *arg, const char *where) | ||
| 536 | return; | 546 | return; |
| 537 | } | 547 | } |
| 538 | 548 | ||
| 539 | - /* Separate the parts. */ | 549 | + // Separate the parts. |
| 540 | s = arg + match_len; | 550 | s = arg + match_len; |
| 541 | while (*s && *s != ':' && !isspace(*s)) | 551 | while (*s && *s != ':' && !isspace(*s)) |
| 542 | s++; | 552 | s++; |
| @@ -556,22 +566,22 @@ parse_xrm(const char *arg, const char *where) | @@ -556,22 +566,22 @@ parse_xrm(const char *arg, const char *where) | ||
| 556 | while (isspace(*s)) | 566 | while (isspace(*s)) |
| 557 | s++; | 567 | s++; |
| 558 | 568 | ||
| 559 | - /* Look up the name. */ | 569 | + // Look up the name. |
| 560 | for (i = 0; resources[i].name != CN; i++) { | 570 | for (i = 0; resources[i].name != CN; i++) { |
| 561 | if (!strncapcmp(resources[i].name, arg + match_len, rnlen)) { | 571 | if (!strncapcmp(resources[i].name, arg + match_len, rnlen)) { |
| 562 | address = resources[i].address; | 572 | address = resources[i].address; |
| 563 | type = resources[i].type; | 573 | type = resources[i].type; |
| 564 | -#if defined(C3270) /*[*/ | 574 | +#if defined(C3270) |
| 565 | if (address == NULL) { | 575 | if (address == NULL) { |
| 566 | add_buf = lib3270_malloc(strlen(s) + 1); | 576 | add_buf = lib3270_malloc(strlen(s) + 1); |
| 567 | address = add_buf; | 577 | address = add_buf; |
| 568 | } | 578 | } |
| 569 | -#endif /*]*/ | 579 | +#endif |
| 570 | break; | 580 | break; |
| 571 | } | 581 | } |
| 572 | } | 582 | } |
| 573 | 583 | ||
| 574 | -#if defined(C3270) /*[*/ | 584 | +#if defined(C3270) |
| 575 | if (address == NULL) { | 585 | if (address == NULL) { |
| 576 | if (!strncasecmp(ResKeymap ".", arg + match_len, | 586 | if (!strncasecmp(ResKeymap ".", arg + match_len, |
| 577 | strlen(ResKeymap ".")) || | 587 | strlen(ResKeymap ".")) || |
| @@ -583,22 +593,22 @@ parse_xrm(const char *arg, const char *where) | @@ -583,22 +593,22 @@ parse_xrm(const char *arg, const char *where) | ||
| 583 | strlen(ResCodepage ".")) || | 593 | strlen(ResCodepage ".")) || |
| 584 | !strncasecmp("host.", arg + match_len, 5) || | 594 | !strncasecmp("host.", arg + match_len, 5) || |
| 585 | !strncasecmp("printer.", arg + match_len, 8) || | 595 | !strncasecmp("printer.", arg + match_len, 8) || |
| 586 | -#if defined(_WIN32) /*[*/ | 596 | +#if defined(_WIN32) |
| 587 | !strncasecmp(ResHostColorFor, arg + match_len, | 597 | !strncasecmp(ResHostColorFor, arg + match_len, |
| 588 | strlen(ResHostColorFor)) || | 598 | strlen(ResHostColorFor)) || |
| 589 | !strncasecmp(ResConsoleColorForHostColor, arg + match_len, | 599 | !strncasecmp(ResConsoleColorForHostColor, arg + match_len, |
| 590 | strlen(ResConsoleColorForHostColor)) | 600 | strlen(ResConsoleColorForHostColor)) |
| 591 | -#else /*][*/ | 601 | +#else |
| 592 | !strncasecmp(ResCursesColorFor, arg + match_len, | 602 | !strncasecmp(ResCursesColorFor, arg + match_len, |
| 593 | strlen(ResCursesColorFor)) | 603 | strlen(ResCursesColorFor)) |
| 594 | -#endif /*]*/ | 604 | +#endif |
| 595 | ) { | 605 | ) { |
| 596 | address = &hide; | 606 | address = &hide; |
| 597 | type = XRM_STRING; | 607 | type = XRM_STRING; |
| 598 | arbitrary = True; | 608 | arbitrary = True; |
| 599 | } | 609 | } |
| 600 | } | 610 | } |
| 601 | -#endif /*]*/ | 611 | +#endif |
| 602 | if (address == NULL) { | 612 | if (address == NULL) { |
| 603 | xs_warning("%s: Unknown resource name: %.*s", | 613 | xs_warning("%s: Unknown resource name: %.*s", |
| 604 | where, (int)rnlen, arg + match_len); | 614 | where, (int)rnlen, arg + match_len); |
| @@ -670,8 +680,8 @@ parse_xrm(const char *arg, const char *where) | @@ -670,8 +680,8 @@ parse_xrm(const char *arg, const char *where) | ||
| 670 | } | 680 | } |
| 671 | } | 681 | } |
| 672 | 682 | ||
| 673 | -#if defined(C3270) /*[*/ | ||
| 674 | - /* Add a new, arbitrarily-named resource. */ | 683 | +#if defined(C3270) |
| 684 | + // Add a new, arbitrarily-named resource. | ||
| 675 | if (arbitrary) { | 685 | if (arbitrary) { |
| 676 | char *rsname; | 686 | char *rsname; |
| 677 | 687 | ||
| @@ -680,10 +690,11 @@ parse_xrm(const char *arg, const char *where) | @@ -680,10 +690,11 @@ parse_xrm(const char *arg, const char *where) | ||
| 680 | rsname[rnlen] = '\0'; | 690 | rsname[rnlen] = '\0'; |
| 681 | add_resource(rsname, hide); | 691 | add_resource(rsname, hide); |
| 682 | } | 692 | } |
| 683 | -#endif /*]*/ | 693 | +#endif |
| 684 | } | 694 | } |
| 695 | +*/ | ||
| 685 | 696 | ||
| 686 | -/* Read resources from a file. */ | 697 | +/* Read resources from a file. */ /* |
| 687 | int | 698 | int |
| 688 | read_resource_file(const char *filename, Boolean fatal) | 699 | read_resource_file(const char *filename, Boolean fatal) |
| 689 | { | 700 | { |
| @@ -701,7 +712,7 @@ read_resource_file(const char *filename, Boolean fatal) | @@ -701,7 +712,7 @@ read_resource_file(const char *filename, Boolean fatal) | ||
| 701 | return -1; | 712 | return -1; |
| 702 | } | 713 | } |
| 703 | 714 | ||
| 704 | - /* Merge in what's in the file into the resource database. */ | 715 | + // Merge in what's in the file into the resource database. |
| 705 | where = lib3270_malloc(strlen(filename) + 64); | 716 | where = lib3270_malloc(strlen(filename) + 64); |
| 706 | 717 | ||
| 707 | ilen = 0; | 718 | ilen = 0; |
| @@ -712,15 +723,15 @@ read_resource_file(const char *filename, Boolean fatal) | @@ -712,15 +723,15 @@ read_resource_file(const char *filename, Boolean fatal) | ||
| 712 | 723 | ||
| 713 | lno++; | 724 | lno++; |
| 714 | 725 | ||
| 715 | - /* Stip any trailing newline. */ | 726 | + // Stip any trailing newline. |
| 716 | sl = strlen(buf + ilen); | 727 | sl = strlen(buf + ilen); |
| 717 | if (sl && (buf + ilen)[sl-1] == '\n') | 728 | if (sl && (buf + ilen)[sl-1] == '\n') |
| 718 | (buf + ilen)[--sl] = '\0'; | 729 | (buf + ilen)[--sl] = '\0'; |
| 719 | 730 | ||
| 720 | - /* | ||
| 721 | - * Translate backslash-n to real newline characters, and | ||
| 722 | - * remember if the last character is a backslash. | ||
| 723 | - */ | 731 | + // |
| 732 | + //Translate backslash-n to real newline characters, and | ||
| 733 | + // remember if the last character is a backslash. | ||
| 734 | + // | ||
| 724 | for (bsl = False, s = buf + ilen, t = s; *s; s++) { | 735 | for (bsl = False, s = buf + ilen, t = s; *s; s++) { |
| 725 | if (bsl) { | 736 | if (bsl) { |
| 726 | if (*s == 'n') | 737 | if (*s == 'n') |
| @@ -737,12 +748,12 @@ read_resource_file(const char *filename, Boolean fatal) | @@ -737,12 +748,12 @@ read_resource_file(const char *filename, Boolean fatal) | ||
| 737 | } | 748 | } |
| 738 | *t = '\0'; | 749 | *t = '\0'; |
| 739 | 750 | ||
| 740 | - /* Skip leading whitespace. */ | 751 | + // Skip leading whitespace. |
| 741 | s = buf; | 752 | s = buf; |
| 742 | while (isspace(*s)) | 753 | while (isspace(*s)) |
| 743 | s++; | 754 | s++; |
| 744 | 755 | ||
| 745 | - /* Skip comments _before_ checking for line continuation. */ | 756 | + // Skip comments _before_ checking for line continuation. |
| 746 | if (*s == '!') { | 757 | if (*s == '!') { |
| 747 | ilen = 0; | 758 | ilen = 0; |
| 748 | continue; | 759 | continue; |
| @@ -755,7 +766,7 @@ read_resource_file(const char *filename, Boolean fatal) | @@ -755,7 +766,7 @@ read_resource_file(const char *filename, Boolean fatal) | ||
| 755 | continue; | 766 | continue; |
| 756 | } | 767 | } |
| 757 | 768 | ||
| 758 | - /* If this line is a continuation, try again. */ | 769 | + // If this line is a continuation, try again. |
| 759 | if (bsl) { | 770 | if (bsl) { |
| 760 | ilen += strlen(buf + ilen); | 771 | ilen += strlen(buf + ilen); |
| 761 | if (ilen >= sizeof(buf) - 1) { | 772 | if (ilen >= sizeof(buf) - 1) { |
| @@ -767,7 +778,7 @@ read_resource_file(const char *filename, Boolean fatal) | @@ -767,7 +778,7 @@ read_resource_file(const char *filename, Boolean fatal) | ||
| 767 | continue; | 778 | continue; |
| 768 | } | 779 | } |
| 769 | 780 | ||
| 770 | - /* Strip trailing whitespace and check for empty lines. */ | 781 | + // Strip trailing whitespace and check for empty lines. |
| 771 | sl = strlen(s); | 782 | sl = strlen(s); |
| 772 | while (sl && isspace(s[sl-1])) | 783 | while (sl && isspace(s[sl-1])) |
| 773 | s[--sl] = '\0'; | 784 | s[--sl] = '\0'; |
| @@ -776,11 +787,11 @@ read_resource_file(const char *filename, Boolean fatal) | @@ -776,11 +787,11 @@ read_resource_file(const char *filename, Boolean fatal) | ||
| 776 | continue; | 787 | continue; |
| 777 | } | 788 | } |
| 778 | 789 | ||
| 779 | - /* Digest it. */ | 790 | + // Digest it. |
| 780 | (void) sprintf(where, "%s:%d", filename, lno); | 791 | (void) sprintf(where, "%s:%d", filename, lno); |
| 781 | parse_xrm(s, where); | 792 | parse_xrm(s, where); |
| 782 | 793 | ||
| 783 | - /* Get ready for the next iteration. */ | 794 | + // Get ready for the next iteration. |
| 784 | ilen = 0; | 795 | ilen = 0; |
| 785 | } | 796 | } |
| 786 | lib3270_free(where); | 797 | lib3270_free(where); |
| @@ -788,29 +799,13 @@ read_resource_file(const char *filename, Boolean fatal) | @@ -788,29 +799,13 @@ read_resource_file(const char *filename, Boolean fatal) | ||
| 788 | } | 799 | } |
| 789 | 800 | ||
| 790 | // Boolean flipped = False; | 801 | // Boolean flipped = False; |
| 802 | +*/ | ||
| 791 | 803 | ||
| 792 | /* Replacements for functions in popups.c. */ | 804 | /* Replacements for functions in popups.c. */ |
| 793 | 805 | ||
| 794 | -#include <stdarg.h> | ||
| 795 | - | ||
| 796 | -Boolean error_popup_visible = False; | 806 | +// Boolean error_popup_visible = False; |
| 797 | 807 | ||
| 798 | 808 | ||
| 799 | -/* Pop up an error dialog, based on an error number. */ | ||
| 800 | -void popup_an_errno(H3270 *session, int errn, const char *fmt, ...) | ||
| 801 | -{ | ||
| 802 | - char vmsgbuf[4096]; | ||
| 803 | - va_list args; | ||
| 804 | - | ||
| 805 | - va_start(args, fmt); | ||
| 806 | - (void) vsprintf(vmsgbuf, fmt, args); | ||
| 807 | - va_end(args); | ||
| 808 | - | ||
| 809 | - lib3270_write_log(session, "3270", "Error Popup:\n%s\nrc=%d (%s)",vmsgbuf,errn,strerror(errn)); | ||
| 810 | - | ||
| 811 | - Error(NULL,vmsgbuf); | ||
| 812 | -} | ||
| 813 | - | ||
| 814 | #ifdef DEBUG | 809 | #ifdef DEBUG |
| 815 | extern void lib3270_initialize(void) | 810 | extern void lib3270_initialize(void) |
| 816 | { | 811 | { |
| @@ -818,11 +813,12 @@ extern void lib3270_initialize(void) | @@ -818,11 +813,12 @@ extern void lib3270_initialize(void) | ||
| 818 | } | 813 | } |
| 819 | #endif | 814 | #endif |
| 820 | 815 | ||
| 816 | + | ||
| 817 | +/* | ||
| 821 | void | 818 | void |
| 822 | action_output(const char *fmt, ...) | 819 | action_output(const char *fmt, ...) |
| 823 | { | 820 | { |
| 824 | // TODO (perry#1#): Implement a callback to browse the text string. | 821 | // TODO (perry#1#): Implement a callback to browse the text string. |
| 825 | -/* | ||
| 826 | va_list args; | 822 | va_list args; |
| 827 | 823 | ||
| 828 | va_start(args, fmt); | 824 | va_start(args, fmt); |
| @@ -844,32 +840,6 @@ action_output(const char *fmt, ...) | @@ -844,32 +840,6 @@ action_output(const char *fmt, ...) | ||
| 844 | (void) fprintf(aout, "%s\n", vmsgbuf); | 840 | (void) fprintf(aout, "%s\n", vmsgbuf); |
| 845 | macro_output = True; | 841 | macro_output = True; |
| 846 | } | 842 | } |
| 847 | -*/ | ||
| 848 | -} | ||
| 849 | - | ||
| 850 | - | ||
| 851 | -#if defined(_WIN32) /*[*/ | ||
| 852 | - | ||
| 853 | -/* Missing parts for wc3270. */ | ||
| 854 | -#include <windows.h> | ||
| 855 | -#define SECS_BETWEEN_EPOCHS 11644473600ULL | ||
| 856 | -#define SECS_TO_100NS 10000000ULL /* 10^7 */ | ||
| 857 | - | ||
| 858 | -int | ||
| 859 | -gettimeofday(struct timeval *tv, void *ignored) | ||
| 860 | -{ | ||
| 861 | - FILETIME t; | ||
| 862 | - ULARGE_INTEGER u; | ||
| 863 | - | ||
| 864 | - GetSystemTimeAsFileTime(&t); | ||
| 865 | - memcpy(&u, &t, sizeof(ULARGE_INTEGER)); | ||
| 866 | - | ||
| 867 | - /* Isolate seconds and move epochs. */ | ||
| 868 | - tv->tv_sec = (DWORD)((u.QuadPart / SECS_TO_100NS) - | ||
| 869 | - SECS_BETWEEN_EPOCHS); | ||
| 870 | - tv->tv_usec = (u.QuadPart % SECS_TO_100NS) / 10ULL; | ||
| 871 | - return 0; | ||
| 872 | } | 843 | } |
| 873 | - | ||
| 874 | -#endif /*]*/ | 844 | +*/ |
| 875 | 845 |
gluec.h
| @@ -20,7 +20,7 @@ | @@ -20,7 +20,7 @@ | ||
| 20 | /* glue.c */ | 20 | /* glue.c */ |
| 21 | // extern int parse_command_line(int argc, const char **argv, const char **cl_hostname); | 21 | // extern int parse_command_line(int argc, const char **argv, const char **cl_hostname); |
| 22 | // extern int parse_program_parameters(int argc, const char **argv); | 22 | // extern int parse_program_parameters(int argc, const char **argv); |
| 23 | -LIB3270_INTERNAL void parse_xrm(const char *arg, const char *where); | 23 | +// LIB3270_INTERNAL void parse_xrm(const char *arg, const char *where); |
| 24 | LIB3270_INTERNAL void notify_ssl_error(H3270 *session, const char *title, const char *msg, const char *state, const char *alert); | 24 | LIB3270_INTERNAL void notify_ssl_error(H3270 *session, const char *title, const char *msg, const char *state, const char *alert); |
| 25 | 25 | ||
| 26 | /* XtGlue.c */ | 26 | /* XtGlue.c */ |
popupsc.h
| @@ -15,4 +15,4 @@ | @@ -15,4 +15,4 @@ | ||
| 15 | /* Non-display version of popupsc.h */ | 15 | /* Non-display version of popupsc.h */ |
| 16 | 16 | ||
| 17 | LIB3270_INTERNAL void popup_an_errno(H3270 *session, int errn, const char *fmt, ...); | 17 | LIB3270_INTERNAL void popup_an_errno(H3270 *session, int errn, const char *fmt, ...); |
| 18 | -LIB3270_INTERNAL void action_output(const char *fmt, ...); | 18 | +// LIB3270_INTERNAL void action_output(const char *fmt, ...); |
sources.mak
| @@ -33,6 +33,6 @@ TERMINAL_SOURCES = bounds.c XtGlue.c ctlr.c util.c toggles.c screen.c selection. | @@ -33,6 +33,6 @@ TERMINAL_SOURCES = bounds.c XtGlue.c ctlr.c util.c toggles.c screen.c selection. | ||
| 33 | NETWORK_SOURCES = iocalls.c proxy.c | 33 | NETWORK_SOURCES = iocalls.c proxy.c |
| 34 | 34 | ||
| 35 | # Full library sources | 35 | # Full library sources |
| 36 | -SOURCES = $(TERMINAL_SOURCES) $(NETWORK_SOURCES) actions.c ft.c ft_cut.c ft_dft.c glue.c resources.c \ | 36 | +SOURCES = $(TERMINAL_SOURCES) $(NETWORK_SOURCES) ft.c ft_cut.c ft_dft.c glue.c resources.c \ |
| 37 | rpq.c see.c trace_ds.c paste.c macros.c fallbacks.c log.c | 37 | rpq.c see.c trace_ds.c paste.c macros.c fallbacks.c log.c |
| 38 | 38 |
util.c
| @@ -992,3 +992,42 @@ LIB3270_EXPORT const char * lib3270_get_revision(void) | @@ -992,3 +992,42 @@ LIB3270_EXPORT const char * lib3270_get_revision(void) | ||
| 992 | { | 992 | { |
| 993 | return build_rpq_revision; | 993 | return build_rpq_revision; |
| 994 | } | 994 | } |
| 995 | + | ||
| 996 | +/* Pop up an error dialog, based on an error number. */ | ||
| 997 | +void popup_an_errno(H3270 *session, int errn, const char *fmt, ...) | ||
| 998 | +{ | ||
| 999 | + va_list args; | ||
| 1000 | + char * text; | ||
| 1001 | + | ||
| 1002 | + va_start(args, fmt); | ||
| 1003 | + text = lib3270_vsprintf(fmt, args); | ||
| 1004 | + va_end(args); | ||
| 1005 | + | ||
| 1006 | + lib3270_write_log(session, "3270", "Error Popup:\n%s\nrc=%d (%s)",text,errn,strerror(errn)); | ||
| 1007 | + | ||
| 1008 | + Error(session,text); | ||
| 1009 | + | ||
| 1010 | + lib3270_free(text); | ||
| 1011 | +} | ||
| 1012 | + | ||
| 1013 | +#if defined(_WIN32) | ||
| 1014 | + | ||
| 1015 | +#define SECS_BETWEEN_EPOCHS 11644473600ULL | ||
| 1016 | +#define SECS_TO_100NS 10000000ULL /* 10^7 */ | ||
| 1017 | + | ||
| 1018 | +int gettimeofday(struct timeval *tv, void *ignored) | ||
| 1019 | +{ | ||
| 1020 | + FILETIME t; | ||
| 1021 | + ULARGE_INTEGER u; | ||
| 1022 | + | ||
| 1023 | + GetSystemTimeAsFileTime(&t); | ||
| 1024 | + memcpy(&u, &t, sizeof(ULARGE_INTEGER)); | ||
| 1025 | + | ||
| 1026 | + /* Isolate seconds and move epochs. */ | ||
| 1027 | + tv->tv_sec = (DWORD)((u.QuadPart / SECS_TO_100NS) - SECS_BETWEEN_EPOCHS); | ||
| 1028 | + tv->tv_usec = (u.QuadPart % SECS_TO_100NS) / 10ULL; | ||
| 1029 | + return 0; | ||
| 1030 | +} | ||
| 1031 | + | ||
| 1032 | +#endif | ||
| 1033 | + |
utilc.h
| @@ -46,7 +46,7 @@ LIB3270_INTERNAL void RemoveTimeOut(void *cookie); | @@ -46,7 +46,7 @@ LIB3270_INTERNAL void RemoveTimeOut(void *cookie); | ||
| 46 | LIB3270_INTERNAL const char * KeysymToString(KeySym k); | 46 | LIB3270_INTERNAL const char * KeysymToString(KeySym k); |
| 47 | LIB3270_INTERNAL KeySym StringToKeysym(char *s); | 47 | LIB3270_INTERNAL KeySym StringToKeysym(char *s); |
| 48 | 48 | ||
| 49 | -LIB3270_INTERNAL int read_resource_file(const char *filename, Boolean fatal); | 49 | +// LIB3270_INTERNAL int read_resource_file(const char *filename, Boolean fatal); |
| 50 | LIB3270_INTERNAL Boolean split_hier(char *label, char **base, char ***parents); | 50 | LIB3270_INTERNAL Boolean split_hier(char *label, char **base, char ***parents); |
| 51 | 51 | ||
| 52 | typedef struct { | 52 | typedef struct { |