diff --git a/ansi.c b/ansi.c index a8f0485..f3ee326 100644 --- a/ansi.c +++ b/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/ctlr.c b/ctlr.c index 11d6589..8d1745c 100644 --- a/ctlr.c +++ b/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/ctlrc.h b/ctlrc.h index 058d4be..d16b244 100644 --- a/ctlrc.h +++ b/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/ft.c b/ft.c index cde9616..1c1df72 100644 --- a/ft.c +++ b/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/ft_cut.c b/ft_cut.c index 78bb537..079f1a6 100644 --- a/ft_cut.c +++ b/ft_cut.c @@ -36,7 +36,6 @@ */ #include -// #include #include "globals.h" diff --git a/ft_dft.c b/ft_dft.c index 889ecdd..3baf003 100644 --- a/ft_dft.c +++ b/ft_dft.c @@ -55,7 +55,6 @@ #include "utilc.h" #include -// #include // extern unsigned char aid; diff --git a/host.c b/host.c index f900479..cb4da7b 100644 --- a/host.c +++ b/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/paste.c b/paste.c index af1d525..723df3a 100644 --- a/paste.c +++ b/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/proxy.c b/proxy.c index 0c9ceb1..3510576 100644 --- a/proxy.c +++ b/proxy.c @@ -56,7 +56,6 @@ #else -// #include #include #include #include diff --git a/selection.c b/selection.c index 08b0059..61ae683 100644 --- a/selection.c +++ b/selection.c @@ -29,7 +29,6 @@ #include "globals.h" // #include "appres.h" -// #include #include #include #include -- libgit2 0.21.2