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

Defined struct's

clist defined in line 9; used 48 times
tc defined in line 27; used 6 times
ttiocb defined in line 69; used 2 times
tty defined in line 36; used 148 times

Defined macros

ASLEEP defined in line 120; used 8 times
BUSY defined in line 119; used 11 times
CARR_ON defined in line 118; used 24 times
CBREAK defined in line 96; used 6 times
CBRK defined in line 87; used 1 times
CEOT defined in line 81; used 2 times
CERASE defined in line 80; used 2 times
CINTR defined in line 84; used 1 times
CKILL defined in line 82; used 2 times
CNTLQ defined in line 129; never used
CQUIT defined in line 83; used 1 times
CRDELAY defined in line 106; never used
CRMOD defined in line 99; used 3 times
CSTART defined in line 86; used 1 times
CSTOP defined in line 85; used 1 times
DIOCGETP defined in line 154; used 2 times
DIOCLOSE defined in line 156; never used
DIOCLSTN defined in line 147; never used
DIOCMPX defined in line 149; never used
DIOCNMPX defined in line 150; never used
DIOCNTRL defined in line 148; never used
DIOCPGRP defined in line 153; never used
DIOCRCALL defined in line 152; never used
DIOCRESET defined in line 158; never used
DIOCSCALL defined in line 151; never used
DIOCSETP defined in line 155; never used
DIOCTIME defined in line 157; never used
DKCALL defined in line 127; never used
DKCMD defined in line 125; never used
DKLINGR defined in line 128; never used
DKMPX defined in line 126; never used
DONE defined in line 110; used 4 times
ECHO defined in line 98; used 5 times
EVENP defined in line 102; used 13 times
FIOCLEX defined in line 159; used 1 times
FIONCLEX defined in line 160; used 1 times
FLUSH defined in line 117; used 3 times
HUPCLS defined in line 123; used 6 times
IENABLE defined in line 111; used 13 times
ISOPEN defined in line 116; used 12 times
LCASE defined in line 97; used 4 times
MXLSTN defined in line 161; never used
MXNBLK defined in line 162; never used
NLDELAY defined in line 103; never used
ODDP defined in line 101; used 10 times
RAW defined in line 100; used 16 times
TANDEM defined in line 95; used 3 times
TBDELAY defined in line 104; used 1 times
TBLOCK defined in line 124; used 4 times
TIMEOUT defined in line 114; used 8 times
TIOCEXCL defined in line 142; never used
TIOCFLUSH defined in line 144; never used
TIOCGETC defined in line 146; never used
TIOCGETD defined in line 134; never used
TIOCGETP defined in line 139; used 1 times
TIOCHPCL defined in line 136; never used
TIOCMODG defined in line 137; never used
TIOCMODS defined in line 138; never used
TIOCNXCL defined in line 143; never used
TIOCSETC defined in line 145; never used
TIOCSETD defined in line 135; never used
TIOCSETN defined in line 141; used 2 times
TIOCSETP defined in line 140; used 4 times
TTHIWAT defined in line 90; used 1 times
TTIPRI defined in line 77; used 9 times
TTLOWAT defined in line 91; used 4 times
TTOPRI defined in line 78; used 6 times
TTSTOP defined in line 122; used 9 times
TTYHOG defined in line 92; used 4 times
VTDELAY defined in line 107; used 1 times
WOPEN defined in line 115; used 10 times
XCLUDE defined in line 121; used 4 times
XTABS defined in line 105; used 2 times
tun defined in line 64; used 20 times

Usage of this include

Last modified: 1979-05-12
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1116
Valid CSS Valid XHTML 1.0 Strict