def-foreign-type

$Revision: 5.0.2.2 $

Macro

Package: FOREIGN-FUNCTIONS

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 4.0 The Syntax for Foreign Types in ftypes.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:

Attribute Type What
:pack integer worst 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. See foreign_functions.htm for general information on foreign functions in Allegro CL.

The general documentation description is in introduction.htm. The index in index.htm.

Copyright (C) 1998-1999, Franz Inc., Berkeley, CA. All Rights Reserved.