*/
#include <config.h>
+#include "settings.h"
#include <assert.h>
#include <stdio.h>
#include <errno.h>
#include "output.h"
#include "var.h"
#include "format.h"
-#include "settings.h"
double set_blanks;
int set_compression;
int set_undefined;
int set_viewlength;
int set_viewwidth;
+size_t set_max_workspace = 4L * 1024 * 1024;
static void set_routing (int q, int *setting);
static int set_ccx (const char *cc_string, struct set_cust_currency * cc,
return CMD_FAILURE;
if (cmd.sbc_block)
- msg (SW, _("BLOCK is obsolete."));
+ msg (SW, _("%s is obsolete."),"BLOCK");
if (cmd.sbc_boxstring)
- msg (SW, _("BOXSTRING is obsolete."));
+ msg (SW, _("%s is obsolete."),"BOXSTRING");
if (cmd.compress != -1)
{
set_cpi = cmd.n_cpi;
}
if (cmd.sbc_histogram)
- msg (MW, _("HISTOGRAM is obsolete."));
+ msg (MW, _("%s is obsolete."),"HISTOGRAM");
if (cmd.n_lpi != NOT_LONG)
{
if (cmd.n_lpi <= 0)
set_mxloops = cmd.n_mxloops;
}
if (cmd.n_mxmemory != NOT_LONG)
- msg (SE, _("MXMEMORY is obsolete."));
+ msg (SE, _("%s is obsolete."),"MXMEMORY");
if (cmd.n_mxwarns != NOT_LONG)
set_mxwarns = cmd.n_mxwarns;
if (cmd.prtbck != -1)
set_printback = cmd.prtbck == STC_OFF ? 0 : 1;
if (cmd.s_scripttab)
- msg (SE, _("SCRIPTTAB is obsolete."));
+ msg (SE, _("%s is obsolete."),"SCRIPTTAB");
if (cmd.s_tbfonts)
- msg (SW, _("TBFONTS not implemented."));
+ msg (SW, _("%s is not yet implemented."),"TBFONTS");
if (cmd.s_tb1)
- msg (SW, _("TB1 not implemented."));
+ msg (SW, _("%s is not yet implemented."),"TB1");
if (cmd.undef != -1)
set_undefined = cmd.undef == STC_NOWARN ? 0 : 1;
- if (cmd.n_workspace != NOT_LONG)
- msg (SE, _("WORKSPACE is obsolete."));
+ if (cmd.n_workspace != NOT_LONG)
+ {
+ if (cmd.n_workspace < 1024)
+ msg (SE, _("Workspace limit must be at least 1 MB."));
+ else
+ {
+ if (cmd.n_workspace > (size_t) -1 / 1024)
+ set_max_workspace = -1;
+ else
+ set_max_workspace = 1024 * cmd.n_workspace;
+ }
+ }
/* PC+ compatible syntax. */
if (cmd.scrn != -1)
outp_enable_device (cmd.scrn == STC_OFF ? 0 : 1, OUTP_DEV_SCREEN);
if (cmd.automenu != -1)
- msg (SW, _("AUTOMENU is obsolete."));
+ msg (SW, _("%s is obsolete."),"AUTOMENU");
if (cmd.beep != -1)
- msg (SW, _("BEEP is obsolete."));
+ msg (SW, _("%s is obsolete."),"BEEP");
if (cmd.s_cprompt)
{
if (cmd.s_endcmd)
set_endcmd = cmd.s_endcmd[0];
if (cmd.eject != -1)
- msg (SW, _("EJECT is obsolete."));
+ msg (SW, _("%s is obsolete."),"EJECT");
if (cmd.errbrk != -1)
set_errorbreak = cmd.errbrk == STC_OFF ? 0 : 1;
if (cmd.helpwin != -1)
- msg (SW, _("HELPWINDOWS is obsolete."));
+ msg (SW, _("%s is obsolete."),"HELPWINDOWS");
if (cmd.inc != -1)
set_include = cmd.inc == STC_OFF ? 0 : 1;
if (cmd.menus != -1)
- msg (MW, _("MENUS is obsolete."));
+ msg (MW, _("%s is obsolete."),"MENUS");
if (cmd.null != -1)
set_nullline = cmd.null == STC_OFF ? 0 : 1;
if (cmd.more != -1)
cmd.s_prompt = NULL;
}
if (cmd.ptrans != -1)
- msg (SW, _("PTRANSLATE is obsolete."));
+ msg (SW, _("%s is obsolete."),"PTRANSLATE");
if (cmd.runrev != -1)
- msg (SW, "RUNREVIEW is obsolete.");
+ msg (SW, _("%s is obsolete."),"RUNREVIEW");
if (cmd.safe == STC_ON)
set_safer = 1;
if (cmd.xsort != -1)
- msg (SW, _("XSORT is obsolete."));
+ msg (SW, _("%s is obsolete."),"XSORT");
free_set (&cmd);
}
static int
-stc_custom_pager (struct cmd_set *cmd unused)
+stc_custom_pager (struct cmd_set *cmd UNUSED)
{
lex_match ('=');
#if !USE_INTERNAL_PAGER
SYSMIS or a numeric value; PC+: Syntax is '.', which is equivalent
to SYSMIS, or a numeric value. */
static int
-stc_custom_blanks (struct cmd_set *cmd unused)
+stc_custom_blanks (struct cmd_set *cmd UNUSED)
{
lex_match ('=');
if ((token == T_ID && lex_id_match ("SYSMIS", tokid))
}
static int
-stc_custom_length (struct cmd_set *cmd unused)
+stc_custom_length (struct cmd_set *cmd UNUSED)
{
int page_length;
}
static int
-stc_custom_results (struct cmd_set *cmd unused)
+stc_custom_results (struct cmd_set *cmd UNUSED)
{
struct tuple
{
}
static int
-stc_custom_seed (struct cmd_set *cmd unused)
+stc_custom_seed (struct cmd_set *cmd UNUSED)
{
lex_match ('=');
if (lex_match_id ("RANDOM"))
set_seed = tokval;
lex_get ();
}
+ set_seed_used=1;
return 1;
}
static int
-stc_custom_width (struct cmd_set *cmd unused)
+stc_custom_width (struct cmd_set *cmd UNUSED)
{
int page_width;
/* Parses FORMAT subcommand, which consists of a numeric format
specifier. */
static int
-stc_custom_format (struct cmd_set *cmd unused)
+stc_custom_format (struct cmd_set *cmd UNUSED)
{
struct fmt_spec fmt;
}
static int
-stc_custom_journal (struct cmd_set *cmd unused)
+stc_custom_journal (struct cmd_set *cmd UNUSED)
{
lex_match ('=');
if (lex_match_id ("ON"))
/* Parses COLOR subcommand. PC+: either ON or OFF or two or three
comma-delimited numbers inside parentheses. */
static int
-stc_custom_color (struct cmd_set *cmd unused)
+stc_custom_color (struct cmd_set *cmd UNUSED)
{
- msg (MW, "COLOR is obsolete.");
+ msg (MW, _("%s is obsolete."),"COLOR");
lex_match ('=');
if (!lex_match_id ("ON") && !lex_match_id ("YES") && !lex_match_id ("OFF") && !lex_match_id ("NO"))
}
static int
-stc_custom_listing (struct cmd_set *cmd unused)
+stc_custom_listing (struct cmd_set *cmd UNUSED)
{
lex_match ('=');
if (lex_match_id ("ON") || lex_match_id ("YES"))
}
static int
-stc_custom_disk (struct cmd_set *cmd unused)
+stc_custom_disk (struct cmd_set *cmd UNUSED)
{
stc_custom_listing (cmd);
return 0;
}
static int
-stc_custom_log (struct cmd_set *cmd unused)
+stc_custom_log (struct cmd_set *cmd UNUSED)
{
stc_custom_journal (cmd);
return 0;
}
static int
-stc_custom_rcolor (struct cmd_set *cmd unused)
+stc_custom_rcolor (struct cmd_set *cmd UNUSED)
{
- msg (SW, _("RCOLOR is obsolete."));
+ msg (SW, _("%s is obsolete."),"RCOLOR");
lex_match ('=');
if (!lex_force_match ('('))
}
static int
-stc_custom_viewlength (struct cmd_set *cmd unused)
+stc_custom_viewlength (struct cmd_set *cmd UNUSED)
{
if (lex_match_id ("MINIMUM"))
set_viewlength = 25;
{
if (!lex_force_int ())
return 0;
-#if __MSDOS__
+#ifdef __MSDOS__
if (lex_integer () >= (43 + 25) / 2)
set_viewlength = 43;
else
lex_get ();
}
-#if __MSDOS__
- msg (SW, _("VIEWLENGTH not implemented."));
+#ifdef __MSDOS__
+ msg (SW, _("%s is not yet implemented."),"VIEWLENGTH");
#endif /* dos */
return 1;
}
static int
-stc_custom_workdev (struct cmd_set *cmd unused)
+stc_custom_workdev (struct cmd_set *cmd UNUSED)
{
char c[2];
- msg (SW, _("WORKDEV is obsolete."));
+ msg (SW, _("%s is obsolete."),"WORKDEV");
c[1] = 0;
for (*c = 'A'; *c <= 'Z'; (*c)++)
return 0;
}
-\f
-/* GSET. */
-
-int
-cmd_gset (void)
-{
- /* FIXME */
- return CMD_FAILURE;
-}
-
/*
Local Variables:
mode: c