Commit a1854e26de923b95fe0eababf0cb5cd7584b0af5

Authored by perry.werneck@gmail.com
1 parent 7ac04a10

Limpando códigos antigos e não mais usados

actions.c
... ... @@ -59,6 +59,8 @@
59 59 #include "screenc.h"
60 60 #endif /*]*/
61 61  
  62 +#error Deprecated
  63 +
62 64 /*
63 65  
64 66 #if defined(X3270_DISPLAY)
... ...
appres.h
... ... @@ -107,7 +107,7 @@ typedef struct {
107 107 */
108 108 #if defined(X3270_DISPLAY) || defined(C3270)
109 109 // char *key_map;
110   - char *compose_map;
  110 +// char *compose_map;
111 111 // char *printer_lu;
112 112 #endif
113 113 /*
... ... @@ -136,30 +136,31 @@ typedef struct {
136 136 #endif
137 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 143 #if defined(C3270) /*[*/
143   - char *meta_escape;
144   - char *all_bold;
  144 +// char *meta_escape;
  145 +// char *all_bold;
145 146 // char *altscreen;
146 147 // char *defscreen;
147 148 #endif /*]*/
148   - char *conf_dir;
  149 +// char *conf_dir;
149 150 char *model;
150 151 // char *hostsfile;
151 152 // char *port;
152 153 // char *charset;
153 154 // char *termname;
154 155 // char *login_macro;
155   - char *macros;
  156 +// char *macros;
156 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 165 #if defined(X3270_DISPLAY) || defined(WC3270)
165 166 char trace_monitor;
... ... @@ -169,13 +170,13 @@ typedef struct {
169 170 #endif /*]*/
170 171 // char *oversize;
171 172 #if defined(X3270_FT) /*[*/
172   - char *ft_command;
  173 +// char *ft_command;
173 174 int dft_buffer_size;
174 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 182 #if defined(X3270_SCRIPT)
... ...
ft.c
... ... @@ -86,7 +86,7 @@ Boolean remap_flag = True; // Remap ASCII<->EBCDIC
86 86 unsigned long ft_length = 0; // Length of transfer
87 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 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 193 {
194 194 H3270FT * ftHandle = NULL;
195 195 FILE * ft_local_file = NULL;
196   - unsigned long ft_length = 0L;
  196 +// unsigned long length = 0L;
197 197  
198 198 // trace("%s(%s)",__FUNCTION__,local);
199 199 if(!lib3270_connected(session))
... ... @@ -248,7 +248,6 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state);
248 248 ftHandle->host = session;
249 249 ftHandle->flags = flags;
250 250 ftHandle->local_file = ft_local_file;
251   - ftHandle->length = ft_length;
252 251 ftHandle->state = LIB3270_FT_STATE_AWAIT_ACK;
253 252 ftHandle->complete = def_complete;
254 253 ftHandle->message = def_message;
... ... @@ -306,9 +305,10 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state);
306 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 312 rewind(ft->local_file);
313 313 }
314 314  
... ... @@ -414,8 +414,8 @@ void ft_complete(H3270FT *session, const char *errmsg)
414 414  
415 415 (void) gettimeofday(&t1, (struct timezone *)NULL);
416 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 420 // Close the local file.
421 421 if(session->local_file)
... ... @@ -470,8 +470,8 @@ void ft_update_length(H3270FT *session)
470 470  
471 471 (void) gettimeofday(&t1, (struct timezone *)NULL);
472 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 477 session->update(session,ft_length,session->length,kbytes_sec);
... ... @@ -486,7 +486,7 @@ void ft_running(H3270FT *h, Boolean is_cut)
486 486 ft_is_cut = is_cut;
487 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 491 if (h->state == FT_AWAIT_ACK)
492 492 set_ft_state(h,FT_RUNNING);
... ...
globals.h
... ... @@ -158,7 +158,7 @@ LIB3270_INTERNAL const char * build_rpq_timestamp;
158 158 LIB3270_INTERNAL const char * build_rpq_version;
159 159 LIB3270_INTERNAL const char * build_rpq_revision;
160 160  
161   -LIB3270_INTERNAL int children;
  161 +// LIB3270_INTERNAL int children;
