UNGETC(3) BSD Programmer's Manual UNGETC(3)
u
\bun
\bng
\bge
\bet
\btc
\bc - un-get character from input stream
S
\bSY
\bYN
\bNO
\bOP
\bPS
\bSI
\bIS
\bS
#
\b#i
\bin
\bnc
\bcl
\blu
\bud
\bde
\be <
\b<s
\bst
\btd
\bdi
\bio
\bo.
\b.h
\bh>
\b>
u
\bun
\bng
\bge
\bet
\btc
\bc(_
\bi_
\bn_
\bt _
\bc, _
\bF_
\bI_
\bL_
\bE _
\b*_
\bs_
\bt_
\br_
\be_
\ba_
\bm);
D
\bDE
\bES
\bSC
\bCR
\bRI
\bIP
\bPT
\bTI
\bIO
\bON
\bN
The u
\bun
\bng
\bge
\bet
\btc
\bc() function pushes the character _
\bc (converted to an unsigned
char) back onto the input stream pointed to by _
\bs_
\bt_
\br_
\be_
\ba_
\bm. The pushed-backed
characters will be returned by subsequent reads on the stream (in reverse
order). A successful intervening call, using the same stream, to one of
the file positioning functions (fseek(3), fsetpos(3), or rewind(3))
will discard the pushed back characters.
One character of push-back is guaranteed, but as long as there is suffi-
cient memory, an effectively infinite amount of pushback is allowed.
If a character is successfully pushed-back, the end-of-file indicator for
R
\bRE
\bET
\bTU
\bUR
\bRN
\bN V
\bVA
\bAL
\bLU
\bUE
\bES
\bS
The u
\bun
\bng
\bge
\bet
\btc
\bc() function returns the character pushed-back after the conver-
sion, or EOF if the operation fails. If the value of the argument _
\bc
character equals EOF, the operation will fail and the stream will remain
S
\bSE
\bEE
\bE A
\bAL
\bLS
\bSO
\bO
getc(3), fseek(3), setvbuf(3)
S
\bST
\bTA
\bAN
\bND
\bDA
\bAR
\bRD
\bDS
\bS
The u
\bun
\bng
\bge
\bet
\btc
\bc() function conforms to ANSI C X3.159-1989 (``ANSI C '').