2f2bbe99b46edd2ad28e5bebb75015581b3267f9
[pspp-builds.git] / 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 <data/format.h>
23 #include <libpspp/float-format.h>
24 #include <libpspp/integer-format.h>
25
26 struct settings;
27
28
29 void settings_init (int *, int *);
30 void settings_done (void);
31
32 enum float_format settings_get_input_float_format (void);
33 void settings_set_input_float_format ( enum float_format);
34
35 /* Returns the integer format used for IB and PIB input. */
36 enum integer_format settings_get_input_integer_format (void);
37
38 /* Sets the integer format used for IB and PIB input to
39    FORMAT. */
40 void settings_set_input_integer_format ( enum integer_format);
41
42
43 /* Returns the current output integer format. */
44 enum integer_format settings_get_output_integer_format (void);
45
46 /* Sets the output integer format to INTEGER_FORMAT. */
47 void settings_set_output_integer_format (enum integer_format integer_format);
48
49 /* Returns the current output float format. */
50 enum float_format settings_get_output_float_format (void);
51
52 /* Sets the output float format to FLOAT_FORMAT. */
53 void settings_set_output_float_format (enum float_format float_format);
54
55
56
57 int settings_get_viewlength (void);
58 void settings_set_viewlength ( int);
59
60 int settings_get_viewwidth (void);
61 void settings_set_viewwidth ( int);
62
63 bool settings_get_safer_mode (void);
64 void settings_set_safer_mode (void);
65
66 bool settings_get_echo (void);
67 void settings_set_echo ( bool);
68 bool settings_get_include (void);
69 void settings_set_include ( bool);
70
71 int settings_get_epoch (void);
72 void settings_set_epoch ( int);
73
74 bool settings_get_errorbreak (void);
75 void settings_set_errorbreak ( bool);
76
77 bool settings_get_error_routing_to_terminal (void);
78 void settings_set_error_routing_to_terminal (bool);
79 bool settings_get_error_routing_to_listing (void);
80 void settings_set_error_routing_to_listing (bool);
81
82 bool settings_get_scompression (void);
83 void settings_set_scompression (bool);
84
85 bool settings_get_undefined (void);
86 void settings_set_undefined (bool);
87 double settings_get_blanks (void);
88 void settings_set_blanks (double);
89
90 int settings_get_mxwarns (void);
91 void settings_set_mxwarns ( int);
92 int settings_get_mxerrs (void);
93 void settings_set_mxerrs ( int);
94
95 bool settings_get_printback (void);
96 void settings_set_printback (bool);
97 bool settings_get_mprint (void);
98 void settings_set_mprint (bool);
99
100 int settings_get_mxloops (void);
101 void settings_set_mxloops ( int);
102
103 bool settings_get_nulline (void);
104 void settings_set_nulline (bool);
105
106 char settings_get_endcmd (void);
107 void settings_set_endcmd (char);
108
109 size_t settings_get_workspace (void);
110 size_t settings_get_workspace_cases (size_t value_cnt);
111 void settings_set_workspace (size_t);
112
113 const struct fmt_spec *settings_get_format (void);
114 void settings_set_format ( const struct fmt_spec *);
115
116 bool settings_get_testing_mode (void);
117 void settings_set_testing_mode (bool);
118
119 enum behavior_mode {
120   ENHANCED,             /* Use improved PSPP behavior. */
121   COMPATIBLE            /* Be as compatible as possible. */
122 };
123
124 enum behavior_mode settings_get_algorithm (void);
125 void settings_set_algorithm (enum behavior_mode);
126 enum behavior_mode settings_get_syntax (void);
127 void settings_set_syntax (enum behavior_mode);
128
129 void settings_set_cmd_algorithm (enum behavior_mode);
130 void unset_cmd_algorithm (void);
131
132 enum fmt_type;
133 bool settings_set_cc (const char *cc_string, enum fmt_type type);
134
135 int settings_get_decimal_char (enum fmt_type type);
136 void settings_set_decimal_char (char decimal);
137
138
139 const struct fmt_number_style * settings_get_style (enum fmt_type type);
140
141 char * settings_dollar_template (const struct fmt_spec *fmt);
142
143 #endif /* !settings_h */