* A clist structure is the head
* of a linked list queue of characters.
* The characters are stored in
* blocks containing a link and CBSIZE (param.h)
* characters. The routines getc, putc, ... in prim.c
* manipulate these structures.
int c_cc
; /* character count */
char *c_cf
; /* pointer to first char */
char *c_cl
; /* pointer to last char */
* A tty structure is needed for
* each UNIX character device that
* is used for normal terminal IO.
* The routines in tty.c handle the
* common code associated with
* these structures. The definition
* and device dependent code is in
* each driver. (cons.c, dh.c, dz.c, kl.c)
#define t_rawq t_nu.t_t.T_rawq /* raw characters or partial line */
#define t_canq t_nu.t_t.T_canq /* complete input lines */
#define t_bufp t_nu.t_n.T_bufp /* buffer allocated to protocol */
#define t_cp t_nu.t_n.T_cp /* pointer into the ripped off buffer */
#define t_inbuf t_nu.t_n.T_inbuf /* number chars in the buffer */
#define t_rec t_nu.t_n.T_rec /* have a complete record */
struct clist t_outq
; /* output list to device */
int (*t_oproc
)(); /* routine to start output */
int (*t_iproc
)(); /* routine to start input */
struct chan
*t_chan
; /* destination channel */
caddr_t t_linep
; /* aux line discipline pointer */
caddr_t t_addr
; /* device address */
dev_t t_dev
; /* device number */
short t_flags
; /* mode, settable by ioctl call */
short t_state
; /* internal state, not visible externally */
short t_pgrp
; /* process group name */
char t_delct
; /* number of delimiters in raw q */
char t_line
; /* line discipline */
char t_col
; /* printing column of device */
char t_erase
; /* erase character */
char t_kill
; /* kill character */
char t_char
; /* character temporary */
char t_ispeed
; /* input speed */
char t_ospeed
; /* output speed */
char t_rocount
; /* chars input since a ttwrite() */
char t_rocol
; /* t_col when first input this line */
struct ltchars t_lchr
; /* local special characters */
short t_local
; /* local mode word */
short t_lstate
; /* local state bits */
#define tun tp->t_un.t_chr
#define CTRL(c) ('c'&037)
/* default special characters */
#define CQUIT 034 /* FS, cntl shift L */
#define CINTR 0177 /* DEL */
short tthiwat
[NSPEEDS
], ttlowat
[NSPEEDS
];
#define TTHIWAT(tp) tthiwat[(tp)->t_ospeed&TTMASK]
#define TTLOWAT(tp) ttlowat[(tp)->t_ospeed&TTMASK]
/* internal state bits */
#define TIMEOUT 01 /* delay timeout in progress */
#define WOPEN 02 /* waiting for open to complete */
#define ISOPEN 04 /* device is open */
#define FLUSH 010 /* outq has been flushed during DMA */
#define CARR_ON 020 /* software copy of carrier-present */
#define BUSY 040 /* output in progress */
#define ASLEEP 0100 /* wakeup when output done */
#define XCLUDE 0200 /* exclusive-use flag against open */
#define TTSTOP 0400 /* output stopped by ctl-s */
#define HUPCLS 01000 /* hang up upon last close */
#define TBLOCK 02000 /* tandem queue blocked */
#define SPEEDS 04000 /* t_ispeed and t_ospeed used by driver */
#define PROTO1 010000 /* reserved for line discipline */
#define EXTPROC 020000 /* external processor (kmc) */
#define FSLEEP 040000 /* Wakeup on input framing */
#define CNTLQ 0100000 /* interpret t_un as clist */
/* define partab character types */
/* define dmctl actions */