change over to new error message format
[unix-history] / usr / src / usr.bin / pascal / libpc / READC.c
CommitLineData
23a44ad6
KM
1/* Copyright (c) 1979 Regents of the University of California */
2
86997b19 3static char sccsid[] = "@(#)READC.c 1.2 %G%";
23a44ad6
KM
4
5#include "h00vars.h"
23a44ad6
KM
6
7char
8READC(curfile)
9
10 register struct iorec *curfile;
11{
12 char data;
13
14 if (curfile->funit & FWRITE) {
86997b19
KM
15 ERROR("%s: Attempt to read, but open for writing\n",
16 curfile->pfname);
23a44ad6
KM
17 return;
18 }
19 IOSYNC(curfile);
20 if (curfile->funit & EOFF) {
86997b19 21 ERROR("%s: Tried to read past end of file\n", curfile->pfname);
23a44ad6
KM
22 return;
23 }
24 curfile->funit |= SYNC;
25 return *curfile->fileptr;
26}