Next: , Previous: , Up: Foreign Types   [Contents][Index]


foreign-enum-keyword

foreign-enum-keyword

Syntax

Function: foreign-enum-keyword type value &key errorp ⇒ keyword

Arguments and Values

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.

Description

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

defcenum
foreign-enum-value