Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: third_party/sqlite/src/test_config.c

Issue 3108030: Move bundled copy of sqlite one level deeper to better separate it... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/sqlite/src/test_btree.c ('k') | third_party/sqlite/src/test_devsym.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.50 2009/06/19 14:06:03 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_MUTEX_OMIT
91 Tcl_SetVar2(interp, "sqlite_options", "mutex", "0", TCL_GLOBAL_ONLY);
92 #else
93 Tcl_SetVar2(interp, "sqlite_options", "mutex", "1", TCL_GLOBAL_ONLY);
94 #endif
95
96 #ifdef SQLITE_OMIT_ALTERTABLE
97 Tcl_SetVar2(interp, "sqlite_options", "altertable", "0", TCL_GLOBAL_ONLY);
98 #else
99 Tcl_SetVar2(interp, "sqlite_options", "altertable", "1", TCL_GLOBAL_ONLY);
100 #endif
101
102 #ifdef SQLITE_OMIT_ANALYZE
103 Tcl_SetVar2(interp, "sqlite_options", "analyze", "0", TCL_GLOBAL_ONLY);
104 #else
105 Tcl_SetVar2(interp, "sqlite_options", "analyze", "1", TCL_GLOBAL_ONLY);
106 #endif
107
108 #ifdef SQLITE_ENABLE_ATOMIC_WRITE
109 Tcl_SetVar2(interp, "sqlite_options", "atomicwrite", "1", TCL_GLOBAL_ONLY);
110 #else
111 Tcl_SetVar2(interp, "sqlite_options", "atomicwrite", "0", TCL_GLOBAL_ONLY);
112 #endif
113
114 #ifdef SQLITE_OMIT_ATTACH
115 Tcl_SetVar2(interp, "sqlite_options", "attach", "0", TCL_GLOBAL_ONLY);
116 #else
117 Tcl_SetVar2(interp, "sqlite_options", "attach", "1", TCL_GLOBAL_ONLY);
118 #endif
119
120 #ifdef SQLITE_OMIT_AUTHORIZATION
121 Tcl_SetVar2(interp, "sqlite_options", "auth", "0", TCL_GLOBAL_ONLY);
122 #else
123 Tcl_SetVar2(interp, "sqlite_options", "auth", "1", TCL_GLOBAL_ONLY);
124 #endif
125
126 #ifdef SQLITE_OMIT_AUTOINCREMENT
127 Tcl_SetVar2(interp, "sqlite_options", "autoinc", "0", TCL_GLOBAL_ONLY);
128 #else
129 Tcl_SetVar2(interp, "sqlite_options", "autoinc", "1", TCL_GLOBAL_ONLY);
130 #endif
131
132 #ifdef SQLITE_OMIT_AUTOVACUUM
133 Tcl_SetVar2(interp, "sqlite_options", "autovacuum", "0", TCL_GLOBAL_ONLY);
134 #else
135 Tcl_SetVar2(interp, "sqlite_options", "autovacuum", "1", TCL_GLOBAL_ONLY);
136 #endif /* SQLITE_OMIT_AUTOVACUUM */
137 #if !defined(SQLITE_DEFAULT_AUTOVACUUM)
138 Tcl_SetVar2(interp,"sqlite_options","default_autovacuum","0",TCL_GLOBAL_ONLY);
139 #else
140 Tcl_SetVar2(interp, "sqlite_options", "default_autovacuum",
141 STRINGVALUE(SQLITE_DEFAULT_AUTOVACUUM), TCL_GLOBAL_ONLY);
142 #endif
143
144 #ifdef SQLITE_OMIT_BETWEEN_OPTIMIZATION
145 Tcl_SetVar2(interp, "sqlite_options", "between_opt", "0", TCL_GLOBAL_ONLY);
146 #else
147 Tcl_SetVar2(interp, "sqlite_options", "between_opt", "1", TCL_GLOBAL_ONLY);
148 #endif
149
150 #ifdef SQLITE_OMIT_BUILTIN_TEST
151 Tcl_SetVar2(interp, "sqlite_options", "builtin_test", "0", TCL_GLOBAL_ONLY);
152 #else
153 Tcl_SetVar2(interp, "sqlite_options", "builtin_test", "1", TCL_GLOBAL_ONLY);
154 #endif
155
156 #ifdef SQLITE_OMIT_BLOB_LITERAL
157 Tcl_SetVar2(interp, "sqlite_options", "bloblit", "0", TCL_GLOBAL_ONLY);
158 #else
159 Tcl_SetVar2(interp, "sqlite_options", "bloblit", "1", TCL_GLOBAL_ONLY);
160 #endif
161
162 #ifdef SQLITE_OMIT_CAST
163 Tcl_SetVar2(interp, "sqlite_options", "cast", "0", TCL_GLOBAL_ONLY);
164 #else
165 Tcl_SetVar2(interp, "sqlite_options", "cast", "1", TCL_GLOBAL_ONLY);
166 #endif
167
168 #ifdef SQLITE_OMIT_CHECK
169 Tcl_SetVar2(interp, "sqlite_options", "check", "0", TCL_GLOBAL_ONLY);
170 #else
171 Tcl_SetVar2(interp, "sqlite_options", "check", "1", TCL_GLOBAL_ONLY);
172 #endif
173
174 #ifdef SQLITE_ENABLE_COLUMN_METADATA
175 Tcl_SetVar2(interp, "sqlite_options", "columnmetadata", "1", TCL_GLOBAL_ONLY);
176 #else
177 Tcl_SetVar2(interp, "sqlite_options", "columnmetadata", "0", TCL_GLOBAL_ONLY);
178 #endif
179
180 #ifdef SQLITE_ENABLE_OVERSIZE_CELL_CHECK
181 Tcl_SetVar2(interp, "sqlite_options", "oversize_cell_check", "1",
182 TCL_GLOBAL_ONLY);
183 #else
184 Tcl_SetVar2(interp, "sqlite_options", "oversize_cell_check", "0",
185 TCL_GLOBAL_ONLY);
186 #endif
187
188
189
190 #ifdef SQLITE_OMIT_COMPLETE
191 Tcl_SetVar2(interp, "sqlite_options", "complete", "0", TCL_GLOBAL_ONLY);
192 #else
193 Tcl_SetVar2(interp, "sqlite_options", "complete", "1", TCL_GLOBAL_ONLY);
194 #endif
195
196 #ifdef SQLITE_OMIT_COMPOUND_SELECT
197 Tcl_SetVar2(interp, "sqlite_options", "compound", "0", TCL_GLOBAL_ONLY);
198 #else
199 Tcl_SetVar2(interp, "sqlite_options", "compound", "1", TCL_GLOBAL_ONLY);
200 #endif
201
202 #ifdef SQLITE_OMIT_CONFLICT_CLAUSE
203 Tcl_SetVar2(interp, "sqlite_options", "conflict", "0", TCL_GLOBAL_ONLY);
204 #else
205 Tcl_SetVar2(interp, "sqlite_options", "conflict", "1", TCL_GLOBAL_ONLY);
206 #endif
207
208 #if SQLITE_OS_UNIX
209 Tcl_SetVar2(interp, "sqlite_options", "crashtest", "1", TCL_GLOBAL_ONLY);
210 #else
211 Tcl_SetVar2(interp, "sqlite_options", "crashtest", "0", TCL_GLOBAL_ONLY);
212 #endif
213
214 #ifdef SQLITE_OMIT_DATETIME_FUNCS
215 Tcl_SetVar2(interp, "sqlite_options", "datetime", "0", TCL_GLOBAL_ONLY);
216 #else
217 Tcl_SetVar2(interp, "sqlite_options", "datetime", "1", TCL_GLOBAL_ONLY);
218 #endif
219
220 #ifdef SQLITE_OMIT_DECLTYPE
221 Tcl_SetVar2(interp, "sqlite_options", "decltype", "0", TCL_GLOBAL_ONLY);
222 #else
223 Tcl_SetVar2(interp, "sqlite_options", "decltype", "1", TCL_GLOBAL_ONLY);
224 #endif
225
226 #ifdef SQLITE_OMIT_DEPRECATED
227 Tcl_SetVar2(interp, "sqlite_options", "deprecated", "0", TCL_GLOBAL_ONLY);
228 #else
229 Tcl_SetVar2(interp, "sqlite_options", "deprecated", "1", TCL_GLOBAL_ONLY);
230 #endif
231
232 #ifdef SQLITE_OMIT_DISKIO
233 Tcl_SetVar2(interp, "sqlite_options", "diskio", "0", TCL_GLOBAL_ONLY);
234 #else
235 Tcl_SetVar2(interp, "sqlite_options", "diskio", "1", TCL_GLOBAL_ONLY);
236 #endif
237
238 #ifdef SQLITE_OMIT_EXPLAIN
239 Tcl_SetVar2(interp, "sqlite_options", "explain", "0", TCL_GLOBAL_ONLY);
240 #else
241 Tcl_SetVar2(interp, "sqlite_options", "explain", "1", TCL_GLOBAL_ONLY);
242 #endif
243
244 #ifdef SQLITE_OMIT_FLOATING_POINT
245 Tcl_SetVar2(interp, "sqlite_options", "floatingpoint", "0", TCL_GLOBAL_ONLY);
246 #else
247 Tcl_SetVar2(interp, "sqlite_options", "floatingpoint", "1", TCL_GLOBAL_ONLY);
248 #endif
249
250 #ifdef SQLITE_OMIT_FOREIGN_KEY
251 Tcl_SetVar2(interp, "sqlite_options", "foreignkey", "0", TCL_GLOBAL_ONLY);
252 #else
253 Tcl_SetVar2(interp, "sqlite_options", "foreignkey", "1", TCL_GLOBAL_ONLY);
254 #endif
255
256 #ifdef SQLITE_ENABLE_FTS1
257 Tcl_SetVar2(interp, "sqlite_options", "fts1", "1", TCL_GLOBAL_ONLY);
258 #else
259 Tcl_SetVar2(interp, "sqlite_options", "fts1", "0", TCL_GLOBAL_ONLY);
260 #endif
261
262 #ifdef SQLITE_ENABLE_FTS2
263 Tcl_SetVar2(interp, "sqlite_options", "fts2", "1", TCL_GLOBAL_ONLY);
264 #else
265 Tcl_SetVar2(interp, "sqlite_options", "fts2", "0", TCL_GLOBAL_ONLY);
266 #endif
267
268 #ifdef SQLITE_ENABLE_FTS3
269 Tcl_SetVar2(interp, "sqlite_options", "fts3", "1", TCL_GLOBAL_ONLY);
270 #else
271 Tcl_SetVar2(interp, "sqlite_options", "fts3", "0", TCL_GLOBAL_ONLY);
272 #endif
273
274 #ifdef SQLITE_OMIT_GET_TABLE
275 Tcl_SetVar2(interp, "sqlite_options", "gettable", "0", TCL_GLOBAL_ONLY);
276 #else
277 Tcl_SetVar2(interp, "sqlite_options", "gettable", "1", TCL_GLOBAL_ONLY);
278 #endif
279
280 #ifdef SQLITE_OMIT_GLOBALRECOVER
281 Tcl_SetVar2(interp, "sqlite_options", "globalrecover", "0", TCL_GLOBAL_ONLY);
282 #else
283 Tcl_SetVar2(interp, "sqlite_options", "globalrecover", "1", TCL_GLOBAL_ONLY);
284 #endif
285
286 #ifdef SQLITE_ENABLE_ICU
287 Tcl_SetVar2(interp, "sqlite_options", "icu", "1", TCL_GLOBAL_ONLY);
288 #else
289 Tcl_SetVar2(interp, "sqlite_options", "icu", "0", TCL_GLOBAL_ONLY);
290 #endif
291
292 #ifdef SQLITE_OMIT_INCRBLOB
293 Tcl_SetVar2(interp, "sqlite_options", "incrblob", "0", TCL_GLOBAL_ONLY);
294 #else
295 Tcl_SetVar2(interp, "sqlite_options", "incrblob", "1", TCL_GLOBAL_ONLY);
296 #endif /* SQLITE_OMIT_AUTOVACUUM */
297
298 #ifdef SQLITE_OMIT_INTEGRITY_CHECK
299 Tcl_SetVar2(interp, "sqlite_options", "integrityck", "0", TCL_GLOBAL_ONLY);
300 #else
301 Tcl_SetVar2(interp, "sqlite_options", "integrityck", "1", TCL_GLOBAL_ONLY);
302 #endif
303
304 #if defined(SQLITE_DEFAULT_FILE_FORMAT) && SQLITE_DEFAULT_FILE_FORMAT==1
305 Tcl_SetVar2(interp, "sqlite_options", "legacyformat", "1", TCL_GLOBAL_ONLY);
306 #else
307 Tcl_SetVar2(interp, "sqlite_options", "legacyformat", "0", TCL_GLOBAL_ONLY);
308 #endif
309
310 #ifdef SQLITE_OMIT_LIKE_OPTIMIZATION
311 Tcl_SetVar2(interp, "sqlite_options", "like_opt", "0", TCL_GLOBAL_ONLY);
312 #else
313 Tcl_SetVar2(interp, "sqlite_options", "like_opt", "1", TCL_GLOBAL_ONLY);
314 #endif
315
316 #ifdef SQLITE_OMIT_LOAD_EXTENSION
317 Tcl_SetVar2(interp, "sqlite_options", "load_ext", "0", TCL_GLOBAL_ONLY);
318 #else
319 Tcl_SetVar2(interp, "sqlite_options", "load_ext", "1", TCL_GLOBAL_ONLY);
320 #endif
321
322 #ifdef SQLITE_OMIT_LOCALTIME
323 Tcl_SetVar2(interp, "sqlite_options", "localtime", "0", TCL_GLOBAL_ONLY);
324 #else
325 Tcl_SetVar2(interp, "sqlite_options", "localtime", "1", TCL_GLOBAL_ONLY);
326 #endif
327
328 #ifdef SQLITE_OMIT_LOOKASIDE
329 Tcl_SetVar2(interp, "sqlite_options", "lookaside", "0", TCL_GLOBAL_ONLY);
330 #else
331 Tcl_SetVar2(interp, "sqlite_options", "lookaside", "1", TCL_GLOBAL_ONLY);
332 #endif
333
334 Tcl_SetVar2(interp, "sqlite_options", "long_double",
335 sizeof(LONGDOUBLE_TYPE)>sizeof(double) ? "1" : "0",
336 TCL_GLOBAL_ONLY);
337
338 #ifdef SQLITE_OMIT_MEMORYDB
339 Tcl_SetVar2(interp, "sqlite_options", "memorydb", "0", TCL_GLOBAL_ONLY);
340 #else
341 Tcl_SetVar2(interp, "sqlite_options", "memorydb", "1", TCL_GLOBAL_ONLY);
342 #endif
343
344 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
345 Tcl_SetVar2(interp, "sqlite_options", "memorymanage", "1", TCL_GLOBAL_ONLY);
346 #else
347 Tcl_SetVar2(interp, "sqlite_options", "memorymanage", "0", TCL_GLOBAL_ONLY);
348 #endif
349
350 #ifdef SQLITE_OMIT_OR_OPTIMIZATION
351 Tcl_SetVar2(interp, "sqlite_options", "or_opt", "0", TCL_GLOBAL_ONLY);
352 #else
353 Tcl_SetVar2(interp, "sqlite_options", "or_opt", "1", TCL_GLOBAL_ONLY);
354 #endif
355
356 #ifdef SQLITE_OMIT_PAGER_PRAGMAS
357 Tcl_SetVar2(interp, "sqlite_options", "pager_pragmas", "0", TCL_GLOBAL_ONLY);
358 #else
359 Tcl_SetVar2(interp, "sqlite_options", "pager_pragmas", "1", TCL_GLOBAL_ONLY);
360 #endif
361
362 #if defined(SQLITE_OMIT_PRAGMA) || defined(SQLITE_OMIT_FLAG_PRAGMAS)
363 Tcl_SetVar2(interp, "sqlite_options", "pragma", "0", TCL_GLOBAL_ONLY);
364 Tcl_SetVar2(interp, "sqlite_options", "integrityck", "0", TCL_GLOBAL_ONLY);
365 #else
366 Tcl_SetVar2(interp, "sqlite_options", "pragma", "1", TCL_GLOBAL_ONLY);
367 #endif
368
369 #ifdef SQLITE_OMIT_PROGRESS_CALLBACK
370 Tcl_SetVar2(interp, "sqlite_options", "progress", "0", TCL_GLOBAL_ONLY);
371 #else
372 Tcl_SetVar2(interp, "sqlite_options", "progress", "1", TCL_GLOBAL_ONLY);
373 #endif
374
375 #ifdef SQLITE_OMIT_REINDEX
376 Tcl_SetVar2(interp, "sqlite_options", "reindex", "0", TCL_GLOBAL_ONLY);
377 #else
378 Tcl_SetVar2(interp, "sqlite_options", "reindex", "1", TCL_GLOBAL_ONLY);
379 #endif
380
381 #ifdef SQLITE_ENABLE_RTREE
382 Tcl_SetVar2(interp, "sqlite_options", "rtree", "1", TCL_GLOBAL_ONLY);
383 #else
384 Tcl_SetVar2(interp, "sqlite_options", "rtree", "0", TCL_GLOBAL_ONLY);
385 #endif
386
387 #ifdef SQLITE_OMIT_SCHEMA_PRAGMAS
388 Tcl_SetVar2(interp, "sqlite_options", "schema_pragmas", "0", TCL_GLOBAL_ONLY);
389 #else
390 Tcl_SetVar2(interp, "sqlite_options", "schema_pragmas", "1", TCL_GLOBAL_ONLY);
391 #endif
392
393 #ifdef SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS
394 Tcl_SetVar2(interp, "sqlite_options", "schema_version", "0", TCL_GLOBAL_ONLY);
395 #else
396 Tcl_SetVar2(interp, "sqlite_options", "schema_version", "1", TCL_GLOBAL_ONLY);
397 #endif
398
399 #ifdef SQLITE_ENABLE_STAT2
400 Tcl_SetVar2(interp, "sqlite_options", "stat2", "1", TCL_GLOBAL_ONLY);
401 #else
402 Tcl_SetVar2(interp, "sqlite_options", "stat2", "0", TCL_GLOBAL_ONLY);
403 #endif
404
405 #if !defined(SQLITE_ENABLE_LOCKING_STYLE)
406 # if defined(__APPLE__)
407 # define SQLITE_ENABLE_LOCKING_STYLE 1
408 # else
409 # define SQLITE_ENABLE_LOCKING_STYLE 0
410 # endif
411 #endif
412 #if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__)
413 Tcl_SetVar2(interp,"sqlite_options","lock_proxy_pragmas","1",TCL_GLOBAL_ONLY);
414 #else
415 Tcl_SetVar2(interp,"sqlite_options","lock_proxy_pragmas","0",TCL_GLOBAL_ONLY);
416 #endif
417 #if defined(SQLITE_PREFER_PROXY_LOCKING) && defined(__APPLE__)
418 Tcl_SetVar2(interp,"sqlite_options","prefer_proxy_locking","1",TCL_GLOBAL_ONLY );
419 #else
420 Tcl_SetVar2(interp,"sqlite_options","prefer_proxy_locking","0",TCL_GLOBAL_ONLY );
421 #endif
422
423
424 #ifdef SQLITE_OMIT_SHARED_CACHE
425 Tcl_SetVar2(interp, "sqlite_options", "shared_cache", "0", TCL_GLOBAL_ONLY);
426 #else
427 Tcl_SetVar2(interp, "sqlite_options", "shared_cache", "1", TCL_GLOBAL_ONLY);
428 #endif
429
430 #ifdef SQLITE_OMIT_SUBQUERY
431 Tcl_SetVar2(interp, "sqlite_options", "subquery", "0", TCL_GLOBAL_ONLY);
432 #else
433 Tcl_SetVar2(interp, "sqlite_options", "subquery", "1", TCL_GLOBAL_ONLY);
434 #endif
435
436 #ifdef SQLITE_OMIT_TCL_VARIABLE
437 Tcl_SetVar2(interp, "sqlite_options", "tclvar", "0", TCL_GLOBAL_ONLY);
438 #else
439 Tcl_SetVar2(interp, "sqlite_options", "tclvar", "1", TCL_GLOBAL_ONLY);
440 #endif
441
442 Tcl_SetVar2(interp, "sqlite_options", "threadsafe",
443 STRINGVALUE(SQLITE_THREADSAFE), TCL_GLOBAL_ONLY);
444 assert( sqlite3_threadsafe()==SQLITE_THREADSAFE );
445
446 #ifdef SQLITE_OMIT_TEMPDB
447 Tcl_SetVar2(interp, "sqlite_options", "tempdb", "0", TCL_GLOBAL_ONLY);
448 #else
449 Tcl_SetVar2(interp, "sqlite_options", "tempdb", "1", TCL_GLOBAL_ONLY);
450 #endif
451
452 #ifdef SQLITE_OMIT_TRACE
453 Tcl_SetVar2(interp, "sqlite_options", "trace", "0", TCL_GLOBAL_ONLY);
454 #else
455 Tcl_SetVar2(interp, "sqlite_options", "trace", "1", TCL_GLOBAL_ONLY);
456 #endif
457
458 #ifdef SQLITE_OMIT_TRIGGER
459 Tcl_SetVar2(interp, "sqlite_options", "trigger", "0", TCL_GLOBAL_ONLY);
460 #else
461 Tcl_SetVar2(interp, "sqlite_options", "trigger", "1", TCL_GLOBAL_ONLY);
462 #endif
463
464 #ifdef SQLITE_OMIT_TRUCATE_OPTIMIZATION
465 Tcl_SetVar2(interp, "sqlite_options", "truncate_opt", "0", TCL_GLOBAL_ONLY);
466 #else
467 Tcl_SetVar2(interp, "sqlite_options", "truncate_opt", "1", TCL_GLOBAL_ONLY);
468 #endif
469
470 #ifdef SQLITE_OMIT_UTF16
471 Tcl_SetVar2(interp, "sqlite_options", "utf16", "0", TCL_GLOBAL_ONLY);
472 #else
473 Tcl_SetVar2(interp, "sqlite_options", "utf16", "1", TCL_GLOBAL_ONLY);
474 #endif
475
476 #if defined(SQLITE_OMIT_VACUUM) || defined(SQLITE_OMIT_ATTACH)
477 Tcl_SetVar2(interp, "sqlite_options", "vacuum", "0", TCL_GLOBAL_ONLY);
478 #else
479 Tcl_SetVar2(interp, "sqlite_options", "vacuum", "1", TCL_GLOBAL_ONLY);
480 #endif
481
482 #ifdef SQLITE_OMIT_VIEW
483 Tcl_SetVar2(interp, "sqlite_options", "view", "0", TCL_GLOBAL_ONLY);
484 #else
485 Tcl_SetVar2(interp, "sqlite_options", "view", "1", TCL_GLOBAL_ONLY);
486 #endif
487
488 #ifdef SQLITE_OMIT_VIRTUALTABLE
489 Tcl_SetVar2(interp, "sqlite_options", "vtab", "0", TCL_GLOBAL_ONLY);
490 #else
491 Tcl_SetVar2(interp, "sqlite_options", "vtab", "1", TCL_GLOBAL_ONLY);
492 #endif
493
494 #ifdef SQLITE_OMIT_WSD
495 Tcl_SetVar2(interp, "sqlite_options", "wsd", "0", TCL_GLOBAL_ONLY);
496 #else
497 Tcl_SetVar2(interp, "sqlite_options", "wsd", "1", TCL_GLOBAL_ONLY);
498 #endif
499
500 #if defined(SQLITE_ENABLE_UPDATE_DELETE_LIMIT) && !defined(SQLITE_OMIT_SUBQUERY)
501 Tcl_SetVar2(interp, "sqlite_options", "update_delete_limit", "1", TCL_GLOBAL_O NLY);
502 #else
503 Tcl_SetVar2(interp, "sqlite_options", "update_delete_limit", "0", TCL_GLOBAL_O NLY);
504 #endif
505
506 #if defined(SQLITE_ENABLE_UNLOCK_NOTIFY)
507 Tcl_SetVar2(interp, "sqlite_options", "unlock_notify", "1", TCL_GLOBAL_ONLY);
508 #else
509 Tcl_SetVar2(interp, "sqlite_options", "unlock_notify", "0", TCL_GLOBAL_ONLY);
510 #endif
511
512 #ifdef SQLITE_SECURE_DELETE
513 Tcl_SetVar2(interp, "sqlite_options", "secure_delete", "1", TCL_GLOBAL_ONLY);
514 #else
515 Tcl_SetVar2(interp, "sqlite_options", "secure_delete", "0", TCL_GLOBAL_ONLY);
516 #endif
517
518 #ifdef YYTRACKMAXSTACKDEPTH
519 Tcl_SetVar2(interp, "sqlite_options", "yytrackmaxstackdepth", "1", TCL_GLOBAL_ ONLY);
520 #else
521 Tcl_SetVar2(interp, "sqlite_options", "yytrackmaxstackdepth", "0", TCL_GLOBAL_ ONLY);
522 #endif
523
524 #define LINKVAR(x) { \
525 static const int cv_ ## x = SQLITE_ ## x; \
526 Tcl_LinkVar(interp, "SQLITE_" #x, (char *)&(cv_ ## x), \
527 TCL_LINK_INT | TCL_LINK_READ_ONLY); }
528
529 LINKVAR( MAX_LENGTH );
530 LINKVAR( MAX_COLUMN );
531 LINKVAR( MAX_SQL_LENGTH );
532 LINKVAR( MAX_EXPR_DEPTH );
533 LINKVAR( MAX_COMPOUND_SELECT );
534 LINKVAR( MAX_VDBE_OP );
535 LINKVAR( MAX_FUNCTION_ARG );
536 LINKVAR( MAX_VARIABLE_NUMBER );
537 LINKVAR( MAX_PAGE_SIZE );
538 LINKVAR( MAX_PAGE_COUNT );
539 LINKVAR( MAX_LIKE_PATTERN_LENGTH );
540 LINKVAR( DEFAULT_TEMP_CACHE_SIZE );
541 LINKVAR( DEFAULT_CACHE_SIZE );
542 LINKVAR( DEFAULT_PAGE_SIZE );
543 LINKVAR( DEFAULT_FILE_FORMAT );
544 LINKVAR( MAX_ATTACHED );
545
546 {
547 static const int cv_TEMP_STORE = SQLITE_TEMP_STORE;
548 Tcl_LinkVar(interp, "TEMP_STORE", (char *)&(cv_TEMP_STORE),
549 TCL_LINK_INT | TCL_LINK_READ_ONLY);
550 }
551 }
552
553
554 /*
555 ** Register commands with the TCL interpreter.
556 */
557 int Sqliteconfig_Init(Tcl_Interp *interp){
558 set_options(interp);
559 return TCL_OK;
560 }
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test_btree.c ('k') | third_party/sqlite/src/test_devsym.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698