162 162  
163 163 #if defined(X3270_DBCS) /*[*/
164 164 LIB3270_INTERNAL Boolean dbcs;
... ... @@ -170,7 +170,7 @@ LIB3270_INTERNAL int children;
170 170  
171 171 // LIB3270_INTERNAL char *efontname;
172 172 LIB3270_INTERNAL Boolean ever_3270;
173   -LIB3270_INTERNAL Boolean exiting;
  173 +// LIB3270_INTERNAL Boolean exiting;
174 174  
175 175 /*
176 176 #if defined(X3270_DISPLAY)
... ... @@ -192,7 +192,7 @@ LIB3270_INTERNAL Boolean exiting;
192 192 //LIB3270_INTERNAL char *hostname;
193 193  
194 194 #if defined(X3270_DBCS) /*[*/
195   - LIB3270_INTERNAL char *local_encoding;
  195 +// LIB3270_INTERNAL char *local_encoding;
196 196  
197 197 #if defined(X3270_DISPLAY) /*[*/
198 198 LIB3270_INTERNAL char *locale_name;
... ...
glue.c
... ... @@ -49,6 +49,7 @@
49 49  
50 50 #include <signal.h>
51 51 #include <errno.h>
  52 +#include <stdarg.h>
52 53  
53 54 #include "appres.h"
54 55 #include "3270ds.h"
... ... @@ -100,15 +101,15 @@
100 101 #define LAST_ARG "--"
101 102  
102 103 /*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/
103   - const char * programname;
  104 +// const char * programname;
104 105 AppRes appres;
105   - int children = 0;
106   - Boolean exiting = False;
  106 +// int children = 0;
  107 +// Boolean exiting = False;
107 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 115 * Set default options
... ... @@ -163,9 +164,9 @@ static void initialize(void)
163 164 // appres.typeahead = True;
164 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 171 appres.model = "";
171 172 // appres.hostsfile = CN;
... ... @@ -182,13 +183,15 @@ static void initialize(void)
182 183 //#endif /*]*/
183 184  
184 185 // appres.termname = CN;
185   - appres.macros = CN;
  186 +// appres.macros = CN;
186 187  
187 188 #if defined(X3270_TRACE) /*[*/
188 189  
189   -#if !defined(_WIN32) /*[*/
  190 +/*
  191 +#if !defined(_WIN32)
190 192 appres.trace_dir = "/tmp";
191   -#endif /*]*/
  193 +#endif
  194 +*/
192 195  
193 196 /*
194 197 #if defined(X3270_DISPLAY) || defined(WC3270)
... ... @@ -201,7 +204,7 @@ static void initialize(void)
201 204 // appres.oversize = CN;
202 205  
203 206 #if defined(C3270) /*[*/
204   - appres.meta_escape = "auto";
  207 +// appres.meta_escape = "auto";
205 208 // appres.curses_keypad = True;
206 209 // appres.cbreak_mode = False;
207 210 #endif /*]*/
... ... @@ -291,79 +294,84 @@ int lib3270_unloaded(void)
291 294 #define offset(n) (void *) &appres.n
292 295 #define toggle_offset(index) offset(toggle[index].value)
293 296  
  297 +/*
  298 +
294 299 static const struct lib3270_option options[] =
295 300 {
296 301 // TODO (perry#5#): Add option descriptions.
297   -//#if defined(C3270) /*[*/
  302 +//#if defined(C3270)
298 303 // { OptAllBold, OPT_BOOLEAN, True, ResAllBold, offset(all_bold_on), NULL },
299 304 // { OptAltScreen,OPT_STRING, False, ResAltScreen, offset(altscreen), NULL },
300   -//#endif /*]*/
  305 +//#endif
301 306 // { OptAplMode, OPT_BOOLEAN, True, ResAplMode, offset(apl_mode), NULL },
302   -#if defined(C3270) /*[*/
  307 +#if defined(C3270)
303 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 311 { OptCertFile, OPT_STRING, False, ResCertFile, offset(cert_file), NULL },
307   -#endif /*]*/
  312 +#endif
