comparison src/emodules.c @ 424:11054d720c21 r21-2-20

Import from CVS: tag r21-2-20
author cvs
date Mon, 13 Aug 2007 11:26:11 +0200
parents 697ef44129c6
children
comparison
equal deleted inserted replaced
423:28d9c139be4c 424:11054d720c21
213 * not previously loaded. 213 * not previously loaded.
214 */ 214 */
215 if (modules == (emodules_list *)0) 215 if (modules == (emodules_list *)0)
216 modules = (emodules_list *)xmalloc (sizeof(emodules_list)); 216 modules = (emodules_list *)xmalloc (sizeof(emodules_list));
217 modnum++; 217 modnum++;
218 modules = xrealloc (modules, modnum * sizeof(emodules_list)); 218 modules = (emodules_list *) xrealloc (modules, modnum * sizeof(emodules_list));
219 219
220 fs = modnum - 1; 220 fs = modnum - 1;
221 memset (&modules[fs], 0, sizeof(emodules_list)); 221 memset (&modules[fs], 0, sizeof(emodules_list));
222 return fs; 222 return fs;
223 } 223 }
524 DEFSUBR(Funload_module); 524 DEFSUBR(Funload_module);
525 #endif 525 #endif
526 } 526 }
527 527
528 void 528 void
529 reinit_vars_of_module (void)
530 {
531 emodules_depth = 0;
532 modules = (emodules_list *)0;
533 modnum = 0;
534 }
535
536 void
529 vars_of_module (void) 537 vars_of_module (void)
530 { 538 {
539 reinit_vars_of_module ();
540
531 DEFVAR_LISP ("module-version", &Vmodule_version /* 541 DEFVAR_LISP ("module-version", &Vmodule_version /*
532 Emacs dynamic loading mechanism version, as a string. 542 Emacs dynamic loading mechanism version, as a string.
533 543
534 This string is in the form XX.YY.ppp, where XX is the major version 544 This string is in the form XX.YY.ppp, where XX is the major version
535 number, YY is the minor version number, and ppp is the patch level. 545 number, YY is the minor version number, and ppp is the patch level.
536 This variable can be used to distinquish between different versions of 546 This variable can be used to distinquish between different versions of
537 the dynamic loading technology used in Emacs, if required. It is not 547 the dynamic loading technology used in Emacs, if required. It is not
538 a given that this value will be the same as the Emacs version number. 548 a given that this value will be the same as the Emacs version number.
539 */ ); 549 */ );
540 Vmodule_version = Fpurecopy (build_string (EMODULES_VERSION)); 550 Vmodule_version = build_string (EMODULES_VERSION);
541 551
542 DEFVAR_BOOL ("load-modules-quietly", &load_modules_quietly /* 552 DEFVAR_BOOL ("load-modules-quietly", &load_modules_quietly /*
543 *Set to t if module loading is to be silent. 553 *Set to t if module loading is to be silent.
544 554
545 Normally, when loading dynamic modules, Emacs will inform you of its 555 Normally, when loading dynamic modules, Emacs will inform you of its
573 /* #### Export this to Lisp */ 583 /* #### Export this to Lisp */
574 Vmodule_extensions = build_string (":.ell:.so:.dll"); 584 Vmodule_extensions = build_string (":.ell:.so:.dll");
575 staticpro (&Vmodule_extensions); 585 staticpro (&Vmodule_extensions);
576 586
577 load_modules_quietly = 0; 587 load_modules_quietly = 0;
578 emodules_depth = 0;
579 modules = (emodules_list *)0;
580 modnum = 0;
581 Vmodule_load_path = Qnil; 588 Vmodule_load_path = Qnil;
582 Fprovide (intern ("modules")); 589 Fprovide (intern ("modules"));
583 } 590 }
584 591
585 #endif /* HAVE_SHLIB */ 592 #endif /* HAVE_SHLIB */