X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fsettings.c;h=3248324ea3a42640d95acf697a2813d21df123f6;hb=b8e2dc45abf0cf7a398cb8cef9d9faa24bee6f6c;hp=64f037ed147de959efa4a9ceddb75a1bfc9f4e57;hpb=65a4e29574b67921ea899b6a1d45806dca11db00;p=pspp-builds.git diff --git a/src/data/settings.c b/src/data/settings.c index 64f037ed..3248324e 100644 --- a/src/data/settings.c +++ b/src/data/settings.c @@ -1,6 +1,5 @@ /* PSPP - computes sample statistics. - Copyright (C) 1997-9, 2000 Free Software Foundation, Inc. - Written by Ben Pfaff . + Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -25,6 +24,7 @@ #include "format.h" #include "value.h" #include "xalloc.h" +#include static int viewlength = 24; static int viewwidth = 79; @@ -32,9 +32,6 @@ static bool long_view = false; static bool safer_mode = false; -static char decimal = '.'; -static char grouping = ','; - static bool echo = false; static bool include = true; @@ -42,6 +39,9 @@ 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; @@ -63,16 +63,6 @@ static size_t workspace = 4L * 1024 * 1024; static struct fmt_spec default_format = {FMT_F, 8, 2}; -#define CC_INITIALIZER {"-", "", "", "", '.', ','} -static struct custom_currency cc[CC_CNT] = - { - CC_INITIALIZER, - CC_INITIALIZER, - CC_INITIALIZER, - CC_INITIALIZER, - CC_INITIALIZER, - }; - static bool testing_mode = false; static int global_algorithm = ENHANCED; @@ -87,11 +77,13 @@ void settings_init (void) { init_viewport (); + i18n_init (); } void settings_done (void) { + i18n_done (); } /* Screen length in lines. */ @@ -189,41 +181,6 @@ set_safer_mode (void) safer_mode = true; } -/* The character used for a decimal point: ',' or '.'. Only - respected for data input and output. */ -char -get_decimal (void) -{ - return decimal; -} - -/* Sets the character used for a decimal point, which must be - either ',' or '.'. */ -void -set_decimal (char decimal_) -{ - assert (decimal_ == '.' || decimal_ == ','); - decimal = decimal_; -} - -/* The character used for grouping in numbers: '.' or ','; the - opposite of set_decimal. Only used in COMMA data input and - output. */ -char -get_grouping (void) -{ - return grouping; -} - -/* Sets the character used for grouping, which must be either ',' - or '.'. */ -void -set_grouping (char grouping_) -{ - assert (grouping_ == '.' || grouping_ == ','); - grouping = grouping_; -} - /* Echo commands to the listing file/printer? */ bool get_echo (void) @@ -287,6 +244,36 @@ set_errorbreak (bool errorbreak_) errorbreak = errorbreak_; } +/* Route error messages to terminal? */ +bool +get_error_routing_to_terminal (void) +{ + return route_errors_to_terminal; +} + +/* Sets whether error messages should be routed to the + terminal. */ +void +set_error_routing_to_terminal (bool route_to_terminal) +{ + route_errors_to_terminal = route_to_terminal; +} + +/* Route error messages to listing file? */ +bool +get_error_routing_to_listing (void) +{ + return route_errors_to_listing; +} + +/* Sets whether error messages should be routed to the + listing file. */ +void +set_error_routing_to_listing (bool route_to_listing) +{ + route_errors_to_listing = route_to_listing; +} + /* Compress system files by default? */ bool get_scompression (void) @@ -463,22 +450,6 @@ set_format (const struct fmt_spec *default_format_) default_format = *default_format_; } -/* Gets the custom currency specification with the given IDX. */ -const struct custom_currency * -get_cc (int idx) -{ - assert (idx >= 0 && idx < CC_CNT); - return &cc[idx]; -} - -/* Gets custom currency specification IDX to CC. */ -void -set_cc (int idx, const struct custom_currency *cc_) -{ - assert (idx >= 0 && idx < CC_CNT); - cc[idx] = *cc_; -} - /* Are we in testing mode? (e.g. --testing-mode command line option) */ bool