xref: /csrg-svn/usr.bin/pascal/libpc/VWRITEF.c (revision 62096)
140865Sbostic /*-
2*62096Sbostic  * Copyright (c) 1989, 1993
3*62096Sbostic  *	The Regents of the University of California.  All rights reserved.
440865Sbostic  *
540865Sbostic  * %sccs.include.redist.c%
640865Sbostic  */
736531Smckusick 
840865Sbostic #ifndef lint
9*62096Sbostic static char sccsid[] = "@(#)VWRITEF.c	8.1 (Berkeley) 06/06/93";
1040865Sbostic #endif /* not lint */
1136531Smckusick 
1236531Smckusick #include "h00vars.h"
1336531Smckusick 
1436531Smckusick #include <stdarg.h>
1536531Smckusick 
VWRITEF(curfile,file,format,args)1636531Smckusick VWRITEF(curfile, file, format, args)
1736531Smckusick 
1836531Smckusick 	register struct iorec	*curfile;
1936531Smckusick 	FILE			*file;
2036531Smckusick 	char 			*format;
2136531Smckusick 	va_list			args;
2236531Smckusick {
2336531Smckusick 
2436531Smckusick 	if (curfile->funit & FREAD) {
2536531Smckusick 		ERROR("%s: Attempt to write, but open for reading\n",
2636531Smckusick 			curfile->pfname);
2736531Smckusick 		return;
2836531Smckusick 	}
2936531Smckusick 	vfprintf(file, format, args);
3036531Smckusick 	if (ferror(curfile->fbuf)) {
3136531Smckusick 		PERROR("Could not write to ", curfile->pfname);
3236531Smckusick 		return;
3336531Smckusick 	}
3436531Smckusick }
35