/*- * Copyright (c) 1979, 1993 * The Regents of the University of California. All rights reserved. * * %sccs.include.redist.c% */ #ifndef lint static char sccsid[] = "@(#)READC.c 8.1 (Berkeley) 06/06/93"; #endif /* not lint */ #include "h00vars.h" char READC(curfile) register struct iorec *curfile; { char data; if (curfile->funit & FWRITE) { ERROR("%s: Attempt to read, but open for writing\n", curfile->pfname); } IOSYNC(curfile); if (curfile->funit & EOFF) { ERROR("%s: Tried to read past end of file\n", curfile->pfname); } curfile->funit |= SYNC; return *curfile->fileptr; }