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

  1. /*-----------------------------------------------------------------------*
  2.  * filename - xfflush.c
  3.  *
  4.  * function(s)
  5.  *        _xfflush - flushes streams
  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        _xfflush - flushes streams
  23.  
  24. Usage        void _xfflush(void)
  25.  
  26. Description    called at exit to flush open streams
  27.  
  28. *---------------------------------------------------------------------*/
  29. void _xfflush(void)
  30. {
  31.     register FILE    *fp;
  32.     register int    i = 4;
  33.  
  34.     for (fp = _streams; i; i--, fp++)
  35.         if (fp->flags & _F_RDWR)
  36.             fflush(fp);
  37. }
  38.