Commit 311e84700a55c057695759eca810188fcd3c9624
1 parent
70142987
Exists in
master
and in
3 other branches
Limpando código, mais ajustes para multi-sessao
Showing
10 changed files
with
20 additions
and
22 deletions
Show diff stats
ansi.c
ctlr.c
... | ... | @@ -89,7 +89,7 @@ Boolean dbcs = False; |
89 | 89 | |
90 | 90 | /* Statics */ |
91 | 91 | // static struct ea *aea_buf; /* alternate 3270 extended attribute buffer */ |
92 | -static unsigned char *zero_buf; // empty buffer, for area clears | |
92 | +// static unsigned char *zero_buf; // empty buffer, for area clears | |
93 | 93 | static void set_formatted(H3270 *session); |
94 | 94 | static void ctlr_blanks(H3270 *session); |
95 | 95 | // static Boolean trace_primed = False; |
... | ... | @@ -105,7 +105,7 @@ static void ctlr_connect(H3270 *session, int ignored, void *dunno); |
105 | 105 | // static int sscp_start; |
106 | 106 | static void ticking_stop(H3270 *session); |
107 | 107 | static void ctlr_add_ic(int baddr, unsigned char ic); |
108 | -static void changed(H3270 *session, int bstart, int bend); | |
108 | +// static void changed(H3270 *session, int bstart, int bend); | |
109 | 109 | |
110 | 110 | /* |
111 | 111 | * code_table is used to translate buffer addresses and attributes to the 3270 |
... | ... | @@ -177,7 +177,7 @@ void ctlr_reinit(H3270 *session, unsigned cmask) |
177 | 177 | |
178 | 178 | session->text = lib3270_calloc(sizeof(struct lib3270_text),sz,session->text); |
179 | 179 | |
180 | - Replace(zero_buf, (unsigned char *)Calloc(sizeof(struct ea),sz)); | |
180 | + Replace(session->zero_buf, (unsigned char *)Calloc(sizeof(struct ea),sz)); | |
181 | 181 | |
182 | 182 | session->cursor_addr = 0; |
183 | 183 | session->buffer_addr = 0; |
... | ... | @@ -2543,7 +2543,7 @@ ctlr_bcopy(int baddr_from, int baddr_to, int count, int move_ea) |
2543 | 2543 | */ |
2544 | 2544 | void ctlr_aclear(int baddr, int count, int clear_ea) |
2545 | 2545 | { |
2546 | - if (memcmp((char *) &h3270.ea_buf[baddr], (char *) zero_buf, | |
2546 | + if (memcmp((char *) &h3270.ea_buf[baddr], (char *) h3270.zero_buf, | |
2547 | 2547 | count * sizeof(struct ea))) { |
2548 | 2548 | (void) memset((char *) &h3270.ea_buf[baddr], 0, |
2549 | 2549 | count * sizeof(struct ea)); |
... | ... | @@ -2558,9 +2558,9 @@ void ctlr_aclear(int baddr, int count, int clear_ea) |
2558 | 2558 | * This could be accomplished with ctlr_bcopy() and ctlr_aclear(), but this |
2559 | 2559 | * operation is common enough to warrant a separate path. |
2560 | 2560 | */ |
2561 | -void ctlr_scroll(void) | |
2561 | +void ctlr_scroll(H3270 *hSession) | |
2562 | 2562 | { |
2563 | - int qty = (h3270.rows - 1) * h3270.cols; | |
2563 | + int qty = (hSession->rows - 1) * hSession->cols; | |
2564 | 2564 | |
2565 | 2565 | /* Make sure nothing is selected. (later this can be fixed) */ |
2566 | 2566 | // unselect(0, ROWS*COLS); |
... | ... | @@ -2568,12 +2568,12 @@ void ctlr_scroll(void) |
2568 | 2568 | /* Synchronize pending changes prior to this. */ |
2569 | 2569 | |
2570 | 2570 | /* Move ea_buf. */ |
2571 | - (void) memmove(&h3270.ea_buf[0], &h3270.ea_buf[h3270.cols],qty * sizeof(struct ea)); | |
2571 | + (void) memmove(&hSession->ea_buf[0], &hSession->ea_buf[h3270.cols],qty * sizeof(struct ea)); | |
2572 | 2572 | |
2573 | 2573 | /* Clear the last line. */ |
2574 | - (void) memset((char *) &h3270.ea_buf[qty], 0, h3270.cols * sizeof(struct ea)); | |
2574 | + (void) memset((char *) &hSession->ea_buf[qty], 0, hSession->cols * sizeof(struct ea)); | |
2575 | 2575 | |
2576 | - h3270.display(&h3270); | |
2576 | + hSession->display(hSession); | |
2577 | 2577 | |
2578 | 2578 | } |
2579 | 2579 | #endif /*]*/ |
... | ... | @@ -2581,8 +2581,9 @@ void ctlr_scroll(void) |
2581 | 2581 | /* |
2582 | 2582 | * Note that a particular region of the screen has changed. |
2583 | 2583 | */ |
2584 | -void changed(H3270 *session, int bstart, int bend) | |
2585 | -{ | |
2584 | + | |
2585 | +// void changed(H3270 *session, int bstart, int bend) | |
2586 | +// { | |
2586 | 2587 | /* |
2587 | 2588 | if(session->first_changed < 0) |
2588 | 2589 | { |
... | ... | @@ -2596,7 +2597,7 @@ void changed(H3270 *session, int bstart, int bend) |
2596 | 2597 | if(bend > session->last_changed) |
2597 | 2598 | session->last_changed = bend; |
2598 | 2599 | */ |
2599 | -} | |
2600 | +// } | |
2600 | 2601 | |
2601 | 2602 | /* |
2602 | 2603 | * Swap the regular and alternate screen buffers | ... | ... |
ctlrc.h
... | ... | @@ -41,7 +41,7 @@ LIB3270_INTERNAL void ctlr_init(H3270 *session, unsigned cmask); |
41 | 41 | LIB3270_INTERNAL void ctlr_read_buffer(unsigned char aid_byte); |
42 | 42 | LIB3270_INTERNAL void ctlr_read_modified(unsigned char aid_byte, Boolean all); |
43 | 43 | LIB3270_INTERNAL void ctlr_reinit(H3270 *session, unsigned cmask); |
44 | -LIB3270_INTERNAL void ctlr_scroll(void); | |
44 | +LIB3270_INTERNAL void ctlr_scroll(H3270 *hSession); | |
45 | 45 | LIB3270_INTERNAL void ctlr_shrink(void); |
46 | 46 | LIB3270_INTERNAL void ctlr_snap_buffer(void); |
47 | 47 | LIB3270_INTERNAL Boolean ctlr_snap_modes(void); | ... | ... |
ft_cut.c
ft_dft.c
host.c
paste.c
... | ... | @@ -45,7 +45,6 @@ |
45 | 45 | #endif |
46 | 46 | |
47 | 47 | #include <fcntl.h> |
48 | -// #include <malloc.h> | |
49 | 48 | |
50 | 49 | #include "3270ds.h" |
51 | 50 | //#include "appres.h" |
... | ... | @@ -107,7 +106,7 @@ |
107 | 106 | int faddr; |
108 | 107 | unsigned char fa; |
109 | 108 | |
110 | - if(lib3270_get_toggle(&h3270,LIB3270_TOGGLE_MARGINED_PASTE)) | |
109 | + if(lib3270_get_toggle(session,LIB3270_TOGGLE_MARGINED_PASTE)) | |
111 | 110 | { |
112 | 111 | baddr = session->cursor_addr; |
113 | 112 | while(BA_TO_COL(baddr) < lmargin) | ... | ... |
proxy.c