Subversion Repositories Kolibri OS

Rev

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

  1. /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
  2. #include <libc/stubs.h>
  3. #include <stdio.h>
  4. #include <unistd.h>
  5. #include <libc/file.h>
  6.  
  7. void rewind(FILE *f)
  8. {
  9.   fflush(f);
  10.   lseek(fileno(f), 0L, SEEK_SET);
  11.   f->_cnt = 0;
  12.   f->_ptr = f->_base;
  13.   f->_flag &= ~(_IOERR|_IOEOF);
  14.   if (f->_flag & _IORW)
  15.     f->_flag &= ~(_IOREAD|_IOWRT);
  16. }
  17.