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

foreign-slot-type Function

Summary

Returns the type of a specified slot of a foreign object.

Package

fli

Signature

foreign-slot-type object-or-type slot-name => type

Arguments
object-or-type
A foreign object, a pointer to a foreign object, or a foreign structure or union type.
slot-name
A symbol or a list of symbols identifying the slot whose type is to be returned. The value is interpreted as described for foreign-slot-value.
Values
type
The type of slot-name.
Description

The function foreign-slot-type returns the type of the slot slot-name in object-or-type.

Examples

In the following example two new types, east and west are defined. Then a new structure, compass, is defined, with two slots. An instance of the structure is created, and foreign-slot-type is used to get the type of the first slot of the structure.

(fli:define-c-typedef east (:boolean :int))
 
(fli:define-c-typedef west :long)
 
(fli:define-c-struct compass
   (x east)
   (y west))
 
(fli:foreign-slot-type 'compass 'x)
 
(setq dir (fli:allocate-foreign-object :type 'compass))
 
(fli:foreign-slot-type dir 'x)
See also

2.2.3 Structures and unions
foreign-slot-names
foreign-slot-value


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