Commit 5a012b7864a0c0ae8d8368f791da2dde7f76097a
1 parent
ab2a3303
Exists in
master
Ajustes para multi sessao, removendo funções obsoletas
Showing
4 changed files
with
5 additions
and
365 deletions
Show diff stats
latest/src/gtk2/screen.c
... | ... | @@ -86,7 +86,7 @@ |
86 | 86 | static void model_changed(H3270 *session, const char *name, int model, int cols, int rows); |
87 | 87 | |
88 | 88 | #ifdef HAVE_ALTSCREEN |
89 | - static void view_changed(H3270 *session, int rows, int cols); | |
89 | + static void view_changed(H3270 *session, unsigned short rows, unsigned short cols); | |
90 | 90 | #endif |
91 | 91 | |
92 | 92 | /*---[ Globals ]-------------------------------------------------------------------------------------------*/ |
... | ... | @@ -906,7 +906,7 @@ |
906 | 906 | } |
907 | 907 | |
908 | 908 | #ifdef HAVE_ALTSCREEN |
909 | - static void view_changed(H3270 *session, int rows, int cols) | |
909 | + static void view_changed(H3270 *session, unsigned short rows, unsigned short cols) | |
910 | 910 | { |
911 | 911 | if(!screen || rows > screen->rows || cols > screen->cols ) |
912 | 912 | return; | ... | ... |
latest/src/include/lib3270/api.h
... | ... | @@ -272,7 +272,7 @@ |
272 | 272 | struct lib3270_state_callback *st_last[N_ST]; |
273 | 273 | |
274 | 274 | /* Session based callbacks */ |
275 | - void (*configure)(H3270 *session, int rows, int cols); | |
275 | + void (*configure)(H3270 *session, unsigned short rows, unsigned short cols); | |
276 | 276 | void (*update)(H3270 *session, int baddr, unsigned char c, unsigned short attr); |
277 | 277 | void (*update_cursor)(H3270 *session, unsigned short row, unsigned short col); |
278 | 278 | void (*set_oia)(H3270 *session, OIA_FLAG id, unsigned char on); |
... | ... | @@ -504,6 +504,7 @@ |
504 | 504 | void (*display)(H3270 *session); |
505 | 505 | void (*set_viewsize)(H3270 *session, unsigned short rows, unsigned short cols); |
506 | 506 | |
507 | + | |
507 | 508 | void (*toggle_changed)(int ix, int value, int reason, const char *name); |
508 | 509 | void (*show_timer)(long seconds); |
509 | 510 | ... | ... |
latest/src/lib/ft.c
... | ... | @@ -385,365 +385,4 @@ static void ft_in3270(H3270 *session, int ignored, void *dunno) |
385 | 385 | ft_complete(MSG_("ftNot3270","Not in 3270 mode, transfer cancelled")); |
386 | 386 | } |
387 | 387 | |
388 | -/* | |
389 | - * Script/macro action for file transfer. | |
390 | - * Transfer(option=value[,...]) | |
391 | - * Options are: | |
392 | - * Direction=send|receive default receive | |
393 | - * HostFile=name required | |
394 | - * LocalFile=name required | |
395 | - * Host=[tso|vm] default tso | |
396 | - * Mode=[ascii|binary] default ascii | |
397 | - * Cr=[add|remove|keep] default add/remove | |
398 | - * Exist=[keep|replace|append] default keep | |
399 | - * Recfm=[default|fixed|variable|undefined] default default | |
400 | - * Lrecl=n no default | |
401 | - * Blksize=n no default | |
402 | - * Allocation=[default|tracks|cylinders|avblock] default default | |
403 | - * PrimarySpace=n no default | |
404 | - * SecondarySpace=n no default | |
405 | - * | |
406 | -static struct { | |
407 | - const char *name; | |
408 | - char *value; | |
409 | - const char *keyword[4]; | |
410 | -} tp[] = { | |
411 | - { "Direction", CN, { "receive", "send" } }, | |
412 | - { "HostFile" }, | |
413 | - { "LocalFile" }, | |
414 | - { "Host", CN, { "tso", "vm" } }, | |
415 | - { "Mode", CN, { "ascii", "binary" } }, | |
416 | - { "Cr", CN, { "auto", "remove", "add", "keep" } }, | |
417 | - { "Exist", CN, { "keep", "replace", "append" } }, | |
418 | - { "Recfm", CN, { "default", "fixed", "variable", | |
419 | - "undefined" } }, | |
420 | - { "Lrecl" }, | |
421 | - { "Blksize" }, | |
422 | - { "Allocation", CN, { "default", "tracks", "cylinders", | |
423 | - "avblock" } }, | |
424 | - { "PrimarySpace" }, | |
425 | - { "SecondarySpace" }, | |
426 | - { "BufferSize" }, | |
427 | - { CN } | |
428 | -}; | |
429 | -enum ft_parm_name { | |
430 | - PARM_DIRECTION, | |
431 | - PARM_HOST_FILE, | |
432 | - PARM_LOCAL_FILE, | |
433 | - PARM_HOST, | |
434 | - PARM_MODE, | |
435 | - PARM_CR, | |
436 | - PARM_EXIST, | |
437 | - PARM_RECFM, | |
438 | - PARM_LRECL, | |
439 | - PARM_BLKSIZE, | |
440 | - PARM_ALLOCATION, | |
441 | - PARM_PRIMARY_SPACE, | |
442 | - PARM_SECONDARY_SPACE, | |
443 | - PARM_BUFFER_SIZE, | |
444 | - N_PARMS | |
445 | -}; | |
446 | - | |
447 | -void | |
448 | -Transfer_action(Widget w unused, XEvent *event, String *params, | |
449 | - Cardinal *num_params) | |
450 | -{ | |
451 | - int i, k; | |
452 | - Cardinal j; | |
453 | - long l; | |
454 | - char *ptr; | |
455 | - char *ft_command = CN; | |
456 | - | |
457 | - char opts[80]; | |
458 | - char *op = opts + 1; | |
459 | - char *cmd; | |
460 | - unsigned flen; | |
461 | - | |
462 | - String *xparams = params; | |
463 | - Cardinal xnparams = *num_params; | |
464 | - | |
465 | - ft_is_action = True; | |
466 | - | |
467 | - // Make sure we're connected. | |
468 | - if (!IN_3270) { | |
469 | - popup_an_error("Not connected"); | |
470 | - return; | |
471 | - } | |
472 | - | |
473 | -//#if defined(C3270) || defined(WC3270) | |
474 | -// // Check for interactive mode. | |
475 | -// if (xnparams == 0 && escaped) { | |
476 | -// if (interactive_transfer(&xparams, &xnparams) < 0) { | |
477 | -// return; | |
478 | -// } | |
479 | -// } | |
480 | -//#endif | |
481 | - | |
482 | - // Set everything to the default. | |
483 | - for (i = 0; i < N_PARMS; i++) { | |
484 | - Free(tp[i].value); | |
485 | - if (tp[i].keyword[0] != CN) | |
486 | - tp[i].value = | |
487 | - NewString(tp[i].keyword[0]); | |
488 | - else | |
489 | - tp[i].value = CN; | |
490 | - } | |
491 | - | |
492 | - // See what they specified. | |
493 | - for (j = 0; j < xnparams; j++) { | |
494 | - for (i = 0; i < N_PARMS; i++) { | |
495 | - char *eq; | |
496 | - int kwlen; | |
497 | - | |
498 | - eq = strchr(xparams[j], '='); | |
499 | - if (eq == CN || eq == xparams[j] || !*(eq + 1)) { | |
500 | - popup_an_error("Invalid option syntax: '%s'", | |
501 | - xparams[j]); | |
502 | - return; | |
503 | - } | |
504 | - kwlen = eq - xparams[j]; | |
505 | - if (!strncasecmp(xparams[j], tp[i].name, kwlen) | |
506 | - && !tp[i].name[kwlen]) { | |
507 | - if (tp[i].keyword[0]) { | |
508 | - for (k = 0; | |
509 | - tp[i].keyword[k] != CN && k < 4; | |
510 | - k++) { | |
511 | - if (!strcasecmp(eq + 1, | |
512 | - tp[i].keyword[k])) { | |
513 | - break; | |
514 | - } | |
515 | - } | |
516 | - if (k >= 4 || | |
517 | - tp[i].keyword[k] == CN) { | |
518 | - popup_an_error("Invalid option " | |
519 | - "value: '%s'", eq + 1); | |
520 | - return; | |
521 | - } | |
522 | - } else switch (i) { | |
523 | - case PARM_LRECL: | |
524 | - case PARM_BLKSIZE: | |
525 | - case PARM_PRIMARY_SPACE: | |
526 | - case PARM_SECONDARY_SPACE: | |
527 | - case PARM_BUFFER_SIZE: | |
528 | - l = strtol(eq + 1, &ptr, 10); | |
529 | - if (ptr == eq + 1 || *ptr) { | |
530 | - popup_an_error("Invalid option " | |
531 | - "value: '%s'", eq + 1); | |
532 | - return; | |
533 | - } | |
534 | - break; | |
535 | - default: | |
536 | - break; | |
537 | - } | |
538 | - tp[i].value = NewString(eq + 1); | |
539 | - break; | |
540 | - } | |
541 | - } | |
542 | - if (i >= N_PARMS) { | |
543 | - popup_an_error("Unknown option: %s", xparams[j]); | |
544 | - return; | |
545 | - } | |
546 | - } | |
547 | - | |
548 | - // Check for required values. | |
549 | - if (tp[PARM_HOST_FILE].value == CN) { | |
550 | - popup_an_error("Missing 'HostFile' option"); | |
551 | - return; | |
552 | - } | |
553 | - if (tp[PARM_LOCAL_FILE].value == CN) { | |
554 | - popup_an_error("Missing 'LocalFile' option"); | |
555 | - return; | |
556 | - } | |
557 | - | |
558 | - // | |
559 | - // Start the transfer. Much of this is duplicated from ft_start() | |
560 | - // and should be made common. | |
561 | - // | |
562 | - if (tp[PARM_BUFFER_SIZE].value != CN) | |
563 | - dft_buffersize = atoi(tp[PARM_BUFFER_SIZE].value); | |
564 | - else | |
565 | - dft_buffersize = 0; | |
566 | - set_dft_buffersize(); | |
567 | - | |
568 | - receive_flag = !strcasecmp(tp[PARM_DIRECTION].value, "receive"); | |
569 | - append_flag = !strcasecmp(tp[PARM_EXIST].value, "append"); | |
570 | - allow_overwrite = !strcasecmp(tp[PARM_EXIST].value, "replace"); | |
571 | - ascii_flag = !strcasecmp(tp[PARM_MODE].value, "ascii"); | |
572 | - if (!strcasecmp(tp[PARM_CR].value, "auto")) { | |
573 | - cr_flag = ascii_flag; | |
574 | - } else { | |
575 | - cr_flag = !strcasecmp(tp[PARM_CR].value, "remove") || | |
576 | - !strcasecmp(tp[PARM_CR].value, "add"); | |
577 | - } | |
578 | - vm_flag = !strcasecmp(tp[PARM_HOST].value, "vm"); | |
579 | - recfm = DEFAULT_RECFM; | |
580 | - for (k = 0; tp[PARM_RECFM].keyword[k] != CN && k < 4; k++) { | |
581 | - if (!strcasecmp(tp[PARM_RECFM].value, | |
582 | - tp[PARM_RECFM].keyword[k])) { | |
583 | - recfm = (enum recfm)k; | |
584 | - break; | |
585 | - } | |
586 | - } | |
587 | - units = DEFAULT_UNITS; | |
588 | - for (k = 0; tp[PARM_ALLOCATION].keyword[k] != CN && k < 4; k++) { | |
589 | - if (!strcasecmp(tp[PARM_ALLOCATION].value, | |
590 | - tp[PARM_ALLOCATION].keyword[k])) { | |
591 | - units = (enum units)k; | |
592 | - break; | |
593 | - } | |
594 | - } | |
595 | - | |
596 | - ft_host_filename = tp[PARM_HOST_FILE].value; | |
597 | - ft_local_filename = tp[PARM_LOCAL_FILE].value; | |
598 | - | |
599 | - // See if the local file can be overwritten. | |
600 | - if (receive_flag && !append_flag && !allow_overwrite) { | |
601 | - ft_local_file = fopen(ft_local_filename, "r"); | |
602 | - if (ft_local_file != (FILE *)NULL) { | |
603 | - (void) fclose(ft_local_file); | |
604 | - popup_an_error("File exists"); | |
605 | - return; | |
606 | - } | |
607 | - } | |
608 | - | |
609 | - // Open the local file. | |
610 | - ft_local_file = fopen(ft_local_filename, | |
611 | - receive_flag ? | |
612 | - (append_flag ? "a" : "w" ) : | |
613 | - "r"); | |
614 | - if (ft_local_file == (FILE *)NULL) { | |
615 | - popup_an_errno(errno, "Open(%s)", ft_local_filename); | |
616 | - return; | |
617 | - } | |
618 | - | |
619 | - // Build the ind$file command | |
620 | - op[0] = '\0'; | |
621 | - if (ascii_flag) | |
622 | - strcat(op, " ascii"); | |
623 | - if (cr_flag) | |
624 | - strcat(op, " crlf"); | |
625 | - if (append_flag && !receive_flag) | |
626 | - strcat(op, " append"); | |
627 | - if (!receive_flag) { | |
628 | - if (!vm_flag) { | |
629 | - if (recfm != DEFAULT_RECFM) { | |
630 | - // RECFM Entered, process | |
631 | - strcat(op, " recfm("); | |
632 | - switch (recfm) { | |
633 | - case FIXED: | |
634 | - strcat(op, "f"); | |
635 | - break; | |
636 | - case VARIABLE: | |
637 | - strcat(op, "v"); | |
638 | - break; | |
639 | - case UNDEFINED: | |
640 | - strcat(op, "u"); | |
641 | - break; | |
642 | - default: | |
643 | - break; | |
644 | - }; | |
645 | - strcat(op, ")"); | |
646 | - if (tp[PARM_LRECL].value != CN) | |
647 | - sprintf(eos(op), " lrecl(%s)", | |
648 | - tp[PARM_LRECL].value); | |
649 | - if (tp[PARM_BLKSIZE].value != CN) | |
650 | - sprintf(eos(op), " blksize(%s)", | |
651 | - tp[PARM_BLKSIZE].value); | |
652 | - } | |
653 | - if (units != DEFAULT_UNITS) { | |
654 | - // Space Entered, processs it | |
655 | - switch (units) { | |
656 | - case TRACKS: | |
657 | - strcat(op, " tracks"); | |
658 | - break; | |
659 | - case CYLINDERS: | |
660 | - strcat(op, " cylinders"); | |
661 | - break; | |
662 | - case AVBLOCK: | |
663 | - strcat(op, " avblock"); | |
664 | - break; | |
665 | - default: | |
666 | - break; | |
667 | - }; | |
668 | - if (tp[PARM_PRIMARY_SPACE].value != CN) { | |
669 | - sprintf(eos(op), " space(%s", | |
670 | - tp[PARM_PRIMARY_SPACE].value); | |
671 | - if (tp[PARM_SECONDARY_SPACE].value) | |
672 | - sprintf(eos(op), ",%s", | |
673 | - tp[PARM_SECONDARY_SPACE].value); | |
674 | - strcat(op, ")"); | |
675 | - } | |
676 | - } | |
677 | - } else { | |
678 | - if (recfm != DEFAULT_RECFM) { | |
679 | - strcat(op, " recfm "); | |
680 | - switch (recfm) { | |
681 | - case FIXED: | |
682 | - strcat(op, "f"); | |
683 | - break; | |
684 | - case VARIABLE: | |
685 | - strcat(op, "v"); | |
686 | - break; | |
687 | - default: | |
688 | - break; | |
689 | - }; | |
690 | - | |
691 | - if (tp[PARM_LRECL].value) | |
692 | - sprintf(eos(op), " lrecl %s", | |
693 | - tp[PARM_LRECL].value); | |
694 | - } | |
695 | - } | |
696 | - } | |
697 | - | |
698 | - // Insert the '(' for VM options. | |
699 | - if (strlen(op) > 0 && vm_flag) { | |
700 | - opts[0] = ' '; | |
701 | - opts[1] = '('; | |
702 | - op = opts; | |
703 | - } | |
704 | - | |
705 | - // | |
706 | - // Unless the user specified a particular file transfer command, | |
707 | - // translate 'ind$file' so that it will have the proper EBCDIC value, | |
708 | - // regardless of the local character set. | |
709 | - // | |
710 | - if (appres.ft_command != CN) { | |
711 | - ft_command = appres.ft_command; | |
712 | - } else { | |
713 | - char *s = "ind$file"; | |
714 | - char *t; | |
715 | - unsigned char c; | |
716 | - | |
717 | - ft_command = Malloc(strlen(s) + 1); | |
718 | - t = ft_command; | |
719 | - | |
720 | - while ((c = *s++)) { | |
721 | - *t++ = ebc2asc[asc2ebc0[c & 0xff]]; | |
722 | - } | |
723 | - *t = '\0'; | |
724 | - } | |
725 | - | |
726 | - // Build the whole command. | |
727 | - cmd = xs_buffer("%s %s %s%s\\n", | |
728 | - ft_command, | |
729 | - receive_flag ? "get" : "put", ft_host_filename, op); | |
730 | - if (appres.ft_command == CN) | |
731 | - Free(ft_command); | |
732 | - | |
733 | - // Erase the line and enter the command. | |
734 | - flen = kybd_prime(); | |
735 | - if (!flen || flen < strlen(cmd) - 1) { | |
736 | - Free(cmd); | |
737 | - popup_an_error(get_message("ftUnable")); | |
738 | - return; | |
739 | - } | |
740 | - (void) emulate_input(cmd, strlen(cmd), False); | |
741 | - Free(cmd); | |
742 | - | |
743 | - // Get this thing started. | |
744 | - set_ft_state(FT_AWAIT_ACK); | |
745 | - ft_is_cut = False; | |
746 | -} | |
747 | -*/ | |
748 | - | |
749 | 388 | #endif | ... | ... |
latest/src/lib/screen.c
... | ... | @@ -320,7 +320,7 @@ LIB3270_EXPORT int lib3270_get_contents(H3270 *h, int first, int last, unsigned |
320 | 320 | |
321 | 321 | for(baddr = first; baddr < last;baddr++) |
322 | 322 | { |
323 | - *(chr++) = ea_buf[baddr].chr; | |
323 | + *(chr++) = ea_buf[baddr].chr ? ea_buf[baddr].chr : ' '; | |
324 | 324 | *(attr++) = ea_buf[baddr].attr; |
325 | 325 | } |
326 | 326 | ... | ... |