date and time created 80/10/31 14:39:48 by mckusick
[unix-history] / usr / src / usr.bin / pascal / libpc / READC.c
CommitLineData
23a44ad6
KM
1/* Copyright (c) 1979 Regents of the University of California */
2
3static char sccsid[] = "@(#)READC.c 1.1 %G%";
4
5#include "h00vars.h"
6#include "h01errs.h"
7
8char
9READC(curfile)
10
11 register struct iorec *curfile;
12{
13 char data;
14
15 if (curfile->funit & FWRITE) {
16 ERROR(EREADIT, curfile->pfname);
17 return;
18 }
19 IOSYNC(curfile);
20 if (curfile->funit & EOFF) {
21 ERROR(EPASTEOF, curfile->pfname);
22 return;
23 }
24 curfile->funit |= SYNC;
25 return *curfile->fileptr;
26}