Reworked settings so as to use one large struct instead of lots of static
[pspp] / src / data / settings.h
1 /* PSPP - a program for statistical analysis.
2    Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
3
4    This program is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
16
17 #if !settings_h
18 #define settings_h 1
19
20 #include <stdbool.h>
21 #include <stddef.h>
22 #include "format.h"
23
24 struct settings;
25
26
27 void settings_init (int *, int *);
28 void settings_done (void);
29
30 enum float_format settings_get_input_float_format (void);
31 void settings_set_input_float_format ( enum float_format);
32
33 /* Returns the integer format used for IB and PIB input. */
34 enum integer_format settings_get_input_integer_format (void);
35
36 /* Sets the integer format used for IB and PIB input to
37    FORMAT. */
38 void settings_set_input_integer_format ( enum integer_format);
39
40
41 /* Returns the current output integer format. */
42 enum integer_format settings_get_output_integer_format (void);
43
44 /* Sets the output integer format to INTEGER_FORMAT. */
45 void settings_set_output_integer_format (enum integer_format integer_format);
46
47 /* Returns the current output float format. */
48 enum float_format settings_get_output_float_format (void);
49
50 /* Sets the output float format to FLOAT_FORMAT. */
51 void settings_set_output_float_format (enum float_format float_format);
52
53
54
55 int settings_get_viewlength (void);
56 void settings_set_viewlength ( int);
57
58 int settings_get_viewwidth (void);
59 void settings_set_viewwidth ( int);
60
61 bool settings_get_safer_mode (void);
62 void settings_set_safer_mode (void);
63
64 bool settings_get_echo (void);
65 void settings_set_echo ( bool);
66 bool settings_get_include (void);
67 void settings_set_include ( bool);
68
69 int settings_get_epoch (void);
70 void settings_set_epoch ( int);
71
72 bool settings_get_errorbreak (void);
73 void settings_set_errorbreak ( bool);
74
75 bool settings_get_error_routing_to_terminal (void);
76 void settings_set_error_routing_to_terminal (bool);
77 bool settings_get_error_routing_to_listing (void);
78 void settings_set_error_routing_to_listing (bool);
79
80 bool settings_get_scompression (void);
81 void settings_set_scompression (bool);
82
83 bool settings_get_undefined (void);
84 void settings_set_undefined (bool);
85 double settings_get_blanks (void);
86 void settings_set_blanks (double);
87
88 int settings_get_mxwarns (void);
89 void settings_set_mxwarns ( int);
90 int settings_get_mxerrs (void);
91 void settings_set_mxerrs ( int);
92
93 bool settings_get_printback (void);
94 void settings_set_printback (bool);
95 bool settings_get_mprint (void);
96 void settings_set_mprint (bool);
97
98 int settings_get_mxloops (void);
99 void settings_set_mxloops ( int);
100
101 bool settings_get_nulline (void);
102 void settings_set_nulline (bool);
103
104 char settings_get_endcmd (void);
105 void settings_set_endcmd (char);
106
107 size_t settings_get_workspace (void);
108 size_t settings_get_workspace_cases (size_t value_cnt);
109 void settings_set_workspace ( size_t);
110
111 const struct fmt_spec *settings_get_format (void);
112 void settings_set_format ( const struct fmt_spec *);
113
114 bool settings_get_testing_mode (void);
115 void settings_set_testing_mode ( bool);
116
117 enum behavior_mode {
118   ENHANCED,             /* Use improved PSPP behavior. */
119   COMPATIBLE            /* Be as compatible as possible. */
120 };
121
122 enum behavior_mode settings_get_algorithm (void);
123 void settings_set_algorithm (enum behavior_mode);
124 enum behavior_mode settings_get_syntax (void);
125 void settings_set_syntax (enum behavior_mode);
126
127 void settings_set_cmd_algorithm (enum behavior_mode);
128 void unset_cmd_algorithm (void);
129
130 bool settings_set_cc (const char *cc_string, enum fmt_type type);
131
132 int settings_get_decimal_char (enum fmt_type type);
133 void settings_set_decimal_char (char decimal);
134
135
136 const struct fmt_number_style * settings_get_style (enum fmt_type type);
137
138 char * settings_dollar_template (const struct fmt_spec *fmt);
139
140 #endif /* !settings_h */