OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [language/] [c/] [libc/] [stdio/] [v2_0/] [include/] [stdio.h] - Blame information for rev 657

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
#ifndef CYGONCE_LIBC_STDIO_STDIO_H
2
#define CYGONCE_LIBC_STDIO_STDIO_H
3
//========================================================================
4
//
5
//      stdio.h
6
//
7
//      ISO C standard I/O routines - with some POSIX 1003.1 extensions
8
//
9
//========================================================================
10
//####ECOSGPLCOPYRIGHTBEGIN####
11
// -------------------------------------------
12
// This file is part of eCos, the Embedded Configurable Operating System.
13
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
14
//
15
// eCos is free software; you can redistribute it and/or modify it under
16
// the terms of the GNU General Public License as published by the Free
17
// Software Foundation; either version 2 or (at your option) any later version.
18
//
19
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
21
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
22
// for more details.
23
//
24
// You should have received a copy of the GNU General Public License along
25
// with eCos; if not, write to the Free Software Foundation, Inc.,
26
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27
//
28
// As a special exception, if other files instantiate templates or use macros
29
// or inline functions from this file, or you compile this file and link it
30
// with other works to produce a work based on this file, this file does not
31
// by itself cause the resulting work to be covered by the GNU General Public
32
// License. However the source code for this file must still be made available
33
// in accordance with section (3) of the GNU General Public License.
34
//
35
// This exception does not invalidate any other reasons why a work based on
36
// this file might be covered by the GNU General Public License.
37
//
38
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
39
// at http://sources.redhat.com/ecos/ecos-license/
40
// -------------------------------------------
41
//####ECOSGPLCOPYRIGHTEND####
42
//========================================================================
43
//#####DESCRIPTIONBEGIN####
44
//
45
// Author(s):     jlarmour
46
// Contributors:  
47
// Date:          2000-04-19
48
// Purpose:       ISO C standard I/O routines
49
// Description: 
50
// Usage:         Do not include this file directly - use #include <stdio.h>
51
//
52
//####DESCRIPTIONEND####
53
//
54
//========================================================================
55
 
56
// CONFIGURATION
57
 
58
#include <pkgconf/libc_stdio.h>   // Configuration header
59
 
60
// INCLUDES
61
 
62
#include <cyg/infra/cyg_type.h> // common type definitions and support
63
#include <stdarg.h>             // va_list from compiler
64
 
65
// CONSTANTS
66
 
67
// Some of these values are odd to ensure that asserts have better effect
68
// should spurious values be passed to functions expecting these constants.
69
 
70
// _IOFBF, _IOLBF, and _IONBF specify full, line or no buffering when used
71
// with setvbuf() - ISO C standard chap 7.9.1
72
 
73
#define _IOFBF      (-2)
74
#define _IOLBF      (-4)
75
#define _IONBF      (-8)
76
 
77
// EOF is a macro defined to any negative integer constant - ISO C standard
78
// chap. 7.9.1
79
#define EOF         (-1)
80
 
81
// SEEK_CUR, SEEK_END and SEEK_SET are used with fseek() as position
82
// anchors - ISO C standard chap. 7.9.1
83
#define SEEK_SET    0
84
#define SEEK_CUR    1
85
#define SEEK_END    2
86
 
87
 
88
// TYPE DEFINITIONS
89
 
90
// A type capable of specifying uniquely every file position - ISO C
91
// standard chap 7.9.1
92
typedef cyg_ucount32 fpos_t;
93
 
94
 
95
// FILE is just cast to an address here. It is uncast internally to the
96
// C library in stream.hxx  as the C++ Cyg_StdioStream class.
97
// Optional run-time checking can be enabled to ensure that the cast is
98
// valid, using the standard assertion functionality.
99
//
100
// The array size is irrelevant other than being more than 8, and is present
101
// to stop references to FILEs being marked as able to be put in the small
102
// data section. We can't just mark it as in the ".data" section as on some
103
// targets it may actually be ".common".
104
typedef CYG_ADDRESS FILE[9999];
105
 
106
// EXTERNAL VARIABLES
107
 
108
// Default file streams for input/output. These only need to be
109
// expressions, not l-values - ISO C standard chap. 7.9.1
110
//
111
// CYGPRI_LIBC_STDIO_NO_DEFAULT_STREAMS is used when initializing
112
// stdin/out/err privately inside the C library
113
 
114
#ifndef CYGPRI_LIBC_STDIO_NO_DEFAULT_STREAMS
115
__externC FILE *stdin, *stdout, *stderr;
116
#endif
117
 
118
// FUNCTION PROTOTYPES
119
 
120
//========================================================================
121
 
122
// ISO C 7.9.5 File access functions
123
 
124
externC int
125
fclose( FILE * /* stream */ );
126
 
127
externC int
128
fflush( FILE * /* stream */ );
129
 
130
externC FILE *
131
fopen( const char * /* filename */, const char * /* mode */ );
132
 
133
externC FILE *
134
freopen( const char * /* filename */, const char * /* mode */,
135
         FILE * /* stream */ );
136
 
137
externC void
138
setbuf( FILE * /* stream */, char * /* buffer */ );
139
 
