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 |
||
|---|---|---|
| .. | ||
| allegrocl.cxx | ||
| allocate.cxx | ||
| browser.cxx | ||
| cffi.cxx | ||
| chicken.cxx | ||
| clisp.cxx | ||
| contract.cxx | ||
| csharp.cxx | ||
| d.cxx | ||
| directors.cxx | ||
| emit.cxx | ||
| go.cxx | ||
| guile.cxx | ||
| java.cxx | ||
| lang.cxx | ||
| lua.cxx | ||
| main.cxx | ||
| modula3.cxx | ||
| module.cxx | ||
| mzscheme.cxx | ||
| ocaml.cxx | ||
| octave.cxx | ||
| overload.cxx | ||
| perl5.cxx | ||
| php.cxx | ||
| pike.cxx | ||
| python.cxx | ||
| r.cxx | ||
| README | ||
| ruby.cxx | ||
| s-exp.cxx | ||
| swigmain.cxx | ||
| swigmod.h | ||
| tcl8.cxx | ||
| typepass.cxx | ||
| uffi.cxx | ||
| utils.cxx | ||
| xml.cxx | ||
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