X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fobjects.cl;h=01884302c2679606db6e7af3a7592f0ef8459cce;hb=e4010c4542ebfdb0f95c15b391648eafa7d64949;hp=0f28115a0cbd24565ad81b915475212994923d77;hpb=55fc3151326f2d3c25a5c5dfdc9f18ea110ee3f8;p=uffi.git diff --git a/src/objects.cl b/src/objects.cl index 0f28115..0188430 100644 --- a/src/objects.cl +++ b/src/objects.cl @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: objects.cl,v 1.6 2002/03/17 17:33:30 kevin Exp $ +;;;; $Id: objects.cl,v 1.7 2002/03/18 02:27:28 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -75,3 +75,23 @@ #+allegro obj ) + +(defmacro allocate-byte-array (nsize) + #+cmu + `(alien:make-alien (alien:unsigned 8) ,nsize) + #+lispworks + `(fli:allocate-foreign-object :type :byte :nelems ,nsize) + #+allegro + `(ff:allocate-fobject (array :byte ,nsize)) +) + +(defmacro deref-byte-array (array position) + #+cmu `(alien:deref ,array ,position) + #+lispworks `(fli:dereference ,array :index ,position) + #+allegro `(ff:fslot-value-typed '(:array :byte) :c ,array ,position) +) + + + + +)