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.
10 #define __WINE_USE_MSVCRT
17 # ifdef USE_MSVCRT_PREFIX
18 # define MSVCRT(x) MSVCRT_##x
24 /* file._flag flags */
25 #ifndef USE_MSVCRT_PREFIX
26 #define _IOREAD 0x0001
28 #define _IOMYBUF 0x0008
31 #define _IOSTRG 0x0040
33 #define _IOAPPEND 0x0200
35 #define MSVCRT__IOREAD 0x0001
36 #define MSVCRT__IOWRT 0x0002
37 #define MSVCRT__IOMYBUF 0x0008
38 #define MSVCRT__IOEOF 0x0010
39 #define MSVCRT__IOERR 0x0020
40 #define MSVCRT__IOSTRG 0x0040
41 #define MSVCRT__IORW 0x0080
42 #define MSVCRT__IOAPPEND 0x0200
43 #endif /* USE_MSVCRT_PREFIX */
49 #define NULL ((void *)0)
53 #ifndef USE_MSVCRT_PREFIX
55 #define STDIN_FILENO 0
56 #define STDOUT_FILENO 1
57 #define STDERR_FILENO 2
59 /* more file._flag flags, but these conflict with Unix */
65 #define FILENAME_MAX 260
79 /* more file._flag flags, but these conflict with Unix */
80 #define MSVCRT__IOFBF 0x0000
81 #define MSVCRT__IONBF 0x0004
82 #define MSVCRT__IOLBF 0x0040
84 #define MSVCRT_FILENAME_MAX 260
86 #define MSVCRT_EOF (-1)
88 #define MSVCRT_BUFSIZ 512
90 #endif /* USE_MSVCRT_PREFIX */
92 #ifndef MSVCRT_FILE_DEFINED
93 #define MSVCRT_FILE_DEFINED
94 typedef struct MSVCRT(_iobuf
)
105 #endif /* MSVCRT_FILE_DEFINED */
107 #ifndef MSVCRT_FPOS_T_DEFINED
108 typedef long MSVCRT(fpos_t);
109 #define MSVCRT_FPOS_T_DEFINED
112 #ifndef MSVCRT_SIZE_T_DEFINED
113 typedef unsigned int MSVCRT(size_t);
114 #define MSVCRT_SIZE_T_DEFINED
117 #ifndef MSVCRT_WCHAR_T_DEFINED
118 #define MSVCRT_WCHAR_T_DEFINED
120 typedef unsigned short MSVCRT(wchar_t);
124 #ifndef MSVCRT_WCTYPE_T_DEFINED
125 typedef MSVCRT(wchar_t) MSVCRT(wint_t);
126 typedef MSVCRT(wchar_t) MSVCRT(wctype_t);
127 #define MSVCRT_WCTYPE_T_DEFINED
134 #ifndef MSVCRT_STDIO_DEFINED
135 MSVCRT(FILE)* MSVCRT(__p__iob
)(void);
136 #define _iob (__p__iob())
137 #endif /* MSVCRT_STDIO_DEFINED */
139 #ifndef USE_MSVCRT_PREFIX
140 #define stdin (_iob+STDIN_FILENO)
141 #define stdout (_iob+STDOUT_FILENO)
142 #define stderr (_iob+STDERR_FILENO)
143 #endif /* USE_MSVCRT_PREFIX */
145 #ifndef MSVCRT_STDIO_DEFINED
146 #define MSVCRT_STDIO_DEFINED
147 int _fcloseall(void);
148 MSVCRT(FILE)* _fdopen(int,const char*);
150 int _filbuf(MSVCRT(FILE*));
151 int _fileno(MSVCRT(FILE)*);
152 int _flsbuf(int,MSVCRT(FILE)*);
155 MSVCRT(FILE)* _fsopen(const char*,const char*,int);
156 int _getmaxstdio(void);
157 int _getw(MSVCRT(FILE)*);
158 int _pclose(MSVCRT(FILE)*);
159 MSVCRT(FILE)* _popen(const char*,const char*);
160 int _putw(int,MSVCRT(FILE)*);
162 int _setmaxstdio(int);
163 int _snprintf(char*,MSVCRT(size_t),const char*,...);
164 char* _tempnam(const char*,const char*);
165 int _unlink(const char*);
166 int _vsnprintf(char*,MSVCRT(size_t),const char*,va_list);
168 void MSVCRT(clearerr
)(MSVCRT(FILE)*);
169 int MSVCRT(fclose
)(MSVCRT(FILE)*);
170 int MSVCRT(feof
)(MSVCRT(FILE)*);
171 int MSVCRT(ferror
)(MSVCRT(FILE)*);
172 int MSVCRT(fflush
)(MSVCRT(FILE)*);
173 int MSVCRT(fgetc
)(MSVCRT(FILE)*);
174 int MSVCRT(fgetpos
)(MSVCRT(FILE)*,MSVCRT(fpos_t)*);
175 char* MSVCRT(fgets
)(char*,int,MSVCRT(FILE)*);
176 MSVCRT(FILE)* MSVCRT(fopen
)(const char*,const char*);
177 int MSVCRT(fprintf
)(MSVCRT(FILE)*,const char*,...);
178 int MSVCRT(fputc
)(int,MSVCRT(FILE)*);
179 int MSVCRT(fputs
)(const char*,MSVCRT(FILE)*);
180 MSVCRT(size_t) MSVCRT(fread
)(void*,MSVCRT(size_t),MSVCRT(size_t),MSVCRT(FILE)*);
181 MSVCRT(FILE)* MSVCRT(freopen
)(const char*,const char*,MSVCRT(FILE)*);
182 int MSVCRT(fscanf
)(MSVCRT(FILE)*,const char*,...);
183 int MSVCRT(fseek
)(MSVCRT(FILE)*,long,int);
184 int MSVCRT(fsetpos
)(MSVCRT(FILE)*,MSVCRT(fpos_t)*);
185 long MSVCRT(ftell
)(MSVCRT(FILE)*);
186 MSVCRT(size_t) MSVCRT(fwrite
)(const void*,MSVCRT(size_t),MSVCRT(size_t),MSVCRT(FILE)*);
187 int MSVCRT(getc
)(MSVCRT(FILE)*);
188 int MSVCRT(getchar
)(void);
189 char* MSVCRT(gets
)(char*);
190 void MSVCRT(perror
)(const char*);
191 int MSVCRT(printf
)(const char*,...);
192 int MSVCRT(putc
)(int,MSVCRT(FILE)*);
193 int MSVCRT(putchar
)(int);
194 int MSVCRT(puts
)(const char*);
195 int MSVCRT(remove
)(const char*);
196 int MSVCRT(rename
)(const char*,const char*);
197 void MSVCRT(rewind
)(MSVCRT(FILE)*);
198 int MSVCRT(scanf
)(const char*,...);
199 void MSVCRT(setbuf
)(MSVCRT(FILE)*,char*);
200 int MSVCRT(setvbuf
)(MSVCRT(FILE)*,char*,int,MSVCRT(size_t));
201 int MSVCRT(sprintf
)(char*,const char*,...);
202 int MSVCRT(sscanf
)(const char*,const char*,...);
203 MSVCRT(FILE)* MSVCRT(tmpfile
)(void);
204 char* MSVCRT(tmpnam
)(char*);
205 int MSVCRT(ungetc
)(int,MSVCRT(FILE)*);
206 int MSVCRT(vfprintf
)(MSVCRT(FILE)*,const char*,va_list);
207 int MSVCRT(vprintf
)(const char*,va_list);
208 int MSVCRT(vsprintf
)(char*,const char*,va_list);
210 #ifndef MSVCRT_WSTDIO_DEFINED
211 #define MSVCRT_WSTDIO_DEFINED
212 MSVCRT(wint_t) _fgetwchar(void);
213 MSVCRT(wint_t) _fputwchar(MSVCRT(wint_t));
214 MSVCRT(wchar_t)*_getws(MSVCRT(wchar_t)*);
215 int _putws(const MSVCRT(wchar_t)*);
216 int _snwprintf(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,...);
217 int _vsnwprintf(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,va_list);
218 MSVCRT(FILE)* _wfdopen(int,const MSVCRT(wchar_t)*);
219 MSVCRT(FILE)* _wfopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
220 MSVCRT(FILE)* _wfreopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
221 MSVCRT(FILE)* _wfsopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,int);
222 void _wperror(const MSVCRT(wchar_t)*);
223 MSVCRT(FILE)* _wpopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
224 int _wremove(const MSVCRT(wchar_t)*);
225 MSVCRT(wchar_t)*_wtempnam(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
226 MSVCRT(wchar_t)*_wtmpnam(MSVCRT(wchar_t)*);
228 MSVCRT(wint_t) MSVCRT(fgetwc
)(MSVCRT(FILE)*);
229 MSVCRT(wchar_t)*MSVCRT(fgetws
)(MSVCRT(wchar_t)*,int,MSVCRT(FILE)*);
230 MSVCRT(wint_t) MSVCRT(fputwc
)(MSVCRT(wint_t),MSVCRT(FILE)*);
231 int MSVCRT(fputws
)(const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
232 int MSVCRT(fwprintf
)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,...);
233 int MSVCRT(fputws
)(const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
234 int MSVCRT(fwscanf
)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,...);
235 MSVCRT(wint_t) MSVCRT(getwc
)(MSVCRT(FILE)*);
236 MSVCRT(wint_t) MSVCRT(getwchar
)(void);
237 MSVCRT(wchar_t)*MSVCRT(getws
)(MSVCRT(wchar_t)*);
238 MSVCRT(wint_t) MSVCRT(putwc
)(MSVCRT(wint_t),MSVCRT(FILE)*);
239 MSVCRT(wint_t) MSVCRT(putwchar
)(MSVCRT(wint_t));
240 int MSVCRT(putws
)(const MSVCRT(wchar_t)*);
241 int MSVCRT(swprintf
)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
242 int MSVCRT(swscanf
)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
243 MSVCRT(wint_t) MSVCRT(ungetwc
)(MSVCRT(wint_t),MSVCRT(FILE)*);
244 int MSVCRT(vfwprintf
)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,va_list);
245 int MSVCRT(vswprintf
)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,va_list);
246 int MSVCRT(vwprintf
)(const MSVCRT(wchar_t)*,va_list);
247 int MSVCRT(wprintf
)(const MSVCRT(wchar_t)*,...);
248 int MSVCRT(wscanf
)(const MSVCRT(wchar_t)*,...);
249 #endif /* MSVCRT_WSTDIO_DEFINED */
251 #endif /* MSVCRT_STDIO_DEFINED */
258 #ifndef USE_MSVCRT_PREFIX
259 #define fdopen _fdopen
260 #define fgetchar _fgetchar
261 #define fileno _fileno
262 #define fputchar _fputchar
263 #define pclose _pclose
265 #define tempnam _tempnam
266 #ifndef MSVCRT_UNLINK_DEFINED
267 static inline int unlink(const char* path
) { return _unlink(path
); }
268 #define MSVCRT_UNLINK_DEFINED
271 #define fgetwchar _fgetwchar
272 #define fputwchar _fputwchar
275 #define wpopen _wpopen
276 #endif /* USE_MSVCRT_PREFIX */
278 #endif /* __WINE_STDIO_H */