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