Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include	<u.h>
2
#include	<libc.h>
3
#include	<bio.h>
4
 
5
static int
6
fmtBflush(Fmt *f)
7
{
8
	Biobufhdr *bp;
9
 
10
	bp = f->farg;
11
	bp->ocount = (char*)f->to - (char*)f->stop;
12
	if(Bflush(bp) < 0)
13
		return 0;
14
	f->stop = bp->ebuf;
15
	f->to = (char*)f->stop + bp->ocount;
16
	f->start = f->to;
17
	return 1;
18
}
19
 
20
int
21
Bvprint(Biobufhdr *bp, char *fmt, va_list arg)
22
{
23
	int n;
24
	Fmt f;
25
 
26
	f.runes = 0;
27
	f.stop = bp->ebuf;
28
	f.start = (char*)f.stop + bp->ocount;
29
	f.to = f.start;
30
	f.flush = fmtBflush;
31
	f.farg = bp;
32
	f.nfmt = 0;
33
	f.args = arg;
34
	n = dofmt(&f, fmt);
35
	bp->ocount = (char*)f.to - (char*)f.stop;
36
	return n;
37
}