From 34eeada8dbae26608dd32ab60a55e154288bf57d Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Thu, 30 Oct 1980 08:36:30 -0800 Subject: [PATCH] date and time created 80/10/30 00:36:30 by mckusick SCCS-vsn: usr.bin/pascal/libpc/WRITLN.c 1.1 --- usr/src/usr.bin/pascal/libpc/WRITLN.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 usr/src/usr.bin/pascal/libpc/WRITLN.c diff --git a/usr/src/usr.bin/pascal/libpc/WRITLN.c b/usr/src/usr.bin/pascal/libpc/WRITLN.c new file mode 100644 index 0000000000..4324cc6183 --- /dev/null +++ b/usr/src/usr.bin/pascal/libpc/WRITLN.c @@ -0,0 +1,25 @@ +/* Copyright (c) 1979 Regents of the University of California */ + +static char sccsid[] = "@(#)WRITLN.c 1.1 %G%"; + +#include "h00vars.h" +#include "h01errs.h" + +WRITLN(curfile) + + register struct iorec *curfile; +{ + if (curfile->funit & FREAD) { + ERROR(EWRITEIT, curfile->pfname); + return; + } + if (++curfile->lcount >= curfile->llimit) { + ERROR(ELLIMIT, curfile->pfname); + return; + } + fputc('\n', curfile->fbuf); + if (ferror(curfile->fbuf)) { + ERROR(EWRITE, curfile->pfname); + return; + } +} -- 2.20.1