Function | Package: ff | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version

## register-foreign-callable

Arguments: name &optional index-or-reuse convert-to-c-types

The name argument must be a symbol defined with defun-foreign-callable.

The index-or-reuse argument can be a fixnum to select a specific table entry to replace, or the symbol `:reuse` to specify that if a function with the same name is already registered, the function will be replaced at the same index.

If convert-to-c-types is specified, then an attempt will be made to convert the return value to a foreign value, otherwise the return value is returned unchanged. It is important to note that though the default is `nil`, most often the desired effect is obtained by setting this option to `t`. The default of `nil` is retained for compatibility reasons. This is described in a little more detail in the description of defun-foreign-callable.

This function returns 5 values:

- an integer address which can be passed to C and used as the address of the function. This address is valid even after a gc and after a dumplisp and so is always be valid; see Calling Lisp functions from C: lisp_call_address() and lisp_call() in foreign-functions.htm for further information.
- a table-index value
- the previous table entry
- a fixnum representing the calling convention
- the number of bytes of stack space needed for this function's arguments

In versions using the :os-threads model of multiprocessing, the callback from foreign code to the foreign-callable function name may be made from a thread started outside Lisp. This is not supported in a version of Lisp using the non :os-threads model of multiprocessing. trying it will likely cause Lisp to fail. See Foreign functions and multiprocessing in foreign-functions.htm.

See ftype.htm for information on foreign types in Allegro CL and foreign-functions.htm for general information on foreign functions in Allegro CL.

Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version