fmt->d = decimals;
fmt_fix (fmt, use);
}
+
+unsigned int
+fmt_to_uint (const struct fmt_spec *fmt)
+{
+ return (fmt_to_io (fmt->type) << 24) | (fmt->w << 8) | fmt->d;
+}
+
+bool
+fmt_from_uint (struct fmt_spec *fmt, unsigned int uint)
+{
+ if (!fmt_from_io (uint >> 24, &fmt->type))
+ return false;
+ fmt->w = (uint >> 8) & 0xffff;
+ fmt->d = uint & 0xff;
+ return true;
+}
\f
/* Describes a display format. */
struct fmt_desc