xref: /plan9/sys/src/cmd/unix/drawterm/libc/runevseprint.c (revision ec59a3ddbfceee0efe34584c2c9981a5e5ff1ec4)
1 #include <u.h>
2 #include <libc.h>
3 #include "fmtdef.h"
4 
5 Rune*
runevseprint(Rune * buf,Rune * e,char * fmt,va_list args)6 runevseprint(Rune *buf, Rune *e, char *fmt, va_list args)
7 {
8 	Fmt f;
9 
10 	if(e <= buf)
11 		return nil;
12 	f.runes = 1;
13 	f.start = buf;
14 	f.to = buf;
15 	f.stop = e - 1;
16 	f.flush = 0;
17 	f.farg = nil;
18 	f.nfmt = 0;
19 	VA_COPY(f.args,args);
20 	dofmt(&f, fmt);
21 	VA_END(f.args);
22 	*(Rune*)f.to = '\0';
23 	return (Rune*)f.to;
24 }
25 
26