Commit b04b9f4b4010f526263ee318542863f914f2f5ff
1 parent
4b5c614f
Exists in
master
and in
5 other branches
Pequenos ajustes na estrutura de sessao
Showing
2 changed files
with
20 additions
and
22 deletions
Show diff stats
src/include/lib3270/session.h
| @@ -41,7 +41,7 @@ | @@ -41,7 +41,7 @@ | ||
| 41 | #define LIB3270_TELNET_N_OPTS 256 | 41 | #define LIB3270_TELNET_N_OPTS 256 |
| 42 | 42 | ||
| 43 | /** extended attributes */ | 43 | /** extended attributes */ |
| 44 | - struct ea | 44 | + struct lib3270_ea |
| 45 | { | 45 | { |
| 46 | unsigned char cc; /**< EBCDIC or ASCII character code */ | 46 | unsigned char cc; /**< EBCDIC or ASCII character code */ |
| 47 | unsigned char fa; /**< field attribute, it nonzero */ | 47 | unsigned char fa; /**< field attribute, it nonzero */ |
| @@ -59,12 +59,6 @@ | @@ -59,12 +59,6 @@ | ||
| 59 | unsigned short attr; /**< Converted character attribute (color & etc) */ | 59 | unsigned short attr; /**< Converted character attribute (color & etc) */ |
| 60 | }; | 60 | }; |
| 61 | 61 | ||
| 62 | - struct lib3270_toggle | ||
| 63 | - { | ||
| 64 | - char value; /**< toggle value */ | ||
| 65 | - void (*upcall)(H3270 *, struct lib3270_toggle *, LIB3270_TOGGLE_TYPE); /**< change value */ | ||
| 66 | - }; | ||
| 67 | - | ||
| 68 | #ifndef HEADER_SSL_H | 62 | #ifndef HEADER_SSL_H |
| 69 | #define SSL void | 63 | #define SSL void |
| 70 | #endif // !HEADER_SSL_H | 64 | #endif // !HEADER_SSL_H |
| @@ -116,7 +110,11 @@ | @@ -116,7 +110,11 @@ | ||
| 116 | 110 | ||
| 117 | LIB3270_SSL_STATE secure; | 111 | LIB3270_SSL_STATE secure; |
| 118 | 112 | ||
| 119 | - struct lib3270_toggle toggle[LIB3270_TOGGLE_COUNT]; | 113 | + struct lib3270_toggle |
| 114 | + { | ||
| 115 | + char value; /**< toggle value */ | ||
| 116 | + void (*upcall)(H3270 *, struct lib3270_toggle *, LIB3270_TOGGLE_TYPE); /**< change value */ | ||
| 117 | + } toggle[LIB3270_TOGGLE_COUNT]; | ||
| 120 | 118 | ||
| 121 | // Network & Termtype | 119 | // Network & Termtype |
| 122 | char * hostname; | 120 | char * hostname; |
| @@ -163,8 +161,8 @@ | @@ -163,8 +161,8 @@ | ||
| 163 | 161 | ||
| 164 | // Screen contents | 162 | // Screen contents |
| 165 | void * buffer[2]; /**< Internal buffers */ | 163 | void * buffer[2]; /**< Internal buffers */ |
| 166 | - struct ea * ea_buf; /**< 3270 device buffer. ea_buf[-1] is the dummy default field attribute */ | ||
| 167 | - struct ea * aea_buf; /** alternate 3270 extended attribute buffer */ | 164 | + struct lib3270_ea * ea_buf; /**< 3270 device buffer. ea_buf[-1] is the dummy default field attribute */ |
| 165 | + struct lib3270_ea * aea_buf; /** alternate 3270 extended attribute buffer */ | ||
| 168 | struct lib3270_text * text; /**< Converted 3270 chars */ | 166 | struct lib3270_text * text; /**< Converted 3270 chars */ |
| 169 | 167 | ||
| 170 | // host.c | 168 | // host.c |
src/lib3270/ctlr.c
| @@ -134,18 +134,18 @@ void ctlr_reinit(H3270 *session, unsigned cmask) | @@ -134,18 +134,18 @@ void ctlr_reinit(H3270 *session, unsigned cmask) | ||
| 134 | if (cmask & MODEL_CHANGE) | 134 | if (cmask & MODEL_CHANGE) |
| 135 | { | 135 | { |
| 136 | /* Allocate buffers */ | 136 | /* Allocate buffers */ |
| 137 | - struct ea *tmp; | 137 | + struct lib3270_ea *tmp; |
| 138 | size_t sz = (session->maxROWS * session->maxCOLS); | 138 | size_t sz = (session->maxROWS * session->maxCOLS); |
| 139 | 139 | ||
| 140 | - session->buffer[0] = tmp = lib3270_calloc(sizeof(struct ea), sz+1, session->buffer[0]); | 140 | + session->buffer[0] = tmp = lib3270_calloc(sizeof(struct lib3270_ea), sz+1, session->buffer[0]); |
| 141 | session->ea_buf = tmp + 1; | 141 | session->ea_buf = tmp + 1; |
| 142 | 142 | ||
| 143 | - session->buffer[1] = tmp = lib3270_calloc(sizeof(struct ea),sz+1,session->buffer[1]); | 143 | + session->buffer[1] = tmp = lib3270_calloc(sizeof(struct lib3270_ea),sz+1,session->buffer[1]); |
| 144 | session->aea_buf = tmp + 1; | 144 | session->aea_buf = tmp + 1; |
| 145 | 145 | ||
| 146 | session->text = lib3270_calloc(sizeof(struct lib3270_text),sz,session->text); | 146 | session->text = lib3270_calloc(sizeof(struct lib3270_text),sz,session->text); |
| 147 | 147 | ||
| 148 | - Replace(session->zero_buf, (unsigned char *)Calloc(sizeof(struct ea),sz)); | 148 | + Replace(session->zero_buf, (unsigned char *)Calloc(sizeof(struct lib3270_ea),sz)); |
| 149 | 149 | ||
| 150 | session->cursor_addr = 0; | 150 | session->cursor_addr = 0; |
| 151 | session->buffer_addr = 0; | 151 | session->buffer_addr = 0; |
| @@ -2270,7 +2270,7 @@ ctlr_clear(H3270 *session, Boolean can_snap) | @@ -2270,7 +2270,7 @@ ctlr_clear(H3270 *session, Boolean can_snap) | ||
| 2270 | #endif /*]*/ | 2270 | #endif /*]*/ |
| 2271 | 2271 | ||
| 2272 | /* Clear the screen. */ | 2272 | /* Clear the screen. */ |
| 2273 | - (void) memset((char *)session->ea_buf, 0, session->rows*session->cols*sizeof(struct ea)); | 2273 | + (void) memset((char *)session->ea_buf, 0, session->rows*session->cols*sizeof(struct lib3270_ea)); |
| 2274 | cursor_move(session,0); | 2274 | cursor_move(session,0); |
| 2275 | session->buffer_addr = 0; | 2275 | session->buffer_addr = 0; |
| 2276 | lib3270_unselect(session); | 2276 | lib3270_unselect(session); |
| @@ -2469,9 +2469,9 @@ ctlr_bcopy(int baddr_from, int baddr_to, int count, int move_ea) | @@ -2469,9 +2469,9 @@ ctlr_bcopy(int baddr_from, int baddr_to, int count, int move_ea) | ||
| 2469 | /* Move the characters. */ | 2469 | /* Move the characters. */ |
| 2470 | if (memcmp((char *) &h3270.ea_buf[baddr_from], | 2470 | if (memcmp((char *) &h3270.ea_buf[baddr_from], |
| 2471 | (char *) &h3270.ea_buf[baddr_to], | 2471 | (char *) &h3270.ea_buf[baddr_to], |
| 2472 | - count * sizeof(struct ea))) { | 2472 | + count * sizeof(struct lib3270_ea))) { |
| 2473 | (void) memmove(&h3270.ea_buf[baddr_to], &h3270.ea_buf[baddr_from], | 2473 | (void) memmove(&h3270.ea_buf[baddr_to], &h3270.ea_buf[baddr_from], |
| 2474 | - count * sizeof(struct ea)); | 2474 | + count * sizeof(struct lib3270_ea)); |
| 2475 | REGION_CHANGED(&h3270,baddr_to, baddr_to + count); | 2475 | REGION_CHANGED(&h3270,baddr_to, baddr_to + count); |
| 2476 | } | 2476 | } |
| 2477 | /* XXX: What about move_ea? */ | 2477 | /* XXX: What about move_ea? */ |
| @@ -2485,9 +2485,9 @@ ctlr_bcopy(int baddr_from, int baddr_to, int count, int move_ea) | @@ -2485,9 +2485,9 @@ ctlr_bcopy(int baddr_from, int baddr_to, int count, int move_ea) | ||
| 2485 | void ctlr_aclear(H3270 *session, int baddr, int count, int clear_ea) | 2485 | void ctlr_aclear(H3270 *session, int baddr, int count, int clear_ea) |
| 2486 | { | 2486 | { |
| 2487 | if (memcmp((char *) &session->ea_buf[baddr], (char *) session->zero_buf, | 2487 | if (memcmp((char *) &session->ea_buf[baddr], (char *) session->zero_buf, |
| 2488 | - count * sizeof(struct ea))) { | 2488 | + count * sizeof(struct lib3270_ea))) { |
| 2489 | (void) memset((char *) &session->ea_buf[baddr], 0, | 2489 | (void) memset((char *) &session->ea_buf[baddr], 0, |
| 2490 | - count * sizeof(struct ea)); | 2490 | + count * sizeof(struct lib3270_ea)); |
| 2491 | REGION_CHANGED(session,baddr, baddr + count); | 2491 | REGION_CHANGED(session,baddr, baddr + count); |
| 2492 | } | 2492 | } |
| 2493 | /* XXX: What about clear_ea? */ | 2493 | /* XXX: What about clear_ea? */ |
| @@ -2509,10 +2509,10 @@ void ctlr_scroll(H3270 *hSession) | @@ -2509,10 +2509,10 @@ void ctlr_scroll(H3270 *hSession) | ||
| 2509 | /* Synchronize pending changes prior to this. */ | 2509 | /* Synchronize pending changes prior to this. */ |
| 2510 | 2510 | ||
| 2511 | /* Move ea_buf. */ | 2511 | /* Move ea_buf. */ |
| 2512 | - (void) memmove(&hSession->ea_buf[0], &hSession->ea_buf[h3270.cols],qty * sizeof(struct ea)); | 2512 | + (void) memmove(&hSession->ea_buf[0], &hSession->ea_buf[h3270.cols],qty * sizeof(struct lib3270_ea)); |
| 2513 | 2513 | ||
| 2514 | /* Clear the last line. */ | 2514 | /* Clear the last line. */ |
| 2515 | - (void) memset((char *) &hSession->ea_buf[qty], 0, hSession->cols * sizeof(struct ea)); | 2515 | + (void) memset((char *) &hSession->ea_buf[qty], 0, hSession->cols * sizeof(struct lib3270_ea)); |
| 2516 | 2516 | ||
| 2517 | hSession->display(hSession); | 2517 | hSession->display(hSession); |
| 2518 | 2518 | ||
| @@ -2549,7 +2549,7 @@ void ctlr_altbuffer(H3270 *session, int alt) | @@ -2549,7 +2549,7 @@ void ctlr_altbuffer(H3270 *session, int alt) | ||
| 2549 | 2549 | ||
| 2550 | if (alt != session->is_altbuffer) | 2550 | if (alt != session->is_altbuffer) |
| 2551 | { | 2551 | { |
| 2552 | - struct ea *etmp; | 2552 | + struct lib3270_ea *etmp; |
| 2553 | 2553 | ||
| 2554 | etmp = session->ea_buf; | 2554 | etmp = session->ea_buf; |
| 2555 | session->ea_buf = session->aea_buf; | 2555 | session->ea_buf = session->aea_buf; |