Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ungetc(3S) — svr3 — mips UMIPS RISC/os 5.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fseek(3S)

getc(3S)

setbuf(3S)

stdio(3S)



UNGETC(3S-SVR3)     RISC/os Reference Manual      UNGETC(3S-SVR3)



NAME
     ungetc - push character back into input stream

SYNOPSIS
     #include <stdio.h>

     int ungetc (c, stream)
     int c;
     FILE *stream;

DESCRIPTION
     ungetc inserts the character c into the buffer associated
     with an input stream.  That character, c, will be returned
     by the next getc(3S) call on that stream.  ungetc returns c,
     and leaves the file stream 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.

     fseek(3S) erases all memory of inserted characters.

SEE ALSO
     fseek(3S), getc(3S), setbuf(3S), stdio(3S).

DIAGNOSTICS
     ungetc returns EOF if it cannot insert the character.

BUGS
     When stream is stdin, one character may be pushed back onto
     the buffer without a previous read statement.





















                        Printed 11/19/92                   Page 1



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026