[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.19.2 Load dynamic library

Function: dynamic-load file &keyword init-function export-symbols
Loads and links a dynamic loadable library (shared library) file. File shouldn't contain the suffix (".so" on most systems); dynamic-load adds it, for it may differ among platforms.

The keyword argument init-function specifies the initialization function name of the library in a string. By default, if the file basename (without extension) is "foo", the initialization function name is "Scm_Init_foo".

The keyword argument export-symbols tells whether the dynamic loader that the external symbols in file should be appended to the symbol table of the running process. (Note: I'm talking about C function and variable names, not Scheme symbols). By default, the symbols in file are not visible from other dynamically loaded libraries. If you want to allow other dynamically loaded libraries to call C function in your library, you should give #t to this argument. It sets RTLD_GLOBAL flag for dlopen().

Usually a dynamic loadable library is provided with wrapping Scheme module, so the user doesn't have to call this function directly.

There's no way to unload the loaded libraries.



This document was generated by Ken Dickey on November, 28 2002 using texi2html