home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / octave-1.1.1p1-base.tgz / octave-1.1.1p1-base.tar / fsf / octave / src / defun-dld.h < prev    next >
C/C++ Source or Header  |  1995-01-03  |  2KB  |  74 lines

  1. // defun-dld.h                                           -*- C++ -*-
  2. /*
  3.  
  4. Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton
  5.  
  6. This file is part of Octave.
  7.  
  8. Octave is free software; you can redistribute it and/or modify it
  9. under the terms of the GNU General Public License as published by the
  10. Free Software Foundation; either version 2, or (at your option) any
  11. later version.
  12.  
  13. Octave is distributed in the hope that it will be useful, but WITHOUT
  14. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  16. for more details.
  17.  
  18. You should have received a copy of the GNU General Public License
  19. along with Octave; see the file COPYING.  If not, write to the Free
  20. Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  
  22. */
  23.  
  24. #if !defined (octave_defun_dld_h)
  25. #define octave_defun_dld_h 1
  26.  
  27. #if defined (octave_defun_h)
  28. #error defun.h and defun-dld.h both included in same file!
  29. #endif
  30.  
  31. #include "defun-int.h"
  32.  
  33. // Define a builtin function that may be loaded dynamically at run
  34. // time.
  35. //
  36. // If Octave is not configured for dynamic linking of builtin
  37. // functions, this is exactly like DEFUN.
  38.  
  39. #if defined (WITH_DLD) && defined (OCTAVE_LITE) && defined (MAKE_BUILTINS)
  40. #define DEFUN_DLD_BUILTIN(name, fname, sname, nargin_max, nargout_max, doc) \
  41.   BEGIN_INSTALL_BUILTIN \
  42.     DEFINE_FUN_STRUCT (name, 0, sname, nargin_max, nargout_max, 0, doc); \
  43.     install_builtin_function (&sname); \
  44.   END_INSTALL_BUILTIN
  45. #else
  46. #define DEFUN_DLD_BUILTIN(name, fname, sname, nargin_max, nargout_max, doc) \
  47.   DEFUN_INTERNAL (name, fname, sname, nargin_max, nargout_max, 0, doc)
  48. #endif
  49.  
  50. // Define a function that may be loaded dynamically at run time.
  51. //
  52. // If Octave is not configured for dynamic linking of builtin
  53. // functions, this won't do anything useful.
  54. //
  55. // The forward declaration is for the struct, the second is for the
  56. // definition of the function.
  57.  
  58. #if ! defined (MAKE_BUILTINS)
  59. #define DEFUN_DLD(name, fname, sname, fsname, nargin_max, nargout_max, doc) \
  60.   DECLARE_FUN (fname); \
  61.   DEFINE_FUN_STRUCT (name, fname, sname, nargin_max, nargout_max, 0, doc); \
  62.   DEFINE_FUN_STRUCT_FUN (sname, fsname) \
  63.   DECLARE_FUN (fname)
  64. #endif
  65.  
  66. #endif
  67.  
  68. /*
  69. ;;; Local Variables: ***
  70. ;;; mode: C++ ***
  71. ;;; page-delimiter: "^/\\*" ***
  72. ;;; End: ***
  73. */
  74.