Implemented the SHOW command and massaged the SET command to fit
[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., 59 Temple Place - Suite 330, Boston, MA
18    02111-1307, USA. */
19
20 #if !settings_h
21 #define settings_h 1
22
23 /* Table of mode settings (x=X, w=Windows, p=PC+, f=has relevance for
24    PSPP):
25
26    AUTOMENU: p
27    BEEP: p
28    BLANKS: xwpf
29    BLKSIZE: x (only on SHOW, not on SET)
30    BLOCK: xwp
31    BOX/BOXSTRING: xwp
32    BUFNO: x (only on SHOW, not on SET)
33    CASE: xw
34    CCA...CCE: xwf
35    COLOR: p
36    COMP/COMPRESSION: xwpf (meaning varies between p and xw)
37    CPI: xwp
38    CPROMPT: pf
39    DECIMAL: wf
40    DPROMPT: f
41    ECHO: pf
42    EJECT: p
43    EMULATION: f
44    ENDCMD: xpf
45    ERRORBREAK: pf
46    ERRORS: wf
47    FORMAT: xwf
48    HEADERS: xwf
49    HELPWINDOWS: p
50    HIGHRES: w
51    HISTOGRAM: xp
52    INCLUDE: pf
53    JOURNAL: wf (equivalent to LOG)
54    LENGTH: xwp
55    LISTING: xpf
56    LOG: pf (equivalent to JOURNAL)
57    LOWRES: w
58    LPI: xwp
59    MENUS: p
60    MESSAGES: wf
61    MEXPAND: xwf
62    MITERATE: xwf
63    MNEST: xwf
64    MORE: pf
65    MPRINT: xwf
66    MXERRS: xf
67    MXLOOPS: xwf
68    MXMEMORY: w
69    MXWARNS: xwf
70    N: xw (only on SHOW, not on SET)
71    NULLINE: xpf
72    NUMBERED: x (only on SHOW, not on SET)
73    PAGER: f
74    PRINTBACK: xwf
75    PRINTER: pf
76    PROMPT: pf
77    PTRANSLATE: p
78    RCOLOR: p
79    RESULTS: wpf (semantics differ)
80    RUNREVIEW: p
81    SCOMP/SCOMPRESSION: xwf
82    SCREEN: pf
83    SCRIPTTAB: xw
84    SEED: xwpf (semantics differ)
85    SYSMIS: xwf (only on SHOW, not on SET)
86    TBFONTS: xw
87    TB1: xw
88    TB2: x
89    UNDEFINED: xwf
90    VIEWLENGTH: pf
91    VIEWWIDTH: f
92    WEIGHT: xwf (only on SHOW, not on SET)
93    WIDTH: xwp
94    WORKDEV: p
95    WORKSPACE: w
96    XSORT: x
97    $VARS: wf (only on SHOW, not on SET)
98
99  */
100
101 #include <stddef.h>
102 #include <float.h>
103
104
105 /* Describes one custom currency specification. */
106 struct set_cust_currency
107   {
108     char buf[32];               /* Buffer for strings. */
109     char *neg_prefix;           /* Negative prefix. */
110     char *prefix;               /* Prefix. */
111     char *suffix;               /* Suffix. */
112     char *neg_suffix;           /* Negative suffix. */
113     int decimal;                /* Decimal point. */
114     int grouping;               /* Grouping character. */
115   };
116
117
118
119
120 /* Types of routing. */
121 enum
122   {
123     SET_ROUTE_SCREEN = 001,     /* Output to screen devices? */
124     SET_ROUTE_LISTING = 002,    /* Output to listing devices? */
125     SET_ROUTE_OTHER = 004,      /* Output to other devices? */
126     SET_ROUTE_DISABLE = 010     /* Disable output--overrides all other bits. */
127   };
128
129
130 /* Set view width to a very long value, and prevent it from 
131    ever changing */
132 void force_long_view(void);
133
134
135 /* Requested "view length" in lines. */
136 int get_viewlength(void);
137
138 /* Screen width. */
139 int get_viewwidth(void);
140
141 void init_settings(void) ;
142
143 /* Whether pspp can erase and overwrite files */
144 int safer_mode(void);
145
146 /* Put into safer mode */
147 void make_safe(void);
148
149 /* The character used for a decimal point: ',' or '.'.  Only respected
150    for data input and output. */
151 char get_decimal(void);
152
153 /* The character used for grouping in numbers: '.' or ','; the
154    opposite of set_decimal.  Only used in COMMA data input and
155    output. */
156
157 char get_grouping(void);
158
159 char *get_prompt(void);
160
161 /* Prompt used for lines between BEGIN DATA and END DATA. */
162 char *get_dprompt(void);
163
164 /* Continuation prompt. */
165 char *get_cprompt(void);
166
167
168 /* Whether we echo commands to the listing file/printer;*/
169 int get_echo(void);
170
171 /* If echo is on, whether commands from include files are echoed */
172 int get_include(void);
173
174 /* Whether an error stops execution; */
175 int  get_errorbreak(void);
176
177 /* Whether save files should be compressed by default. */
178 int get_scompression(void);
179
180 /* Whether to warn on undefined values in numeric data. */
181 int get_undefined(void);
182
183 /* Maximum number of warnings + errors. */
184 int get_mxwarns(void);
185
186 /* Maximum number of errors. */
187 int get_mxerrs(void);
188
189 /* 0=macro expansion is disabled, 1=macro expansion is enabled. */
190 int get_mexpand(void);
191
192 /* Whether commands are written to the display */
193 int get_printback(void);
194
195 /* Independent of get_printback, controls whether the commands
196    generated by macro invocations are displayed. */
197 int get_mprint(void);
198
199 /* Implied limit of unbounded loop. */
200 int get_mxloops(void);
201
202 /* Whether a blank line is a command terminator */
203 int get_nullline(void);
204
205 /* The character used to terminate commands. */
206 unsigned char get_endcmd(void);
207
208 /* Approximate maximum amount of memory to use for cases, in
209    bytes. */
210 size_t get_max_workspace(void);
211
212 /* The value that blank numeric fields are set to when read in;
213    normally SYSMIS. */
214 double get_blanks(void);
215
216
217 /* Default format for variables created by transformations and by DATA
218    LIST {FREE,LIST}. */
219 struct fmt_spec get_format(void);
220
221 /* CCA through CCE. */
222 const struct set_cust_currency *get_cc(int i);
223
224 #if !USE_INTERNAL_PAGER
225 /* Name of the pager program. */
226 const char *get_pager(void);
227 #endif /* !USE_INTERNAL_PAGER */
228
229
230 /* Return 1 if the seed has been set since the last time this function
231    was called.
232    Fill the value pointed to by seed with the seed .
233 */
234 int seed_is_set(unsigned long *seed);
235
236
237 #endif /* !settings_h */