r4947: Auto commit for Debian build
authorKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 15 May 2003 07:33:21 +0000 (07:33 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 15 May 2003 07:33:21 +0000 (07:33 +0000)
debian/changelog
uffi/clsql-uffi.lisp

index 0a37ac9fffd8999f83c39e974d0a0992725b0c54..3db57f93b897e4776ad4935b07b7c93ac2113c6a 100644 (file)
@@ -1,3 +1,10 @@
+cl-sql (1.6.0-1) unstable; urgency=low
+
+  * Optimize string conversion for mysql string fields at the expense
+  of ignoring locales on Allegro and Lispworks.
+
+ -- Kevin M. Rosenberg <kmr@debian.org>  Thu, 15 May 2003 01:32:52 -0600
+
 cl-sql (1.5.4-1) unstable; urgency=low
 
   * Improve .asd files
index 3b5cf719382429f26428870de84d5bb7754a1b61..11fb988c6358269588418cd98105c1232a11db0d 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmers:   Kevin M. Rosenberg
 ;;;; Date Started:  Mar 2002
 ;;;;
-;;;; $Id: clsql-uffi.lisp,v 1.5 2003/05/06 02:22:58 kevin Exp $
+;;;; $Id: clsql-uffi.lisp,v 1.6 2003/05/15 07:33:21 kevin Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
                  low32
                  (make-64-bit-integer high32 low32)))))
         (t
+         (native-to-string char-ptr)
+         #+ignore
          (uffi:convert-from-foreign-string char-ptr)))))))
   
+
+(uffi:def-function "strlen"
+    ((str (* :unsigned-char)))
+  :returning :unsigned-int)
+
+(defun native-to-string (s)
+  (declare (optimize (speed 3) (space 0) (safety 0) (compilation-speed 0)))
+  (let* ((len (strlen s))
+        (str (make-string len)))
+    (declare (fixnum len)
+            (simple-string str))
+    (do ((i 0))
+       ((= i len))
+      (declare (fixnum i))
+      (setf (schar str i)
+       (code-char (uffi:deref-array s '(:array :unsigned-char) i)))
+      (incf i))
+    str))