xref: /csrg-svn/usr.bin/pascal/libpc/UNIT.c (revision 3869)
11712Smckusick /* Copyright (c) 1979 Regents of the University of California */
21712Smckusick 
3*3869Smckusic static char sccsid[] = "@(#)UNIT.c 1.2 06/10/81";
41712Smckusick 
51712Smckusick #include "h00vars.h"
61712Smckusick 
71712Smckusick struct iorec *
81712Smckusick UNIT(curfile)
91712Smckusick 
101712Smckusick 	register struct iorec	*curfile;
111712Smckusick {
121712Smckusick 	if (curfile->fblk >= MAXFILES || _actfile[curfile->fblk] != curfile) {
13*3869Smckusic 		ERROR("Reference to an inactive file\n", 0);
141712Smckusick 		return;
151712Smckusick 	}
161712Smckusick 	if (curfile->funit & FDEF) {
17*3869Smckusic 		ERROR("%s: Reference to an inactive file\n", curfile->pfname);
181712Smckusick 		return;
191712Smckusick 	}
201712Smckusick 	return curfile;
211712Smckusick }
22