Mercurial > hg > xemacs-beta
comparison src/emodules.c @ 1750:7580e52a8218
[xemacs-hg @ 2003-10-15 03:09:02 by james]
Define module-load-path and module-extensions even when compiling without modulesupport.
author | james |
---|---|
date | Wed, 15 Oct 2003 03:09:03 +0000 |
parents | 5903b079bee1 |
children | 3fe1a35b705d |
comparison
equal
deleted
inserted
replaced
1749:c438060b26c6 | 1750:7580e52a8218 |
---|---|
19 Boston, MA 02111-1307, USA. */ | 19 Boston, MA 02111-1307, USA. */ |
20 | 20 |
21 #include "emodules.h" | 21 #include "emodules.h" |
22 #include "sysdll.h" | 22 #include "sysdll.h" |
23 | 23 |
24 /* Load path */ | |
25 static Lisp_Object Vmodule_load_path; | |
26 | |
27 /* Module lFile extensions */ | |
28 static Lisp_Object Vmodule_extensions; | |
29 | |
24 #ifdef HAVE_SHLIB | 30 #ifdef HAVE_SHLIB |
25 | 31 |
26 /* CE-Emacs version number */ | 32 /* CE-Emacs version number */ |
27 Lisp_Object Vmodule_version; | 33 Lisp_Object Vmodule_version; |
28 | 34 |
31 | 37 |
32 /* Set this while unloading a module. This should NOT be made set by users, | 38 /* Set this while unloading a module. This should NOT be made set by users, |
33 as it allows the unbinding of symbol-value-forward variables. */ | 39 as it allows the unbinding of symbol-value-forward variables. */ |
34 int unloading_module; | 40 int unloading_module; |
35 | 41 |
36 /* Load path */ | |
37 Lisp_Object Vmodule_load_path; | |
38 Lisp_Object Qdll_error; | 42 Lisp_Object Qdll_error; |
39 Lisp_Object Qmodule, Qunload_module, module_tag; | 43 Lisp_Object Qmodule, Qunload_module, module_tag; |
40 | 44 |
41 typedef struct _emodules_list | 45 typedef struct _emodules_list |
42 { | 46 { |
46 CIbyte *modver; /* The module version string */ | 50 CIbyte *modver; /* The module version string */ |
47 CIbyte *modtitle; /* How the module announces itself */ | 51 CIbyte *modtitle; /* How the module announces itself */ |
48 void (*unload)(void); /* Module cleanup function to run before unloading */ | 52 void (*unload)(void); /* Module cleanup function to run before unloading */ |
49 dll_handle dlhandle; /* Dynamic lib handle */ | 53 dll_handle dlhandle; /* Dynamic lib handle */ |
50 } emodules_list; | 54 } emodules_list; |
51 | |
52 static Lisp_Object Vmodule_extensions; | |
53 | 55 |
54 static int emodules_depth; | 56 static int emodules_depth; |
55 static dll_handle dlhandle; | 57 static dll_handle dlhandle; |
56 static emodules_list *modules; | 58 static emodules_list *modules; |
57 static int modnum; | 59 static int modnum; |
574 emodules_depth = 0; | 576 emodules_depth = 0; |
575 modules = NULL; | 577 modules = NULL; |
576 modnum = 0; | 578 modnum = 0; |
577 } | 579 } |
578 | 580 |
581 #endif /* HAVE_SHLIB */ | |
582 | |
579 void | 583 void |
580 vars_of_module (void) | 584 vars_of_module (void) |
581 { | 585 { |
586 #ifdef HAVE_SHLIB | |
587 Fprovide (intern ("modules")); | |
588 | |
582 reinit_vars_of_module (); | 589 reinit_vars_of_module (); |
583 | 590 |
584 DEFVAR_LISP ("module-version", &Vmodule_version /* | 591 DEFVAR_LISP ("module-version", &Vmodule_version /* |
585 Emacs dynamic loading mechanism version, as a string. | 592 Emacs dynamic loading mechanism version, as a string. |
586 | 593 |
600 is loaded correctly. Setting this variable to `t' will suppress these | 607 is loaded correctly. Setting this variable to `t' will suppress these |
601 messages. This would normally only be done if `load-module' was being | 608 messages. This would normally only be done if `load-module' was being |
602 called by a Lisp function. | 609 called by a Lisp function. |
603 */); | 610 */); |
604 load_modules_quietly = 0; | 611 load_modules_quietly = 0; |
612 | |
613 DEFVAR_BOOL ("unloading-module", &unloading_module /* | |
614 Used internally by `unload-feature'. Do not set this variable. | |
615 Danger, danger, Will Robinson! | |
616 */); | |
617 unloading_module = 0; | |
618 | |
619 #endif /* HAVE_SHLIB */ | |
605 | 620 |
606 DEFVAR_LISP ("module-load-path", &Vmodule_load_path /* | 621 DEFVAR_LISP ("module-load-path", &Vmodule_load_path /* |
607 *List of directories to search for dynamic modules to load. | 622 *List of directories to search for dynamic modules to load. |
608 Each element is a string (directory name) or nil (try default directory). | 623 Each element is a string (directory name) or nil (try default directory). |
609 | 624 |
623 the correctness of a dynamic module, which can have unpredictable results | 638 the correctness of a dynamic module, which can have unpredictable results |
624 when a dynamic module is loaded. | 639 when a dynamic module is loaded. |
625 */); | 640 */); |
626 Vmodule_load_path = Qnil; | 641 Vmodule_load_path = Qnil; |
627 | 642 |
628 DEFVAR_BOOL ("unloading-module", &unloading_module /* | |
629 Used internally by `unload-feature'. Do not set this variable. | |
630 Danger, danger, Will Robinson! | |
631 */); | |
632 unloading_module = 0; | |
633 | |
634 DEFVAR_LISP ("module-extensions", &Vmodule_extensions /* | 643 DEFVAR_LISP ("module-extensions", &Vmodule_extensions /* |
635 *List of filename extensions to use when searching for dynamic modules. | 644 *List of filename extensions to use when searching for dynamic modules. |
636 */); | 645 */); |
637 Vmodule_extensions = list5 (build_string (".ell"), | 646 Vmodule_extensions = list5 (build_string (".ell"), |
638 build_string (".so"), | 647 build_string (".so"), |
639 build_string (".dll"), | 648 build_string (".dll"), |
640 build_string (".dylib"), | 649 build_string (".dylib"), |
641 build_string ("")); | 650 build_string ("")); |
642 | 651 } |
643 Fprovide (intern ("modules")); | |
644 } | |
645 | |
646 #endif /* HAVE_SHLIB */ |