Annotation of 3BSD/sys/h/tty.h, revision 1.1.1.1

1.1       root        1: /*     tty.h   2.1     1/5/80  */
                      2: /*
                      3:  * A clist structure is the head
                      4:  * of a linked list queue of characters.
                      5:  * The characters are stored in 4-word
                      6:  * blocks containing a link and several characters.
                      7:  * The routines getc and putc
                      8:  * manipulate these structures.
                      9:  */
                     10: struct clist
                     11: {
                     12:        int     c_cc;           /* character count */
                     13:        char    *c_cf;          /* pointer to first char */
                     14:        char    *c_cl;          /* pointer to last char */
                     15: };
                     16: 
                     17: /*
                     18:  * A tty structure is needed for
                     19:  * each UNIX character device that
                     20:  * is used for normal terminal IO.
                     21:  * The routines in tty.c handle the
                     22:  * common code associated with
                     23:  * these structures.
                     24:  * The definition and device dependent
                     25:  * code is in each driver. (kl.c dz.c)
                     26:  */
                     27: 
                     28: struct tc {
                     29:        char    t_intrc;        /* interrupt */
                     30:        char    t_quitc;        /* quit */
                     31:        char    t_startc;       /* start output */
                     32:        char    t_stopc;        /* stop output */
                     33:        char    t_eofc;         /* end-of-file */
                     34:        char    t_brkc;         /* input delimiter (like nl) */
                     35: };
                     36: 
                     37: struct tty
                     38: {
                     39:        struct  clist t_rawq;   /* input chars right off device */
                     40:        struct  clist t_canq;   /* input chars after erase and kill */
                     41:        struct  clist t_outq;   /* output list to device */
                     42:        int     (* t_oproc)();  /* routine to start output */
                     43:        int     (* t_iproc)();  /* routine to start input */
                     44:        struct chan *t_chan;    /* destination channel */
                     45:        caddr_t t_linep;        /* aux line discipline pointer */
                     46:        caddr_t t_addr;         /* device address */
                     47:        dev_t   t_dev;          /* device number */
                     48:        short   t_flags;        /* mode, settable by ioctl call */
                     49:        short   t_state;        /* internal state, not visible externally */
                     50:        short   t_pgrp;         /* process group name */
                     51:        char    t_delct;        /* number of delimiters in raw q */
                     52:        char    t_line;         /* line discipline */
                     53:        char    t_col;          /* printing column of device */
                     54:        char    t_erase;        /* erase character */
                     55:        char    t_kill;         /* kill character */
                     56:        char    t_char;         /* character temporary */
                     57:        char    t_ispeed;       /* input speed */
                     58:        char    t_ospeed;       /* output speed */
                     59:        union {
                     60:                struct tc t_chr;
                     61:                struct clist t_ctlq;
                     62:        } t_un;
                     63: };
                     64: 
                     65: #define        tun     tp->t_un.t_chr
                     66: 
                     67: /*
                     68:  * structure of arg for ioctl
                     69:  */
                     70: struct ttiocb {
                     71:        char    ioc_ispeed;
                     72:        char    ioc_ospeed;
                     73:        char    ioc_erase;
                     74:        char    ioc_kill;
                     75:        short   ioc_flags;
                     76: };
                     77: 
                     78: #define        TTIPRI  28
                     79: #define        TTOPRI  29
                     80: 
                     81: #define        CERASE  '#'             /* default special characters */
                     82: #define        CEOT    004
                     83: #define        CKILL   '@'
                     84: #define        CQUIT   034             /* FS, cntl shift L */
                     85: #define        CINTR   0177            /* DEL */
                     86: #define        CSTOP   023             /* Stop output: ctl-s */
                     87: #define        CSTART  021             /* Start output: ctl-q */
                     88: #define        CBRK    0377
                     89: 
                     90: /* limits */
                     91: #define        TTHIWAT 650
                     92: #define        TTLOWAT 125
                     93: #define        TTYHOG  256
                     94: 
                     95: /* modes */
                     96: #define        TANDEM  01
                     97: #define        CBREAK  02
                     98: #define        LCASE   04
                     99: #define        ECHO    010
                    100: #define        CRMOD   020
                    101: #define        RAW     040
                    102: #define        ODDP    0100
                    103: #define        EVENP   0200
                    104: #define        NLDELAY 001400
                    105: #define        TBDELAY 006000
                    106: #define        XTABS   006000
                    107: #define        CRDELAY 030000
                    108: #define        VTDELAY 040000
                    109: 
                    110: /* Hardware bits */
                    111: #define        DONE    0200
                    112: #define        IENABLE 0100
                    113: 
                    114: /* Internal state bits */
                    115: #define        TIMEOUT 01              /* Delay timeout in progress */
                    116: #define        WOPEN   02              /* Waiting for open to complete */
                    117: #define        ISOPEN  04              /* Device is open */
                    118: #define        FLUSH   010             /* outq has been flushed during DMA */
                    119: #define        CARR_ON 020             /* Software copy of carrier-present */
                    120: #define        BUSY    040             /* Output in progress */
                    121: #define        ASLEEP  0100            /* Wakeup when output done */
                    122: #define        XCLUDE  0200            /* exclusive-use flag against open */
                    123: #define        TTSTOP  0400            /* Output stopped by ctl-s */
                    124: #define        HUPCLS  01000           /* Hang up upon last close */
                    125: #define        TBLOCK  02000           /* tandem queue blocked */
                    126: #define        SPEEDS  04000           /* t_ispeed and t_ospeed used by driver */
                    127: #define        PROTO1  010000          /* reserved for line discipline */
                    128: #define        EXTPROC 020000          /* external processor (kmc) */
                    129: #define        FSLEEP  040000          /* Wakeup on input framing */
                    130: #define        CNTLQ   0100000         /* interpret t_un as clist */
                    131: 
                    132: /*
                    133:  * tty ioctl commands
                    134:  */
                    135: #define        TIOCGETD        (('t'<<8)|0)
                    136: #define        TIOCSETD        (('t'<<8)|1)
                    137: #define        TIOCHPCL        (('t'<<8)|2)
                    138: #define        TIOCMODG        (('t'<<8)|3)
                    139: #define        TIOCMODS        (('t'<<8)|4)
                    140: #define        TIOCGETP        (('t'<<8)|8)
                    141: #define        TIOCSETP        (('t'<<8)|9)
                    142: #define        TIOCSETN        (('t'<<8)|10)
                    143: #define        TIOCEXCL        (('t'<<8)|13)
                    144: #define        TIOCNXCL        (('t'<<8)|14)
                    145: #define        TIOCFLUSH       (('t'<<8)|16)
                    146: #define        TIOCSETC        (('t'<<8)|17)
                    147: #define        TIOCGETC        (('t'<<8)|18)
                    148: #define        TIOCSBRK        (('t'<<8)|19)
                    149: #define        DIOCLSTN        (('d'<<8)|1)
                    150: #define        DIOCNTRL        (('d'<<8)|2)
                    151: #define        DIOCMPX         (('d'<<8)|3)
                    152: #define        DIOCNMPX        (('d'<<8)|4)
                    153: #define        DIOCSCALL       (('d'<<8)|5)
                    154: #define        DIOCRCALL       (('d'<<8)|6)
                    155: #define        DIOCPGRP        (('d'<<8)|7)
                    156: #define        DIOCGETP        (('d'<<8)|8)
                    157: #define        DIOCSETP        (('d'<<8)|9)
                    158: #define        DIOCLOSE        (('d'<<8)|10)
                    159: #define        DIOCTIME        (('d'<<8)|11)
                    160: #define        DIOCRESET       (('d'<<8)|12)
                    161: #define        DIOCSMETA       (('d'<<8)|13)
                    162: #define        DIOCMERGE       (('d'<<8)|14)
                    163: #define        DIOCICHAN       (('d'<<8)|15)
                    164: #define        DIOCPAD         (('d'<<8)|16)
                    165: #define        DIOCRMETA       (('d'<<8)|17)
                    166: #define        DIOCXOUT        (('d'<<8)|18)
                    167: #define        DIOCBMETA       (('d'<<8)|19)
                    168: #define        DIOCAMETA       (('d'<<8)|20)
                    169: #define        DIOCSBMETA      (('d'<<8)|21)
                    170: #define        FIOCLEX         (('f'<<8)|1)
                    171: #define        FIONCLEX        (('f'<<8)|2)
                    172: #define        MXLSTN          (('x'<<8)|1)
                    173: #define        MXNBLK          (('x'<<8)|2)

unix.superglobalmegacorp.com

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