changeset 2954:ac3368dba5d3

[project @ 1997-05-09 15:09:47 by jwe]
author jwe
date Fri, 09 May 1997 15:11:16 +0000
parents ca7d3625ee01
children dfffbf305468
files src/defun-int.h src/defun.h src/ov-base.cc src/ov-re-mat.cc src/ov-struct.cc src/ov.cc src/variables.cc src/variables.h
diffstat 8 files changed, 18 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/src/defun-int.h
+++ b/src/defun-int.h
@@ -24,7 +24,6 @@
 #define octave_defun_int_h 1
 
 #include "oct-builtin.h"
-#include "variables.h"
 
 // MAKE_BUILTINS is defined to extract function names and related
 // information and create the *.def files that are eventually used to
--- a/src/defun.h
+++ b/src/defun.h
@@ -76,13 +76,8 @@
 // How builtin variables are actually installed.
 
 #define DEFVAR_INT(name, sname, defn, inst_as_fcn, protect, sv_fcn, doc) \
-  do \
-    { \
-      builtin_variable sname (name, octave_value (defn), inst_as_fcn, \
-			      protect, (sv_fcn != 0), sv_fcn, doc); \
-      install_builtin_variable (sname); \
-    } \
-  while (0)
+  install_builtin_variable (name, octave_value (defn), inst_as_fcn, \
+			    protect, (sv_fcn != 0), sv_fcn, doc)
 
 // Define a builtin function.
 //
--- a/src/ov-base.cc
+++ b/src/ov-base.cc
@@ -34,6 +34,7 @@
 
 #include "gripes.h"
 #include "oct-map.h"
+#include "oct-var-ref.h"
 #include "ops.h"
 #include "ov-base.h"
 #include "ov-scalar.h"
--- a/src/ov-re-mat.cc
+++ b/src/ov-re-mat.cc
@@ -36,6 +36,7 @@
 
 #include "gripes.h"
 #include "oct-obj.h"
+#include "oct-var-ref.h"
 #include "ops.h"
 #include "ov-scalar.h"
 #include "ov-re-mat.h"
--- a/src/ov-struct.cc
+++ b/src/ov-struct.cc
@@ -31,6 +31,7 @@
 #include <iostream.h>
 
 #include "error.h"
+#include "oct-var-ref.h"
 #include "ov-struct.h"
 #include "unwind-prot.h"
 #include "variables.h"
--- a/src/ov.cc
+++ b/src/ov.cc
@@ -31,6 +31,7 @@
 #include "Array-flags.h"
 #include "str-vec.h"
 
+#include "oct-var-ref.h"
 #include "ov.h"
 #include "ov-base.h"
 #include "ov-bool.h"
--- a/src/variables.cc
+++ b/src/variables.cc
@@ -1533,14 +1533,17 @@
 }
 
 void
-install_builtin_variable (const builtin_variable& v)
+install_builtin_variable (const string& name, const octave_value& value,
+			  bool install_as_function, bool protect,
+			  bool eternal, symbol_record::sv_function sv_fcn,
+			  const string& help_string);
 {
-  if (v.install_as_function)
-    install_builtin_variable_as_function (v.name, v.value, v.protect,
-					  v.eternal, v.help_string);
+  if (install_as_function)
+    install_builtin_variable_as_function (name, value, protect,
+					  eternal, help_string);
   else
-    bind_builtin_variable (v.name, v.value, v.protect, v.eternal,
-			   v.sv_fcn, v.help_string);
+    bind_builtin_variable (name, value, protect, eternal,
+			   sv_fcn, help_string);
 }
 
 void
--- a/src/variables.h
+++ b/src/variables.h
@@ -40,22 +40,6 @@
 #include "ov.h"
 #include "symtab.h"
 
-struct builtin_variable
-{
-  builtin_variable (const string& n, const octave_value& v, bool iaf,
-		    bool p, bool e, sv_Function svf, const string& h)
-    : name (n), value (v), install_as_function (iaf), protect (p),
-      eternal (e), sv_fcn (svf), help_string (h) { }
-
-  string name;
-  octave_value value;
-  bool install_as_function;
-  bool protect;
-  bool eternal;
-  symbol_record::sv_function sv_fcn;
-  string help_string;
-};
-
 typedef octave_value_list (*Octave_builtin_fcn)(const octave_value_list&, int);
 
 extern void initialize_symbol_tables (void);
@@ -114,7 +98,9 @@
 install_builtin_function (octave_builtin *f, bool is_text_fcn = false);
 
 extern void
-install_builtin_variable (const builtin_variable& v);
+install_builtin_variable (const string& n, const octave_value& v,
+			  bool iaf, bool p, bool e,
+			  symbol_record::sv_function svf, const string& h);
 
 extern void
 install_builtin_variable_as_function (const string& name,