xref: /csrg-svn/usr.bin/pascal/libpc/PCLOSE.c (revision 62092)
140865Sbostic /*-
2*62092Sbostic  * Copyright (c) 1979, 1993
3*62092Sbostic  *	The Regents of the University of California.  All rights reserved.
440865Sbostic  *
540865Sbostic  * %sccs.include.redist.c%
640865Sbostic  */
71672Smckusick 
840865Sbostic #ifndef lint
9*62092Sbostic static char sccsid[] = "@(#)PCLOSE.c	8.1 (Berkeley) 06/06/93";
1040865Sbostic #endif /* not lint */
111672Smckusick 
127969Smckusick /*
137969Smckusick  * Close all files associated with the topmost stack frame.
147969Smckusick  */
157969Smckusick 
161672Smckusick #include "h00vars.h"
177969Smckusick #include "libpc.h"
181672Smckusick 
191672Smckusick PCLOSE(level)
201672Smckusick 
211672Smckusick 	struct iorec		*level;
221672Smckusick {
231672Smckusick 	register struct iorec	*next;
241672Smckusick 
251672Smckusick 	next = _fchain.fchain;
261672Smckusick 	while(next != FILNIL && next->flev <= level) {
2710563Smckusick 		next = PFCLOSE(next, TRUE);
281672Smckusick 	}
291672Smckusick 	_fchain.fchain = next;
301672Smckusick }
31