From: Kirk McKusick Date: Thu, 30 Oct 1980 16:35:27 +0000 (-0800) Subject: date and time created 80/10/30 00:35:27 by mckusick X-Git-Tag: BSD-4^3~88 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/b184a153d4f526cbdf024290635faa5f5cbbb32d?ds=inline;hp=a58c9769874ee11a28ecad15665b9cd307ca9eff date and time created 80/10/30 00:35:27 by mckusick SCCS-vsn: usr.bin/pascal/libpc/REWRITE.c 1.1 --- diff --git a/usr/src/usr.bin/pascal/libpc/REWRITE.c b/usr/src/usr.bin/pascal/libpc/REWRITE.c new file mode 100644 index 0000000000..2db963912d --- /dev/null +++ b/usr/src/usr.bin/pascal/libpc/REWRITE.c @@ -0,0 +1,25 @@ +/* Copyright (c) 1979 Regents of the University of California */ + +static char sccsid[] = "@(#)REWRITE.c 1.1 %G%"; + +#include "h00vars.h" +#include "h01errs.h" + +REWRITE(filep, name, maxnamlen, datasize) + + register struct iorec *filep; + char *name; + int maxnamlen; + int datasize; +{ + filep = GETNAME (filep, name, maxnamlen, datasize); + filep->fbuf = fopen(filep->fname, "w"); + if (filep->fbuf == NULL) { + ERROR(ECREATE, filep->pfname); + return; + } + filep->funit |= (EOFF | FWRITE); + if (filep->fblk > PREDEF) { + setbuf(filep->fbuf, &filep->buf[0]); + } +}