Google
 

Trailing-Edge - PDP-10 Archives - SRI_NIC_PERM_FS_1_19910112 - kccdist/lib/stdio/cleanu.c
There are 8 other files named cleanu.c in the archive. Click here to see a list.
/*
 *	_CLEANUP - final cleanup for stdio upon exit
 *
 *	Copyright (c) 1986 by Ian Macky, SRI International
 */

#include "stdio.h"

void _cleanup()
{
    int i;
    FILE *fp;

    for (i = 0; i < SYS_OPEN; i++)		/* close static FILEs */
	if (_sios[i].sioflgs & _SIOF_OPEN)
	    fclose(&_sios[i]);

    while (_FILE_head) {			/* close dynamic FILEs */
	fp = _FILE_head->sionFILE;		/* next FILE in chain */
	fclose(_FILE_head);
	_FILE_head = fp;
    }	
}