Package: cffi

Function foreign-slot-offset

Lambda List

foreign-slot-offset (type slot-name)

Arguments

type -- A foreign struct type.
slot-name -- A symbol.
offset -- An integer.

Details

The function foreign-slot-offset returns the offset in bytes of a slot in a foreign struct type.

Examples
  (defcstruct timeval
    (tv-secs :long)
    (tv-usecs :long))

CFFI> (foreign-slot-offset 'timeval 'tv-secs) => 0 CFFI> (foreign-slot-offset 'timeval 'tv-usecs) => 4
 

See also