-static int viewlength = 24;
-static int viewwidth = 79;
-static bool long_view = false;
-
-static bool safer_mode = false;
-
-static bool do_echo = false;
-static bool include = true;
-
-static int epoch = -1;
-
-static bool errorbreak = false;
-
-static bool route_errors_to_terminal = true;
-static bool route_errors_to_listing = true;
-
-static bool scompress = true;
-
-static bool undefined = true;
-static double blanks = SYSMIS;
-
-static int mxwarns = 100;
-static int mxerrs = 100;
-
-static bool printback = true;
-static bool mprint = true;
-
-static int mxloops = 1;
-
-static bool nulline = true;
-
-static char endcmd = '.';
-
-static size_t workspace = 4L * 1024 * 1024;
-
-static struct fmt_spec default_format = {FMT_F, 8, 2};
-
-static bool testing_mode = false;
-
-static int global_algorithm = ENHANCED;
-static int cmd_algorithm = ENHANCED;
-static int *algorithm = &global_algorithm;
-
-static int syntax = ENHANCED;
-
-static void init_viewport (void);
-static void get_termcap_viewport (void);
-
+struct settings
+{
+ /* Integer format used for IB and PIB input. */
+ enum integer_format input_integer_format;
+
+ /* Floating-point format used for RB and RBHEX input. */
+ enum float_format input_float_format;
+
+ /* Format of integers in output (SET WIB). */
+ enum integer_format output_integer_format;
+
+ /* Format of reals in output (SET WRB). */
+ enum float_format output_float_format;
+
+ int viewlength;
+ int viewwidth;
+ bool safer_mode;
+ bool include;
+ int epoch;
+ bool route_errors_to_terminal;
+ bool route_errors_to_listing;
+ bool scompress;
+ bool undefined;
+ double blanks;
+ int max_messages[MSG_N_SEVERITIES];
+ bool printback;
+ bool mprint;
+ int mxloops;
+ bool nulline;
+ char endcmd;
+ size_t workspace;
+ struct fmt_spec default_format;
+ bool testing_mode;
+
+ int cmd_algorithm;
+ int global_algorithm;
+ int syntax;
+
+ struct fmt_settings *styles;
+
+ enum settings_output_devices output_routing[SETTINGS_N_OUTPUT_TYPES];
+};
+
+static struct settings the_settings = {
+ INTEGER_NATIVE, /* input_integer_format */
+ FLOAT_NATIVE_DOUBLE, /* input_float_format */
+ INTEGER_NATIVE, /* output_integer_format */
+ FLOAT_NATIVE_DOUBLE, /* output_float_format */
+ 24, /* viewlength */
+ 79, /* viewwidth */
+ false, /* safer_mode */
+ true, /* include */
+ -1, /* epoch */
+ true, /* route_errors_to_terminal */
+ true, /* route_errors_to_listing */
+ true, /* scompress */
+ true, /* undefined */
+ SYSMIS, /* blanks */
+
+ /* max_messages */
+ {
+ 100, /* MSG_S_ERROR */
+ 100, /* MSG_S_WARNING */
+ 100 /* MSG_S_NOTE */
+ },
+
+ true, /* printback */
+ true, /* mprint */
+ 1, /* mxloops */
+ true, /* nulline */
+ '.', /* endcmd */
+ 64L * 1024 * 1024, /* workspace */
+ {FMT_F, 8, 2}, /* default_format */
+ false, /* testing_mode */
+ ENHANCED, /* cmd_algorithm */
+ ENHANCED, /* global_algorithm */
+ ENHANCED, /* syntax */
+ NULL, /* styles */
+
+ /* output_routing */
+ {SETTINGS_DEVICE_LISTING | SETTINGS_DEVICE_TERMINAL,
+ SETTINGS_DEVICE_LISTING | SETTINGS_DEVICE_TERMINAL,
+ 0,
+ SETTINGS_DEVICE_LISTING | SETTINGS_DEVICE_TERMINAL}
+};
+
+/* Initializes the settings module. */