Name

load-foreign-library — Loads a foreign library.

Function

Syntax

	  load-foreign-library filename &key module supporting-libraries force-load => success

Arguments and Values

filename

A string or pathname specifying the library location in the filesystem. At least one implementation (Lispworks) can not accept a logical pathname.

module

A string designating the name of the module to apply to functions in this library. (Required for Lispworks)

supporting-libraries

A list of strings naming the libraries required to link the foreign library. (Required by CMUCL)

force-load

Forces the loading of the library if it has been previously loaded.

success

A boolean flag, T if the library was able to be loaded successfully or if the library has been previously loaded, otherwise NIL.

Description

Loads a foreign library. Applies a module name to functions within the library. Ensures that a library is only loaded once during a session. A library can be reloaded by using the :force-load key.

Examples

  (load-foreign-library #p"/usr/lib/libmysqlclient.so" 
                        :module "mysql" 
                        :supporting-libraries '("c"))
    => T
	

Side Effects

Loads the foreign code into the Lisp system.

Affected by

Ability to load the file.

Exceptional Situations

None.