Commit 276af5ac2135e531b11af2f7271331605b9b7626
1 parent
ffeef60c
Exists in
master
and in
3 other branches
Movendo mais campos de teclado para a estrutura de controle de sessao
Showing
5 changed files
with
95 additions
and
132 deletions
Show diff stats
ctlr.c
... | ... | @@ -279,7 +279,7 @@ static void ctlr_connect(H3270 *session, int ignored unused, void *dunno) |
279 | 279 | session->ea_buf[-1].fa = FA_PRINTABLE | FA_PROTECT; |
280 | 280 | if (!IN_3270 || (IN_SSCP && (session->kybdlock & KL_OIA_TWAIT))) |
281 | 281 | { |
282 | - kybdlock_clr(session,KL_OIA_TWAIT, "ctlr_connect"); | |
282 | + lib3270_kybdlock_clear(session,KL_OIA_TWAIT); | |
283 | 283 | status_reset(session); |
284 | 284 | } |
285 | 285 | |
... | ... | @@ -1830,7 +1830,7 @@ ctlr_write(unsigned char buf[], int buflen, Boolean erase) |
1830 | 1830 | h3270.aid = AID_NO; |
1831 | 1831 | do_reset(&h3270,False); |
1832 | 1832 | } else if (h3270.kybdlock & KL_OIA_TWAIT) { |
1833 | - kybdlock_clr(&h3270,KL_OIA_TWAIT, "ctlr_write"); | |
1833 | + lib3270_kybdlock_clear(&h3270,KL_OIA_TWAIT); | |
1834 | 1834 | status_changed(&h3270,LIB3270_STATUS_SYSWAIT); |
1835 | 1835 | } |
1836 | 1836 | if (wcc_sound_alarm) |
... | ... | @@ -2245,7 +2245,7 @@ ctlr_dbcs_postprocess(void) |
2245 | 2245 | void |
2246 | 2246 | ps_process(void) |
2247 | 2247 | { |
2248 | - while (run_ta()) | |
2248 | + while (run_ta(&h3270)) | |
2249 | 2249 | ; |
2250 | 2250 | // sms_continue(); |
2251 | 2251 | ... | ... |
... | ... | @@ -381,7 +381,7 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); |
381 | 381 | snconcat(buffer,4095,"%s","\n"); |
382 | 382 | |
383 | 383 | // Erase the line and enter the command. |
384 | - flen = kybd_prime(); | |
384 | + flen = kybd_prime(ft->host); | |
385 | 385 | if (!flen || flen < strlen(buffer) - 1) |
386 | 386 | { |
387 | 387 | lib3270_write_log(ft->host, "Unable to send command \"%s\" (flen=%d szBuffer=%d)",buffer,flen,strlen(buffer)); | ... | ... |
kybd.c
... | ... | @@ -101,13 +101,15 @@ static const char *ia_name[] = |
101 | 101 | }; |
102 | 102 | #endif // X3270_TRACE |
103 | 103 | |
104 | -static unsigned char pf_xlate[] = { | |
104 | +static unsigned char pf_xlate[] = | |
105 | +{ | |
105 | 106 | AID_PF1, AID_PF2, AID_PF3, AID_PF4, AID_PF5, AID_PF6, |
106 | 107 | AID_PF7, AID_PF8, AID_PF9, AID_PF10, AID_PF11, AID_PF12, |
107 | 108 | AID_PF13, AID_PF14, AID_PF15, AID_PF16, AID_PF17, AID_PF18, |
108 | 109 | AID_PF19, AID_PF20, AID_PF21, AID_PF22, AID_PF23, AID_PF24 |
109 | 110 | }; |
110 | -static unsigned char pa_xlate[] = { | |
111 | +static unsigned char pa_xlate[] = | |
112 | +{ | |
111 | 113 | AID_PA1, AID_PA2, AID_PA3 |
112 | 114 | }; |
113 | 115 | #define PF_SZ (sizeof(pf_xlate)/sizeof(pf_xlate[0])) |
... | ... | @@ -116,9 +118,9 @@ static unsigned char pa_xlate[] = { |
116 | 118 | // static time_t unlock_delay_time; |
117 | 119 | #define UNLOCK_MS 350 /* 0.35s after last unlock */ |
118 | 120 | static Boolean key_Character(int code, Boolean with_ge, Boolean pasting,Boolean *skipped); |
119 | -static Boolean flush_ta(void); | |
121 | +static int flush_ta(H3270 *hSession); | |
120 | 122 | static void key_AID(H3270 *session, unsigned char aid_code); |
121 | -static void kybdlock_set(unsigned int bits, const char *cause); | |
123 | +static void kybdlock_set(H3270 *session, unsigned int bits); | |
122 | 124 | // static KeySym MyStringToKeysym(char *s, enum keytype *keytypep); |
123 | 125 | |
124 | 126 | /* |
... | ... | @@ -128,7 +130,8 @@ Boolean key_WCharacter(unsigned char code[], Boolean *skipped); |
128 | 130 | */ |
129 | 131 | |
130 | 132 | static int nxk = 0; |
131 | -static struct xks { | |
133 | +static struct xks | |
134 | +{ | |
132 | 135 | KeySym key; |
133 | 136 | KeySym assoc; |
134 | 137 | } *xk; |
... | ... | @@ -141,7 +144,8 @@ static struct xks { |
141 | 144 | |
142 | 145 | /* Composite key mappings. */ |
143 | 146 | |
144 | -struct akeysym { | |
147 | +struct akeysym | |
148 | +{ | |
145 | 149 | KeySym keysym; |
146 | 150 | enum keytype keytype; |
147 | 151 | }; |
... | ... | @@ -196,7 +200,7 @@ static const char dxl[] = "0123456789abcdef"; |
196 | 200 | static int enq_chk(H3270 *session) |
197 | 201 | { |
198 | 202 | /* If no connection, forget it. */ |
199 | - if (!CONNECTED) | |
203 | + if (!lib3270_connected(session)) | |
200 | 204 | { |
201 | 205 | trace_event(" dropped (not connected)\n"); |
202 | 206 | return -1; |
... | ... | @@ -305,82 +309,85 @@ static void enq_ta(H3270 *hSession, void (*fn)(H3270 *, const char *, const char |
305 | 309 | /* |
306 | 310 | * Execute an action from the typeahead queue. |
307 | 311 | */ |
308 | -Boolean run_ta(void) | |
312 | +int run_ta(H3270 *hSession) | |
309 | 313 | { |
310 | 314 | struct ta *ta; |
311 | 315 | |
312 | - if (h3270.kybdlock || (ta = h3270.ta_head) == (struct ta *)NULL) | |
313 | - return False; | |
316 | + if (hSession->kybdlock || (ta = hSession->ta_head) == (struct ta *)NULL) | |
317 | + return 0; | |
314 | 318 | |
315 | - if ((h3270.ta_head = ta->next) == (struct ta *)NULL) | |
319 | + if ((hSession->ta_head = ta->next) == (struct ta *)NULL) | |
316 | 320 | { |
317 | - h3270.ta_tail = (struct ta *)NULL; | |
318 | - status_typeahead(&h3270,False); | |
321 | + hSession->ta_tail = (struct ta *)NULL; | |
322 | + status_typeahead(hSession,False); | |
319 | 323 | } |
320 | 324 | |
321 | 325 | switch(ta->type) |
322 | 326 | { |
323 | 327 | case TA_TYPE_DEFAULT: |
324 | - ta->fn(&h3270,ta->parm[0],ta->parm[1]); | |
328 | + ta->fn(hSession,ta->parm[0],ta->parm[1]); | |
325 | 329 | lib3270_free(ta->parm[0]); |
326 | 330 | lib3270_free(ta->parm[1]); |
327 | 331 | break; |
328 | 332 | |
329 | 333 | case TA_TYPE_KEY_AID: |
330 | - trace("Sending enqueued key %02x",ta->aid_code); | |
331 | - key_AID(&h3270,ta->aid_code); | |
334 | +// trace("Sending enqueued key %02x",ta->aid_code); | |
335 | + key_AID(hSession,ta->aid_code); | |
332 | 336 | break; |
333 | 337 | |
334 | 338 | default: |
335 | - popup_an_error(&h3270, _( "Unexpected type %d in typeahead queue" ), ta->type); | |
339 | + popup_an_error(hSession, _( "Unexpected type %d in typeahead queue" ), ta->type); | |
336 | 340 | |
337 | 341 | } |
338 | 342 | |
339 | 343 | lib3270_free(ta); |
340 | 344 | |
341 | - return True; | |
345 | + return 1; | |
342 | 346 | } |
343 | 347 | |
344 | 348 | /* |
345 | 349 | * Flush the typeahead queue. |
346 | 350 | * Returns whether or not anything was flushed. |
347 | 351 | */ |
348 | -static Boolean flush_ta(void) | |
352 | +static int flush_ta(H3270 *hSession) | |
349 | 353 | { |
350 | 354 | struct ta *ta, *next; |
351 | - Boolean any = False; | |
355 | + int any = 0; | |
352 | 356 | |
353 | - for (ta = h3270.ta_head; ta != (struct ta *) NULL; ta = next) | |
357 | + for (ta = hSession->ta_head; ta != (struct ta *) NULL; ta = next) | |
354 | 358 | { |
355 | 359 | lib3270_free(ta->parm[0]); |
356 | 360 | lib3270_free(ta->parm[1]); |
357 | 361 | next = ta->next; |
358 | 362 | lib3270_free(ta); |
359 | - any = True; | |
363 | + any++; | |
360 | 364 | } |
361 | - h3270.ta_head = h3270.ta_tail = (struct ta *) NULL; | |
362 | - status_typeahead(&h3270,False); | |
365 | + hSession->ta_head = hSession->ta_tail = (struct ta *) NULL; | |
366 | + status_typeahead(hSession,False); | |
363 | 367 | return any; |
364 | 368 | } |
365 | 369 | |
366 | 370 | /* Set bits in the keyboard lock. */ |
367 | -static void | |
368 | -kybdlock_set(unsigned int bits, const char *cause unused) | |
371 | +static void kybdlock_set(H3270 *hSession, unsigned int bits) | |
369 | 372 | { |
370 | 373 | unsigned int n; |
371 | 374 | |
372 | - n = h3270.kybdlock | bits; | |
373 | - if (n != h3270.kybdlock) { | |
374 | -#if defined(KYBDLOCK_TRACE) /*[*/ | |
375 | + n = hSession->kybdlock | bits; | |
376 | + if (n != hSession->kybdlock) | |
377 | + { | |
378 | +/* | |
379 | +#if defined(KYBDLOCK_TRACE) | |
375 | 380 | trace_event(" %s: kybdlock |= 0x%04x, 0x%04x -> 0x%04x\n", |
376 | 381 | cause, bits, kybdlock, n); |
377 | -#endif /*]*/ | |
378 | - if ((h3270.kybdlock ^ bits) & KL_DEFERRED_UNLOCK) { | |
382 | +#endif | |
383 | +*/ | |
384 | + if ((hSession->kybdlock ^ bits) & KL_DEFERRED_UNLOCK) | |
385 | + { | |
379 | 386 | /* Turned on deferred unlock. */ |
380 | - h3270.unlock_delay_time = time(NULL); | |
387 | + hSession->unlock_delay_time = time(NULL); | |
381 | 388 | } |
382 | - h3270.kybdlock = n; | |
383 | - status_changed(&h3270,LIB3270_STATUS_KYBDLOCK); | |
389 | + hSession->kybdlock = n; | |
390 | + status_changed(hSession,LIB3270_STATUS_KYBDLOCK); | |
384 | 391 | } |
385 | 392 | } |
386 | 393 | |
... | ... | @@ -418,13 +425,13 @@ void kybd_inhibit(H3270 *session, Boolean inhibit) |
418 | 425 | { |
419 | 426 | if (inhibit) |
420 | 427 | { |
421 | - kybdlock_set(KL_ENTER_INHIBIT, "kybd_inhibit"); | |
428 | + kybdlock_set(session,KL_ENTER_INHIBIT); | |
422 | 429 | if (session->kybdlock == KL_ENTER_INHIBIT) |
423 | 430 | status_reset(session); |
424 | 431 | } |
425 | 432 | else |
426 | 433 | { |
427 | - kybdlock_clr(session,KL_ENTER_INHIBIT, "kybd_inhibit"); | |
434 | + lib3270_kybdlock_clear(session,KL_ENTER_INHIBIT); | |
428 | 435 | if (!session->kybdlock) |
429 | 436 | status_reset(session); |
430 | 437 | } |
... | ... | @@ -438,14 +445,14 @@ void kybd_connect(H3270 *session, int connected, void *dunno) |
438 | 445 | if (session->kybdlock & KL_DEFERRED_UNLOCK) |
439 | 446 | RemoveTimeOut(session->unlock_id); |
440 | 447 | |
441 | - kybdlock_clr(session, -1, "kybd_connect"); | |
448 | + lib3270_kybdlock_clear(session, -1); | |
442 | 449 | |
443 | 450 | if (connected) { |
444 | 451 | /* Wait for any output or a WCC(restore) from the host */ |
445 | - kybdlock_set(KL_AWAITING_FIRST, "kybd_connect"); | |
452 | + kybdlock_set(session,KL_AWAITING_FIRST); | |
446 | 453 | } else { |
447 | - kybdlock_set(KL_NOT_CONNECTED, "kybd_connect"); | |
448 | - (void) flush_ta(); | |
454 | + kybdlock_set(session,KL_NOT_CONNECTED); | |
455 | + (void) flush_ta(session); | |
449 | 456 | } |
450 | 457 | } |
451 | 458 | |
... | ... | @@ -456,7 +463,7 @@ void kybd_in3270(H3270 *session, int in3270 unused, void *dunno) |
456 | 463 | { |
457 | 464 | if (session->kybdlock & KL_DEFERRED_UNLOCK) |
458 | 465 | RemoveTimeOut(session->unlock_id); |
459 | - kybdlock_clr(session,~KL_AWAITING_FIRST, "kybd_in3270"); | |
466 | + lib3270_kybdlock_clear(session,~KL_AWAITING_FIRST); | |
460 | 467 | |
461 | 468 | /* There might be a macro pending. */ |
462 | 469 | if (CONNECTED) |
... | ... | @@ -464,44 +471,16 @@ void kybd_in3270(H3270 *session, int in3270 unused, void *dunno) |
464 | 471 | } |
465 | 472 | |
466 | 473 | /* |
467 | - * Called to initialize the keyboard logic. | |
468 | - */ /* | |
469 | -void kybd_init(void) | |
470 | -{ | |
471 | - // Register kybd interest in connect and disconnect events. | |
472 | - trace("%s",__FUNCTION__); | |
473 | - lib3270_register_schange(NULL,LIB3270_STATE_CONNECT,kybd_connect,NULL); | |
474 | - lib3270_register_schange(NULL,LIB3270_STATE_3270_MODE,kybd_in3270,NULL); | |
475 | -} | |
476 | -*/ | |
477 | - | |
478 | -/* | |
479 | - * Toggle reverse mode. | |
480 | - */ | |
481 | - /* | |
482 | -static void | |
483 | -reverse_mode(Boolean on) | |
484 | -{ | |
485 | - reverse = on; | |
486 | - status_reverse_mode(on); | |
487 | -} | |
488 | -*/ | |
489 | - | |
490 | -/* | |
491 | 474 | * Lock the keyboard because of an operator error. |
492 | 475 | */ |
493 | -static void | |
494 | -operator_error(int error_type) | |
476 | +static void operator_error(int error_type) | |
495 | 477 | { |
496 | -// if (sms_redirect()) | |
497 | -// popup_an_error("Keyboard locked"); | |
498 | - | |
499 | 478 | if(h3270.oerr_lock) |
500 | 479 | { |
501 | 480 | status_oerr(NULL,error_type); |
502 | 481 | mcursor_locked(&h3270); |
503 | - kybdlock_set((unsigned int)error_type, "operator_error"); | |
504 | - flush_ta(); | |
482 | + kybdlock_set(&h3270,(unsigned int)error_type); | |
483 | + flush_ta(&h3270); | |
505 | 484 | } |
506 | 485 | else |
507 | 486 | { |
... | ... | @@ -551,7 +530,7 @@ static void key_AID(H3270 *session, unsigned char aid_code) |
551 | 530 | return; |
552 | 531 | if (aid_code != AID_ENTER && aid_code != AID_CLEAR) { |
553 | 532 | status_changed(&h3270,LIB3270_STATUS_MINUS); |
554 | - kybdlock_set(KL_OIA_MINUS, "key_AID"); | |
533 | + kybdlock_set(&h3270,KL_OIA_MINUS); | |
555 | 534 | return; |
556 | 535 | } |
557 | 536 | } |
... | ... | @@ -565,7 +544,7 @@ static void key_AID(H3270 *session, unsigned char aid_code) |
565 | 544 | status_twait(&h3270); |
566 | 545 | mcursor_waiting(&h3270); |
567 | 546 | lib3270_set_toggle(&h3270,LIB3270_TOGGLE_INSERT,0); |
568 | - kybdlock_set(KL_OIA_TWAIT | KL_OIA_LOCKED, "key_AID"); | |
547 | + kybdlock_set(&h3270,KL_OIA_TWAIT | KL_OIA_LOCKED); | |
569 | 548 | } |
570 | 549 | h3270.aid = aid_code; |
571 | 550 | ctlr_read_modified(h3270.aid, False); |
... | ... | @@ -615,7 +594,7 @@ LIB3270_ACTION(break) |
615 | 594 | |
616 | 595 | return 0; |
617 | 596 | } |
618 | - | |
597 | + | |
619 | 598 | /* |
620 | 599 | * ATTN key, per RFC 2355. Sends IP, regardless. |
621 | 600 | */ |
... | ... | @@ -630,26 +609,6 @@ LIB3270_ACTION(attn) |
630 | 609 | } |
631 | 610 | |
632 | 611 | /* |
633 | - * IAC IP, which works for 5250 System Request and interrupts the program | |
634 | - * on an AS/400, even when the keyboard is locked. | |
635 | - * | |
636 | - * This is now the same as the Attn action. | |
637 | - */ /* | |
638 | -void | |
639 | -Interrupt_action(Widget w unused, XEvent *event, String *params, | |
640 | - Cardinal *num_params) | |
641 | -{ | |
642 | - if (!IN_3270) | |
643 | - return; | |
644 | - | |
645 | -// reset_idle_timer(); | |
646 | - | |
647 | - net_interrupt(); | |
648 | -} | |
649 | - | |
650 | -*/ | |
651 | - | |
652 | -/* | |
653 | 612 | * Prepare for an insert of 'count' bytes. |
654 | 613 | * Returns True if the insert is legal, False otherwise. |
655 | 614 | */ |
... | ... | @@ -1045,7 +1004,7 @@ LIB3270_ACTION( nextfield ) |
1045 | 1004 | { |
1046 | 1005 | if(KYBDLOCK_IS_OERR(hSession)) |
1047 | 1006 | { |
1048 | - kybdlock_clr(hSession,KL_OERR_MASK, "Tab"); | |
1007 | + lib3270_kybdlock_clear(hSession,KL_OERR_MASK); | |
1049 | 1008 | status_reset(hSession); |
1050 | 1009 | } else |
1051 | 1010 | { |
... | ... | @@ -1092,7 +1051,7 @@ LIB3270_ACTION( previousfield ) |
1092 | 1051 | { |
1093 | 1052 | if (KYBDLOCK_IS_OERR(hSession)) |
1094 | 1053 | { |
1095 | - kybdlock_clr(hSession,KL_OERR_MASK, "BackTab"); | |
1054 | + lib3270_kybdlock_clear(hSession,KL_OERR_MASK); | |
1096 | 1055 | status_reset(hSession); |
1097 | 1056 | } |
1098 | 1057 | else |
... | ... | @@ -1133,8 +1092,8 @@ LIB3270_ACTION( previousfield ) |
1133 | 1092 | |
1134 | 1093 | static void defer_unlock(H3270 *session) |
1135 | 1094 | { |
1136 | - trace("%s",__FUNCTION__); | |
1137 | - kybdlock_clr(session,KL_DEFERRED_UNLOCK, "defer_unlock"); | |
1095 | +// trace("%s",__FUNCTION__); | |
1096 | + lib3270_kybdlock_clear(session,KL_DEFERRED_UNLOCK); | |
1138 | 1097 | status_reset(session); |
1139 | 1098 | if(CONNECTED) |
1140 | 1099 | ps_process(); |
... | ... | @@ -1157,7 +1116,7 @@ void do_reset(H3270 *session, Boolean explicit) |
1157 | 1116 | ) { |
1158 | 1117 | Boolean half_reset = False; |
1159 | 1118 | |
1160 | - if (flush_ta()) | |
1119 | + if (flush_ta(session)) | |
1161 | 1120 | half_reset = True; |
1162 | 1121 | |
1163 | 1122 | if (half_reset) |
... | ... | @@ -1188,11 +1147,11 @@ void do_reset(H3270 *session, Boolean explicit) |
1188 | 1147 | #endif /*]*/ |
1189 | 1148 | || (!session->unlock_delay) // && !sms_in_macro()) |
1190 | 1149 | || (session->unlock_delay_time != 0 && (time(NULL) - session->unlock_delay_time) > 1)) { |
1191 | - kybdlock_clr(session,-1, "do_reset"); | |
1150 | + lib3270_kybdlock_clear(session,-1); | |
1192 | 1151 | } else if (session->kybdlock & |
1193 | 1152 | (KL_DEFERRED_UNLOCK | KL_OIA_TWAIT | KL_OIA_LOCKED | KL_AWAITING_FIRST)) { |
1194 | - kybdlock_clr(session,~KL_DEFERRED_UNLOCK, "do_reset"); | |
1195 | - kybdlock_set(KL_DEFERRED_UNLOCK, "do_reset"); | |
1153 | + lib3270_kybdlock_clear(session,~KL_DEFERRED_UNLOCK); | |
1154 | + kybdlock_set(session,KL_DEFERRED_UNLOCK); | |
1196 | 1155 | session->unlock_id = AddTimeOut(UNLOCK_MS, session, defer_unlock); |
1197 | 1156 | } |
1198 | 1157 | |
... | ... | @@ -1260,7 +1219,7 @@ LIB3270_CURSOR_ACTION( left ) |
1260 | 1219 | { |
1261 | 1220 | if(KYBDLOCK_IS_OERR(hSession)) |
1262 | 1221 | { |
1263 | - kybdlock_clr(hSession,KL_OERR_MASK, "Left"); | |
1222 | + lib3270_kybdlock_clear(hSession,KL_OERR_MASK); | |
1264 | 1223 | status_reset(&h3270); |
1265 | 1224 | } |
1266 | 1225 | else |
... | ... | @@ -1523,7 +1482,7 @@ LIB3270_CURSOR_ACTION( right ) |
1523 | 1482 | { |
1524 | 1483 | if (KYBDLOCK_IS_OERR(hSession)) |
1525 | 1484 | { |
1526 | - kybdlock_clr(hSession,KL_OERR_MASK, "Right"); | |
1485 | + lib3270_kybdlock_clear(hSession,KL_OERR_MASK); | |
1527 | 1486 | status_reset(hSession); |
1528 | 1487 | } |
1529 | 1488 | else |
... | ... | @@ -1753,7 +1712,7 @@ LIB3270_CURSOR_ACTION( up ) |
1753 | 1712 | { |
1754 | 1713 | if (KYBDLOCK_IS_OERR(hSession)) |
1755 | 1714 | { |
1756 | - kybdlock_clr(hSession,KL_OERR_MASK, "Up"); | |
1715 | + lib3270_kybdlock_clear(hSession,KL_OERR_MASK); | |
1757 | 1716 | status_reset(hSession); |
1758 | 1717 | } |
1759 | 1718 | else |
... | ... | @@ -1791,7 +1750,7 @@ LIB3270_CURSOR_ACTION( down ) |
1791 | 1750 | { |
1792 | 1751 | if (KYBDLOCK_IS_OERR(hSession)) |
1793 | 1752 | { |
1794 | - kybdlock_clr(hSession,KL_OERR_MASK, "Down"); | |
1753 | + lib3270_kybdlock_clear(hSession,KL_OERR_MASK); | |
1795 | 1754 | status_reset(hSession); |
1796 | 1755 | } else |
1797 | 1756 | { |
... | ... | @@ -2387,7 +2346,7 @@ static void do_pf(unsigned n) |
2387 | 2346 | |
2388 | 2347 | /* |
2389 | 2348 | * Set or clear the keyboard scroll lock. |
2390 | - */ | |
2349 | + */ /* | |
2391 | 2350 | void |
2392 | 2351 | kybd_scroll_lock(Boolean lock) |
2393 | 2352 | { |
... | ... | @@ -2397,7 +2356,7 @@ kybd_scroll_lock(Boolean lock) |
2397 | 2356 | kybdlock_set(KL_SCROLLED, "kybd_scroll_lock"); |
2398 | 2357 | else |
2399 | 2358 | kybdlock_clr(&h3270, KL_SCROLLED, "kybd_scroll_lock"); |
2400 | -} | |
2359 | +} */ | |
2401 | 2360 | |
2402 | 2361 | /* |
2403 | 2362 | * Move the cursor back within the legal paste area. |
... | ... | @@ -2825,8 +2784,7 @@ LIB3270_EXPORT int lib3270_emulate_input(H3270 *session, char *s, int len, int p |
2825 | 2784 | * Returns the length of the input field, or 0 if there is no field |
2826 | 2785 | * to set up. |
2827 | 2786 | */ |
2828 | -int | |
2829 | -kybd_prime(void) | |
2787 | +int kybd_prime(H3270 *hSession) | |
2830 | 2788 | { |
2831 | 2789 | int baddr; |
2832 | 2790 | register unsigned char fa; |
... | ... | @@ -2836,37 +2794,42 @@ kybd_prime(void) |
2836 | 2794 | * No point in trying if the screen isn't formatted, the keyboard |
2837 | 2795 | * is locked, or we aren't in 3270 mode. |
2838 | 2796 | */ |
2839 | - if (!h3270.formatted || h3270.kybdlock || !IN_3270) | |
2797 | + if (!hSession->formatted || hSession->kybdlock || !IN_3270) | |
2840 | 2798 | return 0; |
2841 | 2799 | |
2842 | - fa = get_field_attribute(&h3270,h3270.cursor_addr); | |
2843 | - if (h3270.ea_buf[h3270.cursor_addr].fa || FA_IS_PROTECTED(fa)) { | |
2800 | + fa = get_field_attribute(hSession,hSession->cursor_addr); | |
2801 | + if (hSession->ea_buf[hSession->cursor_addr].fa || FA_IS_PROTECTED(fa)) | |
2802 | + { | |
2844 | 2803 | /* |
2845 | 2804 | * The cursor is not in an unprotected field. Find the |
2846 | 2805 | * next one. |
2847 | 2806 | */ |
2848 | - baddr = next_unprotected(&h3270,h3270.cursor_addr); | |
2807 | + baddr = next_unprotected(hSession,hSession->cursor_addr); | |
2849 | 2808 | |
2850 | 2809 | /* If there isn't any, give up. */ |
2851 | 2810 | if (!baddr) |
2852 | 2811 | return 0; |
2853 | 2812 | |
2854 | 2813 | /* Move the cursor there. */ |
2855 | - } else { | |
2814 | + } | |
2815 | + else | |
2816 | + { | |
2856 | 2817 | /* Already in an unprotected field. Find its start. */ |
2857 | - baddr = h3270.cursor_addr; | |
2858 | - while (!h3270.ea_buf[baddr].fa) { | |
2818 | + baddr = hSession->cursor_addr; | |
2819 | + while (!hSession->ea_buf[baddr].fa) | |
2820 | + { | |
2859 | 2821 | DEC_BA(baddr); |
2860 | 2822 | } |
2861 | 2823 | INC_BA(baddr); |
2862 | 2824 | } |
2863 | 2825 | |
2864 | 2826 | /* Move the cursor to the beginning of the field. */ |
2865 | - cursor_move(&h3270,baddr); | |
2827 | + cursor_move(hSession,baddr); | |
2866 | 2828 | |
2867 | 2829 | /* Erase it. */ |
2868 | - while (!h3270.ea_buf[baddr].fa) { | |
2869 | - ctlr_add(&h3270,baddr, 0, 0); | |
2830 | + while (!hSession->ea_buf[baddr].fa) | |
2831 | + { | |
2832 | + ctlr_add(hSession,baddr, 0, 0); | |
2870 | 2833 | len++; |
2871 | 2834 | INC_BA(baddr); |
2872 | 2835 | } | ... | ... |
kybdc.h
... | ... | @@ -60,18 +60,18 @@ |
60 | 60 | LIB3270_INTERNAL void add_xk(KeySym key, KeySym assoc); |
61 | 61 | LIB3270_INTERNAL void clear_xks(void); |
62 | 62 | LIB3270_INTERNAL void do_reset(H3270 *session, Boolean explicit); |
63 | - LIB3270_INTERNAL void hex_input(char *s); | |
63 | +// LIB3270_INTERNAL void hex_input(char *s); | |
64 | 64 | |
65 | - #define kybdlock_clr(session, bits, cause) lib3270_kybdlock_clear(session, bits) | |
65 | +// #define kybdlock_clr(session, bits, cause) lib3270_kybdlock_clear(session, bits) | |
66 | 66 | LIB3270_INTERNAL void lib3270_kybdlock_clear(H3270 *hSession, LIB3270_KL_STATE bits); |
67 | 67 | |
68 | 68 | |
69 | 69 | LIB3270_INTERNAL void kybd_inhibit(H3270 *session, Boolean inhibit); |
70 | - LIB3270_INTERNAL void kybd_init(void); | |
71 | - LIB3270_INTERNAL int kybd_prime(void); | |
70 | +// LIB3270_INTERNAL void kybd_init(void); | |
71 | + LIB3270_INTERNAL int kybd_prime(H3270 *hSession); | |
72 | 72 | LIB3270_INTERNAL void kybd_scroll_lock(Boolean lock); |
73 | - LIB3270_INTERNAL Boolean run_ta(void); | |
74 | - LIB3270_INTERNAL int state_from_keymap(char keymap[32]); | |
73 | + LIB3270_INTERNAL int run_ta(H3270 *hSession); | |
74 | +// LIB3270_INTERNAL int state_from_keymap(char keymap[32]); | |
75 | 75 | LIB3270_INTERNAL void kybd_connect(H3270 *session, int connected, void *dunno); |
76 | 76 | LIB3270_INTERNAL void kybd_in3270(H3270 *session, int in3270 unused, void *dunno); |
77 | 77 | ... | ... |
telnet.c
... | ... | @@ -1222,7 +1222,7 @@ static int telnet_fsm(H3270 *session, unsigned char c) |
1222 | 1222 | cooked_init(session); |
1223 | 1223 | #endif /*]*/ |
1224 | 1224 | host_in3270(session,CONNECTED_ANSI); |
1225 | - kybdlock_clr(session,KL_AWAITING_FIRST, "telnet_fsm"); | |
1225 | + lib3270_kybdlock_clear(session,KL_AWAITING_FIRST); | |
1226 | 1226 | status_reset(session); |
1227 | 1227 | ps_process(); |
1228 | 1228 | } | ... | ... |