1*40865Sbostic /*- 2*40865Sbostic * Copyright (c) 1979 The Regents of the University of California. 3*40865Sbostic * All rights reserved. 4*40865Sbostic * 5*40865Sbostic * %sccs.include.redist.c% 6*40865Sbostic */ 71718Smckusick 8*40865Sbostic #ifndef lint 9*40865Sbostic static char sccsid[] = "@(#)WRITLN.c 1.3 (Berkeley) 04/09/90"; 10*40865Sbostic #endif /* not lint */ 111718Smckusick 121718Smckusick #include "h00vars.h" 131718Smckusick 141718Smckusick WRITLN(curfile) 151718Smckusick 161718Smckusick register struct iorec *curfile; 171718Smckusick { 181718Smckusick if (curfile->funit & FREAD) { 193869Smckusic ERROR("%s: Attempt to write, but open for reading\n", 203869Smckusic curfile->pfname); 211718Smckusick return; 221718Smckusick } 231718Smckusick if (++curfile->lcount >= curfile->llimit) { 243869Smckusic ERROR("%s: Line limit exceeded\n", curfile->pfname); 251718Smckusick return; 261718Smckusick } 271718Smckusick fputc('\n', curfile->fbuf); 281718Smckusick if (ferror(curfile->fbuf)) { 293869Smckusic PERROR("Could not write to ", curfile->pfname); 301718Smckusick return; 311718Smckusick } 321718Smckusick } 33