Package: cffi

Macro define-c-struct-wrapper

Lambda List

define-c-struct-wrapper (class-and-type supers &optional slots)


Define a new class with CLOS slots matching those of a foreign struct type. An INITIALIZE-INSTANCE method is defined which takes a :POINTER initarg that is used to store the slots of a foreign object. This pointer is only used for initialization and it is not retained.

CLASS-AND-TYPE is either a list of the form (class-name struct-type) or a single symbol naming both. The class will inherit SUPERS. If a list of SLOTS is specified, only thoseslots will be defined and stored.