Mercurial > hg > octave-nkf
annotate src/defun.h @ 10749:df1a3e0ebbff
important fixes for struct rewrite(1)
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Thu, 24 Jun 2010 12:43:35 +0200 |
parents | cd96d29c5efa |
children | fd0a3ac60b0e |
rev | line source |
---|---|
525 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, |
8920 | 4 2004, 2005, 2006, 2007, 2008, 2009 John W. Eaton |
525 | 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 | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
525 | 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 | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
525 | 21 |
22 */ | |
23 | |
24 #if !defined (octave_defun_h) | |
25 #define octave_defun_h 1 | |
26 | |
27 #if defined (octave_defun_dld_h) | |
28 #error defun.h and defun-dld.h both included in same file! | |
29 #endif | |
30 | |
31 #include "defun-int.h" | |
32 | |
550 | 33 // Define a builtin function. |
34 // | |
1957 | 35 // name is the name of the function, unqouted. |
550 | 36 // |
2086 | 37 // args_name is the name of the octave_value_list variable used to pass |
1957 | 38 // the argument list to this function. |
550 | 39 // |
1957 | 40 // nargout_name is the name of the int variable used to pass the |
41 // number of output arguments this function is expected to produce. | |
550 | 42 // |
43 // doc is the simple help text for the function. | |
44 | |
1957 | 45 #define DEFUN(name, args_name, nargout_name, doc) \ |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
46 DEFUN_INTERNAL (name, args_name, nargout_name, doc) |
525 | 47 |
3743 | 48 // This one can be used when `name' cannot be used directly (if it is |
49 // already defined as a macro). In that case, name is already a | |
50 // quoted string, and the internal name of the function must be passed | |
5794 | 51 // too (the convention is to use a prefix of "F", so "foo" becomes "Ffoo"). |
3743 | 52 |
53 #define DEFUNX(name, fname, args_name, nargout_name, doc) \ | |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
54 DEFUNX_INTERNAL (name, fname, args_name, nargout_name, doc) |
4208 | 55 |
4234 | 56 // This is a function with a name that can't be hidden by a variable. |
57 #define DEFCONSTFUN(name, args_name, nargout_name, doc) \ | |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
58 DEFCONSTFUN_INTERNAL (name, args_name, nargout_name, doc) |
4234 | 59 |
550 | 60 // Make alias another name for the existing function name. This macro |
61 // must be used in the same file where name is defined, after the | |
62 // definition for name. | |
525 | 63 |
4699 | 64 #define DEFALIAS(alias, name) \ |
65 DEFALIAS_INTERNAL (alias, name) | |
525 | 66 |
67 #endif |