Fix the test_spellfix.c extension so that it can be made loadable at run-time.

Add spellfix to the shell when building using the build-shell.sh script.

FossilOrigin-Name: 7813b17d8b9fe48ddc841fe1c4bb75f7747073de
This commit is contained in:
drh 2013-01-25 19:11:31 +00:00
parent d3ac7d9b51
commit ef4c035275
6 changed files with 28 additions and 14 deletions

View File

@ -1,5 +1,5 @@
C Enhance\sthe\scommand-line\sshell\sso\sthat\sadding\sa\snon-zero\snumeric\sargument\nto\sthe\s".exit"\scommand\scauses\san\simmediate\sexit\swithout\scleaning\sup.\s\sThis\ncan\sbe\sused\s(for\sexample)\sto\scause\sjournal\sfiles\sto\sbe\sleft\sbehind.
D 2013-01-25T18:33:43.155
C Fix\sthe\stest_spellfix.c\sextension\sso\sthat\sit\scan\sbe\smade\sloadable\sat\srun-time.\nAdd\sspellfix\sto\sthe\sshell\swhen\sbuilding\susing\sthe\sbuild-shell.sh\sscript.
D 2013-01-25T19:11:31.894
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in a48faa9e7dd7d556d84f5456eabe5825dd8a6282
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -175,7 +175,7 @@ F src/random.c cd4a67b3953b88019f8cd4ccd81394a8ddfaba50
F src/resolve.c 0bca3bf694f14f96a13873d87f62d6a6f38f913f
F src/rowset.c 64655f1a627c9c212d9ab497899e7424a34222e0
F src/select.c 395e458a6dc611cbe1179f424753f0c344957607
F src/shell.c db1b04cc1f0039b40d87d3b12382a55b8041edb3
F src/shell.c 215278ae0c4d06a373f885a030b8a522ccb34423
F src/sqlite.h.in 39cc33bb08897c748fe3383c29ccf56585704177
F src/sqlite3.rc fea433eb0a59f4c9393c8e6d76a6e2596b1fe0c0
F src/sqlite3ext.h 6904f4aadf976f95241311fbffb00823075d9477
@ -191,7 +191,7 @@ F src/test4.c bf9fa9bece01de08e6f5e02314e4af5c13590dfa
F src/test5.c a6d1ac55ac054d0b2b8f37b5e655b6c92645a013
F src/test6.c 938794c970ed6810036c8d28450ca28166524bf7
F src/test7.c 2e0781754905c8adc3268d8f0967e7633af58843
F src/test8.c 8bcce65e5ee027fbfd7da41d28371aabbfd369ff
F src/test8.c 58ea1d9698f3947e4662107ef98f429e84ae20e0
F src/test9.c bea1e8cf52aa93695487badedd6e1886c321ea60
F src/test_async.c 0612a752896fad42d55c3999a5122af10dcf22ad
F src/test_autoext.c 30e7bd98ab6d70a62bb9ba572e4c7df347fe645e
@ -222,7 +222,7 @@ F src/test_regexp.c 58e0349f155bc307dfa209df4b03add0a7749866
F src/test_rtree.c aba603c949766c4193f1068b91c787f57274e0d9
F src/test_schema.c 8c06ef9ddb240c7a0fcd31bc221a6a2aade58bf0
F src/test_server.c 2f99eb2837dfa06a4aacf24af24c6affdf66a84f
F src/test_spellfix.c 76dd8d3111d2f5354c374f71fa23b752bd0b029c
F src/test_spellfix.c 4b3fb3ef465736499e5c34ccb51fad6c53ee1e78
F src/test_sqllog.c 8acb843ddb9928dea8962e31bb09f421a72ffccb
F src/test_stat.c d1569c7a4839f13e80187e2c26b2ab4da2d03935
F src/test_superlock.c 2b97936ca127d13962c3605dbc9a4ef269c424cd
@ -991,7 +991,7 @@ F test/win32lock.test b2a539e85ae6b2d78475e016a9636b4451dc7fb9
F test/zeroblob.test caaecfb4f908f7bc086ed238668049f96774d688
F test/zerodamage.test e7f77fded01dfcdf92ac2c5400f1e35d7a21463c
F tool/build-all-msvc.bat 74fb6e5cca66ebdb6c9bbafb2f8b802f08146d38 x
F tool/build-shell.sh 562df23cfdd25822b909b382afd5f99d968437fe
F tool/build-shell.sh a9c34a606e2e522ba9eeca1e07090f67dce8c912
F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2
F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b
F tool/extract.c 054069d81b095fbdc189a6f5d4466e40380505e2
@ -1034,7 +1034,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
P 93b159da5d2570946fdcd7da120bf7eb82b840f3
R 406acb5b4563a45b5fb4ca4f5d25c7e8
P 8ba951d1b76a0fb0ffd9bc6cec1be3ddba80538a
R 9a2d8f5f4d115edcfe69986ba4b2649a
U drh
Z e3f5a516951f63a749e29f3ec2e96b93
Z 8bf13d977bccfa7aed2cdb0fd1df798c

View File

@ -1 +1 @@
8ba951d1b76a0fb0ffd9bc6cec1be3ddba80538a
7813b17d8b9fe48ddc841fe1c4bb75f7747073de

View File

@ -1485,6 +1485,12 @@ static void open_db(struct callback_data *p){
extern int sqlite3_add_regexp_func(sqlite3*);
sqlite3_add_regexp_func(db);
}
#endif
#ifdef SQLITE_ENABLE_SPELLFIX
{
extern int sqlite3_spellfix1_register(sqlite3*);
sqlite3_spellfix1_register(db);
}
#endif
}
}

View File

@ -1389,7 +1389,7 @@ static int register_spellfix_module(
}
if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
sqlite3Spellfix1Register(db);
sqlite3_spellfix1_register(db);
return TCL_OK;
}

View File

@ -21,6 +21,11 @@
# include <stdio.h>
# include <stdlib.h>
# include "sqlite3ext.h"
# include <assert.h>
# define ALWAYS(X) 1
# define NEVER(X) 0
typedef unsigned char u8;
typedef unsigned short u16;
SQLITE_EXTENSION_INIT1
#endif /* !SQLITE_CORE */
#include <ctype.h>
@ -2809,7 +2814,7 @@ static int spellfix1Register(sqlite3 *db){
/*
** Register the spellfix1 virtual table and its associated functions.
*/
int sqlite3Spellfix1Register(sqlite3 *db){
int sqlite3_spellfix1_register(sqlite3 *db){
return spellfix1Register(db);
}
#endif
@ -2819,7 +2824,7 @@ int sqlite3Spellfix1Register(sqlite3 *db){
/*
** Extension load function.
*/
int sqlite3_extension_init(
int sqlite3_spellfix1_init(
sqlite3 *db,
char **pzErrMsg,
const sqlite3_api_routines *pApi

View File

@ -16,8 +16,11 @@ gcc -o sqlite3 -g -Os -I. \
-DSQLITE_ENABLE_FTS4 \
-DSQLITE_ENABLE_RTREE \
-DSQLITE_ENABLE_REGEXP \
-DSQLITE_ENABLE_SPELLFIX -DSQLITE_CORE=1 \
-DHAVE_READLINE \
-DHAVE_USLEEP=1 \
../sqlite/src/shell.c ../sqlite/src/test_vfstrace.c \
../sqlite/src/shell.c \
../sqlite/src/test_regexp.c \
../sqlite/src/test_spellfix.c \
../sqlite/src/test_vfstrace.c \
sqlite3.c -ldl -lreadline -lncurses