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. If this parameter denotes a pathname without a directory component then most of the supported Lisp implementations will be able to find the library themselves if it is located in one of the standard locations as defined by the underlying operating system.

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,

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

An error will be signaled if the library is unable to be loaded.