mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-21 06:12:34 +03:00
efd8f1922c
git-svn-id: svn://kolibrios.org@5266 a494cfbc-eb01-0410-851d-a64ba20cac60
22 lines
397 B
C
22 lines
397 B
C
#include <stdio.h>
|
|
int fgetc(FILE* file)
|
|
{
|
|
dword res;
|
|
|
|
if ((file->mode & 3!=FILE_OPEN_READ) && (file->mode & FILE_OPEN_PLUS==0)) return EOF;
|
|
|
|
if (file->filepos>=file->filesize)
|
|
{
|
|
return EOF;
|
|
}
|
|
else
|
|
{
|
|
res=_ksys_readfile(file->filename,file->filepos,1,file->buffer);
|
|
if (res==0)
|
|
{
|
|
file->filepos++;
|
|
return (int)file->buffer[0];
|
|
}
|
|
else return(res);
|
|
}
|
|
} |