Compare commits
146 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dd65746db0 | |||
| a900467804 | |||
| f5b71c20a9 | |||
| 9b2ef36b2f | |||
| 07bbda75fe | |||
| d46c5cde2e | |||
| 5bfcd01a8d | |||
| e491fd9438 | |||
| fc2e294988 | |||
| 524ec63005 | |||
| ccf446a569 | |||
| a1fe51ffb9 | |||
| dd2a8b9f14 | |||
| 1a25fa3d5e | |||
| 9e1e39de61 | |||
| e6452d34e9 | |||
| 4ff28b2dc1 | |||
| 898ea36c92 | |||
| 529e842a18 | |||
| 211ab33bf0 | |||
| 51d385df85 | |||
| 3008965443 | |||
| 555fe8a08e | |||
| 08cd1e99fd | |||
| c7d6066072 | |||
| f43776e655 | |||
| 0cb00bbe97 | |||
| 077ac43551 | |||
| 51b3f46de9 | |||
| 57ab256d3c | |||
| c92093a868 | |||
| 26247e4352 | |||
| b2ac62e96c | |||
| 90d7c2a16f | |||
| 6bbd187ce2 | |||
| 317269e6c1 | |||
| d6a1c2e0a2 | |||
| 5f5f3b4713 | |||
| 29cbcde95a | |||
| 9eefed6177 | |||
| b095d4511b | |||
| 870380511a | |||
| 6aae48eced | |||
| a2842bda96 | |||
| 3d430307ed | |||
| 19c6c50377 | |||
| 4203750e8e | |||
| a07d62a561 | |||
| 34ddefc419 | |||
| b8302b973c | |||
| e821fcdc8a | |||
| 10417f2224 | |||
| d754081c21 | |||
| dbafc78aa8 | |||
| 7c7f3d1435 | |||
| 866c30285d | |||
| 7ace558fe1 | |||
| a6966c5034 | |||
| d1e19b0c5c | |||
| 4d3f6ff6bf | |||
| a9f3e717d6 | |||
| 6b0f9f3304 | |||
| b4534f173f | |||
| 2a9d64214f | |||
| e5ad1c8a62 | |||
| 82a3fe26f0 | |||
| 2dc3acf1fc | |||
| 0e0720f226 | |||
| 32c53ef074 | |||
| d362752e16 | |||
| c3a9ba08c1 | |||
| 1a59843b39 | |||
| ef1a2bf778 | |||
| ccf4a2bc69 | |||
| c351035606 | |||
| 09b8308045 | |||
| b58d987b42 | |||
| 26b291fe66 | |||
| 7c4d15a128 | |||
| ff98736baf | |||
| 00c94befae | |||
| 0746356f82 | |||
| 82a5e9332b | |||
| 8526f8738a | |||
| 1cdb1fa7e3 | |||
| 5a9d2a497e | |||
| adbd991fa2 | |||
| 961f27a668 | |||
| 19d72321fb | |||
| a6f9a8d97f | |||
| ef7f2c8d88 | |||
| b524e6741a | |||
| f7394cf9a9 | |||
| 4af7ea5b4c | |||
| 4ef0175d06 | |||
| cf4fb1ac20 | |||
| ab4251820f | |||
| 12ee7d9acf | |||
| 7f43d714ad | |||
| 2540eccd60 | |||
| 2527e8b2f8 | |||
| 23e68222f5 | |||
| 9ba2dcf540 | |||
| d7596a2a00 | |||
| 8d81c85a76 | |||
| c8a1bd9567 | |||
| 63255fda5c | |||
| 442f1b06e8 | |||
| 10e2866c99 | |||
| 19d77e2791 | |||
| 8a6c538ed3 | |||
| 8a30af3e1d | |||
| b6265f854c | |||
| 96b922020c | |||
| 408f4e998e | |||
| c4e13636a2 | |||
| 3dc9adfcd2 | |||
| 1ef4579896 | |||
| 6cd6ec811c | |||
| 8acc81f100 | |||
| 5fc17a2f98 | |||
| e1cb8f2639 | |||
| ab0866c73a | |||
| fba56bcec4 | |||
| a8a17ccd4b | |||
| fe1b4b0592 | |||
| dcd8d2d403 | |||
| 23c0ede104 | |||
| 1df96058be | |||
| 7f1d54d69f | |||
| 016cead2a8 | |||
| b89bb8111c | |||
| f655a244ae | |||
| 34b1f2b2b8 | |||
| fb05c996a3 | |||
| c3c68e345a | |||
| ad4e9155ee | |||
| 2345b91f73 | |||
| 52a0e0b740 | |||
| b0e5e7b34a | |||
| e5a5f4bcf9 | |||
| d18d0a0699 | |||
| fcc17dd039 | |||
| 80d2d6e828 | |||
| efb3302986 | |||
| ab5722c7da |
Regular → Executable
+111
-28
@@ -52,6 +52,18 @@ TCC += @TCL_INCLUDE_SPEC@
|
||||
# The library that programs using TCL must link against.
|
||||
#
|
||||
LIBTCL = @TCL_LIB_SPEC@
|
||||
# The preprocessing options that are needed for images using the TCL library.
|
||||
INCTCL = @TCL_INCLUDE_SPEC@
|
||||
|
||||
# TCCX is the C Compile and options for use in building shell extensions
|
||||
# that will run on the target platform. It relies on no in-tree includes,
|
||||
# using only pre-glommed source/header files in the current directory.
|
||||
TCCX = ${CC} ${CFLAGS} -fPIC -shared -I.
|
||||
TCCX += @EXTENSION_DEBUG@
|
||||
|
||||
# TCXX is the C++ compile for building a shell extension from a C++ source.
|
||||
TCXX = ${CXX} ${CFLAGS} -fPIC -shared -I.
|
||||
TCXX += @EXTENSION_DEBUG@
|
||||
|
||||
# Compiler options needed for programs that use the readline() library.
|
||||
#
|
||||
@@ -161,6 +173,9 @@ LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(TCC) $(LTCOMPILE_EXTRAS)
|
||||
LTLINK = $(LIBTOOL) --mode=link $(TCC) $(LTCOMPILE_EXTRAS) @LDFLAGS@ $(LTLINK_EXTRAS)
|
||||
LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
|
||||
|
||||
# Shell and extension source builder tool
|
||||
MKSHELL_TOOL = $(TCLSH_CMD) $(TOP)/tool/mkshellc.tcl
|
||||
|
||||
# You should not have to change anything below this line
|
||||
###############################################################################
|
||||
|
||||
@@ -570,6 +585,11 @@ TESTPROGS = \
|
||||
dbhash$(TEXE) \
|
||||
sqltclsh$(TEXE)
|
||||
|
||||
TESTPROGS_SHX = \
|
||||
testfixture$(TEXE) \
|
||||
sqlite3x$(TEXE) \
|
||||
shell_extensions
|
||||
|
||||
# Databases containing fuzzer test cases
|
||||
#
|
||||
FUZZDATA = \
|
||||
@@ -646,6 +666,9 @@ SQLITE3_SHELL_TARGET_ = sqlite3$(TEXE)
|
||||
SQLITE3_SHELL_TARGET_1 =
|
||||
SQLITE3_SHELL_TARGET = $(SQLITE3_SHELL_TARGET_@HAVE_WASI_SDK@)
|
||||
|
||||
#
|
||||
SHELL_OPT_NOEXT = $(SHELL_OPT) -DSHELL_OMIT_EXTENSIONS=7
|
||||
|
||||
# This is the default Makefile target. The objects listed here
|
||||
# are what get build when you type just "make" with no arguments.
|
||||
#
|
||||
@@ -670,6 +693,11 @@ libtclsqlite3.la: tclsqlite.lo libsqlite3.la
|
||||
-avoid-version
|
||||
|
||||
sqlite3$(TEXE): shell.c sqlite3.c
|
||||
$(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT_NOEXT) -o $@ \
|
||||
shell.c sqlite3.c \
|
||||
$(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
|
||||
|
||||
sqlite3x$(TEXE): shell.c sqlite3.c
|
||||
$(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \
|
||||
shell.c sqlite3.c \
|
||||
$(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
|
||||
@@ -1119,37 +1147,36 @@ keywordhash.h: $(TOP)/tool/mkkeywordhash.c
|
||||
$(BCC) -o mkkeywordhash$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)/tool/mkkeywordhash.c
|
||||
./mkkeywordhash$(BEXE) >keywordhash.h
|
||||
|
||||
$(TOP)/ext/misc/basexx.c: $(TOP)/ext/misc/base64.c $(TOP)/ext/misc/base85.c
|
||||
|
||||
# Source files that go into making shell.c
|
||||
SHELL_SRC = \
|
||||
$(TOP)/src/shell.c.in \
|
||||
$(TOP)/ext/misc/appendvfs.c \
|
||||
$(TOP)/ext/misc/completion.c \
|
||||
$(TOP)/ext/misc/decimal.c \
|
||||
$(TOP)/ext/misc/basexx.c \
|
||||
$(TOP)/ext/misc/base64.c \
|
||||
$(TOP)/ext/misc/base85.c \
|
||||
$(TOP)/ext/misc/fileio.c \
|
||||
$(TOP)/ext/misc/ieee754.c \
|
||||
$(TOP)/ext/misc/regexp.c \
|
||||
$(TOP)/ext/misc/series.c \
|
||||
$(TOP)/ext/misc/shathree.c \
|
||||
$(TOP)/ext/misc/sqlar.c \
|
||||
$(TOP)/ext/misc/uint.c \
|
||||
$(TOP)/ext/expert/sqlite3expert.c \
|
||||
$(TOP)/ext/expert/sqlite3expert.h \
|
||||
$(TOP)/ext/misc/zipfile.c \
|
||||
$(TOP)/ext/misc/memtrace.c \
|
||||
$(TOP)/ext/misc/pcachetrace.c \
|
||||
$(TOP)/ext/recover/dbdata.c \
|
||||
$(TOP)/ext/recover/sqlite3recover.c \
|
||||
$(TOP)/ext/recover/sqlite3recover.h \
|
||||
$(TOP)/src/test_windirent.c
|
||||
$(TOP)/src/shell.c.in \
|
||||
$(TOP)/ext/expert/sqlite3expert.c \
|
||||
$(TOP)/ext/expert/sqlite3expert.h \
|
||||
$(TOP)/ext/misc/appendvfs.c \
|
||||
$(TOP)/ext/misc/basexx.c \
|
||||
$(TOP)/ext/misc/completion.c \
|
||||
$(TOP)/ext/misc/decimal.c \
|
||||
$(TOP)/ext/misc/fileio.c \
|
||||
$(TOP)/ext/misc/ieee754.c \
|
||||
$(TOP)/ext/misc/regexp.c \
|
||||
$(TOP)/ext/misc/series.c \
|
||||
$(TOP)/ext/misc/shathree.c \
|
||||
$(TOP)/ext/misc/sqlar.c \
|
||||
$(TOP)/ext/misc/uint.c \
|
||||
$(TOP)/ext/misc/memtrace.c \
|
||||
$(TOP)/ext/misc/pcachetrace.c \
|
||||
$(TOP)/src/shext_linkage.h \
|
||||
$(TOP)/src/obj_interfaces.h \
|
||||
$(TOP)/src/resmanage.h \
|
||||
$(TOP)/src/resmanage.c \
|
||||
$(TOP)/ext/recover/dbdata.c \
|
||||
$(TOP)/ext/misc/zipfile.c \
|
||||
$(TOP)/src/test_windirent.c
|
||||
|
||||
shell.c: $(SHELL_SRC) $(TOP)/tool/mkshellc.tcl
|
||||
$(TCLSH_CMD) $(TOP)/tool/mkshellc.tcl >shell.c
|
||||
|
||||
|
||||
|
||||
$(MKSHELL_TOOL) >shell.c
|
||||
|
||||
# Rules to build the extension objects.
|
||||
#
|
||||
@@ -1243,6 +1270,54 @@ fts5.lo: fts5.c $(HDR) $(EXTHDR)
|
||||
sqlite3rbu.lo: $(TOP)/ext/rbu/sqlite3rbu.c $(HDR) $(EXTHDR)
|
||||
$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rbu/sqlite3rbu.c
|
||||
|
||||
# Rule to build shx_link.h (for use by shell extensions)
|
||||
|
||||
SHX_LINK_SRC = \
|
||||
$(TOP)/src/shext_linkage.h \
|
||||
$(TOP)/src/obj_interfaces.h \
|
||||
sqlite3ext.h \
|
||||
sqlite3.h
|
||||
|
||||
shx_link.h: $(SHX_LINK_SRC)
|
||||
$(MKSHELL_TOOL) -short-head -header-gen \
|
||||
$(TOP)/src/shext_linkage.h > $@
|
||||
|
||||
# Rules to build shell extensions used for testing extensible shell
|
||||
|
||||
shell_extensions: tcl_shell_extension \
|
||||
test_shellext_cpp$(SHLIB_SUFFIX) test_shellext_c$(SHLIB_SUFFIX)
|
||||
|
||||
test_shellext_cpp$(SHLIB_SUFFIX): $(TOP)/src/test_shellext_cpp.cpp \
|
||||
$(TOP)/shx_link.h
|
||||
$(TCXX) $(TOP)/src/test_shellext_cpp.cpp -o $@
|
||||
|
||||
test_shellext_c$(SHLIB_SUFFIX): $(TOP)/src/test_shellext_c.c \
|
||||
$(TOP)/shx_link.h
|
||||
$(TCCX) $(TOP)/src/test_shellext_c.c -o $@
|
||||
|
||||
# Rules to build the TCL shell extension (tclshext.{so,dll,dylib})
|
||||
|
||||
tcl_shell_extension: tclshext$(SHLIB_SUFFIX)
|
||||
|
||||
# This is a work-around for building Tk variant. Ultimately, the configure
|
||||
# script will find the Tk library with the same version as the Tcl library.
|
||||
# This has the same effect with the lib naming now used by the Tcl project,
|
||||
# but, if it will fail, does so when make rather than configure is run.
|
||||
TCL_LIBS = $(LIBTCL)
|
||||
ifdef WITH_TK
|
||||
ifneq ($(WITH_TK),0)
|
||||
TCLEXT_OPTS += -DSHELL_ENABLE_TK
|
||||
LIBTK := $(patsubst -ltcl%,-ltk%,$(LIBTCL))
|
||||
TCL_LIBS += $(LIBTK)
|
||||
endif
|
||||
endif
|
||||
|
||||
tclshext.c: $(TOP)/ext/misc/tclshext.c.in $(TOP)/src/tclsqlite.c
|
||||
$(MKSHELL_TOOL) $(TOP)/ext/misc/tclshext.c.in > $@
|
||||
|
||||
tclshext$(SHLIB_SUFFIX): tclshext.c shx_link.h
|
||||
$(TCCX) $(INCTCL) $(TCLEXT_OPTS) tclshext.c \
|
||||
-o $@ $(TCL_LIBS) $(TCLEXT_LDOPTS)
|
||||
|
||||
# Rules to build the 'testfixture' application.
|
||||
#
|
||||
@@ -1342,8 +1417,15 @@ valgrindtest: $(TESTPROGS) valgrindfuzz
|
||||
smoketest: $(TESTPROGS) fuzzcheck$(TEXE)
|
||||
./testfixture$(TEXE) $(TOP)/test/main.test $(TESTOPTS)
|
||||
|
||||
TESTRUNS_SHX = \
|
||||
$(TOP)/test/shell_x/shell9.test \
|
||||
$(TOP)/test/shell_x/shell10.test
|
||||
|
||||
shellxtest: $(TESTPROGS_SHX)
|
||||
./testfixture$(TEXE) $(TESTRUNS_SHX)
|
||||
|
||||
shelltest: $(TESTPROGS)
|
||||
./testfixture$(TEXT) $(TOP)/test/permutations.test shell
|
||||
./testfixture$(TEXE) $(TOP)/test/permutations.test shell
|
||||
|
||||
sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in
|
||||
$(TCLSH_CMD) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c
|
||||
@@ -1517,6 +1599,7 @@ clean:
|
||||
rm -f sqlite3.c
|
||||
rm -f sqlite3rc.h
|
||||
rm -f shell.c sqlite3ext.h
|
||||
rm -f shx_link.h tclshext.c tclshext$(SHLIB_SUFFIX)
|
||||
rm -f sqlite3_analyzer$(TEXE) sqlite3_analyzer.c
|
||||
rm -f sqlite-*-output.vsix
|
||||
rm -f mptester mptester.exe
|
||||
|
||||
Regular → Executable
+89
-20
@@ -311,6 +311,7 @@ SQLITE3EXE = winsqlite3shell.exe
|
||||
SQLITE3EXE = sqlite3.exe
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
SQLITE3XEXE = sqlite3x.exe
|
||||
|
||||
# This is the argument used to set the program database (PDB) file for the
|
||||
# SQLite shell executable (EXE).
|
||||
@@ -908,6 +909,14 @@ TCLLIBDIR = $(TCLDIR)\lib
|
||||
LIBTCL = tcl$(TCLVERSION)$(TCLSUFFIX).lib
|
||||
!ENDIF
|
||||
|
||||
# For Tcl shell extension only:
|
||||
!IFDEF WITH_TK
|
||||
!IFNDEF LIBTK
|
||||
LIBTK = tk$(TCLVERSION)$(TCLSUFFIX).lib
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IFNDEF LIBTCLSTUB
|
||||
LIBTCLSTUB = tclstub$(TCLVERSION)$(TCLSUFFIX).lib
|
||||
!ENDIF
|
||||
@@ -1640,6 +1649,11 @@ TESTPROGS = \
|
||||
dbhash.exe \
|
||||
sqltclsh.exe
|
||||
|
||||
TESTPROGS_SHX = \
|
||||
testfixture.exe \
|
||||
$(SQLITE3XEXE) \
|
||||
shell_extensions
|
||||
|
||||
# Databases containing fuzzer test cases
|
||||
#
|
||||
FUZZDATA = \
|
||||
@@ -1663,6 +1677,9 @@ SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS=1
|
||||
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_OFFSET_SQL_FUNC=1
|
||||
!ENDIF
|
||||
|
||||
#
|
||||
SHELL_NOEXT_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSHELL_OMIT_EXTENSIONS=7
|
||||
|
||||
# <<mark>>
|
||||
# Extra compiler options for various test tools.
|
||||
#
|
||||
@@ -1788,6 +1805,10 @@ sqlite3.def: libsqlite3.lib
|
||||
# <</block2>>
|
||||
|
||||
$(SQLITE3EXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
|
||||
$(LTLINK) $(SHELL_NOEXT_COMPILE_OPTS) $(READLINE_FLAGS) shell.c $(SHELL_CORE_SRC) \
|
||||
/link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
|
||||
|
||||
$(SQLITE3XEXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
|
||||
$(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) shell.c $(SHELL_CORE_SRC) \
|
||||
/link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
|
||||
|
||||
@@ -2229,26 +2250,28 @@ keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
|
||||
|
||||
# Source files that go into making shell.c
|
||||
SHELL_SRC = \
|
||||
$(TOP)\src\shell.c.in \
|
||||
$(TOP)\ext\misc\appendvfs.c \
|
||||
$(TOP)\ext\misc\completion.c \
|
||||
$(TOP)\ext\misc\base64.c \
|
||||
$(TOP)\ext\misc\base85.c \
|
||||
$(TOP)\ext\misc\decimal.c \
|
||||
$(TOP)\ext\misc\fileio.c \
|
||||
$(TOP)\ext\misc\ieee754.c \
|
||||
$(TOP)\ext\misc\regexp.c \
|
||||
$(TOP)\ext\misc\series.c \
|
||||
$(TOP)\ext\misc\shathree.c \
|
||||
$(TOP)\ext\misc\uint.c \
|
||||
$(TOP)\ext\expert\sqlite3expert.c \
|
||||
$(TOP)\ext\expert\sqlite3expert.h \
|
||||
$(TOP)\ext\misc\memtrace.c \
|
||||
$(TOP)\ext\misc\pcachetrace.c \
|
||||
$(TOP)\ext\recover\dbdata.c \
|
||||
$(TOP)\ext\recover\sqlite3recover.c \
|
||||
$(TOP)\ext\recover\sqlite3recover.h \
|
||||
$(TOP)\src\test_windirent.c
|
||||
$(TOP)\src\shell.c.in \
|
||||
$(TOP)\ext\misc\appendvfs.c \
|
||||
$(TOP)\ext\misc\completion.c \
|
||||
$(TOP)\ext\misc\base64.c \
|
||||
$(TOP)\ext\misc\base85.c \
|
||||
$(TOP)\ext\misc\decimal.c \
|
||||
$(TOP)\ext\misc\fileio.c \
|
||||
$(TOP)\ext\misc\ieee754.c \
|
||||
$(TOP)\ext\misc\regexp.c \
|
||||
$(TOP)\ext\misc\series.c \
|
||||
$(TOP)\ext\misc\shathree.c \
|
||||
$(TOP)\ext\misc\uint.c \
|
||||
$(TOP)\ext\expert\sqlite3expert.c \
|
||||
$(TOP)\ext\expert\sqlite3expert.h \
|
||||
$(TOP)\ext\misc\memtrace.c \
|
||||
$(TOP)\ext\misc\pcachetrace.c \
|
||||
$(TOP)\ext\recover\dbdata.c \
|
||||
$(TOP)\ext\recover\sqlite3recover.c \
|
||||
$(TOP)\ext\recover\sqlite3recover.h \
|
||||
$(TOP)\src\resmanage.h \
|
||||
$(TOP)\src\resmanage.c \
|
||||
$(TOP)\src\test_windirent.c
|
||||
|
||||
# If use of zlib is enabled, add the "zipfile.c" source file.
|
||||
#
|
||||
@@ -2383,6 +2406,45 @@ fts5.dll: fts5_ext.lo
|
||||
sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR)
|
||||
$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)\ext\rbu\sqlite3rbu.c
|
||||
|
||||
# Rule to build shx_link.h (for use by shell extensions)
|
||||
|
||||
SHX_LINK_SRC = \
|
||||
$(TOP)/src/shext_linkage.h \
|
||||
$(TOP)/src/obj_interfaces.h \
|
||||
sqlite3ext.h \
|
||||
sqlite3.h
|
||||
|
||||
shx_link.h: $(SHX_LINK_SRC)
|
||||
$(TCLSH_CMD) $(TOP)\tool\mkshellc.tcl -short-head -header-gen \
|
||||
$(TOP)/src/shext_linkage.h > $@
|
||||
|
||||
# Rules to build shell extensions used for testing extensible shell
|
||||
|
||||
shell_extensions: tcl_shell_extension \
|
||||
test_shellext_cpp.dll test_shellext_c.dll
|
||||
|
||||
test_shellext_cpp.dll: $(TOP)/src/test_shellext_cpp.cpp $(TOP)/shx_link.h
|
||||
$(TCC) $(TOP)/src/test_shellext_cpp.cpp -LD -Fe$@
|
||||
|
||||
test_shellext_c.dll: $(TOP)/src/test_shellext_c.c $(TOP)/shx_link.h
|
||||
$(TCC) $(TOP)/src/test_shellext_c.c -LD -Fe$@
|
||||
|
||||
tcl_shell_extension: tclshext.dll
|
||||
|
||||
!IFDEF WITH_TK
|
||||
TCLEXT_OPTS=-DSHELL_ENABLE_TK
|
||||
TCLEXT_LIBS = $(TCLLIBS) $(LIBTK)
|
||||
!ELSE
|
||||
TCLEXT_OPTS=
|
||||
TCLEXT_LIBS = $(TCLLIBS)
|
||||
!ENDIF
|
||||
tclshext.c: $(TOP)/ext/misc/tclshext.c.in $(TOP)/src/tclsqlite.c
|
||||
$(TCLSH_CMD) $(TOP)\tool\mkshellc.tcl $(TOP)/ext/misc/tclshext.c.in > $@
|
||||
|
||||
tclshext.dll: tclshext.c shx_link.h
|
||||
$(TCC) -I$(TCLINCDIR) $(TCLEXT_OPTS) tclshext.c -Fe$@ -link -DLL \
|
||||
-LIBPATH:$(TCLLIBDIR) $(TCLEXT_LIBS)
|
||||
|
||||
# Rules to build the 'testfixture' application.
|
||||
#
|
||||
# If using the amalgamation, use sqlite3.c directly to build the test
|
||||
@@ -2501,6 +2563,13 @@ smoketest: $(TESTPROGS)
|
||||
@set PATH=$(LIBTCLPATH);$(PATH)
|
||||
.\testfixture.exe $(TOP)\test\main.test $(TESTOPTS)
|
||||
|
||||
TESTRUNS_SHX = \
|
||||
$(TOP)/test/shell_x/shell9.test \
|
||||
$(TOP)/test/shell_x/shell10.test
|
||||
|
||||
shellxtest: $(TESTPROGS_SHX)
|
||||
.\testfixture.exe $(TESTRUNS_SHX)
|
||||
|
||||
shelltest: $(TESTPROGS)
|
||||
.\testfixture.exe $(TOP)\test\permutations.test shell
|
||||
|
||||
|
||||
@@ -776,6 +776,7 @@ OPT_FEATURE_FLAGS
|
||||
HAVE_ZLIB
|
||||
USE_AMALGAMATION
|
||||
TARGET_DEBUG
|
||||
EXTENSION_DEBUG
|
||||
TARGET_HAVE_EDITLINE
|
||||
TARGET_HAVE_READLINE
|
||||
TARGET_READLINE_INC
|
||||
@@ -11322,10 +11323,12 @@ fi
|
||||
$as_echo_n "checking build type... " >&6; }
|
||||
if test "${enable_debug}" = "yes" ; then
|
||||
TARGET_DEBUG="-DSQLITE_DEBUG=1 -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE -O0"
|
||||
EXTENSION_DEBUG="-DSQLITE_DEBUG=1"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: debug" >&5
|
||||
$as_echo "debug" >&6; }
|
||||
else
|
||||
TARGET_DEBUG="-DNDEBUG"
|
||||
EXTENSION_DEBUG="-DNDEBUG"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: release" >&5
|
||||
$as_echo "release" >&6; }
|
||||
fi
|
||||
|
||||
@@ -616,12 +616,15 @@ AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[enable debugging & verbose
|
||||
AC_MSG_CHECKING([build type])
|
||||
if test "${enable_debug}" = "yes" ; then
|
||||
TARGET_DEBUG="-DSQLITE_DEBUG=1 -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE -O0"
|
||||
EXTENSION_DEBUG="-DSQLITE_DEBUG=1"
|
||||
AC_MSG_RESULT([debug])
|
||||
else
|
||||
TARGET_DEBUG="-DNDEBUG"
|
||||
EXTENSION_DEBUG="-DNDEBUG"
|
||||
AC_MSG_RESULT([release])
|
||||
fi
|
||||
AC_SUBST(TARGET_DEBUG)
|
||||
AC_SUBST(EXTENSION_DEBUG)
|
||||
|
||||
#########
|
||||
# See whether we should use the amalgamation to build
|
||||
|
||||
Executable
+73
@@ -0,0 +1,73 @@
|
||||
# Introduction to the SQLite Extensible Shell #
|
||||
|
||||
This article introduces a set of enhancements to the SQLite "CLI" shell
|
||||
which make it extensible as a shell and provide other useful features.
|
||||
|
||||
What "extensible" means as of June 2023 is that additional dot-commands
|
||||
can be implemented by a dynamically loaded extension and integrated
|
||||
into the shell's command repertoire and help for same. It also means
|
||||
that scripting support can be provided by an extension and integrated
|
||||
into the shell's input collection and dispatching facility.
|
||||
|
||||
In the future, "extensible" will also mean that additional forms of query
|
||||
result output formatting (or other disposition), and additional methods
|
||||
of data collection into tables (or other disposition), can be provided
|
||||
by an extension and utilized via the shell's .mode and .import commands.
|
||||
(This integration with .mode and .import commands is in-work.)
|
||||
|
||||
Scripting support for the shell is presently implemented by a
|
||||
[Tcl Shell Extension](https://sqlite.org/src/file?name=doc/tcl_extension_intro.md&ci=cli_extension).
|
||||
|
||||
Some new features are available via these new or altered dot-commands:
|
||||
|
||||
**.eval** will interpret its arguments as shell input. This is mainly useful
|
||||
from within a script to run fixed or formulated shell commands.
|
||||
|
||||
**.parameter** has several enhancements: The new "edit" subcommand can be
|
||||
used to create or modify SQL binding parameters, either by name or from
|
||||
being referenced in the most recently run SQL. The new "save" and "load"
|
||||
subcommands will store or retrieve all or named parameters into/from a file.
|
||||
|
||||
**.shxload** is used to load shell extensions at runtime.
|
||||
|
||||
**.shxopts** either shows or alters extended shell features. Presently,
|
||||
this allows shell input parsing to be enhanced as described below or to be
|
||||
reverted to the traditional rule where dot-commands always occupy one line
|
||||
and neither dot-commands nor #-prefixed comments may have leading whitespace.
|
||||
|
||||
**.tables** has new options to show only tables, views, or system tables.
|
||||
|
||||
**.vars** is used to create or modify "shell" variables. These are
|
||||
key/value pairs which are associated with the shell session rather than
|
||||
a specific database such as .databases would list. These variables may
|
||||
be the subject of "edit", "set", "save" and "load" subcommands with
|
||||
effect similar to what they do with the .parameter dot-command.
|
||||
|
||||
**.x** is a general purpose, "run these" command. By default, its arguments
|
||||
are treated as shell variable names, values of which are interpreted as
|
||||
shell input. Optionally, its arguments are interpreted similarly to the
|
||||
.eval and .read subcommand. They differ in that interpretation of the
|
||||
arguments stops upon any error.
|
||||
|
||||
Other new shell features are:
|
||||
|
||||
By default, when invoked as "sqlite3x", or after ".shxopts +parsing" is run,
|
||||
the shell effects enhanced command parsing whereby quoted dot-command arguments
|
||||
may span multiple lines or dot-command input lines may be spliced together
|
||||
with trailing backslash, and all shell input may have leading whitespace.
|
||||
|
||||
When not invoked as "sqlite3x", or after ".shxopts -parsing" is run, any
|
||||
dot-command arguments and the dot-command itself end at the first newline.
|
||||
Also, input lines with leading whitespace will not be accepted as dot-commands
|
||||
or #-prefixed comments.
|
||||
This might be needed to run legacy shell scripts having some dot-command(s)
|
||||
with a final argument that has an initial quote but no closing quote or
|
||||
which happen to end with backslash.
|
||||
|
||||
The shell's handling of certain fatal conditions has been changed to make
|
||||
it more suitable being embedded into other applications. It no longer calls
|
||||
exit() for OOM conditions or -safe mode violations. This feature has not
|
||||
yet been fully tested; work remains to be sure that the shell can be called,
|
||||
then return to its caller, repeatedly without leaking resources or leaving
|
||||
the console in an odd state. But the infrastructure is in place to make
|
||||
that all work with only minor (or possibly no) revisions.
|
||||
Executable
+608
@@ -0,0 +1,608 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<title>CLI Shell Extensibility</title>
|
||||
</head>
|
||||
<body>
|
||||
<style>
|
||||
body{counter-reset: section}
|
||||
h2{counter-reset: h2counter; text-indent: 10px}
|
||||
h3{counter-reset: h3counter; text-indent: 25px}
|
||||
h4{counter-reset: h4counter; text-indent: 40px}
|
||||
|
||||
h2:before{
|
||||
counter-increment: section;
|
||||
content: counter(section) " ";
|
||||
}
|
||||
h3:before{
|
||||
counter-increment: h2counter;
|
||||
content: counter(section) "." counter(h2counter) " ";
|
||||
}
|
||||
h4:before{
|
||||
counter-increment: h3counter;
|
||||
content: counter(section) "." counter(h2counter) "." counter(h3counter) " ";
|
||||
}
|
||||
h5:before{
|
||||
counter-increment: h4counter;
|
||||
content: counter(section) "." counter(h2counter) "." counter(h3counter) "." counter(h4counter) " ";
|
||||
}
|
||||
</style>
|
||||
<img class="logo" src="https://sqlite.org/images/sqlite370_banner.gif"
|
||||
alt="SQLite" border="0"/>
|
||||
|
||||
<h1>CLI Shell Extensibility</h1>
|
||||
<hr/>
|
||||
<h2>Introduction</h2>
|
||||
<p>The command line shell for SQLite can be customized
|
||||
to modify or add certain kinds of features, without altering its source.
|
||||
This document details this extensibility
|
||||
and how such extension may be accomplished by shell users.
|
||||
<p>Shell extensibility serves to reduce the tension between
|
||||
keeping the shell simple with broadly useful features
|
||||
and allowing the shell to become an ever-growing tool
|
||||
meeting diverse needs for those not ready to satisfy them
|
||||
with a custom program using the SQLite libary.
|
||||
Extensions contributed by the SQLite developers or others
|
||||
will become (or are) available for use in situations
|
||||
that may not justify permanently adding the same features
|
||||
to the core shell published by the SQLite project in binary form.
|
||||
<h2>Extensible Features</h2>
|
||||
<p>Only certain categories of features may be
|
||||
added or modified via extension, namely:
|
||||
|
||||
<h3>New or Revised Meta-Commands</h3>
|
||||
<p>The "dot" commands implemented by the shell,
|
||||
along with help text for them, may be augmented or overridden.
|
||||
A meta-command effected with an extension may be used
|
||||
in the same ways as one available in the core, non-extended shell.
|
||||
|
||||
<h3>New or Revised Import Modes (work-in-progress)</h3>
|
||||
<p>The ways in which data may be imported to a DB table
|
||||
may be augmented or overriden. Once that is done, the .import
|
||||
meta-command will either have a new option to specify a new import
|
||||
handler or an existing .import option can be overridden for this.
|
||||
|
||||
<h3>New or Revised Query Result Handling (work-in-progress)</h3>
|
||||
<p>The display formatting or other disposition of query results
|
||||
may be augmented or overriden. Once that is done, the .mode
|
||||
meta-command will either have a new option to specify a new result
|
||||
handler or an existing .mode option can be overridden for this.
|
||||
|
||||
<h3>Generalized Import Modes and Query Result Handling</h3>
|
||||
<p>New handlers added via extension are not restricted to
|
||||
importing data from a file or result display formatting.
|
||||
They may be considered more generally to be either
|
||||
a data source or a data sink, producing or accepting
|
||||
data row sets. The origin or destination of
|
||||
the data is up to the handler, as may be affected
|
||||
by arguments to the .import or most recent .mode command.
|
||||
|
||||
<h3>Scriptability</h3>
|
||||
<p>An shell extension may provide for integration of a scripting
|
||||
subsystem with the shell. Such a subsystem may participate in
|
||||
classification of input, extending the recognized classes from
|
||||
{ meta-command SQL-statement(s) comment } to add { script }, and
|
||||
then handle input in the "script" input class. The shell exposes
|
||||
some its internal data and code to script implementations so that
|
||||
they may act in a manner providing adaptation or enhancement of
|
||||
shell features rather than entirely independent new features.
|
||||
|
||||
<h2>Extension Methods, Dynamic or Static</h2>
|
||||
<p>Shell extension may be effected at different times
|
||||
in different ways according to convenience and need.
|
||||
|
||||
<h3>Runtime Extension</h3>
|
||||
<p>Extension at runtime (when the shell is running)
|
||||
is effected via the .shxload command.
|
||||
In this way, a dynamically loaded library (DLL) is loaded with
|
||||
provision made for its sqlite3_X_init() function to obtain
|
||||
the shell extension API entry points and thereby
|
||||
register with the shell core any
|
||||
new meta-commands, or import or query result handlers
|
||||
or scripting support that it implements.
|
||||
|
||||
<h3>Build-Time Extension</h3>
|
||||
<p>Extension when the shell is built is effected by specifying
|
||||
certain option values to either the "make" invocation or
|
||||
to a utility, (tool/mkshellc.tcl), which assembles and transforms
|
||||
sources to produce the shell's unitary source file (shell.c).
|
||||
|
||||
<h3>Extension Source Code</h3>
|
||||
<p>With certain coding conventions and methods followed,
|
||||
the same source code can be used either
|
||||
to produce most of a runtime shell extension DLL or to
|
||||
be incorporated into shell.c as a built-in shell extension.
|
||||
(See the extension code samples for details. (Not fully implemented.))
|
||||
|
||||
<h3>Build-Time Diminuation</h3>
|
||||
<p>Just as new meta-commands can be readily incorporated into
|
||||
the shell when it is built, many of the core meta-commands
|
||||
can be readily omitted from the shell build. This is done
|
||||
with a variation of the option values that may be given
|
||||
to "make" or to tool/mkshellc.tcl as the shell is built.
|
||||
(See tool/mkshellc.tcl --help output for details.)
|
||||
Such omission of meta-commands might be done when building
|
||||
a customized shell which need not have the various meta-commands
|
||||
which exist for the purpose of testing the SQLite library.
|
||||
|
||||
<h2>Interface</h2>
|
||||
<p>The following details relate to src/shext_linkage.h, a header
|
||||
in which declarations appear for objects and functions
|
||||
that facilitate runtime interaction between the shell core
|
||||
and shell extensions written in C/C++.
|
||||
Comments in that header tersely summarize these explanations:
|
||||
|
||||
<h3>struct ShellInState and ShellExState</h3>
|
||||
<p>The Shell{In,Ex}State objects, are maintained by the shell and known
|
||||
as shell state. The shell state consists of a public portion, which
|
||||
is available and stable for use in shell/extension interactions,
|
||||
and a private portion which may not be stable. Shell extension code
|
||||
used only for build-time extension might use the private part,
|
||||
(to which it has access because such code is compiled within the same
|
||||
translation unit as the core shell code),
|
||||
but such usage generally precludes (or makes hazardous)
|
||||
use of runtime loadable extensions built from such code.
|
||||
|
||||
<h3>ExtensionId typedef and eid Member</h3>
|
||||
<p>An object of this type serves to uniquely identify an extension
|
||||
loaded at runtime so that it may be unloaded later. It must be
|
||||
passed back to the shell (in the ShellExtensionLink eid member)
|
||||
by the sqlite3_X_init() function if the extension DLL is ever
|
||||
to be unloaded during that shell session.
|
||||
|
||||
<h3>ShellExState typedef</h3>
|
||||
<p>An object of this type is passed between the shell core and its
|
||||
import or query result handlers to: (1) convey or keep parameters and
|
||||
data related to formatting or parsing data rows in an external form;
|
||||
(2) keep state associated with the progression of an import or result
|
||||
handling operation from initiation to completion; (3) to facilitate
|
||||
access to exposed shell state generally useful to such handlers or
|
||||
meta-commands; or (4) to provide for abnormal shell exits.
|
||||
<p>The shell core .mode and .import implementations also use the same
|
||||
instance of this type to affect result output and import operations.
|
||||
That instance resides in a ShellStateX object kept by the shell so
|
||||
that extension meta-commands can access it, possibly to change it.
|
||||
Meta-commands or handlers which alter this instance for their own
|
||||
purposes (rather than for intended effect) should take care to
|
||||
restore its prior value as the operation completes.
|
||||
|
||||
<h3>extensionDestruct member</h3>
|
||||
<p>The function addressed by this member will be called prior to
|
||||
exit or the extension being unloaded (if the pointer is non-zero.)
|
||||
This is an out parameter from the sqlite3_X_init() function.
|
||||
It may perform any cleanup or deallocations necessitated by
|
||||
successful initialization generally (and will never be called
|
||||
after failed initialization.)
|
||||
|
||||
<h3>Notes Regarding Object Interfaces for C vs C++ Writers</h3>
|
||||
<p>The objects registered with the shell core to provided extension
|
||||
functionality may be implemented in C or C++ (or anything else
|
||||
presenting the same ABI.) In the below descriptions of their
|
||||
interfaces, it should be understood that: C++ implementations
|
||||
need not explicitly deal with anything like a Whatsit_Vtable
|
||||
struct and will refer to the object pointer, passed implicitly,
|
||||
as "this"; and C implementations will need to populate a static
|
||||
Whatsit_Vtable and refer to the initial object pointer as "pThis".
|
||||
<p>All shell extension interfaces have a method, destruct(), which
|
||||
is (or may be) called by the shell core prior to deactivating any
|
||||
registered meta-command, output result or import handler.
|
||||
This call will be made in addition to any automatic (or implicit)
|
||||
takedown that may occur due to atexit() or C++ destructor calls,
|
||||
so destruct()'s responsibility should be limited to reversing
|
||||
the per-registered-object effects of sqlite3_X_init().
|
||||
<p>A registered object is deactivated when either: the extension
|
||||
is immanently going to be unloaded; the registered object is
|
||||
being overridden by some like-named object (such that it can no
|
||||
longer be reached by the core shell); or the shell is about to
|
||||
return or exit.
|
||||
|
||||
<h3>DotCommand typedef</h3>
|
||||
<p>These objects represent an extension meta-command, including a
|
||||
dispatch table for the public interface and any accompanying
|
||||
data (which is opaque to the core shell.) Such objects are created
|
||||
by extensions and passed to the core shell only by reference.
|
||||
They are made known to the shell core via registerDotCommand() calls.
|
||||
|
||||
<h3>DotCommand_Vtable typedef</h3>
|
||||
<p>These objects represent the dispatch table of a DotCommand object.
|
||||
<p>All methods are given the same leading (or lone) argument:<br>
|
||||
(1) the address of the registered DotCommand object.
|
||||
|
||||
<h4>destruct method</h4>
|
||||
<p>This method is called prior to unloading a runtime extension
|
||||
for any registered DotCommand object, provided its dispatch
|
||||
table entry is non-zero.
|
||||
It should free resources allocated during the sqlite3_X_init() call
|
||||
associated with creation or preparation of the object.
|
||||
|
||||
<h4>name method</h4>
|
||||
<p>This method returns the name of the meta-command (sans leading '.'.)
|
||||
The returned pointer must remain valid throughout the lifetime of
|
||||
the registered DotCommand object.
|
||||
|
||||
<h4>help method</h4>
|
||||
<p>This method returns help text for the meta-command. This text
|
||||
should be formatted and aligned with the built-in meta-command
|
||||
help text so that it can be displayed seamlessly.
|
||||
<p>There is one additional argument:<br>
|
||||
(2) a const char * directing what help text to return, with
|
||||
0 indicating primary, single-line help, or
|
||||
&"" indicating more detailed help beyond the primary level, or
|
||||
&"(other)" reserved for expansion.
|
||||
<p>The return for the first 2 forms is either a C string or
|
||||
null pointer. The C string will not be freed by the core shell, and
|
||||
must remain valid during the lifetime of the DotCommand object.
|
||||
|
||||
<h4>argsCheck method</h4>
|
||||
<p>This method returns a DotCmdRC value indicating the validity
|
||||
(or invalidity) of arguments for the meta-command, using the
|
||||
coding scheme defined for the DotCmdRC type.
|
||||
<p>There are three additional arguments:<br>
|
||||
(2) a char** to possibly receive an error message, which the
|
||||
caller must eventually pass to sqlite3_free().<br>
|
||||
(3) a count of all provided arguments; and<br>
|
||||
(4) a char* array of given arguments, led by meta-command's name.
|
||||
|
||||
<h4>execute method</h4>
|
||||
<p>This method performs whatever work the meta-command is supposed
|
||||
to do when invoked. It has 4 additional arguments:<br>
|
||||
(2) present ShellExState, passed by reference (an in/out parameter);<br>
|
||||
(3) an error message pointer, passed by reference, set upon error but
|
||||
otherwise not modified, to be freed by the shell core;<br>
|
||||
(4) the number of invocation arguments; and<br>
|
||||
(5) an array of C strings constituting the invocation arguments;<br>
|
||||
<p>The return is a DotCmdRC value, indicating success, error, or
|
||||
other disposition as documented for the DotCmdRC type.
|
||||
|
||||
<h3>ExportHandler typedef</h3>
|
||||
<p>These objects represent an extension query result handler, including
|
||||
a dispatch table for the public interface and any accompanying
|
||||
data which is opaque to the core shell. Such objects are created
|
||||
by extensions and passed to the core shell only by reference.
|
||||
They are made known to the shell core via registerExporter() calls.
|
||||
|
||||
<h3>ExportHandler_Vtable typedef</h3>
|
||||
<p>These objects represent the dispatch table of an ExportHandler object.
|
||||
All methods in the dispatch table are given at
|
||||
least this leading argument:<br>
|
||||
(1) The ExportHandler address registered via registerExporter();<br>
|
||||
|
||||
<h4>destruct method</h4>
|
||||
<p>This method is called prior to the shell's return or exit or
|
||||
unloading the runtime extension for a registered ExportHandler object,
|
||||
provided its dispatch table entry is non-zero.
|
||||
It should free resources allocated during the sqlite3_X_init() call
|
||||
associated with creation or preparation of the object.
|
||||
|
||||
<h4>name method</h4>
|
||||
<p>This method returns the name of the ExportHandler, which users
|
||||
specify to the .mode command (as the mode's name) to designate use
|
||||
of the registered ExportHandler for subsequent query results.
|
||||
The returned pointer must remain valid throughout the lifetime of
|
||||
the registered ExportHandler object.
|
||||
|
||||
<h4>help method</h4>
|
||||
<p>This method returns help text for the ExportHandler.
|
||||
<p>There is one additional argument:<br>
|
||||
(2) a const char * directing what help text to return, with
|
||||
0 indicating primary, single-line help, or
|
||||
&"" indicating more detailed help beyond the primary level, or
|
||||
&"(other)" reserved for expansion.
|
||||
<p>The primary help is included in the .mode command's own
|
||||
detailed help text, so it should be aligned accordingly.
|
||||
The detailed help is shown by the .mode command's --help option.
|
||||
<p>The return is either a C string or null pointer. The C string
|
||||
will not be freed by the core shell, and must remain valid
|
||||
during the lifetime of the ExportHandler object.
|
||||
|
||||
<h4>Common arguments</h4>
|
||||
<p>The following methods are given these 2 additional arguments:<br>
|
||||
(2) A ShellExState object passed by reference; and<br>
|
||||
(3) An error message pointer, passed by reference, to receive errors.
|
||||
|
||||
<h4>openResultsOutStream method</h4>
|
||||
<p>This method is called when a query output is setup,
|
||||
(via the .mode command with the handler's name given as a --flag.)
|
||||
<p>It is given 3 additional arguments:<br>
|
||||
(4) the number of arguments in the said .mode command;<br>
|
||||
(5) an array of C strings with the said argument values; and<br>
|
||||
(6) the name given as a --flag which caused the handler to be used.
|
||||
<p>When the extension handler is activated via a .mode command,
|
||||
parsing that command and behaving accordingly is the responsibility
|
||||
of this method alone. (The command is parsed and acted upon by the
|
||||
default .mode implementation only when no ExportHandler is used.)
|
||||
<p>Once this method is called and succeeds, it is guaranteed that the
|
||||
closeResultsOutStream method will be called.
|
||||
<p>This method should return SQLITE_OK only upon success.
|
||||
Any other return will abort remaining calls in the handling sequence.
|
||||
|
||||
<h4>prependResultsOut method</h4>
|
||||
<p>This method is called when a query succeeds for which this handler
|
||||
will be given the results. This is purely preparatory; zero or
|
||||
more result rows may follow. It is up to this method to determine
|
||||
if any results can even be had (by considering the return from
|
||||
sqlite3_column_count()) and acting accordingly.
|
||||
<p>It is given 1 additional argument:<br>
|
||||
(4) the query prepared statement (pointer), not yet stepped.
|
||||
<p>This method should return SQLITE_OK only upon success.
|
||||
Any other return will abort the next 2 calls in the handling sequence.
|
||||
(TBD: Such aborts without error should be supported for DDL and DML.)
|
||||
|
||||
<h4>rowResultsOut method</h4>
|
||||
<p>This method is called when a query's prepared statement is stepped,
|
||||
for each result row available.
|
||||
<p>It is given 1 additional argument:<br>
|
||||
(4) the query prepared statement (pointer), stepped with
|
||||
a result row available. It is permitted for this method to
|
||||
perform the remaining stepping, as indicated by the return.
|
||||
<p>This method should return SQLITE_OK only upon success
|
||||
without having completed stepping. If this method completes stepping,
|
||||
(by making its own calls to sqlite3_step() until it returns SQLITE_DONE),
|
||||
it must return SQLITE_DONE. Any other return will avoid the next call
|
||||
in the handling sequence.
|
||||
|
||||
<h4>appendResultsOut method</h4>
|
||||
<p>This method is called when result set stepping has been completed.
|
||||
<p>It is given additional argument:<br>
|
||||
(4) the query prepared statement (pointer), completely stepped.
|
||||
<p>This method should return SQLITE_OK upon success, or may return
|
||||
something else to indicate error with no effect upon succeeding calls.
|
||||
|
||||
<h4>closeResultsOutStream method</h4>
|
||||
<p>This method is called when a new .mode command is invoked specifying
|
||||
some output mode not using this ExportHandler or when the extension
|
||||
is about to be unloaded with this ExportHandler selected for output.
|
||||
It should free resources allocated or held as a result of the
|
||||
previous openResultsOutStream call.
|
||||
|
||||
<h3>ImportHandler typedef</h3>
|
||||
<p>These objects represent an extension data import handler, including
|
||||
a dispatch table for the public interface and any accompanying
|
||||
data which is opaque to the core shell. Such objects are created
|
||||
by extensions and passed to the core shell only by reference.
|
||||
They are made known to the shell core via registerImporter() calls.
|
||||
|
||||
<h3>ImportHandler_Vtable typedef</h3>
|
||||
<p>These objects represent the dispatch table of an ImportHandler object.
|
||||
All methods in the dispatch table are given this 1 leading argument:<br>
|
||||
(1) The ImportHandler address registered via registerImporter().
|
||||
|
||||
<h4>destruct method</h4>
|
||||
<p>This method is called prior to the shell's return or exit or
|
||||
unloading the runtime extension for a registered ImportHandler object,
|
||||
provided its dispatch table entry is non-zero.
|
||||
It should free resources allocated during the sqlite3_X_init() call
|
||||
associated with creation or preparation of the object.
|
||||
|
||||
<h4>name method</h4>
|
||||
<p>This method returns the name of the importer, which is to
|
||||
be passed with leading '--' (or '-') to the .import command
|
||||
to specify use of the registered importer for that invocation.
|
||||
The returned pointer must remain valid throughout the lifetime of
|
||||
the registered ImportHandler object.
|
||||
|
||||
<h4>help method</h4>
|
||||
<p>This method returns help text for the ImportHandler.
|
||||
<p>There is one additional argument:<br>
|
||||
(2) a const char * directing what help text to return, with
|
||||
0 indicating primary, single-line help, or
|
||||
&"" indicating more detailed help beyond the primary level, or
|
||||
&"(other)" reserved for expansion.
|
||||
<p>The primary help is included in the .import command's own
|
||||
detailed help text, so it should be aligned accordingly.
|
||||
The detailed help is shown by the .import command's --help option.
|
||||
<p>The return is either a C string or null pointer. The C string
|
||||
will not be freed by the core shell, and must remain valid
|
||||
during the lifetime of the ImportHandler object.
|
||||
|
||||
<h4>Common arguments</h4>
|
||||
<p>The following methods are given these 2 additional arguments:<br>
|
||||
(2) A ShellExState object passed by reference; and<br>
|
||||
(3) An error message pointer, passed by reference, to receive errors.
|
||||
|
||||
<h4>openDataInStream method</h4>
|
||||
<p>This method is called when a .import command is invoked with
|
||||
the '--' (or '-') prefixed name of the ImportHandler as an argument.
|
||||
<p>These 3 additional arguments are passed:<br>
|
||||
(4) the number of arguments to said .import command;<br>
|
||||
(5) an array of C strings with the said argument values; and<br>
|
||||
(6) the name of the ImportHandler (as its name method would return.)
|
||||
<p>When the extension handler is activated via a .import command,
|
||||
responsibility for parsing that command and behaving accordingly is
|
||||
shared between the shell core .import implementation and this method.
|
||||
The shell core normally takes the last argument as the name of a table
|
||||
(to be created if necessary) which will receive the imported data.
|
||||
(But see return values for exceptions to this treatment.)
|
||||
The shell core also detects any --flag argument selecting a registered
|
||||
ImportHandler (giving effect to the last one) and calls this and
|
||||
following methods to perform the input part of the import operation.
|
||||
This method may interpret any or all of the arguments as needed
|
||||
and (supposedly) documented by the associated help(...) method returns.
|
||||
<p>Once this method is called and succeeds, it is guaranteed that the
|
||||
closeDataInStream method will be called.
|
||||
<p>This method should return SQLITE_OK upon success where disposition
|
||||
of the imported data (into a table named by the last argument) is
|
||||
to be handled normally, by the shell core.
|
||||
An alternative success return is SQLITE_DONE, indicating that
|
||||
disposition of the imported data has been done by the ImportHandler.
|
||||
In that case, the next 3 methods (*DataInput(...)) will not be called
|
||||
and this method should have completed the whole import operation.
|
||||
After a success return, closeDataInStream is guaranteed to be called.
|
||||
Other returns will abort all remaining calls in the handling sequence.
|
||||
|
||||
<h4>prepareDataInput method</h4>
|
||||
<p>This method prepares for the particular import operation commenced
|
||||
with a .import invocation. It may take into account the shape of
|
||||
the input data (and possibly its type) as discovered during the call.
|
||||
<p>This 1 additional argument is passed:<br>
|
||||
(4) a to-be-prepared statement (pointer), passed by reference.
|
||||
This is an out parameter conveying a prepared statement created
|
||||
by this method specifically for the single import operation.
|
||||
<p>The prepared statement should, in some manner wholly determined
|
||||
by the extension handler, incorporate compiled SQL (possibly with
|
||||
as-yet unbound parameters) which will (or may) produce a result set.
|
||||
(This may be no more than a query such as "SELECT @1 as one, ...",
|
||||
or could be a SELECT from a temporary table used for buffering.)
|
||||
<p>The return should be SQLITE_OK upon success, in which case the
|
||||
following 2 methods will also be called. Any other return will
|
||||
abort the {prepare,row,finish}DataInput() call sequence. In that
|
||||
case, no prepared statement should be returned either.
|
||||
|
||||
<h4>rowDataInput method</h4>
|
||||
<p>This method is called to collect imported data, making it available
|
||||
through the prepared statement passed as the last argument with as
|
||||
many steps as are needed to get SQLITE_DONE from sqlite3_step().
|
||||
It will be called repeatedly until its return indicates no more data.
|
||||
<p>It is given 1 additional argument:<br>
|
||||
(4) the prepared statement (pointer) returned by prepareDataInput().<br>
|
||||
This prepared statement can have values bound to it or be reset as
|
||||
necessary to return some or more data. However, it must remain the
|
||||
same sqlite3_statement instance returned by prepareDataInput().
|
||||
<p>The return should be SQLITE_DONE when no more data is available,
|
||||
or SQLITE_ROW to indicate that more data is or might be available.
|
||||
Any other return (including SQLITE_OK) indicates a condition which
|
||||
will abort the data collection phase of the import operation. Any
|
||||
of those 3 returns is treated as success by the shell core.
|
||||
|
||||
<h4>finishDataInput method</h4>
|
||||
<p>This method is called to complete the data input phase of the
|
||||
import operation commenced by prepareDataInput().
|
||||
<p>It is given 1 additional argument:<br>
|
||||
(4) the prepared statement (pointer) returned by prepareDataInput().<br>
|
||||
This prepared statement should be finalized by this method. Other
|
||||
cleanup or import wrap-up related to the transfer may also be performed.
|
||||
|
||||
<h4>closeDataInStream method</h4>
|
||||
<p>This method is called as a .import command which specified this
|
||||
ImportHandler completes.
|
||||
It should free resources allocated or held as a result of the
|
||||
previous openDataInStream call.
|
||||
|
||||
<h3>ScriptSupport typedef</h3>
|
||||
<p>An object of this type is passed by an extension to registerScripting()
|
||||
to enable the shell core to gain scripting functionality provided by
|
||||
the extension.
|
||||
<p>All methods in the dispatch table have this 1 leading argument:<br>
|
||||
(1) The object address registered via registerScripting().
|
||||
<p>The object's v-table contains these methods:
|
||||
|
||||
<h4>destruct method</h4>
|
||||
<p>This method is called prior to the shell's return or exit or unloading
|
||||
the runtime extension, provided its dispatch table entry is non-zero.
|
||||
It should free resources allocated during the sqlite3_X_init() call
|
||||
associated with creation or preparation of the object.
|
||||
|
||||
<h4>name</h4>
|
||||
<p>This method returns the name of the ScriptSupport object.
|
||||
There is no presently planned scheme for using this to switch among
|
||||
scripting providers or even to identify one that is loaded.
|
||||
|
||||
<h4>help</h4>
|
||||
<p>This method returns help text for the ExportHandler.
|
||||
There is no presently implemented use for this method's return.
|
||||
<p>There is one additional argument:<br>
|
||||
(2) a const char * directing what help text to return.
|
||||
|
||||
<h4>configure</h4>
|
||||
<p>This method allows load-time configuration of the extension.
|
||||
It returns a DotCmdRC code indicating status of the extension
|
||||
load and subsequent configuration.
|
||||
It has these 4 additional arguments:<br>
|
||||
(2) ShellExState reference, for general use by the extension;<br>
|
||||
(3) A char ** for an error message associated with configuration;<br>
|
||||
(4) Count of arguments passed in next parameter; and<br>
|
||||
(5) A char * array of arguments passed in the .shxload command tail.
|
||||
|
||||
<h4>isScriptLeader</h4>
|
||||
<p>This method returns TRUE if the provided line text should be
|
||||
considered part of an input line group to be handled by the extension
|
||||
(rather than being treated as a dot-command or SQL), otherwise FALSE.
|
||||
There is one additional argument:<br>
|
||||
(2) char * zLineLead, the initial line of a shell input group.
|
||||
|
||||
<h4>scriptIsComplete</h4>
|
||||
<p>This method returns TRUE if the provided line group text should be
|
||||
considered ready to execute, otherwise FALSE.
|
||||
There are two additional arguments:<br>
|
||||
(2) char * zScript, the possibly ready-to-exectue text; and<br>
|
||||
(3) char ** pzWhyNot, for possibly saying why it is not ready.
|
||||
|
||||
<h4>resetCompletionScan</h4>
|
||||
<p>This method is called by the shell, with no additional arguments,
|
||||
to (possibly) restore the extension's input line scanning state.
|
||||
It has no return.
|
||||
|
||||
<h4>runScript</h4>
|
||||
<p>This method executes the provided script text, returning a
|
||||
DotCmdRC value to indicate success, error, or other dispositions.
|
||||
It has three additional arguments:<br>
|
||||
(2) char * zScript, the to-be-executed text;<br>
|
||||
(3) ShellExState *, (same struct as is passed to configure); and<br>
|
||||
(4) A char ** for an error message associated with the execution.
|
||||
|
||||
<h3>ShellExtensionLink typedef</h3>
|
||||
<p>An object of this type is passed (somewhat indirectly) to the
|
||||
sqlite3_X_init(...) function which is called when a runtime
|
||||
extension is loaded via a .load command with a --shell flag.
|
||||
It is used to establish linkage between the loaded extension
|
||||
and a shell core API exposed specifically for extensibility.
|
||||
<p>At present, the extension API is limited to registration of
|
||||
meta-commands, query result handlers, import handlers, and
|
||||
scripting support implemented by extensions. This API may be
|
||||
extended in future versions of the core shell, in a backwards-
|
||||
compatible manner.
|
||||
(See the pExtra sentinel, whose offset may increase.)
|
||||
|
||||
<h4>Establishing Shell/Extension Linkage</h4>
|
||||
<p>An extension's sqlite3_X_init() function is called soon after
|
||||
the extension is dynamically loaded. It may obtain a pointer
|
||||
to the ShellExtensionLink object by the following means. (Or,
|
||||
without reference to that object, it can do nothing useful.)
|
||||
<p>During extension build, a macro provided by shext_linkage.h,
|
||||
SHDB_TO_SHEXTLINK(link_function_name), is used to define a
|
||||
function named per its argument. This function accepts a
|
||||
sqlite3 *, as passed into sqlite3_X_init(db, ...), and reads
|
||||
that DB to retrieve the address of a ShellExtensionLink object,
|
||||
which it returns. (Or, it returns NULL if somebody has loaded
|
||||
the extension erroneously using the .load meta-command.)
|
||||
<p>The sqlite3_X_init() function may call this macro-written
|
||||
function to obtain a reference to a ShellExtensionLink object
|
||||
which will remain valid while the extension is loaded.
|
||||
|
||||
<h2>Development Aspects of Extensibility and Its Evolution</h2>
|
||||
|
||||
<p>There is critical tension between competing uses of the ShellState
|
||||
object which is kept and used by the core shell for state which
|
||||
must persist between meta-command invocations. For unhindered
|
||||
implementation and feature expansion flexibility, the structure
|
||||
of the ShellState data should be unconstrained across versions
|
||||
of the shell. However, unless extension meta-commands and data
|
||||
transferers are to act entirely independently of built-in meta-commands,
|
||||
(excepting interaction through the above-described extension methods),
|
||||
some portion of the ShellState data needs to be shared in a stable
|
||||
manner between extensions and the core shell code.
|
||||
<p>With respect to interface stability concerns, it is nearly immaterial
|
||||
whether the sharing occurs through exposed data structures
|
||||
or an extension API devised to convey similar data. (Only data layout
|
||||
and possible change notification are at stake in that choice.)
|
||||
<p>For simplicity, and because it can work in a way consistent with how
|
||||
built-in shell features are implemented now, the chosen sharing method
|
||||
is to simply directly expose a subset of the ShellState data. That
|
||||
subset will be extremely limited to minimize hinderance of what has
|
||||
previously been unfettered change to that data structure/meaning.
|
||||
It will initially be: the present output stream, as affected by
|
||||
.output and .once commands; the currently open user DB (if any);
|
||||
the dedicated shell DB; and the data related to formatting
|
||||
and transfer of data in external forms. This data resides in the
|
||||
ShellStateX object as a ShellExState struct.
|
||||
<p>As shell extensibility evolves, additional data items may need to
|
||||
move into the publicly exposed portion of the ShellStateX object,
|
||||
either directly (via exposed data members) or by means of additional
|
||||
extension APIs defined in the ShellExtensionLink object (which has
|
||||
been defined to accommodate growth of its function pointer list in
|
||||
a backwards-compatible manner.)
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Executable
+431
@@ -0,0 +1,431 @@
|
||||
# Introduction to the TCL Extension for the SQLite Extensible Shell #
|
||||
|
||||
This article introduces an extension,
|
||||
written to be hosted by the SQLite Extensible Shell,
|
||||
which adds [Tcl](https://www.tcl.tk/about/index.html) features to it.
|
||||
|
||||
## Motivation ##
|
||||
|
||||
An understanding of the motivation for this feature may prove useful
|
||||
for putting what follows into context.
|
||||
Over its 2+ decade existence, the sqlite3 CLI shell has evolved,
|
||||
from its original utility as a test vehicle for the SQLite library,
|
||||
to a tool used by many people who want to use SQLite databases
|
||||
without writing a specialized application. While the shell exposes
|
||||
many of the library features, its original design was best suited
|
||||
for performing short, fixed sequences of DB operations.
|
||||
|
||||
Effecting more complex, algorithmically determined operations
|
||||
can be difficult,
|
||||
usually requiring use of a general purpose scripting tool
|
||||
to drive the sqlite3 shell.
|
||||
This can work well where the task can be decomposed into
|
||||
"Prepare a sequence of elementary DB operations,"
|
||||
followed by
|
||||
"then feed the sequence into sqlite3 as its command/SQL input."
|
||||
However, where the task requires multiple such steps,
|
||||
with sqlite3 either being run multiple times or
|
||||
being made to engage in two-way communication with a driving process,
|
||||
getting the combination to work as intended can be tedious and tricky.
|
||||
|
||||
Those difficulties are enough to make one wish for a better way
|
||||
to drive the tool, and to muse: If only there was a "Tool Command Language".
|
||||
Fortunately, there is; it is known as "Tcl".
|
||||
The sqlite3 shell is a tool, in need of being flexibly commanded,
|
||||
and Tcl is more than adequate for that purpose, as will be shown.
|
||||
|
||||
Not to be overlooked is that SQLite itself originated as a
|
||||
library for Tcl, and that its integration with Tcl makes it both
|
||||
powerful and easy to use in Tcl programs.
|
||||
In fact, Tcl with SQLite can be a very good substitute for
|
||||
ad hoc combinations of general purpose scripting tools with the SQLite shell,
|
||||
and has been
|
||||
[since year 2000](https://www.sqlite.org/src/timeline?c=2000-05-29+14:26:00).
|
||||
|
||||
Beyond the utility of [Tcl with SQLite](https://www.tcl.tk/about/uses.html),
|
||||
SQLite (the shell) with Tcl has virtues of its own.
|
||||
These include instrumentation,
|
||||
query plan display, ready-to-use data import and export features,
|
||||
among others familiar to sqlite3 shell users.
|
||||
|
||||
## Basics, Terminology and Getting Started ##
|
||||
|
||||
A variant of the SQLite shell can be built, called "sqlite3x" here,
|
||||
whose long name is "The SQLite Extensible Shell".
|
||||
It may be built on Unix-like systems by running "make sqlite3x".
|
||||
On Windows systems, using MSVC, with suitable environment setup,
|
||||
it may be built by running "nmake -f Makefile.msc sqlite3x.exe".
|
||||
|
||||
The Tcl extension for sqlite3x, called "tclshext" here,
|
||||
may be built from the top directory of a SQLite project checkout.
|
||||
(See [Obtaining Code ...](https://sqlite.org/getthecode.html#obtaining_code_directly_from_the_version_control_system).)
|
||||
|
||||
Build the extension for Unix-like systems,
|
||||
after configure is run with a "--enable-tcl" option
|
||||
(and a "--with-tcl=..." option if necessary),
|
||||
by invoking make with "tcl_shell_extension" as a target.
|
||||
On Windows systems, using MSVC, with nmake variables TCLDIR and TCLSUFFIX set
|
||||
appropriately, it may be built by running
|
||||
"nmake -f Makefile.msc tcl_shell_extension".
|
||||
|
||||
It may be necessary to first install the Tcl development package or library
|
||||
in order for configure to find the Tcl interpreter
|
||||
and specify how to locate it as a library to be linked with the extension.
|
||||
|
||||
To manually get a Tcl-extended-shell started,
|
||||
(assuming the above-mentioned images were built and have
|
||||
been placed where the shell and OS loader can find them [^ loader ]),
|
||||
either of these inputs is needed:<br>
|
||||
```
|
||||
From a running shell:
|
||||
sqlite3x
|
||||
.shxload tclshext
|
||||
or
|
||||
At shell invocation:
|
||||
sqlite3x -cmd ".shxload tclshext"
|
||||
```
|
||||
[^loader]: A directory path may need to be prepended to the extension's
|
||||
name for the OS loader to find it unless it is in one of the locations
|
||||
designated to the loader as a candidate for dynamic libraries. How such
|
||||
designation is made is beyond the scope of this introduction.
|
||||
|
||||
Provided this results in another prompt without any error message(s),
|
||||
the Tcl-extended shell is ready to go.
|
||||
For brevity, the shell in this state will be called "sqlite3xt".
|
||||
|
||||
## Yet Another Prompt -- Now What? ##
|
||||
|
||||
When sqlite3xt is ready for input, it acts very much like the sqlite3 shell.
|
||||
(^ The sqlite3x shell passes a test suite which is substantially
|
||||
identical to that used for the traditional shell, differing only
|
||||
in the content and format of error messages.)
|
||||
When given sensible inputs (as discussed below in "Parsing"),
|
||||
that are recognized by and valid for the sqlite3 shell,
|
||||
the same outputs and effects will occur as would with sqlite3.
|
||||
This condition,
|
||||
where SQL and dot commands recognized by sqlite3 may be input
|
||||
and acted upon as sqlite3 would,
|
||||
is referred to below as the "shell execution environment".
|
||||
For sqlite3xt, that is just the beginning.
|
||||
|
||||
## Execution Environments and Input Parsing Changes ##
|
||||
|
||||
The effect of loading tclshext can be briefly summarized as
|
||||
the introduction of an alternative "execution environment",
|
||||
together with a way of entering and leaving it,
|
||||
explication of which follows this on the primary "execution environment":
|
||||
|
||||
### Shell execution environment ###
|
||||
|
||||
The "shell execution environment", in effect upon sqlite3xt startup,
|
||||
has these characteristics pertinent here:
|
||||
|
||||
* The leading non-whitespace token of an input line group
|
||||
is interpreted as a dot command if it begins with a single '.';
|
||||
|
||||
* if that token is nothing but a '.', the line is a no-op;
|
||||
|
||||
* or, if it begins with anything but a '.', it is collected as SQL,
|
||||
until terminated with ';', '/' or 'go',
|
||||
then submitted to the SQL execution (prepare/step) engine.
|
||||
|
||||
* or, if it begins with '#', it is ignored (as a comment).
|
||||
|
||||
* Whitespace-delimited arguments after the leading token
|
||||
are parsed according to the section on "Dot-command arguments"
|
||||
[here](https://sqlite.org/cli.html#rules_for_dot_commands_sql_and_more),
|
||||
with exceptions as noted next.
|
||||
|
||||
The main exception to legacy argument parsing is that open quote
|
||||
constructs are not auto-closed by the end of an input line.
|
||||
(This legacy behavior may be reinstated if desired by: entering
|
||||
".shxopts -parsing" at the prompt; renaming the sqlite3x image
|
||||
to sqlite3 before executing it; or invoking it with the option
|
||||
pair '-shxopt' '0'.)
|
||||
Instead, arguments are collected, potentially across multiple lines,
|
||||
until an input line ends outside of any open quote construct.
|
||||
(Input which does not depend on the legacy, auto-close-on-newline
|
||||
behavior is what the term "sensible inputs" means as used above.)
|
||||
For example, this would not be sensible input to sqlite3:<br>
|
||||
```
|
||||
.print 'Hello.
|
||||
This was entered as multi-line input.'
|
||||
```
|
||||
as it would result in an error, (malformed SQL), while this input:<br>
|
||||
```
|
||||
.print "I'm not fond of closing my quotations.
|
||||
```
|
||||
is acceptable to sqlite3, but deemed "not sensible" here.
|
||||
When either is input to sqlite3x, a continuation prompt will be issued
|
||||
(in interactive mode) and the rest of the multi-line input
|
||||
will be taken as part of the .print dot-command.
|
||||
|
||||
Of course, this is (mostly) review to those familiar with the sqlite3 shell.
|
||||
|
||||
### Tcl execution environment ###
|
||||
|
||||
The "Tcl execution environment" differs in several important ways
|
||||
from the familiar execution environment describe above.
|
||||
How to get into this alternative execution environment is described later.
|
||||
|
||||
In this alternative execution environment, these critical differences exist:
|
||||
|
||||
* An expanded set of command words is available and readily expanded further.
|
||||
|
||||
* The available command words generally do not begin with '.'.
|
||||
(^In the Tcl execution environment, enter
|
||||
"info commands" to see the available command words.)
|
||||
|
||||
* When in interactive mode, commands whose
|
||||
initial token is not defined as a Tcl command,
|
||||
but which can be found as an executable
|
||||
in a directory named in the PATH environment variable,
|
||||
will be executed in a sub-process
|
||||
(unless blocked by Tcl global variable auto_noexec having been set.)
|
||||
|
||||
* The command word and arguments are collected,
|
||||
parsed and expanded according to the usual
|
||||
[rules for the Tcl language](https://www.tcl.tk/about/language.html).
|
||||
In particular, input line groups are collected until deemed "complete"
|
||||
by the Tcl parser. This means no open brace, quote or bracket constructs.
|
||||
|
||||
* New [command words can be readily defined]
|
||||
(https://www.tcl.tk/man/tcl8.6/TclCmd/proc.html),
|
||||
and [variables can be set](https://www.tcl.tk/man/tcl8.6/TclCmd/set.html),
|
||||
either of which may affect argument expansion
|
||||
per the usual Tcl rules.
|
||||
|
||||
This environment will be familiar to those who use Tcl.
|
||||
There are a few differences however. These are:<br>
|
||||
|
||||
* A single '.' on an input line which is not inside of an incomplete
|
||||
Tcl line group is treated as a (momentary) end-of-input by the REPL.
|
||||
(^ "REPL" is an acronym for "Read, Evaluate, Print Loop".)
|
||||
|
||||
* The shell's dot commands, while not visible via \[info commands\],
|
||||
are discoverable by the "unknown" command and will be executed
|
||||
if their names (with the '.' prefix) would be found and resolved
|
||||
unambiguously in the shell execution environment.
|
||||
Commands whose names begin with '.' which are not found as unique in the
|
||||
shell execution environment produce an "invalid command name" error.
|
||||
Except for that treatment, the unknown command in effect
|
||||
acts like the standard Tcl version.
|
||||
(That standard version remains available as _original_unkown,
|
||||
to which handling of non-dot-prefixed commands is delegated.)
|
||||
|
||||
* A few non-standard-Tcl commands are available. In particular:
|
||||
|
||||
+ Commands udb and shdb act nearly like commands creatable
|
||||
by the "sqlite3" Tcl package to represent an open database. They
|
||||
differ in that they do not accept the "close" subcommand, which
|
||||
reflects the fact that they exist to allow the shell's current
|
||||
user database and the shell's own database to be accessed just
|
||||
like ones created in Tcl via "sqlite3 someDbName itsFilename".
|
||||
|
||||
+ Commands sqlite_shell_REPL, get_tcl_group and now_interactive
|
||||
permit input to be collected in the same manner (and from the same
|
||||
sources) as the shell's REPL does. Here, "collected in the same manner"
|
||||
does not include the execution environment switching or SQL execution
|
||||
that the shell execution environment implements.
|
||||
|
||||
+ Command register_adhoc_command permits a newly (or oldly) defined
|
||||
Tcl command, likely with a leading '.' in its name, to be associated
|
||||
by name with some help text in a table kept by the shell
|
||||
for augmentation of its .help facility.
|
||||
In this way, the .help command can emit help
|
||||
text, in summary or long forms, for Tcl commands that might be
|
||||
executable from the shell execution environment.
|
||||
(More on this below.)
|
||||
|
||||
+ Finally, the command ".." (sans quotes) exists for reasons made
|
||||
evident below. With no arguments,
|
||||
it does nothing, quietly and successfully, with the empty result.
|
||||
|
||||
* The present implementation does not run the event loop processing
|
||||
that the standard Tcl REPL uses to support certain functionality
|
||||
(such as sockets, asynchronous I/O and the Tk GUI subsystem.)
|
||||
A future enhancement is to support use of event loop and Tk.
|
||||
|
||||
## Switching Execution Environments ##
|
||||
|
||||
The simplest execution environment switching
|
||||
is effected with lone dots and dot pairs.
|
||||
Some examples should make this clear. For now, focus on "." or ".."
|
||||
entered on a line by itself.
|
||||
(The # comments are not required. The leading prompts reflect
|
||||
what would be seen in interactive use; they are not to be typed either.)<br>
|
||||
```
|
||||
sqlite> # Now in shell execution environment, but it is time to do Tcl stuff.
|
||||
sqlite> ..
|
||||
tcl% # Now in Tcl execution environment, ready to roll a trivial dot command.
|
||||
tcl% proc .do {what} {
|
||||
> .eval $what
|
||||
> }
|
||||
tcl% register_adhoc_command {.do Does whatever one thing it is told to do
|
||||
> from the shell execution environment and little else}
|
||||
tcl% # Time to return to shell execution environment.
|
||||
tcl% .
|
||||
sqlite> # See how ad hoc command creation worked.
|
||||
sqlite> .help do
|
||||
.do Does whatever one thing it is told to do
|
||||
from the shell execution environment and little else
|
||||
sqlite> .do .conn
|
||||
ACTIVE 0: :memory:
|
||||
sqlite> .do ".. puts Putting"
|
||||
Putting
|
||||
sqlite> # Be sure about being in shell execution environment.
|
||||
sqlite> .
|
||||
sqlite> # Oh, the prompt would have sufficed. Now, for some Tcl ...
|
||||
sqlite> ..
|
||||
tcl% # Let's see what that .. command does.
|
||||
tcl% ..
|
||||
tcl% # Apparently, it either gets to the Tcl environment or stays there.
|
||||
```
|
||||
|
||||
The use of lone . and .. to switch environments is easiest to understand.
|
||||
However, as explained in the next section,
|
||||
use of .. not alone on an input line exploits other Tcl functionality.
|
||||
|
||||
Another effect of loading tclshext is that a new dot command, .tcl ,
|
||||
becomes part of the shell's repertoire.
|
||||
When entered without any argument(s)
|
||||
from the shell execution environment,
|
||||
the .tcl command has the same effect as .. by itself.
|
||||
(^When run from the Tcl execution environment with no arguments,
|
||||
.tcl acts as a no-op rather than entering a recursive REPL.)
|
||||
With arguments, it will read file content into the Tcl interpreter
|
||||
just as Tcl's source command would.
|
||||
This may be useful for getting the Tcl execution environment
|
||||
customized via sqlite3x invocation options such as
|
||||
"'-cmd' '.tcl my_sqlite3xt_init.tcl'"
|
||||
|
||||
A side benefit of the .tcl command's existence is that
|
||||
it appears in .help output, which can remind users how
|
||||
to use the extension's main feature.
|
||||
|
||||
## Momentary Use of Tcl Execution Environment ##
|
||||
|
||||
When .. is not the sole non-whitespace content of an input line group
|
||||
which has been submitted from the shell execution environment,
|
||||
that causes argument collection and expansion to be performed
|
||||
according to Tcl rules by the Tcl interpreter,
|
||||
without entering and staying in the Tcl execution environment.
|
||||
These two variations exist (where "..." stands for the provided argument set):
|
||||
```
|
||||
sqlite> ..dotcmd ...
|
||||
or
|
||||
sqlite> .. tclcmd ...
|
||||
```
|
||||
The former, where no space separates .. from dotcmd, causes the
|
||||
dot command known as .dotcmd to be executed (if it can be found.)
|
||||
The latter, where space separates .. from tclcmd, causes the
|
||||
Tcl command known as tclcmd to be executed (if it can be found.)
|
||||
In either case, when the execution terminates (or fails with a
|
||||
"command does not yet exist" or "invalid command name" error),
|
||||
the shell execution environment remains in effect afterward.
|
||||
|
||||
This temporary use of the Tcl interpreter serves two purposes.
|
||||
One is to exploit the more powerful capabilities of Tcl for argument processing.
|
||||
Within the text of arguments as provided,
|
||||
variables can be accessed, computations can be done,
|
||||
and Tcl commands can be invoked to yield results (or produce side effects),
|
||||
all of which can affect what the expanded arguments finally contain.
|
||||
The other (miniscule) effect is to avoid the need for extra
|
||||
input lines to switch to the Tcl execution environment and back
|
||||
when "one-shot" use of Tcl is all that is needed.
|
||||
In other words:<br>
|
||||
```
|
||||
..dotcmd whatever ...
|
||||
acts as a shorter form of
|
||||
..
|
||||
.dotcmd whatever ...
|
||||
.
|
||||
```
|
||||
|
||||
Whenever '..' leads an input line group
|
||||
submitted in the shell execution environment,
|
||||
then most of that input is given to the Tcl interpreter for
|
||||
processing on a one-shot basis.
|
||||
|
||||
## Cross-Execution Environment Interactions ##
|
||||
|
||||
Study of the above examples might give rise to these questions:<br>
|
||||
"How can '..dotcmd ...' work in the Tcl execution environment?"<br>
|
||||
and<br>
|
||||
"Why does '.do anything' work in the shell execution environment?"<br>
|
||||
There are two features at work behind those examples working:
|
||||
|
||||
In the Tcl execution environment, (as touched upon above),
|
||||
when a prospective Tcl command is not found to be defined
|
||||
in the namespace(s) searched by the interpreter, it is
|
||||
passed to the Tcl command named "unknown".
|
||||
In the tclshext-augmented Tcl environment,
|
||||
that procedure is implemented by C code which treats
|
||||
a purported command with a leading '.' specially,
|
||||
by attempting to find it in the shell's repertoire of dot commands.
|
||||
If found (unambiguously), it is then executed
|
||||
and the result (such as it is) returned to the caller.
|
||||
(The sqlite3 shell dot-commands return the empty result on success.)
|
||||
So, assuming there is a dot command invokable as .dotcmd,
|
||||
(which there could be if another extension provided it),
|
||||
it can be found and executed from the Tcl execution environment
|
||||
with arguments as collected and expanded by the Tcl interpreter.
|
||||
|
||||
In the shell execution environment, if any extensions have been
|
||||
loaded when a prospective dot command is not found in the
|
||||
existing repertoire of dot commands kept by the shell,
|
||||
the shell's dispatcher gives the (undocumented) .unknown
|
||||
dot command a chance to execute it. This has no chance
|
||||
of succeeding unless some extension has overridden the
|
||||
built-in .unknown implementation. However, tclshext does
|
||||
override it, and the replacement attempts to find any
|
||||
dot command name it is given in the Tcl root namespace.
|
||||
If it can be found, (such as will be true for the above
|
||||
example invoking .do from the shell execution environment),
|
||||
then that command is executed as a Tcl command
|
||||
with whatever arguments were passed to .unknown .
|
||||
|
||||
Because of how this works, there is not often any reason or need to
|
||||
leave the Tcl execution environment. Dot commands and Tcl commands
|
||||
can be freely intermixed and executed in that environment. The main
|
||||
reason one might revert to the shell execution environment would
|
||||
be to evaluate SQL statements in the usual, sqlite3 way, (by just
|
||||
typing them followed by ";".) However, SQL can be evaluated without
|
||||
leaving the Tcl execution environment by use of the recently added
|
||||
dot command, .eval, which evaluates its arguments in the shell
|
||||
execution environment. For example:<br>
|
||||
```
|
||||
tcl% .mode box
|
||||
tcl% .eval {
|
||||
> .print "Let's have a one,"
|
||||
> select 1 as one;
|
||||
> } {
|
||||
> .print "and a two."
|
||||
> select 2 as two;
|
||||
> }
|
||||
Let's have a one,
|
||||
┌─────┐
|
||||
│ one │
|
||||
├─────┤
|
||||
│ 1 │
|
||||
└─────┘
|
||||
and a two.
|
||||
┌─────┐
|
||||
│ two │
|
||||
├─────┤
|
||||
│ 2 │
|
||||
└─────┘
|
||||
tcl%
|
||||
```
|
||||
|
||||
It should be noted, for those new to Tcl, that brace-quoting in Tcl
|
||||
means "Whatever is between these matching braces is the (single) value."
|
||||
It can be used for nearly any content, excepting explicit mismatched braces.
|
||||
|
||||
## Summary, More to Come ##
|
||||
|
||||
The Tcl extension should prove useful to those who like the features
|
||||
of the sqlite3 shell but find using it programmatically to be challenging.
|
||||
|
||||
A future article will cover using Tk, a graphical user interface
|
||||
toolkit originally created for use with Tcl, with sqlite3xt.
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
+1
-1
@@ -93,7 +93,7 @@ SQLITE_EXTENSION_INIT1
|
||||
# include <utime.h>
|
||||
# include <sys/time.h>
|
||||
#else
|
||||
# include "windows.h"
|
||||
# include <windows.h>
|
||||
# include <io.h>
|
||||
# include <direct.h>
|
||||
# include "test_windirent.h"
|
||||
|
||||
Executable
+1316
File diff suppressed because it is too large
Load Diff
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
@@ -535,6 +535,7 @@ FUZZSRC += $(TOP)/ext/recover/sqlite3recover.c
|
||||
DBFUZZ_OPT =
|
||||
KV_OPT = -DSQLITE_THREADSAFE=0 -DSQLITE_DIRECT_OVERFLOW_READ
|
||||
ST_OPT = -DSQLITE_THREADSAFE=0
|
||||
SHELL_OPT_NOEXT = $(SHELL_OPT) -DSHELL_OMIT_EXTENSIONS=7
|
||||
|
||||
# This is the default Makefile target. The objects listed here
|
||||
# are what get build when you type just "make" with no arguments.
|
||||
@@ -546,6 +547,10 @@ libsqlite3.a: sqlite3.h $(LIBOBJ)
|
||||
$(RANLIB) libsqlite3.a
|
||||
|
||||
sqlite3$(EXE): sqlite3.h libsqlite3.a shell.c
|
||||
$(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) $(SHELL_OPT_NOEXT) \
|
||||
shell.c libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB)
|
||||
|
||||
sqlite3x$(EXE): sqlite3.h libsqlite3.a shell.c
|
||||
$(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) $(SHELL_OPT) \
|
||||
shell.c libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB)
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
C Fix\sharmless\scompiler\swarnings\sabout\sunused\sfunction\sarguments.
|
||||
D 2023-06-29T17:48:32.337
|
||||
C Eliminate\sa\sredundant\sNK_DbAboutToClose\snotification.
|
||||
D 2023-09-02T22:07:23.573
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
F Makefile.in 0f4cb3955aaff8a40ec3857ba1784bd98b69802e51eff979f874b65713b627b2
|
||||
F Makefile.in dcc5b1491fff94b9a8f16f00714ed6a6c886d853970d0cd4a4066296063e96fd x
|
||||
F Makefile.linux-gcc f609543700659711fbd230eced1f01353117621dccae7b9fb70daa64236c5241
|
||||
F Makefile.msc 7248d860f71ab164b4cec3c415e6cc1bd9fee860c370d65bd8bb49e9572521e2
|
||||
F README.md c1c4218efcc4071a6e26db2b517fdbc1035696a29b370edd655faddbef02b224
|
||||
F VERSION c6366dc72582d3144ce87b013cc35fe48d62f6d07d5be0c9716ea33c862144aa
|
||||
F Makefile.msc 7b31410d0f91251d4268b1abcab7b1a26b52d37193dd7ead87b2acb302ecf6b6 x
|
||||
F README.md c1c4218efcc4071a6e26db2b517fdbc1035696a29b370edd655faddbef02b224 x
|
||||
F VERSION c6366dc72582d3144ce87b013cc35fe48d62f6d07d5be0c9716ea33c862144aa x
|
||||
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
|
||||
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
|
||||
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
|
||||
@@ -33,13 +33,16 @@ F autoconf/tea/win/nmakehlp.c b01f822eabbe1ed2b64e70882d97d48402b42d2689a1ea0034
|
||||
F autoconf/tea/win/rules.vc c511f222b80064096b705dbeb97060ee1d6b6d63
|
||||
F config.guess 883205ddf25b46f10c181818bf42c09da9888884af96f79e1719264345053bd6
|
||||
F config.sub c2d0260f17f3e4bc0b6808fccf1b291cb5e9126c14fc5890efc77b9fd0175559
|
||||
F configure 9dc3300339f4d6b3c3b108de60cc6ae6b3c547e25c7e6df280b4775db4de3a1b x
|
||||
F configure.ac 4654d32ac0a0d0b48f1e1e79bdc3d777b723cf2f63c33eb1d7c4ed8b435938e8
|
||||
F configure 697e926af786eb6ddb94ade8aace9f42814902d939ddc6a7bc5f11c3eca7dd51 x
|
||||
F configure.ac 510be9293c7efca69c0cc7f427f223b0597f82dda214af7491887db25fa4e237
|
||||
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
|
||||
F doc/F2FS.txt c1d4a0ae9711cfe0e1d8b019d154f1c29e0d3abfe820787ba1e9ed7691160fcd
|
||||
F doc/extensible_shell.md 3a32ed1d6f9d59d9cd8c94d149a33c448cfdfcff20aaa9031681699f9e82710e x
|
||||
F doc/json-enhancements.md e356fc834781f1f1aa22ee300027a270b2c960122468499bf347bb123ce1ea4f
|
||||
F doc/lemon.html d2862dbef72496e87f7996f37e814b146848190a742c12161d13fd15346051b0
|
||||
F doc/pager-invariants.txt 27fed9a70ddad2088750c4a2b493b63853da2710
|
||||
F doc/shell_extend.html 61e649726612004ae6efb07507301c120969426c052024dd21550606657ecb9b x
|
||||
F doc/tcl_extension_intro.md 4c0505365c6a37dbfb93c66e72e228c517947e9daa9f3040ef4390461cb5740b x
|
||||
F doc/trusted-schema.md 33625008620e879c7bcfbbfa079587612c434fa094d338b08242288d358c3e8a
|
||||
F doc/vdbesort-memory.md 4da2639c14cd24a31e0af694b1a8dd37eaf277aff3867e9a8cc14046bc49df56
|
||||
F doc/vfs-shm.txt e101f27ea02a8387ce46a05be2b1a902a021d37a
|
||||
@@ -76,7 +79,7 @@ F ext/fts3/fts3_tokenizer.h 64c6ef6c5272c51ebe60fc607a896e84288fcbc3
|
||||
F ext/fts3/fts3_tokenizer1.c c1de4ae28356ad98ccb8b2e3388a7fdcce7607b5523738c9afb6275dab765154
|
||||
F ext/fts3/fts3_unicode.c de426ff05c1c2e7bce161cf6b706638419c3a1d9c2667de9cb9dc0458c18e226
|
||||
F ext/fts3/fts3_unicode2.c 416eb7e1e81142703520d284b768ca2751d40e31fa912cae24ba74860532bf0f
|
||||
F ext/fts3/fts3_write.c d28d9ef383ef848a7b77df4b9964abcc90d67a2b584120c0ad465972dce416e6
|
||||
F ext/fts3/fts3_write.c d28d9ef383ef848a7b77df4b9964abcc90d67a2b584120c0ad465972dce416e6 x
|
||||
F ext/fts3/fts3speed.tcl b54caf6a18d38174f1a6e84219950d85e98bb1e9
|
||||
F ext/fts3/tool/fts3cov.sh c331d006359456cf6f8f953e37f2b9c7d568f3863f00bb5f7eb87fea4ac01b73
|
||||
F ext/fts3/tool/fts3view.c 413c346399159df81f86c4928b7c4a455caab73bfbc8cd68f950f632e5751674
|
||||
@@ -90,9 +93,9 @@ F ext/fts5/fts5Int.h ed48a096418ff4a7c02ac9bd1e8d40c46de21b79a132b8b08d3f3223370
|
||||
F ext/fts5/fts5_aux.c 572d5ec92ba7301df2fea3258576332f2f4d2dfd66d8263afd157d9deceac480
|
||||
F ext/fts5/fts5_buffer.c 3001fbabb585d6de52947b44b455235072b741038391f830d6b729225eeaf6a5
|
||||
F ext/fts5/fts5_config.c 051056a9052f5d3a4d1c695f996fd364f920e341f136c60ab2c04aa7e267113f
|
||||
F ext/fts5/fts5_expr.c 58fb8ceddfb1cefcd54510f9f2f33c220ef9d1b3fa77462111f5ae2a825ab7b1
|
||||
F ext/fts5/fts5_expr.c 58fb8ceddfb1cefcd54510f9f2f33c220ef9d1b3fa77462111f5ae2a825ab7b1 x
|
||||
F ext/fts5/fts5_hash.c d4fb70940359f2120ccd1de7ffe64cc3efe65de9e8995b822cd536ff64c96982
|
||||
F ext/fts5/fts5_index.c fe98ebd8835760b9c787d20f6b50d648a761afd8e3b55780e718ee34c694743b
|
||||
F ext/fts5/fts5_index.c fe98ebd8835760b9c787d20f6b50d648a761afd8e3b55780e718ee34c694743b x
|
||||
F ext/fts5/fts5_main.c b4dba04a36aaf9b8e8cef0100b6dbb422cc74753eacc11d6401cac7a87c0f38d
|
||||
F ext/fts5/fts5_storage.c 76c6085239eb44424004c022e9da17a5ecd5aaec859fba90ad47d3b08f4c8082
|
||||
F ext/fts5/fts5_tcl.c b1445cbe69908c411df8084a10b2485500ac70a9c747cdc8cda175a3da59d8ae
|
||||
@@ -106,7 +109,7 @@ F ext/fts5/fts5parse.y eb526940f892ade5693f22ffd6c4f2702543a9059942772526eac1fde
|
||||
F ext/fts5/mkportersteps.tcl 5acf962d2e0074f701620bb5308155fa1e4a63ba
|
||||
F ext/fts5/test/fts5_common.tcl a9de9c2209cc4e7ae3c753e783504e67206c6c1467d08f209cd0c5923d3e8d8b
|
||||
F ext/fts5/test/fts5aa.test 5bd43427b7d08ce2e19c488a26534be450538b9232d4d5305049e8de236e9aa9
|
||||
F ext/fts5/test/fts5ab.test bd932720c748383277456b81f91bc00453de2174f9762cd05f95d0495dc50390
|
||||
F ext/fts5/test/fts5ab.test bd932720c748383277456b81f91bc00453de2174f9762cd05f95d0495dc50390 x
|
||||
F ext/fts5/test/fts5ac.test a7aa7e1fefc6e1918aa4d3111d5c44a09177168e962c5fd2cca9620de8a7ed6d
|
||||
F ext/fts5/test/fts5ad.test e8cf959dfcd57c8e46d6f5f25665686f3b6627130a9a981371dafdf6482790de
|
||||
F ext/fts5/test/fts5ae.test 1142d16d9cc193894dc13cc8f9c7a8a21411ac61b5567a878514df6f9f0d7bb7
|
||||
@@ -121,7 +124,7 @@ F ext/fts5/test/fts5alter.test 5565f7e4605512b69171ac18ca84398603f9f6456dbe377be
|
||||
F ext/fts5/test/fts5auto.test 78989e6527ce69c9eddbef7392fea5c10b0010cd2b2ae68eec7bc869c471e691
|
||||
F ext/fts5/test/fts5aux.test ebf6f2ff7cb556e83f66991b7f12bff016d3c83d4eab36704b649dd6b1437318
|
||||
F ext/fts5/test/fts5auxdata.test eacc97ff04892f1a5f3d4df5a73f8bcbc3955ea1d12c9f24137eb1fc079e7611
|
||||
F ext/fts5/test/fts5bigid.test 2860854c2561a57594192b00c33a29f91cb85e25f3d6c03b5c2b8f62708f39dd
|
||||
F ext/fts5/test/fts5bigid.test 2860854c2561a57594192b00c33a29f91cb85e25f3d6c03b5c2b8f62708f39dd x
|
||||
F ext/fts5/test/fts5bigpl.test 6466c89b38439f0aba26ac09e232a6b963f29b1cbe1304f6a664fe1e7a8f5fd3
|
||||
F ext/fts5/test/fts5bigtok.test 541119e616c637caea925a8c028c37c2c29e94383e00aa2f9198d530724b6e36
|
||||
F ext/fts5/test/fts5cat.test daba0b80659460b0cb60bd1f40b402478a761fe7ea414c3c94c2be25568cc33a
|
||||
@@ -136,9 +139,9 @@ F ext/fts5/test/fts5corrupt.test 77ae6f41a7eba10620efb921cf7dbe218b0ef232b04519d
|
||||
F ext/fts5/test/fts5corrupt2.test 7453752ba12ce91690c469a6449d412561cc604b1dec994e16ab132952e7805f
|
||||
F ext/fts5/test/fts5corrupt3.test 7da9895dafa404efd20728f66ff4b94399788bdc042c36fe2689801bba2ccd78
|
||||
F ext/fts5/test/fts5corrupt4.test f4c08e2182a48d8b70975fd869ee5391855c06d8a0ff87b6a2529e7c5a88a1d3
|
||||
F ext/fts5/test/fts5corrupt5.test eb6ba5ca28ef7c4c6b01e850d388cdb3dacc8c4c2f383f79d0a98128257742b4
|
||||
F ext/fts5/test/fts5corrupt5.test eb6ba5ca28ef7c4c6b01e850d388cdb3dacc8c4c2f383f79d0a98128257742b4 x
|
||||
F ext/fts5/test/fts5corrupt6.test bf8eeae07825b088b9665d9d8e4accbd8dc9bf3cb85b6c64cf6c9e18ccc420a4
|
||||
F ext/fts5/test/fts5corrupt7.test 80ad7f683a8bda2404731bb77e8c3dbbb620c1f6cc583cca8239f6accd6338c0
|
||||
F ext/fts5/test/fts5corrupt7.test 80ad7f683a8bda2404731bb77e8c3dbbb620c1f6cc583cca8239f6accd6338c0 x
|
||||
F ext/fts5/test/fts5delete.test 619295b20dbc1d840b403ee07c878f52378849c3c02e44f2ee143b3e978a0aa7
|
||||
F ext/fts5/test/fts5detail.test 54015e9c43ec4ba542cfb93268abdf280e0300f350efd08ee411284b03595cc4
|
||||
F ext/fts5/test/fts5determin.test 1b77879b2ae818b5b71c859e534ee334dac088b7cf3ff3bf76a2c82b1c788d11
|
||||
@@ -167,7 +170,7 @@ F ext/fts5/test/fts5integrity.test 62147a1e85405b986691177e0312be5a64ec9e67b1799
|
||||
F ext/fts5/test/fts5interrupt.test 09613247b273a99889808ef852898177e671406fe71fdde7ea00e78ea283d227
|
||||
F ext/fts5/test/fts5lastrowid.test be98fe3e03235296585b72daad7aed5717ba0062bae5e5c18dd6e04e194c6b28
|
||||
F ext/fts5/test/fts5leftjoin.test c0b4cafb9661379e576dc4405c0891d8fcc2782680740513c4d1fc114b43d4ad
|
||||
F ext/fts5/test/fts5limits.test 8ab67cf5d311c124b6ceb0062d0297767176df4572d955fce79fa43004dff01c
|
||||
F ext/fts5/test/fts5limits.test 8ab67cf5d311c124b6ceb0062d0297767176df4572d955fce79fa43004dff01c x
|
||||
F ext/fts5/test/fts5matchinfo.test 10c9a6f7fe61fb132299c4183c012770b10c4d5c2f2edb6df0b6607f683d737a
|
||||
F ext/fts5/test/fts5merge.test e92a8db28b45931e7a9c7b1bbd36101692759d00274df74d83fd29d25d53b3a6
|
||||
F ext/fts5/test/fts5merge2.test 3ebad1a59d6ad3fb66eff6523a09e95dc6367cbefb3cd73196801dea0425c8e2
|
||||
@@ -290,7 +293,7 @@ F ext/misc/dbdump.c b8592f6f2da292c62991a13864a60d6c573c47a9cc58362131b9e6a64f82
|
||||
F ext/misc/decimal.c 24ccb63e9af6ed7de2e8e3b300061ad91169a44cc0c35dab92b7d2e1e7574f28
|
||||
F ext/misc/eval.c 04bc9aada78c888394204b4ed996ab834b99726fb59603b0ee3ed6e049755dc1
|
||||
F ext/misc/explain.c 0086fab288d4352ea638cf40ac382aad3b0dc5e845a1ea829a694c015fd970fe
|
||||
F ext/misc/fileio.c 4e7f7cd30de8df4820c552f14af3c9ca451c5ffe1f2e7bef34d598a12ebfb720
|
||||
F ext/misc/fileio.c 37f19acaf22562bae05f530c81c7b24b2c5c091503b115b54ec127958fb5c8bb
|
||||
F ext/misc/fossildelta.c 1240b2d3e52eab1d50c160c7fe1902a9bd210e052dc209200a750bbf885402d5
|
||||
F ext/misc/fuzzer.c eae560134f66333e9e1ca4c8ffea75df42056e2ce8456734565dbe1c2a92bf3d
|
||||
F ext/misc/ieee754.c 984d51fe23e956484ec1049df6f5257002e3ab338cabceb39761c2e80ad10bf4
|
||||
@@ -317,6 +320,7 @@ F ext/misc/showauth.c 732578f0fe4ce42d577e1c86dc89dd14a006ab52
|
||||
F ext/misc/spellfix.c 94df9bbfa514a563c1484f684a2df3d128a2f7209a84ca3ca100c68a0163e29f
|
||||
F ext/misc/sqlar.c 53e7d48f68d699a24f1a92e68e71eca8b3a9ff991fe9588c2a05bde103c6e7b7
|
||||
F ext/misc/stmt.c bc30d60d55e70d0133f10ac6103fe9336543f673740b73946f98758a2bb16dd7
|
||||
F ext/misc/tclshext.c.in eaf544f41cedc1a824e369ab782e3bf3e36f227c9da10d8bdf7187937f80e10a x
|
||||
F ext/misc/templatevtab.c 8a16a91a5ceaccfcbd6aaaa56d46828806e460dd194965b3f77bf38f14b942c4
|
||||
F ext/misc/totype.c fa4aedeb07f66169005dffa8de3b0a2b621779fd44f85c103228a42afa71853b
|
||||
F ext/misc/uint.c 053fed3bce2e89583afcd4bf804d75d659879bbcedac74d0fa9ed548839a030b
|
||||
@@ -377,13 +381,13 @@ F ext/rbu/rbuvacuum4.test ffccd22f67e2d0b380d2889685742159dfe0d19a3880ca3d2d1d69
|
||||
F ext/rbu/sqlite3rbu.c d4ddf8f0e93772556e452a6c2814063cf47efb760a0834391a9d0cd9859fa4b9
|
||||
F ext/rbu/sqlite3rbu.h 9d923eb135c5d04aa6afd7c39ca47b0d1d0707c100e02f19fdde6a494e414304
|
||||
F ext/rbu/test_rbu.c ee6ede75147bc081fe9bc3931e6b206277418d14d3fbceea6fdc6216d9b47055
|
||||
F ext/recover/dbdata.c 81661e3a98cabb70be8f2760a67a8d6d5bf7aaa7a4055a53ff915ac884221a64
|
||||
F ext/recover/dbdata.c 81661e3a98cabb70be8f2760a67a8d6d5bf7aaa7a4055a53ff915ac884221a64 x
|
||||
F ext/recover/recover1.test c484d01502239f11b61f23c1cee9f5dd19fa17617f8974e42e74d64639c524cf
|
||||
F ext/recover/recover_common.tcl a61306c1eb45c0c3fc45652c35b2d4ec19729e340bdf65a272ce4c229cefd85a
|
||||
F ext/recover/recoverbuild.test c74170e0f7b02456af41838afeb5353fdb985a48cc2331d661bbabbca7c6b8e3
|
||||
F ext/recover/recoverclobber.test 3ba6c0c373c5c63d17e82eced64c05c57ccaf26c1abe1ca7141334022a79f32e
|
||||
F ext/recover/recovercorrupt.test 64c081ad1200ae77b447da99eb724785d6bf71715f394543dc7689642e92bf49
|
||||
F ext/recover/recovercorrupt2.test b9b974f006340a1300b5a7e687bd6097c5238498181c6f92d87406a77ece430b
|
||||
F ext/recover/recovercorrupt2.test b9b974f006340a1300b5a7e687bd6097c5238498181c6f92d87406a77ece430b x
|
||||
F ext/recover/recoverfault.test 9d9f88eeb222615a25e7514f234c950d46bee20d24cd8db49d8fff8d650dcfe1
|
||||
F ext/recover/recoverfault2.test 730e7371bcda769554d15460cb23126abba1be8eca9539ccabf63623e7bb7e09
|
||||
F ext/recover/recoverold.test 68db3d6f85dd2b98e785b6c4da4f5eea4bbe52ccf6674d9a94c7506dc92596aa
|
||||
@@ -391,7 +395,7 @@ F ext/recover/recoverpgsz.test 3658ab8e68475b1bb87d6af88baa04551c84b73280a566a1b
|
||||
F ext/recover/recoverrowid.test f948bf4024a5f41b0e21b8af80c60564c5b5d78c05a8d64fc00787715ff9f45f
|
||||
F ext/recover/recoverslowidx.test 5205a9742dd9490ee99950dabb622307355ef1662dea6a3a21030057bfd81411
|
||||
F ext/recover/recoversql.test e66d01f95302a223bcd3fd42b5ee58dc2b53d70afa90b0d00e41e4b8eab20486
|
||||
F ext/recover/sqlite3recover.c e6eb20c469bcdb96f297f2241860bccabf9f036bfa7f3d47bcc6ca1191b108dc
|
||||
F ext/recover/sqlite3recover.c e6eb20c469bcdb96f297f2241860bccabf9f036bfa7f3d47bcc6ca1191b108dc x
|
||||
F ext/recover/sqlite3recover.h 011c799f02deb70ab685916f6f538e6bb32c4e0025e79bfd0e24ff9c74820959
|
||||
F ext/recover/test_recover.c 1a34e2d04533d919a30ae4d5caeb1643f6684e9ccd7597ca27721d8af81f4ade
|
||||
F ext/repair/README.md 92f5e8aae749a4dae14f02eea8e1bb42d4db2b6ce5e83dbcdd6b1446997e0c15
|
||||
@@ -405,9 +409,9 @@ F ext/repair/test/checkindex01.test b530f141413b587c9eb78ff734de6bb79bc3515c3350
|
||||
F ext/repair/test/test.tcl 686d76d888dffd021f64260abf29a55c57b2cedfa7fc69150b42b1d6119aac3c
|
||||
F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
|
||||
F ext/rtree/geopoly.c 971e0b5bd9adaf0811feb8c0842a310811159da10319eb0e74fdb42bf26b99ca
|
||||
F ext/rtree/rtree.c fb36e05027505f2c0dab24564e1d58ca4b789a6dfa48cf51aeee570018cf4814
|
||||
F ext/rtree/rtree.c fb36e05027505f2c0dab24564e1d58ca4b789a6dfa48cf51aeee570018cf4814 x
|
||||
F ext/rtree/rtree.h 4a690463901cb5e6127cf05eb8e642f127012fd5003830dbc974eca5802d9412
|
||||
F ext/rtree/rtree1.test 877d40b8b61b1f88cec9d4dc0ff8334f5b05299fac12a35141532e2881860e9d
|
||||
F ext/rtree/rtree1.test 877d40b8b61b1f88cec9d4dc0ff8334f5b05299fac12a35141532e2881860e9d x
|
||||
F ext/rtree/rtree2.test 9d9deddbb16fd0c30c36e6b4fdc3ee3132d765567f0f9432ee71e1303d32603d
|
||||
F ext/rtree/rtree3.test 272594f88c344e973864008bbe4c71fd3a41a264c097d568593ee7886d83d409
|
||||
F ext/rtree/rtree4.test 304de65d484540111b896827e4261815e5dca4ce28eeecd58be648cd73452c4b
|
||||
@@ -469,9 +473,9 @@ F ext/session/sessionfault2.test b0d6a7c1d7398a7e800d84657404909c7d385965ea8576d
|
||||
F ext/session/sessioninvert.test 04075517a9497a80d39c495ba6b44f3982c7371129b89e2c52219819bc105a25
|
||||
F ext/session/sessionmem.test f2a735db84a3e9e19f571033b725b0b2daf847f3f28b1da55a0c1a4e74f1de09
|
||||
F ext/session/sessionnoop.test a9366a36a95ef85f8a3687856ebef46983df399541174cb1ede2ee53b8011bc7
|
||||
F ext/session/sessionnoop2.test de4672dce88464396ec9f30ed08c6c01643a69c53ae540fadbbf6d30642d64e8
|
||||
F ext/session/sessionnoop2.test de4672dce88464396ec9f30ed08c6c01643a69c53ae540fadbbf6d30642d64e8 x
|
||||
F ext/session/sessionrebase.test 702378bdcb5062f1106e74457beca8797d09c113a81768734a58b197b5b334e2
|
||||
F ext/session/sessionrowid.test 85187c2f1b38861a5844868126f69f9ec62223a03449a98a80600a44396f7363
|
||||
F ext/session/sessionrowid.test 85187c2f1b38861a5844868126f69f9ec62223a03449a98a80600a44396f7363 x
|
||||
F ext/session/sessionsize.test 8fcf4685993c3dbaa46a24183940ab9f5aa9ed0d23e5fb63bfffbdb56134b795
|
||||
F ext/session/sessionstat1.test b039e38e2ba83767b464baf39b297cc0b1cc6f3292255cb467ea7e12d0d0280c
|
||||
F ext/session/sessionwor.test 6fd9a2256442cebde5b2284936ae9e0d54bde692d0f5fd009ecef8511f4cf3fc
|
||||
@@ -496,21 +500,21 @@ F ext/wasm/api/post-js-header.js 47b6b281f39ad59fa6e8b658308cd98ea292c286a68407b
|
||||
F ext/wasm/api/pre-js.c-pp.js ad906703f7429590f2fbf5e6498513bf727a1a4f0ebfa057afb08161d7511219
|
||||
F ext/wasm/api/sqlite3-api-cleanup.js cc21e3486da748463e02bbe51e2464c6ac136587cdfd5aa00cd0b5385f6ca808
|
||||
F ext/wasm/api/sqlite3-api-glue.js f1b2dcb944de5138bb5bd9a1559d2e76a4f3ec25260963d709e8237476688803
|
||||
F ext/wasm/api/sqlite3-api-oo1.js 9678dc4d9a5d39632b6ffe6ea94a023119260815bf32f265bf5f6c36c9516db8
|
||||
F ext/wasm/api/sqlite3-api-oo1.js 9678dc4d9a5d39632b6ffe6ea94a023119260815bf32f265bf5f6c36c9516db8 x
|
||||
F ext/wasm/api/sqlite3-api-prologue.js 17f4ec398ba34c5c666fea8e8c4eb82064a35b302f2f2eb355283cd8d3f68ed5
|
||||
F ext/wasm/api/sqlite3-api-worker1.js 9f32af64df1a031071912eea7a201557fe39b1738645c0134562bb84e88e2fec
|
||||
F ext/wasm/api/sqlite3-api-worker1.js 9f32af64df1a031071912eea7a201557fe39b1738645c0134562bb84e88e2fec x
|
||||
F ext/wasm/api/sqlite3-license-version-header.js 0c807a421f0187e778dc1078f10d2994b915123c1223fe752b60afdcd1263f89
|
||||
F ext/wasm/api/sqlite3-opfs-async-proxy.js 961bbc3ccc1fa4e91d6519a96e8811ad7ae60173bd969fee7775dacb6eee1da2
|
||||
F ext/wasm/api/sqlite3-opfs-async-proxy.js 961bbc3ccc1fa4e91d6519a96e8811ad7ae60173bd969fee7775dacb6eee1da2 x
|
||||
F ext/wasm/api/sqlite3-v-helper.js e5c202a9ecde9ef818536d3f5faf26c03a1a9f5192b1ddea8bdabf30d75ef487
|
||||
F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js 05f2563ddebfdc7a0f0ac0eb7cb381bb72043299aae1600ba9367c12f52b3fcc
|
||||
F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js 05f2563ddebfdc7a0f0ac0eb7cb381bb72043299aae1600ba9367c12f52b3fcc x
|
||||
F ext/wasm/api/sqlite3-wasi.h 25356084cfe0d40458a902afb465df8c21fc4152c1d0a59b563a3fba59a068f9
|
||||
F ext/wasm/api/sqlite3-wasm.c 12a096d8e58a0af0589142bae5a3c27a0c7e19846755a1a37d2c206352fbedda
|
||||
F ext/wasm/api/sqlite3-worker1-promiser.c-pp.js bc06df0d599e625bde6a10a394e326dc68da9ff07fa5404354580f81566e591f
|
||||
F ext/wasm/api/sqlite3-worker1-promiser.c-pp.js bc06df0d599e625bde6a10a394e326dc68da9ff07fa5404354580f81566e591f x
|
||||
F ext/wasm/api/sqlite3-worker1.c-pp.js da509469755035e919c015deea41b4514b5e84c12a1332e6cc8d42cb2cc1fb75
|
||||
F ext/wasm/batch-runner.html 4deeed44fe41496dc6898d9fb17938ea3291f40f4bfb977e29d0cef96fbbe4c8
|
||||
F ext/wasm/batch-runner.js 0dad6a02ad796f1003d3b7048947d275c4d6277f63767b8e685c27df8fdac93e
|
||||
F ext/wasm/c-pp.c 6d80d8569d85713effe8b0818a3cf51dc779e3f0bf8dc88771b8998552ee25b4
|
||||
F ext/wasm/common/SqliteTestUtil.js 7adaeffef757d8708418dc9190f72df22367b531831775804b31598b44f6aa51
|
||||
F ext/wasm/common/SqliteTestUtil.js 7adaeffef757d8708418dc9190f72df22367b531831775804b31598b44f6aa51 x
|
||||
F ext/wasm/common/emscripten.css 11bd104b6c0d597c67d40cc8ecc0a60dae2b965151e3b6a37fa5708bac3acd15
|
||||
F ext/wasm/common/testing.css 0ff15602a3ab2bad8aef2c3bd120c7ee3fd1c2054ad2ace7e214187ae68d926f
|
||||
F ext/wasm/common/whwasmutil.js 03407d7b61b817fd135c82401987e56688a45ee4d6b9c0eced160c0000d6e4c2
|
||||
@@ -520,9 +524,9 @@ F ext/wasm/demo-123.js ebae30756585bca655b4ab2553ec9236a87c23ad24fc8652115dcedb0
|
||||
F ext/wasm/demo-jsstorage.html 409c4be4af5f207fb2877160724b91b33ea36a3cd8c204e8da1acb828ffe588e
|
||||
F ext/wasm/demo-jsstorage.js 44e3ae7ec2483b6c511384c3c290beb6f305c721186bcf5398ca4e00004a06b8
|
||||
F ext/wasm/demo-worker1-promiser.html 1de7c248c7c2cfd4a5783d2aa154bce62d74c6de98ab22f5786620b3354ed15f
|
||||
F ext/wasm/demo-worker1-promiser.js 5e5c7d7c91cd7aae9cc733afd02569ba9c6928292db413b550e8b842f4b75e87
|
||||
F ext/wasm/demo-worker1-promiser.js 5e5c7d7c91cd7aae9cc733afd02569ba9c6928292db413b550e8b842f4b75e87 x
|
||||
F ext/wasm/demo-worker1.html 2c178c1890a2beb5a5fecb1453e796d067a4b8d3d2a04d65ca2eb1ab2c68ef5d
|
||||
F ext/wasm/demo-worker1.js 836bece8615b17b1b572584f7b15912236a5947fe8c68b98d2737d7e287447ef
|
||||
F ext/wasm/demo-worker1.js 836bece8615b17b1b572584f7b15912236a5947fe8c68b98d2737d7e287447ef x
|
||||
F ext/wasm/dist.make 451fb1b732257849f6e898d2a862512a0401500ed369ef53bdfeddf9c77bc3b9
|
||||
F ext/wasm/example_extra_init.c 2347cd69d19d839ef4e5e77b7855103a7fe3ef2af86f2e8c95839afd8b05862f
|
||||
F ext/wasm/fiddle.make dbe36b90b8907ae28ecb9c0e9fd8389dbdaecf117ea4fb2ea33864bdfa498a94
|
||||
@@ -546,9 +550,9 @@ F ext/wasm/sql/000-mandelbrot.sql 775337a4b80938ac8146aedf88808282f04d02d983d826
|
||||
F ext/wasm/sql/001-sudoku.sql 35b7cb7239ba5d5f193bc05ec379bcf66891bce6f2a5b3879f2f78d0917299b5
|
||||
F ext/wasm/test-opfs-vfs.html 1f2d672f3f3fce810dfd48a8d56914aba22e45c6834e262555e685bce3da8c3f
|
||||
F ext/wasm/test-opfs-vfs.js f09266873e1a34d9bdb6d3981ec8c9e382f31f215c9fd2f9016d2394b8ae9b7b
|
||||
F ext/wasm/tester1-worker.html ebc4b820a128963afce328ecf63ab200bd923309eb939f4110510ab449e9814c
|
||||
F ext/wasm/tester1-worker.html ebc4b820a128963afce328ecf63ab200bd923309eb939f4110510ab449e9814c x
|
||||
F ext/wasm/tester1.c-pp.html 1c1bc78b858af2019e663b1a31e76657b73dc24bede28ca92fbe917c3a972af2
|
||||
F ext/wasm/tester1.c-pp.js 1a05497ae2b2fcca008d43b37072f9b841e1c970c06c01eb0faf675db567bfc8
|
||||
F ext/wasm/tester1.c-pp.js 1a05497ae2b2fcca008d43b37072f9b841e1c970c06c01eb0faf675db567bfc8 x
|
||||
F ext/wasm/tests/opfs/concurrency/index.html 0802373d57034d51835ff6041cda438c7a982deea6079efd98098d3e42fbcbc1
|
||||
F ext/wasm/tests/opfs/concurrency/test.js a98016113eaf71e81ddbf71655aa29b0fed9a8b79a3cdd3620d1658eb1cc9a5d
|
||||
F ext/wasm/tests/opfs/concurrency/worker.js 0a8c1a3e6ebb38aabbee24f122693f1fb29d599948915c76906681bb7da1d3d2
|
||||
@@ -557,7 +561,7 @@ F ext/wasm/wasmfs.make cf9a68162d92ca2bcb0b9528b244cb36d5cc2d84ccc9c2d398461927d
|
||||
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
|
||||
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
|
||||
F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
|
||||
F main.mk 0eb735008653412026092961cecdf7d698156c060e4062a69d911335982d471c
|
||||
F main.mk 3c80caf303240df102d4a59f19bfd660d44470d55707d1ead8b71698491f03bf
|
||||
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
|
||||
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
|
||||
F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421
|
||||
@@ -569,16 +573,16 @@ F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
|
||||
F sqlite3.1 fc7ad8990fc8409983309bb80de8c811a7506786
|
||||
F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a
|
||||
F sqlite_cfg.h.in baf2e409c63d4e7a765e17769b6ff17c5a82bbd9cbf1e284fd2e4cefaff3fcf2
|
||||
F src/alter.c 3ff8c2fca0c0636d43459154bb40d79c882df1b34df77f89c4ec47ab2e2389f5
|
||||
F src/analyze.c d4cc28738c29e009640ec20ebb6936ba6fcefff0d11aa93398d9bb9a5ead6c1f
|
||||
F src/alter.c 3ff8c2fca0c0636d43459154bb40d79c882df1b34df77f89c4ec47ab2e2389f5 x
|
||||
F src/analyze.c d4cc28738c29e009640ec20ebb6936ba6fcefff0d11aa93398d9bb9a5ead6c1f x
|
||||
F src/attach.c cc9d00d30da916ff656038211410ccf04ed784b7564639b9b61d1839ed69fd39
|
||||
F src/auth.c 19b7ccacae3dfba23fc6f1d0af68134fa216e9040e53b0681b4715445ea030b4
|
||||
F src/auth.c 19b7ccacae3dfba23fc6f1d0af68134fa216e9040e53b0681b4715445ea030b4 x
|
||||
F src/backup.c 5c97e8023aab1ce14a42387eb3ae00ba5a0644569e3476f38661fa6f824c3523
|
||||
F src/bitvec.c 9eac5f42c11914d5ef00a75605bb205e934f435c579687f985f1f8b0995c8645
|
||||
F src/btmutex.c 79a43670447eacc651519a429f6ece9fd638563cf95b469d6891185ddae2b522
|
||||
F src/btree.c c0c93b6cb4dc133b528c1290bb4ad0f2414452f9a5758ff2b106af718874f39e
|
||||
F src/bitvec.c 9eac5f42c11914d5ef00a75605bb205e934f435c579687f985f1f8b0995c8645 x
|
||||
F src/btmutex.c 79a43670447eacc651519a429f6ece9fd638563cf95b469d6891185ddae2b522 x
|
||||
F src/btree.c c0c93b6cb4dc133b528c1290bb4ad0f2414452f9a5758ff2b106af718874f39e x
|
||||
F src/btree.h aa354b9bad4120af71e214666b35132712b8f2ec11869cb2315c52c81fad45cc
|
||||
F src/btreeInt.h 3b4eff7155c0cea6971dc51f62e3529934a15a6640ec607dd42a767e379cb3a9
|
||||
F src/btreeInt.h 3b4eff7155c0cea6971dc51f62e3529934a15a6640ec607dd42a767e379cb3a9 x
|
||||
F src/build.c a8ae3b32d9aa9bbd2c0e97d7c0dd80def9fbca408425de1608f57ee6f47f45f4
|
||||
F src/callback.c db3a45e376deff6a16c0058163fe0ae2b73a2945f3f408ca32cf74960b28d490
|
||||
F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
|
||||
@@ -587,23 +591,23 @@ F src/date.c f73f203b3877cef866c60ab402aec2bf89597219b60635cf50cbe3c5e4533e94
|
||||
F src/dbpage.c f3eea5f7ec47e09ee7da40f42b25092ecbe961fc59566b8e5f705f34335b2387
|
||||
F src/dbstat.c ec92074baa61d883de58c945162d9e666c13cd7cf3a23bc38b4d1c4d0b2c2bef
|
||||
F src/delete.c cd5f5cd06ed0b6a882ec1a8c2a0d73b3cecb28479ad19e9931c4706c5e2182be
|
||||
F src/expr.c 8d1656b65e26af3e34f78e947ac423f0d20c214ed25a67486e433bf16ca6b543
|
||||
F src/expr.c 8d1656b65e26af3e34f78e947ac423f0d20c214ed25a67486e433bf16ca6b543 x
|
||||
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
|
||||
F src/fkey.c a7fcbf7e66d14dbb73cf49f31489ebf66d0e6006c62b95246924a3bae9f37b36
|
||||
F src/func.c 8ada46d362a153b8dfb5385c3aaa9a7d75ebf306b33d2e663aa03920126a1bc3
|
||||
F src/fkey.c a7fcbf7e66d14dbb73cf49f31489ebf66d0e6006c62b95246924a3bae9f37b36 x
|
||||
F src/func.c 8ada46d362a153b8dfb5385c3aaa9a7d75ebf306b33d2e663aa03920126a1bc3 x
|
||||
F src/global.c bd0892ade7289f6e20bff44c07d06371f2ff9b53cea359e7854b9b72f65adc30
|
||||
F src/hash.c 9ee4269fb1d6632a6fecfb9479c93a1f29271bddbbaf215dd60420bcb80c7220
|
||||
F src/hash.c 9ee4269fb1d6632a6fecfb9479c93a1f29271bddbbaf215dd60420bcb80c7220 x
|
||||
F src/hash.h 3340ab6e1d13e725571d7cee6d3e3135f0779a7d8e76a9ce0a85971fa3953c51
|
||||
F src/hwtime.h f9c2dfb84dce7acf95ce6d289e46f5f9d3d1afd328e53da8f8e9008e3b3caae6
|
||||
F src/hwtime.h f9c2dfb84dce7acf95ce6d289e46f5f9d3d1afd328e53da8f8e9008e3b3caae6 x
|
||||
F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
|
||||
F src/insert.c 3f0a94082d978bbdd33c38fefea15346c6c6bffb70bc645a71dc0f1f87dd3276
|
||||
F src/json.c 14c474fb1249a46eb44e878e2361f36abfe686b134039b0d1883d93d61505b4a
|
||||
F src/json.c 14c474fb1249a46eb44e878e2361f36abfe686b134039b0d1883d93d61505b4a x
|
||||
F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
|
||||
F src/loadext.c 176d6b2cb18a6ad73b133db17f6fc351c4d9a2d510deebdb76c22bde9cfd1465
|
||||
F src/main.c 5fd4b65d61ae6155f36756ed508a39b38b49355b031188961e8d923f43f4bc49
|
||||
F src/loadext.c 176d6b2cb18a6ad73b133db17f6fc351c4d9a2d510deebdb76c22bde9cfd1465 x
|
||||
F src/main.c 5fd4b65d61ae6155f36756ed508a39b38b49355b031188961e8d923f43f4bc49 x
|
||||
F src/malloc.c 47b82c5daad557d9b963e3873e99c22570fb470719082c6658bf64e3012f7d23
|
||||
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
|
||||
F src/mem1.c 3bb59158c38e05f6270e761a9f435bf19827a264c13d1631c58b84bdc96d73b2
|
||||
F src/mem1.c 3bb59158c38e05f6270e761a9f435bf19827a264c13d1631c58b84bdc96d73b2 x
|
||||
F src/mem2.c c8bfc9446fd0798bddd495eb5d9dbafa7d4b7287d8c22d50a83ac9daa26d8a75
|
||||
F src/mem3.c 30301196cace2a085cbedee1326a49f4b26deff0af68774ca82c1f7c06fda4f6
|
||||
F src/mem5.c b7da5c10a726aacacc9ad7cdcb0667deec643e117591cc69cf9b4b9e7f3e96ff
|
||||
@@ -613,47 +617,51 @@ F src/msvc.h 80b35f95d93bf996ccb3e498535255f2ef1118c78764719a7cd15ab4106ccac9
|
||||
F src/mutex.c 5e3409715552348732e97b9194abe92fdfcd934cfb681df4ba0ab87ac6c18d25
|
||||
F src/mutex.h a7b2293c48db5f27007c3bdb21d438873637d12658f5a0bf8ad025bb96803c4a
|
||||
F src/mutex_noop.c 9d4309c075ba9cc7249e19412d3d62f7f94839c4
|
||||
F src/mutex_unix.c bd52ec50e44a41fe1e3deb5a6e3fe98edb6f2059da3e46d196363d0fa3192cda
|
||||
F src/mutex_w32.c 38b56d0bc8d54c17c20cbaaad3719b0c36b92fd07a7e34360d0c6a18d5589912
|
||||
F src/mutex_unix.c bd52ec50e44a41fe1e3deb5a6e3fe98edb6f2059da3e46d196363d0fa3192cda x
|
||||
F src/mutex_w32.c 38b56d0bc8d54c17c20cbaaad3719b0c36b92fd07a7e34360d0c6a18d5589912 x
|
||||
F src/notify.c 89a97dc854c3aa62ad5f384ef50c5a4a11d70fcc69f86de3e991573421130ed6
|
||||
F src/os.c 509452169d5ea739723e213b8e2481cf0e587f0e88579a912d200db5269f5f6d
|
||||
F src/obj_interfaces.h f991295c0dc7c2aca595a9966d5918f3d19eb5dcf62df6819c4680c8cc00084d x
|
||||
F src/os.c 509452169d5ea739723e213b8e2481cf0e587f0e88579a912d200db5269f5f6d x
|
||||
F src/os.h 1ff5ae51d339d0e30d8a9d814f4b8f8e448169304d83a7ed9db66a65732f3e63
|
||||
F src/os_common.h 6c0eb8dd40ef3e12fe585a13e709710267a258e2c8dd1c40b1948a1d14582e06
|
||||
F src/os_kv.c 4d39e1f1c180b11162c6dc4aa8ad34053873a639bac6baae23272fc03349986a
|
||||
F src/os_setup.h 6011ad7af5db4e05155f385eb3a9b4470688de6f65d6166b8956e58a3d872107
|
||||
F src/os_unix.c 95b407307deb902a3bd9a5d5666c7838709cccb337baeee6ef0a53f512d3673e
|
||||
F src/os_win.c 7038223a1cda0a47e2ab4db47f63bf1833fe53ba0542f0f283a062ea13894103
|
||||
F src/os_unix.c 95b407307deb902a3bd9a5d5666c7838709cccb337baeee6ef0a53f512d3673e x
|
||||
F src/os_win.c 7038223a1cda0a47e2ab4db47f63bf1833fe53ba0542f0f283a062ea13894103 x
|
||||
F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
|
||||
F src/pager.c 5ddf3a74c633a008ea6b2f5b3186167e88e2c8ca8a252ecab06ab3f1eb48e60f
|
||||
F src/pager.c 5ddf3a74c633a008ea6b2f5b3186167e88e2c8ca8a252ecab06ab3f1eb48e60f x
|
||||
F src/pager.h f82e9844166e1585f5786837ddc7709966138ced17f568c16af7ccf946c2baa3
|
||||
F src/parse.y 8828f9e15f04d469eab9c0f2aed504e534b1c97c68836bed6f07afab29c2ac0b
|
||||
F src/pcache.c 4cd4a0043167da9ba7e19b4d179a0e6354e7fe32c16f781ecf9bf0a5ff63b40b
|
||||
F src/parse.y 8828f9e15f04d469eab9c0f2aed504e534b1c97c68836bed6f07afab29c2ac0b x
|
||||
F src/pcache.c 4cd4a0043167da9ba7e19b4d179a0e6354e7fe32c16f781ecf9bf0a5ff63b40b x
|
||||
F src/pcache.h 1497ce1b823cf00094bb0cf3bac37b345937e6f910890c626b16512316d3abf5
|
||||
F src/pcache1.c 602acb23c471bb8d557a6f0083cc2be641d6cafcafa19e481eba7ef4c9ca0f00
|
||||
F src/pragma.c 37b8fb02d090262280c86e1e2654bf59d8dbfbfe8dc6733f2b968a11374c095a
|
||||
F src/pcache1.c 602acb23c471bb8d557a6f0083cc2be641d6cafcafa19e481eba7ef4c9ca0f00 x
|
||||
F src/pragma.c 37b8fb02d090262280c86e1e2654bf59d8dbfbfe8dc6733f2b968a11374c095a x
|
||||
F src/pragma.h e690a356c18e98414d2e870ea791c1be1545a714ba623719deb63f7f226d8bb7
|
||||
F src/prepare.c d6c4354f8ea0dc06962fbabc4b68c4471a45276a2918c929be00f9f537f69eb1
|
||||
F src/prepare.c d6c4354f8ea0dc06962fbabc4b68c4471a45276a2918c929be00f9f537f69eb1 x
|
||||
F src/printf.c a87473be34fa2acafa27692b8ae078275c7e23360956c93c07ff22f5d609cbd7
|
||||
F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
|
||||
F src/resmanage.c b85f77821ea0280c73a6afc1dc3b6884ba3a402515c6bf27ba1567408e4f121d x
|
||||
F src/resmanage.h eb63130e49d7b696a33c6d39d1c437a050bbef42b4f6f4405a15fc563c7dd61e x
|
||||
F src/resolve.c 37953a5f36c60bea413c3c04efcd433b6177009f508ef2ace0494728912fe2e9
|
||||
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
|
||||
F src/select.c 383b9dba12493c365ee2036bcadd73013b7c0f7d2afcda0c378317c335d60ac2
|
||||
F src/shell.c.in 2c02c819349de410d63fcc0217763dfe5a42dbe58f2d68046d4ea8a376d12c26
|
||||
F src/sqlite.h.in 3076d78836b6dac53b3ab0875fc8fd15bca8077aad4d33c85336e05af6aef8c7
|
||||
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 x
|
||||
F src/select.c 383b9dba12493c365ee2036bcadd73013b7c0f7d2afcda0c378317c335d60ac2 x
|
||||
F src/shell.c.in 0dddcf40a018fa1ce1cddbd070c8e54959fa3630f012fd7027fecbeeb0fdefd0
|
||||
F src/shext_linkage.h f7c8331f6e3c4a53a7bd70d2aa3d28fec9b206638140d804d35fdaaade54496c x
|
||||
F src/sqlite.h.in 3076d78836b6dac53b3ab0875fc8fd15bca8077aad4d33c85336e05af6aef8c7 x
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
F src/sqlite3ext.h da473ce2b3d0ae407a6300c4a164589b9a6bfdbec9462688a8593ff16f3bb6e4
|
||||
F src/sqliteInt.h f7e904f7fdeccfd5606ca4457122e647dcbaf307ed8615ac4865f8b5f536f77b
|
||||
F src/sqliteLimit.h 33b1c9baba578d34efe7dfdb43193b366111cdf41476b1e82699e14c11ee1fb6
|
||||
F src/sqliteLimit.h 33b1c9baba578d34efe7dfdb43193b366111cdf41476b1e82699e14c11ee1fb6 x
|
||||
F src/status.c 160c445d7d28c984a0eae38c144f6419311ed3eace59b44ac6dafc20db4af749
|
||||
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
|
||||
F src/tclsqlite.c ecbc3c99c0d0c3ed122a913f143026c26d38d57f33e06bb71185dd5c1efe37cd
|
||||
F src/test1.c e6ab4a00671f052366a01bcb7fdf2e2f6bb4aa884cd01e738c5590dcf47a99ca
|
||||
F src/tclsqlite.c ecbc3c99c0d0c3ed122a913f143026c26d38d57f33e06bb71185dd5c1efe37cd x
|
||||
F src/test1.c e6ab4a00671f052366a01bcb7fdf2e2f6bb4aa884cd01e738c5590dcf47a99ca x
|
||||
F src/test2.c 827446e259a3b7ab949da1542953edda7b5117982576d3e6f1c24a0dd20a5cef
|
||||
F src/test3.c e5178558c41ff53236ae0271e9acb3d6885a94981d2eb939536ee6474598840e
|
||||
F src/test3.c e5178558c41ff53236ae0271e9acb3d6885a94981d2eb939536ee6474598840e x
|
||||
F src/test4.c 4533b76419e7feb41b40582554663ed3cd77aaa54e135cf76b3205098cd6e664
|
||||
F src/test5.c 328aae2c010c57a9829d255dc099d6899311672d
|
||||
F src/test6.c e53bc69dc3cb3815fb74df74f38159ec05ba6dd5273216062e26bc797f925530
|
||||
F src/test8.c ccc5d3e2a2bf7248f7da185e2afc4c08b4c6840447f5eb4dd106db165fddbdbc
|
||||
F src/test6.c e53bc69dc3cb3815fb74df74f38159ec05ba6dd5273216062e26bc797f925530 x
|
||||
F src/test8.c ccc5d3e2a2bf7248f7da185e2afc4c08b4c6840447f5eb4dd106db165fddbdbc x
|
||||
F src/test9.c 12e5ba554d2d1cbe0158f6ab3f7ffcd7a86ee4e5
|
||||
F src/test_async.c 195ab49da082053fdb0f949c114b806a49ca770a
|
||||
F src/test_autoext.c 915d245e736652a219a907909bb6710f0d587871
|
||||
@@ -661,30 +669,32 @@ F src/test_backup.c bf5da90c9926df0a4b941f2d92825a01bbe090a0
|
||||
F src/test_bestindex.c 68c62586d2ae9f032903fe53be743657d0c2aac0a850b880938b668e1161d516
|
||||
F src/test_blob.c ae4a0620b478548afb67963095a7417cd06a4ec0a56adb453542203bfdcb31ce
|
||||
F src/test_btree.c 8b2dc8b8848cf3a4db93f11578f075e82252a274
|
||||
F src/test_config.c f0cc1f517deaa96dd384822ae2bb91534fa56aa458528b439830d709941d3932
|
||||
F src/test_config.c f0cc1f517deaa96dd384822ae2bb91534fa56aa458528b439830d709941d3932 x
|
||||
F src/test_delete.c e2fe07646dff6300b48d49b2fee2fe192ed389e834dd635e3b3bac0ce0bf9f8f
|
||||
F src/test_demovfs.c 38a459d1c78fd9afa770445b224c485e079018d6ac07332ff9bd07b54d2b8ce9
|
||||
F src/test_devsym.c 649434ed34d0b03fbd5a6b42df80f0f9a7e53f94dd1710aad5dd8831e91c4e86
|
||||
F src/test_devsym.c 649434ed34d0b03fbd5a6b42df80f0f9a7e53f94dd1710aad5dd8831e91c4e86 x
|
||||
F src/test_fs.c ba1e1dc18fd3159fdba0b9c4256f14032159785320dfbd6776eb9973cb75d480
|
||||
F src/test_func.c 24df3a346c012b1fc9e1001d346db6054deb426db0a7437e92490630e71c9b0a
|
||||
F src/test_hexio.c 9478e56a0f08e07841a014a93b20e4ba2709ab56d039d1ca8020e26846aa19bd
|
||||
F src/test_init.c f2cc4774b7c9140f76e45ecbb2ae219f68e3acbbe248c0179db666a70eae9f08
|
||||
F src/test_init.c f2cc4774b7c9140f76e45ecbb2ae219f68e3acbbe248c0179db666a70eae9f08 x
|
||||
F src/test_intarray.c 39b4181662a0f33a427748d87218e7578d913e683dc27eab7098bb41617cac71
|
||||
F src/test_intarray.h 6c3534641108cd1bea517a8e117dcba237081310a29a4c35bd2190caa8972293
|
||||
F src/test_intarray.h 6c3534641108cd1bea517a8e117dcba237081310a29a4c35bd2190caa8972293 x
|
||||
F src/test_journal.c a0b9709b2f12b1ec819eea8a1176f283bca6d688a6d4a502bd6fd79786f4e287
|
||||
F src/test_loadext.c 337056bae59f80b9eb00ba82088b39d0f4fe6dfd
|
||||
F src/test_malloc.c 21121ea85b49ec0bdb69995847cef9036ef9beca3ce63bbb776e4ea2ecc44b97
|
||||
F src/test_md5.c 0472c86d561f7f9e4ff94080100c2783196f50e583bb83375b759450c5b81802
|
||||
F src/test_multiplex.c 70479161239d65af2a231550b270e9d11ece717ad7bf0e13ef42206586e9dd7f
|
||||
F src/test_multiplex.h f0ff5b6f4462bfd46dac165d6375b9530d08089b7bcbe75e88e0926110db5363
|
||||
F src/test_mutex.c cd5bac43f2fd168f43c4326b1febe0966439217fac52afb270a6b8215f94cb40
|
||||
F src/test_md5.c 0472c86d561f7f9e4ff94080100c2783196f50e583bb83375b759450c5b81802 x
|
||||
F src/test_multiplex.c 70479161239d65af2a231550b270e9d11ece717ad7bf0e13ef42206586e9dd7f x
|
||||
F src/test_multiplex.h f0ff5b6f4462bfd46dac165d6375b9530d08089b7bcbe75e88e0926110db5363 x
|
||||
F src/test_mutex.c cd5bac43f2fd168f43c4326b1febe0966439217fac52afb270a6b8215f94cb40 x
|
||||
F src/test_onefile.c f31e52e891c5fef6709b9fcef54ce660648a34172423a9cbdf4cbce3ba0049f4
|
||||
F src/test_osinst.c d341f9d7613e007c8c3f7eba6cd307230047506aa8f97858c1fd21f5069616bd
|
||||
F src/test_pcache.c 3960cd2c1350adc992c4bf7adcfb0d1ac0574733012bd1a5f94e195928577599
|
||||
F src/test_quota.c ea44c05f29b995bdb71c55eb0c602604884e55681d59b7736e604bbcc68b0464
|
||||
F src/test_pcache.c 3960cd2c1350adc992c4bf7adcfb0d1ac0574733012bd1a5f94e195928577599 x
|
||||
F src/test_quota.c ea44c05f29b995bdb71c55eb0c602604884e55681d59b7736e604bbcc68b0464 x
|
||||
F src/test_quota.h 2a8ad1952d1d2ca9af0ce0465e56e6c023b5e15d
|
||||
F src/test_rtree.c 671f3fae50ff116ef2e32a3bf1fe21b5615b4b7b
|
||||
F src/test_schema.c f5d6067dfc2f2845c4dd56df63e66ee826fb23877855c785f75cc2ca83fd0c1b
|
||||
F src/test_shellext_c.c 9caae730dbbea057cbded37bcab0df4e5fdf87007bbe590d53c33c6044bf1d6e x
|
||||
F src/test_shellext_cpp.cpp 244f35ee4ead819ac9d3a4e91e961adfa0d74b92476697b9f3b23320a8dca68a x
|
||||
F src/test_sqllog.c 540feaea7280cd5f926168aee9deb1065ae136d0bbbe7361e2ef3541783e187a
|
||||
F src/test_superlock.c 4839644b9201da822f181c5bc406c0b2385f672e
|
||||
F src/test_syscall.c 9fdb13b1df05e639808d44fcb8f6064aaded32b6565c00b215cfd05a060d1aca
|
||||
@@ -693,40 +703,40 @@ F src/test_tclvar.c 33ff42149494a39c5fbb0df3d25d6fafb2f668888e41c0688d07273dcb26
|
||||
F src/test_thread.c 7ddcf0c8b79fa3c1d172f82f322302c963d923cdb503c6171f3c8081586d0b01
|
||||
F src/test_vdbecov.c f60c6f135ec42c0de013a1d5136777aa328a776d33277f92abac648930453d43
|
||||
F src/test_vfs.c 193c18da3dbf62a0e33ae7a240bbef938a50846672ee947664512b77d853fe81
|
||||
F src/test_vfstrace.c a2ea82df2ed8927e9eba49bdba1aa1aeb1dcb13dbf6558cff036da813031de9a
|
||||
F src/test_vfstrace.c a2ea82df2ed8927e9eba49bdba1aa1aeb1dcb13dbf6558cff036da813031de9a x
|
||||
F src/test_windirent.c a895e2c068a06644eef91a7f0a32182445a893b9a0f33d0cdb4283dca2486ac1
|
||||
F src/test_windirent.h da2e5b73c32d09905fbdd00f27cd802212a32a58ead882736fe4f5eb775ebc50
|
||||
F src/test_windirent.h da2e5b73c32d09905fbdd00f27cd802212a32a58ead882736fe4f5eb775ebc50 x
|
||||
F src/test_window.c cdae419fdcea5bad6dcd9368c685abdad6deb59e9fc8b84b153de513d394ba3f
|
||||
F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
|
||||
F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c
|
||||
F src/tokenize.c 0fb405f9adf3f757c26bfc1ae6d58ac5dccbb918917ba9e5ef0e6673a06563d3
|
||||
F src/treeview.c 1d52fbc4e97161e65858d36e3424ea6e3fc045dd8a679c82b4b9593dc30de3bd
|
||||
F src/treeview.c 1d52fbc4e97161e65858d36e3424ea6e3fc045dd8a679c82b4b9593dc30de3bd x
|
||||
F src/trigger.c ad6ab9452715fa9a8075442e15196022275b414b9141b566af8cdb7a1605f2b0
|
||||
F src/update.c 0aa36561167a7c40d01163238c297297962f31a15a8d742216b3c37cdf25f731
|
||||
F src/upsert.c 5303dc6c518fa7d4b280ec65170f465c7a70b7ac2b22491598f6d0b4875b3145
|
||||
F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0
|
||||
F src/util.c a6b41c67ff2a5379b46b77e587b2e0adb2d2ddcc5669691674ca4d28e2755ae4
|
||||
F src/vacuum.c 604fcdaebe76f3497c855afcbf91b8fa5046b32de3045bab89cc008d68e40104
|
||||
F src/vdbe.c c993304c609326cf625b4ad30cbb0e15a3f64c941cf2c9713d0c360b4abbaa98
|
||||
F src/vdbe.h 41485521f68e9437fdb7ec4a90f9d86ab294e9bb8281e33b235915e29122cfc0
|
||||
F src/vdbeInt.h 7bd49eef8f89c1a271fbf12d80a206bf56c876814c5fc6bee340f4e1907095ae
|
||||
F src/vdbeapi.c de9703f8705afc393cc2864669ce28cf9516983c8331d59aa2b978de01634365
|
||||
F src/util.c a6b41c67ff2a5379b46b77e587b2e0adb2d2ddcc5669691674ca4d28e2755ae4 x
|
||||
F src/vacuum.c 604fcdaebe76f3497c855afcbf91b8fa5046b32de3045bab89cc008d68e40104 x
|
||||
F src/vdbe.c c993304c609326cf625b4ad30cbb0e15a3f64c941cf2c9713d0c360b4abbaa98 x
|
||||
F src/vdbe.h 41485521f68e9437fdb7ec4a90f9d86ab294e9bb8281e33b235915e29122cfc0 x
|
||||
F src/vdbeInt.h 7bd49eef8f89c1a271fbf12d80a206bf56c876814c5fc6bee340f4e1907095ae x
|
||||
F src/vdbeapi.c de9703f8705afc393cc2864669ce28cf9516983c8331d59aa2b978de01634365 x
|
||||
F src/vdbeaux.c 4d5e68a3850d0b193a692eca6442d7afe35252aaf29728a67adcb542ecabd9ce
|
||||
F src/vdbeblob.c 2516697b3ee8154eb8915f29466fb5d4f1ae39ee8b755ea909cefaf57ec5e2ce
|
||||
F src/vdbemem.c 710119a8e35e47813681c48703d65a80ba22792192de90bc51dc0d6366f2a79e
|
||||
F src/vdbesort.c 0d40dca073c94e158ead752ef4225f4fee22dee84145e8c00ca2309afb489015
|
||||
F src/vdbemem.c 710119a8e35e47813681c48703d65a80ba22792192de90bc51dc0d6366f2a79e x
|
||||
F src/vdbesort.c 0d40dca073c94e158ead752ef4225f4fee22dee84145e8c00ca2309afb489015 x
|
||||
F src/vdbetrace.c fe0bc29ebd4e02c8bc5c1945f1d2e6be5927ec12c06d89b03ef2a4def34bf823
|
||||
F src/vdbevtab.c aae4bd769410eb7e1d02c42613eec961d514459b1c3c1c63cfc84e92a137daac
|
||||
F src/vtab.c 1ecf8c3745d29275688d583e12822fa984d421e0286b5ef50c137bc3bf6d7a64
|
||||
F src/vtab.c 1ecf8c3745d29275688d583e12822fa984d421e0286b5ef50c137bc3bf6d7a64 x
|
||||
F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
|
||||
F src/wal.c cbfeeb7415baa545efa244dd34bb5af4ae953a206fed720c6fa7f1ef763ec122
|
||||
F src/wal.c cbfeeb7415baa545efa244dd34bb5af4ae953a206fed720c6fa7f1ef763ec122 x
|
||||
F src/wal.h c3aa7825bfa2fe0d85bef2db94655f99870a285778baa36307c0a16da32b226a
|
||||
F src/walker.c 7c7ea0115345851c3da4e04e2e239a29983b61fb5b038b94eede6aba462640e2
|
||||
F src/where.c 2dc708cf8b6a691fb79f16bbc46567497ee6f991043318d421e294b2da114d93
|
||||
F src/whereInt.h c7d19902863beadec1d04e66aca39c0bcd60b74f05f0eaa7422c7005dfc5d51a
|
||||
F src/wherecode.c bff0bc56cb1a382de266c2db3a691135c18a4360b6ad5e069e5c415d57eb0c38
|
||||
F src/whereexpr.c dc5096eca5ed503999be3bdee8a90c51361289a678d396a220912e9cb73b3c00
|
||||
F src/window.c b7ad9cff3ce8ae6f8cc25e18e1a258426cb6bd2999aace6f5248d781b2a74098
|
||||
F src/where.c 94c90f838057e8f1ac6ab6e4caf64bbf487f4d0d33e64643731ff99e80a50b54 x
|
||||
F src/whereInt.h c7d19902863beadec1d04e66aca39c0bcd60b74f05f0eaa7422c7005dfc5d51a x
|
||||
F src/wherecode.c bff0bc56cb1a382de266c2db3a691135c18a4360b6ad5e069e5c415d57eb0c38 x
|
||||
F src/whereexpr.c dc5096eca5ed503999be3bdee8a90c51361289a678d396a220912e9cb73b3c00 x
|
||||
F src/window.c b7ad9cff3ce8ae6f8cc25e18e1a258426cb6bd2999aace6f5248d781b2a74098 x
|
||||
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
||||
F test/affinity2.test ce1aafc86e110685b324e9a763eab4f2a73f737842ec3b687bd965867de90627
|
||||
F test/affinity3.test f094773025eddf31135c7ad4cde722b7696f8eb07b97511f98585addf2a510a9
|
||||
@@ -756,7 +766,7 @@ F test/altertab2.test 62597b6fd08feaba1b6bfe7d31dac6117c67e06dc9ce9c478a3abe75b5
|
||||
F test/altertab3.test 6c432fbb9963e0bd6549bf1422f6861d744ee5a80cb3298564e81e556481df16
|
||||
F test/altertrig.test fb5951d21a2c954be3b8a8cf8e10b5c0fa20687c53fd67d63cea88d08dd058d5
|
||||
F test/amatch1.test b5ae7065f042b7f4c1c922933f4700add50cdb9f
|
||||
F test/analyze.test 2fb21d7d64748636384e6cb8998dbf83968caf644c07fcb4f76c18f2e7ede94b
|
||||
F test/analyze.test 2fb21d7d64748636384e6cb8998dbf83968caf644c07fcb4f76c18f2e7ede94b x
|
||||
F test/analyze3.test 03f4b3d794760cf15da2d85a52df9bae300e51c8fefe9c36cfae1f86dc10d23f
|
||||
F test/analyze4.test 68bd069f3ac7ac1e652ddd9f04f57d5606ddb4208450f5297005db7aa0dd707d
|
||||
F test/analyze5.test fa5131952303ac4146aba101b116b9c8cb89e2637531c334a6df7f7d19dddc0d
|
||||
@@ -792,7 +802,7 @@ F test/autoinc.test 997d6f185f138229dc4251583a1d04816423dddc2fc034871a01aeb1d728
|
||||
F test/autoindex1.test d34caffb0384003ee28eae87679214c029e9be4b332d9649a79e0b94ab70502c
|
||||
F test/autoindex2.test 12ef578928102baaa0dc23ad397601a2f4ecb0df
|
||||
F test/autoindex3.test dcd6b2f8bed2be67b131e2e671f892e971d934e24fd00988952d0e0a67e24aa7
|
||||
F test/autoindex4.test 3c2105e9172920e26f950ba3c5823e4972190e022c1e6f260ba476b0af24c593
|
||||
F test/autoindex4.test 3c2105e9172920e26f950ba3c5823e4972190e022c1e6f260ba476b0af24c593 x
|
||||
F test/autoindex5.test 2ee94f033b87ca0160e08d81034c507aff8e230df2627f0304fa309b2fee19a3
|
||||
F test/autovacuum.test 00671369bbf96c6a49989a9425f5b78b94075d6a4b031e5e00000c2c32f365df
|
||||
F test/autovacuum2.test 76f7eb4fe6a6bf6d33a196a7141dba98886d2fb53a268d7feca285d5da4759d7
|
||||
@@ -884,7 +894,7 @@ F test/conflict2.test 5557909ce683b1073982f5d1b61dfb1d41e369533bfdaf003180c5bc87
|
||||
F test/conflict3.test 81865d9599609aca394fb3b9cd5f561d4729ea5b176bece3644f6ecb540f88ac
|
||||
F test/contrib01.test 2a1cbc0f2f48955d7d073f725765da6fbceda6b4
|
||||
F test/corrupt.test d7cb0300e4a297147b6a05e92a1684bc8973635c3bcaa3d66e983c9cbdbf47a3
|
||||
F test/corrupt2.test 9745c55b3ff2d84d9b6dc4f7365f91a99e70d90f3127ebc97ff0549c418e4d3d
|
||||
F test/corrupt2.test 9745c55b3ff2d84d9b6dc4f7365f91a99e70d90f3127ebc97ff0549c418e4d3d x
|
||||
F test/corrupt3.test 6a982535d52c8165654cbc79a043cfd0bf02495a5efbf4754295e056fc548539
|
||||
F test/corrupt4.test b5ae41607e8d17d9c1f3e94fdb572ce061ed3beeebdb46fb3a348181b8c8a097
|
||||
F test/corrupt5.test 387be3250795e2a86e6234745558b80efb248a357d0cd8e53bce75c7463f545d
|
||||
@@ -1122,7 +1132,7 @@ F test/fuzz3.test 9c813e6613b837cb7a277b0383cd66bfa07042b4cf0317157c35852f30043c
|
||||
F test/fuzz4.test c229bcdb45518a89e1d208a21343e061503460ac69fae1539320a89f572eb634
|
||||
F test/fuzz_common.tcl b7197de6ed1ee8250a4f82d67876f4561b42ee8cbbfc6160dcb66331bad3f830
|
||||
F test/fuzz_malloc.test f348276e732e814802e39f042b1f6da6362a610af73a528d8f76898fde6b22f2
|
||||
F test/fuzzcheck.c 29a2f0237553375498f891c9487a2ef3267b47deecc5d5b4335fa37f904cb8d3
|
||||
F test/fuzzcheck.c 29a2f0237553375498f891c9487a2ef3267b47deecc5d5b4335fa37f904cb8d3 x
|
||||
F test/fuzzdata1.db 3e86d9cf5aea68ddb8e27c02d7dfdaa226347426c7eb814918e4d95475bf8517
|
||||
F test/fuzzdata2.db 128b3feeb78918d075c9b14b48610145a0dd4c8d6f1ca7c2870c7e425f5bf31f
|
||||
F test/fuzzdata3.db c6586d3e3cef0fbc18108f9bb649aa77bfc38aba
|
||||
@@ -1202,18 +1212,18 @@ F test/join.test f7abfef3faeaf2800308872e33a57e5b6e4a2b44fb8c6b90c6068412e71a6cf
|
||||
F test/join2.test 8561fe82ce434ac96de91544072e578dc2cadddf2d9bc9cd802f866a9b92502e
|
||||
F test/join3.test 6f0c774ff1ba0489e6c88a3e77b9d3528fb4fda0
|
||||
F test/join4.test 1a352e4e267114444c29266ce79e941af5885916
|
||||
F test/join5.test 7cc3f3595bb41e60f3f96d5cb6dd8cfcbc31212f0136bba6fc081c082994a94a
|
||||
F test/join5.test 7cc3f3595bb41e60f3f96d5cb6dd8cfcbc31212f0136bba6fc081c082994a94a x
|
||||
F test/join6.test f809c025fa253f9e150c0e9afd4cef8813257bceeb6f46e04041228c9403cc2c
|
||||
F test/join7.test 2268dcbb54b724391dda3748ea95c60d960607ffeed67885675998e7117697f6
|
||||
F test/join8.test d384d63985e3991c404afccadaf3efd1cdf9cd72680167f80e3cb80b95c18c68
|
||||
F test/join9.test 9056ddd3b0c0f4f9d658f4521038d9a37dc23ead8ca9a505d0b0db2b6a471e05
|
||||
F test/joinA.test 6ac4efdbb1eb9ca398162c5bc5623a757803b04bb4d76453c8563a0bdc2f73bd
|
||||
F test/joinA.test 6ac4efdbb1eb9ca398162c5bc5623a757803b04bb4d76453c8563a0bdc2f73bd x
|
||||
F test/joinB.test 1b2ba3fc8568b49411787fccbf540570c148e9b6a53a30f80691cb6268098ded
|
||||
F test/joinC.test 1f1a602c2127f55f136e2cbd3bf2d26546614bf8cffe5902ec1ac9c07f87f207
|
||||
F test/joinD.test 2ce62e7353a0702ca5e70008faf319c1d4686aa19fba34275c6d1da0e960be28
|
||||
F test/joinE.test d5d182f3812771e2c0d97c9dcf5dbe4c41c8e21c82560e59358731c4a3981d6b
|
||||
F test/joinF.test 53dd66158806823ea680dd7543b5406af151b5aafa5cd06a7f3231cd94938127
|
||||
F test/joinH.test c9550bb6a0257cf99668a28485bb309bac542081702e89261b95542ab5f676b1
|
||||
F test/joinH.test c9550bb6a0257cf99668a28485bb309bac542081702e89261b95542ab5f676b1 x
|
||||
F test/journal1.test c7b768041b7f494471531e17abc2f4f5ebf9e5096984f43ed17c4eb80ba34497
|
||||
F test/journal2.test 9dac6b4ba0ca79c3b21446bbae993a462c2397c4
|
||||
F test/journal3.test 7c3cf23ffc77db06601c1fcfc9743de8441cb77db9d1aa931863d94f5ffa140e
|
||||
@@ -1232,7 +1242,7 @@ F test/json105.test 11670a4387f4308ae0318cadcbd6a918ea7edcd19fbafde020720a073952
|
||||
F test/json501.test f71710f60fa45b19dc336fbaac9e8362f70f80cf81badefdb845ed3f7c7c2ccc
|
||||
F test/json502.test 98c38e3c4573841028a1381dfb81d4c3f9b105d39668167da10d055e503f6d0b
|
||||
F test/keyword1.test 37ef6bba5d2ed5b07ecdd6810571de2956599dff
|
||||
F test/kvtest.c 6e0228409ea7ca0497dad503fbd109badb5e59545d131014b6aaac68b56f484a
|
||||
F test/kvtest.c 6e0228409ea7ca0497dad503fbd109badb5e59545d131014b6aaac68b56f484a x
|
||||
F test/lastinsert.test 42e948fd6442f07d60acbd15d33fb86473e0ef63
|
||||
F test/laststmtchanges.test ae613f53819206b3222771828d024154d51db200
|
||||
F test/lemon-test01.y 58b764610fd934e189ffbb0bbfa33d171b9cb06019b55bdc04d090d6767e11d7
|
||||
@@ -1362,7 +1372,7 @@ F test/pcache.test c8acbedd3b6fd0f9a7ca887a83b11d24a007972b
|
||||
F test/pcache2.test af7f3deb1a819f77a6d0d81534e97d1cf62cd442
|
||||
F test/pendingrace.test cbdf0f74bc939fb43cebad64dda7a0b5a3941a10b7e9cc2b596ff3e423a18156
|
||||
F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff
|
||||
F test/permutations.test 8bd6b6db541e2a7f9bb894be99ef5c00526b23762c4a00c574e1cba697495125
|
||||
F test/permutations.test aeebc29c7b225487c0235fc8be65f51e2cc19c7ff00c4c0c342315ca6957c0d1
|
||||
F test/pg_common.tcl 3b27542224db1e713ae387459b5d117c836a5f6e328846922993b6d2b7640d9f
|
||||
F test/pragma.test 57a36226218c03cfb381019fe43234b2cefbd8a1f12825514f906a17ccf7991e
|
||||
F test/pragma2.test e5d5c176360c321344249354c0c16aec46214c9f
|
||||
@@ -1375,7 +1385,7 @@ F test/printf.test 512152dca7f2f578f045a5a732e7bee08e4f47a8a212f83ce46791b518eba
|
||||
F test/printf2.test 3f55c1871a5a65507416076f6eb97e738d5210aeda7595a74ee895f2224cce60
|
||||
F test/progress.test ebab27f670bd0d4eb9d20d49cef96e68141d92fb
|
||||
F test/ptrchng.test ef1aa72d6cf35a2bbd0869a649b744e9d84977fc
|
||||
F test/pushdown.test 1495a09837a1cedfc0adf07ba42dc6b83be05a2c15de331b67c39a0e22078238
|
||||
F test/pushdown.test 1495a09837a1cedfc0adf07ba42dc6b83be05a2c15de331b67c39a0e22078238 x
|
||||
F test/queryonly.test 5f653159e0f552f0552d43259890c1089391dcca
|
||||
F test/quick.test 1681febc928d686362d50057c642f77a02c62e57
|
||||
F test/quickcheck.test f86b25b33455af0189b4d3fe7bd6e553115e80b2d7ec9bbe9a6b37fce0881bfe
|
||||
@@ -1391,7 +1401,7 @@ F test/recover.test fd5199f928757cb308661b5fdca1abc19398a798ff7f24b57c3071e9f8e0
|
||||
F test/regexp1.test 8f2a8bc1569666e29a4cee6c1a666cd224eb6d50e2470d1dc1df995170f3e0f1
|
||||
F test/regexp2.test 55ed41da802b0e284ac7e2fe944be3948f93ff25abbca0361a609acfed1368b5
|
||||
F test/reindex.test cd9d6021729910ece82267b4f5e1b5ac2911a7566c43b43c176a6a4732e2118d
|
||||
F test/releasetest_data.tcl b550dd1b122a9c969df794d05ea272df535f10ff1a245062e7ba080822378016
|
||||
F test/releasetest_data.tcl 59400d9e7acbfebdabd87ae89a2b979867af3ce8f2a95c0fb801e8a4781f1f4a
|
||||
F test/resetdb.test 54c06f18bc832ac6d6319e5ab23d5c8dd49fdbeec7c696d791682a8006bd5fc3
|
||||
F test/resolver01.test f4022acafda7f4d40eca94dbf16bc5fc4ac30ceb
|
||||
F test/returning1.test db532cde29d6aebbc48c6ddc3149b30476f8e69ca7a2c4b53986c7635e6fd8ec
|
||||
@@ -1468,14 +1478,16 @@ F test/sharedA.test 64bdd21216dda2c6a3bd3475348ccdc108160f34682c97f2f51c19fc0e21
|
||||
F test/sharedB.test 1a84863d7a2204e0d42f2e1606577c5e92e4473fa37ea0f5bdf829e4bf8ee707
|
||||
F test/shared_err.test 32634e404a3317eeb94abc7a099c556a346fdb8fb3858dbe222a4cbb8926a939
|
||||
F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304
|
||||
F test/shell1.test 300b77328aaafb9f3e7a53a26e4162fbf92181d92251d259ff105a2275ff998d
|
||||
F test/shell2.test 35226c070a8c7f64fd016dfac2a0db2a40f709b3131f61daacd9dad61536c9cb
|
||||
F test/shell3.test 91febeac0412812bf6370abb8ed72700e32bf8f9878849414518f662dfd55e8a
|
||||
F test/shell4.test 9abd0c12a7e20a4c49e84d5be208d2124fa6c09e728f56f1f4bee0f02853935f
|
||||
F test/shell5.test c8b6c54f26ec537f8558273d7ed293ca3725ef42e6b12b8f151718628bd1473b
|
||||
F test/shell1.test cac1fd2d681e0b79de9488069e4b2287da30788ce96a34788cbffbfe57e7b0a4
|
||||
F test/shell2.test c4471c97c0da342c9b02160abd5263de118b4bbb411b3318ee2a179d7bf18a08
|
||||
F test/shell3.test 5dc710deede6e811e7af2bd91867d4128f023edc5a6cff6b8ad89e32af54c033
|
||||
F test/shell4.test 8116d7b9dbefe6e2237908afbd6738637e0426486373231d3ad8984471d4e04c
|
||||
F test/shell5.test ec82248dda87329f7dfced8637515b68db4ee75d94c8129dc017376fb61a8247
|
||||
F test/shell6.test 1ceb51b2678c472ba6cf1e5da96679ce8347889fe2c3bf93a0e0fa73f00b00d3
|
||||
F test/shell7.test 115132f66d0463417f408562cc2cf534f6bbc6d83a6d50f0072a9eb171bae97f
|
||||
F test/shell8.test 3fd093d481aaa94dc77fb73f1044c1f19c7efe3477a395cc4f7450133bc54915
|
||||
F test/shell_x/shell10.test 43c0b10cb4998c91b18861efef9466f6170e43c17a76e28600356a1cb6b41cf4
|
||||
F test/shell_x/shell9.test 867be89a86bc0c2fcf73e4759c85fd38d7e15fef71238e725ba4b6ca6897a0af
|
||||
F test/shmlock.test 3dbf017d34ab0c60abe6a44e447d3552154bd0c87b41eaf5ceacd408dd13fda5
|
||||
F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3
|
||||
F test/show_speedtest1_rtree.tcl 32e6c5f073d7426148a6936a0408f4b5b169aba5
|
||||
@@ -1514,7 +1526,7 @@ F test/spellfix.test 951a6405d49d1a23d6b78027d3877b4a33eeb8221dcab5704b499755bb4
|
||||
F test/spellfix2.test dfc8f519a3fc204cb2dfa8b4f29821ae90f6f8c3
|
||||
F test/spellfix3.test 0f9efaaa502a0e0a09848028518a6fb096c8ad33
|
||||
F test/spellfix4.test 51c7c26514ade169855c66bcf130bd5acfb4d7fd090cc624645ab275ae6a41fb
|
||||
F test/sqldiff1.test 1b7ab4f312442c5cc6b3a5f299fa8ca051416d1dd173cb1126fd51bf64f2c3fb
|
||||
F test/sqldiff1.test 1b7ab4f312442c5cc6b3a5f299fa8ca051416d1dd173cb1126fd51bf64f2c3fb x
|
||||
F test/sqllimits1.test b28e5cc8d337aaf290614d96a47e8fbfb720bb7ad35620c9d5432996fd413ac4
|
||||
F test/sqllog.test 6af6cb0b09f4e44e1917e06ce85be7670302517a
|
||||
F test/startup.c 1beb5ca66fcc0fce95c3444db9d1674f90fc605499a574ae2434dcfc10d22805
|
||||
@@ -1553,7 +1565,7 @@ F test/temptable.test d2c9b87a54147161bcd1822e30c1d1cd891e5b30
|
||||
F test/temptable2.test 76821347810ecc88203e6ef0dd6897b6036ac788e9dd3e6b04fd4d1631311a16
|
||||
F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637
|
||||
F test/temptrigger.test 38f0ca479b1822d3117069e014daabcaacefffcc
|
||||
F test/tester.tcl 68454ef88508c196d19e8694daa27bff7107a91857799eaa12f417188ae53ede
|
||||
F test/tester.tcl 176a2ea601e01ad15450fbbb88b28ae66efbf94e684f52307741b26206f1cefb
|
||||
F test/testrunner.tcl 59490f189cac99b16b0376d0cc0a7ecfb753a84b89c9f4c361af337d88db53ac
|
||||
F test/testrunner_data.tcl 8169c68654ac8906833b8a6aadca973358a441ebf88270dd05c153e5f96f76b8
|
||||
F test/thread001.test a0985c117eab62c0c65526e9fa5d1360dd1cac5b03bde223902763274ce21899
|
||||
@@ -1571,7 +1583,7 @@ F test/threadtest3.c 655bff6c0895ec03f014126aa65e808fac9aae8c5a7a7da58a510cbe8b4
|
||||
F test/threadtest4.c c1e67136ceb6c7ec8184e56ac61db28f96bd2925
|
||||
F test/threadtest5.c 9b4d782c58d8915d7e955ff8051f3d03628bda0d33b82971ea8c0f2f2808c421
|
||||
F test/time-wordcount.sh 8e0b0f8109367827ad5d58f5cc849705731e4b90
|
||||
F test/timediff1.test d982b2b5f1b22f58380c5db94ea5b17518d50ad0c55583cf0ecfa0b176e20888
|
||||
F test/timediff1.test d982b2b5f1b22f58380c5db94ea5b17518d50ad0c55583cf0ecfa0b176e20888 x
|
||||
F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c
|
||||
F test/tkt-18458b1a.test 6a62cb1ee50fa3c620da59e3a6f531eb38fceaf7e2166203816b724524e6f1d6
|
||||
F test/tkt-26ff0c2d1e.test c15bec890c4d226c0da2f35ff30f9e84c169cfef90e73a8cb5cec11d723dfa96
|
||||
@@ -1768,7 +1780,7 @@ F test/upfrom1.tcl 8859d9d437f03b44174c4524a7a734a391fd4526fcff65be08285dafc9dc9
|
||||
F test/upfrom1.test 8cb06689e99cd707d884faa16da0e8eb26ff658bb01c47ddf72fadade666e6e1
|
||||
F test/upfrom2.test 66f3ebf721b3cebd922faee5c386bf244f816d416b57c000753ff51af62328a1
|
||||
F test/upfrom3.test 6130f24ebf97f5ea865e5d2a14a2d543fe5428a62e87cc60f62d875e45c1f5f0
|
||||
F test/upfrom4.test 78f742a6577c91a7a55c64edb8811004e7c6aa99b8d57b2320f70a918c357807
|
||||
F test/upfrom4.test 78f742a6577c91a7a55c64edb8811004e7c6aa99b8d57b2320f70a918c357807 x
|
||||
F test/upfromfault.test 3a10075a0043f0c4fad6614b2c371f88a8ba5a4acab68b907438413865d6a8d6
|
||||
F test/upsert1.test b0ae2f58680c5205b4bc1cdeed3c3d444057c506f6c44494fa3eac60731d68a2
|
||||
F test/upsert2.test 720e94d09f7362a282bc69b3c6b83d51daeaaf0440eb4920a08b86518b8c7496
|
||||
@@ -1856,7 +1868,7 @@ F test/walslow.test c05c68d4dc2700a982f89133ce103a1a84cc285f
|
||||
F test/walthread.test 14b20fcfa6ae152f5d8e12f5dc8a8a724b7ef189f5d8ef1e2ceab79f2af51747
|
||||
F test/walvfs.test e1a6ad0f3c78e98b55c3d5f0889cf366cc0d0a1cb2bccb44ac9ec67384adc4a1
|
||||
F test/wapp.tcl b440cd8cf57953d3a49e7ee81e6a18f18efdaf113b69f7d8482b0710a64566ec
|
||||
F test/wapptest.tcl 1bea58a6a8e68a73f542ee4fca28b771b84ed803bd0c9e385087070b3d747b3c x
|
||||
F test/wapptest.tcl 15ef56ed36b6b03f3ffeb7e1692ec4286bf909c0daa9bbe6215daa9f324fbf3a x
|
||||
F test/where.test 59abb854eee24f166b5f7ba9d17eb250abc59ce0a66c48912ffb10763648196d
|
||||
F test/where2.test 03c21a11e7b90e2845fc3c8b4002fc44cc2797fa74c86ee47d70bd7ea4f29ed6
|
||||
F test/where3.test 5b4ffc0ac2ea0fe92f02b1244b7531522fe4d7bccf6fa8741d54e82c10e67753
|
||||
@@ -1882,13 +1894,13 @@ F test/whereM.test 0dbc9998783458ddcf3cc078ca7c2951d8b2677d472ecf0028f449ed327c0
|
||||
F test/wherefault.test 6cf2a9c5712952d463d3f45ebee7f6caf400984df51a195d884cfb7eb0e837a7
|
||||
F test/wherelfault.test 9012e4ef5259058b771606616bd007af5d154e64cc25fa9fd4170f6411db44e3
|
||||
F test/wherelimit.test afb46397c6d7e964e6e294ba3569864a0c570fe3807afc634236c2b752372f31
|
||||
F test/wherelimit2.test b9e4bfe7b4d7c2f85f99cf2bd2c51369378d04b1f3d1b60557423752003bfd90
|
||||
F test/wherelimit2.test b9e4bfe7b4d7c2f85f99cf2bd2c51369378d04b1f3d1b60557423752003bfd90 x
|
||||
F test/widetab1.test c296a98e123762de79917350e45fa33fdf88577a2571eb3a64c8bf7e44ef74d1
|
||||
F test/win32heap.test 10fd891266bd00af68671e702317726375e5407561d859be1aa04696f2aeee74
|
||||
F test/win32lock.test e0924eb8daac02bf80e9da88930747bd44dd9b230b7759fed927b1655b467c9c
|
||||
F test/win32longpath.test 4baffc3acb2e5188a5e3a895b2b543ed09e62f7c72d713c1feebf76222fe9976
|
||||
F test/win32nolock.test ac4f08811a562e45a5755e661f45ca85892bdbbc
|
||||
F test/window1.test 1e7e13d36235b9a08fcb9790f2b05383f2f8c9538532b027f455766686926114
|
||||
F test/window1.test 1e7e13d36235b9a08fcb9790f2b05383f2f8c9538532b027f455766686926114 x
|
||||
F test/window2.tcl 492c125fa550cda1dd3555768a2303b3effbeceee215293adf8871efc25f1476
|
||||
F test/window2.test e466a88bd626d66edc3d352d7d7e1d5531e0079b549ba44efb029d1fbff9fd3c
|
||||
F test/window3.tcl acea6e86a4324a210fd608d06741010ca83ded9fde438341cb978c49928faf03
|
||||
@@ -1940,7 +1952,7 @@ F tool/build-all-msvc.bat c817b716e0edeecaf265a6775b63e5f45c34a6544f1d4114a22270
|
||||
F tool/build-shell.sh 950f47c6174f1eea171319438b93ba67ff5bf367
|
||||
F tool/cg_anno.tcl c1f875f5a4c9caca3d59937b16aff716f8b1883935f1b4c9ae23124705bc8099 x
|
||||
F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2
|
||||
F tool/custom.txt 6cdf298f43e1db4bb91406d14777669b8fb1df790837823fa6754c4308decc27
|
||||
F tool/custom.txt ed0e9237b8dcc0f7c203d0dc20aa5aaa9ef8680d9396fb382d4f371df9afa157 x
|
||||
F tool/dbhash.c 5da0c61032d23d74f2ab84ffc5740f0e8abec94f2c45c0b4306be7eb3ae96df0
|
||||
F tool/dbtotxt.c ca48d34eaca6d6b6e4bd6a7be2b72caf34475869054240244c60fa7e69a518d6
|
||||
F tool/dbtotxt.md c9a57af8739957ef36d2cfad5c4b1443ff3688ed33e4901ee200c8b651f43f3c
|
||||
@@ -1955,7 +1967,7 @@ F tool/genfkey.test b6afd7b825d797a1e1274f519ab5695373552ecad5cd373530c63533638a
|
||||
F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce
|
||||
F tool/index_usage.c f62a0c701b2c7ff2f3e21d206f093c123f222dbf07136a10ffd1ca15a5c706c5
|
||||
F tool/kvtest-speed.sh 4761a9c4b3530907562314d7757995787f7aef8f
|
||||
F tool/lemon.c 19e368bc8e97ff4071115119a7911ca3b0c56eba7926d8ada8b4a86fcc69a176
|
||||
F tool/lemon.c 19e368bc8e97ff4071115119a7911ca3b0c56eba7926d8ada8b4a86fcc69a176 x
|
||||
F tool/lempar.c 57478ea48420da05faa873c6d1616321caa5464644588c97fbe8e0ea04450748
|
||||
F tool/libvers.c caafc3b689638a1d88d44bc5f526c2278760d9b9
|
||||
F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862
|
||||
@@ -1966,16 +1978,16 @@ F tool/mkautoconfamal.sh f62353eb6c06ab264da027fd4507d09914433dbdcab9cb011cdc180
|
||||
F tool/mkccode.tcl 86463e68ce9c15d3041610fedd285ce32a5cf7a58fc88b3202b8b76837650dbe x
|
||||
F tool/mkctimec.tcl 38e3db33210a200aae791635125052a643a27aa0619a0debf19aa9c55e1b2dde x
|
||||
F tool/mkkeywordhash.c b9faa0ae7e14e4dbbcd951cddd786bf46b8a65bb07b129ba8c0cfade723aaffd
|
||||
F tool/mkmsvcmin.tcl 8897d515ef7f94772322db95a3b6fce6c614d84fe0bdd06ba5a1c786351d5a1d
|
||||
F tool/mkmsvcmin.tcl 8897d515ef7f94772322db95a3b6fce6c614d84fe0bdd06ba5a1c786351d5a1d x
|
||||
F tool/mkopcodec.tcl 33d20791e191df43209b77d37f0ff0904620b28465cca6990cf8d60da61a07ef
|
||||
F tool/mkopcodeh.tcl 769d9e6a8b462323150dc13a8539d6064664b72974f7894befe2491cc73e05cd
|
||||
F tool/mkopts.tcl 680f785fdb09729fd9ac50632413da4eadbdf9071535e3f26d03795828ab07fa
|
||||
F tool/mkpragmatab.tcl bd07bd59d45d0f3448e123d6937e9811195f9908a51e09d774609883055bfd3d
|
||||
F tool/mkshellc.tcl b7adf08b82de60811d2cb6af05ff59fc17e5cd6f3e98743c14eaaa3f8971fed0
|
||||
F tool/mkshellc.tcl 602b339e31af1a95943b3da1280645bcc16f7c53b861c1e337a06b08fb410cbd x
|
||||
F tool/mksourceid.c 36aa8020014aed0836fd13c51d6dc9219b0df1761d6b5f58ff5b616211b079b9
|
||||
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
|
||||
F tool/mksqlite3c-noext.tcl 4f7cfef5152b0c91920355cbfc1d608a4ad242cb819f1aea07f6d0274f584a7f
|
||||
F tool/mksqlite3c.tcl 44bc3bdb675a9e3a507f4d82575332bccd7e6f830a47c9aa29460ea2240593a9
|
||||
F tool/mksqlite3c.tcl 44bc3bdb675a9e3a507f4d82575332bccd7e6f830a47c9aa29460ea2240593a9 x
|
||||
F tool/mksqlite3h.tcl d391cff7cad0a372ee1406faee9ccc7dad9cb80a0c95cae0f73d10dd26e06762
|
||||
F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b
|
||||
F tool/mkvsix.tcl b9e0777a213c23156b6542842c238479e496ebf5
|
||||
@@ -2002,13 +2014,13 @@ F tool/speedtest16.c ecb6542862151c3e6509bbc00509b234562ae81e
|
||||
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
||||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||
F tool/speedtest8inst1.c 7ce07da76b5e745783e703a834417d725b7d45fd
|
||||
F tool/spellsift.tcl 52b4b04dc4333c7ab024f09d9d66ed6b6f7c6eb00b38497a09f338fa55d40618 x
|
||||
F tool/spellsift.tcl 2265f37504e68b73c659a3a09cb4354da9b24de7d5d21b91e1ba1fb62040d0b9 x
|
||||
F tool/split-sqlite3c.tcl 5aa60643afca558bc732b1444ae81a522326f91e1dc5665b369c54f09e20de60
|
||||
F tool/sqldiff.c 2a693b4e7c1818c23f871f82f0c3fe67d80b67e3f087893089d33da29c1e387e
|
||||
F tool/sqldiff.c 2a693b4e7c1818c23f871f82f0c3fe67d80b67e3f087893089d33da29c1e387e x
|
||||
F tool/sqlite3_analyzer.c.in f88615bf33098945e0a42f17733f472083d150b58bdaaa5555a7129d0a51621c
|
||||
F tool/sqltclsh.c.in 1bcc2e9da58fadf17b0bf6a50e68c1159e602ce057210b655d50bad5aaaef898
|
||||
F tool/sqltclsh.tcl 862f4cf1418df5e1315b5db3b5ebe88969e2a784525af5fbf9596592f14ed848
|
||||
F tool/src-verify.c f0cef434a8d8629c4928a02a644fb85e33c8b875a7f2352ba68cc50965a7d213
|
||||
F tool/src-verify.c f0cef434a8d8629c4928a02a644fb85e33c8b875a7f2352ba68cc50965a7d213 x
|
||||
F tool/srcck1.c 371de5363b70154012955544f86fdee8f6e5326f
|
||||
F tool/stack_usage.tcl f8e71b92cdb099a147dad572375595eae55eca43
|
||||
F tool/stripccomments.c 20b8aabc4694d0d4af5566e42da1f1a03aff057689370326e9269a9ddcffdc37
|
||||
@@ -2041,8 +2053,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 41580ba452fdbc3f73da60d8030289d38614c4cab8d24140d7cc44a54b2da8d2
|
||||
R 479219669b5b9c2257f0511e6dc18154
|
||||
U drh
|
||||
Z e7211a376de07c93dd5c0d56ad175411
|
||||
P 8e6e54e48c1739c76db3e7979669cf17f7cee471b1d37836adbf72f42e8b8972
|
||||
R db9f200e78afd22e89e390013ee62ac1
|
||||
U larrybr
|
||||
Z 37d4318428ec7c3e6ea82cfaff778402
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
24927c1377314a10177da4a57191593440aa97fd0c5949fdf25a22df1d947600
|
||||
eccffaa7ca97828202c26341dca615fb762922c221be12a60b14858cdbe5e91d
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Executable
+121
@@ -0,0 +1,121 @@
|
||||
#ifndef OBJIFACE_H
|
||||
#define OBJIFACE_H
|
||||
|
||||
/* This header defines macros to aid declaration of object interfaces
|
||||
* used for shell extension, and to support convenient implementation
|
||||
* of those interfaces.[a] These macros are suitable for either C or
|
||||
* C++ implementations. For C implementations, an extra struct is
|
||||
* defined, whose typename is <InterfaceName>_Vtable, which will need
|
||||
* to be instantiated and populated with function pointers having the
|
||||
* same order and signatures as those declared for the interface. For
|
||||
* C++ implementations, a purely abstract base class (with all public
|
||||
* methods) is declared from which a concrete class will need to be
|
||||
* derived and instantiated. (No *_Vtable is necessary for C++.)
|
||||
*
|
||||
* The macros defined for external use are:
|
||||
* (for C or C++ implementations)
|
||||
* INTERFACE_BEGIN( InterfaceName )
|
||||
* PURE_VMETHOD( returnType, methodName, InterfaceName, argCount, args )
|
||||
* INTERFACE_END( InterfaceName )
|
||||
* IMPLEMENTING( returnType, methodName, ClassName, argCount, args ) [b]
|
||||
* (for C implementations only)
|
||||
* VTABLE_NAME( ClassName ) [c]
|
||||
* DECORATE_METHOD( DerivedName, methodName )
|
||||
* (for C++ implementations only [d])
|
||||
* CONCRETE_BEGIN( InterfaceName, DerivedName )
|
||||
* CONCRETE_METHOD( returnType, methodName, ClassName, argCount, args )
|
||||
* CONCRETE_END( DerivedName )
|
||||
* Notes on these macros:
|
||||
* 1. These macros should be used in the order shown. Many should be
|
||||
* terminated with either ';' or a curly-braced construct. (This
|
||||
* helps auto-indentation tools to operate usefully or sanely.)
|
||||
* 2. The "args" parameter is a parenthesized list of the additional
|
||||
* arguments, those beyond an explicit "InterfaceName *pThis" for C
|
||||
* or the implicit "this" for C++.
|
||||
* 3. The argCount parameter must number the additional arguments.
|
||||
* 4. A leading method, named "destruct" without additional arguments
|
||||
* and returning void, is declared for all interfaces. This is not
|
||||
* the C++ destructor. (It may sometimes delegate to a destructor.)
|
||||
* [a. The convenience is that the signatures from the interface may
|
||||
* be reused for method implementations with a copy and paste. ]
|
||||
* [b. This macro may be useful for function/method definitions which
|
||||
* implement methods in an INTERFACE_{BEGIN,...,END} sequence. ]
|
||||
* [c. This macro is useful for populating a C dispatch table whose
|
||||
* layout is declared in the INTERFACE_{BEGIN,...,END} sequence. ]
|
||||
* [d. These macros are useful for declaring instantiatable classes
|
||||
* derived from an abstract base class via INTERFACE_{BEGIN,END}. ]
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
# define VMETHOD_BEGIN(rType, mName) virtual rType mName(
|
||||
# define PURE_VMETHOD_END )=0
|
||||
#define ARG_FIRST_0(t)
|
||||
#define ARG_FIRST_1(t)
|
||||
#else
|
||||
# define VMETHOD_BEGIN(rType, mName) rType (*mName)(
|
||||
# define PURE_VMETHOD_END )
|
||||
#define ARG_FIRST_0(t) t *pThis
|
||||
#define ARG_FIRST_1(t) t *pThis,
|
||||
#endif
|
||||
#define ARG_FIRST_2 ARG_FIRST_1
|
||||
#define ARG_FIRST_3 ARG_FIRST_1
|
||||
#define ARG_FIRST_4 ARG_FIRST_1
|
||||
#define ARG_FIRST_5 ARG_FIRST_1
|
||||
#define ARGS_EXPAND(na) ARGS_EXPAND_ ## na
|
||||
#define ARGS_EXPAND_0()
|
||||
#define ARGS_EXPAND_1(a1) a1
|
||||
#define ARGS_EXPAND_2(a1,a2) a1,a2
|
||||
#define ARGS_EXPAND_3(a1,a2,a3) a1,a2,a3
|
||||
#define ARGS_EXPAND_4(a1,a2,a3,a4) a1,a2,a3,a4
|
||||
#define ARGS_EXPAND_5(a1,a2,a3,a4,a5) a1,a2,a3,a4,a5
|
||||
|
||||
#define PURE_VMETHOD(rt, mn, ot, na, args) VMETHOD_BEGIN(rt, mn) \
|
||||
ARG_FIRST_ ## na(ot) ARGS_EXPAND(na)args PURE_VMETHOD_END
|
||||
#define CONCRETE_METHOD(rt, mn, ot, na, args) rt (*mn)( \
|
||||
ARG_FIRST_ ## na(ot) ARGS_EXPAND(na)args )
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define INTERFACE_BEGIN(iname) struct iname { virtual void destruct() = 0
|
||||
# define INTERFACE_END(iname) };
|
||||
# define CONCRETE_BEGIN(iname, derived) class derived : public iname { \
|
||||
CONCRETE_METHOD(void, destruct, derived, 0, ())
|
||||
# define CONCRETE_END(derived) }
|
||||
# define DEFINE_METHOD(rt, mn, derived, na, args) rt derived::mn( \
|
||||
ARG_FIRST_ ## na(derived) ARGS_EXPAND(na)args )
|
||||
#else
|
||||
# define VTABLE_NAME(name) name ## _Vtable
|
||||
# define INTERFACE_BEGIN(iname) typedef struct iname { \
|
||||
struct VTABLE_NAME(iname) * pMethods; \
|
||||
} iname; typedef struct VTABLE_NAME(iname) { \
|
||||
PURE_VMETHOD(void, destruct, iname, 0, ())
|
||||
# define INTERFACE_END(iname) } VTABLE_NAME(iname)
|
||||
|
||||
#define DERIVED_METHOD(rt, mn, ot,dt, na, args) rt DECORATE_METHOD(dt,mn)( \
|
||||
ARG_FIRST_ ## na(ot) ARGS_EXPAND(na)args )
|
||||
|
||||
# define CONCRETE_BEGIN(iname, derived) struct VTABLE_NAME(derived) { \
|
||||
CONCRETE_METHOD(void, destruct, iname, 0, ())
|
||||
# define CONCRETE_END(derived) }
|
||||
# define INSTANCE_BEGIN(derived) struct derived { \
|
||||
struct VTABLE_NAME(derived) *pMethods
|
||||
# define INSTANCE_END(derived) }
|
||||
|
||||
# define DECORATE_METHOD(ot, mn) ot ## _ ## mn
|
||||
# define DEFINE_METHOD(rt, mn, ot, na, args) rt DECORATE_METHOD(ot, mn)( \
|
||||
ARG_FIRST_ ## na(ot) ARGS_EXPAND(na)args )
|
||||
#endif
|
||||
|
||||
/* Some preprocessing to make struct type definitions usable for C and C++
|
||||
* code using just the typename. Usage:
|
||||
* AGGTYPE_BEGIN(Whatever) { member; ... } AGGTYPE_END(Whatever);
|
||||
*/
|
||||
#ifndef __cplusplus
|
||||
#define AGGTYPE_BEGIN(tname) typedef struct tname
|
||||
#define AGGTYPE_END(tname) tname
|
||||
#else
|
||||
#define AGGTYPE_BEGIN(tname) struct tname
|
||||
#define AGGTYPE_END(tname)
|
||||
#endif
|
||||
|
||||
#endif /* !defined(OBJIFACE_H) */
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Executable
+363
@@ -0,0 +1,363 @@
|
||||
/*
|
||||
** 2023 May 8
|
||||
**
|
||||
** The author disclaims copyright to this source code. In place of
|
||||
** a legal notice, here is a blessing:
|
||||
**
|
||||
** May you do good and not evil.
|
||||
** May you find forgiveness for yourself and forgive others.
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** This file implements a simple resource management package, interface
|
||||
** and function of which is described in resmanage.h .
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include "resmanage.h"
|
||||
|
||||
/* Track how to free various held resources. */
|
||||
typedef enum FreeableResourceKind {
|
||||
FRK_Indirect = 1<<15,
|
||||
FRK_Malloc = 0, FRK_DbConn, FRK_DbStmt, FRK_SqStr,
|
||||
FRK_DbMem, FRK_File,
|
||||
#if (!defined(_WIN32) && !defined(WIN32)) || !SQLITE_OS_WINRT
|
||||
FRK_Pipe,
|
||||
#endif
|
||||
#ifdef SHELL_MANAGE_TEXT
|
||||
FRK_Text,
|
||||
#endif
|
||||
FRK_AnyRef, FRK_VdtorRef,
|
||||
FRK_CountOf
|
||||
} FreeableResourceKind;
|
||||
|
||||
#if defined(_WIN32) || defined(WIN32)
|
||||
# if !SQLITE_OS_WINRT
|
||||
# include <io.h>
|
||||
# include <fcntl.h>
|
||||
# undef pclose
|
||||
# define pclose _pclose
|
||||
# endif
|
||||
#else
|
||||
extern int pclose(FILE*);
|
||||
#endif
|
||||
|
||||
typedef struct ResourceHeld {
|
||||
union {
|
||||
void *p_any;
|
||||
void *p_malloced;
|
||||
sqlite3 *p_conn;
|
||||
sqlite3_stmt *p_stmt;
|
||||
void *p_s3mem;
|
||||
FILE *p_stream;
|
||||
#ifdef SHELL_MANAGE_TEXT
|
||||
ShellText *p_text;
|
||||
#endif
|
||||
sqlite3_str *p_sqst;
|
||||
AnyResourceHolder *p_any_rh;
|
||||
VirtualDtorNthObject *p_vdfo;
|
||||
} held;
|
||||
unsigned short frk; /* a FreeableResourceKind value */
|
||||
unsigned short offset;
|
||||
} ResourceHeld;
|
||||
|
||||
/* The held-resource stack. This is for single-threaded use only. */
|
||||
static ResourceHeld *pResHold = 0;
|
||||
static ResourceCount numResHold = 0;
|
||||
static ResourceCount numResAlloc = 0;
|
||||
|
||||
const char *resmanage_oom_message = "out of memory, aborting";
|
||||
|
||||
/* Info recorded in support of quit_moan(...) and stack-ripping */
|
||||
static RipStackDest *pRipStack = 0;
|
||||
|
||||
/* Current position of the held-resource stack */
|
||||
ResourceMark holder_mark(){
|
||||
return numResHold;
|
||||
}
|
||||
|
||||
/* Strip resource stack then strip call stack (or exit.) */
|
||||
void quit_moan(const char *zMoan, int errCode){
|
||||
RipStackDest *pRSD = pRipStack;
|
||||
if( zMoan ){
|
||||
fprintf(stderr, "Error: Terminating due to %s.\n", zMoan);
|
||||
}
|
||||
fprintf(stderr, "Auto-freed %d resources.\n",
|
||||
release_holders_mark( (pRSD)? pRSD->resDest : 0 ));
|
||||
pRipStack = (pRSD)? pRSD->pPrev : 0;
|
||||
#ifndef SHELL_OMIT_LONGJMP
|
||||
if( pRSD!=0 ){
|
||||
pRSD->pPrev = 0;
|
||||
longjmp(pRSD->exeDest, errCode);
|
||||
} else
|
||||
#endif
|
||||
exit(errCode);
|
||||
}
|
||||
|
||||
/* Free a single resource item. (ignorant of stack) */
|
||||
static int free_rk( ResourceHeld *pRH ){
|
||||
int rv = 0;
|
||||
if( pRH->held.p_any == 0 ) return 0;
|
||||
if( pRH->frk & FRK_Indirect ){
|
||||
void **ppv = (void**)pRH->held.p_any;
|
||||
pRH->held.p_any = *ppv;
|
||||
*ppv = (void*)0;
|
||||
if( pRH->held.p_any == 0 ) return 0;
|
||||
pRH->frk &= ~FRK_Indirect;
|
||||
}
|
||||
++rv;
|
||||
switch( pRH->frk ){
|
||||
case FRK_Malloc:
|
||||
free(pRH->held.p_malloced);
|
||||
break;
|
||||
case FRK_DbConn:
|
||||
sqlite3_close_v2(pRH->held.p_conn);
|
||||
break;
|
||||
case FRK_DbStmt:
|
||||
sqlite3_clear_bindings(pRH->held.p_stmt);
|
||||
sqlite3_finalize(pRH->held.p_stmt);
|
||||
break;
|
||||
case FRK_DbMem:
|
||||
sqlite3_free(pRH->held.p_s3mem);
|
||||
break;
|
||||
case FRK_File:
|
||||
fclose(pRH->held.p_stream);
|
||||
break;
|
||||
#if (!defined(_WIN32) && !defined(WIN32)) || !SQLITE_OS_WINRT
|
||||
case FRK_Pipe:
|
||||
pclose(pRH->held.p_stream);
|
||||
break;
|
||||
#endif
|
||||
#ifdef SHELL_MANAGE_TEXT
|
||||
case FRK_Text:
|
||||
freeText(pRH->held.p_text);
|
||||
break;
|
||||
#endif
|
||||
case FRK_SqStr:
|
||||
{
|
||||
char *z = sqlite3_str_finish(pRH->held.p_sqst);
|
||||
if( z!=0 ) sqlite3_free(z);
|
||||
}
|
||||
break;
|
||||
case FRK_AnyRef:
|
||||
(pRH->held.p_any_rh->its_freer)(pRH->held.p_any_rh->pAny);
|
||||
break;
|
||||
case FRK_VdtorRef:
|
||||
{
|
||||
VirtualDtorNthObject *po = pRH->held.p_vdfo;
|
||||
(po->p_its_freer[pRH->offset])(po);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(pRH->frk < FRK_CountOf);
|
||||
}
|
||||
pRH->held.p_any = 0;
|
||||
return rv;
|
||||
}
|
||||
|
||||
#if 0 /* obviated by the xxxx_ptr_holder(...) scheme. */
|
||||
/* Take back a held resource pointer, leaving held as NULL. (no-op) */
|
||||
void* take_held(ResourceMark mark, ResourceCount offset){
|
||||
return swap_held(mark,offset,0);
|
||||
}
|
||||
|
||||
/* Swap a held resource pointer for a new one. */
|
||||
void* swap_held(ResourceMark mark, ResourceCount offset, void *pNew){
|
||||
ResourceCount rix = mark + offset;
|
||||
assert(rix < numResHold && numResHold > 0);
|
||||
if( rix < numResHold && numResHold > 0 ){
|
||||
void *rv = pResHold[rix].held.p_any;
|
||||
pResHold[rix].held.p_any = pNew;
|
||||
return rv;
|
||||
}else return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Reserve room for at least count additional holders, with no chance
|
||||
** of an OOM abrupt exit. This is used internally only by this package.
|
||||
** The return is either 1 for success, or 0 indicating an OOM failure.
|
||||
*/
|
||||
static int more_holders_try(ResourceCount count){
|
||||
ResourceHeld *prh;
|
||||
ResourceCount newAlloc = numResHold + count;
|
||||
if( newAlloc < numResHold ) return 0; /* Overflow, sorry. */
|
||||
if( newAlloc <= numResAlloc ) return 1;
|
||||
prh = (ResourceHeld*)realloc(pResHold, newAlloc*sizeof(ResourceHeld));
|
||||
if( prh == 0 ) return 0;
|
||||
pResHold = prh;
|
||||
numResAlloc = newAlloc;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Lose one or more holders. */
|
||||
void* drop_holder(void){
|
||||
assert(numResHold>0);
|
||||
if( numResHold>0 ) return pResHold[--numResHold].held.p_any;
|
||||
return 0;
|
||||
}
|
||||
void drop_holders(ResourceCount num){
|
||||
assert(numResHold>=num);
|
||||
if( numResHold>=num ) numResHold -= num;
|
||||
else numResHold = 0;
|
||||
}
|
||||
|
||||
/* Drop one or more holders while freeing their held resource. */
|
||||
void release_holder(void){
|
||||
assert(numResHold>0);
|
||||
free_rk(&pResHold[--numResHold]);
|
||||
}
|
||||
void release_holders(ResourceCount num){
|
||||
assert(num<=numResHold);
|
||||
while( num>0 ){
|
||||
free_rk(&pResHold[--numResHold]);
|
||||
--num;
|
||||
}
|
||||
}
|
||||
|
||||
/* Shared resource-stack pushing code */
|
||||
static void res_hold(void *pv, FreeableResourceKind frk){
|
||||
ResourceHeld rh = { pv, frk, 0 };
|
||||
if( numResHold == numResAlloc ){
|
||||
ResourceCount nrn = (ResourceCount)((numResAlloc>>2) + 5);
|
||||
if( !more_holders_try(nrn) ){
|
||||
free_rk(&rh);
|
||||
quit_moan(resmanage_oom_message,1);
|
||||
}
|
||||
}
|
||||
pResHold[numResHold++] = rh;
|
||||
}
|
||||
|
||||
/* Hold a NULL (Assure swap_held() cannot fail.) */
|
||||
void more_holders(ResourceCount more){
|
||||
if( !more_holders_try(more) ) quit_moan(resmanage_oom_message,1);
|
||||
}
|
||||
|
||||
/* Hold anything in the malloc() heap */
|
||||
void* mmem_holder(void *pm){
|
||||
res_hold(pm, FRK_Malloc);
|
||||
return pm;
|
||||
}
|
||||
/* Hold a C string in the malloc() heap */
|
||||
char* mstr_holder(char *z){
|
||||
res_hold(z, FRK_Malloc);
|
||||
return z;
|
||||
}
|
||||
/* Hold a SQLite dynamic string */
|
||||
sqlite3_str * sqst_holder(sqlite3_str *psqst){
|
||||
res_hold(psqst, FRK_SqStr);
|
||||
return psqst;
|
||||
}
|
||||
/* Hold a C string in the SQLite heap */
|
||||
char* sstr_holder(char *z){
|
||||
res_hold(z, FRK_DbMem);
|
||||
return z;
|
||||
}
|
||||
/* Hold a SQLite dynamic string, reference to */
|
||||
void sqst_ptr_holder(sqlite3_str **ppsqst){
|
||||
assert(ppsqst!=0);
|
||||
res_hold(ppsqst, FRK_SqStr|FRK_Indirect);
|
||||
}
|
||||
/* Hold a C string in the SQLite heap, reference to */
|
||||
void sstr_ptr_holder(char **pz){
|
||||
assert(pz!=0);
|
||||
res_hold(pz, FRK_DbMem|FRK_Indirect);
|
||||
}
|
||||
/* Hold anything in the SQLite heap, reference to */
|
||||
void smem_ptr_holder(void **ppv){
|
||||
assert(ppv!=0);
|
||||
res_hold(ppv, FRK_DbMem|FRK_Indirect);
|
||||
}
|
||||
/* Hold an open C runtime FILE */
|
||||
void file_holder(FILE *pf){
|
||||
res_hold(pf, FRK_File);
|
||||
}
|
||||
#if (!defined(_WIN32) && !defined(WIN32)) || !SQLITE_OS_WINRT
|
||||
/* Hold an open C runtime pipe */
|
||||
void pipe_holder(FILE *pp){
|
||||
res_hold(pp, FRK_Pipe);
|
||||
}
|
||||
#endif
|
||||
#ifdef SHELL_MANAGE_TEXT
|
||||
/* a ShellText object, reference to (storage for which not managed) */
|
||||
static void text_ref_holder(ShellText *pt){
|
||||
res_hold(pt, FRK_Text);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Hold some SQLite-allocated memory */
|
||||
void* smem_holder(void *pm){
|
||||
res_hold(pm, FRK_DbMem);
|
||||
return pm;
|
||||
}
|
||||
/* Hold a SQLite database "connection" */
|
||||
void conn_holder(sqlite3 *pdb){
|
||||
res_hold(pdb, FRK_DbConn);
|
||||
}
|
||||
/* Hold a SQLite prepared statement */
|
||||
void stmt_holder(sqlite3_stmt *pstmt){
|
||||
res_hold(pstmt, FRK_DbStmt);
|
||||
}
|
||||
/* Hold a SQLite prepared statement, reference to */
|
||||
void stmt_ptr_holder(sqlite3_stmt **ppstmt){
|
||||
assert(ppstmt!=0);
|
||||
res_hold(ppstmt, FRK_DbStmt|FRK_Indirect);
|
||||
}
|
||||
/* Hold a SQLite database ("connection"), reference to */
|
||||
void conn_ptr_holder(sqlite3 **ppdb){
|
||||
assert(ppdb!=0);
|
||||
res_hold(ppdb, FRK_DbConn|FRK_Indirect);
|
||||
}
|
||||
/* Hold a reference to an AnyResourceHolder (in stack frame) */
|
||||
void any_ref_holder(AnyResourceHolder *parh){
|
||||
assert(parh!=0 && parh->its_freer!=0);
|
||||
res_hold(parh, FRK_AnyRef);
|
||||
}
|
||||
/* Hold a reference to a VirtualDtorNthObject (in stack frame) */
|
||||
void dtor_ref_holder(VirtualDtorNthObject *pvdfo, unsigned char n){
|
||||
ResourceHeld rh = { (void*)pvdfo, FRK_VdtorRef, n };
|
||||
assert(pvdfo!=0 && pvdfo->p_its_freer!=0 && *(pvdfo->p_its_freer)!=0);
|
||||
if( numResHold == numResAlloc ){
|
||||
ResourceCount nrn = (ResourceCount)((numResAlloc>>2) + 5);
|
||||
if( !more_holders_try(nrn) ){
|
||||
free_rk(&rh);
|
||||
quit_moan(resmanage_oom_message,1);
|
||||
}
|
||||
}
|
||||
pResHold[numResHold++] = rh;
|
||||
}
|
||||
|
||||
/* Free all held resources in excess of given resource stack mark,
|
||||
** then return how many needed freeing. */
|
||||
int release_holders_mark(ResourceMark mark){
|
||||
int rv = 0;
|
||||
while( numResHold > mark ){
|
||||
rv += free_rk(&pResHold[--numResHold]);
|
||||
}
|
||||
if( mark==0 ){
|
||||
if( numResAlloc>0 ){
|
||||
free(pResHold);
|
||||
pResHold = 0;
|
||||
numResAlloc = 0;
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* Record a resource stack and call stack rip-to position */
|
||||
void register_exit_ripper(RipStackDest *pRSD){
|
||||
assert(pRSD!=0);
|
||||
pRSD->pPrev = pRipStack;
|
||||
pRSD->resDest = holder_mark();
|
||||
pRipStack = pRSD;
|
||||
}
|
||||
/* Undo register_exit_ripper effect, back to previous state. */
|
||||
void forget_exit_ripper(RipStackDest *pRSD){
|
||||
if( pRSD==0 ) pRipStack = 0;
|
||||
else{
|
||||
pRipStack = pRSD->pPrev;
|
||||
pRSD->pPrev = 0;
|
||||
}
|
||||
}
|
||||
Executable
+200
@@ -0,0 +1,200 @@
|
||||
/*
|
||||
** 2023 May 8
|
||||
**
|
||||
** The author disclaims copyright to this source code. In place of
|
||||
** a legal notice, here is a blessing:
|
||||
**
|
||||
** May you do good and not evil.
|
||||
** May you find forgiveness for yourself and forgive others.
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** This file declares the interface of a simple resource management package
|
||||
** which supports freeing of resources upon an abrupt, program-initiated
|
||||
** termination of a function from somewhere in a call tree. The package is
|
||||
** designed to be used with setjmp()/longjmp() to effect a pattern similar
|
||||
** to the try/throw/catch available in some programming languages. (But see
|
||||
** below regarding usage when the setjmp()/longjmp() pair is unavailable.)
|
||||
**
|
||||
** The general scheme is that routines whose pre-return code might be
|
||||
** bypassed, thereby leaking resources, do not rely on pre-return code
|
||||
** to release locally held resources. Instead, they give ownership of
|
||||
** such resources to this package, via xxxx_holder(...) calls, and use
|
||||
** its holder_mark() and holder_free(...) functions to release locally
|
||||
** acquired resources.
|
||||
**
|
||||
** For environments where setjmp()/longjmp() are unavailable, (indicated by
|
||||
** SHELL_OMIT_LONGJMP defined), the package substitutes a process exit for
|
||||
** resumption of execution at a chosen code location. The resources in the
|
||||
** package's held resource stack are still released. And the ability to
|
||||
** free locally acquired resources as functions return is retained. This
|
||||
** can simplify early function exit logic, but a body of code relying on
|
||||
** process exit to ease error handling is unsuitable for use as a called
|
||||
** routine within a larger application. That use is most of the reason for
|
||||
** this package's existence.
|
||||
**
|
||||
** The package is designed for single-threaded use only. It is unsafe to
|
||||
** use it from multiple threads, which includes signal handlers.
|
||||
*/
|
||||
|
||||
#ifndef RES_MANAGE_H
|
||||
# define RES_MANAGE_H
|
||||
|
||||
#ifndef SHELL_OMIT_LONGJMP
|
||||
# include <setjmp.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "sqlite3.h"
|
||||
|
||||
/* Type used for marking/conveying positions within a held-resource stack */
|
||||
typedef unsigned short ResourceMark;
|
||||
typedef unsigned short ResourceCount;
|
||||
|
||||
/* Type used to record a possible succession of recovery destinations */
|
||||
typedef struct RipStackDest {
|
||||
struct RipStackDest *pPrev;
|
||||
#ifndef SHELL_OMIT_LONGJMP
|
||||
jmp_buf exeDest;
|
||||
#endif
|
||||
ResourceMark resDest;
|
||||
} RipStackDest;
|
||||
#define RIP_STACK_DEST_INIT {0}
|
||||
|
||||
/* This macro effects stack mark and potential rip-back, keeping needed
|
||||
** details in a RipStackDest object (independent of SHELL_OMIT_LONGJMP.) */
|
||||
#ifndef SHELL_OMIT_LONGJMP
|
||||
# define RIP_TO_HERE(RSD) (RSD.resDest=holder_mark(), setjmp(RSD.exeDest))
|
||||
#else
|
||||
# define RIP_TO_HERE(RSD) (RSD.resDest=holder_mark(), 0)
|
||||
#endif
|
||||
|
||||
/* Type used for generic free functions (to fib about their signature.) */
|
||||
typedef void (*GenericFreer)(void*);
|
||||
|
||||
/* Current position of the held-resource stack */
|
||||
extern ResourceMark holder_mark();
|
||||
#define RESOURCE_MARK(mark) ResourceMark mark = holder_mark()
|
||||
|
||||
/* Assure no allocation failure for some more xxx_holder() calls.
|
||||
** Note that this call may fail with an OOM abrupt exit. */
|
||||
extern void more_holders(ResourceCount more);
|
||||
|
||||
/* Pop one or more holders, without freeing anything. */
|
||||
extern void* drop_holder(void);
|
||||
extern void drop_holders(ResourceCount num);
|
||||
|
||||
/* Pop one or more holders while freeing their held resource. */
|
||||
extern void release_holder(void);
|
||||
extern void release_holders(ResourceCount num);
|
||||
|
||||
/* Free all held resources in excess of given resource stack mark.
|
||||
** Return count of number actually freed (rather than being 0.) */
|
||||
extern int release_holders_mark(ResourceMark mark);
|
||||
#define RESOURCE_FREE(mark) release_holders_mark(mark)
|
||||
|
||||
/*
|
||||
** Routines for holding resources on held-resource stack together
|
||||
** with enough information for them to be freed by this package.
|
||||
*/
|
||||
|
||||
/* xxxx_holder(...)
|
||||
** The referenced objects are directly freed; they are stored in
|
||||
** the heap with lifetime not bound to the caller's activation.
|
||||
*/
|
||||
/* anything in the malloc() heap */
|
||||
extern void* mmem_holder(void *pm);
|
||||
/* a C string in the malloc() heap */
|
||||
extern char* mstr_holder(char *z);
|
||||
/* some SQLite-allocated memory */
|
||||
extern void* smem_holder(void *pm);
|
||||
/* a C string in the SQLite heap */
|
||||
extern char* sstr_holder(char *z);
|
||||
/* a SQLite database "connection" */
|
||||
extern void conn_holder(sqlite3 *pdb);
|
||||
/* a SQLite prepared statement */
|
||||
extern void stmt_holder(sqlite3_stmt *pstmt);
|
||||
/* a SQLite dynamic string */
|
||||
extern sqlite3_str *sqst_holder(sqlite3_str *psqst);
|
||||
/* an open C runtime FILE */
|
||||
extern void file_holder(FILE *);
|
||||
#if (!defined(_WIN32) && !defined(WIN32)) || !SQLITE_OS_WINRT
|
||||
/* an open C runtime pipe */
|
||||
extern void pipe_holder(FILE *);
|
||||
#endif
|
||||
|
||||
/* xxxx_ptr_holder(...) or xxxx_ref_holder(...)
|
||||
** The referenced objects are indirectly freed; they are stored
|
||||
** in the caller's stack frame, with lifetime limited to the
|
||||
** the caller's activation. It is a grave error to use these
|
||||
** then fail to call release_xxx() before returning. For abrupt
|
||||
** exits, this condition is met because release_xxx() is called
|
||||
** by abrupt exit code before the execution stack is stripped.
|
||||
*/
|
||||
|
||||
/* An arbitrary data pointer paired with its freer function */
|
||||
typedef struct AnyResourceHolder {
|
||||
void *pAny;
|
||||
GenericFreer its_freer;
|
||||
} AnyResourceHolder;
|
||||
|
||||
/* An object of a class having its destructor as the Nth v-table entry.
|
||||
** This is only useful when it is embedded in a bigger object. */
|
||||
typedef struct VirtualDtorNthObject VirtualDtorNthObject;
|
||||
typedef void (*VirtualDtorNth)(VirtualDtorNthObject *);
|
||||
struct VirtualDtorNthObject {
|
||||
VirtualDtorNth *p_its_freer;
|
||||
};
|
||||
|
||||
/* a reference to an AnyResourceHolder (whose storage is not managed) */
|
||||
extern void any_ref_holder(AnyResourceHolder *parh);
|
||||
/* a C string in the SQLite heap, reference to */
|
||||
extern void sstr_ptr_holder(char **pz);
|
||||
/* anything in the SQLite heap, reference to */
|
||||
extern void smem_ptr_holder(void **ppv);
|
||||
/* a SQLite prepared statement, reference to */
|
||||
extern void stmt_ptr_holder(sqlite3_stmt **ppstmt);
|
||||
/* a SQLite database ("connection"), reference to */
|
||||
extern void conn_ptr_holder(sqlite3 **ppdb);
|
||||
/* a SQLite dynamic string, reference to */
|
||||
extern void sqst_ptr_holder(sqlite3_str **ppsqst);
|
||||
/* object with (by-ref) v-table whose destructor is nth member, reference to */
|
||||
extern void dtor_ref_holder(VirtualDtorNthObject *pvdfo, unsigned char n);
|
||||
#ifdef SHELL_MANAGE_TEXT
|
||||
/* a ShellText object, reference to (storage for which not managed) */
|
||||
static void text_ref_holder(ShellText *);
|
||||
#endif
|
||||
|
||||
#if 0 /* Next 2 routines are obviated by the xxxx_ptr_holder(...) scheme. */
|
||||
/* Take back a held resource pointer, leaving held as NULL. (no-op) */
|
||||
extern void* take_held(ResourceMark mark, ResourceCount offset);
|
||||
|
||||
/* Swap a held resource pointer for a new one. */
|
||||
extern void* swap_held(ResourceMark mark, ResourceCount offset, void *pNew);
|
||||
#endif
|
||||
|
||||
/* Remember execution and resource stack position/state. This determines
|
||||
** how far these stacks may be stripped should quit_moan(...) be called.
|
||||
*/
|
||||
extern void register_exit_ripper(RipStackDest *);
|
||||
/* Forget whatever register_exit_ripper() has been recorded. */
|
||||
extern void forget_exit_ripper(RipStackDest *);
|
||||
|
||||
/* Strip resource stack and execute previously registered longjmp() as
|
||||
** previously prepared by register_exit_ripper() call. Or, if no such
|
||||
** prep done (or possible), strip the whole stack and exit the process.
|
||||
*/
|
||||
extern void quit_moan(const char *zMoan, int errCode);
|
||||
|
||||
/* What the complaint will be for OOM failures and abrupt exits. */
|
||||
extern const char *resmanage_oom_message;
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* End of the 'extern "C"' block */
|
||||
#endif
|
||||
#endif /* RES_MANAGE_H */
|
||||
Regular → Executable
Regular → Executable
+10913
-5986
File diff suppressed because it is too large
Load Diff
Executable
+519
@@ -0,0 +1,519 @@
|
||||
/*
|
||||
** 2022 April 8
|
||||
**
|
||||
** The author disclaims copyright to this source code. In place of
|
||||
** a legal notice, here is a blessing:
|
||||
**
|
||||
** May you do good and not evil.
|
||||
** May you find forgiveness for yourself and forgive others.
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef SQLITE3SHX_H
|
||||
#define SQLITE3SHX_H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "sqlite3ext.h"
|
||||
|
||||
#include "obj_interfaces.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*****************
|
||||
* See "Shell Extensions, Programming" for purposes and usage of the following
|
||||
* interfaces supporting extended dot-commands and import and output modes.
|
||||
*/
|
||||
|
||||
/* Define status codes returned by a dot-command, either during its argument
|
||||
* checking or during its execution (to which checking may be deferred.) The
|
||||
* code has 1 or 2 parts. The low-valued codes, below DCR_ArgIxMask, have an
|
||||
* action part and an error flag. Higher-valued codes are bitwise-or'ed with
|
||||
* a small integer and indicate problems with the dot-command itself.
|
||||
*/
|
||||
typedef enum DotCmdRC {
|
||||
/* Post-execute action and success/error status (semi-ordered) */
|
||||
DCR_Ok = 0, /* ordinary success and continue */
|
||||
DCR_Error = 1, /* or'ed with low-valued codes upon error */
|
||||
DCR_Return = 2, /* return from present input source/script */
|
||||
DCR_ReturnError = 3, /* return with error */
|
||||
DCR_Exit = 4, /* exit shell ( process or pseudo-main() ) */
|
||||
DCR_ExitError = 5, /* exit with error */
|
||||
DCR_Abort = 6, /* abort for unrecoverable cause (OOM) */
|
||||
DCR_AbortError = 7, /* abort with error (blocked unsafe) */
|
||||
/* Above are in reverse-priority order for process_input() returns. */
|
||||
|
||||
/* Dispatch and argument errors */
|
||||
DCR_ArgIxMask = 0xfff, /* mask to retain/exclude argument index */
|
||||
/* Below codes may be or'ed with the offending argument index */
|
||||
DCR_Unknown = 0x1000, /* unknown command, subcommand or option */
|
||||
DCR_Ambiguous = 0x2000, /* ambiguous (sub)command (too abbreviated) */
|
||||
DCR_Unpaired = 0x3000, /* option value indicated but missing */
|
||||
DCR_TooMany = 0x4000, /* excess arguments were provided */
|
||||
DCR_TooFew = 0x5000, /* insufficient arguments provided */
|
||||
DCR_Missing = 0x6000, /* required argument(s) missing */
|
||||
DCR_ArgWrong = 0x7000, /* non-specific argument error, nothing emitted */
|
||||
|
||||
/* This code indicates error and a usage message to be emitted to stderr. */
|
||||
DCR_SayUsage = 0x7ffd, /* usage is at *pzErr or is to be generated */
|
||||
/* This code indicates nothing more need be put to stderr (or stdout.) */
|
||||
DCR_CmdErred = 0x7fff /* non-specific error for which complaint is done */
|
||||
} DotCmdRC;
|
||||
|
||||
/* Convey data to, from and/or between I/O handlers and dot-commands. */
|
||||
typedef struct ShellExState {
|
||||
/* A sizeof(*) to permit extensions to guard against too-old hosts */
|
||||
int sizeofThis;
|
||||
|
||||
/* The user's currently open and primary DB connection
|
||||
* Extensions may use this DB, but must not modify this pointer
|
||||
* and must never close the database. The shell is exclusively
|
||||
* responsible for creation and termination of this connection.
|
||||
* Extensions should not store a copy of this pointer without
|
||||
* provisions for maintaining validity of the copy. The shell
|
||||
* may alter this pointer apart from opening or closing a DB.
|
||||
* See ShellEventNotify, NoticeKind and subscribeEvents below
|
||||
* for means of maintaining valid copies. */
|
||||
sqlite3 *dbUser;
|
||||
|
||||
/* DB connection for shell dynamical data and extension management
|
||||
* Extensions may use this DB, but should not alter content created
|
||||
* by the shell nor depend upon its schema. Names with prefix "Shell"
|
||||
* or "shext_" are reserved for the shell's use. */
|
||||
sqlite3 *dbShell;
|
||||
|
||||
/* Shell abrupt exit indicator with return code in LS-byte
|
||||
* 0 => no exit
|
||||
* 0x100 => a non-error (0) exit
|
||||
* 0x100|other => exit with process exit code other
|
||||
* Any value greater than 0x1ff indicates an abnormal exit.
|
||||
* For embedded shell, "exit" means "return from top-level REPL function". */
|
||||
int shellAbruptExit;
|
||||
|
||||
/* Number of lines written during a query result output */
|
||||
int resultCount;
|
||||
/* Whether to show column names for certain output modes (reference) */
|
||||
unsigned char *pShowHeader;
|
||||
/* Column separator character for some modes, read-only */
|
||||
char *zFieldSeparator;
|
||||
/* Row separator character for some modes (MODE_Ascii), read-only */
|
||||
char *zRecordSeparator;
|
||||
/* Row set prefix for some modes if not 0 */
|
||||
char *zRecordLead;
|
||||
/* Row set suffix for some modes if not 0 */
|
||||
char *zRecordTail;
|
||||
/* Text to represent a NULL in external data formats, read-only */
|
||||
char *zNullValue;
|
||||
/* Name of table for which inserts are to be written or performed */
|
||||
const char *zDestTable;
|
||||
/* Next 3 members should be set and/or allocated by .width dot-command.
|
||||
* The values of pSpecWidths[i] and pHaveWidths[i] can be modified or
|
||||
* used by extensions, but setColumnWidths(...) must resize those lists.
|
||||
*/
|
||||
/* Number of column widths presently desired or tracked, read-only */
|
||||
int numWidths; /* known allocation count of next 2 members */
|
||||
/* The column widths last specified via .width command */
|
||||
int *pSpecWidths;
|
||||
/* The column widths last observed in query results, read-only */
|
||||
int *pHaveWidths;
|
||||
|
||||
/* Internal and opaque shell state, not for use by extensions */
|
||||
struct ShellInState *pSIS; /* Offset of this member is NOT STABLE. */
|
||||
} ShellExState;
|
||||
|
||||
/* An object implementing below interface is registered with the
|
||||
* shell to make new or overriding dot-commands available to it.
|
||||
*/
|
||||
INTERFACE_BEGIN( DotCommand );
|
||||
/* The whole, true name for this command */
|
||||
PURE_VMETHOD(const char *, name, DotCommand, 0,());
|
||||
/* Help text; zWhat=0 => primary, zWhat="" => secondary, other ? */
|
||||
PURE_VMETHOD(const char *, help, DotCommand, 1,(const char *zWhat));
|
||||
/* Validate arguments, blocking execute for returns != DCR_Ok */
|
||||
PURE_VMETHOD(DotCmdRC, argsCheck, DotCommand,
|
||||
3, (char **pzErrMsg, int nArgs, char *azArgs[]));
|
||||
/* Do whatever this command does, or return error of some kind */
|
||||
PURE_VMETHOD(DotCmdRC, execute, DotCommand,
|
||||
4,(ShellExState *, char **pzErrMsg, int nArgs, char *azArgs[]));
|
||||
INTERFACE_END( DotCommand );
|
||||
|
||||
/* An object implementing below interface is registered with the
|
||||
* shell to make new or overriding output modes available to it.
|
||||
*/
|
||||
INTERFACE_BEGIN( ExportHandler );
|
||||
PURE_VMETHOD(const char *, name, ExportHandler, 0,());
|
||||
PURE_VMETHOD(const char *, help, ExportHandler, 1,(const char *zWhat));
|
||||
PURE_VMETHOD(int, config, ExportHandler, 2,(int io, char **pzTell));
|
||||
PURE_VMETHOD(int, openResultsOutStream, ExportHandler,
|
||||
5,( ShellExState *pSES, char **pzErr,
|
||||
int numArgs, char *azArgs[], const char * zName ));
|
||||
PURE_VMETHOD(int, prependResultsOut, ExportHandler,
|
||||
3,( ShellExState *pSES, char **pzErr, sqlite3_stmt *pStmt ));
|
||||
PURE_VMETHOD(int, rowResultsOut, ExportHandler,
|
||||
3,( ShellExState *pSES, char **pzErr, sqlite3_stmt *pStmt ));
|
||||
PURE_VMETHOD(int, appendResultsOut, ExportHandler,
|
||||
3,( ShellExState *pSES, char **pzErr, sqlite3_stmt *pStmt ));
|
||||
PURE_VMETHOD(void, closeResultsOutStream, ExportHandler,
|
||||
2,( ShellExState *pSES, char **pzErr ));
|
||||
INTERFACE_END( ExportHandler );
|
||||
|
||||
/* An object implementing below interface is registered with the
|
||||
* shell to make new or overriding data importers available to it.
|
||||
*/
|
||||
INTERFACE_BEGIN( ImportHandler );
|
||||
PURE_VMETHOD(const char *, name, ImportHandler, 0,());
|
||||
PURE_VMETHOD(const char *, help, ImportHandler, 1,(const char *zWhat));
|
||||
PURE_VMETHOD(int, config, ImportHandler, 2,(int io, char **pzTell));
|
||||
PURE_VMETHOD(int, openDataInStream, ImportHandler,
|
||||
5,( ShellExState *pSES, char **pzErr,
|
||||
int numArgs, char *azArgs[], const char * zName ));
|
||||
PURE_VMETHOD(int, prepareDataInput, ImportHandler,
|
||||
3,( ShellExState *pSES, char **pzErr, sqlite3_stmt * *ppStmt ));
|
||||
PURE_VMETHOD(int, rowDataInput, ImportHandler,
|
||||
3,( ShellExState *pSES, char **pzErr, sqlite3_stmt *pStmt ));
|
||||
PURE_VMETHOD(int, finishDataInput, ImportHandler,
|
||||
3,( ShellExState *pSES, char **pzErr, sqlite3_stmt *pStmt ));
|
||||
PURE_VMETHOD(void, closeDataInStream, ImportHandler,
|
||||
2,( ShellExState *pSES, char **pzErr ));
|
||||
INTERFACE_END( ImportHandler );
|
||||
|
||||
/* An object implementing this next interface is registered with the shell
|
||||
* to make scripting support available to it. Only one at a time can be used.
|
||||
*
|
||||
* If registerScripting() has been called to register an extension's support
|
||||
* for scripting, then its methods are called, and must respond, as follows:
|
||||
*
|
||||
* When the initial line of an "execution group" is collected by the shell,
|
||||
* it calls isScriptLeader(pObj, zLineLead) to determine whether the group
|
||||
* should be considered as (eventually) being one for the script handler
|
||||
* to execute. This does not indicate whether it is good input or runnable;
|
||||
* it is only for classification (so that different parsing/collection rules
|
||||
* may be applied for different categories of shell input.) The method should
|
||||
* return true iff the group should be parsed and run by this handler. If it
|
||||
* returns false, something else will be done with the group.
|
||||
*
|
||||
* As one or more lines of an "execution group" are collected by the shell,
|
||||
* scriptIsComplete(pObj, zLineGroup, pzWhyNot) is called with the group as
|
||||
* so far accumulated. If out parameter pzWhyNot is non-zero, the method may
|
||||
* output a message indicating in what way the input is incomplete, which is
|
||||
* then the shell's responsibility to pass to sqlite3_free(). The method must
|
||||
* return true if the group is ready to be executed, otherwise false. This is
|
||||
* not the time at which to execute the accumulated group.
|
||||
*
|
||||
* After the scriptIsComplete() method returns true, or whenever the script is
|
||||
* being ignored (due to end-of-stream or interrupt), the resetCompletionScan()
|
||||
* method is called. This may be used to reset the scanning state held across
|
||||
* calls to scriptIsComplete() so that it need not scan the whole script text
|
||||
* at each call. It might do other things; it is always called after a call to
|
||||
* isScriptLeader() has returned true and scriptIsComplete() has been called.
|
||||
*
|
||||
* If a script group is complete (as above-determined), then runScript() may
|
||||
* be called to execute that script group. (Or, it may not.) It must either
|
||||
* execute it successfully and return DCR_Ok, suffer an ordinary failure and
|
||||
* return DCR_Error, or return one of the codes DCR_{Return,Exit,Abort} or'ed
|
||||
* with DCR_Error or not, to indicate extraordinary post-execute actions.
|
||||
* DCR_Return is to indicate the present execution context should be left.
|
||||
* DCR_Exit is for shell exit requests. DCR_Abort means exit with prejudice.
|
||||
*
|
||||
* An extension which has called registerScripting() should arrange to
|
||||
* free associated resources upon exit or when its destructor runs.
|
||||
*/
|
||||
INTERFACE_BEGIN( ScriptSupport );
|
||||
PURE_VMETHOD(const char *, name, ScriptSupport, 0,());
|
||||
PURE_VMETHOD(const char *, help, ScriptSupport, 1,(const char *zWhat));
|
||||
PURE_VMETHOD(int, configure, ScriptSupport,
|
||||
4,( ShellExState *pSES, char **pzErr,
|
||||
int numArgs, char *azArgs[] ));
|
||||
PURE_VMETHOD(int, isScriptLeader, ScriptSupport,
|
||||
1,( const char *zScript ));
|
||||
PURE_VMETHOD(int, scriptIsComplete, ScriptSupport,
|
||||
2,( const char *zScript, char **pzWhyNot ));
|
||||
PURE_VMETHOD(void, resetCompletionScan, ScriptSupport, 0,());
|
||||
|
||||
PURE_VMETHOD(DotCmdRC, runScript, ScriptSupport,
|
||||
3,( const char *zScript, ShellExState *pSES, char **pzErr ));
|
||||
INTERFACE_END( ScriptSupport );
|
||||
|
||||
/* Define a v-table implementation for ScriptSupport interface. */
|
||||
#define ScriptSupport_IMPLEMENT_VTABLE(Derived, vtname) \
|
||||
CONCRETE_BEGIN(ScriptSupport, Derived); \
|
||||
CONCRETE_METHOD(const char *, name, ScriptSupport, 0,()); \
|
||||
CONCRETE_METHOD(const char *, help, ScriptSupport, 1,(const char *zWhat)); \
|
||||
CONCRETE_METHOD(int, configure, ScriptSupport, \
|
||||
4,( ShellExState *pSES, char **pzErr, int numArgs, char *azArgs[] )); \
|
||||
CONCRETE_METHOD(int, isScriptLeader, ScriptSupport, \
|
||||
1,( const char *zScript )); \
|
||||
CONCRETE_METHOD(int, scriptIsComplete, ScriptSupport, \
|
||||
2,( const char *zScript, char **pzWhyNot )); \
|
||||
CONCRETE_METHOD(void, resetCompletionScan, ScriptSupport, 0,()); \
|
||||
CONCRETE_METHOD(DotCmdRC, runScript, ScriptSupport, \
|
||||
3,( const char *zScript, ShellExState *pSES, char **pzErr )); \
|
||||
CONCRETE_END(Derived) vtname = { \
|
||||
DECORATE_METHOD(Derived,destruct), \
|
||||
DECORATE_METHOD(Derived,name), \
|
||||
DECORATE_METHOD(Derived,help), \
|
||||
DECORATE_METHOD(Derived,configure), \
|
||||
DECORATE_METHOD(Derived,isScriptLeader), \
|
||||
DECORATE_METHOD(Derived,scriptIsComplete), \
|
||||
DECORATE_METHOD(Derived,resetCompletionScan), \
|
||||
DECORATE_METHOD(Derived,runScript) \
|
||||
}
|
||||
/* Define an implementation's v-table matching the DotCommand interface.
|
||||
* Method signatures are copied and pasted from above interface declaration.
|
||||
*/
|
||||
#define DotCommand_IMPLEMENT_VTABLE(Derived, vtname) \
|
||||
CONCRETE_BEGIN(DotCommand, Derived); \
|
||||
CONCRETE_METHOD(const char *, name, DotCommand, 0,()); \
|
||||
CONCRETE_METHOD(const char *, help, DotCommand, 1,(const char *zWhat)); \
|
||||
CONCRETE_METHOD(DotCmdRC, argsCheck, DotCommand, 3, \
|
||||
(char **pzErrMsg, int nArgs, char *azArgs[])); \
|
||||
CONCRETE_METHOD(DotCmdRC, execute, DotCommand, 4, \
|
||||
(ShellExState *, char **pzErrMsg, int nArgs, char *azArgs[])); \
|
||||
CONCRETE_END(Derived) vtname = { \
|
||||
DECORATE_METHOD(Derived,destruct), \
|
||||
DECORATE_METHOD(Derived,name), \
|
||||
DECORATE_METHOD(Derived,help), \
|
||||
DECORATE_METHOD(Derived,argsCheck), \
|
||||
DECORATE_METHOD(Derived,execute) \
|
||||
}
|
||||
|
||||
/* This function pointer has the same signature as the sqlite3_X_init()
|
||||
* function that is called as SQLite3 completes loading an extension.
|
||||
* It is used as a process-unique identifier for a loaded extension.
|
||||
*/
|
||||
typedef int (*ExtensionId)
|
||||
(sqlite3 *, char **, const struct sqlite3_api_routines *);
|
||||
|
||||
typedef struct Prompts {
|
||||
const char *zMain;
|
||||
const char *zContinue;
|
||||
} Prompts;
|
||||
|
||||
AGGTYPE_BEGIN(ExtensionHelpers) {
|
||||
int helperCount; /* Helper count, not including sentinel */
|
||||
struct ExtHelpers {
|
||||
int (*failIfSafeMode)(ShellExState *p, const char *zErrMsg, ...);
|
||||
void (*utf8CurrentOutPrintf)(ShellExState *p, const char *zFmt, ...);
|
||||
struct InSource * (*currentInputSource)(ShellExState *p);
|
||||
char * (*strLineGet)(char *zBuf, int ncMax, struct InSource *pInSrc);
|
||||
DotCommand * (*findDotCommand)(const char *cmdName, ShellExState *p,
|
||||
/* out */ int *pnFound);
|
||||
DotCmdRC (*runDotCommand)(DotCommand *pmc, char *azArg[], int nArg,
|
||||
ShellExState *psx);
|
||||
void (*setColumnWidths)(ShellExState *p, char *azWidths[], int nWidths);
|
||||
int (*nowInteractive)(ShellExState *p);
|
||||
const char * (*shellInvokedAs)(void);
|
||||
const char * (*shellStartupDir)(void);
|
||||
char * (*oneInputLine)(struct InSource *pInSrc, char *zPrior,
|
||||
int isContinuation, Prompts *pCue);
|
||||
void (*freeInputLine)(char *zLine);
|
||||
int (*enable_load_extension)(sqlite3 *db, int onoff);
|
||||
void *pSentinel; /* Always set to 0, above never are. */
|
||||
} helpers;
|
||||
} AGGTYPE_END(ExtensionHelpers);
|
||||
|
||||
/* This enum is stable excepting that it grows at the end. Members will not
|
||||
* change value across successive shell versions, except for NK_CountOf. An
|
||||
* extension which is built to rely upon particular notifications can pass
|
||||
* an NK_CountOf value upon which it relies to subscribeEvents(...) as nkMin,
|
||||
* which call will fail if the hosting shell's NK_CountOf value is lower.
|
||||
*/
|
||||
typedef enum {
|
||||
NK_Unsubscribe, /* Event handler is being unsubscribed, pvSubject
|
||||
* is the ExtensionId used to subscribe. Sent last.
|
||||
* All event handlers eventually get this event, so
|
||||
* it can be used to free a handler's resources.
|
||||
* Also passed to subscribeEvents(...) as nkMin
|
||||
* to unsubscribe some/all event handler(s). */
|
||||
NK_ShutdownImminent, /* Shell or module will soon be shut down, pvSubject
|
||||
* is NULL. Event sent prior to above and extension
|
||||
* destructor calls, and sent after all below, */
|
||||
NK_DbUserAppeared, /* A new ShellExState .dbUser value has been set,
|
||||
* pvSubject is the newly set .dbUser value. */
|
||||
NK_DbUserVanishing, /* Current ShellExState .dbUser will soon vanish,
|
||||
* pvSubject is the vanishing .dbUser value. */
|
||||
NK_DbAboutToClose, /* Possibly (or not) ShellExState-visible DB will soon
|
||||
* be closed, pvSubject is the DB's sqlite3 pointer. */
|
||||
NK_ExtensionUnload, /* The ShellExState .dbShell DB will soon be closed,
|
||||
* soon to be followed by unloading of all dynamic
|
||||
* extensions; pvSubject is the DB's sqlite3 pointer. */
|
||||
NK_NewDotCommand, /* A new DotCommand has been registered, pvSubject
|
||||
* is the just-added DotCommand object (pointer). */
|
||||
NK_CountOf /* Present count of preceding members (evolves) */
|
||||
} NoticeKind;
|
||||
|
||||
/* Callback signature for shell event handlers. */
|
||||
typedef int (*ShellEventNotify)(void *pvUserData, NoticeKind nk,
|
||||
void *pvSubject, ShellExState *psx);
|
||||
|
||||
/* Various shell extension helpers and feature registration functions */
|
||||
AGGTYPE_BEGIN(ShellExtensionAPI) {
|
||||
/* Utility functions for use by extensions */
|
||||
ExtensionHelpers * pExtHelpers;
|
||||
|
||||
/* Functions for an extension to register its implementors with shell */
|
||||
const int numRegistrars; /* 6 for this version */
|
||||
struct ShExtAPI {
|
||||
/* Register a dot-command */
|
||||
int (*registerDotCommand)(ShellExState *p,
|
||||
ExtensionId eid, DotCommand *pMC);
|
||||
/* Register query result data display (or other disposition) mode */
|
||||
int (*registerExporter)(ShellExState *p,
|
||||
ExtensionId eid, ExportHandler *pEH);
|
||||
/* Register an import variation from (various sources) for .import */
|
||||
int (*registerImporter)(ShellExState *p,
|
||||
ExtensionId eid, ImportHandler *pIH);
|
||||
/* Provide scripting support to host shell. (See ScriptSupport above.) */
|
||||
int (*registerScripting)(ShellExState *p,
|
||||
ExtensionId eid, ScriptSupport *pSS);
|
||||
/* Subscribe to (or unsubscribe from) messages about various changes.
|
||||
* See above NoticeKind enum and ShellEventNotify callback typedef. */
|
||||
int (*subscribeEvents)(ShellExState *p, ExtensionId eid, void *pvUserData,
|
||||
NoticeKind nkMin, ShellEventNotify eventHandler);
|
||||
/* Notify host shell that an impromptu dot command exists and provide for
|
||||
* its help text to appear in .help output. Only an extension which has
|
||||
* registered an "unknown" DotCommand may use this.
|
||||
* If zHelp==0, any such provision is removed. If zHelp!=0, original or
|
||||
* replacement help text is associated with command zName.
|
||||
* Help text before the first newline is primary, issued as summary help.
|
||||
* Text beyond that is secondary, issued as the complete command help. */
|
||||
int (*registerAdHocCommand)(ShellExState *p, ExtensionId eid,
|
||||
const char *zName, const char *zHelp);
|
||||
void *pSentinel; /* Always set to 0, above never are. */
|
||||
} api;
|
||||
} AGGTYPE_END(ShellExtensionAPI);
|
||||
|
||||
/* Struct passed to extension init function to establish linkage. The
|
||||
* lifetime of instances spans only the init call itself. Extensions
|
||||
* should make a copy, if needed, of pShellExtensionAPI for later use.
|
||||
* Its referent is static, persisting for the process duration.
|
||||
*/
|
||||
AGGTYPE_BEGIN(ShellExtensionLink) {
|
||||
int sizeOfThis; /* sizeof(ShellExtensionLink) for expansion */
|
||||
ShellExtensionAPI *pShellExtensionAPI;
|
||||
ShellExState *pSXS; /* For use in extension feature registrations */
|
||||
char *zErrMsg; /* Extension error messages land here, if any. */
|
||||
|
||||
/* An init "out" parameter, used as the loaded extension ID. Unless
|
||||
* this is set within sqlite3_X_init() prior to register*() calls,
|
||||
* the extension cannot be unloaded.
|
||||
*/
|
||||
ExtensionId eid;
|
||||
|
||||
/* Two more init "out" parameters, a destructor for extension overall.
|
||||
* Set to 0 on input and left so if no destructor is needed. Otherwise,
|
||||
* upon exit or unload, extensionDestruct(pvExtensionObject) is called.
|
||||
*/
|
||||
void (*extensionDestruct)(void *pvExtObj);
|
||||
void *pvExtensionObject;
|
||||
|
||||
/* If extra arguments were provided to the .shxload command, they are
|
||||
* available through these two members. Only azLoadArgs[0] through
|
||||
* azLoadArgs[nLoadArgs-1] may be referenced. (That may be none.)
|
||||
* If an extension keeps the argument values, copies must be made
|
||||
* because the pointers in azLoadArgs[] become invalid after loading.
|
||||
*/
|
||||
int nLoadArgs;
|
||||
char **azLoadArgs;
|
||||
} AGGTYPE_END(ShellExtensionLink);
|
||||
|
||||
/* String used with SQLite "Pointer Passing Interfaces" as a type marker.
|
||||
* That API subset is used by the shell to pass its extension API to the
|
||||
* sqlite3_X_init() function of shell extensions, via the DB parameter.
|
||||
*/
|
||||
#define SHELLEXT_API_POINTERS "shellext_api_pointers"
|
||||
|
||||
/* Pre-write a function to retrieve a ShellExtensionLink pointer from the
|
||||
* shell's DB. This macro defines a function which will return either a
|
||||
* pointer to a ShellExtensionLink instance during an extension's *init*()
|
||||
* call (during shell extension load) or 0 (during SQLite extension load.)
|
||||
*/
|
||||
#define DEFINE_SHDB_TO_SHEXTLINK(link_func_name) \
|
||||
static ShellExtensionLink * link_func_name(sqlite3 * db){ \
|
||||
ShellExtensionLink *rv = 0; sqlite3_stmt *pStmt = 0; \
|
||||
if( SQLITE_OK==sqlite3_prepare_v2(db,"SELECT shext_pointer(0)",-1,&pStmt,0) \
|
||||
&& SQLITE_ROW == sqlite3_step(pStmt) ) \
|
||||
rv = (ShellExtensionLink *)sqlite3_value_pointer \
|
||||
(sqlite3_column_value(pStmt, 0), SHELLEXT_API_POINTERS); \
|
||||
sqlite3_finalize(pStmt); return rv; \
|
||||
}
|
||||
|
||||
/*
|
||||
* Define boilerplate macros analogous to SQLITE_EXTENSION_INIT#
|
||||
* Note that the argument names are reused across the macro set.
|
||||
* This reflects the fact that, for the macros to be useful, the
|
||||
* same objects must be referenced from different places. Hence,
|
||||
* the actual arguments must appear in all of the invocations.
|
||||
*/
|
||||
|
||||
/* Place at file scope prior to usage of the arguments by extension code.
|
||||
* This defines 3 static objects, named per the arguments and set or used
|
||||
* for an extension to link into the shell host.
|
||||
*/
|
||||
#ifndef __cplusplus
|
||||
#define SHELL_EXTENSION_INIT1( shell_api_ptr, ext_helpers_ptr, link_func ) \
|
||||
static struct ShExtAPI *shell_api_ptr = 0; \
|
||||
static struct ExtHelpers *ext_helpers_ptr = 0; \
|
||||
DEFINE_SHDB_TO_SHEXTLINK(link_func)
|
||||
#else
|
||||
#define SHELL_EXTENSION_INIT1( shell_api_ptr, ext_helpers_ptr, link_func ) \
|
||||
static ShellExtensionAPI::ShExtAPI *shell_api_ptr = 0; \
|
||||
static ExtensionHelpers::ExtHelpers *ext_helpers_ptr = 0; \
|
||||
DEFINE_SHDB_TO_SHEXTLINK(link_func)
|
||||
#endif
|
||||
|
||||
/* Place within sqlite3_x_init() among its local variable declarations. */
|
||||
#define SHELL_EXTENSION_INIT2( link_ptr, link_func, db_ptr ) \
|
||||
ShellExtensionLink * link_ptr = link_func(db_ptr)
|
||||
|
||||
/* Place within sqlite3_x_init() code prior to usage of the *_ptr arguments. */
|
||||
#define SHELL_EXTENSION_INIT3( shell_api_ptr, ext_helpers_ptr, link_ptr ) \
|
||||
if( (link_ptr)!=0 ){ \
|
||||
shell_api_ptr = &link_ptr->pShellExtensionAPI->api; \
|
||||
ext_helpers_ptr = &link_ptr->pShellExtensionAPI->pExtHelpers->helpers; \
|
||||
}
|
||||
|
||||
/* This test may be used within sqlite3_x_init() after SHELL_EXTENSION_INIT3 */
|
||||
#define SHELL_EXTENSION_LINKED(link_ptr) ((link_ptr)!=0)
|
||||
/* These *_COUNT() macros help determine version compatibility.
|
||||
* They should only be used when the above test yields true.
|
||||
*/
|
||||
#define SHELL_API_COUNT(link_ptr) \
|
||||
(link_ptr->pShellExtensionAPI->numRegistrars)
|
||||
#define SHELL_HELPER_COUNT(link_ptr) \
|
||||
(link_ptr->pShellExtensionAPI->pExtHelpers->helperCount)
|
||||
|
||||
/* Combining the above, safely, to provide a single test for extensions to
|
||||
* use for assurance that: (1) the load was as a shell extension (with the
|
||||
* .shxload command rather than .load); and (2) the loading host provides
|
||||
* the stated minimum extension API and helper counts.
|
||||
*/
|
||||
#define SHELL_EXTENSION_LOADFAIL(link_ptr, minNumApi, minNumHelpers) \
|
||||
(!SHELL_EXTENSION_LINKED(link_ptr) \
|
||||
|| SHELL_API_COUNT(link_ptr)<(minNumApi) \
|
||||
|| SHELL_HELPER_COUNT(link_ptr)<(minNumHelpers) \
|
||||
)
|
||||
/* Like above, except it is an enum expression. The value is EXLD_Ok for
|
||||
* success or one of the next three values telling why the load failed.
|
||||
*/
|
||||
typedef enum {
|
||||
EXLD_Ok, EXLD_NoLink, EXLD_OutdatedApi, EXLD_OutdatedHelpers
|
||||
} ExtensionLoadStatus;
|
||||
#define SHELL_EXTENSION_LOADFAIL_WHY(link_ptr, minNumApi, minNumHelpers) ( \
|
||||
(!SHELL_EXTENSION_LINKED(link_ptr) ? EXLD_NoLink \
|
||||
: SHELL_API_COUNT(link_ptr)<(minNumApi) ? EXLD_OutdatedApi \
|
||||
: SHELL_HELPER_COUNT(link_ptr)<(minNumHelpers) ? EXLD_OutdatedHelpers \
|
||||
: EXLD_Ok ) \
|
||||
)
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif /* !defined(SQLITE3SHX_H) */
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Executable
+200
@@ -0,0 +1,200 @@
|
||||
/*
|
||||
** 2022 Feb 28
|
||||
**
|
||||
** The author disclaims copyright to this source code. In place of
|
||||
** a legal notice, here is a blessing:
|
||||
**
|
||||
** May you do good and not evil.
|
||||
** May you find forgiveness for yourself and forgive others.
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** Test extension for testing the shell's .shxload ... function.
|
||||
** To build from the SQLite project root:
|
||||
** on *Nix:
|
||||
** gcc -shared -fPIC -Wall -I. src/test_shellext_c.c -o test_shellext_c.so
|
||||
** on Windows with MSVC:
|
||||
** cl -I. src/test_shellext_c.c -LD -Fetest_shellext_c.dll
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include "shx_link.h"
|
||||
|
||||
SQLITE_EXTENSION_INIT1;
|
||||
|
||||
SHELL_EXTENSION_INIT1(pShExtApi, pExtHelpers, shextLinkFetcher);
|
||||
#define SHX_API(entry) pShExtApi->entry
|
||||
#define SHX_HELPER(entry) pExtHelpers->entry
|
||||
#define oprintf pExtHelpers->utf8CurrentOutPrintf
|
||||
|
||||
typedef struct BatBeing BatBeing;
|
||||
static void sayHowMany( BatBeing *pbb, ShellExState *psx );
|
||||
|
||||
/* These DERIVED_METHOD(...) macro calls' arguments were copied and
|
||||
* pasted from the DotCommand interface declaration in shext_linkage.h ,
|
||||
* but with "Interface,Derived" substituted for the interface typename.
|
||||
* The function bodies are not so easily written, of course. */
|
||||
|
||||
DERIVED_METHOD(void, destruct, DotCommand,BatBeing, 0, ());
|
||||
|
||||
DERIVED_METHOD(const char *, name, DotCommand,BatBeing, 0,()){
|
||||
(void)(pThis);
|
||||
return "bat_being";
|
||||
}
|
||||
|
||||
DERIVED_METHOD(const char *, help, DotCommand,BatBeing, 1,(const char *zHK)){
|
||||
(void)(pThis);
|
||||
if( !zHK )
|
||||
return ".bat_being ?whatever? Demonstrates vigilantism weekly\n";
|
||||
if( !*zHK )
|
||||
return " Options summon side-kick and villains.\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
DERIVED_METHOD(DotCmdRC, argsCheck, DotCommand,BatBeing, 3,
|
||||
(char **pzErrMsg, int nArgs, char *azArgs[])){
|
||||
(void)(pThis);
|
||||
(void)(pzErrMsg);
|
||||
(void)(nArgs);
|
||||
(void)(azArgs);
|
||||
return DCR_Ok;
|
||||
}
|
||||
|
||||
DERIVED_METHOD(DotCmdRC, execute, DotCommand,BatBeing, 4,
|
||||
(ShellExState *psx, char **pzErrMsg, int nArgs, char *azArgs[]));
|
||||
|
||||
/* Define a DotCommand v-table initialized to reference above methods. */
|
||||
DotCommand_IMPLEMENT_VTABLE(BatBeing, batty_methods);
|
||||
|
||||
/* Define/initialize BatBeing as a DotCommand subclass using above v-table.
|
||||
* This compiles in a type-safe manner because the batty_methods v-table
|
||||
* and methods it incorporates strictly match the DotCommand interface.
|
||||
*/
|
||||
INSTANCE_BEGIN(BatBeing);
|
||||
int numCalls;
|
||||
DotCommand * pPrint;
|
||||
DotCommand * pPrior;
|
||||
ShellExState *pSXS;
|
||||
INSTANCE_END(BatBeing) batty = {
|
||||
&batty_methods,
|
||||
0, 0, 0, 0
|
||||
};
|
||||
|
||||
DERIVED_METHOD(void, destruct, DotCommand,BatBeing, 0, ()){
|
||||
BatBeing *pBB = (BatBeing*)(pThis);
|
||||
if( pBB->pSXS ) oprintf(pBB->pSXS, "BatBeing unbecoming.\n");
|
||||
}
|
||||
|
||||
DERIVED_METHOD(DotCmdRC, execute, DotCommand,BatBeing, 4,
|
||||
(ShellExState *psx, char **pzErrMsg, int nArgs, char *azArgs[])){
|
||||
BatBeing *pbb = (BatBeing*)pThis;
|
||||
pbb->pSXS = psx;
|
||||
switch( nArgs ){
|
||||
default:
|
||||
{
|
||||
if( pbb->pPrior ){
|
||||
char *az1 = azArgs[1];
|
||||
for( int i=2; i<nArgs; ++i ) azArgs[i-1] = azArgs[i];
|
||||
azArgs[nArgs-1] = az1;
|
||||
return pbb->pPrior->pMethods->execute(pbb->pPrior, psx,
|
||||
pzErrMsg, nArgs, azArgs);
|
||||
}else{
|
||||
int cix;
|
||||
SHX_HELPER(setColumnWidths)(psx, azArgs+1, nArgs-1);
|
||||
oprintf(psx, "Column widths:");
|
||||
for( cix=0; cix<psx->numWidths; ++cix ){
|
||||
oprintf(psx, " %d", psx->pSpecWidths[cix]);
|
||||
}
|
||||
oprintf(psx, "\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
oprintf(psx, "The Penguin, Joker and Riddler have teamed up!\n");
|
||||
case 2: oprintf(psx, "The Dynamic Duo arrives, and ... ");
|
||||
case 1: oprintf(psx, "@#$ KaPow! $#@\n");
|
||||
}
|
||||
sayHowMany((BatBeing *)pThis, psx);
|
||||
return DCR_Ok;
|
||||
}
|
||||
|
||||
static void sayHowMany( BatBeing *pbb, ShellExState *psx ){
|
||||
if( pbb->pPrint ){
|
||||
char *az[] = { "print", 0 };
|
||||
char *zErr = 0;
|
||||
DotCommand * pdcPrint = pbb->pPrint;
|
||||
DotCmdRC rc;
|
||||
az[1] = sqlite3_mprintf("This execute has been called %d times.",
|
||||
++pbb->numCalls);
|
||||
rc = pdcPrint->pMethods->execute(pdcPrint, psx, &zErr, 2, az);
|
||||
sqlite3_free(az[1]);
|
||||
if( rc!= DCR_Ok ){
|
||||
oprintf(psx, "print() failed: %d\n", rc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int shellEventHandle(void *pv, NoticeKind nk,
|
||||
void *pvSubject, ShellExState *psx){
|
||||
if( nk==NK_ShutdownImminent ){
|
||||
BatBeing *pbb = (BatBeing *)pv;
|
||||
oprintf(psx, "Bat cave meteor strike detected after %d calls.\n",
|
||||
pbb->numCalls);
|
||||
}else if( nk==NK_Unsubscribe ){
|
||||
oprintf(psx, "BatBeing incommunicado.\n");
|
||||
}else if( nk==NK_DbUserAppeared || nk==NK_DbUserVanishing ){
|
||||
const char *zWhat = (nk==NK_DbUserAppeared)? "appeared" : "vanishing";
|
||||
int isDbu = pvSubject==psx->dbUser;
|
||||
oprintf(psx, "db%s %s\n", isDbu? "User" : "?", zWhat);
|
||||
if( psx->dbUser != pvSubject ) oprintf(psx, "not dbx(%p)\n", psx->dbUser);
|
||||
}else if( nk==NK_DbAboutToClose ){
|
||||
const char *zdb = (pvSubject==psx->dbUser)? "User"
|
||||
: (pvSubject==psx->dbShell)? "Shell" : "?";
|
||||
oprintf(psx, "db%s closing\n", zdb);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
** Extension load function.
|
||||
*/
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
int sqlite3_testshellextc_init(
|
||||
sqlite3 *db,
|
||||
char **pzErrMsg,
|
||||
const sqlite3_api_routines *pApi
|
||||
){
|
||||
int nErr = 0;
|
||||
int iLdErr;
|
||||
SQLITE_EXTENSION_INIT2(pApi);
|
||||
SHELL_EXTENSION_INIT2(pShExtLink, shextLinkFetcher, db);
|
||||
|
||||
SHELL_EXTENSION_INIT3(pShExtApi, pExtHelpers, pShExtLink);
|
||||
iLdErr = SHELL_EXTENSION_LOADFAIL_WHY(pShExtLink, 5, 13);
|
||||
if( iLdErr!=EXLD_Ok ){
|
||||
*pzErrMsg = sqlite3_mprintf("Load failed, cause %d\n", iLdErr);
|
||||
return SQLITE_ERROR;
|
||||
}else{
|
||||
ShellExState *psx = pShExtLink->pSXS;
|
||||
DotCommand *pdc = (DotCommand *)&batty;
|
||||
int rc;
|
||||
char *zLoadArgs = sqlite3_mprintf("Load arguments:");
|
||||
int ila;
|
||||
|
||||
for( ila=0; ila<pShExtLink->nLoadArgs; ++ila ){
|
||||
zLoadArgs = sqlite3_mprintf("%z %s", zLoadArgs,
|
||||
pShExtLink->azLoadArgs[ila]);
|
||||
}
|
||||
if( ila ) oprintf(psx, "%s\n", zLoadArgs);
|
||||
sqlite3_free(zLoadArgs);
|
||||
SHX_API(subscribeEvents)(psx, sqlite3_testshellextc_init, &batty,
|
||||
NK_CountOf, shellEventHandle);
|
||||
batty.pPrint = SHX_HELPER(findDotCommand)("print", psx, &rc);
|
||||
batty.pPrior = SHX_HELPER(findDotCommand)("bat_being", psx, &rc);
|
||||
rc = SHX_API(registerDotCommand)(psx, sqlite3_testshellextc_init, pdc);
|
||||
if( rc!=0 ) ++nErr;
|
||||
pShExtLink->eid = sqlite3_testshellextc_init;
|
||||
}
|
||||
return nErr ? SQLITE_ERROR : SQLITE_OK;
|
||||
}
|
||||
Executable
+189
@@ -0,0 +1,189 @@
|
||||
/*
|
||||
** 2022 Feb 28
|
||||
**
|
||||
** The author disclaims copyright to this source code. In place of
|
||||
** a legal notice, here is a blessing:
|
||||
**
|
||||
** May you do good and not evil.
|
||||
** May you find forgiveness for yourself and forgive others.
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** Test extension for testing the shell's .shxload <extName> function.
|
||||
** To build from the SQLite project root:
|
||||
** on *Nix:
|
||||
** g++ -shared -fPIC -Wall -I. src/test_shellext_cpp.cpp -o test_shellext_cpp.so
|
||||
** on Windows with MSVC:
|
||||
** cl -I. src/test_shellext_cpp.cpp -LD -Fetest_shellext_cpp.dll
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include "shx_link.h"
|
||||
|
||||
SQLITE_EXTENSION_INIT1;
|
||||
|
||||
SHELL_EXTENSION_INIT1(pShExtApi, pExtHelpers, shextLinkFetcher);
|
||||
#define SHX_API(entry) pShExtApi->entry
|
||||
#define SHX_HELPER(entry) pExtHelpers->entry
|
||||
#define oprintf pExtHelpers->utf8CurrentOutPrintf
|
||||
|
||||
struct BatBeing : DotCommand {
|
||||
|
||||
~BatBeing() {
|
||||
}; // No held resources; copy/assign is fine and dying is easy.
|
||||
|
||||
void destruct() {
|
||||
if( pSXS ) oprintf(pSXS, "BatBeing unbecoming.\n");
|
||||
}
|
||||
|
||||
const char *name() { return "bat_being"; };
|
||||
|
||||
const char *help(const char *zHK) {
|
||||
if( !zHK )
|
||||
return ".bat_being ?whatever? Demonstrates vigilantism weekly\n";
|
||||
if( !*zHK )
|
||||
return " Options summon side-kick and villains.\n";
|
||||
return 0;
|
||||
};
|
||||
|
||||
DotCmdRC argsCheck(char **pzErrMsg, int nArgs, char *azArgs[]) {
|
||||
(void)(pzErrMsg);
|
||||
(void)(nArgs);
|
||||
(void)(azArgs);
|
||||
return DCR_Ok;
|
||||
};
|
||||
DotCmdRC execute(ShellExState *psx, char **pzErrMsg,
|
||||
int nArgs, char *azArgs[]);
|
||||
|
||||
BatBeing(DotCommand *pp = 0) {
|
||||
numCalls = 0;
|
||||
pPrint = pp;
|
||||
pPrior = 0;
|
||||
pSXS = 0;
|
||||
};
|
||||
|
||||
// Default copy/assign are fine; nothing held.
|
||||
|
||||
int numCalls;
|
||||
DotCommand * pPrint;
|
||||
DotCommand * pPrior;
|
||||
ShellExState *pSXS;
|
||||
};
|
||||
|
||||
static void sayHowMany( BatBeing *pbb, ShellExState *psx ){
|
||||
if( pbb->pPrint ){
|
||||
static char cmd[] = "print";
|
||||
char *az[] = { cmd, 0 };
|
||||
char *zErr = 0;
|
||||
DotCmdRC rc;
|
||||
az[1] = sqlite3_mprintf("This execute has been called %d times.",
|
||||
++pbb->numCalls);
|
||||
rc = pbb->pPrint->execute(psx, &zErr, 2, az);
|
||||
sqlite3_free(az[1]);
|
||||
if( rc!= DCR_Ok ){
|
||||
oprintf(psx, "print() failed: %d\n", rc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DotCmdRC BatBeing::execute(ShellExState *psx, char **pzErrMsg,
|
||||
int nArgs, char *azArgs[]) {
|
||||
pSXS = psx;
|
||||
switch( nArgs ){
|
||||
default:
|
||||
{
|
||||
if( pPrior ){
|
||||
char *az1 = azArgs[1];
|
||||
for( int i=2; i<nArgs; ++i ) azArgs[i-1] = azArgs[i];
|
||||
azArgs[nArgs-1] = az1;
|
||||
return pPrior->execute(psx, pzErrMsg, nArgs, azArgs);
|
||||
}else{
|
||||
SHX_HELPER(setColumnWidths)(psx, azArgs+1, nArgs-1);
|
||||
oprintf(psx, "Column widths:");
|
||||
for( int cix=0; cix<psx->numWidths; ++cix ){
|
||||
oprintf(psx, " %d", psx->pSpecWidths[cix]);
|
||||
}
|
||||
oprintf(psx, "\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
oprintf(psx, "The Penguin, Joker and Riddler have teamed up!\n");
|
||||
case 2: oprintf(psx, "The Dynamic Duo arrives, and ... ");
|
||||
case 1: oprintf(psx, "@#$ KaPow! $#@\n");
|
||||
}
|
||||
sayHowMany(this, psx);
|
||||
return DCR_Ok;
|
||||
}
|
||||
|
||||
/* Define/initialize BatBeing as a DotCommand subclass using above v-table.
|
||||
* This compiles in a type-safe manner because the batty_methods v-table
|
||||
* and methods it incorporates strictly match the DotCommand interface.
|
||||
*/
|
||||
static BatBeing batty(0);
|
||||
|
||||
static int shellEventHandle(void *pv, NoticeKind nk,
|
||||
void *pvSubject, ShellExState *psx){
|
||||
if( nk==NK_ShutdownImminent ){
|
||||
BatBeing *pbb = (BatBeing *)pv;
|
||||
oprintf(psx, "Bat cave meteor strike detected after %d calls.\n",
|
||||
pbb->numCalls);
|
||||
}else if( nk==NK_Unsubscribe ){
|
||||
oprintf(psx, "BatBeing incommunicado.\n");
|
||||
}else if( nk==NK_DbUserAppeared || nk==NK_DbUserVanishing ){
|
||||
const char *zWhat = (nk==NK_DbUserAppeared)? "appeared" : "vanishing";
|
||||
int isDbu = pvSubject==psx->dbUser;
|
||||
oprintf(psx, "db%s %s\n", isDbu? "User" : "?", zWhat);
|
||||
if( psx->dbUser != pvSubject ) oprintf(psx, "not dbx(%p)\n", psx->dbUser);
|
||||
}else if( nk==NK_DbAboutToClose ){
|
||||
const char *zdb = (pvSubject==psx->dbUser)? "User"
|
||||
: (pvSubject==psx->dbShell)? "Shell" : "?";
|
||||
oprintf(psx, "db%s closing\n", zdb);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
** Extension load function.
|
||||
*/
|
||||
extern "C"
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
int sqlite3_testshellextcpp_init(
|
||||
sqlite3 *db,
|
||||
char **pzErrMsg,
|
||||
const sqlite3_api_routines *pApi
|
||||
){
|
||||
int iLdErr;
|
||||
int nErr = 0;
|
||||
SQLITE_EXTENSION_INIT2(pApi);
|
||||
SHELL_EXTENSION_INIT2(pShExtLink, shextLinkFetcher, db);
|
||||
|
||||
SHELL_EXTENSION_INIT3(pShExtApi, pExtHelpers, pShExtLink);
|
||||
iLdErr = SHELL_EXTENSION_LOADFAIL_WHY(pShExtLink, 5, 13);
|
||||
if( iLdErr!=EXLD_Ok ){
|
||||
*pzErrMsg = sqlite3_mprintf("Load failed, cause %d\n", iLdErr);
|
||||
return SQLITE_ERROR;
|
||||
}else{
|
||||
ShellExState *psx = pShExtLink->pSXS;
|
||||
int rc;
|
||||
char *zLoadArgs = sqlite3_mprintf("Load arguments:");
|
||||
int ila;
|
||||
|
||||
for( ila=0; ila<pShExtLink->nLoadArgs; ++ila ){
|
||||
zLoadArgs = sqlite3_mprintf("%z %s", zLoadArgs,
|
||||
pShExtLink->azLoadArgs[ila]);
|
||||
}
|
||||
if( ila ) oprintf(psx, "%s\n", zLoadArgs);
|
||||
sqlite3_free(zLoadArgs);
|
||||
SHX_API(subscribeEvents)(psx, sqlite3_testshellextcpp_init, &batty,
|
||||
NK_CountOf, shellEventHandle);
|
||||
batty.pPrint = SHX_HELPER(findDotCommand)("print", psx, &rc);
|
||||
batty.pPrior = SHX_HELPER(findDotCommand)(batty.name(), psx, &rc);
|
||||
rc = SHX_API(registerDotCommand)(psx,
|
||||
sqlite3_testshellextcpp_init, &batty);
|
||||
if( rc!=0 ) ++nErr;
|
||||
pShExtLink->eid = sqlite3_testshellextcpp_init;
|
||||
}
|
||||
return nErr ? SQLITE_ERROR : SQLITE_OK;
|
||||
}
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user