changeset 525:509e9a2d93a6

[project @ 1994-07-20 18:45:27 by jwe] Initial revision
author jwe
date Wed, 20 Jul 1994 18:45:27 +0000
parents 2814c75c8398
children a01a9db8ab69
files src/defun-dld.h src/defun-int.h src/defun.h
diffstat 3 files changed, 227 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/defun-dld.h	Wed Jul 20 18:45:27 1994 +0000
@@ -0,0 +1,43 @@
+// defun-dld.h                                           -*- C++ -*-
+/*
+
+Copyright (C) 1992, 1993, 1994 John W. Eaton
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, write to the Free
+Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#if !defined (octave_defun_dld_h)
+#define octave_defun_dld_h 1
+
+#if defined (octave_defun_h)
+#error defun.h and defun-dld.h both included in same file!
+#endif
+
+#include "defun-int.h"
+
+#define DEFUN_DLD(name, fname, sname, nargin_max, nargout_max, doc) \
+  DEFUN_INTERNAL (name, fname, sname, nargin_max, nargout_max, 0, doc)
+
+#endif
+
+/*
+;;; Local Variables: ***
+;;; mode: C++ ***
+;;; page-delimiter: "^/\\*" ***
+;;; End: ***
+*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/defun-int.h	Wed Jul 20 18:45:27 1994 +0000
@@ -0,0 +1,76 @@
+// defun-int.h                                          -*- C++ -*-
+/*
+
+Copyright (C) 1992, 1993, 1994 John W. Eaton
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, write to the Free
+Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#if !defined (octave_defun_int_h)
+#define octave_defun_int_h 1
+
+#ifdef MAKE_BUILTINS
+
+#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 }; \
+    install_builtin_function (&sname); \
+  END_INSTALL_BUILTIN
+
+#define DEFALIAS_INTERNAL(alias, name)
+
+#else /* ! MAKE_BUILTINS */
+
+#define DEFUN_INTERNAL(name, fname, sname, nargin_max, nargout_max, \
+		       is_text_fcn, doc) \
+  DECLARE_FUN(fname)
+
+#define DEFALIAS_INTERNAL(alias, name)
+
+#endif /* ! MAKE_BUILTINS */
+
+#define DECLARE_FUN(fname) \
+  Octave_object \
+  fname (const Octave_object& args, int nargout)
+
+#define DEFINE_ARGV(warnfor) \
+  int argc = args.length (); \
+  char **argv = make_argv (args, warnfor); \
+  if (error_state) \
+    return retval
+
+#define DELETE_ARGV \
+  do \
+    { \
+      while (--argc) \
+	delete [] argv[argc]; \
+      delete [] argv; \
+    } \
+  while (0)
+
+#endif
+
+/*
+;;; Local Variables: ***
+;;; mode: C++ ***
+;;; page-delimiter: "^/\\*" ***
+;;; End: ***
+*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/defun.h	Wed Jul 20 18:45:27 1994 +0000
@@ -0,0 +1,108 @@
+// defun.h                                                 -*- C++ -*-
+/*
+
+Copyright (C) 1992, 1993, 1994 John W. Eaton
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, write to the Free
+Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#if !defined (octave_defun_h)
+#define octave_defun_h 1
+
+#if defined (octave_defun_dld_h)
+#error defun.h and defun-dld.h both included in same file!
+#endif
+
+#include "defun-int.h"
+
+#define DEFVAR(name, sname, defn, inst_as_fcn, protect, \
+	       eternal, sv_fcn, doc) \
+  do \
+    { \
+      builtin_variable sname = \
+	{ \
+	  name, \
+	  new tree_constant (defn), \
+	  inst_as_fcn, \
+	  protect, \
+	  eternal, \
+	  sv_fcn, \
+	  doc, \
+	}; \
+      install_builtin_variable (&sname); \
+    } \
+  while (0)
+
+#define DEFUN(name, fname, sname, nargin_max, nargout_max, doc) \
+  DEFUN_INTERNAL (name, fname, sname, nargin_max, nargout_max, 0, doc)
+
+#define DEFUN_TEXT(name, fname, sname, nargin_max, nargout_max, doc) \
+  DEFUN_INTERNAL (name, fname, sname, nargin_max, nargout_max, 1, doc)
+
+#define DEFUN_MAPPER(name, sname, can_ret_cmplx_for_real, lo, hi, \
+		     d_d_map, d_c_map, c_c_map, doc) \
+  do \
+    { \
+      builtin_mapper_function sname = \
+	{ \
+	  name, \
+	  can_ret_cmplx_for_real, \
+	  lo, \
+	  hi, \
+	  d_d_map, \
+	  d_c_map, \
+	  c_c_map, \
+	  doc, \
+	}; \
+      install_builtin_mapper (&sname); \
+    } \
+  while (0)
+
+#define DEFALIAS(alias, name) DEFALIAS_INTERNAL (alias, name)
+
+#ifdef MAKE_BUILTINS
+
+#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 }; \
+    install_builtin_function (&sname); \
+  END_INSTALL_BUILTIN
+
+#define DEFALIAS_INTERNAL(alias, name)
+
+#else /* ! MAKE_BUILTINS */
+
+#define DEFUN_INTERNAL(name, fname, sname, nargin_max, nargout_max, \
+		       is_text_fcn, doc) \
+  DECLARE_FUN(fname)
+
+#define DEFALIAS_INTERNAL(alias, name)
+
+#endif /* ! MAKE_BUILTINS */
+
+#endif
+
+/*
+;;; Local Variables: ***
+;;; mode: C++ ***
+;;; page-delimiter: "^/\\*" ***
+;;; End: ***
+*/