;;;;
;;;; $Id$
;;;;
-;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
-;;;;
-;;;; UFFI users are granted the rights to distribute and use this software
-;;;; as governed by the terms of the Lisp Lesser GNU Public License
-;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
+;;;; This file, part of UFFI, is Copyright (c) 2002-2005 by Kevin M. Rosenberg
;;;; *************************************************************************
(in-package #:uffi)
#+lispworks
(let ((stored (gensym)))
`(let ((,stored ,obj))
- `(if (null ,stored)
- +null-cstring-pointer+
- (fli:convert-to-foreign-string
- ,stored
- :external-format '(:latin-1 :eol-style :lf)))))
+ (if (null ,stored)
+ +null-cstring-pointer+
+ (fli:convert-to-foreign-string
+ ,stored
+ :external-format '(:latin-1 :eol-style :lf)))))
#+allegro
(let ((stored (gensym)))
`(let ((,stored ,obj))
(free-foreign-object ,foreign-string)
,result)))
+(defmacro with-foreign-strings (bindings &body body)
+ `(with-foreign-string ,(car bindings)
+ ,@(if (cdr bindings)
+ `((with-foreign-strings ,(cdr bindings) ,@body))
+ body)))
;; Modified from CMUCL's source to handle non-null terminated strings
#+cmu