defun.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_h)
00024 #define octave_defun_h 1
00025 
00026 #if defined (octave_defun_dld_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.
00033 //
00034 //   name is the name of the function, unqouted.
00035 //
00036 //   args_name is the name of the octave_value_list variable used to pass
00037 //     the argument list to this function.
00038 //
00039 //   nargout_name is the name of the int variable used to pass the
00040 //     number of output arguments this function is expected to produce.
00041 //
00042 //   doc is the simple help text for the function.
00043 
00044 #define DEFUN(name, args_name, nargout_name, doc) \
00045   DEFUN_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 "Ffoo").
00051 
00052 #define DEFUNX(name, fname, args_name, nargout_name, doc) \
00053   DEFUNX_INTERNAL (name, fname, args_name, nargout_name, doc)
00054 
00055 // This is a function with a name that can't be hidden by a variable.
00056 #define DEFCONSTFUN(name, args_name, nargout_name, doc) \
00057   DEFCONSTFUN_INTERNAL (name, args_name, nargout_name, doc)
00058 
00059 // Make alias another name for the existing function name.  This macro
00060 // must be used in the same file where name is defined, after the
00061 // definition for name.
00062 
00063 #define DEFALIAS(alias, name) \
00064   DEFALIAS_INTERNAL (alias, name)
00065 
00066 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines