2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
5 ANSI C function fgetc().
10 #include <dos/dosextens.h>
11 #include <proto/exec.h>
12 #include <proto/dos.h>
17 /*****************************************************************************
28 Read one character from the stream. If there is no character
29 available or an error occurred, the function returns EOF.
32 stream - Read from this stream
35 The character read or EOF on end of file or error.
44 getc(), fputc(), putc()
48 ******************************************************************************/
51 fdesc
*fdesc
= __getfdesc(stream
->fd
);
56 stream
->flags
|= _STDIO_ERROR
;
60 /* Note: changes here might require changes in vfscanf.c!! */
62 c
= FGetC ((BPTR
)(fdesc
->fcb
->fh
));
69 errno
= IoErr2errno (c
);
71 stream
->flags
|= _STDIO_ERROR
;
74 stream
->flags
|= _STDIO_EOF
;