|
|
HP-UX Reference > Uungetc(3S)HP-UX 11i Version 2: December 2007 Update |
|
NAMEungetc(), ungetc_unlocked() — push character back into input stream DESCRIPTIONungetc() inserts the character c (converted to an unsigned char) into the buffer associated with an input stream. That character, c, is returned by the next call to getc() (see getc(3S)) on that stream. A successful intervening call to a file positioning function with stream (fseek(), fsetpos(), or rewind()) erases all memory of the inserted characters. ungetc() affects only the buffer associated with the input stream. It does not affect the contents of the file corresponding to stream. One character of pushback is guaranteed. If c equals EOF, ungetc() does nothing to the buffer and returns EOF. APPLICATION USAGEAfter ungetc() is applied to a stream, the stream becomes byte-oriented (see orientation(5)). RETURN VALUEIf successful, ungetc() and ungetc_unlocked() return c and clear the end-of-file indicator for the stream. ungetc() and ungetc_unlocked() return EOF if they cannot insert the character. WARNINGSungetc_unlocked() is an obsolescent interface supported only for compatibility with existing DCE applications. New multithreaded applications should use ungetc(). SEE ALSOflockfile(3S), fseek(3S), fgetpos(3S), getc(3S), setbuf(3S), orientation(5), thread_safety(5). |
|