You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#if !settings_h
#define settings_h 1
-/* Table of mode settings (x=X, w=Windows, p=PC+, f=has relevance for
- PSPP):
-
- AUTOMENU: p
- BEEP: p
- BLANKS: xwpf
- BLKSIZE: x (only on SHOW, not on SET)
- BLOCK: xwp
- BOX/BOXSTRING: xwp
- BUFNO: x (only on SHOW, not on SET)
- CASE: xw
- CCA...CCE: xwf
- COLOR: p
- COMP/COMPRESSION: xwpf (meaning varies between p and xw)
- CPI: xwp
- CPROMPT: pf
- DECIMAL: wf
- DPROMPT: f
- ECHO: pf
- EJECT: p
- EMULATION: f
- ENDCMD: xpf
- ERRORBREAK: pf
- ERRORS: wf
- FORMAT: xwf
- HEADERS: xwf
- HELPWINDOWS: p
- HIGHRES: w
- HISTOGRAM: xp
- INCLUDE: pf
- JOURNAL: wf (equivalent to LOG)
- LENGTH: xwp
- LISTING: xpf
- LOG: pf (equivalent to JOURNAL)
- LOWRES: w
- LPI: xwp
- MENUS: p
- MESSAGES: wf
- MEXPAND: xwf
- MITERATE: xwf
- MNEST: xwf
- MORE: pf
- MPRINT: xwf
- MXERRS: xf
- MXLOOPS: xwf
- MXMEMORY: w
- MXWARNS: xwf
- N: xw (only on SHOW, not on SET)
- NULLINE: xpf
- NUMBERED: x (only on SHOW, not on SET)
- PAGER: f
- PRINTBACK: xwf
- PRINTER: pf
- PROMPT: pf
- PTRANSLATE: p
- RCOLOR: p
- RESULTS: wpf (semantics differ)
- RUNREVIEW: p
- SCOMP/SCOMPRESSION: xwf
- SCREEN: pf
- SCRIPTTAB: xw
- SEED: xwpf (semantics differ)
- SYSMIS: xwf (only on SHOW, not on SET)
- TBFONTS: xw
- TB1: xw
- TB2: x
- UNDEFINED: xwf
- VIEWLENGTH: pf
- VIEWWIDTH: f
- WEIGHT: xwf (only on SHOW, not on SET)
- WIDTH: xwp
- WORKDEV: p
- WORKSPACE: w
- XSORT: x
- $VARS: wf (only on SHOW, not on SET)
-
- */
-
-#include <float.h>
-
-/* The value that blank numeric fields are set to when read in;
- normally SYSMIS. */
-extern double set_blanks;
-
-/* Describes one custom currency specification. */
-struct set_cust_currency
- {
- char buf[32]; /* Buffer for strings. */
- char *neg_prefix; /* Negative prefix. */
- char *prefix; /* Prefix. */
- char *suffix; /* Suffix. */
- char *neg_suffix; /* Negative suffix. */
- int decimal; /* Decimal point. */
- int grouping; /* Grouping character. */
- };
-
-/* CCA through CCE. */
-extern struct set_cust_currency set_cc[5];
-
-/* Whether the active file should be compressed. */
-extern int set_compression;
-
-/* Characters per inch (horizontal). */
-extern int set_cpi;
-
-/* Continuation prompt. */
-extern char *set_cprompt;
-
-/* The character used for a decimal point: ',' or '.'. Only respected
- for data input and output. */
-extern int set_decimal;
-
-/* The character used for grouping in numbers: '.' or ','; the
- opposite of set_decimal. Only used in COMMA data input and
- output. */
-extern int set_grouping;
-
-/* Prompt used for lines between BEGIN DATA and END DATA. */
-extern char *set_dprompt;
-
-/* Whether we echo commands to the listing file/printer; 0=no, 1=yes. */
-extern int set_echo;
-
-/* The character used to terminate commands. */
-extern int set_endcmd;
+#include <stdbool.h>
+#include <stddef.h>
/* Types of routing. */
enum
SET_ROUTE_DISABLE = 010 /* Disable output--overrides all other bits. */
};
-/* Routing for errors, messages, and procedure results. */
-extern int set_errors, set_messages, set_results;
-
-/* Whether an error stops execution; 0=no, 1=yes. */
-extern int set_errorbreak;
-
-/* Default format for variables created by transformations and by DATA
- LIST {FREE,LIST}. */
-extern struct fmt_spec set_format;
-
-/* I don't know what this setting means; 0=no, 1=yes, 2=blank. */
-extern int set_headers;
-
-/* If set_echo is on, whether commands from include files are echoed;
- * 0=no, 1=yes. */
-extern int set_include;
+void settings_init (void);
+void settings_done (void);
-/* Journal file's name. */
-extern char *set_journal;
+void force_long_view (void);
+int get_viewlength (void);
+void set_viewlength (int);
-/* Whether we're journaling. */
-extern int set_journaling;
+int get_viewwidth (void);
+void set_viewwidth (int);
-/* Lines per inch (vertical). */
-extern int set_lpi;
+bool get_safer_mode (void);
+void set_safer_mode (void);
-/* 0=macro expansion is disabled, 1=macro expansion is enabled. */
-extern int set_mexpand;
+char get_decimal (void);
+void set_decimal (char);
+char get_grouping (void);
+void set_grouping (char);
-/* Maximum number of iterations in a macro loop. */
-extern int set_miterate;
+const char *get_prompt (void);
+void set_prompt (const char *);
+const char *get_cprompt (void);
+void set_cprompt (const char *);
+const char *get_dprompt (void);
+void set_dprompt (const char *);
-/* Maximum nesting level for macros. */
-extern int set_mnest;
+bool get_echo (void);
+void set_echo (bool);
+bool get_include (void);
+void set_include (bool);
-/* Whether we pause after each screen of output; 0=no, 1=yes. */
-extern int set_more;
+int get_epoch (void);
+void set_epoch (int);
-/* Independent of set_printback, controls whether the commands
- generated by macro invocations are displayed. */
-extern int set_mprint;
+bool get_errorbreak (void);
+void set_errorbreak (bool);
-/* Maximum number of errors. */
-extern int set_mxerrs;
+bool get_scompression (void);
+void set_scompression (bool);
-/* Implied limit of unbounded loop. */
-extern int set_mxloops;
+bool get_undefined (void);
+void set_undefined (bool);
+double get_blanks (void);
+void set_blanks (double);
-/* Maximum number of warnings + errors. */
-extern int set_mxwarns;
+int get_mxwarns (void);
+void set_mxwarns (int);
+int get_mxerrs (void);
+void set_mxerrs (int);
-/* Whether a blank line is a command terminator; 0=no, 1=yes. */
-extern int set_nullline;
+bool get_printback (void);
+void set_printback (bool);
+bool get_mprint (void);
+void set_mprint (bool);
-/* Whether commands are written to the display; 0=off, 1=on. */
-extern int set_printback;
+int get_mxloops (void);
+void set_mxloops (int);
-#if !USE_INTERNAL_PAGER
-/* Name of the pager program. */
-extern char *set_pager;
-#endif /* !USE_INTERNAL_PAGER */
+bool get_nulline (void);
+void set_nulline (bool);
-/* The command prompt. */
-extern char *set_prompt;
+char get_endcmd (void);
+void set_endcmd (char);
-/* Name of the results file. */
-extern char *set_results_file;
+size_t get_workspace (void);
+void set_workspace (size_t);
-/* Whether to allow certain unsafe operations. Cannot be unset after
- it is set. */
-extern int set_safer;
+const struct fmt_spec *get_format (void);
+void set_format (const struct fmt_spec *);
-/* Whether save files should be compressed by default. */
-extern int set_scompression;
-
-/* The random number seed; NOT_LONG if we want a "random" random
- number seed. */
-extern long set_seed;
-
-/* 1=The user has modified or made use of the random number seed. */
-extern int set_seed_used;
+/* One custom currency specification. */
+#define CC_WIDTH 16
+struct custom_currency
+ {
+ char neg_prefix[CC_WIDTH]; /* Negative prefix. */
+ char prefix[CC_WIDTH]; /* Prefix. */
+ char suffix[CC_WIDTH]; /* Suffix. */
+ char neg_suffix[CC_WIDTH]; /* Negative suffix. */
+ char decimal; /* Decimal point. */
+ char grouping; /* Grouping character. */
+ };
-/* 1=Turn on some heuristics that make testing PSPP for correct
- workings a little easier. */
-extern int set_testing_mode;
+const struct custom_currency *get_cc (int idx);
+void set_cc (int idx, const struct custom_currency *);
-/* Whether to warn on undefined values in numeric data. */
-extern int set_undefined;
+bool get_testing_mode (void);
+void set_testing_mode (bool);
-/* Requested "view length" in lines. */
-extern int set_viewlength;
+enum behavior_mode {
+ ENHANCED, /* Use improved PSPP behavior. */
+ COMPATIBLE /* Be as compatible as possible. */
+};
-/* Screen width. */
-extern int set_viewwidth;
+enum behavior_mode get_algorithm (void);
+void set_algorithm (enum behavior_mode);
+enum behavior_mode get_syntax (void);
+void set_syntax(enum behavior_mode);
+void set_cmd_algorithm (enum behavior_mode);
+void unset_cmd_algorithm (void);
#endif /* !settings_h */