home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 1.ddi / CLIB1.ZIP / REWIND.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-07  |  1.4 KB  |  41 lines

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