| /* This read function heavily cheats. It knows: |
| * (1) len will always be 1 |
| * (2) non-ascii characters don't matter */ |
| static size_t do_read(FILE *f, unsigned char *buf, size_t len) |
| const wchar_t *wcs = f->cookie; |
| for (i=0; i<f->buf_size && wcs[i]; i++) |
| f->buf[i] = wcs[i] < 128 ? wcs[i] : '@'; |
| f->cookie = (void *)(wcs+i); |
| static long double wcstox(const wchar_t *s, wchar_t **p, int prec) |
| wchar_t *t = (wchar_t *)s; |
| f.rpos = f.rend = f.buf = buf + 4; |
| f.buf_size = sizeof buf - 4; |
| while (iswspace(*t)) t++; |
| long double y = __floatscan(&f, prec, 1); |
| *p = cnt ? t + cnt : (wchar_t *)s; |
| float wcstof(const wchar_t *restrict s, wchar_t **restrict p) |
| double wcstod(const wchar_t *restrict s, wchar_t **restrict p) |
| long double wcstold(const wchar_t *restrict s, wchar_t **restrict p) |