From: Kevin M. Rosenberg Date: Tue, 9 Nov 2004 18:04:31 +0000 (+0000) Subject: r10147: 09 Nov 2004 Kevin Rosenberg X-Git-Tag: v3.8.6~207 X-Git-Url: http://git.kpe.io/?p=clsql.git;a=commitdiff_plain;h=d529146041f6265030edc25c735e063ebfdbd285 r10147: 09 Nov 2004 Kevin Rosenberg * Version 3.1.0 released: New SQLite3 backend by Aurelio Bignoli * doc/appendix.xml: Document SQLITE3 backend, patch by Aurelio Bignoli --- diff --git a/ChangeLog b/ChangeLog index edf6b8a..bc897d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,10 @@ 09 Nov 2004 Kevin Rosenberg - * sql/operations.lisp: Add lower and upper SQL - functions from Daniel Lowe. + * Version 3.1.0 released: New SQLite3 backend by Aurelio Bignoli + * doc/appendix.xml: Document SQLITE3 backend, patch by Aurelio Bignoli + * sql/operations.lisp: Add lower and upper SQL functions [Daniel Lowe]. 08 Nov 2004 Kevin Rosenberg - * sql/expressions.lisp: Fix slot name [thanks to - Daniel Lowe] + * sql/expressions.lisp: Fix slot name [thanks to Daniel Lowe] 31 Oct 2004 Kevin Rosenberg * clsql-sqlite3, db-sqlite3/*: NEW BACKEND diff --git a/db-sqlite3/init-func-sample/Makefile b/db-sqlite3/init-func-sample/Makefile deleted file mode 100644 index de1cf29..0000000 --- a/db-sqlite3/init-func-sample/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# FILE IDENTIFICATION -# -# Name: Makefile -# Purpose: Makefile for SQLite 3 init function example. -# Programer: Aurelio Bignoli -# Date Started: Oct 2004 -# -# CVS Id: $Id$ -# -# This file, part of CLSQL, is Copyright (c) 2004 by Aurelio Bignoli -# -# CLSQL users are granted the rights to distribute and use this software -# as governed by the terms of the Lisp Lesser GNU Public License -# (http://opensource.franz.com/preamble.html), also known as the LLGPL. - -sqlite3-utils.so: iso-8859-15-coll.c Makefile - gcc -c -fPIC iso-8859-15-coll.c -o iso-8859-15-coll.o - gcc -shared iso-8859-15-coll.o -o sqlite3-utils.so -l sqlite3 - diff --git a/db-sqlite3/init-func-sample/example.lisp b/db-sqlite3/init-func-sample/example.lisp deleted file mode 100644 index 1a81645..0000000 --- a/db-sqlite3/init-func-sample/example.lisp +++ /dev/null @@ -1,70 +0,0 @@ -;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- -;;;; ************************************************************************* -;;;; FILE IDENTIFICATION -;;;; -;;;; Name: example.lisp -;;;; Purpose: Sample code for SQLite 3 initialization functions -;;;; Authors: Aurelio Bignoli -;;;; Created: Oct 2004 -;;;; -;;;; $Id$ -;;;; -;;;; This file, part of CLSQL, is Copyright (c) 2004 by Aurelio Bignoli -;;;; -;;;; CLSQL users are granted the rights to distribute and use this software -;;;; as governed by the terms of the Lisp Lesser GNU Public License -;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. -;;;; ************************************************************************* - -;;;; Load CLSQL. -(asdf:oos 'asdf:load-op :clsql-sqlite3) - -;;;; Load sqlite3-utils.so library. See Makefile for library creation. -(unless (uffi:load-foreign-library "/usr/lib/clsql/sqlite3-utils.so" - :module "sqlite3-utils" - :supporting-libraries '("c")) - (error "Unable to load foreign library")) - -;;;; Define the foreign function to be used as init function. -(uffi:def-function - ("create_iso_8859_15_ci_collation" create-coll) - ((db sqlite3:sqlite3-db)) - :returning :int - :module "sqlite3-utils") - -;;;; Create the DB using create-coll as init function. -(defparameter db-name "init-func-test.db") -(clsql:destroy-database (list db-name) :database-type :sqlite3) -(clsql:connect (list db-name #'create-coll) :database-type :sqlite3) - -;;;; Create a table. Field f2 uses the newly defined collating -;;;; sequence. -(clsql:execute-command - "CREATE TABLE t1 (f1 CHAR(1), f2 CHAR(1) COLLATE ISO_8859_15_CI)") - -;;;; Populate the table. -(clsql:execute-command "INSERT INTO t1 VALUES ('à', 'à')") -(clsql:execute-command "INSERT INTO t1 VALUES ('a', 'a')") -(clsql:execute-command "INSERT INTO t1 VALUES ('A', 'A')") -(clsql:execute-command "INSERT INTO t1 VALUES ('é', 'é')") -(clsql:execute-command "INSERT INTO t1 VALUES ('e', 'e')") -(clsql:execute-command "INSERT INTO t1 VALUES ('E', 'E')") -(clsql:execute-command "INSERT INTO t1 VALUES ('ì', 'ì')") -(clsql:execute-command "INSERT INTO t1 VALUES ('i', 'i')") -(clsql:execute-command "INSERT INTO t1 VALUES ('I', 'I')") -(clsql:execute-command "INSERT INTO t1 VALUES ('ò', 'ò')") -(clsql:execute-command "INSERT INTO t1 VALUES ('o', 'o')") -(clsql:execute-command "INSERT INTO t1 VALUES ('O', 'O')") -(clsql:execute-command "INSERT INTO t1 VALUES ('ù', 'ù')") -(clsql:execute-command "INSERT INTO t1 VALUES ('u', 'u')") -(clsql:execute-command "INSERT INTO t1 VALUES ('U', 'U')") - -;;;; Perform some SELECTs. -(format t "~&SELECT * FROM t1 ==> ~A~%"(clsql:query "SELECT * FROM t1")) -(format t "~&SELECT * FROM t1 ORDER BY f1 ==> ~A~%" - (clsql:query "SELECT * FROM t1 ORDER BY f1")) -(format t "~&SELECT * FROM t1 ORDER BY f2 ==> ~A~%" - (clsql:query "SELECT * FROM t1 ORDER BY f2")) - -;;;; Disconnect from database. -(clsql:disconnect) \ No newline at end of file diff --git a/db-sqlite3/init-func-sample/iso-8859-15-coll.c b/db-sqlite3/init-func-sample/iso-8859-15-coll.c deleted file mode 100644 index 0e7fea1..0000000 --- a/db-sqlite3/init-func-sample/iso-8859-15-coll.c +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** - * FILE IDENTIFICATION - * - * Name: iso-8859-15-coll.c - * Purpose: SQLite 3 initialization function for - * ISO-8859-15 collating sequence. - * Programmer: Aurelio Bignoli - * Date Started: Oct 2004 - * - * $Id$ - * - * This file, part of CLSQL, is Copyright (c) 2004 by Aurelio Bignoli - * - * CLSQL users are granted the rights to distribute and use this software - * as governed by the terms of the Lisp Lesser GNU Public License - * (http://opensource.franz.com/preamble.html), also known as the LLGPL. - ***************************************************************************/ - - -/* Collating sequence name. CI = Case Insensitive */ -#define ISO_8859_15_CI_NAME "ISO_8859_15_CI" - -/* Conversion table. */ -const unsigned char iso_8859_15_ci [] = { - /* 0 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - /* 1 */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - /* 2 */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, - /* 3 */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, - /* 4 */ 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, - /* 5 */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, - /* 6 */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, - /* 7 */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, - /* 8 */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x73, 0x8B, 0x6F, 0x8D, 0x7A, 0x79, - /* 9 */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x73, 0x9B, 0x6F, 0x9D, 0x7A, 0x79, - /* A */ 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0x73, 0xA7, 0x73, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, - /* B */ 0xB0, 0xB1, 0xB2, 0xB3, 0x7A, 0xB5, 0xB6, 0xB7, 0x7A, 0xB9, 0xBA, 0xBB, 0x6F, 0xBD, 0x79, 0xBF, - /* C */ 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x65, 0x63, 0x65, 0x65, 0x65, 0x65, 0x69, 0x69, 0x69, 0x69, - /* D */ 0x64, 0x6E, 0x6F, 0x6F, 0x6F, 0x6F, 0x6F, 0xD7, 0x6F, 0x75, 0x75, 0x75, 0x75, 0x79, 0xDE, 0x73, - /* E */ 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x65, 0x63, 0x65, 0x65, 0x65, 0x65, 0x69, 0x69, 0x69, 0x69, - /* F */ 0x64, 0x6E, 0x6F, 0x6F, 0x6F, 0x6F, 0x6F, 0xF7, 0x6F, 0x75, 0x75, 0x75, 0x75, 0x79, 0xFE, 0x73 -}; - -/* - * A modified version of sqlite3StrNICmp in sqlite/src/util.c - */ -int iso_8859_15_ci_StrCmp(const char *zLeft, const char *zRight, int N){ - register unsigned char *a, *b; - a = (unsigned char *)zLeft; - b = (unsigned char *)zRight; - while( N-- > 0 && *a!=0 && iso_8859_15_ci[*a]==iso_8859_15_ci[*b]){ a++; b++; } - return N<0 ? 0 : iso_8859_15_ci[*a] - iso_8859_15_ci[*b]; -} - -/* - * A modified version of nocaseCollatinFunc in sqlite/src/main.c. - */ -int iso_8859_15_ci_CollatingFunc( - void *NotUsed, - int nKey1, const void *pKey1, - int nKey2, const void *pKey2 -){ - int r = iso_8859_15_ci_StrCmp( - (const char *)pKey1, (const char *)pKey2, (nKey1 Tue, 9 Nov 2004 11:04:04 -0700 + cl-sql (3.0.11-1) unstable; urgency=low * New usptream diff --git a/doc/appendix.xml b/doc/appendix.xml index d6a50d9..a37c582 100644 --- a/doc/appendix.xml +++ b/doc/appendix.xml @@ -583,6 +583,118 @@ + + &sqlite3; + + Libraries The &sqlite3; back-end requires + the &sqlite3; shared library file. Its default file name is + /usr/lib/libsqlite3.so. + + + Initialization + + Use + +(asdf:operate 'asdf:load-op 'clsql-sqlite3) + + to load the &sqlite3; back-end. The database type for the &sqlite3; + back-end is :sqlite3. + + + + Connection Specification + + Syntax of connection-spec + (filename &optional init-function) + + + Description of connection-spec + + + filename + + String representing the filename of the &sqlite3; + database file. + + + + init-function + + + A function designator. + init-function takes a + single argument of type + sqlite3:sqlite3-db, a foreign pointer to + the C descriptor of the newly opened database. + init-function is called by + the back-end immediately after &sqlite3; + sqlite3_open library function, + and can be used to perform optional database + initializations by calling foreign functions in the + &sqlite3; library. + + + An example of an initialization function which + defines a new collating sequence for text columns is + provided in + ./examples/sqlite3/init-func/. + + + + + + + Notes + Connection + + + + Passing filename a value of + :memory: will create a database in + physical memory instead of using a file on disk. + + + + + Some operations will be many times faster if database + integrity checking is disabled by setting the SYNCHRONOUS + flag to OFF (see the SQLITE manual for details). + + + + + FDDL + + + + The :owner keyword argument to the FDDL functions + for listing and testing for database objects is ignored. + + + + + The :column-list keyword argument to + create-view + is not supported by &sqlite3;. + + + + + Symbolic SQL Syntax + + + + &sqlite3; does not support the all, + some, any and + exists subquery operations. + + + + + + + Oracle diff --git a/doc/entities.inc b/doc/entities.inc index 496d956..25ef73e 100644 --- a/doc/entities.inc +++ b/doc/entities.inc @@ -10,7 +10,8 @@ CommonSQL"> MySQL"> PostgreSQL"> -SQLite"> +SQLite version 2"> +SQLite version 3"> Oracle"> ODBC"> AODBC"> diff --git a/doc/intro.xml b/doc/intro.xml index ea59c4b..5f1ff00 100644 --- a/doc/intro.xml +++ b/doc/intro.xml @@ -42,7 +42,8 @@ Optimized loading of integer and floating-point fields. - Additional database backends: &odbc;, &aodbc;, and &sqlite;. + Additional database backends: &odbc;, &aodbc;, &sqlite; + and &sqlite3;. A compatibility layer for &cmucl; specific code. @@ -131,6 +132,7 @@ &postgresql; v7.4 with both direct API and TCP socket connections. &sqlite;. + &sqlite3;. Direct &odbc; interface. &oracle; OCI. Allegro's DB interface (&aodbc;). diff --git a/examples/sqlite3/init-func/Makefile b/examples/sqlite3/init-func/Makefile new file mode 100644 index 0000000..de1cf29 --- /dev/null +++ b/examples/sqlite3/init-func/Makefile @@ -0,0 +1,19 @@ +# FILE IDENTIFICATION +# +# Name: Makefile +# Purpose: Makefile for SQLite 3 init function example. +# Programer: Aurelio Bignoli +# Date Started: Oct 2004 +# +# CVS Id: $Id$ +# +# This file, part of CLSQL, is Copyright (c) 2004 by Aurelio Bignoli +# +# CLSQL users are granted the rights to distribute and use this software +# as governed by the terms of the Lisp Lesser GNU Public License +# (http://opensource.franz.com/preamble.html), also known as the LLGPL. + +sqlite3-utils.so: iso-8859-15-coll.c Makefile + gcc -c -fPIC iso-8859-15-coll.c -o iso-8859-15-coll.o + gcc -shared iso-8859-15-coll.o -o sqlite3-utils.so -l sqlite3 + diff --git a/examples/sqlite3/init-func/example.lisp b/examples/sqlite3/init-func/example.lisp new file mode 100644 index 0000000..1a81645 --- /dev/null +++ b/examples/sqlite3/init-func/example.lisp @@ -0,0 +1,70 @@ +;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- +;;;; ************************************************************************* +;;;; FILE IDENTIFICATION +;;;; +;;;; Name: example.lisp +;;;; Purpose: Sample code for SQLite 3 initialization functions +;;;; Authors: Aurelio Bignoli +;;;; Created: Oct 2004 +;;;; +;;;; $Id$ +;;;; +;;;; This file, part of CLSQL, is Copyright (c) 2004 by Aurelio Bignoli +;;;; +;;;; CLSQL users are granted the rights to distribute and use this software +;;;; as governed by the terms of the Lisp Lesser GNU Public License +;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. +;;;; ************************************************************************* + +;;;; Load CLSQL. +(asdf:oos 'asdf:load-op :clsql-sqlite3) + +;;;; Load sqlite3-utils.so library. See Makefile for library creation. +(unless (uffi:load-foreign-library "/usr/lib/clsql/sqlite3-utils.so" + :module "sqlite3-utils" + :supporting-libraries '("c")) + (error "Unable to load foreign library")) + +;;;; Define the foreign function to be used as init function. +(uffi:def-function + ("create_iso_8859_15_ci_collation" create-coll) + ((db sqlite3:sqlite3-db)) + :returning :int + :module "sqlite3-utils") + +;;;; Create the DB using create-coll as init function. +(defparameter db-name "init-func-test.db") +(clsql:destroy-database (list db-name) :database-type :sqlite3) +(clsql:connect (list db-name #'create-coll) :database-type :sqlite3) + +;;;; Create a table. Field f2 uses the newly defined collating +;;;; sequence. +(clsql:execute-command + "CREATE TABLE t1 (f1 CHAR(1), f2 CHAR(1) COLLATE ISO_8859_15_CI)") + +;;;; Populate the table. +(clsql:execute-command "INSERT INTO t1 VALUES ('à', 'à')") +(clsql:execute-command "INSERT INTO t1 VALUES ('a', 'a')") +(clsql:execute-command "INSERT INTO t1 VALUES ('A', 'A')") +(clsql:execute-command "INSERT INTO t1 VALUES ('é', 'é')") +(clsql:execute-command "INSERT INTO t1 VALUES ('e', 'e')") +(clsql:execute-command "INSERT INTO t1 VALUES ('E', 'E')") +(clsql:execute-command "INSERT INTO t1 VALUES ('ì', 'ì')") +(clsql:execute-command "INSERT INTO t1 VALUES ('i', 'i')") +(clsql:execute-command "INSERT INTO t1 VALUES ('I', 'I')") +(clsql:execute-command "INSERT INTO t1 VALUES ('ò', 'ò')") +(clsql:execute-command "INSERT INTO t1 VALUES ('o', 'o')") +(clsql:execute-command "INSERT INTO t1 VALUES ('O', 'O')") +(clsql:execute-command "INSERT INTO t1 VALUES ('ù', 'ù')") +(clsql:execute-command "INSERT INTO t1 VALUES ('u', 'u')") +(clsql:execute-command "INSERT INTO t1 VALUES ('U', 'U')") + +;;;; Perform some SELECTs. +(format t "~&SELECT * FROM t1 ==> ~A~%"(clsql:query "SELECT * FROM t1")) +(format t "~&SELECT * FROM t1 ORDER BY f1 ==> ~A~%" + (clsql:query "SELECT * FROM t1 ORDER BY f1")) +(format t "~&SELECT * FROM t1 ORDER BY f2 ==> ~A~%" + (clsql:query "SELECT * FROM t1 ORDER BY f2")) + +;;;; Disconnect from database. +(clsql:disconnect) \ No newline at end of file diff --git a/examples/sqlite3/init-func/iso-8859-15-coll.c b/examples/sqlite3/init-func/iso-8859-15-coll.c new file mode 100644 index 0000000..0e7fea1 --- /dev/null +++ b/examples/sqlite3/init-func/iso-8859-15-coll.c @@ -0,0 +1,79 @@ +/**************************************************************************** + * FILE IDENTIFICATION + * + * Name: iso-8859-15-coll.c + * Purpose: SQLite 3 initialization function for + * ISO-8859-15 collating sequence. + * Programmer: Aurelio Bignoli + * Date Started: Oct 2004 + * + * $Id$ + * + * This file, part of CLSQL, is Copyright (c) 2004 by Aurelio Bignoli + * + * CLSQL users are granted the rights to distribute and use this software + * as governed by the terms of the Lisp Lesser GNU Public License + * (http://opensource.franz.com/preamble.html), also known as the LLGPL. + ***************************************************************************/ + + +/* Collating sequence name. CI = Case Insensitive */ +#define ISO_8859_15_CI_NAME "ISO_8859_15_CI" + +/* Conversion table. */ +const unsigned char iso_8859_15_ci [] = { + /* 0 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + /* 1 */ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + /* 2 */ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + /* 3 */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + /* 4 */ 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + /* 5 */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, + /* 6 */ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + /* 7 */ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, + /* 8 */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x73, 0x8B, 0x6F, 0x8D, 0x7A, 0x79, + /* 9 */ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x73, 0x9B, 0x6F, 0x9D, 0x7A, 0x79, + /* A */ 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0x73, 0xA7, 0x73, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, + /* B */ 0xB0, 0xB1, 0xB2, 0xB3, 0x7A, 0xB5, 0xB6, 0xB7, 0x7A, 0xB9, 0xBA, 0xBB, 0x6F, 0xBD, 0x79, 0xBF, + /* C */ 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x65, 0x63, 0x65, 0x65, 0x65, 0x65, 0x69, 0x69, 0x69, 0x69, + /* D */ 0x64, 0x6E, 0x6F, 0x6F, 0x6F, 0x6F, 0x6F, 0xD7, 0x6F, 0x75, 0x75, 0x75, 0x75, 0x79, 0xDE, 0x73, + /* E */ 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x65, 0x63, 0x65, 0x65, 0x65, 0x65, 0x69, 0x69, 0x69, 0x69, + /* F */ 0x64, 0x6E, 0x6F, 0x6F, 0x6F, 0x6F, 0x6F, 0xF7, 0x6F, 0x75, 0x75, 0x75, 0x75, 0x79, 0xFE, 0x73 +}; + +/* + * A modified version of sqlite3StrNICmp in sqlite/src/util.c + */ +int iso_8859_15_ci_StrCmp(const char *zLeft, const char *zRight, int N){ + register unsigned char *a, *b; + a = (unsigned char *)zLeft; + b = (unsigned char *)zRight; + while( N-- > 0 && *a!=0 && iso_8859_15_ci[*a]==iso_8859_15_ci[*b]){ a++; b++; } + return N<0 ? 0 : iso_8859_15_ci[*a] - iso_8859_15_ci[*b]; +} + +/* + * A modified version of nocaseCollatinFunc in sqlite/src/main.c. + */ +int iso_8859_15_ci_CollatingFunc( + void *NotUsed, + int nKey1, const void *pKey1, + int nKey2, const void *pKey2 +){ + int r = iso_8859_15_ci_StrCmp( + (const char *)pKey1, (const char *)pKey2, (nKey1