1 #include "stdio_impl.h"
5 static size_t wstring_read(FILE *f, unsigned char *buf, size_t len)
7 const wchar_t *src = f->cookie;
12 k = wcsrtombs((void *)f->buf, &src, f->buf_size, 0);
14 f->rpos = f->rend = 0;
20 f->cookie = (void *)src;
22 if (!len || !k) return 0;
28 int vswscanf(const wchar_t *restrict s, const wchar_t *restrict fmt, va_list ap)
30 unsigned char buf[256];
32 .buf = buf, .buf_size = sizeof buf,
34 .read = wstring_read, .lock = -1
36 return vfwscanf(&f, fmt, ap);
39 weak_alias(vswscanf,__isoc99_vswscanf);