xref: /csrg-svn/usr.bin/pascal/libpc/GET.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  */
71655Smckusick 
840865Sbostic #ifndef lint
9*62092Sbostic static char sccsid[] = "@(#)GET.c	8.1 (Berkeley) 06/06/93";
1040865Sbostic #endif /* not lint */
111655Smckusick 
121655Smckusick #include "h00vars.h"
131655Smckusick 
GET(curfile)141655Smckusick GET(curfile)
151655Smckusick 
161655Smckusick 	register struct iorec	*curfile;
171655Smckusick {
181655Smckusick 	if (curfile->funit & FWRITE) {
193867Smckusic 		ERROR("%s: Attempt to read, but open for writing\n",
203867Smckusic 			curfile->pfname);
211655Smckusick 		return;
221655Smckusick 	}
231655Smckusick 	IOSYNC(curfile);
241655Smckusick 	if (curfile->funit & EOFF) {
253867Smckusic 		ERROR("%s: Tried to read past end of file\n", curfile->pfname);
261655Smckusick 		return;
271655Smckusick 	}
281655Smckusick 	curfile->funit |= SYNC;
291655Smckusick }
30