| OLD | NEW |
| 1 /* | 1 /* |
| 2 ** 2006 Oct 10 | 2 ** 2006 Oct 10 |
| 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 ** | 12 ** |
| 13 ** Implementation of the "simple" full-text-search tokenizer. | 13 ** Implementation of the "simple" full-text-search tokenizer. |
| 14 */ | 14 */ |
| 15 | 15 |
| 16 /* | 16 /* |
| 17 ** The code in this file is only compiled if: | 17 ** The code in this file is only compiled if: |
| 18 ** | 18 ** |
| 19 ** * The FTS3 module is being built as an extension | 19 ** * The FTS3 module is being built as an extension |
| 20 ** (in which case SQLITE_CORE is not defined), or | 20 ** (in which case SQLITE_CORE is not defined), or |
| 21 ** | 21 ** |
| 22 ** * The FTS3 module is being built into the core of | 22 ** * The FTS3 module is being built into the core of |
| 23 ** SQLite (in which case SQLITE_ENABLE_FTS3 is defined). | 23 ** SQLite (in which case SQLITE_ENABLE_FTS3 is defined). |
| 24 */ | 24 */ |
| 25 #include "fts3Int.h" |
| 25 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) | 26 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) |
| 26 | 27 |
| 27 #include "fts3Int.h" | |
| 28 | |
| 29 #include <assert.h> | 28 #include <assert.h> |
| 30 #include <stdlib.h> | 29 #include <stdlib.h> |
| 31 #include <stdio.h> | 30 #include <stdio.h> |
| 32 #include <string.h> | 31 #include <string.h> |
| 33 | 32 |
| 34 #include "fts3_tokenizer.h" | 33 #include "fts3_tokenizer.h" |
| 35 | 34 |
| 36 typedef struct simple_tokenizer { | 35 typedef struct simple_tokenizer { |
| 37 sqlite3_tokenizer base; | 36 sqlite3_tokenizer base; |
| 38 char delim[128]; /* flag ASCII delimiters */ | 37 char delim[128]; /* flag ASCII delimiters */ |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 /* | 211 /* |
| 213 ** The set of routines that implement the simple tokenizer | 212 ** The set of routines that implement the simple tokenizer |
| 214 */ | 213 */ |
| 215 static const sqlite3_tokenizer_module simpleTokenizerModule = { | 214 static const sqlite3_tokenizer_module simpleTokenizerModule = { |
| 216 0, | 215 0, |
| 217 simpleCreate, | 216 simpleCreate, |
| 218 simpleDestroy, | 217 simpleDestroy, |
| 219 simpleOpen, | 218 simpleOpen, |
| 220 simpleClose, | 219 simpleClose, |
| 221 simpleNext, | 220 simpleNext, |
| 221 0, |
| 222 }; | 222 }; |
| 223 | 223 |
| 224 /* | 224 /* |
| 225 ** Allocate a new simple tokenizer. Return a pointer to the new | 225 ** Allocate a new simple tokenizer. Return a pointer to the new |
| 226 ** tokenizer in *ppModule | 226 ** tokenizer in *ppModule |
| 227 */ | 227 */ |
| 228 void sqlite3Fts3SimpleTokenizerModule( | 228 void sqlite3Fts3SimpleTokenizerModule( |
| 229 sqlite3_tokenizer_module const**ppModule | 229 sqlite3_tokenizer_module const**ppModule |
| 230 ){ | 230 ){ |
| 231 *ppModule = &simpleTokenizerModule; | 231 *ppModule = &simpleTokenizerModule; |
| 232 } | 232 } |
| 233 | 233 |
| 234 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ | 234 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
| OLD | NEW |