2 @chapter Input and Output (@file
{stdio.h
})
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.
8 The underlying facilities for input and output depend on the host
9 system, but these functions provide a uniform interface.
11 The corresponding declarations are in @file
{stdio.h
}.
13 The reentrant versions of these functions use macros
17 _stdout_r(@var
{reent
})
18 _stderr_r(@var
{reent
})
22 instead of the globals @code
{stdin
}, @code
{stdout
}, and
23 @code
{stderr
}. The argument @var
{reent
} is a pointer to a reentrancy
27 * Function clearerr:: Clear file or stream error indicator
28 * Function diprintf:: Print to a file descriptor (integer only)
29 * Function dprintf:: Print to a file descriptor
30 * Function fclose:: Close a file
31 * Function fcloseall:: Close all files
32 * Function fdopen:: Turn an open file into a stream
33 * Function feof:: Test for end of file
34 * Function ferror:: Test whether read/write error has occurred
35 * Function fflush:: Flush buffered file output
36 * Function fgetc:: Get a character from a file or stream
37 * Function fgetpos:: Record position in a stream or file
38 * Function fgets:: Get character string from a file or stream
39 * Function fgetwc:: Get a wide character from a file or stream
40 * Function fgetws:: Get a wide character string from a file or stream
41 * Function fileno:: Get file descriptor associated with stream
42 * Function fmemopen:: Open a stream around a fixed-length buffer
43 * Function fopen:: Open a file
44 * Function fopencookie:: Open a stream with custom callbacks
45 * Function fpurge:: Discard all pending I/O on a stream
46 * Function fputc:: Write a character on a stream or file
47 * Function fputs:: Write a character string in a file or stream
48 * Function fputwc:: Write a wide character to a file or stream
49 * Function fputws:: Write a wide character string to a file or stream
50 * Function fread:: Read array elements from a file
51 * Function freopen:: Open a file using an existing file descriptor
52 * Function fseek:: Set file position
53 * Function __fsetlocking:: Set or query locking mode on FILE stream
54 * Function fsetpos:: Restore position of a stream or file
55 * Function ftell:: Return position in a stream or file
56 * Function funopen:: Open a stream with custom callbacks
57 * Function fwide:: Set and determine the orientation of a FILE stream
58 * Function fwrite:: Write array elements from memory to a file or stream
59 * Function getc:: Get a character from a file or stream (macro)
60 * Function getc_unlocked:: Get a character from a file or stream (macro)
61 * Function getchar:: Get a character from standard input (macro)
62 * Function getchar_unlocked:: Get a character from standard input (macro)
63 * Function getdelim:: Get character string from a file or stream
64 * Function getline:: Get character string from a file or stream
65 * Function gets:: Get character string from standard input (obsolete)
66 * Function getw:: Get a word (int) from a file or stream
67 * Function getwchar:: Get a wide character from standard input
68 * Function mktemp:: Generate unused file name
69 * Function open_memstream:: Open a write stream around an arbitrary-length buffer
70 * Function perror:: Print an error message on standard error
71 * Function putc:: Write a character on a stream or file (macro)
72 * Function putc_unlocked:: Write a character on a stream or file (macro)
73 * Function putchar:: Write a character on standard output (macro)
74 * Function putchar_unlocked:: Write a character on standard output (macro)
75 * Function puts:: Write a character string on standard output
76 * Function putw:: Write a word (int) to a file or stream
77 * Function putwchar:: Write a wide character to standard output
78 * Function remove:: Delete a file's name
79 * Function rename:: Rename a file
80 * Function rewind:: Reinitialize a file or stream
81 * Function setbuf:: Specify full buffering for a file or stream
82 * Function setbuffer:: Specify full buffering for a file or stream with size
83 * Function setlinebuf:: Specify line buffering for a file or stream
84 * Function setvbuf:: Specify buffering for a file or stream
85 * Function siprintf:: Write formatted output (integer only)
86 * Function siscanf:: Scan and format input (integer only)
87 * Function sprintf:: Write formatted output
88 * Function sscanf:: Scan and format input
89 * Function stdio_ext:: Access internals of FILE structure
90 * Function swprintf:: Write formatted wide character output
91 * Function swscanf:: Scan and format wide character input
92 * Function tmpfile:: Create a temporary file
93 * Function tmpnam:: Generate name for a temporary file
94 * Function ungetc:: Push data back into a stream
95 * Function ungetwc:: Push wide character data back into a stream
96 * Function vfprintf:: Format variable argument list
97 * Function vfscanf:: Scan variable argument list
98 * Function vfwprintf:: Format variable wide character argument list
99 * Function vfwscanf:: Scan and format argument list from wide character input
100 * Function viprintf:: Format variable argument list (integer only)
101 * Function viscanf:: Scan variable format list (integer only)
105 @include stdio/clearerr.def
108 @include stdio/diprintf.def
111 @include stdio/dprintf.def
114 @include stdio/fclose.def
117 @include stdio/fcloseall.def
120 @include stdio/fdopen.def
123 @include stdio/feof.def
126 @include stdio/ferror.def
129 @include stdio/fflush.def
132 @include stdio/fgetc.def
135 @include stdio/fgetpos.def
138 @include stdio/fgets.def
141 @include stdio/fgetwc.def
144 @include stdio/fgetws.def
147 @include stdio/fileno.def
150 @include stdio/fmemopen.def
153 @include stdio/fopen.def
156 @include stdio/fopencookie.def
159 @include stdio/fpurge.def
162 @include stdio/fputc.def
165 @include stdio/fputs.def
168 @include stdio/fputwc.def
171 @include stdio/fputws.def
174 @include stdio/fread.def
177 @include stdio/freopen.def
180 @include stdio/fseek.def
183 @include stdio/fsetlocking.def
186 @include stdio/fsetpos.def
189 @include stdio/ftell.def
192 @include stdio/funopen.def
195 @include stdio/fwide.def
198 @include stdio/fwrite.def
201 @include stdio/getc.def
204 @include stdio/getc_u.def
207 @include stdio/getchar.def
210 @include stdio/getchar_u.def
213 @include stdio/getdelim.def
216 @include stdio/getline.def
219 @include stdio/gets.def
222 @include stdio/getw.def
225 @include stdio/getwchar.def
228 @include stdio/mktemp.def
231 @include stdio/open_memstream.def
234 @include stdio/perror.def
237 @include stdio/putc.def
240 @include stdio/putc_u.def
243 @include stdio/putchar.def
246 @include stdio/putchar_u.def
249 @include stdio/puts.def
252 @include stdio/putw.def
255 @include stdio/putwchar.def
258 @include stdio/remove.def
261 @include stdio/rename.def
264 @include stdio/rewind.def
267 @include stdio/setbuf.def
270 @include stdio/setbuffer.def
273 @include stdio/setlinebuf.def
276 @include stdio/setvbuf.def
279 @include stdio/siprintf.def
282 @include stdio/siscanf.def
285 @include stdio/sprintf.def
288 @include stdio/sscanf.def
291 @include stdio/stdio_ext.def
294 @include stdio/swprintf.def
297 @include stdio/swscanf.def
300 @include stdio/tmpfile.def
303 @include stdio/tmpnam.def
306 @include stdio/ungetc.def
309 @include stdio/ungetwc.def
312 @include stdio/vfprintf.def
315 @include stdio/vfscanf.def
318 @include stdio/vfwprintf.def
321 @include stdio/vfwscanf.def
324 @include stdio/viprintf.def
327 @include stdio/viscanf.def