Commit b73502013a146f000ad1658b28217e8061f97a31

Authored by Perry Werneck
1 parent f8854827

Estudando possibilidade de isolar "dispatcher" por sessão.

@@ -214,6 +214,9 @@ @@ -214,6 +214,9 @@
214 <Option compilerVar="CC" /> 214 <Option compilerVar="CC" />
215 </Unit> 215 </Unit>
216 <Unit filename="src/lib3270/ctlrc.h" /> 216 <Unit filename="src/lib3270/ctlrc.h" />
  217 + <Unit filename="src/lib3270/dispatcher.c">
  218 + <Option compilerVar="CC" />
  219 + </Unit>
217 <Unit filename="src/lib3270/ft.c"> 220 <Unit filename="src/lib3270/ft.c">
218 <Option compilerVar="CC" /> 221 <Option compilerVar="CC" />
219 </Unit> 222 </Unit>
src/include/lib3270.h
@@ -809,14 +809,6 @@ @@ -809,14 +809,6 @@
809 LIB3270_EXPORT void * lib3270_get_user_data(H3270 *h); 809 LIB3270_EXPORT void * lib3270_get_user_data(H3270 *h);
810 810
811 /** 811 /**
812 - * @brief Iterate internal's lib3270 event loop.  
813 - *  
814 - * Use it only if the internal I/O calls wasn't replaced.  
815 - *  
816 - */  
817 - LIB3270_EXPORT void lib3270_iterate(int block);  
818 -  
819 - /**  
820 * Wait for "N" seconds keeping main loop active. 812 * Wait for "N" seconds keeping main loop active.
821 * 813 *
822 * @param seconds Number of seconds to wait. 814 * @param seconds Number of seconds to wait.
src/include/lib3270/session.h
@@ -173,7 +173,7 @@ @@ -173,7 +173,7 @@
173 // Screen contents 173 // Screen contents
174 void * buffer[2]; /**< Internal buffers */ 174 void * buffer[2]; /**< Internal buffers */
175 struct lib3270_ea * ea_buf; /**< 3270 device buffer. ea_buf[-1] is the dummy default field attribute */ 175 struct lib3270_ea * ea_buf; /**< 3270 device buffer. ea_buf[-1] is the dummy default field attribute */
176 - struct lib3270_ea * aea_buf; /** alternate 3270 extended attribute buffer */ 176 + struct lib3270_ea * aea_buf; /**< alternate 3270 extended attribute buffer */
177 struct lib3270_text * text; /**< Converted 3270 chars */ 177 struct lib3270_text * text; /**< Converted 3270 chars */
178 178
179 // host.c 179 // host.c
src/lib3270/Makefile.in
@@ -113,73 +113,102 @@ include sources.mak @@ -113,73 +113,102 @@ include sources.mak
113 113
114 #---[ Misc targets ]----------------------------------------------------------- 114 #---[ Misc targets ]-----------------------------------------------------------
115 115
116 -Release: $(BINRLS)/lib3270@DLLEXT@ 116 +Release: \
  117 + $(BINRLS)/lib3270@DLLEXT@
  118 +
  119 +install: \
  120 + Release
117 121
118 -install: Release  
119 $(MKDIR) $(DESTDIR)$(libdir) 122 $(MKDIR) $(DESTDIR)$(libdir)
120 $(INSTALL_PROGRAM) $(BINRLS)/lib3270@DLLEXT@.$(PACKAGE_VERSION) $(DESTDIR)$(libdir) 123 $(INSTALL_PROGRAM) $(BINRLS)/lib3270@DLLEXT@.$(PACKAGE_VERSION) $(DESTDIR)$(libdir)
121 $(LN_S) lib3270@DLLEXT@.$(PACKAGE_VERSION) $(DESTDIR)$(libdir)/lib3270@DLLEXT@.@MAJOR_VERSION@ 124 $(LN_S) lib3270@DLLEXT@.$(PACKAGE_VERSION) $(DESTDIR)$(libdir)/lib3270@DLLEXT@.@MAJOR_VERSION@
122 $(LN_S) lib3270@DLLEXT@.@MAJOR_VERSION@ $(DESTDIR)$(libdir)/lib3270@DLLEXT@ 125 $(LN_S) lib3270@DLLEXT@.@MAJOR_VERSION@ $(DESTDIR)$(libdir)/lib3270@DLLEXT@
123 126
124 -Debug: $(BINDBG)/lib3270@DLLEXT@ 127 +Debug: \
  128 + $(BINDBG)/lib3270@DLLEXT@
  129 +
  130 +$(BINDBG)/lib3270@DLLEXT@: \
  131 + $(BINDBG)/lib3270@DLLEXT@.$(PACKAGE_VERSION)
125 132
126 -$(BINDBG)/lib3270@DLLEXT@: $(BINDBG)/lib3270@DLLEXT@.$(PACKAGE_VERSION)  
127 @rm -f $@ 133 @rm -f $@
128 @cd $(BINDBG) && $(LN_S) lib3270@DLLEXT@.$(PACKAGE_VERSION) lib3270@DLLEXT@ 134 @cd $(BINDBG) && $(LN_S) lib3270@DLLEXT@.$(PACKAGE_VERSION) lib3270@DLLEXT@
129 135
130 -$(BINDBG)/lib3270@DLLEXT@.$(PACKAGE_VERSION): $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@) 136 +$(BINDBG)/lib3270@DLLEXT@.$(PACKAGE_VERSION): \
  137 + $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@)
  138 +
131 @echo " CCLD `basename $@`" 139 @echo " CCLD `basename $@`"
132 @$(MKDIR) `dirname $@` 140 @$(MKDIR) `dirname $@`
133 @$(LD) $(DLL_FLAGS) $(LDFLAGS) @LDSOFLAGS@ @LDLIBFLAGS@ -o $@ $^ $(LIBS) 141 @$(LD) $(DLL_FLAGS) $(LDFLAGS) @LDSOFLAGS@ @LDLIBFLAGS@ -o $@ $^ $(LIBS)
134 142
135 -$(BINRLS)/lib3270@DLLEXT@: $(BINRLS)/lib3270@DLLEXT@.$(PACKAGE_VERSION) 143 +$(BINRLS)/lib3270@DLLEXT@: \
  144 + $(BINRLS)/lib3270@DLLEXT@.$(PACKAGE_VERSION)
  145 +
136 @rm -f $@ 146 @rm -f $@
137 @cd $(BINRLS) && $(LN_S) lib3270@DLLEXT@.$(PACKAGE_VERSION) lib3270@DLLEXT@ 147 @cd $(BINRLS) && $(LN_S) lib3270@DLLEXT@.$(PACKAGE_VERSION) lib3270@DLLEXT@
138 148
139 -$(BINRLS)/lib3270@DLLEXT@.$(PACKAGE_VERSION): $(foreach SRC, $(basename $(SOURCES)), $(OBJRLS)/$(SRC)@OBJEXT@) 149 +$(BINRLS)/lib3270@DLLEXT@.$(PACKAGE_VERSION): \
  150 + $(foreach SRC, $(basename $(SOURCES)), $(OBJRLS)/$(SRC)@OBJEXT@)
  151 +
