2020-07-16 14:02:51 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <__fio.h>
|
|
|
|
|
|
|
|
|
|
int fgetc(FILE *fp)
|
|
|
|
|
{
|
|
|
|
|
char ch = 0;
|
2022-05-11 22:06:28 +01:00
|
|
|
unsigned int r = __fio_read(fp, &ch, 1);
|
|
|
|
|
if (r == 0 || __fio_error(fp) || __fio_eof(fp)) {
|
2020-07-16 14:02:51 +01:00
|
|
|
return EOF;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ch;
|
|
|
|
|
}
|