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