2012-04-16 16:03:45 -04:00
|
|
|
#include "stdio_impl.h"
|
2013-04-05 23:20:28 -07:00
|
|
|
#include "libc.h"
|
2011-02-12 00:22:29 -05:00
|
|
|
|
2012-04-16 16:03:45 -04:00
|
|
|
static size_t do_read(FILE *f, unsigned char *buf, size_t len)
|
2011-02-12 00:22:29 -05:00
|
|
|
{
|
2012-04-16 16:03:45 -04:00
|
|
|
return __string_read(f, buf, len);
|
2011-02-12 00:22:29 -05:00
|
|
|
}
|
|
|
|
|
2012-09-06 22:44:55 -04:00
|
|
|
int vsscanf(const char *restrict s, const char *restrict fmt, va_list ap)
|
2011-02-12 00:22:29 -05:00
|
|
|
{
|
2012-04-16 16:03:45 -04:00
|
|
|
FILE f = {
|
|
|
|
.buf = (void *)s, .cookie = (void *)s,
|
|
|
|
.read = do_read, .lock = -1
|
|
|
|
};
|
|
|
|
return vfscanf(&f, fmt, ap);
|
2011-02-12 00:22:29 -05:00
|
|
|
}
|
2013-04-05 23:20:28 -07:00
|
|
|
|
|
|
|
weak_alias(vsscanf,__isoc99_vsscanf);
|