1 /* -----------------------------------------------------------------------------
2 * See the LICENSE file for information on copyright, usage and redistribution
3 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
7 * This file is responsible for the module system.
8 * ----------------------------------------------------------------------------- */
10 char cvsroot_module_cxx[] = "$Id: module.cxx 10003 2007-10-17 21:42:11Z wsfulton $";
18 Module(const char *n, ModuleFactory f) {
20 name = new char[strlen(n) + 1];
28 static Module *modules = 0;
30 /* -----------------------------------------------------------------------------
31 * void Swig_register_module()
34 * ----------------------------------------------------------------------------- */
36 void Swig_register_module(const char *n, ModuleFactory f) {
37 Module *m = new Module(n, f);
42 /* -----------------------------------------------------------------------------
43 * Language *Swig_find_module()
45 * Given a command line option, locates the factory function.
46 * ----------------------------------------------------------------------------- */
48 ModuleFactory Swig_find_module(const char *name) {
51 if (strcmp(m->name, name) == 0) {