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) && ((__USE_MINGW_ANSI_STDIO + 0) != 0) && !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 _WEXEC_DEFINED 304 #define _WEXEC_DEFINED 305 _CRTIMP intptr_t __cdecl _wexecl(const wchar_t *_Filename,const wchar_t *_ArgList,...); 306 _CRTIMP intptr_t __cdecl _wexecle(const wchar_t *_Filename,const wchar_t *_ArgList,...); 307 _CRTIMP intptr_t __cdecl _wexeclp(const wchar_t *_Filename,const wchar_t *_ArgList,...); 308 _CRTIMP intptr_t __cdecl _wexeclpe(const wchar_t *_Filename,const wchar_t *_ArgList,...); 309 _CRTIMP intptr_t __cdecl _wexecv(const wchar_t *_Filename,const wchar_t *const *_ArgList); 310 _CRTIMP intptr_t __cdecl _wexecve(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); 311 _CRTIMP intptr_t __cdecl _wexecvp(const wchar_t *_Filename,const wchar_t *const *_ArgList); 312 _CRTIMP intptr_t __cdecl _wexecvpe(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); 313 #endif 314 315 #ifndef _WSPAWN_DEFINED 316 #define _WSPAWN_DEFINED 317 _CRTIMP intptr_t __cdecl _wspawnl(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); 318 _CRTIMP intptr_t __cdecl _wspawnle(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); 319 _CRTIMP intptr_t __cdecl _wspawnlp(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); 320 _CRTIMP intptr_t __cdecl _wspawnlpe(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); 321 _CRTIMP intptr_t __cdecl _wspawnv(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList); 322 _CRTIMP intptr_t __cdecl _wspawnve(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); 323 _CRTIMP intptr_t __cdecl _wspawnvp(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList); 324 _CRTIMP intptr_t __cdecl _wspawnvpe(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); 325 #endif 326 327 #ifndef _CRT_WSYSTEM_DEFINED 328 #define _CRT_WSYSTEM_DEFINED 329 _CRTIMP int __cdecl _wsystem(const wchar_t *_Command); 330 #endif 331 332 #ifndef _WCTYPE_INLINE_DEFINED 333 #undef _CRT_WCTYPE_NOINLINE 334 #if !defined(__cplusplus) || defined(_CRT_WCTYPE_NOINLINE) 335 #define iswalpha(_c) (iswctype(_c,_ALPHA)) 336 #define iswupper(_c) (iswctype(_c,_UPPER)) 337 #define iswlower(_c) (iswctype(_c,_LOWER)) 338 #define iswdigit(_c) (iswctype(_c,_DIGIT)) 339 #define iswxdigit(_c) (iswctype(_c,_HEX)) 340 #define iswspace(_c) (iswctype(_c,_SPACE)) 341 #define iswpunct(_c) (iswctype(_c,_PUNCT)) 342 #define iswalnum(_c) (iswctype(_c,_ALPHA|_DIGIT)) 343 #define iswprint(_c) (iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT)) 344 #define iswgraph(_c) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT)) 345 #define iswcntrl(_c) (iswctype(_c,_CONTROL)) 346 #define iswascii(_c) ((unsigned)(_c) < 0x80) 347 348 #define _iswalpha_l(_c,_p) (_iswctype_l(_c,_ALPHA,_p)) 349 #define _iswupper_l(_c,_p) (_iswctype_l(_c,_UPPER,_p)) 350 #define _iswlower_l(_c,_p) (_iswctype_l(_c,_LOWER,_p)) 351 #define _iswdigit_l(_c,_p) (_iswctype_l(_c,_DIGIT,_p)) 352 #define _iswxdigit_l(_c,_p) (_iswctype_l(_c,_HEX,_p)) 353 #define _iswspace_l(_c,_p) (_iswctype_l(_c,_SPACE,_p)) 354 #define _iswpunct_l(_c,_p) (_iswctype_l(_c,_PUNCT,_p)) 355 #define _iswalnum_l(_c,_p) (_iswctype_l(_c,_ALPHA|_DIGIT,_p)) 356 #define _iswprint_l(_c,_p) (_iswctype_l(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT,_p)) 357 #define _iswgraph_l(_c,_p) (_iswctype_l(_c,_PUNCT|_ALPHA|_DIGIT,_p)) 358 #define _iswcntrl_l(_c,_p) (_iswctype_l(_c,_CONTROL,_p)) 359 #ifndef _CTYPE_DISABLE_MACROS 360 #define isleadbyte(_c) (__PCTYPE_FUNC[(unsigned char)(_c)] & _LEADBYTE) 361 #endif 362 #endif 363 #define _WCTYPE_INLINE_DEFINED 364 #endif 365 366 #if !defined(_POSIX_) || defined(__GNUC__) 367 #ifndef _INO_T_DEFINED 368 #define _INO_T_DEFINED 369 typedef unsigned short _ino_t; 370 #ifndef NO_OLDNAMES 371 typedef unsigned short ino_t; 372 #endif 373 #endif 374 375 #ifndef _DEV_T_DEFINED 376 #define _DEV_T_DEFINED 377 typedef unsigned int _dev_t; 378 #ifndef NO_OLDNAMES 379 typedef unsigned int dev_t; 380 #endif 381 #endif 382 383 #include <_mingw_off_t.h> 384 #include <_mingw_stat64.h> 385 386 #ifndef _WSTAT_DEFINED 387 #define _WSTAT_DEFINED 388 389 _CRTIMP int __cdecl _wstat32(const wchar_t *_Name,struct _stat32 *_Stat); 390 _CRTIMP int __cdecl _wstat32i64(const wchar_t *_Name,struct _stat32i64 *_Stat); 391 int __cdecl _wstat64i32(const wchar_t *_Name,struct _stat64i32 *_Stat); 392 _CRTIMP int __cdecl _wstat64(const wchar_t *_Name,struct _stat64 *_Stat); 393 #endif 394 #endif 395 396 #ifndef _WCONIO_DEFINED 397 #define _WCONIO_DEFINED 398 399 #ifndef WEOF 400 #define WEOF (wint_t)(0xFFFF) 401 #endif 402 403 _CRTIMP wchar_t *_cgetws(wchar_t *_Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 404 _CRTIMP wint_t __cdecl _getwch(void); 405 _CRTIMP wint_t __cdecl _getwche(void); 406 _CRTIMP wint_t __cdecl _putwch(wchar_t _WCh); 407 _CRTIMP wint_t __cdecl _ungetwch(wint_t _WCh); 408 _CRTIMP int __cdecl _cputws(const wchar_t *_String); 409 _CRTIMP int __cdecl _cwprintf(const wchar_t * __restrict__ _Format,...); 410 _CRTIMP int __cdecl _cwscanf(const wchar_t * __restrict__ _Format,...); 411 _CRTIMP int __cdecl _cwscanf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 412 _CRTIMP int __cdecl _vcwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList); 413 _CRTIMP int __cdecl _cwprintf_p(const wchar_t * __restrict__ _Format,...); 414 _CRTIMP int __cdecl _vcwprintf_p(const wchar_t * __restrict__ _Format,va_list _ArgList); 415 416 _CRTIMP int __cdecl _cwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 417 _CRTIMP int __cdecl _vcwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 418 _CRTIMP int __cdecl _cwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 419 _CRTIMP int __cdecl _vcwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 420 wint_t __cdecl _putwch_nolock(wchar_t _WCh); 421 wint_t __cdecl _getwch_nolock(void); 422 wint_t __cdecl _getwche_nolock(void); 423 wint_t __cdecl _ungetwch_nolock(wint_t _WCh); 424 #endif 425 426 #ifndef _WSTDIO_DEFINED 427 #define _WSTDIO_DEFINED 428 429 /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) 430 int __cdecl __mingw_swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...); 431 /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) 432 int __cdecl __mingw_vswscanf (const wchar_t * __restrict__ _Str,const wchar_t * __restrict__ Format,va_list argp); 433 /* __attribute__((__format__ (gnu_wscanf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1) 434 int __cdecl __mingw_wscanf(const wchar_t * __restrict__ _Format,...); 435 /* __attribute__((__format__ (gnu_wscanf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1) 436 int __cdecl __mingw_vwscanf(const wchar_t * __restrict__ Format, va_list argp); 437 /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) 438 int __cdecl __mingw_fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); 439 /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) 440 int __cdecl __mingw_vfwscanf (FILE * __restrict__ fp, const wchar_t * __restrict__ Format,va_list argp); 441 442 443 /* __attribute__((__format__ (gnu_wprintf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) 444 int __cdecl __mingw_fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); 445 /* __attribute__((__format__ (gnu_wprintf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1) 446 int __cdecl __mingw_wprintf(const wchar_t * __restrict__ _Format,...); 447 /* __attribute__((__format__ (gnu_wprintf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) 448 int __cdecl __mingw_vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList); 449 /* __attribute__((__format__ (gnu_printf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1) 450 int __cdecl __mingw_vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList); 451 /* __attribute__((__format__ (gnu_wprintf, 3, 4))) */ __MINGW_ATTRIB_NONNULL(3) 452 int __cdecl __mingw_snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...); 453 /* __attribute__((__format__ (gnu_wprintf, 3, 0))) */ __MINGW_ATTRIB_NONNULL(3) 454 int __cdecl __mingw_vsnwprintf (wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list); 455 /* __attribute__((__format__ (gnu_wprintf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) 456 int __cdecl __mingw_swprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , ...); 457 /* __attribute__((__format__ (gnu_wprintf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) 458 int __cdecl __mingw_vswprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ ,va_list); 459 460 #undef __mingw_ovr 461 #if defined (__GNUC__) 462 #define __mingw_ovr static __attribute__ ((__unused__)) __inline__ __cdecl 463 #elif defined(__cplusplus) 464 #define __mingw_ovr inline __cdecl 465 #else 466 #define __mingw_ovr static __cdecl 467 #endif 468 469 #if __USE_MINGW_ANSI_STDIO 470 471 /* 472 * User has expressed a preference for C99 conformance... 473 */ 474 __mingw_ovr 475 /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) 476 int swscanf(const wchar_t *__source, const wchar_t *__format, ...) 477 { 478 register int __retval; 479 __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); 480 __retval = __mingw_vswscanf( __source, __format, __local_argv ); 481 __builtin_va_end( __local_argv ); 482 return __retval; 483 } 484 485 __mingw_ovr 486 /* __attribute__((__format__ (gnu_wscanf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1) 487 int wscanf(const wchar_t *__format, ...) 488 { 489 register int __retval; 490 __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); 491 __retval = __mingw_vwscanf( __format, __local_argv ); 492 __builtin_va_end( __local_argv ); 493 return __retval; 494 } 495 496 __mingw_ovr 497 /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) 498 int fwscanf(FILE *__stream, const wchar_t *__format, ...) 499 { 500 register int __retval; 501 __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); 502 __retval = __mingw_vfwscanf( __stream, __format, __local_argv ); 503 __builtin_va_end( __local_argv ); 504 return __retval; 505 } 506 507 #ifndef __NO_ISOCEXT /* externs in libmingwex.a */ 508 __mingw_ovr 509 /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) 510 int vswscanf (const wchar_t *__source, const wchar_t *__format, __builtin_va_list __local_argv) 511 { 512 return __mingw_vswscanf( __source, __format, __local_argv ); 513 } 514 515 __mingw_ovr 516 /* __attribute__((__format__ (gnu_wscanf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1) 517 int vwscanf(const wchar_t *__format, __builtin_va_list __local_argv) 518 { 519 return __mingw_vwscanf( __format, __local_argv ); 520 } 521 522 __mingw_ovr 523 /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) 524 int vfwscanf (FILE *__stream, const wchar_t *__format, __builtin_va_list __local_argv) 525 { 526 return __mingw_vfwscanf( __stream, __format, __local_argv ); 527 } 528 #endif /* __NO_ISOCEXT */ 529 530 531 532 __mingw_ovr 533 /* __attribute__((__format__ (gnu_wprintf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2) 534 int fwprintf (FILE *__stream, const wchar_t *__format, ...) 535 { 536 register int __retval; 537 __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); 538 __retval = __mingw_vfwprintf( __stream, __format, __local_argv ); 539 __builtin_va_end( __local_argv ); 540 return __retval; 541 } 542 543 __mingw_ovr 544 /* __attribute__((__format__ (gnu_wprintf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1) 545 int wprintf (const wchar_t *__format, ...) 546 { 547 register int __retval; 548 __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); 549 __retval = __mingw_vwprintf( __format, __local_argv ); 550 __builtin_va_end( __local_argv ); 551 return __retval; 552 } 553 554 __mingw_ovr 555 /* __attribute__((__format__ (gnu_wprintf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2) 556 int vfwprintf (FILE *__stream, const wchar_t *__format, __builtin_va_list __local_argv) 557 { 558 return __mingw_vfwprintf( __stream, __format, __local_argv ); 559 } 560 561 __mingw_ovr 562 /* __attribute__((__format__ (gnu_wprintf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1) 563 int vwprintf (const wchar_t *__format, __builtin_va_list __local_argv) 564 { 565 return __mingw_vwprintf( __format, __local_argv ); 566 } 567 568 /*#ifndef __NO_ISOCEXT */ /* externs in libmingwex.a */ 569 __mingw_ovr 570 /* __attribute__((__format__ (gnu_wprintf, 3, 4))) */ __MINGW_ATTRIB_NONNULL(3) 571 int snwprintf (wchar_t *__stream, size_t __n, const wchar_t *__format, ...) 572 { 573 register int __retval; 574 __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); 575 __retval = __mingw_vsnwprintf( __stream, __n, __format, __local_argv ); 576 __builtin_va_end( __local_argv ); 577 return __retval; 578 } 579 580 __mingw_ovr 581 /* __attribute__((__format__ (gnu_wprintf, 3, 0))) */ __MINGW_ATTRIB_NONNULL(3) 582 int vsnwprintf (wchar_t *__stream, size_t __n, const wchar_t *__format, __builtin_va_list __local_argv) 583 { 584 return __mingw_vsnwprintf( __stream, __n, __format, __local_argv ); 585 } 586 /* #endif */ /* __NO_ISOCEXT */ 587 #else /* !__USE_MINGW_ANSI_STDIO */ 588 589 int __cdecl fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 590 int __cdecl swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 591 int __cdecl wscanf(const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 592 #ifndef __NO_ISOCEXT /* externs in libmingwex.a */ 593 int __cdecl __ms_vwscanf (const wchar_t * __restrict__ , va_list); 594 int __cdecl __ms_vfwscanf (FILE * __restrict__ ,const wchar_t * __restrict__ ,va_list); 595 int __cdecl __ms_vswscanf (const wchar_t * __restrict__ ,const wchar_t * __restrict__ ,va_list); 596 597 __mingw_ovr 598 __MINGW_ATTRIB_NONNULL(2) 599 int vfwscanf (FILE *__stream, const wchar_t *__format, __builtin_va_list __local_argv) 600 { 601 return __ms_vfwscanf (__stream, __format, __local_argv); 602 } 603 604 __mingw_ovr 605 __MINGW_ATTRIB_NONNULL(2) 606 int vswscanf (const wchar_t * __restrict__ __source, const wchar_t * __restrict__ __format, __builtin_va_list __local_argv) 607 { 608 return __ms_vswscanf( __source, __format, __local_argv ); 609 } 610 __mingw_ovr 611 __MINGW_ATTRIB_NONNULL(1) 612 int vwscanf(const wchar_t *__format, __builtin_va_list __local_argv) 613 { 614 return __ms_vwscanf (__format, __local_argv); 615 } 616 617 #endif /* __NO_ISOCEXT */ 618 619 int __cdecl fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); 620 int __cdecl wprintf(const wchar_t * __restrict__ _Format,...); 621 int __cdecl vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList); 622 int __cdecl vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList); 623 #endif /* __USE_MINGW_ANSI_STDIO */ 624 625 626 #ifndef WEOF 627 #define WEOF (wint_t)(0xFFFF) 628 #endif 629 630 #ifdef _POSIX_ 631 _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode); 632 #else 633 _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode,int _ShFlag); 634 #endif 635 636 wint_t __cdecl fgetwc(FILE *_File); 637 _CRTIMP wint_t __cdecl _fgetwchar(void); 638 wint_t __cdecl fputwc(wchar_t _Ch,FILE *_File); 639 _CRTIMP wint_t __cdecl _fputwchar(wchar_t _Ch); 640 wint_t __cdecl getwc(FILE *_File); 641 wint_t __cdecl getwchar(void); 642 wint_t __cdecl putwc(wchar_t _Ch,FILE *_File); 643 wint_t __cdecl putwchar(wchar_t _Ch); 644 wint_t __cdecl ungetwc(wint_t _Ch,FILE *_File); 645 wchar_t *__cdecl fgetws(wchar_t * __restrict__ _Dst,int _SizeInWords,FILE * __restrict__ _File); 646 int __cdecl fputws(const wchar_t * __restrict__ _Str,FILE * __restrict__ _File); 647 _CRTIMP wchar_t *__cdecl _getws(wchar_t *_String) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 648 _CRTIMP int __cdecl _putws(const wchar_t *_Str); 649 _CRTIMP int __cdecl _scwprintf(const wchar_t * __restrict__ _Format,...); 650 _CRTIMP int __cdecl _swprintf_l(wchar_t * __restrict__ ,size_t _SizeInWords,const wchar_t * __restrict__ _Format,_locale_t _Locale,... ) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 651 _CRTIMP int __cdecl _swprintf_c(wchar_t * __restrict__ _DstBuf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,...); 652 _CRTIMP int __cdecl _vswprintf_c(wchar_t * __restrict__ _DstBuf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,va_list _ArgList); 653 _CRTIMP int __cdecl _snwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 654 _CRTIMP int __cdecl _vsnwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,va_list _Args) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 655 656 #ifndef __NO_ISOCEXT /* externs in libmingwex.a */ 657 658 #if !defined (__USE_MINGW_ANSI_STDIO) || __USE_MINGW_ANSI_STDIO == 0 659 #pragma push_macro("snwprintf") 660 #pragma push_macro("vsnwprintf") 661 # undef snwprintf 662 # undef vsnwprintf 663 int __cdecl __ms_snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...); 664 int __cdecl __ms_vsnwprintf (wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list); 665 __mingw_ovr 666 int snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...) 667 { 668 int r; 669 va_list argp; 670 __builtin_va_start (argp, format); 671 r = _vsnwprintf (s, n, format, argp); 672 __builtin_va_end (argp); 673 return r; 674 } 675 __mingw_ovr 676 int __cdecl vsnwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, va_list arg) 677 { 678 return _vsnwprintf(s,n,format,arg); 679 } 680 #pragma pop_macro ("vsnwprintf") 681 #pragma pop_macro ("snwprintf") 682 #endif 683 684 #endif 685 686 _CRTIMP int __cdecl _fwprintf_p(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); 687 _CRTIMP int __cdecl _wprintf_p(const wchar_t * __restrict__ _Format,...); 688 _CRTIMP int __cdecl _vfwprintf_p(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList); 689 _CRTIMP int __cdecl _vwprintf_p(const wchar_t * __restrict__ _Format,va_list _ArgList); 690 _CRTIMP int __cdecl _swprintf_p(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,...); 691 _CRTIMP int __cdecl _vswprintf_p(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,va_list _ArgList); 692 _CRTIMP int __cdecl _scwprintf_p(const wchar_t * __restrict__ _Format,...); 693 _CRTIMP int __cdecl _vscwprintf_p(const wchar_t * __restrict__ _Format,va_list _ArgList); 694 _CRTIMP int __cdecl _wprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 695 _CRTIMP int __cdecl _wprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 696 _CRTIMP int __cdecl _vwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 697 _CRTIMP int __cdecl _vwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 698 _CRTIMP int __cdecl _fwprintf_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 699 _CRTIMP int __cdecl _fwprintf_p_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 700 _CRTIMP int __cdecl _vfwprintf_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 701 _CRTIMP int __cdecl _vfwprintf_p_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 702 _CRTIMP int __cdecl _swprintf_c_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 703 _CRTIMP int __cdecl _swprintf_p_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 704 _CRTIMP int __cdecl _vswprintf_c_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 705 _CRTIMP int __cdecl _vswprintf_p_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 706 _CRTIMP int __cdecl _scwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 707 _CRTIMP int __cdecl _scwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 708 _CRTIMP int __cdecl _vscwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 709 _CRTIMP int __cdecl _snwprintf_l(wchar_t * __restrict__ _DstBuf,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 710 _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; 711 _CRTIMP int __cdecl _swprintf(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,...); 712 _CRTIMP int __cdecl _vswprintf(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,va_list _Args); 713 _CRTIMP int __cdecl __swprintf_l(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,_locale_t _Plocinfo,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 714 _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; 715 _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; 716 717 #ifndef RC_INVOKED 718 #include <swprintf.inl> 719 #endif 720 721 #ifdef _CRT_NON_CONFORMING_SWPRINTFS 722 #ifndef __cplusplus 723 #define _swprintf_l __swprintf_l 724 #define _vswprintf_l __vswprintf_l 725 #endif 726 #endif 727 728 _CRTIMP wchar_t *__cdecl _wtempnam(const wchar_t *_Directory,const wchar_t *_FilePrefix); 729 _CRTIMP int __cdecl _vscwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList); 730 _CRTIMP int __cdecl _vscwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList); 731 _CRTIMP int __cdecl _fwscanf_l(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,_locale_t _Locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 732 _CRTIMP int __cdecl _swscanf_l(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,_locale_t _Locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 733 _CRTIMP int __cdecl _snwscanf(const wchar_t * __restrict__ _Src,size_t _MaxCount,const wchar_t * __restrict__ _Format,...); 734 _CRTIMP int __cdecl _snwscanf_l(const wchar_t * __restrict__ _Src,size_t _MaxCount,const wchar_t * __restrict__ _Format,_locale_t _Locale,...); 735 _CRTIMP int __cdecl _wscanf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 736 _CRTIMP FILE *__cdecl _wfdopen(int _FileHandle ,const wchar_t *_Mode); 737 _CRTIMP FILE *__cdecl _wfopen(const wchar_t * __restrict__ _Filename,const wchar_t * __restrict__ _Mode) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 738 _CRTIMP FILE *__cdecl _wfreopen(const wchar_t * __restrict__ _Filename,const wchar_t * __restrict__ _Mode,FILE * __restrict__ _OldFile) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 739 740 #ifndef _CRT_WPERROR_DEFINED 741 #define _CRT_WPERROR_DEFINED 742 _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg); 743 #endif 744 _CRTIMP FILE *__cdecl _wpopen(const wchar_t *_Command,const wchar_t *_Mode); 745 #if !defined(NO_OLDNAMES) && !defined(wpopen) 746 #define wpopen _wpopen 747 #endif 748 _CRTIMP int __cdecl _wremove(const wchar_t *_Filename); 749 _CRTIMP wchar_t *__cdecl _wtmpnam(wchar_t *_Buffer); 750 _CRTIMP wint_t __cdecl _fgetwc_nolock(FILE *_File); 751 _CRTIMP wint_t __cdecl _fputwc_nolock(wchar_t _Ch,FILE *_File); 752 _CRTIMP wint_t __cdecl _ungetwc_nolock(wint_t _Ch,FILE *_File); 753 754 #undef _CRT_GETPUTWCHAR_NOINLINE 755 756 #if !defined(__cplusplus) || defined(_CRT_GETPUTWCHAR_NOINLINE) || defined (__CRT__NO_INLINE) 757 #define getwchar() fgetwc(stdin) 758 #define putwchar(_c) fputwc((_c),stdout) 759 #else 760 __CRT_INLINE wint_t __cdecl getwchar() {return (fgetwc(stdin)); } 761 __CRT_INLINE wint_t __cdecl putwchar(wchar_t _C) {return (fputwc(_C,stdout)); } 762 #endif 763 764 #define getwc(_stm) fgetwc(_stm) 765 #define putwc(_c,_stm) fputwc(_c,_stm) 766 #define _putwc_nolock(_c,_stm) _fputwc_nolock(_c,_stm) 767 #define _getwc_nolock(_c) _fgetwc_nolock(_c) 768 #endif 769 770 #ifndef _WSTDLIB_DEFINED 771 #define _WSTDLIB_DEFINED 772 773 _CRTIMP wchar_t *__cdecl _itow(int _Value,wchar_t *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 774 _CRTIMP wchar_t *__cdecl _ltow(long _Value,wchar_t *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 775 _CRTIMP wchar_t *__cdecl _ultow(unsigned long _Value,wchar_t *_Dest,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 776 _CRTIMP double __cdecl _wcstod_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,_locale_t _Locale); 777 778 double __cdecl __mingw_wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr); 779 float __cdecl __mingw_wcstof(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr); 780 long double __cdecl __mingw_wcstold(const wchar_t * __restrict__, wchar_t ** __restrict__); 781 782 #if __USE_MINGW_ANSI_STDIO 783 __mingw_ovr 784 double __cdecl wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr){ 785 return __mingw_wcstod(_Str,_EndPtr); 786 } 787 __mingw_ovr 788 float __cdecl wcstof(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr){ 789 return __mingw_wcstof(_Str,_EndPtr); 790 } 791 /* wcstold is already a mingw implementation */ 792 #else 793 double __cdecl wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr); 794 float __cdecl wcstof(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr); 795 #endif /* defined(__USE_MINGW_STRTOX) */ 796 #if !defined __NO_ISOCEXT /* in libmingwex.a */ 797 long double __cdecl wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__); 798 #endif /* __NO_ISOCEXT */ 799 long __cdecl wcstol(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix); 800 _CRTIMP long __cdecl _wcstol_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix,_locale_t _Locale); 801 unsigned long __cdecl wcstoul(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix); 802 _CRTIMP unsigned long __cdecl _wcstoul_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix,_locale_t _Locale); 803 _CRTIMP wchar_t *__cdecl _wgetenv(const wchar_t *_VarName) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 804 #ifndef _CRT_WSYSTEM_DEFINED 805 #define _CRT_WSYSTEM_DEFINED 806 _CRTIMP int __cdecl _wsystem(const wchar_t *_Command); 807 #endif 808 _CRTIMP double __cdecl _wtof(const wchar_t *_Str); 809 _CRTIMP double __cdecl _wtof_l(const wchar_t *_Str,_locale_t _Locale); 810 _CRTIMP int __cdecl _wtoi(const wchar_t *_Str); 811 _CRTIMP int __cdecl _wtoi_l(const wchar_t *_Str,_locale_t _Locale); 812 _CRTIMP long __cdecl _wtol(const wchar_t *_Str); 813 _CRTIMP long __cdecl _wtol_l(const wchar_t *_Str,_locale_t _Locale); 814 815 __MINGW_EXTENSION _CRTIMP wchar_t *__cdecl _i64tow(__int64 _Val,wchar_t *_DstBuf,int _Radix) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 816 __MINGW_EXTENSION _CRTIMP wchar_t *__cdecl _ui64tow(unsigned __int64 _Val,wchar_t *_DstBuf,int _Radix); 817 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wtoi64(const wchar_t *_Str); 818 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wtoi64_l(const wchar_t *_Str,_locale_t _Locale); 819 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix); 820 __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale); 821 __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix); 822 __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale); 823 #endif 824 825 #ifndef _POSIX_ 826 #ifndef _WSTDLIBP_DEFINED 827 #define _WSTDLIBP_DEFINED 828 _CRTIMP wchar_t *__cdecl _wfullpath(wchar_t *_FullPath,const wchar_t *_Path,size_t _SizeInWords); 829 _CRTIMP void __cdecl _wmakepath(wchar_t *_ResultPath,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext); 830 #ifndef _CRT_WPERROR_DEFINED 831 #define _CRT_WPERROR_DEFINED 832 _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg); 833 #endif 834 _CRTIMP int __cdecl _wputenv(const wchar_t *_EnvString); 835 _CRTIMP void __cdecl _wsearchenv(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 836 _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; 837 #endif 838 #endif 839 840 #ifndef _WSTRING_DEFINED 841 #define _WSTRING_DEFINED 842 _CRTIMP wchar_t *__cdecl _wcsdup(const wchar_t *_Str); 843 wchar_t *__cdecl wcscat(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 844 _CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch); 845 int __cdecl wcscmp(const wchar_t *_Str1,const wchar_t *_Str2); 846 wchar_t *__cdecl wcscpy(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 847 size_t __cdecl wcscspn(const wchar_t *_Str,const wchar_t *_Control); 848 size_t __cdecl wcslen(const wchar_t *_Str); 849 size_t __cdecl wcsnlen(const wchar_t *_Src,size_t _MaxCount); 850 wchar_t *__cdecl wcsncat(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source,size_t _Count) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 851 int __cdecl wcsncmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); 852 wchar_t *__cdecl wcsncpy(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source,size_t _Count) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 853 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; 854 _CONST_RETURN wchar_t *__cdecl wcspbrk(const wchar_t *_Str,const wchar_t *_Control); 855 _CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch); 856 size_t __cdecl wcsspn(const wchar_t *_Str,const wchar_t *_Control); 857 _CONST_RETURN wchar_t *__cdecl wcsstr(const wchar_t *_Str,const wchar_t *_SubStr); 858 wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 859 _CRTIMP wchar_t *__cdecl _wcserror(int _ErrNum) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 860 _CRTIMP wchar_t *__cdecl __wcserror(const wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 861 _CRTIMP int __cdecl _wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2); 862 _CRTIMP int __cdecl _wcsicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); 863 _CRTIMP int __cdecl _wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); 864 _CRTIMP int __cdecl _wcsnicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); 865 _CRTIMP wchar_t *__cdecl _wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 866 _CRTIMP wchar_t *__cdecl _wcsrev(wchar_t *_Str); 867 _CRTIMP wchar_t *__cdecl _wcsset(wchar_t *_Str,wchar_t _Val) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 868 _CRTIMP wchar_t *__cdecl _wcslwr(wchar_t *_String) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 869 _CRTIMP wchar_t *_wcslwr_l(wchar_t *_String,_locale_t _Locale) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 870 _CRTIMP wchar_t *__cdecl _wcsupr(wchar_t *_String) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 871 _CRTIMP wchar_t *_wcsupr_l(wchar_t *_String,_locale_t _Locale) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 872 size_t __cdecl wcsxfrm(wchar_t * __restrict__ _Dst,const wchar_t * __restrict__ _Src,size_t _MaxCount); 873 _CRTIMP size_t __cdecl _wcsxfrm_l(wchar_t * __restrict__ _Dst,const wchar_t * __restrict__ _Src,size_t _MaxCount,_locale_t _Locale); 874 int __cdecl wcscoll(const wchar_t *_Str1,const wchar_t *_Str2); 875 _CRTIMP int __cdecl _wcscoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); 876 _CRTIMP int __cdecl _wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2); 877 _CRTIMP int __cdecl _wcsicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); 878 _CRTIMP int __cdecl _wcsncoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); 879 _CRTIMP int __cdecl _wcsncoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); 880 _CRTIMP int __cdecl _wcsnicoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); 881 _CRTIMP int __cdecl _wcsnicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); 882 883 #ifndef NO_OLDNAMES 884 wchar_t *__cdecl wcsdup(const wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005; 885 #define wcswcs wcsstr 886 int __cdecl wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2) __MINGW_ATTRIB_DEPRECATED_MSVC2005; 887 int __cdecl wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_MSVC2005; 888 wchar_t *__cdecl wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_MSVC2005; 889 wchar_t *__cdecl wcsrev(wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005; 890 wchar_t *__cdecl wcsset(wchar_t *_Str,wchar_t _Val) __MINGW_ATTRIB_DEPRECATED_MSVC2005; 891 wchar_t *__cdecl wcslwr(wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005; 892 wchar_t *__cdecl wcsupr(wchar_t *_Str) __MINGW_ATTRIB_DEPRECATED_MSVC2005; 893 int __cdecl wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2) __MINGW_ATTRIB_DEPRECATED_MSVC2005; 894 #endif 895 #endif 896 897 #ifndef _TM_DEFINED 898 #define _TM_DEFINED 899 struct tm { 900 int tm_sec; 901 int tm_min; 902 int tm_hour; 903 int tm_mday; 904 int tm_mon; 905 int tm_year; 906 int tm_wday; 907 int tm_yday; 908 int tm_isdst; 909 }; 910 #endif 911 912 #ifndef _WTIME_DEFINED 913 #define _WTIME_DEFINED 914 915 _CRTIMP wchar_t *__cdecl _wasctime(const struct tm *_Tm); 916 wchar_t *__cdecl _wctime32(const __time32_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 917 size_t __cdecl wcsftime(wchar_t * __restrict__ _Buf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,const struct tm * __restrict__ _Tm); 918 _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); 919 _CRTIMP wchar_t *__cdecl _wstrdate(wchar_t *_Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 920 _CRTIMP wchar_t *__cdecl _wstrtime(wchar_t *_Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 921 _CRTIMP wchar_t *__cdecl _wctime64(const __time64_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 922 923 #if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL) 924 #define _INC_WTIME_INL 925 wchar_t *__cdecl _wctime(const time_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 926 #ifndef __CRT__NO_INLINE 927 #ifndef _USE_32BIT_TIME_T 928 __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_Time); } 929 #else 930 __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime32(_Time); } 931 #endif 932 #endif /* __CRT__NO_INLINE */ 933 #endif 934 #endif 935 936 typedef int mbstate_t; 937 typedef wchar_t _Wint_t; 938 939 wint_t __cdecl btowc(int); 940 size_t __cdecl mbrlen(const char * __restrict__ _Ch,size_t _SizeInBytes,mbstate_t * __restrict__ _State); 941 size_t __cdecl mbrtowc(wchar_t * __restrict__ _DstCh,const char * __restrict__ _SrcCh,size_t _SizeInBytes,mbstate_t * __restrict__ _State); 942 size_t __cdecl mbsrtowcs(wchar_t * __restrict__ _Dest,const char ** __restrict__ _PSrc,size_t _Count,mbstate_t * __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 943 size_t __cdecl wcrtomb(char * __restrict__ _Dest,wchar_t _Source,mbstate_t * __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 944 size_t __cdecl wcsrtombs(char * __restrict__ _Dest,const wchar_t ** __restrict__ _PSource,size_t _Count,mbstate_t * __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 945 int __cdecl wctob(wint_t _WCh); 946 947 #ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */ 948 wchar_t *__cdecl wmemset(wchar_t *s, wchar_t c, size_t n); 949 _CONST_RETURN wchar_t *__cdecl wmemchr(const wchar_t *s, wchar_t c, size_t n); 950 int __cdecl wmemcmp(const wchar_t *s1, const wchar_t *s2,size_t n); 951 wchar_t *__cdecl wmemcpy(wchar_t * __restrict__ s1,const wchar_t * __restrict__ s2,size_t n) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 952 wchar_t * __cdecl wmempcpy (wchar_t *_Dst, const wchar_t *_Src, size_t _Size); 953 wchar_t *__cdecl wmemmove(wchar_t *s1, const wchar_t *s2, size_t n) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 954 int __cdecl fwide(FILE *stream,int mode); 955 int __cdecl mbsinit(const mbstate_t *ps); 956 __MINGW_EXTENSION long long __cdecl wcstoll(const wchar_t * __restrict__ nptr,wchar_t ** __restrict__ endptr, int base); 957 __MINGW_EXTENSION unsigned long long __cdecl wcstoull(const wchar_t * __restrict__ nptr,wchar_t ** __restrict__ endptr, int base); 958 #endif /* __NO_ISOCEXT */ 959 960 void *__cdecl memmove(void *_Dst,const void *_Src,size_t _MaxCount); 961 void *__cdecl memcpy(void * __restrict__ _Dst,const void * __restrict__ _Src,size_t _MaxCount) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; 962 #ifndef __CRT__NO_INLINE 963 __CRT_INLINE int __cdecl fwide(FILE *_F,int _M) { (void)_F; return (_M); } 964 __CRT_INLINE int __cdecl mbsinit(const mbstate_t *_P) { return (!_P || *_P==0); } 965 __CRT_INLINE _CONST_RETURN wchar_t *__cdecl wmemchr(const wchar_t *_S,wchar_t _C,size_t _N) { 966 if (_S) { 967 for ( ; 0 < _N; ++_S, --_N) 968 if (*_S == _C) 969 return (_CONST_RETURN wchar_t *)(_S); 970 } 971 return (_CONST_RETURN wchar_t *) NULL; 972 } 973 __CRT_INLINE int __cdecl wmemcmp(const wchar_t *_S1,const wchar_t *_S2,size_t _N) { 974 if (_N == 0 || _S1 == _S2) 975 return 0; /* even for NULL pointers. */ 976 if ((_S1 && !(_S2)) || (_S2 && !(_S1))) 977 return !(_S2) ? 1 : -1; /* robust. */ 978 for ( ; 0 < _N; ++_S1, ++_S2, --_N) 979 if (*_S1 != *_S2) 980 return (*_S1 < *_S2 ? -1 : +1); 981 return 0; 982 } 983 __CRT_INLINE wchar_t *__cdecl wmemcpy(wchar_t * __restrict__ _S1,const wchar_t * __restrict__ _S2,size_t _N) 984 { 985 return (wchar_t *) memcpy (_S1,_S2,_N*sizeof(wchar_t)); 986 } 987 __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)); } 988 __CRT_INLINE wchar_t *__cdecl wmemset(wchar_t *_S,wchar_t _C,size_t _N) { 989 wchar_t *_Su = _S; 990 for (;0<_N;++_Su,--_N) { 991 *_Su = _C; 992 } 993 return (_S); 994 } 995 #endif /* !__CRT__NO_INLINE */ 996 997 #ifndef __MINGW_MBWC_CONVERT_DEFINED 998 #define __MINGW_MBWC_CONVERT_DEFINED 999 1000 /** 1001 * __mingw_str_wide_utf8 1002 * Converts a null terminated UCS-2 string to a multibyte (UTF-8) equivalent. 1003 * Caller is supposed to free allocated buffer with __mingw_str_free(). 1004 * @param[in] wptr Pointer to wide string. 1005 * @param[out] mbptr Pointer to multibyte string. 1006 * @param[out] buflen Optional parameter for length of allocated buffer. 1007 * @return bytes written by WideCharToMultiByte conversion, 0 for failure. 1008 * 1009 * WideCharToMultiByte - http://msdn.microsoft.com/en-us/library/dd374130(VS.85).aspx 1010 */ 1011 int __cdecl __mingw_str_wide_utf8 (const wchar_t * const wptr, char **mbptr, size_t * buflen); 1012 1013 /** 1014 * __mingw_str_utf8_wide 1015 * Converts a null terminated UTF-8 string to a UCS-2 equivalent. 1016 * Caller is supposed to free allocated buffer with __mingw_str_free(). 1017 * @param[out] mbptr Pointer to multibyte string. 1018 * @param[in] wptr Pointer to wide string. 1019 * @param[out] buflen Optional parameter for length of allocated buffer. 1020 * @return bytes written by WideCharToMultiByte conversion, 0 for failure. 1021 * 1022 * MultiByteToWideChar - http://msdn.microsoft.com/en-us/library/dd319072(VS.85).aspx 1023 */ 1024 1025 int __cdecl __mingw_str_utf8_wide (const char *const mbptr, wchar_t ** wptr, size_t * buflen); 1026 1027 /** 1028 * __mingw_str_free 1029 * Frees buffer create by __mingw_str_wide_utf8 and __mingw_str_utf8_wide. 1030 * @param[in] ptr memory block to free. 1031 * 1032 */ 1033 1034 void __cdecl __mingw_str_free(void *ptr); 1035 1036 #endif /* __MINGW_MBWC_CONVERT_DEFINED */ 1037 1038 #ifdef __cplusplus 1039 } 1040 #endif 1041 1042 #pragma pack(pop) 1043 1044 #include <sec_api/wchar_s.h> 1045 1046 #include <_mingw_print_pop.h> 1047 1048 #endif /* _INC_WCHAR */ 1049 1050