Subversion Repositories Kolibri OS

Rev

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

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #include <stdio.h>
  3. #include <libc/file.h>
  4.  
  5. int
  6. fpurge(FILE *f)
  7. {
  8.   char *base;
  9.  
  10.   if ((f->_flag&(_IONBF|_IOWRT))==_IOWRT
  11.       && (base = f->_base) != NULL
  12.       && (f->_ptr - base) > 0)
  13.   {
  14.     f->_ptr = base;
  15.     f->_cnt = (f->_flag&(_IOLBF|_IONBF)) ? 0 : f->_bufsiz;
  16.   }
  17.   return 0;
  18. }
  19.