1 /* Copyright (c) 1979 Regents of the University of California */ 2 3 static char sccsid[] = "@(#)WRITES.c 1.3 03/10/81"; 4 5 #include "h00vars.h" 6 #include "h01errs.h" 7 8 WRITES(curfile, d1, d2, d3, d4) 9 10 register struct iorec *curfile; 11 FILE *d1; 12 int d2, d3; 13 char *d4; 14 { 15 if (curfile->funit & FREAD) { 16 ERROR(EWRITEIT, curfile->pfname); 17 return; 18 } 19 fwrite(d1, d2, d3, d4); 20 if (ferror(curfile->fbuf)) { 21 ERROR(EWRITE, curfile->pfname); 22 return; 23 } 24 } 25