NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO
$(OS_DIR)/lib/libc.a #include <stdio.h>int ungetc(int c, FILE *stream);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
The ungetc() function inserts the character c into the buffer associated with an input stream. The c character will be returned by the next getc(3STDC) call on that stream. The ungetc() function returns c, and leaves the stream file unchanged.
One character of pushback is guaranteed, provided something has already been read from the stream and the stream is actually buffered.
If c equals EOF, ungetc() does nothing to the buffer and returns EOF.
Using fseek(3STDC), fsetpos(3STDC) or rewind(3STDC) erases all memory of inserted characters.
The ungetc() function returns EOF if it cannot insert the character.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO