(insert-char-data): Don't output mojikyo-pj-*.
[chise/xemacs-chise.git-] / src / emodules.c
index 1a5d896..3f33e0a 100644 (file)
@@ -42,6 +42,8 @@ typedef struct _emodules_list
   dll_handle dlhandle;  /* Dynamic lib handle                           */
 } emodules_list;
 
+static Lisp_Object Vmodule_extensions;
+
 static int emodules_depth;
 static dll_handle dlhandle;
 static emodules_list *modules;
@@ -213,7 +215,7 @@ find_make_module (CONST char *mod, CONST char *name, CONST char *ver, int mof)
   if (modules == (emodules_list *)0)
     modules = (emodules_list *)xmalloc (sizeof(emodules_list));
   modnum++;
-  modules = xrealloc (modules, modnum * sizeof(emodules_list));
+  modules = (emodules_list *) xrealloc (modules, modnum * sizeof(emodules_list));
 
   fs = modnum - 1;
   memset (&modules[fs], 0, sizeof(emodules_list));
@@ -334,7 +336,8 @@ emodules_load(CONST char *module, CONST char *modname, CONST char *modver)
 
   GCPRO2(filename, foundname);
   filename = build_string (tmod);
-  fd = locate_file(Vmodule_load_path, filename, ":.ell:.so:.dll", &foundname, -1);
+  fd = locate_file(Vmodule_load_path, filename, Vmodule_extensions,
+                  &foundname, -1);
   UNGCPRO;
 
   if (fd < 0)
@@ -523,8 +526,18 @@ syms_of_module (void)
 }
 
 void
+reinit_vars_of_module (void)
+{
+  emodules_depth = 0;
+  modules = (emodules_list *)0;
+  modnum = 0;
+}
+
+void
 vars_of_module (void)
 {
+  reinit_vars_of_module ();
+
   DEFVAR_LISP ("module-version", &Vmodule_version /*
 Emacs dynamic loading mechanism version, as a string.
 
@@ -534,7 +547,7 @@ This variable can be used to distinquish between different versions of
 the dynamic loading technology used in Emacs, if required.  It is not
 a given that this value will be the same as the Emacs version number.
 */ );
-  Vmodule_version = Fpurecopy (build_string (EMODULES_VERSION));
+  Vmodule_version = build_string (EMODULES_VERSION);
 
   DEFVAR_BOOL ("load-modules-quietly", &load_modules_quietly /*
 *Set to t if module loading is to be silent.
@@ -567,10 +580,11 @@ the correctness of a dynamic module, which can have unpredictable results
 when a dynamic module is loaded.
 */);
 
+  /* #### Export this to Lisp */
+  Vmodule_extensions = build_string (":.ell:.so:.dll");
+  staticpro (&Vmodule_extensions);
+
   load_modules_quietly = 0;
-  emodules_depth = 0;
-  modules = (emodules_list *)0;
-  modnum = 0;
   Vmodule_load_path = Qnil;
   Fprovide (intern ("modules"));
 }