home *** CD-ROM | disk | FTP | other *** search
- /*
- * @(#) termio.h 2.2 88/05/18
- *
- * Copyright (C) The Santa Cruz Operation, 1984, 1985, 1986, 1987, 1988.
- * Copyright (C) Microsoft Corporation, 1984, 1985, 1986, 1987, 1988.
- * This Module contains Proprietary Information of
- * The Santa Cruz Operation, Microsoft Corporation
- * and AT&T, and should be treated as Confidential.
- */
-
- /*
- * THIS FILE CONTAINS CODE WHICH IS DESIGNED TO BE
- * PORTABLE BETWEEN DIFFERENT MACHINE ARCHITECTURES
- * AND CONFIGURATIONS. IT SHOULD NOT REQUIRE ANY
- * MODIFICATIONS WHEN ADAPTING XENIX TO NEW HARDWARE.
- */
-
- #define IOCTYPE 0xff00
-
- #define TIOC ('T'<<8)
- #define TCGETA (TIOC|1)
- #define TCSETA (TIOC|2)
- #define TCSETAW (TIOC|3)
- #define TCSETAF (TIOC|4)
- #define TCSBRK (TIOC|5)
- #define TCXONC (TIOC|6)
- #define TCFLSH (TIOC|7)
-
- #define TCDSET (TIOC|32)
-
- #include "machdep.h"
-
- #define LDIOC ('D'<<8)
- #define LDOPEN (LDIOC|0)
- #define LDCLOSE (LDIOC|1)
- #define LDCHG (LDIOC|2)
- #define LDGETT (LDIOC|8)
- #define LDSETT (LDIOC|9)
-
- #define tIOC ('t'<<8)
- #define TIOCGETD (tIOC|0) /* V7 */
- #define TIOCSETD (tIOC|1) /* V7 */
- #define TIOCHPCL (tIOC|2) /* V7 */
- #define TIOCGETP (tIOC|8)
- #define TIOCSETP (tIOC|9)
- #define TIOCSETN (tIOC|10) /* V7 */
- #define TIOCEXCL (tIOC|13) /* V7 */
- #define TIOCNXCL (tIOC|14) /* V7 */
- #define TIOCFLUSH (tIOC|16) /* V7 */
- #define TIOCSETC (tIOC|17) /* V7 */
- #define TIOCGETC (tIOC|18) /* V7 */
-
- #define LIOC ('l'<<8)
- #define LIOCGETP (LIOC|1)
- #define LIOCSETP (LIOC|2)
- #define LIOCGETS (LIOC|5)
- #define LIOCSETS (LIOC|6)
-
- #define DIOC ('d'<<8)
- #define DIOCGETC (DIOC|1)
- #define DIOCGETB (DIOC|2)
- #define DIOCSETE (DIOC|3)
- #define DIOCGETP (DIOC|8) /* V7 */
- #define DIOCSETP (DIOC|9) /* V7 */
-
- #define VPM ('V'<<8)
- #define VPMCMD (VPM|8)
- #define VPMERRS (VPM|9)
- #define VPMRPT (VPM|10)
- #define VPMTRCO (VPM|16)
-
- #define FIOCLEX (('f'<<8)|1) /* V7 */
- #define FIONCLEX (('f'<<8)|2) /* V7 */
- #define FIORDCHK (('f'<<8)|3) /* V7 */
-
- #define NCC 8
-
- /* control characters */
- #define VINTR 0
- #define VQUIT 1
- #define VERASE 2
- #define VKILL 3
- #define VEOF 4
- #define VEOL 5
- #define VEOL2 6
- #define VMIN 4
- #define VTIME 5
- #define VSWTCH 7
- #define VCEOF NCC /* RESERVED true EOF char (V7 compatability) */
- #define VCEOL (NCC + 1) /* RESERVED true EOL char */
-
- #define CNUL 0
- #define CDEL 0377
- /* default control chars */
- #define CESC '\\'
- #define CINTR 0177 /* DEL */
- #define CQUIT 034 /* FS, cntl | */
- #define CERASE '\010' /* backsp */
- #define CKILL '\025' /* cntl u */
- #define CEOF 04 /* cntl d */
- #define CSTART 021 /* cntl q */
- #define CSTOP 023 /* cntl s */
- #define CSWTCH 032 /* cntl z */
- #define CNSWTCH 0
-
-
- /* input modes */
- #define IGNBRK 0000001
- #define BRKINT 0000002
- #define IGNPAR 0000004
- #define PARMRK 0000010
- #define INPCK 0000020
- #define ISTRIP 0000040
- #define INLCR 0000100
- #define IGNCR 0000200
- #define ICRNL 0000400
- #define IUCLC 0001000
- #define IXON 0002000
- #define IXANY 0004000
- #define IXOFF 0010000
- #ifdef VPIX
- #define DOSMODE 0100000
- #endif /* VPIX */
-
-
- /* output modes */
- #define OPOST 0000001
- #define OLCUC 0000002
- #define ONLCR 0000004
- #define OCRNL 0000010
- #define ONOCR 0000020
- #define ONLRET 0000040
- #define OFILL 0000100
- #define OFDEL 0000200
- #define NLDLY 0000400
- #define NL0 0
- #define NL1 0000400
- #define CRDLY 0003000
- #define CR0 0
- #define CR1 0001000
- #define CR2 0002000
- #define CR3 0003000
- #define TABDLY 0014000
- #define TAB0 0
- #define TAB1 0004000
- #define TAB2 0010000
- #define TAB3 0014000
- #define BSDLY 0020000
- #define BS0 0
- #define BS1 0020000
- #define VTDLY 0040000
- #define VT0 0
- #define VT1 0040000
- #define FFDLY 0100000
- #define FF0 0
- #define FF1 0100000
-
- /* control modes */
- #define CBAUD 0000017
- #define B0 0
- #define B50 0000001
- #define B75 0000002
- #define B110 0000003
- #define B134 0000004
- #define B150 0000005
- #define B200 0000006
- #define B300 0000007
- #define B600 0000010
- #define B1200 0000011
- #define B1800 0000012
- #define B2400 0000013
- #define B4800 0000014
- #define B9600 0000015
- #define EXTA 0000016
- #define B19200 0000016
- #define EXTB 0000017
- #define B38400 0000017
- #define CSIZE 0000060
- #define CS5 0
- #define CS6 0000020
- #define CS7 0000040
- #define CS8 0000060
- #define CSTOPB 0000100
- #define CREAD 0000200
- #define PARENB 0000400
- #define PARODD 0001000
- #define HUPCL 0002000
- #define CLOCAL 0004000
- #define LOBLK 0010000
- #define CTSFLOW 0020000
- #define RTSFLOW 0040000
-
- /* line discipline 0 modes */
- #define ISIG 0000001
- #define ICANON 0000002
- #define XCASE 0000004
- #define ECHO 0000010
- #define ECHOE 0000020
- #define ECHOK 0000040
- #define ECHONL 0000100
- #define NOFLSH 0000200
- #define XCLUDE 0100000 /* *V7* exclusive use */
-
- #define SSPEED 13 /* default speed: 7=300, 13=9600 baud */
-
- #ifdef M_I386
- #pragma pack(2)
- #endif
-
- /*
- * Ioctl control packet
- */
- struct termio {
- unsigned short c_iflag; /* input modes */
- unsigned short c_oflag; /* output modes */
- unsigned short c_cflag; /* control modes */
- unsigned short c_lflag; /* line discipline modes */
- char c_line; /* line discipline */
- unsigned char c_cc[NCC]; /* control chars */
- };
-
- /*
- * structure of ioctl arg for LDGETT and LDSETT
- */
- struct termcb {
- char st_flgs; /* term flags */
- char st_termt; /* term type */
- char st_crow; /* gtty only - current row */
- char st_ccol; /* gtty only - current col */
- char st_vrow; /* variable row */
- char st_lrow; /* last row */
- };
-
- #ifdef VPIX
-
- /*
- * structure of ioctl arg for AIOCSETSS
- */
-
- struct termss {
- char ss_start; /* output start char */
- char ss_stop; /* output stop char */
- };
-
- #endif
-
- #ifdef M_I386
- #pragma pack()
- #endif
-