Next: , Up: Alien Operations   [Contents][Index]


8.3.1 Alien Access Operations

Function: alien:deref pointer-or-array &rest indices

This function returns the value pointed to by an Alien pointer or the value of an Alien array element. If a pointer, an optional single index can be specified to give the equivalent of C pointer arithmetic; this index is scaled by the size of the type pointed to. If an array, the number of indices must be the same as the number of dimensions in the array type. deref can be set with setf to assign a new value.

Function: alien:slot struct-or-union slot-name

This function extracts the value of slot slot-name from the an Alien struct or union. If struct-or-union is a pointer to a structure or union, then it is automatically dereferenced. This can be set with setf to assign a new value. Note that slot-name is evaluated, and need not be a compile-time constant (but only constant slot accesses are efficiently compiled.)