2 ** Read an SQLite database file and analyze its space utilization. Generate
3 ** text on standard output.
5 #define TCLSH_INIT_PROC sqlite3_analyzer_init_proc
6 #define SQLITE_ENABLE_DBSTAT_VTAB 1
7 #undef SQLITE_THREADSAFE
8 #define SQLITE_THREADSAFE 0
9 #undef SQLITE_ENABLE_COLUMN_METADATA
10 #define SQLITE_OMIT_DECLTYPE 1
11 #define SQLITE_OMIT_DEPRECATED 1
12 #define SQLITE_OMIT_PROGRESS_CALLBACK 1
13 #define SQLITE_OMIT_SHARED_CACHE 1
14 #define SQLITE_DEFAULT_MEMSTATUS 0
15 #define SQLITE_MAX_EXPR_DEPTH 0
16 #define SQLITE_OMIT_LOAD_EXTENSION 1
17 #if !defined(SQLITE_AMALGAMATION) && !defined(USE_EXTERNAL_SQLITE)
20 INCLUDE $ROOT
/src
/tclsqlite
.c
23 INCLUDE $ROOT
/ext
/consio
/console_io
.h
24 INCLUDE $ROOT
/ext
/consio
/console_io
.c
26 /* Substitute "puts" command. Only these forms recognized:
30 ** puts -nonewline STRING
32 static int subst_puts(
42 zOut
= Tcl_GetString(objv
[1]);
44 Tcl_WrongNumArgs(interp
, 1, objv
, "?stderr|-nonewline? STRING");
47 const char *zArg
= Tcl_GetString(objv
[1]);
48 if( zArg
==0 ) return TCL_ERROR
;
49 zOut
= Tcl_GetString(objv
[2]);
50 if( strcmp(zArg
, "stderr")==0 ){
52 }else if( strcmp(zArg
, "-nonewline")==0 ){
55 Tcl_AppendResult(interp
, "bad argument: ", zArg
, 0);
59 fPutsUtf8(zOut
, pOut
);
60 if( addNewLine
) fPutsUtf8("\n", pOut
);
63 #endif /* defined(_WIN32) */
65 const char *sqlite3_analyzer_init_proc(Tcl_Interp
*interp
){
67 Tcl_CreateObjCommand(interp
, "puts", subst_puts
, 0, 0);
73 INCLUDE $ROOT
/tool
/spaceanal
.tcl