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