source: Daodan/MinGW/include/wchar.h@ 1051

Last change on this file since 1051 was 1046, checked in by alloc, 8 years ago

Daodan: Added Windows MinGW and build batch file

File size: 21.3 KB
Line 
1/*
2 * wchar.h
3 *
4 * Declarations relating to support for wide characters; many are simply
5 * inherited by (sub-optimal) inclusion of other header files.
6 *
7 * $Id: wchar.h,v 0e4f78dbc1ba 2016/06/17 14:16:01 keithmarshall $
8 *
9 * Unattributed original source.
10 * Adapted by Rob Savoye <rob@cygnus.com>
11 * Copyright (C) 1997, 1999-2009, 2011, 2015, 2016, MinGW.org Project.
12 *
13 *
14 * Permission is hereby granted, free of charge, to any person obtaining a
15 * copy of this software and associated documentation files (the "Software"),
16 * to deal in the Software without restriction, including without limitation
17 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 * and/or sell copies of the Software, and to permit persons to whom the
19 * Software is furnished to do so, subject to the following conditions:
20 *
21 * The above copyright notice, this permission notice, and the following
22 * disclaimer shall be included in all copies or substantial portions of
23 * the Software.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
26 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
28 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER
31 * DEALINGS IN THE SOFTWARE.
32 *
33 */
34#ifndef _WCHAR_H
35#pragma GCC system_header
36
37/* This header declares prototypes for wchar_t string functions, as are
38 * prescribed by ISO-C, but which MSVC also expects, (in contravention of
39 * ISO-C prescriptions), to find in <string.h>. To accommodate this MSVC
40 * anomaly, we make provision for <string.h> to include a selected subset
41 * of <wchar.h>; thus, we do not immediately define _WCHAR_T...
42 */
43#ifndef __STRING_H_SOURCED__
44/* ...but defer it until we have confirmed that this is NOT inclusion for
45 * only this subset of <wchar.h> declarations.
46 */
47#define _WCHAR_H
48
49/* All MinGW headers are required to include <_mingw.h>; in the case of
50 * selective inclusion by <string.h>, we expect it to have already done
51 * so, but since that doesn't apply here, we must do it ourselves.
52 */
53#include <_mingw.h>
54
55#ifndef __STRICT_ANSI__
56 /* MSDN says that isw* char classifications appear in both <wchar.h>,
57 * and in <wctype.h>. Although these <wctype.h> classifications are as
58 * prescribed by ISO-C, their exposure in <wchar.h> is not; nonetheless,
59 * we replicate them here, for MSDN conformity.
60 */
61# include <wctype.h>
62
63 /* This is also necessary, to support the non-ANSI wchar.h declarations
64 * which MSDN identifies as being provided here.
65 */
66# include <sys/types.h>
67
68#endif /* !__STRICT_ANSI__ */
69
70#define WCHAR_MIN 0
71#define WCHAR_MAX 0xffff
72
73#define WEOF (wchar_t)(0xffff)
74
75#ifndef RC_INVOKED
76#define __WCHAR_H_SOURCED__
77/* ISO-C, POSIX, and Microsoft specify an overlap of content between
78 * <wchar.h> and other system header files; by inclusion of such other
79 * headers within this "__WCHAR_H_SOURCED__" scope, we may selectively
80 * retrieve the overlapping content, without requiring duplication of
81 * that content here; thus, from...
82 */
83#include "stdio.h"
84/* ...we obtain (possibly indirect) definitions and declarations for:
85 *
86 * macros NULL, FILENAME_MAX
87 * types size_t, wchar_t, wint_t, va_list (a.k.a. __VALIST), FILE
88 * types ssize_t, off_t, __off64_t, (conditionally, as needed)
89 *
90 * int fwprintf (FILE *, const wchar_t *, ...);
91 * int wprintf (const wchar_t *, ...);
92 * int vfwprintf (FILE *, const wchar_t *, __VALIST);
93 * int vwprintf (const wchar_t *, __VALIST);
94 * int snwprintf (wchar_t *, size_t, const wchar_t *, ...);
95 * int _snwprintf (wchar_t *, size_t, const wchar_t *, ...);
96 * int _vscwprintf (const wchar_t *, __VALIST);
97 * int _vsnwprintf (wchar_t *, size_t, const wchar_t *, __VALIST);
98 * int vsnwprintf (wchar_t *, size_t, const wchar_t *, __VALIST);
99 * int fwscanf (FILE *, const wchar_t *, ...);
100 * int wscanf (const wchar_t *, ...);
101 * int swscanf (const wchar_t *, const wchar_t *, ...);
102 * int vwscanf (const wchar_t *, __VALIST);
103 * int vfwscanf (FILE *, const wchar_t *, __VALIST);
104 * int vswscanf (const wchar_t *, const wchar_t *, __VALIST);
105 * wint_t fgetwc (FILE *);
106 * wint_t fputwc (wchar_t, FILE *);
107 * wint_t ungetwc (wchar_t, FILE *);
108 *
109 * The following pair of Microsoft functions conflict with their
110 * corresponding ISO-C prototypes; consequently they will not be
111 * declared when "__STRICT_ANSI__" checking is in effect:
112 *
113 * int swprintf (wchar_t *, const wchar_t *, ...);
114 * int vswprintf (wchar_t *, const wchar_t *, __VALIST);
115 *
116 * The following group of functions is specified by ISO-C, but
117 * their Microsoft implementations are available only if use of
118 * "__MSVCRT__" is specified:
119 *
120 * wchar_t * fgetws (wchar_t *, int, FILE *);
121 * int fputws (const wchar_t *, FILE *);
122 * wint_t getwc (FILE *);
123 * wint_t getwchar (void);
124 * wint_t putwc (wint_t, FILE *);
125 * wint_t putwchar (wint_t);
126 *
127 * The following group of functions is also dependent on use of
128 * "__MSVCRT__"; however, these are Microsoft specific, so they
129 * are not declared if "__STRICT_ANSI__" checking is specified:
130 *
131 * wchar_t * _getws (wchar_t *);
132 * int _putws (const wchar_t *);
133 * FILE * _wfdopen (int, const wchar_t *);
134 * FILE * _wfopen (const wchar_t *, const wchar_t *);
135 * FILE * _wfreopen (const wchar_t *, const wchar_t *, FILE *);
136 * FILE * _wfsopen (const wchar_t *, const wchar_t *, int);
137 * wchar_t * _wtmpnam (wchar_t *);
138 * wchar_t * _wtempnam (const wchar_t *, const wchar_t *);
139 * int _wrename (const wchar_t *, const wchar_t *);
140 * int _wremove (const wchar_t *);
141 * void _wperror (const wchar_t *);
142 * FILE * _wpopen (const wchar_t *, const wchar_t *);
143 *
144 *
145 * In similar fashion, from...
146 */
147#include "stdlib.h"
148/* ...we obtain prototypes for universally supported functions:
149 *
150 * long wcstol (const wchar_t *, wchar_t **, int);
151 * unsigned long wcstoul (const wchar_t *, wchar_t **, int);
152 * double wcstod (const wchar_t *, wchar_t **);
153 *
154 * The following are Microsoft specific, and require MSCVRT.DLL,
155 * or any of its non-free derivatives; they are not available to
156 * applications which use CRTDLL.DLL:
157 *
158 * wchar_t *_wgetenv (const wchar_t *);
159 * int _wputenv (const wchar_t *);
160 * void _wsearchenv (const wchar_t *, const wchar_t *, wchar_t *);
161 * int _wsystem (const wchar_t *);
162 * void _wmakepath (wchar_t *, const wchar_t *, const wchar_t *,
163 * const wchar_t *, const wchar_t *
164 * );
165 * void _wsplitpath (const wchar_t *, wchar_t *, wchar_t *,
166 * wchar_t *, wchar_t *
167 * );
168 * wchar_t *_wfullpath (wchar_t *, const wchar_t *, size_t);
169 *
170 * ...with this pair requiring either WinXP (or later), or one of
171 * the non-free MSVC runtimes from MSVCR70.DLL onwards:
172 *
173 * __int64 _wcstoi64 (const wchar_t *, wchar_t **, int);
174 * unsigned __int64 _wcstoui64 (const wchar_t *, wchar_t **, int);
175 *
176 * ...and this pair requiring Win-Vista (or later), or a non-free
177 * MSVC runtime from MSVCR80.DLL onwards:
178 *
179 * __int64 _wcstoi64_l (const wchar_t *, wchar_t **, int, _locale_t);
180 * unsigned __int64 _wcstoui64_l (const wchar_t *, wchar_t **,
181 * int, _locale_t);
182 * );
183 *
184 * ...while this pair are ISO-C99 standards, which are available
185 * in libmingwex.a, but not in any version of MSVCRT.DLL, (nor in
186 * any of its non-free derivatives prior to MSVCR120.DLL), nor in
187 * CRTDLL.DLL:
188 *
189 * float wcstof (const wchar_t *restrict, wchar_t **restrict);
190 * long double wcstold (const wchar_t *restrict, wchar_t **restrict);
191 *
192 *
193 * while from...
194 */
195#include "direct.h"
196/* ...we obtain prototypes for each of the following functions,
197 * (none of which are available when using CRTDLL.DLL):
198 *
199 * int _wchdir (const wchar_t *);
200 * wchar_t *_wgetcwd (wchar_t *, int);
201 * wchar_t *_wgetdcwd (int, wchar_t *, int);
202 * int _wmkdir (const wchar_t *);
203 * int _wrmdir (const wchar_t *);
204 *
205 *
206 * From...
207 */
208#include "sys/stat.h"
209/* ...we obtain function prototypes, and all associated data type
210 * definitions for this pair of actual functions, in all versions of
211 * MSVCRT.DLL, and its non-free derivatives preceding MSVCR80.DLL, (or
212 * inline replacement implementations for MSVCR80.DLL and later):
213 *
214 * int _wstat (const wchar_t *, struct _stat *);
215 * int _wstati64 (const wchar_t *, struct _stati64 *);
216 *
217 * ...this additional actual function, available in MSVCRT.DLL from
218 * Win2K onwards, or in non-free MSVCR61.DLL and again requiring an
219 * inline replacement from MSVCR80.DLL onwards:
220 *
221 * int _wstat64 (const wchar_t *, struct __stat64 *);
222 *
223 * ...and these actual functions, which are available only in non-free
224 * MSVCR80.DLL, and its later derivatives:
225 *
226 * int _wstat32 (const wchar_t *, struct __stat32 *);
227 * int _wstat32i64 (const wchar_t *, struct _stat32i64 *);
228 * int _wstat64i32 (const wchar_t *, struct _stat64i32 *);
229 *
230 *
231 * while from...
232 */
233#include "io.h"
234/* ...we obtain function prototypes for each of the following, which
235 * are available in all versions of MSVCRT.DLL, (and all its non-free
236 * derivatives), but are not supported by CRTDLL.DLL:
237 *
238 * int _waccess (const wchar_t *, int);
239 * int _wchmod (const wchar_t *, int);
240 * int _wcreat (const wchar_t *, int);
241 * int _wopen (const wchar_t *, int, ...);
242 * int _wsopen (const wchar_t *, int, int, ...);
243 * int _wunlink (const wchar_t *);
244 * wchar_t *_wmktemp (wchar_t *);
245 *
246 * ...and also function prototypes and definitions of all associated
247 * data types and manifest constants for the following, each of which
248 * is physically implemented in all versions of MSVCRT.DLL, and in each
249 * of its non-free variants prior to MSVCR80.DLL, or emulated by inline
250 * replacement functions for MSVCR80.DLL and later:
251 *
252 * intptr_t _wfindfirst (wchar_t *, struct _wfinddata_t *);
253 * int _wfindnext (intptr_t, struct _wfinddata_t *);
254 *
255 * intptr_t _wfindfirsti64 (wchar_t *, struct _wfinddatai64_t *);
256 * int _wfindnexti64 (intptr_t, struct _wfinddatai64_t *);
257 *
258 * ...this additional pair of functions, available in all versions of
259 * MSVCRT.DLL from Win2K, and non-free variants from MSVCR61.DLL:
260 *
261 * intptr_t _wfindfirst64 (wchar_t *, struct __wfinddata64_t *);
262 * int _wfindnext64 (intptr_t, struct __wfinddata64_t *);
263 *
264 * ...and these, which are only available in the non-free run-times
265 * from MSVCR80.DLL onwards:
266 *
267 * intptr_t _wfindfirst32 (wchar_t *, struct __wfinddata32_t *);
268 * int _wfindnext32 (intptr_t, struct __wfinddata32_t *);
269 *
270 * intptr_t _wfindfirst32i64 (wchar_t *, struct _wfinddata32i64_t *);
271 * int _wfindnext32i64 (intptr_t, struct _wfinddata32i64_t *);
272 *
273 * intptr_t _wfindfirst64i32 (wchar_t *, struct _wfinddata64i32_t *);
274 * int _wfindnext64i32 (intptr_t, struct _wfinddata64i32_t *);
275 *
276 * Additionally, although Microsoft's <wchar.h> may not declare it,
277 * this is required to complement all variants of the _wfindfirst()
278 * and _wfindnext() API, so we also declare the prototype for:
279 *
280 * int _findclose (intptr_t);
281 *
282 *
283 * and from...
284 */
285#include "time.h"
286/* ...we obtain an opaque forward declaration of:
287 *
288 * struct tm
289 *
290 * ...and prototype declarations for the following ISO-C99 function,
291 * (which is always provided):
292 *
293 * size_t wcsftime (wchar_t *, size_t, const wchar_t *, const struct tm *);
294 *
295 * ...together with the following non-ISO-C functions, (which are
296 * NOT exposed when "__STRICT_ANSI__" checking is enabled):
297 *
298 * wchar_t *_wctime (const time_t *);
299 * wchar_t *_wasctime (const struct tm *);
300 * wchar_t *_wstrdate (wchar_t *);
301 * wchar_t *_wstrtime (wchar_t *);
302 *
303 * Of the preceding group, we also note that, while it remains in
304 * all versions of MSVCRT.DLL, (using a strictly 32-bit data type
305 * to represent its "time_t" argument), the _wctime() function is
306 * NOT present in MSVCR80.DLL, and later versions of the non-free
307 * MSVC runtime libraries, in which it is replaced by either of:
308 *
309 * wchar_t *_wctime64 (const __time64_t *);
310 * wchar_t *_wctime32 (const __time32_t *);
311 *
312 * ...with the actual replacement being chosen at compile time, on
313 * the basis of the user specified "_USE_32BIT_TIME_T" feature test
314 * macro, (a Microsoft specific, brain damaged concept), which maps
315 * _wctime() itself, as an in-line alias for its corresponding
316 * replacement library function.
317 *
318 *
319 * Also, from...
320 */
321#include "locale.h"
322/* ...we obtain the declaration for:
323 *
324 * wchar_t *_wsetlocale (int, const wchar_t *);
325 *
326 *
327 * and from...
328 */
329#include "process.h"
330/* ...we obtain function prototypes for:
331 *
332 * intptr_t _wexecl (const wchar_t *, const wchar_t *, ...);
333 * intptr_t _wexecle (const wchar_t *, const wchar_t *, ...);
334 * intptr_t _wexeclp (const wchar_t *, const wchar_t *, ...);
335 * intptr_t _wexeclpe (const wchar_t *, const wchar_t *, ...);
336 *
337 * intptr_t _wexecv (const wchar_t *, const wchar_t * const *);
338 * intptr_t _wexecve (
339 * const wchar_t *, const wchar_t * const *, const wchar_t * const *
340 * );
341 * intptr_t _wexecvp (const wchar_t *, const wchar_t * const *);
342 * intptr_t _wexecvpe (
343 * const wchar_t *, const wchar_t * const *, const wchar_t * const *
344 * );
345 *
346 * intptr_t _wspawnl (int, const wchar_t *, const wchar_t *, ...);
347 * intptr_t _wspawnle (int, const wchar_t *, const wchar_t *, ...);
348 * intptr_t _wspawnlp (int, const wchar_t *, const wchar_t *, ...);
349 * intptr_t _wspawnlpe (int, const wchar_t *, const wchar_t *, ...);
350 *
351 * intptr_t _wspawnv (int, const wchar_t *, const wchar_t * const *);
352 * intptr_t _wspawnve (
353 * int, const wchar_t *, const wchar_t * const *, const wchar_t * const *
354 * );
355 * intptr_t _wspawnvp (int, const wchar_t *, const wchar_t * const *);
356 * intptr_t _wspawnvpe (
357 * int, const wchar_t *, const wchar_t * const *, const wchar_t * const *
358 * );
359 *
360 */
361_BEGIN_C_DECLS
362
363/* Wide character string functions must be specified here, as required
364 * by the ISO-C Standard; however, MSVC contravenes this standard by also
365 * requiring them to appear in <string.h>. We declare them here, where
366 * they rightfully belong, but we also arrange for them to be available
367 * for selective inclusion by <string.h>; to facilitate this, we must
368 * change the declarative condition...
369 */
370#endif /* ! RC_INVOKED */
371#endif /* !__STRING_H_SOURCED__ */
372#if ! (defined RC_INVOKED || (defined _WCHAR_H && defined _STRING_H))
373/* ...such that these declarations are exposed when either _WCHAR_H, or
374 * _STRING_H is defined, (but not both, since that would indicate that
375 * these declarations have already been processed).
376 *
377 *
378 * Wide character versions of the ISO-C standard string functions.
379 */
380_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *wcscat (wchar_t *, const wchar_t *);
381_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *wcschr (const wchar_t *, wchar_t);
382_CRTIMP __cdecl __MINGW_NOTHROW int wcscmp (const wchar_t *, const wchar_t *);
383_CRTIMP __cdecl __MINGW_NOTHROW int wcscoll (const wchar_t *, const wchar_t *);
384_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *wcscpy (wchar_t *, const wchar_t *);
385_CRTIMP __cdecl __MINGW_NOTHROW size_t wcscspn (const wchar_t *, const wchar_t *);
386_CRTIMP __cdecl __MINGW_NOTHROW size_t wcslen (const wchar_t *);
387_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *wcsncat (wchar_t *, const wchar_t *, size_t);
388_CRTIMP __cdecl __MINGW_NOTHROW int wcsncmp (const wchar_t *, const wchar_t *, size_t);
389_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *wcsncpy (wchar_t *, const wchar_t *, size_t);
390_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *wcspbrk (const wchar_t *, const wchar_t *);
391_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *wcsrchr (const wchar_t *, wchar_t);
392_CRTIMP __cdecl __MINGW_NOTHROW size_t wcsspn (const wchar_t *, const wchar_t *);
393_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *wcsstr (const wchar_t *, const wchar_t *);
394_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *wcstok (wchar_t *, const wchar_t *);
395_CRTIMP __cdecl __MINGW_NOTHROW size_t wcsxfrm (wchar_t *, const wchar_t *, size_t);
396
397#ifndef __STRICT_ANSI__
398/* UTF-16LE versions of non-ANSI string functions provided by CRTDLL.DLL
399 */
400_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *_wcsdup (const wchar_t *);
401_CRTIMP __cdecl __MINGW_NOTHROW int _wcsicmp (const wchar_t *, const wchar_t *);
402_CRTIMP __cdecl __MINGW_NOTHROW int _wcsicoll (const wchar_t *, const wchar_t *);
403_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *_wcslwr (wchar_t*);
404_CRTIMP __cdecl __MINGW_NOTHROW int _wcsnicmp (const wchar_t *, const wchar_t *, size_t);
405_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *_wcsnset (wchar_t *, wchar_t, size_t);
406_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *_wcsrev (wchar_t *);
407_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *_wcsset (wchar_t *, wchar_t);
408_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *_wcsupr (wchar_t *);
409
410#ifdef __MSVCRT__
411_CRTIMP __cdecl __MINGW_NOTHROW int _wcsncoll (const wchar_t *, const wchar_t *, size_t);
412_CRTIMP __cdecl __MINGW_NOTHROW int _wcsnicoll (const wchar_t *, const wchar_t *, size_t);
413
414/* A wide character counterpart to the strerror() API was introduced in
415 * MSVCR70.DLL, and subsequently back-ported to MSVCRT.DLL in WinXP.
416 */
417#if __MSVCRT_VERSION__ >= __MSVCR70_DLL || NTDDI_VERSION >= NTDDI_WINXP
418 /*
419 * These are are the wide character counterparts to the strerror()
420 * function itself, and the _strerror() function, respectively.
421 */
422_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *_wcserror (int);
423_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *__wcserror (const wchar_t *);
424
425#endif /* MSVCR70.DLL || WinXP */
426#endif /* __MSVCRT__ */
427
428/* MSVCRT.DLL provides neither _wcscmpi() nor wcscmpi(); the heritage
429 * is uncertain, but for the convenience, (and portability), of legacy
430 * applications which assume wcscmpi() should be available:
431 */
432#define _wcscmpi _wcsicmp
433int __cdecl __MINGW_NOTHROW wcscmpi (const wchar_t *, const wchar_t *);
434
435#ifndef __NO_INLINE__
436__CRT_ALIAS __JMPSTUB__(( FUNCTION = wcscmpi, REMAPPED = _wcsicmp ))
437 int wcscmpi (const wchar_t *__ws1, const wchar_t *__ws2)
438 { return _wcsicmp (__ws1, __ws2); }
439#endif /* __NO_INLINE__ */
440
441#ifndef _NO_OLDNAMES
442/* Older CRTDLL.DLL versions may have provided these alternatively named
443 * functions; we continue to support them, via the OLDNAME libraries:
444 */
445_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *wcsdup (const wchar_t *);
446_CRTIMP __cdecl __MINGW_NOTHROW int wcsicmp (const wchar_t *, const wchar_t *);
447_CRTIMP __cdecl __MINGW_NOTHROW int wcsicoll (const wchar_t *, const wchar_t *);
448_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *wcslwr (wchar_t *);
449_CRTIMP __cdecl __MINGW_NOTHROW int wcsnicmp (const wchar_t *, const wchar_t *, size_t);
450_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *wcsnset (wchar_t *, wchar_t, size_t);
451_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *wcsrev (wchar_t *);
452_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *wcsset (wchar_t *, wchar_t);
453_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *wcsupr (wchar_t *);
454
455#endif /* !_NO_OLDNAMES */
456#endif /* !__STRICT_ANSI__ */
457
458/* This completes the set of declarations which are to be duplicated by
459 * inclusion of <string.h>; revert the declarative condition, to make it
460 * specific to <wchar.h> alone.
461 */
462#endif /* !(RC_INVOKED || (_WCHAR_H && _STRING_H)) */
463#if defined _WCHAR_H && ! defined RC_INVOKED
464
465#ifndef __STRICT_ANSI__
466typedef wchar_t _Wint_t;
467#endif
468
469typedef int mbstate_t;
470
471/* The following multi-byte character conversion functions are
472 * implemented in libmingwex.a, (and maybe also in some non-free
473 * Microsoft libraries, such as MSVCP60.DLL and later).
474 */
475__cdecl __MINGW_NOTHROW wint_t btowc (int);
476__cdecl __MINGW_NOTHROW int wctob (wint_t);
477
478__cdecl __MINGW_NOTHROW
479size_t mbrlen (const char *__restrict__, size_t, mbstate_t *__restrict__);
480
481__cdecl __MINGW_NOTHROW size_t mbrtowc
482(wchar_t *__restrict__, const char *__restrict__, size_t, mbstate_t *__restrict__);
483
484__cdecl __MINGW_NOTHROW size_t mbsrtowcs
485(wchar_t *__restrict__, const char **__restrict__, size_t, mbstate_t *__restrict__);
486
487__cdecl __MINGW_NOTHROW
488size_t wcrtomb (char * __restrict__, wchar_t, mbstate_t *__restrict__);
489
490__cdecl __MINGW_NOTHROW size_t wcsrtombs
491(char *__restrict__, const wchar_t **__restrict__, size_t, mbstate_t *__restrict__);
492
493#ifdef _ISOC99_SOURCE
494/* These ISO-C99 functions are implemented in libmingwex.a,
495 * or, in some cases, by inline stubs.
496 */
497__cdecl __MINGW_NOTHROW int fwide (FILE *, int);
498__cdecl __MINGW_NOTHROW int mbsinit (const mbstate_t *);
499
500#ifndef __NO_INLINE__
501__CRT_INLINE __cdecl __MINGW_NOTHROW
502int fwide (FILE *__UNUSED_PARAM(stream), int mode)
503 { return mode; } /* Nothing to do */
504
505__CRT_INLINE __cdecl __MINGW_NOTHROW
506int mbsinit (const mbstate_t *__UNUSED_PARAM(ps))
507 { return 1; }
508#endif
509
510__cdecl __MINGW_NOTHROW wchar_t *wmemset (wchar_t *, wchar_t, size_t);
511__cdecl __MINGW_NOTHROW wchar_t *wmemchr (const wchar_t *, wchar_t, size_t);
512
513/* FIXME: what makes this so different from every other function
514 * in this group? Why is it not qualified with the __cdecl, and
515 * __MINGW_NOTHROW attributes?
516 */
517int wmemcmp (const wchar_t *, const wchar_t *, size_t);
518
519__cdecl __MINGW_NOTHROW
520wchar_t *wmemcpy (wchar_t *__restrict__, const wchar_t *__restrict__, size_t);
521
522__cdecl __MINGW_NOTHROW wchar_t *wmemmove (wchar_t *, const wchar_t *, size_t);
523
524__cdecl __MINGW_NOTHROW
525long long wcstoll (const wchar_t *__restrict__, wchar_t **__restrict__, int);
526
527__cdecl __MINGW_NOTHROW unsigned long long wcstoull
528(const wchar_t *__restrict__, wchar_t **__restrict__, int);
529#endif /* _ISOC99_SOURCE */
530
531_END_C_DECLS
532
533#undef __WCHAR_H_SOURCED__
534#endif /* _WCHAR_H && ! RC_INVOKED */
535#endif /* !_WCHAR_H: $RCSfile: wchar.h,v $: end of file */
Note: See TracBrowser for help on using the repository browser.