def-foreign-type

Macro

Package: ff

Arguments: name definition

Defines name to be a user-defined foreign type with the given definition. name must either be a symbol or a list beginning with a symbol and followed by attributes (see below). definition is not evaluated and must be a foreign type description as described in The Syntax for Foreign Types in ftype.htm.

The def-foreign-type macro immediately defines the given type in the current lisp. It also expands into a form that causes that type definition to be made when the resulting form is evaluated

The attribute that can be specified is:

AttributeTypeWhat
:packintegerworst case alignment needed by data objects.

For example

(def-foreign-type (foostruct (:pack 1)) (:struct (x :char) (y :int)))

Would pack the integer right next to the character, without the normal 3 bytes of padding.

See ftype.htm for information on foreign types in Allegro CL and foreign-functions.htm for general information on foreign functions in Allegro CL.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.