X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=src%2Fdata%2Fformat.h;h=15d13ef958d4e2c42b3a12c443bada7b0a946cf8;hb=6ef859a7962e2d98b192844b07f39017df11681b;hp=88b49a5a38a522547364cf592f81ccbf176fe1ae;hpb=9b94efd7513afdb12a6023024e00e50801532fee;p=pspp diff --git a/src/data/format.h b/src/data/format.h index 88b49a5a38..15d13ef958 100644 --- a/src/data/format.h +++ b/src/data/format.h @@ -69,6 +69,8 @@ struct fmt_spec int d; /* Number of implied decimal places. */ }; +/* Maximum width of any numeric format. */ +#define FMT_MAX_NUMERIC_WIDTH 40 /* A numeric output style. */ struct fmt_number_style @@ -108,12 +110,19 @@ char *fmt_to_string (const struct fmt_spec *, char s[FMT_STRING_LEN_MAX + 1]); bool fmt_equal (const struct fmt_spec *, const struct fmt_spec *); void fmt_resize (struct fmt_spec *, int new_width); +void fmt_fix (struct fmt_spec *, bool for_input); +void fmt_fix_input (struct fmt_spec *); +void fmt_fix_output (struct fmt_spec *); + /* Format types. */ const char *fmt_name (enum fmt_type) PURE_FUNCTION; bool fmt_from_name (const char *name, enum fmt_type *); bool fmt_takes_decimals (enum fmt_type) PURE_FUNCTION; +int fmt_min_width (enum fmt_type, bool for_input) PURE_FUNCTION; +int fmt_max_width (enum fmt_type, bool for_input) PURE_FUNCTION; +int fmt_max_decimals (enum fmt_type, int width, bool for_input) PURE_FUNCTION; int fmt_min_input_width (enum fmt_type) PURE_FUNCTION; int fmt_max_input_width (enum fmt_type) PURE_FUNCTION; int fmt_max_input_decimals (enum fmt_type, int width) PURE_FUNCTION;