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 <crtdefs.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 _Check_return_opt_ 889 _CRTIMP 890 int 891 __cdecl 892 swprintf( 893 _Out_ wchar_t*, 894 _Printf_format_string_ const wchar_t*, 895 ...); 896 897 _CRTIMP 898 int 899 __cdecl 900 vswprintf( 901 _Out_ wchar_t*, 902 const wchar_t*, 903 va_list); 904 905 _Check_return_opt_ 906 _CRTIMP 907 int 908 __cdecl 909 _swprintf_c( 910 _Out_writes_z_(_SizeInWords) wchar_t *_DstBuf, 911 _In_ size_t _SizeInWords, 912 _In_z_ _Printf_format_string_ const wchar_t *_Format, 913 ...); 914 915 _Check_return_opt_ 916 _CRTIMP 917 int 918 __cdecl 919 _vswprintf_c( 920 _Out_writes_z_(_SizeInWords) wchar_t *_DstBuf, 921 _In_ size_t _SizeInWords, 922 _In_z_ _Printf_format_string_ const wchar_t *_Format, 923 va_list _ArgList); 924 925 _CRTIMP int __cdecl _snwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,...); 926 _CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,va_list _Args); 927 #ifndef __NO_ISOCEXT /* externs in libmingwex.a */ 928 _CRTIMP int __cdecl snwprintf (wchar_t* s, size_t n, const wchar_t* format, ...); 929 __CRT_INLINE int __cdecl vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, va_list arg) 930 { 931 #ifdef _MSC_VER 932 #pragma warning(push) 933 #pragma warning(disable:28719) /* disable banned api usage warning */ 934 #endif /* _MSC_VER */ 935 return _vsnwprintf(s,n,format,arg); 936 #ifdef _MSC_VER 937 #pragma warning(pop) 938 #endif /* _MSC_VER */ 939 } 940 _CRTIMP int __cdecl vwscanf (const wchar_t *, va_list); 941 _CRTIMP int __cdecl vfwscanf (FILE *,const wchar_t *,va_list); 942 _CRTIMP int __cdecl vswscanf (const wchar_t *,const wchar_t *,va_list); 943 #endif 944 _CRTIMP int __cdecl _swprintf(wchar_t *_Dest,const wchar_t *_Format,...); 945 _CRTIMP int __cdecl _vswprintf(wchar_t *_Dest,const wchar_t *_Format,va_list _Args); 946 947 #ifndef RC_INVOKED 948 #include <vadefs.h> 949 #endif 950 951 #if 0 //this is for MSVCRT80 and higher, which we don't use nor implement 952 #ifdef _CRT_NON_CONFORMING_SWPRINTFS 953 #ifndef __cplusplus 954 #define swprintf _swprintf 955 #define vswprintf _vswprintf 956 #define _swprintf_l __swprintf_l 957 #define _vswprintf_l __vswprintf_l 958 #endif 959 #endif 960 #endif 961 962 _Check_return_ 963 _CRTIMP 964 wchar_t* 965 __cdecl 966 _wtempnam( 967 _In_opt_z_ const wchar_t *_Directory, 968 _In_opt_z_ const wchar_t *_FilePrefix); 969 970 _Check_return_ 971 _CRTIMP 972 int 973 __cdecl 974 _vscwprintf( 975 _In_z_ _Printf_format_string_ const wchar_t *_Format, 976 va_list _ArgList); 977 978 _Check_return_ 979 _CRTIMP 980 int 981 __cdecl 982 fwscanf( 983 _Inout_ FILE *_File, 984 _In_z_ _Scanf_format_string_ const wchar_t *_Format, 985 ...); 986 987 _Check_return_ 988 _CRTIMP 989 int 990 __cdecl 991 swscanf( 992 _In_z_ const wchar_t *_Src, 993 _In_z_ _Scanf_format_string_ const wchar_t *_Format, 994 ...); 995 996 _Check_return_opt_ 997 _CRTIMP 998 int 999 __cdecl 1000 _snwscanf( 1001 _In_reads_(_MaxCount) _Pre_z_ const wchar_t *_Src, 1002 _In_ size_t _MaxCount, 1003 _In_z_ _Scanf_format_string_ const wchar_t *_Format, 1004 ...); 1005 1006 _Check_return_ 1007 _CRTIMP 1008 int 1009 __cdecl 1010 wscanf( 1011 _In_z_ _Scanf_format_string_ const wchar_t *_Format, 1012 ...); 1013 1014 _Check_return_ 1015 _CRTIMP 1016 FILE* 1017 __cdecl 1018 _wfdopen( 1019 _In_ int _FileHandle, 1020 _In_z_ const wchar_t *_Mode); 1021 1022 _Check_return_ 1023 _CRTIMP 1024 FILE* 1025 __cdecl 1026 _wfopen( 1027 _In_z_ const wchar_t *_Filename, 1028 _In_z_ const wchar_t *_Mode); 1029 1030 _Check_return_ 1031 _CRTIMP 1032 FILE* 1033 __cdecl 1034 _wfreopen( 1035 _In_z_ const wchar_t *_Filename, 1036 _In_z_ const wchar_t *_Mode, 1037 _Inout_ FILE *_OldFile); 1038 1039 #ifndef _CRT_WPERROR_DEFINED 1040 #define _CRT_WPERROR_DEFINED 1041 _CRTIMP 1042 void 1043 __cdecl 1044 _wperror( 1045 _In_opt_z_ const wchar_t *_ErrMsg); 1046 #endif 1047 1048 _Check_return_ 1049 _CRTIMP 1050 FILE* 1051 __cdecl 1052 _wpopen( 1053 _In_z_ const wchar_t *_Command, 1054 _In_z_ const wchar_t *_Mode); 1055 1056 #if !defined(NO_OLDNAMES) && !defined(wpopen) 1057 #define wpopen _wpopen 1058 #endif 1059 1060 _Check_return_ 1061 _CRTIMP 1062 int 1063 __cdecl 1064 _wremove( 1065 _In_z_ const wchar_t *_Filename); 1066 1067 _CRTIMP 1068 wchar_t* 1069 __cdecl 1070 _wtmpnam( 1071 _Pre_maybenull_ _Post_z_ wchar_t *_Buffer); 1072 1073 _Check_return_opt_ 1074 _CRTIMP 1075 wint_t 1076 __cdecl 1077 _fgetwc_nolock( 1078 _Inout_ FILE *_File); 1079 1080 _Check_return_opt_ 1081 _CRTIMP 1082 wint_t 1083 __cdecl 1084 _fputwc_nolock( 1085 _In_ wchar_t _Ch, 1086 _Inout_ FILE *_File); 1087 1088 _Check_return_opt_ 1089 _CRTIMP 1090 wint_t 1091 __cdecl 1092 _ungetwc_nolock( 1093 _In_ wint_t _Ch, 1094 _Inout_ FILE *_File); 1095 1096 #undef _CRT_GETPUTWCHAR_NOINLINE 1097 1098 #if !defined(__cplusplus) || defined(_CRT_GETPUTWCHAR_NOINLINE) 1099 #define getwchar() fgetwc(stdin) 1100 #define putwchar(_c) fputwc((_c),stdout) 1101 #else 1102 __CRT_INLINE wint_t __cdecl getwchar() { return (fgetwc(stdin)); } 1103 __CRT_INLINE wint_t __cdecl putwchar(wchar_t _C) { return (fputwc(_C,stdout)); } 1104 #endif 1105 1106 #define getwc(_stm) fgetwc(_stm) 1107 #define putwc(_c,_stm) fputwc(_c,_stm) 1108 #define _putwc_nolock(_c,_stm) _fputwc_nolock(_c,_stm) 1109 #define _getwc_nolock(_stm) _fgetwc_nolock(_stm) 1110 1111 #define _WSTDIO_DEFINED 1112 #endif 1113 1114 #define _STDIO_DEFINED 1115 #endif 1116 1117 #define _fgetc_nolock(_stream) (--(_stream)->_cnt >= 0 ? 0xff & *(_stream)->_ptr++ : _filbuf(_stream)) 1118 #define _fputc_nolock(_c,_stream) (--(_stream)->_cnt >= 0 ? 0xff & (*(_stream)->_ptr++ = (char)(_c)) : _flsbuf((_c),(_stream))) 1119 #define _getc_nolock(_stream) _fgetc_nolock(_stream) 1120 #define _putc_nolock(_c,_stream) _fputc_nolock(_c,_stream) 1121 #define _getchar_nolock() _getc_nolock(stdin) 1122 #define _putchar_nolock(_c) _putc_nolock((_c),stdout) 1123 #define _getwchar_nolock() _getwc_nolock(stdin) 1124 #define _putwchar_nolock(_c) _putwc_nolock((_c),stdout) 1125 1126 _CRTIMP 1127 void 1128 __cdecl 1129 _lock_file( 1130 _Inout_ FILE *_File); 1131 1132 _CRTIMP 1133 void 1134 __cdecl 1135 _unlock_file( 1136 _Inout_ FILE *_File); 1137 1138 _Check_return_opt_ 1139 _CRTIMP 1140 int 1141 __cdecl 1142 _fclose_nolock( 1143 _Inout_ FILE *_File); 1144 1145 _Check_return_opt_ 1146 _CRTIMP 1147 int 1148 __cdecl 1149 _fflush_nolock( 1150 _Inout_opt_ FILE *_File); 1151 1152 _Check_return_opt_ 1153 _CRTIMP 1154 size_t 1155 __cdecl 1156 _fread_nolock( 1157 _Out_writes_bytes_(_ElementSize * _Count) void *_DstBuf, 1158 _In_ size_t _ElementSize, 1159 _In_ size_t _Count, 1160 _Inout_ FILE *_File); 1161 1162 _Check_return_opt_ 1163 _CRTIMP 1164 int 1165 __cdecl 1166 _fseek_nolock( 1167 _Inout_ FILE *_File, 1168 _In_ long _Offset, 1169 _In_ int _Origin); 1170 1171 _Check_return_ 1172 _CRTIMP 1173 long 1174 __cdecl 1175 _ftell_nolock( 1176 _Inout_ FILE *_File); 1177 1178 _Check_return_opt_ 1179 __MINGW_EXTENSION 1180 _CRTIMP 1181 int 1182 __cdecl 1183 _fseeki64_nolock( 1184 _Inout_ FILE *_File, 1185 _In_ __int64 _Offset, 1186 _In_ int _Origin); 1187 1188 __MINGW_EXTENSION 1189 _Check_return_ 1190 _CRTIMP 1191 __int64 1192 __cdecl 1193 _ftelli64_nolock( 1194 _Inout_ FILE *_File); 1195 1196 _Check_return_opt_ 1197 _CRTIMP 1198 size_t 1199 __cdecl 1200 _fwrite_nolock( 1201 _In_reads_bytes_(_Size * _Count) const void *_DstBuf, 1202 _In_ size_t _Size, 1203 _In_ size_t _Count, 1204 _Inout_ FILE *_File); 1205 1206 _Check_return_opt_ 1207 _CRTIMP 1208 int 1209 __cdecl 1210 _ungetc_nolock( 1211 _In_ int _Ch, 1212 _Inout_ FILE *_File); 1213 1214 #if !defined(NO_OLDNAMES) || !defined(_POSIX) 1215 1216 #define P_tmpdir _P_tmpdir 1217 #define SYS_OPEN _SYS_OPEN 1218 1219 _CRTIMP 1220 char* 1221 __cdecl 1222 tempnam( 1223 _In_opt_z_ const char *_Directory, 1224 _In_opt_z_ const char *_FilePrefix); 1225 1226 _Check_return_opt_ 1227 _CRTIMP 1228 int 1229 __cdecl 1230 fcloseall(void); 1231 1232 _Check_return_ 1233 _CRTIMP 1234 FILE* 1235 __cdecl 1236 fdopen( 1237 _In_ int _FileHandle, 1238 _In_z_ const char *_Format); 1239 1240 _Check_return_opt_ 1241 _CRTIMP 1242 int 1243 __cdecl 1244 fgetchar(void); 1245 1246 _Check_return_ 1247 _CRTIMP 1248 int 1249 __cdecl 1250 fileno( 1251 _In_ FILE *_File); 1252 1253 _Check_return_opt_ 1254 _CRTIMP 1255 int 1256 __cdecl 1257 flushall(void); 1258 1259 _Check_return_opt_ 1260 _CRTIMP 1261 int 1262 __cdecl 1263 fputchar( 1264 _In_ int _Ch); 1265 1266 _Check_return_ 1267 _CRTIMP 1268 int 1269 __cdecl 1270 getw( 1271 _Inout_ FILE *_File); 1272 1273 _Check_return_opt_ 1274 _CRTIMP 1275 int 1276 __cdecl 1277 putw( 1278 _In_ int _Ch, 1279 _Inout_ FILE *_File); 1280 1281 _Check_return_ 1282 _CRTIMP 1283 int 1284 __cdecl 1285 rmtmp(void); 1286 1287 #endif /* !defined(NO_OLDNAMES) || !defined(_POSIX) */ 1288 1289 #ifdef __cplusplus 1290 } 1291 #endif 1292 1293 #pragma pack(pop) 1294 1295 #include <sec_api/stdio_s.h> 1296 1297 #endif 1298