xref: /csrg-svn/usr.bin/pascal/libpc/PFLUSH.c (revision 40865)
1*40865Sbostic /*-
2*40865Sbostic  * Copyright (c) 1979 The Regents of the University of California.
3*40865Sbostic  * All rights reserved.
4*40865Sbostic  *
5*40865Sbostic  * %sccs.include.redist.c%
6*40865Sbostic  */
71674Smckusick 
8*40865Sbostic #ifndef lint
9*40865Sbostic static char sccsid[] = "@(#)PFLUSH.c	1.3 (Berkeley) 04/09/90";
10*40865Sbostic #endif /* not lint */
111674Smckusick 
121674Smckusick #include "h00vars.h"
131674Smckusick 
141674Smckusick /*
151674Smckusick  * insure that a usable image is in the buffer window
161674Smckusick  */
171674Smckusick PFLUSH()
181674Smckusick {
191674Smckusick 	register struct iorec	*next;
201674Smckusick 
2110564Smckusick 	for (next = _fchain.fchain; next != FILNIL; next = next->fchain) {
2210564Smckusick 		if ((next->funit & (FDEF | FREAD)) != 0)
2310564Smckusick 			continue;
2410564Smckusick 		if (next->fbuf != 0)
251674Smckusick 			fflush(next->fbuf);
261674Smckusick 	}
271674Smckusick }
28