xref: /csrg-svn/usr.bin/pascal/libpc/GET.c (revision 1655)
1*1655Smckusick /* Copyright (c) 1979 Regents of the University of California */
2*1655Smckusick 
3*1655Smckusick static char sccsid[] = "@(#)GET.c 1.1 10/30/80";
4*1655Smckusick 
5*1655Smckusick #include "h00vars.h"
6*1655Smckusick #include "h01errs.h"
7*1655Smckusick 
8*1655Smckusick GET(curfile)
9*1655Smckusick 
10*1655Smckusick 	register struct iorec	*curfile;
11*1655Smckusick {
12*1655Smckusick 	if (curfile->funit & FWRITE) {
13*1655Smckusick 		ERROR(EREADIT, curfile->pfname);
14*1655Smckusick 		return;
15*1655Smckusick 	}
16*1655Smckusick 	IOSYNC(curfile);
17*1655Smckusick 	if (curfile->funit & EOFF) {
18*1655Smckusick 		ERROR(EPASTEOF, curfile->pfname);
19*1655Smckusick 		return;
20*1655Smckusick 	}
21*1655Smckusick 	curfile->funit |= SYNC;
22*1655Smckusick }
23