mirror of
https://github.com/sqlite/sqlite.git
synced 2026-01-06 08:01:16 +03:00
Fixes to the appendvfs.c extension. Add the "sqltclsh" application that
uses appendvfs.c to find its scripts. FossilOrigin-Name: ee248b529c2396c5480fb99b0a1dc31032627ec8241eca4a8c0fff257bb4a088
This commit is contained in:
42
tool/sqltclsh.c.in
Normal file
42
tool/sqltclsh.c.in
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
** This is the source code to a "tclsh" that has SQLite built-in.
|
||||
**
|
||||
** The startup script is located as follows:
|
||||
**
|
||||
** (1) Open the executable as an appended SQLite database and try to
|
||||
** read the startup script out of that database.
|
||||
**
|
||||
** (2) If the first argument is a readable file, try to open that file
|
||||
** as an SQLite database and read the startup script out of that
|
||||
** database.
|
||||
**
|
||||
** (3) If the first argument is a readable file with a ".tcl" extension,
|
||||
** then try to run that script directly.
|
||||
**
|
||||
** If none of the above steps work, then the program runs as an interactive
|
||||
** tclsh.
|
||||
*/
|
||||
#define TCLSH_INIT_PROC sqlite3_tclapp_init_proc
|
||||
#define SQLITE_ENABLE_DBSTAT_VTAB 1
|
||||
#undef SQLITE_THREADSAFE
|
||||
#define SQLITE_THREADSAFE 0
|
||||
#undef SQLITE_ENABLE_COLUMN_METADATA
|
||||
#define SQLITE_OMIT_DECLTYPE 1
|
||||
#define SQLITE_OMIT_DEPRECATED 1
|
||||
#define SQLITE_OMIT_PROGRESS_CALLBACK 1
|
||||
#define SQLITE_OMIT_SHARED_CACHE 1
|
||||
#define SQLITE_DEFAULT_MEMSTATUS 0
|
||||
#define SQLITE_MAX_EXPR_DEPTH 0
|
||||
INCLUDE sqlite3.c
|
||||
INCLUDE $ROOT/ext/misc/appendvfs.c
|
||||
INCLUDE $ROOT/src/tclsqlite.c
|
||||
|
||||
const char *sqlite3_tclapp_init_proc(Tcl_Interp *interp){
|
||||
(void)interp;
|
||||
sqlite3_appendvfs_init(0,0,0);
|
||||
return
|
||||
BEGIN_STRING
|
||||
INCLUDE $ROOT/tool/sqltclsh.tcl
|
||||
END_STRING
|
||||
;
|
||||
}
|
||||
Reference in New Issue
Block a user