date and time created 85/04/11 16:55:44 by miriam
[unix-history] / usr / src / usr.bin / window / wwprintf.c
CommitLineData
972e1ce8 1#ifndef lint
7edc52ec 2static char sccsid[] = "@(#)wwprintf.c 3.4 %G%";
972e1ce8
EW
3#endif
4
5#include "ww.h"
6
85af59e4 7/*VARARGS2*/
972e1ce8
EW
8wwprintf(w, fmt, args)
9struct ww *w;
10char *fmt;
11{
b1189050 12#include <stdio.h>
972e1ce8 13 struct _iobuf _wwbuf;
4222244b 14 char buf[1024];
972e1ce8
EW
15
16 /*
17 * A danger is that when buf overflows, _flsbuf() will be
18 * called automatically. It doesn't check for _IOSTR.
19 * We set the file descriptor to -1 so no actual io will be done.
20 */
21 _wwbuf._flag = _IOWRT+_IOSTRG;
22 _wwbuf._base = _wwbuf._ptr = buf;
23 _wwbuf._cnt = sizeof buf;
24 _wwbuf._file = -1; /* safe */
25 _doprnt(fmt, &args, &_wwbuf);
b1189050 26 (void) wwwrite(w, buf, _wwbuf._ptr - buf);
972e1ce8 27}