Package: cffi

Function foreign-enum-value

Lambda List

foreign-enum-value (type keyword &key errorp)

Arguments

type -- An enum type.
keyword -- A keyword symbol.
errorp -- If true (the default), signal an error if keyword is not defined in type. If false, foreign-enum-value returns nil.
value -- An integer.

Details

The function foreign-enum-value returns the value that corresponds to keyword in type.

An error is signaled if type doesn't contain such keyword, and errorp is true.

Examples

  (defcenum boolean
    :no
    :yes)

CFFI> (foreign-enum-value 'boolean :yes) => 1
 

See also