#include <stdio.h>
#include <unistd.h>
-#include <errno.h>
#include "_file.h"
-int fgetc (FILE* f)
+int __fastcall__ fgetc (register FILE* f)
{
unsigned char c;
return EOF;
}
- /* Read the byte */
+ /* If we have a pushed back character, return it */
+ if (f->f_flags & _FPUSHBACK) {
+ f->f_flags &= ~_FPUSHBACK;
+ return f->f_pushback;
+ }
+
+ /* Read one byte */
switch (read (f->f_fd, &c, 1)) {
case -1: