forked from Stichting-MINIX-Research-Foundation/minix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathungetc.3
More file actions
41 lines (40 loc) · 782 Bytes
/
Copy pathungetc.3
File metadata and controls
41 lines (40 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
.\" @(#)ungetc.3s 6.1 (Berkeley) 5/15/85
.\"
.TH UNGETC 3 "May 15, 1985"
.AT 3
.SH NAME
ungetc \- push character back into input stream
.SH SYNOPSIS
.nf
.ft B
#include <stdio.h>
int ungetc(int \fIc\fP, FILE *\fIstream\fP)
.ft R
.fi
.SH DESCRIPTION
.B Ungetc
pushes the character
.I c
back on an input stream. That character will be returned by the next
.B getc
call on that stream.
.B Ungetc
returns
.IR c .
.PP
One character of pushback is guaranteed provided
something has been read from the stream and the stream is actually buffered.
Attempts to push EOF are rejected.
.PP
.BR Fseek (3)
erases all memory of pushed back characters.
.SH "SEE ALSO"
.BR getc (3),
.BR setbuf (3),
.BR fseek (3).
.SH DIAGNOSTICS
.B Ungetc
returns
.SM
.B EOF
if it can't push a character back.