Beginning of VFM cleanup.
[pspp-builds.git] / src / set.q
index 439d52a2ec2a3c12f76add3d1f5b722321bba1bc..2d90ac7e66604c15b65bdb1a24cadbfa95641c7f 100644 (file)
--- a/src/set.q
+++ b/src/set.q
@@ -119,6 +119,7 @@ int set_testing_mode;
 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,
@@ -311,13 +312,23 @@ cmd_set (void)
   if (cmd.s_scripttab)
     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, _("%s is obsolete."),"WORKSPACE");
+  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)
@@ -486,7 +497,7 @@ set_routing (int q, int *setting)
 }
 
 static int
-stc_custom_pager (struct cmd_set *cmd unused)
+stc_custom_pager (struct cmd_set *cmd UNUSED)
 {
   lex_match ('=');
 #if !USE_INTERNAL_PAGER
@@ -519,7 +530,7 @@ stc_custom_pager (struct cmd_set *cmd unused)
    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))
@@ -539,7 +550,7 @@ stc_custom_blanks (struct cmd_set *cmd unused)
 }
 
 static int
-stc_custom_length (struct cmd_set *cmd unused)
+stc_custom_length (struct cmd_set *cmd UNUSED)
 {
   int page_length;
 
@@ -564,7 +575,7 @@ stc_custom_length (struct cmd_set *cmd unused)
 }
 
 static int
-stc_custom_results (struct cmd_set *cmd unused)
+stc_custom_results (struct cmd_set *cmd UNUSED)
 {
   struct tuple
     {  
@@ -605,7 +616,7 @@ stc_custom_results (struct cmd_set *cmd unused)
 }
 
 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"))
@@ -617,11 +628,12 @@ stc_custom_seed (struct cmd_set *cmd unused)
       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;
 
@@ -650,7 +662,7 @@ stc_custom_width (struct cmd_set *cmd unused)
 /* 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;
 
@@ -670,7 +682,7 @@ stc_custom_format (struct cmd_set *cmd unused)
 }
 
 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"))
@@ -688,7 +700,7 @@ stc_custom_journal (struct cmd_set *cmd unused)
 /* 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, _("%s is obsolete."),"COLOR");
 
@@ -739,7 +751,7 @@ stc_custom_color (struct cmd_set *cmd unused)
 }
 
 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"))
@@ -755,21 +767,21 @@ stc_custom_listing (struct cmd_set *cmd unused)
 }
 
 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, _("%s is obsolete."),"RCOLOR");
 
@@ -818,7 +830,7 @@ stc_custom_rcolor (struct cmd_set *cmd unused)
 }
 
 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;
@@ -830,7 +842,7 @@ stc_custom_viewlength (struct cmd_set *cmd unused)
     {
       if (!lex_force_int ())
        return 0;
-#if __MSDOS__
+#ifdef __MSDOS__
       if (lex_integer () >= (43 + 25) / 2)
        set_viewlength = 43;
       else
@@ -841,14 +853,14 @@ stc_custom_viewlength (struct cmd_set *cmd unused)
       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];