read-foreign-modules reads object files of various formats into the Lisp image. Unresolved references are resolved wherever possible and the names of the foreign functions are made available to the Lisp for direct calling from the Lisp if desired. With no argument,
read-foreign-modules scans the default libraries looking for definitions of referenced but undefined symbols.
The module-names argument is a sequence of items representing object files to be loaded. The items may be of type string or pathname, and will be used to look up a corresponding file in the file system. The only exception is if an item is a string beginning ``
-l'' in which case the rest of the string is used to look up a library file using format strings
constructed from the values of the variable
*default-library-name-search-paths*, the environment variable
LD_LIBRARY_PATH and the variable
*default-library-names*. Object files of various formats and library files can be handled by
read-foreign-modules actually adds the module-names to the list of modules in the variable
*default-libraries* and then tries to resolve any undefined symbols using this list. The function get-foreign-symbol may be called to explicitly force a symbol onto the undefined list or the act of defining a foreign function (
fli:define-foreign-function) will do it implicitly.
A warning of any new unresolved references will be printed out after the reading has finished if the flag
*unresolved-messages* is set to
t (the default is nil). By default messages are printed out about which object modules are being loaded. This may be switched off by setting
LispWorks User Guide and Reference Manual - 13 Feb 2015