diff --git a/appres.h b/appres.h index 722ecb8..921d96d 100644 --- a/appres.h +++ b/appres.h @@ -52,8 +52,8 @@ typedef struct { /* Options (not toggles) */ char mono; char extended; - char m3279; - char modified_sel; +// char m3279; +// char modified_sel; // char once; //#if defined(X3270_DISPLAY) /*[*/ // char visual_bell; diff --git a/ctlr.c b/ctlr.c index b4ce3c4..be11fca 100644 --- a/ctlr.c +++ b/ctlr.c @@ -1198,7 +1198,7 @@ ctlr_write(unsigned char buf[], int buflen, Boolean erase) trace_ds("%sresetMDT", paren); paren = ","; baddr = 0; - if (appres.modified_sel) + if (h3270.modified_sel) ALL_CHANGED; do { if (h3270.ea_buf[baddr].fa) { @@ -1485,14 +1485,14 @@ ctlr_write(unsigned char buf[], int buflen, Boolean erase) see_efa(*cp, *(cp + 1))); cp++; - if (appres.m3279) + if (h3270.m3279) ctlr_add_fg(h3270.buffer_addr, *cp); } else if (*cp == XA_BACKGROUND) { trace_ds("%s", see_efa(*cp, *(cp + 1))); cp++; - if (appres.m3279) + if (h3270.m3279) ctlr_add_bg(h3270.buffer_addr, *cp); } else if (*cp == XA_HIGHLIGHTING) { trace_ds("%s", @@ -1558,12 +1558,12 @@ ctlr_write(unsigned char buf[], int buflen, Boolean erase) } else if (*cp == XA_FOREGROUND) { trace_ds("%s", see_efa(*cp, *(cp + 1))); cp++; - if (appres.m3279) + if (h3270.m3279) efa_fg = *cp; } else if (*cp == XA_BACKGROUND) { trace_ds("%s", see_efa(*cp, *(cp + 1))); cp++; - if (appres.m3279) + if (h3270.m3279) efa_bg = *cp; } else if (*cp == XA_HIGHLIGHTING) { trace_ds("%s", see_efa(*cp, *(cp + 1))); @@ -1608,11 +1608,11 @@ ctlr_write(unsigned char buf[], int buflen, Boolean erase) cp++; if (*cp == XA_FOREGROUND) { trace_ds("%s", see_efa(*cp, *(cp + 1))); - if (appres.m3279) + if (h3270.m3279) default_fg = *(cp + 1); } else if (*cp == XA_BACKGROUND) { trace_ds("%s", see_efa(*cp, *(cp + 1))); - if (appres.m3279) + if (h3270.m3279) default_bg = *(cp + 1); } else if (*cp == XA_HIGHLIGHTING) { trace_ds("%s", see_efa(*cp, *(cp + 1))); @@ -2446,7 +2446,7 @@ ctlr_add_gr(int baddr, unsigned char gr) void ctlr_add_fg(int baddr, unsigned char color) { - if (!appres.m3279) + if (!h3270.m3279) return; if ((color & 0xf0) != 0xf0) color = 0; @@ -2463,7 +2463,7 @@ ctlr_add_fg(int baddr, unsigned char color) void ctlr_add_bg(int baddr, unsigned char color) { - if (!appres.m3279) + if (!h3270.m3279) return; if ((color & 0xf0) != 0xf0) color = 0; @@ -2639,7 +2639,7 @@ mdt_set(int baddr) faddr = find_field_attribute(&h3270,baddr); if (faddr >= 0 && !(h3270.ea_buf[faddr].fa & FA_MODIFY)) { h3270.ea_buf[faddr].fa |= FA_MODIFY; - if (appres.modified_sel) + if (h3270.modified_sel) ALL_CHANGED; } } @@ -2652,7 +2652,7 @@ mdt_clear(int baddr) faddr = find_field_attribute(&h3270,baddr); if (faddr >= 0 && (h3270.ea_buf[faddr].fa & FA_MODIFY)) { h3270.ea_buf[faddr].fa &= ~FA_MODIFY; - if (appres.modified_sel) + if (h3270.modified_sel) ALL_CHANGED; } } diff --git a/glue.c b/glue.c index e339856..016c060 100644 --- a/glue.c +++ b/glue.c @@ -139,12 +139,10 @@ static void initialize(void) appres.extended = True; #if defined(C3270) /*[*/ - appres.m3279 = True; -#else /*][*/ - appres.m3279 = False; + h3270.m3279 = True; #endif /*]*/ - appres.modified_sel = False; +// appres.modified_sel = False; appres.apl_mode = False; /* @@ -430,9 +428,9 @@ static struct { { ResLnext, offset(lnext), XRM_STRING }, #endif /*]*/ { ResLoginMacro,offset(login_macro), XRM_STRING }, - { ResM3279, offset(m3279), XRM_BOOLEAN }, +// { ResM3279, offset(m3279), XRM_BOOLEAN }, // { ResModel, offset(model), XRM_STRING }, - { ResModifiedSel, offset(modified_sel), XRM_BOOLEAN }, +// { ResModifiedSel, offset(modified_sel), XRM_BOOLEAN }, #if defined(C3270) && !defined(_WIN32) /*[*/ { ResMono, offset(mono), XRM_BOOLEAN }, #endif /*]*/ diff --git a/init.c b/init.c index a3f827f..3e3eb4f 100644 --- a/init.c +++ b/init.c @@ -184,13 +184,15 @@ static void lib3270_session_init(H3270 *hSession, const char *model) } if(appres.mono) - appres.m3279 = False; + hSession->m3279 = 0; + else + hSession->m3279 = 1; if(!appres.extended) appres.oversize = CN; #if defined(RESTRICT_3279) - if (appres.m3279 && model_number == 4) + if (hSession->m3279 && model_number == 4) model_number = 3; #endif @@ -285,11 +287,16 @@ static int parse_model_number(H3270 *session, const char *m) * If it's longer than one character, it needs to start with * '327[89]', and it sets the m3279 resource. */ - if (!strncmp(m, "3278", 4)) { - appres.m3279 = False; - } else if (!strncmp(m, "3279", 4)) { - appres.m3279 = True; - } else { + if (!strncmp(m, "3278", 4)) + { + session->m3279 = 0; + } + else if (!strncmp(m, "3279", 4)) + { + session->m3279 = 1; + } + else + { return -1; } m += 4; diff --git a/proxy.c b/proxy.c index e18d808..1d448b1 100644 --- a/proxy.c +++ b/proxy.c @@ -42,6 +42,10 @@ #include "resources.h" #endif /*]*/ +#ifndef ANDROID + #include +#endif + #if defined(_WIN32) /*[*/ #include #include diff --git a/screen.c b/screen.c index d83186a..d37e618 100644 --- a/screen.c +++ b/screen.c @@ -148,7 +148,7 @@ int screen_init(H3270 *session) /* Map a field attribute to its default colors. */ static unsigned short color_from_fa(unsigned char fa) { - if (appres.m3279) + if (h3270.m3279) return get_color_pair(DEFCOLOR_MAP(fa),0) | COLOR_ATTR_FIELD; // Green on black @@ -166,7 +166,7 @@ static unsigned short calc_attrs(H3270 *session, int baddr, int fa_addr, int fa) /* Compute the color. */ /* Monochrome is easy, and so is color if nothing is specified. */ - if (!appres.m3279 || + if (!h3270.m3279 || (!session->ea_buf[baddr].fg && !session->ea_buf[fa_addr].fg && !session->ea_buf[baddr].bg && @@ -219,10 +219,10 @@ static unsigned short calc_attrs(H3270 *session, int baddr, int fa_addr, int fa) a |= LIB3270_ATTR_UNDERLINE; } - if(appres.m3279 && (gr & (GR_BLINK | GR_UNDERLINE)) && !(gr & GR_REVERSE) && !bg) + if(h3270.m3279 && (gr & (GR_BLINK | GR_UNDERLINE)) && !(gr & GR_REVERSE) && !bg) a |= LIB3270_ATTR_BACKGROUND_INTENSITY; - if(!appres.m3279 && ((gr & GR_INTENSIFY) || FA_IS_HIGH(fa))) + if(!h3270.m3279 && ((gr & GR_INTENSIFY) || FA_IS_HIGH(fa))) a |= LIB3270_ATTR_INTENSIFY; if (gr & GR_REVERSE) @@ -260,7 +260,7 @@ void update_model_info(H3270 *session, int model, int cols, int rows) session->model_num = model; /* Update the model name. */ - (void) sprintf(session->model_name, "327%c-%d%s",appres.m3279 ? '9' : '8',session->model_num,appres.extended ? "-E" : ""); + (void) sprintf(session->model_name, "327%c-%d%s",session->m3279 ? '9' : '8',session->model_num,appres.extended ? "-E" : ""); session->update_model(session, session->model_name,session->model_num,rows,cols); } diff --git a/sf.c b/sf.c index 2dbf3e3..05dcab5 100644 --- a/sf.c +++ b/sf.c @@ -770,7 +770,7 @@ do_qr_color(void) *obptr++ = 0xf0 + COLOR_GREEN; /* green */ for (i = 0xf1; i < 0xf1 + color_max - 1; i++) { *obptr++ = i; - if (appres.m3279) + if (h3270.m3279) *obptr++ = i; else *obptr++ = 0x00; @@ -779,7 +779,7 @@ do_qr_color(void) /* #if !defined(X3270_DISPLAY) // Add background color. - if (appres.m3279) { + if (h3270.m3279) { space3270out(4); *obptr++ = 4; // length *obptr++ = 0x02; // background color diff --git a/telnet.c b/telnet.c index afd43e3..c43667e 100644 --- a/telnet.c +++ b/telnet.c @@ -677,8 +677,7 @@ int net_connect(H3270 *session, const char *host, char *portname, Boolean ls, Bo /* set up temporary termtype */ if (appres.termname == CN && session->std_ds_host) { - (void) sprintf(ttype_tmpval, "IBM-327%c-%d", - appres.m3279 ? '9' : '8', session->model_num); + (void) sprintf(ttype_tmpval, "IBM-327%c-%d",session->m3279 ? '9' : '8', session->model_num); session->termtype = ttype_tmpval; } -- libgit2 0.21.2