date and time created 82/01/18 19:20:24 by linton
[unix-history] / usr / src / usr.bin / pascal / libpc / WRITES.c
CommitLineData
c20f7c0e
KM
1/* Copyright (c) 1979 Regents of the University of California */
2
86997b19 3static char sccsid[] = "@(#)WRITES.c 1.4 %G%";
c20f7c0e
KM
4
5#include "h00vars.h"
c20f7c0e
KM
6
7WRITES(curfile, d1, d2, d3, d4)
8
9 register struct iorec *curfile;
492cc5d3 10 FILE *d1;
44dfd6de 11 int d2, d3;
492cc5d3 12 char *d4;
c20f7c0e
KM
13{
14 if (curfile->funit & FREAD) {
86997b19
KM
15 ERROR("%s: Attempt to write, but open for reading\n",
16 curfile->pfname);
c20f7c0e
KM
17 return;
18 }
44dfd6de 19 fwrite(d1, d2, d3, d4);
c20f7c0e 20 if (ferror(curfile->fbuf)) {
86997b19 21 PERROR("Could not write to ", curfile->pfname);
c20f7c0e
KM
22 return;
23 }
24}