2 Copyright © 1995-2012, 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>
15 /*****************************************************************************
27 Push the character c character back into the stream.
30 c - Put this character back into the stream. The next read will
31 return this character. If you push back more than one
32 character, then they will be returned in reverse order.
33 The function gurantees that one character can be
34 pushed back but no more. It is possible to push the EOF
35 character back into the stream.
36 stream - Read from this stream
48 fgetc(), getc(), fputc(), putc()
52 ******************************************************************************/
54 fdesc
*fdesc
= __getfdesc(stream
->fd
);
58 stream
->flags
|= _STDIO_ERROR
;
63 /* Note: changes here might require changes in vfscanf.c!! */
68 if (!UnGetC ((BPTR
)fdesc
->fcb
->fh
, c
))
70 errno
= __arosc_ioerr2errno (IoErr ());
73 stream
->flags
|= _STDIO_ERROR
;
75 stream
->flags
|= _STDIO_EOF
;