Package: cffi
Macro defbitfield
Lambda Listdefbitfield (name-and-options &body masks) SyntaxArgumentsDetails The defbitfield macro is used to define foreign types that map
lists of symbols to integer values. If value is omitted, it will be computed as follows: find the greatest value previously used, including those so computed, with only a single 1-bit in its binary representation (that is, powers of two), and left-shift it by one. This rule guarantees that a computed value cannot clash with previous values, but may clash with future explicitly specified values. Symbol lists will be automatically converted to values and vice versa when being passed as arguments to or returned from foreign functions, respectively. The same applies to any other situations where an object of a bitfield type is expected. Types defined with defbitfield canonicalize to base-type which is :int by default. Examples(defbitfield open-flags (:rdonly #x0000) :wronly ;#x0001 :rdwr ;... :nonblock :append (:creat #x0200)) ;; etc... | See also |