/ Check-in [29e69f38]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Changes to allow FTS to be compiled as a loadable module again.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 29e69f389cb0078e125ba5814a68b3fe8cf634c6
User & Date: dan 2011-06-28 07:15:43
Context
2011-06-28
14:16
Merge the fts3-changes branch back into the trunk. check-in: b9477eb0 user: dan tags: trunk
09:51
Merge latest trunk changes with fts3-changes branch. check-in: 22668647 user: dan tags: fts3-changes
07:15
Changes to allow FTS to be compiled as a loadable module again. check-in: 29e69f38 user: dan tags: trunk
2011-06-27
19:37
Remove an unnecessary assignment from vdbeapi.c. check-in: 6c871ac1 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts3/fts3Int.h.

    23     23   ** SQLITE_ENABLE_FTS3 macro.  But to avoid confusion we also all
    24     24   ** the SQLITE_ENABLE_FTS4 macro to serve as an alisse for SQLITE_ENABLE_FTS3.
    25     25   */
    26     26   #if defined(SQLITE_ENABLE_FTS4) && !defined(SQLITE_ENABLE_FTS3)
    27     27   # define SQLITE_ENABLE_FTS3
    28     28   #endif
    29     29   
    30         -#ifdef SQLITE_ENABLE_FTS3
           30  +#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
           31  +
           32  +/* If not building as part of the core, include sqlite3ext.h. */
           33  +#ifndef SQLITE_CORE
           34  +# include "sqlite3ext.h" 
           35  +extern const sqlite3_api_routines *sqlite3_api;
           36  +#endif
           37  +
    31     38   #include "sqlite3.h"
    32     39   #include "fts3_tokenizer.h"
    33     40   #include "fts3_hash.h"
    34     41   
    35     42   /*
    36     43   ** This constant controls how often segments are merged. Once there are
    37     44   ** FTS3_MERGE_COUNT segments of level N, they are merged into a single
................................................................................
   509    516       Fts3Table *, Fts3MultiSegReader *, sqlite3_int64 *, char **, int *);
   510    517   char *sqlite3Fts3EvalPhrasePoslist(Fts3Cursor *, Fts3Expr *, int iCol); 
   511    518   int sqlite3Fts3MsrOvfl(Fts3Cursor *, Fts3MultiSegReader *, int *);
   512    519   int sqlite3Fts3MsrIncrRestart(Fts3MultiSegReader *pCsr);
   513    520   
   514    521   int sqlite3Fts3DeferredTokenList(Fts3DeferredToken *, char **, int *);
   515    522   
   516         -#endif /* SQLITE_ENABLE_FTS3 */
          523  +#endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */
   517    524   #endif /* _FTSINT_H */

