summaryrefslogtreecommitdiff
path: root/lib9
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2007-01-15 21:04:26 +0000
committerCharles.Forsyth <devnull@localhost>2007-01-15 21:04:26 +0000
commit8911721efbf3b3721376e2baa30bae002c2975c2 (patch)
treeaa059ffa39c2c4f1cd5ed2e137dcb9b079de2717 /lib9
parent0e96539ff7cff23233d3f0a64bb285b385a3a1f4 (diff)
20070115
Diffstat (limited to 'lib9')
-rw-r--r--lib9/mkfile4
-rw-r--r--lib9/runeseprint.c13
-rw-r--r--lib9/runesmprint.c13
-rw-r--r--lib9/runesnprint.c14
-rw-r--r--lib9/runevseprint.c22
5 files changed, 66 insertions, 0 deletions
diff --git a/lib9/mkfile b/lib9/mkfile
index 32e1aa56..2fd660b2 100644
--- a/lib9/mkfile
+++ b/lib9/mkfile
@@ -47,6 +47,10 @@ IMPORTFILES=\
print.$O\
readn.$O\
rerrstr.$O\
+ runeseprint.$O\
+ runesmprint.$O\
+ runesnprint.$O\
+ runevseprint.$O\
seek.$O\
seprint.$O\
smprint.$O\
diff --git a/lib9/runeseprint.c b/lib9/runeseprint.c
new file mode 100644
index 00000000..00265481
--- /dev/null
+++ b/lib9/runeseprint.c
@@ -0,0 +1,13 @@
+#include "lib9.h"
+
+Rune*
+runeseprint(Rune *buf, Rune *e, char *fmt, ...)
+{
+ Rune *p;
+ va_list args;
+
+ va_start(args, fmt);
+ p = runevseprint(buf, e, fmt, args);
+ va_end(args);
+ return p;
+}
diff --git a/lib9/runesmprint.c b/lib9/runesmprint.c
new file mode 100644
index 00000000..1afb332e
--- /dev/null
+++ b/lib9/runesmprint.c
@@ -0,0 +1,13 @@
+#include "lib9.h"
+
+Rune*
+runesmprint(char *fmt, ...)
+{
+ va_list args;
+ Rune *p;
+
+ va_start(args, fmt);
+ p = runevsmprint(fmt, args);
+ va_end(args);
+ return p;
+}
diff --git a/lib9/runesnprint.c b/lib9/runesnprint.c
new file mode 100644
index 00000000..6ecce6fc
--- /dev/null
+++ b/lib9/runesnprint.c
@@ -0,0 +1,14 @@
+#include "lib9.h"
+
+int
+runesnprint(Rune *buf, int len, char *fmt, ...)
+{
+ int n;
+ va_list args;
+
+ va_start(args, fmt);
+ n = runevsnprint(buf, len, fmt, args);
+ va_end(args);
+ return n;
+}
+
diff --git a/lib9/runevseprint.c b/lib9/runevseprint.c
new file mode 100644
index 00000000..46fdee60
--- /dev/null
+++ b/lib9/runevseprint.c
@@ -0,0 +1,22 @@
+#include "lib9.h"
+
+Rune*
+runevseprint(Rune *buf, Rune *e, char *fmt, va_list args)
+{
+ Fmt f;
+
+ if(e <= buf)
+ return nil;
+ f.runes = 1;
+ f.start = buf;
+ f.to = buf;
+ f.stop = e - 1;
+ f.flush = nil;
+ f.farg = nil;
+ f.nfmt = 0;
+ f.args = args;
+ dofmt(&f, fmt);
+ *(Rune*)f.to = '\0';
+ return f.to;
+}
+