projects
/
uffi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r1917: *** empty log message ***
[uffi.git]
/
src
/
strings.cl
diff --git
a/src/strings.cl
b/src/strings.cl
index 75496e08a3c77a1069e774bea0155d641e6f73d0..06ffa5226edcc5e166b4291bc3416ef39bb674d5 100644
(file)
--- a/
src/strings.cl
+++ b/
src/strings.cl
@@
-1,4
+1,4
@@
-;;;; -*- Mode:
ANSI-Lisp; Syntax: ANSI-Common-Lisp; Base: 10
-*-
+;;;; -*- Mode:
Lisp; Syntax: ANSI-Common-Lisp; Base: 10; Package: UFFI
-*-
;;;; *************************************************************************
;;;; FILE IDENTIFICATION
;;;;
;;;; *************************************************************************
;;;; FILE IDENTIFICATION
;;;;
@@
-7,7
+7,7
@@
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: strings.cl,v 1.1
2 2002/03/22 20:51:08
kevin Exp $
+;;;; $Id: strings.cl,v 1.1
8 2002/04/28 06:03:13
kevin Exp $
;;;;
;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;;
;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
@@
-23,7
+23,9
@@
(def-constant +null-cstring-pointer+
#+cmu nil
#+allegro 0
(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
(defmacro convert-from-cstring (obj)
"Converts a string from a c-call. Same as convert-from-foreign-string, except
@@
-67,6
+69,12
@@
that LW/CMU automatically converts strings from c-calls."
,@body)))
)
,@body)))
)
+(defmacro with-cstrings (bindings &rest body)
+ (if bindings
+ `(with-cstring ,(car bindings)
+ (with-cstrings ,(cdr bindings)
+ ,@body))
+ `(progn ,@body)))
;;; Foreign string functions
;;; Foreign string functions
@@
-150,7
+158,6
@@
that LW/CMU automatically converts strings from c-calls."
)
(defmacro with-foreign-string ((foreign-string lisp-string) &body body)
)
(defmacro with-foreign-string ((foreign-string lisp-string) &body body)
- #-(or lispworks cmu)
(let ((result (gensym)))
`(let* ((,foreign-string (convert-to-foreign-string ,lisp-string))
(,result (progn ,@body)))
(let ((result (gensym)))
`(let* ((,foreign-string (convert-to-foreign-string ,lisp-string))
(,result (progn ,@body)))
@@
-159,9
+166,6
@@
that LW/CMU automatically converts strings from c-calls."
,result)))
,result)))
-
-
-
;; Modified from CMUCL's source to handle non-null terminated strings
#+cmu
(defun cmucl-naturalize-cstring (sap &key
;; Modified from CMUCL's source to handle non-null terminated strings
#+cmu
(defun cmucl-naturalize-cstring (sap &key