Commit | Line | Data |
---|---|---|
c4665c80 TL |
1 | .TH UNGETC 3S |
2 | .SH NAME | |
3 | ungetc \- push character back into input stream | |
4 | .SH SYNOPSIS | |
5 | .B #include <stdio.h> | |
6 | .PP | |
7 | .B ungetc(c, stream) | |
8 | .br | |
9 | .SM | |
10 | .B FILE | |
11 | .B *stream; | |
12 | .SH DESCRIPTION | |
13 | .I Ungetc | |
14 | pushes the character | |
15 | .I c | |
16 | back on an input stream. | |
17 | That character will be returned by the next | |
18 | .I getc | |
19 | call on that stream. | |
20 | .I Ungetc | |
21 | returns | |
22 | .IR c . | |
23 | .PP | |
24 | One character of pushback is guaranteed provided | |
25 | something has been read from the stream and the stream is | |
26 | actually buffered. | |
27 | Attempts to push EOF are rejected. | |
28 | .PP | |
29 | .IR Fseek (3) | |
30 | erases all memory of pushed back characters. | |
31 | .SH "SEE ALSO" | |
32 | getc(3), setbuf(3), fseek(3) | |
33 | .SH DIAGNOSTICS | |
34 | .I Ungetc | |
35 | returns | |
36 | .SM | |
37 | .B EOF | |
38 | if it can't push a character back. |