swig/Source/Modules
Xavier Delacour 06221dacae Allow global operators to be SWIG-wrapped functions (by Karl Wette)
The Octave run-time allows global operators to be implemented,
e.g. op_scalar_add_X for adding a scalar and a wrapped struct X.
However it doesn't currently seem possible for these operators to
map to SWIG-wrapped functions. This is because dispatch_global_op()
looks for the operators to be installed as global variables, whereas
install_global() installs SWIG-wrapped functions as builtin functions;
the two appear to be separate symbol tables in Octave.

This patch modifies install_global() to install global operator functions
as both builtin functions and as global variables, where the value of the
global variable is a function handle to the operator function. It decides
if a function is a global operator if it begins with the prefix "op_"; this
prefix can be modified through a new command-line variable. It also always
installs the operators globally, regardless of whether the rest of the module
is being loaded globally. To accomplish this, install_global() is now always
called, but takes a bool argument specifying whether it should load symbols
globally. If a function is not a global operator, install_global() should
behave as before.

Tested that this compiles and works on Octave 3.2.4 and 3.4.0.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12675 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-17 02:02:15 +00:00
..
allegrocl.cxx Remove redundant code highlighted by warnings in gcc-4.6 2011-03-14 07:22:08 +00:00
allocate.cxx Remove redundant code highlighted by warnings in gcc-4.6 2011-03-14 07:22:08 +00:00
browser.cxx SWIG license change - Source moves to GPLv3 2010-02-27 23:53:33 +00:00
cffi.cxx Better consistency in usage display 2011-03-09 21:42:38 +00:00
chicken.cxx Fix for a few affected target languages since last commit changed the way enum values that are type char are handled. 2011-03-26 23:25:14 +00:00
clisp.cxx Better consistency in usage display 2011-03-09 21:42:38 +00:00
contract.cxx SWIG license change - Source moves to GPLv3 2010-02-27 23:53:33 +00:00
csharp.cxx SF bug #3195112 - fix wrapping of enums that are type char 2011-03-26 15:28:31 +00:00
d.cxx [D] nspace: Correctly generate identifiers for base classes when 2011-04-23 13:34:08 +00:00
directors.cxx SWIG license change - Source moves to GPLv3 2010-02-27 23:53:33 +00:00
emit.cxx Remove redundant code highlighted by warnings in gcc-4.6 2011-03-14 07:22:08 +00:00
go.cxx Initialize a couple of members accidentally left uninitialized. 2011-04-30 06:02:28 +00:00
guile.cxx Fix for a few affected target languages since last commit changed the way enum values that are type char are handled. 2011-03-26 23:25:14 +00:00
java.cxx SF bug #3195112 - fix wrapping of enums that are type char 2011-03-26 15:28:31 +00:00
lang.cxx Add in missing wrappers for friend functions for some target languages 2011-04-01 23:06:40 +00:00
lua.cxx [Lua, Python, Tcl] C/C++ prototypes shown in error message when calling an overloaded method with incorrect arguments improved to show always show fully qualified name and if a const method. Also fixed other Lua error messages in generated code which weren't consistently using the fully qualified C++ name. 2011-05-05 06:23:02 +00:00
main.cxx Remove redundant code highlighted by warnings in gcc-4.6 2011-03-14 07:22:08 +00:00
modula3.cxx Better consistency in usage display 2011-03-09 21:42:38 +00:00
module.cxx SWIG license change - Source moves to GPLv3 2010-02-27 23:53:33 +00:00
mzscheme.cxx Fix for a few affected target languages since last commit changed the way enum values that are type char are handled. 2011-03-26 23:25:14 +00:00
ocaml.cxx Fix for a few affected target languages since last commit changed the way enum values that are type char are handled. 2011-03-26 23:25:14 +00:00
octave.cxx Allow global operators to be SWIG-wrapped functions (by Karl Wette) 2011-05-17 02:02:15 +00:00
overload.cxx Fix partial overloading warning messages appearing 2011-03-11 22:36:59 +00:00
perl5.cxx Better consistency in usage display 2011-03-09 21:42:38 +00:00
php.cxx [PHP] Fix handling of overloaded methods/functions where some 2011-03-14 12:33:56 +00:00
pike.cxx Fix for a few affected target languages since last commit changed the way enum values that are type char are handled. 2011-03-26 23:25:14 +00:00
python.cxx [Lua, Python, Tcl] C/C++ prototypes shown in error message when calling an overloaded method with incorrect arguments improved to show always show fully qualified name and if a const method. Also fixed other Lua error messages in generated code which weren't consistently using the fully qualified C++ name. 2011-05-05 06:23:02 +00:00
r.cxx Remove redundant code highlighted by warnings in gcc-4.6 2011-03-14 07:22:08 +00:00
README File move 2002-12-03 20:33:35 +00:00
ruby.cxx Remove redundant code highlighted by warnings in gcc-4.6 2011-03-14 07:22:08 +00:00
s-exp.cxx SWIG license change - Source moves to GPLv3 2010-02-27 23:53:33 +00:00
swigmain.cxx Added support for the D programming languge. 2010-11-18 00:24:02 +00:00
swigmod.h constify SwigType * in many places 2010-12-15 21:55:08 +00:00
tcl8.cxx [Lua, Python, Tcl] C/C++ prototypes shown in error message when calling an overloaded method with incorrect arguments improved to show always show fully qualified name and if a const method. Also fixed other Lua error messages in generated code which weren't consistently using the fully qualified C++ name. 2011-05-05 06:23:02 +00:00
typepass.cxx Remove redundant code highlighted by warnings in gcc-4.6 2011-03-14 07:22:08 +00:00
uffi.cxx Remove redundant code highlighted by warnings in gcc-4.6 2011-03-14 07:22:08 +00:00
utils.cxx Cosmetic - comments added 2011-05-05 06:09:55 +00:00
xml.cxx SWIG license change - Source moves to GPLv3 2010-02-27 23:53:33 +00:00

06/25/2002

This directory contains all of the SWIG language modules.  Many of these
modules contain code that dates back to SWIG1.0.  The module API has changed
a lot in the development releases so this is fairly messy.  We're working on
cleaning it up, but you'll have to bear with us until it's done.

-- Dave