Release 4.1
[unix-history] / usr / src / usr.bin / tn3270 / tools / prt3270.c
index 3821724..aa9dfff 100644 (file)
@@ -1,22 +1,45 @@
-#ifndef        lint
-static char    sccsid[] = "@(#)prt3270.c       3.1  10/29/86";
-#endif /* ndef lint */
-
+/*
+ * Copyright (c) 1988 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#ifndef lint
+char copyright[] =
+"@(#) Copyright (c) 1988 Regents of the University of California.\n\
+ All rights reserved.\n";
+#endif /* not lint */
+
+#ifndef lint
+static char sccsid[] = "@(#)prt3270.c  4.1 (Berkeley) %G%";
+#endif /* not lint */
 
 #if defined(unix)
 #endif
 #include <stdio.h>
 #include <ctype.h>
 
 
 #if defined(unix)
 #endif
 #include <stdio.h>
 #include <ctype.h>
 
-#include "../general.h"
+#include "../general/general.h"
 
 
-#include "../ascii/ascebc.h"
+#include "../api/asc_ebc.h"
 #include "../ctlr/hostctlr.h"
 #include "../ctlr/screen.h"
 #include "../ctlr/hostctlr.h"
 #include "../ctlr/screen.h"
-#define        DEFINEAIDS
-#define        LETS_SEE_ASCII
-#include "../keyboard/m4.out"
-#include "../system/globals.h"
+#include "../ctlr/function.h"
+#include "../api/astosc.h"
+#include "../general/globals.h"
+
+#include "../ctlr/kbd.out"
 
 
 int NumberColumns = 80;
 
 
 int NumberColumns = 80;
@@ -148,7 +171,7 @@ void
 putEChar(character)
 int character;
 {
 putEChar(character)
 int character;
 {
-    putChar(ebcasc[0][character]);
+    putChar(ebc_asc[character]);
     if (ColsLeft() < 10) {
        Column1();
     }
     if (ColsLeft() < 10) {
        Column1();
     }
@@ -158,13 +181,33 @@ void
 PrintAid(i)
 int    i;
 {
 PrintAid(i)
 int    i;
 {
-    TC_AsciiAids_t *TC;
+    struct astosc *this;
 
 
-    for (TC = &TC_AsciiAids[TC_LOWEST_AID-TC_LOWEST];
-               TC <= &TC_AsciiAids[TC_HIGHEST_AID-TC_LOWEST]; TC++) {
-       if ((TC->tc_aid&0xff) == i) {
-           putstr(TC->tc_name);
-           return;
+    for (this = &astosc[0]; this <= &astosc[highestof(astosc)]; this++) {
+       if (this->function == FCN_AID) {
+           int j;
+
+           switch (this->shiftstate) {
+           case 0:
+               j = 0;
+               break;
+           case SHIFT_UPSHIFT:
+               j = 1;
+               break;
+           case SHIFT_ALT:
+               j = 2;
+               break;
+           case (SHIFT_UPSHIFT|SHIFT_ALT):
+               j = 3;
+               break;
+           default:
+               fprintf(stderr, "Bad shiftstate 0x%x.\n", this->shiftstate);
+               exit(1);
+           }
+           if (hits[this->scancode].hit[j].code == i) {
+               putstr(this->name);
+               return;
+           }
        }
     }
 
        }
     }
 
@@ -223,16 +266,16 @@ int       control;                                /* this buffer ended block? */
                putstr("read_modified command\n");
                break;
            case CMD_SNA_READ_MODIFIED:
                putstr("read_modified command\n");
                break;
            case CMD_SNA_READ_MODIFIED:
-               putstr("read_modified command\n");
+               putstr("sna_read_modified command\n");
                break;
            case CMD_SNA_READ_MODIFIED_ALL:
                break;
            case CMD_SNA_READ_MODIFIED_ALL:
-               putstr("read_modified command\n");
+               putstr("sna_read_modified_all command\n");
                break;
            case CMD_READ_BUFFER:
                break;
            case CMD_READ_BUFFER:
-               putstr("read_modified command\n");
+               putstr("read_buffer command\n");
                break;
            case CMD_SNA_READ_BUFFER:
                break;
            case CMD_SNA_READ_BUFFER:
-               putstr("read_modified command\n");
+               putstr("sna_read_buffer command\n");
                break;
            default:
                break;
                break;
            default:
                break;
@@ -406,7 +449,7 @@ int control;
        count--;
        PrintAid(aid);
        putSpace();
        count--;
        PrintAid(aid);
        putSpace();
-       if (aid == TCtoAid(TC_TREQ)) {
+       if (aid == AID_TREQ) {
            state = DATA;
        } else {
            state = JUST_GOT_AID;
            state = DATA;
        } else {
            state = JUST_GOT_AID;
@@ -518,7 +561,7 @@ int old,
 main()
 {
     int location;
 main()
 {
     int location;
-    int new;
+    char new;
     int c, c1;
 
     memset(Orders, 0, sizeof Orders);
     int c, c1;
 
     memset(Orders, 0, sizeof Orders);