+void
+settings_set_syntax (enum behavior_mode mode)
+{
+ the_settings.syntax = mode;
+}
+
+\f
+/* Sets custom currency specifier CC having name CC_NAME ('A' through
+ 'E') to correspond to the settings in CC_STRING. */
+bool
+settings_set_cc (const char *cc_string, enum fmt_type type)
+{
+ struct fmt_number_style *style = fmt_number_style_from_string (cc_string);
+ if (!style)
+ {
+ msg (SE, _("%s: Custom currency string `%s' does not contain "
+ "exactly three periods or commas (or it contains both)."),
+ fmt_name (type), cc_string);
+ return false;
+ }
+
+ fmt_settings_set_cc (&the_settings.styles, type, style);
+ return true;
+}
+
+void
+settings_set_decimal_char (char decimal)
+{
+ the_settings.styles.decimal = decimal;
+}
+
+const struct fmt_settings *
+settings_get_fmt_settings (void)
+{
+ return &the_settings.styles;
+}
+
+double
+settings_get_small (void)
+{
+ return the_settings.small;
+}
+
+void
+settings_set_small (double small)
+{
+ the_settings.small = small;
+}
+
+/* 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_show
+settings_get_show_values (void)
+{
+ return the_settings.show_values;
+}
+
+void
+settings_set_show_values (enum settings_value_show s)
+{
+ the_settings.show_values = s;
+}
+
+
+enum settings_value_show
+settings_get_show_variables (void)
+{
+ return the_settings.show_variables;
+}
+
+void
+settings_set_show_variables (enum settings_value_show s)