X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fsettings.h;h=2eedbddbcd60b5b044cd0eeb1913982ea6af68ed;hb=6331aa1af5f813fbe463fd0970c39a35c5243332;hp=30256ae3ed4965cfb27153f9f7ffe51a66658df8;hpb=f9d47b5bba8416419cf3bcd3aa23c2d40a05fcac;p=pspp diff --git a/src/settings.h b/src/settings.h index 30256ae3ed..2eedbddbcd 100644 --- a/src/settings.h +++ b/src/settings.h @@ -14,138 +14,14 @@ 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 #include -#include - -/* 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; /* Types of routing. */ enum @@ -156,103 +32,106 @@ 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; +void settings_init (void); +void settings_done (void); -/* I don't know what this setting means; 0=no, 1=yes, 2=blank. */ -extern int set_headers; +void force_long_view (void); +int get_viewlength (void); +void set_viewlength (int); -/* If set_echo is on, whether commands from include files are echoed; - * 0=no, 1=yes. */ -extern int set_include; +int get_viewwidth (void); +void set_viewwidth (int); -/* Journal file's name. */ -extern char *set_journal; +bool get_safer_mode (void); +void set_safer_mode (void); -/* Whether we're journaling. */ -extern int set_journaling; +char get_decimal (void); +void set_decimal (char); +char get_grouping (void); +void set_grouping (char); -/* Lines per inch (vertical). */ -extern int set_lpi; +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 *); -/* 0=macro expansion is disabled, 1=macro expansion is enabled. */ -extern int set_mexpand; +bool get_echo (void); +void set_echo (bool); +bool get_include (void); +void set_include (bool); -/* Maximum number of iterations in a macro loop. */ -extern int set_miterate; +int get_epoch (void); +void set_epoch (int); -/* Maximum nesting level for macros. */ -extern int set_mnest; +bool get_errorbreak (void); +void set_errorbreak (bool); -/* Whether we pause after each screen of output; 0=no, 1=yes. */ -extern int set_more; +bool get_scompression (void); +void set_scompression (bool); -/* Independent of set_printback, controls whether the commands - generated by macro invocations are displayed. */ -extern int set_mprint; +bool get_undefined (void); +void set_undefined (bool); +double get_blanks (void); +void set_blanks (double); -/* Maximum number of errors. */ -extern int set_mxerrs; +int get_mxwarns (void); +void set_mxwarns (int); +int get_mxerrs (void); +void set_mxerrs (int); -/* Implied limit of unbounded loop. */ -extern int set_mxloops; +bool get_printback (void); +void set_printback (bool); +bool get_mprint (void); +void set_mprint (bool); -/* Maximum number of warnings + errors. */ -extern int set_mxwarns; +int get_mxloops (void); +void set_mxloops (int); -/* Whether a blank line is a command terminator; 0=no, 1=yes. */ -extern int set_nullline; +bool get_nulline (void); +void set_nulline (bool); -/* Whether commands are written to the display; 0=off, 1=on. */ -extern int set_printback; +char get_endcmd (void); +void set_endcmd (char); -#if !USE_INTERNAL_PAGER -/* Name of the pager program. */ -extern char *set_pager; -#endif /* !USE_INTERNAL_PAGER */ +size_t get_workspace (void); +void set_workspace (size_t); -/* The command prompt. */ -extern char *set_prompt; +const struct fmt_spec *get_format (void); +void set_format (const struct fmt_spec *); -/* Name of the results file. */ -extern char *set_results_file; +/* Maximum number of custom currency specifications */ +#define CC_CNT 5 -/* Whether to allow certain unsafe operations. Cannot be unset after - it is set. */ -extern int set_safer; - -/* 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; - -/* 1=Turn on some heuristics that make testing PSPP for correct - workings a little easier. */ -extern int set_testing_mode; +/* 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. */ + }; -/* Whether to warn on undefined values in numeric data. */ -extern int set_undefined; +const struct custom_currency *get_cc (int idx); +void set_cc (int idx, const struct custom_currency *); -/* Requested "view length" in lines. */ -extern int set_viewlength; +bool get_testing_mode (void); +void set_testing_mode (bool); -/* Screen width. */ -extern int set_viewwidth; +enum behavior_mode { + ENHANCED, /* Use improved PSPP behavior. */ + COMPATIBLE /* Be as compatible as possible. */ +}; -/* Approximate maximum amount of memory to use for cases, in - bytes. */ -extern size_t set_max_workspace; +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 */