xref: /illumos-gate/usr/src/head/iso/wctype_iso.h (revision ba3594ba)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*	wctype.h	1.13 89/11/02 SMI; JLE	*/
23 /*	from AT&T JAE 2.1			*/
24 /*	definitions for international functions	*/
25 
26 /*
27  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
28  *
29  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
30  * Use is subject to license terms.
31  */
32 
33 /*
34  * An application should not include this header directly.  Instead it
35  * should be included only through the inclusion of other Sun headers.
36  *
37  * The contents of this header is limited to identifiers specified in the
38  * C Standard.  Any new identifiers specified in future amendments to the
39  * C Standard must be placed in this header.  If these new identifiers
40  * are required to also be in the C++ Standard "std" namespace, then for
41  * anything other than macro definitions, corresponding "using" directives
42  * must also be added to <wctype.h>.
43  */
44 
45 #ifndef	_ISO_WCTYPE_ISO_H
46 #define	_ISO_WCTYPE_ISO_H
47 
48 #include <sys/feature_tests.h>
49 
50 #ifdef	__cplusplus
51 extern "C" {
52 #endif
53 
54 #if __cplusplus >= 199711L
55 namespace std {
56 #endif
57 
58 #if !defined(_WINT_T) || __cplusplus >= 199711L
59 #define	_WINT_T
60 #if defined(_LP64)
61 typedef	int	wint_t;
62 #else
63 typedef long	wint_t;
64 #endif
65 #endif  /* !defined(_WINT_T) || __cplusplus >= 199711L */
66 
67 #if !defined(_WCTYPE_T) || __cplusplus >= 199711L
68 #define	_WCTYPE_T
69 typedef	int	wctype_t;
70 #endif
71 
72 typedef unsigned int	wctrans_t;
73 
74 /* not XPG4 and not XPG4v2 */
75 #if !defined(_XPG4) || defined(_XPG5)
76 #ifndef WEOF
77 #if __cplusplus >= 199711L
78 #define	WEOF	((std::wint_t)(-1))
79 #else
80 #define	WEOF	((wint_t)(-1))
81 #endif
82 #endif /* WEOF */
83 #endif /* not XPG4 and not XPG4v2 */
84 
85 extern	int iswalnum(wint_t);
86 extern	int iswalpha(wint_t);
87 extern	int iswcntrl(wint_t);
88 extern	int iswdigit(wint_t);
89 extern	int iswgraph(wint_t);
90 extern	int iswlower(wint_t);
91 extern	int iswprint(wint_t);
92 extern	int iswpunct(wint_t);
93 extern	int iswspace(wint_t);
94 extern	int iswupper(wint_t);
95 extern	int iswxdigit(wint_t);
96 
97 #if (__cplusplus >= 201103L) || defined(_STDC_C99) || defined(_XPG6) || \
98 	!defined(_STRICT_SYMBOLS)
99 extern	int iswblank(wint_t);
100 #endif
101 
102 /* tow* also become functions */
103 extern	wint_t towlower(wint_t);
104 extern	wint_t towupper(wint_t);
105 extern	wctrans_t wctrans(const char *);
106 extern	wint_t towctrans(wint_t, wctrans_t);
107 extern  int iswctype(wint_t, wctype_t);
108 extern  wctype_t wctype(const char *);
109 
110 /* bit definition for character class */
111 
112 #define	_E1	0x00000100	/* phonogram (international use) */
113 #define	_E2	0x00000200	/* ideogram (international use) */
114 #define	_E3	0x00000400	/* English (international use) */
115 #define	_E4	0x00000800	/* number (international use) */
116 #define	_E5	0x00001000	/* special (international use) */
117 #define	_E6	0x00002000	/* other characters (international use) */
118 #define	_E7	0x00004000	/* reserved (international use) */
119 #define	_E8	0x00008000	/* reserved (international use) */
120 
121 #define	_E9	0x00010000
122 #define	_E10	0x00020000
123 #define	_E11	0x00040000
124 #define	_E12	0x00080000
125 #define	_E13	0x00100000
126 #define	_E14	0x00200000
127 #define	_E15	0x00400000
128 #define	_E16	0x00800000
129 #define	_E17	0x01000000
130 #define	_E18	0x02000000
131 #define	_E19	0x04000000
132 #define	_E20	0x08000000
133 #define	_E21	0x10000000
134 #define	_E22	0x20000000
135 #define	_E23	0x40000000
136 #define	_E24	0x80000000
137 
138 #if __cplusplus >= 199711L
139 }
140 #endif /* end of namespace std */
141 
142 #ifdef	__cplusplus
143 }
144 #endif
145 
146 #endif	/* _ISO_WCTYPE_ISO_H */
147