|
0
|
1 #ifndef CYGONCE_LIBC_CLIBINCL_STDIOSUPP_HXX |
|
|
2 #define CYGONCE_LIBC_CLIBINCL_STDIOSUPP_HXX |
|
|
3 //======================================================================== |
|
|
4 // |
|
|
5 // stdiosupp.hxx |
|
|
6 // |
|
|
7 // Support for C library standard I/O routines |
|
|
8 // |
|
|
9 //======================================================================== |
|
|
10 //####COPYRIGHTBEGIN#### |
|
|
11 // |
|
|
12 // ------------------------------------------- |
|
|
13 // The contents of this file are subject to the Cygnus eCos Public License |
|
|
14 // Version 1.0 (the "License"); you may not use this file except in |
|
|
15 // compliance with the License. You may obtain a copy of the License at |
|
|
16 // http://sourceware.cygnus.com/ecos |
|
|
17 // |
|
|
18 // Software distributed under the License is distributed on an "AS IS" |
|
|
19 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
|
20 // License for the specific language governing rights and limitations under |
|
|
21 // the License. |
|
|
22 // |
|
|
23 // The Original Code is eCos - Embedded Cygnus Operating System, released |
|
|
24 // September 30, 1998. |
|
|
25 // |
|
|
26 // The Initial Developer of the Original Code is Cygnus. Portions created |
|
2
|
27 // by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. |
|
0
|
28 // ------------------------------------------- |
|
|
29 // |
|
|
30 //####COPYRIGHTEND#### |
|
|
31 //======================================================================== |
|
|
32 //#####DESCRIPTIONBEGIN#### |
|
|
33 // |
|
|
34 // Author(s): jlarmour |
|
2
|
35 // Contributors: jlarmour |
|
0
|
36 // Date: 1998-02-13 |
|
|
37 // Purpose: |
|
|
38 // Description: |
|
|
39 // Usage: #include "clibincl/stdiosupp.hxx" |
|
|
40 // |
|
|
41 //####DESCRIPTIONEND#### |
|
|
42 // |
|
|
43 //======================================================================== |
|
|
44 |
|
|
45 // CONFIGURATION |
|
|
46 |
|
|
47 #include <pkgconf/libc.h> // Configuration header |
|
|
48 |
|
|
49 // Include the C library? |
|
|
50 #if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) |
|
|
51 |
|
|
52 // INCLUDES |
|
|
53 |
|
|
54 #include <cyg/infra/cyg_type.h> // common type definitions and support |
|
|
55 #include <stddef.h> // NULL and size_t from compiler |
|
|
56 #include <stdarg.h> // va_list from compiler |
|
|
57 #include <stdio.h> // Main standard I/O header |
|
2
|
58 #include <cyg/io/devtab.h> // Device table |
|
|
59 #include "clibincl/stream.hxx" // Cyg_StdioStream |
|
|
60 #include <errno.h> // Cyg_ErrNo |
|
0
|
61 |
|
|
62 // FUNCTION PROTOTYPES |
|
|
63 |
|
|
64 //======================================================================== |
|
|
65 |
|
|
66 // Miscellaneous support functions |
|
|
67 |
|
2
|
68 externC cyg_io_handle_t |
|
0
|
69 Cyg_libc_stdio_find_filename( const char *filename ); |
|
|
70 |
|
2
|
71 externC Cyg_ErrNo |
|
|
72 cyg_libc_stdio_flush_all_but( Cyg_StdioStream *not_this_stream ); |
|
0
|
73 |
|
|
74 //======================================================================== |
|
|
75 |
|
|
76 // ISO C 7.9.5 File access functions |
|
|
77 |
|
|
78 externC int |
|
|
79 _fclose( FILE * /* stream */ ); |
|
|
80 |
|
|
81 externC int |
|
|
82 _fflush( FILE * /* stream */ ); |
|
|
83 |
|
|
84 externC FILE * |
|
|
85 _fopen( const char * /* filename */, const char * /* mode */ ); |
|
|
86 |
|
|
87 externC FILE * |
|
|
88 _freopen( const char * /* filename */, const char * /* mode */, |
|
|
89 FILE * /* stream */ ); |
|
|
90 |
|
|
91 externC void |
|
|
92 _setbuf( FILE * /* stream */, char * /* buffer */ ); |
|
|
93 |
|
|
94 externC int |
|
|
95 _setvbuf( FILE * /* stream */, char * /* buffer */, int /* mode */, |
|
|
96 size_t /* size */ ); |
|
|
97 |
|
|
98 //======================================================================== |
|
|
99 |
|
|
100 // ISO C 7.9.6 Formatted input/output functions |
|
|
101 |
|
|
102 externC int |
|
|
103 _fprintf( FILE * /* stream */, const char * /* format */, ... ); |
|
|
104 |
|
|
105 externC int |
|
|
106 _fscanf( FILE * /* stream */, const char * /* format */, ... ); |
|
|
107 |
|
|
108 externC int |
|
|
109 _printf( const char * /* format */, ... ); |
|
|
110 |
|
|
111 externC int |
|
|
112 _scanf( const char * /* format */, ... ); |
|
|
113 |
|
|
114 externC int |
|
|
115 _sprintf( char * /* str */, const char * /* format */, ... ); |
|
|
116 |
|
|
117 externC int |
|
|
118 _sscanf( const char * /* str */, const char * /* format */, ... ); |
|
|
119 |
|
|
120 externC int |
|
|
121 _vfprintf( FILE * /* stream */, const char * /* format */, |
|
|
122 va_list /* args */ ); |
|
|
123 |
|
|
124 externC int |
|
|
125 _vprintf( const char * /* format */, va_list /* args */ ); |
|
|
126 |
|
|
127 externC int |
|
|
128 _vsprintf( char * /* str */, const char * /* format */, |
|
|
129 va_list /* args */ ); |
|
|
130 |
|
|
131 //======================================================================== |
|
|
132 |
|
|
133 // ISO C 7.9.7 Character input/output functions |
|
|
134 |
|
|
135 externC char * |
|
|
136 _fgets( char * /* str */, int /* length */, FILE * /* stream */ ); |
|
|
137 |
|
|
138 externC int |
|
|
139 _fputs( const char * /* str */, FILE * /* stream */ ); |
|
|
140 |
|
|
141 externC char * |
|
|
142 _gets( char * ); |
|
|
143 |
|
|
144 externC int |
|
|
145 _puts( const char * /* str */ ); |
|
|
146 |
|
|
147 externC int |
|
|
148 _ungetc( int /* c */, FILE * /* stream */ ); |
|
|
149 |
|
|
150 //======================================================================== |
|
|
151 |
|
|
152 // ISO C 7.9.8 Direct input/output functions |
|
|
153 |
|
|
154 externC size_t |
|
|
155 _fread( void * /* ptr */, size_t /* object_size */, |
|
|
156 size_t /* num_objects */, FILE * /* stream */ ); |
|
|
157 |
|
|
158 externC size_t |
|
|
159 _fwrite( const void * /* ptr */, size_t /* object_size */, |
|
|
160 size_t /* num_objects */, FILE * /* stream */ ); |
|
|
161 |
|
|
162 |
|
|
163 //======================================================================== |
|
|
164 |
|
|
165 // ISO C 7.9.10 Error-handling functions |
|
|
166 |
|
|
167 externC void |
|
|
168 _clearerr( FILE * /* stream */ ); |
|
|
169 |
|
|
170 externC int |
|
|
171 _feof( FILE * /* stream */ ); |
|
|
172 |
|
|
173 externC int |
|
|
174 _ferror( FILE * /* stream */ ); |
|
|
175 |
|
|
176 externC void |
|
|
177 _perror( const char * /* prefix_str */ ); |
|
|
178 |
|
|
179 //======================================================================== |
|
|
180 |
|
|
181 // Other non-ISO C functions |
|
|
182 |
|
|
183 externC int |
|
|
184 _fnprintf( FILE * /* stream */, size_t /* length */, |
|
|
185 const char * /* format */, ... ); |
|
|
186 |
|
|
187 externC int |
|
|
188 _snprintf( char * /* str */, size_t /* length */, |
|
|
189 const char * /* format */, ... ); |
|
|
190 |
|
|
191 externC int |
|
|
192 _vfnprintf( FILE * /* stream */, size_t /* length */, |
|
|
193 const char * /* format */, va_list /* args */ ); |
|
|
194 |
|
|
195 externC int |
|
|
196 _vsnprintf( char * /* str */, size_t /* length */, |
|
|
197 const char * /* format */, va_list /* args */ ); |
|
|
198 |
|
|
199 externC int |
|
|
200 _vscanf( const char * /* format */, va_list /* args */ ); |
|
|
201 |
|
|
202 externC int |
|
|
203 _vsscanf( const char * /* str */, const char * /* format */, |
|
|
204 va_list /* args */ ); |
|
|
205 |
|
|
206 externC int |
|
|
207 _vfscanf( FILE * /* stream */, const char * /* format */, |
|
|
208 va_list /* args */ ); |
|
|
209 |
|
|
210 |
|
|
211 #endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_STDIO) |
|
|
212 |
|
|
213 #endif // CYGONCE_LIBC_CLIBINCL_STDIOSUPP_HXX multiple inclusion protection |
|
|
214 |
|
|
215 // EOF stdiosupp.hxx |