Package: cffi

Function foreign-enum-keyword

Lambda List

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


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


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

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


  (defcenum boolean

CFFI> (foreign-enum-keyword 'boolean 1) => :YES

See also