2 * Standard I/O definitions.
4 * Derived from the mingw header written by Colin Peters.
5 * Modified for Wine use by Jon Griffiths and Francois Gouget.
6 * This file is in the public domain.
19 /* file._flag flags */
20 #define _IOREAD 0x0001
22 #define _IOMYBUF 0x0008
25 #define _IOSTRG 0x0040
32 #define NULL ((void *)0)
36 #define STDIN_FILENO 0
37 #define STDOUT_FILENO 1
38 #define STDERR_FILENO 2
40 /* more file._flag flags, but these conflict with Unix */
46 #define FILENAME_MAX 260
47 #define TMP_MAX 0x7fff
72 #endif /* _FILE_DEFINED */
74 #ifndef _FPOS_T_DEFINED
75 typedef __int64
DECLSPEC_ALIGN(8) fpos_t;
76 #define _FPOS_T_DEFINED
83 #ifndef _STDIO_DEFINED
85 FILE* __cdecl
__p__iob(void);
86 # define _iob (__p__iob())
88 FILE* __cdecl
__iob_func(void);
89 # define _iob (__iob_func())
91 #endif /* _STDIO_DEFINED */
93 #define stdin (_iob+STDIN_FILENO)
94 #define stdout (_iob+STDOUT_FILENO)
95 #define stderr (_iob+STDERR_FILENO)
97 /* return value for _get_output_format */
98 #define _TWO_DIGIT_EXPONENT 0x1
100 #ifndef _STDIO_DEFINED
101 #define _STDIO_DEFINED
102 int __cdecl
_fcloseall(void);
103 FILE* __cdecl
_fdopen(int,const char*);
104 int __cdecl
_fgetchar(void);
105 int __cdecl
_filbuf(FILE*);
106 int __cdecl
_fileno(FILE*);
107 int __cdecl
_flsbuf(int,FILE*);
108 int __cdecl
_flushall(void);
109 int __cdecl
_fputchar(int);
110 FILE* __cdecl
_fsopen(const char*,const char*,int);
111 int __cdecl
_get_printf_count_output(void);
112 int __cdecl
_getmaxstdio(void);
113 int __cdecl
_getw(FILE*);
114 int __cdecl
_pclose(FILE*);
115 FILE* __cdecl
_popen(const char*,const char*);
116 int __cdecl
_putw(int,FILE*);
117 int __cdecl
_rmtmp(void);
118 int __cdecl
_set_printf_count_output(int);
119 int __cdecl
_setmaxstdio(int);
120 int __cdecl
_snprintf(char*,size_t,const char*,...);
121 int __cdecl
_snprintf_s(char*,size_t,size_t,const char*,...);
122 char* __cdecl
_tempnam(const char*,const char*);
123 int __cdecl
_unlink(const char*);
124 int __cdecl
_scprintf(const char*,...);
125 int __cdecl
_vscprintf(const char*,__ms_va_list
);
126 int __cdecl
_vsnprintf(char*,size_t,const char*,__ms_va_list
);
127 int __cdecl
_vsnprintf_s(char*,size_t,size_t,const char*,__ms_va_list
);
128 int __cdecl
_vsprintf_p_l(char*,size_t,const char*,_locale_t
,__ms_va_list
);
130 size_t __cdecl
_fread_nolock(void*,size_t,size_t,FILE*);
131 size_t __cdecl
_fread_nolock_s(void*,size_t,size_t,size_t,FILE*);
132 size_t __cdecl
_fwrite_nolock(const void*,size_t,size_t,FILE*);
133 int __cdecl
_fclose_nolock(FILE*);
134 int __cdecl
_fflush_nolock(FILE*);
135 int __cdecl
_fgetc_nolock(FILE*);
136 int __cdecl
_fputc_nolock(int,FILE*);
137 int __cdecl
_fseek_nolock(FILE*,__msvcrt_long
,int);
138 int __cdecl
_fseeki64_nolock(FILE*,__int64
,int);
139 __msvcrt_long __cdecl
_ftell_nolock(FILE*);
140 __int64 __cdecl
_ftelli64_nolock(FILE*);
141 int __cdecl
_getc_nolock(FILE*);
142 int __cdecl
_putc_nolock(int,FILE*);
143 int __cdecl
_ungetc_nolock(int,FILE*);
145 void __cdecl
clearerr(FILE*);
146 int __cdecl
fclose(FILE*);
147 int __cdecl
feof(FILE*);
148 int __cdecl
ferror(FILE*);
149 int __cdecl
fflush(FILE*);
150 int __cdecl
fgetc(FILE*);
151 int __cdecl
fgetpos(FILE*,fpos_t*);
152 char* __cdecl
fgets(char*,int,FILE*);
153 FILE* __cdecl
fopen(const char*,const char*);
154 errno_t __cdecl
fopen_s(FILE**,const char*,const char*);
155 int __cdecl
fprintf(FILE*,const char*,...);
156 int __cdecl
fprintf_s(FILE*,const char*,...);
157 int __cdecl
fputc(int,FILE*);
158 int __cdecl
fputs(const char*,FILE*);
159 size_t __cdecl
fread(void*,size_t,size_t,FILE*);
160 size_t __cdecl
fread_s(void*,size_t,size_t,size_t,FILE*);
161 FILE* __cdecl
freopen(const char*,const char*,FILE*);
162 int __cdecl
fscanf(FILE*,const char*,...);
163 int __cdecl
fscanf_s(FILE*,const char*,...);
164 int __cdecl
fseek(FILE*,__msvcrt_long
,int);
165 int __cdecl
_fseeki64(FILE*,__int64
,int);
166 int __cdecl
fsetpos(FILE*,fpos_t*);
167 __msvcrt_long __cdecl
ftell(FILE*);
168 __int64 __cdecl
_ftelli64(FILE*);
169 size_t __cdecl
fwrite(const void*,size_t,size_t,FILE*);
170 int __cdecl
getc(FILE*);
171 int __cdecl
getchar(void);
172 char* __cdecl
gets(char*);
173 void __cdecl
perror(const char*);
174 int __cdecl
printf(const char*,...);
175 int __cdecl
printf_s(const char*,...);
176 int __cdecl
putc(int,FILE*);
177 int __cdecl
putchar(int);
178 int __cdecl
puts(const char*);
179 int __cdecl
remove(const char*);
180 int __cdecl
rename(const char*,const char*);
181 void __cdecl
rewind(FILE*);
182 int __cdecl
scanf(const char*,...);
183 int __cdecl
scanf_s(const char*,...);
184 void __cdecl
setbuf(FILE*,char*);
185 int __cdecl
setvbuf(FILE*,char*,int,size_t);
186 int __cdecl
sprintf(char*,const char*,...);
187 int __cdecl
sprintf_s(char*,size_t,const char*,...);
188 int __cdecl
_scprintf(const char *, ...);
189 int __cdecl
sscanf(const char*,const char*,...);
190 int __cdecl
sscanf_s(const char*,const char*,...);
191 FILE* __cdecl
tmpfile(void);
192 char* __cdecl
tmpnam(char*);
193 int __cdecl
ungetc(int,FILE*);
194 int __cdecl
vfprintf(FILE*,const char*,__ms_va_list
);
195 int __cdecl
vfprintf_s(FILE*,const char*,__ms_va_list
);
196 int __cdecl
vprintf(const char*,__ms_va_list
);
197 int __cdecl
vprintf_s(const char*,__ms_va_list
);
198 int __cdecl
vsprintf(char*,const char*,__ms_va_list
);
199 int __cdecl
vsprintf_s(char*,size_t,const char*,__ms_va_list
);
200 unsigned int __cdecl
_get_output_format(void);
201 unsigned int __cdecl
_set_output_format(void);
203 #ifndef _WSTDIO_DEFINED
204 #define _WSTDIO_DEFINED
205 wint_t __cdecl
_fgetwc_nolock(FILE*);
206 wint_t __cdecl
_fgetwchar(void);
207 wint_t __cdecl
_fputwc_nolock(wint_t,FILE*);
208 wint_t __cdecl
_fputwchar(wint_t);
209 wint_t __cdecl
_getwc_nolock(FILE*);
210 wchar_t* __cdecl
_getws(wchar_t*);
211 wint_t __cdecl
_putwc_nolock(wint_t,FILE*);
212 int __cdecl
_putws(const wchar_t*);
213 int __cdecl
_snwprintf(wchar_t*,size_t,const wchar_t*,...);
214 int __cdecl
_snwprintf_s(wchar_t*,size_t,size_t,const wchar_t*,...);
215 int __cdecl
_scwprintf(const wchar_t*,...);
216 wint_t __cdecl
_ungetwc_nolock(wint_t,FILE*);
217 int __cdecl
_vscwprintf(const wchar_t*,__ms_va_list
);
218 int __cdecl
_vscwprintf_p_l(const wchar_t*,_locale_t
,__ms_va_list
);
219 int __cdecl
_vsnwprintf(wchar_t*,size_t,const wchar_t*,__ms_va_list
);
220 int __cdecl
_vsnwprintf_s(wchar_t*,size_t,size_t,const wchar_t*,__ms_va_list
);
221 int __cdecl
_vswprintf_p_l(wchar_t*,size_t,const wchar_t*,_locale_t
,__ms_va_list
);
222 FILE* __cdecl
_wfdopen(int,const wchar_t*);
223 FILE* __cdecl
_wfopen(const wchar_t*,const wchar_t*);
224 errno_t __cdecl
_wfopen_s(FILE**,const wchar_t*,const wchar_t*);
225 FILE* __cdecl
_wfreopen(const wchar_t*,const wchar_t*,FILE*);
226 FILE* __cdecl
_wfsopen(const wchar_t*,const wchar_t*,int);
227 void __cdecl
_wperror(const wchar_t*);
228 FILE* __cdecl
_wpopen(const wchar_t*,const wchar_t*);
229 int __cdecl
_wremove(const wchar_t*);
230 wchar_t* __cdecl
_wtempnam(const wchar_t*,const wchar_t*);
231 wchar_t* __cdecl
_wtmpnam(wchar_t*);
233 wint_t __cdecl
fgetwc(FILE*);
234 wchar_t* __cdecl
fgetws(wchar_t*,int,FILE*);
235 wint_t __cdecl
fputwc(wint_t,FILE*);
236 int __cdecl
fputws(const wchar_t*,FILE*);
237 int __cdecl
fwprintf(FILE*,const wchar_t*,...);
238 int __cdecl
fwprintf_s(FILE*,const wchar_t*,...);
239 int __cdecl
fputws(const wchar_t*,FILE*);
240 int __cdecl
fwscanf(FILE*,const wchar_t*,...);
241 int __cdecl
fwscanf_s(FILE*,const wchar_t*,...);
242 wint_t __cdecl
getwc(FILE*);
243 wint_t __cdecl
getwchar(void);
244 wchar_t* __cdecl
getws(wchar_t*);
245 wint_t __cdecl
putwc(wint_t,FILE*);
246 wint_t __cdecl
putwchar(wint_t);
247 int __cdecl
putws(const wchar_t*);
248 int __cdecl
swprintf(wchar_t*,const wchar_t*,...);
249 int __cdecl
swprintf_s(wchar_t*,size_t,const wchar_t*,...);
250 int __cdecl
swscanf(const wchar_t*,const wchar_t*,...);
251 int __cdecl
swscanf_s(const wchar_t*,const wchar_t*,...);
252 wint_t __cdecl
ungetwc(wint_t,FILE*);
253 int __cdecl
vfwprintf(FILE*,const wchar_t*,__ms_va_list
);
254 int __cdecl
vfwprintf_s(FILE*,const wchar_t*,__ms_va_list
);
255 int __cdecl
vswprintf(wchar_t*,const wchar_t*,__ms_va_list
);
256 int __cdecl
vswprintf_s(wchar_t*,size_t,const wchar_t*,__ms_va_list
);
257 int __cdecl
vwprintf(const wchar_t*,__ms_va_list
);
258 int __cdecl
vwprintf_s(const wchar_t*,__ms_va_list
);
259 int __cdecl
wprintf(const wchar_t*,...);
260 int __cdecl
wprintf_s(const wchar_t*,...);
261 int __cdecl
wscanf(const wchar_t*,...);
262 int __cdecl
wscanf_s(const wchar_t*,...);
263 #endif /* _WSTDIO_DEFINED */
265 #endif /* _STDIO_DEFINED */
272 static inline FILE* fdopen(int fd
, const char *mode
) { return _fdopen(fd
, mode
); }
273 static inline int fgetchar(void) { return _fgetchar(); }
274 static inline int fileno(FILE* file
) { return _fileno(file
); }
275 static inline int fputchar(int c
) { return _fputchar(c
); }
276 static inline int pclose(FILE* file
) { return _pclose(file
); }
277 static inline FILE* popen(const char* command
, const char* mode
) { return _popen(command
, mode
); }
278 static inline char* tempnam(const char *dir
, const char *prefix
) { return _tempnam(dir
, prefix
); }
279 #ifndef _UNLINK_DEFINED
280 static inline int unlink(const char* path
) { return _unlink(path
); }
281 #define _UNLINK_DEFINED
283 static inline int vsnprintf(char *buffer
, size_t size
, const char *format
, __ms_va_list args
) { return _vsnprintf(buffer
,size
,format
,args
); }
285 static inline wint_t fgetwchar(void) { return _fgetwchar(); }
286 static inline wint_t fputwchar(wint_t wc
) { return _fputwchar(wc
); }
287 static inline int getw(FILE* file
) { return _getw(file
); }
288 static inline int putw(int val
, FILE* file
) { return _putw(val
, file
); }
289 static inline FILE* wpopen(const wchar_t* command
,const wchar_t* mode
) { return _wpopen(command
, mode
); }
293 #endif /* __WINE_STDIO_H */