X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fobjects.lisp;h=02928bd84200193e6fe4d6e8637cb5aa8c02d1a6;hb=32a1ec81381452961a16a0dea1aff5711d4a3ed0;hp=740b684b408becfd832a0480e4ffbdffa513139c;hpb=1e1e3631aa2f7f3f0927e05bc1f2d9866c20c685;p=uffi.git diff --git a/src/objects.lisp b/src/objects.lisp index 740b684..02928bd 100644 --- a/src/objects.lisp +++ b/src/objects.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: objects.lisp,v 1.9 2002/12/30 20:39:22 kevin Exp $ +;;;; $Id: objects.lisp,v 1.11 2003/03/31 19:22:24 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -44,11 +44,11 @@ an array of TYPE with size SIZE. The TYPE parameter is evaluated." #+sbcl `(sb-alien:make-alien ,(convert-from-uffi-type (eval type) :allocation)) #+lispworks - `(fli:allocate-foreign-object :type ',(convert-from-uffi-type (eval type) :allocate)) + `(fli:allocate-foreign-object :type ',(convert-from-uffi-type type :allocate)) #+allegro - `(ff:allocate-fobject ',(convert-from-uffi-type (eval type) :allocate) :c) + `(ff:allocate-fobject ',(convert-from-uffi-type type :allocate) :c) #+mcl - `(new-ptr ,(size-of-foreign-type (convert-from-uffi-type (eval type) :allocation))) + `(new-ptr ,(size-of-foreign-type (convert-from-uffi-type type :allocation))) ) (progn #+(or cmu scl) @@ -56,11 +56,11 @@ an array of TYPE with size SIZE. The TYPE parameter is evaluated." #+sbcl `(sb-alien:make-alien ,(convert-from-uffi-type (eval type) :allocation) ,size) #+lispworks - `(fli:allocate-foreign-object :type ',(convert-from-uffi-type (eval type) :allocate) :nelems ,size) + `(fli:allocate-foreign-object :type ',(convert-from-uffi-type type :allocate) :nelems ,size) #+allegro - `(ff:allocate-fobject (list :array (quote ,(convert-from-uffi-type (eval type) :allocate)) ,size) :c) + `(ff:allocate-fobject (list :array (quote ,(convert-from-uffi-type type :allocate)) ,size) :c) #+mcl - `(new-ptr (* ,size ,(size-of-foreign-type (convert-from-uffi-type (eval type) :allocation)))) + `(new-ptr (* ,size ,(size-of-foreign-type (convert-from-uffi-type type :allocation)))) ))) (defmacro free-foreign-object (obj) @@ -135,6 +135,11 @@ an array of TYPE with size SIZE. The TYPE parameter is evaluated." (defmacro ensure-char-integer (obj) obj) +;; Returns the numeric value of a byte at a pointer +;; Highly optimized +(defmacro byte-value-at-pointer (ptr) + ) + (defmacro pointer-address (obj) #+(or cmu scl) `(system:sap-int (alien:alien-sap ,obj))