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 |
||
|---|---|---|
| .. | ||
| CParse | ||
| DOH | ||
| Include | ||
| Modules | ||
| Preprocessor | ||
| Swig | ||
| Makefile.am | ||
| README | ||
SWIG Source directory
Source/DOH - A core set of basic datatypes including
strings, lists, hashes, and files. Used
extensively by the rest of SWIG.
Source/Swig - Swig core. Type-system, utility functions.
Source/Preprocessor - SWIG C Preprocessor
Source/CParse - SWIG C Parser (still messy)
Source/Modules - Language modules.
Source/Include - Include files.
Historic directories which may be in CVS, but have been removed:
Source/Modules1.1 - Old SWIG-1.1 modules. Empty.
Source/LParse - Experimental parser. Officially dead
as CParse is more capable.
Source/SWIG1.1 - Old SWIG1.1 core. Completely empty now.