All Manuals > Foreign Language Interface User Guide and Reference Manual > 7 Function, Macro and Variable Reference

define-foreign-block-callable-type Macro

Summary

Defines a type for foreign blocks, in LispWorks for Macintosh.

Package

fli

Signature

define-foreign-block-callable-type name result-type arg-types => name

Arguments
name
A symbol.
result-type
A foreign type specifier.
arg-types
A list of foreign type specifiers.
Values
name
Symbol.
Description

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 arg-types specifies the types 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:

(example-edit-file "fli/foreign-blocks")

define-foreign-block-callable-type returns name.

Notes

define-foreign-block-callable-type is implemented in LispWorks for Macintosh only.

See also

allocate-foreign-block
with-foreign-block
with-local-foreign-block
5.7 Block objects in C (foreign blocks)


Foreign Language Interface User Guide and Reference Manual - 01 Dec 2021 19:34:58