date and time created 80/10/30 00:33:16 by mckusick
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Thu, 30 Oct 1980 16:33:16 +0000 (08:33 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Thu, 30 Oct 1980 16:33:16 +0000 (08:33 -0800)
SCCS-vsn: usr.bin/pascal/libpc/FNIL.c 1.1

usr/src/usr.bin/pascal/libpc/FNIL.c [new file with mode: 0644]

diff --git a/usr/src/usr.bin/pascal/libpc/FNIL.c b/usr/src/usr.bin/pascal/libpc/FNIL.c
new file mode 100644 (file)
index 0000000..1f4d6ef
--- /dev/null
@@ -0,0 +1,29 @@
+/* Copyright (c) 1979 Regents of the University of California */
+
+static char sccsid[] = "@(#)FNIL.c 1.1 %G%";
+
+#include "h00vars.h"
+#include "h01errs.h"
+
+char *
+FNIL(curfile)
+
+       register struct iorec   *curfile;
+{
+       if (curfile->fblk >= MAXFILES || _actfile[curfile->fblk] != curfile) {
+               ERROR(ENOFILE, 0);
+               return;
+       }
+       if (curfile->funit & FDEF) {
+               ERROR(EREFINAF, curfile->pfname);
+               return;
+       }
+       if (curfile->funit & FREAD) {
+               IOSYNC(curfile);
+               if (curfile->funit & EOFF) {
+                       ERROR(EPASTEOF, curfile->pfname);
+                       return;
+               }
+       }
+       return curfile->fileptr;
+}