11715Smckusick /* Copyright (c) 1979 Regents of the University of California */
21715Smckusick 
3*3167Smckusic static char sccsid[] = "@(#)WRITEC.c 1.3 03/10/81";
41715Smckusick 
51715Smckusick #include "h00vars.h"
61715Smckusick #include "h01errs.h"
71715Smckusick 
81715Smckusick WRITEC(curfile, d1, d2)
91715Smckusick 
101715Smckusick 	register struct iorec	*curfile;
11*3167Smckusic 	char			d1;
123039Smckusic 	FILE			*d2;
131715Smckusick {
141715Smckusick 	if (curfile->funit & FREAD) {
151715Smckusick 		ERROR(EWRITEIT, curfile->pfname);
161715Smckusick 		return;
171715Smckusick 	}
18*3167Smckusic 	fputc(d1, d2);
191715Smckusick 	if (ferror(curfile->fbuf)) {
201715Smckusick 		ERROR(EWRITE, curfile->pfname);
211715Smckusick 		return;
221715Smckusick 	}
231715Smckusick }
24