home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 1.ddi / CLIBSRC.ZIP / REWIND.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1021 b   |  40 lines

  1. /*-----------------------------------------------------------------------*
  2.  * filename - rewind.c
  3.  *
  4.  * function(s)
  5.  *        rewind - repositions a stream
  6.  *-----------------------------------------------------------------------*/
  7.  
  8. /*
  9.  *      C/C++ Run Time Library - Version 5.0
  10.  *
  11.  *      Copyright (c) 1987, 1992 by Borland International
  12.  *      All Rights Reserved.
  13.  *
  14.  */
  15.  
  16.  
  17. #include <stdio.h>
  18.  
  19. /*-----------------------------------------------------------------------*
  20.  
  21. Name            rewind - repositions a stream
  22.  
  23. Usage           void rewind (FILE *fp);
  24.  
  25. Prototype in    stdio.h
  26.  
  27. Description     resets the file position to the beginning of file.  rewind
  28.                 also clears the end-of-file and error indicators.
  29.  
  30. Return value    success : 0
  31.                 failure : non-zero
  32.  
  33. *------------------------------------------------------------------------*/
  34. void _FARFUNC rewind (FILE _FAR *fp)
  35. {
  36.     if (fseek (fp, 0L, SEEK_SET) == 0)
  37.         fp->flags &= ~_F_ERR;
  38. }
  39.  
  40.