Separate settings and the SET command, for modularity.
[pspp-builds.git] / src / settings.h
1 /* PSPP - computes sample statistics.
2    Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
3    Written by Ben Pfaff <blp@gnu.org>.
4
5    This program is free software; you can redistribute it and/or
6    modify it under the terms of the GNU General Public License as
7    published by the Free Software Foundation; either version 2 of the
8    License, or (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful, but
11    WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, write to the Free Software
17    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18    02110-1301, USA. */
19
20 #if !settings_h
21 #define settings_h 1
22
23 #include <stdbool.h>
24 #include <stddef.h>
25
26 /* Types of routing. */
27 enum
28   {
29     SET_ROUTE_SCREEN = 001,     /* Output to screen devices? */
30     SET_ROUTE_LISTING = 002,    /* Output to listing devices? */
31     SET_ROUTE_OTHER = 004,      /* Output to other devices? */
32     SET_ROUTE_DISABLE = 010     /* Disable output--overrides all other bits. */
33   };
34
35 void init_settings (void);
36 void done_settings (void);
37
38 void force_long_view (void);
39 int get_viewlength (void);
40 void set_viewlength (int);
41
42 int get_viewwidth (void);
43 void set_viewwidth (int);
44
45 bool get_safer_mode (void);
46 void set_safer_mode (void);
47
48 char get_decimal (void);
49 void set_decimal (char);
50 char get_grouping (void);
51 void set_grouping (char);
52
53 const char *get_prompt (void);
54 void set_prompt (const char *);
55 const char *get_cprompt (void);
56 void set_cprompt (const char *);
57 const char *get_dprompt (void);
58 void set_dprompt (const char *);
59
60 bool get_echo (void);
61 void set_echo (bool);
62 bool get_include (void);
63 void set_include (bool);
64
65 int get_epoch (void);
66 void set_epoch (int);
67
68 bool get_errorbreak (void);
69 void set_errorbreak (bool);
70
71 bool get_scompression (void);
72 void set_scompression (bool);
73
74 bool get_undefined (void);
75 void set_undefined (bool);
76 double get_blanks (void);
77 void set_blanks (double);
78
79 int get_mxwarns (void);
80 void set_mxwarns (int);
81 int get_mxerrs (void);
82 void set_mxerrs (int);
83
84 bool get_printback (void);
85 void set_printback (bool);
86 bool get_mprint (void);
87 void set_mprint (bool);
88
89 int get_mxloops (void);
90 void set_mxloops (int);
91
92 bool get_nulline (void);
93 void set_nulline (bool);
94
95 char get_endcmd (void);
96 void set_endcmd (char);
97
98 size_t get_workspace (void);
99 void set_workspace (size_t);
100
101 const struct fmt_spec *get_format (void);
102 void set_format (const struct fmt_spec *);
103
104 /* One custom currency specification. */
105 #define CC_WIDTH 16
106 struct custom_currency
107   {
108     char neg_prefix[CC_WIDTH];  /* Negative prefix. */
109     char prefix[CC_WIDTH];      /* Prefix. */
110     char suffix[CC_WIDTH];      /* Suffix. */
111     char neg_suffix[CC_WIDTH];  /* Negative suffix. */
112     char decimal;               /* Decimal point. */
113     char grouping;              /* Grouping character. */
114   };
115
116 const struct custom_currency *get_cc (int idx);
117 void set_cc (int idx, const struct custom_currency *);
118
119 #include <gsl/gsl_rng.h>
120
121 gsl_rng *get_rng (void);
122 void set_rng (unsigned long seed);
123
124 bool get_testing_mode (void);
125 void set_testing_mode (bool);
126
127 enum behavior_mode {
128   ENHANCED,             /* Use improved PSPP behavior. */
129   COMPATIBLE            /* Be as compatible as possible. */
130 };
131
132 enum behavior_mode get_algorithm (void);
133 void set_algorithm (enum behavior_mode);
134 enum behavior_mode get_syntax (void);
135 void set_syntax(enum behavior_mode);
136 void set_cmd_algorithm (enum behavior_mode);
137 void unset_cmd_algorithm (void);
138
139 #endif /* !settings_h */