27.11.2014 Views

CFFI User Manual - Common Lisp.net

CFFI User Manual - Common Lisp.net

CFFI User Manual - Common Lisp.net

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 6: Foreign Types 42<br />

foreign-enum-keyword<br />

Syntax<br />

foreign-enum-keyword type value &key errorp ⇒ keyword<br />

Arguments and Values<br />

[Function]<br />

type<br />

value<br />

errorp<br />

keyword<br />

An enum type.<br />

An integer.<br />

If true (the default), signal an error if value is not defined in type. If false,<br />

foreign-enum-keyword returns nil.<br />

A keyword symbol.<br />

Description<br />

The function foreign-enum-keyword returns the keyword symbol that corresponds to value<br />

in type.<br />

An error is signaled if type doesn’t contain such value and errorp is true.<br />

Examples<br />

(defcenum boolean<br />

:no<br />

:yes)<br />

<strong>CFFI</strong>> (foreign-enum-keyword ’boolean 1)<br />

⇒ :YES<br />

See Also<br />

[defcenum], page 37<br />

[foreign-enum-value], page 43

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!