Package: cffi

Function foreign-enum-keyword

Lambda List

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

Arguments

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.

Details

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.

Examples

  (defcenum boolean
    :no
    :yes)

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

See also