xref: /original-bsd/usr.bin/pascal/libpc/PFLUSH.c (revision e4dd4c49)
1 /*-
2  * Copyright (c) 1979 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)PFLUSH.c	1.3 (Berkeley) 04/09/90";
10 #endif /* not lint */
11 
12 #include "h00vars.h"
13 
14 /*
15  * insure that a usable image is in the buffer window
16  */
17 PFLUSH()
18 {
19 	register struct iorec	*next;
20 
21 	for (next = _fchain.fchain; next != FILNIL; next = next->fchain) {
22 		if ((next->funit & (FDEF | FREAD)) != 0)
23 			continue;
24 		if (next->fbuf != 0)
25 			fflush(next->fbuf);
26 	}
27 }
28