1*40865Sbostic /*- 2*40865Sbostic * Copyright (c) 1989 The Regents of the University of California. 3*40865Sbostic * All rights reserved. 4*40865Sbostic * 5*40865Sbostic * %sccs.include.redist.c% 6*40865Sbostic */ 736531Smckusick 8*40865Sbostic #ifndef lint 9*40865Sbostic static char sccsid[] = "@(#)VWRITEF.c 1.3 (Berkeley) 04/09/90"; 10*40865Sbostic #endif /* not lint */ 1136531Smckusick 1236531Smckusick #include "h00vars.h" 1336531Smckusick 1436531Smckusick #include <stdarg.h> 1536531Smckusick 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