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