OLD | NEW |
1 /* | 1 /* |
2 ** 2001 September 22 | 2 ** 2001 September 22 |
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 ** |
(...skipping 12 matching lines...) Expand all Loading... |
23 ** * The FTS2 module is being built into the core of | 23 ** * The FTS2 module is being built into the core of |
24 ** SQLite (in which case SQLITE_ENABLE_FTS2 is defined). | 24 ** SQLite (in which case SQLITE_ENABLE_FTS2 is defined). |
25 */ | 25 */ |
26 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2) | 26 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2) |
27 | 27 |
28 #include <assert.h> | 28 #include <assert.h> |
29 #include <stdlib.h> | 29 #include <stdlib.h> |
30 #include <string.h> | 30 #include <string.h> |
31 | 31 |
32 #include "sqlite3.h" | 32 #include "sqlite3.h" |
| 33 #include "sqlite3ext.h" |
| 34 SQLITE_EXTENSION_INIT3 |
33 #include "fts2_hash.h" | 35 #include "fts2_hash.h" |
34 | 36 |
35 /* | 37 /* |
36 ** Malloc and Free functions | 38 ** Malloc and Free functions |
37 */ | 39 */ |
38 static void *fts2HashMalloc(int n){ | 40 static void *fts2HashMalloc(int n){ |
39 void *p = sqlite3_malloc(n); | 41 void *p = sqlite3_malloc(n); |
40 if( p ){ | 42 if( p ){ |
41 memset(p, 0, n); | 43 memset(p, 0, n); |
42 } | 44 } |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 } | 367 } |
366 assert( pH->htsize>0 ); | 368 assert( pH->htsize>0 ); |
367 assert( (pH->htsize & (pH->htsize-1))==0 ); | 369 assert( (pH->htsize & (pH->htsize-1))==0 ); |
368 h = hraw & (pH->htsize-1); | 370 h = hraw & (pH->htsize-1); |
369 insertElement(pH, &pH->ht[h], new_elem); | 371 insertElement(pH, &pH->ht[h], new_elem); |
370 new_elem->data = data; | 372 new_elem->data = data; |
371 return 0; | 373 return 0; |
372 } | 374 } |
373 | 375 |
374 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2) */ | 376 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2) */ |
OLD | NEW |