xref: /minix3/sys/sys/ttydefaults.h (revision e5c9686c0f1c06b70b250d043e23b6d5f4f22bb1)
1f6aac1c3SLionel Sambuc /*	$NetBSD: ttydefaults.h,v 1.16 2008/05/24 14:06:39 yamt Exp $	*/
2f6aac1c3SLionel Sambuc 
3f6aac1c3SLionel Sambuc /*-
4f6aac1c3SLionel Sambuc  * Copyright (c) 1982, 1986, 1993
5f6aac1c3SLionel Sambuc  *	The Regents of the University of California.  All rights reserved.
6f6aac1c3SLionel Sambuc  * (c) UNIX System Laboratories, Inc.
7f6aac1c3SLionel Sambuc  * All or some portions of this file are derived from material licensed
8f6aac1c3SLionel Sambuc  * to the University of California by American Telephone and Telegraph
9f6aac1c3SLionel Sambuc  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
10f6aac1c3SLionel Sambuc  * the permission of UNIX System Laboratories, Inc.
11f6aac1c3SLionel Sambuc  *
12f6aac1c3SLionel Sambuc  * Redistribution and use in source and binary forms, with or without
13f6aac1c3SLionel Sambuc  * modification, are permitted provided that the following conditions
14f6aac1c3SLionel Sambuc  * are met:
15f6aac1c3SLionel Sambuc  * 1. Redistributions of source code must retain the above copyright
16f6aac1c3SLionel Sambuc  *    notice, this list of conditions and the following disclaimer.
17f6aac1c3SLionel Sambuc  * 2. Redistributions in binary form must reproduce the above copyright
18f6aac1c3SLionel Sambuc  *    notice, this list of conditions and the following disclaimer in the
19f6aac1c3SLionel Sambuc  *    documentation and/or other materials provided with the distribution.
20f6aac1c3SLionel Sambuc  * 3. Neither the name of the University nor the names of its contributors
21f6aac1c3SLionel Sambuc  *    may be used to endorse or promote products derived from this software
22f6aac1c3SLionel Sambuc  *    without specific prior written permission.
23f6aac1c3SLionel Sambuc  *
24f6aac1c3SLionel Sambuc  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25f6aac1c3SLionel Sambuc  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26f6aac1c3SLionel Sambuc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27f6aac1c3SLionel Sambuc  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28f6aac1c3SLionel Sambuc  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29f6aac1c3SLionel Sambuc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30f6aac1c3SLionel Sambuc  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31f6aac1c3SLionel Sambuc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32f6aac1c3SLionel Sambuc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33f6aac1c3SLionel Sambuc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34f6aac1c3SLionel Sambuc  * SUCH DAMAGE.
35f6aac1c3SLionel Sambuc  *
36f6aac1c3SLionel Sambuc  *	@(#)ttydefaults.h	8.4 (Berkeley) 1/21/94
37f6aac1c3SLionel Sambuc  */
38f6aac1c3SLionel Sambuc 
39f6aac1c3SLionel Sambuc /*
40f6aac1c3SLionel Sambuc  * System wide defaults for terminal state.
41f6aac1c3SLionel Sambuc  */
42f6aac1c3SLionel Sambuc #ifndef _SYS_TTYDEFAULTS_H_
43f6aac1c3SLionel Sambuc #define	_SYS_TTYDEFAULTS_H_
44f6aac1c3SLionel Sambuc 
45f6aac1c3SLionel Sambuc /*
46f6aac1c3SLionel Sambuc  * Defaults on "first" open.
47f6aac1c3SLionel Sambuc  */
4809fab4dcSBen Gras #define	TTYDEF_IFLAG	(BRKINT | ICRNL | IMAXBEL | IXON | IXANY)
4909fab4dcSBen Gras #define TTYDEF_OFLAG	(OPOST | ONLCR | OXTABS)
5009fab4dcSBen Gras #define TTYDEF_LFLAG	(ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
51f6aac1c3SLionel Sambuc #define TTYDEF_CFLAG	(CREAD | CS8 | HUPCL)
5284d9c625SLionel Sambuc #if defined(__minix)
537120f34eSBen Gras #define TTYDEF_SPEED	(B115200)
547120f34eSBen Gras #else
55f6aac1c3SLionel Sambuc #define TTYDEF_SPEED	(B9600)
5684d9c625SLionel Sambuc #endif /* defined(__minix) */
57f6aac1c3SLionel Sambuc 
58f6aac1c3SLionel Sambuc /*
59f6aac1c3SLionel Sambuc  * Control Character Defaults
60f6aac1c3SLionel Sambuc  */
61f6aac1c3SLionel Sambuc #define CTRL(x)	(x&037)
62f6aac1c3SLionel Sambuc #define	CEOF		CTRL('d')
6309fab4dcSBen Gras #define	CEOL		((unsigned char)'\377')	/* XXX avoid _POSIX_VDISABLE */
64*e5c9686cSDavid van Moolenbroek #if defined(__minix)
65*e5c9686cSDavid van Moolenbroek #define	CERASE		CTRL('h')
66*e5c9686cSDavid van Moolenbroek #else
6709fab4dcSBen Gras #define	CERASE		0177
68*e5c9686cSDavid van Moolenbroek #endif /* defined(__minix) */
69f6aac1c3SLionel Sambuc #define	CINTR		CTRL('c')
70f6aac1c3SLionel Sambuc #define	CSTATUS		CTRL('t')
71f6aac1c3SLionel Sambuc #define	CKILL		CTRL('u')
72f6aac1c3SLionel Sambuc #define	CMIN		1
73f6aac1c3SLionel Sambuc #define	CQUIT		034		/* FS, ^\ */
74f6aac1c3SLionel Sambuc #define	CSUSP		CTRL('z')
75f6aac1c3SLionel Sambuc #define	CTIME		0
76f6aac1c3SLionel Sambuc #define	CDSUSP		CTRL('y')
77f6aac1c3SLionel Sambuc #define	CSTART		CTRL('q')
78f6aac1c3SLionel Sambuc #define	CSTOP		CTRL('s')
79f6aac1c3SLionel Sambuc #define	CLNEXT		CTRL('v')
80f6aac1c3SLionel Sambuc #define	CDISCARD 	CTRL('o')
81f6aac1c3SLionel Sambuc #define	CWERASE 	CTRL('w')
82f6aac1c3SLionel Sambuc #define	CREPRINT 	CTRL('r')
83f6aac1c3SLionel Sambuc #define	CEOT		CEOF
84f6aac1c3SLionel Sambuc /* compat */
85f6aac1c3SLionel Sambuc #define	CBRK		CEOL
86f6aac1c3SLionel Sambuc #define CRPRNT		CREPRINT
87f6aac1c3SLionel Sambuc #define	CFLUSH		CDISCARD
88f6aac1c3SLionel Sambuc 
8909fab4dcSBen Gras /* PROTECTED INCLUSION ENDS HERE */
9009fab4dcSBen Gras #endif /* !_SYS_TTYDEFAULTS_H_ */
9109fab4dcSBen Gras 
9209fab4dcSBen Gras /*
9309fab4dcSBen Gras  * #define TTYDEFCHARS to include an array of default control characters.
9409fab4dcSBen Gras  */
9509fab4dcSBen Gras #ifdef _KERNEL
9609fab4dcSBen Gras #ifdef TTYDEFCHARS
9709fab4dcSBen Gras const cc_t ttydefchars[NCCS] = {
9809fab4dcSBen Gras 	[VEOF] = CEOF,
9909fab4dcSBen Gras 	[VEOL] = CEOL,
10009fab4dcSBen Gras 	[VEOL2] = CEOL,
10109fab4dcSBen Gras 	[VERASE] = CERASE,
10209fab4dcSBen Gras 	[VWERASE] = CWERASE,
10309fab4dcSBen Gras 	[VKILL] = CKILL,
10409fab4dcSBen Gras 	[VREPRINT] = CREPRINT,
10509fab4dcSBen Gras 	[7] = _POSIX_VDISABLE,	/* spare */
10609fab4dcSBen Gras 	[VINTR] = CINTR,
10709fab4dcSBen Gras 	[VQUIT] = CQUIT,
10809fab4dcSBen Gras 	[VSUSP] = CSUSP,
10909fab4dcSBen Gras 	[VDSUSP] = CDSUSP,
11009fab4dcSBen Gras 	[VSTART] = CSTART,
11109fab4dcSBen Gras 	[VSTOP] = CSTOP,
11209fab4dcSBen Gras 	[VLNEXT] = CLNEXT,
11309fab4dcSBen Gras 	[VDISCARD] = CDISCARD,
11409fab4dcSBen Gras 	[VMIN] = CMIN,
11509fab4dcSBen Gras 	[VTIME] = CTIME,
11609fab4dcSBen Gras 	[VSTATUS] = CSTATUS,
11709fab4dcSBen Gras 	[19] = _POSIX_VDISABLE,	/* spare */
11809fab4dcSBen Gras };
11909fab4dcSBen Gras #undef TTYDEFCHARS
12009fab4dcSBen Gras #else
12109fab4dcSBen Gras extern const cc_t ttydefchars[NCCS];
12209fab4dcSBen Gras #endif
12309fab4dcSBen Gras #endif /* _KERNEL */
124