| OLD | NEW |
| 1 /* | 1 /* |
| 2 ** 2007 May 6 | 2 ** 2007 May 6 |
| 3 ** | 3 ** |
| 4 ** The author disclaims copyright to this source code. In place of | 4 ** The author disclaims copyright to this source code. In place of |
| 5 ** a legal notice, here is a blessing: | 5 ** a legal notice, here is a blessing: |
| 6 ** | 6 ** |
| 7 ** May you do good and not evil. | 7 ** May you do good and not evil. |
| 8 ** May you find forgiveness for yourself and forgive others. | 8 ** May you find forgiveness for yourself and forgive others. |
| 9 ** May you share freely, never taking more than you give. | 9 ** May you share freely, never taking more than you give. |
| 10 ** | 10 ** |
| 11 ************************************************************************* | 11 ************************************************************************* |
| 12 ** $Id: icu.c,v 1.7 2007/12/13 21:54:11 drh Exp $ | 12 ** $Id: icu.c,v 1.7 2007/12/13 21:54:11 drh Exp $ |
| 13 ** | 13 ** |
| 14 ** This file implements an integration between the ICU library | 14 ** This file implements an integration between the ICU library |
| 15 ** ("International Components for Unicode", an open-source library | 15 ** ("International Components for Unicode", an open-source library |
| 16 ** for handling unicode data) and SQLite. The integration uses | 16 ** for handling unicode data) and SQLite. The integration uses |
| 17 ** ICU to provide the following to SQLite: | 17 ** ICU to provide the following to SQLite: |
| 18 ** | 18 ** |
| 19 ** * An implementation of the SQL regexp() function (and hence REGEXP | 19 ** * An implementation of the SQL regexp() function (and hence REGEXP |
| 20 ** operator) using the ICU uregex_XX() APIs. | 20 ** operator) using the ICU uregex_XX() APIs. |
| 21 ** | 21 ** |
| 22 ** * Implementations of the SQL scalar upper() and lower() functions | 22 ** * Implementations of the SQL scalar upper() and lower() functions |
| 23 ** for case mapping. | 23 ** for case mapping. |
| 24 ** | 24 ** |
| 25 ** * Integration of ICU and SQLite collation seqences. | 25 ** * Integration of ICU and SQLite collation sequences. |
| 26 ** | 26 ** |
| 27 ** * An implementation of the LIKE operator that uses ICU to | 27 ** * An implementation of the LIKE operator that uses ICU to |
| 28 ** provide case-independent matching. | 28 ** provide case-independent matching. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_ICU) | 31 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_ICU) |
| 32 | 32 |
| 33 /* Include ICU headers */ | 33 /* Include ICU headers */ |
| 34 #include <unicode/utypes.h> | 34 #include <unicode/utypes.h> |
| 35 #include <unicode/uregex.h> | 35 #include <unicode/uregex.h> |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 struct IcuScalar *p = &scalars[i]; | 481 struct IcuScalar *p = &scalars[i]; |
| 482 rc = sqlite3_create_function( | 482 rc = sqlite3_create_function( |
| 483 db, p->zName, p->nArg, p->enc, p->pContext, p->xFunc, 0, 0 | 483 db, p->zName, p->nArg, p->enc, p->pContext, p->xFunc, 0, 0 |
| 484 ); | 484 ); |
| 485 } | 485 } |
| 486 | 486 |
| 487 return rc; | 487 return rc; |
| 488 } | 488 } |
| 489 | 489 |
| 490 #if !SQLITE_CORE | 490 #if !SQLITE_CORE |
| 491 int sqlite3_extension_init( | 491 #ifdef _WIN32 |
| 492 __declspec(dllexport) |
| 493 #endif |
| 494 int sqlite3_icu_init( |
| 492 sqlite3 *db, | 495 sqlite3 *db, |
| 493 char **pzErrMsg, | 496 char **pzErrMsg, |
| 494 const sqlite3_api_routines *pApi | 497 const sqlite3_api_routines *pApi |
| 495 ){ | 498 ){ |
| 496 SQLITE_EXTENSION_INIT2(pApi) | 499 SQLITE_EXTENSION_INIT2(pApi) |
| 497 return sqlite3IcuInit(db); | 500 return sqlite3IcuInit(db); |
| 498 } | 501 } |
| 499 #endif | 502 #endif |
| 500 | 503 |
| 501 #endif | 504 #endif |
| OLD | NEW |