4 ** The author disclaims copyright to this source code. In place of
5 ** a legal notice, here is a blessing:
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.
11 *************************************************************************
13 ** This file contains code used for testing the SQLite system.
14 ** None of the code in this file goes into a deliverable build.
16 ** The focus of this file is providing the TCL testing layer
17 ** access to compile-time constants.
20 #include "sqliteLimit.h"
22 #include "sqliteInt.h"
32 ** Macro to stringify the results of the evaluation a pre-processor
33 ** macro. i.e. so that STRINGVALUE(SQLITE_NOMEM) -> "7".
35 #define STRINGVALUE2(x) #x
36 #define STRINGVALUE(x) STRINGVALUE2(x)
39 ** This routine sets entries in the global ::sqlite_options() array variable
40 ** according to the compile-time configuration of the database. Test
41 ** procedures use this to determine when tests should be omitted.
43 static void set_options(Tcl_Interp
*interp
){
44 #ifdef HAVE_MALLOC_USABLE_SIZE
45 Tcl_SetVar2(interp
, "sqlite_options", "malloc_usable_size", "1",
48 Tcl_SetVar2(interp
, "sqlite_options", "malloc_usable_size", "0",
52 #ifdef SQLITE_32BIT_ROWID
53 Tcl_SetVar2(interp
, "sqlite_options", "rowid32", "1", TCL_GLOBAL_ONLY
);
55 Tcl_SetVar2(interp
, "sqlite_options", "rowid32", "0", TCL_GLOBAL_ONLY
);
58 #ifdef SQLITE_CASE_SENSITIVE_LIKE
59 Tcl_SetVar2(interp
, "sqlite_options","casesensitivelike","1",TCL_GLOBAL_ONLY
);
61 Tcl_SetVar2(interp
, "sqlite_options","casesensitivelike","0",TCL_GLOBAL_ONLY
);
64 #if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT
65 Tcl_SetVar2(interp
, "sqlite_options", "curdir", "1", TCL_GLOBAL_ONLY
);
67 Tcl_SetVar2(interp
, "sqlite_options", "curdir", "0", TCL_GLOBAL_ONLY
);
70 #ifdef SQLITE_WIN32_MALLOC
71 Tcl_SetVar2(interp
, "sqlite_options", "win32malloc", "1", TCL_GLOBAL_ONLY
);
73 Tcl_SetVar2(interp
, "sqlite_options", "win32malloc", "0", TCL_GLOBAL_ONLY
);
77 Tcl_SetVar2(interp
, "sqlite_options", "debug", "1", TCL_GLOBAL_ONLY
);
79 Tcl_SetVar2(interp
, "sqlite_options", "debug", "0", TCL_GLOBAL_ONLY
);
82 #ifdef SQLITE_DIRECT_OVERFLOW_READ
83 Tcl_SetVar2(interp
, "sqlite_options", "direct_read", "1", TCL_GLOBAL_ONLY
);
85 Tcl_SetVar2(interp
, "sqlite_options", "direct_read", "0", TCL_GLOBAL_ONLY
);
88 #ifdef SQLITE_DISABLE_DIRSYNC
89 Tcl_SetVar2(interp
, "sqlite_options", "dirsync", "0", TCL_GLOBAL_ONLY
);
91 Tcl_SetVar2(interp
, "sqlite_options", "dirsync", "1", TCL_GLOBAL_ONLY
);
94 #ifdef SQLITE_DISABLE_LFS
95 Tcl_SetVar2(interp
, "sqlite_options", "lfs", "0", TCL_GLOBAL_ONLY
);
97 Tcl_SetVar2(interp
, "sqlite_options", "lfs", "1", TCL_GLOBAL_ONLY
);
100 #if SQLITE_MAX_MMAP_SIZE>0
101 Tcl_SetVar2(interp
, "sqlite_options", "mmap", "1", TCL_GLOBAL_ONLY
);
103 Tcl_SetVar2(interp
, "sqlite_options", "mmap", "0", TCL_GLOBAL_ONLY
);
106 Tcl_SetVar2(interp
, "sqlite_options", "worker_threads",
107 STRINGVALUE(SQLITE_MAX_WORKER_THREADS
), TCL_GLOBAL_ONLY
110 #if 1 /* def SQLITE_MEMDEBUG */
111 Tcl_SetVar2(interp
, "sqlite_options", "memdebug", "1", TCL_GLOBAL_ONLY
);
113 Tcl_SetVar2(interp
, "sqlite_options", "memdebug", "0", TCL_GLOBAL_ONLY
);
116 #ifdef SQLITE_ENABLE_8_3_NAMES
117 Tcl_SetVar2(interp
, "sqlite_options", "8_3_names", "1", TCL_GLOBAL_ONLY
);
119 Tcl_SetVar2(interp
, "sqlite_options", "8_3_names", "0", TCL_GLOBAL_ONLY
);
122 #ifdef SQLITE_ENABLE_MEMSYS3
123 Tcl_SetVar2(interp
, "sqlite_options", "mem3", "1", TCL_GLOBAL_ONLY
);
125 Tcl_SetVar2(interp
, "sqlite_options", "mem3", "0", TCL_GLOBAL_ONLY
);
128 #ifdef SQLITE_ENABLE_MEMSYS5
129 Tcl_SetVar2(interp
, "sqlite_options", "mem5", "1", TCL_GLOBAL_ONLY
);
131 Tcl_SetVar2(interp
, "sqlite_options", "mem5", "0", TCL_GLOBAL_ONLY
);
134 #ifdef SQLITE_MUTEX_OMIT
135 Tcl_SetVar2(interp
, "sqlite_options", "mutex", "0", TCL_GLOBAL_ONLY
);
137 Tcl_SetVar2(interp
, "sqlite_options", "mutex", "1", TCL_GLOBAL_ONLY
);
140 #ifdef SQLITE_MUTEX_NOOP
141 Tcl_SetVar2(interp
, "sqlite_options", "mutex_noop", "1", TCL_GLOBAL_ONLY
);
143 Tcl_SetVar2(interp
, "sqlite_options", "mutex_noop", "0", TCL_GLOBAL_ONLY
);
146 #ifdef SQLITE_OMIT_ALTERTABLE
147 Tcl_SetVar2(interp
, "sqlite_options", "altertable", "0", TCL_GLOBAL_ONLY
);
149 Tcl_SetVar2(interp
, "sqlite_options", "altertable", "1", TCL_GLOBAL_ONLY
);
152 #ifdef SQLITE_OMIT_ANALYZE
153 Tcl_SetVar2(interp
, "sqlite_options", "analyze", "0", TCL_GLOBAL_ONLY
);
155 Tcl_SetVar2(interp
, "sqlite_options", "analyze", "1", TCL_GLOBAL_ONLY
);
158 #ifdef SQLITE_ENABLE_ATOMIC_WRITE
159 Tcl_SetVar2(interp
, "sqlite_options", "atomicwrite", "1", TCL_GLOBAL_ONLY
);
161 Tcl_SetVar2(interp
, "sqlite_options", "atomicwrite", "0", TCL_GLOBAL_ONLY
);
164 #ifdef SQLITE_OMIT_ATTACH
165 Tcl_SetVar2(interp
, "sqlite_options", "attach", "0", TCL_GLOBAL_ONLY
);
167 Tcl_SetVar2(interp
, "sqlite_options", "attach", "1", TCL_GLOBAL_ONLY
);
170 #ifdef SQLITE_OMIT_AUTHORIZATION
171 Tcl_SetVar2(interp
, "sqlite_options", "auth", "0", TCL_GLOBAL_ONLY
);
173 Tcl_SetVar2(interp
, "sqlite_options", "auth", "1", TCL_GLOBAL_ONLY
);
176 #ifdef SQLITE_OMIT_AUTOINCREMENT
177 Tcl_SetVar2(interp
, "sqlite_options", "autoinc", "0", TCL_GLOBAL_ONLY
);
179 Tcl_SetVar2(interp
, "sqlite_options", "autoinc", "1", TCL_GLOBAL_ONLY
);
182 #ifdef SQLITE_OMIT_AUTOMATIC_INDEX
183 Tcl_SetVar2(interp
, "sqlite_options", "autoindex", "0", TCL_GLOBAL_ONLY
);
185 Tcl_SetVar2(interp
, "sqlite_options", "autoindex", "1", TCL_GLOBAL_ONLY
);
188 #ifdef SQLITE_OMIT_AUTORESET
189 Tcl_SetVar2(interp
, "sqlite_options", "autoreset", "0", TCL_GLOBAL_ONLY
);
191 Tcl_SetVar2(interp
, "sqlite_options", "autoreset", "1", TCL_GLOBAL_ONLY
);
194 #ifdef SQLITE_OMIT_AUTOVACUUM
195 Tcl_SetVar2(interp
, "sqlite_options", "autovacuum", "0", TCL_GLOBAL_ONLY
);
197 Tcl_SetVar2(interp
, "sqlite_options", "autovacuum", "1", TCL_GLOBAL_ONLY
);
198 #endif /* SQLITE_OMIT_AUTOVACUUM */
199 #if !defined(SQLITE_DEFAULT_AUTOVACUUM)
200 Tcl_SetVar2(interp
,"sqlite_options","default_autovacuum","0",TCL_GLOBAL_ONLY
);
202 Tcl_SetVar2(interp
, "sqlite_options", "default_autovacuum",
203 STRINGVALUE(SQLITE_DEFAULT_AUTOVACUUM
), TCL_GLOBAL_ONLY
);
206 #ifdef SQLITE_OMIT_BETWEEN_OPTIMIZATION
207 Tcl_SetVar2(interp
, "sqlite_options", "between_opt", "0", TCL_GLOBAL_ONLY
);
209 Tcl_SetVar2(interp
, "sqlite_options", "between_opt", "1", TCL_GLOBAL_ONLY
);
212 #ifdef SQLITE_OMIT_BUILTIN_TEST
213 Tcl_SetVar2(interp
, "sqlite_options", "builtin_test", "0", TCL_GLOBAL_ONLY
);
215 Tcl_SetVar2(interp
, "sqlite_options", "builtin_test", "1", TCL_GLOBAL_ONLY
);
218 #ifdef SQLITE_OMIT_BLOB_LITERAL
219 Tcl_SetVar2(interp
, "sqlite_options", "bloblit", "0", TCL_GLOBAL_ONLY
);
221 Tcl_SetVar2(interp
, "sqlite_options", "bloblit", "1", TCL_GLOBAL_ONLY
);
224 #ifdef SQLITE_OMIT_CAST
225 Tcl_SetVar2(interp
, "sqlite_options", "cast", "0", TCL_GLOBAL_ONLY
);
227 Tcl_SetVar2(interp
, "sqlite_options", "cast", "1", TCL_GLOBAL_ONLY
);
230 #ifdef SQLITE_OMIT_CHECK
231 Tcl_SetVar2(interp
, "sqlite_options", "check", "0", TCL_GLOBAL_ONLY
);
233 Tcl_SetVar2(interp
, "sqlite_options", "check", "1", TCL_GLOBAL_ONLY
);
236 #ifdef SQLITE_OMIT_CTE
237 Tcl_SetVar2(interp
, "sqlite_options", "cte", "0", TCL_GLOBAL_ONLY
);
239 Tcl_SetVar2(interp
, "sqlite_options", "cte", "1", TCL_GLOBAL_ONLY
);
242 #ifdef SQLITE_ENABLE_COLUMN_METADATA
243 Tcl_SetVar2(interp
, "sqlite_options", "columnmetadata", "1", TCL_GLOBAL_ONLY
);
245 Tcl_SetVar2(interp
, "sqlite_options", "columnmetadata", "0", TCL_GLOBAL_ONLY
);
248 #ifdef SQLITE_ENABLE_OVERSIZE_CELL_CHECK
249 Tcl_SetVar2(interp
, "sqlite_options", "oversize_cell_check", "1",
252 Tcl_SetVar2(interp
, "sqlite_options", "oversize_cell_check", "0",
256 #ifdef SQLITE_OMIT_COMPILEOPTION_DIAGS
257 Tcl_SetVar2(interp
, "sqlite_options", "compileoption_diags", "0", TCL_GLOBAL_ONLY
);
259 Tcl_SetVar2(interp
, "sqlite_options", "compileoption_diags", "1", TCL_GLOBAL_ONLY
);
262 #ifdef SQLITE_OMIT_COMPLETE
263 Tcl_SetVar2(interp
, "sqlite_options", "complete", "0", TCL_GLOBAL_ONLY
);
265 Tcl_SetVar2(interp
, "sqlite_options", "complete", "1", TCL_GLOBAL_ONLY
);
268 #ifdef SQLITE_OMIT_COMPOUND_SELECT
269 Tcl_SetVar2(interp
, "sqlite_options", "compound", "0", TCL_GLOBAL_ONLY
);
271 Tcl_SetVar2(interp
, "sqlite_options", "compound", "1", TCL_GLOBAL_ONLY
);
274 Tcl_SetVar2(interp
, "sqlite_options", "conflict", "1", TCL_GLOBAL_ONLY
);
275 Tcl_SetVar2(interp
, "sqlite_options", "crashtest", "1", TCL_GLOBAL_ONLY
);
277 #ifdef SQLITE_OMIT_DATETIME_FUNCS
278 Tcl_SetVar2(interp
, "sqlite_options", "datetime", "0", TCL_GLOBAL_ONLY
);
280 Tcl_SetVar2(interp
, "sqlite_options", "datetime", "1", TCL_GLOBAL_ONLY
);
283 #ifdef SQLITE_OMIT_DECLTYPE
284 Tcl_SetVar2(interp
, "sqlite_options", "decltype", "0", TCL_GLOBAL_ONLY
);
286 Tcl_SetVar2(interp
, "sqlite_options", "decltype", "1", TCL_GLOBAL_ONLY
);
289 #ifdef SQLITE_OMIT_DEPRECATED
290 Tcl_SetVar2(interp
, "sqlite_options", "deprecated", "0", TCL_GLOBAL_ONLY
);
292 Tcl_SetVar2(interp
, "sqlite_options", "deprecated", "1", TCL_GLOBAL_ONLY
);
295 #ifdef SQLITE_OMIT_DISKIO
296 Tcl_SetVar2(interp
, "sqlite_options", "diskio", "0", TCL_GLOBAL_ONLY
);
298 Tcl_SetVar2(interp
, "sqlite_options", "diskio", "1", TCL_GLOBAL_ONLY
);
301 #ifdef SQLITE_OMIT_EXPLAIN
302 Tcl_SetVar2(interp
, "sqlite_options", "explain", "0", TCL_GLOBAL_ONLY
);
304 Tcl_SetVar2(interp
, "sqlite_options", "explain", "1", TCL_GLOBAL_ONLY
);
307 #ifdef SQLITE_OMIT_FLOATING_POINT
308 Tcl_SetVar2(interp
, "sqlite_options", "floatingpoint", "0", TCL_GLOBAL_ONLY
);
310 Tcl_SetVar2(interp
, "sqlite_options", "floatingpoint", "1", TCL_GLOBAL_ONLY
);
313 #ifdef SQLITE_OMIT_FOREIGN_KEY
314 Tcl_SetVar2(interp
, "sqlite_options", "foreignkey", "0", TCL_GLOBAL_ONLY
);
316 Tcl_SetVar2(interp
, "sqlite_options", "foreignkey", "1", TCL_GLOBAL_ONLY
);
319 #ifdef SQLITE_ENABLE_FTS1
320 Tcl_SetVar2(interp
, "sqlite_options", "fts1", "1", TCL_GLOBAL_ONLY
);
322 Tcl_SetVar2(interp
, "sqlite_options", "fts1", "0", TCL_GLOBAL_ONLY
);
325 #ifdef SQLITE_ENABLE_FTS2
326 Tcl_SetVar2(interp
, "sqlite_options", "fts2", "1", TCL_GLOBAL_ONLY
);
328 Tcl_SetVar2(interp
, "sqlite_options", "fts2", "0", TCL_GLOBAL_ONLY
);
331 #ifdef SQLITE_ENABLE_FTS3
332 Tcl_SetVar2(interp
, "sqlite_options", "fts3", "1", TCL_GLOBAL_ONLY
);
334 Tcl_SetVar2(interp
, "sqlite_options", "fts3", "0", TCL_GLOBAL_ONLY
);
337 #if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_DISABLE_FTS3_UNICODE)
338 Tcl_SetVar2(interp
, "sqlite_options", "fts3_unicode", "1", TCL_GLOBAL_ONLY
);
340 Tcl_SetVar2(interp
, "sqlite_options", "fts3_unicode", "0", TCL_GLOBAL_ONLY
);
343 #ifdef SQLITE_DISABLE_FTS4_DEFERRED
344 Tcl_SetVar2(interp
, "sqlite_options", "fts4_deferred", "0", TCL_GLOBAL_ONLY
);
346 Tcl_SetVar2(interp
, "sqlite_options", "fts4_deferred", "1", TCL_GLOBAL_ONLY
);
349 #ifdef SQLITE_OMIT_GET_TABLE
350 Tcl_SetVar2(interp
, "sqlite_options", "gettable", "0", TCL_GLOBAL_ONLY
);
352 Tcl_SetVar2(interp
, "sqlite_options", "gettable", "1", TCL_GLOBAL_ONLY
);
355 #ifdef SQLITE_ENABLE_ICU
356 Tcl_SetVar2(interp
, "sqlite_options", "icu", "1", TCL_GLOBAL_ONLY
);
358 Tcl_SetVar2(interp
, "sqlite_options", "icu", "0", TCL_GLOBAL_ONLY
);
361 #ifdef SQLITE_OMIT_INCRBLOB
362 Tcl_SetVar2(interp
, "sqlite_options", "incrblob", "0", TCL_GLOBAL_ONLY
);
364 Tcl_SetVar2(interp
, "sqlite_options", "incrblob", "1", TCL_GLOBAL_ONLY
);
365 #endif /* SQLITE_OMIT_AUTOVACUUM */
367 #ifdef SQLITE_OMIT_INTEGRITY_CHECK
368 Tcl_SetVar2(interp
, "sqlite_options", "integrityck", "0", TCL_GLOBAL_ONLY
);
370 Tcl_SetVar2(interp
, "sqlite_options", "integrityck", "1", TCL_GLOBAL_ONLY
);
373 #if defined(SQLITE_DEFAULT_FILE_FORMAT) && SQLITE_DEFAULT_FILE_FORMAT==1
374 Tcl_SetVar2(interp
, "sqlite_options", "legacyformat", "1", TCL_GLOBAL_ONLY
);
376 Tcl_SetVar2(interp
, "sqlite_options", "legacyformat", "0", TCL_GLOBAL_ONLY
);
379 #ifdef SQLITE_OMIT_LIKE_OPTIMIZATION
380 Tcl_SetVar2(interp
, "sqlite_options", "like_opt", "0", TCL_GLOBAL_ONLY
);
382 Tcl_SetVar2(interp
, "sqlite_options", "like_opt", "1", TCL_GLOBAL_ONLY
);
385 #ifdef SQLITE_OMIT_LOAD_EXTENSION
386 Tcl_SetVar2(interp
, "sqlite_options", "load_ext", "0", TCL_GLOBAL_ONLY
);
388 Tcl_SetVar2(interp
, "sqlite_options", "load_ext", "1", TCL_GLOBAL_ONLY
);
391 #ifdef SQLITE_OMIT_LOCALTIME
392 Tcl_SetVar2(interp
, "sqlite_options", "localtime", "0", TCL_GLOBAL_ONLY
);
394 Tcl_SetVar2(interp
, "sqlite_options", "localtime", "1", TCL_GLOBAL_ONLY
);
397 #ifdef SQLITE_OMIT_LOOKASIDE
398 Tcl_SetVar2(interp
, "sqlite_options", "lookaside", "0", TCL_GLOBAL_ONLY
);
400 Tcl_SetVar2(interp
, "sqlite_options", "lookaside", "1", TCL_GLOBAL_ONLY
);
403 Tcl_SetVar2(interp
, "sqlite_options", "long_double",
404 sizeof(LONGDOUBLE_TYPE
)>sizeof(double) ? "1" : "0",
407 #ifdef SQLITE_OMIT_MEMORYDB
408 Tcl_SetVar2(interp
, "sqlite_options", "memorydb", "0", TCL_GLOBAL_ONLY
);
410 Tcl_SetVar2(interp
, "sqlite_options", "memorydb", "1", TCL_GLOBAL_ONLY
);
413 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
414 Tcl_SetVar2(interp
, "sqlite_options", "memorymanage", "1", TCL_GLOBAL_ONLY
);
416 Tcl_SetVar2(interp
, "sqlite_options", "memorymanage", "0", TCL_GLOBAL_ONLY
);
419 Tcl_SetVar2(interp
, "sqlite_options", "mergesort", "1", TCL_GLOBAL_ONLY
);
421 #ifdef SQLITE_OMIT_OR_OPTIMIZATION
422 Tcl_SetVar2(interp
, "sqlite_options", "or_opt", "0", TCL_GLOBAL_ONLY
);
424 Tcl_SetVar2(interp
, "sqlite_options", "or_opt", "1", TCL_GLOBAL_ONLY
);
427 #ifdef SQLITE_OMIT_PAGER_PRAGMAS
428 Tcl_SetVar2(interp
, "sqlite_options", "pager_pragmas", "0", TCL_GLOBAL_ONLY
);
430 Tcl_SetVar2(interp
, "sqlite_options", "pager_pragmas", "1", TCL_GLOBAL_ONLY
);
433 #if defined(SQLITE_OMIT_PRAGMA) || defined(SQLITE_OMIT_FLAG_PRAGMAS)
434 Tcl_SetVar2(interp
, "sqlite_options", "pragma", "0", TCL_GLOBAL_ONLY
);
435 Tcl_SetVar2(interp
, "sqlite_options", "integrityck", "0", TCL_GLOBAL_ONLY
);
437 Tcl_SetVar2(interp
, "sqlite_options", "pragma", "1", TCL_GLOBAL_ONLY
);
440 #ifdef SQLITE_OMIT_PROGRESS_CALLBACK
441 Tcl_SetVar2(interp
, "sqlite_options", "progress", "0", TCL_GLOBAL_ONLY
);
443 Tcl_SetVar2(interp
, "sqlite_options", "progress", "1", TCL_GLOBAL_ONLY
);
446 #ifdef SQLITE_OMIT_REINDEX
447 Tcl_SetVar2(interp
, "sqlite_options", "reindex", "0", TCL_GLOBAL_ONLY
);
449 Tcl_SetVar2(interp
, "sqlite_options", "reindex", "1", TCL_GLOBAL_ONLY
);
452 #ifdef SQLITE_ENABLE_RTREE
453 Tcl_SetVar2(interp
, "sqlite_options", "rtree", "1", TCL_GLOBAL_ONLY
);
455 Tcl_SetVar2(interp
, "sqlite_options", "rtree", "0", TCL_GLOBAL_ONLY
);
458 #ifdef SQLITE_RTREE_INT_ONLY
459 Tcl_SetVar2(interp
, "sqlite_options", "rtree_int_only", "1", TCL_GLOBAL_ONLY
);
461 Tcl_SetVar2(interp
, "sqlite_options", "rtree_int_only", "0", TCL_GLOBAL_ONLY
);
464 #ifdef SQLITE_OMIT_SCHEMA_PRAGMAS
465 Tcl_SetVar2(interp
, "sqlite_options", "schema_pragmas", "0", TCL_GLOBAL_ONLY
);
467 Tcl_SetVar2(interp
, "sqlite_options", "schema_pragmas", "1", TCL_GLOBAL_ONLY
);
470 #ifdef SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS
471 Tcl_SetVar2(interp
, "sqlite_options", "schema_version", "0", TCL_GLOBAL_ONLY
);
473 Tcl_SetVar2(interp
, "sqlite_options", "schema_version", "1", TCL_GLOBAL_ONLY
);
476 #ifdef SQLITE_ENABLE_STAT4
477 Tcl_SetVar2(interp
, "sqlite_options", "stat4", "1", TCL_GLOBAL_ONLY
);
479 Tcl_SetVar2(interp
, "sqlite_options", "stat4", "0", TCL_GLOBAL_ONLY
);
481 #if defined(SQLITE_ENABLE_STAT3) && !defined(SQLITE_ENABLE_STAT4)
482 Tcl_SetVar2(interp
, "sqlite_options", "stat3", "1", TCL_GLOBAL_ONLY
);
484 Tcl_SetVar2(interp
, "sqlite_options", "stat3", "0", TCL_GLOBAL_ONLY
);
487 #if !defined(SQLITE_ENABLE_LOCKING_STYLE)
488 # if defined(__APPLE__)
489 # define SQLITE_ENABLE_LOCKING_STYLE 1
491 # define SQLITE_ENABLE_LOCKING_STYLE 0
494 #if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__)
495 Tcl_SetVar2(interp
,"sqlite_options","lock_proxy_pragmas","1",TCL_GLOBAL_ONLY
);
497 Tcl_SetVar2(interp
,"sqlite_options","lock_proxy_pragmas","0",TCL_GLOBAL_ONLY
);
499 #if defined(SQLITE_PREFER_PROXY_LOCKING) && defined(__APPLE__)
500 Tcl_SetVar2(interp
,"sqlite_options","prefer_proxy_locking","1",TCL_GLOBAL_ONLY
);
502 Tcl_SetVar2(interp
,"sqlite_options","prefer_proxy_locking","0",TCL_GLOBAL_ONLY
);
506 #ifdef SQLITE_OMIT_SHARED_CACHE
507 Tcl_SetVar2(interp
, "sqlite_options", "shared_cache", "0", TCL_GLOBAL_ONLY
);
509 Tcl_SetVar2(interp
, "sqlite_options", "shared_cache", "1", TCL_GLOBAL_ONLY
);
512 #ifdef SQLITE_OMIT_SUBQUERY
513 Tcl_SetVar2(interp
, "sqlite_options", "subquery", "0", TCL_GLOBAL_ONLY
);
515 Tcl_SetVar2(interp
, "sqlite_options", "subquery", "1", TCL_GLOBAL_ONLY
);
518 #ifdef SQLITE_OMIT_TCL_VARIABLE
519 Tcl_SetVar2(interp
, "sqlite_options", "tclvar", "0", TCL_GLOBAL_ONLY
);
521 Tcl_SetVar2(interp
, "sqlite_options", "tclvar", "1", TCL_GLOBAL_ONLY
);
524 Tcl_SetVar2(interp
, "sqlite_options", "threadsafe",
525 STRINGVALUE(SQLITE_THREADSAFE
), TCL_GLOBAL_ONLY
);
526 assert( sqlite3_threadsafe()==SQLITE_THREADSAFE
);
528 #ifdef SQLITE_OMIT_TEMPDB
529 Tcl_SetVar2(interp
, "sqlite_options", "tempdb", "0", TCL_GLOBAL_ONLY
);
531 Tcl_SetVar2(interp
, "sqlite_options", "tempdb", "1", TCL_GLOBAL_ONLY
);
534 #ifdef SQLITE_OMIT_TRACE
535 Tcl_SetVar2(interp
, "sqlite_options", "trace", "0", TCL_GLOBAL_ONLY
);
537 Tcl_SetVar2(interp
, "sqlite_options", "trace", "1", TCL_GLOBAL_ONLY
);
540 #ifdef SQLITE_OMIT_TRIGGER
541 Tcl_SetVar2(interp
, "sqlite_options", "trigger", "0", TCL_GLOBAL_ONLY
);
543 Tcl_SetVar2(interp
, "sqlite_options", "trigger", "1", TCL_GLOBAL_ONLY
);
546 #ifdef SQLITE_OMIT_TRUNCATE_OPTIMIZATION
547 Tcl_SetVar2(interp
, "sqlite_options", "truncate_opt", "0", TCL_GLOBAL_ONLY
);
549 Tcl_SetVar2(interp
, "sqlite_options", "truncate_opt", "1", TCL_GLOBAL_ONLY
);
552 #ifdef SQLITE_OMIT_UTF16
553 Tcl_SetVar2(interp
, "sqlite_options", "utf16", "0", TCL_GLOBAL_ONLY
);
555 Tcl_SetVar2(interp
, "sqlite_options", "utf16", "1", TCL_GLOBAL_ONLY
);
558 #if defined(SQLITE_OMIT_VACUUM) || defined(SQLITE_OMIT_ATTACH)
559 Tcl_SetVar2(interp
, "sqlite_options", "vacuum", "0", TCL_GLOBAL_ONLY
);
561 Tcl_SetVar2(interp
, "sqlite_options", "vacuum", "1", TCL_GLOBAL_ONLY
);
564 #ifdef SQLITE_OMIT_VIEW
565 Tcl_SetVar2(interp
, "sqlite_options", "view", "0", TCL_GLOBAL_ONLY
);
567 Tcl_SetVar2(interp
, "sqlite_options", "view", "1", TCL_GLOBAL_ONLY
);
570 #ifdef SQLITE_OMIT_VIRTUALTABLE
571 Tcl_SetVar2(interp
, "sqlite_options", "vtab", "0", TCL_GLOBAL_ONLY
);
573 Tcl_SetVar2(interp
, "sqlite_options", "vtab", "1", TCL_GLOBAL_ONLY
);
576 #ifdef SQLITE_OMIT_WAL
577 Tcl_SetVar2(interp
, "sqlite_options", "wal", "0", TCL_GLOBAL_ONLY
);
579 Tcl_SetVar2(interp
, "sqlite_options", "wal", "1", TCL_GLOBAL_ONLY
);
582 #ifdef SQLITE_OMIT_WSD
583 Tcl_SetVar2(interp
, "sqlite_options", "wsd", "0", TCL_GLOBAL_ONLY
);
585 Tcl_SetVar2(interp
, "sqlite_options", "wsd", "1", TCL_GLOBAL_ONLY
);
588 #if defined(SQLITE_ENABLE_UPDATE_DELETE_LIMIT) && !defined(SQLITE_OMIT_SUBQUERY)
589 Tcl_SetVar2(interp
, "sqlite_options", "update_delete_limit", "1", TCL_GLOBAL_ONLY
);
591 Tcl_SetVar2(interp
, "sqlite_options", "update_delete_limit", "0", TCL_GLOBAL_ONLY
);
594 #if defined(SQLITE_ENABLE_UNLOCK_NOTIFY)
595 Tcl_SetVar2(interp
, "sqlite_options", "unlock_notify", "1", TCL_GLOBAL_ONLY
);
597 Tcl_SetVar2(interp
, "sqlite_options", "unlock_notify", "0", TCL_GLOBAL_ONLY
);
600 #ifdef SQLITE_SECURE_DELETE
601 Tcl_SetVar2(interp
, "sqlite_options", "secure_delete", "1", TCL_GLOBAL_ONLY
);
603 Tcl_SetVar2(interp
, "sqlite_options", "secure_delete", "0", TCL_GLOBAL_ONLY
);
606 #ifdef SQLITE_USER_AUTHENTICATION
607 Tcl_SetVar2(interp
, "sqlite_options", "userauth", "1", TCL_GLOBAL_ONLY
);
609 Tcl_SetVar2(interp
, "sqlite_options", "userauth", "0", TCL_GLOBAL_ONLY
);
612 #ifdef SQLITE_MULTIPLEX_EXT_OVWR
613 Tcl_SetVar2(interp
, "sqlite_options", "multiplex_ext_overwrite", "1", TCL_GLOBAL_ONLY
);
615 Tcl_SetVar2(interp
, "sqlite_options", "multiplex_ext_overwrite", "0", TCL_GLOBAL_ONLY
);
618 #ifdef YYTRACKMAXSTACKDEPTH
619 Tcl_SetVar2(interp
, "sqlite_options", "yytrackmaxstackdepth", "1", TCL_GLOBAL_ONLY
);
621 Tcl_SetVar2(interp
, "sqlite_options", "yytrackmaxstackdepth", "0", TCL_GLOBAL_ONLY
);
624 #define LINKVAR(x) { \
625 static const int cv_ ## x = SQLITE_ ## x; \
626 Tcl_LinkVar(interp, "SQLITE_" #x, (char *)&(cv_ ## x), \
627 TCL_LINK_INT | TCL_LINK_READ_ONLY); }
629 LINKVAR( MAX_LENGTH
);
630 LINKVAR( MAX_COLUMN
);
631 LINKVAR( MAX_SQL_LENGTH
);
632 LINKVAR( MAX_EXPR_DEPTH
);
633 LINKVAR( MAX_COMPOUND_SELECT
);
634 LINKVAR( MAX_VDBE_OP
);
635 LINKVAR( MAX_FUNCTION_ARG
);
636 LINKVAR( MAX_VARIABLE_NUMBER
);
637 LINKVAR( MAX_PAGE_SIZE
);
638 LINKVAR( MAX_PAGE_COUNT
);
639 LINKVAR( MAX_LIKE_PATTERN_LENGTH
);
640 LINKVAR( MAX_TRIGGER_DEPTH
);
641 LINKVAR( DEFAULT_TEMP_CACHE_SIZE
);
642 LINKVAR( DEFAULT_CACHE_SIZE
);
643 LINKVAR( DEFAULT_PAGE_SIZE
);
644 LINKVAR( DEFAULT_FILE_FORMAT
);
645 LINKVAR( MAX_ATTACHED
);
646 LINKVAR( MAX_DEFAULT_PAGE_SIZE
);
647 LINKVAR( MAX_WORKER_THREADS
);
650 static const int cv_TEMP_STORE
= SQLITE_TEMP_STORE
;
651 Tcl_LinkVar(interp
, "TEMP_STORE", (char *)&(cv_TEMP_STORE
),
652 TCL_LINK_INT
| TCL_LINK_READ_ONLY
);
657 static const int cv__MSC_VER
= 1;
658 Tcl_LinkVar(interp
, "_MSC_VER", (char *)&(cv__MSC_VER
),
659 TCL_LINK_INT
| TCL_LINK_READ_ONLY
);
664 static const int cv___GNUC__
= 1;
665 Tcl_LinkVar(interp
, "__GNUC__", (char *)&(cv___GNUC__
),
666 TCL_LINK_INT
| TCL_LINK_READ_ONLY
);
673 ** Register commands with the TCL interpreter.
675 int Sqliteconfig_Init(Tcl_Interp
*interp
){