GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
defun.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1994-2017 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if ! defined (octave_defun_h)
24 #define octave_defun_h 1
25 
26 #include "octave-config.h"
27 
28 #if defined (octave_defun_dld_h)
29 # error defun.h and defun-dld.h both included in same file!
30 #endif
31 
32 #include "defun-int.h"
33 
34 // Define a builtin function.
35 //
36 // name is the name of the function, unqouted.
37 //
38 // args_name is the name of the octave_value_list variable used to pass
39 // the argument list to this function.
40 //
41 // nargout_name is the name of the int variable used to pass the
42 // number of output arguments this function is expected to produce.
43 //
44 // doc is the simple help text for the function.
45 
46 #define DEFUN(name, args_name, nargout_name, doc) \
47  DECLARE_FUN (name, args_name, nargout_name)
48 
49 // This one can be used when 'name' cannot be used directly (if it is
50 // already defined as a macro). In that case, name is already a
51 // quoted string, and the internal name of the function must be passed
52 // too (the convention is to use a prefix of "F", so "foo" becomes "Ffoo").
53 
54 #define DEFUNX(name, fname, args_name, nargout_name, doc) \
55  DECLARE_FUNX (fname, args_name, nargout_name)
56 
57 // This is a function with a name that can't be hidden by a variable.
58 #define DEFCONSTFUN(name, args_name, nargout_name, doc) \
59  DECLARE_FUN (name, args_name, nargout_name)
60 
61 // Make alias another name for the existing function name. This macro
62 // is processed by the mkbuiltins to generate code in builtins.cc to
63 // create the alias in the symbol table.
64 
65 #define DEFALIAS(alias, name)
66 
67 #endif