# HG changeset patch # User jwe # Date 1147140295 0 # Node ID 20f4bd627a748b361cf31a630ad60af00a443d20 # Parent dd0422e4022cc465224a1f2b3448564295de4355 [project @ 2006-05-09 02:04:54 by jwe] diff -r dd0422e4022c -r 20f4bd627a74 src/ChangeLog --- a/src/ChangeLog Mon May 08 21:03:46 2006 +0000 +++ b/src/ChangeLog Tue May 09 02:04:55 2006 +0000 @@ -1,5 +1,18 @@ 2006-05-08 John W. Eaton + * Makefile.in (DEFUN_PATTERN): Match DEFUNX_DLD. + * mkbuiltins: Handle XDEFUNX_DLD_INTERNAL. + * mkgendoc: Likewise. + * mk-pkg-add: Likewise. Do all the matching with sed. + * defun-int.h (DEFINE_FUNX_INSTALLER_FUN, DEFINE_FUNX_INSTALLER_FUN2, + DEFINE_FUNX_INSTALLER_FUN3): New macros. + (DEFINE_FUN_INSTALLER_FUN3): Define using DEFINE_FUNX_INSTALLER_FUN3. + (DEFUNX_DLD_INTERNAL): New macro. + * defun-dld.h (DEFUNX_DLD): New macro. + + * DLD-FUNCTIONS/__gnuplot_raw__.l: Mark __gnuplot_set__ as a + command, not a rawcommand. + * load-save.cc: No need to handle built-in variables. * help.cc (simple_help): No need to handle built-in variables. diff -r dd0422e4022c -r 20f4bd627a74 src/DLD-FUNCTIONS/__gnuplot_raw__.l --- a/src/DLD-FUNCTIONS/__gnuplot_raw__.l Mon May 08 21:03:46 2006 +0000 +++ b/src/DLD-FUNCTIONS/__gnuplot_raw__.l Tue May 09 02:04:55 2006 +0000 @@ -26,10 +26,10 @@ %{ // PKG_ADD: mark_as_rawcommand ("__gnuplot_plot__"); -// PKG_ADD: mark_as_rawcommand ("__gnuplot_set__"); // PKG_ADD: mark_as_rawcommand ("__gnuplot_splot__"); // PKG_ADD: mark_as_rawcommand ("__gnuplot_replot__"); +// PKG_ADD: mark_as_command ("__gnuplot_set__"); // PKG_ADD: mark_as_command ("__gnuplot_show__"); // PKG_ADD: atexit ("closeplot"); diff -r dd0422e4022c -r 20f4bd627a74 src/Makefile.in --- a/src/Makefile.in Mon May 08 21:03:46 2006 +0000 +++ b/src/Makefile.in Tue May 09 02:04:55 2006 +0000 @@ -212,7 +212,7 @@ # so we have to repeat ourselves because some stupid egreps don't like # empty elements in alternation patterns. -DEFUN_PATTERN = "^[ \t]*DEF(CONSTFUN|CMD|UN|UN_DLD|UN_TEXT|UN_MAPPER)[ \t]*\\(" +DEFUN_PATTERN = "^[ \t]*DEF(CONSTFUN|CMD|UN|UN_DLD|UNX_DLD|UN_TEXT|UN_MAPPER)[ \t]*\\(" DLD_DEF_FILES_1 := $(patsubst %.l, %.df, $(DLD_XSRC)) DLD_DEF_FILES := $(patsubst %.cc, %.df, $(DLD_DEF_FILES_1)) diff -r dd0422e4022c -r 20f4bd627a74 src/defun-dld.h --- a/src/defun-dld.h Mon May 08 21:03:46 2006 +0000 +++ b/src/defun-dld.h Tue May 09 02:04:55 2006 +0000 @@ -43,7 +43,15 @@ #if defined (MAKE_BUILTINS) #define DEFUN_DLD(name, args_name, nargout_name, doc) \ - DEFUN_DLD_INTERNAL (name, args_name, nargout_name, 0, doc) + DEFUN_DLD_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 convention is to use a prefix of "F", so "foo" becomes "Ffoo"). + +#define DEFUNX_DLD(name, fname, fsname, args_name, nargout_name, doc) \ + DEFUNX_DLD_INTERNAL (name, fname, args_name, nargout_name, false, doc) #else @@ -52,6 +60,11 @@ DEFINE_FUN_INSTALLER_FUN (name, doc) \ DECLARE_FUN (name, args_name, nargout_name) +#define DEFUNX_DLD(name, fname, fsname, args_name, nargout_name, doc) \ + DECLARE_FUNX (fname, args_name, nargout_name); \ + DEFINE_FUNX_INSTALLER_FUN (name, fname, fsname, doc) \ + DECLARE_FUNX (fname, args_name, nargout_name) + #endif #endif diff -r dd0422e4022c -r 20f4bd627a74 src/defun-int.h --- a/src/defun-int.h Mon May 08 21:03:46 2006 +0000 +++ b/src/defun-int.h Tue May 09 02:04:55 2006 +0000 @@ -75,12 +75,21 @@ DEFINE_FUN_INSTALLER_FUN3(name, doc, cxx_abi) #define DEFINE_FUN_INSTALLER_FUN3(name, doc, cxx_abi) \ + DEFINE_FUNX_INSTALLER_FUN3(#name, F ## name, FS ## name, doc, cxx_abi) + +#define DEFINE_FUNX_INSTALLER_FUN(name, fname, fsname, doc) \ + DEFINE_FUNX_INSTALLER_FUN2(name, fname, fsname, doc, CXX_ABI) + +#define DEFINE_FUNX_INSTALLER_FUN2(name, fname, fsname, doc, cxx_abi) \ + DEFINE_FUNX_INSTALLER_FUN3(name, fname, fsname, doc, cxx_abi) + +#define DEFINE_FUNX_INSTALLER_FUN3(name, fname, fsname, doc, cxx_abi) \ extern "C" \ bool \ - FS ## name ## _ ## cxx_abi (const octave_shlib& shl) \ + fsname ## _ ## cxx_abi (const octave_shlib& shl) \ { \ - check_version (OCTAVE_API_VERSION, #name); \ - install_dld_function (F ## name, #name, shl, doc); \ + check_version (OCTAVE_API_VERSION, name); \ + install_dld_function (fname, name, shl, doc); \ return error_state ? false : true; \ } @@ -119,6 +128,12 @@ XDEFUN_DLD_INTERNAL (name, args_name, nargout_name, is_text_fcn, doc) \ END_INSTALL_BUILTIN +#define DEFUNX_DLD_INTERNAL(name, fname, args_name, nargout_name, \ + is_text_fcn, doc) \ + BEGIN_INSTALL_BUILTIN \ + XDEFUNX_DLD_INTERNAL (name, fname, args_name, nargout_name, is_text_fcn, doc) \ + END_INSTALL_BUILTIN + // Generate code for making another name for an existing function. #define DEFALIAS_INTERNAL(alias, name) \ diff -r dd0422e4022c -r 20f4bd627a74 src/mk-pkg-add --- a/src/mk-pkg-add Mon May 08 21:03:46 2006 +0000 +++ b/src/mk-pkg-add Tue May 09 02:04:55 2006 +0000 @@ -8,8 +8,7 @@ ## Compute and print the autoloads. base=`basename $f | $SED 's/\.df$//'` - fcns=`grep '^ *XDEFUN_DLD_INTERNAL' $f |\ - $SED -e 's/XDEFUN_DLD_INTERNAL *( *//' -e 's/ *,.*$//' |\ + fcns=`$SED -n -e 's/XDEFUN\(X\|\)_DLD_INTERNAL *( *\("\|\)\([^", ]*\)[", ].*$/\3/p' $f | \ sort -u` if [ -n "$fcns" ]; then for n in $fcns; do diff -r dd0422e4022c -r 20f4bd627a74 src/mkbuiltins --- a/src/mkbuiltins Mon May 08 21:03:46 2006 +0000 +++ b/src/mkbuiltins Tue May 09 02:04:55 2006 +0000 @@ -30,10 +30,21 @@ #endif #if defined (ENABLE_DYNAMIC_LINKING) + #define XDEFUN_DLD_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) + +#define XDEFUNX_DLD_INTERNAL(name, fname, args_name, nargout_name, \ + is_text_fcn, doc) + #else + #define XDEFUN_DLD_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) \ XDEFUN_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) + +#define XDEFUNX_DLD_INTERNAL(name, fname, args_name, nargout_name, \ + is_text_fcn, doc) \ + XDEFUNX_INTERNAL(name, fname, args_name, nargout_name, is_text_fcn, doc) + #endif #define XDEFUN_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) \ diff -r dd0422e4022c -r 20f4bd627a74 src/mkgendoc --- a/src/mkgendoc Mon May 08 21:03:46 2006 +0000 +++ b/src/mkgendoc Tue May 09 02:04:55 2006 +0000 @@ -27,6 +27,10 @@ #define XDEFUN_DLD_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) \ print_doc_string (#name, doc); +#define XDEFUNX_DLD_INTERNAL(name, fname, args_name, nargout_name, \ + is_text_fcn, doc) \ + print_doc_string (name, doc); + #define XDEFUN_INTERNAL(name, args_name, nargout_name, is_text_fcn, doc) \ print_doc_string (#name, doc);