From 0b44a0315b47dd8eced9f3b7f31580cf14bbfc01 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 12 Feb 2011 00:22:29 -0500 Subject: initial check-in, version 0.5.0 --- src/stdio/vswscanf.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/stdio/vswscanf.c (limited to 'src/stdio/vswscanf.c') diff --git a/src/stdio/vswscanf.c b/src/stdio/vswscanf.c new file mode 100644 index 00000000..2c4ffbe0 --- /dev/null +++ b/src/stdio/vswscanf.c @@ -0,0 +1,19 @@ +#include +#include +#include +#include + +#include "__scanf.h" + +static void s_read(rctx_t *r) +{ + wchar_t *s = r->opaque; + if (!s[r->l]) r->c = -1; + else r->c = s[r->l++]; +} + +int vswscanf(const wchar_t *s, const wchar_t *fmt, va_list ap) +{ + rctx_t r = { s_read, (void *)s, 1, iswspace }; + return __scanf(&r, fmt, ap); +} -- cgit v1.2.1