annotate libinterp/corefcn/defun.h @ 20614:10ec79b47808

use new string_value method to handle value extraction errors * __voronoi__.cc, chol.cc, colamd.cc, fftw.cc: Use new string_value method.
author John W. Eaton <jwe@octave.org>
date Thu, 08 Oct 2015 18:15:56 -0400
parents 4197fc428c7d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
525
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
1 /*
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
2
19731
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
3 Copyright (C) 1994-2015 John W. Eaton
525
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
4
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
6
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6989
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6989
diff changeset
10 option) any later version.
525
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
11
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
15 for more details.
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
16
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6989
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6989
diff changeset
19 <http://www.gnu.org/licenses/>.
525
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
20
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
21 */
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
22
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
23 #if !defined (octave_defun_h)
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
24 #define octave_defun_h 1
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
25
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
26 #if defined (octave_defun_dld_h)
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
27 #error defun.h and defun-dld.h both included in same file!
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
28 #endif
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
29
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
30 #include "defun-int.h"
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
31
550
95ee5e330179 [project @ 1994-07-22 20:17:58 by jwe]
jwe
parents: 546
diff changeset
32 // Define a builtin function.
95ee5e330179 [project @ 1994-07-22 20:17:58 by jwe]
jwe
parents: 546
diff changeset
33 //
1957
0e6a0a271998 [project @ 1996-02-15 01:08:15 by jwe]
jwe
parents: 1884
diff changeset
34 // name is the name of the function, unqouted.
550
95ee5e330179 [project @ 1994-07-22 20:17:58 by jwe]
jwe
parents: 546
diff changeset
35 //
2086
bfb775fb6fe8 [project @ 1996-04-25 05:55:19 by jwe]
jwe
parents: 1996
diff changeset
36 // args_name is the name of the octave_value_list variable used to pass
1957
0e6a0a271998 [project @ 1996-02-15 01:08:15 by jwe]
jwe
parents: 1884
diff changeset
37 // the argument list to this function.
550
95ee5e330179 [project @ 1994-07-22 20:17:58 by jwe]
jwe
parents: 546
diff changeset
38 //
1957
0e6a0a271998 [project @ 1996-02-15 01:08:15 by jwe]
jwe
parents: 1884
diff changeset
39 // nargout_name is the name of the int variable used to pass the
0e6a0a271998 [project @ 1996-02-15 01:08:15 by jwe]
jwe
parents: 1884
diff changeset
40 // number of output arguments this function is expected to produce.
550
95ee5e330179 [project @ 1994-07-22 20:17:58 by jwe]
jwe
parents: 546
diff changeset
41 //
95ee5e330179 [project @ 1994-07-22 20:17:58 by jwe]
jwe
parents: 546
diff changeset
42 // doc is the simple help text for the function.
95ee5e330179 [project @ 1994-07-22 20:17:58 by jwe]
jwe
parents: 546
diff changeset
43
1957
0e6a0a271998 [project @ 1996-02-15 01:08:15 by jwe]
jwe
parents: 1884
diff changeset
44 #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
45 DEFUN_INTERNAL (name, args_name, nargout_name, doc)
525
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
46
15466
d174210ce1ec use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
47 // This one can be used when 'name' cannot be used directly (if it is
3743
35daf9714b9a [project @ 2000-11-30 00:19:10 by jwe]
jwe
parents: 3741
diff changeset
48 // already defined as a macro). In that case, name is already a
35daf9714b9a [project @ 2000-11-30 00:19:10 by jwe]
jwe
parents: 3741
diff changeset
49 // quoted string, and the internal name of the function must be passed
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5307
diff changeset
50 // too (the convention is to use a prefix of "F", so "foo" becomes "Ffoo").
3743
35daf9714b9a [project @ 2000-11-30 00:19:10 by jwe]
jwe
parents: 3741
diff changeset
51
35daf9714b9a [project @ 2000-11-30 00:19:10 by jwe]
jwe
parents: 3741
diff changeset
52 #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
53 DEFUNX_INTERNAL (name, fname, args_name, nargout_name, doc)
4208
e96f52432059 [project @ 2002-12-03 19:48:57 by jwe]
jwe
parents: 4100
diff changeset
54
4234
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4208
diff changeset
55 // This is a function with a name that can't be hidden by a variable.
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4208
diff changeset
56 #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
57 DEFCONSTFUN_INTERNAL (name, args_name, nargout_name, doc)
4234
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4208
diff changeset
58
550
95ee5e330179 [project @ 1994-07-22 20:17:58 by jwe]
jwe
parents: 546
diff changeset
59 // Make alias another name for the existing function name. This macro
95ee5e330179 [project @ 1994-07-22 20:17:58 by jwe]
jwe
parents: 546
diff changeset
60 // must be used in the same file where name is defined, after the
95ee5e330179 [project @ 1994-07-22 20:17:58 by jwe]
jwe
parents: 546
diff changeset
61 // definition for name.
525
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
62
4699
5e2c68946f30 [project @ 2004-01-20 23:04:46 by jwe]
jwe
parents: 4668
diff changeset
63 #define DEFALIAS(alias, name) \
5e2c68946f30 [project @ 2004-01-20 23:04:46 by jwe]
jwe
parents: 4668
diff changeset
64 DEFALIAS_INTERNAL (alias, name)
525
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
65
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
66 #endif