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 #ifndef __WINE_USE_MSVCRT
11 #define __WINE_USE_MSVCRT
18 #if !defined(_MSC_VER) && !defined(__int64)
19 #define __int64 long long
22 /* file._flag flags */
23 #define _IOREAD 0x0001
25 #define _IOMYBUF 0x0008
28 #define _IOSTRG 0x0040
35 #define NULL ((void *)0)
39 #define STDIN_FILENO 0
40 #define STDOUT_FILENO 1
41 #define STDERR_FILENO 2
43 /* more file._flag flags, but these conflict with Unix */
49 #define FILENAME_MAX 260
50 #define TMP_MAX 0x7fff
75 #endif /* _FILE_DEFINED */
77 #ifndef _FPOS_T_DEFINED
78 typedef __int64
fpos_t;
79 #define _FPOS_T_DEFINED
82 #ifndef _SIZE_T_DEFINED
84 typedef unsigned __int64
size_t;
86 typedef unsigned int size_t;
88 #define _SIZE_T_DEFINED
91 #ifndef _WCHAR_T_DEFINED
92 #define _WCHAR_T_DEFINED
94 typedef unsigned short wchar_t;
98 #ifndef _WCTYPE_T_DEFINED
99 typedef unsigned short wint_t;
100 typedef unsigned short wctype_t;
101 #define _WCTYPE_T_DEFINED
108 #ifndef _STDIO_DEFINED
109 FILE* __p__iob(void);
110 #define _iob (__p__iob())
111 #endif /* _STDIO_DEFINED */
113 #define stdin (_iob+STDIN_FILENO)
114 #define stdout (_iob+STDOUT_FILENO)
115 #define stderr (_iob+STDERR_FILENO)
117 #ifndef _STDIO_DEFINED
118 #define _STDIO_DEFINED
119 int _fcloseall(void);
120 FILE* _fdopen(int,const char*);
124 int _flsbuf(int,FILE*);
127 FILE* _fsopen(const char*,const char*,int);
128 int _getmaxstdio(void);
131 FILE* _popen(const char*,const char*);
132 int _putw(int,FILE*);
134 int _setmaxstdio(int);
135 int _snprintf(char*,size_t,const char*,...);
136 char* _tempnam(const char*,const char*);
137 int _unlink(const char*);
138 int _vsnprintf(char*,size_t,const char*,va_list);
140 void clearerr(FILE*);
146 int fgetpos(FILE*,fpos_t*);
147 char* fgets(char*,int,FILE*);
148 FILE* fopen(const char*,const char*);
149 int fprintf(FILE*,const char*,...);
150 int fputc(int,FILE*);
151 int fputs(const char*,FILE*);
152 size_t fread(void*,size_t,size_t,FILE*);
153 FILE* freopen(const char*,const char*,FILE*);
154 int fscanf(FILE*,const char*,...);
155 int fseek(FILE*,long,int);
156 int fsetpos(FILE*,fpos_t*);
158 size_t fwrite(const void*,size_t,size_t,FILE*);
162 void perror(const char*);
163 int printf(const char*,...);
166 int puts(const char*);
167 int remove(const char*);
168 int rename(const char*,const char*);
170 int scanf(const char*,...);
171 void setbuf(FILE*,char*);
172 int setvbuf(FILE*,char*,int,size_t);
173 int sprintf(char*,const char*,...);
174 int sscanf(const char*,const char*,...);
177 int ungetc(int,FILE*);
178 int vfprintf(FILE*,const char*,va_list);
179 int vprintf(const char*,va_list);
180 int vsprintf(char*,const char*,va_list);
182 #ifndef _WSTDIO_DEFINED
183 #define _WSTDIO_DEFINED
184 wint_t _fgetwchar(void);
185 wint_t _fputwchar(wint_t);
186 wchar_t*_getws(wchar_t*);
187 int _putws(const wchar_t*);
188 int _snwprintf(wchar_t*,size_t,const wchar_t*,...);
189 int _vsnwprintf(wchar_t*,size_t,const wchar_t*,va_list);
190 FILE* _wfdopen(int,const wchar_t*);
191 FILE* _wfopen(const wchar_t*,const wchar_t*);
192 FILE* _wfreopen(const wchar_t*,const wchar_t*,FILE*);
193 FILE* _wfsopen(const wchar_t*,const wchar_t*,int);
194 void _wperror(const wchar_t*);
195 FILE* _wpopen(const wchar_t*,const wchar_t*);
196 int _wremove(const wchar_t*);
197 wchar_t*_wtempnam(const wchar_t*,const wchar_t*);
198 wchar_t*_wtmpnam(wchar_t*);
200 wint_t fgetwc(FILE*);
201 wchar_t*fgetws(wchar_t*,int,FILE*);
202 wint_t fputwc(wint_t,FILE*);
203 int fputws(const wchar_t*,FILE*);
204 int fwprintf(FILE*,const wchar_t*,...);
205 int fputws(const wchar_t*,FILE*);
206 int fwscanf(FILE*,const wchar_t*,...);
208 wint_t getwchar(void);
209 wchar_t*getws(wchar_t*);
210 wint_t putwc(wint_t,FILE*);
211 wint_t putwchar(wint_t);
212 int putws(const wchar_t*);
213 int swprintf(wchar_t*,const wchar_t*,...);
214 int swscanf(const wchar_t*,const wchar_t*,...);
215 wint_t ungetwc(wint_t,FILE*);
216 int vfwprintf(FILE*,const wchar_t*,va_list);
217 int vswprintf(wchar_t*,const wchar_t*,va_list);
218 int vwprintf(const wchar_t*,va_list);
219 int wprintf(const wchar_t*,...);
220 int wscanf(const wchar_t*,...);
221 #endif /* _WSTDIO_DEFINED */
223 #endif /* _STDIO_DEFINED */
230 static inline FILE* fdopen(int fd
, const char *mode
) { return _fdopen(fd
, mode
); }
231 static inline int fgetchar(void) { return _fgetchar(); }
232 static inline int fileno(FILE* file
) { return _fileno(file
); }
233 static inline int fputchar(int c
) { return _fputchar(c
); }
234 static inline int pclose(FILE* file
) { return _pclose(file
); }
235 static inline FILE* popen(const char* command
, const char* mode
) { return _popen(command
, mode
); }
236 static inline char* tempnam(const char *dir
, const char *prefix
) { return _tempnam(dir
, prefix
); }
237 #ifndef _UNLINK_DEFINED
238 static inline int unlink(const char* path
) { return _unlink(path
); }
239 #define _UNLINK_DEFINED
241 static inline int vsnprintf(char *buffer
, size_t size
, const char *format
, va_list args
) { return _vsnprintf(buffer
,size
,format
,args
); }
243 static inline wint_t fgetwchar(void) { return _fgetwchar(); }
244 static inline wint_t fputwchar(wint_t wc
) { return _fputwchar(wc
); }
245 static inline int getw(FILE* file
) { return _getw(file
); }
246 static inline int putw(int val
, FILE* file
) { return _putw(val
, file
); }
247 static inline FILE* wpopen(const wchar_t* command
,const wchar_t* mode
) { return _wpopen(command
, mode
); }
249 #endif /* __WINE_STDIO_H */