OSDN Git Service

Prepare and tag mingwrt-3.22.2 patch release.
[mingw/mingw-org-wsl.git] / mingwrt / include / wchar.h
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$
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...
194  */
195 #ifndef __STRICT_ANSI__
196 /* ...when NOT compiling with "__STRICT_ANSI__" conformity checking,
197  * from...
198  */
199 #include "direct.h"
200 /* ...we obtain prototypes for each of the following functions,
201  * (none of which are available when using CRTDLL.DLL):
202  *
203  *  int _wchdir (const wchar_t *);
204  *  wchar_t *_wgetcwd (wchar_t *, int);
205  *  wchar_t *_wgetdcwd (int, wchar_t *, int);
206  *  int _wmkdir (const wchar_t *);
207  *  int _wrmdir (const wchar_t *);
208  *
209  *
210  * while from...
211  */
212 #include "sys/stat.h"
213 /* ...we obtain function prototypes, and all associated data type
214  * definitions for this pair of actual functions, in all versions of
215  * MSVCRT.DLL, and its non-free derivatives preceding MSVCR80.DLL, (or
216  * inline replacement implementations for MSVCR80.DLL and later):
217  *
218  *  int _wstat (const wchar_t *, struct _stat *);
219  *  int _wstati64 (const wchar_t *, struct _stati64 *);
220  *
221  * ...this additional actual function, available in MSVCRT.DLL from
222  * Win2K onwards, or in non-free MSVCR61.DLL and again requiring an
223  * inline replacement from MSVCR80.DLL onwards:
224  *
225  *  int _wstat64 (const wchar_t *, struct __stat64 *);
226  *
227  * ...and these actual functions, which are available only in non-free
228  * MSVCR80.DLL, and its later derivatives:
229  *
230  *  int _wstat32 (const wchar_t *, struct __stat32 *);
231  *  int _wstat32i64 (const wchar_t *, struct _stat32i64 *);
232  *  int _wstat64i32 (const wchar_t *, struct _stat64i32 *);
233  *
234  *
235  * and from...
236  */
237 #include "io.h"
238 /* ...we obtain function prototypes for each of the following, which
239  * are available in all versions of MSVCRT.DLL, (and all its non-free
240  * derivatives), but are not supported by CRTDLL.DLL:
241  *
242  *  int _waccess (const wchar_t *, int);
243  *  int _wchmod (const wchar_t *, int);
244  *  int _wcreat (const wchar_t *, int);
245  *  int _wopen (const wchar_t *, int, ...);
246  *  int _wsopen (const wchar_t *, int, int, ...);
247  *  int _wunlink (const wchar_t *);
248  *  wchar_t *_wmktemp (wchar_t *);
249  *
250  * ...and also function prototypes and definitions of all associated
251  * data types and manifest constants for the following, each of which
252  * is physically implemented in all versions of MSVCRT.DLL, and in each
253  * of its non-free variants prior to MSVCR80.DLL, or emulated by inline
254  * replacement functions for MSVCR80.DLL and later:
255  *
256  *  intptr_t _wfindfirst (wchar_t *, struct _wfinddata_t *);
257  *  int _wfindnext (intptr_t, struct _wfinddata_t *);
258  *
259  *  intptr_t _wfindfirsti64 (wchar_t *, struct _wfinddatai64_t *);
260  *  int _wfindnexti64 (intptr_t, struct _wfinddatai64_t *);
261  *
262  * ...this additional pair of functions, available in all versions of
263  * MSVCRT.DLL from Win2K, and non-free variants from MSVCR61.DLL:
264  *
265  *  intptr_t _wfindfirst64 (wchar_t *, struct __wfinddata64_t *);
266  *  int _wfindnext64 (intptr_t, struct __wfinddata64_t *);
267  *
268  * ...and these, which are only available in the non-free run-times
269  * from MSVCR80.DLL onwards:
270  *
271  *  intptr_t _wfindfirst32 (wchar_t *, struct __wfinddata32_t *);
272  *  int _wfindnext32 (intptr_t, struct __wfinddata32_t *);
273  *
274  *  intptr_t _wfindfirst32i64 (wchar_t *, struct _wfinddata32i64_t *);
275  *  int _wfindnext32i64 (intptr_t, struct _wfinddata32i64_t *);
276  *
277  *  intptr_t _wfindfirst64i32 (wchar_t *, struct _wfinddata64i32_t *);
278  *  int _wfindnext64i32 (intptr_t, struct _wfinddata64i32_t *);
279  *
280  * Additionally, although Microsoft's <wchar.h> may not declare it,
281  * this is required to complement all variants of the _wfindfirst()
282  * and _wfindnext() API, so we also declare the prototype for:
283  *
284  *  int _findclose (intptr_t);
285  */
286 #endif  /* !__STRICT_ANSI__ */
287
288 /* From...
289  */
290 #include "time.h"
291 /* ...we always obtain an opaque forward declaration of:
292  *
293  *  struct tm
294  *
295  * ...and prototype declarations for the following ISO-C99 function,
296  * (which is always provided):
297  *
298  *  size_t wcsftime (wchar_t *, size_t, const wchar_t *, const struct tm *);
299  *
300  * ...together with the following non-ISO-C functions, (which are
301  * NOT exposed when "__STRICT_ANSI__" checking is enabled):
302  *
303  *  wchar_t *_wctime (const time_t *);
304  *  wchar_t *_wasctime (const struct tm *);
305  *  wchar_t *_wstrdate (wchar_t *);
306  *  wchar_t *_wstrtime (wchar_t *);
307  *
308  * Of the preceding group, we also note that, while it remains in
309  * all versions of MSVCRT.DLL, (using a strictly 32-bit data type
310  * to represent its "time_t" argument), the _wctime() function is
311  * NOT present in MSVCR80.DLL, and later versions of the non-free
312  * MSVC runtime libraries, in which it is replaced by either of:
313  *
314  *  wchar_t *_wctime64 (const __time64_t *);
315  *  wchar_t *_wctime32 (const __time32_t *);
316  *
317  * ...with the actual replacement being chosen at compile time, on
318  * the basis of the user specified "_USE_32BIT_TIME_T" feature test
319  * macro, (a Microsoft specific, brain damaged concept), which maps
320  * _wctime() itself, as an in-line alias for its corresponding
321  * replacement library function.
322  *
323  */
324 #ifndef __STRICT_ANSI__
325 /* Once again, when NOT compiling with "__STRICT_ANSI__" conformity
326  * checking, from...
327  */
328 #include "locale.h"
329 /* ...we obtain the declaration for:
330  *
331  *   wchar_t *_wsetlocale (int, const wchar_t *);
332  *
333  *
334  * and from...
335  */
336 #include "process.h"
337 /* ...we obtain function prototypes for:
338  *
339  *  intptr_t _wexecl (const wchar_t *, const wchar_t *, ...);
340  *  intptr_t _wexecle (const wchar_t *, const wchar_t *, ...);
341  *  intptr_t _wexeclp (const wchar_t *, const wchar_t *, ...);
342  *  intptr_t _wexeclpe (const wchar_t *, const wchar_t *, ...);
343  *
344  *  intptr_t _wexecv (const wchar_t *, const wchar_t * const *);
345  *  intptr_t _wexecve (
346  *    const wchar_t *, const wchar_t * const *, const wchar_t * const *
347  *   );
348  *  intptr_t _wexecvp (const wchar_t *, const wchar_t * const *);
349  *  intptr_t _wexecvpe (
350  *    const wchar_t *, const wchar_t * const *, const wchar_t * const *
351  *   );
352  *
353  *  intptr_t _wspawnl (int, const wchar_t *, const wchar_t *, ...);
354  *  intptr_t _wspawnle (int, const wchar_t *, const wchar_t *, ...);
355  *  intptr_t _wspawnlp (int, const wchar_t *, const wchar_t *, ...);
356  *  intptr_t _wspawnlpe (int, const wchar_t *, const wchar_t *, ...);
357  *
358  *  intptr_t _wspawnv (int, const wchar_t *, const wchar_t * const *);
359  *  intptr_t _wspawnve (
360  *    int, const wchar_t *, const wchar_t * const *, const wchar_t * const *
361  *   );
362  *  intptr_t _wspawnvp (int, const wchar_t *, const wchar_t * const *);
363  *  intptr_t _wspawnvpe (
364  *    int, const wchar_t *, const wchar_t * const *, const wchar_t * const *
365  *   );
366  *
367  */
368 #endif  /* !__STRICT_ANSI__ */
369
370 _BEGIN_C_DECLS
371
372 /* Wide character string functions must be specified here, as required
373  * by the ISO-C Standard; however, MSVC contravenes this standard by also
374  * requiring them to appear in <string.h>.  We declare them here, where
375  * they rightfully belong, but we also arrange for them to be available
376  * for selective inclusion by <string.h>; to facilitate this, we must
377  * change the declarative condition...
378  */
379 #endif  /* ! RC_INVOKED */
380 #endif  /* !__STRING_H_SOURCED__ */
381 #if ! (defined RC_INVOKED || (defined _WCHAR_H && defined _STRING_H))
382 /* ...such that these declarations are exposed when either _WCHAR_H, or
383  * _STRING_H is defined, (but not both, since that would indicate that
384  * these declarations have already been processed).
385  *
386  *
387  * Wide character versions of the ISO-C standard string functions.
388  */
389 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcscat (wchar_t *, const wchar_t *);
390 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcschr (const wchar_t *, wchar_t);
391 _CRTIMP __cdecl __MINGW_NOTHROW  int wcscmp (const wchar_t *, const wchar_t *);
392 _CRTIMP __cdecl __MINGW_NOTHROW  int wcscoll (const wchar_t *, const wchar_t *);
393 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcscpy (wchar_t *, const wchar_t *);
394 _CRTIMP __cdecl __MINGW_NOTHROW  size_t wcscspn (const wchar_t *, const wchar_t *);
395 _CRTIMP __cdecl __MINGW_NOTHROW  size_t wcslen (const wchar_t *);
396 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcsncat (wchar_t *, const wchar_t *, size_t);
397 _CRTIMP __cdecl __MINGW_NOTHROW  int wcsncmp (const wchar_t *, const wchar_t *, size_t);
398 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcsncpy (wchar_t *, const wchar_t *, size_t);
399 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcspbrk (const wchar_t *, const wchar_t *);
400 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcsrchr (const wchar_t *, wchar_t);
401 _CRTIMP __cdecl __MINGW_NOTHROW  size_t wcsspn (const wchar_t *, const wchar_t *);
402 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcsstr (const wchar_t *, const wchar_t *);
403 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcstok (wchar_t *, const wchar_t *);
404 _CRTIMP __cdecl __MINGW_NOTHROW  size_t wcsxfrm (wchar_t *, const wchar_t *, size_t);
405
406 #ifndef __STRICT_ANSI__
407 /* UTF-16LE versions of non-ANSI string functions provided by CRTDLL.DLL
408  */
409 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *_wcsdup (const wchar_t *);
410 _CRTIMP __cdecl __MINGW_NOTHROW  int _wcsicmp (const wchar_t *, const wchar_t *);
411 _CRTIMP __cdecl __MINGW_NOTHROW  int _wcsicoll (const wchar_t *, const wchar_t *);
412 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *_wcslwr (wchar_t*);
413 _CRTIMP __cdecl __MINGW_NOTHROW  int _wcsnicmp (const wchar_t *, const wchar_t *, size_t);
414 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *_wcsnset (wchar_t *, wchar_t, size_t);
415 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *_wcsrev (wchar_t *);
416 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *_wcsset (wchar_t *, wchar_t);
417 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *_wcsupr (wchar_t *);
418
419 #ifdef __MSVCRT__
420 _CRTIMP __cdecl __MINGW_NOTHROW  int _wcsncoll (const wchar_t *, const wchar_t *, size_t);
421 _CRTIMP __cdecl __MINGW_NOTHROW  int _wcsnicoll (const wchar_t *, const wchar_t *, size_t);
422
423 /* A wide character counterpart to the strerror() API was introduced in
424  * MSVCR70.DLL, and subsequently back-ported to MSVCRT.DLL in WinXP.
425  */
426 #if __MSVCRT_VERSION__ >= __MSVCR70_DLL || NTDDI_VERSION >= NTDDI_WINXP
427  /*
428   * These are are the wide character counterparts to the strerror()
429   * function itself, and the _strerror() function, respectively.
430   */
431 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *_wcserror (int);
432 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *__wcserror (const wchar_t *);
433
434 #endif  /* MSVCR70.DLL || WinXP */
435 #endif  /* __MSVCRT__ */
436
437 /* MSVCRT.DLL provides neither _wcscmpi() nor wcscmpi(); the heritage
438  * is uncertain, but for the convenience, (and portability), of legacy
439  * applications which assume wcscmpi() should be available:
440  */
441 #define _wcscmpi _wcsicmp
442 int __cdecl __MINGW_NOTHROW  wcscmpi (const wchar_t *, const wchar_t *);
443
444 #ifndef __NO_INLINE__
445 __CRT_ALIAS __JMPSTUB__(( FUNCTION = wcscmpi, REMAPPED = _wcsicmp ))
446   int wcscmpi (const wchar_t *__ws1, const wchar_t *__ws2)
447   { return _wcsicmp (__ws1, __ws2); }
448 #endif  /* __NO_INLINE__ */
449
450 #ifndef _NO_OLDNAMES
451 /* Older CRTDLL.DLL versions may have provided these alternatively named
452  * functions; we continue to support them, via the OLDNAME libraries:
453  */
454 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcsdup (const wchar_t *);
455 _CRTIMP __cdecl __MINGW_NOTHROW  int wcsicmp (const wchar_t *, const wchar_t *);
456 _CRTIMP __cdecl __MINGW_NOTHROW  int wcsicoll (const wchar_t *, const wchar_t *);
457 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcslwr (wchar_t *);
458 _CRTIMP __cdecl __MINGW_NOTHROW  int wcsnicmp (const wchar_t *, const wchar_t *, size_t);
459 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcsnset (wchar_t *, wchar_t, size_t);
460 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcsrev (wchar_t *);
461 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcsset (wchar_t *, wchar_t);
462 _CRTIMP __cdecl __MINGW_NOTHROW  wchar_t *wcsupr (wchar_t *);
463
464 #endif  /* !_NO_OLDNAMES */
465 #endif  /* !__STRICT_ANSI__ */
466
467 /* This completes the set of declarations which are to be duplicated by
468  * inclusion of <string.h>; revert the declarative condition, to make it
469  * specific to <wchar.h> alone.
470  */
471 #endif  /* !(RC_INVOKED || (_WCHAR_H && _STRING_H)) */
472 #if defined _WCHAR_H && ! defined RC_INVOKED
473
474 #ifndef __STRICT_ANSI__
475 typedef wchar_t  _Wint_t;
476 #endif
477
478 typedef int mbstate_t;
479
480 /* The following multi-byte character conversion functions are
481  * implemented in libmingwex.a, (and maybe also in some non-free
482  * Microsoft libraries, such as MSVCP60.DLL and later).
483  */
484 __cdecl __MINGW_NOTHROW  wint_t btowc (int);
485 __cdecl __MINGW_NOTHROW  int wctob (wint_t);
486
487 __cdecl __MINGW_NOTHROW
488 size_t mbrlen (const char *__restrict__, size_t, mbstate_t *__restrict__);
489
490 __cdecl __MINGW_NOTHROW  size_t mbrtowc
491 (wchar_t *__restrict__, const char *__restrict__, size_t, mbstate_t *__restrict__);
492
493 __cdecl __MINGW_NOTHROW  size_t mbsrtowcs
494 (wchar_t *__restrict__, const char **__restrict__, size_t, mbstate_t *__restrict__);
495
496 __cdecl __MINGW_NOTHROW
497 size_t wcrtomb (char * __restrict__, wchar_t, mbstate_t *__restrict__);
498
499 __cdecl __MINGW_NOTHROW  size_t wcsrtombs
500 (char *__restrict__, const wchar_t **__restrict__, size_t, mbstate_t *__restrict__);
501
502 #if defined _ISOC99_SOURCE || defined __cplusplus
503 /* These ISO-C99 functions are implemented in libmingwex.a,
504  * or, in some cases, as inline stubs; while provided as MinGW
505  * extensions to support ISO-C99, they are also required by
506  * GNU C++.
507  */
508 __cdecl __MINGW_NOTHROW  int fwide (FILE *, int);
509 __cdecl __MINGW_NOTHROW  int mbsinit (const mbstate_t *);
510
511 #ifndef __NO_INLINE__
512 __CRT_INLINE __cdecl __MINGW_NOTHROW
513 int fwide (FILE *__UNUSED_PARAM(stream), int mode)
514   { return mode; } /* Nothing to do  */
515
516 __CRT_INLINE __cdecl __MINGW_NOTHROW
517 int mbsinit (const mbstate_t *__UNUSED_PARAM(ps))
518   { return 1; }
519 #endif
520
521 __cdecl __MINGW_NOTHROW  wchar_t *wmemset (wchar_t *, wchar_t, size_t);
522 __cdecl __MINGW_NOTHROW  wchar_t *wmemchr (const wchar_t *, wchar_t, size_t);
523
524 /* FIXME: what makes this so different from every other function
525  * in this group?  Why is it not qualified with the __cdecl, and
526  * __MINGW_NOTHROW attributes?
527  */
528 int wmemcmp (const wchar_t *, const wchar_t *, size_t);
529
530 __cdecl __MINGW_NOTHROW
531 wchar_t *wmemcpy (wchar_t *__restrict__, const wchar_t *__restrict__, size_t);
532
533 __cdecl __MINGW_NOTHROW  wchar_t *wmemmove (wchar_t *, const wchar_t *, size_t);
534
535 __cdecl __MINGW_NOTHROW
536 long long wcstoll (const wchar_t *__restrict__, wchar_t **__restrict__, int);
537
538 __cdecl __MINGW_NOTHROW  unsigned long long wcstoull
539 (const wchar_t *__restrict__, wchar_t **__restrict__, int);
540 #endif /* _ISOC99_SOURCE */
541
542 _END_C_DECLS
543
544 #undef __WCHAR_H_SOURCED__
545 #endif  /* _WCHAR_H && ! RC_INVOKED */
546 #endif  /* !_WCHAR_H: $RCSfile$: end of file */