Package: cffi
Function foreign-slot-value
Lambda Listforeign-slot-value (ptr type slot-name) Argumentsptr -- A pointer to a structure. type -- A foreign structure type. slot-name}{A symbol naming a slot in the structure type.} @argument[object -- The object contained in the slot specified by slot-name. Details For simple slots, foreign-slot-value returns the value of the
object, such as a Lisp integer or pointer. In C, this would be expressed as ptr->slot. For aggregate slots, a pointer inside the structure to the beginning of the slot's data is returned. In C, this would be expressed as &ptr->slot. This pointer and the memory it points to have the same extent as ptr. There are compiler macros for foreign-slot-value and its setf expansion that open code the memory access when type and slot-names are constant at compile-time. Examples(defcstruct point "Pointer structure." (x :int) (y :int)) | See also |