From: Kevin M. Rosenberg Date: Sat, 23 Mar 2002 12:58:12 +0000 (+0000) Subject: r1636: Updated/cleaned def-array to def-array-pointer X-Git-Tag: v1.6.1~544 X-Git-Url: http://git.kpe.io/?p=uffi.git;a=commitdiff_plain;h=ca7e9a2299773cfbc927d71e6289549601438b24 r1636: Updated/cleaned def-array to def-array-pointer --- diff --git a/ChangeLog b/ChangeLog index c2fe731..0260b37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,12 @@ -See TODO file -- actively maintained. Includes changes that you - might expect in the interface. +2002-03-22 Kevin Rosenberg (kevin@rosenberg.net) + * src/aggregates.cl: + Changed name and implementation of def-array to more appropriate + def-array-pointer + + * src/ref.sgml: + Updated def-array-pointer documentation + 21 Mar 2002 * Fixed problem with NULL foreign-strings with CMUCL * Added c-test-fns to examples for allow more specific testing diff --git a/TODO b/TODO index fb4f2c8..389df1d 100644 --- a/TODO +++ b/TODO @@ -5,7 +5,5 @@ passing a quote character in front of non-keyword types. So This may involve stripping the (quote ...) for some implementations like CMUCL which doesn't evaluate the type argument. -- Cleanup the meaning of (def-array). Add size parameter - - Split implementation-dependent code into separate files in preparation for MCL and CormanLisp ports. diff --git a/doc/ref.sgml b/doc/ref.sgml index 58ac773..fcb08eb 100644 --- a/doc/ref.sgml +++ b/doc/ref.sgml @@ -315,7 +315,7 @@ abstracts the difference in implementations where some return a Examples -(def-array ca :char) +(def-array-pointer ca :unsigned-char) (let ((fs (convert-to-foreign-string "ab"))) (values (null-char-p (deref-array fs 'ca 0)) (null-char-p (deref-array fs 'ca 2)))) @@ -640,17 +640,17 @@ structure. It's type is :pointer-self. - + - def-array - Defines a foreign array type. + def-array-pointer + Defines a pointer to a array of type. Macro Syntax - def-array name type + def-array-pointer name type @@ -675,13 +675,13 @@ structure. It's type is :pointer-self. Description - Defines a foreign array type. + Defines a type tat is a pointer to an array of type. Examples -(def-array byte-array :unsigned-char) +(def-array-pointer byte-array-pointer :unsigned-char) diff --git a/src/aggregates.cl b/src/aggregates.cl index 06dca81..3fc32a3 100644 --- a/src/aggregates.cl +++ b/src/aggregates.cl @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: aggregates.cl,v 1.7 2002/03/21 07:56:45 kevin Exp $ +;;;; $Id: aggregates.cl,v 1.8 2002/03/23 12:58:12 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -49,16 +49,16 @@ of the enum-name name, separator-string, and field-name" cmds)) -(defmacro def-array (name-array type) +(defmacro def-array-pointer (name-array type) #+allegro `(ff:def-foreign-type ,name-array - (:array ,(convert-from-uffi-type type :array))) + (:array ,(convert-from-uffi-type type :array))) #+lispworks `(fli:define-c-typedef ,name-array - (:pointer (:pointer ,(convert-from-uffi-type type :array)))) + (:c-array ,(convert-from-uffi-type type :array))) #+cmu `(alien:def-alien-type ,name-array - (* ,(convert-from-uffi-type type :array))) + (* ,(convert-from-uffi-type type :array))) ) (defun process-struct-fields (name fields) diff --git a/src/strings.cl b/src/strings.cl index 75496e0..18b7ffa 100644 --- a/src/strings.cl +++ b/src/strings.cl @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: strings.cl,v 1.12 2002/03/22 20:51:08 kevin Exp $ +;;;; $Id: strings.cl,v 1.13 2002/03/23 12:58:12 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -159,9 +159,6 @@ that LW/CMU automatically converts strings from c-calls." ,result))) - - - ;; Modified from CMUCL's source to handle non-null terminated strings #+cmu (defun cmucl-naturalize-cstring (sap &key