diff src/pr-output.cc @ 5759:ce79d238f142

[project @ 2006-04-13 13:04:32 by jwe]
author jwe
date Thu, 13 Apr 2006 13:04:33 +0000
parents 8510034588a7
children 7ba9ad1fec11
line wrap: on
line diff
--- a/src/pr-output.cc
+++ b/src/pr-output.cc
@@ -78,6 +78,9 @@
 // smaller slices that fit on the screen.
 static bool Vsplit_long_rows;
 
+// How many levels of structure elements should we print?
+int Vstruct_levels_to_print;
+
 // TRUE means don't do any fancy formatting.
 static bool free_format = false;
 
@@ -3019,6 +3022,24 @@
   return 0;
 }
 
+static int
+struct_levels_to_print (void)
+{
+  double val;
+  if (builtin_real_scalar_variable ("struct_levels_to_print", val)
+      && ! xisnan (val))
+    {
+      int ival = NINT (val);
+      if (ival == val)
+	{
+	  Vstruct_levels_to_print = ival;
+	  return 0;
+	}
+    }
+  gripe_invalid_value_specified ("struct_levels_to_print");
+  return -1;
+}
+
 void
 symbols_of_pr_output (void)
 {
@@ -3119,6 +3140,13 @@
 @noindent\n\
 The default value of @code{split_long_rows} is nonzero.\n\
 @end defvr");
+
+  DEFVAR (struct_levels_to_print, 2.0, struct_levels_to_print,
+    "-*- texinfo -*-\n\
+@defvr {Built-in Variable} struct_levels_to_print\n\
+You can tell Octave how many structure levels to display by setting the\n\
+built-in variable @code{struct_levels_to_print}.  The default value is 2.\n\
+@end defvr");
 }
 
 /*