308 313 // { OptCharset, OPT_STRING, False, ResCharset, offset(charset), NULL },
309 314 { OptClear, OPT_SKIP2, False, NULL, NULL, NULL },
310 315 // { OptDefScreen,OPT_STRING, False, ResDefScreen, offset(defscreen), NULL },
311 316 //#if defined(X3270_TRACE)
312 317 // { OptDsTrace, OPT_BOOLEAN, True, ResDsTrace, toggle_offset(DS_TRACE), NULL },
313   -//#endif /*]*/
  318 +//#endif
314 319 // { OptHostsFile,OPT_STRING, False, ResHostsFile, offset(hostsfile), NULL },
315 320 //#if defined(C3270)
316 321 // { OptKeymap, OPT_STRING, False, ResKeymap, offset(key_map), N_( "Specifies a keymap name and optional modifiers." ) },
317 322 // #endif
318 323  
319   -// #if defined(X3270_DBCS) /*[*/
  324 +// #if defined(X3270_DBCS)
320 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 329 // { OptMono, OPT_BOOLEAN, True, ResMono, offset(mono), N_( "Forces monochrome display" ) },
325   -// #endif /*]*/
  330 +// #endif
326 331 // { OptOnce, OPT_BOOLEAN, True, ResOnce, offset(once), NULL },
327 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 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 335 // { OptPrinterLu,OPT_STRING, False, ResPrinterLu, offset(printer_lu), NULL },
331   -#endif /*]*/
  336 +#endif
332 337 // { OptProxy, OPT_STRING, False, ResProxy, offset(proxy), N_( "Proxy server (type:host[:port])" ) },
333   -#if defined(S3270) /*[*/
  338 +#if defined(S3270)
334 339 { OptScripted, OPT_NOP, False, ResScripted, NULL, NULL },
335   -#endif /*]*/
336   -//#if defined(C3270) /*[*/
  340 +#endif
  341 +//#if defined(C3270)
337 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 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 358 { "-xrm", OPT_XRM, False, NULL, NULL, NULL },
354 359 { LAST_ARG, OPT_DONE, False, NULL, NULL, NULL },
355 360 { CN, OPT_SKIP2, False, NULL, NULL, NULL }
356 361 };
  362 +*/
357 363  
358 364 /*
359 365 * Get library option table
360 366 */
  367 + /*
361 368 const struct lib3270_option * get_3270_option_table(int sz)
362 369 {
363 370 if(sz == sizeof(struct lib3270_option))
364 371 return options;
365 372 return NULL;
366 373 }
  374 +*/
367 375  
368 376 /*
369 377 * Parse '-xrm' options.
... ... @@ -371,110 +379,111 @@ const struct lib3270_option * get_3270_option_table(int sz)
371 379 * {c,s,tcl}3270.<resourcename>: value
372 380 * Asterisks and class names need not apply.
373 381 */
374   -
  382 +/*
375 383 static struct {
376 384 const char *name;
377 385 void *address;
378 386 enum resource_type { XRM_STRING, XRM_BOOLEAN, XRM_INT } type;
379 387 } resources[] = {
380   - { ResAllBold, offset(all_bold), XRM_STRING },
  388 +// { ResAllBold, offset(all_bold), XRM_STRING },
381 389 // { ResAltScreen, offset(altscreen), XRM_STRING },
382 390 // { ResBsdTm, offset(bsd_tm), XRM_BOOLEAN },
383   -#if defined(HAVE_LIBSSL) /*[*/
  391 +#if defined(HAVE_LIBSSL)
384 392 { ResCertFile, offset(cert_file), XRM_STRING },
385   -#endif /*]*/
  393 +#endif
386 394 // { ResCharset, offset(charset), XRM_STRING },
387 395 // { ResColor8, offset(color8), XRM_BOOLEAN },
388   - { ResConfDir, offset(conf_dir), XRM_STRING },
  396 +// { ResConfDir, offset(conf_dir), XRM_STRING },
389 397 // { ResDefScreen, offset(defscreen), XRM_STRING },
390   -#if defined(X3270_ANSI) /*[*/
  398 +#if defined(X3270_ANSI)
391 399 // { ResEof, offset(eof), XRM_STRING },
392 400 // { ResErase, offset(erase), XRM_STRING },
393   -#endif /*]*/
  401 +#endif
394 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 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 410 // { ResHostsFile, offset(hostsfile), XRM_STRING },
403   -#if defined(X3270_ANSI) /*[*/
  411 +#if defined(X3270_ANSI)
