Subversion Repositories Kolibri OS

Rev

Rev 145 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
145 halyavin 1
#include "stdio.h"
2
int ungetc(int c,FILE* file)
3
{
610 andrew_pro 4
	dword res;
5
 
145 halyavin 6
	if (c==EOF)
7
		return EOF;
8
	if (file->filepos<=0 || file->filepos>file->filesize)
9
		return EOF;
10
	file->filepos--;
610 andrew_pro 11
	res=_ksys_readfile(file->filename,file->filepos,1,file->buffer);
12
	if (res==0)
13
	{
14
		return(c);
15
	}
16
	else return(EOF);
145 halyavin 17
}