It's currently not possible to tell SWIG whether or not symbols should be loaded into the global namespace by default. In fact, it's not even possible to make the generated .oct module *not* load all symbols globally, due to a bug in Lib/octave/octruntime.swg (line 37: "noglobal" should be "global"). It's also not possible to change the name of the symbol used to access global variables/constants from the default "cvar". This patch adds 3 Octave-specific command-line options: * -global/-noglobal tell SWIG whether the generated .oct module should load symbols into the global namespace by default. The default option is -global to preserve existing behaviour. * -globals <name> sets the name of the symbol used to access global variables/constants. It is set to "cvar" by default. These options are parsed in Source/Modules/octave.cxx, and written to the wrapping code as the macros SWIG_global_load and SWIG_global_name. In Lib/octave/octruntime.swg, the Octave entry point DEFUN_DLD function now contains a expanded input argument parser, which uses the same command-line arguments (-global/-noglobal, -globals) as can be passed to SWIG itself; this allows the module user to change the default loading behaviour of the module user at load time. The parser checks for non-string and unrecognised arguments, and also checks that the argument to -globals is a valid Octave identifier. A -help option prints a short usage message. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12670 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.