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