r5059: *** empty log message ***
[uffi.git] / src / objects.lisp
index c7fa563a2dcc717f15c622b1edfcefcdef900621..51a9ce5977ecaab6929502dc3588ca3938d62d08 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: objects.lisp,v 1.4 2002/10/16 11:56:43 kevin Exp $
+;;;; $Id: objects.lisp,v 1.12 2003/05/30 18:46:45 kevin Exp $
 ;;;;
 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
@@ -46,7 +46,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))
        #+allegro
-       `(ff:allocate-fobject ,(convert-from-uffi-type type :allocate) :c)
+       `(ff:allocate-fobject ',(convert-from-uffi-type type :allocate) :c)
        #+mcl
        `(new-ptr ,(size-of-foreign-type (convert-from-uffi-type type :allocation)))
        )
@@ -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,7 +108,7 @@ 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)
+  #+allegro `(ff:fslot-value-typed (quote ,(convert-from-uffi-type type :deref)) :c ,ptr)
   #+mcl `(ccl:pref ,ptr ,(convert-from-uffi-type type :deref))
   )
 
@@ -119,11 +119,11 @@ an array of TYPE with size SIZE. The TYPE parameter is evaluated."
 #+mcl
 (defsetf deref-pointer deref-pointer-set)
 
-#+(or lispworks (and mcl (not openmcl))) ;; with LW, deref is a character
+#+(or (and mcl (not openmcl))) ;; with LW, deref is a character
 (defmacro ensure-char-character (obj)
   obj)
 
-#+(or allegro cmu sbcl scl openmcl)
+#+(or allegro lispworks cmu sbcl scl openmcl)
 (defmacro ensure-char-character (obj)
   `(code-char ,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))