Lines Matching defs:fmt
34 static int scan(const char *fmt, struct t *t, char *buf);
35 static int print(const char *fmt, struct t *t, char *buf, int n);
37 // TODO: many output, fmt->ulp
44 char *fmt;
96 if (scan(f->fmt, &t, buf))
103 print(f->fmt, &tread, buf, sizeof buf);
105 // print(f->fmt, &t, buf, sizeof buf);
113 if (print(f->fmt, &t, buf, sizeof buf))
114 fprintf(stderr, "error fmt %s, line %d\n", f->name, i);
120 print(f->fmt, &terr, buf, sizeof buf);
144 p = strchr(f->fmt, '_');
169 static int scan1(long double *x, char *s, int fmt)
174 if (fmt == 'd') {
178 } else if (fmt == 'f') {
182 } else if (fmt == 'l') {
189 static int scan(const char *fmt, struct t *t, char *buf)
211 for (; *fmt && *fmt != '_'; fmt++) {
214 if (*fmt == 'i') {
218 } else if (*fmt == 'd' || *fmt == 'f' || *fmt == 'l') {
219 if (scan1(b[j++], a[i++], *fmt))
230 fmt++;
231 for (; *fmt && i < n && j < sizeof b/sizeof *b; fmt++) {
232 if (*fmt == 'i') {
236 } else if (*fmt == 'd' || *fmt == 'f' || *fmt == 'l') {
237 if (scan1(b[j++], a[i++], *fmt))
269 static int print1(char *buf, int n, long double x, int fmt)
273 if (fmt == 'd')
275 else if (fmt == 'f')
277 else if (fmt == 'l') {
289 static int print(const char *fmt, struct t *t, char *buf, int n)
303 for (; *fmt; fmt++) {
304 if (*fmt == '_') {
313 if (*fmt == 'i') {
322 k = print1(buf, n, a[i++], *fmt);