1 | @node Stdio |
---|
2 | @chapter Input and Output (@file{stdio.h}) |
---|
3 | |
---|
4 | This chapter comprises functions to manage files |
---|
5 | or other input/output streams. Among these functions are subroutines |
---|
6 | to generate or scan strings according to specifications from a format string. |
---|
7 | |
---|
8 | The underlying facilities for input and output depend on the host |
---|
9 | system, but these functions provide a uniform interface. |
---|
10 | |
---|
11 | The corresponding declarations are in @file{stdio.h}. |
---|
12 | |
---|
13 | The reentrant versions of these functions use macros |
---|
14 | |
---|
15 | @example |
---|
16 | _stdin_r(@var{reent}) |
---|
17 | _stdout_r(@var{reent}) |
---|
18 | _stderr_r(@var{reent}) |
---|
19 | @end example |
---|
20 | |
---|
21 | @noindent |
---|
22 | instead of the globals @code{stdin}, @code{stdout}, and |
---|
23 | @code{stderr}. The argument @var{reent} is a pointer to a reentrancy |
---|
24 | structure. |
---|
25 | |
---|
26 | @menu |
---|
27 | * clearerr:: Clear file or stream error indicator |
---|
28 | * diprintf:: Print to a file descriptor (integer only) |
---|
29 | * dprintf:: Print to a file descriptor |
---|
30 | * fclose:: Close a file |
---|
31 | * fcloseall:: Close all files |
---|
32 | * fdopen:: Turn an open file into a stream |
---|
33 | * feof:: Test for end of file |
---|
34 | * ferror:: Test whether read/write error has occurred |
---|
35 | * fflush:: Flush buffered file output |
---|
36 | * fgetc:: Get a character from a file or stream |
---|
37 | * fgetpos:: Record position in a stream or file |
---|
38 | * fgets:: Get character string from a file or stream |
---|
39 | * fgetwc:: Get a wide character from a file or stream |
---|
40 | * fgetws:: Get a wide character string from a file or stream |
---|
41 | * fileno:: Get file descriptor associated with stream |
---|
42 | * fmemopen:: Open a stream around a fixed-length buffer |
---|
43 | * fopen:: Open a file |
---|
44 | * fopencookie:: Open a stream with custom callbacks |
---|
45 | * fpurge:: Discard all pending I/O on a stream |
---|
46 | * fputc:: Write a character on a stream or file |
---|
47 | * fputs:: Write a character string in a file or stream |
---|
48 | * fputwc:: Write a wide character to a file or stream |
---|
49 | * fputws:: Write a wide character string to a file or stream |
---|
50 | * fread:: Read array elements from a file |
---|
51 | * freopen:: Open a file using an existing file descriptor |
---|
52 | * fseek:: Set file position |
---|
53 | * __fsetlocking:: Set or query locking mode on FILE stream |
---|
54 | * fsetpos:: Restore position of a stream or file |
---|
55 | * ftell:: Return position in a stream or file |
---|
56 | * funopen:: Open a stream with custom callbacks |
---|
57 | * fwide:: Set and determine the orientation of a FILE stream |
---|
58 | * fwrite:: Write array elements from memory to a file or stream |
---|
59 | * getc:: Get a character from a file or stream (macro) |
---|
60 | * getc_unlocked:: Get a character from a file or stream (macro) |
---|
61 | * getchar:: Get a character from standard input (macro) |
---|
62 | * getchar_unlocked:: Get a character from standard input (macro) |
---|
63 | * getdelim:: Get character string from a file or stream |
---|
64 | * getline:: Get character string from a file or stream |
---|
65 | * gets:: Get character string from standard input (obsolete) |
---|
66 | * getw:: Get a word (int) from a file or stream |
---|
67 | * getwchar:: Get a wide character from standard input |
---|
68 | * mktemp:: Generate unused file name |
---|
69 | * open_memstream:: Open a write stream around an arbitrary-length buffer |
---|
70 | * perror:: Print an error message on standard error |
---|
71 | * putc:: Write a character on a stream or file (macro) |
---|
72 | * putc_unlocked:: Write a character on a stream or file (macro) |
---|
73 | * putchar:: Write a character on standard output (macro) |
---|
74 | * putchar_unlocked:: Write a character on standard output (macro) |
---|
75 | * puts:: Write a character string on standard output |
---|
76 | * putw:: Write a word (int) to a file or stream |
---|
77 | * putwchar:: Write a wide character to standard output |
---|
78 | * remove:: Delete a file's name |
---|
79 | * rename:: Rename a file |
---|
80 | * rewind:: Reinitialize a file or stream |
---|
81 | * setbuf:: Specify full buffering for a file or stream |
---|
82 | * setbuffer:: Specify full buffering for a file or stream with size |
---|
83 | * setlinebuf:: Specify line buffering for a file or stream |
---|
84 | * setvbuf:: Specify buffering for a file or stream |
---|
85 | * siprintf:: Write formatted output (integer only) |
---|
86 | * siscanf:: Scan and format input (integer only) |
---|
87 | * sprintf:: Write formatted output |
---|
88 | * sscanf:: Scan and format input |
---|
89 | * stdio_ext:: Access internals of FILE structure |
---|
90 | * swprintf:: Write formatted wide character output |
---|
91 | * swscanf:: Scan and format wide character input |
---|
92 | * tmpfile:: Create a temporary file |
---|
93 | * tmpnam:: Generate name for a temporary file |
---|
94 | * ungetc:: Push data back into a stream |
---|
95 | * ungetwc:: Push wide character data back into a stream |
---|
96 | * vfprintf:: Format variable argument list |
---|
97 | * vfscanf:: Scan variable argument list |
---|
98 | * vfwprintf:: Format variable wide character argument list |
---|
99 | * vfwscanf:: Scan and format argument list from wide character input |
---|
100 | * viprintf:: Format variable argument list (integer only) |
---|
101 | * viscanf:: Scan variable format list (integer only) |
---|
102 | @end menu |
---|
103 | |
---|
104 | @page |
---|
105 | @include stdio/clearerr.def |
---|
106 | |
---|
107 | @page |
---|
108 | @include stdio/diprintf.def |
---|
109 | |
---|
110 | @page |
---|
111 | @include stdio/dprintf.def |
---|
112 | |
---|
113 | @page |
---|
114 | @include stdio/fclose.def |
---|
115 | |
---|
116 | @page |
---|
117 | @include stdio/fcloseall.def |
---|
118 | |
---|
119 | @page |
---|
120 | @include stdio/fdopen.def |
---|
121 | |
---|
122 | @page |
---|
123 | @include stdio/feof.def |
---|
124 | |
---|
125 | @page |
---|
126 | @include stdio/ferror.def |
---|
127 | |
---|
128 | @page |
---|
129 | @include stdio/fflush.def |
---|
130 | |
---|
131 | @page |
---|
132 | @include stdio/fgetc.def |
---|
133 | |
---|
134 | @page |
---|
135 | @include stdio/fgetpos.def |
---|
136 | |
---|
137 | @page |
---|
138 | @include stdio/fgets.def |
---|
139 | |
---|
140 | @page |
---|
141 | @include stdio/fgetwc.def |
---|
142 | |
---|
143 | @page |
---|
144 | @include stdio/fgetws.def |
---|
145 | |
---|
146 | @page |
---|
147 | @include stdio/fileno.def |
---|
148 | |
---|
149 | @page |
---|
150 | @include stdio/fmemopen.def |
---|
151 | |
---|
152 | @page |
---|
153 | @include stdio/fopen.def |
---|
154 | |
---|
155 | @page |
---|
156 | @include stdio/fopencookie.def |
---|
157 | |
---|
158 | @page |
---|
159 | @include stdio/fpurge.def |
---|
160 | |
---|
161 | @page |
---|
162 | @include stdio/fputc.def |
---|
163 | |
---|
164 | @page |
---|
165 | @include stdio/fputs.def |
---|
166 | |
---|
167 | @page |
---|
168 | @include stdio/fputwc.def |
---|
169 | |
---|
170 | @page |
---|
171 | @include stdio/fputws.def |
---|
172 | |
---|
173 | @page |
---|
174 | @include stdio/fread.def |
---|
175 | |
---|
176 | @page |
---|
177 | @include stdio/freopen.def |
---|
178 | |
---|
179 | @page |
---|
180 | @include stdio/fseek.def |
---|
181 | |
---|
182 | @page |
---|
183 | @include stdio/fsetlocking.def |
---|
184 | |
---|
185 | @page |
---|
186 | @include stdio/fsetpos.def |
---|
187 | |
---|
188 | @page |
---|
189 | @include stdio/ftell.def |
---|
190 | |
---|
191 | @page |
---|
192 | @include stdio/funopen.def |
---|
193 | |
---|
194 | @page |
---|
195 | @include stdio/fwide.def |
---|
196 | |
---|
197 | @page |
---|
198 | @include stdio/fwrite.def |
---|
199 | |
---|
200 | @page |
---|
201 | @include stdio/getc.def |
---|
202 | |
---|
203 | @page |
---|
204 | @include stdio/getc_u.def |
---|
205 | |
---|
206 | @page |
---|
207 | @include stdio/getchar.def |
---|
208 | |
---|
209 | @page |
---|
210 | @include stdio/getchar_u.def |
---|
211 | |
---|
212 | @page |
---|
213 | @include stdio/getdelim.def |
---|
214 | |
---|
215 | @page |
---|
216 | @include stdio/getline.def |
---|
217 | |
---|
218 | @page |
---|
219 | @include stdio/gets.def |
---|
220 | |
---|
221 | @page |
---|
222 | @include stdio/getw.def |
---|
223 | |
---|
224 | @page |
---|
225 | @include stdio/getwchar.def |
---|
226 | |
---|
227 | @page |
---|
228 | @include stdio/mktemp.def |
---|
229 | |
---|
230 | @page |
---|
231 | @include stdio/open_memstream.def |
---|
232 | |
---|
233 | @page |
---|
234 | @include stdio/perror.def |
---|
235 | |
---|
236 | @page |
---|
237 | @include stdio/putc.def |
---|
238 | |
---|
239 | @page |
---|
240 | @include stdio/putc_u.def |
---|
241 | |
---|
242 | @page |
---|
243 | @include stdio/putchar.def |
---|
244 | |
---|
245 | @page |
---|
246 | @include stdio/putchar_u.def |
---|
247 | |
---|
248 | @page |
---|
249 | @include stdio/puts.def |
---|
250 | |
---|
251 | @page |
---|
252 | @include stdio/putw.def |
---|
253 | |
---|
254 | @page |
---|
255 | @include stdio/putwchar.def |
---|
256 | |
---|
257 | @page |
---|
258 | @include stdio/remove.def |
---|
259 | |
---|
260 | @page |
---|
261 | @include stdio/rename.def |
---|
262 | |
---|
263 | @page |
---|
264 | @include stdio/rewind.def |
---|
265 | |
---|
266 | @page |
---|
267 | @include stdio/setbuf.def |
---|
268 | |
---|
269 | @page |
---|
270 | @include stdio/setbuffer.def |
---|
271 | |
---|
272 | @page |
---|
273 | @include stdio/setlinebuf.def |
---|
274 | |
---|
275 | @page |
---|
276 | @include stdio/setvbuf.def |
---|
277 | |
---|
278 | @page |
---|
279 | @include stdio/siprintf.def |
---|
280 | |
---|
281 | @page |
---|
282 | @include stdio/siscanf.def |
---|
283 | |
---|
284 | @page |
---|
285 | @include stdio/sprintf.def |
---|
286 | |
---|
287 | @page |
---|
288 | @include stdio/sscanf.def |
---|
289 | |
---|
290 | @page |
---|
291 | @include stdio/stdio_ext.def |
---|
292 | |
---|
293 | @page |
---|
294 | @include stdio/swprintf.def |
---|
295 | |
---|
296 | @page |
---|
297 | @include stdio/swscanf.def |
---|
298 | |
---|
299 | @page |
---|
300 | @include stdio/tmpfile.def |
---|
301 | |
---|
302 | @page |
---|
303 | @include stdio/tmpnam.def |
---|
304 | |
---|
305 | @page |
---|
306 | @include stdio/ungetc.def |
---|
307 | |
---|
308 | @page |
---|
309 | @include stdio/ungetwc.def |
---|
310 | |
---|
311 | @page |
---|
312 | @include stdio/vfprintf.def |
---|
313 | |
---|
314 | @page |
---|
315 | @include stdio/vfscanf.def |
---|
316 | |
---|
317 | @page |
---|
318 | @include stdio/vfwprintf.def |
---|
319 | |
---|
320 | @page |
---|
321 | @include stdio/vfwscanf.def |
---|
322 | |
---|
323 | @page |
---|
324 | @include stdio/viprintf.def |
---|
325 | |
---|
326 | @page |
---|
327 | @include stdio/viscanf.def |
---|