X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fformat.h;h=049ffc6fdc9f7d903af41dad566521f24d287d41;hb=1d68fabd9a00b483ac3dc2410ec4d6d4a24e256d;hp=88b49a5a38a522547364cf592f81ccbf176fe1ae;hpb=9b94efd7513afdb12a6023024e00e50801532fee;p=pspp-builds.git diff --git a/src/data/format.h b/src/data/format.h index 88b49a5a..049ffc6f 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; @@ -155,4 +164,6 @@ int fmt_grouping_char (const struct fmt_number_style *, enum fmt_type); void fmt_set_decimal (struct fmt_number_style *, char); +extern const struct fmt_spec F_8_0 ; + #endif /* data/format.h */