Next Previous Up Top Contents Index

5 Function and Macro Reference

size-of

Function

Summary

Returns the size in bytes of a foreign type.
Package

fli

Signature

size-of type-name => size

Arguments

type-name

A foreign type whose size is to be determined.

Values

size

The size of the foreign type type-name in bytes.

Description

The functionsize-of returns the size in bytes of the foreign language type named by type-name.
Example

The following example shows that the integer type has a size of 4 bytes, and that an array of 10 integers has a size of 40 bytes.
(fli:size-of :int)

(fli:size-of '(:c-array :int 10))

The functionsize-of can also be used to determine the size of a structure.
(fli:define-c-struct POS
  (x :int)
  (y :int)
  (z :int))

(fli:size-of 'POS)
See Also

allocate-foreign-object
free-foreign-object

LispWorks Foreign Language Interface - 12 Oct 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker