4.1 The Foreign Function Interface

4.1.1 Defining and calling foreign functions

The following constructs allow you to define functions that can be used in the Foreign Function Interface:

def-foreign-callable
def-foreign-function
*lisp-symbol-to-foreign-string-method*

The macro def-foreign-function defines a Lisp function that calls a foreign function. Lisp arguments are converted to the appropriate foreign data type before the foreign function call The value returned by the foreign function is then converted to a Lisp data type.

The macro def-foreign-callable defines a Lisp function that can be called from foreign code. The foreign arguments are converted to Lisp data types; the value returned by the function is coerced to a foreign data type and returned to the caller.

The variable*lisp-symbol-to-foreign-string-method* names a function that can be invoked to compute a name for a foreign function not named in its original definition.

You should consider the following information about declarations when you usedef-foreign-function anddef-foreign-callable to create new functions:

4.1.1.1 - Avoiding SIGALRM signals
4.1.1.2 - Examples

The Advanced User's Guide - 9 SEP 1996

Generated with Harlequin WebMaker