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 #ifndef _STDIO_DEFINED
98 #define _STDIO_DEFINED
99 int __cdecl
_fcloseall(void);
100 FILE* __cdecl
_fdopen(int,const char*);
101 int __cdecl
_fgetchar(void);
102 int __cdecl
_filbuf(FILE*);
103 int __cdecl
_fileno(FILE*);
104 int __cdecl
_flsbuf(int,FILE*);
105 int __cdecl
_flushall(void);
106 int __cdecl
_fputchar(int);
107 FILE* __cdecl
_fsopen(const char*,const char*,int);
108 int __cdecl
_getmaxstdio(void);
109 int __cdecl
_getw(FILE*);
110 int __cdecl
_pclose(FILE*);
111 FILE* __cdecl
_popen(const char*,const char*);
112 int __cdecl
_putw(int,FILE*);
113 int __cdecl
_rmtmp(void);
114 int __cdecl
_setmaxstdio(int);
115 int __cdecl
_snprintf(char*,size_t,const char*,...);
116 char* __cdecl
_tempnam(const char*,const char*);
117 int __cdecl
_unlink(const char*);
118 int __cdecl
_vscprintf(const char*,__ms_va_list
);
119 int __cdecl
_vsnprintf(char*,size_t,const char*,__ms_va_list
);
121 void __cdecl
clearerr(FILE*);
122 int __cdecl
fclose(FILE*);
123 int __cdecl
feof(FILE*);
124 int __cdecl
ferror(FILE*);
125 int __cdecl
fflush(FILE*);
126 int __cdecl
fgetc(FILE*);
127 int __cdecl
fgetpos(FILE*,fpos_t*);
128 char* __cdecl
fgets(char*,int,FILE*);
129 FILE* __cdecl
fopen(const char*,const char*);
130 int __cdecl
fprintf(FILE*,const char*,...);
131 int __cdecl
fputc(int,FILE*);
132 int __cdecl
fputs(const char*,FILE*);
133 size_t __cdecl
fread(void*,size_t,size_t,FILE*);
134 FILE* __cdecl
freopen(const char*,const char*,FILE*);
135 int __cdecl
fscanf(FILE*,const char*,...);
136 int __cdecl
fseek(FILE*,__msvcrt_long
,int);
137 int __cdecl
fsetpos(FILE*,fpos_t*);
138 __msvcrt_long __cdecl
ftell(FILE*);
139 size_t __cdecl
fwrite(const void*,size_t,size_t,FILE*);
140 int __cdecl
getc(FILE*);
141 int __cdecl
getchar(void);
142 char* __cdecl
gets(char*);
143 void __cdecl
perror(const char*);
144 int __cdecl
printf(const char*,...);
145 int __cdecl
putc(int,FILE*);
146 int __cdecl
putchar(int);
147 int __cdecl
puts(const char*);
148 int __cdecl
remove(const char*);
149 int __cdecl
rename(const char*,const char*);
150 void __cdecl
rewind(FILE*);
151 int __cdecl
scanf(const char*,...);
152 void __cdecl
setbuf(FILE*,char*);
153 int __cdecl
setvbuf(FILE*,char*,int,size_t);
154 int __cdecl
sprintf(char*,const char*,...);
155 int __cdecl
sscanf(const char*,const char*,...);
156 FILE* __cdecl
tmpfile(void);
157 char* __cdecl
tmpnam(char*);
158 int __cdecl
ungetc(int,FILE*);
159 int __cdecl
vfprintf(FILE*,const char*,__ms_va_list
);
160 int __cdecl
vprintf(const char*,__ms_va_list
);
161 int __cdecl
vsprintf(char*,const char*,__ms_va_list
);
163 #ifndef _WSTDIO_DEFINED
164 #define _WSTDIO_DEFINED
165 wint_t __cdecl
_fgetwchar(void);
166 wint_t __cdecl
_fputwchar(wint_t);
167 wchar_t* __cdecl
_getws(wchar_t*);
168 int __cdecl
_putws(const wchar_t*);
169 int __cdecl
_snwprintf(wchar_t*,size_t,const wchar_t*,...);
170 int __cdecl
_vscwprintf(const wchar_t*,__ms_va_list
);
171 int __cdecl
_vsnwprintf(wchar_t*,size_t,const wchar_t*,__ms_va_list
);
172 FILE* __cdecl
_wfdopen(int,const wchar_t*);
173 FILE* __cdecl
_wfopen(const wchar_t*,const wchar_t*);
174 FILE* __cdecl
_wfreopen(const wchar_t*,const wchar_t*,FILE*);
175 FILE* __cdecl
_wfsopen(const wchar_t*,const wchar_t*,int);
176 void __cdecl
_wperror(const wchar_t*);
177 FILE* __cdecl
_wpopen(const wchar_t*,const wchar_t*);
178 int __cdecl
_wremove(const wchar_t*);
179 wchar_t* __cdecl
_wtempnam(const wchar_t*,const wchar_t*);
180 wchar_t* __cdecl
_wtmpnam(wchar_t*);
182 wint_t __cdecl
fgetwc(FILE*);
183 wchar_t* __cdecl
fgetws(wchar_t*,int,FILE*);
184 wint_t __cdecl
fputwc(wint_t,FILE*);
185 int __cdecl
fputws(const wchar_t*,FILE*);
186 int __cdecl
fwprintf(FILE*,const wchar_t*,...);
187 int __cdecl
fputws(const wchar_t*,FILE*);
188 int __cdecl
fwscanf(FILE*,const wchar_t*,...);
189 wint_t __cdecl
getwc(FILE*);
190 wint_t __cdecl
getwchar(void);
191 wchar_t* __cdecl
getws(wchar_t*);
192 wint_t __cdecl
putwc(wint_t,FILE*);
193 wint_t __cdecl
putwchar(wint_t);
194 int __cdecl
putws(const wchar_t*);
195 int __cdecl
swprintf(wchar_t*,const wchar_t*,...);
196 int __cdecl
swscanf(const wchar_t*,const wchar_t*,...);
197 wint_t __cdecl
ungetwc(wint_t,FILE*);
198 int __cdecl
vfwprintf(FILE*,const wchar_t*,__ms_va_list
);
199 int __cdecl
vswprintf(wchar_t*,const wchar_t*,__ms_va_list
);
200 int __cdecl
vwprintf(const wchar_t*,__ms_va_list
);
201 int __cdecl
wprintf(const wchar_t*,...);
202 int __cdecl
wscanf(const wchar_t*,...);
203 #endif /* _WSTDIO_DEFINED */
205 #endif /* _STDIO_DEFINED */
212 static inline FILE* fdopen(int fd
, const char *mode
) { return _fdopen(fd
, mode
); }
213 static inline int fgetchar(void) { return _fgetchar(); }
214 static inline int fileno(FILE* file
) { return _fileno(file
); }
215 static inline int fputchar(int c
) { return _fputchar(c
); }
216 static inline int pclose(FILE* file
) { return _pclose(file
); }
217 static inline FILE* popen(const char* command
, const char* mode
) { return _popen(command
, mode
); }
218 static inline char* tempnam(const char *dir
, const char *prefix
) { return _tempnam(dir
, prefix
); }
219 #ifndef _UNLINK_DEFINED
220 static inline int unlink(const char* path
) { return _unlink(path
); }
221 #define _UNLINK_DEFINED
223 static inline int vsnprintf(char *buffer
, size_t size
, const char *format
, __ms_va_list args
) { return _vsnprintf(buffer
,size
,format
,args
); }
225 static inline wint_t fgetwchar(void) { return _fgetwchar(); }
226 static inline wint_t fputwchar(wint_t wc
) { return _fputwchar(wc
); }
227 static inline int getw(FILE* file
) { return _getw(file
); }
228 static inline int putw(int val
, FILE* file
) { return _putw(val
, file
); }
229 static inline FILE* wpopen(const wchar_t* command
,const wchar_t* mode
) { return _wpopen(command
, mode
); }
233 #endif /* __WINE_STDIO_H */