source: trunk/include/win/msvcrt/stdio.h@ 8207

Last change on this file since 8207 was 8207, checked in by sandervl, 23 years ago

added

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