pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp/src data/ChangeLog data/settings.c data/se...


From: Ben Pfaff
Subject: [Pspp-cvs] pspp/src data/ChangeLog data/settings.c data/se...
Date: Sat, 04 Nov 2006 19:49:45 +0000

CVSROOT:        /cvsroot/pspp
Module name:    pspp
Changes by:     Ben Pfaff <blp> 06/11/04 19:49:45

Modified files:
        src/data       : ChangeLog settings.c settings.h 
        src/language/utilities: ChangeLog set.q 

Log message:
        Implement SET ERRORS, SHOW ERRORS.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/ChangeLog?cvsroot=pspp&r1=1.70&r2=1.71
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/settings.c?cvsroot=pspp&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/settings.h?cvsroot=pspp&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/utilities/ChangeLog?cvsroot=pspp&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/utilities/set.q?cvsroot=pspp&r1=1.16&r2=1.17

Patches:
Index: data/ChangeLog
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/ChangeLog,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -b -r1.70 -r1.71
--- data/ChangeLog      3 Nov 2006 04:53:51 -0000       1.70
+++ data/ChangeLog      4 Nov 2006 19:49:45 -0000       1.71
@@ -1,3 +1,16 @@
+Sat Nov  4 11:47:09 2006  Ben Pfaff  <address@hidden>
+
+       Implement SET ERRORS, SHOW ERRORS.  Fixes bug #17609.
+       
+       * settings.c: (route_errors_to_terminal) New variable.
+       (route_errors_to_listing) New variable. 
+       (get_error_routing_to_terminal) New function.
+       (set_error_routing_to_terminal) New function.
+       (get_error_routing_to_listing) New function.
+       (set_error_routing_to_listing) New function.
+
+       * settings.h: (SET_ROUTE_* enums) Removed, because unused.
+
 Tue Oct 31 19:58:27 2006  Ben Pfaff  <address@hidden>
 
        * format.c: Completely rewrite, to achieve better abstraction.

Index: data/settings.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/settings.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- data/settings.c     3 Nov 2006 04:53:51 -0000       1.4
+++ data/settings.c     4 Nov 2006 19:49:45 -0000       1.5
@@ -40,6 +40,9 @@
 
 static bool errorbreak = false;
 
+static bool route_errors_to_terminal = true;
+static bool route_errors_to_listing = true;
+
 static bool scompress = true;
 
 static bool undefined = true;
@@ -242,6 +245,36 @@
   errorbreak = errorbreak_;
 }
 
+/* Route error messages to terminal? */
+bool
+get_error_routing_to_terminal (void) 
+{
+  return route_errors_to_terminal;
+}
+
+/* Sets whether error messages should be routed to the
+   terminal. */
+void
+set_error_routing_to_terminal (bool route_to_terminal) 
+{
+  route_errors_to_terminal = route_to_terminal;
+}
+
+/* Route error messages to listing file? */
+bool
+get_error_routing_to_listing (void) 
+{
+  return route_errors_to_listing;
+}
+
+/* Sets whether error messages should be routed to the
+   listing file. */
+void
+set_error_routing_to_listing (bool route_to_listing) 
+{
+  route_errors_to_listing = route_to_listing;
+}
+
 /* Compress system files by default? */
 bool 
 get_scompression (void)

Index: data/settings.h
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/settings.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- data/settings.h     3 Nov 2006 04:53:51 -0000       1.2
+++ data/settings.h     4 Nov 2006 19:49:45 -0000       1.3
@@ -23,15 +23,6 @@
 #include <stdbool.h>
 #include <stddef.h>
 
-/* Types of routing. */
-enum
-  {
-    SET_ROUTE_SCREEN = 001,    /* Output to screen devices? */
-    SET_ROUTE_LISTING = 002,   /* Output to listing devices? */
-    SET_ROUTE_OTHER = 004,     /* Output to other devices? */
-    SET_ROUTE_DISABLE = 010    /* Disable output--overrides all other bits. */
-  };
-
 void settings_init (void);
 void settings_done (void);
 
@@ -56,6 +47,11 @@
 bool get_errorbreak (void);
 void set_errorbreak (bool);
 
