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 #include <_mingw_print_push.h> 11 12 #if defined (__USE_MINGW_ANSI_STDIO) && !defined (__USE_MINGW_STRTOX) 13 #define __USE_MINGW_STRTOX 1 14 #endif 15 16 #pragma pack(push,_CRT_PACKING) 17 18 #ifdef __cplusplus 19 extern "C" { 20 #endif 21 22 #ifndef WCHAR_MIN /* also in stdint.h */ 23 #define WCHAR_MIN 0U 24 #define WCHAR_MAX 0xffffU 25 #endif 26 27 #ifndef WEOF 28 #define WEOF (wint_t)(0xFFFF) 29 #endif 30 31 #ifndef _FILE_DEFINED 32 struct _iobuf { 33 char *_ptr; 34 int _cnt; 35 char *_base; 36 int _flag; 37 int _file; 38 int _charbuf; 39 int _bufsiz; 40 char *_tmpfname; 41 }; 42 typedef struct _iobuf FILE; 43 #define _FILE_DEFINED 44 #endif 45 46 #ifndef _STDIO_DEFINED 47 #ifdef _WIN64 48 _CRTIMP FILE *__cdecl __iob_func(void); 49 #define _iob __iob_func() 50 #else 51 #ifdef _MSVCRT_ 52 extern FILE _iob[]; /* A pointer to an array of FILE */ 53 #define __iob_func() (_iob) 54 #else 55 extern FILE (* __MINGW_IMP_SYMBOL(_iob))[]; /* A pointer to an array of FILE */ 56 #define __iob_func() (* __MINGW_IMP_SYMBOL(_iob)) 57 #endif 58 #endif 59 60 #define _iob __iob_func() 61 #endif 62 63 #ifndef _STDSTREAM_DEFINED 64 #define stdin (&__iob_func()[0]) 65 #define stdout (&__iob_func()[1]) 66 #define stderr (&__iob_func()[2]) 67 #define _STDSTREAM_DEFINED 68 #endif 69 70 #ifndef _FSIZE_T_DEFINED 71 typedef unsigned long _fsize_t; 72 #define _FSIZE_T_DEFINED 73 #endif 74 75 #ifndef _WFINDDATA_T_DEFINED 76 struct _wfinddata32_t { 77 unsigned attrib; 78 __time32_t time_create; 79 __time32_t time_access; 80 __time32_t time_write; 81 _fsize_t size; 82 wchar_t name[260]; 83 }; 84 85 struct _wfinddata32i64_t { 86 unsigned attrib; 87 __time32_t time_create; 88 __time32_t time_access; 89 __time32_t time_write; 90 __MINGW_EXTENSION __int64 size; 91 wchar_t name[260]; 92 }; 93 94 struct _wfinddata64i32_t { 95 unsigned attrib; 96 __time64_t time_create; 97 __time64_t time_access; 98 __time64_t time_write; 99 _fsize_t size; 100 wchar_t name[260]; 101 }; 102 103 struct _wfinddata64_t { 104 unsigned attrib; 105 __time64_t time_create; 106 __time64_t time_access; 107 __time64_t time_write; 108 __MINGW_EXTENSION __int64 size; 109 wchar_t name[260]; 110 }; 111 /* #endif */ 112 113 #ifdef _USE_32BIT_TIME_T 114 #define _wfinddata_t _wfinddata32_t 115 #define _wfinddatai64_t _wfinddata32i64_t 116 117 #define _wfindfirst32 _wfindfirst 118 #define _wfindnext32 _wfindnext 119 #define _wfindfirst32i64 _wfindfirsti64 120 #define _wfindnext32i64 _wfindnexti64 121 #else 122 #define _wfinddata_t _wfinddata64i32_t 123 #define _wfinddatai64_t _wfinddata64_t 124 125 #define _wfindfirst _wfindfirst64i32 126 #define _wfindnext _wfindnext64i32 127 #define _wfindfirsti64 _wfindfirst64 128 #define _wfindnexti64 _wfindnext64 129 #endif 130 131 #define _WFINDDATA_T_DEFINED 132 #endif 133 134 #ifndef NULL 135 #ifdef __cplusplus 136 #ifndef _WIN64 137 #define NULL 0 138 #else 139 #define NULL 0LL 140 #endif /* W64 */ 141 #else 142 #define NULL ((void *)0) 143 #endif 144 #endif 145 146 #ifndef _CONST_RETURN 147 #define _CONST_RETURN 148 #endif 149 150 #define _WConst_return _CONST_RETURN 151 152 #ifndef _CRT_CTYPEDATA_DEFINED 153 #define _CRT_CTYPEDATA_DEFINED 154 #ifndef _CTYPE_DISABLE_MACROS 155 156 #ifndef __PCTYPE_FUNC 157 #define __PCTYPE_FUNC __pctype_func() 158 #ifdef _MSVCRT_ 159 #define __pctype_func() (_pctype) 160 #else 161 #define __pctype_func() (* __MINGW_IMP_SYMBOL(_pctype)) 162 #endif 163 #endif 164 165 #ifndef _pctype 166 #ifdef _MSVCRT_ 167 extern unsigned short *_pctype; 168 #else 169 extern unsigned short ** __MINGW_IMP_SYMBOL(_pctype); 170 #define _pctype (* __MINGW_IMP_SYMBOL(_pctype)) 171 #endif 172 #endif 173 #endif 174 #endif 175 176 #ifndef _CRT_WCTYPEDATA_DEFINED 177 #define _CRT_WCTYPEDATA_DEFINED 178 #ifndef _CTYPE_DISABLE_MACROS 179 #ifndef _wctype 180 #ifdef _MSVCRT_ 181 extern unsigned short *_wctype; 182 #else 183 extern unsigned short ** __MINGW_IMP_SYMBOL(_wctype); 184 #define _wctype (* __MINGW_IMP_SYMBOL(_wctype)) 185 #endif 186 #endif 187 188 #ifdef _MSVCRT_ 189 #define __pwctype_func() (_pwctype) 190 #else 191 #define __pwctype_func() (* __MINGW_IMP_SYMBOL(_pwctype)) 192 #endif 193 194 #ifndef _pwctype 195 #ifdef _MSVCRT_ 196 extern unsigned short *_pwctype; 197 #else 198 extern unsigned short ** __MINGW_IMP_SYMBOL(_pwctype); 199 #define _pwctype (* __MINGW_IMP_SYMBOL(_pwctype)) 200 #endif 201 #endif 202 203 #endif 204 #endif 205 206 #define _UPPER 0x1 207 #define _LOWER 0x2 208 #define _DIGIT 0x4 209 #define _SPACE 0x8 210 211 #define _PUNCT 0x10 212 #define _CONTROL 0x20 213 #define _BLANK 0x40 214 #define _HEX 0x80 215 216 #define _LEADBYTE 0x8000 217 #define _ALPHA (0x0100|_UPPER|_LOWER) 218 219 #ifndef _WCTYPE_DEFINED 220 #define _WCTYPE_DEFINED 221 222 int __cdecl iswalpha(wint_t _C); 223 _CRTIMP int __cdecl _iswalpha_l(wint_t _C,_locale_t _Locale); 224 int __cdecl iswupper(wint_t _C); 225 _CRTIMP int __cdecl _iswupper_l(wint_t _C,_locale_t _Locale); 226 int __cdecl iswlower(wint_t _C); 227 _CRTIMP int __cdecl _iswlower_l(wint_t _C,_locale_t _Locale); 228 int __cdecl iswdigit(wint_t _C); 229 _CRTIMP int __cdecl _iswdigit_l(wint_t _C,_locale_t _Locale); 230 int __cdecl iswxdigit(wint_t _C); 231 _CRTIMP int __cdecl _iswxdigit_l(wint_t _C,_locale_t _Locale); 232 int __cdecl iswspace(wint_t _C); 233 _CRTIMP int __cdecl _iswspace_l(wint_t _C,_locale_t _Locale); 234 int __cdecl iswpunct(wint_t _C); 235 _CRTIMP int __cdecl _iswpunct_l(wint_t _C,_locale_t _Locale); 236 int __cdecl iswalnum(wint_t _C); 237 _CRTIMP int __cdecl _iswalnum_l(wint_t _C,_locale_t _Locale); 238 int __cdecl iswprint(wint_t _C); 239 _CRTIMP int __cdecl _iswprint_l(wint_t _C,_locale_t _Locale); 240 int __cdecl iswgraph(wint_t _C); 241 _CRTIMP int __cdecl _iswgraph_l(wint_t _C,_locale_t _Locale); 242 int __cdecl iswcntrl(wint_t _C); 243 _CRTIMP int __cdecl _iswcntrl_l(wint_t _C,_locale_t _Locale); 244 int __cdecl iswascii(wint_t _C); 245 int __cdecl isleadbyte(int _C); 246 _CRTIMP int __cdecl _isleadbyte_l(int _C,_locale_t _Locale); 247 wint_t __cdecl towupper(wint_t _C); 248 _CRTIMP wint_t __cdecl _towupper_l(wint_t _C,_locale_t _Locale); 249 wint_t __cdecl towlower(wint_t _C); 250 _CRTIMP wint_t __cdecl _towlower_l(wint_t _C,_locale_t _Locale); 251 int __cdecl iswctype(wint_t _C,wctype_t _Type); 252 _CRTIMP int __cdecl _iswctype_l(wint_t _C,wctype_t _Type,_locale_t _Locale); 253 _CRTIMP int __cdecl __iswcsymf(wint_t _C); 254 _CRTIMP int __cdecl _iswcsymf_l(wint_t _C,_locale_t _Locale); 255 _CRTIMP int __cdecl __iswcsym(wint_t _C); 256 _CRTIMP int __cdecl _iswcsym_l(wint_t _C,_locale_t _Locale); 257 int __cdecl is_wctype(wint_t _C,wctype_t _Type); 258 259 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES) 260 int __cdecl iswblank(wint_t _C); 261 #endif 262 263 #endif 264 265 #ifndef _WDIRECT_DEFINED 266 #define _WDIRECT_DEFINED 267 268 _CRTIMP wchar_t *__cdecl _wgetcwd(wchar_t *_DstBuf,int _SizeInWords); 269 _CRTIMP wchar_t *__cdecl _wgetdcwd(int _Drive,wchar_t *_DstBuf,int _SizeInWords); 270 wchar_t *__cdecl _wgetdcwd_nolock(int _Drive,wchar_t *_DstBuf,int _SizeInWords); 271 _CRTIMP int __cdecl _wchdir(const wchar_t *_Path); 272 _CRTIMP int __cdecl _wmkdir(const wchar_t *_Path); 273 _CRTIMP int __cdecl _wrmdir(const wchar_t *_Path); 274 #endif 275 276 #ifndef _WIO_DEFINED 277 #define _WIO_DEFINED 278 279 _CRTIMP int __cdecl _waccess(const wchar_t *_Filename,int _AccessMode); 280 _CRTIMP int __cdecl _wchmod(const wchar_t *_Filename,int _Mode); 281 _CRTIMP int __cdecl _wcreat(const wchar_t *_Filename,int _PermissionMode) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 282 _CRTIMP intptr_t __cdecl _wfindfirst32(const wchar_t *_Filename,struct _wfinddata32_t *_FindData); 283 _CRTIMP int __cdecl _wfindnext32(intptr_t _FindHandle,struct _wfinddata32_t *_FindData); 284 _CRTIMP int __cdecl _wunlink(const wchar_t *_Filename); 285 _CRTIMP int __cdecl _wrename(const wchar_t *_OldFilename,const wchar_t *_NewFilename); 286 _CRTIMP wchar_t *__cdecl _wmktemp(wchar_t *_TemplateName) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 287 _CRTIMP intptr_t __cdecl _wfindfirst32i64(const wchar_t *_Filename,struct _wfinddata32i64_t *_FindData); 288 intptr_t __cdecl _wfindfirst64i32(const wchar_t *_Filename,struct _wfinddata64i32_t *_FindData); 289 _CRTIMP intptr_t __cdecl _wfindfirst64(const wchar_t *_Filename,struct _wfinddata64_t *_FindData); 290 _CRTIMP int __cdecl _wfindnext32i64(intptr_t _FindHandle,struct _wfinddata32i64_t *_FindData); 291 int __cdecl _wfindnext64i32(intptr_t _FindHandle,struct _wfinddata64i32_t *_FindData); 292 _CRTIMP int __cdecl _wfindnext64(intptr_t _FindHandle,struct _wfinddata64_t *_FindData); 293 _CRTIMP errno_t __cdecl _wsopen_s(int *_FileHandle,const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionFlag); 294 _CRTIMP int __cdecl _wopen(const wchar_t *_Filename,int _OpenFlag,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 295 _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 296 #endif 297 298 #ifndef _WLOCALE_DEFINED 299 #define _WLOCALE_DEFINED 300 _CRTIMP wchar_t *__cdecl _wsetlocale(int _Category,const wchar_t *_Locale); 301 #endif 302 303 #ifndef _WPROCESS_DEFINED 304 #define _WPROCESS_DEFINED 305 306 _CRTIMP intptr_t __cdecl _wexecl(const wchar_t *_Filename,const wchar_t *_ArgList,...); 307 _CRTIMP intptr_t __cdecl _wexecle(const wchar_t *_Filename,const wchar_t *_ArgList,...); 308 _CRTIMP intptr_t __cdecl _wexeclp(const wchar_t *_Filename,const wchar_t *_ArgList,...); 309 _CRTIMP intptr_t __cdecl _wexeclpe(const wchar_t *_Filename,const wchar_t *_ArgList,...); 310 _CRTIMP intptr_t __cdecl _wexecv(const wchar_t *_Filename,const wchar_t *const *_ArgList); 311 _CRTIMP intptr_t __cdecl _wexecve(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); 312 _CRTIMP intptr_t __cdecl _wexecvp(const wchar_t *_Filename,const wchar_t *const *_ArgList); 313 _CRTIMP intptr_t __cdecl _wexecvpe(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); 314 _CRTIMP intptr_t __cdecl _wspawnl(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); 315 _CRTIMP intptr_t __cdecl _wspawnle(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); 316 _CRTIMP intptr_t __cdecl _wspawnlp(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); 317 _CRTIMP intptr_t __cdecl _wspawnlpe(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); 318 _CRTIMP intptr_t __cdecl _wspawnv(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList); 319 _CRTIMP intptr_t __cdecl _wspawnve(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); 320 _CRTIMP intptr_t __cdecl _wspawnvp(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList); 321 _CRTIMP intptr_t __cdecl _wspawnvpe(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); 322 #ifndef _CRT_WSYSTEM_DEFINED 323 #define _CRT_WSYSTEM_DEFINED 324 _CRTIMP int __cdecl _wsystem(const wchar_t *_Command); 325 #endif 326 #endif 327 328 #ifndef _WCTYPE_INLINE_DEFINED 329 #undef _CRT_WCTYPE_NOINLINE 330 #if !defined(__cplusplus) || defined(_CRT_WCTYPE_NOINLINE) 331 #define iswalpha(_c) (iswctype(_c,_ALPHA)) 332 #define iswupper(_c) (iswctype(_c,_UPPER)) 333 #define iswlower(_c) (iswctype(_c,_LOWER)) 334 #define iswdigit(_c) (iswctype(_c,_DIGIT)) 335 #define iswxdigit(_c) (iswctype(_c,_HEX)) 336 #define iswspace(_c) (iswctype(_c,_SPACE)) 337 #define iswpunct(_c) (iswctype(_c,_PUNCT)) 338 #define iswalnum(_c) (iswctype(_c,_ALPHA|_DIGIT)) 339 #define iswprint(_c) (iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT)) 340 #define iswgraph(_c) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT)) 341 #define iswcntrl(_c) (iswctype(_c,_CONTROL)) 342 #define iswascii(_c) ((unsigned)(_c) < 0x80) 343 344 #define _iswalpha_l(_c,_p) (_iswctype_l(_c,_ALPHA,_p)) 345 #define _iswupper_l(_c,_p) (_iswctype_l(_c,_UPPER,_p)) 346 #define _iswlower_l(_c,_p) (_iswctype_l(_c,_LOWER,_p)) 347 #define _iswdigit_l(_c,_p) (_iswctype_l(_c,_DIGIT,_p)) 348 #define _iswxdigit_l(_c,_p) (_iswctype_l(_c,_HEX,_p)) 349 #define _iswspace_l(_c,_p) (_iswctype_l(_c,_SPACE,_p)) 350 #define _iswpunct_l(_c,_p) (_iswctype_l(_c,_PUNCT,_p)) 351 #define _iswalnum_l(_c,_p) (_iswctype_l(_c,_ALPHA|_DIGIT,_p)) 352 #define _iswprint_l(_c,_p) (_iswctype_l(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT,_p)) 353 #define _iswgraph_l(_c,_p) (_iswctype_l(_c,_PUNCT|_ALPHA|_DIGIT,_p)) 354 #define _iswcntrl_l(_c,_p) (_iswctype_l(_c,_CONTROL,_p)) 355 #ifndef _CTYPE_DISABLE_MACROS 356 #define isleadbyte(_c) (__PCTYPE_FUNC[(unsigned char)(_c)] & _LEADBYTE) 357 #endif 358 #endif 359 #define _WCTYPE_INLINE_DEFINED 360 #endif 361 362 #if !defined(_POSIX_) || defined(__GNUC__) 363 #ifndef _INO_T_DEFINED 364 #define _INO_T_DEFINED 365 typedef unsigned short _ino_t; 366 #ifndef NO_OLDNAMES 367 typedef unsigned short ino_t; 368 #endif 369 #endif 370 371 #ifndef _DEV_T_DEFINED 372 #define _DEV_T_DEFINED 373 typedef unsigned int _dev_t; 374 #ifndef NO_OLDNAMES 375 typedef unsigned int dev_t; 376 #endif 377 #endif 378 379 #include <_mingw_off_t.h> 380 #include <_mingw_stat64.h> 381 382 #ifndef _WSTAT_DEFINED 383 #define _WSTAT_DEFINED 384 385 _CRTIMP int __cdecl _wstat32(const wchar_t *_Name,struct _stat32 *_Stat); 386 _CRTIMP int __cdecl _wstat32i64(const wchar_t *_Name,struct _stat32i64 *_Stat); 387 int __cdecl _wstat64i32(const wchar_t *_Name,struct _stat64i32 *_Stat); 388 _CRTIMP int __cdecl _wstat64(const wchar_t *_Name,struct _stat64 *_Stat); 389 #endif 390 #endif 391 392 #ifndef _WCONIO_DEFINED 393 #define _WCONIO_DEFINED 394 395 #ifndef WEOF 396 #define WEOF (wint_t)(0xFFFF) 397 #endif 398 399 _CRTIMP wchar_t *_cgetws(wchar_t *_Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 400 _CRTIMP wint_t __cdecl _getwch(void); 401 _CRTIMP wint_t __cdecl _getwche(void); 402 _CRTIMP wint_t __cdecl _putwch(wchar_t _WCh); 403 _CRTIMP wint_t __cdecl _ungetwch(wint_t _WCh); 404 _CRTIMP int __cdecl _cputws(const wchar_t *_String); 405 _CRTIMP int __cdecl _cwprintf(const wchar_t * __restrict__ _Format,...); 406 _CRTIMP int __cdecl _cwscanf(const wchar_t * __restrict__ _Format,...); 407 _CRTIMP int __cdecl _cwscanf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 408 _CRTIMP int __cdecl _vcwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList); 409 _CRTIMP int __cdecl _cwprintf_p(const wchar_t * __restrict__ _Format,...); 410 _CRTIMP int __cdecl _vcwprintf_p(const wchar_t * __restrict__ _Format,va_list _ArgList); 411 412 _CRTIMP int __cdecl _cwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 413 _CRTIMP int __cdecl _vcwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 414 _CRTIMP int __cdecl _cwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 415 _CRTIMP int __cdecl _vcwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 416 wint_t __cdecl _putwch_nolock(wchar_t _WCh); 417 wint_t __cdecl _getwch_nolock(void); 418 wint_t __cdecl _getwche_nolock(void); 419 wint_t __cdecl _ungetwch_nolock(wint_t _WCh); 420 #endif 421 422 #ifndef _WSTDIO_DEFINED 423 #define _WSTDIO_DEFINED 424 425 /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) 426 int __cdecl __mingw_swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...); 427 /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) 428 int __cdecl __mingw_vswscanf (const wchar_t * __restrict__ _Str,const wchar_t * __restrict__ Format,va_list argp); 429 /* __attribute__((__format__ (gnu_wscanf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1) 430 int __cdecl __mingw_wscanf(const wchar_t * __restrict__ _Format,...); 431 /* __attribute__((__format__ (gnu_wscanf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1) 432 int __cdecl __mingw_vwscanf(const wchar_t * __restrict__ Format, va_list argp); 433 /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) 434 int __cdecl __mingw_fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); 435 /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) 436 int __cdecl __mingw_vfwscanf (FILE * __restrict__ fp, const wchar_t * __restrict__ Format,va_list argp); 437 438 439 /* __attribute__((__format__ (gnu_wprintf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) 440 int __cdecl __mingw_fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); 441 /* __attribute__((__format__ (gnu_wprintf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1) 442 int __cdecl __mingw_wprintf(const wchar_t * __restrict__ _Format,...); 443 /* __attribute__((__format__ (gnu_wprintf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) 444 int __cdecl __mingw_vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList); 445 /* __attribute__((__format__ (gnu_printf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1) 446 int __cdecl __mingw_vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList); 447 /* __attribute__((__format__ (gnu_wprintf, 3, 4))) */ __MINGW_ATTRIB_NONNULL(3) 448 int __cdecl __mingw_snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...); 449 /* __attribute__((__format__ (gnu_wprintf, 3, 0))) */ __MINGW_ATTRIB_NONNULL(3) 450 int __cdecl __mingw_vsnwprintf (wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list); 451 /* __attribute__((__format__ (gnu_wprintf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) 452 int __cdecl __mingw_swprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , ...); 453 /* __attribute__((__format__ (gnu_wprintf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) 454 int __cdecl __mingw_vswprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ ,va_list); 455 456 #undef __mingw_ovr 457 #if defined (__GNUC__) 458 #define __mingw_ovr static __attribute__ ((__unused__)) __inline__ __cdecl 459 #elif defined(__cplusplus) 460 #define __mingw_ovr inline __cdecl 461 #else 462 #define __mingw_ovr static __cdecl 463 #endif 464 465 #if __USE_MINGW_ANSI_STDIO 466 467 /* 468 * User has expressed a preference for C99 conformance... 469 */ 470 __mingw_ovr 471 /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) 472 int swscanf(const wchar_t *__source, const wchar_t *__format, ...) 473 { 474 register int __retval; 475 __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); 476 __retval = __mingw_vswscanf( __source, __format, __local_argv ); 477 __builtin_va_end( __local_argv ); 478 return __retval; 479 } 480 481 __mingw_ovr 482 /* __attribute__((__format__ (gnu_wscanf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1) 483 int wscanf(const wchar_t *__format, ...) 484 { 485 register int __retval; 486 __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); 487 __retval = __mingw_vwscanf( __format, __local_argv ); 488 __builtin_va_end( __local_argv ); 489 return __retval; 490 } 491 492 __mingw_ovr 493 /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) 494 int fwscanf(FILE *__stream, const wchar_t *__format, ...) 495 { 496 register int __retval; 497 __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); 498 __retval = __mingw_vfwscanf( __stream, __format, __local_argv ); 499 __builtin_va_end( __local_argv ); 500 return __retval; 501 } 502 503 #ifndef __NO_ISOCEXT /* externs in libmingwex.a */ 504 __mingw_ovr 505 /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) 506 int vswscanf (const wchar_t *__source, const wchar_t *__format, __builtin_va_list __local_argv) 507 { 508 return __mingw_vswscanf( __source, __format, __local_argv ); 509 } 510 511 __mingw_ovr 512 /* __attribute__((__format__ (gnu_wscanf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1) 513 int vwscanf(const wchar_t *__format, __builtin_va_list __local_argv) 514 { 515 return __mingw_vwscanf( __format, __local_argv ); 516 } 517 518 __mingw_ovr 519 /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) 520 int vfwscanf (FILE *__stream, const wchar_t *__format, __builtin_va_list __local_argv) 521 { 522 return __mingw_vfwscanf( __stream, __format, __local_argv ); 523 } 524 #endif /* __NO_ISOCEXT */ 525 526 527 528 __mingw_ovr 529 /* __attribute__((__format__ (gnu_wprintf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) 530 int fwprintf (FILE *__stream, const wchar_t *__format, ...) 531 { 532 register int __retval; 533 __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); 534 __retval = __mingw_vfwprintf( __stream, __format, __local_argv ); 535 __builtin_va_end( __local_argv ); 536 return __retval; 537 } 538 539 __mingw_ovr 540 /* __attribute__((__format__ (gnu_wprintf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1) 541 int wprintf (const wchar_t *__format, ...) 542 { 543 register int __retval; 544 __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); 545 __retval = __mingw_vwprintf( __format, __local_argv ); 546 __builtin_va_end( __local_argv ); 547 return __retval; 548 } 549 550 __mingw_ovr 551 /* __attribute__((__format__ (gnu_wprintf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) 552 int vfwprintf (FILE *__stream, const wchar_t *__format, __builtin_va_list __local_argv) 553 { 554 return __mingw_vfwprintf( __stream, __format, __local_argv ); 555 } 556 557 __mingw_ovr 558 /* __attribute__((__format__ (gnu_wprintf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1) 559 int vwprintf (const wchar_t *__format, __builtin_va_list __local_argv) 560 { 561 return __mingw_vwprintf( __format, __local_argv ); 562 } 563 564 /*#ifndef __NO_ISOCEXT */ /* externs in libmingwex.a */ 565 __mingw_ovr 566 /* __attribute__((__format__ (gnu_wprintf, 3, 4))) */ __MINGW_ATTRIB_NONNULL(3) 567 int snwprintf (wchar_t *__stream, size_t __n, const wchar_t *__format, ...) 568 { 569 register int __retval; 570 __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); 571 __retval = __mingw_vsnwprintf( __stream, __n, __format, __local_argv ); 572 __builtin_va_end( __local_argv ); 573 return __retval; 574 } 575 576 __mingw_ovr 577 /* __attribute__((__format__ (gnu_wprintf, 3, 0))) */ __MINGW_ATTRIB_NONNULL(3) 578 int vsnwprintf (wchar_t *__stream, size_t __n, const wchar_t *__format, __builtin_va_list __local_argv) 579 { 580 return __mingw_vsnwprintf( __stream, __n, __format, __local_argv ); 581 } 582 /* #endif */ /* __NO_ISOCEXT */ 583 #else /* !__USE_MINGW_ANSI_STDIO */ 584 585 int __cdecl fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 586 int __cdecl swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 587 int __cdecl wscanf(const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 588 #ifndef __NO_ISOCEXT /* externs in libmingwex.a */ 589 int __cdecl __ms_vwscanf (const wchar_t * __restrict__ , va_list); 590 int __cdecl __ms_vfwscanf (FILE * __restrict__ ,const wchar_t * __restrict__ ,va_list); 591 int __cdecl __ms_vswscanf (const wchar_t * __restrict__ ,const wchar_t * __restrict__ ,va_list); 592 593 __mingw_ovr 594 __MINGW_ATTRIB_NONNULL(2) 595 int vfwscanf (FILE *__stream, const wchar_t *__format, __builtin_va_list __local_argv) 596 { 597 return __ms_vfwscanf (__stream, __format, __local_argv); 598 } 599 600 __mingw_ovr 601 __MINGW_ATTRIB_NONNULL(2) 602 int vswscanf (const wchar_t * __restrict__ __source, const wchar_t * __restrict__ __format, __builtin_va_list __local_argv) 603 { 604 return __ms_vswscanf( __source, __format, __local_argv ); 605 } 606 __mingw_ovr 607 __MINGW_ATTRIB_NONNULL(1) 608 int vwscanf(const wchar_t *__format, __builtin_va_list __local_argv) 609 { 610 return __ms_vwscanf (__format, __local_argv); 611 } 612 613 #endif /* __NO_ISOCEXT */ 614 615 int __cdecl fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); 616 int __cdecl wprintf(const wchar_t * __restrict__ _Format,...); 617 int __cdecl vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList); 618 int __cdecl vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList); 619 #endif /* __USE_MINGW_ANSI_STDIO */ 620 621 622 #ifndef WEOF 623 #define WEOF (wint_t)(0xFFFF) 624 #endif 625 626 #ifdef _POSIX_ 627 _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode); 628 #else 629 _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode,int _ShFlag); 630 #endif 631 632 wint_t __cdecl fgetwc(FILE *_File); 633 _CRTIMP wint_t __cdecl _fgetwchar(void); 634 wint_t __cdecl fputwc(wchar_t _Ch,FILE *_File); 635 _CRTIMP wint_t __cdecl _fputwchar(wchar_t _Ch); 636 wint_t __cdecl getwc(FILE *_File); 637 wint_t __cdecl getwchar(void); 638 wint_t __cdecl putwc(wchar_t _Ch,FILE *_File); 639 wint_t __cdecl putwchar(wchar_t _Ch); 640 wint_t __cdecl ungetwc(wint_t _Ch,FILE *_File); 641 wchar_t *__cdecl fgetws(wchar_t * __restrict__ _Dst,int _SizeInWords,FILE * __restrict__ _File); 642 int __cdecl fputws(const wchar_t * __restrict__ _Str,FILE * __restrict__ _File); 643 _CRTIMP wchar_t *__cdecl _getws(wchar_t *_String) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 644 _CRTIMP int __cdecl _putws(const wchar_t *_Str); 645 _CRTIMP int __cdecl _scwprintf(const wchar_t * __restrict__ _Format,...); 646 _CRTIMP int __cdecl _swprintf_l(wchar_t * __restrict__ ,size_t _SizeInWords,const wchar_t * __restrict__ _Format,_locale_t _Locale,... ) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 647 _CRTIMP int __cdecl _swprintf_c(wchar_t * __restrict__ _DstBuf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,...); 648 _CRTIMP int __cdecl _vswprintf_c(wchar_t * __restrict__ _DstBuf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,va_list _ArgList); 649 _CRTIMP int __cdecl _snwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 650 _CRTIMP int __cdecl _vsnwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,va_list _Args) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 651 652 #ifndef __NO_ISOCEXT /* externs in libmingwex.a */ 653 654 #if !defined (__USE_MINGW_ANSI_STDIO) || __USE_MINGW_ANSI_STDIO == 0 655 #pragma push_macro("snwprintf") 656 #pragma push_macro("vsnwprintf") 657 # undef snwprintf 658 # undef vsnwprintf 659 int __cdecl __ms_snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...); 660 int __cdecl __ms_vsnwprintf (wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list); 661 __mingw_ovr 662 int snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...) 663 { 664 int r; 665 va_list argp; 666 __builtin_va_start (argp, format); 667 r = _vsnwprintf (s, n, format, argp); 668 __builtin_va_end (argp); 669 return r; 670 } 671 __mingw_ovr 672 int __cdecl vsnwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, va_list arg) 673 { 674 return _vsnwprintf(s,n,format,arg); 675 } 676 #pragma pop_macro ("vsnwprintf") 677 #pragma pop_macro ("snwprintf") 678 #endif 679 680 #endif 681 682 _CRTIMP int __cdecl _fwprintf_p(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); 683 _CRTIMP int __cdecl _wprintf_p(const wchar_t * __restrict__ _Format,...); 684 _CRTIMP int __cdecl _vfwprintf_p(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList); 685 _CRTIMP int __cdecl _vwprintf_p(const wchar_t * __restrict__ _Format,va_list _ArgList); 686 _CRTIMP int __cdecl _swprintf_p(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,...); 687 _CRTIMP int __cdecl _vswprintf_p(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,va_list _ArgList); 688 _CRTIMP int __cdecl _scwprintf_p(const wchar_t * __restrict__ _Format,...); 689 _CRTIMP int __cdecl _vscwprintf_p(const wchar_t * __restrict__ _Format,va_list _ArgList); 690 _CRTIMP int __cdecl _wprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 691 _CRTIMP int __cdecl _wprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 692 _CRTIMP int __cdecl _vwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 693 _CRTIMP int __cdecl _vwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 694 _CRTIMP int __cdecl _fwprintf_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 695 _CRTIMP int __cdecl _fwprintf_p_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 696 _CRTIMP int __cdecl _vfwprintf_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 697 _CRTIMP int __cdecl _vfwprintf_p_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 698 _CRTIMP int __cdecl _swprintf_c_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 699 _CRTIMP int __cdecl _swprintf_p_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 700 _CRTIMP int __cdecl _vswprintf_c_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 701 _CRTIMP int __cdecl _vswprintf_p_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 702 _CRTIMP int __cdecl _scwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 703 _CRTIMP int __cdecl _scwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 704 _CRTIMP int __cdecl _vscwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 705 _CRTIMP int __cdecl _snwprintf_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 706 _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; 707 _CRTIMP int __cdecl _swprintf(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,...); 708 _CRTIMP int __cdecl _vswprintf(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,va_list _Args); 709 _CRTIMP int __cdecl __swprintf_l(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,_locale_t _Plocinfo,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 710 _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; 711 _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; 712 713 #ifndef RC_INVOKED 714 #include <swprintf.inl> 715 #endif 716 717 #ifdef _CRT_NON_CONFORMING_SWPRINTFS 718 #ifndef __cplusplus 719 #define _swprintf_l __swprintf_l 720 #define _vswprintf_l __vswprintf_l 721 #endif 722 #endif 723 724 _CRTIMP wchar_t *__cdecl _wtempnam(const wchar_t *_Directory,const wchar_t *_FilePrefix); 725 _CRTIMP int __cdecl _vscwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList); 726 _CRTIMP int __cdecl _vscwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 727 _CRTIMP int __cdecl _fwscanf_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 728 _CRTIMP int __cdecl _swscanf_l(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,_locale_t _Locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 729 _CRTIMP int __cdecl _snwscanf(const wchar_t * __restrict__ _Src,size_t _MaxCount,const wchar_t * __restrict__ _Format,...); 730 _CRTIMP int __cdecl _snwscanf_l(const wchar_t * __restrict__ _Src,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 731 _CRTIMP int __cdecl _wscanf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 732 _CRTIMP FILE *__cdecl _wfdopen(int _FileHandle ,const wchar_t *_Mode); 733 _CRTIMP FILE *__cdecl _wfopen(const wchar_t * __restrict__ _Filename,const wchar_t * __restrict__ _Mode) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 734 _CRTIMP FILE *__cdecl _wfreopen(const wchar_t * __restrict__ _Filename,const wchar_t * __restrict__ _Mode,FILE * __restrict__ _OldFile) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 735 736 #ifndef _CRT_WPERROR_DEFINED 737 #define _CRT_WPERROR_DEFINED 738 _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg); 739 #endif 740 _CRTIMP FILE *__cdecl _wpopen(const wchar_t *_Command,const wchar_t *_Mode); 741 #if !defined(NO_OLDNAMES) && !defined(wpopen) 742 #define wpopen _wpopen 743 #endif 744 _CRTIMP int __cdecl _wremove(const wchar_t *_Filename); 745 _CRTIMP wchar_t *__cdecl _wtmpnam(wchar_t *_Buffer); 746 _CRTIMP wint_t __cdecl _fgetwc_nolock(FILE *_File); 747 _CRTIMP wint_t __cdecl _fputwc_nolock(wchar_t _Ch,FILE *_File); 748 _CRTIMP wint_t __cdecl _ungetwc_nolock(wint_t _Ch,FILE *_File); 749 750 #undef _CRT_GETPUTWCHAR_NOINLINE 751 752 #if !defined(__cplusplus) || defined(_CRT_GETPUTWCHAR_NOINLINE) || defined (__CRT__NO_INLINE) 753 #define getwchar() fgetwc(stdin) 754 #define putwchar(_c) fputwc((_c),stdout) 755 #else 756 __CRT_INLINE wint_t __cdecl getwchar() {return (fgetwc(stdin)); } 757 __CRT_INLINE wint_t __cdecl putwchar(wchar_t _C) {return (fputwc(_C,stdout)); } 758 #endif 759 760 #define getwc(_stm) fgetwc(_stm) 761 #define putwc(_c,_stm) fputwc(_c,_stm) 762 #define _putwc_nolock(_c,_stm) _fputwc_nolock(_c,_stm) 763 #define _getwc_nolock(_c) _fgetwc_nolock(_c) 764 #endif 765 766 #ifndef _WSTDLIB_DEFINED 767 #define _WSTDLIB_DEFINED 768 769 _CRTIMP wchar_t *__cdecl _itow(int _Value,wchar_t *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 770 _CRTIMP wchar_t *__cdecl _ltow(long _Value,wchar_t *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 771 _CRTIMP wchar_t *__cdecl _ultow(unsigned long _Value,wchar_t *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 772 _CRTIMP double __cdecl _wcstod_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,_locale_t _Locale); 773 774 double __cdecl __mingw_wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr); 775 float __cdecl __mingw_wcstof(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr); 776 long double __cdecl __mingw_wcstold(const wchar_t * __restrict__, wchar_t ** __restrict__); 777 778 #if defined(__USE_MINGW_ANSI_STDIO) 779 __mingw_ovr 780 double __cdecl wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr){ 781 return __mingw_wcstod(_Str,_EndPtr); 782 } 783 __mingw_ovr 784 float __cdecl wcstof(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr){ 785 return __mingw_wcstof(_Str,_EndPtr); 786 } 787 /* wcstold is already a mingw implementation */ 788 #else 789 double __cdecl wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr); 790 float __cdecl wcstof(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr); 791 #endif /* defined(__USE_MINGW_STRTOX) */ 792 #if !defined __NO_ISOCEXT /* in libmingwex.a */ 793 long double __cdecl wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__); 794 #endif /* __NO_ISOCEXT */ 795 long __cdecl wcstol(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix); 796 _CRTIMP long __cdecl _wcstol_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix,_locale_t _Locale); 797 unsigned long __cdecl wcstoul(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix); 798 _CRTIMP unsigned long __cdecl _wcstoul_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix,_locale_t _Locale); 799 _CRTIMP wchar_t *__cdecl _wgetenv(const wchar_t *_VarName) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 800 #ifndef _CRT_WSYSTEM_DEFINED 801 #define _CRT_WSYSTEM_DEFINED 802 _CRTIMP int __cdecl _wsystem(const wchar_t *_Command); 803 #endif 804 _CRTIMP double __cdecl _wtof(const wchar_t *_Str); 805 _CRTIMP double __cdecl _wtof_l(const wchar_t *_Str,_locale_t _Locale); 806 _CRTIMP int __cdecl _wtoi(const wchar_t *_Str); 807 _CRTIMP int __cdecl _wtoi_l(const wchar_t *_Str,_locale_t _Locale); 808 _CRTIMP long __cdecl _wtol(const wchar_t *_Str); 809 _CRTIMP long __cdecl _wtol_l(const wchar_t *_Str,_locale_t _Locale); 810 811 __MINGW_EXTENSION _CRTIMP wchar_t *__cdecl _i64tow(__int64 _Val,wchar_t *_DstBuf,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 812 __MINGW_EXTENSION _CRTIMP wchar_t *__cdecl _ui64tow(unsigned __int64 _Val,wchar_t *_DstBuf,int _Radix); 813 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wtoi64(const wchar_t *_Str); 814 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wtoi64_l(const wchar_t *_Str,_locale_t _Locale); 815 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix); 816 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale); 817 __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix); 818 __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale); 819 #endif 820 821 #ifndef _POSIX_ 822 #ifndef _WSTDLIBP_DEFINED 823 #define _WSTDLIBP_DEFINED 824 _CRTIMP wchar_t *__cdecl _wfullpath(wchar_t *_FullPath,const wchar_t *_Path,size_t _SizeInWords); 825 _CRTIMP void __cdecl _wmakepath(wchar_t *_ResultPath,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext); 826 #ifndef _CRT_WPERROR_DEFINED 827 #define _CRT_WPERROR_DEFINED 828 _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg); 829 #endif 830 _CRTIMP int __cdecl _wputenv(const wchar_t *_EnvString); 831 _CRTIMP void __cdecl _wsearchenv(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 832 _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; 833 #endif 834 #endif 835 836 #ifndef _WSTRING_DEFINED 837 #define _WSTRING_DEFINED 838 _CRTIMP wchar_t *__cdecl _wcsdup(const wchar_t *_Str); 839 wchar_t *__cdecl wcscat(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 840 _CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch); 841 int __cdecl wcscmp(const wchar_t *_Str1,const wchar_t *_Str2); 842 wchar_t *__cdecl wcscpy(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 843 size_t __cdecl wcscspn(const wchar_t *_Str,const wchar_t *_Control); 844 size_t __cdecl wcslen(const wchar_t *_Str); 845 size_t __cdecl wcsnlen(const wchar_t *_Src,size_t _MaxCount); 846 wchar_t *__cdecl wcsncat(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source,size_t _Count) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 847 int __cdecl wcsncmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); 848 wchar_t *__cdecl wcsncpy(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source,size_t _Count) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 849 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; 850 _CONST_RETURN wchar_t *__cdecl wcspbrk(const wchar_t *_Str,const wchar_t *_Control); 851 _CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch); 852 size_t __cdecl wcsspn(const wchar_t *_Str,const wchar_t *_Control); 853 _CONST_RETURN wchar_t *__cdecl wcsstr(const wchar_t *_Str,const wchar_t *_SubStr); 854 wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 855 _CRTIMP wchar_t *__cdecl _wcserror(int _ErrNum) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 856 _CRTIMP wchar_t *__cdecl __wcserror(const wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 857 _CRTIMP int __cdecl _wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2); 858 _CRTIMP int __cdecl _wcsicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); 859 _CRTIMP int __cdecl _wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); 860 _CRTIMP int __cdecl _wcsnicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); 861 _CRTIMP wchar_t *__cdecl _wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 862 _CRTIMP wchar_t *__cdecl _wcsrev(wchar_t *_Str); 863 _CRTIMP wchar_t *__cdecl _wcsset(wchar_t *_Str,wchar_t _Val) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 864 _CRTIMP wchar_t *__cdecl _wcslwr(wchar_t *_String) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 865 _CRTIMP wchar_t *_wcslwr_l(wchar_t *_String,_locale_t _Locale) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 866 _CRTIMP wchar_t *__cdecl _wcsupr(wchar_t *_String) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 867 _CRTIMP wchar_t *_wcsupr_l(wchar_t *_String,_locale_t _Locale) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 868 size_t __cdecl wcsxfrm(wchar_t * __restrict__ _Dst,const wchar_t * __restrict__ _Src,size_t _MaxCount); 869 _CRTIMP size_t __cdecl _wcsxfrm_l(wchar_t * __restrict__ _Dst,const wchar_t * __restrict__ _Src,size_t _MaxCount,_locale_t _Locale); 870 int __cdecl wcscoll(const wchar_t *_Str1,const wchar_t *_Str2); 871 _CRTIMP int __cdecl _wcscoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); 872 _CRTIMP int __cdecl _wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2); 873 _CRTIMP int __cdecl _wcsicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); 874 _CRTIMP int __cdecl _wcsncoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); 875 _CRTIMP int __cdecl _wcsncoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); 876 _CRTIMP int __cdecl _wcsnicoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); 877 _CRTIMP int __cdecl _wcsnicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); 878 879 #ifndef NO_OLDNAMES 880 wchar_t *__cdecl wcsdup(const wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005; 881 #define wcswcs wcsstr 882 int __cdecl wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2) __MINGW_ATTRIB_DEPRECATED_MSVC2005; 883 int __cdecl wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_MSVC2005; 884 wchar_t *__cdecl wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_MSVC2005; 885 wchar_t *__cdecl wcsrev(wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005; 886 wchar_t *__cdecl wcsset(wchar_t *_Str,wchar_t _Val) __MINGW_ATTRIB_DEPRECATED_MSVC2005; 887 wchar_t *__cdecl wcslwr(wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005; 888 wchar_t *__cdecl wcsupr(wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005; 889 int __cdecl wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2) __MINGW_ATTRIB_DEPRECATED_MSVC2005; 890 #endif 891 #endif 892 893 #ifndef _TM_DEFINED 894 #define _TM_DEFINED 895 struct tm { 896 int tm_sec; 897 int tm_min; 898 int tm_hour; 899 int tm_mday; 900 int tm_mon; 901 int tm_year; 902 int tm_wday; 903 int tm_yday; 904 int tm_isdst; 905 }; 906 #endif 907 908 #ifndef _WTIME_DEFINED 909 #define _WTIME_DEFINED 910 911 _CRTIMP wchar_t *__cdecl _wasctime(const struct tm *_Tm); 912 wchar_t *__cdecl _wctime32(const __time32_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 913 size_t __cdecl wcsftime(wchar_t * __restrict__ _Buf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,const struct tm * __restrict__ _Tm); 914 _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); 915 _CRTIMP wchar_t *__cdecl _wstrdate(wchar_t *_Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 916 _CRTIMP wchar_t *__cdecl _wstrtime(wchar_t *_Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 917 _CRTIMP wchar_t *__cdecl _wctime64(const __time64_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 918 919 #if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL) 920 #define _INC_WTIME_INL 921 wchar_t *__cdecl _wctime(const time_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 922 #ifndef __CRT__NO_INLINE 923 #ifndef _USE_32BIT_TIME_T 924 __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_Time); } 925 #else 926 __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime32(_Time); } 927 #endif 928 #endif /* __CRT__NO_INLINE */ 929 #endif 930 #endif 931 932 typedef int mbstate_t; 933 typedef wchar_t _Wint_t; 934 935 wint_t __cdecl btowc(int); 936 size_t __cdecl mbrlen(const char * __restrict__ _Ch,size_t _SizeInBytes,mbstate_t * __restrict__ _State); 937 size_t __cdecl mbrtowc(wchar_t * __restrict__ _DstCh,const char * __restrict__ _SrcCh,size_t _SizeInBytes,mbstate_t * __restrict__ _State); 938 size_t __cdecl mbsrtowcs(wchar_t * __restrict__ _Dest,const char ** __restrict__ _PSrc,size_t _Count,mbstate_t * __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 939 size_t __cdecl wcrtomb(char * __restrict__ _Dest,wchar_t _Source,mbstate_t * __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 940 size_t __cdecl wcsrtombs(char * __restrict__ _Dest,const wchar_t ** __restrict__ _PSource,size_t _Count,mbstate_t * __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 941 int __cdecl wctob(wint_t _WCh); 942 943 #ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */ 944 wchar_t *__cdecl wmemset(wchar_t *s, wchar_t c, size_t n); 945 _CONST_RETURN wchar_t *__cdecl wmemchr(const wchar_t *s, wchar_t c, size_t n); 946 int __cdecl wmemcmp(const wchar_t *s1, const wchar_t *s2,size_t n); 947 wchar_t *__cdecl wmemcpy(wchar_t * __restrict__ s1,const wchar_t * __restrict__ s2,size_t n) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 948 wchar_t * __cdecl wmempcpy (wchar_t *_Dst, const wchar_t *_Src, size_t _Size); 949 wchar_t *__cdecl wmemmove(wchar_t *s1, const wchar_t *s2, size_t n) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 950 int __cdecl fwide(FILE *stream,int mode); 951 int __cdecl mbsinit(const mbstate_t *ps); 952 __MINGW_EXTENSION long long __cdecl wcstoll(const wchar_t * __restrict__ nptr,wchar_t ** __restrict__ endptr, int base); 953 __MINGW_EXTENSION unsigned long long __cdecl wcstoull(const wchar_t * __restrict__ nptr,wchar_t ** __restrict__ endptr, int base); 954 #endif /* __NO_ISOCEXT */ 955 956 void *__cdecl memmove(void *_Dst,const void *_Src,size_t _MaxCount); 957 void *__cdecl memcpy(void * __restrict__ _Dst,const void * __restrict__ _Src,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 958 #ifndef __CRT__NO_INLINE 959 __CRT_INLINE int __cdecl fwide(FILE *_F,int _M) { (void)_F; return (_M); } 960 __CRT_INLINE int __cdecl mbsinit(const mbstate_t *_P) { return (!_P || *_P==0); } 961 __CRT_INLINE _CONST_RETURN wchar_t *__cdecl wmemchr(const wchar_t *_S,wchar_t _C,size_t _N) { 962 if (_S) { 963 for ( ; 0 < _N; ++_S, --_N) 964 if (*_S == _C) 965 return (_CONST_RETURN wchar_t *)(_S); 966 } 967 return (_CONST_RETURN wchar_t *) NULL; 968 } 969 __CRT_INLINE int __cdecl wmemcmp(const wchar_t *_S1,const wchar_t *_S2,size_t _N) { 970 if (_N == 0 || _S1 == _S2) 971 return 0; /* even for NULL pointers. */ 972 if ((_S1 && !(_S2)) || (_S2 && !(_S1))) 973 return !(_S2) ? 1 : -1; /* robust. */ 974 for ( ; 0 < _N; ++_S1, ++_S2, --_N) 975 if (*_S1 != *_S2) 976 return (*_S1 < *_S2 ? -1 : +1); 977 return 0; 978 } 979 __CRT_INLINE wchar_t *__cdecl wmemcpy(wchar_t * __restrict__ _S1,const wchar_t * __restrict__ _S2,size_t _N) 980 { 981 return (wchar_t *) memcpy (_S1,_S2,_N*sizeof(wchar_t)); 982 } 983 __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)); } 984 __CRT_INLINE wchar_t *__cdecl wmemset(wchar_t *_S,wchar_t _C,size_t _N) { 985 wchar_t *_Su = _S; 986 for (;0<_N;++_Su,--_N) { 987 *_Su = _C; 988 } 989 return (_S); 990 } 991 #endif /* !__CRT__NO_INLINE */ 992 993 #ifndef __MINGW_MBWC_CONVERT_DEFINED 994 #define __MINGW_MBWC_CONVERT_DEFINED 995 996 /** 997 * __mingw_str_wide_utf8 998 * Converts a null terminated UCS-2 string to a multibyte (UTF-8) equivalent. 999 * Caller is supposed to free allocated buffer with __mingw_str_free(). 1000 * @param[in] wptr Pointer to wide string. 1001 * @param[out] mbptr Pointer to multibyte string. 1002 * @param[out] buflen Optional parameter for length of allocated buffer. 1003 * @return bytes written by WideCharToMultiByte conversion, 0 for failure. 1004 * 1005 * WideCharToMultiByte - http://msdn.microsoft.com/en-us/library/dd374130(VS.85).aspx 1006 */ 1007 int __cdecl __mingw_str_wide_utf8 (const wchar_t * const wptr, char **mbptr, size_t * buflen); 1008 1009 /** 1010 * __mingw_str_utf8_wide 1011 * Converts a null terminated UTF-8 string to a UCS-2 equivalent. 1012 * Caller is supposed to free allocated buffer with __mingw_str_free(). 1013 * @param[out] mbptr Pointer to multibyte string. 1014 * @param[in] wptr Pointer to wide string. 1015 * @param[out] buflen Optional parameter for length of allocated buffer. 1016 * @return bytes written by WideCharToMultiByte conversion, 0 for failure. 1017 * 1018 * MultiByteToWideChar - http://msdn.microsoft.com/en-us/library/dd319072(VS.85).aspx 1019 */ 1020 1021 int __cdecl __mingw_str_utf8_wide (const char *const mbptr, wchar_t ** wptr, size_t * buflen); 1022 1023 /** 1024 * __mingw_str_free 1025 * Frees buffer create by __mingw_str_wide_utf8 and __mingw_str_utf8_wide. 1026 * @param[in] ptr memory block to free. 1027 * 1028 */ 1029 1030 void __cdecl __mingw_str_free(void *ptr); 1031 1032 #endif /* __MINGW_MBWC_CONVERT_DEFINED */ 1033 1034 #ifdef __cplusplus 1035 } 1036 #endif 1037 1038 #pragma pack(pop) 1039 1040 #include <sec_api/wchar_s.h> 1041 1042 #include <_mingw_print_pop.h> 1043 1044 #endif /* _INC_WCHAR */ 1045 1046