1 /* PSPP - computes sample statistics.
2 Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
3 Written by Ben Pfaff <blp@gnu.org>.
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.
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.
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
21 Categories of SET subcommands:
23 data input: BLANKS, DECIMAL, FORMAT, EPOCH.
25 program input: ENDCMD, NULLINE.
27 interaction: CPROMPT, DPROMPT, ERRORBREAK, MXERRS, MXWARNS, PROMPT.
29 program execution: MEXPAND, MITERATE, MNEST, MPRINT,
30 MXLOOPS, SEED, UNDEFINED.
32 data output: CCA...CCE, DECIMAL, FORMAT, RESULTS-p.
34 output routing: ECHO, ERRORS, INCLUDE, MESSAGES, PRINTBACK, ERRORS,
37 output activation: LISTING (on/off), SCREEN, PRINTER.
39 output driver options: HEADERS, MORE, PAGER, VIEWLENGTH, VIEWWIDTH,
42 logging: LOG, JOURNAL.
44 system files: COMP/COMPRESSION, SCOMP/SCOMPRESSION.
52 These subcommands remain to be implemented:
53 ECHO, PRINTBACK, INCLUDE
54 MORE, PAGER, VIEWLENGTH, VIEWWIDTH, HEADERS
56 These subcommands are not complete:
57 MESSAGES, ERRORS, RESULTS
58 LISTING/DISK, LOG/JOURNAL
84 #else /* !HAVE_TERMCAP_H */
85 int tgetent (char *, const char *);
86 int tgetnum (const char *);
87 #endif /* !HAVE_TERMCAP_H */
88 #endif /* !HAVE_LIBTERMCAP */
90 static int set_errors;
91 static int set_messages;
92 static int set_results;
94 static double set_blanks=SYSMIS;
96 static int set_epoch = -1;
98 static struct fmt_spec set_format={FMT_F,8,2};
100 static struct set_cust_currency set_cc[5];
102 static char *set_journal;
103 static int set_journaling;
105 static int set_listing=1;
107 #if !USE_INTERNAL_PAGER
108 static char *set_pager=0;
109 #endif /* !USE_INTERNAL_PAGER */
113 static int long_view=0;
114 int set_testing_mode=0;
115 static int set_viewlength;
116 static int set_viewwidth;
118 void aux_show_warranty(void);
119 void aux_show_copying(void);
121 static const char *route_to_string(int routing);
122 static void set_routing (int q, int *setting);
124 static int set_ccx (const char *cc_string, struct set_cust_currency * cc,
126 static void set_rng (unsigned long);
127 static unsigned long random_seed (void);
131 automenu=automenu:on/off;
134 block=string "x==1" "one character long";
135 boxstring=string "x==3 || x==11" "3 or 11 characters long";
136 case=size:upper/uplow;
143 compression=compress:on/off;
144 cpi=integer "x>0" "%s must be greater than 0";
146 decimal=dec:dot/comma;
151 endcmd=string "x==1" "one character long";
153 errorbreak=errbrk:on/off;
154 errors=errors:on/off/terminal/listing/both/none;
156 headers=headers:no/yes/blank;
157 helpwindows=helpwin:on/off;
158 highres=hires:on/off;
159 histogram=string "x==1" "one character long";
165 lowres=lores:auto/on/off;
166 lpi=integer "x>0" "%s must be greater than 0";
167 menus=menus:standard/extended;
168 messages=messages:on/off/terminal/listing/both/none;
170 miterate=integer "x>0" "%s must be greater than 0";
171 mnest=integer "x>0" "%s must be greater than 0";
173 mprint=mprint:on/off;
174 mxerrs=integer "x >= 1" "%s must be at least 1";
175 mxloops=integer "x >=1" "%s must be at least 1";
180 printback=prtbck:on/off;
183 ptranslate=ptrans:on/off;
186 runreview=runrev:auto/manual;
188 scompression=scompress:on/off;
190 scripttab=string "x==1" "one character long";
192 tb1=string "x==3 || x==11" "3 or 11 characters long";
194 undefined=undef:warn/nowarn;
199 workspace=integer "x>=1024" "%s must be at least 1 MB";
208 aux_stc_custom_blanks(struct cmd_set *cmd UNUSED)
210 if ( set_blanks == SYSMIS )
213 msg(MM, "%g", set_blanks);
219 aux_stc_custom_color(struct cmd_set *cmd UNUSED)
221 msg (MW, _("%s is obsolete."),"COLOR");
226 aux_stc_custom_listing(struct cmd_set *cmd UNUSED)
229 msg(MM, _("LISTING is ON"));
231 msg(MM, _("LISTING is OFF"));
237 aux_stc_custom_disk(struct cmd_set *cmd UNUSED)
239 return aux_stc_custom_listing(cmd);
243 aux_stc_custom_epoch(struct cmd_set *cmd UNUSED)
245 msg (MM, _("EPOCH is %d"), get_epoch ());
250 aux_stc_custom_format(struct cmd_set *cmd UNUSED)
252 msg(MM, fmt_to_string(&set_format));
259 aux_stc_custom_journal(struct cmd_set *cmd UNUSED)
262 msg(MM, set_journal);
264 msg(MM, _("Journalling is off") );
270 aux_stc_custom_length(struct cmd_set *cmd UNUSED)
272 msg(MM, "%d", set_viewlength);
277 aux_stc_custom_log(struct cmd_set *cmd )
279 return aux_stc_custom_journal (cmd);
283 aux_stc_custom_pager(struct cmd_set *cmd UNUSED)
285 #if !USE_INTERNAL_PAGER
290 #else /* USE_INTERNAL_PAGER */
291 msg (MM, "Internal pager.");
292 #endif /* USE_INTERNAL_PAGER */
298 aux_stc_custom_rcolor(struct cmd_set *cmd UNUSED)
300 msg (SW, _("%s is obsolete."),"RCOLOR");
305 aux_stc_custom_results(struct cmd_set *cmd UNUSED)
308 msg(MM, route_to_string(set_results) );
314 aux_stc_custom_seed(struct cmd_set *cmd UNUSED)
320 aux_stc_custom_viewlength(struct cmd_set *cmd UNUSED)
322 msg(MM, "%d", set_viewlength);
327 aux_stc_custom_viewwidth(struct cmd_set *cmd UNUSED)
329 msg(MM, "%d", set_viewwidth);
334 aux_stc_custom_width(struct cmd_set *cmd UNUSED)
336 msg(MM, "%d", set_viewwidth);
341 aux_stc_custom_workdev(struct cmd_set *cmd UNUSED)
343 msg (SW, _("%s is obsolete."),"WORKDEV");
350 warranty=show_warranty;
351 copying=show_copying.
355 static struct cmd_set cmd;
360 lex_match_id ("SHOW");
362 if (!aux_parse_set (&cmd))
372 if (!parse_set (&cmd))
376 set_ccx (cmd.s_cca, &set_cc[0], 'A');
378 set_ccx (cmd.s_ccb, &set_cc[1], 'B');
380 set_ccx (cmd.s_ccc, &set_cc[2], 'C');
382 set_ccx (cmd.s_ccd, &set_cc[3], 'D');
384 set_ccx (cmd.s_cce, &set_cc[4], 'E');
387 set_routing (cmd.errors, &set_errors);
388 if (cmd.sbc_messages)
389 set_routing (cmd.messages, &set_messages);
391 /* PC+ compatible syntax. */
393 outp_enable_device (cmd.scrn == STC_OFF ? 0 : 1, OUTP_DEV_SCREEN);
395 outp_enable_device (cmd.prtr == STC_OFF ? 0 : 1, OUTP_DEV_PRINTER);
397 if (cmd.sbc_automenu )
398 msg (SW, _("%s is obsolete."),"AUTOMENU");
400 msg (SW, _("%s is obsolete."),"BEEP");
402 msg (SW, _("%s is obsolete."),"BLOCK");
403 if (cmd.sbc_boxstring)
404 msg (SW, _("%s is obsolete."),"BOXSTRING");
406 msg (SW, _("%s is obsolete."),"EJECT");
407 if (cmd.sbc_helpwindows )
408 msg (SW, _("%s is obsolete."),"HELPWINDOWS");
409 if (cmd.sbc_histogram)
410 msg (MW, _("%s is obsolete."),"HISTOGRAM");
412 msg (MW, _("%s is obsolete."),"MENUS");
413 if (cmd.sbc_ptranslate )
414 msg (SW, _("%s is obsolete."),"PTRANSLATE");
415 if (cmd.sbc_runreview )
416 msg (SW, _("%s is obsolete."),"RUNREVIEW");
418 msg (SW, _("%s is obsolete."),"XSORT");
419 if (cmd.sbc_mxmemory )
420 msg (SE, _("%s is obsolete."),"MXMEMORY");
421 if (cmd.sbc_scripttab)
422 msg (SE, _("%s is obsolete."),"SCRIPTTAB");
425 msg (SW, _("%s is not yet implemented."),"TBFONTS");
426 if (cmd.sbc_tb1 && cmd.s_tb1)
427 msg (SW, _("%s is not yet implemented."),"TB1");
429 /* Windows compatible syntax. */
431 msg (SW, _("CASE is not implemented and probably won't be. "
432 "If you care, complain about it."));
434 if (cmd.sbc_compression)
436 msg (MW, _("Active file compression is not yet implemented "
437 "(and probably won't be)."));
443 /* Sets custom currency specifier CC having name CC_NAME ('A' through
444 'E') to correspond to the settings in CC_STRING. */
446 set_ccx (const char *cc_string, struct set_cust_currency * cc, int cc_name)
448 if (strlen (cc_string) > 16)
450 msg (SE, _("CC%c: Length of custom currency string `%s' (%d) "
451 "exceeds maximum length of 16."),
452 cc_name, cc_string, strlen (cc_string));
456 /* Determine separators. */
459 int n_commas, n_periods;
461 /* Count the number of commas and periods. There must be exactly
462 three of one or the other. */
463 n_commas = n_periods = 0;
464 for (sp = cc_string; *sp; sp++)
470 if (!((n_commas == 3) ^ (n_periods == 3)))
472 msg (SE, _("CC%c: Custom currency string `%s' does not contain "
473 "exactly three periods or commas (not both)."),
477 else if (n_commas == 3)
489 /* Copy cc_string to cc, changing separators to nulls. */
493 strcpy (cc->buf, cc_string);
494 cp = cc->neg_prefix = cc->buf;
496 while (*cp++ != cc->grouping)
501 while (*cp++ != cc->grouping)
506 while (*cp++ != cc->grouping)
517 route_to_string(int routing)
525 strcpy(s, _("None"));
529 if (routing & SET_ROUTE_DISABLE )
531 strcpy(s, _("Disabled") );
535 if (routing & SET_ROUTE_SCREEN)
536 strcat(s, _("Screen") );
538 if (routing & SET_ROUTE_LISTING)
543 strcat(s, _("Listing") );
546 if (routing & SET_ROUTE_OTHER)
550 strcat(s, _("Other") );
559 /* Sets *SETTING, which is a combination of SET_ROUTE_* bits that
560 indicates what to do with some sort of output, to the value
561 indicated by Q, which is a value provided by the input parser. */
563 set_routing (int q, int *setting)
568 *setting |= SET_ROUTE_DISABLE;
571 *setting &= ~SET_ROUTE_DISABLE;
574 *setting &= ~(SET_ROUTE_LISTING | SET_ROUTE_OTHER);
575 *setting |= SET_ROUTE_SCREEN;
578 *setting &= ~SET_ROUTE_SCREEN;
579 *setting |= SET_ROUTE_LISTING | SET_ROUTE_OTHER;
582 *setting |= SET_ROUTE_SCREEN | SET_ROUTE_LISTING | SET_ROUTE_OTHER;
585 *setting &= ~(SET_ROUTE_SCREEN | SET_ROUTE_LISTING | SET_ROUTE_OTHER);
593 stc_custom_pager (struct cmd_set *cmd UNUSED)
596 #if !USE_INTERNAL_PAGER
597 if (lex_match_id ("OFF"))
605 if (!lex_force_string ())
609 set_pager = xstrdup (ds_c_str (&tokstr));
613 #else /* USE_INTERNAL_PAGER */
614 if (lex_match_id ("OFF"))
616 msg (SW, "External pagers not supported.");
618 #endif /* USE_INTERNAL_PAGER */
621 /* Parses the BLANKS subcommand, which controls the value that
622 completely blank fields in numeric data imply. X, Wnd: Syntax is
623 SYSMIS or a numeric value; PC+: Syntax is '.', which is equivalent
624 to SYSMIS, or a numeric value. */
626 stc_custom_blanks (struct cmd_set *cmd UNUSED)
629 if ((token == T_ID && lex_id_match ("SYSMIS", tokid))
630 || (token == T_STRING && !strcmp (tokid, ".")))
637 if (!lex_force_num ())
645 /* Parses the EPOCH subcommand, which controls the epoch used for
646 parsing 2-digit years. */
648 stc_custom_epoch (struct cmd_set *cmd UNUSED)
651 if (lex_match_id ("AUTOMATIC"))
653 else if (lex_is_integer ())
655 int new_epoch = lex_integer ();
657 if (new_epoch < 1500)
659 msg (SE, _("EPOCH must be 1500 or later."));
662 set_epoch = new_epoch;
666 lex_error (_("expecting AUTOMATIC or year"));
674 stc_custom_length (struct cmd_set *cmd UNUSED)
679 if (lex_match_id ("NONE"))
683 if (!lex_force_int ())
685 if (lex_integer () < 1)
687 msg (SE, _("LENGTH must be at least 1."));
690 page_length = lex_integer ();
694 if ( page_length != -1 )
695 set_viewlength = page_length;
701 stc_custom_results (struct cmd_set *cmd UNUSED)
709 static struct tuple tab[] =
713 {"TERMINAL", STC_TERMINAL},
714 {"LISTING", STC_LISTING},
726 msg (SE, _("Missing identifier in RESULTS subcommand."));
730 for (t = tab; t->s; t++)
731 if (lex_id_match (t->s, tokid))
734 set_routing (t->v, &set_results);
737 msg (SE, _("Unrecognized identifier in RESULTS subcommand."));
742 stc_custom_seed (struct cmd_set *cmd UNUSED)
745 if (lex_match_id ("RANDOM"))
746 set_rng (random_seed ());
749 if (!lex_force_num ())
759 stc_custom_width (struct cmd_set *cmd UNUSED)
764 if (lex_match_id ("NARROW"))
766 else if (lex_match_id ("WIDE"))
770 if (!lex_force_int ())
772 if (lex_integer () < 1)
774 msg (SE, _("WIDTH must be at least 1."));
777 page_width = lex_integer ();
781 set_viewwidth = page_width;
785 /* Parses FORMAT subcommand, which consists of a numeric format
788 stc_custom_format (struct cmd_set *cmd UNUSED)
793 if (!parse_format_specifier (&fmt, 0))
795 if ((formats[fmt.type].cat & FCAT_STRING) != 0)
797 msg (SE, _("FORMAT requires numeric output format as an argument. "
798 "Specified format %s is of type string."),
799 fmt_to_string (&fmt));
808 stc_custom_journal (struct cmd_set *cmd UNUSED)
811 if (lex_match_id ("ON"))
813 else if (lex_match_id ("OFF"))
815 if (token == T_STRING)
817 set_journal = xstrdup (ds_c_str (&tokstr));
823 /* Parses COLOR subcommand. PC+: either ON or OFF or two or three
824 comma-delimited numbers inside parentheses. */
826 stc_custom_color (struct cmd_set *cmd UNUSED)
828 msg (MW, _("%s is obsolete."),"COLOR");
831 if (!lex_match_id ("ON") && !lex_match_id ("YES") && !lex_match_id ("OFF") && !lex_match_id ("NO"))
833 if (!lex_force_match ('('))
835 if (!lex_match ('*'))
837 if (!lex_force_int ())
839 if (lex_integer () < 0 || lex_integer () > 15)
841 msg (SE, _("Text color must be in range 0-15."));
846 if (!lex_force_match (','))
848 if (!lex_match ('*'))
850 if (!lex_force_int ())
852 if (lex_integer () < 0 || lex_integer () > 7)
854 msg (SE, _("Background color must be in range 0-7."));
859 if (lex_match (',') && !lex_match ('*'))
861 if (!lex_force_int ())
863 if (lex_integer () < 0 || lex_integer () > 7)
865 msg (SE, _("Border color must be in range 0-7."));
870 if (!lex_force_match (')'))
877 stc_custom_listing (struct cmd_set *cmd UNUSED)
880 if (lex_match_id ("ON") || lex_match_id ("YES"))
882 else if (lex_match_id ("OFF") || lex_match_id ("NO"))
889 outp_enable_device (set_listing, OUTP_DEV_LISTING);
895 stc_custom_disk (struct cmd_set *cmd UNUSED)
897 return stc_custom_listing (cmd);
901 stc_custom_log (struct cmd_set *cmd UNUSED)
903 return stc_custom_journal (cmd);
907 stc_custom_rcolor (struct cmd_set *cmd UNUSED)
909 msg (SW, _("%s is obsolete."),"RCOLOR");
912 if (!lex_force_match ('('))
915 if (!lex_match ('*'))
917 if (!lex_force_int ())
919 if (lex_integer () < 0 || lex_integer () > 6)
921 msg (SE, _("Lower window color must be between 0 and 6."));
926 if (!lex_force_match (','))
929 if (!lex_match ('*'))
931 if (!lex_force_int ())
933 if (lex_integer () < 0 || lex_integer () > 6)
935 msg (SE, _("Upper window color must be between 0 and 6."));
941 if (lex_match (',') && !lex_match ('*'))
943 if (!lex_force_int ())
945 if (lex_integer () < 0 || lex_integer () > 6)
947 msg (SE, _("Frame color must be between 0 and 6."));
956 stc_custom_viewwidth (struct cmd_set *cmd UNUSED)
960 if ( !lex_force_int() )
963 set_viewwidth = lex_integer();
970 stc_custom_viewlength (struct cmd_set *cmd UNUSED)
972 if (lex_match_id ("MINIMUM"))
974 else if (lex_match_id ("MEDIAN"))
975 set_viewlength = 43; /* This is not correct for VGA displays. */
976 else if (lex_match_id ("MAXIMUM"))
980 if (!lex_force_int ())
983 if (lex_integer () >= (43 + 25) / 2)
988 set_viewlength = lex_integer ();
994 msg (SW, _("%s is not yet implemented."),"VIEWLENGTH");
1000 stc_custom_workdev (struct cmd_set *cmd UNUSED)
1004 msg (SW, _("%s is obsolete."),"WORKDEV");
1007 for (*c = 'A'; *c <= 'Z'; (*c)++)
1008 if (token == T_ID && lex_id_match (c, tokid))
1013 msg (SE, _("Drive letter expected in WORKDEV subcommand."));
1020 set_viewport(int sig_num UNUSED)
1023 static char term_buffer[16384];
1027 set_viewlength = -1;
1029 #if __DJGPP__ || __BORLANDC__
1031 struct text_info ti;
1034 set_viewlength = max (ti.screenheight, 25);
1035 set_viewwidth = max (ti.screenwidth, 79);
1037 #elif HAVE_LIBTERMCAP
1042 /* This code stolen from termcap.info, though modified. */
1043 termtype = getenv ("TERM");
1045 msg (FE, _("Specify a terminal type with the TERM environment variable."));
1047 success = tgetent (term_buffer, termtype);
1051 msg (IE, _("Could not access the termcap data base."));
1053 msg (IE, _("Terminal type `%s' is not defined."), termtype);
1057 /* NOTE: Do not rely upon tgetnum returning -1 if the value is
1058 not available. It's supposed to do it, but not all platforms
1061 if ( -1 != tgetnum("li"))
1062 set_viewlength = tgetnum ("li");
1064 if ( -1 != tgetnum("co"))
1065 set_viewwidth = tgetnum ("co") - 1;
1068 #endif /* HAVE_LIBTERMCAP */
1070 /* Try the environment variables */
1071 if ( -1 == set_viewwidth )
1073 char *s = getenv("COLUMNS");
1074 if ( s ) set_viewwidth = atoi(s);
1077 if ( -1 == set_viewwidth )
1079 char *s = getenv("LINES");
1080 if ( s ) set_viewlength = atoi(s);
1084 /* Last resort. Use hard coded values */
1085 if ( 0 > set_viewwidth ) set_viewwidth = 79;
1086 if ( 0 > set_viewlength ) set_viewlength = 24;
1090 /* Public functions */
1100 free (cmd.s_endcmd);
1101 free (cmd.s_prompt);
1102 free (cmd.s_cprompt);
1103 free (cmd.s_dprompt);
1111 cmd.s_dprompt = xstrdup (_("data> "));
1112 cmd.s_cprompt = xstrdup (" > ");
1113 cmd.s_prompt = xstrdup ("PSPP> ");
1114 cmd.s_endcmd = xstrdup (".");
1116 assert(cmd.safe == 0 );
1124 cmd.headers = STC_YES;
1125 cmd.errbrk = STC_OFF;
1127 cmd.scompress = STC_OFF;
1128 cmd.undef = STC_WARN;
1129 cmd.mprint = STC_ON ;
1130 cmd.prtbck = STC_ON ;
1134 set_journal = xstrdup ("pspp.jnl");
1137 cmd.n_mxwarns[0] = 100;
1138 cmd.n_mxerrs[0] = 100;
1139 cmd.n_mxloops[0] = 1;
1140 cmd.n_workspace[0] = 4L * 1024 * 1024;
1143 #if !USE_INTERNAL_PAGER
1145 const char *pager = getenv ("STAT_PAGER");
1149 const char *p = getenv ("PAGER");
1152 set_pager = xstrdup (p);
1159 set_pager = xstrdup (pager);
1162 set_pager = xstrdup (DEFAULT_PAGER);
1163 #endif /* DEFAULT_PAGER */
1165 #endif /* !USE_INTERNAL_PAGER */
1171 for (i = 0; i < 5; i++)
1173 struct set_cust_currency *cc = &set_cc[i];
1174 strcpy (cc->buf, "-");
1175 cc->neg_prefix = cc->buf;
1176 cc->prefix = &cc->buf[1];
1177 cc->suffix = &cc->buf[1];
1178 cc->neg_suffix = &cc->buf[1];
1187 signal (SIGWINCH, set_viewport);
1193 force_long_view(void)
1202 return !(cmd.safe != STC_ON) ;
1206 /* Set safer mode */
1217 return (cmd.dec == STC_DOT ? '.' : ',');
1225 time_t t = time (0);
1226 struct tm *tm = localtime (&t);
1228 set_epoch = (tm->tm_year + 1900) - 69;
1230 set_epoch = 2000 - 69;
1239 return (cmd.dec == STC_DOT ? ',' : '.');
1246 return cmd.s_prompt;
1252 return cmd.s_dprompt;
1258 return cmd.s_cprompt;
1265 return (cmd.echo != STC_OFF );
1270 get_errorbreak(void)
1272 return (cmd.errbrk != STC_OFF);
1277 get_scompression(void)
1279 return (cmd.scompress != STC_OFF );
1285 return (cmd.undef != STC_NOWARN);
1291 return cmd.n_mxwarns[0];
1297 return cmd.n_mxerrs[0];
1303 return ( cmd.mprint != STC_OFF );
1309 return (cmd.prtbck != STC_OFF );
1315 return cmd.n_mxloops[0];
1321 return (cmd.null != STC_OFF );
1327 return (cmd.inc != STC_OFF );
1333 return cmd.s_endcmd[0];
1338 get_max_workspace(void)
1340 return cmd.n_workspace[0];
1355 /* CCA through CCE. */
1356 const struct set_cust_currency *
1363 aux_show_warranty(void)
1365 msg(MM,lack_of_warranty);
1369 aux_show_copying(void)
1376 get_viewlength(void)
1378 return set_viewlength;
1384 return set_viewwidth;
1397 set_rng (random_seed ());
1402 set_rng (unsigned long seed)
1404 rng = gsl_rng_alloc (gsl_rng_mt19937);
1407 gsl_rng_set (rng, seed);
1410 static unsigned long
1416 static int global_algorithm = ENHANCED;
1417 static int cmd_algorithm = ENHANCED;
1418 static int *algorithm = &global_algorithm;
1420 static int syntax = ENHANCED;
1422 /* Set the algorithm option globally */
1424 set_algorithm(int x)
1426 global_algorithm = x;
1429 /* Set the algorithm option for this command only */
1431 set_cmd_algorithm(int x)
1434 algorithm = &cmd_algorithm;
1437 /* Unset the algorithm option for this command */
1439 unset_cmd_algorithm(void)
1441 algorithm = &global_algorithm;
1444 /* Return the current algorithm setting */
1451 /* Set the syntax option */
1458 /* Get the current syntax setting */