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 */ 71709Smckusick 8*40865Sbostic #ifndef lint 9*40865Sbostic static char sccsid[] = "@(#)TEOLN.c 1.5 (Berkeley) 04/09/90"; 10*40865Sbostic #endif /* not lint */ 111709Smckusick 121709Smckusick #include "h00vars.h" 131709Smckusick 143036Smckusic bool 151709Smckusick TEOLN(filep) 161709Smckusick 171709Smckusick register struct iorec *filep; 181709Smckusick { 197765Smckusick if (filep->fblk >= MAXFILES || _actfile[filep->fblk] != filep || 207765Smckusick (filep->funit & FDEF)) { 213869Smckusic ERROR("Reference to an inactive file\n", 0); 221709Smckusick return; 231709Smckusick } 247765Smckusick if (filep->funit & FWRITE) { 257765Smckusick ERROR("%s: eoln is undefined on files open for writing\n", 267765Smckusick filep->pfname); 277765Smckusick return; 287765Smckusick } 291709Smckusick IOSYNC(filep); 307765Smckusick if (filep->funit & EOFF) { 317765Smckusick ERROR("%s: eoln is undefined when eof is true\n", 327765Smckusick filep->pfname); 337765Smckusick return; 347765Smckusick } 351709Smckusick if (filep->funit & EOLN) 361709Smckusick return TRUE; 371709Smckusick return FALSE; 381709Smckusick } 39