4bdc65d1fe32cc2cb5e9a756145234d2ce229e3d
[pspp-builds.git] / src / data / 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 settings_init (void);
36 void settings_done (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 bool get_echo (void);
54 void set_echo (bool);
55 bool get_include (void);
56 void set_include (bool);
57
58 int get_epoch (void);
59 void set_epoch (int);
60
61 bool get_errorbreak (void);
62 void set_errorbreak (bool);
63
64 bool get_scompression (void);
65 void set_scompression (bool);
66
67 bool get_undefined (void);
68 void set_undefined (bool);
69 double get_blanks (void);
70 void set_blanks (double);
71
72 int get_mxwarns (void);
73 void set_mxwarns (int);
74 int get_mxerrs (void);
75 void set_mxerrs (int);
76
77 bool get_printback (void);
78 void set_printback (bool);
79 bool get_mprint (void);
80 void set_mprint (bool);
81
82 int get_mxloops (void);
83 void set_mxloops (int);
84
85 bool get_nulline (void);
86 void set_nulline (bool);
87
88 char get_endcmd (void);
89 void set_endcmd (char);
90
91 size_t get_workspace (void);
92 void set_workspace (size_t);
93
94 const struct fmt_spec *get_format (void);
95 void set_format (const struct fmt_spec *);
96
97 /* Maximum number of custom currency specifications */
98 #define CC_CNT 5
99
100 /* One custom currency specification. */
101 #define CC_WIDTH 16
102 struct custom_currency
103   {
104     char neg_prefix[CC_WIDTH];  /* Negative prefix. */
105     char prefix[CC_WIDTH];      /* Prefix. */
106     char suffix[CC_WIDTH];      /* Suffix. */
107     char neg_suffix[CC_WIDTH];  /* Negative suffix. */
108     char decimal;               /* Decimal point. */
109     char grouping;              /* Grouping character. */
110   };
111
112 const struct custom_currency *get_cc (int idx);
113 void set_cc (int idx, const struct custom_currency *);
114
115 bool get_testing_mode (void);
116 void set_testing_mode (bool);
117
118 enum behavior_mode {
119   ENHANCED,             /* Use improved PSPP behavior. */
120   COMPATIBLE            /* Be as compatible as possible. */
121 };
122
123 enum behavior_mode get_algorithm (void);
124 void set_algorithm (enum behavior_mode);
125 enum behavior_mode get_syntax (void);
126 void set_syntax(enum behavior_mode);
127 void set_cmd_algorithm (enum behavior_mode);
128 void unset_cmd_algorithm (void);
129
130 #endif /* !settings_h */