Subversion Repositories Kolibri OS

Rev

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

  1. #include "kolibc.h"
  2. #include "kolibri.h"
  3.  
  4. int fsetpos(FILE* f,const fpos_t * pos)
  5. { int err;
  6.   size_t bytes;
  7.  
  8.   if (*pos>=0)
  9.   {
  10.     bytes= *pos & -4096;
  11.     err=read_file(f->filename,f->buffer,bytes,
  12.                              4096,&bytes);
  13.     if (err) return EOF;
  14.     if(!bytes) return EOF;    
  15.     f->filepos= *pos & -4096;
  16.     f->strpos = *pos & 4095;
  17.     f->remain = 4096-f->strpos;
  18.     f->stream = f->buffer+f->strpos;
  19.     return 0;
  20.   }
  21.   else
  22.     return EOF;
  23. }