date and time created 80/10/30 00:36:24 by mckusick
[unix-history] / usr / src / usr.bin / pascal / libpc / REWRITE.c
CommitLineData
b184a153
KM
1/* Copyright (c) 1979 Regents of the University of California */
2
3static char sccsid[] = "@(#)REWRITE.c 1.1 %G%";
4
5#include "h00vars.h"
6#include "h01errs.h"
7
8REWRITE(filep, name, maxnamlen, datasize)
9
10 register struct iorec *filep;
11 char *name;
12 int maxnamlen;
13 int datasize;
14{
15 filep = GETNAME (filep, name, maxnamlen, datasize);
16 filep->fbuf = fopen(filep->fname, "w");
17 if (filep->fbuf == NULL) {
18 ERROR(ECREATE, filep->pfname);
19 return;
20 }
21 filep->funit |= (EOFF | FWRITE);
22 if (filep->fblk > PREDEF) {
23 setbuf(filep->fbuf, &filep->buf[0]);
24 }
25}