annotate src/defun-int.h @ 5102:b04b30d30c66

[project @ 2004-12-28 01:59:05 by jwe]
author jwe
date Tue, 28 Dec 2004 01:59:05 +0000
parents 5e2c68946f30
children 90a9058de7e8
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
2847
8b262e771614 [project @ 1997-03-27 16:18:26 by jwe]
jwe
parents: 2405
diff changeset
3 Copyright (C) 1996, 1997 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
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
10 later version.
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
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, write to the Free
1315
611d403c7f3d [project @ 1995-06-25 19:56:32 by jwe]
jwe
parents: 1009
diff changeset
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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_int_h)
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
24 #define octave_defun_int_h 1
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
25
2968
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2954
diff changeset
26 #include <string>
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2954
diff changeset
27
3145
0d640dc625c7 [project @ 1998-02-05 08:44:59 by jwe]
jwe
parents: 3096
diff changeset
28 #include "ov-builtin.h"
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
29 #include "ov-dld-fcn.h"
3145
0d640dc625c7 [project @ 1998-02-05 08:44:59 by jwe]
jwe
parents: 3096
diff changeset
30 #include "ov-mapper.h"
0d640dc625c7 [project @ 1998-02-05 08:44:59 by jwe]
jwe
parents: 3096
diff changeset
31 #include "symtab.h"
3015
2e114e914b77 [project @ 1997-06-02 21:03:55 by jwe]
jwe
parents: 3014
diff changeset
32 #include "version.h"
2e114e914b77 [project @ 1997-06-02 21:03:55 by jwe]
jwe
parents: 3014
diff changeset
33
2968
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2954
diff changeset
34 class octave_value;
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2954
diff changeset
35
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3364
diff changeset
36 extern void print_usage (const std::string& nm, bool just_usage = false);
3014
38de16594cb4 [project @ 1997-06-02 20:28:09 by jwe]
jwe
parents: 3005
diff changeset
37
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3364
diff changeset
38 extern void check_version (const std::string& version, const std::string& fcn);
3015
2e114e914b77 [project @ 1997-06-02 21:03:55 by jwe]
jwe
parents: 3014
diff changeset
39
3145
0d640dc625c7 [project @ 1998-02-05 08:44:59 by jwe]
jwe
parents: 3096
diff changeset
40 extern void
0d640dc625c7 [project @ 1998-02-05 08:44:59 by jwe]
jwe
parents: 3096
diff changeset
41 install_builtin_mapper (octave_mapper *mf);
2968
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2954
diff changeset
42
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2954
diff changeset
43 extern void
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3364
diff changeset
44 install_builtin_function (octave_builtin::fcn f, const std::string& name,
4234
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4208
diff changeset
45 const std::string& doc, bool is_text_fcn = false,
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4208
diff changeset
46 bool can_hide_function = true);
2968
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2954
diff changeset
47
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2954
diff changeset
48 extern void
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3364
diff changeset
49 install_builtin_variable (const std::string& n, const octave_value& v,
3258
4964d5391acc [project @ 1999-07-21 21:51:33 by jwe]
jwe
parents: 3249
diff changeset
50 bool p, bool e,
3145
0d640dc625c7 [project @ 1998-02-05 08:44:59 by jwe]
jwe
parents: 3096
diff changeset
51 symbol_record::change_function chg_fcn,
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3364
diff changeset
52 const std::string& h);
2968
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2954
diff changeset
53
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2954
diff changeset
54 extern void
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3364
diff changeset
55 install_builtin_constant (const std::string& n, const octave_value& v,
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3364
diff changeset
56 bool p, const std::string& h);
3258
4964d5391acc [project @ 1999-07-21 21:51:33 by jwe]
jwe
parents: 3249
diff changeset
57
4964d5391acc [project @ 1999-07-21 21:51:33 by jwe]
jwe
parents: 3249
diff changeset
58 extern void
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3364
diff changeset
59 install_dld_function (octave_dld_function::fcn f, const std::string& name,
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
60 const octave_shlib& shl,
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3364
diff changeset
61 const std::string& doc, bool is_text_fcn = false);
703
21cc5b9b9ed6 [project @ 1994-09-15 02:39:57 by jwe]
jwe
parents: 578
diff changeset
62
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
63 extern void
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3364
diff changeset
64 alias_builtin (const std::string& alias, const std::string& name);
703
21cc5b9b9ed6 [project @ 1994-09-15 02:39:57 by jwe]
jwe
parents: 578
diff changeset
65
3743
35daf9714b9a [project @ 2000-11-30 00:19:10 by jwe]
jwe
parents: 3741
diff changeset
66 #define DECLARE_FUNX(name, args_name, nargout_name) \
2968
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2954
diff changeset
67 octave_value_list \
3743
35daf9714b9a [project @ 2000-11-30 00:19:10 by jwe]
jwe
parents: 3741
diff changeset
68 name (const octave_value_list& args_name, int nargout_name)
35daf9714b9a [project @ 2000-11-30 00:19:10 by jwe]
jwe
parents: 3741
diff changeset
69
35daf9714b9a [project @ 2000-11-30 00:19:10 by jwe]
jwe
parents: 3741
diff changeset
70 #define DECLARE_FUN(name, args_name, nargout_name) \
35daf9714b9a [project @ 2000-11-30 00:19:10 by jwe]
jwe
parents: 3741
diff changeset
71 DECLARE_FUNX (F ## name, args_name, nargout_name)
2968
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2954
diff changeset
72
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
73 // Define the code that will be used to insert the new function into
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
74 // the symbol table. We look for this name instead of the actual
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3364
diff changeset
75 // function so that we can easily install the doc std::string too.
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
76
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
77 typedef bool (*octave_dld_fcn_installer) (const octave_shlib&);
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
78
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
79 #define DEFINE_FUN_INSTALLER_FUN(name, doc) \
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3744
diff changeset
80 DEFINE_FUN_INSTALLER_FUN2(name, doc, CXX_ABI)
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3744
diff changeset
81
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3744
diff changeset
82 #define DEFINE_FUN_INSTALLER_FUN2(name, doc, cxx_abi) \
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3744
diff changeset
83 DEFINE_FUN_INSTALLER_FUN3(name, doc, cxx_abi)
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3744
diff changeset
84
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3744
diff changeset
85 #define DEFINE_FUN_INSTALLER_FUN3(name, doc, cxx_abi) \
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3744
diff changeset
86 extern "C" \
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
87 bool \
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3744
diff changeset
88 FS ## name ## _ ## cxx_abi (const octave_shlib& shl) \
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
89 { \
4448
042cdbb7f317 [project @ 2003-07-08 19:14:55 by jwe]
jwe
parents: 4234
diff changeset
90 check_version (OCTAVE_API_VERSION, #name); \
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
91 install_dld_function (F ## name, #name, shl, doc); \
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
92 return error_state ? false : true; \
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
93 }
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
94
5102
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
95 // Define a builtin variable.
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
96 //
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
97 // name is the name of the variable, unquoted.
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
98 //
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
99 // defn is the initial value for the variable.
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
100 //
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
101 // protect is a flag that says whether it should be possible to give
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
102 // the variable a new value.
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
103 //
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
104 // eternal is a flag that says whether it should be possible to
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
105 // clear the variable. Most builtin variables are eternal, and
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
106 // cannot be cleared.
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
107 //
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
108 // chg_fcn is a pointer to a function that should be called whenever
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
109 // this variable is given a new value. It can be 0 if there is no
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
110 // function to call. See also the code in user-prefs.cc.
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
111 //
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
112 // doc is the simple help text for this variable.
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
113
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
114 #define DEFVAR(name, defn, chg_fcn, doc) \
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
115 DEFVAR_INTERNAL (#name, SBV_ ## name, defn, false, chg_fcn, doc)
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
116
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
117 // Define a builtin constant `name' (which may be redefined, but will
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
118 // retain its original value when cleared) and also an alias to it
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
119 // called `__name__' (which may not be redefined).
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
120
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
121 #define DEFCONST(name, defn, doc) \
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
122 DEFCONST_INTERNAL (name, defn, doc)
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
123
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
124 // This one can be used when `name' cannot be used directly (if it is
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
125 // already defined as a macro). In that case, name is already a
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
126 // quoted string, and the name of the structure must to be passed too.
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
127
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
128 #define DEFCONSTX(name, sname, defn, doc) \
b04b30d30c66 [project @ 2004-12-28 01:59:05 by jwe]
jwe
parents: 4699
diff changeset
129 DEFCONSTX_INTERNAL (name, sname, defn, doc)
3842
07b99a1889cb [project @ 2001-06-29 18:58:21 by jwe]
jwe
parents: 3744
diff changeset
130
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
131 // MAKE_BUILTINS is defined to extract function names and related
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
132 // information and create the *.df files that are eventually used to
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
133 // create the builtins.cc file.
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
134
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
135 #if defined (MAKE_BUILTINS)
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
136
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
137 // Generate code to install name in the symbol table. The script
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
138 // mkdefs will create a .def file for every .cc file that uses DEFUN,
4208
e96f52432059 [project @ 2002-12-03 19:48:57 by jwe]
jwe
parents: 4165
diff changeset
139 // or DEFCMD.
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
140
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
141 #define DEFUN_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
142 BEGIN_INSTALL_BUILTIN \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
143 XDEFUN_INTERNAL (name, args_name, nargout_name, is_text_fcn, doc) \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
144 END_INSTALL_BUILTIN
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
145
4234
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4208
diff changeset
146 #define DEFCONSTFUN_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) \
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4208
diff changeset
147 BEGIN_INSTALL_BUILTIN \
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4208
diff changeset
148 XDEFCONSTFUN_INTERNAL (name, args_name, nargout_name, is_text_fcn, doc) \
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4208
diff changeset
149 END_INSTALL_BUILTIN
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4208
diff changeset
150
3743
35daf9714b9a [project @ 2000-11-30 00:19:10 by jwe]
jwe
parents: 3741
diff changeset
151 #define DEFUNX_INTERNAL(name, fname, args_name, nargout_name, \
35daf9714b9a [project @ 2000-11-30 00:19:10 by jwe]
jwe
parents: 3741
diff changeset
152 is_text_fcn, doc) \
35daf9714b9a [project @ 2000-11-30 00:19:10 by jwe]
jwe
parents: 3741
diff changeset
153 BEGIN_INSTALL_BUILTIN \
3744
b0588fc1f3ca [project @ 2000-11-30 00:27:00 by jwe]
jwe
parents: 3743
diff changeset
154 XDEFUNX_INTERNAL (name, fname, args_name, nargout_name, is_text_fcn, doc) \
3743
35daf9714b9a [project @ 2000-11-30 00:19:10 by jwe]
jwe
parents: 3741
diff changeset
155 END_INSTALL_BUILTIN
35daf9714b9a [project @ 2000-11-30 00:19:10 by jwe]
jwe
parents: 3741
diff changeset
156
3364
fac05a83b4c5 [project @ 1999-11-20 03:05:42 by jwe]
jwe
parents: 3325
diff changeset
157 // Generate code to install name in the symbol table. The script
fac05a83b4c5 [project @ 1999-11-20 03:05:42 by jwe]
jwe
parents: 3325
diff changeset
158 // mkdefs will create a .def file for every .cc file that uses
fac05a83b4c5 [project @ 1999-11-20 03:05:42 by jwe]
jwe
parents: 3325
diff changeset
159 // DEFUN_DLD.
fac05a83b4c5 [project @ 1999-11-20 03:05:42 by jwe]
jwe
parents: 3325
diff changeset
160
fac05a83b4c5 [project @ 1999-11-20 03:05:42 by jwe]
jwe
parents: 3325
diff changeset
161 #define DEFUN_DLD_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) \
fac05a83b4c5 [project @ 1999-11-20 03:05:42 by jwe]
jwe
parents: 3325
diff changeset
162 BEGIN_INSTALL_BUILTIN \
fac05a83b4c5 [project @ 1999-11-20 03:05:42 by jwe]
jwe
parents: 3325
diff changeset
163 XDEFUN_DLD_INTERNAL (name, args_name, nargout_name, is_text_fcn, doc) \
fac05a83b4c5 [project @ 1999-11-20 03:05:42 by jwe]
jwe
parents: 3325
diff changeset
164 END_INSTALL_BUILTIN
fac05a83b4c5 [project @ 1999-11-20 03:05:42 by jwe]
jwe
parents: 3325
diff changeset
165
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
166 // Generate code for making another name for an existing function.
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
167
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
168 #define DEFALIAS_INTERNAL(alias, name) \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
169 BEGIN_INSTALL_BUILTIN \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
170 XDEFALIAS_INTERNAL(alias, name) \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
171 END_INSTALL_BUILTIN
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
172
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
173 #define DEFVAR_INTERNAL(name, sname, defn, protect, chg_fcn, doc) \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
174 BEGIN_INSTALL_BUILTIN \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
175 XDEFVAR_INTERNAL(name, sname, defn, protect, chg_fcn, doc) \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
176 END_INSTALL_BUILTIN
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
177
3321
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3295
diff changeset
178 #define DEFCONST_INTERNAL(name, defn, doc) \
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
179 BEGIN_INSTALL_BUILTIN \
3321
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3295
diff changeset
180 XDEFCONST_INTERNAL(name, defn, doc) \
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3295
diff changeset
181 END_INSTALL_BUILTIN
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3295
diff changeset
182
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3295
diff changeset
183 #define DEFCONSTX_INTERNAL(name, sname, defn, doc) \
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3295
diff changeset
184 BEGIN_INSTALL_BUILTIN \
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3295
diff changeset
185 XDEFCONST_INTERNAL(name, defn, doc) \
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
186 END_INSTALL_BUILTIN
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
187
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
188 #define DEFUN_MAPPER_INTERNAL(name, ch_map, d_b_map, c_b_map, d_d_map, \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
189 d_c_map, c_c_map, lo, hi, \
4100
ed0090ecf80f [project @ 2002-10-11 16:37:45 by jwe]
jwe
parents: 4011
diff changeset
190 ch_map_flag, can_ret_cmplx_for_real, doc) \
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
191 BEGIN_INSTALL_BUILTIN \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
192 XDEFUN_MAPPER_INTERNAL(name, ch_map, d_b_map, c_b_map, d_d_map, \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
193 d_c_map, c_c_map, lo, hi, \
4100
ed0090ecf80f [project @ 2002-10-11 16:37:45 by jwe]
jwe
parents: 4011
diff changeset
194 ch_map_flag, can_ret_cmplx_for_real, doc) \
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
195 END_INSTALL_BUILTIN
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
196
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
197 #else /* ! MAKE_BUILTINS */
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
198
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
199 // Generate the first line of the function definition. This ensures
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
200 // that the internal functions all have the same signature.
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
201
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
202 #define DEFUN_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) \
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
203 DECLARE_FUN (name, args_name, nargout_name)
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
204
4234
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4208
diff changeset
205 #define DEFCONSTFUN_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) \
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4208
diff changeset
206 DECLARE_FUN (name, args_name, nargout_name)
90e44267e8cf [project @ 2002-12-21 17:15:25 by jwe]
jwe
parents: 4208
diff changeset
207
3743
35daf9714b9a [project @ 2000-11-30 00:19:10 by jwe]
jwe
parents: 3741
diff changeset
208 #define DEFUNX_INTERNAL(name, fname, args_name, nargout_name, \
35daf9714b9a [project @ 2000-11-30 00:19:10 by jwe]
jwe
parents: 3741
diff changeset
209 is_text_fcn, doc) \
35daf9714b9a [project @ 2000-11-30 00:19:10 by jwe]
jwe
parents: 3741
diff changeset
210 DECLARE_FUNX (fname, args_name, nargout_name)
35daf9714b9a [project @ 2000-11-30 00:19:10 by jwe]
jwe
parents: 3741
diff changeset
211
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
212 // No definition is required for an alias.
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
213
4699
5e2c68946f30 [project @ 2004-01-20 23:04:46 by jwe]
jwe
parents: 4448
diff changeset
214 #define DEFALIAS_INTERNAL(alias, name)
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
215
2968
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2954
diff changeset
216 // How builtin variables are actually installed.
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2954
diff changeset
217
3258
4964d5391acc [project @ 1999-07-21 21:51:33 by jwe]
jwe
parents: 3249
diff changeset
218 #define DEFVAR_INTERNAL(name, sname, defn, protect, chg_fcn, doc) \
4964d5391acc [project @ 1999-07-21 21:51:33 by jwe]
jwe
parents: 3249
diff changeset
219 install_builtin_variable (name, octave_value (defn), protect, \
4964d5391acc [project @ 1999-07-21 21:51:33 by jwe]
jwe
parents: 3249
diff changeset
220 (chg_fcn != 0), chg_fcn, doc)
4964d5391acc [project @ 1999-07-21 21:51:33 by jwe]
jwe
parents: 3249
diff changeset
221
4964d5391acc [project @ 1999-07-21 21:51:33 by jwe]
jwe
parents: 3249
diff changeset
222 // How builtin variables are actually installed.
4964d5391acc [project @ 1999-07-21 21:51:33 by jwe]
jwe
parents: 3249
diff changeset
223
3321
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3295
diff changeset
224 #define INSTALL_CONST(name, sname, defn, protect, doc) \
3258
4964d5391acc [project @ 1999-07-21 21:51:33 by jwe]
jwe
parents: 3249
diff changeset
225 install_builtin_constant (name, octave_value (defn), protect, doc)
2968
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2954
diff changeset
226
3321
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3295
diff changeset
227 #define DEFCONST_INTERNAL(name, defn, doc) \
4011
eb377885843d [project @ 2002-08-01 20:08:08 by jwe]
jwe
parents: 3842
diff changeset
228 INSTALL_CONST (#name, SBV_ ## name, defn, false, doc);
3321
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3295
diff changeset
229
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3295
diff changeset
230 #define DEFCONSTX_INTERNAL(name, sname, defn, doc) \
4011
eb377885843d [project @ 2002-08-01 20:08:08 by jwe]
jwe
parents: 3842
diff changeset
231 INSTALL_CONST (name, sname, defn, false, doc);
3321
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3295
diff changeset
232
2968
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2954
diff changeset
233 // How mapper functions are actually installed.
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2954
diff changeset
234
3564
403039c85792 [project @ 2000-02-03 06:23:11 by jwe]
jwe
parents: 3528
diff changeset
235 // XXX FIXME XXX -- Really want to avoid the following casts, since
403039c85792 [project @ 2000-02-03 06:23:11 by jwe]
jwe
parents: 3528
diff changeset
236 // (as always with casts) it may mask some real errors...
403039c85792 [project @ 2000-02-03 06:23:11 by jwe]
jwe
parents: 3528
diff changeset
237
3249
60866c521b92 [project @ 1999-07-13 03:44:16 by jwe]
jwe
parents: 3145
diff changeset
238 #define DEFUN_MAPPER_INTERNAL(name, ch_map, d_b_map, c_b_map, d_d_map, \
60866c521b92 [project @ 1999-07-13 03:44:16 by jwe]
jwe
parents: 3145
diff changeset
239 d_c_map, c_c_map, lo, hi, \
4100
ed0090ecf80f [project @ 2002-10-11 16:37:45 by jwe]
jwe
parents: 4011
diff changeset
240 ch_map_flag, can_ret_cmplx_for_real, doc) \
2968
e330cb788508 [project @ 1997-05-15 17:40:29 by jwe]
jwe
parents: 2954
diff changeset
241 install_builtin_mapper \
3564
403039c85792 [project @ 2000-02-03 06:23:11 by jwe]
jwe
parents: 3528
diff changeset
242 (new octave_mapper \
403039c85792 [project @ 2000-02-03 06:23:11 by jwe]
jwe
parents: 3528
diff changeset
243 (X_CAST (octave_mapper::ch_mapper, ch_map), \
403039c85792 [project @ 2000-02-03 06:23:11 by jwe]
jwe
parents: 3528
diff changeset
244 X_CAST (octave_mapper::d_b_mapper, d_b_map), \
403039c85792 [project @ 2000-02-03 06:23:11 by jwe]
jwe
parents: 3528
diff changeset
245 X_CAST (octave_mapper::c_b_mapper, c_b_map), \
403039c85792 [project @ 2000-02-03 06:23:11 by jwe]
jwe
parents: 3528
diff changeset
246 X_CAST (octave_mapper::d_d_mapper, d_d_map), \
403039c85792 [project @ 2000-02-03 06:23:11 by jwe]
jwe
parents: 3528
diff changeset
247 X_CAST (octave_mapper::d_c_mapper, d_c_map), \
403039c85792 [project @ 2000-02-03 06:23:11 by jwe]
jwe
parents: 3528
diff changeset
248 X_CAST (octave_mapper::c_c_mapper, c_c_map), \
4165
e05de825dbd6 [project @ 2002-11-11 23:25:48 by jwe]
jwe
parents: 4100
diff changeset
249 lo, hi, ch_map_flag, can_ret_cmplx_for_real, #name, doc))
525
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
250
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
251 #endif /* ! MAKE_BUILTINS */
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3258
diff changeset
252
525
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
253 #endif
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
254
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
255 /*
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
256 ;;; Local Variables: ***
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
257 ;;; mode: C++ ***
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
258 ;;; End: ***
509e9a2d93a6 [project @ 1994-07-20 18:45:27 by jwe]
jwe
parents:
diff changeset
259 */