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