From: Kevin M. Rosenberg Date: Fri, 28 Jun 2002 21:09:42 +0000 (+0000) Subject: r2185: *** empty log message *** X-Git-Tag: v1.6.1~363 X-Git-Url: http://git.kpe.io/?p=uffi.git;a=commitdiff_plain;h=b0b263f7735028b6198593365c8285a6367882af r2185: *** empty log message *** --- diff --git a/ChangeLog b/ChangeLog index ab5d5de..3e99d1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +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 diff --git a/debian/changelog b/debian/changelog index b6d79b3..d31ac6d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ -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 Fri, 28 Jun 2002 11:16:28 -0600 diff --git a/doc/ref.sgml b/doc/ref.sgml index 1058e48..827ac07 100644 --- a/doc/ref.sgml +++ b/doc/ref.sgml @@ -1050,6 +1050,61 @@ much better with static allocation. + + + size-of-foreign-type + Returns the number of data bytes used by a foreign object type. + + Macro + + + Syntax + + size-of-foreign-type ftype + + + + Arguments and Values + + + ftype + + A foreign type specifier. This parameter is evaluated. + + + + + + + Description + + Returns the number of data bytes used by a foreign object type. This does not include any Lisp storage overhead. + + + + Examples + + +(size-of-foreign-object :unsigned-byte) +=> 1 +(size-of-foreign-object 'my-100-byte-vector-type) +=> 100 + + + + + Side Effects + None. + + Affected by + None. + + + Exceptional Situations + None. + + + pointer-address diff --git a/src/objects.cl b/src/objects.cl index c71aa48..fd5ac67 100644 --- a/src/objects.cl +++ b/src/objects.cl @@ -7,7 +7,7 @@ ;;;; 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 ;;;; @@ -55,6 +55,12 @@ an array of TYPE with size SIZE. The TYPE parameter is evaluated." #+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)) diff --git a/src/package.cl b/src/package.cl index 30d115b..abacbc8 100644 --- a/src/package.cl +++ b/src/package.cl @@ -41,6 +41,7 @@ #:free-foreign-object #:with-foreign-object #:with-foreign-objects + #:size-of-foreign-type #:pointer-address #:deref-pointer #:ensure-char-character