Next: , Previous: defcunion, Up: Foreign Types


defctype

Syntax

— Macro: defctype name base-type &key documentation translate-p

Arguments and Values

name
The name of the new foreign type.
base-type
A symbol or a list defining the new type.
documentation
A documentation string, currently ignored.
translate-p
A boolean. If true (the default), the type will be subject to type translation. This may be false to avoid extra generic function call overhead when it is known that no type translation is needed, perhaps because base-type is a built-in type.

Description

The defctype macro provides a mechanism similar to C's typedef to define new types.

The new type inherits base-type's translators.

Examples

  (defctype my-string :string
    :documentation "My own string type.")
   
  (defctype long-bools (:boolean :long)
    :documentation "Booleans that map to C longs.")
   
  (defctype my-float :float :translate-p nil)

See Also

define-foreign-type