Mercurial > hg > octave-lyh
changeset 1431:d90d88618a9e
[project @ 1995-09-19 07:12:58 by jwe]
author | jwe |
---|---|
date | Tue, 19 Sep 1995 07:12:58 +0000 |
parents | 045e70a15a8f |
children | 4c3d46b02f99 |
files | src/defun.h |
diffstat | 1 files changed, 16 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/defun.h +++ b/src/defun.h @@ -59,8 +59,8 @@ // // doc is the simple help text for this variable. -#define DEFVAR(name, sname, defn, inst_as_fcn, protect, \ - eternal, sv_fcn, doc) \ +#define DEFVAR_INT(name, sname, defn, inst_as_fcn, protect, \ + sv_fcn, doc) \ do \ { \ builtin_variable sname = \ @@ -69,7 +69,7 @@ new tree_constant (defn), \ inst_as_fcn, \ protect, \ - eternal, \ + (sv_fcn ? 1 : 0), \ sv_fcn, \ doc, \ }; \ @@ -77,6 +77,18 @@ } \ while (0) +#define DEFVAR(name, sname, defn, inst_as_fcn, sv_fcn, doc) \ + DEFVAR_INT (name, sname, defn, inst_as_fcn, 0, sv_fcn, doc) + +// Define a builtin-constant, and a corresponding variable that can be +// redefined. This is just the same as DEFVAR, except that it defines +// `name' as a variable, and `__name__' as a constant that cannot be +// redefined. + +#define DEFCONST(name, sname, defn, inst_as_fcn, sv_fcn, doc) \ + DEFVAR_INT (name, sname, defn, inst_as_fcn, 0, sv_fcn, doc); \ + DEFVAR_INT ("__" ## name ## "__", sname, defn, 0, 1, sv_fcn, doc) + // Define a builtin function. // // name is the name of the function, as a string. @@ -94,7 +106,7 @@ // accept. XXX FIXME XXX -- is this really used now? // // nargout_max is the maximum number of outputs this function can -// produce. XXX FIXME XXX -- is this really used now? +// produce. XXX FIXME XXX -- is this really used now? // // doc is the simple help text for the function.