r5005: *** empty log message ***
[uffi.git] / src / objects.lisp
index 6c7a745476fea1939bb2e1b7d957d44980a57438..02928bd84200193e6fe4d6e8637cb5aa8c02d1a6 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: objects.lisp,v 1.6 2002/11/23 18:01:57 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
 ;;;;
@@ -58,7 +58,7 @@ an array of TYPE with size SIZE. The TYPE parameter is evaluated."
        #+lispworks
        `(fli:allocate-foreign-object :type ',(convert-from-uffi-type type :allocate) :nelems ,size)
        #+allegro
-       `(ff:allocate-fobject '(:array ,(convert-from-uffi-type (eval type) :allocate) ,(eval 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 type :allocation))))
        )))
@@ -108,8 +108,8 @@ an array of TYPE with size SIZE. The TYPE parameter is evaluated."
   #+(or cmu scl)  `(alien:deref ,ptr)
   #+sbcl  `(sb-alien:deref ,ptr)
   #+lispworks `(fli:dereference ,ptr)
-  #+allegro `(ff:fslot-value-typed (convert-from-uffi-type ,type :deref) :c ,ptr)
-  #+mcl `(ccl:pref ,ptr (convert-from-uffi-type ,type :deref))
+  #+allegro `(ff:fslot-value-typed (quote ,(convert-from-uffi-type type :deref)) :c ,ptr)
+  #+mcl `(ccl:pref ,ptr ,(convert-from-uffi-type type :deref))
   )
 
 #+mcl
@@ -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))