404 412 // { ResIcrnl, offset(icrnl), XRM_BOOLEAN },
405 413 // { ResInlcr, offset(inlcr), XRM_BOOLEAN },
406 414 // { ResOnlcr, offset(onlcr), XRM_BOOLEAN },
407 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 420 //#if defined(C3270) && defined(_WIN32)
413 421 // { ResHighlightUnderline, offset(highlight_underline), XRM_BOOLEAN },
414 422 //#endif
415   -#if defined(C3270) && defined(X3270_SCRIPT) /*[*/
  423 +#if defined(C3270) && defined(X3270_SCRIPT)
416 424 { ResIdleCommand,offset(idle_command), XRM_STRING },
417 425 { ResIdleCommandEnabled,offset(idle_command_enabled), XRM_BOOLEAN },
418 426 { ResIdleTimeout,offset(idle_timeout), XRM_STRING },
419   -#endif /*]*/
420   -#if defined(C3270) /*[*/
  427 +#endif
  428 +#if defined(C3270)
421 429 // { ResKeymap, offset(key_map), XRM_STRING },
422   - { ResMetaEscape,offset(meta_escape), XRM_STRING },
  430 +// { ResMetaEscape,offset(meta_escape), XRM_STRING },
423 431 // { ResCursesKeypad,offset(curses_keypad),XRM_BOOLEAN },
424 432 // { ResCbreak, offset(cbreak_mode), XRM_BOOLEAN },
425   -#endif /*]*/
426   -#if defined(X3270_ANSI) /*[*/
  433 +#endif
  434 +#if defined(X3270_ANSI)
427 435 // { ResKill, offset(kill), XRM_STRING },
428 436 // { ResLnext, offset(lnext), XRM_STRING },
429   -#endif /*]*/
  437 +#endif
430 438 // { ResLoginMacro,offset(login_macro), XRM_STRING },
431 439 // { ResM3279, offset(m3279), XRM_BOOLEAN },
432 440 // { ResModel, offset(model), XRM_STRING },
433 441 // { ResModifiedSel, offset(modified_sel), XRM_BOOLEAN },
434   -//#if defined(C3270) && !defined(_WIN32) /*[*/
  442 +//#if defined(C3270) && !defined(_WIN32)
435 443 // { ResMono, offset(mono), XRM_BOOLEAN },
436   -//#endif /*]*/
  444 +//#endif
437 445 // { ResNumericLock, offset(numeric_lock), XRM_BOOLEAN },
438 446 // { ResOerrLock, offset(oerr_lock), XRM_BOOLEAN },
439 447 // { ResOversize, offset(oversize), XRM_STRING },
440 448 // { ResPort, offset(port), XRM_STRING },
441   -#if defined(C3270) /*[*/
  449 +#if defined(C3270)
442 450 // { ResPrinterLu, offset(printer_lu), XRM_STRING },
443 451 { ResPrintTextCommand, NULL, XRM_STRING },
444   -#endif /*]*/
  452 +#endif
445 453 // { ResProxy, offset(proxy), XRM_STRING },
446   -#if defined(X3270_ANSI) /*[*/
  454 +#if defined(X3270_ANSI)
447 455 // { ResQuit, offset(quit), XRM_STRING },
448 456 // { ResRprnt, offset(rprnt), XRM_STRING },
449   -#endif /*]*/
  457 +#endif
450 458 // { ResSecure, offset(secure), XRM_BOOLEAN },
451 459 // { ResTermName, offset(termname), XRM_STRING },
452   -#if defined(WC3270) /*[*/
  460 +#if defined(WC3270)
453 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 470 { ResTraceMonitor,offset(trace_monitor),XRM_BOOLEAN },
463   -#endif /*]*/
464   -#endif /*]*/
  471 +#endif
  472 +#endif
465 473 // { ResTypeahead, offset(typeahead), XRM_BOOLEAN },
466 474 // { ResUnlockDelay,offset(unlock_delay), XRM_BOOLEAN },
467   -#if defined(X3270_ANSI) /*[*/
  475 +#if defined(X3270_ANSI)
468 476 // { ResWerase, offset(werase), XRM_STRING },
469   -#endif /*]*/
  477 +#endif
