aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.msc61
-rw-r--r--autoconf/Makefile.msc8
-rw-r--r--ext/fts2/fts2_tokenizer.c6
-rw-r--r--ext/fts3/fts3_test.c17
-rw-r--r--ext/fts3/fts3_tokenizer.c6
-rw-r--r--ext/fts5/fts5_tcl.c6
-rw-r--r--ext/misc/percentile.c2
-rw-r--r--ext/misc/spellfix.c2
-rw-r--r--ext/rbu/test_rbu.c12
-rw-r--r--ext/session/test_session.c6
-rw-r--r--manifest113
-rw-r--r--manifest.uuid2
-rw-r--r--src/sqlite.h.in11
-rw-r--r--src/sqliteInt.h8
-rw-r--r--src/tclsqlite.c65
-rw-r--r--src/test1.c368
-rw-r--r--src/test2.c46
-rw-r--r--src/test3.c36
-rw-r--r--src/test4.c36
-rw-r--r--src/test5.c14
-rw-r--r--src/test6.c20
-rw-r--r--src/test7.c32
-rw-r--r--src/test8.c10
-rw-r--r--src/test9.c12
-rw-r--r--src/test_async.c19
-rw-r--r--src/test_autoext.c23
-rw-r--r--src/test_backup.c15
-rw-r--r--src/test_bestindex.c8
-rw-r--r--src/test_blob.c16
-rw-r--r--src/test_btree.c8
-rw-r--r--src/test_config.c6
-rw-r--r--src/test_demovfs.c13
-rw-r--r--src/test_fs.c8
-rw-r--r--src/test_func.c10
-rw-r--r--src/test_hexio.c20
-rw-r--r--src/test_init.c14
-rw-r--r--src/test_intarray.c13
-rw-r--r--src/test_malloc.c70
-rw-r--r--src/test_multiplex.c17
-rw-r--r--src/test_mutex.c28
-rw-r--r--src/test_osinst.c11
-rw-r--r--src/test_quota.c79
-rw-r--r--src/test_rtree.c16
-rw-r--r--src/test_schema.c12
-rw-r--r--src/test_superlock.c15
-rw-r--r--src/test_syscall.c26
-rw-r--r--src/test_tclvar.c8
-rw-r--r--src/test_thread.c24
-rw-r--r--src/test_vfs.c12
-rw-r--r--tool/mksqlite3c-noext.tcl2
-rw-r--r--tool/mksqlite3c.tcl2
-rw-r--r--tool/mksqlite3h.tcl7
-rw-r--r--tool/replace.tcl3
53 files changed, 846 insertions, 558 deletions
diff --git a/Makefile.msc b/Makefile.msc
index cd866ce4a..d2c53a038 100644
--- a/Makefile.msc
+++ b/Makefile.msc
@@ -464,20 +464,32 @@ RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src $(RCOPTS) $(RCCOPTS)
#
!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
!IF "$(PLATFORM)"=="x86"
-CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
-SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
+CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
+SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
+# <<mark>>
+TEST_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall -DINCLUDE_SQLITE_TCL_H=1 -DSQLITE_TCLAPI=__cdecl
+# <</mark>>
!ELSE
!IFNDEF PLATFORM
-CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
-SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
+CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
+SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
+# <<mark>>
+TEST_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall -DINCLUDE_SQLITE_TCL_H=1 -DSQLITE_TCLAPI=__cdecl
+# <</mark>>
!ELSE
CORE_CCONV_OPTS =
SHELL_CCONV_OPTS =
+# <<mark>>
+TEST_CCONV_OPTS =
+# <</mark>>
!ENDIF
!ENDIF
!ELSE
CORE_CCONV_OPTS =
SHELL_CCONV_OPTS =
+# <<mark>>
+TEST_CCONV_OPTS =
+# <</mark>>
!ENDIF
# These are additional compiler options used for the core library.
@@ -1235,6 +1247,12 @@ SRC11 = \
parse.h \
$(SQLITE3H)
+# Generated Tcl header files
+#
+SRC12 = \
+ sqlite_tcl.h \
+ sqlite_tclDecls.h
+
# All source code files.
#
SRC = $(SRC00) $(SRC01) $(SRC02) $(SRC03) $(SRC04) $(SRC05) $(SRC06) $(SRC07) $(SRC08) $(SRC09) $(SRC10) $(SRC11)
@@ -1499,7 +1517,7 @@ mptest: mptester.exe
# files are automatically generated. This target takes care of
# all that automatic generation.
#
-.target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl fts5.c
+.target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl fts5.c sqlite_tcl.h
-rmdir /Q/S tsrc 2>NUL
-mkdir tsrc
for %i in ($(SRC00)) do copy /Y %i tsrc
@@ -1514,6 +1532,7 @@ mptest: mptester.exe
for %i in ($(SRC09)) do copy /Y %i tsrc
for %i in ($(SRC10)) do copy /Y %i tsrc
for %i in ($(SRC11)) do copy /Y %i tsrc
+ for %i in ($(SRC12)) do copy /Y %i tsrc
copy /Y fts5.c tsrc
copy /Y fts5.h tsrc
del /Q tsrc\sqlite.h.in tsrc\parse.y 2>NUL
@@ -1795,10 +1814,10 @@ wherecode.lo: $(TOP)\src\wherecode.c $(HDR)
whereexpr.lo: $(TOP)\src\whereexpr.c $(HDR)
$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\whereexpr.c
-tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR)
+tclsqlite.lo: $(TOP)\src\tclsqlite.c $(HDR) sqlite_tcl.h
$(LTCOMPILE) $(NO_WARN) -DUSE_TCL_STUBS=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
-tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR)
+tclsqlite-shell.lo: $(TOP)\src\tclsqlite.c $(HDR) sqlite_tcl.h
$(LTCOMPILE) $(NO_WARN) -DTCLSH=1 -DBUILD_sqlite -I$(TCLINCDIR) -c $(TOP)\src\tclsqlite.c
tclsqlite3.exe: tclsqlite-shell.lo $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
@@ -1827,7 +1846,8 @@ $(SQLITE3H): $(TOP)\src\sqlite.h.in $(TOP)\manifest.uuid $(TOP)\VERSION
$(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > $(SQLITE3H)
sqlite3ext.h: .target_source
- copy tsrc\sqlite3ext.h .
+ type tsrc\sqlite3ext.h | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*\)" "(SQLITE_CALLBACK *)" \
+ | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*" "(SQLITE_APICALL *" > sqlite3ext.h
mkkeywordhash.exe: $(TOP)\tool\mkkeywordhash.c
$(BCC) $(NO_WARN) -Fe$@ $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) \
@@ -1960,6 +1980,7 @@ TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_DEFAULT_PAGE_SIZE=1024
+TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) $(TEST_CCONV_OPTS)
TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2)
TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C)
@@ -1969,7 +1990,25 @@ TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC1)
!ENDIF
-testfixture.exe: $(TESTFIXTURE_SRC) $(SQLITE3H) $(LIBRESOBJS) $(HDR)
+sqlite_tclDecls.h:
+ echo #ifndef SQLITE_TCLAPI > sqlite_tclDecls.h
+ echo # define SQLITE_TCLAPI >> sqlite_tclDecls.h
+ echo #endif >> sqlite_tclDecls.h
+ type "$(TCLINCDIR)\tclDecls.h" \
+ | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "^(EXTERN(?: CONST\d+?)?\s+?[^\(]*?\s+?)Tcl_" "\1 SQLITE_TCLAPI Tcl_" \
+ | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "^(EXTERN\s+?(?:void|VOID)\s+?)TclFreeObj" "\1 SQLITE_TCLAPI TclFreeObj" \
+ | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*tcl_" "(SQLITE_TCLAPI *tcl_" \
+ | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*tclFreeObj" "(SQLITE_TCLAPI *tclFreeObj" \
+ | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "\(\*" "(SQLITE_TCLAPI *" >> sqlite_tclDecls.h
+
+sqlite_tcl.h: sqlite_tclDecls.h
+ type "$(TCLINCDIR)\tcl.h" | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact tclDecls.h sqlite_tclDecls.h \
+ | $(TCLSH_CMD) $(TOP)\tool\replace.tcl regsub "typedef (.*?)\(Tcl_" "typedef \1 (SQLITE_TCLAPI Tcl_" \
+ | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "void (*freeProc)" "void (SQLITE_TCLAPI *freeProc)" \
+ | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "Tcl_HashEntry *(*findProc)" "Tcl_HashEntry *(SQLITE_TCLAPI *findProc)" \
+ | $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact "Tcl_HashEntry *(*createProc)" "Tcl_HashEntry *(SQLITE_TCLAPI *createProc)" >> sqlite_tcl.h
+
+testfixture.exe: $(TESTFIXTURE_SRC) $(SQLITE3H) $(LIBRESOBJS) $(HDR) sqlite_tcl.h
$(LTLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
-DBUILD_sqlite -I$(TCLINCDIR) \
$(TESTFIXTURE_SRC) \
@@ -2018,7 +2057,7 @@ smoketest: $(TESTPROGS)
@set PATH=$(LIBTCLPATH);$(PATH)
.\testfixture.exe $(TOP)\test\main.test $(TESTOPTS)
-sqlite3_analyzer.c: $(SQLITE3C) $(SQLITE3H) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl
+sqlite3_analyzer.c: $(SQLITE3C) $(SQLITE3H) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl sqlite_tcl.h
echo #define TCLSH 2 > $@
echo #define SQLITE_ENABLE_DBSTAT_VTAB 1 >> $@
copy $@ + $(SQLITE3C) + $(TOP)\src\tclsqlite.c $@
@@ -2098,7 +2137,7 @@ clean:
-rmdir /Q/S .libs 2>NUL
-rmdir /Q/S tsrc 2>NUL
del /Q .target_source 2>NUL
- del /Q tclsqlite3.exe 2>NUL
+ del /Q tclsqlite3.exe sqlite_tcl.h sqlite_tclDecls.h 2>NUL
del /Q testloadext.dll 2>NUL
del /Q testfixture.exe test.db 2>NUL
del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe 2>NUL
diff --git a/autoconf/Makefile.msc b/autoconf/Makefile.msc
index 7f62bcb12..2f7447383 100644
--- a/autoconf/Makefile.msc
+++ b/autoconf/Makefile.msc
@@ -449,12 +449,12 @@ RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) $(RCOPTS) $(RCCOPTS)
#
!IF $(USE_STDCALL)!=0 || $(FOR_WIN10)!=0
!IF "$(PLATFORM)"=="x86"
-CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
-SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
+CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
+SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
!ELSE
!IFNDEF PLATFORM
-CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
-SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_STDCALL=__stdcall
+CORE_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
+SHELL_CCONV_OPTS = -Gz -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
!ELSE
CORE_CCONV_OPTS =
SHELL_CCONV_OPTS =
diff --git a/ext/fts2/fts2_tokenizer.c b/ext/fts2/fts2_tokenizer.c
index a3d6a6312..dda33a72d 100644
--- a/ext/fts2/fts2_tokenizer.c
+++ b/ext/fts2/fts2_tokenizer.c
@@ -99,7 +99,11 @@ static void scalarFunc(
#ifdef SQLITE_TEST
-#include <tcl.h>
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#include <string.h>
/*
diff --git a/ext/fts3/fts3_test.c b/ext/fts3/fts3_test.c
index 2596e6dec..a48a556c9 100644
--- a/ext/fts3/fts3_test.c
+++ b/ext/fts3/fts3_test.c
@@ -18,7 +18,14 @@
** that the sqlite3_tokenizer_module.xLanguage() method is invoked correctly.
*/
-#include <tcl.h>
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+# ifndef SQLITE_TCLAPI
+# define SQLITE_TCLAPI
+# endif
+#endif
#include <string.h>
#include <assert.h>
@@ -143,7 +150,7 @@ static int nm_match_count(
/*
** Tclcmd: fts3_near_match DOCUMENT EXPR ?OPTIONS?
*/
-static int fts3_near_match_cmd(
+static int SQLITE_TCLAPI fts3_near_match_cmd(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -278,7 +285,7 @@ static int fts3_near_match_cmd(
** # Restore initial incr-load settings:
** eval fts3_configure_incr_load $cfg
*/
-static int fts3_configure_incr_load_cmd(
+static int SQLITE_TCLAPI fts3_configure_incr_load_cmd(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -488,7 +495,7 @@ static int testTokenizerLanguage(
}
#endif
-static int fts3_test_tokenizer_cmd(
+static int SQLITE_TCLAPI fts3_test_tokenizer_cmd(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -517,7 +524,7 @@ static int fts3_test_tokenizer_cmd(
return TCL_OK;
}
-static int fts3_test_varint_cmd(
+static int SQLITE_TCLAPI fts3_test_varint_cmd(
ClientData clientData,
Tcl_Interp *interp,
int objc,
diff --git a/ext/fts3/fts3_tokenizer.c b/ext/fts3/fts3_tokenizer.c
index b7d9d2b3b..bfc36af3e 100644
--- a/ext/fts3/fts3_tokenizer.c
+++ b/ext/fts3/fts3_tokenizer.c
@@ -224,7 +224,11 @@ int sqlite3Fts3InitTokenizer(
#ifdef SQLITE_TEST
-#include <tcl.h>
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#include <string.h>
/*
diff --git a/ext/fts5/fts5_tcl.c b/ext/fts5/fts5_tcl.c
index 72db65777..dee9bc7f1 100644
--- a/ext/fts5/fts5_tcl.c
+++ b/ext/fts5/fts5_tcl.c
@@ -14,7 +14,11 @@
#ifdef SQLITE_TEST
-#include <tcl.h>
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#ifdef SQLITE_ENABLE_FTS5
diff --git a/ext/misc/percentile.c b/ext/misc/percentile.c
index 74a4c9d12..a5d7e8491 100644
--- a/ext/misc/percentile.c
+++ b/ext/misc/percentile.c
@@ -167,7 +167,7 @@ static void percentStep(sqlite3_context *pCtx, int argc, sqlite3_value **argv){
/*
** Compare to doubles for sorting using qsort()
*/
-static int doubleCmp(const void *pA, const void *pB){
+static int SQLITE_CDECL doubleCmp(const void *pA, const void *pB){
double a = *(double*)pA;
double b = *(double*)pB;
if( a==b ) return 0;
diff --git a/ext/misc/spellfix.c b/ext/misc/spellfix.c
index cbcf8b7c5..1ac1712f4 100644
--- a/ext/misc/spellfix.c
+++ b/ext/misc/spellfix.c
@@ -2231,7 +2231,7 @@ static int spellfix1Score(int iDistance, int iRank){
** Compare two spellfix1_row objects for sorting purposes in qsort() such
** that they sort in order of increasing distance.
*/
-static int spellfix1RowCompare(const void *A, const void *B){
+static int SQLITE_CDECL spellfix1RowCompare(const void *A, const void *B){
const struct spellfix1_row *a = (const struct spellfix1_row*)A;
const struct spellfix1_row *b = (const struct spellfix1_row*)B;
return a->iScore - b->iScore;
diff --git a/ext/rbu/test_rbu.c b/ext/rbu/test_rbu.c
index 6418d30d5..671f16c55 100644
--- a/ext/rbu/test_rbu.c
+++ b/ext/rbu/test_rbu.c
@@ -17,7 +17,11 @@
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU)
#include "sqlite3rbu.h"
-#include <tcl.h>
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#include <assert.h>
/* From main.c */
@@ -347,7 +351,11 @@ int SqliteRbu_Init(Tcl_Interp *interp){
}
#else
-#include <tcl.h>
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
int SqliteRbu_Init(Tcl_Interp *interp){ return TCL_OK; }
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU) */
#endif /* defined(SQLITE_TEST) */
diff --git a/ext/session/test_session.c b/ext/session/test_session.c
index 1aa63b74e..9f6bc3f70 100644
--- a/ext/session/test_session.c
+++ b/ext/session/test_session.c
@@ -5,7 +5,11 @@
#include "sqlite3session.h"
#include <assert.h>
#include <string.h>
-#include <tcl.h>
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
typedef struct TestSession TestSession;
struct TestSession {
diff --git a/manifest b/manifest
index b3d969ce8..7b451988d 100644
--- a/manifest
+++ b/manifest
@@ -1,8 +1,8 @@
-C Disable\sthe\sauthorizer\scallback\swhen\sreparsing\sthe\sschema.\s\sThis\savoids\nundesirable\sauthorization\sfailures\sfollowing\san\sALTER\sTABLE.
-D 2016-07-28T18:38:13.187
+C Decorate\sall\sinterfaces\swith\scalling\sconvention\smacros.
+D 2016-07-28T18:55:57.809
F Makefile.in 6c20d44f72d4564f11652b26291a214c8367e5db
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
-F Makefile.msc d66d0395c38571aab3804f8db0fa20707ae4609a
+F Makefile.msc b8894e579e4a5f32d61eb9309dbdbd7c883d2e87
F README.md 8ecc12493ff9f820cdea6520a9016001cb2e59b7
F VERSION cb29eb11e493dd85b3eeec4053c03949bf98478e
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
@@ -11,7 +11,7 @@ F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903
F autoconf/Makefile.am 1a47d071e3d5435f8f7ebff7eb6703848bbd65d4
-F autoconf/Makefile.msc 0eca137c12542bd76c253a2d24380f29ade59b95
+F autoconf/Makefile.msc 05a99e98a8895461574ccb9604444d9e97c1f0b6
F autoconf/README.first 6c4f34fe115ff55d4e8dbfa3cecf04a0188292f7
F autoconf/README.txt 4f04b0819303aabaa35fff5f7b257fb0c1ef95f1
F autoconf/configure.ac cacf2616abf6e4a569bde2ef365c143caeec40bc
@@ -62,7 +62,7 @@ F ext/fts2/fts2_hash.c 011a1d32de45bb1b519a1fd0048e857d6a843558
F ext/fts2/fts2_hash.h 1824b99dfd8d0225facbdb26a2c87289b2e7dcf8
F ext/fts2/fts2_icu.c 51c5cd3c04954badd329fa738c95fcdb717b5188
F ext/fts2/fts2_porter.c 2cd4a507bf3c3085fe66f59b0f2a325f65aaacf5
-F ext/fts2/fts2_tokenizer.c 3dbe8058e97afb55fff3ea844120ce3208b114cc
+F ext/fts2/fts2_tokenizer.c b529493d55e55497213c37e1f31680a77746be26
F ext/fts2/fts2_tokenizer.h 27a1a99ca2d615cf7e142839b8d79e8751b4529e
F ext/fts2/fts2_tokenizer1.c 07e223eecb483d448313b5f1553a4f299a7fb7a1
F ext/fts2/mkfts2amal.tcl 974d5d438cb3f7c4a652639262f82418c1e4cff0
@@ -81,9 +81,9 @@ F ext/fts3/fts3_icu.c deb46f7020d87ea7a14a433fb7a7f4bef42a9652
F ext/fts3/fts3_porter.c 3565faf04b626cddf85f03825e86056a4562c009
F ext/fts3/fts3_snippet.c 68ae118b0f834ea53d2b89e4087fc0f0b8c4ee4e
F ext/fts3/fts3_term.c 88c55a6fa1a51ab494e33dced0401a6c28791fd7
-F ext/fts3/fts3_test.c a940cf104d545ad1abf926956ce65db2aa5af0cf
+F ext/fts3/fts3_test.c 79f2a7fbb3f672fa032e5a432ca274ea3ee93c34
F ext/fts3/fts3_tokenize_vtab.c a27593ab19657166f6fa5ec073b678cc29a75860
-F ext/fts3/fts3_tokenizer.c 3cf21cd2212db17a88d4ef7da0fd8a80275979a1
+F ext/fts3/fts3_tokenizer.c a22bf311a71f3efa9d7012d8cc48fc9b0f3dace7
F ext/fts3/fts3_tokenizer.h 64c6ef6c5272c51ebe60fc607a896e84288fcbc3
F ext/fts3/fts3_tokenizer1.c 5c98225a53705e5ee34824087478cf477bdb7004
F ext/fts3/fts3_unicode.c a93f5edc0aff44ef8b06d7cb55b52026541ca145
@@ -107,7 +107,7 @@ F ext/fts5/fts5_hash.c 880998e596b60f078348d48732ca4ad9a90caad2
F ext/fts5/fts5_index.c b429e23fabb57506f71e406997cc46b89190dc97
F ext/fts5/fts5_main.c f85281445dcf8be32d18841c93a6f90fe27dbfe2
F ext/fts5/fts5_storage.c de0ed8a06738bde433afe11e92295ceaffbc4e58
-F ext/fts5/fts5_tcl.c f8731e0508299bd43f1a2eff7dbeaac870768966
+F ext/fts5/fts5_tcl.c b41f04600936a2b910b5dff179e8bd050ccb34c7
F ext/fts5/fts5_test_mi.c 783b86697ebf773c18fc109992426c0173a055bc
F ext/fts5/fts5_test_tok.c db08af63673c3a7d39f053b36fd6e065017706be
F ext/fts5/fts5_tokenize.c 2ce7b44183538ec46b7907726262ee43ffdd39a8
@@ -214,13 +214,13 @@ F ext/misc/fuzzer.c 7c64b8197bb77b7d64eff7cac7848870235d4c25
F ext/misc/ieee754.c f190d0cc5182529acb15babd177781be1ac1718c
F ext/misc/json1.c d51a764ba43a49e191bc3536238bfab3def258ca
F ext/misc/nextchar.c 35c8b8baacb96d92abbb34a83a997b797075b342
-F ext/misc/percentile.c bcbee3c061b884eccb80e21651daaae8e1e43c63
+F ext/misc/percentile.c 92699c8cd7d517ff610e6037e56506f8904dae2e
F ext/misc/regexp.c a68d25c659bd2d893cd1215667bbf75ecb9dc7d4
F ext/misc/rot13.c 1ac6f95f99b575907b9b09c81a349114cf9be45a
F ext/misc/scrub.c 1c5bfb8b0cd18b602fcb55755e84abf0023ac2fb
F ext/misc/series.c e11e534ada797d5b816d7e7a93c022306563ca35
F ext/misc/showauth.c 732578f0fe4ce42d577e1c86dc89dd14a006ab52
-F ext/misc/spellfix.c bf1b922c2750698e9a3d4c50cce6974adb7e93be
+F ext/misc/spellfix.c a4723b6aff748a417b5091b68a46443265c40f0d
F ext/misc/totype.c 4a167594e791abeed95e0a8db028822b5e8fe512
F ext/misc/vfslog.c fe40fab5c077a40477f7e5eba994309ecac6cc95
F ext/misc/vfsstat.c 6110aeeaab2f1df17a923c8a8acef3c74f6dc515
@@ -255,7 +255,7 @@ F ext/rbu/rbuvacuum.test 4a977447c15c2581ab668781d9ef4294382530e0
F ext/rbu/rbuvacuum2.test 45009e127c3fb385e5c0fd5a8a63fb922a79d0ab
F ext/rbu/sqlite3rbu.c 948677ee0ec57da51148e6c5f64ac68afcf36ab2
F ext/rbu/sqlite3rbu.h db8858120c9be14b60c9225f9da28221f5f6b945
-F ext/rbu/test_rbu.c 9f043b74c46c45b231f4313aed1fccb379a76fe6
+F ext/rbu/test_rbu.c c2c1859dfd69f1a55125d38009d0d49e36895780
F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
F ext/rtree/rtree.c d26a815b0df1c412a6881dae8d7fd3c9c08cce68
F ext/rtree/rtree.h 834dbcb82dc85b2481cde6a07cdadfddc99e9b9e
@@ -301,7 +301,7 @@ F ext/session/sessionfault.test da273f2712b6411e85e71465a1733b8501dbf6f7
F ext/session/sessionfault2.test 04aa0bc9aa70ea43d8de82c4f648db4de1e990b0
F ext/session/sqlite3session.c 37485891b4add26cf61495df193c419f36556a32
F ext/session/sqlite3session.h 69bf73cfd71e58f2ae5d2aa935b2c1a541aee555
-F ext/session/test_session.c 464f2c8bf502795d95969387eb8e93f68c513c15
+F ext/session/test_session.c ebf9acf2bd70885e6245512427f800693b65dc9c
F ext/userauth/sqlite3userauth.h 19cb6f0e31316d0ee4afdfb7a85ef9da3333a220
F ext/userauth/user-auth.txt e6641021a9210364665fe625d067617d03f27b04
F ext/userauth/userauth.c 5fa3bdb492f481bbc1709fc83c91ebd13460c69e
@@ -385,58 +385,58 @@ F src/resolve.c cca3aa77b95706df5d635a2141a4d1de60ae6598
F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac
F src/select.c f3c6e9065fb34f6a23af27ec7f1f717ffbfc2ee4
F src/shell.c 9351fc6de11e1d908648c0a92d85627138e3dee5
-F src/sqlite.h.in c6e68a4a47610631822a4f8f83a44c9f75339331
+F src/sqlite.h.in a03063e698a43cc5c996cd341f39439a6ce58304
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h 46f300b6e300e0fa916d7d58c44b53415b8471a9
-F src/sqliteInt.h d25c18c1272a7811e2569c39bfc2fca96156eead
+F src/sqliteInt.h 14516943867eb2c30ce0e3670299958f59ade052
F src/sqliteLimit.h c0373387c287c8d0932510b5547ecde31b5da247
F src/status.c 5b18f9526900f61189ab0b83f1ef41d9f871a2ab
F src/table.c 5226df15ab9179b9ed558d89575ea0ce37b03fc9
-F src/tclsqlite.c 5c213bf5fee084390f632df2328cf0821d483799
-F src/test1.c 186e3b53c402b7a73bcb4ade2b77709675c39fe3
-F src/test2.c 5586f43fcd9a1be0830793cf9d354082c261b25b
-F src/test3.c c75c8af0eadb335236c9e61b51044c58a8f7dd59
-F src/test4.c d168f83cc78d02e8d35567bb5630e40dcd85ac1e
-F src/test5.c 5a34feec76d9b3a86aab30fd4f6cc9c48cbab4c1
-F src/test6.c a684b7abd01352ab50cb79c0bf727e6b3f381a3d
-F src/test7.c 9c89a4f1ed6bb13af0ed805b8d782bd83fcd57e3
-F src/test8.c fa262391d3edea6490a71bfaa8fed477ccbbac75
-F src/test9.c bea1e8cf52aa93695487badedd6e1886c321ea60
-F src/test_async.c 21e11293a2f72080eda70e1124e9102044531cd8
-F src/test_autoext.c dea8a01a7153b9adc97bd26161e4226329546e12
-F src/test_backup.c 2e6e6a081870150f20c526a2e9d0d29cda47d803
-F src/test_bestindex.c f9e6807c52aa532e4775321ce3ed8e47c907ed45
-F src/test_blob.c b2551a9b5573232db5f66f292307c37067937239
-F src/test_btree.c 2e9978eca99a9a4bfa8cae949efb00886860a64f
-F src/test_config.c 7003f6f35134de6f19c6588f44783e43390ea277
-F src/test_demovfs.c 0de72c2c89551629f58486fde5734b7d90758852
+F src/tclsqlite.c 342379845d52c62a778c76c3dd0a2695af723e04
+F src/test1.c 906a04b649c7139e943193a3905d583e325c30c7
+F src/test2.c b7174313e993754303a8b33c43df7c44b46857ab
+F src/test3.c 1339a40be39650ae83894b6578f971dc7f96ea8a
+F src/test4.c 18ec393bb4d0ad1de729f0b94da7267270f3d8e6
+F src/test5.c 328aae2c010c57a9829d255dc099d6899311672d
+F src/test6.c 55aa2775c154415dcf4ed7cd1e19a193122b3a02
+F src/test7.c 5612e9aecf934d6df7bba6ce861fdf5ba5456010
+F src/test8.c 4f4904721167b32f7a4fa8c7b32a07a673d6cc86
+F src/test9.c 12e5ba554d2d1cbe0158f6ab3f7ffcd7a86ee4e5
+F src/test_async.c 195ab49da082053fdb0f949c114b806a49ca770a
+F src/test_autoext.c 6c8fe00caa3f38396f0990467179e9d1adb39ddd
+F src/test_backup.c bf5da90c9926df0a4b941f2d92825a01bbe090a0
+F src/test_bestindex.c d23f80d334c59662af69191854c76b8d3d0c8c96
+F src/test_blob.c a0f7ad49a0c9d4b72f693fe2a71c58d7e507174d
+F src/test_btree.c 8b2dc8b8848cf3a4db93f11578f075e82252a274
+F src/test_config.c 4d3d4a886416f369771d69a6dba926866deda788
+F src/test_demovfs.c a0c3bdd45ed044115c2c9f7779e56eafff18741e
F src/test_devsym.c 4e58dec2602d8e139ca08659f62a62450587cb58
-F src/test_fs.c f10f840ca4f8c72e4837908bd8347ac4bcab074b
-F src/test_func.c 37453d346cfcf118774efd5bf6187f7e6a7e3254
-F src/test_hexio.c abfdecb6fa58c354623978efceb088ca18e379cd
-F src/test_init.c 66b33120ffe9cd853b5a905ec850d51151337b32
-F src/test_intarray.c 870124b95ec4c645d4eb84f15efb7133528fb1a5
+F src/test_fs.c ac62ce7d5c0c23aa6932891cad5746945564c91c
+F src/test_func.c 9cea6fee7ece5f46aa26e060b35e10dc6ba708cf
+F src/test_hexio.c 1d4469ca61ab202a1fcec6543f584d2407205e8d
+F src/test_init.c 4413c211a94b62157ca4c145b3f27c497f03c664
+F src/test_intarray.c 988fc61cb0ff539f4172c0d95f15287c92516f64
F src/test_intarray.h f3b7672f5d1056eac563c0d6ea8480a660b1475c
F src/test_journal.c d3b83f2bcb7792c709e57abddc456a2b1818643a
F src/test_loadext.c 337056bae59f80b9eb00ba82088b39d0f4fe6dfd
-F src/test_malloc.c 6b27e947eeeb70d11aa65406ed28d749e39b6356
-F src/test_multiplex.c eafc567ebe162e36f17b5062285dfe90461cf8e9
+F src/test_malloc.c c05f6c40bd6c8bfe5f1718212f81fd5687f91766
+F src/test_multiplex.c af2792ec4436d442d1bd00b8803470a25111bad3
F src/test_multiplex.h 5436d03f2d0501d04f3ed50a75819e190495b635
-F src/test_mutex.c dbdfaff8580071f2212a0deae3325a93a737819c
+F src/test_mutex.c 7f4337ba23ee6b1d2ec81c189653608cb069926a
F src/test_onefile.c 416f87a28d6d673352d33fc4b1c7d39db878e50f
-F src/test_osinst.c ad0233b1dabb0390e25edded4ebd79a2a61538c6
+F src/test_osinst.c 98ef31ff03d55497829ca0f6c74a9f4e1aa48690
F src/test_pcache.c a5cd24730cb43c5b18629043314548c9169abb00
-F src/test_quota.c 180813f43683be5725458fc1ff13ac455d8e722d
+F src/test_quota.c 6cb9297115b551f433a9ad1741817a9831abed99
F src/test_quota.h 2a8ad1952d1d2ca9af0ce0465e56e6c023b5e15d
-F src/test_rtree.c 43fff4c5a01576d6d213f27472598801a247890c
-F src/test_schema.c 2bdba21b82f601da69793e1f1d11bf481a79b091
+F src/test_rtree.c 671f3fae50ff116ef2e32a3bf1fe21b5615b4b7b
+F src/test_schema.c f575932cb6274d12147a77e13ea4b49d52408513
F src/test_server.c a2615049954cbb9cfb4a62e18e2f0616e4dc38fe
F src/test_sqllog.c 0d138a8180a312bf996b37fa66da5c5799d4d57b
-F src/test_superlock.c 06797157176eb7085027d9dd278c0d7a105e3ec9
-F src/test_syscall.c 268c072541162564a882c57f54a6fee12ef4a4d2
-F src/test_tclvar.c d86412527da65468ee6fa1b8607c65d0af736bc4
-F src/test_thread.c af391ec03d23486dffbcc250b7e58e073f172af9
-F src/test_vfs.c 4d02f38bfb8f7f273da7ba84bfe000f5babf206c
+F src/test_superlock.c 4839644b9201da822f181c5bc406c0b2385f672e
+F src/test_syscall.c 1073306ba2e9bfc886771871a13d3de281ed3939
+F src/test_tclvar.c df9fe1213c2634687a9ca0b0bec0d2119d359ae3
+F src/test_thread.c c7c40494b7a0603ebb6eb97c904545c0dceca5ff
+F src/test_vfs.c f0186261a24de2671d080bcd8050732f0cb64f6e
F src/test_vfstrace.c bab9594adc976cbe696ff3970728830b4c5ed698
F src/test_windirent.c 8f5fada630348558d5745b334702f301da1ffc61
F src/test_windirent.h b12055cab6227f7be10f5c19296f67c60cc5e2a5
@@ -1448,16 +1448,16 @@ F tool/mkopcodeh.tcl a01d2c1d8a6205b03fc635adf3735b4c523befd3
F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e
F tool/mkpragmatab.tcl f0d5bb266d1d388cf86fce5ba01a891e95d72d41
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
-F tool/mksqlite3c-noext.tcl 87240b09c20042999b41d5fabe091b7111287835
-F tool/mksqlite3c.tcl 63af8429841f08552e6da1d93b3dee4a93ff8071
-F tool/mksqlite3h.tcl e7b106fc4f29fbc258e8ba9b88d9108332ea2ade
+F tool/mksqlite3c-noext.tcl aa58ea3be311c81821c2cd3209f55e46b07ab656
+F tool/mksqlite3c.tcl a52ead27e2ac5d4b616e945a0601f628f4328329
+F tool/mksqlite3h.tcl cf5cd68028e69a51ed5c76042672664201f0f756
F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b
F tool/mkvsix.tcl 4abcaf3267171b2faadaf9b82a0dfbaa6e98f8b7
F tool/offsets.c fe4262fdfa378e8f5499a42136d17bf3b98f6091
F tool/omittest.tcl 34d7ac01fe4fd18e3637f64abe12c40eca0f6b97
F tool/opcodesum.tcl 740ed206ba8c5040018988129abbf3089a0ccf4a
F tool/pagesig.c ff0ca355fd3c2398e933da5e22439bbff89b803b
-F tool/replace.tcl 7727c60a04299b65a92f5e1590896fea0f25b9e0
+F tool/replace.tcl 3856f87247dde5418d16dac92fa4060813431778
F tool/restore_jrnl.tcl 6957a34f8f1f0f8285e07536225ec3b292a9024a
F tool/rollback-test.c 9fc98427d1e23e84429d7e6d07d9094fbdec65a5
F tool/run-speed-test.sh f95d19fd669b68c4c38b6b475242841d47c66076
@@ -1508,7 +1508,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 81f9cf86c48f3cd43755ded4dc97388ec650f8af
-R ae8bfc7314166cec8de9b44e7e9859e8
+P 805d01cdabb48a69eb986a7f084e53eb25d76b7f 97fc6e4328fe72cdd10f11a4b4bc9ce14bdc537f
+R 8897711bcf29ba23a6ba0e1e7c3853bd
+T +closed 97fc6e4328fe72cdd10f11a4b4bc9ce14bdc537f
U drh
-Z 7b0f6930a62d02daa8f4147d6dafd3a6
+Z 6ec050f366e0cbc18c7d1fd514c95e5b
diff --git a/manifest.uuid b/manifest.uuid
index 53827a116..76c400fd3 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-805d01cdabb48a69eb986a7f084e53eb25d76b7f \ No newline at end of file
+fd784887e125bf95f4799ad09cbcba6795173487 \ No newline at end of file
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index e8f5d2484..02ae22c34 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -54,8 +54,17 @@ extern "C" {
#ifndef SQLITE_CDECL
# define SQLITE_CDECL
#endif
+#ifndef SQLITE_APICALL
+# define SQLITE_APICALL
+#endif
#ifndef SQLITE_STDCALL
-# define SQLITE_STDCALL
+# define SQLITE_STDCALL SQLITE_APICALL
+#endif
+#ifndef SQLITE_CALLBACK
+# define SQLITE_CALLBACK
+#endif
+#ifndef SQLITE_SYSAPI
+# define SQLITE_SYSAPI
#endif
/*
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index c5b1eccc0..35be76dfb 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -43,6 +43,14 @@
*/
/*
+** Make sure the Tcl calling convention macro is defined. This macro is
+** only used by test code and Tcl integration code.
+*/
+#ifndef SQLITE_TCLAPI
+# define SQLITE_TCLAPI
+#endif
+
+/*
** Make sure that rand_s() is available on Windows systems with MSVC 2005
** or higher.
*/
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index 2de88f41f..bc94a5ff7 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -30,10 +30,17 @@
** If requested, include the SQLite compiler options file for MSVC.
*/
#if defined(INCLUDE_MSVC_H)
-#include "msvc.h"
+# include "msvc.h"
#endif
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+# ifndef SQLITE_TCLAPI
+# define SQLITE_TCLAPI
+# endif
+#endif
#include <errno.h>
/*
@@ -204,7 +211,10 @@ static void closeIncrblobChannels(SqliteDb *pDb){
/*
** Close an incremental blob channel.
*/
-static int incrblobClose(ClientData instanceData, Tcl_Interp *interp){
+static int SQLITE_TCLAPI incrblobClose(
+ ClientData instanceData,
+ Tcl_Interp *interp
+){
IncrblobChannel *p = (IncrblobChannel *)instanceData;
int rc = sqlite3_blob_close(p->pBlob);
sqlite3 *db = p->pDb->db;
@@ -233,7 +243,7 @@ static int incrblobClose(ClientData instanceData, Tcl_Interp *interp){
/*
** Read data from an incremental blob channel.
*/
-static int incrblobInput(
+static int SQLITE_TCLAPI incrblobInput(
ClientData instanceData,
char *buf,
int bufSize,
@@ -265,7 +275,7 @@ static int incrblobInput(
/*
** Write data to an incremental blob channel.
*/
-static int incrblobOutput(
+static int SQLITE_TCLAPI incrblobOutput(
ClientData instanceData,
CONST char *buf,
int toWrite,
@@ -298,7 +308,7 @@ static int incrblobOutput(
/*
** Seek an incremental blob channel.
*/
-static int incrblobSeek(
+static int SQLITE_TCLAPI incrblobSeek(
ClientData instanceData,
long offset,
int seekMode,
@@ -324,10 +334,17 @@ static int incrblobSeek(
}
-static void incrblobWatch(ClientData instanceData, int mode){
+static void SQLITE_TCLAPI incrblobWatch(
+ ClientData instanceData,
+ int mode
+){
/* NO-OP */
}
-static int incrblobHandle(ClientData instanceData, int dir, ClientData *hPtr){
+static int SQLITE_TCLAPI incrblobHandle(
+ ClientData instanceData,
+ int dir,
+ ClientData *hPtr
+){
return TCL_ERROR;
}
@@ -486,7 +503,7 @@ static void flushStmtCache(SqliteDb *pDb){
** TCL calls this procedure when an sqlite3 database command is
** deleted.
*/
-static void DbDeleteCmd(void *db){
+static void SQLITE_TCLAPI DbDeleteCmd(void *db){
SqliteDb *pDb = (SqliteDb*)db;
flushStmtCache(pDb);
closeIncrblobChannels(pDb);
@@ -1134,7 +1151,7 @@ static char *local_getline(char *zPrompt, FILE *in){
** It is invoked after evaluating the script SCRIPT to commit or rollback
** the transaction or savepoint opened by the [transaction] command.
*/
-static int DbTransPostCmd(
+static int SQLITE_TCLAPI DbTransPostCmd(
ClientData data[], /* data[0] is the Sqlite3Db* for $db */
Tcl_Interp *interp, /* Tcl interpreter */
int result /* Result of evaluating SCRIPT */
@@ -1681,7 +1698,7 @@ static int DbUseNre(void){
**
** $db eval SQL ?ARRAYNAME? SCRIPT
*/
-static int DbEvalNextCmd(
+static int SQLITE_TCLAPI DbEvalNextCmd(
ClientData data[], /* data[0] is the (DbEvalContext*) */
Tcl_Interp *interp, /* Tcl interpreter */
int result /* Result so far */
@@ -1791,7 +1808,12 @@ static void DbHookCmd(
** and calls that connection "db1". The second command causes this
** subroutine to be invoked.
*/
-static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
+static int SQLITE_TCLAPI DbObjCmd(
+ void *cd,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *const*objv
+){
SqliteDb *pDb = (SqliteDb*)cd;
int choice;
int rc = TCL_OK;
@@ -3234,7 +3256,7 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
** Adaptor that provides an objCmd interface to the NRE-enabled
** interface implementation.
*/
-static int DbObjCmdAdaptor(
+static int SQLITE_TCLAPI DbObjCmdAdaptor(
void *cd,
Tcl_Interp *interp,
int objc,
@@ -3259,7 +3281,12 @@ static int DbObjCmdAdaptor(
** The second argument is the name of the database file.
**
*/
-static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
+static int SQLITE_TCLAPI DbMain(
+ void *cd,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *const*objv
+){
SqliteDb *p;
const char *zArg;
char *zErrMsg;
@@ -3931,7 +3958,7 @@ static const char *tclsh_main_loop(void);
#ifdef SQLITE_TEST
static void init_all(Tcl_Interp *);
-static int init_all_cmd(
+static int SQLITE_TCLAPI init_all_cmd(
ClientData cd,
Tcl_Interp *interp,
int objc,
@@ -3961,7 +3988,7 @@ static int init_all_cmd(
** to use the sqlite3_prepare_v2() function to prepare statements. If it
** is false, sqlite3_prepare().
*/
-static int db_use_legacy_prepare_cmd(
+static int SQLITE_TCLAPI db_use_legacy_prepare_cmd(
ClientData cd,
Tcl_Interp *interp,
int objc,
@@ -3998,7 +4025,7 @@ static int db_use_legacy_prepare_cmd(
** return the text representation of the most recently used statement
** handle.
*/
-static int db_last_stmt_ptr(
+static int SQLITE_TCLAPI db_last_stmt_ptr(
ClientData cd,
Tcl_Interp *interp,
int objc,
@@ -4123,7 +4150,7 @@ static void init_all(Tcl_Interp *interp){
Sqlitetesttclvar_Init(interp);
Sqlitetestfs_Init(interp);
SqlitetestThread_Init(interp);
- SqlitetestOnefile_Init(interp);
+ SqlitetestOnefile_Init();
SqlitetestOsinst_Init(interp);
Sqlitetestbackup_Init(interp);
Sqlitetestintarray_Init(interp);
@@ -4167,7 +4194,7 @@ static void init_all(Tcl_Interp *interp){
#endif
#define TCLSH_MAIN main /* Needed to fake out mktclapp */
-int TCLSH_MAIN(int argc, char **argv){
+int SQLITE_CDECL TCLSH_MAIN(int argc, char **argv){
Tcl_Interp *interp;
#if !defined(_WIN32_WCE)
diff --git a/src/test1.c b/src/test1.c
index 7d8388113..ec6d8ecff 100644
--- a/src/test1.c
+++ b/src/test1.c
@@ -19,7 +19,11 @@
#endif
#include "vdbeInt.h"
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#include <stdlib.h>
#include <string.h>
@@ -75,7 +79,7 @@ void *sqlite3TestTextToPtr(const char *z){
** for an sqlite connection instance. Bad things happen if the
** input is not an sqlite connection.
*/
-static int get_sqlite_pointer(
+static int SQLITE_TCLAPI get_sqlite_pointer(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -221,7 +225,7 @@ static void io_trace_callback(const char *zFormat, ...){
** I/O tracing begins going into FILENAME. If FILENAME is an empty
** string, I/O tracing is turned off.
*/
-static int test_io_trace(
+static int SQLITE_TCLAPI test_io_trace(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -262,7 +266,7 @@ static int test_io_trace(
**
** Also return true if the OMIT_MISUSE environment variable exists.
*/
-static int clang_sanitize_address(
+static int SQLITE_TCLAPI clang_sanitize_address(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -289,7 +293,7 @@ static int clang_sanitize_address(
** DB. The SQL is the string FORMAT. The format string should contain
** one %s or %q. STRING is the value inserted into %s or %q.
*/
-static int test_exec_printf(
+static int SQLITE_TCLAPI test_exec_printf(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -327,7 +331,7 @@ static int test_exec_printf(
** HEX into ASCII. Most characters are translated as is. %HH becomes
** a hex character.
*/
-static int test_exec_hex(
+static int SQLITE_TCLAPI test_exec_hex(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -373,7 +377,7 @@ static int test_exec_hex(
**
** Enter or leave the mutex on a database connection.
*/
-static int db_enter(
+static int SQLITE_TCLAPI db_enter(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -389,7 +393,7 @@ static int db_enter(
sqlite3_mutex_enter(db->mutex);
return TCL_OK;
}
-static int db_leave(
+static int SQLITE_TCLAPI db_leave(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -411,7 +415,7 @@ static int db_leave(
**
** Invoke the sqlite3_exec interface using the open database DB
*/
-static int test_exec(
+static int SQLITE_TCLAPI test_exec(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -458,7 +462,7 @@ static int test_exec(
** Invoke the sqlite3_exec interface using the open database DB. Discard
** all results
*/
-static int test_exec_nr(
+static int SQLITE_TCLAPI test_exec_nr(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -485,7 +489,7 @@ static int test_exec_nr(
** concatenate arg0 through argn using separator as the separator.
** Return the result.
*/
-static int test_mprintf_z(
+static int SQLITE_TCLAPI test_mprintf_z(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -508,7 +512,7 @@ static int test_mprintf_z(
** Test the %n format of sqlite_mprintf(). Return the length of the
** input string.
*/
-static int test_mprintf_n(
+static int SQLITE_TCLAPI test_mprintf_n(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -532,7 +536,7 @@ static int test_mprintf_n(
** You pass in a format string that requires more than one argument,
** bad things will happen.
*/
-static int test_snprintf_int(
+static int SQLITE_TCLAPI test_snprintf_int(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -558,7 +562,7 @@ static int test_snprintf_int(
** DB. The SQL is the string FORMAT. The format string should contain
** one %s or %q. STRING is the value inserted into %s or %q.
*/
-static int test_get_table_printf(
+static int SQLITE_TCLAPI test_get_table_printf(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -621,7 +625,7 @@ static int test_get_table_printf(
**
** Returns the integer ROWID of the most recent insert.
*/
-static int test_last_rowid(
+static int SQLITE_TCLAPI test_last_rowid(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -645,7 +649,7 @@ static int test_last_rowid(
**
** Set the codec key.
*/
-static int test_key(
+static int SQLITE_TCLAPI test_key(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -673,7 +677,7 @@ static int test_key(
**
** Change the codec key.
*/
-static int test_rekey(
+static int SQLITE_TCLAPI test_rekey(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -701,7 +705,7 @@ static int test_rekey(
**
** Closes the database opened by sqlite3_open.
*/
-static int sqlite_test_close(
+static int SQLITE_TCLAPI sqlite_test_close(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -725,7 +729,7 @@ static int sqlite_test_close(
**
** Closes the database opened by sqlite3_open.
*/
-static int sqlite_test_close_v2(
+static int SQLITE_TCLAPI sqlite_test_close_v2(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -1009,7 +1013,7 @@ static void nondeterministicFunction(
** sqlite3_create_function function while a query is in progress in order
** to test the SQLITE_MISUSE detection logic.
*/
-static int test_create_function(
+static int SQLITE_TCLAPI test_create_function(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -1166,7 +1170,7 @@ static void legacyCountFinalize(sqlite3_context *context){
** "legacy_count()" with the supplied database handle. This is used
** to test the deprecated sqlite3_aggregate_count() API.
*/
-static int test_create_aggregate(
+static int SQLITE_TCLAPI test_create_aggregate(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -1207,7 +1211,7 @@ static int test_create_aggregate(
** Puts uses a separate buffer and debugging statements will be out of
** sequence if it is used.
*/
-static int test_printf(
+static int SQLITE_TCLAPI test_printf(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -1229,7 +1233,7 @@ static int test_printf(
**
** Call mprintf with three integer arguments
*/
-static int sqlite3_mprintf_int(
+static int SQLITE_TCLAPI sqlite3_mprintf_int(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -1256,7 +1260,7 @@ static int sqlite3_mprintf_int(
**
** Call mprintf with three 64-bit integer arguments
*/
-static int sqlite3_mprintf_int64(
+static int SQLITE_TCLAPI sqlite3_mprintf_int64(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -1289,7 +1293,7 @@ static int sqlite3_mprintf_int64(
** same as sqlite3_mprintf_int or sqlite3_mprintf_int64, depending on
** platform.
*/
-static int sqlite3_mprintf_long(
+static int SQLITE_TCLAPI sqlite3_mprintf_long(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -1320,7 +1324,7 @@ static int sqlite3_mprintf_long(
**
** Call mprintf with two integer arguments and one string argument
*/
-static int sqlite3_mprintf_str(
+static int SQLITE_TCLAPI sqlite3_mprintf_str(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -1347,7 +1351,7 @@ static int sqlite3_mprintf_str(
**
** Call mprintf with two integer arguments and one string argument
*/
-static int sqlite3_snprintf_str(
+static int SQLITE_TCLAPI sqlite3_snprintf_str(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -1381,7 +1385,7 @@ static int sqlite3_snprintf_str(
**
** Call mprintf with two integer arguments and one double argument
*/
-static int sqlite3_mprintf_double(
+static int SQLITE_TCLAPI sqlite3_mprintf_double(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -1412,7 +1416,7 @@ static int sqlite3_mprintf_double(
** two arguments given above. This is used to generate overflow and underflow
** doubles to test that they are converted properly.
*/
-static int sqlite3_mprintf_scaled(
+static int SQLITE_TCLAPI sqlite3_mprintf_scaled(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -1442,7 +1446,7 @@ static int sqlite3_mprintf_scaled(
** two arguments given above. This is used to generate overflow and underflow
** doubles to test that they are converted properly.
*/
-static int sqlite3_mprintf_stronly(
+static int SQLITE_TCLAPI sqlite3_mprintf_stronly(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -1466,7 +1470,7 @@ static int sqlite3_mprintf_stronly(
** Call mprintf with a single double argument which is derived from the
** hexadecimal encoding of an IEEE double.
*/
-static int sqlite3_mprintf_hexdouble(
+static int SQLITE_TCLAPI sqlite3_mprintf_hexdouble(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -1499,7 +1503,7 @@ static int sqlite3_mprintf_hexdouble(
**
*/
#if !defined(SQLITE_OMIT_SHARED_CACHE)
-static int test_enable_shared(
+static int SQLITE_TCLAPI test_enable_shared(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -1536,7 +1540,7 @@ static int test_enable_shared(
** Usage: sqlite3_extended_result_codes DB BOOLEAN
**
*/
-static int test_extended_result_codes(
+static int SQLITE_TCLAPI test_extended_result_codes(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -1559,7 +1563,7 @@ static int test_extended_result_codes(
** Usage: sqlite3_libversion_number
**
*/
-static int test_libversion_number(
+static int SQLITE_TCLAPI test_libversion_number(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -1573,7 +1577,7 @@ static int test_libversion_number(
** Usage: sqlite3_table_column_metadata DB dbname tblname colname
**
*/
-static int test_table_column_metadata(
+static int SQLITE_TCLAPI test_table_column_metadata(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -1624,7 +1628,7 @@ static int test_table_column_metadata(
#ifndef SQLITE_OMIT_INCRBLOB
-static int blobHandleFromObj(
+static int SQLITE_TCLAPI blobHandleFromObj(
Tcl_Interp *interp,
Tcl_Obj *pObj,
sqlite3_blob **ppBlob
@@ -1653,7 +1657,7 @@ static int blobHandleFromObj(
return TCL_OK;
}
-static int test_blob_reopen(
+static int SQLITE_TCLAPI test_blob_reopen(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -1729,7 +1733,7 @@ static int testCreateCollationCmp(
return iRes;
}
-static int test_create_collation_v2(
+static int SQLITE_TCLAPI test_create_collation_v2(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -1804,7 +1808,7 @@ static void cf2Destroy(void *pUser){
if( p->pDestroy ) Tcl_DecrRefCount(p->pDestroy);
sqlite3_free(p);
}
-static int test_create_function_v2(
+static int SQLITE_TCLAPI test_create_function_v2(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* The invoking TCL interpreter */
int objc, /* Number of arguments */
@@ -1892,7 +1896,7 @@ static int test_create_function_v2(
/*
** Usage: sqlite3_load_extension DB-HANDLE FILE ?PROC?
*/
-static int test_load_extension(
+static int SQLITE_TCLAPI test_load_extension(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -1950,7 +1954,7 @@ static int test_load_extension(
/*
** Usage: sqlite3_enable_load_extension DB-HANDLE ONOFF
*/
-static int test_enable_load(
+static int SQLITE_TCLAPI test_enable_load(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -1996,7 +2000,7 @@ static int test_enable_load(
** This command is used to test the recoverability of a database in
** the event of a program crash.
*/
-static int sqlite_abort(
+static int SQLITE_TCLAPI sqlite_abort(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -2055,7 +2059,7 @@ error_out:
**
** Register the test SQL function on the database DB under the name NAME.
*/
-static int test_register_func(
+static int SQLITE_TCLAPI test_register_func(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -2084,7 +2088,7 @@ static int test_register_func(
**
** Finalize a statement handle.
*/
-static int test_finalize(
+static int SQLITE_TCLAPI test_finalize(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2116,7 +2120,7 @@ static int test_finalize(
**
** Get the value of a status counter from a statement.
*/
-static int test_stmt_status(
+static int SQLITE_TCLAPI test_stmt_status(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2161,7 +2165,7 @@ static int test_stmt_status(
/*
** Usage: sqlite3_stmt_scanstatus STMT IDX
*/
-static int test_stmt_scanstatus(
+static int SQLITE_TCLAPI test_stmt_scanstatus(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2211,7 +2215,7 @@ static int test_stmt_scanstatus(
/*
** Usage: sqlite3_stmt_scanstatus_reset STMT
*/
-static int test_stmt_scanstatus_reset(
+static int SQLITE_TCLAPI test_stmt_scanstatus_reset(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2234,7 +2238,7 @@ static int test_stmt_scanstatus_reset(
**
** Zero the SQLITE_CONFIG_SQLLOG configuration
*/
-static int test_config_sqllog(
+static int SQLITE_TCLAPI test_config_sqllog(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2254,7 +2258,7 @@ static int test_config_sqllog(
**
** Return the value returned by the default VFS's xCurrentTimeInt64 method.
*/
-static int vfsCurrentTimeInt64(
+static int SQLITE_TCLAPI vfsCurrentTimeInt64(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2275,7 +2279,7 @@ static int vfsCurrentTimeInt64(
/*
** Usage: sqlite3_snapshot_get DB DBNAME
*/
-static int test_snapshot_get(
+static int SQLITE_TCLAPI test_snapshot_get(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2310,7 +2314,7 @@ static int test_snapshot_get(
/*
** Usage: sqlite3_snapshot_open DB DBNAME SNAPSHOT
*/
-static int test_snapshot_open(
+static int SQLITE_TCLAPI test_snapshot_open(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2342,7 +2346,7 @@ static int test_snapshot_open(
/*
** Usage: sqlite3_snapshot_free SNAPSHOT
*/
-static int test_snapshot_free(
+static int SQLITE_TCLAPI test_snapshot_free(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2363,7 +2367,7 @@ static int test_snapshot_free(
/*
** Usage: sqlite3_snapshot_cmp SNAPSHOT1 SNAPSHOT2
*/
-static int test_snapshot_cmp(
+static int SQLITE_TCLAPI test_snapshot_cmp(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2389,7 +2393,7 @@ static int test_snapshot_cmp(
**
** Return the next statment in sequence after STMT.
*/
-static int test_next_stmt(
+static int SQLITE_TCLAPI test_next_stmt(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2421,7 +2425,7 @@ static int test_next_stmt(
** Return true if STMT is a NULL pointer or a pointer to a statement
** that is guaranteed to leave the database unmodified.
*/
-static int test_stmt_readonly(
+static int SQLITE_TCLAPI test_stmt_readonly(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2448,7 +2452,7 @@ static int test_stmt_readonly(
** Return true if STMT is a non-NULL pointer to a statement
** that has been stepped but not to completion.
*/
-static int test_stmt_busy(
+static int SQLITE_TCLAPI test_stmt_busy(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2474,7 +2478,7 @@ static int test_stmt_busy(
**
** Return true if STMT uses a statement journal.
*/
-static int uses_stmt_journal(
+static int SQLITE_TCLAPI uses_stmt_journal(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2500,7 +2504,7 @@ static int uses_stmt_journal(
**
** Reset a statement handle.
*/
-static int test_reset(
+static int SQLITE_TCLAPI test_reset(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2535,7 +2539,7 @@ static int test_reset(
**
** Return TRUE if a recompilation of the statement is recommended.
*/
-static int test_expired(
+static int SQLITE_TCLAPI test_expired(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2559,7 +2563,7 @@ static int test_expired(
**
** Transfer all bindings from FROMSTMT over to TOSTMT
*/
-static int test_transfer_bind(
+static int SQLITE_TCLAPI test_transfer_bind(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2586,7 +2590,7 @@ static int test_transfer_bind(
** Return the number of changes made to the database by the last SQL
** execution.
*/
-static int test_changes(
+static int SQLITE_TCLAPI test_changes(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2621,7 +2625,7 @@ static int sqlite_static_bind_nbyte = 0;
** of the VALUE is made. If FLAGS=="blob10" then a VALUE is ignored
** an a 10-byte blob "abc\000xyz\000pq" is inserted.
*/
-static int test_bind(
+static int SQLITE_TCLAPI test_bind(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -2743,7 +2747,7 @@ static int test_collate_func(
Tcl_GetIntFromObj(i, Tcl_GetObjResult(i), &res);
return res;
}
-static int test_collate(
+static int SQLITE_TCLAPI test_collate(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2817,7 +2821,7 @@ static int test_utf16bin_collate_func(
if( res==0 ) res = nA - nB;
return res;
}
-static int test_utf16bin_collate(
+static int SQLITE_TCLAPI test_utf16bin_collate(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2874,7 +2878,7 @@ static void test_collate_needed_cb(
/*
** Usage: add_test_collate_needed DB
*/
-static int test_collate_needed(
+static int SQLITE_TCLAPI test_collate_needed(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -2925,7 +2929,7 @@ static int alignmentCollFunc(
}
return rc;
}
-static int add_alignment_test_collations(
+static int SQLITE_TCLAPI add_alignment_test_collations(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3043,7 +3047,7 @@ static void test_function_utf16be(
sqlite3ValueFree(pVal);
}
#endif /* SQLITE_OMIT_UTF16 */
-static int test_function(
+static int SQLITE_TCLAPI test_function(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3088,7 +3092,7 @@ bad_args:
** The result is a list of two elements, the string representation of the
** error code and the english language explanation.
*/
-static int test_errstr(
+static int SQLITE_TCLAPI test_errstr(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3121,7 +3125,7 @@ static int test_errstr(
** Then run testfixture in the debugger and wait for the breakpoint to
** fire. Then additional breakpoints can be set to trace down the bug.
*/
-static int test_breakpoint(
+static int SQLITE_TCLAPI test_breakpoint(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -3137,7 +3141,7 @@ static int test_breakpoint(
** IDX is the index of a wildcard in the prepared statement. This command
** binds a N-byte zero-filled BLOB to the wildcard.
*/
-static int test_bind_zeroblob(
+static int SQLITE_TCLAPI test_bind_zeroblob(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3173,7 +3177,7 @@ static int test_bind_zeroblob(
** IDX is the index of a wildcard in the prepared statement. This command
** binds a N-byte zero-filled BLOB to the wildcard.
*/
-static int test_bind_zeroblob64(
+static int SQLITE_TCLAPI test_bind_zeroblob64(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3210,7 +3214,7 @@ static int test_bind_zeroblob64(
** N is the index of a wildcard in the prepared statement. This command
** binds a 32-bit integer VALUE to that wildcard.
*/
-static int test_bind_int(
+static int SQLITE_TCLAPI test_bind_int(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3250,7 +3254,7 @@ static int test_bind_int(
** with no arguments in order to release memory. Each call to this procedure
** overwrites the previous array.
*/
-static int test_intarray_addr(
+static int SQLITE_TCLAPI test_intarray_addr(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3284,7 +3288,7 @@ static int test_intarray_addr(
** with no arguments in order to release memory. Each call to this procedure
** overwrites the previous array.
*/
-static int test_int64array_addr(
+static int SQLITE_TCLAPI test_int64array_addr(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3320,7 +3324,7 @@ static int test_int64array_addr(
** with no arguments in order to release memory. Each call to this procedure
** overwrites the previous array.
*/
-static int test_doublearray_addr(
+static int SQLITE_TCLAPI test_doublearray_addr(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3354,7 +3358,7 @@ static int test_doublearray_addr(
** with no arguments in order to release memory. Each call to this procedure
** overwrites the previous array.
*/
-static int test_textarray_addr(
+static int SQLITE_TCLAPI test_textarray_addr(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3387,7 +3391,7 @@ static int test_textarray_addr(
** N is the index of a wildcard in the prepared statement. This command
** binds a 64-bit integer VALUE to that wildcard.
*/
-static int test_bind_int64(
+static int SQLITE_TCLAPI test_bind_int64(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3425,7 +3429,7 @@ static int test_bind_int64(
** N is the index of a wildcard in the prepared statement. This command
** binds a 64-bit integer VALUE to that wildcard.
*/
-static int test_bind_double(
+static int SQLITE_TCLAPI test_bind_double(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3501,7 +3505,7 @@ static int test_bind_double(
** N is the index of a wildcard in the prepared statement. This command
** binds a NULL to the wildcard.
*/
-static int test_bind_null(
+static int SQLITE_TCLAPI test_bind_null(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3537,7 +3541,7 @@ static int test_bind_null(
** binds a UTF-8 string STRING to the wildcard. The string is BYTES bytes
** long.
*/
-static int test_bind_text(
+static int SQLITE_TCLAPI test_bind_text(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3578,7 +3582,7 @@ static int test_bind_text(
** binds a UTF-16 string STRING to the wildcard. The string is BYTES bytes
** long.
*/
-static int test_bind_text16(
+static int SQLITE_TCLAPI test_bind_text16(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3626,7 +3630,7 @@ static int test_bind_text16(
** N is the index of a wildcard in the prepared statement. This command
** binds a BLOB to the wildcard. The BLOB is BYTES bytes in size.
*/
-static int test_bind_blob(
+static int SQLITE_TCLAPI test_bind_blob(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3678,7 +3682,7 @@ static int test_bind_blob(
**
** Return the number of wildcards in the given statement.
*/
-static int test_bind_parameter_count(
+static int SQLITE_TCLAPI test_bind_parameter_count(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3702,7 +3706,7 @@ static int test_bind_parameter_count(
** An empty string is returned if N is out of range or if the wildcard
** is nameless.
*/
-static int test_bind_parameter_name(
+static int SQLITE_TCLAPI test_bind_parameter_name(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3729,7 +3733,7 @@ static int test_bind_parameter_name(
** Return the index of the wildcard called NAME. Return 0 if there is
** no such wildcard.
*/
-static int test_bind_parameter_index(
+static int SQLITE_TCLAPI test_bind_parameter_index(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3754,7 +3758,7 @@ static int test_bind_parameter_index(
** Usage: sqlite3_clear_bindings STMT
**
*/
-static int test_clear_bindings(
+static int SQLITE_TCLAPI test_clear_bindings(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3774,7 +3778,7 @@ static int test_clear_bindings(
/*
** Usage: sqlite3_sleep MILLISECONDS
*/
-static int test_sleep(
+static int SQLITE_TCLAPI test_sleep(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3799,7 +3803,7 @@ static int test_sleep(
** Return the string representation of the most recent sqlite3_* API
** error code. e.g. "SQLITE_ERROR".
*/
-static int test_ex_errcode(
+static int SQLITE_TCLAPI test_ex_errcode(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3826,7 +3830,7 @@ static int test_ex_errcode(
** Return the string representation of the most recent sqlite3_* API
** error code. e.g. "SQLITE_ERROR".
*/
-static int test_errcode(
+static int SQLITE_TCLAPI test_errcode(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3852,7 +3856,7 @@ static int test_errcode(
** Returns the UTF-8 representation of the error message string for the
** most recent sqlite3_* API call.
*/
-static int test_errmsg(
+static int SQLITE_TCLAPI test_errmsg(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3881,7 +3885,7 @@ static int test_errmsg(
** level, and it includes the 0x00 0x00 terminator bytes at the end of the
** UTF-16 string.
*/
-static int test_errmsg16(
+static int SQLITE_TCLAPI test_errmsg16(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3918,7 +3922,7 @@ static int test_errmsg16(
** variable that is set to the unused portion of <sql> (if any). A
** STMT handle is returned.
*/
-static int test_prepare(
+static int SQLITE_TCLAPI test_prepare(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -3975,7 +3979,7 @@ static int test_prepare(
** variable that is set to the unused portion of <sql> (if any). A
** STMT handle is returned.
*/
-static int test_prepare_v2(
+static int SQLITE_TCLAPI test_prepare_v2(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4043,7 +4047,7 @@ static int test_prepare_v2(
** Generate a prepared statement for a zero-byte string as a test
** for ticket #3134. The string should be preceded by a zero byte.
*/
-static int test_prepare_tkt3134(
+static int SQLITE_TCLAPI test_prepare_tkt3134(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4086,7 +4090,7 @@ static int test_prepare_tkt3134(
** variable that is set to the unused portion of <sql> (if any). A
** STMT handle is returned.
*/
-static int test_prepare16(
+static int SQLITE_TCLAPI test_prepare16(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4146,7 +4150,7 @@ static int test_prepare16(
** variable that is set to the unused portion of <sql> (if any). A
** STMT handle is returned.
*/
-static int test_prepare16_v2(
+static int SQLITE_TCLAPI test_prepare16_v2(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4201,7 +4205,7 @@ static int test_prepare16_v2(
/*
** Usage: sqlite3_open filename ?options-list?
*/
-static int test_open(
+static int SQLITE_TCLAPI test_open(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4228,7 +4232,7 @@ static int test_open(
/*
** Usage: sqlite3_open_v2 FILENAME FLAGS VFS
*/
-static int test_open_v2(
+static int SQLITE_TCLAPI test_open_v2(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4298,7 +4302,7 @@ static int test_open_v2(
/*
** Usage: sqlite3_open16 filename options
*/
-static int test_open16(
+static int SQLITE_TCLAPI test_open16(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4330,7 +4334,7 @@ static int test_open16(
** Return 1 if the supplied argument is a complete SQL statement, or zero
** otherwise.
*/
-static int test_complete16(
+static int SQLITE_TCLAPI test_complete16(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4355,7 +4359,7 @@ static int test_complete16(
**
** Advance the statement to the next row.
*/
-static int test_step(
+static int SQLITE_TCLAPI test_step(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4378,7 +4382,7 @@ static int test_step(
return TCL_OK;
}
-static int test_sql(
+static int SQLITE_TCLAPI test_sql(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4395,7 +4399,7 @@ static int test_sql(
Tcl_SetResult(interp, (char *)sqlite3_sql(pStmt), TCL_VOLATILE);
return TCL_OK;
}
-static int test_ex_sql(
+static int SQLITE_TCLAPI test_ex_sql(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4421,7 +4425,7 @@ static int test_ex_sql(
**
** Return the number of columns returned by the sql statement STMT.
*/
-static int test_column_count(
+static int SQLITE_TCLAPI test_column_count(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4446,7 +4450,7 @@ static int test_column_count(
**
** Return the type of the data in column 'column' of the current row.
*/
-static int test_column_type(
+static int SQLITE_TCLAPI test_column_type(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4495,7 +4499,7 @@ static int test_column_type(
** Return the data in column 'column' of the current row cast as an
** wide (64-bit) integer.
*/
-static int test_column_int64(
+static int SQLITE_TCLAPI test_column_int64(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4522,7 +4526,7 @@ static int test_column_int64(
/*
** Usage: sqlite3_column_blob STMT column
*/
-static int test_column_blob(
+static int SQLITE_TCLAPI test_column_blob(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4554,7 +4558,7 @@ static int test_column_blob(
**
** Return the data in column 'column' of the current row cast as a double.
*/
-static int test_column_double(
+static int SQLITE_TCLAPI test_column_double(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4583,7 +4587,7 @@ static int test_column_double(
**
** Return the number of columns returned by the sql statement STMT.
*/
-static int test_data_count(
+static int SQLITE_TCLAPI test_data_count(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4610,7 +4614,7 @@ static int test_data_count(
**
** Usage: sqlite3_column_name STMT column
*/
-static int test_stmt_utf8(
+static int SQLITE_TCLAPI test_stmt_utf8(
void * clientData, /* Pointer to SQLite API function to be invoke */
Tcl_Interp *interp,
int objc,
@@ -4637,7 +4641,7 @@ static int test_stmt_utf8(
return TCL_OK;
}
-static int test_global_recover(
+static int SQLITE_TCLAPI test_global_recover(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4662,7 +4666,7 @@ static int test_global_recover(
**
** Usage: sqlite3_column_name STMT column
*/
-static int test_stmt_utf16(
+static int SQLITE_TCLAPI test_stmt_utf16(
void * clientData, /* Pointer to SQLite API function to be invoked */
Tcl_Interp *interp,
int objc,
@@ -4706,7 +4710,7 @@ static int test_stmt_utf16(
** Usage: sqlite3_column_bytes16 STMT column
**
*/
-static int test_stmt_int(
+static int SQLITE_TCLAPI test_stmt_int(
void * clientData, /* Pointer to SQLite API function to be invoked */
Tcl_Interp *interp,
int objc,
@@ -4735,7 +4739,7 @@ static int test_stmt_int(
**
** Set the db->magic value. This is used to test error recovery logic.
*/
-static int sqlite_set_magic(
+static int SQLITE_TCLAPI sqlite_set_magic(
void * clientData,
Tcl_Interp *interp,
int argc,
@@ -4767,7 +4771,7 @@ static int sqlite_set_magic(
**
** Trigger an interrupt on DB
*/
-static int test_interrupt(
+static int SQLITE_TCLAPI test_interrupt(
void * clientData,
Tcl_Interp *interp,
int argc,
@@ -4808,7 +4812,7 @@ u64 sqlite3StackDepth(void){
**
** Try to measure the amount of stack space used by a call to sqlite3_exec
*/
-static int test_stack_used(
+static int SQLITE_TCLAPI test_stack_used(
void * clientData,
Tcl_Interp *interp,
int argc,
@@ -4836,7 +4840,7 @@ static int test_stack_used(
** is assumed that the user function was created as UTF8, any number of
** arguments (the way the TCL interface does it).
*/
-static int delete_function(
+static int SQLITE_TCLAPI delete_function(
void * clientData,
Tcl_Interp *interp,
int argc,
@@ -4862,7 +4866,7 @@ static int delete_function(
** DB. It is assumed that the collation sequence was created as UTF8 (the
** way the TCL interface does it).
*/
-static int delete_collation(
+static int SQLITE_TCLAPI delete_collation(
void * clientData,
Tcl_Interp *interp,
int argc,
@@ -4887,7 +4891,7 @@ static int delete_collation(
** Return true if the database DB is currently in auto-commit mode.
** Return false if not.
*/
-static int get_autocommit(
+static int SQLITE_TCLAPI get_autocommit(
void * clientData,
Tcl_Interp *interp,
int argc,
@@ -4913,7 +4917,7 @@ static int get_autocommit(
** method of the TCL interface. But we need a way to test the case
** where it returns SQLITE_MISUSE.
*/
-static int test_busy_timeout(
+static int SQLITE_TCLAPI test_busy_timeout(
void * clientData,
Tcl_Interp *interp,
int argc,
@@ -4939,7 +4943,7 @@ static int test_busy_timeout(
** Return the name of the internal representation for the
** value of the given variable.
*/
-static int tcl_variable_type(
+static int SQLITE_TCLAPI tcl_variable_type(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4965,7 +4969,7 @@ static int tcl_variable_type(
** The integer N is the number of bytes we are trying to release. The
** return value is the amount of memory actually released.
*/
-static int test_release_memory(
+static int SQLITE_TCLAPI test_release_memory(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -4996,7 +5000,7 @@ static int test_release_memory(
** Attempt to release memory currently held by database DB. Return the
** result code (which in the current implementation is always zero).
*/
-static int test_db_release_memory(
+static int SQLITE_TCLAPI test_db_release_memory(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -5019,7 +5023,7 @@ static int test_db_release_memory(
**
** Attempt to flush any dirty pages to disk.
*/
-static int test_db_cacheflush(
+static int SQLITE_TCLAPI test_db_cacheflush(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -5047,7 +5051,7 @@ static int test_db_cacheflush(
**
** Return the low-level system errno value.
*/
-static int test_system_errno(
+static int SQLITE_TCLAPI test_system_errno(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -5070,7 +5074,7 @@ static int test_system_errno(
**
** Return the name of a file associated with a database.
*/
-static int test_db_filename(
+static int SQLITE_TCLAPI test_db_filename(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -5094,7 +5098,7 @@ static int test_db_filename(
** Return 1 or 0 if DBNAME is readonly or not. Return -1 if DBNAME does
** not exist.
*/
-static int test_db_readonly(
+static int SQLITE_TCLAPI test_db_readonly(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -5119,7 +5123,7 @@ static int test_db_readonly(
** limit is only changed if the N is present. The previous limit
** is returned.
*/
-static int test_soft_heap_limit(
+static int SQLITE_TCLAPI test_soft_heap_limit(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -5144,7 +5148,7 @@ static int test_soft_heap_limit(
**
** Call the sqlite3_thread_cleanup API.
*/
-static int test_thread_cleanup(
+static int SQLITE_TCLAPI test_thread_cleanup(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -5162,7 +5166,7 @@ static int test_thread_cleanup(
** Return a list of numbers which are the PagerRefcount for all
** pagers on each database connection.
*/
-static int test_pager_refcounts(
+static int SQLITE_TCLAPI test_pager_refcounts(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -5208,7 +5212,7 @@ static int test_pager_refcounts(
** and that the errors they are seeing in the test scripts might be
** a result of their defective TCL rather than problems in SQLite.
*/
-static int working_64bit_int(
+static int SQLITE_TCLAPI working_64bit_int(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5233,7 +5237,7 @@ static int working_64bit_int(
** VFS when none are previously registered, and the ability to
** unregister the only available VFS. Ticket #2738
*/
-static int vfs_unlink_test(
+static int SQLITE_TCLAPI vfs_unlink_test(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5335,7 +5339,7 @@ static int vfs_unlink_test(
** This TCL command attempts to vfs_find and vfs_register when the
** sqlite3_initialize() interface is failing. All calls should fail.
*/
-static int vfs_initfail_test(
+static int SQLITE_TCLAPI vfs_initfail_test(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5363,7 +5367,7 @@ static int nVfs = 0;
**
** Unregister all VFSes.
*/
-static int vfs_unregister_all(
+static int SQLITE_TCLAPI vfs_unregister_all(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5385,7 +5389,7 @@ static int vfs_unregister_all(
** care to put the linked list back together in the same order as it was
** in before vfs_unregister_all was invoked.
*/
-static int vfs_reregister_all(
+static int SQLITE_TCLAPI vfs_reregister_all(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5405,7 +5409,7 @@ static int vfs_reregister_all(
** This TCL command runs the sqlite3_file_control interface and
** verifies correct operation of the same.
*/
-static int file_control_test(
+static int SQLITE_TCLAPI file_control_test(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5440,7 +5444,7 @@ static int file_control_test(
** This TCL command runs the sqlite3_file_control interface and
** verifies correct operation of the SQLITE_LAST_ERRNO verb.
*/
-static int file_control_lasterrno_test(
+static int SQLITE_TCLAPI file_control_lasterrno_test(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5478,7 +5482,7 @@ static int file_control_lasterrno_test(
** verifies correct operation of the SQLITE_GET_LOCKPROXYFILE and
** SQLITE_SET_LOCKPROXYFILE verbs.
*/
-static int file_control_chunksize_test(
+static int SQLITE_TCLAPI file_control_chunksize_test(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5515,7 +5519,7 @@ static int file_control_chunksize_test(
** This TCL command runs the sqlite3_file_control interface
** with SQLITE_FCNTL_SIZE_HINT
*/
-static int file_control_sizehint_test(
+static int SQLITE_TCLAPI file_control_sizehint_test(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5553,7 +5557,7 @@ static int file_control_sizehint_test(
** verifies correct operation of the SQLITE_GET_LOCKPROXYFILE and
** SQLITE_SET_LOCKPROXYFILE verbs.
*/
-static int file_control_lockproxy_test(
+static int SQLITE_TCLAPI file_control_lockproxy_test(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5623,7 +5627,7 @@ static int file_control_lockproxy_test(
** This TCL command runs the sqlite3_file_control interface with
** the SQLITE_FCNTL_WIN32_AV_RETRY opcode.
*/
-static int file_control_win32_av_retry(
+static int SQLITE_TCLAPI file_control_win32_av_retry(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5656,7 +5660,7 @@ static int file_control_win32_av_retry(
** This TCL command runs the sqlite3_file_control interface with
** the SQLITE_FCNTL_WIN32_SET_HANDLE opcode.
*/
-static int file_control_win32_set_handle(
+static int SQLITE_TCLAPI file_control_win32_set_handle(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5692,7 +5696,7 @@ static int file_control_win32_set_handle(
** This TCL command runs the sqlite3_file_control interface with
** the SQLITE_FCNTL_PERSIST_WAL opcode.
*/
-static int file_control_persist_wal(
+static int SQLITE_TCLAPI file_control_persist_wal(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5724,7 +5728,7 @@ static int file_control_persist_wal(
** This TCL command runs the sqlite3_file_control interface with
** the SQLITE_FCNTL_POWERSAFE_OVERWRITE opcode.
*/
-static int file_control_powersafe_overwrite(
+static int SQLITE_TCLAPI file_control_powersafe_overwrite(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5756,7 +5760,7 @@ static int file_control_powersafe_overwrite(
**
** Return a string that describes the stack of VFSes.
*/
-static int file_control_vfsname(
+static int SQLITE_TCLAPI file_control_vfsname(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5788,7 +5792,7 @@ static int file_control_vfsname(
**
** Return a string that is a temporary filename
*/
-static int file_control_tempfilename(
+static int SQLITE_TCLAPI file_control_tempfilename(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5821,7 +5825,7 @@ static int file_control_tempfilename(
**
** Return a tcl list containing the names of all registered vfs's.
*/
-static int vfs_list(
+static int SQLITE_TCLAPI vfs_list(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5846,7 +5850,7 @@ static int vfs_list(
** This TCL command runs the sqlite3_limit interface and
** verifies correct operation of the same.
*/
-static int test_limit(
+static int SQLITE_TCLAPI test_limit(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5909,7 +5913,7 @@ static int test_limit(
** At the same time, verify that sqlite3_test_control works even when
** called with an out-of-range opcode.
*/
-static int save_prng_state(
+static int SQLITE_TCLAPI save_prng_state(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5925,7 +5929,7 @@ static int save_prng_state(
/*
** tclcmd: restore_prng_state
*/
-static int restore_prng_state(
+static int SQLITE_TCLAPI restore_prng_state(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5937,7 +5941,7 @@ static int restore_prng_state(
/*
** tclcmd: reset_prng_state
*/
-static int reset_prng_state(
+static int SQLITE_TCLAPI reset_prng_state(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5953,7 +5957,7 @@ static int reset_prng_state(
** Indicate that database files might be corrupt. In other words, set the normal
** state of operation.
*/
-static int database_may_be_corrupt(
+static int SQLITE_TCLAPI database_may_be_corrupt(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5968,7 +5972,7 @@ static int database_may_be_corrupt(
** Indicate that database files are always well-formed. This enables extra assert()
** statements that test conditions that are always true for well-formed databases.
*/
-static int database_never_corrupt(
+static int SQLITE_TCLAPI database_never_corrupt(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -5981,7 +5985,7 @@ static int database_never_corrupt(
/*
** tclcmd: pcache_stats
*/
-static int test_pcache_stats(
+static int SQLITE_TCLAPI test_pcache_stats(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -6023,7 +6027,7 @@ static void test_unlock_notify_cb(void **aArg, int nArg){
** tclcmd: sqlite3_unlock_notify db
*/
#ifdef SQLITE_ENABLE_UNLOCK_NOTIFY
-static int test_unlock_notify(
+static int SQLITE_TCLAPI test_unlock_notify(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -6049,7 +6053,7 @@ static int test_unlock_notify(
/*
** tclcmd: sqlite3_wal_checkpoint db ?NAME?
*/
-static int test_wal_checkpoint(
+static int SQLITE_TCLAPI test_wal_checkpoint(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -6093,7 +6097,7 @@ static int test_wal_checkpoint(
** the number of frames in the log and the number of frames in the log
** that have been checkpointed.
*/
-static int test_wal_checkpoint_v2(
+static int SQLITE_TCLAPI test_wal_checkpoint_v2(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -6149,7 +6153,7 @@ static int test_wal_checkpoint_v2(
/*
** tclcmd: sqlite3_wal_autocheckpoint db VALUE
*/
-static int test_wal_autocheckpoint(
+static int SQLITE_TCLAPI test_wal_autocheckpoint(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -6200,7 +6204,7 @@ static void xLogcallback(void *unused, int err, char *zMsg){
Tcl_EvalObjEx(logcallback.pInterp, pNew, TCL_EVAL_GLOBAL|TCL_EVAL_DIRECT);
Tcl_DecrRefCount(pNew);
}
-static int test_sqlite3_log(
+static int SQLITE_TCLAPI test_sqlite3_log(
ClientData clientData,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -6231,7 +6235,7 @@ static int test_sqlite3_log(
** Run a TCL command using its objProc interface. Throw an error if
** the command has no objProc interface.
*/
-static int runAsObjProc(
+static int SQLITE_TCLAPI runAsObjProc(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -6294,7 +6298,7 @@ int printExplainQueryPlan(sqlite3_stmt *pStmt){
return sqlite3_finalize(pExplain);
}
-static int test_print_eqp(
+static int SQLITE_TCLAPI test_print_eqp(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -6322,7 +6326,7 @@ static int test_print_eqp(
/*
** sqlite3_test_control VERB ARGS...
*/
-static int test_test_control(
+static int SQLITE_TCLAPI test_test_control(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -6401,7 +6405,7 @@ static int test_test_control(
#include <sys/time.h>
#include <sys/resource.h>
-static int test_getrusage(
+static int SQLITE_TCLAPI test_getrusage(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -6444,7 +6448,7 @@ struct win32FileLocker {
/*
** The background thread that does file locking.
*/
-static void win32_file_locker(void *pAppData){
+static void SQLITE_CDECL win32_file_locker(void *pAppData){
struct win32FileLocker *p = (struct win32FileLocker*)pAppData;
if( p->evName ){
HANDLE ev = OpenEvent(EVENT_MODIFY_STATE, FALSE, p->evName);
@@ -6475,7 +6479,7 @@ static void win32_file_locker(void *pAppData){
** Get an exclusive manditory lock on file for DELAY2 milliseconds.
** Wait DELAY1 milliseconds before acquiring the lock.
*/
-static int win32_file_lock(
+static int SQLITE_TCLAPI win32_file_lock(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -6539,7 +6543,7 @@ static int win32_file_lock(
** Returns non-zero if the specified path exists, whose fully qualified name
** may exceed 260 characters if it is prefixed with "\\?\".
*/
-static int win32_exists_path(
+static int SQLITE_TCLAPI win32_exists_path(
void *clientData,
Tcl_Interp *interp,
int objc,
@@ -6561,7 +6565,7 @@ static int win32_exists_path(
** whose fully qualified name may exceed 248 characters if it is prefixed with
** "\\?\".
*/
-static int win32_find_file(
+static int SQLITE_TCLAPI win32_find_file(
void *clientData,
Tcl_Interp *interp,
int objc,
@@ -6606,7 +6610,7 @@ static int win32_find_file(
** Deletes the specified file, whose fully qualified name may exceed 260
** characters if it is prefixed with "\\?\".
*/
-static int win32_delete_file(
+static int SQLITE_TCLAPI win32_delete_file(
void *clientData,
Tcl_Interp *interp,
int objc,
@@ -6630,7 +6634,7 @@ static int win32_delete_file(
** Creates the specified directory, whose fully qualified name may exceed 248
** characters if it is prefixed with "\\?\".
*/
-static int win32_mkdir(
+static int SQLITE_TCLAPI win32_mkdir(
void *clientData,
Tcl_Interp *interp,
int objc,
@@ -6654,7 +6658,7 @@ static int win32_mkdir(
** Removes the specified directory, whose fully qualified name may exceed 248
** characters if it is prefixed with "\\?\".
*/
-static int win32_rmdir(
+static int SQLITE_TCLAPI win32_rmdir(
void *clientData,
Tcl_Interp *interp,
int objc,
@@ -6681,7 +6685,7 @@ static int win32_rmdir(
** interface. Disable if BOOLEAN is false and enable if BOOLEAN is true.
** OPT is the name of the optimization to be disabled.
*/
-static int optimization_control(
+static int SQLITE_TCLAPI optimization_control(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -6744,7 +6748,7 @@ typedef struct sqlite3_api_routines sqlite3_api_routines;
**
** Load one or more statically linked extensions.
*/
-static int tclLoadStaticExtensionCmd(
+static int SQLITE_TCLAPI tclLoadStaticExtensionCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -6822,7 +6826,7 @@ static int tclLoadStaticExtensionCmd(
** sorter_test_fakeheap BOOL
**
*/
-static int sorter_test_fakeheap(
+static int SQLITE_TCLAPI sorter_test_fakeheap(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -6862,7 +6866,7 @@ static int sorter_test_fakeheap(
** Then execute statement $SQL2. Check that the statement returns the same
** set of integers in the same order as in the previous step (using $SQL1).
*/
-static int sorter_test_sort4_helper(
+static int SQLITE_TCLAPI sorter_test_sort4_helper(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -6931,7 +6935,7 @@ static int sorter_test_sort4_helper(
/*
** tclcmd: sqlite3_user_authenticate DB USERNAME PASSWORD
*/
-static int test_user_authenticate(
+static int SQLITE_TCLAPI test_user_authenticate(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -6962,7 +6966,7 @@ static int test_user_authenticate(
/*
** tclcmd: sqlite3_user_add DB USERNAME PASSWORD ISADMIN
*/
-static int test_user_add(
+static int SQLITE_TCLAPI test_user_add(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -6995,7 +6999,7 @@ static int test_user_add(
/*
** tclcmd: sqlite3_user_change DB USERNAME PASSWORD ISADMIN
*/
-static int test_user_change(
+static int SQLITE_TCLAPI test_user_change(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -7028,7 +7032,7 @@ static int test_user_change(
/*
** tclcmd: sqlite3_user_delete DB USERNAME
*/
-static int test_user_delete(
+static int SQLITE_TCLAPI test_user_delete(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -7065,7 +7069,7 @@ static int test_user_delete(
** 3 Read after free
** 4 Panic
*/
-static int test_bad_behavior(
+static int SQLITE_TCLAPI test_bad_behavior(
ClientData clientData, /* Pointer to an integer containing zero */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -7115,7 +7119,7 @@ static int test_bad_behavior(
**
** Cause the dbstat virtual table to be available on the connection DB
*/
-static int test_register_dbstat_vtab(
+static int SQLITE_TCLAPI test_register_dbstat_vtab(
void *clientData,
Tcl_Interp *interp,
int objc,
@@ -7149,7 +7153,7 @@ static int test_register_dbstat_vtab(
**
** Invoke sqlite3_db_config() for one of the setting values.
*/
-static int test_sqlite3_db_config(
+static int SQLITE_TCLAPI test_sqlite3_db_config(
void *clientData,
Tcl_Interp *interp,
int objc,
@@ -7206,7 +7210,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
extern int sqlite3_hostid_num;
#endif
extern int sqlite3_max_blobsize;
- extern int sqlite3BtreeSharedCacheReport(void*,
+ extern int SQLITE_TCLAPI sqlite3BtreeSharedCacheReport(void*,
Tcl_Interp*,int,Tcl_Obj*CONST*);
static int iZero = 0;
static struct {
diff --git a/src/test2.c b/src/test2.c
index d16ba5016..dfca1d2b3 100644
--- a/src/test2.c
+++ b/src/test2.c
@@ -14,7 +14,11 @@
** testing of the SQLite library.
*/
#include "sqliteInt.h"
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
@@ -38,7 +42,7 @@ static void pager_test_reiniter(DbPage *pNotUsed){
**
** Open a new pager
*/
-static int pager_open(
+static int SQLITE_TCLAPI pager_open(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -75,7 +79,7 @@ static int pager_open(
**
** Close the given pager.
*/
-static int pager_close(
+static int SQLITE_TCLAPI pager_close(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -102,7 +106,7 @@ static int pager_close(
**
** Rollback changes
*/
-static int pager_rollback(
+static int SQLITE_TCLAPI pager_rollback(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -129,7 +133,7 @@ static int pager_rollback(
**
** Commit all changes
*/
-static int pager_commit(
+static int SQLITE_TCLAPI pager_commit(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -161,7 +165,7 @@ static int pager_commit(
**
** Start a new checkpoint.
*/
-static int pager_stmt_begin(
+static int SQLITE_TCLAPI pager_stmt_begin(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -188,7 +192,7 @@ static int pager_stmt_begin(
**
** Rollback changes to a checkpoint
*/
-static int pager_stmt_rollback(
+static int SQLITE_TCLAPI pager_stmt_rollback(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -216,7 +220,7 @@ static int pager_stmt_rollback(
**
** Commit changes to a checkpoint
*/
-static int pager_stmt_commit(
+static int SQLITE_TCLAPI pager_stmt_commit(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -243,7 +247,7 @@ static int pager_stmt_commit(
**
** Return pager statistics.
*/
-static int pager_stats(
+static int SQLITE_TCLAPI pager_stats(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -276,7 +280,7 @@ static int pager_stats(
**
** Return the size of the database file.
*/
-static int pager_pagecount(
+static int SQLITE_TCLAPI pager_pagecount(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -302,7 +306,7 @@ static int pager_pagecount(
**
** Return a pointer to a page from the database.
*/
-static int page_get(
+static int SQLITE_TCLAPI page_get(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -339,7 +343,7 @@ static int page_get(
** Return a pointer to a page if the page is already in cache.
** If not in cache, return an empty string.
*/
-static int page_lookup(
+static int SQLITE_TCLAPI page_lookup(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -367,7 +371,7 @@ static int page_lookup(
/*
** Usage: pager_truncate ID PGNO
*/
-static int pager_truncate(
+static int SQLITE_TCLAPI pager_truncate(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -392,7 +396,7 @@ static int pager_truncate(
**
** Drop a pointer to a page.
*/
-static int page_unref(
+static int SQLITE_TCLAPI page_unref(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -414,7 +418,7 @@ static int page_unref(
**
** Return the content of a page
*/
-static int page_read(
+static int SQLITE_TCLAPI page_read(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -438,7 +442,7 @@ static int page_read(
**
** Return the page number for a page.
*/
-static int page_number(
+static int SQLITE_TCLAPI page_number(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -462,7 +466,7 @@ static int page_number(
**
** Write something into a page.
*/
-static int page_write(
+static int SQLITE_TCLAPI page_write(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -498,7 +502,7 @@ static int page_write(
** new pages after N. If N is 2096 or bigger, this will test the
** ability of SQLite to write to large files.
*/
-static int fake_big_file(
+static int SQLITE_TCLAPI fake_big_file(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -551,7 +555,7 @@ static int fake_big_file(
**
** Set the PENDING_BYTE using the sqlite3_test_control() interface.
*/
-static int testPendingByte(
+static int SQLITE_TCLAPI testPendingByte(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -616,7 +620,7 @@ static int faultSimCallback(int x){
** appended, whenever sqlite3FaultSim() is called. Or, if SCRIPT is the
** empty string, cancel the sqlite3FaultSim() callback.
*/
-static int faultInstallCmd(
+static int SQLITE_TCLAPI faultInstallCmd(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -659,7 +663,7 @@ static int faultInstallCmd(
** Invoke the SQLITE_TESTCTRL_BITVEC_TEST operator on test_control.
** See comments on sqlite3BitvecBuiltinTest() for additional information.
*/
-static int testBitvecBuiltinTest(
+static int SQLITE_TCLAPI testBitvecBuiltinTest(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
diff --git a/src/test3.c b/src/test3.c
index bfd7c30b6..6995684c2 100644
--- a/src/test3.c
+++ b/src/test3.c
@@ -15,7 +15,11 @@
*/
#include "sqliteInt.h"
#include "btreeInt.h"
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#include <stdlib.h>
#include <string.h>
@@ -33,7 +37,7 @@ static int nRefSqlite3 = 0;
**
** Open a new database
*/
-static int btree_open(
+static int SQLITE_TCLAPI btree_open(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -79,7 +83,7 @@ static int btree_open(
**
** Close the given database.
*/
-static int btree_close(
+static int SQLITE_TCLAPI btree_close(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -114,7 +118,7 @@ static int btree_close(
**
** Start a new transaction
*/
-static int btree_begin_transaction(
+static int SQLITE_TCLAPI btree_begin_transaction(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -143,7 +147,7 @@ static int btree_begin_transaction(
**
** Returns pager statistics
*/
-static int btree_pager_stats(
+static int SQLITE_TCLAPI btree_pager_stats(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -193,7 +197,7 @@ static int btree_pager_stats(
**
** Create a new cursor. Return the ID for the cursor.
*/
-static int btree_cursor(
+static int SQLITE_TCLAPI btree_cursor(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -242,7 +246,7 @@ static int btree_cursor(
**
** Close a cursor opened using btree_cursor.
*/
-static int btree_close_cursor(
+static int SQLITE_TCLAPI btree_close_cursor(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -279,7 +283,7 @@ static int btree_close_cursor(
** or 1 if the cursor was already on the last entry in the table or if
** the table is empty.
*/
-static int btree_next(
+static int SQLITE_TCLAPI btree_next(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -314,7 +318,7 @@ static int btree_next(
** Move the cursor to the first entry in the table. Return 0 if the
** cursor was left point to something and 1 if the table is empty.
*/
-static int btree_first(
+static int SQLITE_TCLAPI btree_first(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -349,7 +353,7 @@ static int btree_first(
** Return TRUE if the given cursor is not pointing at a valid entry.
** Return FALSE if the cursor does point to a valid entry.
*/
-static int btree_eof(
+static int SQLITE_TCLAPI btree_eof(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -378,7 +382,7 @@ static int btree_eof(
**
** Return the number of bytes of payload
*/
-static int btree_payload_size(
+static int SQLITE_TCLAPI btree_payload_size(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -416,7 +420,7 @@ static int btree_payload_size(
** This command returns nothing if it works. It returns an error message
** if something goes wrong.
*/
-static int btree_varint_test(
+static int SQLITE_TCLAPI btree_varint_test(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -500,7 +504,7 @@ static int btree_varint_test(
** sqlite3 db test.db
** set bt [btree_from_db db]
*/
-static int btree_from_db(
+static int SQLITE_TCLAPI btree_from_db(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -540,7 +544,7 @@ static int btree_from_db(
**
** Return true if the B-Tree is currently stored entirely in memory.
*/
-static int btree_ismemdb(
+static int SQLITE_TCLAPI btree_ismemdb(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -571,7 +575,7 @@ static int btree_ismemdb(
**
** Set the size of the cache used by btree $ID.
*/
-static int btree_set_cache_size(
+static int SQLITE_TCLAPI btree_set_cache_size(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -601,7 +605,7 @@ static int btree_set_cache_size(
**
** Set the size of the cache used by btree $ID.
*/
-static int btree_insert(
+static int SQLITE_TCLAPI btree_insert(
ClientData clientData,
Tcl_Interp *interp,
int objc,
diff --git a/src/test4.c b/src/test4.c
index d68903030..c5b5ec12c 100644
--- a/src/test4.c
+++ b/src/test4.c
@@ -12,7 +12,11 @@
** Code for testing the SQLite library in a multithreaded environment.
*/
#include "sqliteInt.h"
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#if SQLITE_OS_UNIX && SQLITE_THREADSAFE
#include <stdlib.h>
#include <string.h>
@@ -121,7 +125,7 @@ static int parse_thread_id(Tcl_Interp *interp, const char *zArg){
** NAME should be an upper case letter. Start the thread running with
** an open connection to the given database.
*/
-static int tcl_thread_create(
+static int SQLITE_TCLAPI tcl_thread_create(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -170,7 +174,7 @@ static void thread_wait(Thread *p){
**
** Wait on thread ID to reach its idle state.
*/
-static int tcl_thread_wait(
+static int SQLITE_TCLAPI tcl_thread_wait(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -214,7 +218,7 @@ static void stop_thread(Thread *p){
** Cause a thread to shut itself down. Wait for the shutdown to be
** completed. If ID is "*" then stop all threads.
*/
-static int tcl_thread_halt(
+static int SQLITE_TCLAPI tcl_thread_halt(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -249,7 +253,7 @@ static int tcl_thread_halt(
** Wait on the most recent thread_step to complete, then return the
** number of columns in the result set.
*/
-static int tcl_thread_argc(
+static int SQLITE_TCLAPI tcl_thread_argc(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -281,7 +285,7 @@ static int tcl_thread_argc(
** Wait on the most recent thread_step to complete, then return the
** value of the N-th columns in the result set.
*/
-static int tcl_thread_argv(
+static int SQLITE_TCLAPI tcl_thread_argv(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -317,7 +321,7 @@ static int tcl_thread_argv(
** Wait on the most recent thread_step to complete, then return the
** name of the N-th columns in the result set.
*/
-static int tcl_thread_colname(
+static int SQLITE_TCLAPI tcl_thread_colname(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -353,7 +357,7 @@ static int tcl_thread_colname(
** Wait on the most recent operation to complete, then return the
** result code from that operation.
*/
-static int tcl_thread_result(
+static int SQLITE_TCLAPI tcl_thread_result(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -385,7 +389,7 @@ static int tcl_thread_result(
** Wait on the most recent operation to complete, then return the
** error string.
*/
-static int tcl_thread_error(
+static int SQLITE_TCLAPI tcl_thread_error(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -430,7 +434,7 @@ static void do_compile(Thread *p){
**
** Compile a new virtual machine.
*/
-static int tcl_thread_compile(
+static int SQLITE_TCLAPI tcl_thread_compile(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -483,7 +487,7 @@ static void do_step(Thread *p){
**
** Advance the virtual machine by one step
*/
-static int tcl_thread_step(
+static int SQLITE_TCLAPI tcl_thread_step(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -525,7 +529,7 @@ static void do_finalize(Thread *p){
**
** Finalize the virtual machine.
*/
-static int tcl_thread_finalize(
+static int SQLITE_TCLAPI tcl_thread_finalize(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -556,7 +560,7 @@ static int tcl_thread_finalize(
**
** Interchange the sqlite* pointer between two threads.
*/
-static int tcl_thread_swap(
+static int SQLITE_TCLAPI tcl_thread_swap(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -596,7 +600,7 @@ static int tcl_thread_swap(
** remove the pointer from the thread itself. Afterwards, the thread
** can be stopped and the connection can be used by the main thread.
*/
-static int tcl_thread_db_get(
+static int SQLITE_TCLAPI tcl_thread_db_get(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -627,7 +631,7 @@ static int tcl_thread_db_get(
** Usage: thread_db_put ID DB
**
*/
-static int tcl_thread_db_put(
+static int SQLITE_TCLAPI tcl_thread_db_put(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -659,7 +663,7 @@ static int tcl_thread_db_put(
** Return the database stmt pointer for the given thread. Then
** remove the pointer from the thread itself.
*/
-static int tcl_thread_stmt_get(
+static int SQLITE_TCLAPI tcl_thread_stmt_get(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
diff --git a/src/test5.c b/src/test5.c
index 952e3325e..0d9242862 100644
--- a/src/test5.c
+++ b/src/test5.c
@@ -17,7 +17,11 @@
*/
#include "sqliteInt.h"
#include "vdbeInt.h"
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#include <stdlib.h>
#include <string.h>
@@ -26,7 +30,7 @@
** object with the encoded representation of the string, including
** the NULL terminator.
*/
-static int binarize(
+static int SQLITE_TCLAPI binarize(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -54,7 +58,7 @@ static int binarize(
** If <do-calls> is 0, then the calls to sqlite3_value_text() are not
** actually made.
*/
-static int test_value_overhead(
+static int SQLITE_TCLAPI test_value_overhead(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -118,7 +122,7 @@ static u8 name_to_enc(Tcl_Interp *interp, Tcl_Obj *pObj){
** Usage: test_translate <string/blob> <from enc> <to enc> ?<transient>?
**
*/
-static int test_translate(
+static int SQLITE_TCLAPI test_translate(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -182,7 +186,7 @@ static int test_translate(
** translation. If there is a problem an assert() will fail.
**/
void sqlite3UtfSelfTest(void);
-static int test_translate_selftest(
+static int SQLITE_TCLAPI test_translate_selftest(
void * clientData,
Tcl_Interp *interp,
int objc,
diff --git a/src/test6.c b/src/test6.c
index 24fe725f7..5304bcc31 100644
--- a/src/test6.c
+++ b/src/test6.c
@@ -16,7 +16,11 @@
*/
#if SQLITE_TEST /* This file is used for testing only */
#include "sqliteInt.h"
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#ifndef SQLITE_OMIT_DISKIO /* This file is a no-op if disk I/O is disabled */
@@ -807,7 +811,7 @@ static int processDevSymArgs(
** Simulate a crash immediately. This function does not return
** (writeListSync() calls exit(-1)).
*/
-static int crashNowCmd(
+static int SQLITE_TCLAPI crashNowCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -828,7 +832,7 @@ static int crashNowCmd(
** Parameter ENABLE must be a boolean value. If true, then the "crash"
** vfs is added to the system. If false, it is removed.
*/
-static int crashEnableCmd(
+static int SQLITE_TCLAPI crashEnableCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -903,7 +907,7 @@ static int crashEnableCmd(
** sqlite_crashparams -sect 1024 -char {atomic sequential} ./test.db 1
**
*/
-static int crashParamsObjCmd(
+static int SQLITE_TCLAPI crashParamsObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -950,7 +954,7 @@ error:
return TCL_ERROR;
}
-static int devSymObjCmd(
+static int SQLITE_TCLAPI devSymObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -973,7 +977,7 @@ static int devSymObjCmd(
/*
** tclcmd: unregister_devsim
*/
-static int dsUnregisterObjCmd(
+static int SQLITE_TCLAPI dsUnregisterObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -993,7 +997,7 @@ static int dsUnregisterObjCmd(
/*
** tclcmd: register_jt_vfs ?-default? PARENT-VFS
*/
-static int jtObjCmd(
+static int SQLITE_TCLAPI jtObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1031,7 +1035,7 @@ static int jtObjCmd(
/*
** tclcmd: unregister_jt_vfs
*/
-static int jtUnregisterObjCmd(
+static int SQLITE_TCLAPI jtUnregisterObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
diff --git a/src/test7.c b/src/test7.c
index 6ba3631b4..d57e4b826 100644
--- a/src/test7.c
+++ b/src/test7.c
@@ -13,7 +13,11 @@
** Derived from test4.c.
*/
#include "sqliteInt.h"
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
/*
** This test only works on UNIX with a SQLITE_THREADSAFE build that includes
@@ -149,7 +153,7 @@ static int parse_client_id(Tcl_Interp *interp, const char *zArg){
** NAME should be an upper case letter. Start the thread running with
** an open connection to the given database.
*/
-static int tcl_client_create(
+static int SQLITE_TCLAPI tcl_client_create(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -202,7 +206,7 @@ static void client_wait(Thread *p){
**
** Wait on thread ID to reach its idle state.
*/
-static int tcl_client_wait(
+static int SQLITE_TCLAPI tcl_client_wait(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -246,7 +250,7 @@ static void stop_thread(Thread *p){
** Cause a client thread to shut itself down. Wait for the shutdown to be
** completed. If ID is "*" then stop all client threads.
*/
-static int tcl_client_halt(
+static int SQLITE_TCLAPI tcl_client_halt(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -294,7 +298,7 @@ static int tcl_client_halt(
** Wait on the most recent client_step to complete, then return the
** number of columns in the result set.
*/
-static int tcl_client_argc(
+static int SQLITE_TCLAPI tcl_client_argc(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -326,7 +330,7 @@ static int tcl_client_argc(
** Wait on the most recent client_step to complete, then return the
** value of the N-th columns in the result set.
*/
-static int tcl_client_argv(
+static int SQLITE_TCLAPI tcl_client_argv(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -362,7 +366,7 @@ static int tcl_client_argv(
** Wait on the most recent client_step to complete, then return the
** name of the N-th columns in the result set.
*/
-static int tcl_client_colname(
+static int SQLITE_TCLAPI tcl_client_colname(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -400,7 +404,7 @@ extern const char *sqlite3ErrName(int);
** Wait on the most recent operation to complete, then return the
** result code from that operation.
*/
-static int tcl_client_result(
+static int SQLITE_TCLAPI tcl_client_result(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -432,7 +436,7 @@ static int tcl_client_result(
** Wait on the most recent operation to complete, then return the
** error string.
*/
-static int tcl_client_error(
+static int SQLITE_TCLAPI tcl_client_error(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -477,7 +481,7 @@ static void do_compile(Thread *p){
**
** Compile a new virtual machine.
*/
-static int tcl_client_compile(
+static int SQLITE_TCLAPI tcl_client_compile(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -530,7 +534,7 @@ static void do_step(Thread *p){
**
** Advance the virtual machine by one step
*/
-static int tcl_client_step(
+static int SQLITE_TCLAPI tcl_client_step(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -572,7 +576,7 @@ static void do_finalize(Thread *p){
**
** Finalize the virtual machine.
*/
-static int tcl_client_finalize(
+static int SQLITE_TCLAPI tcl_client_finalize(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -616,7 +620,7 @@ static void do_reset(Thread *p){
**
** Finalize the virtual machine.
*/
-static int tcl_client_reset(
+static int SQLITE_TCLAPI tcl_client_reset(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -647,7 +651,7 @@ static int tcl_client_reset(
**
** Interchange the sqlite* pointer between two threads.
*/
-static int tcl_client_swap(
+static int SQLITE_TCLAPI tcl_client_swap(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
diff --git a/src/test8.c b/src/test8.c
index fb781ac8f..daab504e4 100644
--- a/src/test8.c
+++ b/src/test8.c
@@ -14,7 +14,11 @@
** testing of the SQLite library.
*/
#include "sqliteInt.h"
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#include <stdlib.h>
#include <string.h>
@@ -1353,7 +1357,7 @@ static void moduleDestroy(void *p){
/*
** Register the echo virtual table module.
*/
-static int register_echo_module(
+static int SQLITE_TCLAPI register_echo_module(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -1393,7 +1397,7 @@ static int register_echo_module(
**
** sqlite3_declare_vtab DB SQL
*/
-static int declare_vtab(
+static int SQLITE_TCLAPI declare_vtab(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
diff --git a/src/test9.c b/src/test9.c
index e5993e8ff..5b139e8a5 100644
--- a/src/test9.c
+++ b/src/test9.c
@@ -15,14 +15,18 @@
** as there is not much point in binding to Tcl.
*/
#include "sqliteInt.h"
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#include <stdlib.h>
#include <string.h>
/*
** c_collation_test
*/
-static int c_collation_test(
+static int SQLITE_TCLAPI c_collation_test(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -63,7 +67,7 @@ error_out:
/*
** c_realloc_test
*/
-static int c_realloc_test(
+static int SQLITE_TCLAPI c_realloc_test(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -104,7 +108,7 @@ error_out:
/*
** c_misuse_test
*/
-static int c_misuse_test(
+static int SQLITE_TCLAPI c_misuse_test(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
diff --git a/src/test_async.c b/src/test_async.c
index b0b943185..c32c74c66 100644
--- a/src/test_async.c
+++ b/src/test_async.c
@@ -15,7 +15,14 @@
*/
#define TCL_THREADS
-#include <tcl.h>
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+# ifndef SQLITE_TCLAPI
+# define SQLITE_TCLAPI
+# endif
+#endif
#ifdef SQLITE_ENABLE_ASYNCIO
@@ -36,7 +43,7 @@ TCL_DECLARE_MUTEX(testasync_g_writerMutex);
/*
** sqlite3async_initialize PARENT-VFS ISDEFAULT
*/
-static int testAsyncInit(
+static int SQLITE_TCLAPI testAsyncInit(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -69,7 +76,7 @@ static int testAsyncInit(
/*
** sqlite3async_shutdown
*/
-static int testAsyncShutdown(
+static int SQLITE_TCLAPI testAsyncShutdown(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -93,7 +100,7 @@ static Tcl_ThreadCreateType tclWriterThread(ClientData pIsStarted){
**
** Start a new writer thread.
*/
-static int testAsyncStart(
+static int SQLITE_TCLAPI testAsyncStart(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -125,7 +132,7 @@ static int testAsyncStart(
** If the current writer thread is set to run forever then this
** command would block forever. To prevent that, an error is returned.
*/
-static int testAsyncWait(
+static int SQLITE_TCLAPI testAsyncWait(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -151,7 +158,7 @@ static int testAsyncWait(
/*
** sqlite3async_control OPTION ?VALUE?
*/
-static int testAsyncControl(
+static int SQLITE_TCLAPI testAsyncControl(
void * clientData,
Tcl_Interp *interp,
int objc,
diff --git a/src/test_autoext.c b/src/test_autoext.c
index a5236d239..94a3223e6 100644
--- a/src/test_autoext.c
+++ b/src/test_autoext.c
@@ -11,7 +11,14 @@
*************************************************************************
** Test extension for testing the sqlite3_auto_extension() function.
*/
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+# ifndef SQLITE_TCLAPI
+# define SQLITE_TCLAPI
+# endif
+#endif
#include "sqlite3ext.h"
#ifndef SQLITE_OMIT_LOAD_EXTENSION
@@ -87,7 +94,7 @@ static int broken_init(
**
** Register the "sqr" extension to be loaded automatically.
*/
-static int autoExtSqrObjCmd(
+static int SQLITE_TCLAPI autoExtSqrObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -103,7 +110,7 @@ static int autoExtSqrObjCmd(
**
** Unregister the "sqr" extension.
*/
-static int cancelAutoExtSqrObjCmd(
+static int SQLITE_TCLAPI cancelAutoExtSqrObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -119,7 +126,7 @@ static int cancelAutoExtSqrObjCmd(
**
** Register the "cube" extension to be loaded automatically.
*/
-static int autoExtCubeObjCmd(
+static int SQLITE_TCLAPI autoExtCubeObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -135,7 +142,7 @@ static int autoExtCubeObjCmd(
**
** Unregister the "cube" extension.
*/
-static int cancelAutoExtCubeObjCmd(
+static int SQLITE_TCLAPI cancelAutoExtCubeObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -151,7 +158,7 @@ static int cancelAutoExtCubeObjCmd(
**
** Register the broken extension to be loaded automatically.
*/
-static int autoExtBrokenObjCmd(
+static int SQLITE_TCLAPI autoExtBrokenObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -167,7 +174,7 @@ static int autoExtBrokenObjCmd(
**
** Unregister the broken extension.
*/
-static int cancelAutoExtBrokenObjCmd(
+static int SQLITE_TCLAPI cancelAutoExtBrokenObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -186,7 +193,7 @@ static int cancelAutoExtBrokenObjCmd(
**
** Reset all auto-extensions
*/
-static int resetAutoExtObjCmd(
+static int SQLITE_TCLAPI resetAutoExtObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
diff --git a/src/test_backup.c b/src/test_backup.c
index 6b4d6b9b1..9b684a28f 100644
--- a/src/test_backup.c
+++ b/src/test_backup.c
@@ -13,7 +13,14 @@
**
*/
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+# ifndef SQLITE_TCLAPI
+# define SQLITE_TCLAPI
+# endif
+#endif
#include "sqlite3.h"
#include <assert.h>
@@ -23,7 +30,7 @@ extern const char *sqlite3ErrName(int);
/* These functions are implemented in test1.c. */
extern int getDbPointer(Tcl_Interp *, const char *, sqlite3 **);
-static int backupTestCmd(
+static int SQLITE_TCLAPI backupTestCmd(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -98,7 +105,7 @@ static int backupTestCmd(
return TCL_OK;
}
-static void backupTestFinish(ClientData clientData){
+static void SQLITE_TCLAPI backupTestFinish(ClientData clientData){
sqlite3_backup *pBackup = (sqlite3_backup *)clientData;
sqlite3_backup_finish(pBackup);
}
@@ -107,7 +114,7 @@ static void backupTestFinish(ClientData clientData){
** sqlite3_backup CMDNAME DESTHANDLE DESTNAME SRCHANDLE SRCNAME
**
*/
-static int backupTestInit(
+static int SQLITE_TCLAPI backupTestInit(
ClientData clientData,
Tcl_Interp *interp,
int objc,
diff --git a/src/test_bestindex.c b/src/test_bestindex.c
index f6f9d3eaf..94017f034 100644
--- a/src/test_bestindex.c
+++ b/src/test_bestindex.c
@@ -93,7 +93,11 @@
#include "sqliteInt.h"
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#ifndef SQLITE_OMIT_VIRTUALTABLE
@@ -563,7 +567,7 @@ extern int getDbPointer(Tcl_Interp *interp, const char *zA, sqlite3 **ppDb);
/*
** Register the echo virtual table module.
*/
-static int register_tcl_module(
+static int SQLITE_TCLAPI register_tcl_module(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
diff --git a/src/test_blob.c b/src/test_blob.c
index ec2227bb3..3ac6c1142 100644
--- a/src/test_blob.c
+++ b/src/test_blob.c
@@ -12,7 +12,11 @@
**
*/
#include "sqliteInt.h"
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#include <stdlib.h>
#include <string.h>
#include <assert.h>
@@ -95,7 +99,7 @@ static char *blobStringFromObj(Tcl_Obj *pObj){
**
** Tcl test harness for the sqlite3_blob_open() function.
*/
-static int test_blob_open(
+static int SQLITE_TCLAPI test_blob_open(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* Calling TCL interpreter */
int objc, /* Number of arguments */
@@ -146,7 +150,7 @@ static int test_blob_open(
/*
** sqlite3_blob_close HANDLE
*/
-static int test_blob_close(
+static int SQLITE_TCLAPI test_blob_close(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -174,7 +178,7 @@ static int test_blob_close(
/*
** sqlite3_blob_bytes HANDLE
*/
-static int test_blob_bytes(
+static int SQLITE_TCLAPI test_blob_bytes(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -210,7 +214,7 @@ static int test_blob_bytes(
** text representation of the returned error code (i.e. "SQLITE_NOMEM")
** and a Tcl exception is thrown.
*/
-static int test_blob_read(
+static int SQLITE_TCLAPI test_blob_read(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -262,7 +266,7 @@ static int test_blob_read(
** result is set to the text representation of the returned error code
** (i.e. "SQLITE_NOMEM") and a Tcl exception is thrown.
*/
-static int test_blob_write(
+static int SQLITE_TCLAPI test_blob_write(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
diff --git a/src/test_btree.c b/src/test_btree.c
index dfe77051b..03b8b207c 100644
--- a/src/test_btree.c
+++ b/src/test_btree.c
@@ -14,7 +14,11 @@
** testing of the SQLite library.
*/
#include "btreeInt.h"
-#include <tcl.h>
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
/*
** Usage: sqlite3_shared_cache_report
@@ -22,7 +26,7 @@
** Return a list of file that are shared and the number of
** references to each file.
*/
-int sqlite3BtreeSharedCacheReport(
+int SQLITE_TCLAPI sqlite3BtreeSharedCacheReport(
void * clientData,
Tcl_Interp *interp,
int objc,
diff --git a/src/test_config.c b/src/test_config.c
index 9ce9bfcac..1e68e58d8 100644
--- a/src/test_config.c
+++ b/src/test_config.c
@@ -24,7 +24,11 @@
# include "os_win.h"
#endif
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#include <stdlib.h>
#include <string.h>
diff --git a/src/test_demovfs.c b/src/test_demovfs.c
index 9410a309a..ba7af863c 100644
--- a/src/test_demovfs.c
+++ b/src/test_demovfs.c
@@ -641,10 +641,17 @@ sqlite3_vfs *sqlite3_demovfs(void){
#ifdef SQLITE_TEST
-#include <tcl.h>
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+# ifndef SQLITE_TCLAPI
+# define SQLITE_TCLAPI
+# endif
+#endif
#if SQLITE_OS_UNIX
-static int register_demovfs(
+static int SQLITE_TCLAPI register_demovfs(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -653,7 +660,7 @@ static int register_demovfs(
sqlite3_vfs_register(sqlite3_demovfs(), 1);
return TCL_OK;
}
-static int unregister_demovfs(
+static int SQLITE_TCLAPI unregister_demovfs(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
diff --git a/src/test_fs.c b/src/test_fs.c
index 32026d0f3..87088bdae 100644
--- a/src/test_fs.c
+++ b/src/test_fs.c
@@ -62,7 +62,11 @@
** SELECT * FROM fstree WHERE path LIKE '/home/dan/sqlite/%'
*/
#include "sqliteInt.h"
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#include <stdlib.h>
#include <string.h>
@@ -871,7 +875,7 @@ extern int getDbPointer(Tcl_Interp *interp, const char *zA, sqlite3 **ppDb);
/*
** Register the echo virtual table module.
*/
-static int register_fs_module(
+static int SQLITE_TCLAPI register_fs_module(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
diff --git a/src/test_func.c b/src/test_func.c
index 579177b70..6a714ef3e 100644
--- a/src/test_func.c
+++ b/src/test_func.c
@@ -13,7 +13,11 @@
** implements new SQL functions used by the test scripts.
*/
#include "sqlite3.h"
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#include <stdlib.h>
#include <string.h>
#include <assert.h>
@@ -689,7 +693,7 @@ static int registerTestFunctions(sqlite3 *db){
** the standard set of test functions to be loaded into each new
** database connection.
*/
-static int autoinstall_test_funcs(
+static int SQLITE_TCLAPI autoinstall_test_funcs(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -717,7 +721,7 @@ static void tFinal(sqlite3_context *a){}
** Make various calls to sqlite3_create_function that do not have valid
** parameters. Verify that the error condition is detected and reported.
*/
-static int abuse_create_function(
+static int SQLITE_TCLAPI abuse_create_function(
void * clientData,
Tcl_Interp *interp,
int objc,
diff --git a/src/test_hexio.c b/src/test_hexio.c
index b20b5ce73..7b62ea08b 100644
--- a/src/test_hexio.c
+++ b/src/test_hexio.c
@@ -18,7 +18,11 @@
** easier and safer to build our own mechanism.
*/
#include "sqliteInt.h"
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#include <stdlib.h>
#include <string.h>
#include <assert.h>
@@ -94,7 +98,7 @@ int sqlite3TestHexToBin(const unsigned char *zIn, int N, unsigned char *aOut){
** beginning of the file. Convert that information to hexadecimal
** and return the resulting HEX string.
*/
-static int hexio_read(
+static int SQLITE_TCLAPI hexio_read(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -144,7 +148,7 @@ static int hexio_read(
** Write DATA into file FILENAME beginning at OFFSET from the
** beginning of the file. DATA is expressed in hexadecimal.
*/
-static int hexio_write(
+static int SQLITE_TCLAPI hexio_write(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -192,7 +196,7 @@ static int hexio_write(
** the value of that integer. HEXDATA can contain between 2 and 8
** hexadecimal digits.
*/
-static int hexio_get_int(
+static int SQLITE_TCLAPI hexio_get_int(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -232,7 +236,7 @@ static int hexio_get_int(
**
** Render INTEGER has a 16-bit big-endian integer in hexadecimal.
*/
-static int hexio_render_int16(
+static int SQLITE_TCLAPI hexio_render_int16(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -259,7 +263,7 @@ static int hexio_render_int16(
**
** Render INTEGER has a 32-bit big-endian integer in hexadecimal.
*/
-static int hexio_render_int32(
+static int SQLITE_TCLAPI hexio_render_int32(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -289,7 +293,7 @@ static int hexio_render_int32(
** The UTF8 might not be well-formed. Run this string through
** sqlite3Utf8to8() convert it back to hex and return the result.
*/
-static int utf8_to_utf8(
+static int SQLITE_TCLAPI utf8_to_utf8(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -340,7 +344,7 @@ static int getFts3Varint(const char *p, sqlite_int64 *v){
** Read a varint from the start of BLOB. Set variable VARNAME to contain
** the interpreted value. Return the number of bytes of BLOB consumed.
*/
-static int read_fts3varint(
+static int SQLITE_TCLAPI read_fts3varint(
void * clientData,
Tcl_Interp *interp,
int objc,
diff --git a/src/test_init.c b/src/test_init.c
index 502d95c05..58465785d 100644
--- a/src/test_init.c
+++ b/src/test_init.c
@@ -27,7 +27,11 @@
#include "sqliteInt.h"
#include <string.h>
-#include <tcl.h>
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
static struct Wrapped {
sqlite3_pcache_methods2 pcache;
@@ -184,7 +188,7 @@ static void installInitWrappers(void){
sqlite3_config(SQLITE_CONFIG_PCACHE2, &pcachemethods);
}
-static int init_wrapper_install(
+static int SQLITE_TCLAPI init_wrapper_install(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -208,7 +212,7 @@ static int init_wrapper_install(
return TCL_OK;
}
-static int init_wrapper_uninstall(
+static int SQLITE_TCLAPI init_wrapper_uninstall(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -226,7 +230,7 @@ static int init_wrapper_uninstall(
return TCL_OK;
}
-static int init_wrapper_clear(
+static int SQLITE_TCLAPI init_wrapper_clear(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -243,7 +247,7 @@ static int init_wrapper_clear(
return TCL_OK;
}
-static int init_wrapper_query(
+static int SQLITE_TCLAPI init_wrapper_query(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
diff --git a/src/test_intarray.c b/src/test_intarray.c
index 70e34db3e..ddfb13fe2 100644
--- a/src/test_intarray.c
+++ b/src/test_intarray.c
@@ -270,7 +270,14 @@ SQLITE_API int sqlite3_intarray_bind(
** Everything below is interface for testing this module.
*/
#ifdef SQLITE_TEST
-#include <tcl.h>
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+# ifndef SQLITE_TCLAPI
+# define SQLITE_TCLAPI
+# endif
+#endif
/*
** Routines to encode and decode pointers
@@ -286,7 +293,7 @@ extern const char *sqlite3ErrName(int);
** Invoke the sqlite3_intarray_create interface. A string that becomes
** the first parameter to sqlite3_intarray_bind.
*/
-static int test_intarray_create(
+static int SQLITE_TCLAPI test_intarray_create(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -322,7 +329,7 @@ static int test_intarray_create(
**
** Invoke the sqlite3_intarray_bind interface on the given array of integers.
*/
-static int test_intarray_bind(
+static int SQLITE_TCLAPI test_intarray_bind(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
diff --git a/src/test_malloc.c b/src/test_malloc.c
index 37612561e..e8c248f95 100644
--- a/src/test_malloc.c
+++ b/src/test_malloc.c
@@ -14,7 +14,11 @@
** memory allocation subsystem.
*/
#include "sqliteInt.h"
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#include <stdlib.h>
#include <string.h>
#include <assert.h>
@@ -306,7 +310,7 @@ static int textToPointer(const char *z, void **pp){
**
** Raw test interface for sqlite3_malloc().
*/
-static int test_malloc(
+static int SQLITE_TCLAPI test_malloc(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -331,7 +335,7 @@ static int test_malloc(
**
** Raw test interface for sqlite3_realloc().
*/
-static int test_realloc(
+static int SQLITE_TCLAPI test_realloc(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -360,7 +364,7 @@ static int test_realloc(
**
** Raw test interface for sqlite3_free().
*/
-static int test_free(
+static int SQLITE_TCLAPI test_free(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -391,7 +395,7 @@ int sqlite3TestBinToHex(char*,int);
** Set a chunk of memory (obtained from malloc, probably) to a
** specified hex pattern.
*/
-static int test_memset(
+static int SQLITE_TCLAPI test_memset(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -437,7 +441,7 @@ static int test_memset(
**
** Return memory as hexadecimal text.
*/
-static int test_memget(
+static int SQLITE_TCLAPI test_memget(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -484,7 +488,7 @@ static int test_memget(
**
** Raw test interface for sqlite3_memory_used().
*/
-static int test_memory_used(
+static int SQLITE_TCLAPI test_memory_used(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -499,7 +503,7 @@ static int test_memory_used(
**
** Raw test interface for sqlite3_memory_highwater().
*/
-static int test_memory_highwater(
+static int SQLITE_TCLAPI test_memory_highwater(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -524,7 +528,7 @@ static int test_memory_highwater(
** Set the depth of backtracing. If SQLITE_MEMDEBUG is not defined
** then this routine is a no-op.
*/
-static int test_memdebug_backtrace(
+static int SQLITE_TCLAPI test_memdebug_backtrace(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -550,7 +554,7 @@ static int test_memdebug_backtrace(
**
** Write a summary of unfreed memory to FILENAME.
*/
-static int test_memdebug_dump(
+static int SQLITE_TCLAPI test_memdebug_dump(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -575,7 +579,7 @@ static int test_memdebug_dump(
**
** Return the total number of times malloc() has been called.
*/
-static int test_memdebug_malloc_count(
+static int SQLITE_TCLAPI test_memdebug_malloc_count(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -615,7 +619,7 @@ static int test_memdebug_malloc_count(
**
** To disable simulated failures, use a COUNTER of -1.
*/
-static int test_memdebug_fail(
+static int SQLITE_TCLAPI test_memdebug_fail(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -681,7 +685,7 @@ static int test_memdebug_fail(
** simulated failure occurs. A negative return value indicates that
** no malloc() failure is scheduled.
*/
-static int test_memdebug_pending(
+static int SQLITE_TCLAPI test_memdebug_pending(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -714,7 +718,7 @@ static int sqlite3_memdebug_title_count = 0;
**
** Each title overwrite the previous.
*/
-static int test_memdebug_settitle(
+static int SQLITE_TCLAPI test_memdebug_settitle(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -795,7 +799,7 @@ static void test_memdebug_log_clear(void){
Tcl_InitHashTable(&aMallocLog, MALLOC_LOG_KEYINTS);
}
-static int test_memdebug_log(
+static int SQLITE_TCLAPI test_memdebug_log(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -893,7 +897,7 @@ static int test_memdebug_log(
**
** A negative SIZE causes the buffer pointer to be NULL.
*/
-static int test_config_scratch(
+static int SQLITE_TCLAPI test_config_scratch(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -933,7 +937,7 @@ static int test_config_scratch(
**
** A negative SIZE causes the buffer pointer to be NULL.
*/
-static int test_config_pagecache(
+static int SQLITE_TCLAPI test_config_pagecache(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -976,7 +980,7 @@ static int test_config_pagecache(
** is certainty. 0 is never. PRNG_SEED is the pseudo-random number generator
** seed.
*/
-static int test_alt_pcache(
+static int SQLITE_TCLAPI test_alt_pcache(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1017,7 +1021,7 @@ static int test_alt_pcache(
**
** Enable or disable memory status reporting using SQLITE_CONFIG_MEMSTATUS.
*/
-static int test_config_memstatus(
+static int SQLITE_TCLAPI test_config_memstatus(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1038,7 +1042,7 @@ static int test_config_memstatus(
** Usage: sqlite3_config_lookaside SIZE COUNT
**
*/
-static int test_config_lookaside(
+static int SQLITE_TCLAPI test_config_lookaside(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1072,7 +1076,7 @@ static int test_config_lookaside(
** is 10KB in size. A BUFID of 0 indicates that the buffer should be NULL
** which will cause sqlite3_db_config() to allocate space on its own.
*/
-static int test_db_config_lookaside(
+static int SQLITE_TCLAPI test_db_config_lookaside(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1107,7 +1111,7 @@ static int test_db_config_lookaside(
/*
** Usage: sqlite3_config_heap NBYTE NMINALLOC
*/
-static int test_config_heap(
+static int SQLITE_TCLAPI test_config_heap(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1144,7 +1148,7 @@ static int test_config_heap(
/*
** Usage: sqlite3_config_heap_size NBYTE
*/
-static int test_config_heap_size(
+static int SQLITE_TCLAPI test_config_heap_size(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1174,7 +1178,7 @@ static int test_config_heap_size(
** Invoke sqlite3_config() or sqlite3_db_config() with invalid
** opcodes and verify that they return errors.
*/
-static int test_config_error(
+static int SQLITE_TCLAPI test_config_error(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1212,7 +1216,7 @@ static int test_config_error(
** Enables or disables interpretation of URI parameters by default using
** SQLITE_CONFIG_URI.
*/
-static int test_config_uri(
+static int SQLITE_TCLAPI test_config_uri(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1241,7 +1245,7 @@ static int test_config_uri(
** Enables or disables the use of the covering-index scan optimization.
** SQLITE_CONFIG_COVERING_INDEX_SCAN.
*/
-static int test_config_cis(
+static int SQLITE_TCLAPI test_config_cis(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1269,7 +1273,7 @@ static int test_config_cis(
**
** Set the minimum PMA size.
*/
-static int test_config_pmasz(
+static int SQLITE_TCLAPI test_config_pmasz(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1299,7 +1303,7 @@ static int test_config_pmasz(
**
** Write a summary of unfreed memsys3 allocations to FILENAME.
*/
-static int test_dump_memsys3(
+static int SQLITE_TCLAPI test_dump_memsys3(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1335,7 +1339,7 @@ static int test_dump_memsys3(
** Return a list of three elements which are the sqlite3_status() return
** code, the current value, and the high-water mark value.
*/
-static int test_status(
+static int SQLITE_TCLAPI test_status(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1392,7 +1396,7 @@ static int test_status(
** Return a list of three elements which are the sqlite3_db_status() return
** code, the current value, and the high-water mark value.
*/
-static int test_db_status(
+static int SQLITE_TCLAPI test_db_status(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1453,7 +1457,7 @@ static int test_db_status(
/*
** install_malloc_faultsim BOOLEAN
*/
-static int test_install_malloc_faultsim(
+static int SQLITE_TCLAPI test_install_malloc_faultsim(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1477,7 +1481,7 @@ static int test_install_malloc_faultsim(
/*
** sqlite3_install_memsys3
*/
-static int test_install_memsys3(
+static int SQLITE_TCLAPI test_install_memsys3(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1492,7 +1496,7 @@ static int test_install_memsys3(
return TCL_OK;
}
-static int test_vfs_oom_test(
+static int SQLITE_TCLAPI test_vfs_oom_test(
void * clientData,
Tcl_Interp *interp,
int objc,
diff --git a/src/test_multiplex.c b/src/test_multiplex.c
index ba4e61b09..e7ffa63a5 100644
--- a/src/test_multiplex.c
+++ b/src/test_multiplex.c
@@ -1229,14 +1229,21 @@ int sqlite3_multiplex_shutdown(int eForce){
/***************************** Test Code ***********************************/
#ifdef SQLITE_TEST
-#include <tcl.h>
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+# ifndef SQLITE_TCLAPI
+# define SQLITE_TCLAPI
+# endif
+#endif
extern const char *sqlite3ErrName(int);
/*
** tclcmd: sqlite3_multiplex_initialize NAME MAKEDEFAULT
*/
-static int test_multiplex_initialize(
+static int SQLITE_TCLAPI test_multiplex_initialize(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1267,7 +1274,7 @@ static int test_multiplex_initialize(
/*
** tclcmd: sqlite3_multiplex_shutdown
*/
-static int test_multiplex_shutdown(
+static int SQLITE_TCLAPI test_multiplex_shutdown(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1295,7 +1302,7 @@ static int test_multiplex_shutdown(
/*
** tclcmd: sqlite3_multiplex_dump
*/
-static int test_multiplex_dump(
+static int SQLITE_TCLAPI test_multiplex_dump(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1350,7 +1357,7 @@ static int test_multiplex_dump(
/*
** Tclcmd: test_multiplex_control HANDLE DBNAME SUB-COMMAND ?INT-VALUE?
*/
-static int test_multiplex_control(
+static int SQLITE_TCLAPI test_multiplex_control(
ClientData cd,
Tcl_Interp *interp,
int objc,
diff --git a/src/test_mutex.c b/src/test_mutex.c
index 995b89a4c..8f43e5ad3 100644
--- a/src/test_mutex.c
+++ b/src/test_mutex.c
@@ -12,7 +12,11 @@
** This file contains test logic for the sqlite3_mutex interfaces.
*/
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#include "sqlite3.h"
#include "sqliteInt.h"
#include <stdlib.h>
@@ -152,7 +156,7 @@ static void counterMutexLeave(sqlite3_mutex *p){
/*
** sqlite3_shutdown
*/
-static int test_shutdown(
+static int SQLITE_TCLAPI test_shutdown(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -173,7 +177,7 @@ static int test_shutdown(
/*
** sqlite3_initialize
*/
-static int test_initialize(
+static int SQLITE_TCLAPI test_initialize(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -194,7 +198,7 @@ static int test_initialize(
/*
** install_mutex_counters BOOLEAN
*/
-static int test_install_mutex_counters(
+static int SQLITE_TCLAPI test_install_mutex_counters(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -255,7 +259,7 @@ static int test_install_mutex_counters(
/*
** read_mutex_counters
*/
-static int test_read_mutex_counters(
+static int SQLITE_TCLAPI test_read_mutex_counters(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -284,7 +288,7 @@ static int test_read_mutex_counters(
/*
** clear_mutex_counters
*/
-static int test_clear_mutex_counters(
+static int SQLITE_TCLAPI test_clear_mutex_counters(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -308,7 +312,7 @@ static int test_clear_mutex_counters(
** will be invalid since the mutex has already been freed. The
** return pointer just checks to see if the mutex really was allocated.
*/
-static int test_alloc_mutex(
+static int SQLITE_TCLAPI test_alloc_mutex(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -335,7 +339,7 @@ static int test_alloc_mutex(
**
** Or OPTION can be an raw integer.
*/
-static int test_config(
+static int SQLITE_TCLAPI test_config(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -397,7 +401,7 @@ static sqlite3_mutex *getStaticMutexPointer(
return counterMutexAlloc(iMutex);
}
-static int test_enter_static_mutex(
+static int SQLITE_TCLAPI test_enter_static_mutex(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -416,7 +420,7 @@ static int test_enter_static_mutex(
return TCL_OK;
}
-static int test_leave_static_mutex(
+static int SQLITE_TCLAPI test_leave_static_mutex(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -435,7 +439,7 @@ static int test_leave_static_mutex(
return TCL_OK;
}
-static int test_enter_db_mutex(
+static int SQLITE_TCLAPI test_enter_db_mutex(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -454,7 +458,7 @@ static int test_enter_db_mutex(
return TCL_OK;
}
-static int test_leave_db_mutex(
+static int SQLITE_TCLAPI test_leave_db_mutex(
void * clientData,
Tcl_Interp *interp,
int objc,
diff --git a/src/test_osinst.c b/src/test_osinst.c
index e51ce77ef..a008baba4 100644
--- a/src/test_osinst.c
+++ b/src/test_osinst.c
@@ -1104,9 +1104,16 @@ int sqlite3_vfslog_register(sqlite3 *db){
#if defined(SQLITE_TEST) || defined(TCLSH)
-#include <tcl.h>
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+# ifndef SQLITE_TCLAPI
+# define SQLITE_TCLAPI
+# endif
+#endif
-static int test_vfslog(
+static int SQLITE_TCLAPI test_vfslog(
void *clientData,
Tcl_Interp *interp,
int objc,
diff --git a/src/test_quota.c b/src/test_quota.c
index e8e0b3407..e87e9772f 100644
--- a/src/test_quota.c
+++ b/src/test_quota.c
@@ -111,7 +111,7 @@ struct quotaFile {
/*
** An instance of the following object represents each open connection
-** to a file that participates in quota tracking. This object is a
+** to a file that participates in quota tracking. This object is a
** subclass of sqlite3_file. The sqlite3_file object for the underlying
** VFS is appended to this structure.
*/
@@ -154,11 +154,11 @@ static struct {
*/
sqlite3_vfs sThisVfs;
- /* The sIoMethods defines the methods used by sqlite3_file objects
+ /* The sIoMethods defines the methods used by sqlite3_file objects
** associated with this shim. It is initialized at start-time and does
** not require a mutex.
**
- ** When the underlying VFS is called to open a file, it might return
+ ** When the underlying VFS is called to open a file, it might return
** either a version 1 or a version 2 sqlite3_file object. This shim
** has to create a wrapper sqlite3_file of the same version. Hence
** there are two I/O method structures, one for version 1 and the other
@@ -190,7 +190,7 @@ static struct {
static void quotaEnter(void){ sqlite3_mutex_enter(gQuota.pMutex); }
static void quotaLeave(void){ sqlite3_mutex_leave(gQuota.pMutex); }
-/* Count the number of open files in a quotaGroup
+/* Count the number of open files in a quotaGroup
*/
static int quotaGroupOpenFileCount(quotaGroup *pGroup){
int N = 0;
@@ -399,7 +399,7 @@ static char *quota_utf8_to_mbcs(const char *zUtf8){
return zMbcs;
#else
return (char*)zUtf8; /* No-op on unix */
-#endif
+#endif
}
/*
@@ -410,7 +410,7 @@ static void quota_mbcs_free(char *zOld){
sqlite3_free(zOld);
#else
/* No-op on unix */
-#endif
+#endif
}
/************************* VFS Method Wrappers *****************************/
@@ -428,7 +428,7 @@ static int quotaOpen(
int flags, /* Flags to control the opening */
int *pOutFlags /* Flags showing results of opening */
){
- int rc; /* Result code */
+ int rc; /* Result code */
quotaConn *pQuotaOpen; /* The new quota file descriptor */
quotaFile *pFile; /* Corresponding quotaFile obj */
quotaGroup *pGroup; /* The group file belongs to */
@@ -488,7 +488,7 @@ static int quotaDelete(
const char *zName, /* Name of file to be deleted */
int syncDir /* Do a directory sync after deleting */
){
- int rc; /* Result code */
+ int rc; /* Result code */
quotaFile *pFile; /* Files in the quota */
quotaGroup *pGroup; /* The group file belongs to */
sqlite3_vfs *pOrigVfs = gQuota.pOrigVfs; /* Real VFS */
@@ -581,7 +581,7 @@ static int quotaWrite(
szNew = pGroup->iSize - pFile->iSize + iEnd;
if( szNew>pGroup->iLimit && pGroup->iLimit>0 ){
if( pGroup->xCallback ){
- pGroup->xCallback(pFile->zFilename, &pGroup->iLimit, szNew,
+ pGroup->xCallback(pFile->zFilename, &pGroup->iLimit, szNew,
pGroup->pArg);
}
if( szNew>pGroup->iLimit && pGroup->iLimit>0 ){
@@ -738,7 +738,7 @@ static int quotaShmUnmap(sqlite3_file *pConn, int deleteFlag){
/*
** Initialize the quota VFS shim. Use the VFS named zOrigVfsName
** as the VFS that does the actual work. Use the default if
-** zOrigVfsName==NULL.
+** zOrigVfsName==NULL.
**
** The quota VFS shim is named "quota". It will become the default
** VFS if makeDefault is non-zero.
@@ -908,7 +908,7 @@ int sqlite3_quota_file(const char *zFilename){
if( rc==SQLITE_OK ){
zFull[strlen(zFull)+1] = '\0';
- rc = quotaOpen(&gQuota.sThisVfs, zFull, fd,
+ rc = quotaOpen(&gQuota.sThisVfs, zFull, fd,
SQLITE_OPEN_READONLY | SQLITE_OPEN_MAIN_DB, &outFlags);
if( rc==SQLITE_OK ){
fd->pMethods->xFileSize(fd, &iSize);
@@ -1016,7 +1016,7 @@ size_t sqlite3_quota_fwrite(
szNew = pGroup->iSize - pFile->iSize + iEnd;
if( szNew>pGroup->iLimit && pGroup->iLimit>0 ){
if( pGroup->xCallback ){
- pGroup->xCallback(pFile->zFilename, &pGroup->iLimit, szNew,
+ pGroup->xCallback(pFile->zFilename, &pGroup->iLimit, szNew,
pGroup->pArg);
}
if( szNew>pGroup->iLimit && pGroup->iLimit>0 ){
@@ -1203,7 +1203,7 @@ sqlite3_int64 sqlite3_quota_file_truesize(quota_FILE *p){
sqlite3_int64 sqlite3_quota_file_size(quota_FILE *p){
return p->pFile ? p->pFile->iSize : -1;
}
-
+
/*
** Determine the amount of data in bytes available for reading
** in the given file.
@@ -1275,10 +1275,17 @@ int sqlite3_quota_remove(const char *zFilename){
sqlite3_free(zFull);
return rc;
}
-
+
/***************************** Test Code ***********************************/
#ifdef SQLITE_TEST
-#include <tcl.h>
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+# ifndef SQLITE_TCLAPI
+# define SQLITE_TCLAPI
+# endif
+#endif
/*
** Argument passed to a TCL quota-over-limit callback.
@@ -1350,7 +1357,7 @@ static void tclCallbackDestructor(void *pObj){
/*
** tclcmd: sqlite3_quota_initialize NAME MAKEDEFAULT
*/
-static int test_quota_initialize(
+static int SQLITE_TCLAPI test_quota_initialize(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1379,7 +1386,7 @@ static int test_quota_initialize(
/*
** tclcmd: sqlite3_quota_shutdown
*/
-static int test_quota_shutdown(
+static int SQLITE_TCLAPI test_quota_shutdown(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1402,7 +1409,7 @@ static int test_quota_shutdown(
/*
** tclcmd: sqlite3_quota_set PATTERN LIMIT SCRIPT
*/
-static int test_quota_set(
+static int SQLITE_TCLAPI test_quota_set(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1456,7 +1463,7 @@ static int test_quota_set(
/*
** tclcmd: sqlite3_quota_file FILENAME
*/
-static int test_quota_file(
+static int SQLITE_TCLAPI test_quota_file(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1482,7 +1489,7 @@ static int test_quota_file(
/*
** tclcmd: sqlite3_quota_dump
*/
-static int test_quota_dump(
+static int SQLITE_TCLAPI test_quota_dump(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1530,7 +1537,7 @@ static int test_quota_dump(
/*
** tclcmd: sqlite3_quota_fopen FILENAME MODE
*/
-static int test_quota_fopen(
+static int SQLITE_TCLAPI test_quota_fopen(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1560,7 +1567,7 @@ extern void *sqlite3TestTextToPtr(const char*);
/*
** tclcmd: sqlite3_quota_fread HANDLE SIZE NELEM
*/
-static int test_quota_fread(
+static int SQLITE_TCLAPI test_quota_fread(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1594,7 +1601,7 @@ static int test_quota_fread(
/*
** tclcmd: sqlite3_quota_fwrite HANDLE SIZE NELEM CONTENT
*/
-static int test_quota_fwrite(
+static int SQLITE_TCLAPI test_quota_fwrite(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1622,7 +1629,7 @@ static int test_quota_fwrite(
/*
** tclcmd: sqlite3_quota_fclose HANDLE
*/
-static int test_quota_fclose(
+static int SQLITE_TCLAPI test_quota_fclose(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1644,7 +1651,7 @@ static int test_quota_fclose(
/*
** tclcmd: sqlite3_quota_fflush HANDLE ?HARDSYNC?
*/
-static int test_quota_fflush(
+static int SQLITE_TCLAPI test_quota_fflush(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1670,7 +1677,7 @@ static int test_quota_fflush(
/*
** tclcmd: sqlite3_quota_fseek HANDLE OFFSET WHENCE
*/
-static int test_quota_fseek(
+static int SQLITE_TCLAPI test_quota_fseek(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1708,7 +1715,7 @@ static int test_quota_fseek(
/*
** tclcmd: sqlite3_quota_rewind HANDLE
*/
-static int test_quota_rewind(
+static int SQLITE_TCLAPI test_quota_rewind(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1727,7 +1734,7 @@ static int test_quota_rewind(
/*
** tclcmd: sqlite3_quota_ftell HANDLE
*/
-static int test_quota_ftell(
+static int SQLITE_TCLAPI test_quota_ftell(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1748,7 +1755,7 @@ static int test_quota_ftell(
/*
** tclcmd: sqlite3_quota_ftruncate HANDLE SIZE
*/
-static int test_quota_ftruncate(
+static int SQLITE_TCLAPI test_quota_ftruncate(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1773,7 +1780,7 @@ static int test_quota_ftruncate(
/*
** tclcmd: sqlite3_quota_file_size HANDLE
*/
-static int test_quota_file_size(
+static int SQLITE_TCLAPI test_quota_file_size(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1794,7 +1801,7 @@ static int test_quota_file_size(
/*
** tclcmd: sqlite3_quota_file_truesize HANDLE
*/
-static int test_quota_file_truesize(
+static int SQLITE_TCLAPI test_quota_file_truesize(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1815,7 +1822,7 @@ static int test_quota_file_truesize(
/*
** tclcmd: sqlite3_quota_file_mtime HANDLE
*/
-static int test_quota_file_mtime(
+static int SQLITE_TCLAPI test_quota_file_mtime(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1838,7 +1845,7 @@ static int test_quota_file_mtime(
/*
** tclcmd: sqlite3_quota_remove FILENAME
*/
-static int test_quota_remove(
+static int SQLITE_TCLAPI test_quota_remove(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1862,7 +1869,7 @@ static int test_quota_remove(
** Test the glob pattern matching. Return 1 if TEXT matches PATTERN
** and return 0 if it does not.
*/
-static int test_quota_glob(
+static int SQLITE_TCLAPI test_quota_glob(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1888,7 +1895,7 @@ static int test_quota_glob(
** Return the number of bytes from the current file point to the end of
** the file.
*/
-static int test_quota_file_available(
+static int SQLITE_TCLAPI test_quota_file_available(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1911,7 +1918,7 @@ static int test_quota_file_available(
**
** Return true if the file handle is in the error state.
*/
-static int test_quota_ferror(
+static int SQLITE_TCLAPI test_quota_ferror(
void * clientData,
Tcl_Interp *interp,
int objc,
diff --git a/src/test_rtree.c b/src/test_rtree.c
index 797ec0026..0c6dbf3cd 100644
--- a/src/test_rtree.c
+++ b/src/test_rtree.c
@@ -14,7 +14,11 @@
*/
#include "sqlite3.h"
-#include <tcl.h>
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
/* Solely for the UNUSED_PARAMETER() macro. */
#include "sqliteInt.h"
@@ -353,7 +357,11 @@ static int bfs_query_func(sqlite3_rtree_query_info *p){
*************************************************************************/
#include <assert.h>
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
typedef struct Cube Cube;
struct Cube {
@@ -432,7 +440,7 @@ static int cube_geom(
}
#endif /* SQLITE_ENABLE_RTREE */
-static int register_cube_geom(
+static int SQLITE_TCLAPI register_cube_geom(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -460,7 +468,7 @@ static int register_cube_geom(
return TCL_OK;
}
-static int register_circle_geom(
+static int SQLITE_TCLAPI register_circle_geom(
void * clientData,
Tcl_Interp *interp,
int objc,
diff --git a/src/test_schema.c b/src/test_schema.c
index 4ee18193b..cdf085797 100644
--- a/src/test_schema.c
+++ b/src/test_schema.c
@@ -35,10 +35,14 @@
** to be compiled into an sqlite dynamic extension.
*/
#ifdef SQLITE_TEST
- #include "sqliteInt.h"
- #include "tcl.h"
+# include "sqliteInt.h"
+# if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+# else
+# include "tcl.h"
+# endif
#else
- #include "sqlite3ext.h"
+# include "sqlite3ext.h"
SQLITE_EXTENSION_INIT1
#endif
@@ -302,7 +306,7 @@ extern int getDbPointer(Tcl_Interp *interp, const char *zA, sqlite3 **ppDb);
/*
** Register the schema virtual table module.
*/
-static int register_schema_module(
+static int SQLITE_TCLAPI register_schema_module(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
diff --git a/src/test_superlock.c b/src/test_superlock.c
index cac789842..45d0d623a 100644
--- a/src/test_superlock.c
+++ b/src/test_superlock.c
@@ -256,7 +256,14 @@ int sqlite3demo_superlock(
#ifdef SQLITE_TEST
-#include <tcl.h>
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+# ifndef SQLITE_TCLAPI
+# define SQLITE_TCLAPI
+# endif
+#endif
struct InterpAndScript {
Tcl_Interp *interp;
@@ -264,11 +271,11 @@ struct InterpAndScript {
};
typedef struct InterpAndScript InterpAndScript;
-static void superunlock_del(ClientData cd){
+static void SQLITE_TCLAPI superunlock_del(ClientData cd){
sqlite3demo_superunlock((void *)cd);
}
-static int superunlock_cmd(
+static int SQLITE_TCLAPI superunlock_cmd(
ClientData cd,
Tcl_Interp *interp,
int objc,
@@ -300,7 +307,7 @@ static int superlock_busy(void *pCtx, int nBusy){
/*
** Tclcmd: sqlite3demo_superlock CMDNAME PATH VFS BUSY-HANDLER-SCRIPT
*/
-static int superlock_cmd(
+static int SQLITE_TCLAPI superlock_cmd(
ClientData cd,
Tcl_Interp *interp,
int objc,
diff --git a/src/test_syscall.c b/src/test_syscall.c
index f1d5c61bc..947f9a9d9 100644
--- a/src/test_syscall.c
+++ b/src/test_syscall.c
@@ -76,7 +76,11 @@
#include "sqliteInt.h"
#include "sqlite3.h"
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#include <stdlib.h>
#include <string.h>
#include <assert.h>
@@ -418,7 +422,7 @@ static void *ts_mremap(void *a, size_t b, size_t c, int d, ...){
return orig_mremap(a, b, c, d, pArg);
}
-static int test_syscall_install(
+static int SQLITE_TCLAPI test_syscall_install(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -454,7 +458,7 @@ static int test_syscall_install(
return TCL_OK;
}
-static int test_syscall_uninstall(
+static int SQLITE_TCLAPI test_syscall_uninstall(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -478,7 +482,7 @@ static int test_syscall_uninstall(
return TCL_OK;
}
-static int test_syscall_reset(
+static int SQLITE_TCLAPI test_syscall_reset(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -516,7 +520,7 @@ static int test_syscall_reset(
return TCL_OK;
}
-static int test_syscall_exists(
+static int SQLITE_TCLAPI test_syscall_exists(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -537,7 +541,7 @@ static int test_syscall_exists(
return TCL_OK;
}
-static int test_syscall_fault(
+static int SQLITE_TCLAPI test_syscall_fault(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -566,7 +570,7 @@ static int test_syscall_fault(
return TCL_OK;
}
-static int test_syscall_errno(
+static int SQLITE_TCLAPI test_syscall_errno(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -612,7 +616,7 @@ static int test_syscall_errno(
return TCL_OK;
}
-static int test_syscall_list(
+static int SQLITE_TCLAPI test_syscall_list(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -642,7 +646,7 @@ static int test_syscall_list(
return TCL_OK;
}
-static int test_syscall_defaultvfs(
+static int SQLITE_TCLAPI test_syscall_defaultvfs(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -664,7 +668,7 @@ static int ts_getpagesize(void){
return gSyscall.pgsz;
}
-static int test_syscall_pagesize(
+static int SQLITE_TCLAPI test_syscall_pagesize(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -699,7 +703,7 @@ static int test_syscall_pagesize(
return TCL_OK;
}
-static int test_syscall(
+static int SQLITE_TCLAPI test_syscall(
void * clientData,
Tcl_Interp *interp,
int objc,
diff --git a/src/test_tclvar.c b/src/test_tclvar.c
index 63ed39473..8f7352112 100644
--- a/src/test_tclvar.c
+++ b/src/test_tclvar.c
@@ -17,7 +17,11 @@
** access to TCL variables.
*/
#include "sqliteInt.h"
-#include "tcl.h"
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#include <stdlib.h>
#include <string.h>
@@ -407,7 +411,7 @@ extern int getDbPointer(Tcl_Interp *interp, const char *zA, sqlite3 **ppDb);
/*
** Register the echo virtual table module.
*/
-static int register_tclvar_module(
+static int SQLITE_TCLAPI register_tclvar_module(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
diff --git a/src/test_thread.c b/src/test_thread.c
index a4d96e194..d67b4be10 100644
--- a/src/test_thread.c
+++ b/src/test_thread.c
@@ -16,7 +16,11 @@
*/
#include "sqliteInt.h"
-#include <tcl.h>
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
#if SQLITE_THREADSAFE
@@ -72,7 +76,7 @@ extern int sqlite3TestErrCode(Tcl_Interp *, sqlite3 *, int);
/*
** Handler for events of type EvalEvent.
*/
-static int tclScriptEvent(Tcl_Event *evPtr, int flags){
+static int SQLITE_TCLAPI tclScriptEvent(Tcl_Event *evPtr, int flags){
int rc;
EvalEvent *p = (EvalEvent *)evPtr;
rc = Tcl_Eval(p->interp, p->zScript);
@@ -167,7 +171,7 @@ static Tcl_ThreadCreateType tclScriptThread(ClientData pSqlThread){
**
** The caller can wait for the script to terminate using [vwait VARNAME].
*/
-static int sqlthread_spawn(
+static int SQLITE_TCLAPI sqlthread_spawn(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -220,7 +224,7 @@ static int sqlthread_spawn(
**
** NOTE: At the moment, this doesn't work. FIXME.
*/
-static int sqlthread_parent(
+static int SQLITE_TCLAPI sqlthread_parent(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -265,7 +269,7 @@ static int xBusy(void *pArg, int nBusy){
** Open a database handle and return the string representation of
** the pointer value.
*/
-static int sqlthread_open(
+static int SQLITE_TCLAPI sqlthread_open(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -315,7 +319,7 @@ static int sqlthread_open(
** Return the current thread-id (Tcl_GetCurrentThread()) cast to
** an integer.
*/
-static int sqlthread_id(
+static int SQLITE_TCLAPI sqlthread_id(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -333,7 +337,7 @@ static int sqlthread_id(
/*
** Dispatch routine for the sub-commands of [sqlthread].
*/
-static int sqlthread_proc(
+static int SQLITE_TCLAPI sqlthread_proc(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -381,7 +385,7 @@ static int sqlthread_proc(
** implemented as a script in Tcl 8.5, it is not usually available to
** testfixture.
*/
-static int clock_seconds_proc(
+static int SQLITE_TCLAPI clock_seconds_proc(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -543,7 +547,7 @@ int sqlite3_blocking_prepare_v2(
**
** Advance the statement to the next row.
*/
-static int blocking_step_proc(
+static int SQLITE_TCLAPI blocking_step_proc(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -569,7 +573,7 @@ static int blocking_step_proc(
** Usage: sqlite3_blocking_prepare_v2 DB sql bytes ?tailvar?
** Usage: sqlite3_nonblocking_prepare_v2 DB sql bytes ?tailvar?
*/
-static int blocking_prepare_v2_proc(
+static int SQLITE_TCLAPI blocking_prepare_v2_proc(
void * clientData,
Tcl_Interp *interp,
int objc,
diff --git a/src/test_vfs.c b/src/test_vfs.c
index b476a42cb..fb987a616 100644
--- a/src/test_vfs.c
+++ b/src/test_vfs.c
@@ -28,7 +28,11 @@
#include "sqlite3.h"
#include "sqliteInt.h"
-#include <tcl.h>
+#if defined(INCLUDE_SQLITE_TCL_H)
+# include "sqlite_tcl.h"
+#else
+# include "tcl.h"
+#endif
typedef struct Testvfs Testvfs;
typedef struct TestvfsShm TestvfsShm;
@@ -1036,7 +1040,7 @@ static int tvfsUnfetch(sqlite3_file *pFile, sqlite3_int64 iOfst, void *p){
return sqlite3OsUnfetch(pFd->pReal, iOfst, p);
}
-static int testvfs_obj_cmd(
+static int SQLITE_TCLAPI testvfs_obj_cmd(
ClientData cd,
Tcl_Interp *interp,
int objc,
@@ -1348,7 +1352,7 @@ static int testvfs_obj_cmd(
return TCL_OK;
}
-static void testvfs_obj_del(ClientData cd){
+static void SQLITE_TCLAPI testvfs_obj_del(ClientData cd){
Testvfs *p = (Testvfs *)cd;
if( p->pScript ) Tcl_DecrRefCount(p->pScript);
sqlite3_vfs_unregister(p->pVfs);
@@ -1391,7 +1395,7 @@ static void testvfs_obj_del(ClientData cd){
**
** where LOCK is of the form "OFFSET NBYTE lock/unlock shared/exclusive"
*/
-static int testvfs_cmd(
+static int SQLITE_TCLAPI testvfs_cmd(
ClientData cd,
Tcl_Interp *interp,
int objc,
diff --git a/tool/mksqlite3c-noext.tcl b/tool/mksqlite3c-noext.tcl
index 601b8cce8..fad6c9e58 100644
--- a/tool/mksqlite3c-noext.tcl
+++ b/tool/mksqlite3c-noext.tcl
@@ -220,7 +220,7 @@ proc copy_file {filename} {
if {[lsearch -exact $cdecllist $funcname] >= 0} {
append line SQLITE_CDECL
} else {
- append line SQLITE_STDCALL
+ append line SQLITE_APICALL
}
append line " " $funcname $rest
puts $out $line
diff --git a/tool/mksqlite3c.tcl b/tool/mksqlite3c.tcl
index 7e8558d2a..b7561cfa5 100644
--- a/tool/mksqlite3c.tcl
+++ b/tool/mksqlite3c.tcl
@@ -232,7 +232,7 @@ proc copy_file {filename} {
if {[lsearch -exact $cdecllist $funcname] >= 0} {
append line SQLITE_CDECL
} else {
- append line SQLITE_STDCALL
+ append line SQLITE_APICALL
}
append line " " $funcname $rest
puts $out $line
diff --git a/tool/mksqlite3h.tcl b/tool/mksqlite3h.tcl
index 1af6d7573..9a4e7d298 100644
--- a/tool/mksqlite3h.tcl
+++ b/tool/mksqlite3h.tcl
@@ -21,6 +21,8 @@
# formatted as an integer (e.g. "3006017").
# 5) Replaces the string --SOURCE-ID-- with the date and time and sha1
# hash of the fossil-scm manifest for the source tree.
+# 6) Adds the SQLITE_CALLBACK calling convention macro in front of all
+# callback declarations.
#
# This script outputs to stdout.
#
@@ -120,11 +122,14 @@ foreach file $filelist {
if {[lsearch -exact $cdecllist $funcname] >= 0} {
append line SQLITE_CDECL
} else {
- append line SQLITE_STDCALL
+ append line SQLITE_APICALL
}
append line " " $funcname $rest
}
}
+ set line [string map [list (*sqlite3_syscall_ptr) \
+ "(SQLITE_SYSAPI *sqlite3_syscall_ptr)"] $line]
+ regsub {\(\*} $line {(SQLITE_CALLBACK *} line
puts $line
}
close $in
diff --git a/tool/replace.tcl b/tool/replace.tcl
index b01a83acc..1ecc6dc7b 100644
--- a/tool/replace.tcl
+++ b/tool/replace.tcl
@@ -7,13 +7,14 @@
set mode [string tolower [lindex $argv 0]]
set from [lindex $argv 1]
set to [lindex $argv 2]
-if {$mode ni [list exact include]} {exit 1}
+if {$mode ni [list exact regsub include]} {exit 1}
if {[string length $from]==0} {exit 2}
while {![eof stdin]} {
set line [gets stdin]
if {[eof stdin]} break
switch -exact $mode {
exact {set line [string map [list $from $to] $line]}
+ regsub {regsub -all -- $from $line $to line}
include {if {[regsub -all -- $from $line $to line]==0} continue}
}
puts stdout $line