1 #include "stdio_impl.h"
13 static size_t sw_write(FILE *f, const unsigned char *s, size_t l)
17 struct cookie *c = f->cookie;
18 if (s!=f->wbase && sw_write(f, f->wbase, f->wpos-f->wbase)==-1)
20 while (c->l && l && (i=mbtowc(c->ws, (void *)s, l))>=0) {
30 int vswprintf(wchar_t *restrict s, size_t n, const wchar_t *restrict fmt, va_list ap)
34 unsigned char buf[256];
35 struct cookie c = { s, n-1 };
37 memset(&f, 0, sizeof(FILE));
40 f.buf_size = sizeof buf;
46 } else if (n > INT_MAX) {
50 r = vfwprintf(&f, fmt, ap);