summaryrefslogtreecommitdiff
path: root/lib/bio
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bio')
-rw-r--r--lib/bio/bio.myr10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/bio/bio.myr b/lib/bio/bio.myr
index abfc2a5..a6dfd48 100644
--- a/lib/bio/bio.myr
+++ b/lib/bio/bio.myr
@@ -69,6 +69,7 @@ pkg bio =
/* formatted i/o */
const put : (f : file#, fmt : byte[:], args : ... -> status(std.size))
+ const putv : (f : file#, fmt : byte[:], ap : std.valist# -> status(std.size))
/* pkg funcs */
pkglocal const ensureread : (f : file#, n : std.size -> status(std.size))
@@ -529,6 +530,15 @@ const put = {f, fmt, args
-> n
}
+const putv = {f, fmt, ap
+ var sl, n
+
+ sl = std.fmtv(fmt, ap)
+ n = write(f, sl)
+ std.slfree(sl)
+ -> n
+}
+
/*
reads n bytes from the read buffer onto the heap-allocated slice
provided.