[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    ungetwc(3I) manual page Table of Contents

Name

ungetwc - push a Process Code character back into input stream

Synopsis

cc [ flag ... ] file ... -lw [ library ... ]


#include <stdio.h>
#include <widec.h>

int ungetwc(int c, FILE *stream);

MT-Level

MT-Safe

Description

ungetwc() pushes back the Process Code character c onto an input stream. That character will be returned by the next getwc(3I) call on that stream. ungetwc() returns c, and leaves the file stream unchanged.

One character of pushback is guaranteed provided something has been read from the stream and the stream is actually buffered. In the case that stream is stdin, one character may be pushed back onto the buffer without a previous read statement.

If c equals EOF , ungetwc() does nothing to the buffer and returns EOF .

An fseek(3S) erases all memory of pushed back characters.

Return Values

ungetwc() returns EOF if it can’t push a character back.

See Also

fseek(3S) , getwc(3I) , setbuf(3S) , ungetc(3S)


Table of Contents