This repository has been archived by the owner on Jun 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
stdio.h
242 lines (209 loc) · 7.43 KB
/
stdio.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
/*
* Standard I/O definitions.
*
* Derived from the mingw header written by Colin Peters.
* Modified for Wine use by Jon Griffiths and Francois Gouget.
* This file is in the public domain.
*/
#ifndef __WINE_STDIO_H
#define __WINE_STDIO_H
#ifndef __WINE_USE_MSVCRT
#define __WINE_USE_MSVCRT
#endif
#ifndef RC_INVOKED
#include <stdarg.h>
#endif
#include "msvcrt/wctype.h" /* For wint_t */
/* file._flag flags */
#ifndef USE_MSVCRT_PREFIX
#define _IOREAD 0x0001
#define _IOWRT 0x0002
#define _IOMYBUF 0x0008
#define _IOEOF 0x0010
#define _IOERR 0x0020
#define _IOSTRG 0x0040
#define _IORW 0x0080
#define _IOAPPEND 0x0200
#else
#define MSVCRT__IOREAD 0x0001
#define MSVCRT__IOWRT 0x0002
#define MSVCRT__IOMYBUF 0x0008
#define MSVCRT__IOEOF 0x0010
#define MSVCRT__IOERR 0x0020
#define MSVCRT__IOSTRG 0x0040
#define MSVCRT__IORW 0x0080
#define MSVCRT__IOAPPEND 0x0200
#endif /* USE_MSVCRT_PREFIX */
#ifndef USE_MSVCRT_PREFIX
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
/* more file._flag flags, but these conflict with Unix */
#define _IOFBF 0x0000
#define _IONBF 0x0004
#define _IOLBF 0x0040
#define EOF (-1)
#define FILENAME_MAX 260
#define FOPEN_MAX 20
#define L_tmpnam 260
#define BUFSIZ 512
#ifndef SEEK_SET
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#endif
#else
/* more file._flag flags, but these conflict with Unix */
#define MSVCRT__IOFBF 0x0000
#define MSVCRT__IONBF 0x0004
#define MSVCRT__IOLBF 0x0040
#define MSVCRT_FILENAME_MAX 260
#define MSVCRT_EOF (-1)
#define MSVCRT_BUFSIZ 512
#endif /* USE_MSVCRT_PREFIX */
typedef struct MSVCRT(_iobuf)
{
char* _ptr;
int _cnt;
char* _base;
int _flag;
int _file;
int _charbuf;
int _bufsiz;
char* _tmpfname;
} MSVCRT(FILE);
typedef long MSVCRT(fpos_t);
#ifndef MSVCRT_SIZE_T_DEFINED
typedef unsigned int MSVCRT(size_t);
#define MSVCRT_SIZE_T_DEFINED
#endif
#ifdef __cplusplus
extern "C" {
#endif
MSVCRT(FILE)* MSVCRT(__p__iob)(void);
#define _iob (__p__iob())
#ifndef USE_MSVCRT_PREFIX
#define stdin (_iob+STDIN_FILENO)
#define stdout (_iob+STDOUT_FILENO)
#define stderr (_iob+STDERR_FILENO)
#elif !defined(__WINE__)
#define MSVCRT_stdin (_iob+STDIN_FILENO)
#define MSVCRT_stdout (_iob+STDOUT_FILENO)
#define MSVCRT_stderr (_iob+STDERR_FILENO)
#endif /* USE_MSVCRT_PREFIX, __WINE__ */
int _fcloseall(void);
MSVCRT(FILE)* _fdopen(int,const char*);
int _fgetchar(void);
int _filbuf(MSVCRT(FILE*));
int _fileno(MSVCRT(FILE)*);
int _flsbuf(int,MSVCRT(FILE)*);
int _flushall(void);
int _fputchar(int);
MSVCRT(FILE)* _fsopen(const char*,const char*,int);
int _getmaxstdio(void);
int _getw(MSVCRT(FILE)*);
int _pclose(MSVCRT(FILE)*);
MSVCRT(FILE)* _popen(const char*,const char*);
int _putw(int,MSVCRT(FILE)*);
int _rmtmp(void);
int _setmaxstdio(int);
int _snprintf(char*,MSVCRT(size_t),const char*,...);
char* _tempnam(const char*,const char*);
int _unlink(const char*);
int _vsnprintf(char*,MSVCRT(size_t),const char*,va_list);
void MSVCRT(clearerr)(MSVCRT(FILE)*);
int MSVCRT(fclose)(MSVCRT(FILE)*);
int MSVCRT(feof)(MSVCRT(FILE)*);
int MSVCRT(ferror)(MSVCRT(FILE)*);
int MSVCRT(fflush)(MSVCRT(FILE)*);
int MSVCRT(fgetc)(MSVCRT(FILE)*);
int MSVCRT(fgetpos)(MSVCRT(FILE)*,MSVCRT(fpos_t)*);
char* MSVCRT(fgets)(char*,int,MSVCRT(FILE)*);
MSVCRT(FILE)* MSVCRT(fopen)(const char*,const char*);
int MSVCRT(fprintf)(MSVCRT(FILE)*,const char*,...);
int MSVCRT(fputc)(int,MSVCRT(FILE)*);
int MSVCRT(fputs)(const char*,MSVCRT(FILE)*);
MSVCRT(size_t) MSVCRT(fread)(void*,MSVCRT(size_t),MSVCRT(size_t),MSVCRT(FILE)*);
MSVCRT(FILE)* MSVCRT(freopen)(const char*,const char*,MSVCRT(FILE)*);
int MSVCRT(fscanf)(MSVCRT(FILE)*,const char*,...);
int MSVCRT(fseek)(MSVCRT(FILE)*,long,int);
int MSVCRT(fsetpos)(MSVCRT(FILE)*,MSVCRT(fpos_t)*);
long MSVCRT(ftell)(MSVCRT(FILE)*);
MSVCRT(size_t) MSVCRT(fwrite)(const void*,MSVCRT(size_t),MSVCRT(size_t),MSVCRT(FILE)*);
int MSVCRT(getc)(MSVCRT(FILE)*);
int MSVCRT(getchar)(void);
char* MSVCRT(gets)(char*);
void MSVCRT(perror)(const char*);
int MSVCRT(printf)(const char*,...);
int MSVCRT(putc)(int,MSVCRT(FILE)*);
int MSVCRT(putchar)(int);
int MSVCRT(puts)(const char*);
int MSVCRT(remove)(const char*);
int MSVCRT(rename)(const char*,const char*);
void MSVCRT(rewind)(MSVCRT(FILE)*);
int MSVCRT(scanf)(const char*,...);
void MSVCRT(setbuf)(MSVCRT(FILE)*,char*);
int MSVCRT(setvbuf)(MSVCRT(FILE)*,char*,int,MSVCRT(size_t));
int MSVCRT(sprintf)(char*,const char*,...);
int MSVCRT(sscanf)(const char*,const char*,...);
MSVCRT(FILE)* MSVCRT(tmpfile)(void);
char* MSVCRT(tmpnam)(char*);
int MSVCRT(ungetc)(int,MSVCRT(FILE)*);
int MSVCRT(vfprintf)(MSVCRT(FILE)*,const char*,va_list);
int MSVCRT(vprintf)(const char*,va_list);
int MSVCRT(vsprintf)(char*,const char*,va_list);
MSVCRT(wint_t) _fgetwchar(void);
MSVCRT(wint_t) _fputwchar(MSVCRT(wint_t));
WCHAR* _getws(WCHAR*);
int _putws(const WCHAR*);
int _snwprintf(WCHAR*,MSVCRT(size_t),const WCHAR*,...);
int _vsnwprintf(WCHAR*,MSVCRT(size_t),const WCHAR*,va_list);
MSVCRT(FILE)* _wfdopen(int,const WCHAR*);
MSVCRT(FILE)* _wfopen(const WCHAR*,const WCHAR*);
MSVCRT(FILE)* _wfreopen(const WCHAR*,const WCHAR*,MSVCRT(FILE)*);
MSVCRT(FILE)* _wfsopen(const WCHAR*,const WCHAR*,int);
void _wperror(const WCHAR*);
MSVCRT(FILE)* _wpopen(const WCHAR*,const WCHAR*);
int _wremove(const WCHAR*);
WCHAR* _wtempnam(const WCHAR*,const WCHAR*);
WCHAR* _wtmpnam(WCHAR*);
MSVCRT(wint_t) MSVCRT(fgetwc)(MSVCRT(FILE)*);
WCHAR* MSVCRT(fgetws)(WCHAR*,int,MSVCRT(FILE)*);
MSVCRT(wint_t) MSVCRT(fputwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
int MSVCRT(fputws)(const WCHAR*,MSVCRT(FILE)*);
int MSVCRT(fwprintf)(MSVCRT(FILE)*,const WCHAR*,...);
int MSVCRT(fputws)(const WCHAR*,MSVCRT(FILE)*);
int MSVCRT(fwscanf)(MSVCRT(FILE)*,const WCHAR*,...);
MSVCRT(wint_t) MSVCRT(getwc)(MSVCRT(FILE)*);
MSVCRT(wint_t) MSVCRT(getwchar)(void);
WCHAR* MSVCRT(getws)(WCHAR*);
MSVCRT(wint_t) MSVCRT(putwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
MSVCRT(wint_t) MSVCRT(putwchar)(MSVCRT(wint_t));
int MSVCRT(putws)(const WCHAR*);
int MSVCRT(swprintf)(WCHAR*,const WCHAR*,...);
int MSVCRT(swscanf)(WCHAR*,const WCHAR*,...);
MSVCRT(wint_t) MSVCRT(ungetwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
int MSVCRT(vfwprintf)(MSVCRT(FILE)*,const WCHAR*,va_list);
int MSVCRT(vswprintf)(WCHAR*,const WCHAR*,va_list);
int MSVCRT(vwprintf)(const WCHAR*,va_list);
int MSVCRT(wprintf)(const WCHAR*,...);
int MSVCRT(wscanf)(const WCHAR*,...);
#ifdef __cplusplus
}
#endif
#ifndef USE_MSVCRT_PREFIX
#define fdopen _fdopen
#define fgetchar _fgetchar
#define fileno _fileno
#define fputchar _fputchar
#define pclose _pclose
#define popen _popen
#define tempnam _tempnam
#define unlink _unlink
#define fgetwchar _fgetwchar
#define fputwchar _fputwchar
#define getw _getw
#define putw _putw
#define wpopen _wpopen
#endif /* USE_MSVCRT_PREFIX */
#endif /* __WINE_STDIO_H */