diff src/defun-int.h @ 703:21cc5b9b9ed6

[project @ 1994-09-15 02:39:57 by jwe]
author jwe
date Thu, 15 Sep 1994 02:41:12 +0000
parents d169be9237fb
children 36ba0576bd1b
line wrap: on
line diff
--- a/src/defun-int.h
+++ b/src/defun-int.h
@@ -37,9 +37,9 @@
 #define DEFUN_INTERNAL(name, fname, sname, nargin_max, nargout_max, \
 		       is_text_fcn, doc) \
   BEGIN_INSTALL_BUILTIN \
-    extern DECLARE_FUN(fname); \
-    static builtin_function sname = \
-      { name, nargin_max, nargout_max, is_text_fcn, fname, doc }; \
+    extern DECLARE_FUN (fname); \
+    DEFINE_FUN_STRUCT (name, fname, sname, nargin_max, nargout_max, \
+		       is_text_fcn, doc); \
     install_builtin_function (&sname); \
   END_INSTALL_BUILTIN
 
@@ -57,7 +57,7 @@
 
 #define DEFUN_INTERNAL(name, fname, sname, nargin_max, nargout_max, \
 		       is_text_fcn, doc) \
-  DECLARE_FUN(fname)
+  DECLARE_FUN (fname)
 
 // No definition is required for an alias.
 
@@ -65,6 +65,21 @@
 
 #endif /* ! MAKE_BUILTINS */
 
+// Define the structure that will be used to insert this function into
+// the symbol table.
+
+#define DEFINE_FUN_STRUCT(name, fname, sname, nargin_max, \
+			  nargout_max, is_text_fcn, doc) \
+  static builtin_function sname = \
+    { name, nargin_max, nargout_max, is_text_fcn, fname, doc }
+
+#define DEFINE_FUN_STRUCT_FUN(sname, fsname) \
+  builtin_function * \
+  fsname (void) \
+  { \
+    return &sname; \
+  }
+
 // Declare an internal function named fname.  This is the interface
 // used by all internal functions in Octave that are also callable
 // from the Octave language.