date and time created 82/02/02 16:00:30 by mckusick
[unix-history] / usr / src / usr.bin / pascal / libpc / UNIT.c
CommitLineData
0d82265d
KM
1/* Copyright (c) 1979 Regents of the University of California */
2
86997b19 3static char sccsid[] = "@(#)UNIT.c 1.2 %G%";
0d82265d
KM
4
5#include "h00vars.h"
0d82265d
KM
6
7struct iorec *
8UNIT(curfile)
9
10 register struct iorec *curfile;
11{
12 if (curfile->fblk >= MAXFILES || _actfile[curfile->fblk] != curfile) {
86997b19 13 ERROR("Reference to an inactive file\n", 0);
0d82265d
KM
14 return;
15 }
16 if (curfile->funit & FDEF) {
86997b19 17 ERROR("%s: Reference to an inactive file\n", curfile->pfname);
0d82265d
KM
18 return;
19 }
20 return curfile;
21}