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