X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fstrings.lisp;h=28ff372810792b0ca77e0c51ef224154bb167189;hb=f7a5481c4ede7cf15256922861088e8601313ac8;hp=02ae84bfa1758412f690918d6290633bba04ae1b;hpb=caf4972e7f7d2562fe4a9977cf20d38bbf0e320f;p=uffi.git diff --git a/src/strings.lisp b/src/strings.lisp index 02ae84b..28ff372 100644 --- a/src/strings.lisp +++ b/src/strings.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: strings.lisp,v 1.4 2002/10/16 11:56:43 kevin Exp $ +;;;; $Id: strings.lisp,v 1.7 2003/03/28 19:58:18 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -55,14 +55,14 @@ that LW/CMU automatically converts strings from c-calls." `(if (null ,obj) +null-cstring-pointer+ (let ((ptr (new-ptr (1+ (length ,obj))))) - (ccl:%put-cstring ptr ,obj) + (ccl::%put-cstring ptr ,obj) ptr)) ) (defmacro free-cstring (obj) #+(or cmu sbcl scl lispworks) (declare (ignore obj)) #+allegro - `(unless (zerop obj) + `(unless (zerop ,obj) (ff:free-fobject ,obj)) #+mcl `(unless (ccl:%null-ptr-p ,obj) @@ -97,8 +97,8 @@ that LW/CMU automatically converts strings from c-calls." (defmacro convert-to-foreign-string (obj) #+lispworks `(if (null ,obj) - +null-cstring-pointer+ - (fli:convert-to-foreign-string ,obj)) + +null-cstring-pointer+ + (fli:convert-to-foreign-string ,obj :external-format '(:latin-1 :eol-style :lf))) #+allegro `(if (null ,obj) 0 @@ -143,7 +143,7 @@ that LW/CMU automatically converts strings from c-calls." `(if (null ,obj) +null-cstring-pointer+ (let ((ptr (new-ptr (1+ (length ,obj))))) - (ccl:%put-cstring ptr ,obj) + (ccl::%put-cstring ptr ,obj) ptr)) )