140 @echo " CCLD `basename $@`" 152 @echo " CCLD `basename $@`"
141 @$(MKDIR) `dirname $@` 153 @$(MKDIR) `dirname $@`
142 @$(LD) $(DLL_FLAGS) $(LDFLAGS) @LDSOFLAGS@ @LDLIBFLAGS@ -o $@ $^ $(LIBS) 154 @$(LD) $(DLL_FLAGS) $(LDFLAGS) @LDSOFLAGS@ @LDLIBFLAGS@ -o $@ $^ $(LIBS)
143 @$(STRIP) $@ 155 @$(STRIP) $@
144 156
145 -$(BINDBG)/testprogram$(EXEEXT): $(OBJDBG)/testprogram.o $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@) 157 +$(BINDBG)/testprogram$(EXEEXT): \
  158 + $(OBJDBG)/testprogram.o $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@)
  159 +
146 @echo " CCLD `basename $@`" 160 @echo " CCLD `basename $@`"
147 @$(MKDIR) `dirname $@` 161 @$(MKDIR) `dirname $@`
148 @$(LD) -o $@ $^ $(LIBS) 162 @$(LD) -o $@ $^ $(LIBS)
149 163
150 -$(BINDIR)/pot/lib3270.pot: $(foreach SRC, $(basename $(SOURCES)), $(TMPDIR)/pot/$(SRC).pot) 164 +$(BINDIR)/pot/lib3270.pot: \
  165 + $(foreach SRC, $(basename $(SOURCES)), $(TMPDIR)/pot/$(SRC).pot)
  166 +
151 @rm -f $@ 167 @rm -f $@
152 @mkdir -p `dirname $@` 168 @mkdir -p `dirname $@`
153 @$(MSGCAT) --sort-output $^ > $@ 169 @$(MSGCAT) --sort-output $^ > $@
154 170
155 -test: $(BINDBG)/testprogram$(EXEEXT) 171 +test: \
  172 + $(BINDBG)/testprogram$(EXEEXT)
  173 +
  174 +run: \
  175 + $(BINDBG)/testprogram$(EXEEXT)
156 176
157 -run: $(BINDBG)/testprogram$(EXEEXT)  
158 ifeq ($(VALGRIND),no) 177 ifeq ($(VALGRIND),no)
159 @PATH="$(BINDIR)/Debug@DLLDIR@:$(PATH)" "$(BINDBG)/testprogram$(EXEEXT)" 178 @PATH="$(BINDIR)/Debug@DLLDIR@:$(PATH)" "$(BINDBG)/testprogram$(EXEEXT)"
160 else 179 else
161 @PATH="$(BINDIR)/Debug@DLLDIR@:$(PATH)" G_DEBUG=gc-friendly G_SLICE=always-malloc \$(VALGRIND) --leak-check=full --suppressions=valgrind.suppression --gen-suppressions=all $(BINDBG)/testprogram$(EXEEXT) 180 @PATH="$(BINDIR)/Debug@DLLDIR@:$(PATH)" G_DEBUG=gc-friendly G_SLICE=always-malloc \$(VALGRIND) --leak-check=full --suppressions=valgrind.suppression --gen-suppressions=all $(BINDBG)/testprogram$(EXEEXT)
162 endif 181 endif
163 182
164 -memchk: $(BINDBG)/testprogram$(EXEEXT) 183 +memchk: \
  184 + $(BINDBG)/testprogram$(EXEEXT)
  185 +
165 ifeq ($(VALGRIND),no) 186 ifeq ($(VALGRIND),no)
166 @cd "$(ROOTDIR)" ; .bin/Debug/testprogram$(EXEEXT) 187 @cd "$(ROOTDIR)" ; .bin/Debug/testprogram$(EXEEXT)
167 else 188 else
168 @cd "$(ROOTDIR)" ; \$(VALGRIND) --leak-check=full --gen-suppressions=all $(BINDBG)/testprogram$(EXEEXT) 189 @cd "$(ROOTDIR)" ; \$(VALGRIND) --leak-check=full --gen-suppressions=all $(BINDBG)/testprogram$(EXEEXT)
169 endif 190 endif
170 191
171 -version.c: ./mkversion.sh 192 +version.c: \
  193 + ./mkversion.sh
  194 +
172 @echo " GEN $@" 195 @echo " GEN $@"
173 @chmod +x ./mkversion.sh 196 @chmod +x ./mkversion.sh
174 @./mkversion.sh 197 @./mkversion.sh
175 198
176 -fallbacks.c: X3270.xad mkfb.c 199 +fallbacks.c: \
  200 + X3270.xad mkfb.c
  201 +
177 @echo " GEN $@" 202 @echo " GEN $@"
178 @$(MKDIR) $(BINDIR) 203 @$(MKDIR) $(BINDIR)
179 @$(HOST_CC) -g -o $(BINDIR)/mkfb@EXEEXT@ mkfb.c 204 @$(HOST_CC) -g -o $(BINDIR)/mkfb@EXEEXT@ mkfb.c
180 @$(BINDIR)/mkfb@EXEEXT@ -c X3270.xad $@ 205 @$(BINDIR)/mkfb@EXEEXT@ -c X3270.xad $@
181 206
182 -cleantest: clean 207 +cleantest: \
  208 + clean
  209 +
  210 +cleanDebug: \
  211 + clean
183 212
184 clean: 213 clean:
185 @rm -fr .obj 214 @rm -fr .obj
@@ -190,3 +219,4 @@ clean: @@ -190,3 +219,4 @@ clean:
190 @rm -f fallbacks.c 219 @rm -f fallbacks.c
191 @rm -f lib3270.pot 220 @rm -f lib3270.pot
192 @rm -fr debian 221 @rm -fr debian
  222 +
