xref: /csrg-svn/usr.bin/pascal/libpc/TEOF.c (revision 62096)
140865Sbostic /*-
2*62096Sbostic  * Copyright (c) 1979, 1993
3*62096Sbostic  *	The Regents of the University of California.  All rights reserved.
440865Sbostic  *
540865Sbostic  * %sccs.include.redist.c%
640865Sbostic  */
71708Smckusick 
840865Sbostic #ifndef lint
9*62096Sbostic static char sccsid[] = "@(#)TEOF.c	8.1 (Berkeley) 06/06/93";
1040865Sbostic #endif /* not lint */
111708Smckusick 
121708Smckusick #include "h00vars.h"
131708Smckusick 
143035Smckusic bool
TEOF(filep)151708Smckusick TEOF(filep)
161708Smckusick 
171708Smckusick 	register struct iorec	*filep;
181708Smckusick {
197765Smckusick 	if (filep->fblk >= MAXFILES || _actfile[filep->fblk] != filep ||
207765Smckusick 	    (filep->funit & FDEF)) {
213869Smckusic 		ERROR("Reference to an inactive file\n", 0);
221708Smckusick 		return;
231708Smckusick 	}
247765Smckusick 	if (filep->funit & (EOFF|FWRITE))
251708Smckusick 		return TRUE;
261708Smckusick 	IOSYNC(filep);
271708Smckusick 	if (filep->funit & EOFF)
281708Smckusick 		return TRUE;
291708Smckusick 	return FALSE;
301708Smckusick }
31