Commit 47203aff7513963687c1d338eb9dc2d6a8760398
1 parent
360022bc
Exists in
master
and in
3 other branches
Isolando callbacks da estrutura principal.
Showing
14 changed files
with
135 additions
and
138 deletions
Show diff stats
ansi.c
@@ -618,7 +618,7 @@ static enum lib3270_ansi_state ansi_reset(H3270 *hSession, int ig1 unused, int i | @@ -618,7 +618,7 @@ static enum lib3270_ansi_state ansi_reset(H3270 *hSession, int ig1 unused, int i | ||
618 | ctlr_aclear(hSession, 0, hSession->rows * hSession->cols, 1); | 618 | ctlr_aclear(hSession, 0, hSession->rows * hSession->cols, 1); |
619 | ctlr_altbuffer(hSession,False); | 619 | ctlr_altbuffer(hSession,False); |
620 | ctlr_clear(hSession,False); | 620 | ctlr_clear(hSession,False); |
621 | - hSession->set_width(hSession,80); | 621 | + hSession->cbk.set_width(hSession,80); |
622 | hSession->ansi_reset = 1; | 622 | hSession->ansi_reset = 1; |
623 | } | 623 | } |
624 | hSession->pmi = 0; | 624 | hSession->pmi = 0; |
@@ -1459,7 +1459,7 @@ dec_set(H3270 *hSession, int ig1 unused, int ig2 unused) | @@ -1459,7 +1459,7 @@ dec_set(H3270 *hSession, int ig1 unused, int ig2 unused) | ||
1459 | if(hSession->allow_wide_mode) | 1459 | if(hSession->allow_wide_mode) |
1460 | { | 1460 | { |
1461 | hSession->wide_mode = 1; | 1461 | hSession->wide_mode = 1; |
1462 | - hSession->set_width(hSession,132); | 1462 | + hSession->cbk.set_width(hSession,132); |
1463 | } | 1463 | } |
1464 | break; | 1464 | break; |
1465 | case 7: /* wraparound mode */ | 1465 | case 7: /* wraparound mode */ |
@@ -1493,7 +1493,7 @@ dec_reset(H3270 *hSession, int ig1 unused, int ig2 unused) | @@ -1493,7 +1493,7 @@ dec_reset(H3270 *hSession, int ig1 unused, int ig2 unused) | ||
1493 | if (hSession->allow_wide_mode) | 1493 | if (hSession->allow_wide_mode) |
1494 | { | 1494 | { |
1495 | hSession->wide_mode = 0; | 1495 | hSession->wide_mode = 0; |
1496 | - hSession->set_width(hSession,80); | 1496 | + hSession->cbk.set_width(hSession,80); |
1497 | } | 1497 | } |
1498 | break; | 1498 | break; |
1499 | case 7: /* no wraparound mode */ | 1499 | case 7: /* no wraparound mode */ |
@@ -1556,7 +1556,7 @@ dec_restore(H3270 *hSession, int ig1 unused, int ig2 unused) | @@ -1556,7 +1556,7 @@ dec_restore(H3270 *hSession, int ig1 unused, int ig2 unused) | ||
1556 | if (hSession->allow_wide_mode) | 1556 | if (hSession->allow_wide_mode) |
1557 | { | 1557 | { |
1558 | hSession->wide_mode = hSession->saved_wide_mode; | 1558 | hSession->wide_mode = hSession->saved_wide_mode; |
1559 | - hSession->set_width(hSession,hSession->wide_mode ? 132 : 80); | 1559 | + hSession->cbk.set_width(hSession,hSession->wide_mode ? 132 : 80); |
1560 | } | 1560 | } |
1561 | break; | 1561 | break; |
1562 | case 7: /* wraparound mode */ | 1562 | case 7: /* wraparound mode */ |
charset.c
ctlr.c
@@ -95,9 +95,9 @@ static const unsigned char code_table[64] = | @@ -95,9 +95,9 @@ static const unsigned char code_table[64] = | ||
95 | #define IsBlank(c) ((c == EBC_null) || (c == EBC_space)) | 95 | #define IsBlank(c) ((c == EBC_null) || (c == EBC_space)) |
96 | 96 | ||
97 | 97 | ||
98 | -#define ALL_CHANGED(h) if(lib3270_in_ansi(h)) (h)->changed(h,0,(h)->rows*(h)->cols); | ||
99 | -#define REGION_CHANGED(h, f, l) if(lib3270_in_ansi(h)) (h)->changed(h,f,l) | ||
100 | -#define ONE_CHANGED(h,n) if(lib3270_in_ansi(h)) (h)->changed(h,n,n+1); | 98 | +#define ALL_CHANGED(h) if(lib3270_in_ansi(h)) (h)->cbk.changed(h,0,(h)->rows*(h)->cols); |
99 | +#define REGION_CHANGED(h, f, l) if(lib3270_in_ansi(h)) (h)->cbk.changed(h,f,l) | ||
100 | +#define ONE_CHANGED(h,n) if(lib3270_in_ansi(h)) (h)->cbk.changed(h,n,n+1); | ||
101 | 101 | ||
102 | #define DECODE_BADDR(c1, c2) \ | 102 | #define DECODE_BADDR(c1, c2) \ |
103 | ((((c1) & 0xC0) == 0x00) ? \ | 103 | ((((c1) & 0xC0) == 0x00) ? \ |
@@ -379,16 +379,6 @@ void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr) | @@ -379,16 +379,6 @@ void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr) | ||
379 | static void set_formatted(H3270 *hSession, int state) | 379 | static void set_formatted(H3270 *hSession, int state) |
380 | { | 380 | { |
381 | hSession->formatted = state; | 381 | hSession->formatted = state; |
382 | -/* | ||
383 | - int last = (int) hSession->formatted; | ||
384 | - hSession->formatted = state; | ||
385 | - | ||
386 | - if( ((int) hSession->formatted) != last) | ||
387 | - { | ||
388 | - trace("Screen is now %s",hSession->formatted ? "formatted" : "unformatted"); | ||
389 | - hSession->update_formatted(hSession,hSession->formatted); | ||
390 | - } | ||
391 | -*/ | ||
392 | } | 382 | } |
393 | 383 | ||
394 | /** | 384 | /** |
@@ -640,7 +630,7 @@ void ctlr_erase(H3270 *session, int alt) | @@ -640,7 +630,7 @@ void ctlr_erase(H3270 *session, int alt) | ||
640 | 630 | ||
641 | kybd_inhibit(session,False); | 631 | kybd_inhibit(session,False); |
642 | ctlr_clear(session,True); | 632 | ctlr_clear(session,True); |
643 | - session->erase(session); | 633 | + session->cbk.erase(session); |
644 | 634 | ||
645 | if(alt == session->screen_alt) | 635 | if(alt == session->screen_alt) |
646 | return; | 636 | return; |
@@ -648,7 +638,7 @@ void ctlr_erase(H3270 *session, int alt) | @@ -648,7 +638,7 @@ void ctlr_erase(H3270 *session, int alt) | ||
648 | if (alt) | 638 | if (alt) |
649 | { | 639 | { |
650 | /* Going from 24x80 to maximum. */ | 640 | /* Going from 24x80 to maximum. */ |
651 | - session->display(session); | 641 | + session->cbk.display(session); |
652 | 642 | ||
653 | set_viewsize(session,session->maxROWS,session->maxCOLS); | 643 | set_viewsize(session,session->maxROWS,session->maxCOLS); |
654 | } | 644 | } |
@@ -660,7 +650,7 @@ void ctlr_erase(H3270 *session, int alt) | @@ -660,7 +650,7 @@ void ctlr_erase(H3270 *session, int alt) | ||
660 | if(session->vcontrol) | 650 | if(session->vcontrol) |
661 | { | 651 | { |
662 | ctlr_blanks(session); | 652 | ctlr_blanks(session); |
663 | - session->display(session); | 653 | + session->cbk.display(session); |
664 | } | 654 | } |
665 | 655 | ||
666 | if(lib3270_get_toggle(session,LIB3270_TOGGLE_ALTSCREEN)) | 656 | if(lib3270_get_toggle(session,LIB3270_TOGGLE_ALTSCREEN)) |
@@ -2465,7 +2455,7 @@ void ctlr_clear(H3270 *session, Boolean can_snap) | @@ -2465,7 +2455,7 @@ void ctlr_clear(H3270 *session, Boolean can_snap) | ||
2465 | session->sscp_start = 0; | 2455 | session->sscp_start = 0; |
2466 | 2456 | ||
2467 | // ALL_CHANGED; | 2457 | // ALL_CHANGED; |
2468 | - session->erase(session); | 2458 | + session->cbk.erase(session); |
2469 | } | 2459 | } |
2470 | 2460 | ||
2471 | /** | 2461 | /** |
@@ -2700,7 +2690,7 @@ void ctlr_scroll(H3270 *hSession) | @@ -2700,7 +2690,7 @@ void ctlr_scroll(H3270 *hSession) | ||
2700 | /* Clear the last line. */ | 2690 | /* Clear the last line. */ |
2701 | (void) memset((char *) &hSession->ea_buf[qty], 0, hSession->cols * sizeof(struct lib3270_ea)); | 2691 | (void) memset((char *) &hSession->ea_buf[qty], 0, hSession->cols * sizeof(struct lib3270_ea)); |
2702 | 2692 | ||
2703 | - hSession->display(hSession); | 2693 | + hSession->cbk.display(hSession); |
2704 | 2694 | ||
2705 | } | 2695 | } |
2706 | #endif /*]*/ | 2696 | #endif /*]*/ |
@@ -2845,10 +2835,10 @@ void ticking_start(H3270 *hSession, Boolean anyway) | @@ -2845,10 +2835,10 @@ void ticking_start(H3270 *hSession, Boolean anyway) | ||
2845 | { | 2835 | { |
2846 | CHECK_SESSION_HANDLE(hSession); | 2836 | CHECK_SESSION_HANDLE(hSession); |
2847 | 2837 | ||
2848 | - if(hSession->set_timer) | 2838 | + if(hSession->cbk.set_timer) |
2849 | { | 2839 | { |
2850 | if(lib3270_get_toggle(hSession,LIB3270_TOGGLE_SHOW_TIMING) || anyway) | 2840 | if(lib3270_get_toggle(hSession,LIB3270_TOGGLE_SHOW_TIMING) || anyway) |
2851 | - hSession->set_timer(hSession,1); | 2841 | + hSession->cbk.set_timer(hSession,1); |
2852 | } | 2842 | } |
2853 | else | 2843 | else |
2854 | { | 2844 | { |
@@ -2875,9 +2865,9 @@ static void ticking_stop(H3270 *hSession) | @@ -2875,9 +2865,9 @@ static void ticking_stop(H3270 *hSession) | ||
2875 | { | 2865 | { |
2876 | CHECK_SESSION_HANDLE(hSession); | 2866 | CHECK_SESSION_HANDLE(hSession); |
2877 | 2867 | ||
2878 | - if(hSession->set_timer) | 2868 | + if(hSession->cbk.set_timer) |
2879 | { | 2869 | { |
2880 | - hSession->set_timer(hSession,0); | 2870 | + hSession->cbk.set_timer(hSession,0); |
2881 | } | 2871 | } |
2882 | else | 2872 | else |
2883 | { | 2873 | { |
host.c
@@ -125,8 +125,8 @@ void lib3270_set_connected(H3270 *hSession) | @@ -125,8 +125,8 @@ void lib3270_set_connected(H3270 *hSession) | ||
125 | hSession->starting = 1; // Enable autostart | 125 | hSession->starting = 1; // Enable autostart |
126 | 126 | ||
127 | lib3270_st_changed(hSession, LIB3270_STATE_CONNECT, True); | 127 | lib3270_st_changed(hSession, LIB3270_STATE_CONNECT, True); |
128 | - if(hSession->update_connect) | ||
129 | - hSession->update_connect(hSession,1); | 128 | + if(hSession->cbk.update_connect) |
129 | + hSession->cbk.update_connect(hSession,1); | ||
130 | } | 130 | } |
131 | 131 | ||
132 | void lib3270_set_disconnected(H3270 *hSession) | 132 | void lib3270_set_disconnected(H3270 *hSession) |
@@ -143,10 +143,10 @@ void lib3270_set_disconnected(H3270 *hSession) | @@ -143,10 +143,10 @@ void lib3270_set_disconnected(H3270 *hSession) | ||
143 | 143 | ||
144 | status_changed(hSession,LIB3270_MESSAGE_DISCONNECTED); | 144 | status_changed(hSession,LIB3270_MESSAGE_DISCONNECTED); |
145 | 145 | ||
146 | - if(hSession->update_connect) | ||
147 | - hSession->update_connect(hSession,0); | 146 | + if(hSession->cbk.update_connect) |
147 | + hSession->cbk.update_connect(hSession,0); | ||
148 | 148 | ||
149 | - hSession->update_ssl(hSession,hSession->secure); | 149 | + hSession->cbk.update_ssl(hSession,hSession->secure); |
150 | 150 | ||
151 | } | 151 | } |
152 | 152 |
kybd.c
@@ -1396,7 +1396,7 @@ LIB3270_ACTION( delete ) | @@ -1396,7 +1396,7 @@ LIB3270_ACTION( delete ) | ||
1396 | if (!hSession->ea_buf[baddr].fa) | 1396 | if (!hSession->ea_buf[baddr].fa) |
1397 | cursor_move(hSession,baddr); | 1397 | cursor_move(hSession,baddr); |
1398 | } | 1398 | } |
1399 | - hSession->display(hSession); | 1399 | + hSession->cbk.display(hSession); |
1400 | return 0; | 1400 | return 0; |
1401 | } | 1401 | } |
1402 | 1402 | ||
@@ -1428,7 +1428,7 @@ LIB3270_ACTION( backspace ) | @@ -1428,7 +1428,7 @@ LIB3270_ACTION( backspace ) | ||
1428 | DEC_BA(baddr); | 1428 | DEC_BA(baddr); |
1429 | cursor_move(hSession,baddr); | 1429 | cursor_move(hSession,baddr); |
1430 | } | 1430 | } |
1431 | - hSession->display(hSession); | 1431 | + hSession->cbk.display(hSession); |
1432 | return 0; | 1432 | return 0; |
1433 | } | 1433 | } |
1434 | 1434 | ||
@@ -1495,7 +1495,7 @@ static void do_erase(H3270 *hSession) | @@ -1495,7 +1495,7 @@ static void do_erase(H3270 *hSession) | ||
1495 | cursor_move(hSession,baddr); | 1495 | cursor_move(hSession,baddr); |
1496 | (void) do_delete(hSession); | 1496 | (void) do_delete(hSession); |
1497 | } | 1497 | } |
1498 | - hSession->display(hSession); | 1498 | + hSession->cbk.display(hSession); |
1499 | } | 1499 | } |
1500 | 1500 | ||
1501 | LIB3270_ACTION( erase ) | 1501 | LIB3270_ACTION( erase ) |
@@ -1876,7 +1876,7 @@ LIB3270_ACTION( dup ) | @@ -1876,7 +1876,7 @@ LIB3270_ACTION( dup ) | ||
1876 | #endif | 1876 | #endif |
1877 | if (key_Character(hSession, EBC_dup, False, False, NULL)) | 1877 | if (key_Character(hSession, EBC_dup, False, False, NULL)) |
1878 | { | 1878 | { |
1879 | - hSession->display(hSession); | 1879 | + hSession->cbk.display(hSession); |
1880 | cursor_move(hSession,next_unprotected(hSession,hSession->cursor_addr)); | 1880 | cursor_move(hSession,next_unprotected(hSession,hSession->cursor_addr)); |
1881 | } | 1881 | } |
1882 | 1882 | ||
@@ -2036,7 +2036,7 @@ LIB3270_ACTION( eraseeol ) | @@ -2036,7 +2036,7 @@ LIB3270_ACTION( eraseeol ) | ||
2036 | hSession->ea_buf[hSession->cursor_addr].cc = EBC_si; | 2036 | hSession->ea_buf[hSession->cursor_addr].cc = EBC_si; |
2037 | } | 2037 | } |
2038 | (void) ctlr_dbcs_postprocess(hSession); | 2038 | (void) ctlr_dbcs_postprocess(hSession); |
2039 | - hSession->display(hSession); | 2039 | + hSession->cbk.display(hSession); |
2040 | return 0; | 2040 | return 0; |
2041 | } | 2041 | } |
2042 | 2042 | ||
@@ -2093,7 +2093,7 @@ LIB3270_ACTION( eraseeof ) | @@ -2093,7 +2093,7 @@ LIB3270_ACTION( eraseeof ) | ||
2093 | hSession->ea_buf[hSession->cursor_addr].cc = EBC_si; | 2093 | hSession->ea_buf[hSession->cursor_addr].cc = EBC_si; |
2094 | } | 2094 | } |
2095 | (void) ctlr_dbcs_postprocess(hSession); | 2095 | (void) ctlr_dbcs_postprocess(hSession); |
2096 | - hSession->display(hSession); | 2096 | + hSession->cbk.display(hSession); |
2097 | return 0; | 2097 | return 0; |
2098 | } | 2098 | } |
2099 | 2099 | ||
@@ -2149,7 +2149,7 @@ LIB3270_ACTION( eraseinput ) | @@ -2149,7 +2149,7 @@ LIB3270_ACTION( eraseinput ) | ||
2149 | ctlr_clear(hSession,True); | 2149 | ctlr_clear(hSession,True); |
2150 | cursor_move(hSession,0); | 2150 | cursor_move(hSession,0); |
2151 | } | 2151 | } |
2152 | - hSession->display(hSession); | 2152 | + hSession->cbk.display(hSession); |
2153 | return 0; | 2153 | return 0; |
2154 | } | 2154 | } |
2155 | 2155 | ||
@@ -2218,7 +2218,7 @@ LIB3270_ACTION( deleteword ) | @@ -2218,7 +2218,7 @@ LIB3270_ACTION( deleteword ) | ||
2218 | else | 2218 | else |
2219 | do_erase(hSession); | 2219 | do_erase(hSession); |
2220 | } | 2220 | } |
2221 | - hSession->display(hSession); | 2221 | + hSession->cbk.display(hSession); |
2222 | return 0; | 2222 | return 0; |
2223 | } | 2223 | } |
2224 | 2224 | ||
@@ -2264,7 +2264,7 @@ LIB3270_ACTION( deletefield ) | @@ -2264,7 +2264,7 @@ LIB3270_ACTION( deletefield ) | ||
2264 | ctlr_add(hSession,baddr, EBC_null, 0); | 2264 | ctlr_add(hSession,baddr, EBC_null, 0); |
2265 | INC_BA(baddr); | 2265 | INC_BA(baddr); |
2266 | } | 2266 | } |
2267 | - hSession->display(hSession); | 2267 | + hSession->cbk.display(hSession); |
2268 | return 0; | 2268 | return 0; |
2269 | } | 2269 | } |
2270 | 2270 | ||
@@ -2909,7 +2909,7 @@ LIB3270_EXPORT int lib3270_emulate_input(H3270 *hSession, const char *s, int len | @@ -2909,7 +2909,7 @@ LIB3270_EXPORT int lib3270_emulate_input(H3270 *hSession, const char *s, int len | ||
2909 | break; | 2909 | break; |
2910 | } | 2910 | } |
2911 | 2911 | ||
2912 | - hSession->display(hSession); | 2912 | + hSession->cbk.display(hSession); |
2913 | return len; | 2913 | return len; |
2914 | } | 2914 | } |
2915 | 2915 |
paste.c
@@ -238,12 +238,12 @@ LIB3270_EXPORT int lib3270_set_string_at(H3270 *hSession, int row, int col, cons | @@ -238,12 +238,12 @@ LIB3270_EXPORT int lib3270_set_string_at(H3270 *hSession, int row, int col, cons | ||
238 | 238 | ||
239 | if(row >= 0 && col >= 0 && row <= hSession->rows && col <= hSession->cols) | 239 | if(row >= 0 && col >= 0 && row <= hSession->rows && col <= hSession->cols) |
240 | { | 240 | { |
241 | - hSession->suspend(hSession); | 241 | + hSession->cbk.suspend(hSession); |
242 | 242 | ||
243 | hSession->cursor_addr = (row * hSession->cols) + col; | 243 | hSession->cursor_addr = (row * hSession->cols) + col; |
244 | rc = set_string(hSession, str); | 244 | rc = set_string(hSession, str); |
245 | 245 | ||
246 | - hSession->resume(hSession); | 246 | + hSession->cbk.resume(hSession); |
247 | } | 247 | } |
248 | 248 | ||
249 | return rc; | 249 | return rc; |
@@ -268,9 +268,9 @@ LIB3270_EXPORT int lib3270_set_string(H3270 *hSession, const unsigned char *str) | @@ -268,9 +268,9 @@ LIB3270_EXPORT int lib3270_set_string(H3270 *hSession, const unsigned char *str) | ||
268 | if(hSession->kybdlock) | 268 | if(hSession->kybdlock) |
269 | return -EINVAL; | 269 | return -EINVAL; |
270 | 270 | ||
271 | - hSession->suspend(hSession); | 271 | + hSession->cbk.suspend(hSession); |
272 | rc = set_string(hSession, str); | 272 | rc = set_string(hSession, str); |
273 | - hSession->resume(hSession); | 273 | + hSession->cbk.resume(hSession); |
274 | 274 | ||
275 | return rc; | 275 | return rc; |
276 | } | 276 | } |
private.h
@@ -114,11 +114,6 @@ | @@ -114,11 +114,6 @@ | ||
114 | #undef X3270_MENUS | 114 | #undef X3270_MENUS |
115 | #endif /*]*/ | 115 | #endif /*]*/ |
116 | 116 | ||
117 | -/* Functions we may need to supply. */ | ||
118 | -#if defined(NEED_STRTOK_R) /*[*/ | ||
119 | - extern char *strtok_r(char *str, const char *sep, char **last); | ||
120 | -#endif /*]*/ | ||
121 | - | ||
122 | /* types of internal actions */ | 117 | /* types of internal actions */ |
123 | enum iaction { | 118 | enum iaction { |
124 | IA_STRING, IA_PASTE, IA_REDRAW, | 119 | IA_STRING, IA_PASTE, IA_REDRAW, |
@@ -141,16 +136,6 @@ LIB3270_INTERNAL const char * build_rpq_revision; | @@ -141,16 +136,6 @@ LIB3270_INTERNAL const char * build_rpq_revision; | ||
141 | #endif /*]*/ | 136 | #endif /*]*/ |
142 | 137 | ||
143 | 138 | ||
144 | -#if defined(X3270_DBCS) /*[*/ | ||
145 | - LIB3270_INTERNAL char *full_efontname_dbcs; | ||
146 | -#endif /*]*/ | ||
147 | - | ||
148 | - | ||
149 | -/* keyboard modifer bitmap */ | ||
150 | -#define ShiftKeyDown 0x01 | ||
151 | -#define MetaKeyDown 0x02 | ||
152 | -#define AltKeyDown 0x04 | ||
153 | - | ||
154 | /* toggle names */ | 139 | /* toggle names */ |
155 | struct toggle_name { | 140 | struct toggle_name { |
156 | const char *name; | 141 | const char *name; |
@@ -226,6 +211,28 @@ LIB3270_INTERNAL struct _ansictl | @@ -226,6 +211,28 @@ LIB3270_INTERNAL struct _ansictl | ||
226 | char vlnext; | 211 | char vlnext; |
227 | } ansictl; | 212 | } ansictl; |
228 | 213 | ||
214 | +/** extended attributes */ | ||
215 | +struct lib3270_ea | ||
216 | +{ | ||
217 | + unsigned char cc; ///< @brief EBCDIC or ASCII character code | ||
218 | + unsigned char fa; ///< @brief field attribute, it nonzero | ||
219 | + unsigned char fg; ///< @brief foreground color (0x00 or 0xf<n>) | ||
220 | + unsigned char bg; ///< @brief background color (0x00 or 0xf<n>) | ||
221 | + unsigned char gr; ///< @brief ANSI graphics rendition bits | ||
222 | + unsigned char cs; ///< @brief character set (GE flag, or 0..2) | ||
223 | + unsigned char ic; ///< @brief input control (DBCS) | ||
224 | + unsigned char db; ///< @brief DBCS state | ||
225 | +}; | ||
226 | + | ||
227 | +struct lib3270_text | ||
228 | +{ | ||
229 | + unsigned char chr; ///< @brief ASCII character code | ||
230 | + unsigned short attr; ///< @brief Converted character attribute (color & etc) | ||
231 | +}; | ||
232 | + | ||
233 | + | ||
234 | + | ||
235 | + | ||
229 | /* default charset translation tables */ | 236 | /* default charset translation tables */ |
230 | // LIB3270_INTERNAL const unsigned short ebc2asc0[256]; | 237 | // LIB3270_INTERNAL const unsigned short ebc2asc0[256]; |
231 | // LIB3270_INTERNAL const unsigned short asc2ft0[256]; | 238 | // LIB3270_INTERNAL const unsigned short asc2ft0[256]; |
screen.c
@@ -104,7 +104,7 @@ static void addch(H3270 *session, int baddr, unsigned char c, unsigned short att | @@ -104,7 +104,7 @@ static void addch(H3270 *session, int baddr, unsigned char c, unsigned short att | ||
104 | session->text[baddr].chr = c; | 104 | session->text[baddr].chr = c; |
105 | session->text[baddr].attr = attr; | 105 | session->text[baddr].attr = attr; |
106 | 106 | ||
107 | - session->update(session,baddr,c,attr,baddr == session->cursor_addr); | 107 | + session->cbk.update(session,baddr,c,attr,baddr == session->cursor_addr); |
108 | } | 108 | } |
109 | 109 | ||
110 | LIB3270_EXPORT int lib3270_get_element(H3270 *h, int baddr, unsigned char *c, unsigned short *attr) | 110 | LIB3270_EXPORT int lib3270_get_element(H3270 *h, int baddr, unsigned char *c, unsigned short *attr) |
@@ -140,7 +140,7 @@ int screen_init(H3270 *session) | @@ -140,7 +140,7 @@ int screen_init(H3270 *session) | ||
140 | ctlr_reinit(session,-1); | 140 | ctlr_reinit(session,-1); |
141 | 141 | ||
142 | /* Finish screen initialization. */ | 142 | /* Finish screen initialization. */ |
143 | - session->suspend(session); | 143 | + session->cbk.suspend(session); |
144 | 144 | ||
145 | return 0; | 145 | return 0; |
146 | } | 146 | } |
@@ -259,8 +259,8 @@ void update_model_info(H3270 *session, int model, int cols, int rows) | @@ -259,8 +259,8 @@ void update_model_info(H3270 *session, int model, int cols, int rows) | ||
259 | /* Update the model name. */ | 259 | /* Update the model name. */ |
260 | (void) sprintf(session->model_name, "327%c-%d%s",session->m3279 ? '9' : '8',session->model_num,session->extended ? "-E" : ""); | 260 | (void) sprintf(session->model_name, "327%c-%d%s",session->m3279 ? '9' : '8',session->model_num,session->extended ? "-E" : ""); |
261 | 261 | ||
262 | - trace("%s: %p",__FUNCTION__,session->update_model); | ||
263 | - session->update_model(session, session->model_name,session->model_num,rows,cols); | 262 | + trace("%s: %p",__FUNCTION__,session->cbk.update_model); |
263 | + session->cbk.update_model(session, session->model_name,session->model_num,rows,cols); | ||
264 | } | 264 | } |
265 | 265 | ||
266 | LIB3270_EXPORT int lib3270_get_contents(H3270 *h, int first, int last, unsigned char *chr, unsigned short *attr) | 266 | LIB3270_EXPORT int lib3270_get_contents(H3270 *h, int first, int last, unsigned char *chr, unsigned short *attr) |
@@ -355,7 +355,7 @@ void screen_update(H3270 *session, int bstart, int bend) | @@ -355,7 +355,7 @@ void screen_update(H3270 *session, int bstart, int bend) | ||
355 | len++; | 355 | len++; |
356 | } | 356 | } |
357 | 357 | ||
358 | - session->changed(session,first,len); | 358 | + session->cbk.changed(session,first,len); |
359 | } | 359 | } |
360 | 360 | ||
361 | if(session->starting && session->formatted && !session->kybdlock && lib3270_in_3270(session)) | 361 | if(session->starting && session->formatted && !session->kybdlock && lib3270_in_3270(session)) |
@@ -364,7 +364,7 @@ void screen_update(H3270 *session, int bstart, int bend) | @@ -364,7 +364,7 @@ void screen_update(H3270 *session, int bstart, int bend) | ||
364 | 364 | ||
365 | // cursor_move(session,next_unprotected(session,0)); | 365 | // cursor_move(session,next_unprotected(session,0)); |
366 | // lib3270_emulate_input(session,"\\n",-1,0); | 366 | // lib3270_emulate_input(session,"\\n",-1,0); |
367 | - session->autostart(session); | 367 | + session->cbk.autostart(session); |
368 | 368 | ||
369 | #ifdef DEBUG | 369 | #ifdef DEBUG |
370 | { | 370 | { |
@@ -416,7 +416,7 @@ LIB3270_EXPORT int lib3270_set_cursor_position(H3270 *h, int row, int col) | @@ -416,7 +416,7 @@ LIB3270_EXPORT int lib3270_set_cursor_position(H3270 *h, int row, int col) | ||
416 | if(baddr != h->cursor_addr) | 416 | if(baddr != h->cursor_addr) |
417 | { | 417 | { |
418 | h->cursor_addr = baddr; | 418 | h->cursor_addr = baddr; |
419 | - h->update_cursor(h,(unsigned short) row,(unsigned short) col,h->text[baddr].chr,h->text[baddr].attr); | 419 | + h->cbk.update_cursor(h,(unsigned short) row,(unsigned short) col,h->text[baddr].chr,h->text[baddr].attr); |
420 | } | 420 | } |
421 | } | 421 | } |
422 | 422 | ||
@@ -434,7 +434,7 @@ int cursor_move(H3270 *h, int baddr) | @@ -434,7 +434,7 @@ int cursor_move(H3270 *h, int baddr) | ||
434 | if(baddr >= 0) | 434 | if(baddr >= 0) |
435 | { | 435 | { |
436 | h->cursor_addr = baddr; | 436 | h->cursor_addr = baddr; |
437 | - h->update_cursor(h,(unsigned short) (baddr/h->cols),(unsigned short) (baddr%h->cols),h->text[baddr].chr,h->text[baddr].attr); | 437 | + h->cbk.update_cursor(h,(unsigned short) (baddr/h->cols),(unsigned short) (baddr%h->cols),h->text[baddr].chr,h->text[baddr].attr); |
438 | } | 438 | } |
439 | 439 | ||
440 | return ret; | 440 | return ret; |
@@ -447,7 +447,7 @@ void set_status(H3270 *session, LIB3270_FLAG id, Boolean on) | @@ -447,7 +447,7 @@ void set_status(H3270 *session, LIB3270_FLAG id, Boolean on) | ||
447 | CHECK_SESSION_HANDLE(session); | 447 | CHECK_SESSION_HANDLE(session); |
448 | 448 | ||
449 | session->oia_flag[id] = (on != 0); | 449 | session->oia_flag[id] = (on != 0); |
450 | - session->update_oia(session,id,session->oia_flag[id]); | 450 | + session->cbk.update_oia(session,id,session->oia_flag[id]); |
451 | 451 | ||
452 | } | 452 | } |
453 | 453 | ||
@@ -455,7 +455,7 @@ void status_ctlr_done(H3270 *session) | @@ -455,7 +455,7 @@ void status_ctlr_done(H3270 *session) | ||
455 | { | 455 | { |
456 | CHECK_SESSION_HANDLE(session); | 456 | CHECK_SESSION_HANDLE(session); |
457 | set_status(session,OIA_FLAG_UNDERA,True); | 457 | set_status(session,OIA_FLAG_UNDERA,True); |
458 | - session->ctlr_done(session); | 458 | + session->cbk.ctlr_done(session); |
459 | } | 459 | } |
460 | 460 | ||
461 | void status_oerr(H3270 *session, int error_type) | 461 | void status_oerr(H3270 *session, int error_type) |
@@ -486,8 +486,8 @@ void status_oerr(H3270 *session, int error_type) | @@ -486,8 +486,8 @@ void status_oerr(H3270 *session, int error_type) | ||
486 | 486 | ||
487 | void status_connecting(H3270 *session, Boolean on) | 487 | void status_connecting(H3270 *session, Boolean on) |
488 | { | 488 | { |
489 | - if(session->cursor) | ||
490 | - session->cursor(session,on ? CURSOR_MODE_LOCKED : CURSOR_MODE_NORMAL); | 489 | + if(session->cbk.cursor) |
490 | + session->cbk.cursor(session,on ? CURSOR_MODE_LOCKED : CURSOR_MODE_NORMAL); | ||
491 | 491 | ||
492 | status_changed(session, on ? LIB3270_MESSAGE_CONNECTING : LIB3270_MESSAGE_NONE); | 492 | status_changed(session, on ? LIB3270_MESSAGE_CONNECTING : LIB3270_MESSAGE_NONE); |
493 | } | 493 | } |
@@ -506,12 +506,12 @@ void status_reset(H3270 *session) | @@ -506,12 +506,12 @@ void status_reset(H3270 *session) | ||
506 | } | 506 | } |
507 | else | 507 | else |
508 | { | 508 | { |
509 | - if(session->cursor) | ||
510 | - session->cursor(session,CURSOR_MODE_NORMAL); | 509 | + if(session->cbk.cursor) |
510 | + session->cbk.cursor(session,CURSOR_MODE_NORMAL); | ||
511 | status_changed(session,LIB3270_MESSAGE_NONE); | 511 | status_changed(session,LIB3270_MESSAGE_NONE); |
512 | } | 512 | } |
513 | 513 | ||
514 | - session->display(session); | 514 | + session->cbk.display(session); |
515 | 515 | ||
516 | } | 516 | } |
517 | 517 | ||
@@ -573,7 +573,7 @@ void status_changed(H3270 *session, LIB3270_STATUS id) | @@ -573,7 +573,7 @@ void status_changed(H3270 *session, LIB3270_STATUS id) | ||
573 | 573 | ||
574 | session->oia_status = id; | 574 | session->oia_status = id; |
575 | 575 | ||
576 | - session->update_status(session,id); | 576 | + session->cbk.update_status(session,id); |
577 | } | 577 | } |
578 | 578 | ||
579 | void status_twait(H3270 *session) | 579 | void status_twait(H3270 *session) |
@@ -593,8 +593,8 @@ void set_viewsize(H3270 *session, int rows, int cols) | @@ -593,8 +593,8 @@ void set_viewsize(H3270 *session, int rows, int cols) | ||
593 | session->rows = rows; | 593 | session->rows = rows; |
594 | session->cols = cols; | 594 | session->cols = cols; |
595 | 595 | ||
596 | - if(session->configure) | ||
597 | - session->configure(session,session->rows,session->cols); | 596 | + if(session->cbk.configure) |
597 | + session->cbk.configure(session,session->rows,session->cols); | ||
598 | 598 | ||
599 | } | 599 | } |
600 | 600 | ||
@@ -602,8 +602,8 @@ void status_lu(H3270 *session, const char *lu) | @@ -602,8 +602,8 @@ void status_lu(H3270 *session, const char *lu) | ||
602 | { | 602 | { |
603 | CHECK_SESSION_HANDLE(session); | 603 | CHECK_SESSION_HANDLE(session); |
604 | 604 | ||
605 | - if(session->update_luname) | ||
606 | - session->update_luname(session,lu); | 605 | + if(session->cbk.update_luname) |
606 | + session->cbk.update_luname(session,lu); | ||
607 | 607 | ||
608 | } | 608 | } |
609 | 609 | ||
@@ -660,8 +660,8 @@ void status_untiming(H3270 *session) | @@ -660,8 +660,8 @@ void status_untiming(H3270 *session) | ||
660 | { | 660 | { |
661 | CHECK_SESSION_HANDLE(session); | 661 | CHECK_SESSION_HANDLE(session); |
662 | 662 | ||
663 | - if(session->set_timer) | ||
664 | - session->set_timer(session,0); | 663 | + if(session->cbk.set_timer) |
664 | + session->cbk.set_timer(session,0); | ||
665 | } | 665 | } |
666 | 666 | ||
667 | static int logpopup(H3270 *session, void *widget, LIB3270_NOTIFY type, const char *title, const char *msg, const char *fmt, va_list arg) | 667 | static int logpopup(H3270 *session, void *widget, LIB3270_NOTIFY type, const char *title, const char *msg, const char *fmt, va_list arg) |
@@ -740,8 +740,8 @@ void mcursor_set(H3270 *session,LIB3270_CURSOR m) | @@ -740,8 +740,8 @@ void mcursor_set(H3270 *session,LIB3270_CURSOR m) | ||
740 | { | 740 | { |
741 | CHECK_SESSION_HANDLE(session); | 741 | CHECK_SESSION_HANDLE(session); |
742 | 742 | ||
743 | - if(session->cursor) | ||
744 | - session->cursor(session,m); | 743 | + if(session->cbk.cursor) |
744 | + session->cbk.cursor(session,m); | ||
745 | } | 745 | } |
746 | 746 | ||
747 | LIB3270_ACTION( testpattern ) | 747 | LIB3270_ACTION( testpattern ) |
@@ -832,7 +832,7 @@ LIB3270_ACTION( testpattern ) | @@ -832,7 +832,7 @@ LIB3270_ACTION( testpattern ) | ||
832 | hSession->ea_buf[f].gr = gr[grpos]; | 832 | hSession->ea_buf[f].gr = gr[grpos]; |
833 | } | 833 | } |
834 | 834 | ||
835 | - hSession->display(hSession); | 835 | + hSession->cbk.display(hSession); |
836 | 836 | ||
837 | return 0; | 837 | return 0; |
838 | } | 838 | } |
selection.c
@@ -104,7 +104,7 @@ static void update_selected_rectangle(H3270 *session) | @@ -104,7 +104,7 @@ static void update_selected_rectangle(H3270 *session) | ||
104 | if(!(row >= p[0].row && row <= p[1].row && col >= p[0].col && col <= p[1].col) && (session->text[baddr].attr & LIB3270_ATTR_SELECTED)) | 104 | if(!(row >= p[0].row && row <= p[1].row && col >= p[0].col && col <= p[1].col) && (session->text[baddr].attr & LIB3270_ATTR_SELECTED)) |
105 | { | 105 | { |
106 | session->text[baddr].attr &= ~LIB3270_ATTR_SELECTED; | 106 | session->text[baddr].attr &= ~LIB3270_ATTR_SELECTED; |
107 | - session->update(session,baddr,session->text[baddr].chr,session->text[baddr].attr,baddr == session->cursor_addr); | 107 | + session->cbk.update(session,baddr,session->text[baddr].chr,session->text[baddr].attr,baddr == session->cursor_addr); |
108 | } | 108 | } |
109 | baddr++; | 109 | baddr++; |
110 | } | 110 | } |
@@ -119,7 +119,7 @@ static void update_selected_rectangle(H3270 *session) | @@ -119,7 +119,7 @@ static void update_selected_rectangle(H3270 *session) | ||
119 | if((row >= p[0].row && row <= p[1].row && col >= p[0].col && col <= p[1].col) && !(session->text[baddr].attr & LIB3270_ATTR_SELECTED)) | 119 | if((row >= p[0].row && row <= p[1].row && col >= p[0].col && col <= p[1].col) && !(session->text[baddr].attr & LIB3270_ATTR_SELECTED)) |
120 | { | 120 | { |
121 | session->text[baddr].attr |= LIB3270_ATTR_SELECTED; | 121 | session->text[baddr].attr |= LIB3270_ATTR_SELECTED; |
122 | - session->update(session,baddr,session->text[baddr].chr,session->text[baddr].attr,baddr == session->cursor_addr); | 122 | + session->cbk.update(session,baddr,session->text[baddr].chr,session->text[baddr].attr,baddr == session->cursor_addr); |
123 | } | 123 | } |
124 | baddr++; | 124 | baddr++; |
125 | } | 125 | } |
@@ -140,7 +140,7 @@ static void update_selected_region(H3270 *session) | @@ -140,7 +140,7 @@ static void update_selected_region(H3270 *session) | ||
140 | if(session->text[baddr].attr & LIB3270_ATTR_SELECTED) | 140 | if(session->text[baddr].attr & LIB3270_ATTR_SELECTED) |
141 | { | 141 | { |
142 | session->text[baddr].attr &= ~LIB3270_ATTR_SELECTED; | 142 | session->text[baddr].attr &= ~LIB3270_ATTR_SELECTED; |
143 | - session->update(session,baddr,session->text[baddr].chr,session->text[baddr].attr,baddr == session->cursor_addr); | 143 | + session->cbk.update(session,baddr,session->text[baddr].chr,session->text[baddr].attr,baddr == session->cursor_addr); |
144 | } | 144 | } |
145 | } | 145 | } |
146 | 146 | ||
@@ -149,7 +149,7 @@ static void update_selected_region(H3270 *session) | @@ -149,7 +149,7 @@ static void update_selected_region(H3270 *session) | ||
149 | if(session->text[baddr].attr & LIB3270_ATTR_SELECTED) | 149 | if(session->text[baddr].attr & LIB3270_ATTR_SELECTED) |
150 | { | 150 | { |
151 | session->text[baddr].attr &= ~LIB3270_ATTR_SELECTED; | 151 | session->text[baddr].attr &= ~LIB3270_ATTR_SELECTED; |
152 | - session->update(session,baddr,session->text[baddr].chr,session->text[baddr].attr,baddr == session->cursor_addr); | 152 | + session->cbk.update(session,baddr,session->text[baddr].chr,session->text[baddr].attr,baddr == session->cursor_addr); |
153 | } | 153 | } |
154 | } | 154 | } |
155 | 155 | ||
@@ -159,7 +159,7 @@ static void update_selected_region(H3270 *session) | @@ -159,7 +159,7 @@ static void update_selected_region(H3270 *session) | ||
159 | if(!(session->text[baddr].attr & LIB3270_ATTR_SELECTED)) | 159 | if(!(session->text[baddr].attr & LIB3270_ATTR_SELECTED)) |
160 | { | 160 | { |
161 | session->text[baddr].attr |= LIB3270_ATTR_SELECTED; | 161 | session->text[baddr].attr |= LIB3270_ATTR_SELECTED; |
162 | - session->update(session,baddr,session->text[baddr].chr,session->text[baddr].attr,baddr == session->cursor_addr); | 162 | + session->cbk.update(session,baddr,session->text[baddr].chr,session->text[baddr].attr,baddr == session->cursor_addr); |
163 | } | 163 | } |
164 | } | 164 | } |
165 | 165 | ||
@@ -191,13 +191,13 @@ LIB3270_EXPORT int lib3270_unselect(H3270 *hSession) | @@ -191,13 +191,13 @@ LIB3270_EXPORT int lib3270_unselect(H3270 *hSession) | ||
191 | if(hSession->text[a].attr & LIB3270_ATTR_SELECTED) | 191 | if(hSession->text[a].attr & LIB3270_ATTR_SELECTED) |
192 | { | 192 | { |
193 | hSession->text[a].attr &= ~LIB3270_ATTR_SELECTED; | 193 | hSession->text[a].attr &= ~LIB3270_ATTR_SELECTED; |
194 | - if(hSession->update) | ||
195 | - hSession->update(hSession,a,hSession->text[a].chr,hSession->text[a].attr,a == hSession->cursor_addr); | 194 | + if(hSession->cbk.update) |
195 | + hSession->cbk.update(hSession,a,hSession->text[a].chr,hSession->text[a].attr,a == hSession->cursor_addr); | ||
196 | } | 196 | } |
197 | } | 197 | } |
198 | 198 | ||
199 | - hSession->set_selection(hSession,0); | ||
200 | - hSession->update_selection(hSession,-1,-1); | 199 | + hSession->cbk.set_selection(hSession,0); |
200 | + hSession->cbk.update_selection(hSession,-1,-1); | ||
201 | } | 201 | } |
202 | 202 | ||
203 | return 0; | 203 | return 0; |
@@ -268,10 +268,10 @@ static void do_select(H3270 *h, int start, int end, int rect) | @@ -268,10 +268,10 @@ static void do_select(H3270 *h, int start, int end, int rect) | ||
268 | if(!h->selected) | 268 | if(!h->selected) |
269 | { | 269 | { |
270 | h->selected = 1; | 270 | h->selected = 1; |
271 | - h->set_selection(h,1); | 271 | + h->cbk.set_selection(h,1); |
272 | } | 272 | } |
273 | 273 | ||
274 | - h->update_selection(h,start,end); | 274 | + h->cbk.update_selection(h,start,end); |
275 | 275 | ||
276 | } | 276 | } |
277 | 277 | ||
@@ -602,11 +602,11 @@ static void copy_chr(H3270 *hSession, int from, int to) | @@ -602,11 +602,11 @@ static void copy_chr(H3270 *hSession, int from, int to) | ||
602 | memcpy(&hSession->ea_buf[to], &hSession->ea_buf[from],sizeof(struct lib3270_ea)); | 602 | memcpy(&hSession->ea_buf[to], &hSession->ea_buf[from],sizeof(struct lib3270_ea)); |
603 | hSession->ea_buf[from].fa = 0; | 603 | hSession->ea_buf[from].fa = 0; |
604 | 604 | ||
605 | - hSession->update( hSession, | ||
606 | - to, | ||
607 | - hSession->text[to].chr, | ||
608 | - hSession->text[to].attr, | ||
609 | - to == hSession->cursor_addr ); | 605 | + hSession->cbk.update( hSession, |
606 | + to, | ||
607 | + hSession->text[to].chr, | ||
608 | + hSession->text[to].attr, | ||
609 | + to == hSession->cursor_addr ); | ||
610 | } | 610 | } |
611 | 611 | ||
612 | static void clear_chr(H3270 *hSession, int baddr) | 612 | static void clear_chr(H3270 *hSession, int baddr) |
@@ -616,11 +616,11 @@ static void clear_chr(H3270 *hSession, int baddr) | @@ -616,11 +616,11 @@ static void clear_chr(H3270 *hSession, int baddr) | ||
616 | hSession->ea_buf[baddr].cc = EBC_null; | 616 | hSession->ea_buf[baddr].cc = EBC_null; |
617 | hSession->ea_buf[baddr].cs = 0; | 617 | hSession->ea_buf[baddr].cs = 0; |
618 | 618 | ||
619 | - hSession->update( hSession, | ||
620 | - baddr, | ||
621 | - hSession->text[baddr].chr, | ||
622 | - hSession->text[baddr].attr, | ||
623 | - baddr == hSession->cursor_addr ); | 619 | + hSession->cbk.update( hSession, |
620 | + baddr, | ||
621 | + hSession->text[baddr].chr, | ||
622 | + hSession->text[baddr].attr, | ||
623 | + baddr == hSession->cursor_addr ); | ||
624 | } | 624 | } |
625 | 625 | ||
626 | int cut_addr(H3270 *hSession, int daddr, int saddr, int maxlen, int *sattr) | 626 | int cut_addr(H3270 *hSession, int daddr, int saddr, int maxlen, int *sattr) |
@@ -727,7 +727,7 @@ char * cut_text(H3270 *hSession, char tok) | @@ -727,7 +727,7 @@ char * cut_text(H3270 *hSession, char tok) | ||
727 | if(!hSession->ea_buf[daddr].fa) | 727 | if(!hSession->ea_buf[daddr].fa) |
728 | clear_chr(hSession,daddr); | 728 | clear_chr(hSession,daddr); |
729 | 729 | ||
730 | - hSession->changed(hSession,0,maxlen); | 730 | + hSession->cbk.changed(hSession,0,maxlen); |
731 | 731 | ||
732 | lib3270_unselect(hSession); | 732 | lib3270_unselect(hSession); |
733 | return text; | 733 | return text; |
session.c
@@ -192,28 +192,28 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char | @@ -192,28 +192,28 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char | ||
192 | lib3270_set_host_charset(hSession,charset); | 192 | lib3270_set_host_charset(hSession,charset); |
193 | 193 | ||
194 | // Default calls | 194 | // Default calls |
195 | - hSession->write = lib3270_sock_send; | ||
196 | - hSession->disconnect = lib3270_sock_disconnect; | ||
197 | - hSession->update = update_char; | ||
198 | - hSession->update_model = update_model; | ||
199 | - hSession->update_cursor = update_cursor; | ||
200 | - hSession->set_selection = nop_char; | ||
201 | - hSession->ctlr_done = nop; | ||
202 | - hSession->changed = changed; | ||
203 | - hSession->erase = screen_disp; | ||
204 | - hSession->suspend = nop; | ||
205 | - hSession->resume = screen_disp; | ||
206 | - hSession->update_oia = update_oia; | ||
207 | - hSession->update_selection = update_selection; | ||
208 | - hSession->cursor = set_cursor; | ||
209 | - hSession->message = message; | ||
210 | - hSession->update_ssl = update_ssl; | ||
211 | - hSession->display = screen_disp; | ||
212 | - hSession->set_width = nop_int; | ||
213 | - hSession->update_status = (void (*)(H3270 *, LIB3270_STATUS)) nop_int; | ||
214 | - hSession->autostart = nop; | ||
215 | - hSession->set_timer = set_timer; | ||
216 | - hSession->print = print; | 195 | + hSession->cbk.write = lib3270_sock_send; |
196 | + hSession->cbk.disconnect = lib3270_sock_disconnect; | ||
197 | + hSession->cbk.update = update_char; | ||
198 | + hSession->cbk.update_model = update_model; | ||
199 | + hSession->cbk.update_cursor = update_cursor; | ||
200 | + hSession->cbk.set_selection = nop_char; | ||
201 | + hSession->cbk.ctlr_done = nop; | ||
202 | + hSession->cbk.changed = changed; | ||
203 | + hSession->cbk.erase = screen_disp; | ||
204 | + hSession->cbk.suspend = nop; | ||
205 | + hSession->cbk.resume = screen_disp; | ||
206 | + hSession->cbk.update_oia = update_oia; | ||
207 | + hSession->cbk.update_selection = update_selection; | ||
208 | + hSession->cbk.cursor = set_cursor; | ||
209 | + hSession->cbk.message = message; | ||
210 | + hSession->cbk.update_ssl = update_ssl; | ||
211 | + hSession->cbk.display = screen_disp; | ||
212 | + hSession->cbk.set_width = nop_int; | ||
213 | + hSession->cbk.update_status = (void (*)(H3270 *, LIB3270_STATUS)) nop_int; | ||
214 | + hSession->cbk.autostart = nop; | ||
215 | + hSession->cbk.set_timer = set_timer; | ||
216 | + hSession->cbk.print = print; | ||
217 | 217 | ||
218 | // Set the defaults. | 218 | // Set the defaults. |
219 | hSession->extended = 1; | 219 | hSession->extended = 1; |
@@ -450,5 +450,5 @@ void set_ssl_state(H3270 *session, LIB3270_SSL_STATE state) | @@ -450,5 +450,5 @@ void set_ssl_state(H3270 *session, LIB3270_SSL_STATE state) | ||
450 | session->secure = state; | 450 | session->secure = state; |
451 | trace_dsn(session,"SSL state changes to %d\n",(int) state); | 451 | trace_dsn(session,"SSL state changes to %d\n",(int) state); |
452 | 452 | ||
453 | - session->update_ssl(session,session->secure); | 453 | + session->cbk.update_ssl(session,session->secure); |
454 | } | 454 | } |
telnet.c
@@ -931,7 +931,7 @@ void net_disconnect(H3270 *session) | @@ -931,7 +931,7 @@ void net_disconnect(H3270 *session) | ||
931 | set_ssl_state(session,LIB3270_SSL_UNSECURE); | 931 | set_ssl_state(session,LIB3270_SSL_UNSECURE); |
932 | #endif // HAVE_LIBSSL | 932 | #endif // HAVE_LIBSSL |
933 | 933 | ||
934 | - session->disconnect(session); | 934 | + session->cbk.disconnect(session); |
935 | 935 | ||
936 | trace_dsn(session,"SENT disconnect\n"); | 936 | trace_dsn(session,"SENT disconnect\n"); |
937 | 937 | ||
@@ -1032,7 +1032,7 @@ void net_input(H3270 *hSession, int fd, LIB3270_IO_FLAG flag, void *dunno) | @@ -1032,7 +1032,7 @@ void net_input(H3270 *hSession, int fd, LIB3270_IO_FLAG flag, void *dunno) | ||
1032 | { | 1032 | { |
1033 | (void) ERR_error_string(e, err_buf); | 1033 | (void) ERR_error_string(e, err_buf); |
1034 | trace_dsn(hSession,"RCVD SSL_read error %ld (%s)\n", e,err_buf); | 1034 | trace_dsn(hSession,"RCVD SSL_read error %ld (%s)\n", e,err_buf); |
1035 | - hSession->message(hSession,LIB3270_NOTIFY_ERROR,_( "SSL Error" ),_( "SSL Read error" ),err_buf ); | 1035 | + hSession->cbk.message(hSession,LIB3270_NOTIFY_ERROR,_( "SSL Error" ),_( "SSL Read error" ),err_buf ); |
1036 | } | 1036 | } |
1037 | else | 1037 | else |
1038 | { | 1038 | { |
@@ -2054,7 +2054,7 @@ static void net_rawout(H3270 *hSession, unsigned const char *buf, size_t len) | @@ -2054,7 +2054,7 @@ static void net_rawout(H3270 *hSession, unsigned const char *buf, size_t len) | ||
2054 | 2054 | ||
2055 | while (len) | 2055 | while (len) |
2056 | { | 2056 | { |
2057 | - int nw = hSession->write(hSession,buf,len); | 2057 | + int nw = hSession->cbk.write(hSession,buf,len); |
2058 | 2058 | ||
2059 | if (nw > 0) | 2059 | if (nw > 0) |
2060 | { | 2060 | { |
toggles.c
@@ -240,8 +240,8 @@ static void toggle_notify(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGG | @@ -240,8 +240,8 @@ static void toggle_notify(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGG | ||
240 | trace("%s: ix=%d upcall=%p",__FUNCTION__,ix,t->upcall); | 240 | trace("%s: ix=%d upcall=%p",__FUNCTION__,ix,t->upcall); |
241 | t->upcall(session, t, TT_INTERACTIVE); | 241 | t->upcall(session, t, TT_INTERACTIVE); |
242 | 242 | ||
243 | - if(session->update_toggle) | ||
244 | - session->update_toggle(session,ix,t->value,TT_INTERACTIVE,toggle_info[ix].name); | 243 | + if(session->cbk.update_toggle) |
244 | + session->cbk.update_toggle(session,ix,t->value,TT_INTERACTIVE,toggle_info[ix].name); | ||
245 | 245 | ||
246 | } | 246 | } |
247 | 247 | ||
@@ -291,7 +291,7 @@ static void toggle_altscreen(H3270 *session, struct lib3270_toggle *t, LIB3270_T | @@ -291,7 +291,7 @@ static void toggle_altscreen(H3270 *session, struct lib3270_toggle *t, LIB3270_T | ||
291 | 291 | ||
292 | static void toggle_redraw(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE tt) | 292 | static void toggle_redraw(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE tt) |
293 | { | 293 | { |
294 | - session->display(session); | 294 | + session->cbk.display(session); |
295 | } | 295 | } |
296 | 296 | ||
297 | /* | 297 | /* |
util.c
@@ -1009,7 +1009,7 @@ int gettimeofday(struct timeval *tv, void *ignored) | @@ -1009,7 +1009,7 @@ int gettimeofday(struct timeval *tv, void *ignored) | ||
1009 | { | 1009 | { |
1010 | CHECK_SESSION_HANDLE(h); | 1010 | CHECK_SESSION_HANDLE(h); |
1011 | trace("%s(%p)",__FUNCTION__,h); | 1011 | trace("%s(%p)",__FUNCTION__,h); |
1012 | - return h->print(h); | 1012 | + return h->cbk.print(h); |
1013 | } | 1013 | } |
1014 | 1014 | ||
1015 | 1015 |