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