kernel: Make sure the file contains data for the ReadFile test.
[wine/multimedia.git] / include / msvcrt / stdio.h
blobb1c8043d1f12a8950879b4e719ef3f5e361afa49
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 #if !defined(_MSC_VER) && !defined(__int64)
15 /* FIXME: not compatible, but needed for __int64 definition */
16 #include <basetsd.h>
17 #endif
19 #ifndef RC_INVOKED
20 #include <stdarg.h>
21 #endif
23 /* file._flag flags */
24 #define _IOREAD 0x0001
25 #define _IOWRT 0x0002
26 #define _IOMYBUF 0x0008
27 #define _IOEOF 0x0010
28 #define _IOERR 0x0020
29 #define _IOSTRG 0x0040
30 #define _IORW 0x0080
32 #ifndef NULL
33 #ifdef __cplusplus
34 #define NULL 0
35 #else
36 #define NULL ((void *)0)
37 #endif
38 #endif
40 #define STDIN_FILENO 0
41 #define STDOUT_FILENO 1
42 #define STDERR_FILENO 2
44 /* more file._flag flags, but these conflict with Unix */
45 #define _IOFBF 0x0000
46 #define _IONBF 0x0004
47 #define _IOLBF 0x0040
49 #define EOF (-1)
50 #define FILENAME_MAX 260
51 #define TMP_MAX 0x7fff
52 #define FOPEN_MAX 20
53 #define L_tmpnam 260
55 #define BUFSIZ 512
57 #ifndef SEEK_SET
58 #define SEEK_SET 0
59 #define SEEK_CUR 1
60 #define SEEK_END 2
61 #endif
63 #ifndef _FILE_DEFINED
64 #define _FILE_DEFINED
65 typedef struct _iobuf
67 char* _ptr;
68 int _cnt;
69 char* _base;
70 int _flag;
71 int _file;
72 int _charbuf;
73 int _bufsiz;
74 char* _tmpfname;
75 } FILE;
76 #endif /* _FILE_DEFINED */
78 #ifndef _FPOS_T_DEFINED
79 typedef __int64 fpos_t;
80 #define _FPOS_T_DEFINED
81 #endif
83 #ifndef _SIZE_T_DEFINED
84 typedef unsigned int size_t;
85 #define _SIZE_T_DEFINED
86 #endif
88 #ifndef _WCHAR_T_DEFINED
89 #define _WCHAR_T_DEFINED
90 #ifndef __cplusplus
91 typedef unsigned short wchar_t;
92 #endif
93 #endif
95 #ifndef _WCTYPE_T_DEFINED
96 typedef unsigned short wint_t;
97 typedef unsigned short wctype_t;
98 #define _WCTYPE_T_DEFINED
99 #endif
101 #ifdef __cplusplus
102 extern "C" {
103 #endif
105 #ifndef _STDIO_DEFINED
106 FILE* __p__iob(void);
107 #define _iob (__p__iob())
108 #endif /* _STDIO_DEFINED */
110 #define stdin (_iob+STDIN_FILENO)
111 #define stdout (_iob+STDOUT_FILENO)
112 #define stderr (_iob+STDERR_FILENO)
114 #ifndef _STDIO_DEFINED
115 #define _STDIO_DEFINED
116 int _fcloseall(void);
117 FILE* _fdopen(int,const char*);
118 int _fgetchar(void);
119 int _filbuf(FILE*);
120 int _fileno(FILE*);
121 int _flsbuf(int,FILE*);
122 int _flushall(void);
123 int _fputchar(int);
124 FILE* _fsopen(const char*,const char*,int);
125 int _getmaxstdio(void);
126 int _getw(FILE*);
127 int _pclose(FILE*);
128 FILE* _popen(const char*,const char*);
129 int _putw(int,FILE*);
130 int _rmtmp(void);
131 int _setmaxstdio(int);
132 int _snprintf(char*,size_t,const char*,...);
133 char* _tempnam(const char*,const char*);
134 int _unlink(const char*);
135 int _vsnprintf(char*,size_t,const char*,va_list);
137 void clearerr(FILE*);
138 int fclose(FILE*);
139 int feof(FILE*);
140 int ferror(FILE*);
141 int fflush(FILE*);
142 int fgetc(FILE*);
143 int fgetpos(FILE*,fpos_t*);
144 char* fgets(char*,int,FILE*);
145 FILE* fopen(const char*,const char*);
146 int fprintf(FILE*,const char*,...);
147 int fputc(int,FILE*);
148 int fputs(const char*,FILE*);
149 size_t fread(void*,size_t,size_t,FILE*);
150 FILE* freopen(const char*,const char*,FILE*);
151 int fscanf(FILE*,const char*,...);
152 int fseek(FILE*,long,int);
153 int fsetpos(FILE*,fpos_t*);
154 long ftell(FILE*);
155 size_t fwrite(const void*,size_t,size_t,FILE*);
156 int getc(FILE*);
157 int getchar(void);
158 char* gets(char*);
159 void perror(const char*);
160 int printf(const char*,...);
161 int putc(int,FILE*);
162 int putchar(int);
163 int puts(const char*);
164 int remove(const char*);
165 int rename(const char*,const char*);
166 void rewind(FILE*);
167 int scanf(const char*,...);
168 void setbuf(FILE*,char*);
169 int setvbuf(FILE*,char*,int,size_t);
170 int sprintf(char*,const char*,...);
171 int sscanf(const char*,const char*,...);
172 FILE* tmpfile(void);
173 char* tmpnam(char*);
174 int ungetc(int,FILE*);
175 int vfprintf(FILE*,const char*,va_list);
176 int vprintf(const char*,va_list);
177 int vsprintf(char*,const char*,va_list);
179 #ifndef _WSTDIO_DEFINED
180 #define _WSTDIO_DEFINED
181 wint_t _fgetwchar(void);
182 wint_t _fputwchar(wint_t);
183 wchar_t*_getws(wchar_t*);
184 int _putws(const wchar_t*);
185 int _snwprintf(wchar_t*,size_t,const wchar_t*,...);
186 int _vsnwprintf(wchar_t*,size_t,const wchar_t*,va_list);
187 FILE* _wfdopen(int,const wchar_t*);
188 FILE* _wfopen(const wchar_t*,const wchar_t*);
189 FILE* _wfreopen(const wchar_t*,const wchar_t*,FILE*);
190 FILE* _wfsopen(const wchar_t*,const wchar_t*,int);
191 void _wperror(const wchar_t*);
192 FILE* _wpopen(const wchar_t*,const wchar_t*);
193 int _wremove(const wchar_t*);
194 wchar_t*_wtempnam(const wchar_t*,const wchar_t*);
195 wchar_t*_wtmpnam(wchar_t*);
197 wint_t fgetwc(FILE*);
198 wchar_t*fgetws(wchar_t*,int,FILE*);
199 wint_t fputwc(wint_t,FILE*);
200 int fputws(const wchar_t*,FILE*);
201 int fwprintf(FILE*,const wchar_t*,...);
202 int fputws(const wchar_t*,FILE*);
203 int fwscanf(FILE*,const wchar_t*,...);
204 wint_t getwc(FILE*);
205 wint_t getwchar(void);
206 wchar_t*getws(wchar_t*);
207 wint_t putwc(wint_t,FILE*);
208 wint_t putwchar(wint_t);
209 int putws(const wchar_t*);
210 int swprintf(wchar_t*,const wchar_t*,...);
211 int swscanf(const wchar_t*,const wchar_t*,...);
212 wint_t ungetwc(wint_t,FILE*);
213 int vfwprintf(FILE*,const wchar_t*,va_list);
214 int vswprintf(wchar_t*,const wchar_t*,va_list);
215 int vwprintf(const wchar_t*,va_list);
216 int wprintf(const wchar_t*,...);
217 int wscanf(const wchar_t*,...);
218 #endif /* _WSTDIO_DEFINED */
220 #endif /* _STDIO_DEFINED */
222 #ifdef __cplusplus
224 #endif
227 static inline FILE* fdopen(int fd, const char *mode) { return _fdopen(fd, mode); }
228 static inline int fgetchar(void) { return _fgetchar(); }
229 static inline int fileno(FILE* file) { return _fileno(file); }
230 static inline int fputchar(int c) { return _fputchar(c); }
231 static inline int pclose(FILE* file) { return _pclose(file); }
232 static inline FILE* popen(const char* command, const char* mode) { return _popen(command, mode); }
233 static inline char* tempnam(const char *dir, const char *prefix) { return _tempnam(dir, prefix); }
234 #ifndef _UNLINK_DEFINED
235 static inline int unlink(const char* path) { return _unlink(path); }
236 #define _UNLINK_DEFINED
237 #endif
238 static inline int vsnprintf(char *buffer, size_t size, const char *format, va_list args) { return _vsnprintf(buffer,size,format,args); }
240 static inline wint_t fgetwchar(void) { return _fgetwchar(); }
241 static inline wint_t fputwchar(wint_t wc) { return _fputwchar(wc); }
242 static inline int getw(FILE* file) { return _getw(file); }
243 static inline int putw(int val, FILE* file) { return _putw(val, file); }
244 static inline FILE* wpopen(const wchar_t* command,const wchar_t* mode) { return _wpopen(command, mode); }
246 #endif /* __WINE_STDIO_H */