os/persistentdata/persistentstorage/sqlite3api/TEST/SRC/test_config.c
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 ** 2007 May 7
     3 **
     4 ** The author disclaims copyright to this source code.  In place of
     5 ** a legal notice, here is a blessing:
     6 **
     7 **    May you do good and not evil.
     8 **    May you find forgiveness for yourself and forgive others.
     9 **    May you share freely, never taking more than you give.
    10 **
    11 *************************************************************************
    12 ** 
    13 ** This file contains code used for testing the SQLite system.
    14 ** None of the code in this file goes into a deliverable build.
    15 ** 
    16 ** The focus of this file is providing the TCL testing layer
    17 ** access to compile-time constants.
    18 **
    19 ** $Id: test_config.c,v 1.37 2008/09/23 10:16:05 drh Exp $
    20 */
    21 
    22 #include "sqliteLimit.h"
    23 
    24 #include "sqliteInt.h"
    25 #include "tcl.h"
    26 #include <stdlib.h>
    27 #include <string.h>
    28 
    29 /*
    30 ** Macro to stringify the results of the evaluation a pre-processor
    31 ** macro. i.e. so that STRINGVALUE(SQLITE_NOMEM) -> "7".
    32 */
    33 #define STRINGVALUE2(x) #x
    34 #define STRINGVALUE(x) STRINGVALUE2(x)
    35 
    36 /*
    37 ** This routine sets entries in the global ::sqlite_options() array variable
    38 ** according to the compile-time configuration of the database.  Test
    39 ** procedures use this to determine when tests should be omitted.
    40 */
    41 static void set_options(Tcl_Interp *interp){
    42 #ifdef SQLITE_32BIT_ROWID
    43   Tcl_SetVar2(interp, "sqlite_options", "rowid32", "1", TCL_GLOBAL_ONLY);
    44 #else
    45   Tcl_SetVar2(interp, "sqlite_options", "rowid32", "0", TCL_GLOBAL_ONLY);
    46 #endif
    47 
    48 #ifdef SQLITE_CASE_SENSITIVE_LIKE
    49   Tcl_SetVar2(interp, "sqlite_options","casesensitivelike","1",TCL_GLOBAL_ONLY);
    50 #else
    51   Tcl_SetVar2(interp, "sqlite_options","casesensitivelike","0",TCL_GLOBAL_ONLY);
    52 #endif
    53 
    54 #ifdef SQLITE_DEBUG
    55   Tcl_SetVar2(interp, "sqlite_options", "debug", "1", TCL_GLOBAL_ONLY);
    56 #else
    57   Tcl_SetVar2(interp, "sqlite_options", "debug", "0", TCL_GLOBAL_ONLY);
    58 #endif
    59 
    60 #ifdef SQLITE_DISABLE_DIRSYNC
    61   Tcl_SetVar2(interp, "sqlite_options", "dirsync", "0", TCL_GLOBAL_ONLY);
    62 #else
    63   Tcl_SetVar2(interp, "sqlite_options", "dirsync", "1", TCL_GLOBAL_ONLY);
    64 #endif
    65 
    66 #ifdef SQLITE_DISABLE_LFS
    67   Tcl_SetVar2(interp, "sqlite_options", "lfs", "0", TCL_GLOBAL_ONLY);
    68 #else
    69   Tcl_SetVar2(interp, "sqlite_options", "lfs", "1", TCL_GLOBAL_ONLY);
    70 #endif
    71 
    72 #if 1 /* def SQLITE_MEMDEBUG */
    73   Tcl_SetVar2(interp, "sqlite_options", "memdebug", "1", TCL_GLOBAL_ONLY);
    74 #else
    75   Tcl_SetVar2(interp, "sqlite_options", "memdebug", "0", TCL_GLOBAL_ONLY);
    76 #endif
    77 
    78 #ifdef SQLITE_ENABLE_MEMSYS3
    79   Tcl_SetVar2(interp, "sqlite_options", "mem3", "1", TCL_GLOBAL_ONLY);
    80 #else
    81   Tcl_SetVar2(interp, "sqlite_options", "mem3", "0", TCL_GLOBAL_ONLY);
    82 #endif
    83 
    84 #ifdef SQLITE_ENABLE_MEMSYS5
    85   Tcl_SetVar2(interp, "sqlite_options", "mem5", "1", TCL_GLOBAL_ONLY);
    86 #else
    87   Tcl_SetVar2(interp, "sqlite_options", "mem5", "0", TCL_GLOBAL_ONLY);
    88 #endif
    89 
    90 #ifdef SQLITE_OMIT_ALTERTABLE
    91   Tcl_SetVar2(interp, "sqlite_options", "altertable", "0", TCL_GLOBAL_ONLY);
    92 #else
    93   Tcl_SetVar2(interp, "sqlite_options", "altertable", "1", TCL_GLOBAL_ONLY);
    94 #endif
    95 
    96 #ifdef SQLITE_OMIT_ANALYZE
    97   Tcl_SetVar2(interp, "sqlite_options", "analyze", "0", TCL_GLOBAL_ONLY);
    98 #else
    99   Tcl_SetVar2(interp, "sqlite_options", "analyze", "1", TCL_GLOBAL_ONLY);
   100 #endif
   101 
   102 #ifdef SQLITE_ENABLE_ATOMIC_WRITE
   103   Tcl_SetVar2(interp, "sqlite_options", "atomicwrite", "1", TCL_GLOBAL_ONLY);
   104 #else
   105   Tcl_SetVar2(interp, "sqlite_options", "atomicwrite", "0", TCL_GLOBAL_ONLY);
   106 #endif
   107 
   108 #ifdef SQLITE_OMIT_ATTACH
   109   Tcl_SetVar2(interp, "sqlite_options", "attach", "0", TCL_GLOBAL_ONLY);
   110 #else
   111   Tcl_SetVar2(interp, "sqlite_options", "attach", "1", TCL_GLOBAL_ONLY);
   112 #endif
   113 
   114 #ifdef SQLITE_OMIT_AUTHORIZATION
   115   Tcl_SetVar2(interp, "sqlite_options", "auth", "0", TCL_GLOBAL_ONLY);
   116 #else
   117   Tcl_SetVar2(interp, "sqlite_options", "auth", "1", TCL_GLOBAL_ONLY);
   118 #endif
   119 
   120 #ifdef SQLITE_OMIT_AUTOINCREMENT
   121   Tcl_SetVar2(interp, "sqlite_options", "autoinc", "0", TCL_GLOBAL_ONLY);
   122 #else
   123   Tcl_SetVar2(interp, "sqlite_options", "autoinc", "1", TCL_GLOBAL_ONLY);
   124 #endif
   125 
   126 #ifdef SQLITE_OMIT_AUTOVACUUM
   127   Tcl_SetVar2(interp, "sqlite_options", "autovacuum", "0", TCL_GLOBAL_ONLY);
   128 #else
   129   Tcl_SetVar2(interp, "sqlite_options", "autovacuum", "1", TCL_GLOBAL_ONLY);
   130 #endif /* SQLITE_OMIT_AUTOVACUUM */
   131 #if !defined(SQLITE_DEFAULT_AUTOVACUUM)
   132   Tcl_SetVar2(interp,"sqlite_options","default_autovacuum","0",TCL_GLOBAL_ONLY);
   133 #else
   134   Tcl_SetVar2(interp, "sqlite_options", "default_autovacuum", 
   135       STRINGVALUE(SQLITE_DEFAULT_AUTOVACUUM), TCL_GLOBAL_ONLY);
   136 #endif
   137 
   138 #ifdef SQLITE_OMIT_BETWEEN_OPTIMIZATION
   139   Tcl_SetVar2(interp, "sqlite_options", "between_opt", "0", TCL_GLOBAL_ONLY);
   140 #else
   141   Tcl_SetVar2(interp, "sqlite_options", "between_opt", "1", TCL_GLOBAL_ONLY);
   142 #endif
   143 
   144 #ifdef SQLITE_OMIT_BUILTIN_TEST
   145   Tcl_SetVar2(interp, "sqlite_options", "builtin_test", "0", TCL_GLOBAL_ONLY);
   146 #else
   147   Tcl_SetVar2(interp, "sqlite_options", "builtin_test", "1", TCL_GLOBAL_ONLY);
   148 #endif
   149 
   150 #ifdef SQLITE_OMIT_BLOB_LITERAL
   151   Tcl_SetVar2(interp, "sqlite_options", "bloblit", "0", TCL_GLOBAL_ONLY);
   152 #else
   153   Tcl_SetVar2(interp, "sqlite_options", "bloblit", "1", TCL_GLOBAL_ONLY);
   154 #endif
   155 
   156 #ifdef SQLITE_OMIT_CAST
   157   Tcl_SetVar2(interp, "sqlite_options", "cast", "0", TCL_GLOBAL_ONLY);
   158 #else
   159   Tcl_SetVar2(interp, "sqlite_options", "cast", "1", TCL_GLOBAL_ONLY);
   160 #endif
   161 
   162 #ifdef SQLITE_OMIT_CHECK
   163   Tcl_SetVar2(interp, "sqlite_options", "check", "0", TCL_GLOBAL_ONLY);
   164 #else
   165   Tcl_SetVar2(interp, "sqlite_options", "check", "1", TCL_GLOBAL_ONLY);
   166 #endif
   167 
   168 #ifdef SQLITE_ENABLE_COLUMN_METADATA
   169   Tcl_SetVar2(interp, "sqlite_options", "columnmetadata", "1", TCL_GLOBAL_ONLY);
   170 #else
   171   Tcl_SetVar2(interp, "sqlite_options", "columnmetadata", "0", TCL_GLOBAL_ONLY);
   172 #endif
   173 
   174 #ifdef SQLITE_OMIT_COMPLETE
   175   Tcl_SetVar2(interp, "sqlite_options", "complete", "0", TCL_GLOBAL_ONLY);
   176 #else
   177   Tcl_SetVar2(interp, "sqlite_options", "complete", "1", TCL_GLOBAL_ONLY);
   178 #endif
   179 
   180 #ifdef SQLITE_OMIT_COMPOUND_SELECT
   181   Tcl_SetVar2(interp, "sqlite_options", "compound", "0", TCL_GLOBAL_ONLY);
   182 #else
   183   Tcl_SetVar2(interp, "sqlite_options", "compound", "1", TCL_GLOBAL_ONLY);
   184 #endif
   185 
   186 #ifdef SQLITE_OMIT_CONFLICT_CLAUSE
   187   Tcl_SetVar2(interp, "sqlite_options", "conflict", "0", TCL_GLOBAL_ONLY);
   188 #else
   189   Tcl_SetVar2(interp, "sqlite_options", "conflict", "1", TCL_GLOBAL_ONLY);
   190 #endif
   191 
   192 #if SQLITE_OS_UNIX
   193   Tcl_SetVar2(interp, "sqlite_options", "crashtest", "1", TCL_GLOBAL_ONLY);
   194 #else
   195   Tcl_SetVar2(interp, "sqlite_options", "crashtest", "0", TCL_GLOBAL_ONLY);
   196 #endif
   197 
   198 #ifdef SQLITE_OMIT_DATETIME_FUNCS
   199   Tcl_SetVar2(interp, "sqlite_options", "datetime", "0", TCL_GLOBAL_ONLY);
   200 #else
   201   Tcl_SetVar2(interp, "sqlite_options", "datetime", "1", TCL_GLOBAL_ONLY);
   202 #endif
   203 
   204 #ifdef SQLITE_OMIT_DECLTYPE
   205   Tcl_SetVar2(interp, "sqlite_options", "decltype", "0", TCL_GLOBAL_ONLY);
   206 #else
   207   Tcl_SetVar2(interp, "sqlite_options", "decltype", "1", TCL_GLOBAL_ONLY);
   208 #endif
   209 
   210 #ifdef SQLITE_OMIT_DISKIO
   211   Tcl_SetVar2(interp, "sqlite_options", "diskio", "0", TCL_GLOBAL_ONLY);
   212 #else
   213   Tcl_SetVar2(interp, "sqlite_options", "diskio", "1", TCL_GLOBAL_ONLY);
   214 #endif
   215 
   216 #ifdef SQLITE_OMIT_EXPLAIN
   217   Tcl_SetVar2(interp, "sqlite_options", "explain", "0", TCL_GLOBAL_ONLY);
   218 #else
   219   Tcl_SetVar2(interp, "sqlite_options", "explain", "1", TCL_GLOBAL_ONLY);
   220 #endif
   221 
   222 #ifdef SQLITE_OMIT_FLOATING_POINT
   223   Tcl_SetVar2(interp, "sqlite_options", "floatingpoint", "0", TCL_GLOBAL_ONLY);
   224 #else
   225   Tcl_SetVar2(interp, "sqlite_options", "floatingpoint", "1", TCL_GLOBAL_ONLY);
   226 #endif
   227 
   228 #ifdef SQLITE_OMIT_FOREIGN_KEY
   229   Tcl_SetVar2(interp, "sqlite_options", "foreignkey", "0", TCL_GLOBAL_ONLY);
   230 #else
   231   Tcl_SetVar2(interp, "sqlite_options", "foreignkey", "1", TCL_GLOBAL_ONLY);
   232 #endif
   233 
   234 #ifdef SQLITE_ENABLE_FTS1
   235   Tcl_SetVar2(interp, "sqlite_options", "fts1", "1", TCL_GLOBAL_ONLY);
   236 #else
   237   Tcl_SetVar2(interp, "sqlite_options", "fts1", "0", TCL_GLOBAL_ONLY);
   238 #endif
   239 
   240 #ifdef SQLITE_ENABLE_FTS2
   241   Tcl_SetVar2(interp, "sqlite_options", "fts2", "1", TCL_GLOBAL_ONLY);
   242 #else
   243   Tcl_SetVar2(interp, "sqlite_options", "fts2", "0", TCL_GLOBAL_ONLY);
   244 #endif
   245 
   246 #ifdef SQLITE_ENABLE_FTS3
   247   Tcl_SetVar2(interp, "sqlite_options", "fts3", "1", TCL_GLOBAL_ONLY);
   248 #else
   249   Tcl_SetVar2(interp, "sqlite_options", "fts3", "0", TCL_GLOBAL_ONLY);
   250 #endif
   251 
   252 #ifdef SQLITE_OMIT_GET_TABLE
   253   Tcl_SetVar2(interp, "sqlite_options", "gettable", "0", TCL_GLOBAL_ONLY);
   254 #else
   255   Tcl_SetVar2(interp, "sqlite_options", "gettable", "1", TCL_GLOBAL_ONLY);
   256 #endif
   257 
   258 #ifdef SQLITE_OMIT_GLOBALRECOVER
   259   Tcl_SetVar2(interp, "sqlite_options", "globalrecover", "0", TCL_GLOBAL_ONLY);
   260 #else
   261   Tcl_SetVar2(interp, "sqlite_options", "globalrecover", "1", TCL_GLOBAL_ONLY);
   262 #endif
   263 
   264 #ifdef SQLITE_ENABLE_ICU
   265   Tcl_SetVar2(interp, "sqlite_options", "icu", "1", TCL_GLOBAL_ONLY);
   266 #else
   267   Tcl_SetVar2(interp, "sqlite_options", "icu", "0", TCL_GLOBAL_ONLY);
   268 #endif
   269 
   270 #ifdef SQLITE_OMIT_INCRBLOB
   271   Tcl_SetVar2(interp, "sqlite_options", "incrblob", "0", TCL_GLOBAL_ONLY);
   272 #else
   273   Tcl_SetVar2(interp, "sqlite_options", "incrblob", "1", TCL_GLOBAL_ONLY);
   274 #endif /* SQLITE_OMIT_AUTOVACUUM */
   275 
   276 #ifdef SQLITE_OMIT_INTEGRITY_CHECK
   277   Tcl_SetVar2(interp, "sqlite_options", "integrityck", "0", TCL_GLOBAL_ONLY);
   278 #else
   279   Tcl_SetVar2(interp, "sqlite_options", "integrityck", "1", TCL_GLOBAL_ONLY);
   280 #endif
   281 
   282 #if defined(SQLITE_DEFAULT_FILE_FORMAT) && SQLITE_DEFAULT_FILE_FORMAT==1
   283   Tcl_SetVar2(interp, "sqlite_options", "legacyformat", "1", TCL_GLOBAL_ONLY);
   284 #else
   285   Tcl_SetVar2(interp, "sqlite_options", "legacyformat", "0", TCL_GLOBAL_ONLY);
   286 #endif
   287 
   288 #ifdef SQLITE_OMIT_LIKE_OPTIMIZATION
   289   Tcl_SetVar2(interp, "sqlite_options", "like_opt", "0", TCL_GLOBAL_ONLY);
   290 #else
   291   Tcl_SetVar2(interp, "sqlite_options", "like_opt", "1", TCL_GLOBAL_ONLY);
   292 #endif
   293 
   294 #ifdef SQLITE_OMIT_LOAD_EXTENSION
   295   Tcl_SetVar2(interp, "sqlite_options", "load_ext", "0", TCL_GLOBAL_ONLY);
   296 #else
   297   Tcl_SetVar2(interp, "sqlite_options", "load_ext", "1", TCL_GLOBAL_ONLY);
   298 #endif
   299 
   300 #ifdef SQLITE_OMIT_LOCALTIME
   301   Tcl_SetVar2(interp, "sqlite_options", "localtime", "0", TCL_GLOBAL_ONLY);
   302 #else
   303   Tcl_SetVar2(interp, "sqlite_options", "localtime", "1", TCL_GLOBAL_ONLY);
   304 #endif
   305 
   306 Tcl_SetVar2(interp, "sqlite_options", "long_double",
   307               sizeof(LONGDOUBLE_TYPE)>sizeof(double) ? "1" : "0",
   308               TCL_GLOBAL_ONLY);
   309 
   310 #ifdef SQLITE_OMIT_MEMORYDB
   311   Tcl_SetVar2(interp, "sqlite_options", "memorydb", "0", TCL_GLOBAL_ONLY);
   312 #else
   313   Tcl_SetVar2(interp, "sqlite_options", "memorydb", "1", TCL_GLOBAL_ONLY);
   314 #endif
   315 
   316 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
   317   Tcl_SetVar2(interp, "sqlite_options", "memorymanage", "1", TCL_GLOBAL_ONLY);
   318 #else
   319   Tcl_SetVar2(interp, "sqlite_options", "memorymanage", "0", TCL_GLOBAL_ONLY);
   320 #endif
   321 
   322 #ifdef SQLITE_OMIT_OR_OPTIMIZATION
   323   Tcl_SetVar2(interp, "sqlite_options", "or_opt", "0", TCL_GLOBAL_ONLY);
   324 #else
   325   Tcl_SetVar2(interp, "sqlite_options", "or_opt", "1", TCL_GLOBAL_ONLY);
   326 #endif
   327 
   328 #ifdef SQLITE_OMIT_PAGER_PRAGMAS
   329   Tcl_SetVar2(interp, "sqlite_options", "pager_pragmas", "0", TCL_GLOBAL_ONLY);
   330 #else
   331   Tcl_SetVar2(interp, "sqlite_options", "pager_pragmas", "1", TCL_GLOBAL_ONLY);
   332 #endif
   333 
   334 #ifdef SQLITE_OMIT_PARSER
   335   Tcl_SetVar2(interp, "sqlite_options", "parser", "0", TCL_GLOBAL_ONLY);
   336 #else
   337   Tcl_SetVar2(interp, "sqlite_options", "parser", "1", TCL_GLOBAL_ONLY);
   338 #endif
   339 
   340 #if defined(SQLITE_OMIT_PRAGMA) || defined(SQLITE_OMIT_FLAG_PRAGMAS)
   341   Tcl_SetVar2(interp, "sqlite_options", "pragma", "0", TCL_GLOBAL_ONLY);
   342   Tcl_SetVar2(interp, "sqlite_options", "integrityck", "0", TCL_GLOBAL_ONLY);
   343 #else
   344   Tcl_SetVar2(interp, "sqlite_options", "pragma", "1", TCL_GLOBAL_ONLY);
   345 #endif
   346 
   347 #ifdef SQLITE_OMIT_PROGRESS_CALLBACK
   348   Tcl_SetVar2(interp, "sqlite_options", "progress", "0", TCL_GLOBAL_ONLY);
   349 #else
   350   Tcl_SetVar2(interp, "sqlite_options", "progress", "1", TCL_GLOBAL_ONLY);
   351 #endif
   352 
   353 #ifdef SQLITE_OMIT_REINDEX
   354   Tcl_SetVar2(interp, "sqlite_options", "reindex", "0", TCL_GLOBAL_ONLY);
   355 #else
   356   Tcl_SetVar2(interp, "sqlite_options", "reindex", "1", TCL_GLOBAL_ONLY);
   357 #endif
   358 
   359 #ifdef SQLITE_ENABLE_RTREE
   360   Tcl_SetVar2(interp, "sqlite_options", "rtree", "1", TCL_GLOBAL_ONLY);
   361 #else
   362   Tcl_SetVar2(interp, "sqlite_options", "rtree", "0", TCL_GLOBAL_ONLY);
   363 #endif
   364 
   365 #ifdef SQLITE_OMIT_SCHEMA_PRAGMAS
   366   Tcl_SetVar2(interp, "sqlite_options", "schema_pragmas", "0", TCL_GLOBAL_ONLY);
   367 #else
   368   Tcl_SetVar2(interp, "sqlite_options", "schema_pragmas", "1", TCL_GLOBAL_ONLY);
   369 #endif
   370 
   371 #ifdef SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS
   372   Tcl_SetVar2(interp, "sqlite_options", "schema_version", "0", TCL_GLOBAL_ONLY);
   373 #else
   374   Tcl_SetVar2(interp, "sqlite_options", "schema_version", "1", TCL_GLOBAL_ONLY);
   375 #endif
   376 
   377 #ifdef SQLITE_OMIT_SHARED_CACHE
   378   Tcl_SetVar2(interp, "sqlite_options", "shared_cache", "0", TCL_GLOBAL_ONLY);
   379 #else
   380   Tcl_SetVar2(interp, "sqlite_options", "shared_cache", "1", TCL_GLOBAL_ONLY);
   381 #endif
   382 
   383 #ifdef SQLITE_OMIT_SUBQUERY
   384   Tcl_SetVar2(interp, "sqlite_options", "subquery", "0", TCL_GLOBAL_ONLY);
   385 #else
   386   Tcl_SetVar2(interp, "sqlite_options", "subquery", "1", TCL_GLOBAL_ONLY);
   387 #endif
   388 
   389 #ifdef SQLITE_OMIT_TCL_VARIABLE
   390   Tcl_SetVar2(interp, "sqlite_options", "tclvar", "0", TCL_GLOBAL_ONLY);
   391 #else
   392   Tcl_SetVar2(interp, "sqlite_options", "tclvar", "1", TCL_GLOBAL_ONLY);
   393 #endif
   394 
   395   Tcl_SetVar2(interp, "sqlite_options", "threadsafe", 
   396       STRINGVALUE(SQLITE_THREADSAFE), TCL_GLOBAL_ONLY);
   397   assert( sqlite3_threadsafe()==SQLITE_THREADSAFE );
   398 
   399 #ifdef SQLITE_OMIT_TRACE
   400   Tcl_SetVar2(interp, "sqlite_options", "trace", "0", TCL_GLOBAL_ONLY);
   401 #else
   402   Tcl_SetVar2(interp, "sqlite_options", "trace", "1", TCL_GLOBAL_ONLY);
   403 #endif
   404 
   405 #ifdef SQLITE_OMIT_TRIGGER
   406   Tcl_SetVar2(interp, "sqlite_options", "trigger", "0", TCL_GLOBAL_ONLY);
   407 #else
   408   Tcl_SetVar2(interp, "sqlite_options", "trigger", "1", TCL_GLOBAL_ONLY);
   409 #endif
   410 
   411 #ifdef SQLITE_OMIT_TEMPDB
   412   Tcl_SetVar2(interp, "sqlite_options", "tempdb", "0", TCL_GLOBAL_ONLY);
   413 #else
   414   Tcl_SetVar2(interp, "sqlite_options", "tempdb", "1", TCL_GLOBAL_ONLY);
   415 #endif
   416 
   417 #ifdef SQLITE_OMIT_UTF16
   418   Tcl_SetVar2(interp, "sqlite_options", "utf16", "0", TCL_GLOBAL_ONLY);
   419 #else
   420   Tcl_SetVar2(interp, "sqlite_options", "utf16", "1", TCL_GLOBAL_ONLY);
   421 #endif
   422 
   423 #if defined(SQLITE_OMIT_VACUUM) || defined(SQLITE_OMIT_ATTACH)
   424   Tcl_SetVar2(interp, "sqlite_options", "vacuum", "0", TCL_GLOBAL_ONLY);
   425 #else
   426   Tcl_SetVar2(interp, "sqlite_options", "vacuum", "1", TCL_GLOBAL_ONLY);
   427 #endif
   428 
   429 #ifdef SQLITE_OMIT_VIEW
   430   Tcl_SetVar2(interp, "sqlite_options", "view", "0", TCL_GLOBAL_ONLY);
   431 #else
   432   Tcl_SetVar2(interp, "sqlite_options", "view", "1", TCL_GLOBAL_ONLY);
   433 #endif
   434 
   435 #ifdef SQLITE_OMIT_VIRTUALTABLE
   436   Tcl_SetVar2(interp, "sqlite_options", "vtab", "0", TCL_GLOBAL_ONLY);
   437 #else
   438   Tcl_SetVar2(interp, "sqlite_options", "vtab", "1", TCL_GLOBAL_ONLY);
   439 #endif
   440 
   441 #ifdef SQLITE_OMIT_WSD
   442   Tcl_SetVar2(interp, "sqlite_options", "wsd", "0", TCL_GLOBAL_ONLY);
   443 #else
   444   Tcl_SetVar2(interp, "sqlite_options", "wsd", "1", TCL_GLOBAL_ONLY);
   445 #endif
   446 
   447 #ifdef SQLITE_SECURE_DELETE
   448   Tcl_SetVar2(interp, "sqlite_options", "secure_delete", "1", TCL_GLOBAL_ONLY);
   449 #else
   450   Tcl_SetVar2(interp, "sqlite_options", "secure_delete", "0", TCL_GLOBAL_ONLY);
   451 #endif
   452 
   453 #ifdef YYTRACKMAXSTACKDEPTH
   454   Tcl_SetVar2(interp, "sqlite_options", "yytrackmaxstackdepth", "1", TCL_GLOBAL_ONLY);
   455 #else
   456   Tcl_SetVar2(interp, "sqlite_options", "yytrackmaxstackdepth", "0", TCL_GLOBAL_ONLY);
   457 #endif
   458 
   459 #define LINKVAR(x) { \
   460     static const int cv_ ## x = SQLITE_ ## x; \
   461     Tcl_LinkVar(interp, "SQLITE_" #x, (char *)&(cv_ ## x), \
   462                 TCL_LINK_INT | TCL_LINK_READ_ONLY); }
   463 
   464   LINKVAR( MAX_LENGTH );
   465   LINKVAR( MAX_COLUMN );
   466   LINKVAR( MAX_SQL_LENGTH );
   467   LINKVAR( MAX_EXPR_DEPTH );
   468   LINKVAR( MAX_COMPOUND_SELECT );
   469   LINKVAR( MAX_VDBE_OP );
   470   LINKVAR( MAX_FUNCTION_ARG );
   471   LINKVAR( MAX_VARIABLE_NUMBER );
   472   LINKVAR( MAX_PAGE_SIZE );
   473   LINKVAR( MAX_PAGE_COUNT );
   474   LINKVAR( MAX_LIKE_PATTERN_LENGTH );
   475   LINKVAR( DEFAULT_TEMP_CACHE_SIZE );
   476   LINKVAR( DEFAULT_CACHE_SIZE );
   477   LINKVAR( DEFAULT_PAGE_SIZE );
   478   LINKVAR( DEFAULT_FILE_FORMAT );
   479   LINKVAR( MAX_ATTACHED );
   480 
   481   {
   482     static const int cv_TEMP_STORE = SQLITE_TEMP_STORE;
   483     Tcl_LinkVar(interp, "TEMP_STORE", (char *)&(cv_TEMP_STORE),
   484                 TCL_LINK_INT | TCL_LINK_READ_ONLY);
   485   }
   486 }
   487 
   488 
   489 /*
   490 ** Register commands with the TCL interpreter.
   491 */
   492 int Sqliteconfig_Init(Tcl_Interp *interp){
   493   set_options(interp);
   494   return TCL_OK;
   495 }