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 36<br />

defctype<br />

Syntax<br />

defctype name base-type &optional documentation<br />

Arguments and Values<br />

name<br />

base-type<br />

The name of the new foreign type.<br />

A symbol or a list defining the new type.<br />

documentation<br />

A documentation string, currently ignored.<br />

[Macro]<br />

Description<br />

The defctype macro provides a mechanism similar to C’s typedef to define new types.<br />

The new type inherits base-type’s translators, if any. There is no way to define translations<br />

for types defined with defctype. For that, you should use [define-foreign-type], page 38.<br />

Examples<br />

(defctype my-string :string<br />

"My own string type.")<br />

(defctype long-bools (:boolean :long)<br />

"Booleans that map to C longs.")<br />

See Also<br />

[define-foreign-type], page 38

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

Saved successfully!

Ooh no, something went wrong!