os/persistentdata/persistentstorage/sqlite3api/TEST/SRC/test_config.c
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/SRC/test_config.c	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,495 @@
     1.4 +/*
     1.5 +** 2007 May 7
     1.6 +**
     1.7 +** The author disclaims copyright to this source code.  In place of
     1.8 +** a legal notice, here is a blessing:
     1.9 +**
    1.10 +**    May you do good and not evil.
    1.11 +**    May you find forgiveness for yourself and forgive others.
    1.12 +**    May you share freely, never taking more than you give.
    1.13 +**
    1.14 +*************************************************************************
    1.15 +** 
    1.16 +** This file contains code used for testing the SQLite system.
    1.17 +** None of the code in this file goes into a deliverable build.
    1.18 +** 
    1.19 +** The focus of this file is providing the TCL testing layer
    1.20 +** access to compile-time constants.
    1.21 +**
    1.22 +** $Id: test_config.c,v 1.37 2008/09/23 10:16:05 drh Exp $
    1.23 +*/
    1.24 +
    1.25 +#include "sqliteLimit.h"
    1.26 +
    1.27 +#include "sqliteInt.h"
    1.28 +#include "tcl.h"
    1.29 +#include <stdlib.h>
    1.30 +#include <string.h>
    1.31 +
    1.32 +/*
    1.33 +** Macro to stringify the results of the evaluation a pre-processor
    1.34 +** macro. i.e. so that STRINGVALUE(SQLITE_NOMEM) -> "7".
    1.35 +*/
    1.36 +#define STRINGVALUE2(x) #x
    1.37 +#define STRINGVALUE(x) STRINGVALUE2(x)
    1.38 +
    1.39 +/*
    1.40 +** This routine sets entries in the global ::sqlite_options() array variable
    1.41 +** according to the compile-time configuration of the database.  Test
    1.42 +** procedures use this to determine when tests should be omitted.
    1.43 +*/
    1.44 +static void set_options(Tcl_Interp *interp){
    1.45 +#ifdef SQLITE_32BIT_ROWID
    1.46 +  Tcl_SetVar2(interp, "sqlite_options", "rowid32", "1", TCL_GLOBAL_ONLY);
    1.47 +#else
    1.48 +  Tcl_SetVar2(interp, "sqlite_options", "rowid32", "0", TCL_GLOBAL_ONLY);
    1.49 +#endif
    1.50 +
    1.51 +#ifdef SQLITE_CASE_SENSITIVE_LIKE
    1.52 +  Tcl_SetVar2(interp, "sqlite_options","casesensitivelike","1",TCL_GLOBAL_ONLY);
    1.53 +#else
    1.54 +  Tcl_SetVar2(interp, "sqlite_options","casesensitivelike","0",TCL_GLOBAL_ONLY);
    1.55 +#endif
    1.56 +
    1.57 +#ifdef SQLITE_DEBUG
    1.58 +  Tcl_SetVar2(interp, "sqlite_options", "debug", "1", TCL_GLOBAL_ONLY);
    1.59 +#else
    1.60 +  Tcl_SetVar2(interp, "sqlite_options", "debug", "0", TCL_GLOBAL_ONLY);
    1.61 +#endif
    1.62 +
    1.63 +#ifdef SQLITE_DISABLE_DIRSYNC
    1.64 +  Tcl_SetVar2(interp, "sqlite_options", "dirsync", "0", TCL_GLOBAL_ONLY);
    1.65 +#else
    1.66 +  Tcl_SetVar2(interp, "sqlite_options", "dirsync", "1", TCL_GLOBAL_ONLY);
    1.67 +#endif
    1.68 +
    1.69 +#ifdef SQLITE_DISABLE_LFS
    1.70 +  Tcl_SetVar2(interp, "sqlite_options", "lfs", "0", TCL_GLOBAL_ONLY);
    1.71 +#else
    1.72 +  Tcl_SetVar2(interp, "sqlite_options", "lfs", "1", TCL_GLOBAL_ONLY);
    1.73 +#endif
    1.74 +
    1.75 +#if 1 /* def SQLITE_MEMDEBUG */
    1.76 +  Tcl_SetVar2(interp, "sqlite_options", "memdebug", "1", TCL_GLOBAL_ONLY);
    1.77 +#else
    1.78 +  Tcl_SetVar2(interp, "sqlite_options", "memdebug", "0", TCL_GLOBAL_ONLY);
    1.79 +#endif
    1.80 +
    1.81 +#ifdef SQLITE_ENABLE_MEMSYS3
    1.82 +  Tcl_SetVar2(interp, "sqlite_options", "mem3", "1", TCL_GLOBAL_ONLY);
    1.83 +#else
    1.84 +  Tcl_SetVar2(interp, "sqlite_options", "mem3", "0", TCL_GLOBAL_ONLY);
    1.85 +#endif
    1.86 +
    1.87 +#ifdef SQLITE_ENABLE_MEMSYS5
    1.88 +  Tcl_SetVar2(interp, "sqlite_options", "mem5", "1", TCL_GLOBAL_ONLY);
    1.89 +#else
    1.90 +  Tcl_SetVar2(interp, "sqlite_options", "mem5", "0", TCL_GLOBAL_ONLY);
    1.91 +#endif
    1.92 +
    1.93 +#ifdef SQLITE_OMIT_ALTERTABLE
    1.94 +  Tcl_SetVar2(interp, "sqlite_options", "altertable", "0", TCL_GLOBAL_ONLY);
    1.95 +#else
    1.96 +  Tcl_SetVar2(interp, "sqlite_options", "altertable", "1", TCL_GLOBAL_ONLY);
    1.97 +#endif
    1.98 +
    1.99 +#ifdef SQLITE_OMIT_ANALYZE
   1.100 +  Tcl_SetVar2(interp, "sqlite_options", "analyze", "0", TCL_GLOBAL_ONLY);
   1.101 +#else
   1.102 +  Tcl_SetVar2(interp, "sqlite_options", "analyze", "1", TCL_GLOBAL_ONLY);
   1.103 +#endif
   1.104 +
   1.105 +#ifdef SQLITE_ENABLE_ATOMIC_WRITE
   1.106 +  Tcl_SetVar2(interp, "sqlite_options", "atomicwrite", "1", TCL_GLOBAL_ONLY);
   1.107 +#else
   1.108 +  Tcl_SetVar2(interp, "sqlite_options", "atomicwrite", "0", TCL_GLOBAL_ONLY);
   1.109 +#endif
   1.110 +
   1.111 +#ifdef SQLITE_OMIT_ATTACH
   1.112 +  Tcl_SetVar2(interp, "sqlite_options", "attach", "0", TCL_GLOBAL_ONLY);
   1.113 +#else
   1.114 +  Tcl_SetVar2(interp, "sqlite_options", "attach", "1", TCL_GLOBAL_ONLY);
   1.115 +#endif
   1.116 +
   1.117 +#ifdef SQLITE_OMIT_AUTHORIZATION
   1.118 +  Tcl_SetVar2(interp, "sqlite_options", "auth", "0", TCL_GLOBAL_ONLY);
   1.119 +#else
   1.120 +  Tcl_SetVar2(interp, "sqlite_options", "auth", "1", TCL_GLOBAL_ONLY);
   1.121 +#endif
   1.122 +
   1.123 +#ifdef SQLITE_OMIT_AUTOINCREMENT
   1.124 +  Tcl_SetVar2(interp, "sqlite_options", "autoinc", "0", TCL_GLOBAL_ONLY);
   1.125 +#else
   1.126 +  Tcl_SetVar2(interp, "sqlite_options", "autoinc", "1", TCL_GLOBAL_ONLY);
   1.127 +#endif
   1.128 +
   1.129 +#ifdef SQLITE_OMIT_AUTOVACUUM
   1.130 +  Tcl_SetVar2(interp, "sqlite_options", "autovacuum", "0", TCL_GLOBAL_ONLY);
   1.131 +#else
   1.132 +  Tcl_SetVar2(interp, "sqlite_options", "autovacuum", "1", TCL_GLOBAL_ONLY);
   1.133 +#endif /* SQLITE_OMIT_AUTOVACUUM */
   1.134 +#if !defined(SQLITE_DEFAULT_AUTOVACUUM)
   1.135 +  Tcl_SetVar2(interp,"sqlite_options","default_autovacuum","0",TCL_GLOBAL_ONLY);
   1.136 +#else
   1.137 +  Tcl_SetVar2(interp, "sqlite_options", "default_autovacuum", 
   1.138 +      STRINGVALUE(SQLITE_DEFAULT_AUTOVACUUM), TCL_GLOBAL_ONLY);
   1.139 +#endif
   1.140 +
   1.141 +#ifdef SQLITE_OMIT_BETWEEN_OPTIMIZATION
   1.142 +  Tcl_SetVar2(interp, "sqlite_options", "between_opt", "0", TCL_GLOBAL_ONLY);
   1.143 +#else
   1.144 +  Tcl_SetVar2(interp, "sqlite_options", "between_opt", "1", TCL_GLOBAL_ONLY);
   1.145 +#endif
   1.146 +
   1.147 +#ifdef SQLITE_OMIT_BUILTIN_TEST
   1.148 +  Tcl_SetVar2(interp, "sqlite_options", "builtin_test", "0", TCL_GLOBAL_ONLY);
   1.149 +#else
   1.150 +  Tcl_SetVar2(interp, "sqlite_options", "builtin_test", "1", TCL_GLOBAL_ONLY);
   1.151 +#endif
   1.152 +
   1.153 +#ifdef SQLITE_OMIT_BLOB_LITERAL
   1.154 +  Tcl_SetVar2(interp, "sqlite_options", "bloblit", "0", TCL_GLOBAL_ONLY);
   1.155 +#else
   1.156 +  Tcl_SetVar2(interp, "sqlite_options", "bloblit", "1", TCL_GLOBAL_ONLY);
   1.157 +#endif
   1.158 +
   1.159 +#ifdef SQLITE_OMIT_CAST
   1.160 +  Tcl_SetVar2(interp, "sqlite_options", "cast", "0", TCL_GLOBAL_ONLY);
   1.161 +#else
   1.162 +  Tcl_SetVar2(interp, "sqlite_options", "cast", "1", TCL_GLOBAL_ONLY);
   1.163 +#endif
   1.164 +
   1.165 +#ifdef SQLITE_OMIT_CHECK
   1.166 +  Tcl_SetVar2(interp, "sqlite_options", "check", "0", TCL_GLOBAL_ONLY);
   1.167 +#else
   1.168 +  Tcl_SetVar2(interp, "sqlite_options", "check", "1", TCL_GLOBAL_ONLY);
   1.169 +#endif
   1.170 +
   1.171 +#ifdef SQLITE_ENABLE_COLUMN_METADATA
   1.172 +  Tcl_SetVar2(interp, "sqlite_options", "columnmetadata", "1", TCL_GLOBAL_ONLY);
   1.173 +#else
   1.174 +  Tcl_SetVar2(interp, "sqlite_options", "columnmetadata", "0", TCL_GLOBAL_ONLY);
   1.175 +#endif
   1.176 +
   1.177 +#ifdef SQLITE_OMIT_COMPLETE
   1.178 +  Tcl_SetVar2(interp, "sqlite_options", "complete", "0", TCL_GLOBAL_ONLY);
   1.179 +#else
   1.180 +  Tcl_SetVar2(interp, "sqlite_options", "complete", "1", TCL_GLOBAL_ONLY);
   1.181 +#endif
   1.182 +
   1.183 +#ifdef SQLITE_OMIT_COMPOUND_SELECT
   1.184 +  Tcl_SetVar2(interp, "sqlite_options", "compound", "0", TCL_GLOBAL_ONLY);
   1.185 +#else
   1.186 +  Tcl_SetVar2(interp, "sqlite_options", "compound", "1", TCL_GLOBAL_ONLY);
   1.187 +#endif
   1.188 +
   1.189 +#ifdef SQLITE_OMIT_CONFLICT_CLAUSE
   1.190 +  Tcl_SetVar2(interp, "sqlite_options", "conflict", "0", TCL_GLOBAL_ONLY);
   1.191 +#else
   1.192 +  Tcl_SetVar2(interp, "sqlite_options", "conflict", "1", TCL_GLOBAL_ONLY);
   1.193 +#endif
   1.194 +
   1.195 +#if SQLITE_OS_UNIX
   1.196 +  Tcl_SetVar2(interp, "sqlite_options", "crashtest", "1", TCL_GLOBAL_ONLY);
   1.197 +#else
   1.198 +  Tcl_SetVar2(interp, "sqlite_options", "crashtest", "0", TCL_GLOBAL_ONLY);
   1.199 +#endif
   1.200 +
   1.201 +#ifdef SQLITE_OMIT_DATETIME_FUNCS
   1.202 +  Tcl_SetVar2(interp, "sqlite_options", "datetime", "0", TCL_GLOBAL_ONLY);
   1.203 +#else
   1.204 +  Tcl_SetVar2(interp, "sqlite_options", "datetime", "1", TCL_GLOBAL_ONLY);
   1.205 +#endif
   1.206 +
   1.207 +#ifdef SQLITE_OMIT_DECLTYPE
   1.208 +  Tcl_SetVar2(interp, "sqlite_options", "decltype", "0", TCL_GLOBAL_ONLY);
   1.209 +#else
   1.210 +  Tcl_SetVar2(interp, "sqlite_options", "decltype", "1", TCL_GLOBAL_ONLY);
   1.211 +#endif
   1.212 +
   1.213 +#ifdef SQLITE_OMIT_DISKIO
   1.214 +  Tcl_SetVar2(interp, "sqlite_options", "diskio", "0", TCL_GLOBAL_ONLY);
   1.215 +#else
   1.216 +  Tcl_SetVar2(interp, "sqlite_options", "diskio", "1", TCL_GLOBAL_ONLY);
   1.217 +#endif
   1.218 +
   1.219 +#ifdef SQLITE_OMIT_EXPLAIN
   1.220 +  Tcl_SetVar2(interp, "sqlite_options", "explain", "0", TCL_GLOBAL_ONLY);
   1.221 +#else
   1.222 +  Tcl_SetVar2(interp, "sqlite_options", "explain", "1", TCL_GLOBAL_ONLY);
   1.223 +#endif
   1.224 +
   1.225 +#ifdef SQLITE_OMIT_FLOATING_POINT
   1.226 +  Tcl_SetVar2(interp, "sqlite_options", "floatingpoint", "0", TCL_GLOBAL_ONLY);
   1.227 +#else
   1.228 +  Tcl_SetVar2(interp, "sqlite_options", "floatingpoint", "1", TCL_GLOBAL_ONLY);
   1.229 +#endif
   1.230 +
   1.231 +#ifdef SQLITE_OMIT_FOREIGN_KEY
   1.232 +  Tcl_SetVar2(interp, "sqlite_options", "foreignkey", "0", TCL_GLOBAL_ONLY);
   1.233 +#else
   1.234 +  Tcl_SetVar2(interp, "sqlite_options", "foreignkey", "1", TCL_GLOBAL_ONLY);
   1.235 +#endif
   1.236 +
   1.237 +#ifdef SQLITE_ENABLE_FTS1
   1.238 +  Tcl_SetVar2(interp, "sqlite_options", "fts1", "1", TCL_GLOBAL_ONLY);
   1.239 +#else
   1.240 +  Tcl_SetVar2(interp, "sqlite_options", "fts1", "0", TCL_GLOBAL_ONLY);
   1.241 +#endif
   1.242 +
   1.243 +#ifdef SQLITE_ENABLE_FTS2
   1.244 +  Tcl_SetVar2(interp, "sqlite_options", "fts2", "1", TCL_GLOBAL_ONLY);
   1.245 +#else
   1.246 +  Tcl_SetVar2(interp, "sqlite_options", "fts2", "0", TCL_GLOBAL_ONLY);
   1.247 +#endif
   1.248 +
   1.249 +#ifdef SQLITE_ENABLE_FTS3
   1.250 +  Tcl_SetVar2(interp, "sqlite_options", "fts3", "1", TCL_GLOBAL_ONLY);
   1.251 +#else
   1.252 +  Tcl_SetVar2(interp, "sqlite_options", "fts3", "0", TCL_GLOBAL_ONLY);
   1.253 +#endif
   1.254 +
   1.255 +#ifdef SQLITE_OMIT_GET_TABLE
   1.256 +  Tcl_SetVar2(interp, "sqlite_options", "gettable", "0", TCL_GLOBAL_ONLY);
   1.257 +#else
   1.258 +  Tcl_SetVar2(interp, "sqlite_options", "gettable", "1", TCL_GLOBAL_ONLY);
   1.259 +#endif
   1.260 +
   1.261 +#ifdef SQLITE_OMIT_GLOBALRECOVER
   1.262 +  Tcl_SetVar2(interp, "sqlite_options", "globalrecover", "0", TCL_GLOBAL_ONLY);
   1.263 +#else
   1.264 +  Tcl_SetVar2(interp, "sqlite_options", "globalrecover", "1", TCL_GLOBAL_ONLY);
   1.265 +#endif
   1.266 +
   1.267 +#ifdef SQLITE_ENABLE_ICU
   1.268 +  Tcl_SetVar2(interp, "sqlite_options", "icu", "1", TCL_GLOBAL_ONLY);
   1.269 +#else
   1.270 +  Tcl_SetVar2(interp, "sqlite_options", "icu", "0", TCL_GLOBAL_ONLY);
   1.271 +#endif
   1.272 +
   1.273 +#ifdef SQLITE_OMIT_INCRBLOB
   1.274 +  Tcl_SetVar2(interp, "sqlite_options", "incrblob", "0", TCL_GLOBAL_ONLY);
   1.275 +#else
   1.276 +  Tcl_SetVar2(interp, "sqlite_options", "incrblob", "1", TCL_GLOBAL_ONLY);
   1.277 +#endif /* SQLITE_OMIT_AUTOVACUUM */
   1.278 +
   1.279 +#ifdef SQLITE_OMIT_INTEGRITY_CHECK
   1.280 +  Tcl_SetVar2(interp, "sqlite_options", "integrityck", "0", TCL_GLOBAL_ONLY);
   1.281 +#else
   1.282 +  Tcl_SetVar2(interp, "sqlite_options", "integrityck", "1", TCL_GLOBAL_ONLY);
   1.283 +#endif
   1.284 +
   1.285 +#if defined(SQLITE_DEFAULT_FILE_FORMAT) && SQLITE_DEFAULT_FILE_FORMAT==1
   1.286 +  Tcl_SetVar2(interp, "sqlite_options", "legacyformat", "1", TCL_GLOBAL_ONLY);
   1.287 +#else
   1.288 +  Tcl_SetVar2(interp, "sqlite_options", "legacyformat", "0", TCL_GLOBAL_ONLY);
   1.289 +#endif
   1.290 +
   1.291 +#ifdef SQLITE_OMIT_LIKE_OPTIMIZATION
   1.292 +  Tcl_SetVar2(interp, "sqlite_options", "like_opt", "0", TCL_GLOBAL_ONLY);
   1.293 +#else
   1.294 +  Tcl_SetVar2(interp, "sqlite_options", "like_opt", "1", TCL_GLOBAL_ONLY);
   1.295 +#endif
   1.296 +
   1.297 +#ifdef SQLITE_OMIT_LOAD_EXTENSION
   1.298 +  Tcl_SetVar2(interp, "sqlite_options", "load_ext", "0", TCL_GLOBAL_ONLY);
   1.299 +#else
   1.300 +  Tcl_SetVar2(interp, "sqlite_options", "load_ext", "1", TCL_GLOBAL_ONLY);
   1.301 +#endif
   1.302 +
   1.303 +#ifdef SQLITE_OMIT_LOCALTIME
   1.304 +  Tcl_SetVar2(interp, "sqlite_options", "localtime", "0", TCL_GLOBAL_ONLY);
   1.305 +#else
   1.306 +  Tcl_SetVar2(interp, "sqlite_options", "localtime", "1", TCL_GLOBAL_ONLY);
   1.307 +#endif
   1.308 +
   1.309 +Tcl_SetVar2(interp, "sqlite_options", "long_double",
   1.310 +              sizeof(LONGDOUBLE_TYPE)>sizeof(double) ? "1" : "0",
   1.311 +              TCL_GLOBAL_ONLY);
   1.312 +
   1.313 +#ifdef SQLITE_OMIT_MEMORYDB
   1.314 +  Tcl_SetVar2(interp, "sqlite_options", "memorydb", "0", TCL_GLOBAL_ONLY);
   1.315 +#else
   1.316 +  Tcl_SetVar2(interp, "sqlite_options", "memorydb", "1", TCL_GLOBAL_ONLY);
   1.317 +#endif
   1.318 +
   1.319 +#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
   1.320 +  Tcl_SetVar2(interp, "sqlite_options", "memorymanage", "1", TCL_GLOBAL_ONLY);
   1.321 +#else
   1.322 +  Tcl_SetVar2(interp, "sqlite_options", "memorymanage", "0", TCL_GLOBAL_ONLY);
   1.323 +#endif
   1.324 +
   1.325 +#ifdef SQLITE_OMIT_OR_OPTIMIZATION
   1.326 +  Tcl_SetVar2(interp, "sqlite_options", "or_opt", "0", TCL_GLOBAL_ONLY);
   1.327 +#else
   1.328 +  Tcl_SetVar2(interp, "sqlite_options", "or_opt", "1", TCL_GLOBAL_ONLY);
   1.329 +#endif
   1.330 +
   1.331 +#ifdef SQLITE_OMIT_PAGER_PRAGMAS
   1.332 +  Tcl_SetVar2(interp, "sqlite_options", "pager_pragmas", "0", TCL_GLOBAL_ONLY);
   1.333 +#else
   1.334 +  Tcl_SetVar2(interp, "sqlite_options", "pager_pragmas", "1", TCL_GLOBAL_ONLY);
   1.335 +#endif
   1.336 +
   1.337 +#ifdef SQLITE_OMIT_PARSER
   1.338 +  Tcl_SetVar2(interp, "sqlite_options", "parser", "0", TCL_GLOBAL_ONLY);
   1.339 +#else
   1.340 +  Tcl_SetVar2(interp, "sqlite_options", "parser", "1", TCL_GLOBAL_ONLY);
   1.341 +#endif
   1.342 +
   1.343 +#if defined(SQLITE_OMIT_PRAGMA) || defined(SQLITE_OMIT_FLAG_PRAGMAS)
   1.344 +  Tcl_SetVar2(interp, "sqlite_options", "pragma", "0", TCL_GLOBAL_ONLY);
   1.345 +  Tcl_SetVar2(interp, "sqlite_options", "integrityck", "0", TCL_GLOBAL_ONLY);
   1.346 +#else
   1.347 +  Tcl_SetVar2(interp, "sqlite_options", "pragma", "1", TCL_GLOBAL_ONLY);
   1.348 +#endif
   1.349 +
   1.350 +#ifdef SQLITE_OMIT_PROGRESS_CALLBACK
   1.351 +  Tcl_SetVar2(interp, "sqlite_options", "progress", "0", TCL_GLOBAL_ONLY);
   1.352 +#else
   1.353 +  Tcl_SetVar2(interp, "sqlite_options", "progress", "1", TCL_GLOBAL_ONLY);
   1.354 +#endif
   1.355 +
   1.356 +#ifdef SQLITE_OMIT_REINDEX
   1.357 +  Tcl_SetVar2(interp, "sqlite_options", "reindex", "0", TCL_GLOBAL_ONLY);
   1.358 +#else
   1.359 +  Tcl_SetVar2(interp, "sqlite_options", "reindex", "1", TCL_GLOBAL_ONLY);
   1.360 +#endif
   1.361 +
   1.362 +#ifdef SQLITE_ENABLE_RTREE
   1.363 +  Tcl_SetVar2(interp, "sqlite_options", "rtree", "1", TCL_GLOBAL_ONLY);
   1.364 +#else
   1.365 +  Tcl_SetVar2(interp, "sqlite_options", "rtree", "0", TCL_GLOBAL_ONLY);
   1.366 +#endif
   1.367 +
   1.368 +#ifdef SQLITE_OMIT_SCHEMA_PRAGMAS
   1.369 +  Tcl_SetVar2(interp, "sqlite_options", "schema_pragmas", "0", TCL_GLOBAL_ONLY);
   1.370 +#else
   1.371 +  Tcl_SetVar2(interp, "sqlite_options", "schema_pragmas", "1", TCL_GLOBAL_ONLY);
   1.372 +#endif
   1.373 +
   1.374 +#ifdef SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS
   1.375 +  Tcl_SetVar2(interp, "sqlite_options", "schema_version", "0", TCL_GLOBAL_ONLY);
   1.376 +#else
   1.377 +  Tcl_SetVar2(interp, "sqlite_options", "schema_version", "1", TCL_GLOBAL_ONLY);
   1.378 +#endif
   1.379 +
   1.380 +#ifdef SQLITE_OMIT_SHARED_CACHE
   1.381 +  Tcl_SetVar2(interp, "sqlite_options", "shared_cache", "0", TCL_GLOBAL_ONLY);
   1.382 +#else
   1.383 +  Tcl_SetVar2(interp, "sqlite_options", "shared_cache", "1", TCL_GLOBAL_ONLY);
   1.384 +#endif
   1.385 +
   1.386 +#ifdef SQLITE_OMIT_SUBQUERY
   1.387 +  Tcl_SetVar2(interp, "sqlite_options", "subquery", "0", TCL_GLOBAL_ONLY);
   1.388 +#else
   1.389 +  Tcl_SetVar2(interp, "sqlite_options", "subquery", "1", TCL_GLOBAL_ONLY);
   1.390 +#endif
   1.391 +
   1.392 +#ifdef SQLITE_OMIT_TCL_VARIABLE
   1.393 +  Tcl_SetVar2(interp, "sqlite_options", "tclvar", "0", TCL_GLOBAL_ONLY);
   1.394 +#else
   1.395 +  Tcl_SetVar2(interp, "sqlite_options", "tclvar", "1", TCL_GLOBAL_ONLY);
   1.396 +#endif
   1.397 +
   1.398 +  Tcl_SetVar2(interp, "sqlite_options", "threadsafe", 
   1.399 +      STRINGVALUE(SQLITE_THREADSAFE), TCL_GLOBAL_ONLY);
   1.400 +  assert( sqlite3_threadsafe()==SQLITE_THREADSAFE );
   1.401 +
   1.402 +#ifdef SQLITE_OMIT_TRACE
   1.403 +  Tcl_SetVar2(interp, "sqlite_options", "trace", "0", TCL_GLOBAL_ONLY);
   1.404 +#else
   1.405 +  Tcl_SetVar2(interp, "sqlite_options", "trace", "1", TCL_GLOBAL_ONLY);
   1.406 +#endif
   1.407 +
   1.408 +#ifdef SQLITE_OMIT_TRIGGER
   1.409 +  Tcl_SetVar2(interp, "sqlite_options", "trigger", "0", TCL_GLOBAL_ONLY);
   1.410 +#else
   1.411 +  Tcl_SetVar2(interp, "sqlite_options", "trigger", "1", TCL_GLOBAL_ONLY);
   1.412 +#endif
   1.413 +
   1.414 +#ifdef SQLITE_OMIT_TEMPDB
   1.415 +  Tcl_SetVar2(interp, "sqlite_options", "tempdb", "0", TCL_GLOBAL_ONLY);
   1.416 +#else
   1.417 +  Tcl_SetVar2(interp, "sqlite_options", "tempdb", "1", TCL_GLOBAL_ONLY);
   1.418 +#endif
   1.419 +
   1.420 +#ifdef SQLITE_OMIT_UTF16
   1.421 +  Tcl_SetVar2(interp, "sqlite_options", "utf16", "0", TCL_GLOBAL_ONLY);
   1.422 +#else
   1.423 +  Tcl_SetVar2(interp, "sqlite_options", "utf16", "1", TCL_GLOBAL_ONLY);
   1.424 +#endif
   1.425 +
   1.426 +#if defined(SQLITE_OMIT_VACUUM) || defined(SQLITE_OMIT_ATTACH)
   1.427 +  Tcl_SetVar2(interp, "sqlite_options", "vacuum", "0", TCL_GLOBAL_ONLY);
   1.428 +#else
   1.429 +  Tcl_SetVar2(interp, "sqlite_options", "vacuum", "1", TCL_GLOBAL_ONLY);
   1.430 +#endif
   1.431 +
   1.432 +#ifdef SQLITE_OMIT_VIEW
   1.433 +  Tcl_SetVar2(interp, "sqlite_options", "view", "0", TCL_GLOBAL_ONLY);
   1.434 +#else
   1.435 +  Tcl_SetVar2(interp, "sqlite_options", "view", "1", TCL_GLOBAL_ONLY);
   1.436 +#endif
   1.437 +
   1.438 +#ifdef SQLITE_OMIT_VIRTUALTABLE
   1.439 +  Tcl_SetVar2(interp, "sqlite_options", "vtab", "0", TCL_GLOBAL_ONLY);
   1.440 +#else
   1.441 +  Tcl_SetVar2(interp, "sqlite_options", "vtab", "1", TCL_GLOBAL_ONLY);
   1.442 +#endif
   1.443 +
   1.444 +#ifdef SQLITE_OMIT_WSD
   1.445 +  Tcl_SetVar2(interp, "sqlite_options", "wsd", "0", TCL_GLOBAL_ONLY);
   1.446 +#else
   1.447 +  Tcl_SetVar2(interp, "sqlite_options", "wsd", "1", TCL_GLOBAL_ONLY);
   1.448 +#endif
   1.449 +
   1.450 +#ifdef SQLITE_SECURE_DELETE
   1.451 +  Tcl_SetVar2(interp, "sqlite_options", "secure_delete", "1", TCL_GLOBAL_ONLY);
   1.452 +#else
   1.453 +  Tcl_SetVar2(interp, "sqlite_options", "secure_delete", "0", TCL_GLOBAL_ONLY);
   1.454 +#endif
   1.455 +
   1.456 +#ifdef YYTRACKMAXSTACKDEPTH
   1.457 +  Tcl_SetVar2(interp, "sqlite_options", "yytrackmaxstackdepth", "1", TCL_GLOBAL_ONLY);
   1.458 +#else
   1.459 +  Tcl_SetVar2(interp, "sqlite_options", "yytrackmaxstackdepth", "0", TCL_GLOBAL_ONLY);
   1.460 +#endif
   1.461 +
   1.462 +#define LINKVAR(x) { \
   1.463 +    static const int cv_ ## x = SQLITE_ ## x; \
   1.464 +    Tcl_LinkVar(interp, "SQLITE_" #x, (char *)&(cv_ ## x), \
   1.465 +                TCL_LINK_INT | TCL_LINK_READ_ONLY); }
   1.466 +
   1.467 +  LINKVAR( MAX_LENGTH );
   1.468 +  LINKVAR( MAX_COLUMN );
   1.469 +  LINKVAR( MAX_SQL_LENGTH );
   1.470 +  LINKVAR( MAX_EXPR_DEPTH );
   1.471 +  LINKVAR( MAX_COMPOUND_SELECT );
   1.472 +  LINKVAR( MAX_VDBE_OP );
   1.473 +  LINKVAR( MAX_FUNCTION_ARG );
   1.474 +  LINKVAR( MAX_VARIABLE_NUMBER );
   1.475 +  LINKVAR( MAX_PAGE_SIZE );
   1.476 +  LINKVAR( MAX_PAGE_COUNT );
   1.477 +  LINKVAR( MAX_LIKE_PATTERN_LENGTH );
   1.478 +  LINKVAR( DEFAULT_TEMP_CACHE_SIZE );
   1.479 +  LINKVAR( DEFAULT_CACHE_SIZE );
   1.480 +  LINKVAR( DEFAULT_PAGE_SIZE );
   1.481 +  LINKVAR( DEFAULT_FILE_FORMAT );
   1.482 +  LINKVAR( MAX_ATTACHED );
   1.483 +
   1.484 +  {
   1.485 +    static const int cv_TEMP_STORE = SQLITE_TEMP_STORE;
   1.486 +    Tcl_LinkVar(interp, "TEMP_STORE", (char *)&(cv_TEMP_STORE),
   1.487 +                TCL_LINK_INT | TCL_LINK_READ_ONLY);
   1.488 +  }
   1.489 +}
   1.490 +
   1.491 +
   1.492 +/*
   1.493 +** Register commands with the TCL interpreter.
   1.494 +*/
   1.495 +int Sqliteconfig_Init(Tcl_Interp *interp){
   1.496 +  set_options(interp);
   1.497 +  return TCL_OK;
   1.498 +}