11715Smckusick /* Copyright (c) 1979 Regents of the University of California */
21715Smckusick 
3*3869Smckusic static char sccsid[] = "@(#)WRITEC.c 1.4 06/10/81";
41715Smckusick 
51715Smckusick #include "h00vars.h"
61715Smckusick 
71715Smckusick WRITEC(curfile, d1, d2)
81715Smckusick 
91715Smckusick 	register struct iorec	*curfile;
103167Smckusic 	char			d1;
113039Smckusic 	FILE			*d2;
121715Smckusick {
131715Smckusick 	if (curfile->funit & FREAD) {
14*3869Smckusic 		ERROR("%s: Attempt to write, but open for reading\n",
15*3869Smckusic 			curfile->pfname);
161715Smckusick 		return;
171715Smckusick 	}
183167Smckusic 	fputc(d1, d2);
191715Smckusick 	if (ferror(curfile->fbuf)) {
20*3869Smckusic 		PERROR("Could not write to ", curfile->pfname);
211715Smckusick 		return;
221715Smckusick 	}
231715Smckusick }
24