470 478  
471 479 { CN, 0, XRM_STRING }
472 480 };
  481 +*/
473 482  
474 483 /*
475 484 * Compare two strings, allowing the second to differ by uppercasing the
476 485 * first character of the second.
477   - */
  486 + */ /*
478 487 static int
479 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 497 return 0;
489 498 return -1;
490 499 }
491   -
  500 +*/
492 501  
493 502 #if !defined(ME) /*[*/
494 503 #if defined(C3270) /*[*/
... ... @@ -504,6 +513,7 @@ strncapcmp(const char *known, const char *unknown, unsigned unk_len)
504 513 #endif /*]*/
505 514 #endif /*]*/
506 515  
  516 +/*
507 517 void
508 518 parse_xrm(const char *arg, const char *where)
509 519 {
... ... @@ -516,13 +526,13 @@ parse_xrm(const char *arg, const char *where)
516 526 char *t;
517 527 void *address = NULL;
518 528 enum resource_type type = XRM_STRING;
519   -#if defined(C3270) /*[*/
  529 +#if defined(C3270)
520 530 char *add_buf = CN;
521 531 char *hide;
522 532 Boolean arbitrary = False;
523   -#endif /*]*/
  533 +#endif
524 534  
525   - /* Enforce "-3270." or "-3270*" or "*". */
  535 + // Enforce "-3270." or "-3270*" or "*".
526 536 if (!strncmp(arg, me_dot, sizeof(me_dot)-1))
527 537 match_len = sizeof(me_dot)-1;
528 538 else if (!strncmp(arg, me_star, sizeof(me_star)-1))
... ... @@ -536,7 +546,7 @@ parse_xrm(const char *arg, const char *where)
536 546 return;
537 547 }
538 548  
539   - /* Separate the parts. */
  549 + // Separate the parts.
540 550 s = arg + match_len;
541 551 while (*s && *s != ':' && !isspace(*s))
542 552 s++;
... ... @@ -556,22 +566,22 @@ parse_xrm(const char *arg, const char *where)
556 566 while (isspace(*s))
557 567 s++;
558 568  
559   - /* Look up the name. */
  569 + // Look up the name.
560 570 for (i = 0; resources[i].name != CN; i++) {
561 571 if (!strncapcmp(resources[i].name, arg + match_len, rnlen)) {
562 572 address = resources[i].address;
563 573 type = resources[i].type;
564   -#if defined(C3270) /*[*/
  574 +#if defined(C3270)
565 575 if (address == NULL) {
566 576 add_buf = lib3270_malloc(strlen(s) + 1);
567 577 address = add_buf;
568 578 }
569   -#endif /*]*/
  579 +#endif
570 580 break;
571 581 }
572 582 }
573 583  
574   -#if defined(C3270) /*[*/
  584 +#if defined(C3270)
575 585 if (address == NULL) {
576 586 if (!strncasecmp(ResKeymap ".", arg + match_len,
577 587 strlen(ResKeymap ".")) ||
... ... @@ -583,22 +593,22 @@ parse_xrm(const char *arg, const char *where)
583 593 strlen(ResCodepage ".")) ||
584 594 !strncasecmp("host.", arg + match_len, 5) ||
585 595 !strncasecmp("printer.", arg + match_len, 8) ||
586   -#if defined(_WIN32) /*[*/
  596 +#if defined(_WIN32)
587 597 !strncasecmp(ResHostColorFor, arg + match_len,
588 598 strlen(ResHostColorFor)) ||
589 599 !strncasecmp(ResConsoleColorForHostColor, arg + match_len,
590 600 strlen(ResConsoleColorForHostColor))
591   -#else /*][*/
  601 +#else
592 602 !strncasecmp(ResCursesColorFor, arg + match_len,
593 603 strlen(ResCursesColorFor))
594   -#endif /*]*/
  604 +#endif
595 605 ) {
596 606 address = &hide;
597 607 type = XRM_STRING;
598 608 arbitrary = True;
599 609 }
600 610 }
601   -#endif /*]*/
  611 +#endif
