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

[project @ 1994-09-15 02:39:57 by jwe]
author jwe
date Thu, 15 Sep 1994 02:41:12 +0000
parents 95ee5e330179
children 1900ccfdf860
line wrap: on
line diff
--- a/src/defun-dld.h	Thu Sep 15 02:32:47 1994 +0000
+++ b/src/defun-dld.h	Thu Sep 15 02:41:12 1994 +0000
@@ -36,8 +36,32 @@
 // If Octave is not configured for dynamic linking of builtin
 // functions, this is exactly like DEFUN.
 
-#define DEFUN_DLD(name, fname, sname, nargin_max, nargout_max, doc) \
+#if defined (WITH_DLD) && defined (OCTAVE_LITE) && defined (MAKE_BUILTINS)
+#define DEFUN_DLD_BUILTIN(name, fname, sname, nargin_max, nargout_max, doc) \
+  BEGIN_INSTALL_BUILTIN \
+    DEFINE_FUN_STRUCT (name, 0, sname, nargin_max, nargout_max, 0, doc); \
+    install_builtin_function (&sname); \
+  END_INSTALL_BUILTIN
+#else
+#define DEFUN_DLD_BUILTIN(name, fname, sname, nargin_max, nargout_max, doc) \
   DEFUN_INTERNAL (name, fname, sname, nargin_max, nargout_max, 0, doc)
+#endif
+
+// Define a function that may be loaded dynamically at run time.
+//
+// If Octave is not configured for dynamic linking of builtin
+// functions, this won't do anything useful.
+//
+// The forward declaration is for the struct, the second is for the
+// definition of the function.
+
+#if ! defined (MAKE_BUILTINS)
+#define DEFUN_DLD(name, fname, sname, fsname, nargin_max, nargout_max, doc) \
+  DECLARE_FUN (fname);
+  DEFINE_FUN_STRUCT (name, fname, sname, nargin_max, nargout_max, 0, doc); \
+  DEFINE_FUN_STRUCT_FUN (sname, fsname) \
+  DECLARE_FUN (fname)
+#endif
 
 #endif