From 4908377b3ffb2edd80eb4718dc544b64d17c2142 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Thu, 10 May 2012 18:45:06 +0000 Subject: [PATCH] Implementando biblioteca básica para android --- XtGlue.c | 19 +++++++++++++------ ctlr.c | 11 ++++++----- ft.c | 1 + ft_cut.c | 1 + ft_dft.c | 1 + globals.h | 4 ++-- glue.c | 3 --- host.c | 1 + init.c | 2 ++ paste.c | 3 ++- proxy.c | 2 ++ rpq.c | 2 ++ selection.c | 1 + telnet.c | 15 +++++++++++---- toggle.h | 2 +- util.c | 13 +++++++++++-- 16 files changed, 57 insertions(+), 24 deletions(-) diff --git a/XtGlue.c b/XtGlue.c index 9cc1e7c..8cad2af 100644 --- a/XtGlue.c +++ b/XtGlue.c @@ -34,15 +34,18 @@ #include "globals.h" #include "api.h" -#if defined(_WIN32) /*[*/ -#include "appres.h" -#include "trace_dsc.h" -#include "xioc.h" -#endif /*]*/ +#include + +#if defined(_WIN32) + #include "appres.h" + #include "trace_dsc.h" + #include "xioc.h" +#endif + #include "utilc.h" #include -#include +// #include #include #include #include "X11keysym.h" @@ -78,6 +81,10 @@ #define MILLION 1000000L +/*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/ + + H3270 h3270; + /*---[ Callbacks ]------------------------------------------------------------------------------------------*/ static void DefaultRemoveTimeOut(unsigned long timer); diff --git a/ctlr.c b/ctlr.c index 7b9b716..b4ce3c4 100644 --- a/ctlr.c +++ b/ctlr.c @@ -477,7 +477,7 @@ void ctlr_erase(H3270 *session, int alt) /* Going from maximum to 24x80. */ if (session->maxROWS > 24 || session->maxCOLS > 80) { - if (visible_control) + if(session->vcontrol) { ctlr_blanks(); screen_disp(session); @@ -2282,7 +2282,7 @@ ps_process(void) ; // sms_continue(); -#if defined(X3270_FT) /*[*/ +#if defined(X3270_FT) /* Process file transfers. */ if (lib3270_get_ft_state(&h3270) != LIB3270_FT_STATE_NONE && /* transfer in progress */ h3270.formatted && /* screen is formatted */ @@ -2292,7 +2292,7 @@ ps_process(void) h3270.ea_buf[1919].fa && FA_IS_SKIP(h3270.ea_buf[1919].fa)) { ft_cut_data(); } -#endif /*]*/ +#endif } /* @@ -2666,9 +2666,10 @@ ctlr_shrink(void) { int baddr; - for (baddr = 0; baddr < h3270.rows*h3270.cols; baddr++) { + for (baddr = 0; baddr < h3270.rows*h3270.cols; baddr++) + { if (!h3270.ea_buf[baddr].fa) - h3270.ea_buf[baddr].cc = visible_control? EBC_space : EBC_null; + h3270.ea_buf[baddr].cc = h3270.vcontrol ? EBC_space : EBC_null; } ALL_CHANGED; screen_disp(&h3270); diff --git a/ft.c b/ft.c index 3c673b9..8ba4347 100644 --- a/ft.c +++ b/ft.c @@ -36,6 +36,7 @@ #include "globals.h" #include +#include #include "appres.h" #include "actionsc.h" diff --git a/ft_cut.c b/ft_cut.c index 00b7c35..fc03b40 100644 --- a/ft_cut.c +++ b/ft_cut.c @@ -36,6 +36,7 @@ */ #include +#include #include "globals.h" diff --git a/ft_dft.c b/ft_dft.c index 575cb8c..06a99f3 100644 --- a/ft_dft.c +++ b/ft_dft.c @@ -55,6 +55,7 @@ #include "utilc.h" #include +#include extern unsigned char aid; diff --git a/globals.h b/globals.h index c195141..8c09ccd 100644 --- a/globals.h +++ b/globals.h @@ -106,7 +106,7 @@ * Prerequisite #includes. */ #include /* Unix standard I/O library */ -#include /* Other Unix library functions */ +// #include /* Other Unix library functions */ #include /* Unix system calls */ #include /* Character classes */ #include /* String manipulations */ @@ -248,7 +248,7 @@ LIB3270_INTERNAL Boolean *standard_font; LIB3270_INTERNAL Boolean std_ds_host; LIB3270_INTERNAL char *termtype; LIB3270_INTERNAL Widget toplevel; -LIB3270_INTERNAL Boolean visible_control; +// LIB3270_INTERNAL Boolean visible_control; LIB3270_INTERNAL int *xtra_width; /* diff --git a/glue.c b/glue.c index c4b2b96..e339856 100644 --- a/glue.c +++ b/glue.c @@ -100,7 +100,6 @@ #define LAST_ARG "--" /*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/ - H3270 h3270; const char * programname; AppRes appres; int children = 0; @@ -798,8 +797,6 @@ int *char_width = &cw; static int ch = 7; int *char_height = &ch; -Boolean visible_control = False; - // Boolean flipped = False; /* Replacements for functions in popups.c. */ diff --git a/host.c b/host.c index a2ff9e8..3e5ccb4 100644 --- a/host.c +++ b/host.c @@ -52,6 +52,7 @@ #include "xioc.h" #include +#include #define RECONNECT_MS 2000 /* 2 sec before reconnecting to host */ #define RECONNECT_ERR_MS 5000 /* 5 sec before reconnecting to host */ diff --git a/init.c b/init.c index ea3d472..a3f827f 100644 --- a/init.c +++ b/init.c @@ -35,6 +35,8 @@ #include "appres.h" #include "charsetc.h" +#include + /*---[ Statics ]--------------------------------------------------------------------------------------------------------------*/ static int parse_model_number(H3270 *session, const char *m); diff --git a/paste.c b/paste.c index 8c831da..0b7c0eb 100644 --- a/paste.c +++ b/paste.c @@ -45,9 +45,10 @@ #endif #include +#include + #include "3270ds.h" #include "appres.h" -// #include "ctlr.h" #include "resources.h" #include "actionsc.h" diff --git a/proxy.c b/proxy.c index c7b431d..e18d808 100644 --- a/proxy.c +++ b/proxy.c @@ -46,6 +46,8 @@ #include #include #else /*][*/ + +#include #include #include #include diff --git a/rpq.c b/rpq.c index 622e6f5..e06ab4e 100644 --- a/rpq.c +++ b/rpq.c @@ -48,6 +48,8 @@ #include #endif /*]*/ +#include + #include "api.h" #include diff --git a/selection.c b/selection.c index aaa0e98..a331433 100644 --- a/selection.c +++ b/selection.c @@ -29,6 +29,7 @@ #include "globals.h" #include "appres.h" + #include #include #include #include diff --git a/telnet.c b/telnet.c index c862a52..afd43e3 100644 --- a/telnet.c +++ b/telnet.c @@ -38,10 +38,14 @@ */ #if defined(_WIN32) - #include - #include + #include + #include #endif +#ifndef ANDROID + #include +#endif // !ANDROID + #include #if defined(HAVE_LIBSSL) #include @@ -533,9 +537,12 @@ int net_connect(H3270 *session, const char *host, char *portname, Boolean ls, Bo /* get the passthru host and port number */ if (session->passthru_host) { - const char *hn; + const char *hn = CN; +#ifndef ANDROID hn = getenv("INTERNET_HOST"); +#endif // ANDROID + if (hn == CN) hn = "internet-gateway"; @@ -3432,7 +3439,7 @@ int net_getsockname(const H3270 *session, void *buf, int *len) char * net_proxy_type(void) { - if (proxy_type > 0) + if (proxy_type > 0) return proxy_type_name(proxy_type); else return NULL; diff --git a/toggle.h b/toggle.h index 854517d..32ed14d 100644 --- a/toggle.h +++ b/toggle.h @@ -55,7 +55,7 @@ #define MARGINED_PASTE LIB3270_TOGGLE_MARGINED_PASTE #define RECTANGLE_SELECT LIB3270_TOGGLE_RECTANGLE_SELECT #define CROSSHAIR LIB3270_TOGGLE_CROSSHAIR - #define VISIBLE_CONTROL LIB3270_TOGGLE_VISIBLE_CONTROL +// #define VISIBLE_CONTROL LIB3270_TOGGLE_VISIBLE_CONTROL #define AID_WAIT LIB3270_TOGGLE_AID_WAIT #define FULL_SCREEN LIB3270_TOGGLE_FULL_SCREEN #define RECONNECT LIB3270_TOGGLE_RECONNECT diff --git a/util.c b/util.c index 791bfda..e66acd0 100644 --- a/util.c +++ b/util.c @@ -53,6 +53,10 @@ #include #endif // _WIN32 +#ifndef ANDROID + #include +#endif // !ANDROID + #include #include "resources.h" @@ -516,7 +520,7 @@ get_message(const char *key) #endif */ -#define ex_getenv getenv +// #define ex_getenv getenv /* Variable and tilde substitution functions. */ static char * @@ -602,7 +606,10 @@ var_subst(const char *s) vn = Malloc(vn_len + 1); (void) strncpy(vn, vn_start, vn_len); vn[vn_len] = '\0'; - if ((vv = ex_getenv(vn))) { + +#ifndef ANDROID + if((vv = getenv(vn))) + { *o = '\0'; o_len = o_len - 1 /* '$' */ @@ -615,6 +622,8 @@ var_subst(const char *s) (void) strcpy(o, vv); o += strlen(vv); } +#endif // !ANDROID + Free(vn); if (state == VS_VNB) { state = VS_BASE; -- libgit2 0.21.2