11717Smckusick /* Copyright (c) 1979 Regents of the University of California */
21717Smckusick 
3*3869Smckusic static char sccsid[] = "@(#)WRITES.c 1.4 06/10/81";
41717Smckusick 
51717Smckusick #include "h00vars.h"
61717Smckusick 
71717Smckusick WRITES(curfile, d1, d2, d3, d4)
81717Smckusick 
91717Smckusick 	register struct iorec	*curfile;
103041Smckusic 	FILE			*d1;
113169Smckusic 	int			d2, d3;
123041Smckusic 	char			*d4;
131717Smckusick {
141717Smckusick 	if (curfile->funit & FREAD) {
15*3869Smckusic 		ERROR("%s: Attempt to write, but open for reading\n",
16*3869Smckusic 			curfile->pfname);
171717Smckusick 		return;
181717Smckusick 	}
193169Smckusic 	fwrite(d1, d2, d3, d4);
201717Smckusick 	if (ferror(curfile->fbuf)) {
21*3869Smckusic 		PERROR("Could not write to ", curfile->pfname);
221717Smckusick 		return;
231717Smckusick 	}
241717Smckusick }
25