-;;;; -*- Mode: ANSI-Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
+;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10; Package: UFFI -*-
;;;; *************************************************************************
;;;; FILE IDENTIFICATION
;;;;
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: strings.cl,v 1.11 2002/03/21 11:38:07 kevin Exp $
+;;;; $Id: strings.cl,v 1.18 2002/04/28 06:03:13 kevin Exp $
;;;;
;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
(def-constant +null-cstring-pointer+
#+cmu nil
#+allegro 0
- #+lispworks (fli:make-pointer :address 0 :type '(:unsigned :char)))
+ #+lispworks (fli:make-pointer :address 0 :type '(:unsigned :char))
+ #-(or cmu allegro lispworks) nil
+)
(defmacro convert-from-cstring (obj)
"Converts a string from a c-call. Same as convert-from-foreign-string, except
,@body)))
)
+(defmacro with-cstrings (bindings &rest body)
+ (if bindings
+ `(with-cstring ,(car bindings)
+ (with-cstrings ,(cdr bindings)
+ ,@body))
+ `(progn ,@body)))
;;; Foreign string functions
,result)))
-
-
-
;; Modified from CMUCL's source to handle non-null terminated strings
#+cmu
(defun cmucl-naturalize-cstring (sap &key