changeset 1198:1352ecca2d91

[project @ 1995-03-31 22:13:32 by jwe]
author jwe
date Fri, 31 Mar 1995 22:13:32 +0000
parents ed01dfb2338d
children 4f1bfa351b99
files src/user-prefs.cc src/user-prefs.h src/variables.cc
diffstat 3 files changed, 44 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/user-prefs.cc	Fri Mar 31 19:33:00 1995 +0000
+++ b/src/user-prefs.cc	Fri Mar 31 22:13:32 1995 +0000
@@ -64,6 +64,7 @@
   user_pref.save_precision = 0;
   user_pref.silent_functions = 0;
   user_pref.split_long_rows = 0;
+  user_pref.struct_levels_to_print = 0;
   user_pref.suppress_verbose_help_message = 0;
   user_pref.treat_neg_dim_as_zero = 0;
   user_pref.warn_assign_as_truth_value = 0;
@@ -110,6 +111,9 @@
   return pref;
 }
 
+// XXX FIXME XXX -- some of these should do their own checking to be
+// able to provide more meaningful warning or error messages.
+
 // Should a replot command be generated automatically each time a plot
 // changes in some way?
 
@@ -364,6 +368,39 @@
 }
 
 
+// How many levels of structure elements should we print?
+
+int
+struct_levels_to_print (void)
+{
+  int status = 0;
+
+  static int kludge = 0;
+
+  double val;
+  if (builtin_real_scalar_variable ("struct_levels_to_print", val) == 0
+      && ! xisnan (val))
+    {
+      int ival = NINT (val);
+      if (ival > 0 && (double) ival == val)
+	{
+	  user_pref.struct_levels_to_print = ival;
+	  return status;
+	}
+    }
+
+  if (kludge == 0)
+    kludge++;
+  else
+    {
+      warning ("invalid value specified for struct_levels_to_print");
+      status = -1;
+    }
+
+  return status;
+}
+
+
 // Suppress printing of additional help message in help and usage
 // functions?
 
@@ -519,7 +556,7 @@
       int ival = NINT (val);
       if (ival > 0 && (double) ival == val)
 	{
-	  user_pref.output_max_field_width= ival;
+	  user_pref.output_max_field_width = ival;
 	  return status;
 	}
     }
--- a/src/user-prefs.h	Fri Mar 31 19:33:00 1995 +0000
+++ b/src/user-prefs.h	Fri Mar 31 22:13:32 1995 +0000
@@ -47,6 +47,7 @@
   int save_precision;
   int silent_functions;
   int split_long_rows;
+  int struct_levels_to_print;
   int suppress_verbose_help_message;
   int treat_neg_dim_as_zero;
   int warn_assign_as_truth_value;
@@ -90,6 +91,7 @@
 extern int return_last_computed_value (void);
 extern int silent_functions (void);
 extern int split_long_rows (void);
+extern int struct_levels_to_print (void);
 extern int suppress_verbose_help_message (void);
 extern int treat_neg_dim_as_zero (void);
 extern int warn_assign_as_truth_value (void);
--- a/src/variables.cc	Fri Mar 31 19:33:00 1995 +0000
+++ b/src/variables.cc	Fri Mar 31 22:13:32 1995 +0000
@@ -1654,6 +1654,10 @@
 	  split_long_rows,
     "split long matrix rows instead of wrapping");
 
+  DEFVAR ("struct_levels_to_print", SBV_struct_levels_to_print, 2.0,
+	  0, 0, 1, struct_levels_to_print,
+    "number of levels of structure elements to print");
+
 #ifdef USE_GNU_INFO
   DEFVAR ("suppress_verbose_help_message",
 	  SBV_suppress_verbose_help_message, "false", 0, 0, 1,