;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: objects.lisp,v 1.20 2003/08/23 01:05:53 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
#+mcl `(ccl:%null-ptr)
)
+(defmacro make-pointer (addr type)
+ #+(or allegro mcl) (declare (ignore type))
+ #+(or cmu scl) `(alien:sap-alien (system:int-sap ,addr) (* ,(convert-from-uffi-type (eval type) :type)))
+ #+sbcl `(sb-alien:sap-alien (sb-sys:int-sap ,addr) (* ,(convert-from-uffi-type (eval type) :type)))
+ #+lispworks `(fli:make-pointer :address ,addr :type (quote ,(convert-from-uffi-type (eval type) :type)))
+ #+allegro addr
+ #+mcl `(ccl:%int-to-ptr addr)
+ )
+
+(defmacro pointer-address (ptr)
+ #+allegro ptr
+ #+(or cmu scl) `(system:sap-int (alien:alien-sap ,ptr))
+ #+sbcl `(sb-sys:sap-int (sb-alien:alien-sap ,ptr))
+ #+lispworks `(fli:pointer-address ,ptr)
+ #+mcl `(ccl:%ptr-to-int ,ptr))
+
(defmacro char-array-to-pointer (obj)
#+(or cmu scl) `(alien:cast ,obj (* (alien:unsigned 8)))
#+sbcl `(sb-alien:cast ,obj (* (sb-alien:unsigned 8)))