source: trunk/src/emx/include/stdio.h@ 346

Last change on this file since 346 was 236, checked in by zap, 22 years ago

See ChangeLog.

  • Property cvs2svn:cvs-rev set to 1.4
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 5.1 KB
Line 
1/* stdio.h (emx+gcc) */
2
3#ifndef _STDIO_H
4#define _STDIO_H
5
6#if defined (__cplusplus)
7extern "C" {
8#endif
9
10#if !defined (_SIZE_T)
11#define _SIZE_T
12typedef unsigned long size_t;
13#endif
14
15#if !defined (NULL)
16#if defined (__cplusplus)
17#define NULL 0
18#else
19#define NULL ((void *)0)
20#endif
21#endif
22
23#if !defined (BUFSIZ)
24#define BUFSIZ 5120
25#endif
26
27#if !defined (_FILE_T)
28#define _FILE_T
29#define _FILE_MEMBERS_HAVE_UNDERSCORE
30struct _file2;
31struct _FILE
32{
33 char * _ptr;
34 char * _buffer;
35 int _rcount;
36 int _wcount;
37 int _handle;
38 int _flags;
39 int _buf_size;
40 int _tmpidx;
41 int _pid;
42 char _char_buf;
43 unsigned char _ungetc_count;
44 short _mbstate;
45 int (*_flush)(struct _FILE *, int);
46 struct _file2 *_more;
47};
48
49typedef struct _FILE FILE;
50
51extern FILE _streamv[];
52
53#define stdin (&_streamv[0])
54#define stdout (&_streamv[1])
55#define stderr (&_streamv[2])
56
57#endif
58
59#if !defined (SEEK_SET)
60#define SEEK_SET 0
61#define SEEK_CUR 1
62#define SEEK_END 2
63#endif
64
65#if !defined (EOF)
66#define EOF (-1)
67#endif
68
69#if !defined (_IOREAD)
70#define _IOREAD 0x01
71#define _IOWRT 0x02
72#define _IORW 0x04
73#define _IOEOF 0x08
74#define _IOERR 0x10
75#define _IOFBF 0x00
76#define _IOLBF 0x20
77#define _IONBF 0x40
78#endif
79
80#if !defined (FOPEN_MAX)
81#define FOPEN_MAX 14
82#endif
83
84#if !defined (FILENAME_MAX)
85#define FILENAME_MAX 260
86#endif
87
88#if !defined (TMP_MAX)
89#define TMP_MAX 1000
90#endif
91
92#if !defined (P_tmpdir)
93#define P_tmpdir "."
94#define L_tmpnam (sizeof (P_tmpdir) + 13)
95#endif
96
97#if !defined (L_cuserid)
98#define L_cuserid 9
99#endif
100
101#if !defined (_FPOS_T)
102#define _FPOS_T
103typedef struct
104{
105 long _pos;
106 long _reserved1;
107 short _mbstate;
108 short _reserved2;
109} fpos_t;
110#endif
111
112#if !defined (_VA_LIST)
113#define _VA_LIST
114typedef __builtin_va_list va_list;
115#endif
116
117void clearerr (FILE *);
118int fclose (FILE *);
119int feof (FILE *);
120int ferror (FILE *);
121int fflush (FILE *);
122int fgetc (FILE *);
123int fgetpos (FILE *, fpos_t *);
124char *fgets (char *, int, FILE *);
125FILE *fopen (__const__ char *, __const__ char *);
126int fprintf (FILE *, __const__ char *, ...);
127int fputc (int, FILE *);
128int fputs (__const__ char *, FILE *);
129size_t fread (void *, size_t, size_t, FILE *);
130FILE *freopen (__const__ char *, __const__ char *, FILE *);
131int fscanf (FILE *, __const__ char *, ...);
132int fseek (FILE *, long, int);
133int fsetpos (FILE *, __const__ fpos_t *);
134long ftell (FILE *);
135size_t fwrite (__const__ void *, size_t, size_t, FILE *);
136int getchar (void);
137char *gets (char *);
138void perror (__const__ char *);
139int printf (__const__ char *, ...);
140int putchar (int);
141int puts (__const__ char *);
142int remove (__const__ char *);
143int rename (__const__ char *, __const__ char *);
144void rewind (FILE *);
145int scanf (__const__ char *, ...);
146int setbuf (FILE *, char *);
147int setvbuf (FILE *, char *, int, size_t);
148int sprintf (char *, __const__ char *, ...);
149int sscanf (__const__ char *, __const__ char *, ...);
150FILE *tmpfile (void);
151char *tmpnam (char *);
152int ungetc (int, FILE *);
153int vfprintf (FILE *, __const__ char *, va_list);
154int vprintf (__const__ char *, va_list);
155int vsprintf (char *, __const__ char *, va_list);
156
157int _fill (FILE *);
158int _flush (int, FILE *);
159int _rmtmp (void);
160
161extern __inline__ int feof (FILE *_s)
162{
163 return (_s->_flags & _IOEOF ? 1 : 0);
164}
165
166extern __inline__ int ferror (FILE *_s)
167{
168 return (_s->_flags & _IOERR ? 1 : 0);
169}
170
171#define getc(s) fgetc(s)
172#define putc(c,s) fputc(c,s)
173
174extern __inline__ int getchar (void) { return getc (stdin); }
175extern __inline__ int putchar (int _c) { return putc (_c, stdout); }
176
177
178#if !defined (__STRICT_ANSI__)
179
180/* POSIX.1 */
181
182/* ctermid() */
183FILE *fdopen (int, __const__ char *);
184int fileno (FILE *);
185
186extern __inline__ int fileno (FILE *_s) { return _s->_handle; }
187
188#endif
189
190
191#if !defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE)
192
193char *cuserid (char *);
194int getw (FILE *);
195int fcloseall (void);
196int fgetchar (void);
197int flushall (void);
198int fputchar (int);
199int pclose (FILE *);
200FILE *popen (__const__ char *, __const__ char *);
201int putw (int, FILE *);
202int setbuffer (FILE *, char *, size_t);
203int snprintf (char *, size_t, __const__ char *, ...);
204char *tempnam (__const__ char *, __const__ char *);
205int vfscanf (FILE *, __const__ char *, va_list);
206int vscanf (__const__ char *, va_list);
207int vsnprintf (char *, size_t, __const__ char *, va_list);
208int vsscanf (__const__ char *, __const__ char *, va_list);
209
210#endif
211
212
213#if (!defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE)) \
214 || defined (_WITH_UNDERSCORE)
215
216int _fcloseall (void);
217FILE *_fassign (FILE *, FILE *);
218FILE *_fdopen (int, __const__ char *);
219int _fgetchar (void);
220int _flushall (void);
221int _fputchar (int);
222int _fseek_hdr (FILE *);
223int _fsetmode (FILE *, __const__ char *);
224FILE *_fsopen (__const__ char *, __const__ char *, int);
225int _getw (FILE *);
226char *_mfclose (FILE *);
227FILE *_mfopen (char *, __const__ char *, size_t, int);
228int _pclose (FILE *);
229FILE *_popen (__const__ char *, __const__ char *);
230int _putw (int, FILE *);
231int _setbuffer (FILE *, char *, size_t);
232int _snprintf (char *, size_t, __const__ char *, ...);
233char *_tempnam (__const__ char *, __const__ char *);
234int _vsnprintf (char *, size_t, __const__ char *, va_list);
235
236#endif
237
238
239#if defined (__cplusplus)
240}
241#endif
242
243#endif /* not _STDIO_H */
Note: See TracBrowser for help on using the repository browser.