From 7e2e81e44c39433cdef1b3b2af12e8affd486065 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Wed, 23 May 2012 19:59:40 +0000 Subject: [PATCH] Removendo includes e globais que nao sao mais usados --- XtGlue.c | 2 +- ansi.c | 4 ++-- appres.h | 16 +++++++++------- charset.c | 2 +- ctlr.c | 10 +++++----- ft.c | 2 +- ft_cut.c | 2 +- ft_dft.c | 9 +++++---- globals.h | 2 ++ glue.c | 26 +++++++++++++------------- paste.c | 4 ++-- proxy.c | 2 +- rpq.c | 2 +- screen.c | 4 ++-- selection.c | 2 +- session.c | 13 ++++++------- toggles.c | 3 ++- trace_ds.c | 7 ++++--- 18 files changed, 59 insertions(+), 53 deletions(-) diff --git a/XtGlue.c b/XtGlue.c index e5c53a7..346ade5 100644 --- a/XtGlue.c +++ b/XtGlue.c @@ -41,7 +41,7 @@ // #include #if defined(_WIN32) - #include "appres.h" +// #include "appres.h" #include "trace_dsc.h" #include "xioc.h" #endif diff --git a/ansi.c b/ansi.c index 6728a28..a8f0485 100644 --- a/ansi.c +++ b/ansi.c @@ -43,7 +43,7 @@ #include #endif /*]*/ -#include "appres.h" +//#include "appres.h" // #include "ctlr.h" #if defined(X3270_DBCS) /*[*/ #include "3270ds.h" @@ -1715,7 +1715,7 @@ ansi_process(unsigned int c) // scroll_to_bottom(); #if defined(X3270_TRACE) /*[*/ - if (lib3270_get_toggle(&h3270,SCREEN_TRACE)) + if (lib3270_get_toggle(&h3270,LIB3270_TOGGLE_SCREEN_TRACE)) trace_char((char)c); #endif /*]*/ diff --git a/appres.h b/appres.h index 6cb7937..612996d 100644 --- a/appres.h +++ b/appres.h @@ -38,6 +38,8 @@ struct toggle { // #define toggle_toggle(t) { (t)->value = !(t)->value; } */ +#error Deprecated + #define toggled(ix) lib3270_get_toggle(NULL,ix) /* Application resources */ @@ -86,9 +88,9 @@ typedef struct { // char secure; // char oerr_lock; // char typeahead; - char debug_tracing; - char disconnect_clear; - char highlight_bold; +// char debug_tracing; +// char disconnect_clear; +// char highlight_bold; // char color8; // char bsd_tm; // char unlock_delay; @@ -171,7 +173,7 @@ typedef struct { // char *oversize; #if defined(X3270_FT) /*[*/ // char *ft_command; - int dft_buffer_size; +// int dft_buffer_size; #endif /*]*/ // char *connectfile_name; // char *idle_command; @@ -184,9 +186,9 @@ typedef struct { #endif */ -#if defined(HAVE_LIBSSL) /*[*/ - char *cert_file; -#endif /*]*/ +//#if defined(HAVE_LIBSSL) +// char *cert_file; +//#endif // char *proxy; /* Toggles */ diff --git a/charset.c b/charset.c index 63d37b0..62e8464 100644 --- a/charset.c +++ b/charset.c @@ -38,7 +38,7 @@ #include "globals.h" #include "resources.h" -#include "appres.h" +// #include "appres.h" #include "cg.h" #include "charsetc.h" diff --git a/ctlr.c b/ctlr.c index 84a1a7b..9e57b1b 100644 --- a/ctlr.c +++ b/ctlr.c @@ -41,7 +41,7 @@ #include "globals.h" #include #include "3270ds.h" -#include "appres.h" +//#include "appres.h" // #include "ctlr.h" #include "screen.h" #include "resources.h" @@ -2319,7 +2319,7 @@ ctlr_clear(H3270 *session, Boolean can_snap) /* Snap any data that is about to be lost into the trace file. */ if (ctlr_any_data()) { #if defined(X3270_TRACE) /*[*/ - if (can_snap && !trace_skipping && lib3270_get_toggle(session,SCREEN_TRACE)) + if (can_snap && !trace_skipping && lib3270_get_toggle(session,LIB3270_TOGGLE_SCREEN_TRACE)) trace_screen(); #endif /*]*/ // scroll_save(session->maxROWS, ever_3270 ? False : True); @@ -2379,7 +2379,7 @@ void ctlr_add(int baddr, unsigned char c, unsigned char cs) if (trace_primed && !IsBlank(oc)) { #if defined(X3270_TRACE) /*[*/ - if (lib3270_get_toggle(&h3270,SCREEN_TRACE)) + if (lib3270_get_toggle(&h3270,LIB3270_TOGGLE_SCREEN_TRACE)) trace_screen(); #endif /*]*/ trace_primed = False; @@ -2739,7 +2739,7 @@ void ticking_start(H3270 *session, Boolean anyway) if(session->set_timer) { - if(lib3270_get_toggle(&h3270,SHOW_TIMING) || anyway) + if(lib3270_get_toggle(&h3270,LIB3270_TOGGLE_SHOW_TIMING) || anyway) session->set_timer(session,1); } else @@ -2748,7 +2748,7 @@ void ticking_start(H3270 *session, Boolean anyway) mticking = True; - if (!lib3270_get_toggle(&h3270,SHOW_TIMING) && !anyway) + if (!lib3270_get_toggle(&h3270,LIB3270_TOGGLE_SHOW_TIMING) && !anyway) return; status_untiming(session); diff --git a/ft.c b/ft.c index 7053385..4733b0c 100644 --- a/ft.c +++ b/ft.c @@ -38,7 +38,7 @@ #include #include -#include "appres.h" +//#include "appres.h" #include "actionsc.h" #include "ft_cutc.h" #include "ft_dftc.h" diff --git a/ft_cut.c b/ft_cut.c index ff32b34..78bb537 100644 --- a/ft_cut.c +++ b/ft_cut.c @@ -44,7 +44,7 @@ // #include -#include "appres.h" +//#include "appres.h" // #include "ctlr.h" #include "3270ds.h" diff --git a/ft_dft.c b/ft_dft.c index 95abd42..dbb9590 100644 --- a/ft_dft.c +++ b/ft_dft.c @@ -41,7 +41,7 @@ #if defined(X3270_FT) /*[*/ -#include "appres.h" +//#include "appres.h" #include "3270ds.h" #include "ft_dft_ds.h" @@ -548,9 +548,10 @@ dft_read_modified(void) void set_dft_buffersize(void) { - if (dft_buffersize == 0) { - dft_buffersize = appres.dft_buffer_size; - if (dft_buffersize == 0) + if (dft_buffersize == 0) + { +// dft_buffersize = appres.dft_buffer_size; +// if (dft_buffersize == 0) dft_buffersize = DFT_BUF; } if (dft_buffersize > DFT_MAX_BUF) diff --git a/globals.h b/globals.h index 5dec40c..f4b0253 100644 --- a/globals.h +++ b/globals.h @@ -350,3 +350,5 @@ LIB3270_INTERNAL void lib3270_initialize(void); LIB3270_INTERNAL int cursor_move(H3270 *session, int baddr); LIB3270_INTERNAL void add_input_calls(H3270 *, void (*)(H3270 *), void (*)(H3270 *)); + +LIB3270_INTERNAL void toggle_rectselect(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE tt); diff --git a/glue.c b/glue.c index 712fd2d..df16f99 100644 --- a/glue.c +++ b/glue.c @@ -51,7 +51,7 @@ #include #include -#include "appres.h" +//#include "appres.h" #include "3270ds.h" #include "resources.h" @@ -102,7 +102,7 @@ /*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/ // const char * programname; - AppRes appres; +// AppRes appres; // int children = 0; // Boolean exiting = False; // char * command_string = CN; @@ -116,15 +116,15 @@ */ static void initialize(void) { - memset(&appres,0,sizeof(appres)); +// memset(&appres,0,sizeof(appres)); #ifdef DEBUG init_calls++; trace("Initializing library (calls: %d)",init_calls); #endif - h3270.selected = 0; - h3270.select.start = h3270.select.end = 0; +// h3270.selected = 0; +// h3270.select.start = h3270.select.end = 0; // initialize_toggles(&h3270); #if defined(_WIN32) @@ -137,9 +137,9 @@ static void initialize(void) // appres.mono = False; // appres.extended = True; -#if defined(C3270) /*[*/ - h3270.m3279 = True; -#endif /*]*/ +//#if defined(C3270) /*[*/ +// h3270.m3279 = True; +//#endif /*]*/ // appres.modified_sel = False; // appres.apl_mode = False; @@ -162,13 +162,13 @@ static void initialize(void) #endif /*]*/ // appres.typeahead = True; - appres.debug_tracing = True; +// appres.debug_tracing = True; //#if defined(C3270) // appres.compose_map = "latin1"; //#endif - appres.model = ""; +// appres.model = ""; // appres.hostsfile = CN; // appres.port = "telnet"; @@ -225,9 +225,9 @@ static void initialize(void) // appres.unlock_delay = True; -#if defined(X3270_FT) /*[*/ - appres.dft_buffer_size = DFT_BUF; -#endif /*]*/ +//#if defined(X3270_FT) /*[*/ +// appres.dft_buffer_size = DFT_BUF; +//#endif /*]*/ /* #if defined(C3270) && !defined(LIB3270) diff --git a/paste.c b/paste.c index 518f0e5..c689e49 100644 --- a/paste.c +++ b/paste.c @@ -48,7 +48,7 @@ // #include #include "3270ds.h" -#include "appres.h" +//#include "appres.h" #include "resources.h" #include "actionsc.h" @@ -138,7 +138,7 @@ static int paste_char(H3270 *session, PASTE_DATA *data, unsigned char c) { - if(lib3270_get_toggle(session,SMART_PASTE)) + if(lib3270_get_toggle(session,LIB3270_TOGGLE_SMART_PASTE)) { int faddr = find_field_attribute(session,session->cursor_addr); if(FA_IS_PROTECTED(session->ea_buf[faddr].fa)) diff --git a/proxy.c b/proxy.c index 0e78487..0c9ceb1 100644 --- a/proxy.c +++ b/proxy.c @@ -43,7 +43,7 @@ #include "globals.h" -#include "appres.h" +//#include "appres.h" #include "resources.h" #ifndef ANDROID diff --git a/rpq.c b/rpq.c index a679006..d4f8679 100644 --- a/rpq.c +++ b/rpq.c @@ -57,7 +57,7 @@ #include #include #include "3270ds.h" -#include "appres.h" +//#include "appres.h" #include "popupsc.h" #include "tablesc.h" diff --git a/screen.c b/screen.c index 7260ed9..d32e039 100644 --- a/screen.c +++ b/screen.c @@ -37,7 +37,7 @@ #include "globals.h" #include -#include "appres.h" +//#include "appres.h" #include "3270ds.h" #include "resources.h" // #include "ctlr.h" @@ -342,7 +342,7 @@ void screen_update(H3270 *session, int bstart, int bend) } else { - if(lib3270_get_toggle(session,MONOCASE)) + if(lib3270_get_toggle(session,LIB3270_TOGGLE_MONOCASE)) addch(session,baddr,asc2uc[ebc2asc[session->ea_buf[baddr].cc]],attr,&first,&last); else addch(session,baddr,ebc2asc[session->ea_buf[baddr].cc],attr,&first,&last); diff --git a/selection.c b/selection.c index 497935a..4d235de 100644 --- a/selection.c +++ b/selection.c @@ -28,7 +28,7 @@ */ #include "globals.h" - #include "appres.h" +// #include "appres.h" // #include #include #include diff --git a/session.c b/session.c index fce5d76..7642ca1 100644 --- a/session.c +++ b/session.c @@ -174,19 +174,18 @@ static void lib3270_session_init(H3270 *hSession, const char *model) hSession->display = screen_disp; // Set the defaults. - hSession->extended = 1; - hSession->typeahead = 1; - hSession->oerr_lock = 1; - hSession->unlock_delay = 1; - hSession->icrnl = 1; - hSession->onlcr = 1; + hSession->extended = 1; + hSession->typeahead = 1; + hSession->oerr_lock = 1; + hSession->unlock_delay = 1; + hSession->icrnl = 1; + hSession->onlcr = 1; hSession->host_charset = "bracket"; hSession->sock = -1; hSession->model_num = -1; hSession->cstate = LIB3270_NOT_CONNECTED; hSession->oia_status = -1; - #ifdef _WIN32 hSession->sockEvent = NULL; #endif // _WIN32 diff --git a/toggles.c b/toggles.c index f296f6c..0821927 100644 --- a/toggles.c +++ b/toggles.c @@ -38,8 +38,9 @@ #include #include +#include "toggle.h" #include "globals.h" -#include "appres.h" +//#include "appres.h" #include "ansic.h" #include "actionsc.h" diff --git a/trace_ds.c b/trace_ds.c index 56d80bd..1309b19 100644 --- a/trace_ds.c +++ b/trace_ds.c @@ -53,7 +53,7 @@ #include #include #include "3270ds.h" -#include "appres.h" +//#include "appres.h" #include "objects.h" #include "resources.h" // #include "ctlr.h" @@ -69,6 +69,7 @@ #include "trace_dsc.h" #include "utilc.h" #include "w3miscc.h" +#include "toggle.h" /* Maximum size of a tracefile header. */ #define MAX_HEADER_SIZE (10*1024) @@ -815,14 +816,14 @@ void trace_screen(void) { trace_skipping = False; - if (!lib3270_get_toggle(&h3270,SCREEN_TRACE)) + if (!lib3270_get_toggle(&h3270,LIB3270_TOGGLE_SCREEN_TRACE)) do_screentrace(); } /* Called from ANSI emulation code to log a single character. */ void trace_char(char c) { - if (lib3270_get_toggle(&h3270,SCREEN_TRACE)) + if (lib3270_get_toggle(&h3270,LIB3270_TOGGLE_SCREEN_TRACE)) wtrace("%c",c); return; } -- libgit2 0.21.2