xref: /illumos-gate/usr/src/uts/common/sys/eucioctl.h (revision 3299f39fdcbdab4be7a9c70daa3873f2b78a398d)
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 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
23 /*	  All Rights Reserved	*/
24 
25 
26 #ifndef _SYS_EUCIOCTL_H
27 #define	_SYS_EUCIOCTL_H
28 
29 #ifdef	__cplusplus
30 extern "C" {
31 #endif
32 
33 /*
34  * /usr/include/sys/eucioctl.h:
35  *
36  *	Header for EUC width information to LD modules.
37  */
38 
39 #ifndef EUC_IOC
40 #define	EUC_IOC		(('E' | 128) << 8)
41 #endif
42 #define	EUC_WSET	(EUC_IOC | 1)
43 #define	EUC_WGET	(EUC_IOC | 2)
44 #define	EUC_MSAVE	(EUC_IOC | 3)
45 #define	EUC_MREST	(EUC_IOC | 4)
46 #define	EUC_IXLOFF	(EUC_IOC | 5)
47 #define	EUC_IXLON	(EUC_IOC | 6)
48 #define	EUC_OXLOFF	(EUC_IOC | 7)
49 #define	EUC_OXLON	(EUC_IOC | 8)
50 
51 /*
52  * This structure should really be the same one as defined in "euc.h",
53  * but we want to minimize the number of bytes sent downstream to each
54  * module -- this should make it 8 bytes -- therefore, we take only the
55  * info we need.  The major assumptions here are that no EUC character
56  * set has a character width greater than 255 bytes, and that no EUC
57  * character consumes more than 255 screen columns.  Let me know if this
58  * is an unsafe assumption...
59  */
60 
61 struct eucioc {
62 	unsigned char eucw[4];
63 	unsigned char scrw[4];
64 };
65 typedef struct eucioc	eucioc_t;
66 
67 /*
68  * The following defines are for LD modules to broadcast the state of
69  * their "icanon" bit.
70  *
71  * The message type is M_CTL; message block 1 has a data block containing
72  * an "iocblk"; EUC_BCAST is put into the "ioc_cmd" field.  The "b_cont"
73  * of the first message block points to a second message block.  The second
74  * message block is type M_DATA; it contains 1 byte that is either EUC_B_RAW
75  * or EUC_B_CANON depending on the state of the "icanon" bit.  EUC line
76  * disciplines should take care to broadcast this information when they are
77  * in multibyte character mode.
78  */
79 
80 #define	EUC_BCAST	EUC_IOC|16
81 
82 #define	EUC_B_CANON	'\177'
83 #define	EUC_B_RAW	'\001'	/* MUST be non-zero! */
84 
85 #ifdef	__cplusplus
86 }
87 #endif
88 
89 #endif	/* _SYS_EUCIOCTL_H */
90