From 082969cc01765b8ebde78cd35a41ad274d1af02d Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Thu, 15 May 2003 07:33:21 +0000 Subject: [PATCH] r4947: Auto commit for Debian build --- debian/changelog | 7 +++++++ uffi/clsql-uffi.lisp | 22 +++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 0a37ac9..3db57f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Thu, 15 May 2003 01:32:52 -0600 + cl-sql (1.5.4-1) unstable; urgency=low * Improve .asd files diff --git a/uffi/clsql-uffi.lisp b/uffi/clsql-uffi.lisp index 3b5cf71..11fb988 100644 --- a/uffi/clsql-uffi.lisp +++ b/uffi/clsql-uffi.lisp @@ -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 ;;;; @@ -120,5 +120,25 @@ 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)) -- 2.34.1