src/lib3270/actions.c
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 * 27 *
28 */ 28 */
29 29
30 -#include "globals.h" 30 +#include "private.h"
31 #include <lib3270/trace.h> 31 #include <lib3270/trace.h>
32 32
33 /*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/ 33 /*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/
src/lib3270/ansi.c
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 * ANSI terminal emulation. 34 * ANSI terminal emulation.
35 */ 35 */
36 36
37 -#include "globals.h" 37 +#include "private.h"
38 38
39 #if defined(X3270_ANSI) /*[*/ 39 #if defined(X3270_ANSI) /*[*/
40 40
src/lib3270/bounds.c
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 * 30 *
31 */ 31 */
32 32
33 -#include "globals.h" 33 +#include "private.h"
34 34
35 /*--[ Implement ]------------------------------------------------------------------------------------*/ 35 /*--[ Implement ]------------------------------------------------------------------------------------*/
36 36
src/lib3270/charset.c
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 * This module handles character sets. 34 * This module handles character sets.
35 */ 35 */
36 36
37 -#include "globals.h" 37 +#include "private.h"
38 #include "X11keysym.h" 38 #include "X11keysym.h"
39 #include <lib3270/charset.h> 39 #include <lib3270/charset.h>
40 40
src/lib3270/connect.c
@@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
39 39
40 #endif 40 #endif
41 41
42 -#include "globals.h" 42 +#include "private.h"
43 #include <errno.h> 43 #include <errno.h>
44 44
45 #if defined(_WIN32) 45 #if defined(_WIN32)
src/lib3270/ctlr.c
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 * 37 *
38 */ 38 */
39 39
40 -#include "globals.h" 40 +#include "private.h"
41 #include <errno.h> 41 #include <errno.h>
42 #include <stdlib.h> 42 #include <stdlib.h>
43 #include "3270ds.h" 43 #include "3270ds.h"
src/lib3270/ft.c
@@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
32 #include <lib3270/config.h> 32 #include <lib3270/config.h>
33 #include <lib3270.h> 33 #include <lib3270.h>
34 #include <lib3270/filetransfer.h> 34 #include <lib3270/filetransfer.h>
35 -#include "globals.h" 35 +#include "private.h"
36 #include <lib3270/trace.h> 36 #include <lib3270/trace.h>
37 37
38 #include <errno.h> 38 #include <errno.h>
src/lib3270/ft_cut.c
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 37
38 #include <errno.h> 38 #include <errno.h>
39 39
40 -#include "globals.h" 40 +#include "private.h"
41 41
42 #if defined(X3270_FT) /*[*/ 42 #if defined(X3270_FT) /*[*/
43 43
src/lib3270/ft_dft.c
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 */ 35 */
36 36
37 #include <lib3270.h> 37 #include <lib3270.h>
38 -#include "globals.h" 38 +#include "private.h"
39 39
40 #if defined(X3270_FT) /*[*/ 40 #if defined(X3270_FT) /*[*/
41 41
src/lib3270/globals.h
@@ -1,271 +0,0 @@ @@ -1,271 +0,0 @@
1 -/*  
2 - * "Software G3270, desenvolvido com base nos códigos fontes do WC3270 e X3270  
3 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a  
4 - * aplicativos mainframe. Registro no INPI sob o nome G3270.  
5 - *  
6 - * Copyright (C) <2008> <Banco do Brasil S.A.>  
7 - *  
8 - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob  
9 - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela  
10 - * Free Software Foundation.  
11 - *  
12 - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER  
13 - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO  
14 - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para  
15 - * obter mais detalhes.  
16 - *  
17 - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este  
18 - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin  
19 - * St, Fifth Floor, Boston, MA 02110-1301 USA  
20 - *  
21 - * Este programa está nomeado como globals.h e possui 315 linhas de código.  
22 - *  
23 - * Contatos:  
24 - *  
25 - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)  
26 - * erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça)  
27 - * licinio@bb.com.br (Licínio Luis Branco)  
28 - * kraucer@bb.com.br (Kraucer Fernandes Mazuco)  
29 - * macmiranda@bb.com.br (Marco Aurélio Caldas Miranda)  
30 - *  
31 - */  
32 -  
33 -/* Autoconf settings. */  
34 -#include <lib3270/config.h> /* autoconf settings */  
35 -#include <lib3270.h> /* lib3270 API calls and defs */  
36 -#include "api.h"  
37 -  
38 -#if defined(X3270_TN3270E) && !defined(X3270_ANSI) /*[*/  
39 - #define X3270_ANSI 1 /* RFC2355 requires NVT mode */  
40 -#endif /*]*/  
41 -  
42 -#if defined(HAVE_VASPRINTF) && !defined(_GNU_SOURCE) /*[*/  
43 - #define _GNU_SOURCE /* vasprintf isn't POSIX */  
44 -#endif /*]*/  
45 -  
46 -/*  
47 - * gettext stuff  
48 - */  
49 -#ifdef ANDROID  
50 - #undef HAVE_LIBINTL  
51 - #undef HAVE_LIBSSL  
52 -#endif  
53 -  
54 -#ifdef HAVE_LIBINTL  
55 - #include <libintl.h>  
56 - #define _( x ) gettext(x)  
57 - #define N_( x ) x  
58 -#else  
59 - #define _( x ) x  
60 - #define N_( x ) x  
61 -#endif // HAVE_LIBINTL  
62 -  
63 -#define action_name(x) #x  
64 -  
65 -/*  
66 - * OS-specific #defines. Except for the blocking-connect workarounds, these  
67 - * should be replaced with autoconf probes as soon as possible.  
68 - */  
69 -  
70 -/*  
71 - * BLOCKING_CONNECT_ONLY  
72 - * Use only blocking sockets.  
73 - */  
74 -#if defined(sco) /*[*/  
75 - #define BLOCKING_CONNECT_ONLY 1  
76 -#endif /*]*/  
77 -  
78 -#if defined(apollo) /*[*/  
79 - #define BLOCKING_CONNECT_ONLY 1  
80 -#endif /*]*/  
81 -  
82 -/*  
83 - * Compiler-specific #defines.  
84 - */  
85 -  
86 -/* 'unused' explicitly flags an unused parameter */  
87 -#if defined(__GNUC__) /*[*/  
88 - #define unused __attribute__((__unused__))  
89 - #define printflike(s,f) __attribute__ ((__format__ (__printf__, s, f)))  
90 -#else /*][*/  
91 - #define unused /* nothing */  
92 - #define printflike(s, f) /* nothing */  
93 -#endif /*]*/  
94 -  
95 -  
96 -  
97 -/*  
98 - * Prerequisite #includes.  
99 - */  
100 -#include <stdio.h> /* Unix standard I/O library */  
101 -#include <unistd.h> /* Unix system calls */  
102 -#include <ctype.h> /* Character classes */  
103 -#include <string.h> /* String manipulations */  
104 -#include <sys/types.h> /* Basic system data types */  
105 -#include <sys/time.h> /* System time-related data types */  
106 -#include <time.h> /* C library time functions */  
107 -#include "localdefs.h" /* {s,tcl,c}3270-specific defines */  
108 -  
109 -/*  
110 - * Cancel out contradictory parts.  
111 - */  
112 -#if !defined(X3270_DISPLAY) /*[*/  
113 - #undef X3270_KEYPAD  
114 - #undef X3270_MENUS  
115 -#endif /*]*/  
116 -  
117 -/* Functions we may need to supply. */  
118 -#if defined(NEED_STRTOK_R) /*[*/  
119 - extern char *strtok_r(char *str, const char *sep, char **last);  
120 -#endif /*]*/  
121 -  
122 -/* types of internal actions */  
123 -enum iaction {  
124 - IA_STRING, IA_PASTE, IA_REDRAW,  
125 - IA_KEYPAD, IA_DEFAULT, IA_KEY,  
126 - IA_MACRO, IA_SCRIPT, IA_PEEK,  
127 - IA_TYPEAHEAD, IA_FT, IA_COMMAND, IA_KEYMAP,  
128 - IA_IDLE  
129 -};  
130 -  
131 -// Version strings  
132 -LIB3270_INTERNAL const char * build;  
133 -LIB3270_INTERNAL const char * app_defaults_version;  
134 -LIB3270_INTERNAL const char * sccsid;  
135 -LIB3270_INTERNAL const char * build_rpq_timestamp;  
136 -LIB3270_INTERNAL const char * build_rpq_version;  
137 -LIB3270_INTERNAL const char * build_rpq_revision;  
138 -  
139 -#if defined(X3270_DBCS) /*[*/  
140 - LIB3270_INTERNAL Boolean dbcs;  
141 -#endif /*]*/  
142 -  
143 -  
144 -#if defined(X3270_DBCS) /*[*/  
145 - LIB3270_INTERNAL char *full_efontname_dbcs;  
146 -#endif /*]*/  
147 -  
148 -  
149 -/* keyboard modifer bitmap */  
150 -#define ShiftKeyDown 0x01  
151 -#define MetaKeyDown 0x02  
152 -#define AltKeyDown 0x04  
153 -  
154 -/* toggle names */  
155 -struct toggle_name {  
156 - const char *name;  
157 - int index;  
158 -};  
159 -  
160 -  
161 -/* input key type */  
162 -  
163 -/* Naming convention for private actions. */  
164 -#define PA_PFX "PA-"  
165 -  
166 -/* Shorthand macros */  
167 -  
168 -#define CN ((char *) NULL)  
169 -#define PN ((XtPointer) NULL)  
170 -#define Replace(var, value) { lib3270_free(var); var = (value); };  
171 -  
172 -/* Configuration change masks. */  
173 -#define NO_CHANGE 0x0000 /* no change */  
174 -#define MODEL_CHANGE 0x0001 /* screen dimensions changed */  
175 -#define FONT_CHANGE 0x0002 /* emulator font changed */  
176 -#define COLOR_CHANGE 0x0004 /* color scheme or 3278/9 mode changed */  
177 -#define SCROLL_CHANGE 0x0008 /* scrollbar snapped on or off */  
178 -#define CHARSET_CHANGE 0x0010 /* character set changed */  
179 -#define ALL_CHANGE 0xffff /* everything changed */  
180 -  
181 -/* Portability macros */  
182 -  
183 -/* Equivalent of setlinebuf */  
184 -  
185 -#if defined(_IOLBF) /*[*/  
186 - #define SETLINEBUF(s) setvbuf(s, (char *)NULL, _IOLBF, BUFSIZ)  
187 -#else /*][*/  
188 - #define SETLINEBUF(s) setlinebuf(s)  
189 -#endif /*]*/  
190 -  
191 -/* Motorola version of gettimeofday */  
192 -  
193 -#if defined(MOTOROLA)  
194 - #define gettimeofday(tp,tz) gettimeofday(tp)  
195 -#endif  
196 -  
197 -/* Default DFT file transfer buffer size. */  
198 -#if defined(X3270_FT) && !defined(DFT_BUF) /*[*/  
199 - #define DFT_BUF (4 * 1024)  
200 -#endif /*]*/  
201 -  
202 -/* DBCS Preedit Types */  
203 -#if defined(X3270_DBCS) /*[*/  
204 - #define PT_ROOT "Root"  
205 - #define PT_OVER_THE_SPOT "OverTheSpot"  
206 - #define PT_OFF_THE_SPOT "OffTheSpot"  
207 - #define PT_ON_THE_SPOT "OnTheSpot"  
208 -#endif /*]*/  
209 -  
210 -/** input key type */  
211 -enum keytype  
212 -{  
213 - KT_STD,  
214 - KT_GE  
215 -};  
216 -  
217 -LIB3270_INTERNAL struct _ansictl  
218 -{  
219 - char vintr;  
220 - char vquit;  
221 - char verase;  
222 - char vkill;  
223 - char veof;  
224 - char vwerase;  
225 - char vrprnt;  
226 - char vlnext;  
227 -} ansictl;  
228 -  
229 -/* default charset translation tables */  
230 -// LIB3270_INTERNAL const unsigned short ebc2asc0[256];  
231 -// LIB3270_INTERNAL const unsigned short asc2ft0[256];  
232 -  
233 -  
234 -/* Library internal calls */  
235 -LIB3270_INTERNAL void key_ACharacter(H3270 *hSession, unsigned char c, enum keytype keytype, enum iaction cause,Boolean *skipped);  
236 -LIB3270_INTERNAL void lib3270_initialize(void);  
237 -LIB3270_INTERNAL int cursor_move(H3270 *session, int baddr);  
238 -  
239 -LIB3270_INTERNAL void toggle_rectselect(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE tt);  
240 -LIB3270_INTERNAL void remove_input_calls(H3270 *session);  
241 -  
242 -LIB3270_INTERNAL int lib3270_sock_send(H3270 *hSession, unsigned const char *buf, int len);  
243 -LIB3270_INTERNAL void lib3270_sock_disconnect(H3270 *hSession);  
244 -  
245 -#if defined(DEBUG)  
246 - #define CHECK_SESSION_HANDLE(x) check_session_handle(&x,__FUNCTION__);  
247 - LIB3270_INTERNAL void check_session_handle(H3270 **hSession, const char *fname);  
248 -#else  
249 - #define CHECK_SESSION_HANDLE(x) check_session_handle(&x);  
250 - LIB3270_INTERNAL void check_session_handle(H3270 **hSession);  
251 -#endif // DEBUG  
252 -  
253 -LIB3270_INTERNAL int non_blocking(H3270 *session, Boolean on);  
254 -  
255 -#if defined(HAVE_LIBSSL) /*[*/  
256 -  
257 - LIB3270_INTERNAL int ssl_init(H3270 *session);  
258 - LIB3270_INTERNAL int ssl_negotiate(H3270 *hSession);  
259 - LIB3270_INTERNAL void set_ssl_state(H3270 *session, LIB3270_SSL_STATE state);  
260 -  
261 -  
262 - #if OPENSSL_VERSION_NUMBER >= 0x00907000L /*[*/  
263 - #define INFO_CONST const  
264 - #else /*][*/  
265 - #define INFO_CONST  
266 - #endif /*]*/  
267 -  
268 - LIB3270_INTERNAL void ssl_info_callback(INFO_CONST SSL *s, int where, int ret);  
269 -  
270 -#endif /*]*/  
271 -  
src/lib3270/glue.c
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 38
39 39
40 40
41 -#include "globals.h" 41 +#include "private.h"
42 42
43 #if !defined(_WIN32) /*[*/ 43 #if !defined(_WIN32) /*[*/
44 #include <sys/wait.h> 44 #include <sys/wait.h>
src/lib3270/host.c
@@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
39 */ 39 */
40 40
41 #include <malloc.h> 41 #include <malloc.h>
42 -#include "globals.h" 42 +#include "private.h"
43 // #include "appres.h" 43 // #include "appres.h"
44 #include "resources.h" 44 #include "resources.h"
45 45
src/lib3270/html.c
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 #include "3270ds.h" 33 #include "3270ds.h"
34 #include <lib3270/html.h> 34 #include <lib3270/html.h>
35 35
36 - #include "globals.h" 36 + #include "private.h"
37 #include "utilc.h" 37 #include "utilc.h"
38 38
39 struct chr_xlat 39 struct chr_xlat
src/lib3270/iocalls.c
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
29 * 29 *
30 */ 30 */
31 31
32 -#include "globals.h" 32 +#include "private.h"
33 #include <sys/time.h> 33 #include <sys/time.h>
34 #include <sys/types.h> 34 #include <sys/types.h>
35 #include "xioc.h" 35 #include "xioc.h"
@@ -45,15 +45,14 @@ @@ -45,15 +45,14 @@
45 /*---[ Standard calls ]-------------------------------------------------------------------------------------*/ 45 /*---[ Standard calls ]-------------------------------------------------------------------------------------*/
46 46
47 // Timeout calls 47 // Timeout calls
48 -static void internal_remove_timeout(void *timer);  
49 -static void * internal_add_timeout(unsigned long interval_ms, H3270 *session, void (*proc)(H3270 *session)); 48 +static void internal_remove_timeout(void *timer);
  49 +static void * internal_add_timeout(unsigned long interval_ms, H3270 *session, void (*proc)(H3270 *session));
