diff --git a/pw3270.cbp b/pw3270.cbp
index bd5b78a..ea40b34 100644
--- a/pw3270.cbp
+++ b/pw3270.cbp
@@ -9,8 +9,8 @@
-
-
+
+
@@ -20,8 +20,8 @@
-
-
+
+
@@ -35,308 +35,305 @@
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
-
-
+
+
+
-
-
-
+
+
+
+
-
-
-
-
+
+
-
-
+
+
+
-
-
-
+
+
-
-
+
-
+
+
+
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
-
-
-
+
-
+
-
+
+
-
-
+
+
+
+
-
-
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
-
-
-
-
+
+
-
-
+
-
+
-
+
+
+
+
-
-
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
-
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
-
-
-
+
+
+
+
+
-
-
-
-
-
+
-
+
+
-
-
+
+
-
-
+
-
+
+
-
-
+
+
-
-
+
-
+
+
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
-
-
+
+
-
-
+
-
+
+
-
-
+
-
+
-
+
+
-
-
+
+
-
-
+
-
+
-
+
-
+
+
-
-
+
+
+
-
-
-
+
-
-
-
-
-
-
+
+
+
diff --git a/src/include/lib3270/filetransfer.h b/src/include/lib3270/filetransfer.h
index 9943c39..ffd76ea 100644
--- a/src/include/lib3270/filetransfer.h
+++ b/src/include/lib3270/filetransfer.h
@@ -34,6 +34,7 @@
#define LIB3270_FILETRANSFER_INCLUDED 1
#include
+ #include
#define LIB3270_FT_OPTION_SEND 0x0000
@@ -85,6 +86,8 @@
int secspace;
int dft;
+ struct timeval starting_time; /**< Starting time */
+
const char * local; /**< Local filename */
const char * remote; /**< Remote filename */
diff --git a/src/lib3270/actions.c b/src/lib3270/actions.c
index 08727b3..82d7e5f 100644
--- a/src/lib3270/actions.c
+++ b/src/lib3270/actions.c
@@ -59,6 +59,8 @@
#include "screenc.h"
#endif /*]*/
+#error Deprecated
+
/*
#if defined(X3270_DISPLAY)
diff --git a/src/lib3270/appres.h b/src/lib3270/appres.h
index 1699efd..6cb7937 100644
--- a/src/lib3270/appres.h
+++ b/src/lib3270/appres.h
@@ -107,7 +107,7 @@ typedef struct {
*/
#if defined(X3270_DISPLAY) || defined(C3270)
// char *key_map;
- char *compose_map;
+// char *compose_map;
// char *printer_lu;
#endif
/*
@@ -136,30 +136,31 @@ typedef struct {
#endif
#endif
*/
-#if defined(X3270_DBCS) /*[*/
- char *local_encoding;
-#endif /*]*/
+//#if defined(X3270_DBCS)
+// char *local_encoding;
+//#endif
+
#if defined(C3270) /*[*/
- char *meta_escape;
- char *all_bold;
+// char *meta_escape;
+// char *all_bold;
// char *altscreen;
// char *defscreen;
#endif /*]*/
- char *conf_dir;
+// char *conf_dir;
char *model;
// char *hostsfile;
// char *port;
// char *charset;
// char *termname;
// char *login_macro;
- char *macros;
+// char *macros;
#if defined(X3270_TRACE) /*[*/
-#if !defined(_WIN32) /*[*/
- char *trace_dir;
-#endif /*]*/
- char *trace_file;
- char *screentrace_file;
- char *trace_file_size;
+//#if !defined(_WIN32)
+// char *trace_dir;
+//#endif
+// char *trace_file;
+// char *screentrace_file;
+// char *trace_file_size;
/*
#if defined(X3270_DISPLAY) || defined(WC3270)
char trace_monitor;
@@ -169,13 +170,13 @@ typedef struct {
#endif /*]*/
// char *oversize;
#if defined(X3270_FT) /*[*/
- char *ft_command;
+// char *ft_command;
int dft_buffer_size;
#endif /*]*/
- char *connectfile_name;
- char *idle_command;
- char idle_command_enabled;
- char *idle_timeout;
+// char *connectfile_name;
+// char *idle_command;
+// char idle_command_enabled;
+// char *idle_timeout;
/*
#if defined(X3270_SCRIPT)
diff --git a/src/lib3270/ft.c b/src/lib3270/ft.c
index 059c907..7053385 100644
--- a/src/lib3270/ft.c
+++ b/src/lib3270/ft.c
@@ -86,7 +86,7 @@ Boolean remap_flag = True; // Remap ASCII<->EBCDIC
unsigned long ft_length = 0; // Length of transfer
static Boolean ft_is_cut; // File transfer is CUT-style
-static struct timeval starting_time; // Starting time
+// static struct timeval starting_time; // Starting time
// static const struct filetransfer_callbacks *callbacks = NULL; // Callbacks to main application
@@ -193,7 +193,7 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state);
{
H3270FT * ftHandle = NULL;
FILE * ft_local_file = NULL;
- unsigned long ft_length = 0L;
+// unsigned long length = 0L;
// trace("%s(%s)",__FUNCTION__,local);
if(!lib3270_connected(session))
@@ -248,7 +248,6 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state);
ftHandle->host = session;
ftHandle->flags = flags;
ftHandle->local_file = ft_local_file;
- ftHandle->length = ft_length;
ftHandle->state = LIB3270_FT_STATE_AWAIT_ACK;
ftHandle->complete = def_complete;
ftHandle->message = def_message;
@@ -306,9 +305,10 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state);
return errno ? errno : -1;
}
- ft_length = ftell(ft->local_file);
+ ft->length = ftell(ft->local_file);
- lib3270_write_log(ft->host,"ft","Sending file %s (%ld bytes)",ft->local,ft_length);
+
+ lib3270_write_log(ft->host,"ft","Sending file %s (%ld bytes)",ft->local,ft->length);
rewind(ft->local_file);
}
@@ -414,8 +414,8 @@ void ft_complete(H3270FT *session, const char *errmsg)
(void) gettimeofday(&t1, (struct timezone *)NULL);
kbytes_sec = (double)ft_length / 1024.0 /
- ((double)(t1.tv_sec - starting_time.tv_sec) +
- (double)(t1.tv_usec - starting_time.tv_usec) / 1.0e6);
+ ((double)(t1.tv_sec - session->starting_time.tv_sec) +
+ (double)(t1.tv_usec - session->starting_time.tv_usec) / 1.0e6);
// Close the local file.
if(session->local_file)
@@ -470,8 +470,8 @@ void ft_update_length(H3270FT *session)
(void) gettimeofday(&t1, (struct timezone *)NULL);
kbytes_sec = (double)ft_length / 1024.0 /
- ((double)(t1.tv_sec - starting_time.tv_sec) +
- (double)(t1.tv_usec - starting_time.tv_usec) / 1.0e6);
+ ((double)(t1.tv_sec - session->starting_time.tv_sec) +
+ (double)(t1.tv_usec - session->starting_time.tv_usec) / 1.0e6);
}
session->update(session,ft_length,session->length,kbytes_sec);
@@ -486,7 +486,7 @@ void ft_running(H3270FT *h, Boolean is_cut)
ft_is_cut = is_cut;
ft_length = 0;
- (void) gettimeofday(&starting_time, (struct timezone *)NULL);
+ gettimeofday(&h->starting_time, (struct timezone *)NULL);
if (h->state == FT_AWAIT_ACK)
set_ft_state(h,FT_RUNNING);
diff --git a/src/lib3270/globals.h b/src/lib3270/globals.h
index 43c5011..5dec40c 100644
--- a/src/lib3270/globals.h
+++ b/src/lib3270/globals.h
@@ -158,7 +158,7 @@ LIB3270_INTERNAL const char * build_rpq_timestamp;
LIB3270_INTERNAL const char * build_rpq_version;
LIB3270_INTERNAL const char * build_rpq_revision;
-LIB3270_INTERNAL int children;
+// LIB3270_INTERNAL int children;
#if defined(X3270_DBCS) /*[*/
LIB3270_INTERNAL Boolean dbcs;
@@ -170,7 +170,7 @@ LIB3270_INTERNAL int children;
// LIB3270_INTERNAL char *efontname;
LIB3270_INTERNAL Boolean ever_3270;
-LIB3270_INTERNAL Boolean exiting;
+// LIB3270_INTERNAL Boolean exiting;
/*
#if defined(X3270_DISPLAY)
@@ -192,7 +192,7 @@ LIB3270_INTERNAL Boolean exiting;
//LIB3270_INTERNAL char *hostname;
#if defined(X3270_DBCS) /*[*/
- LIB3270_INTERNAL char *local_encoding;
+// LIB3270_INTERNAL char *local_encoding;
#if defined(X3270_DISPLAY) /*[*/
LIB3270_INTERNAL char *locale_name;
diff --git a/src/lib3270/glue.c b/src/lib3270/glue.c
index 2260d28..712fd2d 100644
--- a/src/lib3270/glue.c
+++ b/src/lib3270/glue.c
@@ -49,6 +49,7 @@
#include
#include
+#include
#include "appres.h"
#include "3270ds.h"
@@ -100,15 +101,15 @@
#define LAST_ARG "--"
/*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/
- const char * programname;
+// const char * programname;
AppRes appres;
- int children = 0;
- Boolean exiting = False;
+// int children = 0;
+// Boolean exiting = False;
// char * command_string = CN;
-#if defined(WC3270) || defined(LIB3270)/*[*/
-char *profile_name = CN;
-#endif /*]*/
+// #if defined(WC3270) || defined(LIB3270)
+// char *profile_name = CN;
+// #endif
/*
* Set default options
@@ -163,9 +164,9 @@ static void initialize(void)
// appres.typeahead = True;
appres.debug_tracing = True;
-#if defined(C3270) /*[*/
- appres.compose_map = "latin1";
-#endif /*]*/
+//#if defined(C3270)
+// appres.compose_map = "latin1";
+//#endif
appres.model = "";
// appres.hostsfile = CN;
@@ -182,13 +183,15 @@ static void initialize(void)
//#endif /*]*/
// appres.termname = CN;
- appres.macros = CN;
+// appres.macros = CN;
#if defined(X3270_TRACE) /*[*/
-#if !defined(_WIN32) /*[*/
+/*
+#if !defined(_WIN32)
appres.trace_dir = "/tmp";
-#endif /*]*/
+#endif
+*/
/*
#if defined(X3270_DISPLAY) || defined(WC3270)
@@ -201,7 +204,7 @@ static void initialize(void)
// appres.oversize = CN;
#if defined(C3270) /*[*/
- appres.meta_escape = "auto";
+// appres.meta_escape = "auto";
// appres.curses_keypad = True;
// appres.cbreak_mode = False;
#endif /*]*/
@@ -291,79 +294,84 @@ int lib3270_unloaded(void)
#define offset(n) (void *) &appres.n
#define toggle_offset(index) offset(toggle[index].value)
+/*
+
static const struct lib3270_option options[] =
{
// TODO (perry#5#): Add option descriptions.
-//#if defined(C3270) /*[*/
+//#if defined(C3270)
// { OptAllBold, OPT_BOOLEAN, True, ResAllBold, offset(all_bold_on), NULL },
// { OptAltScreen,OPT_STRING, False, ResAltScreen, offset(altscreen), NULL },
-//#endif /*]*/
+//#endif
// { OptAplMode, OPT_BOOLEAN, True, ResAplMode, offset(apl_mode), NULL },
-#if defined(C3270) /*[*/
+#if defined(C3270)
// { OptCbreak, OPT_BOOLEAN, True, ResCbreak, offset(cbreak_mode), NULL },
-#endif /*]*/
-#if defined(HAVE_LIBSSL) /*[*/
+#endif
+#if defined(HAVE_LIBSSL)
{ OptCertFile, OPT_STRING, False, ResCertFile, offset(cert_file), NULL },
-#endif /*]*/
+#endif
// { OptCharset, OPT_STRING, False, ResCharset, offset(charset), NULL },
{ OptClear, OPT_SKIP2, False, NULL, NULL, NULL },
// { OptDefScreen,OPT_STRING, False, ResDefScreen, offset(defscreen), NULL },
//#if defined(X3270_TRACE)
// { OptDsTrace, OPT_BOOLEAN, True, ResDsTrace, toggle_offset(DS_TRACE), NULL },
-//#endif /*]*/
+//#endif
// { OptHostsFile,OPT_STRING, False, ResHostsFile, offset(hostsfile), NULL },
//#if defined(C3270)
// { OptKeymap, OPT_STRING, False, ResKeymap, offset(key_map), N_( "Specifies a keymap name and optional modifiers." ) },
// #endif
-// #if defined(X3270_DBCS) /*[*/
+// #if defined(X3270_DBCS)
// { OptLocalEncoding,OPT_STRING,False,ResLocalEncoding,offset(local_encoding), NULL },
-//#endif /*]*/
- { OptModel, OPT_STRING, False, ResKeymap, offset(model), N_( "Set terminal model (screen size)" ) },
-// #if !defined(_WIN32) /*[*/
+//#endif
+// { OptModel, OPT_STRING, False, ResKeymap, offset(model), N_( "Set terminal model (screen size)" ) },
+// #if !defined(_WIN32)
// { OptMono, OPT_BOOLEAN, True, ResMono, offset(mono), N_( "Forces monochrome display" ) },
-// #endif /*]*/
+// #endif
// { OptOnce, OPT_BOOLEAN, True, ResOnce, offset(once), NULL },
// { OptOversize, OPT_STRING, False, ResOversize, offset(oversize), N_( "Sets the screen dimensions to be larger than the default for the chosen model (COLSxROWS)." ) },
// { OptPort, OPT_STRING, False, ResPort, offset(port), N_( "The name of the default TCP port to connect" ) },
-#if defined(C3270) && !defined(LIB3270) /*[*/
+#if defined(C3270) && !defined(LIB3270)
// { OptPrinterLu,OPT_STRING, False, ResPrinterLu, offset(printer_lu), NULL },
-#endif /*]*/
+#endif
// { OptProxy, OPT_STRING, False, ResProxy, offset(proxy), N_( "Proxy server (type:host[:port])" ) },
-#if defined(S3270) /*[*/
+#if defined(S3270)
{ OptScripted, OPT_NOP, False, ResScripted, NULL, NULL },
-#endif /*]*/
-//#if defined(C3270) /*[*/
+#endif
+//#if defined(C3270)
// { OptSecure, OPT_BOOLEAN, True, ResSecure, offset(secure), NULL },
-//#endif /*]*/
- { OptSet, OPT_SKIP2, False, NULL, NULL, NULL },
-#if defined(X3270_SCRIPT) /*[*/
- { OptSocket, OPT_BOOLEAN, True, ResSocket, offset(socket), NULL },
-#endif /*]*/
+//#endif
+// { OptSet, OPT_SKIP2, False, NULL, NULL, NULL },
+#if defined(X3270_SCRIPT)
+// { OptSocket, OPT_BOOLEAN, True, ResSocket, offset(socket), NULL },
+#endif
// { OptTermName, OPT_STRING, False, ResTermName, offset(termname), N_( "Specifies the terminal name to be transmitted over the telnet connection." ) },
-#if defined(WC3270) /*[*/
- { OptTitle, OPT_STRING, False, ResTitle, offset(title), NULL },
-#endif /*]*/
-#if defined(X3270_TRACE) /*[*/
- { OptTraceFile,OPT_STRING, False, ResTraceFile, offset(trace_file), NULL },
- { OptTraceFileSize,OPT_STRING,False,ResTraceFileSize,offset(trace_file_size), NULL },
-#endif /*]*/
+#if defined(WC3270)
+// { OptTitle, OPT_STRING, False, ResTitle, offset(title), NULL },
+#endif
+#if defined(X3270_TRACE)
+// { OptTraceFile,OPT_STRING, False, ResTraceFile, offset(trace_file), NULL },
+// { OptTraceFileSize,OPT_STRING,False,ResTraceFileSize,offset(trace_file_size), NULL },
+#endif
{ "-xrm", OPT_XRM, False, NULL, NULL, NULL },
{ LAST_ARG, OPT_DONE, False, NULL, NULL, NULL },
{ CN, OPT_SKIP2, False, NULL, NULL, NULL }
};
+*/
/*
* Get library option table
*/
+ /*
const struct lib3270_option * get_3270_option_table(int sz)
{
if(sz == sizeof(struct lib3270_option))
return options;
return NULL;
}
+*/
/*
* Parse '-xrm' options.
@@ -371,110 +379,111 @@ const struct lib3270_option * get_3270_option_table(int sz)
* {c,s,tcl}3270.: value
* Asterisks and class names need not apply.
*/
-
+/*
static struct {
const char *name;
void *address;
enum resource_type { XRM_STRING, XRM_BOOLEAN, XRM_INT } type;
} resources[] = {
- { ResAllBold, offset(all_bold), XRM_STRING },
+// { ResAllBold, offset(all_bold), XRM_STRING },
// { ResAltScreen, offset(altscreen), XRM_STRING },
// { ResBsdTm, offset(bsd_tm), XRM_BOOLEAN },
-#if defined(HAVE_LIBSSL) /*[*/
+#if defined(HAVE_LIBSSL)
{ ResCertFile, offset(cert_file), XRM_STRING },
-#endif /*]*/
+#endif
// { ResCharset, offset(charset), XRM_STRING },
// { ResColor8, offset(color8), XRM_BOOLEAN },
- { ResConfDir, offset(conf_dir), XRM_STRING },
+// { ResConfDir, offset(conf_dir), XRM_STRING },
// { ResDefScreen, offset(defscreen), XRM_STRING },
-#if defined(X3270_ANSI) /*[*/
+#if defined(X3270_ANSI)
// { ResEof, offset(eof), XRM_STRING },
// { ResErase, offset(erase), XRM_STRING },
-#endif /*]*/
+#endif
// { ResExtended, offset(extended), XRM_BOOLEAN },
-#if defined(X3270_FT) /*[*/
- { ResFtCommand, offset(ft_command), XRM_STRING },
+#if defined(X3270_FT)
+// { ResFtCommand, offset(ft_command), XRM_STRING },
{ ResDftBufferSize,offset(dft_buffer_size),XRM_INT },
-#endif /*]*/
-#if defined(WC3270) /*[*/
- { "hostname", offset(hostname), XRM_STRING },
-#endif /*]*/
+#endif
+//#if defined(WC3270)
+// { "hostname", offset(hostname), XRM_STRING },
+//#endif
// { ResHostsFile, offset(hostsfile), XRM_STRING },
-#if defined(X3270_ANSI) /*[*/
+#if defined(X3270_ANSI)
// { ResIcrnl, offset(icrnl), XRM_BOOLEAN },
// { ResInlcr, offset(inlcr), XRM_BOOLEAN },
// { ResOnlcr, offset(onlcr), XRM_BOOLEAN },
// { ResIntr, offset(intr), XRM_STRING },
-#endif /*]*/
-#if defined(X3270_SCRIPT) /*[*/
- { ResPluginCommand, offset(plugin_command), XRM_STRING },
-#endif /*]*/
+#endif
+//#if defined(X3270_SCRIPT)
+// { ResPluginCommand, offset(plugin_command), XRM_STRING },
+//#endif
//#if defined(C3270) && defined(_WIN32)
// { ResHighlightUnderline, offset(highlight_underline), XRM_BOOLEAN },
//#endif
-#if defined(C3270) && defined(X3270_SCRIPT) /*[*/
+#if defined(C3270) && defined(X3270_SCRIPT)
{ ResIdleCommand,offset(idle_command), XRM_STRING },
{ ResIdleCommandEnabled,offset(idle_command_enabled), XRM_BOOLEAN },
{ ResIdleTimeout,offset(idle_timeout), XRM_STRING },
-#endif /*]*/
-#if defined(C3270) /*[*/
+#endif
+#if defined(C3270)
// { ResKeymap, offset(key_map), XRM_STRING },
- { ResMetaEscape,offset(meta_escape), XRM_STRING },
+// { ResMetaEscape,offset(meta_escape), XRM_STRING },
// { ResCursesKeypad,offset(curses_keypad),XRM_BOOLEAN },
// { ResCbreak, offset(cbreak_mode), XRM_BOOLEAN },
-#endif /*]*/
-#if defined(X3270_ANSI) /*[*/
+#endif
+#if defined(X3270_ANSI)
// { ResKill, offset(kill), XRM_STRING },
// { ResLnext, offset(lnext), XRM_STRING },
-#endif /*]*/
+#endif
// { ResLoginMacro,offset(login_macro), XRM_STRING },
// { ResM3279, offset(m3279), XRM_BOOLEAN },
// { ResModel, offset(model), XRM_STRING },
// { ResModifiedSel, offset(modified_sel), XRM_BOOLEAN },
-//#if defined(C3270) && !defined(_WIN32) /*[*/
+//#if defined(C3270) && !defined(_WIN32)
// { ResMono, offset(mono), XRM_BOOLEAN },
-//#endif /*]*/
+//#endif
// { ResNumericLock, offset(numeric_lock), XRM_BOOLEAN },
// { ResOerrLock, offset(oerr_lock), XRM_BOOLEAN },
// { ResOversize, offset(oversize), XRM_STRING },
// { ResPort, offset(port), XRM_STRING },
-#if defined(C3270) /*[*/
+#if defined(C3270)
// { ResPrinterLu, offset(printer_lu), XRM_STRING },
{ ResPrintTextCommand, NULL, XRM_STRING },
-#endif /*]*/
+#endif
// { ResProxy, offset(proxy), XRM_STRING },
-#if defined(X3270_ANSI) /*[*/
+#if defined(X3270_ANSI)
// { ResQuit, offset(quit), XRM_STRING },
// { ResRprnt, offset(rprnt), XRM_STRING },
-#endif /*]*/
+#endif
// { ResSecure, offset(secure), XRM_BOOLEAN },
// { ResTermName, offset(termname), XRM_STRING },
-#if defined(WC3270) /*[*/
+#if defined(WC3270)
{ ResTitle, offset(title), XRM_STRING },
-#endif /*]*/
-#if defined(X3270_TRACE) /*[*/
-#if !defined(_WIN32) /*[*/
- { ResTraceDir, offset(trace_dir), XRM_STRING },
-#endif /*]*/
- { ResTraceFile, offset(trace_file), XRM_STRING },
- { ResTraceFileSize,offset(trace_file_size),XRM_STRING },
-#if defined(WC3270) /*[*/
+#endif
+#if defined(X3270_TRACE)
+//#if !defined(_WIN32)
+// { ResTraceDir, offset(trace_dir), XRM_STRING },
+//#endif
+// { ResTraceFile, offset(trace_file), XRM_STRING },
+// { ResTraceFileSize,offset(trace_file_size),XRM_STRING },
+#if defined(WC3270)
{ ResTraceMonitor,offset(trace_monitor),XRM_BOOLEAN },
-#endif /*]*/
-#endif /*]*/
+#endif
+#endif
// { ResTypeahead, offset(typeahead), XRM_BOOLEAN },
// { ResUnlockDelay,offset(unlock_delay), XRM_BOOLEAN },
-#if defined(X3270_ANSI) /*[*/
+#if defined(X3270_ANSI)
// { ResWerase, offset(werase), XRM_STRING },
-#endif /*]*/
+#endif
{ CN, 0, XRM_STRING }
};
+*/
/*
* Compare two strings, allowing the second to differ by uppercasing the
* first character of the second.
- */
+ */ /*
static int
strncapcmp(const char *known, const char *unknown, unsigned unk_len)
{
@@ -488,7 +497,7 @@ strncapcmp(const char *known, const char *unknown, unsigned unk_len)
return 0;
return -1;
}
-
+*/
#if !defined(ME) /*[*/
#if defined(C3270) /*[*/
@@ -504,6 +513,7 @@ strncapcmp(const char *known, const char *unknown, unsigned unk_len)
#endif /*]*/
#endif /*]*/
+/*
void
parse_xrm(const char *arg, const char *where)
{
@@ -516,13 +526,13 @@ parse_xrm(const char *arg, const char *where)
char *t;
void *address = NULL;
enum resource_type type = XRM_STRING;
-#if defined(C3270) /*[*/
+#if defined(C3270)
char *add_buf = CN;
char *hide;
Boolean arbitrary = False;
-#endif /*]*/
+#endif
- /* Enforce "-3270." or "-3270*" or "*". */
+ // Enforce "-3270." or "-3270*" or "*".
if (!strncmp(arg, me_dot, sizeof(me_dot)-1))
match_len = sizeof(me_dot)-1;
else if (!strncmp(arg, me_star, sizeof(me_star)-1))
@@ -536,7 +546,7 @@ parse_xrm(const char *arg, const char *where)
return;
}
- /* Separate the parts. */
+ // Separate the parts.
s = arg + match_len;
while (*s && *s != ':' && !isspace(*s))
s++;
@@ -556,22 +566,22 @@ parse_xrm(const char *arg, const char *where)
while (isspace(*s))
s++;
- /* Look up the name. */
+ // Look up the name.
for (i = 0; resources[i].name != CN; i++) {
if (!strncapcmp(resources[i].name, arg + match_len, rnlen)) {
address = resources[i].address;
type = resources[i].type;
-#if defined(C3270) /*[*/
+#if defined(C3270)
if (address == NULL) {
add_buf = lib3270_malloc(strlen(s) + 1);
address = add_buf;
}
-#endif /*]*/
+#endif
break;
}
}
-#if defined(C3270) /*[*/
+#if defined(C3270)
if (address == NULL) {
if (!strncasecmp(ResKeymap ".", arg + match_len,
strlen(ResKeymap ".")) ||
@@ -583,22 +593,22 @@ parse_xrm(const char *arg, const char *where)
strlen(ResCodepage ".")) ||
!strncasecmp("host.", arg + match_len, 5) ||
!strncasecmp("printer.", arg + match_len, 8) ||
-#if defined(_WIN32) /*[*/
+#if defined(_WIN32)
!strncasecmp(ResHostColorFor, arg + match_len,
strlen(ResHostColorFor)) ||
!strncasecmp(ResConsoleColorForHostColor, arg + match_len,
strlen(ResConsoleColorForHostColor))
-#else /*][*/
+#else
!strncasecmp(ResCursesColorFor, arg + match_len,
strlen(ResCursesColorFor))
-#endif /*]*/
+#endif
) {
address = &hide;
type = XRM_STRING;
arbitrary = True;
}
}
-#endif /*]*/
+#endif
if (address == NULL) {
xs_warning("%s: Unknown resource name: %.*s",
where, (int)rnlen, arg + match_len);
@@ -670,8 +680,8 @@ parse_xrm(const char *arg, const char *where)
}
}
-#if defined(C3270) /*[*/
- /* Add a new, arbitrarily-named resource. */
+#if defined(C3270)
+ // Add a new, arbitrarily-named resource.
if (arbitrary) {
char *rsname;
@@ -680,10 +690,11 @@ parse_xrm(const char *arg, const char *where)
rsname[rnlen] = '\0';
add_resource(rsname, hide);
}
-#endif /*]*/
+#endif
}
+*/
-/* Read resources from a file. */
+/* Read resources from a file. */ /*
int
read_resource_file(const char *filename, Boolean fatal)
{
@@ -701,7 +712,7 @@ read_resource_file(const char *filename, Boolean fatal)
return -1;
}
- /* Merge in what's in the file into the resource database. */
+ // Merge in what's in the file into the resource database.
where = lib3270_malloc(strlen(filename) + 64);
ilen = 0;
@@ -712,15 +723,15 @@ read_resource_file(const char *filename, Boolean fatal)
lno++;
- /* Stip any trailing newline. */
+ // Stip any trailing newline.
sl = strlen(buf + ilen);
if (sl && (buf + ilen)[sl-1] == '\n')
(buf + ilen)[--sl] = '\0';
- /*
- * Translate backslash-n to real newline characters, and
- * remember if the last character is a backslash.
- */
+ //
+ //Translate backslash-n to real newline characters, and
+ // remember if the last character is a backslash.
+ //
for (bsl = False, s = buf + ilen, t = s; *s; s++) {
if (bsl) {
if (*s == 'n')
@@ -737,12 +748,12 @@ read_resource_file(const char *filename, Boolean fatal)
}
*t = '\0';
- /* Skip leading whitespace. */
+ // Skip leading whitespace.
s = buf;
while (isspace(*s))
s++;
- /* Skip comments _before_ checking for line continuation. */
+ // Skip comments _before_ checking for line continuation.
if (*s == '!') {
ilen = 0;
continue;
@@ -755,7 +766,7 @@ read_resource_file(const char *filename, Boolean fatal)
continue;
}
- /* If this line is a continuation, try again. */
+ // If this line is a continuation, try again.
if (bsl) {
ilen += strlen(buf + ilen);
if (ilen >= sizeof(buf) - 1) {
@@ -767,7 +778,7 @@ read_resource_file(const char *filename, Boolean fatal)
continue;
}
- /* Strip trailing whitespace and check for empty lines. */
+ // Strip trailing whitespace and check for empty lines.
sl = strlen(s);
while (sl && isspace(s[sl-1]))
s[--sl] = '\0';
@@ -776,11 +787,11 @@ read_resource_file(const char *filename, Boolean fatal)
continue;
}
- /* Digest it. */
+ // Digest it.
(void) sprintf(where, "%s:%d", filename, lno);
parse_xrm(s, where);
- /* Get ready for the next iteration. */
+ // Get ready for the next iteration.
ilen = 0;
}
lib3270_free(where);
@@ -788,29 +799,13 @@ read_resource_file(const char *filename, Boolean fatal)
}
// Boolean flipped = False;
+*/
/* Replacements for functions in popups.c. */
-#include
-
-Boolean error_popup_visible = False;
+// Boolean error_popup_visible = False;
-/* Pop up an error dialog, based on an error number. */
-void popup_an_errno(H3270 *session, int errn, const char *fmt, ...)
-{
- char vmsgbuf[4096];
- va_list args;
-
- va_start(args, fmt);
- (void) vsprintf(vmsgbuf, fmt, args);
- va_end(args);
-
- lib3270_write_log(session, "3270", "Error Popup:\n%s\nrc=%d (%s)",vmsgbuf,errn,strerror(errn));
-
- Error(NULL,vmsgbuf);
-}
-
#ifdef DEBUG
extern void lib3270_initialize(void)
{
@@ -818,11 +813,12 @@ extern void lib3270_initialize(void)
}
#endif
+
+/*
void
action_output(const char *fmt, ...)
{
// TODO (perry#1#): Implement a callback to browse the text string.
-/*
va_list args;
va_start(args, fmt);
@@ -844,32 +840,6 @@ action_output(const char *fmt, ...)
(void) fprintf(aout, "%s\n", vmsgbuf);
macro_output = True;
}
-*/
-}
-
-
-#if defined(_WIN32) /*[*/
-
-/* Missing parts for wc3270. */
-#include
-#define SECS_BETWEEN_EPOCHS 11644473600ULL
-#define SECS_TO_100NS 10000000ULL /* 10^7 */
-
-int
-gettimeofday(struct timeval *tv, void *ignored)
-{
- FILETIME t;
- ULARGE_INTEGER u;
-
- GetSystemTimeAsFileTime(&t);
- memcpy(&u, &t, sizeof(ULARGE_INTEGER));
-
- /* Isolate seconds and move epochs. */
- tv->tv_sec = (DWORD)((u.QuadPart / SECS_TO_100NS) -
- SECS_BETWEEN_EPOCHS);
- tv->tv_usec = (u.QuadPart % SECS_TO_100NS) / 10ULL;
- return 0;
}
-
-#endif /*]*/
+*/
diff --git a/src/lib3270/gluec.h b/src/lib3270/gluec.h
index fc01e8c..e1c5956 100644
--- a/src/lib3270/gluec.h
+++ b/src/lib3270/gluec.h
@@ -20,7 +20,7 @@
/* glue.c */
// extern int parse_command_line(int argc, const char **argv, const char **cl_hostname);
// extern int parse_program_parameters(int argc, const char **argv);
-LIB3270_INTERNAL void parse_xrm(const char *arg, const char *where);
+// LIB3270_INTERNAL void parse_xrm(const char *arg, const char *where);
LIB3270_INTERNAL void notify_ssl_error(H3270 *session, const char *title, const char *msg, const char *state, const char *alert);
/* XtGlue.c */
diff --git a/src/lib3270/popupsc.h b/src/lib3270/popupsc.h
index cad80ad..f5a8fce 100644
--- a/src/lib3270/popupsc.h
+++ b/src/lib3270/popupsc.h
@@ -15,4 +15,4 @@
/* Non-display version of popupsc.h */
LIB3270_INTERNAL void popup_an_errno(H3270 *session, int errn, const char *fmt, ...);
-LIB3270_INTERNAL void action_output(const char *fmt, ...);
+// LIB3270_INTERNAL void action_output(const char *fmt, ...);
diff --git a/src/lib3270/sources.mak b/src/lib3270/sources.mak
index 86ed9a5..751bc92 100644
--- a/src/lib3270/sources.mak
+++ b/src/lib3270/sources.mak
@@ -33,6 +33,6 @@ TERMINAL_SOURCES = bounds.c XtGlue.c ctlr.c util.c toggles.c screen.c selection.
NETWORK_SOURCES = iocalls.c proxy.c
# Full library sources
-SOURCES = $(TERMINAL_SOURCES) $(NETWORK_SOURCES) actions.c ft.c ft_cut.c ft_dft.c glue.c resources.c \
+SOURCES = $(TERMINAL_SOURCES) $(NETWORK_SOURCES) ft.c ft_cut.c ft_dft.c glue.c resources.c \
rpq.c see.c trace_ds.c paste.c macros.c fallbacks.c log.c
diff --git a/src/lib3270/util.c b/src/lib3270/util.c
index fbe69d4..5f35b48 100644
--- a/src/lib3270/util.c
+++ b/src/lib3270/util.c
@@ -992,3 +992,42 @@ LIB3270_EXPORT const char * lib3270_get_revision(void)
{
return build_rpq_revision;
}
+
+/* Pop up an error dialog, based on an error number. */
+void popup_an_errno(H3270 *session, int errn, const char *fmt, ...)
+{
+ va_list args;
+ char * text;
+
+ va_start(args, fmt);
+ text = lib3270_vsprintf(fmt, args);
+ va_end(args);
+
+ lib3270_write_log(session, "3270", "Error Popup:\n%s\nrc=%d (%s)",text,errn,strerror(errn));
+
+ Error(session,text);
+
+ lib3270_free(text);
+}
+
+#if defined(_WIN32)
+
+#define SECS_BETWEEN_EPOCHS 11644473600ULL
+#define SECS_TO_100NS 10000000ULL /* 10^7 */
+
+int gettimeofday(struct timeval *tv, void *ignored)
+{
+ FILETIME t;
+ ULARGE_INTEGER u;
+
+ GetSystemTimeAsFileTime(&t);
+ memcpy(&u, &t, sizeof(ULARGE_INTEGER));
+
+ /* Isolate seconds and move epochs. */
+ tv->tv_sec = (DWORD)((u.QuadPart / SECS_TO_100NS) - SECS_BETWEEN_EPOCHS);
+ tv->tv_usec = (u.QuadPart % SECS_TO_100NS) / 10ULL;
+ return 0;
+}
+
+#endif
+
diff --git a/src/lib3270/utilc.h b/src/lib3270/utilc.h
index 4d057d1..8cb453a 100644
--- a/src/lib3270/utilc.h
+++ b/src/lib3270/utilc.h
@@ -46,7 +46,7 @@ LIB3270_INTERNAL void RemoveTimeOut(void *cookie);
LIB3270_INTERNAL const char * KeysymToString(KeySym k);
LIB3270_INTERNAL KeySym StringToKeysym(char *s);
-LIB3270_INTERNAL int read_resource_file(const char *filename, Boolean fatal);
+// LIB3270_INTERNAL int read_resource_file(const char *filename, Boolean fatal);
LIB3270_INTERNAL Boolean split_hier(char *label, char **base, char ***parents);
typedef struct {
--
libgit2 0.21.2