home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / ansi / stdio / stdiohk.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-27  |  399 b   |  20 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #include <stdio.h>
  3. #include <libc/file.h>
  4. #include <libc/local.h>
  5.  
  6. static void fcloseall_helper(FILE *f)
  7. {
  8.   fflush(f);
  9.   if (fileno(f) > 2)
  10.     fclose(f);
  11. }
  12.  
  13. void __stdio_cleanup_proc(void);
  14. void __stdio_cleanup_proc(void)
  15. {
  16.   _fwalk(fcloseall_helper);
  17. }
  18.  
  19. void (*__stdio_cleanup_hook)(void) = __stdio_cleanup_proc;
  20.