1 /**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6 #ifndef _INC_WCHAR
7 #define _INC_WCHAR
8
9 #include <crtdefs.h>
10
11 #if __USE_MINGW_ANSI_STDIO && !defined (__USE_MINGW_STRTOX)
12 #define __USE_MINGW_STRTOX 1
13 #endif
14
15 #if defined(__LIBMSVCRT__)
16 /* When building mingw-w64, this should be blank. */
17 #define _SECIMP
18 #else
19 #ifndef _SECIMP
20 #define _SECIMP __declspec(dllimport)
21 #endif /* _SECIMP */
22 #endif /* defined(_CRTBLD) || defined(__LIBMSVCRT__) */
23
24 #pragma pack(push,_CRT_PACKING)
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 #ifndef WCHAR_MIN /* also in stdint.h */
31 #define WCHAR_MIN 0U
32 #define WCHAR_MAX 0xffffU
33 #endif
34
35 #ifndef WEOF
36 #define WEOF (wint_t)(0xFFFF)
37 #endif
38
39 #ifndef _FILE_DEFINED
40 struct _iobuf {
41 char *_ptr;
42 int _cnt;
43 char *_base;
44 int _flag;
45 int _file;
46 int _charbuf;
47 int _bufsiz;
48 char *_tmpfname;
49 };
50 typedef struct _iobuf FILE;
51 #define _FILE_DEFINED
52 #endif
53
54 _CRTIMP FILE *__cdecl __acrt_iob_func(unsigned index);
55 #ifndef _STDIO_DEFINED
56 #ifdef _WIN64
57 _CRTIMP FILE *__cdecl __iob_func(void);
58 #define _iob __iob_func()
59 #else
60 #ifdef _MSVCRT_
61 extern FILE _iob[]; /* A pointer to an array of FILE */
62 #define __iob_func() (_iob)
63 #else
64 extern FILE (* __MINGW_IMP_SYMBOL(_iob))[]; /* A pointer to an array of FILE */
65 #define __iob_func() (* __MINGW_IMP_SYMBOL(_iob))
66 #endif
67 #endif
68
69 #define _iob __iob_func()
70 #endif
71
72 #ifndef _STDSTREAM_DEFINED
73 #define stdin (__acrt_iob_func(0))
74 #define stdout (__acrt_iob_func(1))
75 #define stderr (__acrt_iob_func(2))
76 #define _STDSTREAM_DEFINED
77 #endif
78
79 #ifndef _FSIZE_T_DEFINED
80 typedef unsigned long _fsize_t;
81 #define _FSIZE_T_DEFINED
82 #endif
83
84 #ifndef _WFINDDATA_T_DEFINED
85 struct _wfinddata32_t {
86 unsigned attrib;
87 __time32_t time_create;
88 __time32_t time_access;
89 __time32_t time_write;
90 _fsize_t size;
91 wchar_t name[260];
92 };
93
94 struct _wfinddata32i64_t {
95 unsigned attrib;
96 __time32_t time_create;
97 __time32_t time_access;
98 __time32_t time_write;
99 __MINGW_EXTENSION __int64 size;
100 wchar_t name[260];
101 };
102
103 struct _wfinddata64i32_t {
104 unsigned attrib;
105 __time64_t time_create;
106 __time64_t time_access;
107 __time64_t time_write;
108 _fsize_t size;
109 wchar_t name[260];
110 };
111
112 struct _wfinddata64_t {
113 unsigned attrib;
114 __time64_t time_create;
115 __time64_t time_access;
116 __time64_t time_write;
117 __MINGW_EXTENSION __int64 size;
118 wchar_t name[260];
119 };
120 /* #endif */
121
122 #ifdef _USE_32BIT_TIME_T
123 #define _wfinddata_t _wfinddata32_t
124 #define _wfinddatai64_t _wfinddata32i64_t
125
126 #define _wfindfirst _wfindfirst32
127 #define _wfindnext _wfindnext32
128 #define _wfindfirst32i64 _wfindfirsti64
129 #define _wfindnext32i64 _wfindnexti64
130 #else
131 #define _wfinddata_t _wfinddata64i32_t
132 #define _wfinddatai64_t _wfinddata64_t
133
134 #define _wfindfirst _wfindfirst64i32
135 #define _wfindnext _wfindnext64i32
136 #define _wfindfirsti64 _wfindfirst64
137 #define _wfindnexti64 _wfindnext64
138 #endif
139
140 #define _WFINDDATA_T_DEFINED
141 #endif
142
143 #ifndef NULL
144 #ifdef __cplusplus
145 #ifndef _WIN64
146 #define NULL 0
147 #else
148 #define NULL 0LL
149 #endif /* W64 */
150 #else
151 #define NULL ((void *)0)
152 #endif
153 #endif
154
155 #ifndef _CONST_RETURN
156 #define _CONST_RETURN
157 #endif
158
159 #define _WConst_return _CONST_RETURN
160
161 #ifndef _CRT_CTYPEDATA_DEFINED
162 #define _CRT_CTYPEDATA_DEFINED
163 #ifndef _CTYPE_DISABLE_MACROS
164
165 #ifndef __PCTYPE_FUNC
166 #define __PCTYPE_FUNC __pctype_func()
167 #ifdef _MSVCRT_
168 #define __pctype_func() (_pctype)
169 #else
170 #if __MSVCRT_VERSION__ >= 0x1400
171 _CRTIMP unsigned short* __pctype_func(void);
172 #else
173 #define __pctype_func() (* __MINGW_IMP_SYMBOL(_pctype))
174 #endif
175 #endif
176 #endif
177
178 #ifndef _pctype
179 #ifdef _MSVCRT_
180 extern unsigned short *_pctype;
181 #else
182 #if __MSVCRT_VERSION__ >= 0x1400
183 #define _pctype (__pctype_func())
184 #else
185 extern unsigned short ** __MINGW_IMP_SYMBOL(_pctype);
186 #define _pctype (* __MINGW_IMP_SYMBOL(_pctype))
187 #endif
188 #endif
189 #endif
190 #endif
191 #endif
192
193 #ifndef _CRT_WCTYPEDATA_DEFINED
194 #define _CRT_WCTYPEDATA_DEFINED
195 #ifndef _CTYPE_DISABLE_MACROS
196 #ifndef _wctype
197 #ifdef _MSVCRT_
198 extern unsigned short *_wctype;
199 #else
200 extern unsigned short ** __MINGW_IMP_SYMBOL(_wctype);
201 #define _wctype (* __MINGW_IMP_SYMBOL(_wctype))
202 #endif
203 #endif
204
205 #ifdef _MSVCRT_
206 #define __pwctype_func() (_pwctype)
207 #else
208 #define __pwctype_func() (* __MINGW_IMP_SYMBOL(_pwctype))
209 #endif
210
211 #ifndef _pwctype
212 #ifdef _MSVCRT_
213 extern unsigned short *_pwctype;
214 #else
215 extern unsigned short ** __MINGW_IMP_SYMBOL(_pwctype);
216 #define _pwctype (* __MINGW_IMP_SYMBOL(_pwctype))
217 #endif
218 #endif
219
220 #endif
221 #endif
222
223 #define _UPPER 0x1
224 #define _LOWER 0x2
225 #define _DIGIT 0x4
226 #define _SPACE 0x8
227
228 #define _PUNCT 0x10
229 #define _CONTROL 0x20
230 #define _BLANK 0x40
231 #define _HEX 0x80
232
233 #define _LEADBYTE 0x8000
234 #define _ALPHA (0x0100|_UPPER|_LOWER)
235
236 #if !defined(_UCRTBASE_STDIO_DEFINED) && __MSVCRT_VERSION__ >= 0x1400
237 #define _UCRTBASE_STDIO_DEFINED
238
239 #define UCRTBASE_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION (0x0001)
240 #define UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR (0x0002)
241 #define UCRTBASE_PRINTF_LEGACY_WIDE_SPECIFIERS (0x0004)
242 #define UCRTBASE_PRINTF_LEGACY_MSVCRT_COMPATIBILITY (0x0008)
243 #define UCRTBASE_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS (0x0010)
244
245 #define UCRTBASE_SCANF_SECURECRT (0x0001)
246 #define UCRTBASE_SCANF_LEGACY_WIDE_SPECIFIERS (0x0002)
247 #define UCRTBASE_SCANF_LEGACY_MSVCRT_COMPATIBILITY (0x0004)
248
249 // Default wide printfs and scanfs to the standard mode
250 #ifndef UCRTBASE_PRINTF_DEFAULT_WIDE
251 #define UCRTBASE_PRINTF_DEFAULT_WIDE 0
252 #endif
253 #ifndef UCRTBASE_SCANF_DEFAULT_WIDE
254 #define UCRTBASE_SCANF_DEFAULT_WIDE 0
255 #endif
256 #endif
257
258 #ifndef _WCTYPE_DEFINED
259 #define _WCTYPE_DEFINED
260
261 int __cdecl iswalpha(wint_t _C);
262 _CRTIMP int __cdecl _iswalpha_l(wint_t _C,_locale_t _Locale);
263 int __cdecl iswupper(wint_t _C);
264 _CRTIMP int __cdecl _iswupper_l(wint_t _C,_locale_t _Locale);
265 int __cdecl iswlower(wint_t _C);
266 _CRTIMP int __cdecl _iswlower_l(wint_t _C,_locale_t _Locale);
267 int __cdecl iswdigit(wint_t _C);
268 _CRTIMP int __cdecl _iswdigit_l(wint_t _C,_locale_t _Locale);
269 int __cdecl iswxdigit(wint_t _C);
270 _CRTIMP int __cdecl _iswxdigit_l(wint_t _C,_locale_t _Locale);
271 int __cdecl iswspace(wint_t _C);
272 _CRTIMP int __cdecl _iswspace_l(wint_t _C,_locale_t _Locale);
273 int __cdecl iswpunct(wint_t _C);
274 _CRTIMP int __cdecl _iswpunct_l(wint_t _C,_locale_t _Locale);
275 int __cdecl iswalnum(wint_t _C);
276 _CRTIMP int __cdecl _iswalnum_l(wint_t _C,_locale_t _Locale);
277 int __cdecl iswprint(wint_t _C);
278 _CRTIMP int __cdecl _iswprint_l(wint_t _C,_locale_t _Locale);
279 int __cdecl iswgraph(wint_t _C);
280 _CRTIMP int __cdecl _iswgraph_l(wint_t _C,_locale_t _Locale);
281 int __cdecl iswcntrl(wint_t _C);
282 _CRTIMP int __cdecl _iswcntrl_l(wint_t _C,_locale_t _Locale);
283 int __cdecl iswascii(wint_t _C);
284 int __cdecl isleadbyte(int _C);
285 _CRTIMP int __cdecl _isleadbyte_l(int _C,_locale_t _Locale);
286 wint_t __cdecl towupper(wint_t _C);
287 _CRTIMP wint_t __cdecl _towupper_l(wint_t _C,_locale_t _Locale);
288 wint_t __cdecl towlower(wint_t _C);
289 _CRTIMP wint_t __cdecl _towlower_l(wint_t _C,_locale_t _Locale);
290 int __cdecl iswctype(wint_t _C,wctype_t _Type);
291 _CRTIMP int __cdecl _iswctype_l(wint_t _C,wctype_t _Type,_locale_t _Locale);
292 _CRTIMP int __cdecl __iswcsymf(wint_t _C);
293 _CRTIMP int __cdecl _iswcsymf_l(wint_t _C,_locale_t _Locale);
294 _CRTIMP int __cdecl __iswcsym(wint_t _C);
295 _CRTIMP int __cdecl _iswcsym_l(wint_t _C,_locale_t _Locale);
296 int __cdecl is_wctype(wint_t _C,wctype_t _Type);
297
298 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES)
299 int __cdecl iswblank(wint_t _C);
300 #endif
301
302 #endif
303
304 #ifndef _WDIRECT_DEFINED
305 #define _WDIRECT_DEFINED
306
307 _CRTIMP wchar_t *__cdecl _wgetcwd(wchar_t *_DstBuf,int _SizeInWords);
308 _CRTIMP wchar_t *__cdecl _wgetdcwd(int _Drive,wchar_t *_DstBuf,int _SizeInWords);
309 wchar_t *__cdecl _wgetdcwd_nolock(int _Drive,wchar_t *_DstBuf,int _SizeInWords);
310 _CRTIMP int __cdecl _wchdir(const wchar_t *_Path);
311 _CRTIMP int __cdecl _wmkdir(const wchar_t *_Path);
312 _CRTIMP int __cdecl _wrmdir(const wchar_t *_Path);
313 #endif
314
315 #ifndef _WIO_DEFINED
316 #define _WIO_DEFINED
317
318 _CRTIMP int __cdecl _waccess(const wchar_t *_Filename,int _AccessMode);
319 _CRTIMP int __cdecl _wchmod(const wchar_t *_Filename,int _Mode);
320 _CRTIMP int __cdecl _wcreat(const wchar_t *_Filename,int _PermissionMode) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
321 _CRTIMP intptr_t __cdecl _wfindfirst32(const wchar_t *_Filename,struct _wfinddata32_t *_FindData);
322 _CRTIMP int __cdecl _wfindnext32(intptr_t _FindHandle,struct _wfinddata32_t *_FindData);
323 _CRTIMP int __cdecl _wunlink(const wchar_t *_Filename);
324 _CRTIMP int __cdecl _wrename(const wchar_t *_OldFilename,const wchar_t *_NewFilename);
325 _CRTIMP wchar_t *__cdecl _wmktemp(wchar_t *_TemplateName) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
326 _CRTIMP intptr_t __cdecl _wfindfirst32i64(const wchar_t *_Filename,struct _wfinddata32i64_t *_FindData);
327 intptr_t __cdecl _wfindfirst64i32(const wchar_t *_Filename,struct _wfinddata64i32_t *_FindData);
328 _CRTIMP intptr_t __cdecl _wfindfirst64(const wchar_t *_Filename,struct _wfinddata64_t *_FindData);
329 _CRTIMP int __cdecl _wfindnext32i64(intptr_t _FindHandle,struct _wfinddata32i64_t *_FindData);
330 int __cdecl _wfindnext64i32(intptr_t _FindHandle,struct _wfinddata64i32_t *_FindData);
331 _CRTIMP int __cdecl _wfindnext64(intptr_t _FindHandle,struct _wfinddata64_t *_FindData);
332 _CRTIMP errno_t __cdecl _wsopen_s(int *_FileHandle,const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionFlag);
333 _CRTIMP int __cdecl _wopen(const wchar_t *_Filename,int _OpenFlag,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
334 _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
335 #endif
336
337 #ifndef _WLOCALE_DEFINED
338 #define _WLOCALE_DEFINED
339 _CRTIMP wchar_t *__cdecl _wsetlocale(int _Category,const wchar_t *_Locale);
340 #endif
341
342 #ifndef _WEXEC_DEFINED
343 #define _WEXEC_DEFINED
344 _CRTIMP intptr_t __cdecl _wexecl(const wchar_t *_Filename,const wchar_t *_ArgList,...);
345 _CRTIMP intptr_t __cdecl _wexecle(const wchar_t *_Filename,const wchar_t *_ArgList,...);
346 _CRTIMP intptr_t __cdecl _wexeclp(const wchar_t *_Filename,const wchar_t *_ArgList,...);
347 _CRTIMP intptr_t __cdecl _wexeclpe(const wchar_t *_Filename,const wchar_t *_ArgList,...);
348 _CRTIMP intptr_t __cdecl _wexecv(const wchar_t *_Filename,const wchar_t *const *_ArgList);
349 _CRTIMP intptr_t __cdecl _wexecve(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
350 _CRTIMP intptr_t __cdecl _wexecvp(const wchar_t *_Filename,const wchar_t *const *_ArgList);
351 _CRTIMP intptr_t __cdecl _wexecvpe(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
352 #endif
353
354 #ifndef _WSPAWN_DEFINED
355 #define _WSPAWN_DEFINED
356 _CRTIMP intptr_t __cdecl _wspawnl(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
357 _CRTIMP intptr_t __cdecl _wspawnle(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
358 _CRTIMP intptr_t __cdecl _wspawnlp(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
359 _CRTIMP intptr_t __cdecl _wspawnlpe(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
360 _CRTIMP intptr_t __cdecl _wspawnv(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList);
361 _CRTIMP intptr_t __cdecl _wspawnve(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
362 _CRTIMP intptr_t __cdecl _wspawnvp(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList);
363 _CRTIMP intptr_t __cdecl _wspawnvpe(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
364 #endif
365
366 #ifndef _CRT_WSYSTEM_DEFINED
367 #define _CRT_WSYSTEM_DEFINED
368 _CRTIMP int __cdecl _wsystem(const wchar_t *_Command);
369 #endif
370
371 #ifndef _WCTYPE_INLINE_DEFINED
372 #undef _CRT_WCTYPE_NOINLINE
373 #if !defined(__cplusplus) || defined(_CRT_WCTYPE_NOINLINE)
374 #define iswalpha(_c) (iswctype(_c,_ALPHA))
375 #define iswupper(_c) (iswctype(_c,_UPPER))
376 #define iswlower(_c) (iswctype(_c,_LOWER))
377 #define iswdigit(_c) (iswctype(_c,_DIGIT))
378 #define iswxdigit(_c) (iswctype(_c,_HEX))
379 #define iswspace(_c) (iswctype(_c,_SPACE))
380 #define iswpunct(_c) (iswctype(_c,_PUNCT))
381 #define iswalnum(_c) (iswctype(_c,_ALPHA|_DIGIT))
382 #define iswprint(_c) (iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT))
383 #define iswgraph(_c) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT))
384 #define iswcntrl(_c) (iswctype(_c,_CONTROL))
385 #define iswascii(_c) ((unsigned)(_c) < 0x80)
386
387 #define _iswalpha_l(_c,_p) (_iswctype_l(_c,_ALPHA,_p))
388 #define _iswupper_l(_c,_p) (_iswctype_l(_c,_UPPER,_p))
389 #define _iswlower_l(_c,_p) (_iswctype_l(_c,_LOWER,_p))
390 #define _iswdigit_l(_c,_p) (_iswctype_l(_c,_DIGIT,_p))
391 #define _iswxdigit_l(_c,_p) (_iswctype_l(_c,_HEX,_p))
392 #define _iswspace_l(_c,_p) (_iswctype_l(_c,_SPACE,_p))
393 #define _iswpunct_l(_c,_p) (_iswctype_l(_c,_PUNCT,_p))
394 #define _iswalnum_l(_c,_p) (_iswctype_l(_c,_ALPHA|_DIGIT,_p))
395 #define _iswprint_l(_c,_p) (_iswctype_l(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT,_p))
396 #define _iswgraph_l(_c,_p) (_iswctype_l(_c,_PUNCT|_ALPHA|_DIGIT,_p))
397 #define _iswcntrl_l(_c,_p) (_iswctype_l(_c,_CONTROL,_p))
398 #ifndef _CTYPE_DISABLE_MACROS
399 #define isleadbyte(_c) (__PCTYPE_FUNC[(unsigned char)(_c)] & _LEADBYTE)
400 #endif
401 #endif
402 #define _WCTYPE_INLINE_DEFINED
403 #endif
404
405 #if !defined(_POSIX_) || defined(__GNUC__)
406 #ifndef _INO_T_DEFINED
407 #define _INO_T_DEFINED
408 typedef unsigned short _ino_t;
409 #ifndef NO_OLDNAMES
410 typedef unsigned short ino_t;
411 #endif
412 #endif
413
414 #ifndef _DEV_T_DEFINED
415 #define _DEV_T_DEFINED
416 typedef unsigned int _dev_t;
417 #ifndef NO_OLDNAMES
418 typedef unsigned int dev_t;
419 #endif
420 #endif
421
422 #include <_mingw_off_t.h>
423 #include <_mingw_stat64.h>
424
425 #ifndef _WSTAT_DEFINED
426 #define _WSTAT_DEFINED
427
428 _CRTIMP int __cdecl _wstat32(const wchar_t *_Name,struct _stat32 *_Stat);
429 _CRTIMP int __cdecl _wstat32i64(const wchar_t *_Name,struct _stat32i64 *_Stat);
430 int __cdecl _wstat64i32(const wchar_t *_Name,struct _stat64i32 *_Stat);
431 _CRTIMP int __cdecl _wstat64(const wchar_t *_Name,struct _stat64 *_Stat);
432 #endif
433 #endif
434
435 #ifndef _WCONIO_DEFINED
436 #define _WCONIO_DEFINED
437
438 #ifndef WEOF
439 #define WEOF (wint_t)(0xFFFF)
440 #endif
441
442 _CRTIMP wchar_t *_cgetws(wchar_t *_Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
443 _CRTIMP wint_t __cdecl _getwch(void);
444 _CRTIMP wint_t __cdecl _getwche(void);
445 _CRTIMP wint_t __cdecl _putwch(wchar_t _WCh);
446 _CRTIMP wint_t __cdecl _ungetwch(wint_t _WCh);
447 _CRTIMP int __cdecl _cputws(const wchar_t *_String);
448 _CRTIMP int __cdecl _cwprintf(const wchar_t * __restrict__ _Format,...);
449 _CRTIMP int __cdecl _cwscanf(const wchar_t * __restrict__ _Format,...);
450 _CRTIMP int __cdecl _cwscanf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
451 _CRTIMP int __cdecl _vcwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList);
452 _CRTIMP int __cdecl _cwprintf_p(const wchar_t * __restrict__ _Format,...);
453 _CRTIMP int __cdecl _vcwprintf_p(const wchar_t * __restrict__ _Format,va_list _ArgList);
454
455 _CRTIMP int __cdecl _cwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
456 _CRTIMP int __cdecl _vcwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
457 _CRTIMP int __cdecl _cwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
458 _CRTIMP int __cdecl _vcwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
459 wint_t __cdecl _putwch_nolock(wchar_t _WCh);
460 wint_t __cdecl _getwch_nolock(void);
461 wint_t __cdecl _getwche_nolock(void);
462 wint_t __cdecl _ungetwch_nolock(wint_t _WCh);
463 #endif
464
465 #ifndef _WSTDIO_DEFINED
466 #define _WSTDIO_DEFINED
467
468 /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
469 int __cdecl __mingw_swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...);
470 /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
471 int __cdecl __mingw_vswscanf (const wchar_t * __restrict__ _Str,const wchar_t * __restrict__ Format,va_list argp);
472 /* __attribute__((__format__ (gnu_wscanf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1)
473 int __cdecl __mingw_wscanf(const wchar_t * __restrict__ _Format,...);
474 /* __attribute__((__format__ (gnu_wscanf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1)
475 int __cdecl __mingw_vwscanf(const wchar_t * __restrict__ Format, va_list argp);
476 /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
477 int __cdecl __mingw_fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...);
478 /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
479 int __cdecl __mingw_vfwscanf (FILE * __restrict__ fp, const wchar_t * __restrict__ Format,va_list argp);
480
481
482 /* __attribute__((__format__ (gnu_wprintf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
483 int __cdecl __mingw_fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...);
484 /* __attribute__((__format__ (gnu_wprintf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1)
485 int __cdecl __mingw_wprintf(const wchar_t * __restrict__ _Format,...);
486 /* __attribute__((__format__ (gnu_wprintf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
487 int __cdecl __mingw_vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList);
488 /* __attribute__((__format__ (gnu_printf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1)
489 int __cdecl __mingw_vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList);
490 /* __attribute__((__format__ (gnu_wprintf, 3, 4))) */ __MINGW_ATTRIB_NONNULL(3)
491 int __cdecl __mingw_snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...);
492 /* __attribute__((__format__ (gnu_wprintf, 3, 0))) */ __MINGW_ATTRIB_NONNULL(3)
493 int __cdecl __mingw_vsnwprintf (wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list);
494 /* __attribute__((__format__ (gnu_wprintf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
495 int __cdecl __mingw_swprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , ...);
496 /* __attribute__((__format__ (gnu_wprintf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
497 int __cdecl __mingw_vswprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ ,va_list);
498
499 #if __MSVCRT_VERSION__ >= 0x1400
500 int __cdecl __stdio_common_vswprintf(unsigned __int64 options, wchar_t *str, size_t len, const wchar_t *format, _locale_t locale, va_list valist);
501 int __cdecl __stdio_common_vfwprintf(unsigned __int64 options, FILE *file, const wchar_t *format, _locale_t locale, va_list valist);
502 int __cdecl __stdio_common_vswscanf(unsigned __int64 options, const wchar_t *input, size_t length, const wchar_t *format, _locale_t locale, va_list valist);
503 int __cdecl __stdio_common_vfwscanf(unsigned __int64 options, FILE *file, const wchar_t *format, _locale_t locale, va_list valist);
504 #endif
505
506 #undef __mingw_ovr
507 #if defined (__GNUC__)
508 #define __mingw_ovr static __attribute__ ((__unused__)) __inline__ __cdecl
509 #ifdef __mingw_static_ovr
510 #undef __mingw_static_ovr
511 #define __mingw_static_ovr __mingw_ovr
512 #endif
513 #elif defined(__cplusplus)
514 #define __mingw_ovr inline __cdecl
515 #else
516 #define __mingw_ovr static __cdecl
517 #endif
518
519 #if __USE_MINGW_ANSI_STDIO
520
521 /*
522 * User has expressed a preference for C99 conformance...
523 */
524 __mingw_ovr
525 /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
swscanf(const wchar_t * __source,const wchar_t * __format,...)526 int swscanf(const wchar_t *__source, const wchar_t *__format, ...)
527 {
528 int __retval;
529 __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
530 __retval = __mingw_vswscanf( __source, __format, __local_argv );
531 __builtin_va_end( __local_argv );
532 return __retval;
533 }
534
535 __mingw_ovr
536 /* __attribute__((__format__ (gnu_wscanf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1)
wscanf(const wchar_t * __format,...)537 int wscanf(const wchar_t *__format, ...)
538 {
539 int __retval;
540 __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
541 __retval = __mingw_vfwscanf( stdin, __format, __local_argv );
542 __builtin_va_end( __local_argv );
543 return __retval;
544 }
545
546 __mingw_ovr
547 /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
fwscanf(FILE * __stream,const wchar_t * __format,...)548 int fwscanf(FILE *__stream, const wchar_t *__format, ...)
549 {
550 int __retval;
551 __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
552 __retval = __mingw_vfwscanf( __stream, __format, __local_argv );
553 __builtin_va_end( __local_argv );
554 return __retval;
555 }
556
557 #ifndef __NO_ISOCEXT /* externs in libmingwex.a */
558 __mingw_ovr
559 /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
vswscanf(const wchar_t * __source,const wchar_t * __format,__builtin_va_list __local_argv)560 int vswscanf (const wchar_t *__source, const wchar_t *__format, __builtin_va_list __local_argv)
561 {
562 return __mingw_vswscanf( __source, __format, __local_argv );
563 }
564
565 __mingw_ovr
566 /* __attribute__((__format__ (gnu_wscanf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1)
vwscanf(const wchar_t * __format,__builtin_va_list __local_argv)567 int vwscanf(const wchar_t *__format, __builtin_va_list __local_argv)
568 {
569 return __mingw_vfwscanf( stdin, __format, __local_argv );
570 }
571
572 __mingw_ovr
573 /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
vfwscanf(FILE * __stream,const wchar_t * __format,__builtin_va_list __local_argv)574 int vfwscanf (FILE *__stream, const wchar_t *__format, __builtin_va_list __local_argv)
575 {
576 return __mingw_vfwscanf( __stream, __format, __local_argv );
577 }
578 #endif /* __NO_ISOCEXT */
579
580
581
582 __mingw_ovr
583 /* __attribute__((__format__ (gnu_wprintf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
fwprintf(FILE * __stream,const wchar_t * __format,...)584 int fwprintf (FILE *__stream, const wchar_t *__format, ...)
585 {
586 int __retval;
587 __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
588 __retval = __mingw_vfwprintf( __stream, __format, __local_argv );
589 __builtin_va_end( __local_argv );
590 return __retval;
591 }
592
593 __mingw_ovr
594 /* __attribute__((__format__ (gnu_wprintf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1)
wprintf(const wchar_t * __format,...)595 int wprintf (const wchar_t *__format, ...)
596 {
597 int __retval;
598 __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
599 __retval = __mingw_vfwprintf( stdout, __format, __local_argv );
600 __builtin_va_end( __local_argv );
601 return __retval;
602 }
603
604 __mingw_ovr
605 /* __attribute__((__format__ (gnu_wprintf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
vfwprintf(FILE * __stream,const wchar_t * __format,__builtin_va_list __local_argv)606 int vfwprintf (FILE *__stream, const wchar_t *__format, __builtin_va_list __local_argv)
607 {
608 return __mingw_vfwprintf( __stream, __format, __local_argv );
609 }
610
611 __mingw_ovr
612 /* __attribute__((__format__ (gnu_wprintf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1)
vwprintf(const wchar_t * __format,__builtin_va_list __local_argv)613 int vwprintf (const wchar_t *__format, __builtin_va_list __local_argv)
614 {
615 return __mingw_vfwprintf( stdout, __format, __local_argv );
616 }
617
618 /*#ifndef __NO_ISOCEXT */ /* externs in libmingwex.a */
619 __mingw_ovr
620 /* __attribute__((__format__ (gnu_wprintf, 3, 4))) */ __MINGW_ATTRIB_NONNULL(3)
snwprintf(wchar_t * __stream,size_t __n,const wchar_t * __format,...)621 int snwprintf (wchar_t *__stream, size_t __n, const wchar_t *__format, ...)
622 {
623 int __retval;
624 __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
625 __retval = __mingw_vsnwprintf( __stream, __n, __format, __local_argv );
626 __builtin_va_end( __local_argv );
627 return __retval;
628 }
629
630 __mingw_ovr
631 /* __attribute__((__format__ (gnu_wprintf, 3, 0))) */ __MINGW_ATTRIB_NONNULL(3)
vsnwprintf(wchar_t * __stream,size_t __n,const wchar_t * __format,__builtin_va_list __local_argv)632 int vsnwprintf (wchar_t *__stream, size_t __n, const wchar_t *__format, __builtin_va_list __local_argv)
633 {
634 return __mingw_vsnwprintf( __stream, __n, __format, __local_argv );
635 }
636 /* #endif */ /* __NO_ISOCEXT */
637 #else /* !__USE_MINGW_ANSI_STDIO */
638
639 #if __MSVCRT_VERSION__ >= 0x1400
640 __mingw_ovr
fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...)641 int __cdecl fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN
642 {
643 __builtin_va_list ap;
644 int ret;
645 __builtin_va_start(ap, _Format);
646 ret = __stdio_common_vfwscanf(UCRTBASE_SCANF_DEFAULT_WIDE, _File, _Format, NULL, ap);
647 __builtin_va_end(ap);
648 return ret;
649 }
650 __mingw_ovr
swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...)651 int __cdecl swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN
652 {
653 __builtin_va_list ap;
654 int ret;
655 __builtin_va_start(ap, _Format);
656 ret = __stdio_common_vswscanf(UCRTBASE_SCANF_DEFAULT_WIDE, _Src, (size_t)-1, _Format, NULL, ap);
657 __builtin_va_end(ap);
658 return ret;
659 }
660 __mingw_ovr
wscanf(const wchar_t * __restrict__ _Format,...)661 int __cdecl wscanf(const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN
662 {
663 __builtin_va_list ap;
664 int ret;
665 __builtin_va_start(ap, _Format);
666 ret = __stdio_common_vfwscanf(UCRTBASE_SCANF_DEFAULT_WIDE, stdin, _Format, NULL, ap);
667 __builtin_va_end(ap);
668 return ret;
669 }
670 __mingw_ovr
671 __MINGW_ATTRIB_NONNULL(2)
vfwscanf(FILE * __stream,const wchar_t * __format,va_list __local_argv)672 int vfwscanf (FILE *__stream, const wchar_t *__format, va_list __local_argv)
673 {
674 return __stdio_common_vfwscanf(UCRTBASE_SCANF_DEFAULT_WIDE, __stream, __format, NULL, __local_argv);
675 }
676
677 __mingw_ovr
678 __MINGW_ATTRIB_NONNULL(2)
vswscanf(const wchar_t * __restrict__ __source,const wchar_t * __restrict__ __format,va_list __local_argv)679 int vswscanf (const wchar_t * __restrict__ __source, const wchar_t * __restrict__ __format, va_list __local_argv)
680 {
681 return __stdio_common_vswscanf(UCRTBASE_SCANF_DEFAULT_WIDE, __source, (size_t)-1, __format, NULL, __local_argv);
682 }
683 __mingw_ovr
684 __MINGW_ATTRIB_NONNULL(1)
vwscanf(const wchar_t * __format,va_list __local_argv)685 int vwscanf(const wchar_t *__format, va_list __local_argv)
686 {
687 return __stdio_common_vfwscanf(UCRTBASE_SCANF_DEFAULT_WIDE, stdin, __format, NULL, __local_argv);
688 }
689
690 __mingw_static_ovr
fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...)691 int __cdecl fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...)
692 {
693 __builtin_va_list ap;
694 int ret;
695 __builtin_va_start(ap, _Format);
696 ret = __stdio_common_vfwprintf(UCRTBASE_PRINTF_DEFAULT_WIDE, _File, _Format, NULL, ap);
697 __builtin_va_end(ap);
698 return ret;
699 }
700 __mingw_ovr
wprintf(const wchar_t * __restrict__ _Format,...)701 int __cdecl wprintf(const wchar_t * __restrict__ _Format,...)
702 {
703 __builtin_va_list ap;
704 int ret;
705 __builtin_va_start(ap, _Format);
706 ret = __stdio_common_vfwprintf(UCRTBASE_PRINTF_DEFAULT_WIDE, stdout, _Format, NULL, ap);
707 __builtin_va_end(ap);
708 return ret;
709 }
710 __mingw_ovr
vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList)711 int __cdecl vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList)
712 {
713 return __stdio_common_vfwprintf(UCRTBASE_PRINTF_DEFAULT_WIDE, _File, _Format, NULL, _ArgList);
714 }
715 __mingw_ovr
vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList)716 int __cdecl vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList)
717 {
718 return __stdio_common_vfwprintf(UCRTBASE_PRINTF_DEFAULT_WIDE, stdout, _Format, NULL, _ArgList);
719 }
720 #else
721
722 int __cdecl fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
723 int __cdecl swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
724 int __cdecl wscanf(const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
725 #ifndef __NO_ISOCEXT /* externs in libmingwex.a */
726 int __cdecl __ms_vwscanf (const wchar_t * __restrict__ , va_list);
727 int __cdecl __ms_vfwscanf (FILE * __restrict__ ,const wchar_t * __restrict__ ,va_list);
728 int __cdecl __ms_vswscanf (const wchar_t * __restrict__ ,const wchar_t * __restrict__ ,va_list);
729
730 __mingw_ovr
731 __MINGW_ATTRIB_NONNULL(2)
vfwscanf(FILE * __stream,const wchar_t * __format,__builtin_va_list __local_argv)732 int vfwscanf (FILE *__stream, const wchar_t *__format, __builtin_va_list __local_argv)
733 {
734 return __ms_vfwscanf (__stream, __format, __local_argv);
735 }
736
737 __mingw_ovr
738 __MINGW_ATTRIB_NONNULL(2)
vswscanf(const wchar_t * __restrict__ __source,const wchar_t * __restrict__ __format,__builtin_va_list __local_argv)739 int vswscanf (const wchar_t * __restrict__ __source, const wchar_t * __restrict__ __format, __builtin_va_list __local_argv)
740 {
741 return __ms_vswscanf( __source, __format, __local_argv );
742 }
743 __mingw_ovr
744 __MINGW_ATTRIB_NONNULL(1)
vwscanf(const wchar_t * __format,__builtin_va_list __local_argv)745 int vwscanf(const wchar_t *__format, __builtin_va_list __local_argv)
746 {
747 return __ms_vwscanf (__format, __local_argv);
748 }
749
750 #endif /* __NO_ISOCEXT */
751
752 int __cdecl fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...);
753 int __cdecl wprintf(const wchar_t * __restrict__ _Format,...);
754 int __cdecl vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList);
755 int __cdecl vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList);
756 #endif /* __MSVCRT_VERSION__ >= 0x1400 */
757 #endif /* __USE_MINGW_ANSI_STDIO */
758
759
760 #ifndef WEOF
761 #define WEOF (wint_t)(0xFFFF)
762 #endif
763
764 #ifdef _POSIX_
765 _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode);
766 #else
767 _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode,int _ShFlag);
768 #endif
769
770 wint_t __cdecl fgetwc(FILE *_File);
771 _CRTIMP wint_t __cdecl _fgetwchar(void);
772 wint_t __cdecl fputwc(wchar_t _Ch,FILE *_File);
773 _CRTIMP wint_t __cdecl _fputwchar(wchar_t _Ch);
774 wint_t __cdecl getwc(FILE *_File);
775 wint_t __cdecl getwchar(void);
776 wint_t __cdecl putwc(wchar_t _Ch,FILE *_File);
777 wint_t __cdecl putwchar(wchar_t _Ch);
778 wint_t __cdecl ungetwc(wint_t _Ch,FILE *_File);
779 wchar_t *__cdecl fgetws(wchar_t * __restrict__ _Dst,int _SizeInWords,FILE * __restrict__ _File);
780 int __cdecl fputws(const wchar_t * __restrict__ _Str,FILE * __restrict__ _File);
781 _CRTIMP wchar_t *__cdecl _getws(wchar_t *_String) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
782 _CRTIMP int __cdecl _putws(const wchar_t *_Str);
783
784 #if __MSVCRT_VERSION__ >= 0x1400
785 __mingw_ovr
_scwprintf(const wchar_t * __restrict__ _Format,...)786 int __cdecl _scwprintf(const wchar_t * __restrict__ _Format,...)
787 {
788 __builtin_va_list ap;
789 int ret;
790 __builtin_va_start(ap, _Format);
791 ret = __stdio_common_vswprintf(UCRTBASE_PRINTF_DEFAULT_WIDE | UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR, NULL, 0, _Format, NULL, ap);
792 __builtin_va_end(ap);
793 return ret;
794 }
795 __mingw_static_ovr
_snwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,...)796 int __cdecl _snwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN
797 {
798 __builtin_va_list ap;
799 int ret;
800 __builtin_va_start(ap, _Format);
801 ret = __stdio_common_vswprintf(UCRTBASE_PRINTF_DEFAULT_WIDE | UCRTBASE_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, _Dest, _Count, _Format, NULL, ap);
802 __builtin_va_end(ap);
803 return ret;
804 }
805 __mingw_ovr
_vsnwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,va_list _Args)806 int __cdecl _vsnwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,va_list _Args) __MINGW_ATTRIB_DEPRECATED_SEC_WARN
807 {
808 return __stdio_common_vswprintf(UCRTBASE_PRINTF_DEFAULT_WIDE | UCRTBASE_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, _Dest, _Count, _Format, NULL, _Args);
809 }
810
811 #if __USE_MINGW_ANSI_STDIO == 0
812 __mingw_ovr
snwprintf(wchar_t * __restrict__ s,size_t n,const wchar_t * __restrict__ format,...)813 int snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...)
814 {
815 __builtin_va_list ap;
816 int ret;
817 __builtin_va_start(ap, format);
818 ret = __stdio_common_vswprintf(UCRTBASE_PRINTF_DEFAULT_WIDE | UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR, s, n, format, NULL, ap);
819 __builtin_va_end(ap);
820 return ret;
821 }
822 __mingw_ovr
vsnwprintf(wchar_t * __restrict__ s,size_t n,const wchar_t * __restrict__ format,va_list arg)823 int __cdecl vsnwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, va_list arg)
824 {
825 return __stdio_common_vswprintf(UCRTBASE_PRINTF_DEFAULT_WIDE | UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR, s, n, format, NULL, arg);
826 }
827 #endif
828
829 #else
830 _CRTIMP int __cdecl _scwprintf(const wchar_t * __restrict__ _Format,...);
831 _CRTIMP int __cdecl _swprintf_l(wchar_t * __restrict__ ,size_t _SizeInWords,const wchar_t * __restrict__ _Format,_locale_t _Locale,... ) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
832 _CRTIMP int __cdecl _swprintf_c(wchar_t * __restrict__ _DstBuf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,...);
833 _CRTIMP int __cdecl _vswprintf_c(wchar_t * __restrict__ _DstBuf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,va_list _ArgList);
834 _CRTIMP int __cdecl _snwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
835 _CRTIMP int __cdecl _vsnwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,va_list _Args) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
836
837 #ifndef __NO_ISOCEXT /* externs in libmingwex.a */
838
839 #if __USE_MINGW_ANSI_STDIO == 0
840 #pragma push_macro("snwprintf")
841 #pragma push_macro("vsnwprintf")
842 # undef snwprintf
843 # undef vsnwprintf
844 int __cdecl __ms_snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...);
845 int __cdecl __ms_vsnwprintf (wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list);
846 __mingw_ovr
snwprintf(wchar_t * __restrict__ s,size_t n,const wchar_t * __restrict__ format,...)847 int snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...)
848 {
849 int r;
850 va_list argp;
851 __builtin_va_start (argp, format);
852 r = _vsnwprintf (s, n, format, argp);
853 __builtin_va_end (argp);
854 return r;
855 }
856 __mingw_ovr
vsnwprintf(wchar_t * __restrict__ s,size_t n,const wchar_t * __restrict__ format,va_list arg)857 int __cdecl vsnwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, va_list arg)
858 {
859 return _vsnwprintf(s,n,format,arg);
860 }
861 #pragma pop_macro ("vsnwprintf")
862 #pragma pop_macro ("snwprintf")
863 #endif
864
865 #endif /* __MSVCRT_VERSION__ >= 0x1400 */
866
867 #endif /* _WSTDIO_DEFINED */
868
869
870 #if __MSVCRT_VERSION__ >= 0x1400
871 int __cdecl __stdio_common_vswprintf_p(unsigned __int64 _Options, wchar_t *_Str, size_t _Len, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList);
872 int __cdecl __stdio_common_vfwprintf_p(unsigned __int64 _Options, FILE *_File, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList);
873
_vfwscanf_l(FILE * _File,const wchar_t * _Format,_locale_t _Locale,va_list _ArgList)874 __mingw_ovr int __cdecl _vfwscanf_l(FILE *_File, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
875 {
876 return __stdio_common_vfwscanf(UCRTBASE_SCANF_DEFAULT_WIDE, _File, _Format, _Locale, _ArgList);
877 }
_fwscanf_l(FILE * _File,const wchar_t * _Format,_locale_t _Locale,...)878 __mingw_ovr int __cdecl _fwscanf_l(FILE *_File, const wchar_t *_Format, _locale_t _Locale, ...)
879 {
880 __builtin_va_list _ArgList;
881 int _Ret;
882 __builtin_va_start(_ArgList, _Locale);
883 _Ret = _vfwscanf_l(_File, _Format, _Locale, _ArgList);
884 __builtin_va_end(_ArgList);
885 return _Ret;
886 }
_wscanf_l(const wchar_t * _Format,_locale_t _Locale,...)887 __mingw_ovr int __cdecl _wscanf_l(const wchar_t *_Format, _locale_t _Locale, ...)
888 {
889 __builtin_va_list _ArgList;
890 int _Ret;
891 __builtin_va_start(_ArgList, _Locale);
892 _Ret = _vfwscanf_l(stdin, _Format, _Locale, _ArgList);
893 __builtin_va_end(_ArgList);
894 return _Ret;
895 }
896
_vsnwscanf_l(const wchar_t * _Src,size_t _MaxCount,const wchar_t * _Format,_locale_t _Locale,va_list _ArgList)897 __mingw_ovr int __cdecl _vsnwscanf_l(const wchar_t *_Src, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
898 {
899 return __stdio_common_vswscanf(UCRTBASE_SCANF_DEFAULT_WIDE, _Src, _MaxCount, _Format, _Locale, _ArgList);
900 }
_snwscanf_l(const wchar_t * _Src,size_t _MaxCount,const wchar_t * _Format,_locale_t _Locale,...)901 __mingw_ovr int __cdecl _snwscanf_l(const wchar_t *_Src, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, ...)
902 {
903 __builtin_va_list _ArgList;
904 int _Ret;
905 __builtin_va_start(_ArgList, _Locale);
906 _Ret = _vsnwscanf_l(_Src, _MaxCount, _Format, _Locale, _ArgList);
907 __builtin_va_end(_ArgList);
908 return _Ret;
909 }
_snwscanf(const wchar_t * _Src,size_t _MaxCount,const wchar_t * _Format,...)910 __mingw_ovr int __cdecl _snwscanf(const wchar_t *_Src, size_t _MaxCount, const wchar_t *_Format, ...)
911 {
912 __builtin_va_list _ArgList;
913 int _Ret;
914 __builtin_va_start(_ArgList, _Format);
915 _Ret = _vsnwscanf_l(_Src, _MaxCount, _Format, NULL, _ArgList);
916 __builtin_va_end(_ArgList);
917 return _Ret;
918 }
919
_vswscanf_l(const wchar_t * _Src,const wchar_t * _Format,_locale_t _Locale,va_list _ArgList)920 __mingw_ovr int __cdecl _vswscanf_l(const wchar_t *_Src, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
921 {
922 return __stdio_common_vswscanf(UCRTBASE_SCANF_DEFAULT_WIDE, _Src, (size_t)-1, _Format, _Locale, _ArgList);
923 }
_swscanf_l(const wchar_t * _Src,const wchar_t * _Format,_locale_t _Locale,...)924 __mingw_ovr int __cdecl _swscanf_l(const wchar_t *_Src, const wchar_t *_Format, _locale_t _Locale, ...)
925 {
926 __builtin_va_list _ArgList;
927 int _Ret;
928 __builtin_va_start(_ArgList, _Locale);
929 _Ret = _vswscanf_l(_Src, _Format, _Locale, _ArgList);
930 __builtin_va_end(_ArgList);
931 return _Ret;
932 }
933
_vfwprintf_p_l(FILE * _File,const wchar_t * _Format,_locale_t _Locale,va_list _ArgList)934 __mingw_ovr int __cdecl _vfwprintf_p_l(FILE *_File, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
935 {
936 return __stdio_common_vfwprintf_p(UCRTBASE_PRINTF_DEFAULT_WIDE, _File, _Format, _Locale, _ArgList);
937 }
_vwprintf_p_l(const wchar_t * _Format,_locale_t _Locale,va_list _ArgList)938 __mingw_ovr int __cdecl _vwprintf_p_l(const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
939 {
940 return _vfwprintf_p_l(stdout, _Format, _Locale, _ArgList);
941 }
_vfwprintf_p(FILE * _File,const wchar_t * _Format,va_list _ArgList)942 __mingw_ovr int __cdecl _vfwprintf_p(FILE *_File, const wchar_t *_Format, va_list _ArgList)
943 {
944 return _vfwprintf_p_l(_File, _Format, NULL, _ArgList);
945 }
_vwprintf_p(const wchar_t * _Format,va_list _ArgList)946 __mingw_ovr int __cdecl _vwprintf_p(const wchar_t *_Format, va_list _ArgList)
947 {
948 return _vfwprintf_p_l(stdout, _Format, NULL, _ArgList);
949 }
_fwprintf_p_l(FILE * _File,const wchar_t * _Format,_locale_t _Locale,...)950 __mingw_ovr int __cdecl _fwprintf_p_l(FILE *_File, const wchar_t *_Format, _locale_t _Locale, ...)
951 {
952 __builtin_va_list _ArgList;
953 int _Ret;
954 __builtin_va_start(_ArgList, _Locale);
955 _Ret = _vfwprintf_p_l(_File, _Format, _Locale, _ArgList);
956 __builtin_va_end(_ArgList);
957 return _Ret;
958 }
_wprintf_p_l(const wchar_t * _Format,_locale_t _Locale,...)959 __mingw_ovr int __cdecl _wprintf_p_l(const wchar_t *_Format, _locale_t _Locale, ...)
960 {
961 __builtin_va_list _ArgList;
962 int _Ret;
963 __builtin_va_start(_ArgList, _Locale);
964 _Ret = _vfwprintf_p_l(stdout, _Format, _Locale, _ArgList);
965 __builtin_va_end(_ArgList);
966 return _Ret;
967 }
_fwprintf_p(FILE * _File,const wchar_t * _Format,...)968 __mingw_ovr int __cdecl _fwprintf_p(FILE *_File, const wchar_t *_Format, ...)
969 {
970 __builtin_va_list _ArgList;
971 int _Ret;
972 __builtin_va_start(_ArgList, _Format);
973 _Ret = _vfwprintf_p_l(_File, _Format, NULL, _ArgList);
974 __builtin_va_end(_ArgList);
975 return _Ret;
976 }
_wprintf_p(const wchar_t * _Format,...)977 __mingw_ovr int __cdecl _wprintf_p(const wchar_t *_Format, ...)
978 {
979 __builtin_va_list _ArgList;
980 int _Ret;
981 __builtin_va_start(_ArgList, _Format);
982 _Ret = _vfwprintf_p_l(stdout, _Format, NULL, _ArgList);
983 __builtin_va_end(_ArgList);
984 return _Ret;
985 }
986
_vfwprintf_l(FILE * _File,const wchar_t * _Format,_locale_t _Locale,va_list _ArgList)987 __mingw_ovr int __cdecl _vfwprintf_l(FILE *_File, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
988 {
989 return __stdio_common_vfwprintf(UCRTBASE_PRINTF_DEFAULT_WIDE, _File, _Format, _Locale, _ArgList);
990 }
_vwprintf_l(const wchar_t * _Format,_locale_t _Locale,va_list _ArgList)991 __mingw_ovr int __cdecl _vwprintf_l(const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
992 {
993 return _vfwprintf_l(stdout, _Format, _Locale, _ArgList);
994 }
_fwprintf_l(FILE * _File,const wchar_t * _Format,_locale_t _Locale,...)995 __mingw_ovr int __cdecl _fwprintf_l(FILE *_File, const wchar_t *_Format, _locale_t _Locale, ...)
996 {
997 __builtin_va_list _ArgList;
998 int _Ret;
999 __builtin_va_start(_ArgList, _Locale);
1000 _Ret = _vfwprintf_l(_File, _Format, _Locale, _ArgList);
1001 __builtin_va_end(_ArgList);
1002 return _Ret;
1003 }
_wprintf_l(const wchar_t * _Format,_locale_t _Locale,...)1004 __mingw_ovr int __cdecl _wprintf_l(const wchar_t *_Format, _locale_t _Locale, ...)
1005 {
1006 __builtin_va_list _ArgList;
1007 int _Ret;
1008 __builtin_va_start(_ArgList, _Locale);
1009 _Ret = _vfwprintf_l(stdout, _Format, _Locale, _ArgList);
1010 __builtin_va_end(_ArgList);
1011 return _Ret;
1012 }
1013
_vswprintf_p_l(wchar_t * _DstBuf,size_t _MaxCount,const wchar_t * _Format,_locale_t _Locale,va_list _ArgList)1014 __mingw_ovr int __cdecl _vswprintf_p_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
1015 {
1016 return __stdio_common_vswprintf_p(UCRTBASE_PRINTF_DEFAULT_WIDE, _DstBuf, _MaxCount, _Format, _Locale, _ArgList);
1017 }
_vswprintf_p(wchar_t * _DstBuf,size_t _MaxCount,const wchar_t * _Format,va_list _ArgList)1018 __mingw_ovr int __cdecl _vswprintf_p(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, va_list _ArgList)
1019 {
1020 return _vswprintf_p_l(_DstBuf, _MaxCount, _Format, NULL, _ArgList);
1021 }
_swprintf_p_l(wchar_t * _DstBuf,size_t _MaxCount,const wchar_t * _Format,_locale_t _Locale,...)1022 __mingw_ovr int __cdecl _swprintf_p_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, ...)
1023 {
1024 __builtin_va_list _ArgList;
1025 int _Ret;
1026 __builtin_va_start(_ArgList, _Locale);
1027 _Ret = _vswprintf_p_l(_DstBuf, _MaxCount, _Format, _Locale, _ArgList);
1028 __builtin_va_end(_ArgList);
1029 return _Ret;
1030 }
_swprintf_p(wchar_t * _DstBuf,size_t _MaxCount,const wchar_t * _Format,...)1031 __mingw_ovr int __cdecl _swprintf_p(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, ...)
1032 {
1033 __builtin_va_list _ArgList;
1034 int _Ret;
1035 __builtin_va_start(_ArgList, _Format);
1036 _Ret = _vswprintf_p_l(_DstBuf, _MaxCount, _Format, NULL, _ArgList);
1037 __builtin_va_end(_ArgList);
1038 return _Ret;
1039 }
1040
_vsnwprintf_l(wchar_t * _DstBuf,size_t _MaxCount,const wchar_t * _Format,_locale_t _Locale,va_list _ArgList)1041 __mingw_ovr int __cdecl _vsnwprintf_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
1042 {
1043 return __stdio_common_vswprintf(UCRTBASE_PRINTF_DEFAULT_WIDE | UCRTBASE_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, _DstBuf, _MaxCount, _Format, _Locale, _ArgList);
1044 }
_snwprintf_l(wchar_t * _DstBuf,size_t _MaxCount,const wchar_t * _Format,_locale_t _Locale,...)1045 __mingw_ovr int __cdecl _snwprintf_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, ...)
1046 {
1047 __builtin_va_list _ArgList;
1048 int _Ret;
1049 __builtin_va_start(_ArgList, _Locale);
1050 _Ret = _vsnwprintf_l(_DstBuf, _MaxCount, _Format, _Locale, _ArgList);
1051 __builtin_va_end(_ArgList);
1052 return _Ret;
1053 }
1054
_vscwprintf_p_l(const wchar_t * _Format,_locale_t _Locale,va_list _ArgList)1055 __mingw_ovr int __cdecl _vscwprintf_p_l(const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
1056 {
1057 return __stdio_common_vswprintf_p(UCRTBASE_PRINTF_DEFAULT_WIDE | UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR, NULL, 0, _Format, _Locale, _ArgList);
1058 }
_vscwprintf_p(const wchar_t * _Format,va_list _ArgList)1059 __mingw_ovr int __cdecl _vscwprintf_p(const wchar_t *_Format, va_list _ArgList)
1060 {
1061 return _vscwprintf_p_l(_Format, NULL, _ArgList);
1062 }
_scwprintf_p_l(const wchar_t * _Format,_locale_t _Locale,...)1063 __mingw_ovr int __cdecl _scwprintf_p_l(const wchar_t *_Format, _locale_t _Locale, ...)
1064 {
1065 __builtin_va_list _ArgList;
1066 int _Ret;
1067 __builtin_va_start(_ArgList, _Locale);
1068 _Ret = _vscwprintf_p_l(_Format, _Locale, _ArgList);
1069 __builtin_va_end(_ArgList);
1070 return _Ret;
1071 }
_scwprintf_p(const wchar_t * _Format,...)1072 __mingw_ovr int __cdecl _scwprintf_p(const wchar_t *_Format, ...)
1073 {
1074 __builtin_va_list _ArgList;
1075 int _Ret;
1076 __builtin_va_start(_ArgList, _Format);
1077 _Ret = _vscwprintf_p_l(_Format, NULL, _ArgList);
1078 __builtin_va_end(_ArgList);
1079 return _Ret;
1080 }
1081
_vscwprintf_l(const wchar_t * _Format,_locale_t _Locale,va_list _ArgList)1082 __mingw_ovr int __cdecl _vscwprintf_l(const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
1083 {
1084 return __stdio_common_vswprintf(UCRTBASE_PRINTF_DEFAULT_WIDE | UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR, NULL, 0, _Format, _Locale, _ArgList);
1085 }
_vscwprintf(const wchar_t * _Format,va_list _ArgList)1086 __mingw_ovr int __cdecl _vscwprintf(const wchar_t *_Format, va_list _ArgList)
1087 {
1088 return _vscwprintf_l(_Format, NULL, _ArgList);
1089 }
_scwprintf_l(const wchar_t * _Format,_locale_t _Locale,...)1090 __mingw_ovr int __cdecl _scwprintf_l(const wchar_t *_Format, _locale_t _Locale, ...)
1091 {
1092 __builtin_va_list _ArgList;
1093 int _Ret;
1094 __builtin_va_start(_ArgList, _Locale);
1095 _Ret = _vscwprintf_l(_Format, _Locale, _ArgList);
1096 __builtin_va_end(_ArgList);
1097 return _Ret;
1098 }
1099
_vswprintf_c_l(wchar_t * _DstBuf,size_t _MaxCount,const wchar_t * _Format,_locale_t _Locale,va_list _ArgList)1100 __mingw_ovr int __cdecl _vswprintf_c_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
1101 {
1102 return __stdio_common_vswprintf(UCRTBASE_PRINTF_DEFAULT_WIDE, _DstBuf, _MaxCount, _Format, _Locale, _ArgList);
1103 }
__vswprintf_l(wchar_t * _DstBuf,const wchar_t * _Format,_locale_t _Locale,va_list _ArgList)1104 __mingw_ovr int __cdecl __vswprintf_l(wchar_t *_DstBuf, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
1105 {
1106 return _vswprintf_c_l(_DstBuf, (size_t)-1, _Format, _Locale, _ArgList);
1107 }
_vswprintf_l(wchar_t * _DstBuf,size_t _MaxCount,const wchar_t * _Format,_locale_t _Locale,va_list _ArgList)1108 __mingw_ovr int __cdecl _vswprintf_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, va_list _ArgList)
1109 {
1110 return _vswprintf_c_l(_DstBuf, _MaxCount, _Format, _Locale, _ArgList);
1111 }
_vswprintf(wchar_t * _DstBuf,const wchar_t * _Format,va_list _ArgList)1112 __mingw_ovr int __cdecl _vswprintf(wchar_t *_DstBuf, const wchar_t *_Format, va_list _ArgList)
1113 {
1114 return _vswprintf_c_l(_DstBuf, (size_t)-1, _Format, NULL, _ArgList);
1115 }
_swprintf_c_l(wchar_t * _DstBuf,size_t _MaxCount,const wchar_t * _Format,_locale_t _Locale,...)1116 __mingw_ovr int __cdecl _swprintf_c_l(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, _locale_t _Locale, ...)
1117 {
1118 __builtin_va_list _ArgList;
1119 int _Ret;
1120 __builtin_va_start(_ArgList, _Locale);
1121 _Ret = _vswprintf_c_l(_DstBuf, _MaxCount, _Format, _Locale, _ArgList);
1122 __builtin_va_end(_ArgList);
1123 return _Ret;
1124 }
__swprintf_l(wchar_t * _DstBuf,const wchar_t * _Format,_locale_t _Locale,...)1125 __mingw_ovr int __cdecl __swprintf_l(wchar_t *_DstBuf, const wchar_t *_Format, _locale_t _Locale, ...)
1126 {
1127 __builtin_va_list _ArgList;
1128 int _Ret;
1129 __builtin_va_start(_ArgList, _Locale);
1130 _Ret = _vswprintf_c_l(_DstBuf, (size_t)-1, _Format, _Locale, _ArgList);
1131 __builtin_va_end(_ArgList);
1132 return _Ret;
1133 }
_swprintf(wchar_t * _DstBuf,const wchar_t * _Format,...)1134 __mingw_ovr int __cdecl _swprintf(wchar_t *_DstBuf, const wchar_t *_Format, ...)
1135 {
1136 __builtin_va_list _ArgList;
1137 int _Ret;
1138 __builtin_va_start(_ArgList, _Format);
1139 _Ret = _vswprintf_c_l(_DstBuf, (size_t)-1, _Format, NULL, _ArgList);
1140 __builtin_va_end(_ArgList);
1141 return _Ret;
1142 }
1143 #else /* __MSVCRT_VERSION__ >= 0x1400 */
1144 _CRTIMP int __cdecl _fwprintf_p(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...);
1145 _CRTIMP int __cdecl _wprintf_p(const wchar_t * __restrict__ _Format,...);
1146 _CRTIMP int __cdecl _vfwprintf_p(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList);
1147 _CRTIMP int __cdecl _vwprintf_p(const wchar_t * __restrict__ _Format,va_list _ArgList);
1148 _CRTIMP int __cdecl _swprintf_p(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,...);
1149 _SECIMP int __cdecl _vswprintf_p(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,va_list _ArgList);
1150 _CRTIMP int __cdecl _scwprintf_p(const wchar_t * __restrict__ _Format,...);
1151 _SECIMP int __cdecl _vscwprintf_p(const wchar_t * __restrict__ _Format,va_list _ArgList);
1152 _CRTIMP int __cdecl _wprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
1153 _CRTIMP int __cdecl _wprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
1154 _CRTIMP int __cdecl _vwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
1155 _CRTIMP int __cdecl _vwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
1156 _CRTIMP int __cdecl _fwprintf_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
1157 _CRTIMP int __cdecl _fwprintf_p_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
1158 _CRTIMP int __cdecl _vfwprintf_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
1159 _CRTIMP int __cdecl _vfwprintf_p_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
1160 _CRTIMP int __cdecl _swprintf_c_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
1161 _CRTIMP int __cdecl _swprintf_p_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
1162 _CRTIMP int __cdecl _vswprintf_c_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
1163 _CRTIMP int __cdecl _vswprintf_p_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
1164 _CRTIMP int __cdecl _scwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
1165 _CRTIMP int __cdecl _scwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
1166 _CRTIMP int __cdecl _vscwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
1167 _CRTIMP int __cdecl _snwprintf_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
1168 _CRTIMP int __cdecl _vsnwprintf_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1169 _CRTIMP int __cdecl _swprintf(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,...);
1170 _CRTIMP int __cdecl _vswprintf(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,va_list _Args);
1171 _CRTIMP int __cdecl __swprintf_l(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,_locale_t _Plocinfo,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1172 _CRTIMP int __cdecl _vswprintf_l(wchar_t * __restrict__ _Dest,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1173 _CRTIMP int __cdecl __vswprintf_l(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,_locale_t _Plocinfo,va_list _Args) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1174 #endif /* __MSVCRT_VERSION__ < 0x1400 */
1175
1176 #ifndef RC_INVOKED
1177 #include <swprintf.inl>
1178 #endif
1179
1180 #ifdef _CRT_NON_CONFORMING_SWPRINTFS
1181 #ifndef __cplusplus
1182 #define _swprintf_l __swprintf_l
1183 #define _vswprintf_l __vswprintf_l
1184 #endif
1185 #endif
1186
1187 _CRTIMP wchar_t *__cdecl _wtempnam(const wchar_t *_Directory,const wchar_t *_FilePrefix);
1188 #if __MSVCRT_VERSION__ < 0x1400
1189 _CRTIMP int __cdecl _vscwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList);
1190 _CRTIMP int __cdecl _vscwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList);
1191 _CRTIMP int __cdecl _fwscanf_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1192 _CRTIMP int __cdecl _swscanf_l(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,_locale_t _Locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1193 _CRTIMP int __cdecl _snwscanf(const wchar_t * __restrict__ _Src,size_t _MaxCount,const wchar_t * __restrict__ _Format,...);
1194 _CRTIMP int __cdecl _snwscanf_l(const wchar_t * __restrict__ _Src,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...);
1195 _CRTIMP int __cdecl _wscanf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1196 #endif /* __MSVCRT_VERSION__ < 0x1400 */
1197 _CRTIMP FILE *__cdecl _wfdopen(int _FileHandle ,const wchar_t *_Mode);
1198 _CRTIMP FILE *__cdecl _wfopen(const wchar_t * __restrict__ _Filename,const wchar_t * __restrict__ _Mode) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1199 _CRTIMP FILE *__cdecl _wfreopen(const wchar_t * __restrict__ _Filename,const wchar_t * __restrict__ _Mode,FILE * __restrict__ _OldFile) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1200
1201 #ifndef _CRT_WPERROR_DEFINED
1202 #define _CRT_WPERROR_DEFINED
1203 _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg);
1204 #endif
1205 _CRTIMP FILE *__cdecl _wpopen(const wchar_t *_Command,const wchar_t *_Mode);
1206 #if !defined(NO_OLDNAMES) && !defined(wpopen)
1207 #define wpopen _wpopen
1208 #endif
1209 _CRTIMP int __cdecl _wremove(const wchar_t *_Filename);
1210 _CRTIMP wchar_t *__cdecl _wtmpnam(wchar_t *_Buffer);
1211 _CRTIMP wint_t __cdecl _fgetwc_nolock(FILE *_File);
1212 _CRTIMP wint_t __cdecl _fputwc_nolock(wchar_t _Ch,FILE *_File);
1213 _CRTIMP wint_t __cdecl _ungetwc_nolock(wint_t _Ch,FILE *_File);
1214
1215 #undef _CRT_GETPUTWCHAR_NOINLINE
1216
1217 #if !defined(__cplusplus) || defined(_CRT_GETPUTWCHAR_NOINLINE) || defined (__CRT__NO_INLINE)
1218 #define getwchar() fgetwc(stdin)
1219 #define putwchar(_c) fputwc((_c),stdout)
1220 #else
getwchar()1221 __CRT_INLINE wint_t __cdecl getwchar() {return (fgetwc(stdin)); }
putwchar(wchar_t _C)1222 __CRT_INLINE wint_t __cdecl putwchar(wchar_t _C) {return (fputwc(_C,stdout)); }
1223 #endif
1224
1225 #define getwc(_stm) fgetwc(_stm)
1226 #define putwc(_c,_stm) fputwc(_c,_stm)
1227 #define _putwc_nolock(_c,_stm) _fputwc_nolock(_c,_stm)
1228 #define _getwc_nolock(_c) _fgetwc_nolock(_c)
1229 #endif
1230
1231 #ifndef _WSTDLIB_DEFINED
1232 #define _WSTDLIB_DEFINED
1233
1234 _CRTIMP wchar_t *__cdecl _itow(int _Value,wchar_t *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1235 _CRTIMP wchar_t *__cdecl _ltow(long _Value,wchar_t *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1236 _CRTIMP wchar_t *__cdecl _ultow(unsigned long _Value,wchar_t *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1237 _CRTIMP double __cdecl _wcstod_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,_locale_t _Locale);
1238
1239 double __cdecl __mingw_wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr);
1240 float __cdecl __mingw_wcstof(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr);
1241 long double __cdecl __mingw_wcstold(const wchar_t * __restrict__, wchar_t ** __restrict__);
1242
1243 #if __USE_MINGW_ANSI_STDIO
1244 __mingw_ovr
wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr)1245 double __cdecl wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr){
1246 return __mingw_wcstod(_Str,_EndPtr);
1247 }
1248 __mingw_ovr
wcstof(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr)1249 float __cdecl wcstof(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr){
1250 return __mingw_wcstof(_Str,_EndPtr);
1251 }
1252 /* wcstold is already a mingw implementation */
1253 #else
1254 double __cdecl wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr);
1255 float __cdecl wcstof(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr);
1256 #endif /* defined(__USE_MINGW_STRTOX) */
1257 #if !defined __NO_ISOCEXT /* in libmingwex.a */
1258 long double __cdecl wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__);
1259 #endif /* __NO_ISOCEXT */
1260 long __cdecl wcstol(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix);
1261 _CRTIMP long __cdecl _wcstol_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix,_locale_t _Locale);
1262 unsigned long __cdecl wcstoul(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix);
1263 _CRTIMP unsigned long __cdecl _wcstoul_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix,_locale_t _Locale);
1264 _CRTIMP wchar_t *__cdecl _wgetenv(const wchar_t *_VarName) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1265 #ifndef _CRT_WSYSTEM_DEFINED
1266 #define _CRT_WSYSTEM_DEFINED
1267 _CRTIMP int __cdecl _wsystem(const wchar_t *_Command);
1268 #endif
1269 _CRTIMP double __cdecl _wtof(const wchar_t *_Str);
1270 _CRTIMP double __cdecl _wtof_l(const wchar_t *_Str,_locale_t _Locale);
1271 _CRTIMP int __cdecl _wtoi(const wchar_t *_Str);
1272 _CRTIMP int __cdecl _wtoi_l(const wchar_t *_Str,_locale_t _Locale);
1273 _CRTIMP long __cdecl _wtol(const wchar_t *_Str);
1274 _CRTIMP long __cdecl _wtol_l(const wchar_t *_Str,_locale_t _Locale);
1275
1276 __MINGW_EXTENSION _CRTIMP wchar_t *__cdecl _i64tow(__int64 _Val,wchar_t *_DstBuf,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1277 __MINGW_EXTENSION _CRTIMP wchar_t *__cdecl _ui64tow(unsigned __int64 _Val,wchar_t *_DstBuf,int _Radix);
1278 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wtoi64(const wchar_t *_Str);
1279 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wtoi64_l(const wchar_t *_Str,_locale_t _Locale);
1280 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
1281 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
1282 __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
1283 __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
1284 #endif
1285
1286 #ifndef _POSIX_
1287 #ifndef _WSTDLIBP_DEFINED
1288 #define _WSTDLIBP_DEFINED
1289 _CRTIMP wchar_t *__cdecl _wfullpath(wchar_t *_FullPath,const wchar_t *_Path,size_t _SizeInWords);
1290 _CRTIMP void __cdecl _wmakepath(wchar_t *_ResultPath,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext);
1291 #ifndef _CRT_WPERROR_DEFINED
1292 #define _CRT_WPERROR_DEFINED
1293 _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg);
1294 #endif
1295 _CRTIMP int __cdecl _wputenv(const wchar_t *_EnvString);
1296 _CRTIMP void __cdecl _wsearchenv(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1297 _CRTIMP void __cdecl _wsplitpath(const wchar_t *_FullPath,wchar_t *_Drive,wchar_t *_Dir,wchar_t *_Filename,wchar_t *_Ext) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1298 #endif
1299 #endif
1300
1301 #ifndef _WSTRING_DEFINED
1302 #define _WSTRING_DEFINED
1303 _CRTIMP wchar_t *__cdecl _wcsdup(const wchar_t *_Str);
1304 wchar_t *__cdecl wcscat(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1305 _CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch);
1306 int __cdecl wcscmp(const wchar_t *_Str1,const wchar_t *_Str2);
1307 wchar_t *__cdecl wcscpy(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1308 size_t __cdecl wcscspn(const wchar_t *_Str,const wchar_t *_Control);
1309 size_t __cdecl wcslen(const wchar_t *_Str);
1310 size_t __cdecl wcsnlen(const wchar_t *_Src,size_t _MaxCount);
1311 wchar_t *__cdecl wcsncat(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source,size_t _Count) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1312 int __cdecl wcsncmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
1313 wchar_t *__cdecl wcsncpy(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source,size_t _Count) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1314 wchar_t *__cdecl _wcsncpy_l(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source,size_t _Count,_locale_t _Locale) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1315 _CONST_RETURN wchar_t *__cdecl wcspbrk(const wchar_t *_Str,const wchar_t *_Control);
1316 _CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch);
1317 size_t __cdecl wcsspn(const wchar_t *_Str,const wchar_t *_Control);
1318 _CONST_RETURN wchar_t *__cdecl wcsstr(const wchar_t *_Str,const wchar_t *_SubStr);
1319 wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1320 _CRTIMP wchar_t *__cdecl _wcserror(int _ErrNum) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1321 _CRTIMP wchar_t *__cdecl __wcserror(const wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1322 _CRTIMP int __cdecl _wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2);
1323 _CRTIMP int __cdecl _wcsicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
1324 _CRTIMP int __cdecl _wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
1325 _CRTIMP int __cdecl _wcsnicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
1326 _CRTIMP wchar_t *__cdecl _wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1327 _CRTIMP wchar_t *__cdecl _wcsrev(wchar_t *_Str);
1328 _CRTIMP wchar_t *__cdecl _wcsset(wchar_t *_Str,wchar_t _Val) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1329 _CRTIMP wchar_t *__cdecl _wcslwr(wchar_t *_String) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1330 _CRTIMP wchar_t *_wcslwr_l(wchar_t *_String,_locale_t _Locale) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1331 _CRTIMP wchar_t *__cdecl _wcsupr(wchar_t *_String) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1332 _CRTIMP wchar_t *_wcsupr_l(wchar_t *_String,_locale_t _Locale) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1333 size_t __cdecl wcsxfrm(wchar_t * __restrict__ _Dst,const wchar_t * __restrict__ _Src,size_t _MaxCount);
1334 _CRTIMP size_t __cdecl _wcsxfrm_l(wchar_t * __restrict__ _Dst,const wchar_t * __restrict__ _Src,size_t _MaxCount,_locale_t _Locale);
1335 int __cdecl wcscoll(const wchar_t *_Str1,const wchar_t *_Str2);
1336 _CRTIMP int __cdecl _wcscoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
1337 _CRTIMP int __cdecl _wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2);
1338 _CRTIMP int __cdecl _wcsicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
1339 _CRTIMP int __cdecl _wcsncoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
1340 _CRTIMP int __cdecl _wcsncoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
1341 _CRTIMP int __cdecl _wcsnicoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
1342 _CRTIMP int __cdecl _wcsnicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
1343
1344 #ifndef NO_OLDNAMES
1345 wchar_t *__cdecl wcsdup(const wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
1346 #define wcswcs wcsstr
1347 int __cdecl wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
1348 int __cdecl wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
1349 wchar_t *__cdecl wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
1350 wchar_t *__cdecl wcsrev(wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
1351 wchar_t *__cdecl wcsset(wchar_t *_Str,wchar_t _Val) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
1352 wchar_t *__cdecl wcslwr(wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
1353 wchar_t *__cdecl wcsupr(wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
1354 int __cdecl wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
1355 #endif
1356 #endif
1357
1358 #ifndef _TM_DEFINED
1359 #define _TM_DEFINED
1360 struct tm {
1361 int tm_sec;
1362 int tm_min;
1363 int tm_hour;
1364 int tm_mday;
1365 int tm_mon;
1366 int tm_year;
1367 int tm_wday;
1368 int tm_yday;
1369 int tm_isdst;
1370 };
1371 #endif
1372
1373 #ifndef _WTIME_DEFINED
1374 #define _WTIME_DEFINED
1375
1376 _CRTIMP wchar_t *__cdecl _wasctime(const struct tm *_Tm);
1377 _SECIMP errno_t __cdecl _wasctime_s (wchar_t *_Buf,size_t _SizeInWords,const struct tm *_Tm);
1378 wchar_t *__cdecl _wctime32(const __time32_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1379 _SECIMP errno_t __cdecl _wctime32_s (wchar_t *_Buf,size_t _SizeInWords,const __time32_t *_Time);
1380 size_t __cdecl wcsftime(wchar_t * __restrict__ _Buf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,const struct tm * __restrict__ _Tm);
1381 _CRTIMP size_t __cdecl _wcsftime_l(wchar_t * __restrict__ _Buf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,const struct tm * __restrict__ _Tm,_locale_t _Locale);
1382 _CRTIMP wchar_t *__cdecl _wstrdate(wchar_t *_Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1383 _SECIMP errno_t __cdecl _wstrdate_s (wchar_t *_Buf,size_t _SizeInWords);
1384 _CRTIMP wchar_t *__cdecl _wstrtime(wchar_t *_Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1385 _SECIMP errno_t __cdecl _wstrtime_s (wchar_t *_Buf,size_t _SizeInWords);
1386 _CRTIMP wchar_t *__cdecl _wctime64(const __time64_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1387 _SECIMP errno_t __cdecl _wctime64_s (wchar_t *_Buf,size_t _SizeInWords,const __time64_t *_Time);
1388
1389 #if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL)
1390 #define _INC_WTIME_INL
1391 wchar_t *__cdecl _wctime(const time_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1392 #ifndef __CRT__NO_INLINE
1393 #ifndef _USE_32BIT_TIME_T
_wctime(const time_t * _Time)1394 __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_Time); }
1395 #else
_wctime(const time_t * _Time)1396 __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime32(_Time); }
1397 #endif
1398 #endif /* __CRT__NO_INLINE */
1399 #endif
1400
1401 #if !defined (RC_INVOKED) && !defined (_INC_WTIME_S_INL)
1402 #define _INC_WTIME_S_INL
1403 errno_t __cdecl _wctime_s(wchar_t *, size_t, const time_t *);
1404 #ifndef __CRT__NO_INLINE
1405 #ifndef _USE_32BIT_TIME_T
_wctime_s(wchar_t * _Buffer,size_t _SizeInWords,const time_t * _Time)1406 __CRT_INLINE errno_t __cdecl _wctime_s (wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime64_s (_Buffer,_SizeInWords,_Time); }
1407 #else
_wctime_s(wchar_t * _Buffer,size_t _SizeInWords,const time_t * _Time)1408 __CRT_INLINE errno_t __cdecl _wctime_s (wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime32_s (_Buffer,_SizeInWords,_Time); }
1409 #endif /* _USE_32BIT_TIME_T */
1410 #endif /* __CRT__NO_INLINE */
1411 #endif /* !defined (RC_INVOKED) && !defined (_INC_WTIME_S_INL) */
1412
1413 #endif
1414
1415 typedef int mbstate_t;
1416 typedef wchar_t _Wint_t;
1417
1418 wint_t __cdecl btowc(int);
1419 size_t __cdecl mbrlen(const char * __restrict__ _Ch,size_t _SizeInBytes,mbstate_t * __restrict__ _State);
1420 size_t __cdecl mbrtowc(wchar_t * __restrict__ _DstCh,const char * __restrict__ _SrcCh,size_t _SizeInBytes,mbstate_t * __restrict__ _State);
1421 size_t __cdecl mbsrtowcs(wchar_t * __restrict__ _Dest,const char ** __restrict__ _PSrc,size_t _Count,mbstate_t * __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1422 size_t __cdecl wcrtomb(char * __restrict__ _Dest,wchar_t _Source,mbstate_t * __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1423 size_t __cdecl wcsrtombs(char * __restrict__ _Dest,const wchar_t ** __restrict__ _PSource,size_t _Count,mbstate_t * __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1424 int __cdecl wctob(wint_t _WCh);
1425
1426 #ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */
1427 wchar_t *__cdecl wmemset(wchar_t *s, wchar_t c, size_t n);
1428 _CONST_RETURN wchar_t *__cdecl wmemchr(const wchar_t *s, wchar_t c, size_t n);
1429 int __cdecl wmemcmp(const wchar_t *s1, const wchar_t *s2,size_t n);
1430 wchar_t *__cdecl wmemcpy(wchar_t * __restrict__ s1,const wchar_t * __restrict__ s2,size_t n) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1431 wchar_t * __cdecl wmempcpy (wchar_t *_Dst, const wchar_t *_Src, size_t _Size);
1432 wchar_t *__cdecl wmemmove(wchar_t *s1, const wchar_t *s2, size_t n) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1433 int __cdecl fwide(FILE *stream,int mode);
1434 int __cdecl mbsinit(const mbstate_t *ps);
1435 __MINGW_EXTENSION long long __cdecl wcstoll(const wchar_t * __restrict__ nptr,wchar_t ** __restrict__ endptr, int base);
1436 __MINGW_EXTENSION unsigned long long __cdecl wcstoull(const wchar_t * __restrict__ nptr,wchar_t ** __restrict__ endptr, int base);
1437 #endif /* __NO_ISOCEXT */
1438
1439 void *__cdecl memmove(void *_Dst,const void *_Src,size_t _MaxCount);
1440 void *__cdecl memcpy(void * __restrict__ _Dst,const void * __restrict__ _Src,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
1441 #ifndef __CRT__NO_INLINE
fwide(FILE * _F,int _M)1442 __CRT_INLINE int __cdecl fwide(FILE *_F,int _M) { (void)_F; return (_M); }
mbsinit(const mbstate_t * _P)1443 __CRT_INLINE int __cdecl mbsinit(const mbstate_t *_P) { return (!_P || *_P==0); }
wmemchr(const wchar_t * _S,wchar_t _C,size_t _N)1444 __CRT_INLINE _CONST_RETURN wchar_t *__cdecl wmemchr(const wchar_t *_S,wchar_t _C,size_t _N) {
1445 if (_S) {
1446 for ( ; 0 < _N; ++_S, --_N)
1447 if (*_S == _C)
1448 return (_CONST_RETURN wchar_t *)(_S);
1449 }
1450 return (_CONST_RETURN wchar_t *) NULL;
1451 }
wmemcmp(const wchar_t * _S1,const wchar_t * _S2,size_t _N)1452 __CRT_INLINE int __cdecl wmemcmp(const wchar_t *_S1,const wchar_t *_S2,size_t _N) {
1453 if (_N == 0 || _S1 == _S2)
1454 return 0; /* even for NULL pointers. */
1455 if ((_S1 && !(_S2)) || (_S2 && !(_S1)))
1456 return !(_S2) ? 1 : -1; /* robust. */
1457 for ( ; 0 < _N; ++_S1, ++_S2, --_N)
1458 if (*_S1 != *_S2)
1459 return (*_S1 < *_S2 ? -1 : +1);
1460 return 0;
1461 }
wmemcpy(wchar_t * __restrict__ _S1,const wchar_t * __restrict__ _S2,size_t _N)1462 __CRT_INLINE wchar_t *__cdecl wmemcpy(wchar_t * __restrict__ _S1,const wchar_t * __restrict__ _S2,size_t _N)
1463 {
1464 return (wchar_t *) memcpy (_S1,_S2,_N*sizeof(wchar_t));
1465 }
wmemmove(wchar_t * _S1,const wchar_t * _S2,size_t _N)1466 __CRT_INLINE wchar_t *__cdecl wmemmove(wchar_t *_S1,const wchar_t *_S2,size_t _N) { return (wchar_t *)memmove(_S1,_S2,_N*sizeof(wchar_t)); }
wmemset(wchar_t * _S,wchar_t _C,size_t _N)1467 __CRT_INLINE wchar_t *__cdecl wmemset(wchar_t *_S,wchar_t _C,size_t _N) {
1468 wchar_t *_Su = _S;
1469 for (;0<_N;++_Su,--_N) {
1470 *_Su = _C;
1471 }
1472 return (_S);
1473 }
1474 #endif /* !__CRT__NO_INLINE */
1475
1476 #ifndef __MINGW_MBWC_CONVERT_DEFINED
1477 #define __MINGW_MBWC_CONVERT_DEFINED
1478
1479 /**
1480 * __mingw_str_wide_utf8
1481 * Converts a null terminated UCS-2 string to a multibyte (UTF-8) equivalent.
1482 * Caller is supposed to free allocated buffer with __mingw_str_free().
1483 * @param[in] wptr Pointer to wide string.
1484 * @param[out] mbptr Pointer to multibyte string.
1485 * @param[out] buflen Optional parameter for length of allocated buffer.
1486 * @return bytes written by WideCharToMultiByte conversion, 0 for failure.
1487 *
1488 * WideCharToMultiByte - http://msdn.microsoft.com/en-us/library/dd374130(VS.85).aspx
1489 */
1490 int __cdecl __mingw_str_wide_utf8 (const wchar_t * const wptr, char **mbptr, size_t * buflen);
1491
1492 /**
1493 * __mingw_str_utf8_wide
1494 * Converts a null terminated UTF-8 string to a UCS-2 equivalent.
1495 * Caller is supposed to free allocated buffer with __mingw_str_free().
1496 * @param[out] mbptr Pointer to multibyte string.
1497 * @param[in] wptr Pointer to wide string.
1498 * @param[out] buflen Optional parameter for length of allocated buffer.
1499 * @return bytes written by WideCharToMultiByte conversion, 0 for failure.
1500 *
1501 * MultiByteToWideChar - http://msdn.microsoft.com/en-us/library/dd319072(VS.85).aspx
1502 */
1503
1504 int __cdecl __mingw_str_utf8_wide (const char *const mbptr, wchar_t ** wptr, size_t * buflen);
1505
1506 /**
1507 * __mingw_str_free
1508 * Frees buffer create by __mingw_str_wide_utf8 and __mingw_str_utf8_wide.
1509 * @param[in] ptr memory block to free.
1510 *
1511 */
1512
1513 void __cdecl __mingw_str_free(void *ptr);
1514
1515 #endif /* __MINGW_MBWC_CONVERT_DEFINED */
1516
1517 #ifdef __cplusplus
1518 }
1519 #endif
1520
1521 #pragma pack(pop)
1522
1523 #include <sec_api/wchar_s.h>
1524
1525 #endif /* _INC_WCHAR */
1526
1527