diff options
author | dan miller | 2007-10-20 02:49:29 +0000 |
---|---|---|
committer | dan miller | 2007-10-20 02:49:29 +0000 |
commit | e36d23a85ebff914d74bb541558c2b6082b78edb (patch) | |
tree | 54b58fdf162e78af64055282a6035c8d2443389d /libraries/sqlite/unix/sqlite-3.5.1/src/test_config.c | |
parent | * Fixed an issue whereby avatar chat distances were being calculated against ... (diff) | |
download | opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.zip opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.gz opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.bz2 opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.xz |
sqlite source (unix build) added to libraries
Diffstat (limited to 'libraries/sqlite/unix/sqlite-3.5.1/src/test_config.c')
-rw-r--r-- | libraries/sqlite/unix/sqlite-3.5.1/src/test_config.c | 460 |
1 files changed, 460 insertions, 0 deletions
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/src/test_config.c b/libraries/sqlite/unix/sqlite-3.5.1/src/test_config.c new file mode 100644 index 0000000..cd3dce4 --- /dev/null +++ b/libraries/sqlite/unix/sqlite-3.5.1/src/test_config.c | |||
@@ -0,0 +1,460 @@ | |||
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.15 2007/09/03 15:26:21 drh Exp $ | ||
20 | */ | ||
21 | |||
22 | #include "sqliteLimit.h" | ||
23 | |||
24 | int sqlite3MAX_LENGTH = SQLITE_MAX_LENGTH; | ||
25 | int sqlite3MAX_COLUMN = SQLITE_MAX_COLUMN; | ||
26 | int sqlite3MAX_SQL_LENGTH = SQLITE_MAX_SQL_LENGTH; | ||
27 | int sqlite3MAX_EXPR_DEPTH = SQLITE_MAX_EXPR_DEPTH; | ||
28 | int sqlite3MAX_COMPOUND_SELECT = SQLITE_MAX_COMPOUND_SELECT; | ||
29 | int sqlite3MAX_VDBE_OP = SQLITE_MAX_VDBE_OP; | ||
30 | int sqlite3MAX_FUNCTION_ARG = SQLITE_MAX_FUNCTION_ARG; | ||
31 | int sqlite3MAX_VARIABLE_NUMBER = SQLITE_MAX_VARIABLE_NUMBER; | ||
32 | int sqlite3MAX_PAGE_SIZE = SQLITE_MAX_PAGE_SIZE; | ||
33 | int sqlite3MAX_PAGE_COUNT = SQLITE_MAX_PAGE_COUNT; | ||
34 | int sqlite3MAX_LIKE_PATTERN_LENGTH = SQLITE_MAX_LIKE_PATTERN_LENGTH; | ||
35 | |||
36 | #include "sqliteInt.h" | ||
37 | #include "tcl.h" | ||
38 | #include <stdlib.h> | ||
39 | #include <string.h> | ||
40 | |||
41 | /* | ||
42 | ** This routine sets entries in the global ::sqlite_options() array variable | ||
43 | ** according to the compile-time configuration of the database. Test | ||
44 | ** procedures use this to determine when tests should be omitted. | ||
45 | */ | ||
46 | static void set_options(Tcl_Interp *interp){ | ||
47 | #ifdef SQLITE_32BIT_ROWID | ||
48 | Tcl_SetVar2(interp, "sqlite_options", "rowid32", "1", TCL_GLOBAL_ONLY); | ||
49 | #else | ||
50 | Tcl_SetVar2(interp, "sqlite_options", "rowid32", "0", TCL_GLOBAL_ONLY); | ||
51 | #endif | ||
52 | |||
53 | #ifdef SQLITE_CASE_SENSITIVE_LIKE | ||
54 | Tcl_SetVar2(interp, "sqlite_options","casesensitivelike","1",TCL_GLOBAL_ONLY); | ||
55 | #else | ||
56 | Tcl_SetVar2(interp, "sqlite_options","casesensitivelike","0",TCL_GLOBAL_ONLY); | ||
57 | #endif | ||
58 | |||
59 | #ifdef SQLITE_DEBUG | ||
60 | Tcl_SetVar2(interp, "sqlite_options", "debug", "1", TCL_GLOBAL_ONLY); | ||
61 | #else | ||
62 | Tcl_SetVar2(interp, "sqlite_options", "debug", "0", TCL_GLOBAL_ONLY); | ||
63 | #endif | ||
64 | |||
65 | #ifdef SQLITE_DISABLE_DIRSYNC | ||
66 | Tcl_SetVar2(interp, "sqlite_options", "dirsync", "0", TCL_GLOBAL_ONLY); | ||
67 | #else | ||
68 | Tcl_SetVar2(interp, "sqlite_options", "dirsync", "1", TCL_GLOBAL_ONLY); | ||
69 | #endif | ||
70 | |||
71 | #ifdef SQLITE_DISABLE_LFS | ||
72 | Tcl_SetVar2(interp, "sqlite_options", "lfs", "0", TCL_GLOBAL_ONLY); | ||
73 | #else | ||
74 | Tcl_SetVar2(interp, "sqlite_options", "lfs", "1", TCL_GLOBAL_ONLY); | ||
75 | #endif | ||
76 | |||
77 | #ifdef SQLITE_MEMDEBUG | ||
78 | Tcl_SetVar2(interp, "sqlite_options", "memdebug", "1", TCL_GLOBAL_ONLY); | ||
79 | #else | ||
80 | Tcl_SetVar2(interp, "sqlite_options", "memdebug", "0", TCL_GLOBAL_ONLY); | ||
81 | #endif | ||
82 | |||
83 | #ifdef SQLITE_OMIT_ALTERTABLE | ||
84 | Tcl_SetVar2(interp, "sqlite_options", "altertable", "0", TCL_GLOBAL_ONLY); | ||
85 | #else | ||
86 | Tcl_SetVar2(interp, "sqlite_options", "altertable", "1", TCL_GLOBAL_ONLY); | ||
87 | #endif | ||
88 | |||
89 | #ifdef SQLITE_OMIT_ANALYZE | ||
90 | Tcl_SetVar2(interp, "sqlite_options", "analyze", "0", TCL_GLOBAL_ONLY); | ||
91 | #else | ||
92 | Tcl_SetVar2(interp, "sqlite_options", "analyze", "1", TCL_GLOBAL_ONLY); | ||
93 | #endif | ||
94 | |||
95 | #ifdef SQLITE_ENABLE_ATOMIC_WRITE | ||
96 | Tcl_SetVar2(interp, "sqlite_options", "atomicwrite", "1", TCL_GLOBAL_ONLY); | ||
97 | #else | ||
98 | Tcl_SetVar2(interp, "sqlite_options", "atomicwrite", "0", TCL_GLOBAL_ONLY); | ||
99 | #endif | ||
100 | |||
101 | #ifdef SQLITE_OMIT_ATTACH | ||
102 | Tcl_SetVar2(interp, "sqlite_options", "attach", "0", TCL_GLOBAL_ONLY); | ||
103 | #else | ||
104 | Tcl_SetVar2(interp, "sqlite_options", "attach", "1", TCL_GLOBAL_ONLY); | ||
105 | #endif | ||
106 | |||
107 | #ifdef SQLITE_OMIT_AUTHORIZATION | ||
108 | Tcl_SetVar2(interp, "sqlite_options", "auth", "0", TCL_GLOBAL_ONLY); | ||
109 | #else | ||
110 | Tcl_SetVar2(interp, "sqlite_options", "auth", "1", TCL_GLOBAL_ONLY); | ||
111 | #endif | ||
112 | |||
113 | #ifdef SQLITE_OMIT_AUTOINCREMENT | ||
114 | Tcl_SetVar2(interp, "sqlite_options", "autoinc", "0", TCL_GLOBAL_ONLY); | ||
115 | #else | ||
116 | Tcl_SetVar2(interp, "sqlite_options", "autoinc", "1", TCL_GLOBAL_ONLY); | ||
117 | #endif | ||
118 | |||
119 | #ifdef SQLITE_OMIT_AUTOVACUUM | ||
120 | Tcl_SetVar2(interp, "sqlite_options", "autovacuum", "0", TCL_GLOBAL_ONLY); | ||
121 | #else | ||
122 | Tcl_SetVar2(interp, "sqlite_options", "autovacuum", "1", TCL_GLOBAL_ONLY); | ||
123 | #endif /* SQLITE_OMIT_AUTOVACUUM */ | ||
124 | #if !defined(SQLITE_DEFAULT_AUTOVACUUM) || SQLITE_DEFAULT_AUTOVACUUM==0 | ||
125 | Tcl_SetVar2(interp,"sqlite_options","default_autovacuum","0",TCL_GLOBAL_ONLY); | ||
126 | #else | ||
127 | Tcl_SetVar2(interp,"sqlite_options","default_autovacuum","1",TCL_GLOBAL_ONLY); | ||
128 | #endif | ||
129 | |||
130 | #ifdef SQLITE_OMIT_BETWEEN_OPTIMIZATION | ||
131 | Tcl_SetVar2(interp, "sqlite_options", "between_opt", "0", TCL_GLOBAL_ONLY); | ||
132 | #else | ||
133 | Tcl_SetVar2(interp, "sqlite_options", "between_opt", "1", TCL_GLOBAL_ONLY); | ||
134 | #endif | ||
135 | |||
136 | #ifdef SQLITE_OMIT_BLOB_LITERAL | ||
137 | Tcl_SetVar2(interp, "sqlite_options", "bloblit", "0", TCL_GLOBAL_ONLY); | ||
138 | #else | ||
139 | Tcl_SetVar2(interp, "sqlite_options", "bloblit", "1", TCL_GLOBAL_ONLY); | ||
140 | #endif | ||
141 | |||
142 | #ifdef SQLITE_OMIT_CAST | ||
143 | Tcl_SetVar2(interp, "sqlite_options", "cast", "0", TCL_GLOBAL_ONLY); | ||
144 | #else | ||
145 | Tcl_SetVar2(interp, "sqlite_options", "cast", "1", TCL_GLOBAL_ONLY); | ||
146 | #endif | ||
147 | |||
148 | #ifdef SQLITE_OMIT_CHECK | ||
149 | Tcl_SetVar2(interp, "sqlite_options", "check", "0", TCL_GLOBAL_ONLY); | ||
150 | #else | ||
151 | Tcl_SetVar2(interp, "sqlite_options", "check", "1", TCL_GLOBAL_ONLY); | ||
152 | #endif | ||
153 | |||
154 | #ifdef SQLITE_ENABLE_COLUMN_METADATA | ||
155 | Tcl_SetVar2(interp, "sqlite_options", "columnmetadata", "1", TCL_GLOBAL_ONLY); | ||
156 | #else | ||
157 | Tcl_SetVar2(interp, "sqlite_options", "columnmetadata", "0", TCL_GLOBAL_ONLY); | ||
158 | #endif | ||
159 | |||
160 | #ifdef SQLITE_OMIT_COMPLETE | ||
161 | Tcl_SetVar2(interp, "sqlite_options", "complete", "0", TCL_GLOBAL_ONLY); | ||
162 | #else | ||
163 | Tcl_SetVar2(interp, "sqlite_options", "complete", "1", TCL_GLOBAL_ONLY); | ||
164 | #endif | ||
165 | |||
166 | #ifdef SQLITE_OMIT_COMPOUND_SELECT | ||
167 | Tcl_SetVar2(interp, "sqlite_options", "compound", "0", TCL_GLOBAL_ONLY); | ||
168 | #else | ||
169 | Tcl_SetVar2(interp, "sqlite_options", "compound", "1", TCL_GLOBAL_ONLY); | ||
170 | #endif | ||
171 | |||
172 | #ifdef SQLITE_OMIT_CONFLICT_CLAUSE | ||
173 | Tcl_SetVar2(interp, "sqlite_options", "conflict", "0", TCL_GLOBAL_ONLY); | ||
174 | #else | ||
175 | Tcl_SetVar2(interp, "sqlite_options", "conflict", "1", TCL_GLOBAL_ONLY); | ||
176 | #endif | ||
177 | |||
178 | #if OS_UNIX | ||
179 | Tcl_SetVar2(interp, "sqlite_options", "crashtest", "1", TCL_GLOBAL_ONLY); | ||
180 | #else | ||
181 | Tcl_SetVar2(interp, "sqlite_options", "crashtest", "0", TCL_GLOBAL_ONLY); | ||
182 | #endif | ||
183 | |||
184 | #ifdef SQLITE_OMIT_DATETIME_FUNCS | ||
185 | Tcl_SetVar2(interp, "sqlite_options", "datetime", "0", TCL_GLOBAL_ONLY); | ||
186 | #else | ||
187 | Tcl_SetVar2(interp, "sqlite_options", "datetime", "1", TCL_GLOBAL_ONLY); | ||
188 | #endif | ||
189 | |||
190 | #ifdef SQLITE_OMIT_DISKIO | ||
191 | Tcl_SetVar2(interp, "sqlite_options", "diskio", "0", TCL_GLOBAL_ONLY); | ||
192 | #else | ||
193 | Tcl_SetVar2(interp, "sqlite_options", "diskio", "1", TCL_GLOBAL_ONLY); | ||
194 | #endif | ||
195 | |||
196 | #ifdef SQLITE_OMIT_EXPLAIN | ||
197 | Tcl_SetVar2(interp, "sqlite_options", "explain", "0", TCL_GLOBAL_ONLY); | ||
198 | #else | ||
199 | Tcl_SetVar2(interp, "sqlite_options", "explain", "1", TCL_GLOBAL_ONLY); | ||
200 | #endif | ||
201 | |||
202 | #ifdef SQLITE_OMIT_FLOATING_POINT | ||
203 | Tcl_SetVar2(interp, "sqlite_options", "floatingpoint", "0", TCL_GLOBAL_ONLY); | ||
204 | #else | ||
205 | Tcl_SetVar2(interp, "sqlite_options", "floatingpoint", "1", TCL_GLOBAL_ONLY); | ||
206 | #endif | ||
207 | |||
208 | #ifdef SQLITE_OMIT_FOREIGN_KEY | ||
209 | Tcl_SetVar2(interp, "sqlite_options", "foreignkey", "0", TCL_GLOBAL_ONLY); | ||
210 | #else | ||
211 | Tcl_SetVar2(interp, "sqlite_options", "foreignkey", "1", TCL_GLOBAL_ONLY); | ||
212 | #endif | ||
213 | |||
214 | #ifdef SQLITE_ENABLE_FTS1 | ||
215 | Tcl_SetVar2(interp, "sqlite_options", "fts1", "1", TCL_GLOBAL_ONLY); | ||
216 | #else | ||
217 | Tcl_SetVar2(interp, "sqlite_options", "fts1", "0", TCL_GLOBAL_ONLY); | ||
218 | #endif | ||
219 | |||
220 | #ifdef SQLITE_ENABLE_FTS2 | ||
221 | Tcl_SetVar2(interp, "sqlite_options", "fts2", "1", TCL_GLOBAL_ONLY); | ||
222 | #else | ||
223 | Tcl_SetVar2(interp, "sqlite_options", "fts2", "0", TCL_GLOBAL_ONLY); | ||
224 | #endif | ||
225 | |||
226 | #ifdef SQLITE_ENABLE_FTS3 | ||
227 | Tcl_SetVar2(interp, "sqlite_options", "fts3", "1", TCL_GLOBAL_ONLY); | ||
228 | #else | ||
229 | Tcl_SetVar2(interp, "sqlite_options", "fts3", "0", TCL_GLOBAL_ONLY); | ||
230 | #endif | ||
231 | |||
232 | #ifdef SQLITE_OMIT_GLOBALRECOVER | ||
233 | Tcl_SetVar2(interp, "sqlite_options", "globalrecover", "0", TCL_GLOBAL_ONLY); | ||
234 | #else | ||
235 | Tcl_SetVar2(interp, "sqlite_options", "globalrecover", "1", TCL_GLOBAL_ONLY); | ||
236 | #endif | ||
237 | |||
238 | #ifdef SQLITE_ENABLE_ICU | ||
239 | Tcl_SetVar2(interp, "sqlite_options", "icu", "1", TCL_GLOBAL_ONLY); | ||
240 | #else | ||
241 | Tcl_SetVar2(interp, "sqlite_options", "icu", "0", TCL_GLOBAL_ONLY); | ||
242 | #endif | ||
243 | |||
244 | #ifdef SQLITE_OMIT_INCRBLOB | ||
245 | Tcl_SetVar2(interp, "sqlite_options", "incrblob", "0", TCL_GLOBAL_ONLY); | ||
246 | #else | ||
247 | Tcl_SetVar2(interp, "sqlite_options", "incrblob", "1", TCL_GLOBAL_ONLY); | ||
248 | #endif /* SQLITE_OMIT_AUTOVACUUM */ | ||
249 | |||
250 | #ifdef SQLITE_OMIT_INTEGRITY_CHECK | ||
251 | Tcl_SetVar2(interp, "sqlite_options", "integrityck", "0", TCL_GLOBAL_ONLY); | ||
252 | #else | ||
253 | Tcl_SetVar2(interp, "sqlite_options", "integrityck", "1", TCL_GLOBAL_ONLY); | ||
254 | #endif | ||
255 | |||
256 | #if defined(SQLITE_DEFAULT_FILE_FORMAT) && SQLITE_DEFAULT_FILE_FORMAT==1 | ||
257 | Tcl_SetVar2(interp, "sqlite_options", "legacyformat", "1", TCL_GLOBAL_ONLY); | ||
258 | #else | ||
259 | Tcl_SetVar2(interp, "sqlite_options", "legacyformat", "0", TCL_GLOBAL_ONLY); | ||
260 | #endif | ||
261 | |||
262 | #ifdef SQLITE_OMIT_LIKE_OPTIMIZATION | ||
263 | Tcl_SetVar2(interp, "sqlite_options", "like_opt", "0", TCL_GLOBAL_ONLY); | ||
264 | #else | ||
265 | Tcl_SetVar2(interp, "sqlite_options", "like_opt", "1", TCL_GLOBAL_ONLY); | ||
266 | #endif | ||
267 | |||
268 | #ifdef SQLITE_OMIT_LOAD_EXTENSION | ||
269 | Tcl_SetVar2(interp, "sqlite_options", "load_ext", "0", TCL_GLOBAL_ONLY); | ||
270 | #else | ||
271 | Tcl_SetVar2(interp, "sqlite_options", "load_ext", "1", TCL_GLOBAL_ONLY); | ||
272 | #endif | ||
273 | |||
274 | Tcl_SetVar2(interp, "sqlite_options", "long_double", | ||
275 | sizeof(LONGDOUBLE_TYPE)>sizeof(double) ? "1" : "0", | ||
276 | TCL_GLOBAL_ONLY); | ||
277 | |||
278 | #ifdef SQLITE_OMIT_MEMORYDB | ||
279 | Tcl_SetVar2(interp, "sqlite_options", "memorydb", "0", TCL_GLOBAL_ONLY); | ||
280 | #else | ||
281 | Tcl_SetVar2(interp, "sqlite_options", "memorydb", "1", TCL_GLOBAL_ONLY); | ||
282 | #endif | ||
283 | |||
284 | #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT | ||
285 | Tcl_SetVar2(interp, "sqlite_options", "memorymanage", "1", TCL_GLOBAL_ONLY); | ||
286 | #else | ||
287 | Tcl_SetVar2(interp, "sqlite_options", "memorymanage", "0", TCL_GLOBAL_ONLY); | ||
288 | #endif | ||
289 | |||
290 | #ifdef SQLITE_OMIT_OR_OPTIMIZATION | ||
291 | Tcl_SetVar2(interp, "sqlite_options", "or_opt", "0", TCL_GLOBAL_ONLY); | ||
292 | #else | ||
293 | Tcl_SetVar2(interp, "sqlite_options", "or_opt", "1", TCL_GLOBAL_ONLY); | ||
294 | #endif | ||
295 | |||
296 | #ifdef SQLITE_OMIT_PAGER_PRAGMAS | ||
297 | Tcl_SetVar2(interp, "sqlite_options", "pager_pragmas", "0", TCL_GLOBAL_ONLY); | ||
298 | #else | ||
299 | Tcl_SetVar2(interp, "sqlite_options", "pager_pragmas", "1", TCL_GLOBAL_ONLY); | ||
300 | #endif | ||
301 | |||
302 | #ifdef SQLITE_OMIT_PARSER | ||
303 | Tcl_SetVar2(interp, "sqlite_options", "parser", "0", TCL_GLOBAL_ONLY); | ||
304 | #else | ||
305 | Tcl_SetVar2(interp, "sqlite_options", "parser", "1", TCL_GLOBAL_ONLY); | ||
306 | #endif | ||
307 | |||
308 | #if defined(SQLITE_OMIT_PRAGMA) || defined(SQLITE_OMIT_FLAG_PRAGMAS) | ||
309 | Tcl_SetVar2(interp, "sqlite_options", "pragma", "0", TCL_GLOBAL_ONLY); | ||
310 | Tcl_SetVar2(interp, "sqlite_options", "integrityck", "0", TCL_GLOBAL_ONLY); | ||
311 | #else | ||
312 | Tcl_SetVar2(interp, "sqlite_options", "pragma", "1", TCL_GLOBAL_ONLY); | ||
313 | #endif | ||
314 | |||
315 | #ifdef SQLITE_OMIT_PROGRESS_CALLBACK | ||
316 | Tcl_SetVar2(interp, "sqlite_options", "progress", "0", TCL_GLOBAL_ONLY); | ||
317 | #else | ||
318 | Tcl_SetVar2(interp, "sqlite_options", "progress", "1", TCL_GLOBAL_ONLY); | ||
319 | #endif | ||
320 | |||
321 | #ifdef SQLITE_OMIT_REINDEX | ||
322 | Tcl_SetVar2(interp, "sqlite_options", "reindex", "0", TCL_GLOBAL_ONLY); | ||
323 | #else | ||
324 | Tcl_SetVar2(interp, "sqlite_options", "reindex", "1", TCL_GLOBAL_ONLY); | ||
325 | #endif | ||
326 | |||
327 | #ifdef SQLITE_OMIT_SCHEMA_PRAGMAS | ||
328 | Tcl_SetVar2(interp, "sqlite_options", "schema_pragmas", "0", TCL_GLOBAL_ONLY); | ||
329 | #else | ||
330 | Tcl_SetVar2(interp, "sqlite_options", "schema_pragmas", "1", TCL_GLOBAL_ONLY); | ||
331 | #endif | ||
332 | |||
333 | #ifdef SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS | ||
334 | Tcl_SetVar2(interp, "sqlite_options", "schema_version", "0", TCL_GLOBAL_ONLY); | ||
335 | #else | ||
336 | Tcl_SetVar2(interp, "sqlite_options", "schema_version", "1", TCL_GLOBAL_ONLY); | ||
337 | #endif | ||
338 | |||
339 | #ifdef SQLITE_OMIT_SHARED_CACHE | ||
340 | Tcl_SetVar2(interp, "sqlite_options", "shared_cache", "0", TCL_GLOBAL_ONLY); | ||
341 | #else | ||
342 | Tcl_SetVar2(interp, "sqlite_options", "shared_cache", "1", TCL_GLOBAL_ONLY); | ||
343 | #endif | ||
344 | |||
345 | #ifdef SQLITE_OMIT_SUBQUERY | ||
346 | Tcl_SetVar2(interp, "sqlite_options", "subquery", "0", TCL_GLOBAL_ONLY); | ||
347 | #else | ||
348 | Tcl_SetVar2(interp, "sqlite_options", "subquery", "1", TCL_GLOBAL_ONLY); | ||
349 | #endif | ||
350 | |||
351 | #ifdef SQLITE_OMIT_TCL_VARIABLE | ||
352 | Tcl_SetVar2(interp, "sqlite_options", "tclvar", "0", TCL_GLOBAL_ONLY); | ||
353 | #else | ||
354 | Tcl_SetVar2(interp, "sqlite_options", "tclvar", "1", TCL_GLOBAL_ONLY); | ||
355 | #endif | ||
356 | |||
357 | #if SQLITE_THREADSAFE | ||
358 | Tcl_SetVar2(interp, "sqlite_options", "threadsafe", "1", TCL_GLOBAL_ONLY); | ||
359 | #else | ||
360 | Tcl_SetVar2(interp, "sqlite_options", "threadsafe", "0", TCL_GLOBAL_ONLY); | ||
361 | #endif | ||
362 | |||
363 | #ifdef SQLITE_OMIT_TRACE | ||
364 | Tcl_SetVar2(interp, "sqlite_options", "trace", "0", TCL_GLOBAL_ONLY); | ||
365 | #else | ||
366 | Tcl_SetVar2(interp, "sqlite_options", "trace", "1", TCL_GLOBAL_ONLY); | ||
367 | #endif | ||
368 | |||
369 | #ifdef SQLITE_OMIT_TRIGGER | ||
370 | Tcl_SetVar2(interp, "sqlite_options", "trigger", "0", TCL_GLOBAL_ONLY); | ||
371 | #else | ||
372 | Tcl_SetVar2(interp, "sqlite_options", "trigger", "1", TCL_GLOBAL_ONLY); | ||
373 | #endif | ||
374 | |||
375 | #ifdef SQLITE_OMIT_TEMPDB | ||
376 | Tcl_SetVar2(interp, "sqlite_options", "tempdb", "0", TCL_GLOBAL_ONLY); | ||
377 | #else | ||
378 | Tcl_SetVar2(interp, "sqlite_options", "tempdb", "1", TCL_GLOBAL_ONLY); | ||
379 | #endif | ||
380 | |||
381 | #ifdef SQLITE_OMIT_UTF16 | ||
382 | Tcl_SetVar2(interp, "sqlite_options", "utf16", "0", TCL_GLOBAL_ONLY); | ||
383 | #else | ||
384 | Tcl_SetVar2(interp, "sqlite_options", "utf16", "1", TCL_GLOBAL_ONLY); | ||
385 | #endif | ||
386 | |||
387 | #if defined(SQLITE_OMIT_VACUUM) || defined(SQLITE_OMIT_ATTACH) | ||
388 | Tcl_SetVar2(interp, "sqlite_options", "vacuum", "0", TCL_GLOBAL_ONLY); | ||
389 | #else | ||
390 | Tcl_SetVar2(interp, "sqlite_options", "vacuum", "1", TCL_GLOBAL_ONLY); | ||
391 | #endif | ||
392 | |||
393 | #ifdef SQLITE_OMIT_VIEW | ||
394 | Tcl_SetVar2(interp, "sqlite_options", "view", "0", TCL_GLOBAL_ONLY); | ||
395 | #else | ||
396 | Tcl_SetVar2(interp, "sqlite_options", "view", "1", TCL_GLOBAL_ONLY); | ||
397 | #endif | ||
398 | |||
399 | #ifdef SQLITE_OMIT_VIRTUALTABLE | ||
400 | Tcl_SetVar2(interp, "sqlite_options", "vtab", "0", TCL_GLOBAL_ONLY); | ||
401 | #else | ||
402 | Tcl_SetVar2(interp, "sqlite_options", "vtab", "1", TCL_GLOBAL_ONLY); | ||
403 | #endif | ||
404 | |||
405 | #define LINKVAR(x) \ | ||
406 | Tcl_LinkVar(interp, "SQLITE_" #x, (char *)&(sqlite3 ## x), TCL_LINK_INT) | ||
407 | |||
408 | LINKVAR( MAX_LENGTH ); | ||
409 | LINKVAR( MAX_COLUMN ); | ||
410 | LINKVAR( MAX_SQL_LENGTH ); | ||
411 | LINKVAR( MAX_EXPR_DEPTH ); | ||
412 | LINKVAR( MAX_COMPOUND_SELECT ); | ||
413 | LINKVAR( MAX_VDBE_OP ); | ||
414 | LINKVAR( MAX_FUNCTION_ARG ); | ||
415 | LINKVAR( MAX_VARIABLE_NUMBER ); | ||
416 | LINKVAR( MAX_PAGE_SIZE ); | ||
417 | LINKVAR( MAX_PAGE_COUNT ); | ||
418 | LINKVAR( MAX_LIKE_PATTERN_LENGTH ); | ||
419 | |||
420 | { | ||
421 | static int sqlite_default_temp_cache_size = SQLITE_DEFAULT_TEMP_CACHE_SIZE; | ||
422 | Tcl_LinkVar(interp, "SQLITE_DEFAULT_TEMP_CACHE_SIZE", | ||
423 | (char*)&sqlite_default_temp_cache_size, | ||
424 | TCL_LINK_INT|TCL_LINK_READ_ONLY); | ||
425 | } | ||
426 | { | ||
427 | static int sqlite_default_cache_size = SQLITE_DEFAULT_CACHE_SIZE; | ||
428 | Tcl_LinkVar(interp, "SQLITE_DEFAULT_CACHE_SIZE", | ||
429 | (char*)&sqlite_default_cache_size, TCL_LINK_INT|TCL_LINK_READ_ONLY); | ||
430 | } | ||
431 | { | ||
432 | static int sqlite_default_page_size = SQLITE_DEFAULT_PAGE_SIZE; | ||
433 | Tcl_LinkVar(interp, "SQLITE_DEFAULT_PAGE_SIZE", | ||
434 | (char*)&sqlite_default_page_size, TCL_LINK_INT|TCL_LINK_READ_ONLY); | ||
435 | } | ||
436 | { | ||
437 | static int temp_store = TEMP_STORE; | ||
438 | Tcl_LinkVar(interp, "TEMP_STORE", | ||
439 | (char*)&temp_store, TCL_LINK_INT|TCL_LINK_READ_ONLY); | ||
440 | } | ||
441 | { | ||
442 | static int sqlite_default_file_format = SQLITE_DEFAULT_FILE_FORMAT; | ||
443 | Tcl_LinkVar(interp, "SQLITE_DEFAULT_FILE_FORMAT", | ||
444 | (char*)&sqlite_default_file_format, TCL_LINK_INT|TCL_LINK_READ_ONLY); | ||
445 | } | ||
446 | { | ||
447 | static int sqlite_max_attached = SQLITE_MAX_ATTACHED; | ||
448 | Tcl_LinkVar(interp, "SQLITE_MAX_ATTACHED", | ||
449 | (char*)&sqlite_max_attached, TCL_LINK_INT|TCL_LINK_READ_ONLY); | ||
450 | } | ||
451 | } | ||
452 | |||
453 | |||
454 | /* | ||
455 | ** Register commands with the TCL interpreter. | ||
456 | */ | ||
457 | int Sqliteconfig_Init(Tcl_Interp *interp){ | ||
458 | set_options(interp); | ||
459 | return TCL_OK; | ||
460 | } | ||