r2784: *** empty log message ***
[uffi.git] / src-mcl / strings.cl
index ccf6b5d1cacd4277bed06e11c52eebfac726c563..12ff2acef65714503408c900c08614a326d32fa9 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmers:   Kevin M. Rosenberg and John DeSoi
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: strings.cl,v 1.1 2002/09/16 17:57:43 kevin Exp $
+;;;; $Id: strings.cl,v 1.2 2002/09/20 04:51:14 kevin Exp $
 ;;;;
 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg 
 ;;;; and John DeSoi
@@ -194,5 +194,16 @@ that CMU automatically converts strings from c-calls."
 
 
 
+
+(defmacro with-foreign-string ((foreign-string lisp-string) &body body)
+  (let ((result (gensym)))
+    `(let* ((,foreign-string (convert-to-foreign-string ,lisp-string))
+           (,result (progn ,@body)))
+      (declare (dynamic-extent ,foreign-string))
+      (free-foreign-object ,foreign-string)
+      ,result)))
+
+
+