Enhanced robustness at startup.
[wine.git] / include / msvcrt / stdio.h
blobef51591dd32c6b801dd1748165fd3c4f05731935
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
11 #include <stdarg.h>
12 #include "msvcrt/wctype.h" /* For wint_t */
15 /* file._flag flags */
16 #define _IOREAD 0x0001
17 #define _IOWRT 0x0002
18 #define _IOMYBUF 0x0008
19 #define _IOEOF 0x0010
20 #define _IOERR 0x0020
21 #define _IOSTRG 0x0040
22 #define _IORW 0x0080
23 #define _IOAPPEND 0x0200
26 #ifndef USE_MSVCRT_PREFIX
28 #define STDIN_FILENO 0
29 #define STDOUT_FILENO 1
30 #define STDERR_FILENO 2
32 /* more file._flag flags, but these conflict with Unix */
33 #define _IOFBF 0x0000
34 #define _IONBF 0x0004
35 #define _IOLBF 0x0040
37 #define EOF (-1)
38 #define FILENAME_MAX 260
39 #define FOPEN_MAX 20
40 #define L_tmpnam 260
42 #define BUFSIZ 512
44 #ifndef SEEK_SET
45 #define SEEK_SET 0
46 #define SEEK_CUR 1
47 #define SEEK_END 2
48 #endif
50 #else
52 /* more file._flag flags, but these conflict with Unix */
53 #define MSVCRT__IOFBF 0x0000
54 #define MSVCRT__IONBF 0x0004
55 #define MSVCRT__IOLBF 0x0040
57 #define MSVCRT_FILENAME_MAX 260
59 #define MSVCRT_EOF (-1)
61 #endif /* USE_MSVCRT_PREFIX */
63 typedef struct MSVCRT(_iobuf)
65 char* _ptr;
66 int _cnt;
67 char* _base;
68 int _flag;
69 int _file;
70 int _charbuf;
71 int _bufsiz;
72 char* _tmpfname;
73 } MSVCRT(FILE);
75 typedef long MSVCRT(fpos_t);
77 #ifndef MSVCRT_SIZE_T_DEFINED
78 typedef unsigned int MSVCRT(size_t);
79 #define MSVCRT_SIZE_T_DEFINED
80 #endif
83 #ifdef __cplusplus
84 extern "C" {
85 #endif
87 MSVCRT(FILE)* MSVCRT(__p__iob)(void);
88 #define _iob (__p__iob())
89 #ifndef USE_MSVCRT_PREFIX
90 #define stdin (_iob+STDIN_FILENO)
91 #define stdout (_iob+STDOUT_FILENO)
92 #define stderr (_iob+STDERR_FILENO)
93 #elif !defined(__WINE__)
94 #define MSVCRT_stdin (_iob+STDIN_FILENO)
95 #define MSVCRT_stdout (_iob+STDOUT_FILENO)
96 #define MSVCRT_stderr (_iob+STDERR_FILENO)
97 #endif /* USE_MSVCRT_PREFIX, __WINE__ */
100 int _fcloseall(void);
101 MSVCRT(FILE)* _fdopen(int,const char*);
102 int _fgetchar(void);
103 int _filbuf(MSVCRT(FILE*));
104 int _fileno(MSVCRT(FILE)*);
105 int _flsbuf(int,MSVCRT(FILE)*);
106 int _flushall(void);
107 int _fputchar(int);
108 MSVCRT(FILE)* _fsopen(const char*,const char*,int);
109 int _getmaxstdio(void);
110 int _getw(MSVCRT(FILE)*);
111 int _pclose(MSVCRT(FILE)*);
112 MSVCRT(FILE)* _popen(const char*,const char*);
113 int _putw(int,MSVCRT(FILE)*);
114 int _rmtmp(void);
115 int _setmaxstdio(int);
116 int _snprintf(char*,MSVCRT(size_t),const char*,...);
117 char* _tempnam(const char*,const char*);
118 int _unlink(const char*);
119 int _vsnprintf(char*,MSVCRT(size_t),const char*,va_list);
121 void MSVCRT(clearerr)(MSVCRT(FILE)*);
122 int MSVCRT(fclose)(MSVCRT(FILE)*);
123 int MSVCRT(feof)(MSVCRT(FILE)*);
124 int MSVCRT(ferror)(MSVCRT(FILE)*);
125 int MSVCRT(fflush)(MSVCRT(FILE)*);
126 int MSVCRT(fgetc)(MSVCRT(FILE)*);
127 int MSVCRT(fgetpos)(MSVCRT(FILE)*,MSVCRT(fpos_t)*);
128 char* MSVCRT(fgets)(char*,int,MSVCRT(FILE)*);
129 MSVCRT(FILE)* MSVCRT(fopen)(const char*,const char*);
130 int MSVCRT(fprintf)(MSVCRT(FILE)*,const char*,...);
131 int MSVCRT(fputc)(int,MSVCRT(FILE)*);
132 int MSVCRT(fputs)(const char*,MSVCRT(FILE)*);
133 MSVCRT(size_t) MSVCRT(fread)(void*,MSVCRT(size_t),MSVCRT(size_t),MSVCRT(FILE)*);
134 MSVCRT(FILE)* MSVCRT(freopen)(const char*,const char*,MSVCRT(FILE)*);
135 int MSVCRT(fscanf)(MSVCRT(FILE)*,const char*,...);
136 int MSVCRT(fseek)(MSVCRT(FILE)*,long,int);
137 int MSVCRT(fsetpos)(MSVCRT(FILE)*,MSVCRT(fpos_t)*);
138 long MSVCRT(ftell)(MSVCRT(FILE)*);
139 MSVCRT(size_t) MSVCRT(fwrite)(const void*,MSVCRT(size_t),MSVCRT(size_t),MSVCRT(FILE)*);
140 int MSVCRT(getc)(MSVCRT(FILE)*);
141 int MSVCRT(getchar)(void);
142 char* MSVCRT(gets)(char*);
143 void MSVCRT(perror)(const char*);
144 int MSVCRT(printf)(const char*,...);
145 int MSVCRT(putc)(int,MSVCRT(FILE)*);
146 int MSVCRT(putchar)(int);
147 int MSVCRT(puts)(const char*);
148 int MSVCRT(remove)(const char*);
149 int MSVCRT(rename)(const char*,const char*);
150 void MSVCRT(rewind)(MSVCRT(FILE)*);
151 int MSVCRT(scanf)(const char*,...);
152 void MSVCRT(setbuf)(MSVCRT(FILE)*,char*);
153 int MSVCRT(setvbuf)(MSVCRT(FILE)*,char*,int,MSVCRT(size_t));
154 int MSVCRT(sprintf)(char*,const char*,...);
155 int MSVCRT(sscanf)(const char*,const char*,...);
156 MSVCRT(FILE)* MSVCRT(tmpfile)(void);
157 char* MSVCRT(tmpnam)(char*);
158 int MSVCRT(ungetc)(int,MSVCRT(FILE)*);
159 int MSVCRT(vfprintf)(MSVCRT(FILE)*,const char*,va_list);
160 int MSVCRT(vprintf)(const char*,va_list);
161 int MSVCRT(vsprintf)(char*,const char*,va_list);
163 MSVCRT(wint_t) _fgetwchar(void);
164 MSVCRT(wint_t) _fputwchar(MSVCRT(wint_t));
165 WCHAR* _getws(WCHAR*);
166 int _putws(const WCHAR*);
167 int _snwprintf(WCHAR*,MSVCRT(size_t),const WCHAR*,...);
168 int _vsnwprintf(WCHAR*,MSVCRT(size_t),const WCHAR*,va_list);
169 MSVCRT(FILE)* _wfdopen(int,const WCHAR*);
170 MSVCRT(FILE)* _wfopen(const WCHAR*,const WCHAR*);
171 MSVCRT(FILE)* _wfreopen(const WCHAR*,const WCHAR*,MSVCRT(FILE)*);
172 MSVCRT(FILE)* _wfsopen(const WCHAR*,const WCHAR*,int);
173 void _wperror(const WCHAR*);
174 MSVCRT(FILE)* _wpopen(const WCHAR*,const WCHAR*);
175 int _wremove(const WCHAR*);
176 WCHAR* _wtempnam(const WCHAR*,const WCHAR*);
177 WCHAR* _wtmpnam(WCHAR*);
179 MSVCRT(wint_t) MSVCRT(fgetwc)(MSVCRT(FILE)*);
180 WCHAR* MSVCRT(fgetws)(WCHAR*,int,MSVCRT(FILE)*);
181 MSVCRT(wint_t) MSVCRT(fputwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
182 int MSVCRT(fputws)(const WCHAR*,MSVCRT(FILE)*);
183 int MSVCRT(fwprintf)(MSVCRT(FILE)*,const WCHAR*,...);
184 int MSVCRT(fputws)(const WCHAR*,MSVCRT(FILE)*);
185 int MSVCRT(fwscanf)(MSVCRT(FILE)*,const WCHAR*,...);
186 MSVCRT(wint_t) MSVCRT(getwc)(MSVCRT(FILE)*);
187 MSVCRT(wint_t) MSVCRT(getwchar)(void);
188 WCHAR* MSVCRT(getws)(WCHAR*);
189 MSVCRT(wint_t) MSVCRT(putwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
190 MSVCRT(wint_t) MSVCRT(putwchar)(MSVCRT(wint_t));
191 int MSVCRT(putws)(const WCHAR*);
192 int MSVCRT(swprintf)(WCHAR*,const WCHAR*,...);
193 int MSVCRT(swscanf)(WCHAR*,const WCHAR*,...);
194 MSVCRT(wint_t) MSVCRT(ungetwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
195 int MSVCRT(vfwprintf)(MSVCRT(FILE)*,const WCHAR*,va_list);
196 int MSVCRT(vswprintf)(WCHAR*,const WCHAR*,va_list);
197 int MSVCRT(vwprintf)(const WCHAR*,va_list);
198 int MSVCRT(wprintf)(const WCHAR*,...);
199 int MSVCRT(wscanf)(const WCHAR*,...);
201 #ifdef __cplusplus
203 #endif
206 #ifndef USE_MSVCRT_PREFIX
207 #define fdopen _fdopen
208 #define fgetchar _fgetchar
209 #define fileno _fileno
210 #define fputchar _fputchar
211 #define pclose _pclose
212 #define popen _popen
213 #define tempnam _tempnam
214 #define unlink _unlink
216 #define fgetwchar _fgetwchar
217 #define fputwchar _fputwchar
218 #define getw _getw
219 #define putw _putw
220 #define wpopen _wpopen
221 #endif /* USE_MSVCRT_PREFIX */
223 #endif /* __WINE_STDIO_H */