+
+/* Returns the decimal point character for TYPE. */
+int
+settings_get_decimal_char (enum fmt_type type)
+{
+ return fmt_settings_get_style (the_settings.styles, type)->decimal;
+}
+
+void
+settings_set_decimal_char (char decimal)
+{
+ fmt_settings_set_decimal (the_settings.styles, decimal);
+}
+
+/* Returns the number formatting style associated with the given
+ format TYPE. */
+const struct fmt_number_style *
+settings_get_style (enum fmt_type type)
+{
+ assert (is_fmt_type (type));
+ return fmt_settings_get_style (the_settings.styles, type);
+}
+
+/* Returns a string of the form "$#,###.##" according to FMT,
+ which must be of type FMT_DOLLAR. The caller must free the
+ string. */
+char *
+settings_dollar_template (const struct fmt_spec *fmt)
+{
+ struct string str = DS_EMPTY_INITIALIZER;
+ int c;
+ const struct fmt_number_style *fns ;
+
+ assert (fmt->type == FMT_DOLLAR);
+
+ fns = fmt_settings_get_style (the_settings.styles, fmt->type);
+
+ ds_put_byte (&str, '$');
+ for (c = MAX (fmt->w - fmt->d - 1, 0); c > 0; )
+ {
+ ds_put_byte (&str, '#');
+ if (--c % 4 == 0 && c > 0)
+ {
+ ds_put_byte (&str, fns->grouping);
+ --c;
+ }
+ }
+ if (fmt->d > 0)
+ {
+ ds_put_byte (&str, fns->decimal);
+ ds_put_byte_multiple (&str, '#', fmt->d);
+ }
+
+ return ds_cstr (&str);
+}
+
+void
+settings_set_output_routing (enum settings_output_type type,
+ enum settings_output_devices devices)
+{
+ assert (type < SETTINGS_N_OUTPUT_TYPES);
+ the_settings.output_routing[type] = devices;
+}
+
+enum settings_output_devices
+settings_get_output_routing (enum settings_output_type type)
+{
+ assert (type < SETTINGS_N_OUTPUT_TYPES);
+ return the_settings.output_routing[type] | SETTINGS_DEVICE_UNFILTERED;
+}
+
+enum settings_value_style
+settings_get_value_style (void)
+{
+ return the_settings.value_output_style;
+}
+
+void
+settings_set_value_style (enum settings_value_style s)
+{
+ the_settings.value_output_style = s;
+}
+
+
+
+enum settings_var_style
+settings_get_var_style (void)
+{
+ return the_settings.var_output_style;
+}
+
+
+void
+settings_set_var_style (enum settings_var_style s)