The function
pointer-element-type
returns the type of the foreign object pointed to by
pointer
.
In the following example a pointer to an integer is defined, and
pointer-element-type
is used to confirm that the pointer points to an integer.
(setq point (fli:allocate-foreign-object :type :int))
(fli:pointer-element-type point)
In the next example a new type,
HAPPY
, is defined. The pointer
point
is set to point to an instance of
HAPPY
, and
pointer-element-type
is used to find the type of the object pointed to by
point
.
(fli:define-c-typedef HAPPY :long)
(setq point (fli:allocate-foreign-object :type 'HAPPY))
(fli:pointer-element-type point)