winex11.drv: Move WGL extension code to winex11.drv.
[wine/testsucceed.git] / include / msvcrt / stdio.h
blobbc58de382db963fb8a60ba3c653cb01d41624cb0
1 /*
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.
7 */
8 #ifndef __WINE_STDIO_H
9 #define __WINE_STDIO_H
10 #ifndef __WINE_USE_MSVCRT
11 #define __WINE_USE_MSVCRT
12 #endif
14 #ifndef RC_INVOKED
15 #include <stdarg.h>
16 #endif
18 #if !defined(_MSC_VER) && !defined(__int64)
19 #define __int64 long long
20 #endif
22 /* file._flag flags */
23 #define _IOREAD 0x0001
24 #define _IOWRT 0x0002
25 #define _IOMYBUF 0x0008
26 #define _IOEOF 0x0010
27 #define _IOERR 0x0020
28 #define _IOSTRG 0x0040
29 #define _IORW 0x0080
31 #ifndef NULL
32 #ifdef __cplusplus
33 #define NULL 0
34 #else
35 #define NULL ((void *)0)
36 #endif
37 #endif
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 */
44 #define _IOFBF 0x0000
45 #define _IONBF 0x0004
46 #define _IOLBF 0x0040
48 #define EOF (-1)
49 #define FILENAME_MAX 260
50 #define TMP_MAX 0x7fff
51 #define FOPEN_MAX 20
52 #define L_tmpnam 260
54 #define BUFSIZ 512
56 #ifndef SEEK_SET
57 #define SEEK_SET 0
58 #define SEEK_CUR 1
59 #define SEEK_END 2
60 #endif
62 #ifndef _FILE_DEFINED
63 #define _FILE_DEFINED
64 typedef struct _iobuf
66 char* _ptr;
67 int _cnt;
68 char* _base;
69 int _flag;
70 int _file;
71 int _charbuf;
72 int _bufsiz;
73 char* _tmpfname;
74 } FILE;
75 #endif /* _FILE_DEFINED */
77 #ifndef _FPOS_T_DEFINED
78 typedef __int64 fpos_t;
79 #define _FPOS_T_DEFINED
80 #endif
82 #ifndef _SIZE_T_DEFINED
83 #ifdef _WIN64
84 typedef unsigned __int64 size_t;
85 #else
86 typedef unsigned int size_t;
87 #endif
88 #define _SIZE_T_DEFINED
89 #endif
91 #ifndef _WCHAR_T_DEFINED
92 #define _WCHAR_T_DEFINED
93 #ifndef __cplusplus
94 typedef unsigned short wchar_t;
95 #endif
96 #endif
98 #ifndef _WCTYPE_T_DEFINED
99 typedef unsigned short wint_t;
100 typedef unsigned short wctype_t;
101 #define _WCTYPE_T_DEFINED
102 #endif
104 #ifdef __cplusplus
105 extern "C" {
106 #endif
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*);
121 int _fgetchar(void);
122 int _filbuf(FILE*);
123 int _fileno(FILE*);
124 int _flsbuf(int,FILE*);
125 int _flushall(void);
126 int _fputchar(int);
127 FILE* _fsopen(const char*,const char*,int);
128 int _getmaxstdio(void);
129 int _getw(FILE*);
130 int _pclose(FILE*);
131 FILE* _popen(const char*,const char*);
132 int _putw(int,FILE*);
133 int _rmtmp(void);
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*);
141 int fclose(FILE*);
142 int feof(FILE*);
143 int ferror(FILE*);
144 int fflush(FILE*);
145 int fgetc(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*);
157 long ftell(FILE*);
158 size_t fwrite(const void*,size_t,size_t,FILE*);
159 int getc(FILE*);
160 int getchar(void);
161 char* gets(char*);
162 void perror(const char*);
163 int printf(const char*,...);
164 int putc(int,FILE*);
165 int putchar(int);
166 int puts(const char*);
167 int remove(const char*);
168 int rename(const char*,const char*);
169 void rewind(FILE*);
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*,...);
175 FILE* tmpfile(void);
176 char* tmpnam(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*,...);
207 wint_t getwc(FILE*);
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 */
225 #ifdef __cplusplus
227 #endif
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
240 #endif
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 */