r5209: Auto commit for Debian build
[uffi.git] / src / objects.lisp
index 8c6d2aca11f1c936b3d970438aed7057ef3561d3..2efacf1bb4b65a2168896395a128a42976b59353 100644 (file)
@@ -2,12 +2,12 @@
 ;;;; *************************************************************************
 ;;;; FILE IDENTIFICATION
 ;;;;
-;;;; Name:          objects.cl
+;;;; Name:          objects.lisp
 ;;;; Purpose:       UFFI source to handle objects and pointers
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: objects.lisp,v 1.7 2002/12/02 13:21:43 kevin Exp $
+;;;; $Id: objects.lisp,v 1.14 2003/06/26 18:02:08 kevin Exp $
 ;;;;
 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
@@ -16,8 +16,7 @@
 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
 ;;;; *************************************************************************
 
-(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
-(in-package :uffi)
+(in-package #:uffi)
 
 (defun size-of-foreign-type (type)
   #+lispworks (fli:size-of type)
@@ -58,7 +57,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))))
        )))
@@ -135,6 +134,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))