Annotation of 43BSDTahoe/ucb/tn3270/ascii/termcodes.m4, revision 1.1.1.1

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

unix.superglobalmegacorp.com

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