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 |
||
|---|---|---|
| .. | ||
| 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