xref: /illumos-gate/usr/src/cmd/ttymon/stty.h (revision 69a119caa6570c7077699161b7c28b6ee9f8b0f4)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1999-2002 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*
28  * Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
29  * All Rights Reserved
30  *
31  */
32 
33 #ifndef	_STTY_H
34 #define	_STTY_H
35 
36 #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.3 */
37 
38 #ifdef	__cplusplus
39 extern "C" {
40 #endif
41 
42 /* Stty flags. */
43 #define	ASYNC   1
44 #define	FLOW	2
45 #define	WINDOW	4
46 #define	TERMIOS 8
47 #ifdef EUC
48 #define	EUCW	16
49 #define	CSIW	32
50 #endif /* EUC */
51 
52 /* Path to the locale-specific ldterm.dat file. */
53 #ifdef EUC
54 #define	_LDTERM_DAT_PATH	"/usr/lib/locale/%s/LC_CTYPE/ldterm.dat"
55 #endif /* EUC */
56 
57 #define	MAX_CC	NCCS-1	/* max number of ctrl char fields printed by stty -g */
58 #define	NUM_MODES 4	/* number of modes printed by stty -g */
59 #define	NUM_FIELDS NUM_MODES+MAX_CC /* num modes + ctrl char fields (stty -g) */
60 
61 struct	speeds {
62 	const char	*string;	/* Speed in string form, e.g. "9600" */
63 	int		code;		/* speed_t code for speed, e.g. B9600 */
64 	int		value;		/* Integer value of speed, e.g. 9600 */
65 };
66 
67 struct	mds {
68 	const char	*string;
69 	long	set;
70 	long	reset;
71 };
72 
73 extern	const struct	speeds	speeds[];
74 extern	const struct	mds	lmodes[];
75 extern	const struct	mds	nlmodes[];
76 extern	const struct	mds	cmodes[];
77 extern	const struct	mds	ncmodes[];
78 extern	const struct	mds	imodes[];
79 extern	const struct	mds	nimodes[];
80 extern	const struct	mds	omodes[];
81 extern	const struct	mds	hmodes[];
82 extern	const struct	mds	clkmodes[];
83 
84 #ifdef	__cplusplus
85 }
86 #endif
87 
88 #endif	/* _STTY_H */
89