diff --git a/src/include/lib3270/session.h b/src/include/lib3270/session.h index 4c3409c..fc46c05 100644 --- a/src/include/lib3270/session.h +++ b/src/include/lib3270/session.h @@ -176,6 +176,7 @@ int trace_primed : 1; int crm_nattr; unsigned char crm_attr[16]; + unsigned char * zero_buf; /**< empty buffer, for area clears */ // Telnet.c unsigned char * ibuf; diff --git a/src/lib3270/ansi.c b/src/lib3270/ansi.c index a8f0485..f3ee326 100644 --- a/src/lib3270/ansi.c +++ b/src/lib3270/ansi.c @@ -1666,7 +1666,7 @@ ansi_scroll(void) { // if (!h3270.is_altbuffer) // scroll_save(1, False); - ctlr_scroll(); + ctlr_scroll(&h3270); return; } diff --git a/src/lib3270/ctlr.c b/src/lib3270/ctlr.c index 11d6589..8d1745c 100644 --- a/src/lib3270/ctlr.c +++ b/src/lib3270/ctlr.c @@ -89,7 +89,7 @@ Boolean dbcs = False; /* Statics */ // static struct ea *aea_buf; /* alternate 3270 extended attribute buffer */ -static unsigned char *zero_buf; // empty buffer, for area clears +// static unsigned char *zero_buf; // empty buffer, for area clears static void set_formatted(H3270 *session); static void ctlr_blanks(H3270 *session); // static Boolean trace_primed = False; @@ -105,7 +105,7 @@ static void ctlr_connect(H3270 *session, int ignored, void *dunno); // static int sscp_start; static void ticking_stop(H3270 *session); static void ctlr_add_ic(int baddr, unsigned char ic); -static void changed(H3270 *session, int bstart, int bend); +// static void changed(H3270 *session, int bstart, int bend); /* * code_table is used to translate buffer addresses and attributes to the 3270 @@ -177,7 +177,7 @@ void ctlr_reinit(H3270 *session, unsigned cmask) session->text = lib3270_calloc(sizeof(struct lib3270_text),sz,session->text); - Replace(zero_buf, (unsigned char *)Calloc(sizeof(struct ea),sz)); + Replace(session->zero_buf, (unsigned char *)Calloc(sizeof(struct ea),sz)); session->cursor_addr = 0; session->buffer_addr = 0; @@ -2543,7 +2543,7 @@ ctlr_bcopy(int baddr_from, int baddr_to, int count, int move_ea) */ void ctlr_aclear(int baddr, int count, int clear_ea) { - if (memcmp((char *) &h3270.ea_buf[baddr], (char *) zero_buf, + if (memcmp((char *) &h3270.ea_buf[baddr], (char *) h3270.zero_buf, count * sizeof(struct ea))) { (void) memset((char *) &h3270.ea_buf[baddr], 0, count * sizeof(struct ea)); @@ -2558,9 +2558,9 @@ void ctlr_aclear(int baddr, int count, int clear_ea) * This could be accomplished with ctlr_bcopy() and ctlr_aclear(), but this * operation is common enough to warrant a separate path. */ -void ctlr_scroll(void) +void ctlr_scroll(H3270 *hSession) { - int qty = (h3270.rows - 1) * h3270.cols; + int qty = (hSession->rows - 1) * hSession->cols; /* Make sure nothing is selected. (later this can be fixed) */ // unselect(0, ROWS*COLS); @@ -2568,12 +2568,12 @@ void ctlr_scroll(void) /* Synchronize pending changes prior to this. */ /* Move ea_buf. */ - (void) memmove(&h3270.ea_buf[0], &h3270.ea_buf[h3270.cols],qty * sizeof(struct ea)); + (void) memmove(&hSession->ea_buf[0], &hSession->ea_buf[h3270.cols],qty * sizeof(struct ea)); /* Clear the last line. */ - (void) memset((char *) &h3270.ea_buf[qty], 0, h3270.cols * sizeof(struct ea)); + (void) memset((char *) &hSession->ea_buf[qty], 0, hSession->cols * sizeof(struct ea)); - h3270.display(&h3270); + hSession->display(hSession); } #endif /*]*/ @@ -2581,8 +2581,9 @@ void ctlr_scroll(void) /* * Note that a particular region of the screen has changed. */ -void changed(H3270 *session, int bstart, int bend) -{ + +// void changed(H3270 *session, int bstart, int bend) +// { /* if(session->first_changed < 0) { @@ -2596,7 +2597,7 @@ void changed(H3270 *session, int bstart, int bend) if(bend > session->last_changed) session->last_changed = bend; */ -} +// } /* * Swap the regular and alternate screen buffers diff --git a/src/lib3270/ctlrc.h b/src/lib3270/ctlrc.h index 058d4be..d16b244 100644 --- a/src/lib3270/ctlrc.h +++ b/src/lib3270/ctlrc.h @@ -41,7 +41,7 @@ LIB3270_INTERNAL void ctlr_init(H3270 *session, unsigned cmask); LIB3270_INTERNAL void ctlr_read_buffer(unsigned char aid_byte); LIB3270_INTERNAL void ctlr_read_modified(unsigned char aid_byte, Boolean all); LIB3270_INTERNAL void ctlr_reinit(H3270 *session, unsigned cmask); -LIB3270_INTERNAL void ctlr_scroll(void); +LIB3270_INTERNAL void ctlr_scroll(H3270 *hSession); LIB3270_INTERNAL void ctlr_shrink(void); LIB3270_INTERNAL void ctlr_snap_buffer(void); LIB3270_INTERNAL Boolean ctlr_snap_modes(void); diff --git a/src/lib3270/ft.c b/src/lib3270/ft.c index cde9616..1c1df72 100644 --- a/src/lib3270/ft.c +++ b/src/lib3270/ft.c @@ -36,7 +36,10 @@ #include "globals.h" #include -#include + +#ifdef HAVE_MALLOC_H + #include +#endif // HAVE_MALLOC_H //#include "appres.h" #include "actionsc.h" diff --git a/src/lib3270/ft_cut.c b/src/lib3270/ft_cut.c index 78bb537..079f1a6 100644 --- a/src/lib3270/ft_cut.c +++ b/src/lib3270/ft_cut.c @@ -36,7 +36,6 @@ */ #include -// #include #include "globals.h" diff --git a/src/lib3270/ft_dft.c b/src/lib3270/ft_dft.c index 889ecdd..3baf003 100644 --- a/src/lib3270/ft_dft.c +++ b/src/lib3270/ft_dft.c @@ -55,7 +55,6 @@ #include "utilc.h" #include -// #include // extern unsigned char aid; diff --git a/src/lib3270/host.c b/src/lib3270/host.c index f900479..cb4da7b 100644 --- a/src/lib3270/host.c +++ b/src/lib3270/host.c @@ -52,7 +52,6 @@ #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/src/lib3270/paste.c b/src/lib3270/paste.c index af1d525..723df3a 100644 --- a/src/lib3270/paste.c +++ b/src/lib3270/paste.c @@ -45,7 +45,6 @@ #endif #include -// #include #include "3270ds.h" //#include "appres.h" @@ -107,7 +106,7 @@ int faddr; unsigned char fa; - if(lib3270_get_toggle(&h3270,LIB3270_TOGGLE_MARGINED_PASTE)) + if(lib3270_get_toggle(session,LIB3270_TOGGLE_MARGINED_PASTE)) { baddr = session->cursor_addr; while(BA_TO_COL(baddr) < lmargin) diff --git a/src/lib3270/proxy.c b/src/lib3270/proxy.c index 0c9ceb1..3510576 100644 --- a/src/lib3270/proxy.c +++ b/src/lib3270/proxy.c @@ -56,7 +56,6 @@ #else -// #include #include #include #include diff --git a/src/lib3270/selection.c b/src/lib3270/selection.c index 08b0059..61ae683 100644 --- a/src/lib3270/selection.c +++ b/src/lib3270/selection.c @@ -29,7 +29,6 @@ #include "globals.h" // #include "appres.h" -// #include #include #include #include diff --git a/src/pw3270/v3270/iocallback.c b/src/pw3270/v3270/iocallback.c index f1a7867..72d0c5f 100644 --- a/src/pw3270/v3270/iocallback.c +++ b/src/pw3270/v3270/iocallback.c @@ -43,10 +43,6 @@ #include #include "../globals.h" -//#ifdef HAVE_MALLOC_H -// #include -//#endif - static int static_CallAndWait(int(*callback)(H3270 *session, void *), H3270 *session, void *parm); static void * static_AddInput(int source, H3270 *session, void (*fn)(H3270 *session)); static void static_RemoveSource(void *id); @@ -123,13 +119,6 @@ static void static_RemoveSource(void *id) g_source_destroy((GSource *) id); } -// #if !defined(_WIN32) -// static void * static_AddOutput(int source, H3270 *session, void (*fn)(H3270 *session)) -// { -// return AddSource(source,session,G_IO_OUT|G_IO_HUP|G_IO_ERR,fn); -// } -// #endif - static void * static_AddExcept(int source, H3270 *session, void (*fn)(H3270 *session)) { #if defined(_WIN32) /*[*/ diff --git a/src/pw3270/v3270/widget.c b/src/pw3270/v3270/widget.c index a157dbe..5d5058f 100644 --- a/src/pw3270/v3270/widget.c +++ b/src/pw3270/v3270/widget.c @@ -33,7 +33,11 @@ #include #include #include - #include + +#ifdef HAVE_MALLOC_H + #include +#endif // HAVE_MALLOC_H + #include "v3270.h" #include "private.h" #include "accessible.h" -- libgit2 0.21.2