-/* Returns the decimal point character for the given format
- TYPE. */
-int
-fmt_decimal_char (enum fmt_type type)
-{
- return fmt_get_style (type)->decimal;
-}
-
-/* Returns the grouping character for the given format TYPE, or 0
- if the format type does not group digits. */
-int
-fmt_grouping_char (enum fmt_type type)
-{
- return fmt_get_style (type)->grouping;
-}
-
-/* Sets the number style for TYPE to have the given standard
- PREFIX and SUFFIX, "-" as prefix suffix, an empty negative
- suffix, DECIMAL as the decimal point character, and GROUPING
- as the grouping character. */
-static void
-set_style (enum fmt_type type,
- const char *prefix, const char *suffix,
- char decimal, char grouping)
-{
- struct fmt_number_style *style;
-
- assert (is_fmt_type (type));
-
- fmt_number_style_destroy (styles[type]);
-
- style = styles[type] = fmt_number_style_create ();
- ss_alloc_substring (&style->neg_prefix, ss_cstr ("-"));
- ss_alloc_substring (&style->prefix, ss_cstr (prefix));
- ss_alloc_substring (&style->suffix, ss_cstr (suffix));
- style->decimal = decimal;
- style->grouping = grouping;
-}
-
-/* Sets the number style for TYPE as with set_style, but only if
- TYPE has not already been initialized. */
-static void
-init_style (enum fmt_type type,
- const char *prefix, const char *suffix,
- char decimal, char grouping)
-{
- assert (is_fmt_type (type));
- if (styles[type] == NULL)
- set_style (type, prefix, suffix, decimal, grouping);
-}
-
-/* Sets the decimal point character to DECIMAL. */
-void
-fmt_set_decimal (char decimal)
-{
- int grouping = decimal == '.' ? ',' : '.';
- assert (decimal == '.' || decimal == ',');
-
- set_style (FMT_F, "", "", decimal, 0);
- set_style (FMT_E, "", "", decimal, 0);
- set_style (FMT_COMMA, "", "", decimal, grouping);
- set_style (FMT_DOT, "", "", grouping, decimal);
- set_style (FMT_DOLLAR, "$", "", decimal, grouping);
- set_style (FMT_PCT, "", "%", decimal, 0);
-
- init_style (FMT_CCA, "", "", decimal, grouping);
- init_style (FMT_CCB, "", "", decimal, grouping);
- init_style (FMT_CCC, "", "", decimal, grouping);
- init_style (FMT_CCD, "", "", decimal, grouping);
- init_style (FMT_CCE, "", "", decimal, grouping);
-}
-\f
-/* Returns true if M is a valid variable measurement level,
- false otherwise. */
-bool
-measure_is_valid (enum measure m)
-{
- return m > 0 && m < n_MEASURES;
-}
-
-/* Returns true if A is a valid alignment,
- false otherwise. */
-bool
-alignment_is_valid (enum alignment a)
-{
- return a < n_ALIGN;
-}
-\f