Annotation of 43BSD/ucb/tn3270/termcodes.m4, revision 1.1

1.1     ! root        1: /*
        !             2:  *     Copyright 1984, 1985 by the Regents of the University of
        !             3:  *     California and by Gregory Glenn Minshall.
        !             4:  *
        !             5:  *     Permission to use, copy, modify, and distribute these
        !             6:  *     programs and their documentation for any purpose and
        !             7:  *     without fee is hereby granted, provided that this
        !             8:  *     copyright and permission appear on all copies and
        !             9:  *     supporting documentation, the name of the Regents of
        !            10:  *     the University of California not be used in advertising
        !            11:  *     or publicity pertaining to distribution of the programs
        !            12:  *     without specific prior permission, and notice be given in
        !            13:  *     supporting documentation that copying and distribution is
        !            14:  *     by permission of the Regents of the University of California
        !            15:  *     and by Gregory Glenn Minshall.  Neither the Regents of the
        !            16:  *     University of California nor Gregory Glenn Minshall make
        !            17:  *     representations about the suitability of this software
        !            18:  *     for any purpose.  It is provided "as is" without
        !            19:  *     express or implied warranty.
        !            20:  */
        !            21: 
        !            22: 
        !            23: /* the following allows us to generate our TC values.  it is a bit painful. */
        !            24: 
        !            25: define(TCvalue, 128)
        !            26: define(TCbump, `define(`TCvalue', eval(TCvalue+1))')
        !            27: define(TCdefine, ``#define'')
        !            28: define(TC, `TCdefine define(`TCstring', TC_$1) TCstring TCvalue TCbump `
        !            29:                'InitialAscii("$1", TCstring) InitialAids(ifelse($2,,0,0x$2))')
        !            30: define(Is, `TCdefine TC_$1 TCvalue')
        !            31: 
        !            32: #define IsTc(x) (((x)&0xff) >= TC_LOWEST)
        !            33: 
        !            34: /* This lists the codes which are output from termin() */
        !            35: 
        !            36: typedef char TC_Aids_t;
        !            37: 
        !            38: typedef struct {
        !            39:     char       *tc_name;               /* what the name is */
        !            40:     char       tc_value;               /* what the value is */
        !            41: } TC_Ascii_t;
        !            42: 
        !            43: typedef struct {
        !            44:     char       *tc_name;               /* what the name is */
        !            45:     char       tc_value;               /* what the value is */
        !            46:     char       tc_aid;                 /* what the AID is */
        !            47: } TC_AsciiAids_t;
        !            48: 
        !            49: #ifdef DEFINEAIDS
        !            50: #define InitialAids(x) x,
        !            51: #else
        !            52: #define InitialAids(x)
        !            53: #endif /* DEFINEAIDS */
        !            54: #ifdef LETS_SEE_ASCII
        !            55: #define InitialAscii(x, y) x, y,
        !            56: #else
        !            57: #define InitialAscii(x, y)
        !            58: #endif /* LETS_SEE_ASCII */
        !            59: 
        !            60: #ifdef LETS_SEE_ASCII
        !            61: #ifdef DEFINEAIDS
        !            62: static TC_AsciiAids_t TC_AsciiAids[] = {
        !            63: #else /* so, no aids */
        !            64: static TC_Ascii_t TC_Ascii[] = {
        !            65: #endif /* DEFINEAIDS */
        !            66: #else
        !            67: #ifdef DEFINEAIDS
        !            68: static TC_Aids_t TC_Aids[] = {
        !            69: #endif /* LETS_SEE_ASCII */
        !            70: #endif
        !            71: 
        !            72: Is(LOWEST)
        !            73: 
        !            74: /* the following are internal to the parser and generator */
        !            75: /* (and, generally, should not be specified by the user...) */
        !            76: TC(CALL)                       /* INT: call a state sequence */
        !            77: TC(RETURN)                     /* INT: return from TC_CALL */
        !            78: TC(GOTO)                       /* INT: goto next entry */
        !            79: TC(NULL)                       /* Illegal sequence; bell */
        !            80: TC(ATTN)                       /* attention generator */
        !            81: 
        !            82: 
        !            83: 
        !            84: Is(LOWEST_USER)                        /* lowest code settable by user */
        !            85: 
        !            86: TC(LPRT)                       /* local print */
        !            87: TC(DP)                         /* dup character */
        !            88: TC(FM)                         /* field mark character */
        !            89: TC(CURSEL)                     /* cursor select */
        !            90: TC(RESHOW)                     /* redisplay the screen */
        !            91: TC(EINP)                       /* erase input */
        !            92: TC(EEOF)                       /* erase end of field */
        !            93: TC(DELETE)                     /* delete character */
        !            94: TC(INSRT)                      /* toggle insert mode */
        !            95: TC(TAB)                                /* field tab */
        !            96: TC(BTAB)                       /* field back tab */
        !            97: TC(COLTAB)                     /* column tab */
        !            98: TC(COLBAK)                     /* column back tab */
        !            99: TC(INDENT)                     /* indent one tab stop */
        !           100: TC(UNDENT)                     /* undent one tab stop */
        !           101: TC(NL)                         /* new line */
        !           102: TC(HOME)                       /* home the cursor */
        !           103: TC(UP)                         /* up cursor */
        !           104: TC(DOWN)                       /* down cursor */
        !           105: TC(RIGHT)                      /* right cursor */
        !           106: TC(LEFT)                       /* left cursor */
        !           107: TC(SETTAB)                     /* set a column tab */
        !           108: TC(DELTAB)                     /* delete a column tab */
        !           109: TC(SETMRG)                     /* set left margin */
        !           110: TC(SETHOM)                     /* set home position */
        !           111: TC(CLRTAB)                     /* clear all column tabs */
        !           112: TC(APLON)                      /* apl on */
        !           113: TC(APLOFF)                     /* apl off */
        !           114: TC(APLEND)                     /* treat input as ascii */
        !           115: TC(PCON)                       /* xon/xoff on */
        !           116: TC(PCOFF)                      /* xon/xoff off */
        !           117: TC(DISC)                       /* disconnect (suspend) */
        !           118: TC(INIT)                       /* new terminal type */
        !           119: TC(ALTK)                       /* alternate keyboard dvorak */
        !           120: TC(FLINP)                      /* flush input */
        !           121: TC(ERASE)                      /* erase last character */
        !           122: TC(WERASE)                     /* erase last word */
        !           123: TC(FERASE)                     /* erase field */
        !           124: TC(SYNCH)                      /* user and us are in synch */
        !           125: TC(RESET)                      /* reset key -unlock keyboard */
        !           126: TC(MASTER_RESET)               /* master reset key; flush, reset, repaint */
        !           127: TC(XOFF)                       /* please hold output */
        !           128: TC(XON)                                /* please give me output */
        !           129: TC(ESCAPE)                     /* enter telnet command mode */
        !           130: TC(WORDTAB)                    /* Go to first character of next word */
        !           131: TC(WORDBACKTAB)                        /* Go to first character of last word */
        !           132: TC(WORDEND)                    /* Go to last character of this/next word */
        !           133: TC(FIELDEND)                   /* Go to last non-blank of this field */
        !           134: 
        !           135: 
        !           136: Is(LOWEST_AID)                 /* lowest attn generator */
        !           137: 
        !           138: /* the attention generating keys... */
        !           139: 
        !           140: TC(PA1,6c)                             /*  */
        !           141: TC(PA2,6e)                             /*  */
        !           142: TC(PA3,6b)                             /*  */
        !           143: TC(CLEAR,6d)                   /*  */
        !           144: TC(TREQ,f0)                            /*  */
        !           145: TC(ENTER,7d)                   /*  */
        !           146: TC(PFK1, f1)                           /*  */
        !           147: TC(PFK2, f2)                           /*  */
        !           148: TC(PFK3, f3)                           /*  */
        !           149: TC(PFK4, f4)                           /*  */
        !           150: TC(PFK5, f5)                           /*  */
        !           151: TC(PFK6, f6)                           /*  */
        !           152: TC(PFK7, f7)                           /*  */
        !           153: TC(PFK8, f8)                           /*  */
        !           154: TC(PFK9, f9)                           /*  */
        !           155: TC(PFK10, 7a)                  /*  */
        !           156: TC(PFK11, 7b)                  /*  */
        !           157: TC(PFK12, 7c)                  /*  */
        !           158: TC(PFK13, c1)                  /*  */
        !           159: TC(PFK14, c2)                  /*  */
        !           160: TC(PFK15, c3)                  /*  */
        !           161: TC(PFK16, c4)                  /*  */
        !           162: TC(PFK17, c5)                  /*  */
        !           163: TC(PFK18, c6)                  /*  */
        !           164: TC(PFK19, c7)                  /*  */
        !           165: TC(PFK20, c8)                  /*  */
        !           166: TC(PFK21, c9)                  /*  */
        !           167: TC(PFK22, 4a)                  /*  */
        !           168: TC(PFK23, 4b)                  /*  */
        !           169: TC(PFK24, 4c)                  /*  */
        !           170: TC(PFK25)                      /*  */
        !           171: TC(PFK26)                      /*  */
        !           172: TC(PFK27)                      /*  */
        !           173: TC(PFK28)                      /*  */
        !           174: TC(PFK29)                      /*  */
        !           175: TC(PFK30)                      /*  */
        !           176: TC(PFK31)                      /*  */
        !           177: TC(PFK32)                      /*  */
        !           178: TC(PFK33)                      /*  */
        !           179: TC(PFK34)                      /*  */
        !           180: TC(PFK35)                      /*  */
        !           181: TC(PFK36)                      /*  */
        !           182: 
        !           183: Is(HIGHEST_AID)-1                      /* highest AID value */
        !           184: #define IsAid(x)       (((x) >= TC_LOWEST_AID) && ((x) <= TC_HIGHEST_AID))
        !           185: 
        !           186: Is(HIGHEST)-1                  /* highest TC value */
        !           187: 
        !           188: #ifdef LETS_SEE_ASCII
        !           189: };
        !           190: #else
        !           191: #ifdef DEFINEAIDS
        !           192: };
        !           193: #endif
        !           194: #endif
        !           195: 
        !           196: #ifdef DEFINEAIDS
        !           197: #ifdef LETS_SEE_ASCII
        !           198: #define TCtoAid(x)     TC_AsciiAids[(x)-TC_LOWEST].tc_aid
        !           199: #else
        !           200: #define TCtoAid(x)     TC_Aids[x-TC_LOWEST]
        !           201: #endif
        !           202: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.