defun-dld.h

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 1994-2012 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, see
00019 <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #if !defined (octave_defun_dld_h)
00024 #define octave_defun_dld_h 1
00025 
00026 #if defined (octave_defun_h)
00027 #error defun.h and defun-dld.h both included in same file!
00028 #endif
00029 
00030 #include "defun-int.h"
00031 
00032 // Define a builtin function that may be loaded dynamically at run
00033 // time.
00034 //
00035 // If Octave is not configured for dynamic linking of builtin
00036 // functions, this is the same as DEFUN, except that it will generate
00037 // an extra externally visible function.
00038 //
00039 // The first DECLARE_FUN is for the benefit of the installer function
00040 // and the second is for the definition of the function.
00041 
00042 #if defined (MAKE_BUILTINS)
00043 
00044 #define DEFUN_DLD(name, args_name, nargout_name, doc) \
00045   DEFUN_DLD_INTERNAL (name, args_name, nargout_name, doc)
00046 
00047 // This one can be used when 'name' cannot be used directly (if it is
00048 // already defined as a macro).  In that case, name is already a
00049 // quoted string, and the internal name of the function must be passed
00050 // too (the convention is to use a prefix of "F", so "foo" becomes
00051 // "Ffoo") as well as the name of the generated installer function
00052 // (the convention is to use a prefix of "G", so "foo" becomes "Gfoo").
00053 
00054 #define DEFUNX_DLD(name, fname, gname, args_name, nargout_name, doc) \
00055   DEFUNX_DLD_INTERNAL (name, fname, args_name, nargout_name, doc)
00056 
00057 #else
00058 
00059 #define DEFUN_DLD(name, args_name, nargout_name, doc) \
00060   DECLARE_FUN (name, args_name, nargout_name); \
00061   DEFINE_FUN_INSTALLER_FUN (name, doc) \
00062   DECLARE_FUN (name, args_name, nargout_name)
00063 
00064 #define DEFUNX_DLD(name, fname, gname, args_name, nargout_name, doc) \
00065   DECLARE_FUNX (fname, args_name, nargout_name); \
00066   DEFINE_FUNX_INSTALLER_FUN (name, fname, gname, doc) \
00067   DECLARE_FUNX (fname, args_name, nargout_name)
00068 
00069 #endif
00070 
00071 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines