1*1712Smckusick /* Copyright (c) 1979 Regents of the University of California */ 2*1712Smckusick 3*1712Smckusick static char sccsid[] = "@(#)UNIT.c 1.1 10/30/80"; 4*1712Smckusick 5*1712Smckusick #include "h00vars.h" 6*1712Smckusick #include "h01errs.h" 7*1712Smckusick 8*1712Smckusick struct iorec * 9*1712Smckusick UNIT(curfile) 10*1712Smckusick 11*1712Smckusick register struct iorec *curfile; 12*1712Smckusick { 13*1712Smckusick if (curfile->fblk >= MAXFILES || _actfile[curfile->fblk] != curfile) { 14*1712Smckusick ERROR(ENOFILE, 0); 15*1712Smckusick return; 16*1712Smckusick } 17*1712Smckusick if (curfile->funit & FDEF) { 18*1712Smckusick ERROR(EREFINAF, curfile->pfname); 19*1712Smckusick return; 20*1712Smckusick } 21*1712Smckusick return curfile; 22*1712Smckusick } 23