1.1 An example of how to interface a foreign function

The following example shows how to use the FLI to call a C function. The function to interface with, FarenheitToCelsius , takes one integer as its argument (the temperature in Farenheit) and returns the result as a single float (the temperature in Celsius).

The example consists of three stages: defining a foreign language interface to the C function, loading the foreign code into the Lisp image, and calling the C function to obtain the results.

1.1.1 Defining the FLI function

1.1.2 Loading foreign code

1.1.3 Calling foreign code

LispWorks Foreign Language Interface User Guide and Reference Manual - 27 Mar 2005