Package: cffi

Function foreign-enum-value

Lambda List

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


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.


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.


  (defcenum boolean

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

See also