swig/Lib/octave
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
..
attribute.i Initial commit of Octave module. 2008-03-01 23:35:44 +00:00
boost_shared_ptr.i shared_ptr improvements so the proxy class does not need to be specified - SWIG_SHARED_PTR macro deprecated and replaced by %shared_ptr 2010-05-22 23:57:19 +00:00
carrays.i Octave: fix carrays regression caused by operator suffix change. 2009-01-10 02:17:58 +00:00
cdata.i Initial commit of Octave module. 2008-03-01 23:35:44 +00:00
cmalloc.i Initial commit of Octave module. 2008-03-01 23:35:44 +00:00
director.swg Initial commit of Octave module. 2008-03-01 23:35:44 +00:00
exception.i Initial commit of Octave module. 2008-03-01 23:35:44 +00:00
factory.i Initial commit of Octave module. 2008-03-01 23:35:44 +00:00
implicit.i Initial commit of Octave module. 2008-03-01 23:35:44 +00:00
octave.swg Add support for manual %docstrings, so users can provide texinfo help for wrapped functions. 2008-04-03 13:22:19 +00:00
octcomplex.swg Fixes to two bugs in Lib/octave/octcomplex.swg (by Karl Wette) 2011-05-17 01:57:46 +00:00
octcontainer.swg Fix typo "the the" -> "the" 2010-10-19 06:31:31 +00:00
octfragments.swg Initial commit of Octave module. 2008-03-01 23:35:44 +00:00
octiterators.swg SWIG license change - The Examples and Lib move to a very permissive license in the LICENSE file, removing the BSD license restrictions as agreed by committers since it was inadvertently introduced. Remove some examples where the impact of the license change is not clear. 2010-02-27 23:26:02 +00:00
octopers.swg Octave: add {save,load}_{ascii,binary,hdf} functions that silently do nothing; 2009-01-10 00:20:46 +00:00
octprimtypes.swg Add test for null pointer handling ([] taken as null pointer). 2008-04-20 14:29:46 +00:00
octrun.swg Allow global operators to be SWIG-wrapped functions (by Karl Wette) 2011-05-17 02:02:15 +00:00
octruntime.swg Allow global operators to be SWIG-wrapped functions (by Karl Wette) 2011-05-17 02:02:15 +00:00
octstdcommon.swg UTL - Fix some incorrect acceptance of types in the STL, eg a double * element passed into a vector<int *> constructor would be accepted, but the ensuing behaviour was undefined. Now the type conversion correctly raises an exception 2008-11-28 23:35:46 +00:00
octtypemaps.swg Fix an incompatibility with never versions of Octave (by Karl Wette) 2011-05-17 01:59:53 +00:00
octuserdir.swg Fix ~15 tests, minor doc fixes, improve STL support. 2008-03-05 04:35:34 +00:00
std_alloc.i Initial commit of Octave module. 2008-03-01 23:35:44 +00:00
std_basic_string.i Some octave SWIG test-suite warning fixes 2010-05-10 17:58:06 +00:00
std_carray.i Commited SF#2158938: change all SWIG symbols start with Py to a new name. 2008-12-03 18:43:44 +00:00
std_char_traits.i Initial commit of Octave module. 2008-03-01 23:35:44 +00:00
std_common.i Initial commit of Octave module. 2008-03-01 23:35:44 +00:00
std_complex.i Initial commit of Octave module. 2008-03-01 23:35:44 +00:00
std_container.i Initial commit of Octave module. 2008-03-01 23:35:44 +00:00
std_deque.i Initial commit of Octave module. 2008-03-01 23:35:44 +00:00
std_except.i Initial commit of Octave module. 2008-03-01 23:35:44 +00:00
std_map.i Fix compile errors in Octave std::map wrappers. Remove li_std_map_runme.oct which looks like Python code 2010-05-10 18:21:34 +00:00
std_pair.i Initial commit of Octave module. 2008-03-01 23:35:44 +00:00
std_string.i Initial commit of Octave module. 2008-03-01 23:35:44 +00:00
std_vector.i Fix ~15 tests, minor doc fixes, improve STL support. 2008-03-05 04:35:34 +00:00
stl.i Initial commit of Octave module. 2008-03-01 23:35:44 +00:00
typemaps.i Initial commit of Octave module. 2008-03-01 23:35:44 +00:00