All Manuals > Foreign Language Interface User Guide and Reference Manual > 7 Function, Macro and Variable Reference

foreign-slot-names Function

Summary

Returns a list of the slot names in a foreign structure.

Package

fli

Signature

foreign-slot-names object => slot-names

Arguments
object
A foreign object or a pointer to a foreign object.
Values
slot-names
A list containing the slot names of object.
Description

The function foreign-slot-names returns a list containing the slot names of object, whose foreign type was defined by define-c-struct. If object is not a structure, an error is signaled.

Examples

In the following example a structure with three slots is defined, an instance of the structure is made, and foreign-slot-names is used to return a list of the slot names.

(fli:define-c-struct POS
  (x :int)
  (y :int)
  (z :int))
(setq my-pos (fli:allocate-foreign-object :type 'POS))
(fli:foreign-slot-names my-pos)
See also

2.2.3 Structures and unions
define-c-struct
foreign-slot-value


Foreign Language Interface User Guide and Reference Manual - 01 Dec 2021 19:34:58