xref: /original-bsd/usr.bin/pascal/libpc/VWRITEF.c (revision 87febec0)
1 /* Copyright (c) 1989 Regents of the University of California */
2 
3 static char sccsid[] = "@(#)VWRITEF.c 1.2 01/11/89";
4 
5 #include "h00vars.h"
6 
7 #include <stdarg.h>
8 
9 VWRITEF(curfile, file, format, args)
10 
11 	register struct iorec	*curfile;
12 	FILE			*file;
13 	char 			*format;
14 	va_list			args;
15 {
16 
17 	if (curfile->funit & FREAD) {
18 		ERROR("%s: Attempt to write, but open for reading\n",
19 			curfile->pfname);
20 		return;
21 	}
22 	vfprintf(file, format, args);
23 	if (ferror(curfile->fbuf)) {
24 		PERROR("Could not write to ", curfile->pfname);
25 		return;
26 	}
27 }
28