spv-writer: Consistently use label from output_item.
[pspp] / src / data / settings.c
index 776cd51957fe4916301a8dbe30f8de4c195bf001..1b48299446d777491fbf9fad5cc087204481bb22 100644 (file)
@@ -71,6 +71,7 @@ struct settings
   int syntax;
 
   struct fmt_settings styles;
+  double small;
 
   enum settings_output_devices output_routing[SETTINGS_N_OUTPUT_TYPES];
 
@@ -111,6 +112,7 @@ static struct settings the_settings = {
   ENHANCED,                     /* global_algorithm */
   ENHANCED,                     /* syntax */
   FMT_SETTINGS_INIT,            /* styles */
+  .0001,                        /* small */
 
   /* output_routing */
   {SETTINGS_DEVICE_LISTING | SETTINGS_DEVICE_TERMINAL,
@@ -140,7 +142,7 @@ static void
 settings_copy (struct settings *dst, const struct settings *src)
 {
   *dst = *src;
-  fmt_settings_copy (&dst->styles, &src->styles);
+  dst->styles = fmt_settings_copy (&src->styles);
 }
 
 /* Returns a copy of the current settings. */
@@ -289,13 +291,6 @@ settings_set_include (bool include)
   the_settings.include = include;
 }
 
-/* What year to use as the start of the epoch. */
-int
-settings_get_epoch (void)
-{
-  return fmt_settings_get_epoch (&the_settings.styles);
-}
-
 /* Sets the year that starts the epoch. */
 void
 settings_set_epoch (int epoch)
@@ -546,26 +541,28 @@ settings_set_cc (const char *cc_string, enum fmt_type type)
   return true;
 }
 
-/* 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)
 {
   the_settings.styles.decimal = decimal;
 }
 
-/* Returns the number formatting style associated with the given
-   format TYPE. */
-const struct fmt_number_style *
-settings_get_style (enum fmt_type type)
+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)
 {
-  assert (is_fmt_type (type));
-  return fmt_settings_get_style (&the_settings.styles, type);
+  the_settings.small = small;
 }
 
 /* Returns a string of the form "$#,###.##" according to FMT,