Changes to ext/fts3/fts3_hash.c.

    26     26   #include "fts3Int.h"
    27     27   #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
    28     28   
    29     29   #include <assert.h>
    30     30   #include <stdlib.h>
    31     31   #include <string.h>
    32     32   
    33         -#include "sqlite3.h"
    34     33   #include "fts3_hash.h"
    35     34   
    36     35   /*
    37     36   ** Malloc and Free functions
    38     37   */
    39     38   static void *fts3HashMalloc(int n){
    40     39     void *p = sqlite3_malloc(n);

Changes to ext/fts3/fts3_test.c.

    14     14   ** testing. It contains a Tcl command that can be used to test if a document
    15     15   ** matches an FTS NEAR expression.
    16     16   */
    17     17   
    18     18   #include <tcl.h>
    19     19   #include <string.h>
    20     20   #include <assert.h>
           21  +
           22  +#ifdef SQLITE_TEST
    21     23   
    22     24   /* Required so that the "ifdef SQLITE_ENABLE_FTS3" below works */
    23     25   #include "fts3Int.h"
    24     26   
    25     27   #define NM_MAX_TOKEN 12
    26     28   
    27     29   typedef struct NearPhrase NearPhrase;
................................................................................
   315    317   int Sqlitetestfts3_Init(Tcl_Interp *interp){
   316    318     Tcl_CreateObjCommand(interp, "fts3_near_match", fts3_near_match_cmd, 0, 0);
   317    319     Tcl_CreateObjCommand(interp, 
   318    320         "fts3_configure_incr_load", fts3_configure_incr_load_cmd, 0, 0
   319    321     );
   320    322     return TCL_OK;
   321    323   }
          324  +#endif                  /* ifdef SQLITE_TEST */

Changes to ext/fts3/fts3_tokenizer.c.

    19     19   **
    20     20   **     * The FTS3 module is being built as an extension
    21     21   **       (in which case SQLITE_CORE is not defined), or
    22     22   **
    23     23   **     * The FTS3 module is being built into the core of
    24     24   **       SQLite (in which case SQLITE_ENABLE_FTS3 is defined).
    25     25   */
    26         -#include "sqlite3ext.h"
    27         -#ifndef SQLITE_CORE
    28         -  SQLITE_EXTENSION_INIT1
    29         -#endif
    30     26   #include "fts3Int.h"
    31         -
    32     27   #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
    33     28   
    34     29   #include <assert.h>
    35     30   #include <string.h>
    36     31   
    37     32   /*
    38     33   ** Implementation of the SQL scalar function for accessing the underlying 

Changes to src/loadext.c.

    80     80   # define sqlite3_progress_handler 0
    81     81   #endif
    82     82   
    83     83   #ifdef SQLITE_OMIT_VIRTUALTABLE
    84     84   # define sqlite3_create_module 0
    85     85   # define sqlite3_create_module_v2 0
    86     86   # define sqlite3_declare_vtab 0
           87  +# define sqlite3_vtab_config 0
           88  +# define sqlite3_vtab_on_conflict 0
    87     89   #endif
    88     90   
    89     91   #ifdef SQLITE_OMIT_SHARED_CACHE
    90     92   # define sqlite3_enable_shared_cache 0
    91     93   #endif
    92     94   
    93     95   #ifdef SQLITE_OMIT_TRACE
................................................................................
   103    105   #ifdef SQLITE_OMIT_INCRBLOB
   104    106   #define sqlite3_bind_zeroblob  0
   105    107   #define sqlite3_blob_bytes     0
   106    108   #define sqlite3_blob_close     0
   107    109   #define sqlite3_blob_open      0
   108    110   #define sqlite3_blob_read      0
   109    111   #define sqlite3_blob_write     0
          112  +#define sqlite3_blob_reopen    0
   110    113   #endif
   111    114   
   112    115   /*
   113    116   ** The following structure contains pointers to all SQLite API routines.
   114    117   ** A pointer to this structure is passed into extensions when they are
   115    118   ** loaded so that the extension can make calls back into the SQLite
   116    119   ** library.
................................................................................
   368    371     sqlite3_wal_checkpoint,
   369    372     sqlite3_wal_hook,
   370    373   #else
   371    374     0,
   372    375     0,
   373    376     0,
   374    377   #endif
          378  +  sqlite3_blob_reopen,
          379  +  sqlite3_vtab_config,
          380  +  sqlite3_vtab_on_conflict,
   375    381   };
   376    382   
   377    383   /*
   378    384   ** Attempt to load an SQLite extension library contained in the file
   379    385   ** zFile.  The entry point is zProc.  zProc may be 0 in which case a
   380    386   ** default entry point name (sqlite3_extension_init) is used.  Use
   381    387   ** of the default name is recommended.

Changes to src/sqlite3ext.h.

   208    208     const char *(*sourceid)(void);
   209    209     int (*stmt_status)(sqlite3_stmt*,int,int);
   210    210     int (*strnicmp)(const char*,const char*,int);
   211    211     int (*unlock_notify)(sqlite3*,void(*)(void**,int),void*);
   212    212     int (*wal_autocheckpoint)(sqlite3*,int);
   213    213     int (*wal_checkpoint)(sqlite3*,const char*);
   214    214     void *(*wal_hook)(sqlite3*,int(*)(void*,sqlite3*,const char*,int),void*);
          215  +  int (*blob_reopen)(sqlite3_blob*,sqlite3_int64);
          216  +  int (*vtab_config)(sqlite3*,int op,...);
          217  +  int (*vtab_on_conflict)(sqlite3*);
   215    218   };
   216    219   
   217    220   /*
   218    221   ** The following macros redefine the API routines so that they are
   219    222   ** redirected throught the global sqlite3_api structure.
   220    223   **
   221    224   ** This header file is also used by the loadext.c source file
................................................................................
   408    411   #define sqlite3_sourceid               sqlite3_api->sourceid
   409    412   #define sqlite3_stmt_status            sqlite3_api->stmt_status
   410    413   #define sqlite3_strnicmp               sqlite3_api->strnicmp
   411    414   #define sqlite3_unlock_notify          sqlite3_api->unlock_notify
   412    415   #define sqlite3_wal_autocheckpoint     sqlite3_api->wal_autocheckpoint
   413    416   #define sqlite3_wal_checkpoint         sqlite3_api->wal_checkpoint
   414    417   #define sqlite3_wal_hook               sqlite3_api->wal_hook
          418  +#define sqlite3_blob_reopen            sqlite3_api->blob_reopen
          419  +#define sqlite3_vtab_config            sqlite3_api->vtab_config
          420  +#define sqlite3_vtab_on_conflict       sqlite3_api->vtab_on_conflict
   415    421   #endif /* SQLITE_CORE */
   416    422   
   417    423   #define SQLITE_EXTENSION_INIT1     const sqlite3_api_routines *sqlite3_api = 0;
   418    424   #define SQLITE_EXTENSION_INIT2(v)  sqlite3_api = v;
   419    425   
   420    426   #endif /* _SQLITE3EXT_H_ */