2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 ANSI C function ungetc().
10 #include <dos/dosextens.h>
11 #include <proto/exec.h>
12 #include <proto/dos.h>
16 /*****************************************************************************
28 Puch the character c character back into the stream.
31 c - Put this character back into the stream. The next read will
32 return this character. If you push back more than one
33 character, then they will be returned in reverse order.
34 The function gurantees that one character can be
35 pushed back but no more. It is possible to push the EOF
36 character back into the stream.
37 stream - Read from this stream
49 fgetc(), getc(), fputc(), putc()
53 ******************************************************************************/
55 fdesc
*fdesc
= __getfdesc(stream
->fd
);
59 stream
->flags
|= _STDIO_ERROR
;
64 /* Note: changes here might require changes in vfscanf.c!! */
69 if (!UnGetC ((BPTR
)fdesc
->fh
, c
))
71 errno
= IoErr2errno (IoErr ());
74 stream
->flags
|= _STDIO_ERROR
;
76 stream
->flags
|= _STDIO_EOF
;