xref: /illumos-gate/usr/src/cmd/ttymon/stty.h (revision 3bb2c1567625e7b11f8c2a5335125224717af64a)
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 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 /* Stty flags. */
41 #define	ASYNC   1
42 #define	FLOW	2
43 #define	WINDOW	4
44 #define	TERMIOS 8
45 #ifdef EUC
46 #define	EUCW	16
47 #define	CSIW	32
48 #endif /* EUC */
49 
50 /* Path to the locale-specific ldterm.dat file. */
51 #ifdef EUC
52 #define	_LDTERM_DAT_PATH	"/usr/lib/locale/%s/LC_CTYPE/ldterm.dat"
53 #endif /* EUC */
54 
55 #define	MAX_CC	NCCS-1	/* max number of ctrl char fields printed by stty -g */
56 #define	NUM_MODES 4	/* number of modes printed by stty -g */
57 #define	NUM_FIELDS NUM_MODES+MAX_CC /* num modes + ctrl char fields (stty -g) */
58 
59 struct	speeds {
60 	const char	*string;	/* Speed in string form, e.g. "9600" */
61 	int		code;		/* speed_t code for speed, e.g. B9600 */
62 	int		value;		/* Integer value of speed, e.g. 9600 */
63 };
64 
65 struct	mds {
66 	const char	*string;
67 	long	set;
68 	long	reset;
69 };
70 
71 extern	const struct	speeds	speeds[];
72 extern	const struct	mds	lmodes[];
73 extern	const struct	mds	nlmodes[];
74 extern	const struct	mds	cmodes[];
75 extern	const struct	mds	ncmodes[];
76 extern	const struct	mds	imodes[];
77 extern	const struct	mds	nimodes[];
78 extern	const struct	mds	omodes[];
79 extern	const struct	mds	hmodes[];
80 extern	const struct	mds	clkmodes[];
81 
82 #ifdef	__cplusplus
83 }
84 #endif
85 
86 #endif	/* _STTY_H */
87