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

Last change on this file since 10004 was 10004, checked in by sandervl, 22 years ago

PF: Header updates

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