The macro
define-foreign-block-callable-type
defines a type for foreign blocks.
name specifies the name of the type. It must not be the same as the name of a define-foreign-callable.
result-type specifies the type of the result of the foreign block.
arg-types specifies the types of the arguments that a block of type name takes. These must correspond to the arguments types with which the block is called from the foreign call.
Note that the arg-types specify the type for a call from foreign code into Lisp, which affects the way :reference-return and :reference-pass are used. If the block is called from the foreign code with a pointer and you want to treat it as pass-by-reference, you need to use :reference-return (like define-foreign-callable does). See the qsort_b example in
(sys:example-file "misc/foreign-blocks.lisp").
allocate-foreign-block
with-foreign-block
with-local-foreign-block
Block objects in C (foreign blocks)
LispWorks Foreign Language Interface User Guide and Reference Manual - 7 Dec 2011