Defines FLI type specifiers corresponding to type specifiers defined using the C typedef
command.
define-c-typedef name-and-options type-description => name
A symbol naming the new FLI type
A string specifying the foreign name of the type
A symbol or list defining the new type
The define-c-typedef
macro is used to define FLI type specifiers, which corresponds to those defined using the C function typedef
. It is a convenience function, as types can also be defined using define-foreign-type.
In the following example three types are defined using the FLI function define-c-typedef
, and the corresponding C definitions are then given.
(fli:define-c-typedef intptr (:pointer :int))
(fli:define-c-typedef bar (:struct (one :int)))
These are the corresponding C typedef
definitions:
typedef int *intptr;
typedef struct (int one;) bar;
LispWorks Foreign Language Interface User Guide and Reference Manual - 16 Feb 2015