1*1718Smckusick /* Copyright (c) 1979 Regents of the University of California */
2*1718Smckusick 
3*1718Smckusick static char sccsid[] = "@(#)WRITLN.c 1.1 10/30/80";
4*1718Smckusick 
5*1718Smckusick #include "h00vars.h"
6*1718Smckusick #include "h01errs.h"
7*1718Smckusick 
8*1718Smckusick WRITLN(curfile)
9*1718Smckusick 
10*1718Smckusick 	register struct iorec	*curfile;
11*1718Smckusick {
12*1718Smckusick 	if (curfile->funit & FREAD) {
13*1718Smckusick 		ERROR(EWRITEIT, curfile->pfname);
14*1718Smckusick 		return;
15*1718Smckusick 	}
16*1718Smckusick 	if (++curfile->lcount >= curfile->llimit) {
17*1718Smckusick 		ERROR(ELLIMIT, curfile->pfname);
18*1718Smckusick 		return;
19*1718Smckusick 	}
20*1718Smckusick 	fputc('\n', curfile->fbuf);
21*1718Smckusick 	if (ferror(curfile->fbuf)) {
22*1718Smckusick 		ERROR(EWRITE, curfile->pfname);
23*1718Smckusick 		return;
24*1718Smckusick 	}
25*1718Smckusick }
26