xref: /titanic_51/usr/src/head/wchar.h (revision 1e49577a7fcde812700ded04431b49d67cc57d6d)
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 /*
23  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_WCHAR_H
28 #define	_WCHAR_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/feature_tests.h>
33 
34 #include <iso/wchar_iso.h>
35 #include <iso/wchar_c99.h>
36 
37 /*
38  * Allow global visibility for symbols defined in
39  * C++ "std" namespace in <iso/wchar_iso.h>.
40  */
41 #if __cplusplus >= 199711L
42 using std::FILE;
43 using std::wint_t;
44 using std::clock_t;
45 using std::size_t;
46 using std::time_t;
47 using std::tm;
48 using std::mbstate_t;
49 using std::fgetwc;
50 using std::fgetws;
51 using std::fputwc;
52 using std::fputws;
53 using std::ungetwc;
54 using std::getwc;
55 using std::getwchar;
56 using std::putwc;
57 using std::putwchar;
58 using std::wcstod;
59 using std::wcstol;
60 using std::wcstoul;
61 using std::wcscat;
62 using std::wcschr;
63 using std::wcscmp;
64 using std::wcscoll;
65 using std::wcscpy;
66 using std::wcscspn;
67 using std::wcslen;
68 using std::wcsncat;
69 using std::wcsncmp;
70 using std::wcsncpy;
71 using std::wcspbrk;
72 using std::wcsrchr;
73 using std::wcsspn;
74 using std::wcsxfrm;
75 using std::wcstok;
76 using std::wcsftime;
77 /* not XPG4 and not XPG4v2 */
78 #if (!defined(_XPG4) && !defined(_XPG4_2) || defined(_XPG5))
79 using std::btowc;
80 using std::fwprintf;
81 using std::fwscanf;
82 using std::fwide;
83 using std::mbsinit;
84 using std::mbrlen;
85 using std::mbrtowc;
86 using std::mbsrtowcs;
87 using std::swprintf;
88 using std::swscanf;
89 using std::vfwprintf;
90 using std::vwprintf;
91 using std::vswprintf;
92 using std::wcrtomb;
93 using std::wcsrtombs;
94 using std::wcsstr;
95 using std::wctob;
96 using std::wmemchr;
97 using std::wmemcmp;
98 using std::wmemcpy;
99 using std::wmemmove;
100 using std::wmemset;
101 using std::wprintf;
102 using std::wscanf;
103 #endif /* not XPG4 and not XPG4v2 */
104 #endif /* __cplusplus >= 199711L */
105 
106 #ifdef	__cplusplus
107 extern "C" {
108 #endif
109 
110 #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
111 #if !defined(_WCTYPE_T) || __cplusplus >= 199711L
112 #define	_WCTYPE_T
113 typedef	int	wctype_t;
114 #endif
115 #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
116 
117 /*
118  * XPG6 requires that va_list be defined as defined in <stdarg.h>,
119  * however, inclusion of <stdarg.h> breaks Standard C namespace.
120  */
121 #if defined(_XPG6) && !defined(_VA_LIST)
122 #define	_VA_LIST
123 typedef __va_list va_list;
124 #endif  /* defined(_XPG6) && !defined(_VA_LIST) */
125 
126 #ifdef __STDC__
127 
128 #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
129 extern int iswalpha(wint_t);
130 extern int iswupper(wint_t);
131 extern int iswlower(wint_t);
132 extern int iswdigit(wint_t);
133 extern int iswxdigit(wint_t);
134 extern int iswalnum(wint_t);
135 extern int iswspace(wint_t);
136 extern int iswpunct(wint_t);
137 extern int iswprint(wint_t);
138 extern int iswgraph(wint_t);
139 extern int iswcntrl(wint_t);
140 extern int iswctype(wint_t, wctype_t);
141 extern wint_t towlower(wint_t);
142 extern wint_t towupper(wint_t);
143 extern wchar_t *wcswcs(const wchar_t *, const wchar_t *);
144 extern int wcswidth(const wchar_t *, size_t);
145 extern int wcwidth(wchar_t);
146 extern wctype_t wctype(const char *);
147 #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
148 
149 #else /* __STDC__ */
150 
151 #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
152 extern  int iswalpha();
153 extern  int iswupper();
154 extern  int iswlower();
155 extern  int iswdigit();
156 extern  int iswxdigit();
157 extern  int iswalnum();
158 extern  int iswspace();
159 extern  int iswpunct();
160 extern  int iswprint();
161 extern  int iswgraph();
162 extern  int iswcntrl();
163 extern  int iswctype();
164 extern  wint_t towlower();
165 extern  wint_t towupper();
166 extern wchar_t *wcswcs();
167 extern int wcswidth();
168 extern int wcwidth();
169 extern wctype_t wctype();
170 #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
171 
172 #endif /* __STDC__ */
173 
174 #ifdef	__cplusplus
175 }
176 #endif
177 
178 #endif	/* _WCHAR_H */
179