Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. #include <stdio.h>
  2. // non standard realization - no support for virtually change char
  3. int ungetc(int c,FILE* file)
  4. {
  5.         dword res;
  6.  
  7.         if ((file->mode & 3!=FILE_OPEN_READ) && (file->mode & FILE_OPEN_PLUS==0)) return EOF;
  8.  
  9.         if (file->filepos>file->filesize || file->filepos==0)
  10.         {
  11.                 return EOF;
  12.         }
  13.         file->filepos--;
  14.  
  15.         return c;
  16. }