vfprint.c - 9base - revived minimalist port of Plan 9 userland to Unix | |
git clone git://git.suckless.org/9base | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
vfprint.c (381B) | |
--- | |
1 /* Copyright (c) 2002-2006 Lucent Technologies; see LICENSE */ | |
2 #include <stdarg.h> | |
3 #include "plan9.h" | |
4 #include "fmt.h" | |
5 #include "fmtdef.h" | |
6 | |
7 int | |
8 vfprint(int fd, char *fmt, va_list args) | |
9 { | |
10 Fmt f; | |
11 char buf[256]; | |
12 int n; | |
13 | |
14 fmtfdinit(&f, fd, buf, sizeof(buf)); | |
15 VA_COPY(f.args,args); | |
16 n = dofmt(&f, fmt); | |
17 VA_END(f.args); | |
18 if(n > 0 && __fmtFdFlush(&f) == 0) | |
19 return -1; | |
20 return n; | |
21 } |