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.
14 #include "msvcrt/wctype.h" /* For wint_t */
17 /* file._flag flags */
18 #define _IOREAD 0x0001
20 #define _IOMYBUF 0x0008
23 #define _IOSTRG 0x0040
25 #define _IOAPPEND 0x0200
28 #ifndef USE_MSVCRT_PREFIX
30 #define STDIN_FILENO 0
31 #define STDOUT_FILENO 1
32 #define STDERR_FILENO 2
34 /* more file._flag flags, but these conflict with Unix */
40 #define FILENAME_MAX 260
54 /* more file._flag flags, but these conflict with Unix */
55 #define MSVCRT__IOFBF 0x0000
56 #define MSVCRT__IONBF 0x0004
57 #define MSVCRT__IOLBF 0x0040
59 #define MSVCRT_FILENAME_MAX 260
61 #define MSVCRT_EOF (-1)
63 #endif /* USE_MSVCRT_PREFIX */
65 typedef struct MSVCRT(_iobuf)
77 typedef long MSVCRT(fpos_t);
79 #ifndef MSVCRT_SIZE_T_DEFINED
80 typedef unsigned int MSVCRT(size_t);
81 #define MSVCRT_SIZE_T_DEFINED
89 MSVCRT(FILE)* MSVCRT(__p__iob)(void);
90 #define _iob (__p__iob())
91 #ifndef USE_MSVCRT_PREFIX
92 #define stdin (_iob+STDIN_FILENO)
93 #define stdout (_iob+STDOUT_FILENO)
94 #define stderr (_iob+STDERR_FILENO)
95 #elif !defined(__WINE__)
96 #define MSVCRT_stdin (_iob+STDIN_FILENO)
97 #define MSVCRT_stdout (_iob+STDOUT_FILENO)
98 #define MSVCRT_stderr (_iob+STDERR_FILENO)
99 #endif /* USE_MSVCRT_PREFIX, __WINE__ */
102 int _fcloseall(void);
103 MSVCRT(FILE)* _fdopen(int,const char*);
105 int _filbuf(MSVCRT(FILE*));
106 int _fileno(MSVCRT(FILE)*);
107 int _flsbuf(int,MSVCRT(FILE)*);
110 MSVCRT(FILE)* _fsopen(const char*,const char*,int);
111 int _getmaxstdio(void);
112 int _getw(MSVCRT(FILE)*);
113 int _pclose(MSVCRT(FILE)*);
114 MSVCRT(FILE)* _popen(const char*,const char*);
115 int _putw(int,MSVCRT(FILE)*);
117 int _setmaxstdio(int);
118 int _snprintf(char*,MSVCRT(size_t),const char*,...);
119 char* _tempnam(const char*,const char*);
120 int _unlink(const char*);
121 int _vsnprintf(char*,MSVCRT(size_t),const char*,va_list);
123 void MSVCRT(clearerr)(MSVCRT(FILE)*);
124 int MSVCRT(fclose)(MSVCRT(FILE)*);
125 int MSVCRT(feof)(MSVCRT(FILE)*);
126 int MSVCRT(ferror)(MSVCRT(FILE)*);
127 int MSVCRT(fflush)(MSVCRT(FILE)*);
128 int MSVCRT(fgetc)(MSVCRT(FILE)*);
129 int MSVCRT(fgetpos)(MSVCRT(FILE)*,MSVCRT(fpos_t)*);
130 char* MSVCRT(fgets)(char*,int,MSVCRT(FILE)*);
131 MSVCRT(FILE)* MSVCRT(fopen)(const char*,const char*);
132 int MSVCRT(fprintf)(MSVCRT(FILE)*,const char*,...);
133 int MSVCRT(fputc)(int,MSVCRT(FILE)*);
134 int MSVCRT(fputs)(const char*,MSVCRT(FILE)*);
135 MSVCRT(size_t) MSVCRT(fread)(void*,MSVCRT(size_t),MSVCRT(size_t),MSVCRT(FILE)*);
136 MSVCRT(FILE)* MSVCRT(freopen)(const char*,const char*,MSVCRT(FILE)*);
137 int MSVCRT(fscanf)(MSVCRT(FILE)*,const char*,...);
138 int MSVCRT(fseek)(MSVCRT(FILE)*,long,int);
139 int MSVCRT(fsetpos)(MSVCRT(FILE)*,MSVCRT(fpos_t)*);
140 long MSVCRT(ftell)(MSVCRT(FILE)*);
141 MSVCRT(size_t) MSVCRT(fwrite)(const void*,MSVCRT(size_t),MSVCRT(size_t),MSVCRT(FILE)*);
142 int MSVCRT(getc)(MSVCRT(FILE)*);
143 int MSVCRT(getchar)(void);
144 char* MSVCRT(gets)(char*);
145 void MSVCRT(perror)(const char*);
146 int MSVCRT(printf)(const char*,...);
147 int MSVCRT(putc)(int,MSVCRT(FILE)*);
148 int MSVCRT(putchar)(int);
149 int MSVCRT(puts)(const char*);
150 int MSVCRT(remove)(const char*);
151 int MSVCRT(rename)(const char*,const char*);
152 void MSVCRT(rewind)(MSVCRT(FILE)*);
153 int MSVCRT(scanf)(const char*,...);
154 void MSVCRT(setbuf)(MSVCRT(FILE)*,char*);
155 int MSVCRT(setvbuf)(MSVCRT(FILE)*,char*,int,MSVCRT(size_t));
156 int MSVCRT(sprintf)(char*,const char*,...);
157 int MSVCRT(sscanf)(const char*,const char*,...);
158 MSVCRT(FILE)* MSVCRT(tmpfile)(void);
159 char* MSVCRT(tmpnam)(char*);
160 int MSVCRT(ungetc)(int,MSVCRT(FILE)*);
161 int MSVCRT(vfprintf)(MSVCRT(FILE)*,const char*,va_list);
162 int MSVCRT(vprintf)(const char*,va_list);
163 int MSVCRT(vsprintf)(char*,const char*,va_list);
165 MSVCRT(wint_t) _fgetwchar(void);
166 MSVCRT(wint_t) _fputwchar(MSVCRT(wint_t));
167 WCHAR* _getws(WCHAR*);
168 int _putws(const WCHAR*);
169 int _snwprintf(WCHAR*,MSVCRT(size_t),const WCHAR*,...);
170 int _vsnwprintf(WCHAR*,MSVCRT(size_t),const WCHAR*,va_list);
171 MSVCRT(FILE)* _wfdopen(int,const WCHAR*);
172 MSVCRT(FILE)* _wfopen(const WCHAR*,const WCHAR*);
173 MSVCRT(FILE)* _wfreopen(const WCHAR*,const WCHAR*,MSVCRT(FILE)*);
174 MSVCRT(FILE)* _wfsopen(const WCHAR*,const WCHAR*,int);
175 void _wperror(const WCHAR*);
176 MSVCRT(FILE)* _wpopen(const WCHAR*,const WCHAR*);
177 int _wremove(const WCHAR*);
178 WCHAR* _wtempnam(const WCHAR*,const WCHAR*);
179 WCHAR* _wtmpnam(WCHAR*);
181 MSVCRT(wint_t) MSVCRT(fgetwc)(MSVCRT(FILE)*);
182 WCHAR* MSVCRT(fgetws)(WCHAR*,int,MSVCRT(FILE)*);
183 MSVCRT(wint_t) MSVCRT(fputwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
184 int MSVCRT(fputws)(const WCHAR*,MSVCRT(FILE)*);
185 int MSVCRT(fwprintf)(MSVCRT(FILE)*,const WCHAR*,...);
186 int MSVCRT(fputws)(const WCHAR*,MSVCRT(FILE)*);
187 int MSVCRT(fwscanf)(MSVCRT(FILE)*,const WCHAR*,...);
188 MSVCRT(wint_t) MSVCRT(getwc)(MSVCRT(FILE)*);
189 MSVCRT(wint_t) MSVCRT(getwchar)(void);
190 WCHAR* MSVCRT(getws)(WCHAR*);
191 MSVCRT(wint_t) MSVCRT(putwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
192 MSVCRT(wint_t) MSVCRT(putwchar)(MSVCRT(wint_t));
193 int MSVCRT(putws)(const WCHAR*);
194 int MSVCRT(swprintf)(WCHAR*,const WCHAR*,...);
195 int MSVCRT(swscanf)(WCHAR*,const WCHAR*,...);
196 MSVCRT(wint_t) MSVCRT(ungetwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
197 int MSVCRT(vfwprintf)(MSVCRT(FILE)*,const WCHAR*,va_list);
198 int MSVCRT(vswprintf)(WCHAR*,const WCHAR*,va_list);
199 int MSVCRT(vwprintf)(const WCHAR*,va_list);
200 int MSVCRT(wprintf)(const WCHAR*,...);
201 int MSVCRT(wscanf)(const WCHAR*,...);
208 #ifndef USE_MSVCRT_PREFIX
209 #define fdopen _fdopen
210 #define fgetchar _fgetchar
211 #define fileno _fileno
212 #define fputchar _fputchar
213 #define pclose _pclose
215 #define tempnam _tempnam
216 #define unlink _unlink
218 #define fgetwchar _fgetwchar
219 #define fputwchar _fputwchar
222 #define wpopen _wpopen
223 #endif /* USE_MSVCRT_PREFIX */
225 #endif /* __WINE_STDIO_H */