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.
11 #define __need___va_list
14 #pragma pack(push,_CRT_PACKING)
21 #define _NFILE _NSTREAM_
23 #define _IOB_ENTRIES 20
37 typedef struct _iobuf
FILE;
43 #define _wP_tmpdir L"/"
45 #define _P_tmpdir "\\"
46 #define _wP_tmpdir L"\\"
49 #define L_tmpnam (sizeof(_P_tmpdir) + 12)
60 #define STDIN_FILENO 0
61 #define STDOUT_FILENO 1
62 #define STDERR_FILENO 2
64 #define FILENAME_MAX 260
73 #define NULL ((void *)0)
77 #ifndef _OFF_T_DEFINED
78 #define _OFF_T_DEFINED
82 #if !defined(NO_OLDNAMES) || defined(_POSIX)
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
;
96 #ifndef _STDIO_DEFINED
97 _CRTIMP
FILE *__cdecl
__iob_func(void);
98 _CRTDATA(extern FILE _iob
[];)
100 #define _iob __iob_func()
104 #ifndef _FPOS_T_DEFINED
105 #define _FPOS_T_DEFINED
108 #if (!defined(NO_OLDNAMES) || defined(__GNUC__)) && _INTEGRAL_MAX_BITS >= 64
109 __MINGW_EXTENSION
typedef __int64
fpos_t;
110 #define _FPOSOFF(fp) ((long)(fp))
112 __MINGW_EXTENSION
typedef long long fpos_t;
113 #define _FPOSOFF(fp) ((long)(fp))
118 #ifndef _STDSTREAM_DEFINED
119 #define _STDSTREAM_DEFINED
120 #define stdin (&_iob[0])
121 #define stdout (&_iob[1])
122 #define stderr (&_iob[1])
123 #endif /* !_STDSTREAM_DEFINED */
125 #define _IOREAD 0x0001
126 #define _IOWRT 0x0002
128 #define _IOFBF 0x0000
129 #define _IOLBF 0x0040
130 #define _IONBF 0x0004
132 #define _IOMYBUF 0x0008
133 #define _IOEOF 0x0010
134 #define _IOERR 0x0020
135 #define _IOSTRG 0x0040
138 #define _TWO_DIGIT_EXPONENT 0x1
140 #ifndef _STDIO_DEFINED
142 _CRTIMP
int __cdecl
_filbuf(FILE *_File
);
143 _CRTIMP
int __cdecl
_flsbuf(int _Ch
,FILE *_File
);
145 _CRTIMP
FILE *__cdecl
_fsopen(const char *_Filename
,const char *_Mode
);
147 _CRTIMP
FILE *__cdecl
_fsopen(const char *_Filename
,const char *_Mode
,int _ShFlag
);
149 _CRTIMP
void __cdecl
clearerr(FILE *_File
);
150 _CRTIMP
int __cdecl
fclose(FILE *_File
);
151 _CRTIMP
int __cdecl
_fcloseall(void);
153 FILE *__cdecl
fdopen(int _FileHandle
,const char *_Mode
);
155 _CRTIMP
FILE *__cdecl
_fdopen(int _FileHandle
,const char *_Mode
);
157 _CRTIMP
int __cdecl
feof(FILE *_File
);
158 _CRTIMP
int __cdecl
ferror(FILE *_File
);
159 _CRTIMP
int __cdecl
fflush(FILE *_File
);
160 _CRTIMP
int __cdecl
fgetc(FILE *_File
);
161 _CRTIMP
int __cdecl
_fgetchar(void);
162 _CRTIMP
int __cdecl
fgetpos(FILE *_File
,fpos_t *_Pos
);
163 _CRTIMP
char *__cdecl
fgets(char *_Buf
,int _MaxCount
,FILE *_File
);
165 int __cdecl
fileno(FILE *_File
);
167 _CRTIMP
int __cdecl
_fileno(FILE *_File
);
169 _CRTIMP
char *__cdecl
_tempnam(const char *_DirName
,const char *_FilePrefix
);
170 _CRTIMP
int __cdecl
_flushall(void);
171 _CRTIMP
FILE *__cdecl
fopen(const char *_Filename
,const char *_Mode
);
172 _CRTIMP
int __cdecl
fprintf(FILE *_File
,const char *_Format
,...);
173 _CRTIMP
int __cdecl
fputc(int _Ch
,FILE *_File
);
174 _CRTIMP
int __cdecl
_fputchar(int _Ch
);
175 _CRTIMP
int __cdecl
fputs(const char *_Str
,FILE *_File
);
176 _CRTIMP
size_t __cdecl
fread(void *_DstBuf
,size_t _ElementSize
,size_t _Count
,FILE *_File
);
177 _CRTIMP
_CRT_INSECURE_DEPRECATE(freopen_s
) FILE *__cdecl
freopen(const char *_Filename
,const char *_Mode
,FILE *_File
);
178 _CRTIMP
_CRT_INSECURE_DEPRECATE(fscanf_s
) int __cdecl
fscanf(FILE *_File
,const char *_Format
,...);
179 _CRTIMP
int __cdecl
fsetpos(FILE *_File
,const fpos_t *_Pos
);
180 _CRTIMP
int __cdecl
fseek(FILE *_File
,long _Offset
,int _Origin
);
181 _CRTIMP
long __cdecl
ftell(FILE *_File
);
182 __MINGW_EXTENSION _CRTIMP
int __cdecl
_fseeki64(FILE *_File
,__int64 _Offset
,int _Origin
);
183 __MINGW_EXTENSION _CRTIMP __int64 __cdecl
_ftelli64(FILE *_File
);
184 _CRTIMP
size_t __cdecl
fwrite(const void *_Str
,size_t _Size
,size_t _Count
,FILE *_File
);
185 _CRTIMP
int __cdecl
getc(FILE *_File
);
186 _CRTIMP
int __cdecl
getchar(void);
187 _CRTIMP
int __cdecl
_getmaxstdio(void);
188 _CRTIMP
char *__cdecl
gets(char *_Buffer
); // FIXME: non-standard
189 _CRTIMP
int __cdecl
_getw(FILE *_File
);
190 #ifndef _CRT_PERROR_DEFINED
191 #define _CRT_PERROR_DEFINED
192 _CRTIMP
void __cdecl
perror(const char *_ErrMsg
);
194 _CRTIMP
int __cdecl
_pclose(FILE *_File
);
195 _CRTIMP
FILE *__cdecl
_popen(const char *_Command
,const char *_Mode
);
196 _CRTIMP
int __cdecl
printf(const char *_Format
,...);
197 _CRTIMP
int __cdecl
putc(int _Ch
,FILE *_File
);
198 _CRTIMP
int __cdecl
putchar(int _Ch
);
199 _CRTIMP
int __cdecl
puts(const char *_Str
);
200 _CRTIMP
int __cdecl
_putw(int _Word
,FILE *_File
);
201 #ifndef _CRT_DIRECTORY_DEFINED
202 #define _CRT_DIRECTORY_DEFINED
203 _CRTIMP
int __cdecl
remove(const char *_Filename
);
204 _CRTIMP
int __cdecl
rename(const char *_OldFilename
,const char *_NewFilename
);
205 _CRTIMP
int __cdecl
_unlink(const char *_Filename
);
207 _CRTIMP
_CRT_NONSTDC_DEPRECATE(_unlink
) int __cdecl
unlink(const char *_Filename
);
210 _CRTIMP
void __cdecl
rewind(FILE *_File
);
211 _CRTIMP
int __cdecl
_rmtmp(void);
212 _CRTIMP
_CRT_INSECURE_DEPRECATE_CORE(scanf_s
) int __cdecl
scanf(const char *_Format
,...);
213 _CRTIMP
_CRT_INSECURE_DEPRECATE(setvbuf
) void __cdecl
setbuf(FILE *_File
,char *_Buffer
);
214 _CRTIMP
int __cdecl
_setmaxstdio(int _Max
);
215 _CRTIMP
unsigned int __cdecl
_set_output_format(unsigned int _Format
);
216 _CRTIMP
unsigned int __cdecl
_get_output_format(void);
217 _CRTIMP
int __cdecl
setvbuf(FILE *_File
,char *_Buf
,int _Mode
,size_t _Size
);
218 _CRTIMP
int __cdecl
_scprintf(const char *_Format
,...);
219 _CRTIMP
_CRT_INSECURE_DEPRECATE_CORE(sscanf_s
) int __cdecl
sscanf(const char *_Src
,const char *_Format
,...);
220 _CRTIMP
_CRT_INSECURE_DEPRECATE_CORE(_snscanf_s
) int __cdecl
_snscanf(const char *_Src
,size_t _MaxCount
,const char *_Format
,...);
221 _CRTIMP
_CRT_INSECURE_DEPRECATE(tmpfile_s
) FILE *__cdecl
tmpfile(void);
222 _CRTIMP
char *__cdecl
tmpnam(char *_Buffer
);
223 _CRTIMP_ALT
int __cdecl
ungetc(int _Ch
,FILE *_File
);
224 _CRTIMP
int __cdecl
vfprintf(FILE *_File
,const char *_Format
,va_list _ArgList
);
225 _CRTIMP
int __cdecl
vprintf(const char *_Format
,va_list _ArgList
);
226 /* Make sure macros are not defined. */
227 #if __MINGW_GNUC_PREREQ(4,4)
228 #pragma push_macro("vsnprintf")
229 #pragma push_macro("snprintf")
233 _CRTIMP
_CRT_INSECURE_DEPRECATE(vsnprintf_s
) int __cdecl
vsnprintf(char *_DstBuf
,size_t _MaxCount
,const char *_Format
,va_list _ArgList
);
234 _CRTIMP
int __cdecl
_snprintf(char *_Dest
,size_t _Count
,const char *_Format
,...);
235 _CRTIMP
int __cdecl
_vsnprintf(char *_Dest
,size_t _Count
,const char *_Format
,va_list _Args
);
236 int __cdecl
sprintf(char *_Dest
,const char *_Format
,...);
237 int __cdecl
vsprintf(char *_Dest
,const char *_Format
,va_list _Args
);
238 #ifndef __NO_ISOCEXT /* externs in libmingwex.a */
239 int __cdecl
snprintf(char* s
, size_t n
, const char* format
, ...);
240 int __cdecl
vscanf(const char * __restrict__ Format
, va_list argp
);
241 int __cdecl
vfscanf (FILE * __restrict__ fp
, const char * Format
,va_list argp
);
242 int __cdecl
vsscanf (const char * __restrict__ _Str
,const char * __restrict__ Format
,va_list argp
);
244 /* Restore may prior defined macros snprintf/vsnprintf. */
245 #if __MINGW_GNUC_PREREQ(4,4)
246 #pragma pop_macro("snprintf")
247 #pragma pop_macro("vsnprintf")
251 #define vsnprintf _vsnprintf
254 #define snprintf _snprintf
257 _CRTIMP
int __cdecl
_vscprintf(const char *_Format
,va_list _ArgList
);
259 #define _set_printf_count_output(i)
260 #define _get_printf_count_output() (FALSE)
262 _CRTIMP
int __cdecl
_set_printf_count_output(int _Value
);
263 _CRTIMP
int __cdecl
_get_printf_count_output(void);
266 #ifndef _WSTDIO_DEFINED
269 #define WEOF (wint_t)(0xFFFF)
273 _CRTIMP
FILE *__cdecl
_wfsopen(const wchar_t *_Filename
,const wchar_t *_Mode
);
275 _CRTIMP
FILE *__cdecl
_wfsopen(const wchar_t *_Filename
,const wchar_t *_Mode
,int _ShFlag
);
277 _CRTIMP
wint_t __cdecl
fgetwc(FILE *_File
);
278 _CRTIMP
wint_t __cdecl
_fgetwchar(void);
279 _CRTIMP
wint_t __cdecl
fputwc(wchar_t _Ch
,FILE *_File
);
280 _CRTIMP
wint_t __cdecl
_fputwchar(wchar_t _Ch
);
281 _CRTIMP
wint_t __cdecl
getwc(FILE *_File
);
282 _CRTIMP
wint_t __cdecl
getwchar(void);
283 _CRTIMP
wint_t __cdecl
putwc(wchar_t _Ch
,FILE *_File
);
284 _CRTIMP
wint_t __cdecl
putwchar(wchar_t _Ch
);
285 _CRTIMP
wint_t __cdecl
ungetwc(wint_t _Ch
,FILE *_File
);
286 _CRTIMP
wchar_t *__cdecl
fgetws(wchar_t *_Dst
,int _SizeInWords
,FILE *_File
);
287 _CRTIMP
int __cdecl
fputws(const wchar_t *_Str
,FILE *_File
);
288 _CRTIMP
wchar_t *__cdecl
_getws(wchar_t *_String
);
289 _CRTIMP
int __cdecl
_putws(const wchar_t *_Str
);
290 _CRTIMP
int __cdecl
fwprintf(FILE *_File
,const wchar_t *_Format
,...);
291 _CRTIMP
int __cdecl
wprintf(const wchar_t *_Format
,...);
292 _CRTIMP
int __cdecl
_scwprintf(const wchar_t *_Format
,...);
293 _CRTIMP
int __cdecl
vfwprintf(FILE *_File
,const wchar_t *_Format
,va_list _ArgList
);
294 _CRTIMP
int __cdecl
vwprintf(const wchar_t *_Format
,va_list _ArgList
);
295 _CRTIMP
int __cdecl
swprintf(wchar_t*, const wchar_t*, ...);
296 _CRTIMP
int __cdecl
vswprintf(wchar_t*, const wchar_t*,va_list);
297 _CRTIMP
int __cdecl
_swprintf_c(wchar_t *_DstBuf
,size_t _SizeInWords
,const wchar_t *_Format
,...);
298 _CRTIMP
int __cdecl
_vswprintf_c(wchar_t *_DstBuf
,size_t _SizeInWords
,const wchar_t *_Format
,va_list _ArgList
);
299 _CRTIMP
int __cdecl
_snwprintf(wchar_t *_Dest
,size_t _Count
,const wchar_t *_Format
,...);
300 _CRTIMP
int __cdecl
_vsnwprintf(wchar_t *_Dest
,size_t _Count
,const wchar_t *_Format
,va_list _Args
);
301 #ifndef __NO_ISOCEXT /* externs in libmingwex.a */
302 _CRTIMP
int __cdecl
snwprintf (wchar_t* s
, size_t n
, const wchar_t* format
, ...);
303 __CRT_INLINE
int __cdecl
vsnwprintf (wchar_t* s
, size_t n
, const wchar_t* format
, va_list arg
)
306 #pragma warning(push)
307 #pragma warning(disable:28719) /* disable banned api usage warning */
308 #endif /* _MSC_VER */
309 return _vsnwprintf(s
,n
,format
,arg
);
312 #endif /* _MSC_VER */
314 _CRTIMP
int __cdecl
vwscanf (const wchar_t *, va_list);
315 _CRTIMP
int __cdecl
vfwscanf (FILE *,const wchar_t *,va_list);
316 _CRTIMP
int __cdecl
vswscanf (const wchar_t *,const wchar_t *,va_list);
318 _CRTIMP
int __cdecl
_swprintf(wchar_t *_Dest
,const wchar_t *_Format
,...);
319 _CRTIMP
int __cdecl
_vswprintf(wchar_t *_Dest
,const wchar_t *_Format
,va_list _Args
);
325 #ifdef _CRT_NON_CONFORMING_SWPRINTFS
327 #define swprintf _swprintf
328 #define vswprintf _vswprintf
329 #define _swprintf_l __swprintf_l
330 #define _vswprintf_l __vswprintf_l
334 _CRTIMP
wchar_t *__cdecl
_wtempnam(const wchar_t *_Directory
,const wchar_t *_FilePrefix
);
335 _CRTIMP
int __cdecl
_vscwprintf(const wchar_t *_Format
,va_list _ArgList
);
336 _CRTIMP
int __cdecl
fwscanf(FILE *_File
,const wchar_t *_Format
,...);
337 _CRTIMP
int __cdecl
swscanf(const wchar_t *_Src
,const wchar_t *_Format
,...);
338 _CRTIMP
int __cdecl
_snwscanf(const wchar_t *_Src
,size_t _MaxCount
,const wchar_t *_Format
,...);
339 _CRTIMP
int __cdecl
wscanf(const wchar_t *_Format
,...);
340 _CRTIMP
FILE *__cdecl
_wfdopen(int _FileHandle
,const wchar_t *_Mode
);
341 _CRTIMP
FILE *__cdecl
_wfopen(const wchar_t *_Filename
,const wchar_t *_Mode
);
342 _CRTIMP
FILE *__cdecl
_wfreopen(const wchar_t *_Filename
,const wchar_t *_Mode
,FILE *_OldFile
);
343 #ifndef _CRT_WPERROR_DEFINED
344 #define _CRT_WPERROR_DEFINED
345 _CRTIMP
void __cdecl
_wperror(const wchar_t *_ErrMsg
);
347 _CRTIMP
FILE *__cdecl
_wpopen(const wchar_t *_Command
,const wchar_t *_Mode
);
348 #if !defined(NO_OLDNAMES) && !defined(wpopen)
349 #define wpopen _wpopen
351 _CRTIMP
int __cdecl
_wremove(const wchar_t *_Filename
);
352 _CRTIMP
wchar_t *__cdecl
_wtmpnam(wchar_t *_Buffer
);
353 _CRTIMP
wint_t __cdecl
_fgetwc_nolock(FILE *_File
);
354 _CRTIMP
wint_t __cdecl
_fputwc_nolock(wchar_t _Ch
,FILE *_File
);
355 _CRTIMP
wint_t __cdecl
_ungetwc_nolock(wint_t _Ch
,FILE *_File
);
357 #undef _CRT_GETPUTWCHAR_NOINLINE
359 #if !defined(__cplusplus) || defined(_CRT_GETPUTWCHAR_NOINLINE)
360 #define getwchar() fgetwc(stdin)
361 #define putwchar(_c) fputwc((_c),stdout)
363 __CRT_INLINE
wint_t __cdecl
getwchar() { return (fgetwc(stdin
)); }
364 __CRT_INLINE
wint_t __cdecl
putwchar(wchar_t _C
) { return (fputwc(_C
,stdout
)); }
367 #define getwc(_stm) fgetwc(_stm)
368 #define putwc(_c,_stm) fputwc(_c,_stm)
369 #define _putwc_nolock(_c,_stm) _fputwc_nolock(_c,_stm)
370 #define _getwc_nolock(_stm) _fgetwc_nolock(_stm)
372 #define _WSTDIO_DEFINED
375 #define _STDIO_DEFINED
378 #define _fgetc_nolock(_stream) (--(_stream)->_cnt >= 0 ? 0xff & *(_stream)->_ptr++ : _filbuf(_stream))
379 #define _fputc_nolock(_c,_stream) (--(_stream)->_cnt >= 0 ? 0xff & (*(_stream)->_ptr++ = (char)(_c)) : _flsbuf((_c),(_stream)))
380 #define _getc_nolock(_stream) _fgetc_nolock(_stream)
381 #define _putc_nolock(_c,_stream) _fputc_nolock(_c,_stream)
382 #define _getchar_nolock() _getc_nolock(stdin)
383 #define _putchar_nolock(_c) _putc_nolock((_c),stdout)
384 #define _getwchar_nolock() _getwc_nolock(stdin)
385 #define _putwchar_nolock(_c) _putwc_nolock((_c),stdout)
387 _CRTIMP
void __cdecl
_lock_file(FILE *_File
);
388 _CRTIMP
void __cdecl
_unlock_file(FILE *_File
);
389 _CRTIMP
int __cdecl
_fclose_nolock(FILE *_File
);
390 _CRTIMP
int __cdecl
_fflush_nolock(FILE *_File
);
391 _CRTIMP
size_t __cdecl
_fread_nolock(void *_DstBuf
,size_t _ElementSize
,size_t _Count
,FILE *_File
);
392 _CRTIMP
int __cdecl
_fseek_nolock(FILE *_File
,long _Offset
,int _Origin
);
393 _CRTIMP
long __cdecl
_ftell_nolock(FILE *_File
);
394 __MINGW_EXTENSION _CRTIMP
int __cdecl
_fseeki64_nolock(FILE *_File
,__int64 _Offset
,int _Origin
);
395 __MINGW_EXTENSION _CRTIMP __int64 __cdecl
_ftelli64_nolock(FILE *_File
);
396 _CRTIMP
size_t __cdecl
_fwrite_nolock(const void *_DstBuf
,size_t _Size
,size_t _Count
,FILE *_File
);
397 _CRTIMP
int __cdecl
_ungetc_nolock(int _Ch
,FILE *_File
);
399 #if !defined(NO_OLDNAMES) || !defined(_POSIX)
400 #define P_tmpdir _P_tmpdir
401 #define SYS_OPEN _SYS_OPEN
403 _CRTIMP
char *__cdecl
tempnam(const char *_Directory
,const char *_FilePrefix
);
404 _CRTIMP
int __cdecl
fcloseall(void);
405 _CRTIMP
FILE *__cdecl
fdopen(int _FileHandle
,const char *_Format
);
406 _CRTIMP
int __cdecl
fgetchar(void);
407 _CRTIMP
int __cdecl
fileno(FILE *_File
);
408 _CRTIMP
int __cdecl
flushall(void);
409 _CRTIMP
int __cdecl
fputchar(int _Ch
);
410 _CRTIMP
int __cdecl
getw(FILE *_File
);
411 _CRTIMP
int __cdecl
putw(int _Ch
,FILE *_File
);
412 _CRTIMP
int __cdecl
rmtmp(void);
421 #include <sec_api/stdio_s.h>