17c478bdstevel@tonic-gate/*
27c478bdstevel@tonic-gate * CDDL HEADER START
37c478bdstevel@tonic-gate *
47c478bdstevel@tonic-gate * The contents of this file are subject to the terms of the
57c478bdstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only
67c478bdstevel@tonic-gate * (the "License").  You may not use this file except in compliance
77c478bdstevel@tonic-gate * with the License.
87c478bdstevel@tonic-gate *
97c478bdstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bdstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
117c478bdstevel@tonic-gate * See the License for the specific language governing permissions
127c478bdstevel@tonic-gate * and limitations under the License.
137c478bdstevel@tonic-gate *
147c478bdstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
157c478bdstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bdstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
177c478bdstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
187c478bdstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bdstevel@tonic-gate *
207c478bdstevel@tonic-gate * CDDL HEADER END
217c478bdstevel@tonic-gate */
227c478bdstevel@tonic-gate/*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
23b4203d7Marcel Telka/*	  All Rights Reserved	*/
247c478bdstevel@tonic-gate
257c478bdstevel@tonic-gate/*
267c478bdstevel@tonic-gate * University Copyright- Copyright (c) 1982, 1986, 1988
277c478bdstevel@tonic-gate * The Regents of the University of California
287c478bdstevel@tonic-gate * All Rights Reserved
297c478bdstevel@tonic-gate *
307c478bdstevel@tonic-gate * University Acknowledgment- Portions of this document are derived from
317c478bdstevel@tonic-gate * software developed by the University of California, Berkeley, and its
327c478bdstevel@tonic-gate * contributors.
337c478bdstevel@tonic-gate */
347c478bdstevel@tonic-gate
357c478bdstevel@tonic-gate#ifndef _SYS_TTOLD_H
367c478bdstevel@tonic-gate#define	_SYS_TTOLD_H
377c478bdstevel@tonic-gate
387c478bdstevel@tonic-gate#ifdef	__cplusplus
397c478bdstevel@tonic-gateextern "C" {
407c478bdstevel@tonic-gate#endif
417c478bdstevel@tonic-gate
427c478bdstevel@tonic-gate/* All the ioctls (BSD, V7, XENIX, S5) defines are in termios.h */
437c478bdstevel@tonic-gate/* this file has mostly BSD structures and flags */
447c478bdstevel@tonic-gate
457c478bdstevel@tonic-gate/* BSD special characters. Structure for TIOCSTC/TIOCGTC */
467c478bdstevel@tonic-gatestruct tchars {
477c478bdstevel@tonic-gate	char	t_intrc;	/* interrupt */
487c478bdstevel@tonic-gate	char	t_quitc;	/* quit */
497c478bdstevel@tonic-gate	char	t_startc;	/* start output */
507c478bdstevel@tonic-gate	char	t_stopc;	/* stop output */
517c478bdstevel@tonic-gate	char	t_eofc;		/* end-of-file */
527c478bdstevel@tonic-gate	char	t_brkc;		/* input delimiter (like nl) */
537c478bdstevel@tonic-gate};
547c478bdstevel@tonic-gate
557c478bdstevel@tonic-gate/* note xenix defines tchars as tc */
567c478bdstevel@tonic-gatestruct tc {
577c478bdstevel@tonic-gate	char	t_intrc;	/* interrupt */
587c478bdstevel@tonic-gate	char	t_quitc;	/* quit */
597c478bdstevel@tonic-gate	char	t_startc;	/* start output */
607c478bdstevel@tonic-gate	char	t_stopc;	/* stop output */
617c478bdstevel@tonic-gate	char	t_eofc;		/* end-of-file */
627c478bdstevel@tonic-gate	char	t_brkc;		/* input delimiter (like nl) */
637c478bdstevel@tonic-gate};
647c478bdstevel@tonic-gate
657c478bdstevel@tonic-gate#ifndef _SGTTY_H
667c478bdstevel@tonic-gate/*
677c478bdstevel@tonic-gate * Structure for TIOCGETP and TIOCSETP ioctls.
687c478bdstevel@tonic-gate */
697c478bdstevel@tonic-gate
707c478bdstevel@tonic-gate/*  sg_flags value changed from short (in SUN/BSD) to int in System V to */
717c478bdstevel@tonic-gate/*  match sgtty.h definition */
727c478bdstevel@tonic-gatestruct	sgttyb {
737c478bdstevel@tonic-gate	char	sg_ispeed;		/* input speed */
747c478bdstevel@tonic-gate	char	sg_ospeed;		/* output speed */
757c478bdstevel@tonic-gate	char	sg_erase;		/* erase character */
767c478bdstevel@tonic-gate	char	sg_kill;		/* kill character */
777c478bdstevel@tonic-gate	int	sg_flags;		/* mode flags */
787c478bdstevel@tonic-gate};
797c478bdstevel@tonic-gate
807c478bdstevel@tonic-gate/* BSD local special chars. Structure for TIOCSLTC/TIOCGLTC */
817c478bdstevel@tonic-gatestruct ltchars {
827c478bdstevel@tonic-gate	char	t_suspc;	/* stop process signal */
837c478bdstevel@tonic-gate	char	t_dsuspc;	/* delayed stop process signal */
847c478bdstevel@tonic-gate	char	t_rprntc;	/* reprint line */
857c478bdstevel@tonic-gate	char	t_flushc;	/* flush output (toggles) */
867c478bdstevel@tonic-gate	char	t_werasc;	/* word erase */
877c478bdstevel@tonic-gate	char	t_lnextc;	/* literal next character */
887c478bdstevel@tonic-gate};
897c478bdstevel@tonic-gate#endif /* _SGTTY_H */
907c478bdstevel@tonic-gate
917c478bdstevel@tonic-gate/*
927c478bdstevel@tonic-gate * 4.3BSD/XENIX tty ioctl commands that are either:
937c478bdstevel@tonic-gate *  1) deprecated
947c478bdstevel@tonic-gate *  2) not implemented (and never were implemented)
957c478bdstevel@tonic-gate *  3) implemented on top of new-style "ioctl"s.
967c478bdstevel@tonic-gate */
977c478bdstevel@tonic-gate
987c478bdstevel@tonic-gate/*
997c478bdstevel@tonic-gate * These ioctls are also defined in termios.h.
1007c478bdstevel@tonic-gate * because XENIX expects to see them in termio.h
1017c478bdstevel@tonic-gate */
1027c478bdstevel@tonic-gate
1037c478bdstevel@tonic-gate#ifndef tIOC
1047c478bdstevel@tonic-gate#define	tIOC	('t'<<8)
1057c478bdstevel@tonic-gate#endif
1067c478bdstevel@tonic-gate
1077c478bdstevel@tonic-gate#ifndef _SYS_TERMIOS_H
1087c478bdstevel@tonic-gate/* defined in termios.h also so that all the ioctl codes are visible */
1097c478bdstevel@tonic-gate
1107c478bdstevel@tonic-gate#define	TIOCGETD	(tIOC|0)
1117c478bdstevel@tonic-gate#define	TIOCSETD	(tIOC|1)
1127c478bdstevel@tonic-gate#ifndef _SGTTY_H
1137c478bdstevel@tonic-gate#define	TIOCHPCL	(tIOC|2)
1147c478bdstevel@tonic-gate#define	TIOCGETP	(tIOC|8)
1157c478bdstevel@tonic-gate#define	TIOCSETP  	(tIOC|9)
1167c478bdstevel@tonic-gate#endif /* _SGTTY_H */
1177c478bdstevel@tonic-gate#define	TIOCSETN	(tIOC|10)
1187c478bdstevel@tonic-gate#ifndef _SGTTY_H
1197c478bdstevel@tonic-gate#define	TIOCEXCL	(tIOC|13)
1207c478bdstevel@tonic-gate#define	TIOCNXCL	(tIOC|14)
1217c478bdstevel@tonic-gate#endif /* _SGTTY_H */
1227c478bdstevel@tonic-gate#define	TIOCFLUSH	(tIOC|16)
1237c478bdstevel@tonic-gate#define	TIOCSETC	(tIOC|17)
1247c478bdstevel@tonic-gate#define	TIOCGETC	(tIOC|18)
1257c478bdstevel@tonic-gate
1267c478bdstevel@tonic-gate/* BSD ioctls that are not the same as XENIX */
1277c478bdstevel@tonic-gate#define	TIOCLBIS	(tIOC|127)	/* bis local mode bits */
1287c478bdstevel@tonic-gate#define	TIOCLBIC	(tIOC|126)	/* bic local mode bits */
1297c478bdstevel@tonic-gate#define	TIOCLSET	(tIOC|125)	/* set entire local mode word */
1307c478bdstevel@tonic-gate#define	TIOCLGET	(tIOC|124)	/* get local modes */
1317c478bdstevel@tonic-gate#define	TIOCSBRK	(tIOC|123)	/* set break bit */
1327c478bdstevel@tonic-gate#define	TIOCCBRK	(tIOC|122)	/* clear break bit */
1337c478bdstevel@tonic-gate#define	TIOCSDTR	(tIOC|121)	/* set data terminal ready */
1347c478bdstevel@tonic-gate#define	TIOCCDTR	(tIOC|120)	/* clear data terminal ready */
1357c478bdstevel@tonic-gate#define	TIOCSLTC	(tIOC|117)	/* set local special chars */
1367c478bdstevel@tonic-gate#define	TIOCGLTC	(tIOC|116)	/* get local special chars */
1377c478bdstevel@tonic-gate#define	TIOCOUTQ	(tIOC|115)	/* driver output queue size */
1387c478bdstevel@tonic-gate#define	TIOCNOTTY	(tIOC|113)	/* void tty association */
1397c478bdstevel@tonic-gate#define	TIOCSTOP	(tIOC|111)	/* stop output, like ^S */
1407c478bdstevel@tonic-gate#define	TIOCSTART	(tIOC|110)	/* start output, like ^Q */
1417c478bdstevel@tonic-gate
1427c478bdstevel@tonic-gate#define	TIOCREMOTE	(tIOC|30)	/* remote input editing */
1437c478bdstevel@tonic-gate
1447c478bdstevel@tonic-gate/* windowing ioctls and structure also defined in termios.h */
1457c478bdstevel@tonic-gate
1467c478bdstevel@tonic-gate#ifndef	_TIOC
1477c478bdstevel@tonic-gate#define	_TIOC	('T'<<8)
1487c478bdstevel@tonic-gate#endif
1497c478bdstevel@tonic-gate
1507c478bdstevel@tonic-gate#define	TIOCGWINSZ (_TIOC|104)
1517c478bdstevel@tonic-gate#define	TIOCSWINSZ (_TIOC|103)
1527c478bdstevel@tonic-gate
1537c478bdstevel@tonic-gate/* Windowing structure to support TIOCSWINSZ/TIOCGWINSZ */
1547c478bdstevel@tonic-gatestruct winsize {
1557c478bdstevel@tonic-gate	unsigned short ws_row;		/* rows, in characters */
1567c478bdstevel@tonic-gate	unsigned short ws_col;		/* columns, in character */
1577c478bdstevel@tonic-gate	unsigned short ws_xpixel;	/* horizontal size, pixels */
1587c478bdstevel@tonic-gate	unsigned short ws_ypixel;	/* vertical size, pixels */
1597c478bdstevel@tonic-gate};
1607c478bdstevel@tonic-gate
1617c478bdstevel@tonic-gate
1627c478bdstevel@tonic-gate#endif /* end _SYS_TERMIOS_H */
1637c478bdstevel@tonic-gate
1647c478bdstevel@tonic-gate/* Old SVR3.0 flags - should be removed if there is no problem */
1657c478bdstevel@tonic-gate/* note they are commented out */
1667c478bdstevel@tonic-gate
1677c478bdstevel@tonic-gate#if 0
1687c478bdstevel@tonic-gate
1697c478bdstevel@tonic-gate#define	O_HUPCL	01
1707c478bdstevel@tonic-gate#define	O_XTABS	02
1717c478bdstevel@tonic-gate#define	O_LCASE	04   /* simulate lower case */
1727c478bdstevel@tonic-gate#define	O_ECHO	010  /* echo input */
1737c478bdstevel@tonic-gate#define	O_CRMOD	020  /* map \r to \r\n on output */
1747c478bdstevel@tonic-gate#define	O_RAW	040  /* no i/o processing */
1757c478bdstevel@tonic-gate#define	O_ODDP	0100 /* get/send odd parity */
1767c478bdstevel@tonic-gate#define	O_EVENP	0200 /* get/send even parity */
1777c478bdstevel@tonic-gate#define	O_NLDELAY	001400	/* \n delay */
1787c478bdstevel@tonic-gate#define	O_NL1	000400
1797c478bdstevel@tonic-gate#define	O_NL2	001000
1807c478bdstevel@tonic-gate#define	O_TBDELAY	002000	/* horizontal tab delay */
1817c478bdstevel@tonic-gate#define	O_NOAL	004000
1827c478bdstevel@tonic-gate#define	O_CRDELAY	030000	/* \r delay */
1837c478bdstevel@tonic-gate#define	O_CR1	010000
1847c478bdstevel@tonic-gate#define	O_CR2	020000
1857c478bdstevel@tonic-gate#define	O_VTDELAY	040000	/* vertical tab delay */
1867c478bdstevel@tonic-gate#define	O_BSDELAY	0100000 /* \b delay */
1877c478bdstevel@tonic-gate
1887c478bdstevel@tonic-gate#endif
1897c478bdstevel@tonic-gate
1907c478bdstevel@tonic-gate/*
1917c478bdstevel@tonic-gate * 4.3 BSD additions. These are new codes  and some of the
1927c478bdstevel@tonic-gate * flags that were there in SVR3.2 ttold.h have been given
1937c478bdstevel@tonic-gate * new codes. Otherwise they will not fit in a word.
1947c478bdstevel@tonic-gate */
1957c478bdstevel@tonic-gate
1967c478bdstevel@tonic-gate#define		O_TANDEM	0x00000001	/* send stopc on out q full */
1977c478bdstevel@tonic-gate#define		O_CBREAK	0x00000002	/* half-cooked mode */
1987c478bdstevel@tonic-gate#define		O_LCASE		0x00000004	/* simulate lower case */
1997c478bdstevel@tonic-gate#define		O_ECHO		0x00000008	/* echo input */
2007c478bdstevel@tonic-gate#define		O_CRMOD		0x00000010	/* map \r to \r\n on output */
2017c478bdstevel@tonic-gate#define		O_RAW		0x00000020	/* no i/o processing */
2027c478bdstevel@tonic-gate#define		O_ODDP		0x00000040	/* get/send odd parity */
2037c478bdstevel@tonic-gate#define		O_EVENP		0x00000080	/* get/send even parity */
2047c478bdstevel@tonic-gate#define		O_ANYP		0x000000c0	/* get any parity/send none */
2057c478bdstevel@tonic-gate#define		O_NLDELAY	0x00000300	/* \n delay */
2067c478bdstevel@tonic-gate#define			O_NL0	0x00000000
2077c478bdstevel@tonic-gate#define			O_NL1	0x00000100	/* tty 37 */
2087c478bdstevel@tonic-gate#define			O_NL2	0x00000200	/* vt05 */
2097c478bdstevel@tonic-gate#define			O_NL3	0x00000300
2107c478bdstevel@tonic-gate#define		O_TBDELAY	0x00000c00	/* horizontal tab delay */
2117c478bdstevel@tonic-gate#define			O_TAB0	0x00000000
2127c478bdstevel@tonic-gate#define			O_TAB1	0x00000400	/* tty 37 */
2137c478bdstevel@tonic-gate#define			O_TAB2	0x00000800
2147c478bdstevel@tonic-gate#define		O_XTABS		0x00000c00	/* expand tabs on output */
2157c478bdstevel@tonic-gate#define		O_CRDELAY	0x00003000	/* \r delay */
2167c478bdstevel@tonic-gate#define			O_CR0	0x00000000
2177c478bdstevel@tonic-gate#define			O_CR1	0x00001000	/* tn 300 */
2187c478bdstevel@tonic-gate#define			O_CR2	0x00002000	/* tty 37 */
2197c478bdstevel@tonic-gate#define			O_CR3	0x00003000	/* concept 100 */
2207c478bdstevel@tonic-gate#define		O_VTDELAY	0x00004000	/* vertical tab delay */
2217c478bdstevel@tonic-gate#define			O_FF0	0x00000000
2227c478bdstevel@tonic-gate#define			O_FF1	0x00004000	/* tty 37 */
2237c478bdstevel@tonic-gate#define		O_BSDELAY	0x00008000	/* \b delay */
2247c478bdstevel@tonic-gate#define			O_BS0	0x00000000
2257c478bdstevel@tonic-gate#define			O_BS1	0x00008000
2267c478bdstevel@tonic-gate#define		O_ALLDELAY \
2277c478bdstevel@tonic-gate	(O_NLDELAY|O_TBDELAY|O_CRDELAY|O_VTDELAY|O_BSDELAY)
2287c478bdstevel@tonic-gate#define		O_CRTBS		0x00010000	/* do backspacing for crt */
2297c478bdstevel@tonic-gate#define		O_PRTERA	0x00020000	/* \ ... / erase */
2307c478bdstevel@tonic-gate#define		O_CRTERA	0x00040000	/* " \b " to wipe out char */
2317c478bdstevel@tonic-gate#define		O_TILDE		0x00080000	/* hazeltine tilde kludge */
2327c478bdstevel@tonic-gate#define		O_MDMBUF	0x00100000	/* start/stop output on */
2337c478bdstevel@tonic-gate						/* carrier intr */
2347c478bdstevel@tonic-gate#define		O_LITOUT	0x00200000	/* literal output */
2357c478bdstevel@tonic-gate#define		O_TOSTOP	0x00400000	/* SIGSTOP on background */
2367c478bdstevel@tonic-gate						/* output */
2377c478bdstevel@tonic-gate#define		O_FLUSHO	0x00800000	/* flush output to terminal */
2387c478bdstevel@tonic-gate#define		O_NOHANG	0x01000000	/* no SIGHUP on carrier drop */
2397c478bdstevel@tonic-gate#define		O_L001000	0x02000000
2407c478bdstevel@tonic-gate#define		O_CRTKIL	0x04000000	/* kill line with " \b " */
2417c478bdstevel@tonic-gate#define		O_PASS8		0x08000000
2427c478bdstevel@tonic-gate#define		O_CTLECH	0x10000000	/* echo control chars as ^X */
2437c478bdstevel@tonic-gate#define		O_PENDIN	0x20000000	/* tp->t_rawq needs reread */
2447c478bdstevel@tonic-gate#define		O_DECCTQ	0x40000000	/* only ^Q starts after ^S */
2457c478bdstevel@tonic-gate#define		O_NOFLSH	0x80000000	/* no output flush on signal */
2467c478bdstevel@tonic-gate
2477c478bdstevel@tonic-gate/* more BSD flags */
2487c478bdstevel@tonic-gate#define		LCRTBS		(O_CRTBS>>16)
2497c478bdstevel@tonic-gate#define		LPRTERA		(O_PRTERA>>16)
2507c478bdstevel@tonic-gate#define		LCRTERA		(O_CRTERA>>16)
2517c478bdstevel@tonic-gate#define		LTILDE		(O_TILDE>>16)
2527c478bdstevel@tonic-gate#define		LMDMBUF		(O_MDMBUF>>16)
2537c478bdstevel@tonic-gate#define		LLITOUT		(O_LITOUT>>16)
2547c478bdstevel@tonic-gate#define		LTOSTOP		(O_TOSTOP>>16)
2557c478bdstevel@tonic-gate#define		LFLUSHO		(O_FLUSHO>>16)
2567c478bdstevel@tonic-gate#define		LNOHANG		(O_NOHANG>>16)
2577c478bdstevel@tonic-gate#define		LCRTKIL		(O_CRTKIL>>16)
2587c478bdstevel@tonic-gate#define		LPASS8		(O_PASS8>>16)
2597c478bdstevel@tonic-gate#define		LCTLECH		(O_CTLECH>>16)
2607c478bdstevel@tonic-gate#define		LPENDIN		(O_PENDIN>>16)
2617c478bdstevel@tonic-gate#define		LDECCTQ		(O_DECCTQ>>16)
2627c478bdstevel@tonic-gate#define		LNOFLSH		(O_NOFLSH>>16)
2637c478bdstevel@tonic-gate
2647c478bdstevel@tonic-gate
2657c478bdstevel@tonic-gate#define		NOPOST	0x00000001	/* no processing on output (LITOUT */
2667c478bdstevel@tonic-gate					/* with 7 bits + parity) */
2677c478bdstevel@tonic-gate#define		NOISIG	0x00000002	/* disable all signal-generating */
2687c478bdstevel@tonic-gate					/* characters */
2697c478bdstevel@tonic-gate#define		STOPB	0x00000004	/* two stop bits */
2707c478bdstevel@tonic-gate
2717c478bdstevel@tonic-gate#define	OTTYDISC	0		/* old, v7 std tty driver */
2727c478bdstevel@tonic-gate#define	NETLDISC	1		/* line discip for berk net */
2737c478bdstevel@tonic-gate#define	NTTYDISC	2		/* new tty discipline */
2747c478bdstevel@tonic-gate#define	TABLDISC	3		/* hitachi tablet discipline */
2757c478bdstevel@tonic-gate#define	NTABLDISC	4		/* gtco tablet discipline */
2767c478bdstevel@tonic-gate#define	MOUSELDISC	5		/* mouse discipline */
2777c478bdstevel@tonic-gate#define	KBDLDISC	6		/* up/down keyboard trans (console) */
2787c478bdstevel@tonic-gate
2797c478bdstevel@tonic-gate#ifdef	__cplusplus
2807c478bdstevel@tonic-gate}
2817c478bdstevel@tonic-gate#endif
2827c478bdstevel@tonic-gate
2837c478bdstevel@tonic-gate#endif	/* _SYS_TTOLD_H */
284