xref: /csrg-svn/usr.bin/pascal/libpc/FLUSH.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  */
71651Smckusick 
840865Sbostic #ifndef lint
9*62092Sbostic static char sccsid[] = "@(#)FLUSH.c	8.1 (Berkeley) 06/06/93";
1040865Sbostic #endif /* not lint */
111651Smckusick 
121651Smckusick #include "h00vars.h"
131651Smckusick 
FLUSH(curfile)141651Smckusick FLUSH(curfile)
151651Smckusick 
161651Smckusick 	register struct iorec	*curfile;
171651Smckusick {
181651Smckusick 	if (curfile->fblk >= MAXFILES || _actfile[curfile->fblk] != curfile) {
193867Smckusic 		ERROR("Reference to an inactive file\n", 0);
201651Smckusick 		return;
211651Smckusick 	}
221651Smckusick 	if (curfile->funit & FWRITE) {
231651Smckusick 		fflush(curfile->fbuf);
241651Smckusick 	}
251651Smckusick }
26