+2002-06-28 Kevin Rosenberg (kevin@rosenberg.net)
+
+ * Added size-of-foreign-type function.
+
2002-06-26 Kevin Rosenberg (kevin@rosenberg.net)
* Fix bug in Lispworks allocate-foreign-object
-cl-uffi (0.4.8-2) unstable; urgency=low
+cl-uffi (0.5.0-1) unstable; urgency=low
- * Additions to the copyright file
+ * New upstream version
+
+ * Additions to the copyright file to comply with Debian Policy
-- Kevin M. Rosenberg <kevin@rosenberg.net> Fri, 28 Jun 2002 11:16:28 -0600
</refsect1>
</refentry>
+ <refentry id="size-of-foreign-type">
+ <refnamediv>
+ <refname>size-of-foreign-type</refname>
+ <refpurpose>Returns the number of data bytes used by a foreign object type.
+ </refpurpose>
+ <refclass>Macro</refclass>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Syntax</title>
+ <synopsis>
+ <function>size-of-foreign-type</function> <replaceable>ftype</replaceable>
+ </synopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Arguments and Values</title>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>ftype</parameter></term>
+ <listitem>
+ <para>A foreign type specifier. This parameter is evaluated.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ Returns the number of data bytes used by a foreign object type. This does not include any Lisp storage overhead.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <para>
+<programlisting>
+(size-of-foreign-object :unsigned-byte)
+=> 1
+(size-of-foreign-object 'my-100-byte-vector-type)
+=> 100
+</programlisting>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Side Effects</title>
+ <para>None.</para>
+ </refsect1> <refsect1>
+ <title>Affected by</title>
+ <para>None.</para>
+ </refsect1>
+ <refsect1>
+ <title>Exceptional Situations</title>
+ <para>None.</para>
+ </refsect1>
+ </refentry>
+
<refentry id="pointer-address">
<refnamediv>
<refname>pointer-address</refname>
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: objects.cl,v 1.18 2002/06/27 03:42:40 kevin Exp $
+;;;; $Id: objects.cl,v 1.19 2002/06/28 21:08:00 kevin Exp $
;;;;
;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
#+cmu `(alien:null-alien ,obj)
)
+(defmacro size-of-foreign-type (type)
+ #+lispworks `(fli:size-of ,type)
+ #+allegro `(ff:sizeof-fobject ,type)
+ #+cmu `(alien:alien-size ,type)
+ )
+
(defmacro make-null-pointer (type)
#+(or allegro cmu) (declare (ignore type))
#:free-foreign-object
#:with-foreign-object
#:with-foreign-objects
+ #:size-of-foreign-type
#:pointer-address
#:deref-pointer
#:ensure-char-character