r5326: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 18 Jul 2003 21:34:18 +0000 (21:34 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 18 Jul 2003 21:34:18 +0000 (21:34 +0000)
src/strings.lisp
uffi.asd

index b5eeebe19df0e43e3898ea0749208c62632a20fe..a8cbf8bdcd3937707cf90f2119a0c14612680dc3 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: strings.lisp,v 1.9 2003/06/12 18:32:30 kevin Exp $
+;;;; $Id: strings.lisp,v 1.10 2003/07/18 21:33:26 kevin Exp $
 ;;;;
 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
@@ -310,8 +310,7 @@ that LW/CMU automatically converts strings from c-calls."
 
 (def-type char-ptr-def (* :unsigned-char))
 
-;;#+(or lispworks (and allegro ics))
-#+(or lispworks allegro)
+#+(or lispworks (and allegro (not ics)))
 (defun fast-native-to-string (s)
   (declare (optimize (speed 3) (space 0) (safety 0) (compilation-speed 0))
           (type char-ptr-def s))
@@ -322,7 +321,17 @@ that LW/CMU automatically converts strings from c-calls."
     (dotimes (i len str)
       (setf (aref str i) (uffi:deref-array s '(:array :char) i)))))
 
-;;#+(and allegro (not ics))
+#+(and allegro ics)
+(defun fast-native-to-string (s)
+  (declare (optimize (speed 3) (space 0) (safety 0) (compilation-speed 0))
+          (type char-ptr-def s))
+  (let* ((len (strlen s))
+        (str (make-string len)))
+    (declare (fixnum len))
+    (dotimes (i len str)
+      (setf (schar str i) (ensure-char-character
+                         (uffi:deref-array s '(:array :char) i))))))
+
 #+ignore
 (defun fast-native-to-string (s)
   (declare (optimize (speed 3) (space 0) (safety 0) (compilation-speed 0) (debug 0))
index 53db6644e2f5d9097ba6b70b6965a86154f31ff6..dbdb11c908278d5b29527ad561c9e2c9f689daaf 100644 (file)
--- a/uffi.asd
+++ b/uffi.asd
@@ -7,7 +7,7 @@
 ;;;; Author:        Kevin M. Rosenberg
 ;;;; Date Started:  Aug 2002
 ;;;;
-;;;; $Id: uffi.asd,v 1.26 2003/06/07 22:34:24 kevin Exp $
+;;;; $Id: uffi.asd,v 1.27 2003/07/18 21:33:25 kevin Exp $
 ;;;;
 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
@@ -35,8 +35,8 @@
            ((:file "package")
             (:file "primitives" :depends-on ("package"))
             #+mcl (:file "readmacros-mcl" :depends-on ("package"))
-            (:file "strings" :depends-on ("primitives" "functions" "aggregates"))
             (:file "objects" :depends-on ("primitives"))
+            (:file "strings" :depends-on ("primitives" "functions" "aggregates" "objects"))
             (:file "aggregates" :depends-on ("primitives"))
             (:file "functions" :depends-on ("primitives"))
             (:file "libraries" :depends-on ("package"))