Mercurial > octave-nkf
changeset 3743:35daf9714b9a
[project @ 2000-11-30 00:19:10 by jwe]
author | jwe |
---|---|
date | Thu, 30 Nov 2000 00:19:11 +0000 |
parents | 078fde449ebc |
children | b0588fc1f3ca |
files | src/ChangeLog src/defun-int.h src/defun.h src/ov-usr-fcn.cc |
diffstat | 4 files changed, 29 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Wed Nov 29 22:58:53 2000 +0000 +++ b/src/ChangeLog Thu Nov 30 00:19:11 2000 +0000 @@ -1,5 +1,9 @@ 2000-11-29 John W. Eaton <jwe@bevo.che.wisc.edu> + * defun.h (DEFUNX): New macro. + * defun-int.h (DEFUNX_INTERNAL, DECLARE_FUNX): New macro. + (DECLARE_FUN): Define in terms of DECLARE_FUNX. + * mkdefs: Read and print one line at a time, so we can force patterns to match only at the beginning of a line.
--- a/src/defun-int.h Wed Nov 29 22:58:53 2000 +0000 +++ b/src/defun-int.h Thu Nov 30 00:19:11 2000 +0000 @@ -62,9 +62,12 @@ extern void alias_builtin (const std::string& alias, const std::string& name); -#define DECLARE_FUN(name, args_name, nargout_name) \ +#define DECLARE_FUNX(name, args_name, nargout_name) \ octave_value_list \ - F ## name (const octave_value_list& args_name, int nargout_name) + name (const octave_value_list& args_name, int nargout_name) + +#define DECLARE_FUN(name, args_name, nargout_name) \ + DECLARE_FUNX (F ## name, args_name, nargout_name) // Define the code that will be used to insert the new function into // the symbol table. We look for this name instead of the actual @@ -96,6 +99,12 @@ XDEFUN_INTERNAL (name, args_name, nargout_name, is_text_fcn, doc) \ END_INSTALL_BUILTIN +#define DEFUNX_INTERNAL(name, fname, args_name, nargout_name, \ + is_text_fcn, doc) \ + BEGIN_INSTALL_BUILTIN \ + XDEFUN_INTERNAL (name, args_name, nargout_name, is_text_fcn, doc) \ + END_INSTALL_BUILTIN + // Generate code to install name in the symbol table. The script // mkdefs will create a .def file for every .cc file that uses // DEFUN_DLD. @@ -144,6 +153,10 @@ #define DEFUN_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) \ DECLARE_FUN (name, args_name, nargout_name) +#define DEFUNX_INTERNAL(name, fname, args_name, nargout_name, \ + is_text_fcn, doc) \ + DECLARE_FUNX (fname, args_name, nargout_name) + // No definition is required for an alias. #define DEFALIAS_INTERNAL(name, alias)
--- a/src/defun.h Wed Nov 29 22:58:53 2000 +0000 +++ b/src/defun.h Thu Nov 30 00:19:11 2000 +0000 @@ -60,7 +60,7 @@ // This one can be used when `name' cannot be used directly (if it is // already defined as a macro). In that case, name is already a -// quoted string, and the name of the structure has to be passed too. +// quoted string, and the name of the structure must to be passed too. #define DEFCONSTX(name, sname, defn, doc) \ DEFCONSTX_INTERNAL (name, sname, defn, doc) @@ -80,6 +80,14 @@ #define DEFUN(name, args_name, nargout_name, doc) \ DEFUN_INTERNAL (name, args_name, nargout_name, false, doc) +// This one can be used when `name' cannot be used directly (if it is +// already defined as a macro). In that case, name is already a +// quoted string, and the internal name of the function must be passed +// too (the convetion is to use a prefix of "F", so "foo" becomes "Ffoo"). + +#define DEFUNX(name, fname, args_name, nargout_name, doc) \ + DEFUNX_INTERNAL (name, fname, args_name, nargout_name, false, doc) + // Define a builtin text-style function. // // This is like DEFUN, except that it defines a function that can be
--- a/src/ov-usr-fcn.cc Wed Nov 29 22:58:53 2000 +0000 +++ b/src/ov-usr-fcn.cc Thu Nov 30 00:19:11 2000 +0000 @@ -486,7 +486,7 @@ nargout_sr->define (static_cast<double> (nargout)); } -DEFUN (va_arg, args, , +DEFUNX ("va_arg", Fva_arg, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} va_arg ()\n\ Return the value of hte next available argument and move the internal\n\