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 */
91 #define _(msgid) gettext (msgid)
93 static int set_errors;
94 static int set_messages;
95 static int set_results;
97 static double set_blanks=SYSMIS;
99 static int set_epoch = -1;
101 static struct fmt_spec set_format={FMT_F,8,2};
103 static struct set_cust_currency set_cc[5];
105 static char *set_journal;
106 static int set_journaling;
108 static int set_listing=1;
110 #if !USE_INTERNAL_PAGER
111 static char *set_pager=0;
112 #endif /* !USE_INTERNAL_PAGER */
116 static int long_view=0;
117 int set_testing_mode=0;
118 static int set_viewlength;
119 static int set_viewwidth;
121 void aux_show_warranty(void);
122 void aux_show_copying(void);
124 static const char *route_to_string(int routing);
125 static void set_routing (int q, int *setting);
127 static int set_ccx (const char *cc_string, struct set_cust_currency * cc,
129 static void set_rng (unsigned long);
130 static unsigned long random_seed (void);
134 automenu=automenu:on/off;
137 block=string "x==1" "one character long";
138 boxstring=string "x==3 || x==11" "3 or 11 characters long";
139 case=size:upper/uplow;
146 compression=compress:on/off;
147 cpi=integer "x>0" "%s must be greater than 0";
149 decimal=dec:dot/comma;
154 endcmd=string "x==1" "one character long";
156 errorbreak=errbrk:on/off;
157 errors=errors:on/off/terminal/listing/both/none;
159 headers=headers:no/yes/blank;
160 helpwindows=helpwin:on/off;
161 highres=hires:on/off;
162 histogram=string "x==1" "one character long";
168 lowres=lores:auto/on/off;
169 lpi=integer "x>0" "%s must be greater than 0";
170 menus=menus:standard/extended;
171 messages=messages:on/off/terminal/listing/both/none;
173 miterate=integer "x>0" "%s must be greater than 0";
174 mnest=integer "x>0" "%s must be greater than 0";
176 mprint=mprint:on/off;
177 mxerrs=integer "x >= 1" "%s must be at least 1";
178 mxloops=integer "x >=1" "%s must be at least 1";
183 printback=prtbck:on/off;
186 ptranslate=ptrans:on/off;
189 runreview=runrev:auto/manual;
191 scompression=scompress:on/off;
193 scripttab=string "x==1" "one character long";
195 tb1=string "x==3 || x==11" "3 or 11 characters long";
197 undefined=undef:warn/nowarn;
202 workspace=integer "x>=1024" "%s must be at least 1 MB";
211 aux_stc_custom_blanks(struct cmd_set *cmd UNUSED)
213 if ( set_blanks == SYSMIS )
216 msg(MM, "%g", set_blanks);
222 aux_stc_custom_color(struct cmd_set *cmd UNUSED)
224 msg (MW, _("%s is obsolete."),"COLOR");
229 aux_stc_custom_listing(struct cmd_set *cmd UNUSED)
232 msg(MM, _("LISTING is ON"));
234 msg(MM, _("LISTING is OFF"));
240 aux_stc_custom_disk(struct cmd_set *cmd UNUSED)
242 return aux_stc_custom_listing(cmd);
246 aux_stc_custom_epoch(struct cmd_set *cmd UNUSED)
248 msg (MM, _("EPOCH is %d"), get_epoch ());
253 aux_stc_custom_format(struct cmd_set *cmd UNUSED)
255 msg(MM, fmt_to_string(&set_format));
262 aux_stc_custom_journal(struct cmd_set *cmd UNUSED)
265 msg(MM, set_journal);
267 msg(MM, _("Journalling is off") );
273 aux_stc_custom_length(struct cmd_set *cmd UNUSED)
275 msg(MM, "%d", set_viewlength);
280 aux_stc_custom_log(struct cmd_set *cmd )
282 return aux_stc_custom_journal (cmd);
286 aux_stc_custom_pager(struct cmd_set *cmd UNUSED)
288 #if !USE_INTERNAL_PAGER
293 #else /* USE_INTERNAL_PAGER */
294 msg (MM, "Internal pager.");
295 #endif /* USE_INTERNAL_PAGER */
301 aux_stc_custom_rcolor(struct cmd_set *cmd UNUSED)
303 msg (SW, _("%s is obsolete."),"RCOLOR");
308 aux_stc_custom_results(struct cmd_set *cmd UNUSED)
311 msg(MM, route_to_string(set_results) );
317 aux_stc_custom_seed(struct cmd_set *cmd UNUSED)
323 aux_stc_custom_viewlength(struct cmd_set *cmd UNUSED)
325 msg(MM, "%d", set_viewlength);
330 aux_stc_custom_viewwidth(struct cmd_set *cmd UNUSED)
332 msg(MM, "%d", set_viewwidth);
337 aux_stc_custom_width(struct cmd_set *cmd UNUSED)
339 msg(MM, "%d", set_viewwidth);
344 aux_stc_custom_workdev(struct cmd_set *cmd UNUSED)
346 msg (SW, _("%s is obsolete."),"WORKDEV");
353 warranty=show_warranty;
354 copying=show_copying.
358 static struct cmd_set cmd;
363 lex_match_id ("SHOW");
365 if (!aux_parse_set (&cmd))
375 if (!parse_set (&cmd))
379 set_ccx (cmd.s_cca, &set_cc[0], 'A');
381 set_ccx (cmd.s_ccb, &set_cc[1], 'B');
383 set_ccx (cmd.s_ccc, &set_cc[2], 'C');
385 set_ccx (cmd.s_ccd, &set_cc[3], 'D');
387 set_ccx (cmd.s_cce, &set_cc[4], 'E');
390 set_routing (cmd.errors, &set_errors);
391 if (cmd.sbc_messages)
392 set_routing (cmd.messages, &set_messages);
394 /* PC+ compatible syntax. */
396 outp_enable_device (cmd.scrn == STC_OFF ? 0 : 1, OUTP_DEV_SCREEN);
398 outp_enable_device (cmd.prtr == STC_OFF ? 0 : 1, OUTP_DEV_PRINTER);
400 if (cmd.sbc_automenu )
401 msg (SW, _("%s is obsolete."),"AUTOMENU");
403 msg (SW, _("%s is obsolete."),"BEEP");
405 msg (SW, _("%s is obsolete."),"BLOCK");
406 if (cmd.sbc_boxstring)
407 msg (SW, _("%s is obsolete."),"BOXSTRING");
409 msg (SW, _("%s is obsolete."),"EJECT");
410 if (cmd.sbc_helpwindows )
411 msg (SW, _("%s is obsolete."),"HELPWINDOWS");
412 if (cmd.sbc_histogram)
413 msg (MW, _("%s is obsolete."),"HISTOGRAM");
415 msg (MW, _("%s is obsolete."),"MENUS");
416 if (cmd.sbc_ptranslate )
417 msg (SW, _("%s is obsolete."),"PTRANSLATE");
418 if (cmd.sbc_runreview )
419 msg (SW, _("%s is obsolete."),"RUNREVIEW");
421 msg (SW, _("%s is obsolete."),"XSORT");
422 if (cmd.sbc_mxmemory )
423 msg (SE, _("%s is obsolete."),"MXMEMORY");
424 if (cmd.sbc_scripttab)
425 msg (SE, _("%s is obsolete."),"SCRIPTTAB");
428 msg (SW, _("%s is not yet implemented."),"TBFONTS");
429 if (cmd.sbc_tb1 && cmd.s_tb1)
430 msg (SW, _("%s is not yet implemented."),"TB1");
432 /* Windows compatible syntax. */
434 msg (SW, _("CASE is not implemented and probably won't be. "
435 "If you care, complain about it."));
437 if (cmd.sbc_compression)
439 msg (MW, _("Active file compression is not yet implemented "
440 "(and probably won't be)."));
446 /* Sets custom currency specifier CC having name CC_NAME ('A' through
447 'E') to correspond to the settings in CC_STRING. */
449 set_ccx (const char *cc_string, struct set_cust_currency * cc, int cc_name)
451 if (strlen (cc_string) > 16)
453 msg (SE, _("CC%c: Length of custom currency string `%s' (%d) "
454 "exceeds maximum length of 16."),
455 cc_name, cc_string, strlen (cc_string));
459 /* Determine separators. */
462 int n_commas, n_periods;
464 /* Count the number of commas and periods. There must be exactly
465 three of one or the other. */
466 n_commas = n_periods = 0;
467 for (sp = cc_string; *sp; sp++)
473 if (!((n_commas == 3) ^ (n_periods == 3)))
475 msg (SE, _("CC%c: Custom currency string `%s' does not contain "
476 "exactly three periods or commas (not both)."),
480 else if (n_commas == 3)
492 /* Copy cc_string to cc, changing separators to nulls. */
496 strcpy (cc->buf, cc_string);
497 cp = cc->neg_prefix = cc->buf;
499 while (*cp++ != cc->grouping)
504 while (*cp++ != cc->grouping)
509 while (*cp++ != cc->grouping)
520 route_to_string(int routing)
528 strcpy(s, _("None"));
532 if (routing & SET_ROUTE_DISABLE )
534 strcpy(s, _("Disabled") );
538 if (routing & SET_ROUTE_SCREEN)
539 strcat(s, _("Screen") );
541 if (routing & SET_ROUTE_LISTING)
546 strcat(s, _("Listing") );
549 if (routing & SET_ROUTE_OTHER)
553 strcat(s, _("Other") );
562 /* Sets *SETTING, which is a combination of SET_ROUTE_* bits that
563 indicates what to do with some sort of output, to the value
564 indicated by Q, which is a value provided by the input parser. */
566 set_routing (int q, int *setting)
571 *setting |= SET_ROUTE_DISABLE;
574 *setting &= ~SET_ROUTE_DISABLE;
577 *setting &= ~(SET_ROUTE_LISTING | SET_ROUTE_OTHER);
578 *setting |= SET_ROUTE_SCREEN;
581 *setting &= ~SET_ROUTE_SCREEN;
582 *setting |= SET_ROUTE_LISTING | SET_ROUTE_OTHER;
585 *setting |= SET_ROUTE_SCREEN | SET_ROUTE_LISTING | SET_ROUTE_OTHER;
588 *setting &= ~(SET_ROUTE_SCREEN | SET_ROUTE_LISTING | SET_ROUTE_OTHER);
596 stc_custom_pager (struct cmd_set *cmd UNUSED)
599 #if !USE_INTERNAL_PAGER
600 if (lex_match_id ("OFF"))
608 if (!lex_force_string ())
612 set_pager = xstrdup (ds_c_str (&tokstr));
616 #else /* USE_INTERNAL_PAGER */
617 if (lex_match_id ("OFF"))
619 msg (SW, "External pagers not supported.");
621 #endif /* USE_INTERNAL_PAGER */
624 /* Parses the BLANKS subcommand, which controls the value that
625 completely blank fields in numeric data imply. X, Wnd: Syntax is
626 SYSMIS or a numeric value; PC+: Syntax is '.', which is equivalent
627 to SYSMIS, or a numeric value. */
629 stc_custom_blanks (struct cmd_set *cmd UNUSED)
632 if ((token == T_ID && lex_id_match ("SYSMIS", tokid))
633 || (token == T_STRING && !strcmp (tokid, ".")))
640 if (!lex_force_num ())
648 /* Parses the EPOCH subcommand, which controls the epoch used for
649 parsing 2-digit years. */
651 stc_custom_epoch (struct cmd_set *cmd UNUSED)
654 if (lex_match_id ("AUTOMATIC"))
656 else if (lex_is_integer ())
658 int new_epoch = lex_integer ();
660 if (new_epoch < 1500)
662 msg (SE, _("EPOCH must be 1500 or later."));
665 set_epoch = new_epoch;
669 lex_error (_("expecting AUTOMATIC or year"));
677 stc_custom_length (struct cmd_set *cmd UNUSED)
682 if (lex_match_id ("NONE"))
686 if (!lex_force_int ())
688 if (lex_integer () < 1)
690 msg (SE, _("LENGTH must be at least 1."));
693 page_length = lex_integer ();
697 if ( page_length != -1 )
698 set_viewlength = page_length;
704 stc_custom_results (struct cmd_set *cmd UNUSED)
712 static struct tuple tab[] =
716 {"TERMINAL", STC_TERMINAL},
717 {"LISTING", STC_LISTING},
729 msg (SE, _("Missing identifier in RESULTS subcommand."));
733 for (t = tab; t->s; t++)
734 if (lex_id_match (t->s, tokid))
737 set_routing (t->v, &set_results);
740 msg (SE, _("Unrecognized identifier in RESULTS subcommand."));
745 stc_custom_seed (struct cmd_set *cmd UNUSED)
748 if (lex_match_id ("RANDOM"))
749 set_rng (random_seed ());
752 if (!lex_force_num ())
762 stc_custom_width (struct cmd_set *cmd UNUSED)
767 if (lex_match_id ("NARROW"))
769 else if (lex_match_id ("WIDE"))
773 if (!lex_force_int ())
775 if (lex_integer () < 1)
777 msg (SE, _("WIDTH must be at least 1."));
780 page_width = lex_integer ();
784 set_viewwidth = page_width;
788 /* Parses FORMAT subcommand, which consists of a numeric format
791 stc_custom_format (struct cmd_set *cmd UNUSED)
796 if (!parse_format_specifier (&fmt, 0))
798 if ((formats[fmt.type].cat & FCAT_STRING) != 0)
800 msg (SE, _("FORMAT requires numeric output format as an argument. "
801 "Specified format %s is of type string."),
802 fmt_to_string (&fmt));
811 stc_custom_journal (struct cmd_set *cmd UNUSED)
814 if (lex_match_id ("ON"))
816 else if (lex_match_id ("OFF"))
818 if (token == T_STRING)
820 set_journal = xstrdup (ds_c_str (&tokstr));
826 /* Parses COLOR subcommand. PC+: either ON or OFF or two or three
827 comma-delimited numbers inside parentheses. */
829 stc_custom_color (struct cmd_set *cmd UNUSED)
831 msg (MW, _("%s is obsolete."),"COLOR");
834 if (!lex_match_id ("ON") && !lex_match_id ("YES") && !lex_match_id ("OFF") && !lex_match_id ("NO"))
836 if (!lex_force_match ('('))
838 if (!lex_match ('*'))
840 if (!lex_force_int ())
842 if (lex_integer () < 0 || lex_integer () > 15)
844 msg (SE, _("Text color must be in range 0-15."));
849 if (!lex_force_match (','))
851 if (!lex_match ('*'))
853 if (!lex_force_int ())
855 if (lex_integer () < 0 || lex_integer () > 7)
857 msg (SE, _("Background color must be in range 0-7."));
862 if (lex_match (',') && !lex_match ('*'))
864 if (!lex_force_int ())
866 if (lex_integer () < 0 || lex_integer () > 7)
868 msg (SE, _("Border color must be in range 0-7."));
873 if (!lex_force_match (')'))
880 stc_custom_listing (struct cmd_set *cmd UNUSED)
883 if (lex_match_id ("ON") || lex_match_id ("YES"))
885 else if (lex_match_id ("OFF") || lex_match_id ("NO"))
892 outp_enable_device (set_listing, OUTP_DEV_LISTING);
898 stc_custom_disk (struct cmd_set *cmd UNUSED)
900 return stc_custom_listing (cmd);
904 stc_custom_log (struct cmd_set *cmd UNUSED)
906 return stc_custom_journal (cmd);
910 stc_custom_rcolor (struct cmd_set *cmd UNUSED)
912 msg (SW, _("%s is obsolete."),"RCOLOR");
915 if (!lex_force_match ('('))
918 if (!lex_match ('*'))
920 if (!lex_force_int ())
922 if (lex_integer () < 0 || lex_integer () > 6)
924 msg (SE, _("Lower window color must be between 0 and 6."));
929 if (!lex_force_match (','))
932 if (!lex_match ('*'))
934 if (!lex_force_int ())
936 if (lex_integer () < 0 || lex_integer () > 6)
938 msg (SE, _("Upper window color must be between 0 and 6."));
944 if (lex_match (',') && !lex_match ('*'))
946 if (!lex_force_int ())
948 if (lex_integer () < 0 || lex_integer () > 6)
950 msg (SE, _("Frame color must be between 0 and 6."));
959 stc_custom_viewwidth (struct cmd_set *cmd UNUSED)
963 if ( !lex_force_int() )
966 set_viewwidth = lex_integer();
973 stc_custom_viewlength (struct cmd_set *cmd UNUSED)
975 if (lex_match_id ("MINIMUM"))
977 else if (lex_match_id ("MEDIAN"))
978 set_viewlength = 43; /* This is not correct for VGA displays. */
979 else if (lex_match_id ("MAXIMUM"))
983 if (!lex_force_int ())
986 if (lex_integer () >= (43 + 25) / 2)
991 set_viewlength = lex_integer ();
997 msg (SW, _("%s is not yet implemented."),"VIEWLENGTH");
1003 stc_custom_workdev (struct cmd_set *cmd UNUSED)
1007 msg (SW, _("%s is obsolete."),"WORKDEV");
1010 for (*c = 'A'; *c <= 'Z'; (*c)++)
1011 if (token == T_ID && lex_id_match (c, tokid))
1016 msg (SE, _("Drive letter expected in WORKDEV subcommand."));
1023 set_viewport(int sig_num UNUSED)
1026 static char term_buffer[16384];
1030 set_viewlength = -1;
1032 #if __DJGPP__ || __BORLANDC__
1034 struct text_info ti;
1037 set_viewlength = max (ti.screenheight, 25);
1038 set_viewwidth = max (ti.screenwidth, 79);
1040 #elif HAVE_LIBTERMCAP
1045 /* This code stolen from termcap.info, though modified. */
1046 termtype = getenv ("TERM");
1048 msg (FE, _("Specify a terminal type with the TERM environment variable."));
1050 success = tgetent (term_buffer, termtype);
1054 msg (IE, _("Could not access the termcap data base."));
1056 msg (IE, _("Terminal type `%s' is not defined."), termtype);
1060 /* NOTE: Do not rely upon tgetnum returning -1 if the value is
1061 not available. It's supposed to do it, but not all platforms
1064 if ( -1 != tgetnum("li"))
1065 set_viewlength = tgetnum ("li");
1067 if ( -1 != tgetnum("co"))
1068 set_viewwidth = tgetnum ("co") - 1;
1071 #endif /* HAVE_LIBTERMCAP */
1073 /* Try the environment variables */
1074 if ( -1 == set_viewwidth )
1076 char *s = getenv("COLUMNS");
1077 if ( s ) set_viewwidth = atoi(s);
1080 if ( -1 == set_viewwidth )
1082 char *s = getenv("LINES");
1083 if ( s ) set_viewlength = atoi(s);
1087 /* Last resort. Use hard coded values */
1088 if ( 0 > set_viewwidth ) set_viewwidth = 79;
1089 if ( 0 > set_viewlength ) set_viewlength = 24;
1093 /* Public functions */
1103 free (cmd.s_endcmd);
1104 free (cmd.s_prompt);
1105 free (cmd.s_cprompt);
1106 free (cmd.s_dprompt);
1114 cmd.s_dprompt = xstrdup (_("data> "));
1115 cmd.s_cprompt = xstrdup (" > ");
1116 cmd.s_prompt = xstrdup ("PSPP> ");
1117 cmd.s_endcmd = xstrdup (".");
1119 assert(cmd.safe == 0 );
1127 cmd.headers = STC_YES;
1128 cmd.errbrk = STC_OFF;
1130 cmd.scompress = STC_OFF;
1131 cmd.undef = STC_WARN;
1132 cmd.mprint = STC_ON ;
1133 cmd.prtbck = STC_ON ;
1137 set_journal = xstrdup ("pspp.jnl");
1140 cmd.n_mxwarns[0] = 100;
1141 cmd.n_mxerrs[0] = 100;
1142 cmd.n_mxloops[0] = 1;
1143 cmd.n_workspace[0] = 4L * 1024 * 1024;
1146 #if !USE_INTERNAL_PAGER
1148 const char *pager = getenv ("STAT_PAGER");
1152 const char *p = getenv ("PAGER");
1155 set_pager = xstrdup (p);
1162 set_pager = xstrdup (pager);
1165 set_pager = xstrdup (DEFAULT_PAGER);
1166 #endif /* DEFAULT_PAGER */
1168 #endif /* !USE_INTERNAL_PAGER */
1174 for (i = 0; i < 5; i++)
1176 struct set_cust_currency *cc = &set_cc[i];
1177 strcpy (cc->buf, "-");
1178 cc->neg_prefix = cc->buf;
1179 cc->prefix = &cc->buf[1];
1180 cc->suffix = &cc->buf[1];
1181 cc->neg_suffix = &cc->buf[1];
1190 signal (SIGWINCH, set_viewport);
1196 force_long_view(void)
1205 return !(cmd.safe != STC_ON) ;
1209 /* Set safer mode */
1220 return (cmd.dec == STC_DOT ? '.' : ',');
1228 time_t t = time (0);
1229 struct tm *tm = localtime (&t);
1231 set_epoch = (tm->tm_year + 1900) - 69;
1233 set_epoch = 2000 - 69;
1242 return (cmd.dec == STC_DOT ? ',' : '.');
1249 return cmd.s_prompt;
1255 return cmd.s_dprompt;
1261 return cmd.s_cprompt;
1268 return (cmd.echo != STC_OFF );
1273 get_errorbreak(void)
1275 return (cmd.errbrk != STC_OFF);
1280 get_scompression(void)
1282 return (cmd.scompress != STC_OFF );
1288 return (cmd.undef != STC_NOWARN);
1294 return cmd.n_mxwarns[0];
1300 return cmd.n_mxerrs[0];
1306 return ( cmd.mprint != STC_OFF );
1312 return (cmd.prtbck != STC_OFF );
1318 return cmd.n_mxloops[0];
1324 return (cmd.null != STC_OFF );
1330 return (cmd.inc != STC_OFF );
1336 return cmd.s_endcmd[0];
1341 get_max_workspace(void)
1343 return cmd.n_workspace[0];
1358 /* CCA through CCE. */
1359 const struct set_cust_currency *
1366 aux_show_warranty(void)
1368 msg(MM,lack_of_warranty);
1372 aux_show_copying(void)
1379 get_viewlength(void)
1381 return set_viewlength;
1387 return set_viewwidth;
1400 set_rng (random_seed ());
1405 set_rng (unsigned long seed)
1407 rng = gsl_rng_alloc (gsl_rng_mt19937);
1410 gsl_rng_set (rng, seed);
1413 static unsigned long
1419 static int global_algorithm = ENHANCED;
1420 static int cmd_algorithm = ENHANCED;
1421 static int *algorithm = &global_algorithm;
1423 static int syntax = ENHANCED;
1425 /* Set the algorithm option globally */
1427 set_algorithm(int x)
1429 global_algorithm = x;
1432 /* Set the algorithm option for this command only */
1434 set_cmd_algorithm(int x)
1437 algorithm = &cmd_algorithm;
1440 /* Unset the algorithm option for this command */
1442 unset_cmd_algorithm(void)
1444 algorithm = &global_algorithm;
1447 /* Return the current algorithm setting */
1454 /* Set the syntax option */
1461 /* Get the current syntax setting */