merge in onyx changes
[unix-history] / usr / src / usr.bin / pascal / libpc / WRITES.c
CommitLineData
c20f7c0e
KM
1/* Copyright (c) 1979 Regents of the University of California */
2
492cc5d3 3static char sccsid[] = "@(#)WRITES.c 1.2 %G%";
c20f7c0e
KM
4
5#include "h00vars.h"
6#include "h01errs.h"
7
8WRITES(curfile, d1, d2, d3, d4)
9
10 register struct iorec *curfile;
492cc5d3
KM
11 FILE *d1;
12 long d2, d3;
13 char *d4;
c20f7c0e
KM
14{
15 if (curfile->funit & FREAD) {
16 ERROR(EWRITEIT, curfile->pfname);
17 return;
18 }
492cc5d3 19 fwrite(d1, (int)d2, (int)d3, d4);
c20f7c0e
KM
20 if (ferror(curfile->fbuf)) {
21 ERROR(EWRITE, curfile->pfname);
22 return;
23 }
24}