Commit | Line | Data |
---|---|---|
972e1ce8 | 1 | #ifndef lint |
60de5df9 | 2 | static char sccsid[] = "@(#)wwprintf.c 3.5 %G%"; |
972e1ce8 EW |
3 | #endif |
4 | ||
60de5df9 EW |
5 | /* |
6 | * Copyright (c) 1983 Regents of the University of California, | |
7 | * All rights reserved. Redistribution permitted subject to | |
8 | * the terms of the Berkeley Software License Agreement. | |
9 | */ | |
10 | ||
972e1ce8 EW |
11 | #include "ww.h" |
12 | ||
85af59e4 | 13 | /*VARARGS2*/ |
972e1ce8 EW |
14 | wwprintf(w, fmt, args) |
15 | struct ww *w; | |
16 | char *fmt; | |
17 | { | |
b1189050 | 18 | #include <stdio.h> |
972e1ce8 | 19 | struct _iobuf _wwbuf; |
4222244b | 20 | char buf[1024]; |
972e1ce8 EW |
21 | |
22 | /* | |
23 | * A danger is that when buf overflows, _flsbuf() will be | |
24 | * called automatically. It doesn't check for _IOSTR. | |
25 | * We set the file descriptor to -1 so no actual io will be done. | |
26 | */ | |
27 | _wwbuf._flag = _IOWRT+_IOSTRG; | |
28 | _wwbuf._base = _wwbuf._ptr = buf; | |
29 | _wwbuf._cnt = sizeof buf; | |
30 | _wwbuf._file = -1; /* safe */ | |
31 | _doprnt(fmt, &args, &_wwbuf); | |
b1189050 | 32 | (void) wwwrite(w, buf, _wwbuf._ptr - buf); |
972e1ce8 | 33 | } |