4 #include "stdio_impl.h"
6 static long double strtox(const char *s, char **p, int prec)
9 while (isspace(*t)) t++;
11 .buf = (void *)t, .rpos = (void *)t,
12 .rend = (void *)-1, .lock = -1
15 long double y = __floatscan(&f, -1, prec, 1);
16 off_t cnt = shcnt(&f);
17 if (p) *p = cnt ? t + cnt : (char *)s;
21 float strtof(const char *s, char **p)
23 return strtox(s, p, 0);
26 double strtod(const char *s, char **p)
28 return strtox(s, p, 1);
31 long double strtold(const char *s, char **p)
33 return strtox(s, p, 2);