Next Previous Up Top Contents Index

5 Function and Macro Reference

foreign-slot-offset

Function

Summary

Returns the offset of a slot in an FLI object.
Package

fli

Signature

foreign-slot-offset object slot-name => offset

Arguments

object

A pointer to a foreign object or a foreign object.

slot-name

The name of a slot in object.

Values

offset

The offset, in bytes, of the slot slot-name in the FLI object object.

Description

The functionforeign-slot-offset returns the offset, in bytes, of a slot in an FLI object. The offset is the number of bytes from the beginning of the object to the start of the slot. For example, the offset of the first slot in any FLI object is 0.
Example

The following example defines a structure, creates an instance of the structure pointed to bydir, and then finds the offset of the third slot in the object.
(fli:define-c-struct COMPASS
  (east :int)
  (west (:c-array :char 20))
  (north :int)
  (south :int))

(setq dir (fli:allocate-foreign-object :type 'COMPASS))

(fli:foreign-slot-offset dir 'north)

See Also

foreign-slot-value
size-of

LispWorks Foreign Language Interface - 12 Oct 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker