X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fobjects.lisp;h=cb6cd7f95c9c81bd92e1ae409b4023576eb511c4;hb=778b73f612acda97b1b9ff6d870ed3315a96239f;hp=0881539df370794a00977ca1601fac4212e6caaf;hpb=f1de6d7be49f73be92691828678aeafe98ddee99;p=uffi.git diff --git a/src/objects.lisp b/src/objects.lisp index 0881539..cb6cd7f 100644 --- a/src/objects.lisp +++ b/src/objects.lisp @@ -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.10 2002/12/30 20:49:12 kevin Exp $ +;;;; $Id: objects.lisp,v 1.13 2003/06/06 21:59:18 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) @@ -119,11 +118,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 +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))