1 #include "stdio_impl.h"
4 static size_t wstring_read(FILE *f
, unsigned char *buf
, size_t len
)
6 const wchar_t *src
= f
->cookie
;
11 k
= wcsrtombs((void *)f
->buf
, &src
, f
->buf_size
, 0);
13 f
->rpos
= f
->rend
= 0;
19 f
->cookie
= (void *)src
;
21 if (!len
|| !k
) return 0;
27 int vswscanf(const wchar_t *restrict s
, const wchar_t *restrict fmt
, va_list ap
)
29 unsigned char buf
[256];
31 .buf
= buf
, .buf_size
= sizeof buf
,
33 .read
= wstring_read
, .lock
= -1
35 return vfwscanf(&f
, fmt
, ap
);
38 weak_alias(vswscanf
,__isoc99_vswscanf
);