diff options
Diffstat (limited to 'lib9')
| -rw-r--r-- | lib9/mkfile | 4 | ||||
| -rw-r--r-- | lib9/runeseprint.c | 13 | ||||
| -rw-r--r-- | lib9/runesmprint.c | 13 | ||||
| -rw-r--r-- | lib9/runesnprint.c | 14 | ||||
| -rw-r--r-- | lib9/runevseprint.c | 22 |
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; +} + |
