diff --git a/src/lib3270/appres.h b/src/lib3270/appres.h index 72c48ac..96aeed7 100644 --- a/src/lib3270/appres.h +++ b/src/lib3270/appres.h @@ -228,7 +228,7 @@ typedef struct { } AppRes, *AppResptr; -LIB3270_INTERNAL AppRes appres; +extern AppRes appres; // FIXME (perry#2#): Check for right implementation #define _( x ) x diff --git a/src/lib3270/ctlr.c b/src/lib3270/ctlr.c index c968745..4ddb39b 100644 --- a/src/lib3270/ctlr.c +++ b/src/lib3270/ctlr.c @@ -2841,6 +2841,7 @@ toggle_nop(H3270 *session, struct toggle *t unused, LIB3270_TOGGLE_TYPE tt unuse { } +/* int ctlr_get_rows(void) { return h3270.rows; @@ -2850,4 +2851,4 @@ int ctlr_get_cols(void) { return h3270.cols; } - +*/ diff --git a/src/lib3270/ctlr.h b/src/lib3270/ctlr.h index 577458c..3056bdf 100644 --- a/src/lib3270/ctlr.h +++ b/src/lib3270/ctlr.h @@ -17,8 +17,5 @@ * External declarations for ctlr.c data structures. */ -LIB3270_INTERNAL int buffer_addr; /**< buffer address */ -// LIB3270_INTERNAL int cursor_addr; /**< cursor address */ -LIB3270_INTERNAL struct ea *ea_buf; /**< 3270 device buffer */ -//LIB3270_INTERNAL Boolean formatted; /**< contains at least one field? */ -//LIB3270_INTERNAL Boolean is_altbuffer; /**< in alternate-buffer mode? */ +extern int buffer_addr; /**< buffer address */ +extern struct ea *ea_buf; /**< 3270 device buffer */ diff --git a/src/lib3270/ftc.h b/src/lib3270/ftc.h index ceda7aa..f6a67c9 100644 --- a/src/lib3270/ftc.h +++ b/src/lib3270/ftc.h @@ -24,7 +24,7 @@ LIB3270_INTERNAL Boolean ascii_flag; LIB3270_INTERNAL Boolean cr_flag; LIB3270_INTERNAL unsigned long ft_length; LIB3270_INTERNAL FILE *ft_local_file; -LIB3270_INTERNAL char *ft_local_filename; +extern char *ft_local_filename; LIB3270_INTERNAL Boolean ft_last_cr; LIB3270_INTERNAL Boolean remap_flag; diff --git a/src/lib3270/globals.h b/src/lib3270/globals.h index 86a9fc4..19b4036 100644 --- a/src/lib3270/globals.h +++ b/src/lib3270/globals.h @@ -145,7 +145,7 @@ enum iaction { LIB3270_INTERNAL int COLS; LIB3270_INTERNAL int ROWS; -LIB3270_INTERNAL H3270 h3270; +extern H3270 h3270; #if defined(X3270_DISPLAY) /*[*/ LIB3270_INTERNAL Atom a_3270, a_registry, a_encoding; @@ -209,7 +209,7 @@ LIB3270_INTERNAL Boolean no_login_host; LIB3270_INTERNAL Boolean non_tn3270e_host; // LIB3270_INTERNAL int ov_cols, ov_rows; LIB3270_INTERNAL Boolean passthru_host; -LIB3270_INTERNAL const char *programname; +extern const char *programname; LIB3270_INTERNAL char *qualified_host; LIB3270_INTERNAL char *reconnect_host; LIB3270_INTERNAL int screen_depth; diff --git a/src/lib3270/printer.c b/src/lib3270/printer.c index 428fede..f1e6f81 100644 --- a/src/lib3270/printer.c +++ b/src/lib3270/printer.c @@ -438,8 +438,7 @@ printer_start(const char *lu) NULL, &startupinfo, &process_information) == 0) { - popup_an_error("CreateProcess(%s) failed: %s", subcommand, - win32_strerror(GetLastError())); + popup_an_error(NULL,"CreateProcess(%s) failed: %s", subcommand,win32_strerror(GetLastError())); } printer_handle = process_information.hProcess; CloseHandle(process_information.hThread); @@ -599,8 +598,7 @@ printer_check(void) st_changed(ST_PRINTER, False); - popup_an_error("Printer process exited with status %d", - exit_code); + popup_an_error(NULL,"Printer process exited with status %d",exit_code); } } #endif /*]*/ diff --git a/src/lib3270/screen.c b/src/lib3270/screen.c index 6ca5d66..43f246f 100644 --- a/src/lib3270/screen.c +++ b/src/lib3270/screen.c @@ -688,6 +688,7 @@ void show_3270_popup_dialog(H3270 *session, LIB3270_NOTIFY type, const char *tit static int logpopup(H3270 *session, LIB3270_NOTIFY type, const char *title, const char *msg, const char *fmt, va_list arg) { lib3270_write_va_log(session,"lib3270",fmt,arg); + return 0; } void Error(H3270 *session, const char *fmt, ...) diff --git a/src/lib3270/selection.c b/src/lib3270/selection.c index 2ce2f31..412792f 100644 --- a/src/lib3270/selection.c +++ b/src/lib3270/selection.c @@ -166,8 +166,6 @@ LIB3270_EXPORT void lib3270_clear_selection(H3270 *session) for(a = 0; a < session->rows*session->cols; a++) { - unsigned short attr = ea_buf[a].attr; - if(ea_buf[a].attr & LIB3270_ATTR_SELECTED) { ea_buf[a].attr &= ~LIB3270_ATTR_SELECTED; diff --git a/src/lib3270/telnet.c b/src/lib3270/telnet.c index 06ecacd..5debf0b 100644 --- a/src/lib3270/telnet.c +++ b/src/lib3270/telnet.c @@ -390,33 +390,23 @@ static union { } haddr; socklen_t ha_len = sizeof(haddr); -#if defined(_WIN32) -void popup_a_sockerr(char *fmt, ...) -{ - va_list args; - char buffer[4096]; - - va_start(args, fmt); - vsprintf(buffer, fmt, args); - va_end(args); - - popup_system_error( N_( "Network error" ), buffer, win32_strerror(socket_errno())); - -} -#else void popup_a_sockerr(H3270 *session, char *fmt, ...) { +#if defined(_WIN32) + const char *msg = win32_strerror(socket_errno()); +#else + const char *msg = strerror(errno) +#endif // WIN32 va_list args; char buffer[4096]; va_start(args, fmt); - vsprintf(buffer, fmt, args); + vsnprintf(buffer, 4095, fmt, args); va_end(args); - popup_system_error(session, N_( "Network error" ), buffer, strerror(errno)); + popup_system_error(session, N_( "Network error" ), buffer, "%s", msg); } -#endif /* * net_connect @@ -2780,8 +2770,7 @@ tn3270e_nak(enum pds rv) } rsp_buf[rsp_len++] = IAC; rsp_buf[rsp_len++] = EOR; - trace_dsn("SENT TN3270E(RESPONSE NEGATIVE-RESPONSE %u) %s\n", - h_in->seq_number[0] << 8 | h_in->seq_number[1], neg); + trace_dsn("SENT TN3270E(RESPONSE NEGATIVE-RESPONSE %u) %s\n",h_in->seq_number[0] << 8 | h_in->seq_number[1], neg); net_rawout(rsp_buf, rsp_len); } diff --git a/src/lib3270/telnetc.h b/src/lib3270/telnetc.h index eb1a41e..dc3c25b 100644 --- a/src/lib3270/telnetc.h +++ b/src/lib3270/telnetc.h @@ -20,7 +20,8 @@ */ /* Output buffer. */ -LIB3270_INTERNAL unsigned char *obuf, *obptr; +extern unsigned char *obuf; +extern unsigned char *obptr; /* Spelled-out tty control character. */ struct ctl_char { -- libgit2 0.21.2