50 50
51 -static void * internal_add_poll(H3270 *session, int fd, LIB3270_IO_FLAG flag, void(*proc)(H3270 *, int, LIB3270_IO_FLAG, void *), void *userdata );  
52 -static void internal_remove_poll(void *id); 51 +static void * internal_add_poll(H3270 *session, int fd, LIB3270_IO_FLAG flag, void(*proc)(H3270 *, int, LIB3270_IO_FLAG, void *), void *userdata );
  52 +static void internal_remove_poll(void *id);
53 53
54 static int internal_wait(H3270 *hSession, int seconds); 54 static int internal_wait(H3270 *hSession, int seconds);
55 55
56 -static int internal_event_dispatcher(H3270 *hSession, int block);  
57 static void internal_ring_bell(H3270 *); 56 static void internal_ring_bell(H3270 *);
58 57
59 /*---[ Active callbacks ]-----------------------------------------------------------------------------------*/ 58 /*---[ Active callbacks ]-----------------------------------------------------------------------------------*/
@@ -74,7 +73,7 @@ static void internal_ring_bell(H3270 *); @@ -74,7 +73,7 @@ static void internal_ring_bell(H3270 *);
74 = internal_wait; 73 = internal_wait;
75 74
76 static int (*event_dispatcher)(H3270 *hSession,int wait) 75 static int (*event_dispatcher)(H3270 *hSession,int wait)
77 - = internal_event_dispatcher; 76 + = lib3270_default_event_dispatcher;
78 77
79 static void (*ring_bell)(H3270 *) 78 static void (*ring_bell)(H3270 *)
80 = internal_ring_bell; 79 = internal_ring_bell;
@@ -318,7 +317,7 @@ LIB3270_EXPORT void * lib3270_add_poll_fd(H3270 *session, int fd, LIB3270_IO_FL @@ -318,7 +317,7 @@ LIB3270_EXPORT void * lib3270_add_poll_fd(H3270 *session, int fd, LIB3270_IO_FL
318 } 317 }
319 318
320 /* Event dispatcher. */ 319 /* Event dispatcher. */
321 -static int internal_event_dispatcher(H3270 *hSession, int block) 320 +int lib3270_default_event_dispatcher(H3270 *hSession, int block)
322 { 321 {
323 #if defined(_WIN32) 322 #if defined(_WIN32)
324 unsigned long long now; 323 unsigned long long now;
@@ -704,11 +703,6 @@ LIB3270_EXPORT int lib3270_register_handlers(const struct lib3270_callbacks *cbk @@ -704,11 +703,6 @@ LIB3270_EXPORT int lib3270_register_handlers(const struct lib3270_callbacks *cbk
704 703
705 } 704 }
706 705
707 -  
708 -LIB3270_EXPORT void lib3270_iterate(int block) {  
709 - event_dispatcher(NULL,block);  
710 -}  
711 -  
712 LIB3270_EXPORT void lib3270_main_iterate(H3270 *hSession, int block) 706 LIB3270_EXPORT void lib3270_main_iterate(H3270 *hSession, int block)
713 { 707 {
714 CHECK_SESSION_HANDLE(hSession); 708 CHECK_SESSION_HANDLE(hSession);
src/lib3270/kybd.c
@@ -38,7 +38,7 @@ struct ta; @@ -38,7 +38,7 @@ struct ta;
38 38
39 #define LIB3270_TA struct ta 39 #define LIB3270_TA struct ta
40 40
41 -#include "globals.h" 41 +#include "private.h"
42 #include <lib3270/trace.h> 42 #include <lib3270/trace.h>
43 43
44 #ifndef ANDROID 44 #ifndef ANDROID
src/lib3270/lib3270.cbp
@@ -110,7 +110,6 @@ @@ -110,7 +110,6 @@
110 <Unit filename="ft_dft_ds.h" /> 110 <Unit filename="ft_dft_ds.h" />
111 <Unit filename="ft_dftc.h" /> 111 <Unit filename="ft_dftc.h" />
112 <Unit filename="ftc.h" /> 112 <Unit filename="ftc.h" />
113 - <Unit filename="globals.h" />  
114 <Unit filename="glue.c"> 113 <Unit filename="glue.c">
115 <Option compilerVar="CC" /> 114 <Option compilerVar="CC" />
116 </Unit> 115 </Unit>
@@ -135,6 +134,9 @@ @@ -135,6 +134,9 @@
135 <Unit filename="macros.c"> 134 <Unit filename="macros.c">
136 <Option compilerVar="CC" /> 135 <Option compilerVar="CC" />
137 </Unit> 136 </Unit>
  137 + <Unit filename="mkfb.c">
  138 + <Option compilerVar="CC" />
  139 + </Unit>
138 <Unit filename="mkversion.sh.in" /> 140 <Unit filename="mkversion.sh.in" />
139 <Unit filename="objects.h" /> 141 <Unit filename="objects.h" />
140 <Unit filename="paste.c"> 142 <Unit filename="paste.c">
@@ -149,6 +151,7 @@ @@ -149,6 +151,7 @@
149 <Option compilerVar="CC" /> 151 <Option compilerVar="CC" />
150 </Unit> 152 </Unit>
151 <Unit filename="printerc.h" /> 153 <Unit filename="printerc.h" />
  154 + <Unit filename="private.h" />
152 <Unit filename="proxy.c"> 155 <Unit filename="proxy.c">
153 <Option compilerVar="CC" /> 156 <Option compilerVar="CC" />
154 </Unit> 157 </Unit>
src/lib3270/macros.c
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 #include <lib3270/selection.h> 38 #include <lib3270/selection.h>
39 #include <stdlib.h> 39 #include <stdlib.h>
40 #include <strings.h> 40 #include <strings.h>
41 - #include "globals.h" 41 + #include "private.h"
42 #include "utilc.h" 42 #include "utilc.h"
43 #include "api.h" 43 #include "api.h"
44 44
src/lib3270/mkfb.c
@@ -386,7 +386,7 @@ main(int argc, char *argv[]) @@ -386,7 +386,7 @@ main(int argc, char *argv[])
386 fprintf(t, "/* This file was created automatically from %s by mkfb. */\n\n", 386 fprintf(t, "/* This file was created automatically from %s by mkfb. */\n\n",
387 filename); 387 filename);
388 if (cmode) { 388 if (cmode) {
389 - fprintf(t, "#include \"globals.h\"\n"); 389 + fprintf(t, "#include \"private.h\"\n");
390 fprintf(t, "static unsigned char fsd[] = {\n"); 390 fprintf(t, "static unsigned char fsd[] = {\n");
391 } else { 391 } else {
392 fprintf(t, "unsigned char common_fallbacks[] = {\n"); 392 fprintf(t, "unsigned char common_fallbacks[] = {\n");
@@ -640,7 +640,7 @@ FILE * osx_tmpfile( void ) @@ -640,7 +640,7 @@ FILE * osx_tmpfile( void )
640 { 640 {
641 int fd = -1; 641 int fd = -1;
642 FILE *file = NULL; 642 FILE *file = NULL;
643 - 643 +
644 do 644 do
645 { 645 {
646 char *tempname = tempnam(NULL,"XXXXXX"); 646 char *tempname = tempnam(NULL,"XXXXXX");
@@ -648,8 +648,8 @@ FILE * osx_tmpfile( void ) @@ -648,8 +648,8 @@ FILE * osx_tmpfile( void )
648 return NULL; 648 return NULL;
649 fd = open (tempname,O_CREAT | O_EXCL | O_RDWR,S_IREAD | S_IWRITE); 649 fd = open (tempname,O_CREAT | O_EXCL | O_RDWR,S_IREAD | S_IWRITE);
650 } while (fd < 0 && errno == EEXIST); 650 } while (fd < 0 && errno == EEXIST);
651 -  
652 - 651 +
  652 +
653 file = fdopen (fd, "w+b"); 653 file = fdopen (fd, "w+b");
654 if (file == NULL) 654 if (file == NULL)
655 { 655 {
@@ -657,7 +657,7 @@ FILE * osx_tmpfile( void ) @@ -657,7 +657,7 @@ FILE * osx_tmpfile( void )
657 close (fd); 657 close (fd);
658 errno = save_errno; 658 errno = save_errno;
659 } 659 }
660 - 660 +
661 return file; 661 return file;
662 } 662 }
663 663
src/lib3270/options.c
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
29 * 29 *
30 */ 30 */
31 31
32 -#include "globals.h" 32 +#include "private.h"
33 33
34 /*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/ 34 /*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/
35 35
src/lib3270/paste.c
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 * 30 *
31 */ 31 */
32 32
33 -#include "globals.h" 33 +#include "private.h"
34 34
35 /* 35 /*
36 #if defined(X3270_DISPLAY) 36 #if defined(X3270_DISPLAY)
src/lib3270/print.c
@@ -35,4 +35,4 @@ @@ -35,4 +35,4 @@
35 * Screen printing functions. 35 * Screen printing functions.
36 */ 36 */
37 37
38 -#include "globals.h" 38 +#include "private.h"
src/lib3270/printer.c
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 * Printer session support 36 * Printer session support
37 */ 37 */
38 38
39 -#include "globals.h" 39 +#include "private.h"
40 40
41 #if (defined(C3270) || defined(X3270_DISPLAY)) && defined(X3270_PRINTER) /*[*/ 41 #if (defined(C3270) || defined(X3270_DISPLAY)) && defined(X3270_PRINTER) /*[*/
42 42
src/lib3270/private.h 0 → 100644
@@ -0,0 +1,273 @@ @@ -0,0 +1,273 @@
  1 +/*
  2 + * "Software G3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
  3 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
  4 + * aplicativos mainframe. Registro no INPI sob o nome G3270.
  5 + *
  6 + * Copyright (C) <2008> <Banco do Brasil S.A.>
  7 + *
  8 + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
  9 + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
  10 + * Free Software Foundation.
  11 + *
  12 + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
  13 + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
  14 + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
  15 + * obter mais detalhes.
  16 + *
  17 + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
  18 + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
  19 + * St, Fifth Floor, Boston, MA 02110-1301 USA
  20 + *
  21 + * Este programa está nomeado como private.h e possui - linhas de código.
  22 + *
  23 + * Contatos:
  24 + *
  25 + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
  26 + * erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça)
  27 + * licinio@bb.com.br (Licínio Luis Branco)
  28 + * kraucer@bb.com.br (Kraucer Fernandes Mazuco)
  29 + * macmiranda@bb.com.br (Marco Aurélio Caldas Miranda)
  30 + *
  31 + */
  32 +
  33 +/* Autoconf settings. */
  34 +#include <lib3270/config.h> /* autoconf settings */
  35 +#include <lib3270.h> /* lib3270 API calls and defs */
  36 +#include "api.h"
  37 +
  38 +#if defined(X3270_TN3270E) && !defined(X3270_ANSI) /*[*/
  39 + #define X3270_ANSI 1 /* RFC2355 requires NVT mode */
  40 +#endif /*]*/
  41 +
  42 +#if defined(HAVE_VASPRINTF) && !defined(_GNU_SOURCE) /*[*/
  43 + #define _GNU_SOURCE /* vasprintf isn't POSIX */
  44 +#endif /*]*/
  45 +
  46 +/*
  47 + * gettext stuff
  48 + */
  49 +#ifdef ANDROID
  50 + #undef HAVE_LIBINTL
  51 + #undef HAVE_LIBSSL
  52 +#endif
  53 +
  54 +#ifdef HAVE_LIBINTL
  55 + #include <libintl.h>
  56 + #define _( x ) gettext(x)
  57 + #define N_( x ) x
  58 +#else
  59 + #define _( x ) x
  60 + #define N_( x ) x
  61 +#endif // HAVE_LIBINTL
  62 +
  63 +#define action_name(x) #x
  64 +
  65 +/*
  66 + * OS-specific #defines. Except for the blocking-connect workarounds, these
  67 + * should be replaced with autoconf probes as soon as possible.
  68 + */
  69 +
  70 +/*
  71 + * BLOCKING_CONNECT_ONLY
  72 + * Use only blocking sockets.
  73 + */
  74 +#if defined(sco) /*[*/
  75 + #define BLOCKING_CONNECT_ONLY 1
  76 +#endif /*]*/
  77 +
  78 +#if defined(apollo) /*[*/
  79 + #define BLOCKING_CONNECT_ONLY 1
  80 +#endif /*]*/
  81 +
  82 +/*
  83 + * Compiler-specific #defines.
  84 + */
  85 +
  86 +/* 'unused' explicitly flags an unused parameter */
  87 +#if defined(__GNUC__) /*[*/
  88 + #define unused __attribute__((__unused__))
  89 + #define printflike(s,f) __attribute__ ((__format__ (__printf__, s, f)))
  90 +#else /*][*/
  91 + #define unused /* nothing */
  92 + #define printflike(s, f) /* nothing */
  93 +#endif /*]*/
  94 +
  95 +
  96 +
  97 +/*
  98 + * Prerequisite #includes.
  99 + */
  100 +#include <stdio.h> /* Unix standard I/O library */
  101 +#include <unistd.h> /* Unix system calls */
  102 +#include <ctype.h> /* Character classes */
  103 +#include <string.h> /* String manipulations */
  104 +#include <sys/types.h> /* Basic system data types */
  105 +#include <sys/time.h> /* System time-related data types */
  106 +#include <time.h> /* C library time functions */
  107 +#include "localdefs.h" /* {s,tcl,c}3270-specific defines */
  108 +
  109 +/*
  110 + * Cancel out contradictory parts.
  111 + */
  112 +#if !defined(X3270_DISPLAY) /*[*/
  113 + #undef X3270_KEYPAD
  114 + #undef X3270_MENUS
  115 +#endif /*]*/
  116 +
  117 +/* Functions we may need to supply. */
  118 +#if defined(NEED_STRTOK_R) /*[*/
  119 + extern char *strtok_r(char *str, const char *sep, char **last);
  120 +#endif /*]*/
  121 +
  122 +/* types of internal actions */
  123 +enum iaction {
  124 + IA_STRING, IA_PASTE, IA_REDRAW,
  125 + IA_KEYPAD, IA_DEFAULT, IA_KEY,
  126 + IA_MACRO, IA_SCRIPT, IA_PEEK,
  127 + IA_TYPEAHEAD, IA_FT, IA_COMMAND, IA_KEYMAP,
  128 + IA_IDLE
  129 +};
  130 +
  131 +// Version strings
  132 +LIB3270_INTERNAL const char * build;
  133 +LIB3270_INTERNAL const char * app_defaults_version;
  134 +LIB3270_INTERNAL const char * sccsid;
  135 +LIB3270_INTERNAL const char * build_rpq_timestamp;
  136 +LIB3270_INTERNAL const char * build_rpq_version;
  137 +LIB3270_INTERNAL const char * build_rpq_revision;
  138 +
  139 +#if defined(X3270_DBCS) /*[*/
  140 + LIB3270_INTERNAL Boolean dbcs;
  141 +#endif /*]*/
  142 +
  143 +
  144 +#if defined(X3270_DBCS) /*[*/
  145 + LIB3270_INTERNAL char *full_efontname_dbcs;
  146 +#endif /*]*/
  147 +
  148 +
  149 +/* keyboard modifer bitmap */
  150 +#define ShiftKeyDown 0x01
  151 +#define MetaKeyDown 0x02
  152 +#define AltKeyDown 0x04
  153 +
  154 +/* toggle names */
  155 +struct toggle_name {
  156 + const char *name;
  157 + int index;
  158 +};
  159 +
  160 +
  161 +/* input key type */
  162 +
  163 +/* Naming convention for private actions. */
  164 +#define PA_PFX "PA-"
  165 +
  166 +/* Shorthand macros */
  167 +
  168 +#define CN ((char *) NULL)
  169 +#define PN ((XtPointer) NULL)
  170 +#define Replace(var, value) { lib3270_free(var); var = (value); };
  171 +
  172 +/* Configuration change masks. */
  173 +#define NO_CHANGE 0x0000 /* no change */
  174 +#define MODEL_CHANGE 0x0001 /* screen dimensions changed */
  175 +#define FONT_CHANGE 0x0002 /* emulator font changed */
  176 +#define COLOR_CHANGE 0x0004 /* color scheme or 3278/9 mode changed */
  177 +#define SCROLL_CHANGE 0x0008 /* scrollbar snapped on or off */
  178 +#define CHARSET_CHANGE 0x0010 /* character set changed */
  179 +#define ALL_CHANGE 0xffff /* everything changed */
  180 +
  181 +/* Portability macros */
  182 +
  183 +/* Equivalent of setlinebuf */
  184 +
  185 +#if defined(_IOLBF) /*[*/
  186 + #define SETLINEBUF(s) setvbuf(s, (char *)NULL, _IOLBF, BUFSIZ)
  187 +#else /*][*/
  188 + #define SETLINEBUF(s) setlinebuf(s)
  189 +#endif /*]*/
  190 +
  191 +/* Motorola version of gettimeofday */
  192 +
  193 +#if defined(MOTOROLA)
  194 + #define gettimeofday(tp,tz) gettimeofday(tp)
  195 +#endif
  196 +
  197 +/* Default DFT file transfer buffer size. */
  198 +#if defined(X3270_FT) && !defined(DFT_BUF) /*[*/
  199 + #define DFT_BUF (4 * 1024)
  200 +#endif /*]*/
  201 +
  202 +/* DBCS Preedit Types */
  203 +#if defined(X3270_DBCS) /*[*/
  204 + #define PT_ROOT "Root"
  205 + #define PT_OVER_THE_SPOT "OverTheSpot"
  206 + #define PT_OFF_THE_SPOT "OffTheSpot"
  207 + #define PT_ON_THE_SPOT "OnTheSpot"
  208 +#endif /*]*/
  209 +
  210 +/** input key type */
  211 +enum keytype
  212 +{
  213 + KT_STD,
  214 + KT_GE
  215 +};
  216 +
  217 +LIB3270_INTERNAL struct _ansictl
  218 +{
  219 + char vintr;
  220 + char vquit;
  221 + char verase;
  222 + char vkill;
  223 + char veof;
  224 + char vwerase;
  225 + char vrprnt;
  226 + char vlnext;
  227 +} ansictl;
  228 +
  229 +/* default charset translation tables */
  230 +// LIB3270_INTERNAL const unsigned short ebc2asc0[256];
  231 +// LIB3270_INTERNAL const unsigned short asc2ft0[256];
  232 +
  233 +
  234 +/* Library internal calls */
  235 +LIB3270_INTERNAL void key_ACharacter(H3270 *hSession, unsigned char c, enum keytype keytype, enum iaction cause,Boolean *skipped);
  236 +LIB3270_INTERNAL void lib3270_initialize(void);
  237 +LIB3270_INTERNAL int cursor_move(H3270 *session, int baddr);
  238 +
  239 +LIB3270_INTERNAL void toggle_rectselect(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE tt);
  240 +LIB3270_INTERNAL void remove_input_calls(H3270 *session);
  241 +
  242 +LIB3270_INTERNAL int lib3270_sock_send(H3270 *hSession, unsigned const char *buf, int len);
  243 +LIB3270_INTERNAL void lib3270_sock_disconnect(H3270 *hSession);
  244 +
  245 +LIB3270_INTERNAL int lib3270_default_event_dispatcher(H3270 *hSession, int block);
  246 +
  247 +#if defined(DEBUG)
  248 + #define CHECK_SESSION_HANDLE(x) check_session_handle(&x,__FUNCTION__);
  249 + LIB3270_INTERNAL void check_session_handle(H3270 **hSession, const char *fname);
  250 +#else
  251 + #define CHECK_SESSION_HANDLE(x) check_session_handle(&x);
  252 + LIB3270_INTERNAL void check_session_handle(H3270 **hSession);
  253 +#endif // DEBUG
  254 +
  255 +LIB3270_INTERNAL int non_blocking(H3270 *session, Boolean on);
  256 +
  257 +#if defined(HAVE_LIBSSL) /*[*/
  258 +
  259 + LIB3270_INTERNAL int ssl_init(H3270 *session);
  260 + LIB3270_INTERNAL int ssl_negotiate(H3270 *hSession);
  261 + LIB3270_INTERNAL void set_ssl_state(H3270 *session, LIB3270_SSL_STATE state);
  262 +
  263 +
  264 + #if OPENSSL_VERSION_NUMBER >= 0x00907000L /*[*/
  265 + #define INFO_CONST const
  266 + #else /*][*/
  267 + #define INFO_CONST
  268 + #endif /*]*/
  269 +
  270 + LIB3270_INTERNAL void ssl_info_callback(INFO_CONST SSL *s, int where, int ret);
  271 +
  272 +#endif /*]*/
  273 +
src/lib3270/proxy.c
@@ -42,7 +42,7 @@ @@ -42,7 +42,7 @@
42 #include <windows.h> 42 #include <windows.h>
43 #endif // _WIN32 43 #endif // _WIN32
44 44
45 -#include "globals.h" 45 +#include "private.h"
46 #include "utilc.h" 46 #include "utilc.h"
47 47
48 //#include "appres.h" 48 //#include "appres.h"
src/lib3270/resolver.c
@@ -45,11 +45,11 @@ @@ -45,11 +45,11 @@
45 #include <windows.h> 45 #include <windows.h>
46 #include <ws2tcpip.h> 46 #include <ws2tcpip.h>
47 47
48 - #include "globals.h" 48 + #include "private.h"
49 49
50 #else 50 #else
51 51
52 - #include "globals.h" 52 + #include "private.h"
53 53
54 #include <sys/socket.h> 54 #include <sys/socket.h>
55 #include <netinet/in.h> 55 #include <netinet/in.h>
src/lib3270/resources.c
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 #include <stdio.h> 34 #include <stdio.h>
35 #include <string.h> 35 #include <string.h>
36 36
37 -#include "globals.h" 37 +#include "private.h"
38 #include "utilc.h" 38 #include "utilc.h"
39 39
40 extern String fallbacks[]; 40 extern String fallbacks[];
src/lib3270/rpq.c
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 * 36 *
37 */ 37 */
38 38
39 -#include "globals.h" 39 +#include "private.h"
40 #include <errno.h> 40 #include <errno.h>
41 #if !defined(_WIN32) /*[*/ 41 #if !defined(_WIN32) /*[*/
42 #include <netinet/in.h> 42 #include <netinet/in.h>
src/lib3270/screen.c
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 * Screen drawing 35 * Screen drawing
36 */ 36 */
37 37
38 -#include "globals.h" 38 +#include "private.h"
39 #include <signal.h> 39 #include <signal.h>
40 //#include "appres.h" 40 //#include "appres.h"
41 #include "3270ds.h" 41 #include "3270ds.h"
src/lib3270/see.c
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 * 36 *
37 */ 37 */
38 38
39 -#include "globals.h" 39 +#include "private.h"
40 40
41 #if defined(X3270_TRACE) /*[*/ 41 #if defined(X3270_TRACE) /*[*/
42 42
src/lib3270/selection.c
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 * 27 *
28 */ 28 */
29 29
30 - #include "globals.h" 30 + #include "private.h"
31 // #include "appres.h" 31 // #include "appres.h"
32 #include <lib3270.h> 32 #include <lib3270.h>
33 #include <lib3270/session.h> 33 #include <lib3270/session.h>
src/lib3270/session.c
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 #include <stdlib.h> 33 #include <stdlib.h>
34 #endif // !ANDROID 34 #endif // !ANDROID
35 35
36 -#include "globals.h" 36 +#include "private.h"
37 // #include "charsetc.h" 37 // #include "charsetc.h"
38 #include "kybdc.h" 38 #include "kybdc.h"
39 #include "ansic.h" 39 #include "ansic.h"
src/lib3270/sf.c
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 * 36 *
37 */ 37 */
38 38
39 -#include "globals.h" 39 +#include "private.h"
40 #include <errno.h> 40 #include <errno.h>
41 #if !defined(_WIN32) /*[*/ 41 #if !defined(_WIN32) /*[*/
42 #include <netinet/in.h> 42 #include <netinet/in.h>
src/lib3270/ssl.c
@@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
41 #include <openssl/err.h> 41 #include <openssl/err.h>
42 #endif 42 #endif
43 43
44 -#include "globals.h" 44 +#include "private.h"
45 #include <errno.h> 45 #include <errno.h>
46 #include <lib3270.h> 46 #include <lib3270.h>
47 #include <lib3270/internals.h> 47 #include <lib3270/internals.h>
src/lib3270/state.c
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 * 27 *
28 */ 28 */
29 29
30 -#include "globals.h" 30 +#include "private.h"
31 31
32 /*---[ Implement ]------------------------------------------------------------------------------------------------------------*/ 32 /*---[ Implement ]------------------------------------------------------------------------------------------------------------*/
33 33
src/lib3270/telnet.c
@@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
51 #include <openssl/err.h> 51 #include <openssl/err.h>
52 #endif 52 #endif
53 53
54 -#include "globals.h" 54 +#include "private.h"
55 #include <errno.h> 55 #include <errno.h>
56 56
57 #if defined(_WIN32) 57 #if defined(_WIN32)
src/lib3270/testprogram.c
1 1
2 #include <stdio.h> 2 #include <stdio.h>
3 #include <string.h> 3 #include <string.h>
  4 +#include <stdlib.h>
4 // #include <pthread.h> 5 // #include <pthread.h>
5 6
6 -#include "globals.h" 7 +#include "private.h"
7 #include <lib3270/macros.h> 8 #include <lib3270/macros.h>
8 9
9 #define MAX_ARGS 10 10 #define MAX_ARGS 10
@@ -23,6 +24,7 @@ int main(int numpar, char *param[]) @@ -23,6 +24,7 @@ int main(int numpar, char *param[])
23 { 24 {
24 H3270 * h; 25 H3270 * h;
25 int rc = 0; 26 int rc = 0;
  27 + const char * url = getenv("LIB3270HOST");
26 // char line[4096]; 28 // char line[4096];
27 // pthread_t thread; 29 // pthread_t thread;
28 30
@@ -36,7 +38,7 @@ int main(int numpar, char *param[]) @@ -36,7 +38,7 @@ int main(int numpar, char *param[])
36 // pthread_create(&thread, NULL, mainloop, NULL); 38 // pthread_create(&thread, NULL, mainloop, NULL);
37 // pthread_detach(thread); 39 // pthread_detach(thread);
38 40
39 - lib3270_set_url(h,"tn3270://fandezhi.efglobe.com"); 41 + lib3270_set_url(h,url ? url : "tn3270://fandezhi.efglobe.com");
40 rc = lib3270_connect(h,1); 42 rc = lib3270_connect(h,1);
41 43
42 printf("\nConnect exits with rc=%d\n",rc); 44 printf("\nConnect exits with rc=%d\n",rc);
src/lib3270/toggles.c
@@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
45 45
46 #include <lib3270/config.h> 46 #include <lib3270/config.h>
47 #include "toggle.h" 47 #include "toggle.h"
48 -#include "globals.h" 48 +#include "private.h"
49 49
50 #include "ansic.h" 50 #include "ansic.h"
51 #include "ctlrc.h" 51 #include "ctlrc.h"
src/lib3270/trace_ds.c
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 * 37 *
38 */ 38 */
39 39
40 -#include "globals.h" 40 +#include "private.h"
41 #include <lib3270/trace.h> 41 #include <lib3270/trace.h>
42 42
43 #if defined(X3270_TRACE) /*[*/ 43 #if defined(X3270_TRACE) /*[*/
src/lib3270/utf8.c
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 * UTF-8 conversions 36 * UTF-8 conversions
37 */ 37 */
38 38
39 -#include "globals.h" 39 +#include "private.h"
40 #include "api.h" 40 #include "api.h"
41 41
42 #include "popupsc.h" 42 #include "popupsc.h"
src/lib3270/util.c
@@ -43,7 +43,7 @@ @@ -43,7 +43,7 @@
43 #include <windows.h> 43 #include <windows.h>
44 #endif // _WIN32 44 #endif // _WIN32
45 45
46 -#include "globals.h" 46 +#include "private.h"
47 47
48 #if defined(_WIN32) 48 #if defined(_WIN32)
49 49