|
20.1.1 Initialising the Module Loader
Before using this code (or any other libltdl based module loader
for that matter), a certain amount of initialisation is required:
-
libltdl itself requires initialisation.
-
libltdl should be told to use the same memory allocation routines
used by the rest of Sic.
-
Any preloaded modules (see section 18.4 dlpreopen Loading) need to be initialised
with
LTDL_SET_PRELOADED_SYMBOLS() .
-
ltdl_init() must be called.
-
The module search path needs to be set. Here I allow the installer to
specify a default search path to correspond with the installed Sic
modules at compile time, but search the directories in the runtime
environment variable `SIC_MODULES_PATH' first.
-
The internal error handling needs to be initialised.
Here is the start of the module loader, `sic/module.c', including
the initialisation code for libltdl:
|