1 /** 2 * This file has no copyright assigned and is placed in the Public Domain. 3 * This file is part of the w64 mingw-runtime package. 4 * No warranty is given; refer to the file DISCLAIMER within this package. 5 */ 6 #ifndef _INC_STDIO 7 #define _INC_STDIO 8 9 #include <corecrt.h> 10 11 #define __need___va_list 12 #include <stdarg.h> 13 14 #pragma pack(push,_CRT_PACKING) 15 16 #ifdef __cplusplus 17 extern "C" { 18 #endif 19 20 #define BUFSIZ 512 21 #define _NFILE _NSTREAM_ 22 #define _NSTREAM_ 512 23 #define _IOB_ENTRIES 20 24 #define EOF (-1) 25 26 #ifndef _FILE_DEFINED 27 struct _iobuf { 28 char *_ptr; 29 int _cnt; 30 char *_base; 31 int _flag; 32 int _file; 33 int _charbuf; 34 int _bufsiz; 35 char *_tmpfname; 36 }; 37 typedef struct _iobuf FILE; 38 #define _FILE_DEFINED 39 #endif 40 41 #ifdef _POSIX_ 42 #define _P_tmpdir "/" 43 #define _wP_tmpdir L"/" 44 #else 45 #define _P_tmpdir "\\" 46 #define _wP_tmpdir L"\\" 47 #endif 48 49 #define L_tmpnam (sizeof(_P_tmpdir) + 12) 50 51 #ifdef _POSIX_ 52 #define L_ctermid 9 53 #define L_cuserid 32 54 #endif 55 56 #define SEEK_CUR 1 57 #define SEEK_END 2 58 #define SEEK_SET 0 59 60 #define STDIN_FILENO 0 61 #define STDOUT_FILENO 1 62 #define STDERR_FILENO 2 63 64 #define FILENAME_MAX 260 65 #define FOPEN_MAX 20 66 #define _SYS_OPEN 20 67 #define TMP_MAX 32767 68 69 #ifndef _OFF_T_DEFINED 70 #define _OFF_T_DEFINED 71 #ifndef _OFF_T_ 72 #define _OFF_T_ 73 typedef long _off_t; 74 #if !defined(NO_OLDNAMES) || defined(_POSIX) 75 typedef long off_t; 76 #endif 77 #endif 78 #endif 79 80 #ifndef _OFF64_T_DEFINED 81 #define _OFF64_T_DEFINED 82 __MINGW_EXTENSION typedef long long _off64_t; 83 #if !defined(NO_OLDNAMES) || defined(_POSIX) 84 __MINGW_EXTENSION typedef long long off64_t; 85 #endif 86 #endif 87 88 #ifndef _STDIO_DEFINED 89 _CRTIMP FILE *__cdecl __iob_func(void); 90 _CRTDATA(extern FILE _iob[];) 91 #ifdef _M_CEE_PURE 92 #define _iob __iob_func() 93 #endif 94 #endif 95 96 #ifndef _STDSTREAM_DEFINED 97 #define _STDSTREAM_DEFINED 98 #define stdin (&_iob[0]) 99 #define stdout (&_iob[1]) 100 #define stderr (&_iob[2]) 101 #endif /* !_STDSTREAM_DEFINED */ 102 103 #ifndef _FPOS_T_DEFINED 104 #define _FPOS_T_DEFINED 105 #undef _FPOSOFF 106 107 #if (!defined(NO_OLDNAMES) || defined(__GNUC__)) && _INTEGRAL_MAX_BITS >= 64 108 __MINGW_EXTENSION typedef __int64 fpos_t; 109 #define _FPOSOFF(fp) ((long)(fp)) 110 #else 111 __MINGW_EXTENSION typedef long long fpos_t; 112 #define _FPOSOFF(fp) ((long)(fp)) 113 #endif 114 115 #endif 116 117 #if defined(_M_IX86) // newer Windows versions always have it 118 _CRTIMP int* __cdecl __p__commode(void); 119 #endif 120 121 /* On newer Windows windows versions, (*__p__commode()) is used */ 122 extern _CRTIMP int _commode; 123 124 #define _IOREAD 0x0001 125 #define _IOWRT 0x0002 126 127 #define _IOFBF 0x0000 128 #define _IOLBF 0x0040 129 #define _IONBF 0x0004 130 131 #define _IOMYBUF 0x0008 132 #define _IOEOF 0x0010 133 #define _IOERR 0x0020 134 #define _IOSTRG 0x0040 135 #define _IORW 0x0080 136 #define _USERBUF 0x0100 137 138 #define _TWO_DIGIT_EXPONENT 0x1 139 140 #ifndef _STDIO_DEFINED 141 142 _Check_return_ 143 _CRTIMP 144 int 145 __cdecl 146 _filbuf( 147 _Inout_ FILE *_File); 148 149 _Check_return_opt_ 150 _CRTIMP 151 int 152 __cdecl 153 _flsbuf( 154 _In_ int _Ch, 155 _Inout_ FILE *_File); 156 157 #ifdef _POSIX_ 158 _CRTIMP 159 FILE* 160 __cdecl 161 _fsopen( 162 const char *_Filename, 163 const char *_Mode); 164 #else 165 _Check_return_ 166 _CRTIMP 167 FILE* 168 __cdecl 169 _fsopen( 170 _In_z_ const char *_Filename, 171 _In_z_ const char *_Mode, 172 _In_ int _ShFlag); 173 #endif 174 175 _CRTIMP 176 void 177 __cdecl 178 clearerr( 179 _Inout_ FILE *_File); 180 181 _Check_return_opt_ 182 _CRTIMP 183 int 184 __cdecl 185 fclose( 186 _Inout_ FILE *_File); 187 188 _Check_return_opt_ 189 _CRTIMP 190 int 191 __cdecl 192 _fcloseall(void); 193 194 #ifdef _POSIX_ 195 FILE* 196 __cdecl 197 fdopen( 198 int _FileHandle, 199 const char *_Mode); 200 #else 201 _Check_return_ 202 _CRTIMP 203 FILE* 204 __cdecl 205 _fdopen( 206 _In_ int _FileHandle, 207 _In_z_ const char *_Mode); 208 #endif 209 210 _Check_return_ 211 _CRTIMP 212 int 213 __cdecl 214 feof( 215 _In_ FILE *_File); 216 217 _Check_return_ 218 _CRTIMP 219 int 220 __cdecl 221 ferror( 222 _In_ FILE *_File); 223 224 _Check_return_opt_ 225 _CRTIMP 226 int 227 __cdecl 228 fflush( 229 _Inout_opt_ FILE *_File); 230 231 _Check_return_opt_ 232 _CRTIMP 233 int 234 __cdecl 235 fgetc( 236 _Inout_ FILE *_File); 237 238 _Check_return_opt_ 239 _CRTIMP 240 int 241 __cdecl 242 _fgetchar(void); 243 244 _Check_return_opt_ 245 _CRTIMP 246 int 247 __cdecl 248 fgetpos( 249 _Inout_ FILE *_File, 250 _Out_ fpos_t *_Pos); 251 252 _Check_return_opt_ 253 _CRTIMP 254 char* 255 __cdecl 256 fgets( 257 _Out_writes_z_(_MaxCount) char *_Buf, 258 _In_ int _MaxCount, 259 _Inout_ FILE *_File); 260 261 #ifdef _POSIX_ 262 int 263 __cdecl 264 fileno( 265 FILE *_File); 266 #else 267 _Check_return_ 268 _CRTIMP 269 int 270 __cdecl 271 _fileno( 272 _In_ FILE *_File); 273 #endif 274 275 _Check_return_ 276 _CRTIMP 277 char* 278 __cdecl 279 _tempnam( 280 _In_opt_z_ const char *_DirName, 281 _In_opt_z_ const char *_FilePrefix); 282 283 _Check_return_opt_ 284 _CRTIMP 285 int 286 __cdecl 287 _flushall(void); 288 289 _Check_return_ 290 _CRTIMP 291 FILE* 292 __cdecl 293 fopen( 294 _In_z_ const char *_Filename, 295 _In_z_ const char *_Mode); 296 297 _Check_return_opt_ 298 _CRTIMP 299 int 300 __cdecl 301 fprintf( 302 _Inout_ FILE *_File, 303 _In_z_ _Printf_format_string_ const char *_Format, 304 ...); 305 306 _Check_return_opt_ 307 _CRTIMP 308 int 309 __cdecl 310 fputc( 311 _In_ int _Ch, 312 _Inout_ FILE *_File); 313 314 _Check_return_opt_ 315 _CRTIMP 316 int 317 __cdecl 318 _fputchar( 319 _In_ int _Ch); 320 321 _Check_return_opt_ 322 _CRTIMP 323 int 324 __cdecl 325 fputs( 326 _In_z_ const char *_Str, 327 _Inout_ FILE *_File); 328 329 _Check_return_opt_ 330 _CRTIMP 331 size_t 332 __cdecl 333 fread( 334 _Out_writes_bytes_(_ElementSize * _Count) void *_DstBuf, 335 _In_ size_t _ElementSize, 336 _In_ size_t _Count, 337 _Inout_ FILE *_File); 338 339 _Check_return_ 340 _CRTIMP 341 _CRT_INSECURE_DEPRECATE(freopen_s) 342 FILE* 343 __cdecl 344 freopen( 345 _In_z_ const char *_Filename, 346 _In_z_ const char *_Mode, 347 _Inout_ FILE *_File); 348 349 _Check_return_ 350 _CRTIMP 351 _CRT_INSECURE_DEPRECATE(fscanf_s) 352 int 353 __cdecl 354 fscanf( 355 _Inout_ FILE *_File, 356 _In_z_ _Scanf_format_string_ const char *_Format, 357 ...); 358 359 _Check_return_opt_ 360 _CRTIMP 361 int 362 __cdecl 363 fsetpos( 364 _Inout_ FILE *_File, 365 _In_ const fpos_t *_Pos); 366 367 _Check_return_opt_ 368 _CRTIMP 369 int 370 __cdecl 371 fseek( 372 _Inout_ FILE *_File, 373 _In_ long _Offset, 374 _In_ int _Origin); 375 376 _Check_return_ 377 _CRTIMP 378 long 379 __cdecl 380 ftell( 381 _Inout_ FILE *_File); 382 383 _Check_return_opt_ 384 __MINGW_EXTENSION 385 _CRTIMP 386 int 387 __cdecl 388 _fseeki64( 389 _Inout_ FILE *_File, 390 _In_ __int64 _Offset, 391 _In_ int _Origin); 392 393 __MINGW_EXTENSION 394 _Check_return_ 395 _CRTIMP 396 __int64 397 __cdecl 398 _ftelli64( 399 _Inout_ FILE *_File); 400 401 _Check_return_opt_ 402 _CRTIMP 403 size_t 404 __cdecl 405 fwrite( 406 _In_reads_bytes_(_Size * _Count) const void *_Str, 407 _In_ size_t _Size, 408 _In_ size_t _Count, 409 _Inout_ FILE *_File); 410 411 _Check_return_ 412 _CRTIMP 413 int 414 __cdecl 415 getc( 416 _Inout_ FILE *_File); 417 418 _Check_return_ 419 _CRTIMP 420 int 421 __cdecl 422 getchar(void); 423 424 _Check_return_ 425 _CRTIMP 426 int 427 __cdecl 428 _getmaxstdio(void); 429 430 _CRTIMP 431 char* 432 __cdecl 433 gets( 434 char *_Buffer); // FIXME: non-standard 435 436 _Check_return_ 437 _CRTIMP 438 int 439 __cdecl 440 _getw( 441 _Inout_ FILE *_File); 442 443 #ifndef _CRT_PERROR_DEFINED 444 #define _CRT_PERROR_DEFINED 445 _CRTIMP 446 void 447 __cdecl 448 perror( 449 _In_opt_z_ const char *_ErrMsg); 450 #endif 451 452 _Check_return_opt_ 453 _CRTIMP 454 int 455 __cdecl 456 _pclose( 457 _Inout_ FILE *_File); 458 459 _Check_return_ 460 _CRTIMP 461 FILE* 462 __cdecl 463 _popen( 464 _In_z_ const char *_Command, 465 _In_z_ const char *_Mode); 466 467 _Check_return_opt_ 468 _CRTIMP 469 int 470 __cdecl 471 printf( 472 _In_z_ _Printf_format_string_ const char *_Format, 473 ...); 474 475 _Check_return_opt_ 476 _CRTIMP 477 int 478 __cdecl 479 putc( 480 _In_ int _Ch, 481 _Inout_ FILE *_File); 482 483 _Check_return_opt_ 484 _CRTIMP 485 int 486 __cdecl 487 putchar( 488 _In_ int _Ch); 489 490 _Check_return_opt_ 491 _CRTIMP 492 int 493 __cdecl 494 puts( 495 _In_z_ const char *_Str); 496 497 _Check_return_opt_ 498 _CRTIMP 499 int 500 __cdecl 501 _putw( 502 _In_ int _Word, 503 _Inout_ FILE *_File); 504 505 #ifndef _CRT_DIRECTORY_DEFINED 506 #define _CRT_DIRECTORY_DEFINED 507 508 _Check_return_ 509 _CRTIMP 510 int 511 __cdecl 512 remove( 513 _In_z_ const char *_Filename); 514 515 _Check_return_ 516 _CRTIMP 517 int 518 __cdecl 519 rename( 520 _In_z_ const char *_OldFilename, 521 _In_z_ const char *_NewFilename); 522 523 _Check_return_ 524 _CRTIMP 525 int 526 __cdecl 527 _unlink( 528 _In_z_ const char *_Filename); 529 530 #ifndef NO_OLDNAMES 531 _Check_return_ 532 _CRTIMP 533 _CRT_NONSTDC_DEPRECATE(_unlink) 534 int 535 __cdecl 536 unlink( 537 _In_z_ const char *_Filename); 538 #endif 539 540 #endif /* _CRT_DIRECTORY_DEFINED */ 541 542 _CRTIMP 543 void 544 __cdecl 545 rewind( 546 _Inout_ FILE *_File); 547 548 _Check_return_opt_ 549 _CRTIMP 550 int 551 __cdecl 552 _rmtmp(void); 553 554 _Check_return_ 555 _CRTIMP 556 _CRT_INSECURE_DEPRECATE_CORE(scanf_s) 557 int 558 __cdecl 559 scanf( 560 _In_z_ _Scanf_format_string_ const char *_Format, 561 ...); 562 563 _CRTIMP 564 _CRT_INSECURE_DEPRECATE(setvbuf) 565 void 566 __cdecl 567 setbuf( 568 _Inout_ FILE *_File, 569 _Inout_updates_opt_(BUFSIZ) _Post_readable_size_(0) char *_Buffer); 570 571 _Check_return_opt_ 572 _CRTIMP 573 int 574 __cdecl 575 _setmaxstdio( 576 _In_ int _Max); 577 578 _Check_return_opt_ 579 _CRTIMP 580 unsigned int 581 __cdecl 582 _set_output_format( 583 _In_ unsigned int _Format); 584 585 _Check_return_opt_ 586 _CRTIMP 587 unsigned int 588 __cdecl 589 _get_output_format(void); 590 591 _Check_return_opt_ 592 _CRTIMP 593 int 594 __cdecl 595 setvbuf( 596 _Inout_ FILE *_File, 597 _Inout_updates_opt_z_(_Size) char *_Buf, 598 _In_ int _Mode, 599 _In_ size_t _Size); 600 601 _Check_return_ 602 _CRTIMP 603 int 604 __cdecl 605 _scprintf( 606 _In_z_ _Printf_format_string_ const char *_Format, 607 ...); 608 609 _Check_return_ 610 _CRTIMP 611 _CRT_INSECURE_DEPRECATE_CORE(sscanf_s) 612 int 613 __cdecl 614 sscanf( 615 _In_z_ const char *_Src, 616 _In_z_ _Scanf_format_string_ const char *_Format, 617 ...); 618 619 _Check_return_opt_ 620 _CRTIMP 621 _CRT_INSECURE_DEPRECATE_CORE(_snscanf_s) 622 int 623 __cdecl 624 _snscanf( 625 _In_reads_bytes_(_MaxCount) _Pre_z_ const char *_Src, 626 _In_ size_t _MaxCount, 627 _In_z_ _Scanf_format_string_ const char *_Format, 628 ...); 629 630 _Check_return_ 631 _CRTIMP 632 _CRT_INSECURE_DEPRECATE(tmpfile_s) 633 FILE* 634 __cdecl 635 tmpfile(void); 636 637 _CRTIMP 638 char* 639 __cdecl 640 tmpnam( 641 _Pre_maybenull_ _Post_z_ char *_Buffer); 642 643 _Check_return_opt_ 644 _CRTIMP_ALT 645 int 646 __cdecl 647 ungetc( 648 _In_ int _Ch, 649 _Inout_ FILE *_File); 650 651 _Check_return_opt_ 652 _CRTIMP 653 int 654 __cdecl 655 vfprintf( 656 _Inout_ FILE *_File, 657 _In_z_ _Printf_format_string_ const char *_Format, 658 va_list _ArgList); 659 660 _Check_return_opt_ 661 _CRTIMP 662 int 663 __cdecl 664 vprintf( 665 _In_z_ _Printf_format_string_ const char *_Format, 666 va_list _ArgList); 667 668 /* Make sure macros are not defined. */ 669 #if __MINGW_GNUC_PREREQ(4,4) 670 #pragma push_macro("vsnprintf") 671 #pragma push_macro("snprintf") 672 #endif 673 #undef vsnprintf 674 #undef snprintf 675 676 _Check_return_opt_ 677 _CRTIMP 678 _CRT_INSECURE_DEPRECATE(vsnprintf_s) 679 int 680 __cdecl 681 vsnprintf( 682 _Out_writes_(_MaxCount) char *_DstBuf, 683 _In_ size_t _MaxCount, 684 _In_z_ _Printf_format_string_ const char *_Format, 685 va_list _ArgList); 686 687 _CRTIMP int __cdecl _snprintf(char *_Dest,size_t _Count,const char *_Format,...); 688 _CRTIMP int __cdecl _vsnprintf(char *_Dest,size_t _Count,const char *_Format,va_list _Args); 689 int __cdecl sprintf(char *_Dest,const char *_Format,...); 690 int __cdecl vsprintf(char *_Dest,const char *_Format,va_list _Args); 691 692 #ifndef __NO_ISOCEXT /* externs in libmingwex.a */ 693 int __cdecl snprintf(char* s, size_t n, const char* format, ...); 694 int __cdecl vscanf(const char * __restrict__ Format, va_list argp); 695 int __cdecl vfscanf (FILE * __restrict__ fp, const char * Format,va_list argp); 696 int __cdecl vsscanf (const char * __restrict__ _Str,const char * __restrict__ Format,va_list argp); 697 #endif 698 699 /* Restore may prior defined macros snprintf/vsnprintf. */ 700 #if __MINGW_GNUC_PREREQ(4,4) 701 #pragma pop_macro("snprintf") 702 #pragma pop_macro("vsnprintf") 703 #endif 704 705 #ifndef vsnprintf 706 #define vsnprintf _vsnprintf 707 #endif 708 #ifndef snprintf 709 #define snprintf _snprintf 710 #endif 711 712 _Check_return_ 713 _CRTIMP 714 int 715 __cdecl 716 _vscprintf( 717 _In_z_ _Printf_format_string_ const char *_Format, 718 va_list _ArgList); 719 720 #ifdef _SAFECRT_IMPL 721 #define _set_printf_count_output(i) 722 #define _get_printf_count_output() (FALSE) 723 #else 724 _CRTIMP int __cdecl _set_printf_count_output(_In_ int _Value); 725 _CRTIMP int __cdecl _get_printf_count_output(void); 726 #endif 727 728 #ifndef _WSTDIO_DEFINED 729 730 #ifndef WEOF 731 #define WEOF (wint_t)(0xFFFF) 732 #endif 733 734 #ifdef _POSIX_ 735 _CRTIMP 736 FILE* 737 __cdecl 738 _wfsopen( 739 const wchar_t *_Filename, 740 const wchar_t *_Mode); 741 #else 742 _Check_return_ 743 _CRTIMP 744 FILE* 745 __cdecl 746 _wfsopen( 747 _In_z_ const wchar_t *_Filename, 748 _In_z_ const wchar_t *_Mode, 749 _In_ int _ShFlag); 750 #endif 751 752 _Check_return_opt_ 753 _CRTIMP 754 wint_t 755 __cdecl 756 fgetwc( 757 _Inout_ FILE *_File); 758 759 _Check_return_opt_ 760 _CRTIMP 761 wint_t 762 __cdecl 763 _fgetwchar(void); 764 765 _Check_return_opt_ 766 _CRTIMP 767 wint_t 768 __cdecl 769 fputwc( 770 _In_ wchar_t _Ch, 771 _Inout_ FILE *_File); 772 773 _Check_return_opt_ 774 _CRTIMP 775 wint_t 776 __cdecl 777 _fputwchar( 778 _In_ wchar_t _Ch); 779 780 _Check_return_ 781 _CRTIMP 782 wint_t 783 __cdecl 784 getwc( 785 _Inout_ FILE *_File); 786 787 _Check_return_ 788 _CRTIMP 789 wint_t 790 __cdecl 791 getwchar(void); 792 793 _Check_return_opt_ 794 _CRTIMP 795 wint_t 796 __cdecl 797 putwc( 798 _In_ wchar_t _Ch, 799 _Inout_ FILE *_File); 800 801 _Check_return_opt_ 802 _CRTIMP 803 wint_t 804 __cdecl 805 putwchar( 806 _In_ wchar_t _Ch); 807 808 _Check_return_opt_ 809 _CRTIMP 810 wint_t 811 __cdecl 812 ungetwc( 813 _In_ wint_t _Ch, 814 _Inout_ FILE *_File); 815 816 _Check_return_opt_ 817 _CRTIMP 818 wchar_t* 819 __cdecl 820 fgetws( 821 _Out_writes_z_(_SizeInWords) wchar_t *_Dst, 822 _In_ int _SizeInWords, 823 _Inout_ FILE *_File); 824 825 _Check_return_opt_ 826 _CRTIMP 827 int 828 __cdecl 829 fputws( 830 _In_z_ const wchar_t *_Str, 831 _Inout_ FILE *_File); 832 833 _CRTIMP 834 wchar_t* 835 __cdecl 836 _getws( 837 wchar_t *_String); 838 839 _Check_return_opt_ 840 _CRTIMP 841 int 842 __cdecl 843 _putws( 844 _In_z_ const wchar_t *_Str); 845 846 _Check_return_opt_ 847 _CRTIMP 848 int 849 __cdecl 850 fwprintf( 851 _Inout_ FILE *_File, 852 _In_z_ _Printf_format_string_ const wchar_t *_Format, 853 ...); 854 855 _Check_return_opt_ 856 _CRTIMP 857 int 858 __cdecl 859 wprintf( 860 _In_z_ _Printf_format_string_ const wchar_t *_Format, 861 ...); 862 863 _Check_return_ 864 _CRTIMP 865 int 866 __cdecl 867 _scwprintf( 868 _In_z_ _Printf_format_string_ const wchar_t *_Format, 869 ...); 870 871 _Check_return_opt_ 872 _CRTIMP 873 int 874 __cdecl 875 vfwprintf( 876 _Inout_ FILE *_File, 877 _In_z_ _Printf_format_string_ const wchar_t *_Format, 878 va_list _ArgList); 879 880 _Check_return_opt_ 881 _CRTIMP 882 int 883 __cdecl 884 vwprintf( 885 _In_z_ _Printf_format_string_ const wchar_t *_Format, 886 va_list _ArgList); 887 888 #if defined __cplusplus || defined _CRT_NON_CONFORMING_SWPRINTFS 889 _Check_return_opt_ 890 _CRTIMP 891 int 892 __cdecl 893 swprintf( 894 _Out_ wchar_t*, 895 _Printf_format_string_ const wchar_t*, 896 ...); 897 898 _CRTIMP 899 int 900 __cdecl 901 vswprintf( 902 _Out_ wchar_t*, 903 const wchar_t*, 904 va_list); 905 #endif 906 907 _Check_return_opt_ 908 _CRTIMP 909 int 910 __cdecl 911 _swprintf_c( 912 _Out_writes_z_(_SizeInWords) wchar_t *_DstBuf, 913 _In_ size_t _SizeInWords, 914 _In_z_ _Printf_format_string_ const wchar_t *_Format, 915 ...); 916 917 _Check_return_opt_ 918 _CRTIMP 919 int 920 __cdecl 921 _vswprintf_c( 922 _Out_writes_z_(_SizeInWords) wchar_t *_DstBuf, 923 _In_ size_t _SizeInWords, 924 _In_z_ _Printf_format_string_ const wchar_t *_Format, 925 va_list _ArgList); 926 927 _CRTIMP int __cdecl _snwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,...); 928 _CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,va_list _Args); 929 #ifndef __NO_ISOCEXT /* externs in libmingwex.a */ 930 _CRTIMP int __cdecl snwprintf (wchar_t* s, size_t n, const wchar_t* format, ...); vsnwprintf(wchar_t * s,size_t n,const wchar_t * format,va_list arg)931 __CRT_INLINE int __cdecl vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, va_list arg) 932 { 933 #ifdef _MSC_VER 934 #pragma warning(push) 935 #pragma warning(disable:28719) /* disable banned api usage warning */ 936 #endif /* _MSC_VER */ 937 return _vsnwprintf(s,n,format,arg); 938 #ifdef _MSC_VER 939 #pragma warning(pop) 940 #endif /* _MSC_VER */ 941 } 942 _CRTIMP int __cdecl vwscanf (const wchar_t *, va_list); 943 _CRTIMP int __cdecl vfwscanf (FILE *,const wchar_t *,va_list); 944 _CRTIMP int __cdecl vswscanf (const wchar_t *,const wchar_t *,va_list); 945 #endif 946 _CRTIMP int __cdecl _swprintf(wchar_t *_Dest,const wchar_t *_Format,...); 947 _CRTIMP int __cdecl _vswprintf(wchar_t *_Dest,const wchar_t *_Format,va_list _Args); 948 949 #ifndef RC_INVOKED 950 #include <vadefs.h> 951 #endif 952 953 #ifndef _CRT_NON_CONFORMING_SWPRINTFS 954 _Check_return_opt_ 955 static inline 956 int 957 __cdecl swprintf(_Out_writes_z_ (_SizeInWords)wchar_t * _DstBuf,_In_ size_t _SizeInWords,_In_z_ _Printf_format_string_ const wchar_t * _Format,...)958 swprintf( 959 _Out_writes_z_(_SizeInWords) wchar_t* _DstBuf, 960 _In_ size_t _SizeInWords, 961 _In_z_ _Printf_format_string_ const wchar_t* _Format, 962 ...) 963 { 964 int ret; 965 va_list args; 966 967 va_start(args, _Format); 968 ret = _vsnwprintf(_DstBuf, _SizeInWords, _Format, args); 969 va_end(args); 970 return ret; 971 } 972 973 _Check_return_opt_ 974 static inline 975 int 976 __cdecl vswprintf(_Out_writes_z_ (_SizeInWords)wchar_t * _DstBuf,_In_ size_t _SizeInWords,_In_z_ _Printf_format_string_ const wchar_t * _Format,va_list _ArgList)977 vswprintf( 978 _Out_writes_z_(_SizeInWords) wchar_t* _DstBuf, 979 _In_ size_t _SizeInWords, 980 _In_z_ _Printf_format_string_ const wchar_t* _Format, 981 va_list _ArgList) 982 { 983 return _vsnwprintf(_DstBuf, _SizeInWords, _Format, _ArgList); 984 } 985 #endif 986 987 _Check_return_ 988 _CRTIMP 989 wchar_t* 990 __cdecl 991 _wtempnam( 992 _In_opt_z_ const wchar_t *_Directory, 993 _In_opt_z_ const wchar_t *_FilePrefix); 994 995 _Check_return_ 996 _CRTIMP 997 int 998 __cdecl 999 _vscwprintf( 1000 _In_z_ _Printf_format_string_ const wchar_t *_Format, 1001 va_list _ArgList); 1002 1003 _Check_return_ 1004 _CRTIMP 1005 int 1006 __cdecl 1007 fwscanf( 1008 _Inout_ FILE *_File, 1009 _In_z_ _Scanf_format_string_ const wchar_t *_Format, 1010 ...); 1011 1012 _Check_return_ 1013 _CRTIMP 1014 int 1015 __cdecl 1016 swscanf( 1017 _In_z_ const wchar_t *_Src, 1018 _In_z_ _Scanf_format_string_ const wchar_t *_Format, 1019 ...); 1020 1021 _Check_return_opt_ 1022 _CRTIMP 1023 int 1024 __cdecl 1025 _snwscanf( 1026 _In_reads_(_MaxCount) _Pre_z_ const wchar_t *_Src, 1027 _In_ size_t _MaxCount, 1028 _In_z_ _Scanf_format_string_ const wchar_t *_Format, 1029 ...); 1030 1031 _Check_return_ 1032 _CRTIMP 1033 int 1034 __cdecl 1035 wscanf( 1036 _In_z_ _Scanf_format_string_ const wchar_t *_Format, 1037 ...); 1038 1039 _Check_return_ 1040 _CRTIMP 1041 FILE* 1042 __cdecl 1043 _wfdopen( 1044 _In_ int _FileHandle, 1045 _In_z_ const wchar_t *_Mode); 1046 1047 _Check_return_ 1048 _CRTIMP 1049 FILE* 1050 __cdecl 1051 _wfopen( 1052 _In_z_ const wchar_t *_Filename, 1053 _In_z_ const wchar_t *_Mode); 1054 1055 _Check_return_ 1056 _CRTIMP 1057 FILE* 1058 __cdecl 1059 _wfreopen( 1060 _In_z_ const wchar_t *_Filename, 1061 _In_z_ const wchar_t *_Mode, 1062 _Inout_ FILE *_OldFile); 1063 1064 #ifndef _CRT_WPERROR_DEFINED 1065 #define _CRT_WPERROR_DEFINED 1066 _CRTIMP 1067 void 1068 __cdecl 1069 _wperror( 1070 _In_opt_z_ const wchar_t *_ErrMsg); 1071 #endif 1072 1073 _Check_return_ 1074 _CRTIMP 1075 FILE* 1076 __cdecl 1077 _wpopen( 1078 _In_z_ const wchar_t *_Command, 1079 _In_z_ const wchar_t *_Mode); 1080 1081 #if !defined(NO_OLDNAMES) && !defined(wpopen) 1082 #define wpopen _wpopen 1083 #endif 1084 1085 _Check_return_ 1086 _CRTIMP 1087 int 1088 __cdecl 1089 _wremove( 1090 _In_z_ const wchar_t *_Filename); 1091 1092 _CRTIMP 1093 wchar_t* 1094 __cdecl 1095 _wtmpnam( 1096 _Pre_maybenull_ _Post_z_ wchar_t *_Buffer); 1097 1098 _Check_return_opt_ 1099 _CRTIMP 1100 wint_t 1101 __cdecl 1102 _fgetwc_nolock( 1103 _Inout_ FILE *_File); 1104 1105 _Check_return_opt_ 1106 _CRTIMP 1107 wint_t 1108 __cdecl 1109 _fputwc_nolock( 1110 _In_ wchar_t _Ch, 1111 _Inout_ FILE *_File); 1112 1113 _Check_return_opt_ 1114 _CRTIMP 1115 wint_t 1116 __cdecl 1117 _ungetwc_nolock( 1118 _In_ wint_t _Ch, 1119 _Inout_ FILE *_File); 1120 1121 #undef _CRT_GETPUTWCHAR_NOINLINE 1122 1123 #if !defined(__cplusplus) || defined(_CRT_GETPUTWCHAR_NOINLINE) 1124 #define getwchar() fgetwc(stdin) 1125 #define putwchar(_c) fputwc((_c),stdout) 1126 #else getwchar()1127 __CRT_INLINE wint_t __cdecl getwchar() { return (fgetwc(stdin)); } putwchar(wchar_t _C)1128 __CRT_INLINE wint_t __cdecl putwchar(wchar_t _C) { return (fputwc(_C,stdout)); } 1129 #endif 1130 1131 #define getwc(_stm) fgetwc(_stm) 1132 #define putwc(_c,_stm) fputwc(_c,_stm) 1133 #define _putwc_nolock(_c,_stm) _fputwc_nolock(_c,_stm) 1134 #define _getwc_nolock(_stm) _fgetwc_nolock(_stm) 1135 1136 #define _WSTDIO_DEFINED 1137 #endif 1138 1139 #define _STDIO_DEFINED 1140 #endif 1141 1142 #define _fgetc_nolock(_stream) (--(_stream)->_cnt >= 0 ? 0xff & *(_stream)->_ptr++ : _filbuf(_stream)) 1143 #define _fputc_nolock(_c,_stream) (--(_stream)->_cnt >= 0 ? 0xff & (*(_stream)->_ptr++ = (char)(_c)) : _flsbuf((_c),(_stream))) 1144 #define _getc_nolock(_stream) _fgetc_nolock(_stream) 1145 #define _putc_nolock(_c,_stream) _fputc_nolock(_c,_stream) 1146 #define _getchar_nolock() _getc_nolock(stdin) 1147 #define _putchar_nolock(_c) _putc_nolock((_c),stdout) 1148 #define _getwchar_nolock() _getwc_nolock(stdin) 1149 #define _putwchar_nolock(_c) _putwc_nolock((_c),stdout) 1150 1151 _CRTIMP 1152 void 1153 __cdecl 1154 _lock_file( 1155 _Inout_ FILE *_File); 1156 1157 _CRTIMP 1158 void 1159 __cdecl 1160 _unlock_file( 1161 _Inout_ FILE *_File); 1162 1163 _Check_return_opt_ 1164 _CRTIMP 1165 int 1166 __cdecl 1167 _fclose_nolock( 1168 _Inout_ FILE *_File); 1169 1170 _Check_return_opt_ 1171 _CRTIMP 1172 int 1173 __cdecl 1174 _fflush_nolock( 1175 _Inout_opt_ FILE *_File); 1176 1177 _Check_return_opt_ 1178 _CRTIMP 1179 size_t 1180 __cdecl 1181 _fread_nolock( 1182 _Out_writes_bytes_(_ElementSize * _Count) void *_DstBuf, 1183 _In_ size_t _ElementSize, 1184 _In_ size_t _Count, 1185 _Inout_ FILE *_File); 1186 1187 _Check_return_opt_ 1188 _CRTIMP 1189 int 1190 __cdecl 1191 _fseek_nolock( 1192 _Inout_ FILE *_File, 1193 _In_ long _Offset, 1194 _In_ int _Origin); 1195 1196 _Check_return_ 1197 _CRTIMP 1198 long 1199 __cdecl 1200 _ftell_nolock( 1201 _Inout_ FILE *_File); 1202 1203 _Check_return_opt_ 1204 __MINGW_EXTENSION 1205 _CRTIMP 1206 int 1207 __cdecl 1208 _fseeki64_nolock( 1209 _Inout_ FILE *_File, 1210 _In_ __int64 _Offset, 1211 _In_ int _Origin); 1212 1213 __MINGW_EXTENSION 1214 _Check_return_ 1215 _CRTIMP 1216 __int64 1217 __cdecl 1218 _ftelli64_nolock( 1219 _Inout_ FILE *_File); 1220 1221 _Check_return_opt_ 1222 _CRTIMP 1223 size_t 1224 __cdecl 1225 _fwrite_nolock( 1226 _In_reads_bytes_(_Size * _Count) const void *_DstBuf, 1227 _In_ size_t _Size, 1228 _In_ size_t _Count, 1229 _Inout_ FILE *_File); 1230 1231 _Check_return_opt_ 1232 _CRTIMP 1233 int 1234 __cdecl 1235 _ungetc_nolock( 1236 _In_ int _Ch, 1237 _Inout_ FILE *_File); 1238 1239 #if !defined(NO_OLDNAMES) || !defined(_POSIX) 1240 1241 #define P_tmpdir _P_tmpdir 1242 #define SYS_OPEN _SYS_OPEN 1243 1244 _CRTIMP 1245 char* 1246 __cdecl 1247 tempnam( 1248 _In_opt_z_ const char *_Directory, 1249 _In_opt_z_ const char *_FilePrefix); 1250 1251 _Check_return_opt_ 1252 _CRTIMP 1253 int 1254 __cdecl 1255 fcloseall(void); 1256 1257 _Check_return_ 1258 _CRTIMP 1259 FILE* 1260 __cdecl 1261 fdopen( 1262 _In_ int _FileHandle, 1263 _In_z_ const char *_Format); 1264 1265 _Check_return_opt_ 1266 _CRTIMP 1267 int 1268 __cdecl 1269 fgetchar(void); 1270 1271 _Check_return_ 1272 _CRTIMP 1273 int 1274 __cdecl 1275 fileno( 1276 _In_ FILE *_File); 1277 1278 _Check_return_opt_ 1279 _CRTIMP 1280 int 1281 __cdecl 1282 flushall(void); 1283 1284 _Check_return_opt_ 1285 _CRTIMP 1286 int 1287 __cdecl 1288 fputchar( 1289 _In_ int _Ch); 1290 1291 _Check_return_ 1292 _CRTIMP 1293 int 1294 __cdecl 1295 getw( 1296 _Inout_ FILE *_File); 1297 1298 _Check_return_opt_ 1299 _CRTIMP 1300 int 1301 __cdecl 1302 putw( 1303 _In_ int _Ch, 1304 _Inout_ FILE *_File); 1305 1306 _Check_return_ 1307 _CRTIMP 1308 int 1309 __cdecl 1310 rmtmp(void); 1311 1312 #endif /* !defined(NO_OLDNAMES) || !defined(_POSIX) */ 1313 1314 #ifdef __cplusplus 1315 } 1316 #endif 1317 1318 #pragma pack(pop) 1319 1320 #include <sec_api/stdio_s.h> 1321 1322 #endif 1323