{"", -1, -1, -1, -1, -1, 0000, -1, -1},
};
+/* Common formats. */
+const struct fmt_spec f8_2 = {FMT_F, 8, 2};
+
/* Parses the alphabetic prefix of the current token as a format
specifier name. Returns the corresponding format specifier
type if successful, or -1 on failure. If ALLOW_XT is zero,
{
if (emit_error)
msg (SE, _("Format %s specifies an odd width %d, but "
- "format %s requires an even width."),
- str, spec->w, f->name, f->Imin_w, f->Imax_w);
+ "an even width is required."),
+ str, spec->w);
return false;
}
if (f->n_args > 1 && (spec->d < 0 || spec->d > 16))
"many decimal places as the field width, which "
"fails to allow space for a decimal point. "
"Try %s%d.%d instead."),
- str, f->name, f->name, spec->d + 1, spec->d);
+ str, f->name, spec->d + 1, spec->d);
return 0;
}
return 1;
return type;
return -1;
}
+
+/* Returns an input format specification with type TYPE, width W,
+ and D decimals. */
+struct fmt_spec
+make_input_format (int type, int w, int d)
+{
+ struct fmt_spec f;
+ f.type = type;
+ f.w = w;
+ f.d = d;
+ assert (check_input_specifier (&f, 0));
+ return f;
+}
+
+/* Returns an output format specification with type TYPE, width
+ W, and D decimals. */
+struct fmt_spec
+make_output_format (int type, int w, int d)
+{
+ struct fmt_spec f;
+ f.type = type;
+ f.w = w;
+ f.d = d;
+ assert (check_output_specifier (&f, 0));
+ return f;
+}