602 612 if (address == NULL) {
603 613 xs_warning("%s: Unknown resource name: %.*s",
604 614 where, (int)rnlen, arg + match_len);
... ... @@ -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 685 if (arbitrary) {
676 686 char *rsname;
677 687  
... ... @@ -680,10 +690,11 @@ parse_xrm(const char *arg, const char *where)
680 690 rsname[rnlen] = '\0';
681 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 698 int
688 699 read_resource_file(const char *filename, Boolean fatal)
689 700 {
... ... @@ -701,7 +712,7 @@ read_resource_file(const char *filename, Boolean fatal)
701 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 716 where = lib3270_malloc(strlen(filename) + 64);
706 717  
707 718 ilen = 0;
... ... @@ -712,15 +723,15 @@ read_resource_file(const char *filename, Boolean fatal)
712 723  
713 724 lno++;
714 725  
715   - /* Stip any trailing newline. */
  726 + // Stip any trailing newline.
716 727 sl = strlen(buf + ilen);
717 728 if (sl && (buf + ilen)[sl-1] == '\n')
718 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 735 for (bsl = False, s = buf + ilen, t = s; *s; s++) {
725 736 if (bsl) {
726 737 if (*s == 'n')
... ... @@ -737,12 +748,12 @@ read_resource_file(const char *filename, Boolean fatal)
737 748 }
738 749 *t = '\0';
739 750  
740   - /* Skip leading whitespace. */
  751 + // Skip leading whitespace.
741 752 s = buf;
742 753 while (isspace(*s))
743 754 s++;
744 755  
745   - /* Skip comments _before_ checking for line continuation. */
  756 + // Skip comments _before_ checking for line continuation.
746 757 if (*s == '!') {
747 758 ilen = 0;
748 759 continue;
... ... @@ -755,7 +766,7 @@ read_resource_file(const char *filename, Boolean fatal)
755 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 770 if (bsl) {
760 771 ilen += strlen(buf + ilen);
761 772 if (ilen >= sizeof(buf) - 1) {
... ... @@ -767,7 +778,7 @@ read_resource_file(const char *filename, Boolean fatal)
767 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 782 sl = strlen(s);
772 783 while (sl && isspace(s[sl-1]))
773 784 s[--sl] = '\0';
... ... @@ -776,11 +787,11 @@ read_resource_file(const char *filename, Boolean fatal)
776 787 continue;
777 788 }
778 789  
779   - /* Digest it. */
  790 + // Digest it.
780 791 (void) sprintf(where, "%s:%d", filename, lno);
781 792 parse_xrm(s, where);
782 793  
783   - /* Get ready for the next iteration. */
  794 + // Get ready for the next iteration.
784 795 ilen = 0;
785 796 }
786 797 lib3270_free(where);
... ... @@ -788,29 +799,13 @@ read_resource_file(const char *filename, Boolean fatal)
788 799 }
789 800  
790 801 // Boolean flipped = False;
  802 +*/
791 803  
792 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 809 #ifdef DEBUG
815 810 extern void lib3270_initialize(void)
816 811 {
... ... @@ -818,11 +813,12 @@ extern void lib3270_initialize(void)
818 813 }
819 814 #endif
820 815  
  816 +
  817 +/*
821 818 void
822 819 action_output(const char *fmt, ...)
823 820 {
824 821 // TODO (perry#1#): Implement a callback to browse the text string.
825   -/*
826 822 va_list args;
827 823  
828 824 va_start(args, fmt);
... ... @@ -844,32 +840,6 @@ action_output(const char *fmt, ...)
844 840 (void) fprintf(aout, "%s\n", vmsgbuf);
845 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 20 /* glue.c */
21 21 // extern int parse_command_line(int argc, const char **argv, const char **cl_hostname);
22 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 24 LIB3270_INTERNAL void notify_ssl_error(H3270 *session, const char *title, const char *msg, const char *state, const char *alert);
25 25  
26 26 /* XtGlue.c */
... ...
popupsc.h
... ... @@ -15,4 +15,4 @@
15 15 /* Non-display version of popupsc.h */
16 16  
17 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 33 NETWORK_SOURCES = iocalls.c proxy.c
34 34  
35 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 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 992 {
993 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 46 LIB3270_INTERNAL const char * KeysymToString(KeySym k);
47 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 50 LIB3270_INTERNAL Boolean split_hier(char *label, char **base, char ***parents);
51 51  
52 52 typedef struct {
... ...