diff src/ov-usr-fcn.cc @ 5794:1138ced03f14

[project @ 2006-05-08 20:23:04 by jwe]
author jwe
date Mon, 08 May 2006 20:23:07 +0000
parents ace8d8d26933
children 080c08b192d8
line wrap: on
line diff
--- a/src/ov-usr-fcn.cc	Sat May 06 14:55:35 2006 +0000
+++ b/src/ov-usr-fcn.cc	Mon May 08 20:23:07 2006 +0000
@@ -49,7 +49,7 @@
 #include "variables.h"
 
 // Maximum nesting level for functions called recursively.
-static int Vmax_recursion_depth;
+static int Vmax_recursion_depth = 256;
 
 // User defined functions.
 
@@ -545,7 +545,7 @@
 void
 octave_user_function::print_code_function_header (void)
 {
-  tree_print_code tpc (octave_stdout, Vps4);
+  tree_print_code tpc (octave_stdout, VPS4);
 
   tpc.visit_octave_user_function_header (*this);
 }
@@ -553,7 +553,7 @@
 void
 octave_user_function::print_code_function_trailer (void)
 {
-  tree_print_code tpc (octave_stdout, Vps4);
+  tree_print_code tpc (octave_stdout, VPS4);
 
   tpc.visit_octave_user_function_trailer (*this);
 }
@@ -865,26 +865,16 @@
   return retval;
 }
 
-static int
-max_recursion_depth (void)
+DEFUN (max_recursion_depth, args, nargout,
+  "-*- texinfo -*-\n\
+@deftypefn {Built-in Function} {@var{val} =} max_recursion_depth ()\n\
+@deftypefnx {Built-in Function} {@var{old_val} =} max_recursion_depth (@var{new_val})\n\
+Query or set the internal limit on the number of times a function may\n\
+be called recursively.  If the limit is exceeded, an error message is\n\
+printed and control returns to the top level.\n\
+@end deftypefn")
 {
-  Vmax_recursion_depth = check_preference ("max_recursion_depth");
-
-  return 0;
-}
-
-void
-symbols_of_ov_usr_fcn (void)
-{
-  DEFVAR (max_recursion_depth, 256.0, max_recursion_depth,
-    "-*- texinfo -*-\n\
-@defvr {Built-in Variable} max_recursion_depth\n\
-Limit the number of times a function may be called recursively.\n\
-If the limit is exceeded, an error message is printed and control\n\
-returns to the top level.\n\
-\n\
-The default value is 256.\n\
-@end defvr");
+  return SET_INTERNAL_VARIABLE (max_recursion_depth);
 }
 
 /*