aboutsummaryrefslogtreecommitdiff
path: root/src/libbio/bprint.c
blob: f8a4d94f18dc7d5ebfc95ac19d85d4e782343719 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include	"lib9.h"
#include	<bio.h>

int
Bprint(Biobuf *bp, char *fmt, ...)
{
	va_list args;
	Fmt f;
	int n;

	if(Bfmtinit(&f, bp) < 0)
		return -1;
	va_start(args, fmt);
	va_copy(f.args, args);
	n = dofmt(&f, fmt);
	va_end(args);
	va_end(f.args);
	if(n > 0 && Bfmtflush(&f) < 0)
		return -1;
	return n;
}