140
externC int
141
setvbuf( FILE * /* stream */, char * /* buffer */, int /* mode */,
142
         size_t /* size */ );
143
 
144
//========================================================================
145
 
146
// ISO C 7.9.6 Formatted input/output functions
147
 
148
externC int
149
fprintf( FILE * /* stream */, const char * /* format */, ... );
150
 
151
externC int
152
fscanf( FILE * /* stream */, const char * /* format */, ... );
153
 
154
externC int
155
printf( const char * /* format */, ... );
156
 
157
externC int
158
scanf( const char * /* format */, ... );
159
 
160
externC int
161
sprintf( char * /* str */, const char * /* format */, ... );
162
 
163
externC int
164
sscanf( const char * /* str */, const char * /* format */, ... );
165
 
166
externC int
167
vfprintf( FILE * /* stream */, const char * /* format */,
168
          va_list /* args */ );
169
 
170
externC int
171
vprintf( const char * /* format */, va_list /* args */ );
172
 
173
externC int
174
vsprintf( char * /* str */, const char * /* format */,
175
          va_list /* args */ );
176
 
177
//========================================================================
178
 
179
// ISO C 7.9.7 Character input/output functions
180
 
181
externC int
182
fgetc( FILE * /* stream */ );
183
 
184
externC char *
185
fgets( char * /* str */, int /* length */, FILE * /* stream */ );
186
 
187
externC int
188
fputc( int /* c */, FILE * /* stream */ );
189
 
190
externC int
191
putc( int /* c */, FILE * /* stream */ );
192
 
193
externC int
194
putchar( int /* c */ );
195
 
196
externC int
197
fputs( const char * /* str */, FILE * /* stream */ );
198
 
199
externC char *
200
gets( char * );
201
 
202
externC int
203
getc( FILE * /* stream */ );
204
 
205
externC int
206
getchar( void );
207
 
208
externC int
209
puts( const char * /* str */ );
210
 
211
externC int
212
ungetc( int /* c */, FILE * /* stream */ );
213
 
214
// no function equivalent is required for getchar() or putchar(), so we can
215
// just #define them
216
 
217
#define getchar() fgetc( stdin )
218
 
219
#define putchar(__c) fputc(__c, stdout)
220
 
221
//========================================================================
222
 
223
// ISO C 7.9.8 Direct input/output functions
224
 
225
externC size_t
226
fread( void * /* ptr */, size_t /* object_size */,
227
       size_t /* num_objects */, FILE * /* stream */ );
228
 
229
externC size_t
230
fwrite( const void * /* ptr */, size_t /* object_size */,
231
        size_t /* num_objects */, FILE * /* stream */ );
232
 
233
//========================================================================
234
 
235
// ISO C 7.9.9 File positioning functions
236
 
237
externC int
238
fgetpos( FILE * /* stream */, fpos_t * /* pos */ );
239
 
240
externC int
241
fseek( FILE * /* stream */, long int /* offset */, int /* whence */ );
242
 
243
externC int
244
fsetpos( FILE * /* stream */, const fpos_t * /* pos */ );
245
 
246
externC long int
247
ftell( FILE * /* stream */ );
248
 
249
externC void
250
rewind( FILE * /* stream */ );
251
 
252
//========================================================================
253
 
254
// ISO C 7.9.10 Error-handling functions
255
 
256
externC void
257
clearerr( FILE * /* stream */ );
258
 
259
externC int
260
feof( FILE * /* stream */ );
261
 
262
externC int
263
ferror( FILE * /* stream */ );
264
 
265
externC void
266
perror( const char * /* prefix_str */ );
267
 
268
//========================================================================
269
 
270
// Other non-ISO C functions
271
 
272
externC int
273
fnprintf( FILE * /* stream */, size_t /* length */,
274
          const char * /* format */, ... ) CYGBLD_ATTRIB_PRINTF_FORMAT(3, 4);
275
 
276
externC int
277
snprintf( char * /* str */, size_t /* length */, const char * /* format */,
278
          ... ) CYGBLD_ATTRIB_PRINTF_FORMAT(3, 4);
279
 
280
externC int
281
vfnprintf( FILE * /* stream */, size_t /* length */,
282
           const char * /* format */, va_list /* args */ );
283
 
284
externC int
285
vsnprintf( char * /* str */, size_t /* length */,
286
           const char * /* format */, va_list /* args */ );
287
 
288
externC int
289
vscanf( const char * /* format */, va_list /* args */ );
290
 
291
externC int
292
vsscanf( const char * /* str */, const char * /* format */,
293
         va_list /* args */ );
294
 
295
externC int
296
vfscanf( FILE * /* stream */, const char * /* format */,
297
         va_list /* args */ );
298
 
299
 
300
// INLINE FUNCTIONS
301
 
302
#ifdef CYGIMP_LIBC_STDIO_INLINES
303
# include <cyg/libc/stdio/stdio.inl>
304
#endif
305
 
306
#endif // CYGONCE_LIBC_STDIO_STDIO_H multiple inclusion protection
307
 
308
// EOF stdio.h

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.