1139743Simp/*-
243412Snewton * Copyright (c) 1998 Mark Newton
343412Snewton * Copyright (c) 1994 Christos Zoulas
443412Snewton * All rights reserved.
543412Snewton *
643412Snewton * Redistribution and use in source and binary forms, with or without
743412Snewton * modification, are permitted provided that the following conditions
843412Snewton * are met:
943412Snewton * 1. Redistributions of source code must retain the above copyright
1043412Snewton *    notice, this list of conditions and the following disclaimer.
1143412Snewton * 2. Redistributions in binary form must reproduce the above copyright
1243412Snewton *    notice, this list of conditions and the following disclaimer in the
1343412Snewton *    documentation and/or other materials provided with the distribution.
1443412Snewton * 3. The name of the author may not be used to endorse or promote products
1543412Snewton *    derived from this software without specific prior written permission
1643412Snewton *
1743412Snewton * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1843412Snewton * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1943412Snewton * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2043412Snewton * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2143412Snewton * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2243412Snewton * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2343412Snewton * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2443412Snewton * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2543412Snewton * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2643412Snewton * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2749267Snewton *
2850477Speter * $FreeBSD$
2943412Snewton */
3043412Snewton
3143412Snewton#ifndef	_SVR4_TERMIOS_H_
3243412Snewton#define	_SVR4_TERMIOS_H_
3343412Snewton
3443412Snewton#define SVR4_POSIX_VDISABLE	0
3543412Snewton#define	SVR4_NCC	 	8
3643412Snewton#define	SVR4_NCCS		19
3743412Snewton
3843412Snewtontypedef u_long	svr4_tcflag_t;
3943412Snewtontypedef u_char	svr4_cc_t;
4043412Snewtontypedef u_long	svr4_speed_t;
4143412Snewton
4243412Snewtonstruct svr4_termios {
4343412Snewton	svr4_tcflag_t	c_iflag;
4443412Snewton	svr4_tcflag_t	c_oflag;
4543412Snewton	svr4_tcflag_t	c_cflag;
4643412Snewton	svr4_tcflag_t	c_lflag;
4743412Snewton	svr4_cc_t	c_cc[SVR4_NCCS];
4843412Snewton};
4943412Snewton
5043412Snewtonstruct svr4_termio {
5143412Snewton	u_short		c_iflag;
5243412Snewton	u_short		c_oflag;
5343412Snewton	u_short		c_cflag;
5443412Snewton	u_short		c_lflag;
5543412Snewton	char		c_line;
5643412Snewton	u_char		c_cc[SVR4_NCC];
5743412Snewton};
5843412Snewton
5943412Snewton/* control characters */
6043412Snewton#define	SVR4_VINTR	0
6143412Snewton#define	SVR4_VQUIT	1
6243412Snewton#define	SVR4_VERASE	2
6343412Snewton#define	SVR4_VKILL	3
6443412Snewton#define	SVR4_VEOF	4
6543412Snewton#define	SVR4_VEOL	5
6643412Snewton#define	SVR4_VEOL2	6
6743412Snewton#define	SVR4_VMIN	4
6843412Snewton#define	SVR4_VTIME	5
6943412Snewton#define	SVR4_VSWTCH	7
7043412Snewton#define	SVR4_VSTART	8
7143412Snewton#define	SVR4_VSTOP	9
7243412Snewton#define	SVR4_VSUSP	10
7343412Snewton#define	SVR4_VDSUSP	11
7443412Snewton#define	SVR4_VREPRINT	12
7543412Snewton#define	SVR4_VDISCARD	13
7643412Snewton#define	SVR4_VWERASE	14
7743412Snewton#define	SVR4_VLNEXT	15
7843412Snewton
7943412Snewton/* Input modes */
8043412Snewton#define	SVR4_IGNBRK	00000001
8143412Snewton#define	SVR4_BRKINT	00000002
8243412Snewton#define	SVR4_IGNPAR	00000004
8343412Snewton#define	SVR4_PARMRK	00000010
8443412Snewton#define	SVR4_INPCK	00000020
8543412Snewton#define	SVR4_ISTRIP	00000040
8643412Snewton#define	SVR4_INLCR	00000100
8743412Snewton#define	SVR4_IGNCR	00000200
8843412Snewton#define	SVR4_ICRNL	00000400
8943412Snewton#define	SVR4_IUCLC	00001000
9043412Snewton#define	SVR4_IXON	00002000
9143412Snewton#define	SVR4_IXANY	00004000
9243412Snewton#define	SVR4_IXOFF	00010000
9343412Snewton#define SVR4_IMAXBEL	00020000
9443412Snewton#define SVR4_DOSMODE	00100000
9543412Snewton
9643412Snewton/* Output modes */
9743412Snewton#define	SVR4_OPOST	00000001
9843412Snewton#define	SVR4_OLCUC	00000002
9943412Snewton#define	SVR4_ONLCR	00000004
10043412Snewton#define	SVR4_OCRNL	00000010
10143412Snewton#define	SVR4_ONOCR	00000020
10243412Snewton#define	SVR4_ONLRET	00000040
10343412Snewton#define	SVR4_OFILL	00000100
10443412Snewton#define	SVR4_OFDEL	00000200
10543412Snewton#define	SVR4_NLDLY	00000400
10643412Snewton#define	SVR4_NL0	00000000
10743412Snewton#define	SVR4_NL1	00000400
10843412Snewton#define	SVR4_CRDLY	00003000
10943412Snewton#define	SVR4_CR0	00000000
11043412Snewton#define	SVR4_CR1	00001000
11143412Snewton#define	SVR4_CR2	00002000
11243412Snewton#define	SVR4_CR3	00003000
11343412Snewton#define	SVR4_TABDLY	00014000
11443412Snewton#define	SVR4_TAB0	00000000
11543412Snewton#define	SVR4_TAB1	00004000
11643412Snewton#define	SVR4_TAB2	00010000
11743412Snewton#define	SVR4_TAB3	00014000
11843412Snewton#define SVR4_XTABS	00014000
11943412Snewton#define	SVR4_BSDLY	00020000
12043412Snewton#define	SVR4_BS0	00000000
12143412Snewton#define	SVR4_BS1	00020000
12243412Snewton#define	SVR4_VTDLY	00040000
12343412Snewton#define	SVR4_VT0	00000000
12443412Snewton#define	SVR4_VT1	00040000
12543412Snewton#define	SVR4_FFDLY	00100000
12643412Snewton#define	SVR4_FF0	00000000
12743412Snewton#define	SVR4_FF1	00100000
12843412Snewton#define SVR4_PAGEOUT	00200000
12943412Snewton#define SVR4_WRAP	00400000
13043412Snewton
13143412Snewton/* Control modes */
13243412Snewton#define	SVR4_CBAUD	00000017
13343412Snewton#define	SVR4_CSIZE	00000060
13443412Snewton#define	SVR4_CS5	00000000
13543412Snewton#define	SVR4_CS6	00000200
13643412Snewton#define	SVR4_CS7	00000040
13743412Snewton#define	SVR4_CS8	00000006
13843412Snewton#define	SVR4_CSTOPB	00000100
13943412Snewton#define	SVR4_CREAD	00000200
14043412Snewton#define	SVR4_PARENB	00000400
14143412Snewton#define	SVR4_PARODD	00001000
14243412Snewton#define	SVR4_HUPCL	00002000
14343412Snewton#define	SVR4_CLOCAL	00004000
14443412Snewton#define SVR4_RCV1EN	00010000
14543412Snewton#define	SVR4_XMT1EN	00020000
14643412Snewton#define	SVR4_LOBLK	00040000
14743412Snewton#define	SVR4_XCLUDE	00100000
14843412Snewton#define SVR4_CIBAUD	03600000
14943412Snewton#define SVR4_PAREXT	04000000
15043412Snewton
15143412Snewton/* line discipline modes */
15243412Snewton#define	SVR4_ISIG	00000001
15343412Snewton#define	SVR4_ICANON	00000002
15443412Snewton#define	SVR4_XCASE	00000004
15543412Snewton#define	SVR4_ECHO	00000010
15643412Snewton#define	SVR4_ECHOE	00000020
15743412Snewton#define	SVR4_ECHOK	00000040
15843412Snewton#define	SVR4_ECHONL	00000100
15943412Snewton#define	SVR4_NOFLSH	00000200
16043412Snewton#define	SVR4_TOSTOP	00000400
16143412Snewton#define	SVR4_ECHOCTL	00001000
16243412Snewton#define	SVR4_ECHOPRT	00002000
16343412Snewton#define	SVR4_ECHOKE	00004000
16443412Snewton#define	SVR4_DEFECHO	00010000
16543412Snewton#define	SVR4_FLUSHO	00020000
16643412Snewton#define	SVR4_PENDIN	00040000
16743412Snewton#define	SVR4_IEXTEN	00100000
16843412Snewton
16943412Snewton#define	SVR4_TIOC	('T' << 8)
17043412Snewton
17143412Snewton#define	SVR4_TCGETA	(SVR4_TIOC| 1)
17243412Snewton#define	SVR4_TCSETA	(SVR4_TIOC| 2)
17343412Snewton#define	SVR4_TCSETAW	(SVR4_TIOC| 3)
17443412Snewton#define	SVR4_TCSETAF	(SVR4_TIOC| 4)
17543412Snewton#define	SVR4_TCSBRK	(SVR4_TIOC| 5)
17643412Snewton#define	SVR4_TCXONC	(SVR4_TIOC| 6)
17743412Snewton#define	SVR4_TCFLSH	(SVR4_TIOC| 7)
17843412Snewton#define SVR4_TIOCKBON	(SVR4_TIOC| 8)
17943412Snewton#define SVR4_TIOCKBOF 	(SVR4_TIOC| 9)
18043412Snewton#define SVR4_KBENABLED 	(SVR4_TIOC|10)
18143412Snewton#define SVR4_TCGETS	(SVR4_TIOC|13)
18243412Snewton#define SVR4_TCSETS	(SVR4_TIOC|14)
18343412Snewton#define SVR4_TCSETSW	(SVR4_TIOC|15)
18443412Snewton#define	SVR4_TCSETSF	(SVR4_TIOC|16)
18543412Snewton#define	SVR4_TCDSET	(SVR4_TIOC|32)
18643412Snewton#define	SVR4_RTS_TOG	(SVR4_TIOC|33)
18743412Snewton#define SVR4_TCGETSC	(SVR4_TIOC|34)
18843412Snewton#define SVR4_TCSETSC	(SVR4_TIOC|35)
18943412Snewton#define	SVR4_TCMOUSE	(SVR4_TIOC|36)
19043412Snewton#define SVR4_TIOCGWINSZ	(SVR4_TIOC|104)
19143412Snewton#define SVR4_TIOCSWINSZ	(SVR4_TIOC|103)
19243412Snewton
19343412Snewtonstruct svr4_winsize {
19443412Snewton	u_short	ws_row;
19543412Snewton	u_short	ws_col;
19643412Snewton	u_short	ws_xpixel;
19743412Snewton	u_short	ws_ypixel;
19843412Snewton};
19943412Snewton
20043412Snewton#define	SVR4_B0		0
20143412Snewton#define	SVR4_B50	1
20243412Snewton#define	SVR4_B75	2
20343412Snewton#define	SVR4_B110	3
20443412Snewton#define	SVR4_B134	4
20543412Snewton#define	SVR4_B150	5
20643412Snewton#define	SVR4_B200	6
20743412Snewton#define	SVR4_B300	7
20843412Snewton#define	SVR4_B600	8
20943412Snewton#define	SVR4_B1200	9
21043412Snewton#define	SVR4_B1800	10
21143412Snewton#define	SVR4_B2400	11
21243412Snewton#define	SVR4_B4800	12
21343412Snewton#define	SVR4_B9600	13
21443412Snewton#define	SVR4_B19200	14
21543412Snewton#define	SVR4_B38400	15
21643412Snewton#define	SVR4_B57600	16
21743412Snewton#define	SVR4_B76800	17
21843412Snewton#define	SVR4_B115200	18
21943412Snewton#define	SVR4_B153600	19
22043412Snewton#define	SVR4_B230400	20
22143412Snewton#define	SVR4_B307200	21
22243412Snewton#define	SVR4_B460800	22
22343412Snewton
22443412Snewton#endif /* !_SVR4_TERMIOS_H_ */
225