]> git.lizzy.rs Git - plan9front.git/blob - sys/src/libc/fmt/runevsnprint.c
libc: use MOVP instruction for arm64 memmove() and memset()
[plan9front.git] / sys / src / libc / fmt / runevsnprint.c
1 #include <u.h>
2 #include <libc.h>
3
4 int
5 runevsnprint(Rune *buf, int len, char *fmt, va_list args)
6 {
7         Fmt f;
8
9         if(len <= 0)
10                 return -1;
11         f.runes = 1;
12         f.start = buf;
13         f.to = buf;
14         f.stop = buf + len - 1;
15         f.flush = nil;
16         f.farg = nil;
17         f.nfmt = 0;
18         f.args = args;
19         dofmt(&f, fmt);
20         *(Rune*)f.to = '\0';
21         return (Rune*)f.to - buf;
22 }