+bool get_error_routing_to_terminal (void);
+void set_error_routing_to_terminal (bool);
+bool get_error_routing_to_listing (void);
+void set_error_routing_to_listing (bool);
+
 bool get_scompression (void);
 void set_scompression (bool);
 

Index: language/utilities/ChangeLog
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/utilities/ChangeLog,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- language/utilities/ChangeLog        3 Nov 2006 04:53:51 -0000       1.4
+++ language/utilities/ChangeLog        4 Nov 2006 19:49:45 -0000       1.5
@@ -1,3 +1,10 @@
+Sat Nov  4 11:48:23 2006  Ben Pfaff  <address@hidden>
+
+       * set.q: Update ERRORS, MESSAGES, RESULTS command syntax.
+       (cmd_set) Handle ERRORS command.
+       (show_errors) New function.
+       (var show_table[]) Add ERRORS to the table.
+
 Tue Oct 31 20:10:24 2006  Ben Pfaff  <address@hidden>
 
        * set.q (cmd_set): Drop the `ok' variable, which didn't do

Index: language/utilities/set.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/utilities/set.q,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- language/utilities/set.q    3 Nov 2006 04:53:51 -0000       1.16
+++ language/utilities/set.q    4 Nov 2006 19:49:45 -0000       1.17
@@ -74,7 +74,7 @@
      endcmd=string "x==1" "one character long";
      epoch=custom;
      errorbreak=errbrk:on/off;
-     errors=errors:on/off/terminal/listing/both/none;
+     errors=errors:terminal/listing/both/on/none/off;
      format=custom;
      headers=headers:no/yes/blank;
      highres=hires:on/off;
@@ -86,7 +86,7 @@
      lowres=lores:auto/on/off;
      lpi=integer "x>0" "%s must be greater than 0";
      menus=menus:standard/extended;
-     messages=messages:on/off/terminal/listing/both/none;
+     messages=messages:on/off/terminal/listing/both/on/none/off;
      mexpand=mexp:on/off;
      miterate=integer "x>0" "%s must be greater than 0";
      mnest=integer "x>0" "%s must be greater than 0";
@@ -98,7 +98,7 @@
      nulline=null:on/off;
      printback=prtbck:on/off;
      prompt=string;
-     results=res:on/off/terminal/listing/both/none;
+     results=res:on/off/terminal/listing/both/on/none/off;
      safer=safe:on;
      scompression=scompress:on/off;
      scripttab=string "x==1" "one character long";
@@ -153,6 +153,12 @@
     set_endcmd (cmd.s_endcmd[0]);
   if (cmd.sbc_errorbreak)
     set_errorbreak (cmd.errbrk == STC_ON);
+  if (cmd.sbc_errors)
+    {
+      bool both = cmd.errors == STC_BOTH || cmd.errors == STC_ON;
+      set_error_routing_to_terminal (cmd.errors == STC_TERMINAL || both);
+      set_error_routing_to_listing (cmd.errors == STC_LISTING || both);
+    }
   if (cmd.sbc_include)
     set_include (cmd.inc == STC_ON);
   if (cmd.sbc_mxerrs)
@@ -556,6 +562,18 @@
 }
 
 static void
+show_errors (const struct dataset *ds UNUSED) 
+{
+  bool terminal = get_error_routing_to_terminal ();
+  bool listing = get_error_routing_to_listing ();
+  msg (SN, _("ERRORS is \"%s\"."),
+       terminal && listing ? "BOTH"
+       : terminal ? "TERMINAL"
+       : listing ? "LISTING"
+       : "NONE");
+}
+
+static void
 show_format (const struct dataset *ds UNUSED) 
 {
   char str[FMT_STRING_LEN_MAX + 1];
@@ -636,6 +654,7 @@
     {"CCE", show_cce},
     {"DECIMALS", show_decimals},
     {"ENDCMD", show_endcmd},
+    {"ERRORS", show_errors},      
     {"FORMAT", show_format},
     {"LENGTH", show_length},
     {"MXERRS", show_mxerrs},




reply via email to

[Prev in Thread] Current Thread [Next in Thread]