Subversion Repositories Kolibri OS

Rev

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

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