8446 uts: pci_check_bios() should check for BIOS
[unleashed.git] / include / iso / wchar_iso.h
blob3645ea9ac763188bdd1cac22135cf72c58fa04e0
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 * Copyright 2014 PALO, Richard.
26 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
31 * An application should not include this header directly. Instead it
32 * should be included only through the inclusion of other Sun headers.
34 * The contents of this header is limited to identifiers specified in the
35 * C Standard. Any new identifiers specified in future amendments to the
36 * C Standard must be placed in this header. If these new identifiers
37 * are required to also be in the C++ Standard "std" namespace, then for
38 * anything other than macro definitions, corresponding "using" directives
39 * must also be added to <wchar.h>.
42 #ifndef _ISO_WCHAR_ISO_H
43 #define _ISO_WCHAR_ISO_H
45 #include <sys/feature_tests.h>
46 #include <sys/null.h>
47 #include <stdio_tag.h>
48 #include <wchar_impl.h>
49 #include <iso/time_iso.h>
51 #if (defined(__cplusplus) && (__cplusplus - 0 < 54321L)) || \
52 (!defined(__cplusplus) && !defined(_STRICT_STDC)) || \
53 defined(__EXTENSIONS__)
54 #include <stdio.h>
55 #endif /* (defined(__cplusplus) && (__cplusplus - 0 < 54321L)) ... */
57 #if !defined(_STRICT_STDC) || defined(__EXTENSIONS__)
58 #include <ctype.h>
59 #include <stddef.h>
60 #endif /* !defined(_STRICT_STDC) || defined(__EXTENSIONS__) */
62 #include <sys/va_list.h>
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
68 #if __cplusplus >= 199711L
69 namespace std {
70 #endif
73 * wchar_t is a built-in type in standard C++ and as such is not
74 * defined here when using standard C++. However, the GNU compiler
75 * fixincludes utility nonetheless creates its own version of this
76 * header for use by gcc and g++. In that version it adds a redundant
77 * guard for __cplusplus. To avoid the creation of a gcc/g++ specific
78 * header we need to include the following magic comment:
80 * we must use the C++ compiler's type
82 * The above comment should not be removed or changed until GNU
83 * gcc/fixinc/inclhack.def is updated to bypass this header.
85 #if !defined(__cplusplus) || (__cplusplus < 199711L && !defined(__GNUG__))
86 #ifndef _WCHAR_T
87 #define _WCHAR_T
88 #if defined(_LP64)
89 typedef int wchar_t;
90 #else
91 typedef long wchar_t;
92 #endif
93 #endif /* !_WCHAR_T */
94 #endif /* !defined(__cplusplus) ... */
96 #if !defined(_WINT_T) || __cplusplus >= 199711L
97 #define _WINT_T
98 #if defined(_LP64)
99 typedef int wint_t;
100 #else
101 typedef long wint_t;
102 #endif
103 #endif /* !defined(_WINT_T) || __cplusplus >= 199711L */
105 #if !defined(_SIZE_T) || __cplusplus >= 199711L
106 #define _SIZE_T
107 #if defined(_LP64) || defined(_I32LPx)
108 typedef unsigned long size_t; /* size of something in bytes */
109 #else
110 typedef unsigned int size_t; /* (historical version) */
111 #endif
112 #endif /* !defined(_SIZE_T) || __cplusplus >= 199711L */
114 #ifndef WEOF
115 #if __cplusplus >= 199711L
116 #define WEOF ((std::wint_t)(-1))
117 #else
118 #define WEOF ((wint_t)(-1))
119 #endif
120 #endif /* WEOF */
122 /* not XPG4 and not XPG4v2 */
123 #if !defined(_XPG4) || defined(_XPG5)
124 #ifndef WCHAR_MAX
125 #define WCHAR_MAX 2147483647
126 #endif
127 #ifndef WCHAR_MIN
128 #define WCHAR_MIN (-2147483647-1)
129 #endif
130 #endif /* not XPG4 and not XPG4v2 */
132 #if !defined(_MBSTATE_T) || __cplusplus >= 199711L
133 #define _MBSTATE_T
134 typedef __mbstate_t mbstate_t;
135 #endif /* _MBSTATE_T */
137 #if defined(_XPG4) && !defined(_FILEDEFED) || __cplusplus >= 199711L
138 #define _FILEDEFED
139 typedef __FILE FILE;
140 #endif
142 #if !defined(_LP64) && !defined(_LONGLONG_TYPE)
144 #ifdef __PRAGMA_REDEFINE_EXTNAME
145 #pragma redefine_extname fwprintf _fwprintf_c89
146 #pragma redefine_extname swprintf _swprintf_c89
147 #pragma redefine_extname vfwprintf _vfwprintf_c89
148 #pragma redefine_extname vswprintf _vswprintf_c89
149 #pragma redefine_extname vwprintf _vwprintf_c89
150 #pragma redefine_extname wprintf _wprintf_c89
151 #pragma redefine_extname fwscanf _fwscanf_c89
152 #pragma redefine_extname swscanf _swscanf_c89
153 #pragma redefine_extname wscanf _wscanf_c89
154 #else
155 #define fwprintf _fwprintf_c89
156 #define swprintf _swprintf_c89
157 #define vfwprintf _vfwprintf_c89
158 #define vswprintf _vswprintf_c89
159 #define vwprintf _vwprintf_c89
160 #define wprintf _wprintf_c89
161 #define fwscanf _fwscanf_c89
162 #define swscanf _swscanf_c89
163 #define wscanf _wscanf_c89
164 #endif
166 #endif /* !defined(_LP64) && !defined(_LONGLONG_TYPE) */
168 extern wint_t fgetwc(__FILE *);
169 extern wchar_t *fgetws(wchar_t *_RESTRICT_KYWD, int, __FILE *_RESTRICT_KYWD);
170 extern wint_t fputwc(wint_t, __FILE *);
171 extern int fputws(const wchar_t *_RESTRICT_KYWD, __FILE *_RESTRICT_KYWD);
172 extern wint_t ungetwc(wint_t, __FILE *);
173 extern wint_t getwc(__FILE *);
174 extern wint_t getwchar(void);
175 extern wint_t putwc(wint_t, __FILE *);
176 extern wint_t putwchar(wint_t);
177 extern double wcstod(const wchar_t *_RESTRICT_KYWD, wchar_t **_RESTRICT_KYWD);
178 extern long wcstol(const wchar_t *_RESTRICT_KYWD, wchar_t **_RESTRICT_KYWD,
179 int);
180 extern unsigned long wcstoul(const wchar_t *_RESTRICT_KYWD,
181 wchar_t **_RESTRICT_KYWD, int);
182 extern wchar_t *wcscat(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD);
183 extern int wcscmp(const wchar_t *, const wchar_t *);
184 extern int wcscoll(const wchar_t *, const wchar_t *);
185 extern wchar_t *wcscpy(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD);
186 extern size_t wcscspn(const wchar_t *, const wchar_t *);
187 extern size_t wcslen(const wchar_t *);
188 extern wchar_t *wcsncat(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
189 size_t);
190 extern int wcsncmp(const wchar_t *, const wchar_t *, size_t);
191 extern wchar_t *wcsncpy(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
192 size_t);
193 extern size_t wcsspn(const wchar_t *, const wchar_t *);
194 extern size_t wcsxfrm(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
195 size_t);
196 #if __cplusplus >= 199711L
197 extern const wchar_t *wcschr(const wchar_t *, wchar_t);
198 extern "C++" {
199 inline wchar_t *wcschr(wchar_t *__ws, wchar_t __wc) {
200 return (wchar_t *)wcschr((const wchar_t *)__ws, __wc);
203 extern const wchar_t *wcspbrk(const wchar_t *, const wchar_t *);
204 extern "C++" {
205 inline wchar_t *wcspbrk(wchar_t *__ws1, const wchar_t *__ws2) {
206 return (wchar_t *)wcspbrk((const wchar_t *)__ws1, __ws2);
209 extern const wchar_t *wcsrchr(const wchar_t *, wchar_t);
210 extern "C++" {
211 inline wchar_t *wcsrchr(wchar_t *__ws, wchar_t __wc) {
212 return (wchar_t *)wcsrchr((const wchar_t *)__ws, __wc);
215 #else /* __cplusplus >= 199711L */
216 extern wchar_t *wcschr(const wchar_t *, wchar_t);
217 extern wchar_t *wcspbrk(const wchar_t *, const wchar_t *);
218 extern wchar_t *wcsrchr(const wchar_t *, wchar_t);
219 #endif /* __cplusplus >= 199711L */
221 #if (!defined(_MSE_INT_H))
222 #if defined(_XPG4) && !defined(_XPG5) /* XPG4 or XPG4v2 */
223 extern wchar_t *wcstok(wchar_t *, const wchar_t *);
224 extern size_t wcsftime(wchar_t *, size_t, const char *, const struct tm *);
225 #else /* XPG4 or XPG4v2 */
226 #ifdef __PRAGMA_REDEFINE_EXTNAME
227 #pragma redefine_extname wcstok __wcstok_xpg5
228 #pragma redefine_extname wcsftime __wcsftime_xpg5
229 extern wchar_t *wcstok(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
230 wchar_t **_RESTRICT_KYWD);
231 extern size_t wcsftime(wchar_t *_RESTRICT_KYWD, size_t,
232 const wchar_t *_RESTRICT_KYWD, const struct tm *_RESTRICT_KYWD);
233 #else /* __PRAGMA_REDEFINE_EXTNAME */
234 extern wchar_t *__wcstok_xpg5(wchar_t *_RESTRICT_KYWD,
235 const wchar_t *_RESTRICT_KYWD, wchar_t **_RESTRICT_KYWD);
236 extern size_t __wcsftime_xpg5(wchar_t *_RESTRICT_KYWD, size_t,
237 const wchar_t *_RESTRICT_KYWD, const struct tm *_RESTRICT_KYWD);
238 #define wcstok __wcstok_xpg5
239 #define wcsftime __wcsftime_xpg5
240 #endif /* __PRAGMA_REDEFINE_EXTNAME */
241 #endif /* XPG4 or XPG4v2 */
242 #endif /* !defined(_MSE_INT_H) */
244 /* not XPG4 and not XPG4v2 */
245 #if !defined(_XPG4) || defined(_XPG5)
246 extern wint_t btowc(int);
247 extern int fwprintf(__FILE *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
248 ...);
249 extern int fwscanf(__FILE *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
250 ...);
251 extern int fwide(__FILE *, int);
252 extern int mbsinit(const mbstate_t *);
253 extern size_t mbrlen(const char *_RESTRICT_KYWD, size_t,
254 mbstate_t *_RESTRICT_KYWD);
255 extern size_t mbrtowc(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
256 size_t, mbstate_t *_RESTRICT_KYWD);
257 extern size_t mbsrtowcs(wchar_t *_RESTRICT_KYWD, const char **_RESTRICT_KYWD,
258 size_t, mbstate_t *_RESTRICT_KYWD);
259 extern int swprintf(wchar_t *_RESTRICT_KYWD, size_t,
260 const wchar_t *_RESTRICT_KYWD, ...);
261 extern int swscanf(const wchar_t *_RESTRICT_KYWD,
262 const wchar_t *_RESTRICT_KYWD, ...);
263 extern int vfwprintf(__FILE *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
264 __va_list);
265 extern int vwprintf(const wchar_t *_RESTRICT_KYWD, __va_list);
266 extern int vswprintf(wchar_t *_RESTRICT_KYWD, size_t,
267 const wchar_t *_RESTRICT_KYWD, __va_list);
268 extern size_t wcrtomb(char *_RESTRICT_KYWD, wchar_t,
269 mbstate_t *_RESTRICT_KYWD);
270 extern size_t wcsrtombs(char *_RESTRICT_KYWD, const wchar_t **_RESTRICT_KYWD,
271 size_t, mbstate_t *_RESTRICT_KYWD);
272 #if defined(_XPG7) || !defined(_STRICT_SYMBOLS)
273 extern size_t wcsnrtombs(char *_RESTRICT_KYWD, const wchar_t **_RESTRICT_KYWD,
274 size_t, size_t, mbstate_t *_RESTRICT_KYWD);
275 #endif
276 extern int wctob(wint_t);
277 extern int wmemcmp(const wchar_t *, const wchar_t *, size_t);
278 extern wchar_t *wmemcpy(wchar_t *_RESTRICT_KYWD,
279 const wchar_t *_RESTRICT_KYWD, size_t);
280 extern wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t);
281 extern wchar_t *wmemset(wchar_t *, wchar_t, size_t);
282 extern int wprintf(const wchar_t *_RESTRICT_KYWD, ...);
283 extern int wscanf(const wchar_t *_RESTRICT_KYWD, ...);
284 #if __cplusplus >= 199711L
285 extern const wchar_t *wcsstr(const wchar_t *, const wchar_t *);
286 extern "C++" {
287 inline wchar_t *wcsstr(wchar_t *__ws1, const wchar_t *__ws2) {
288 return (wchar_t *)wcsstr((const wchar_t *)__ws1, __ws2);
291 extern const wchar_t *wmemchr(const wchar_t *, wchar_t, size_t);
292 extern "C++" {
293 inline wchar_t *wmemchr(wchar_t *__ws, wchar_t __wc, size_t __n) {
294 return (wchar_t *)wmemchr((const wchar_t *)__ws, __wc, __n);
297 #else /* __cplusplus >= 199711L */
298 extern wchar_t *wcsstr(const wchar_t *_RESTRICT_KYWD,
299 const wchar_t *_RESTRICT_KYWD);
300 extern wchar_t *wmemchr(const wchar_t *, wchar_t, size_t);
301 #endif /* __cplusplus >= 199711L */
302 #endif /* not XPG4 and not XPG4v2 */
304 #if __cplusplus >= 199711L
306 #endif /* end of namespace std */
308 #ifdef __cplusplus
310 #endif
312 #endif /* _ISO_WCHAR_ISO_H */