wasCSharpSQLite – Blame information for rev
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | using System.Diagnostics; |
2 | |||
3 | namespace Community.CsharpSqlite |
||
4 | { |
||
5 | #if TCLSH |
||
6 | using tcl.lang; |
||
7 | using Tcl_Interp = tcl.lang.Interp; |
||
8 | #endif |
||
9 | |||
10 | public partial class Sqlite3 |
||
11 | { |
||
12 | /* |
||
13 | ** 2007 May 7 |
||
14 | ** |
||
15 | ** The author disclaims copyright to this source code. In place of |
||
16 | ** a legal notice, here is a blessing: |
||
17 | ** |
||
18 | ** May you do good and not evil. |
||
19 | ** May you find forgiveness for yourself and forgive others. |
||
20 | ** May you share freely, never taking more than you give. |
||
21 | ** |
||
22 | ************************************************************************* |
||
23 | ** |
||
24 | ** This file contains code used for testing the SQLite system. |
||
25 | ** None of the code in this file goes into a deliverable build. |
||
26 | ** |
||
27 | ** The focus of this file is providing the TCL testing layer |
||
28 | ** access to compile-time constants. |
||
29 | ************************************************************************* |
||
30 | ** Included in SQLite3 port to C#-SQLite; 2008 Noah B Hart |
||
31 | ** C#-SQLite is an independent reimplementation of the SQLite software library |
||
32 | ** |
||
33 | ** SQLITE_SOURCE_ID: 2011-06-23 19:49:22 4374b7e83ea0a3fbc3691f9c0c936272862f32f2 |
||
34 | ** |
||
35 | ************************************************************************* |
||
36 | */ |
||
37 | |||
38 | #if TCLSH |
||
39 | //#include "sqliteLimit.h" |
||
40 | |||
41 | //#include "sqliteInt.h" |
||
42 | //#include "tcl.h" |
||
43 | //#include <stdlib.h> |
||
44 | //#include <string.h> |
||
45 | |||
46 | /*** Macro to stringify the results of the evaluation a pre-processor |
||
47 | ** macro. i.e. so that STRINGVALUE(SQLITE_NOMEM) -> "7". |
||
48 | */ |
||
49 | //#define STRINGVALUE2(x) #x |
||
50 | //#define STRINGVALUE(x) STRINGVALUE2(x) |
||
51 | static string STRINGVALUE( int x ) |
||
52 | { |
||
53 | return x.ToString(); |
||
54 | } |
||
55 | |||
56 | /* |
||
57 | ** This routine sets entries in the global ::sqlite_options() array variable |
||
58 | ** according to the compile-time configuration of the database. Test |
||
59 | ** procedures use this to determine when tests should be omitted. |
||
60 | */ |
||
61 | static void set_options( Tcl_Interp interp ) |
||
62 | { |
||
63 | |||
64 | TCL.Tcl_SetVar2( interp, "sqlite_options", "malloc", "0", TCL.TCL_GLOBAL_ONLY ); |
||
65 | |||
66 | #if SQLITE_32BIT_ROWID |
||
67 | TCL.Tcl_SetVar2( interp, "sqlite_options", "rowid32", "1", TCL.TCL_GLOBAL_ONLY ); |
||
68 | #else |
||
69 | TCL.Tcl_SetVar2( interp, "sqlite_options", "rowid32", "0", TCL.TCL_GLOBAL_ONLY ); |
||
70 | #endif |
||
71 | |||
72 | #if SQLITE_CASE_SENSITIVE_LIKE |
||
73 | TCL.Tcl_SetVar2(interp, "sqlite_options","casesensitivelike","1",TCL.TCL_GLOBAL_ONLY); |
||
74 | #else |
||
75 | TCL.Tcl_SetVar2( interp, "sqlite_options", "casesensitivelike", "0", TCL.TCL_GLOBAL_ONLY ); |
||
76 | #endif |
||
77 | |||
78 | #if SQLITE_DEBUG |
||
79 | TCL.Tcl_SetVar2( interp, "sqlite_options", "debug", "1", TCL.TCL_GLOBAL_ONLY ); |
||
80 | #else |
||
81 | TCL.Tcl_SetVar2( interp, "sqlite_options", "debug", "0", TCL.TCL_GLOBAL_ONLY ); |
||
82 | #endif |
||
83 | |||
84 | #if SQLITE_DISABLE_DIRSYNC |
||
85 | TCL.Tcl_SetVar2(interp, "sqlite_options", "dirsync", "0", TCL.TCL_GLOBAL_ONLY); |
||
86 | #else |
||
87 | TCL.Tcl_SetVar2( interp, "sqlite_options", "dirsync", "1", TCL.TCL_GLOBAL_ONLY ); |
||
88 | #endif |
||
89 | |||
90 | #if SQLITE_DISABLE_LFS |
||
91 | TCL.Tcl_SetVar2( interp, "sqlite_options", "lfs", "0", TCL.TCL_GLOBAL_ONLY ); |
||
92 | #else |
||
93 | TCL.Tcl_SetVar2( interp, "sqlite_options", "lfs", "1", TCL.TCL_GLOBAL_ONLY ); |
||
94 | #endif |
||
95 | |||
96 | #if FALSE // /* def SQLITE_MEMDEBUG */ |
||
97 | TCL.Tcl_SetVar2( interp, "sqlite_options", "memdebug", "1", TCL.TCL_GLOBAL_ONLY ); |
||
98 | #else |
||
99 | TCL.Tcl_SetVar2( interp, "sqlite_options", "memdebug", "0", TCL.TCL_GLOBAL_ONLY ); |
||
100 | #endif |
||
101 | |||
102 | #if SQLITE_ENABLE_8_3_NAMES |
||
103 | TCL.Tcl_SetVar2(interp, "sqlite_options", "8_3_names", "1", TCL.TCL_GLOBAL_ONLY); |
||
104 | #else |
||
105 | TCL.Tcl_SetVar2( interp, "sqlite_options", "8_3_names", "0", TCL.TCL_GLOBAL_ONLY ); |
||
106 | #endif |
||
107 | |||
108 | #if SQLITE_ENABLE_MEMSYS3 |
||
109 | TCL.Tcl_SetVar2(interp, "sqlite_options", "mem3", "1", TCL.TCL_GLOBAL_ONLY); |
||
110 | #else |
||
111 | TCL.Tcl_SetVar2( interp, "sqlite_options", "mem3", "0", TCL.TCL_GLOBAL_ONLY ); |
||
112 | #endif |
||
113 | |||
114 | #if SQLITE_ENABLE_MEMSYS5 |
||
115 | TCL.Tcl_SetVar2(interp, "sqlite_options", "mem5", "1", TCL.TCL_GLOBAL_ONLY); |
||
116 | #else |
||
117 | TCL.Tcl_SetVar2( interp, "sqlite_options", "mem5", "0", TCL.TCL_GLOBAL_ONLY ); |
||
118 | #endif |
||
119 | |||
120 | #if SQLITE_MUTEX_OMIT |
||
121 | TCL.Tcl_SetVar2( interp, "sqlite_options", "mutex", "0", TCL.TCL_GLOBAL_ONLY ); |
||
122 | #else |
||
123 | TCL.Tcl_SetVar2( interp, "sqlite_options", "mutex", "1", TCL.TCL_GLOBAL_ONLY ); |
||
124 | #endif |
||
125 | |||
126 | #if SQLITE_MUTEX_NOOP |
||
127 | TCL.Tcl_SetVar2(interp, "sqlite_options", "mutex_noop", "1", TCL.TCL_GLOBAL_ONLY); |
||
128 | #else |
||
129 | TCL.Tcl_SetVar2( interp, "sqlite_options", "mutex_noop", "0", TCL.TCL_GLOBAL_ONLY ); |
||
130 | #endif |
||
131 | |||
132 | #if SQLITE_OMIT_ALTERTABLE |
||
133 | TCL.Tcl_SetVar2(interp, "sqlite_options", "altertable", "0", TCL.TCL_GLOBAL_ONLY); |
||
134 | #else |
||
135 | TCL.Tcl_SetVar2( interp, "sqlite_options", "altertable", "1", TCL.TCL_GLOBAL_ONLY ); |
||
136 | #endif |
||
137 | |||
138 | #if SQLITE_OMIT_ANALYZE |
||
139 | TCL.Tcl_SetVar2(interp, "sqlite_options", "analyze", "0", TCL.TCL_GLOBAL_ONLY); |
||
140 | #else |
||
141 | TCL.Tcl_SetVar2( interp, "sqlite_options", "analyze", "1", TCL.TCL_GLOBAL_ONLY ); |
||
142 | #endif |
||
143 | |||
144 | #if SQLITE_ENABLE_ATOMIC_WRITE |
||
145 | TCL.Tcl_SetVar2(interp, "sqlite_options", "atomicwrite", "1", TCL.TCL_GLOBAL_ONLY); |
||
146 | #else |
||
147 | TCL.Tcl_SetVar2( interp, "sqlite_options", "atomicwrite", "0", TCL.TCL_GLOBAL_ONLY ); |
||
148 | #endif |
||
149 | |||
150 | #if SQLITE_OMIT_ATTACH |
||
151 | TCL.Tcl_SetVar2(interp, "sqlite_options", "attach", "0", TCL.TCL_GLOBAL_ONLY); |
||
152 | #else |
||
153 | TCL.Tcl_SetVar2( interp, "sqlite_options", "attach", "1", TCL.TCL_GLOBAL_ONLY ); |
||
154 | #endif |
||
155 | |||
156 | #if SQLITE_OMIT_AUTHORIZATION |
||
157 | TCL.Tcl_SetVar2( interp, "sqlite_options", "auth", "0", TCL.TCL_GLOBAL_ONLY ); |
||
158 | #else |
||
159 | TCL.Tcl_SetVar2(interp, "sqlite_options", "auth", "1", TCL.TCL_GLOBAL_ONLY); |
||
160 | #endif |
||
161 | |||
162 | #if SQLITE_OMIT_AUTOINCREMENT |
||
163 | TCL.Tcl_SetVar2(interp, "sqlite_options", "autoinc", "0", TCL.TCL_GLOBAL_ONLY); |
||
164 | #else |
||
165 | TCL.Tcl_SetVar2( interp, "sqlite_options", "autoinc", "1", TCL.TCL_GLOBAL_ONLY ); |
||
166 | #endif |
||
167 | |||
168 | #if SQLITE_OMIT_AUTOMATIC_INDEX |
||
169 | TCL.Tcl_SetVar2(interp, "sqlite_options", "autoindex", "0", TCL.TCL_GLOBAL_ONLY); |
||
170 | #else |
||
171 | TCL.Tcl_SetVar2( interp, "sqlite_options", "autoindex", "1", TCL.TCL_GLOBAL_ONLY ); |
||
172 | #endif |
||
173 | |||
174 | #if SQLITE_OMIT_AUTORESET |
||
175 | Tcl_SetVar2(interp, "sqlite_options", "autoreset", "0", TCL_GLOBAL_ONLY); |
||
176 | #else |
||
177 | TCL.Tcl_SetVar2( interp, "sqlite_options", "autoreset", "1", TCL.TCL_GLOBAL_ONLY ); |
||
178 | #endif |
||
179 | |||
180 | #if SQLITE_OMIT_AUTOVACUUM |
||
181 | TCL.Tcl_SetVar2( interp, "sqlite_options", "autovacuum", "0", TCL.TCL_GLOBAL_ONLY ); |
||
182 | #else |
||
183 | TCL.Tcl_SetVar2( interp, "sqlite_options", "autovacuum", "1", TCL.TCL_GLOBAL_ONLY ); |
||
184 | #endif // * SQLITE_OMIT_AUTOVACUUM */ |
||
185 | #if !SQLITE_DEFAULT_AUTOVACUUM |
||
186 | TCL.Tcl_SetVar2( interp, "sqlite_options", "default_autovacuum", "0", TCL.TCL_GLOBAL_ONLY ); |
||
187 | #else |
||
188 | TCL.Tcl_SetVar2(interp,"sqlite_options","default_autovacuum", |
||
189 | STRINGVALUE(SQLITE_DEFAULT_AUTOVACUUM), TCL.TCL_GLOBAL_ONLY); |
||
190 | #endif |
||
191 | |||
192 | #if SQLITE_OMIT_BETWEEN_OPTIMIZATION |
||
193 | TCL.Tcl_SetVar2(interp, "sqlite_options", "between_opt", "0", TCL.TCL_GLOBAL_ONLY); |
||
194 | #else |
||
195 | TCL.Tcl_SetVar2( interp, "sqlite_options", "between_opt", "1", TCL.TCL_GLOBAL_ONLY ); |
||
196 | #endif |
||
197 | |||
198 | #if SQLITE_OMIT_BUILTIN_TEST |
||
199 | TCL.Tcl_SetVar2(interp, "sqlite_options", "builtin_test", "0", TCL.TCL_GLOBAL_ONLY); |
||
200 | #else |
||
201 | TCL.Tcl_SetVar2( interp, "sqlite_options", "builtin_test", "1", TCL.TCL_GLOBAL_ONLY ); |
||
202 | #endif |
||
203 | |||
204 | #if SQLITE_OMIT_BLOB_LITERAL |
||
205 | TCL.Tcl_SetVar2(interp, "sqlite_options", "bloblit", "0", TCL.TCL_GLOBAL_ONLY); |
||
206 | #else |
||
207 | TCL.Tcl_SetVar2( interp, "sqlite_options", "bloblit", "1", TCL.TCL_GLOBAL_ONLY ); |
||
208 | #endif |
||
209 | |||
210 | #if SQLITE_OMIT_CAST |
||
211 | TCL.Tcl_SetVar2(interp, "sqlite_options", "cast", "0", TCL.TCL_GLOBAL_ONLY); |
||
212 | #else |
||
213 | TCL.Tcl_SetVar2( interp, "sqlite_options", "cast", "1", TCL.TCL_GLOBAL_ONLY ); |
||
214 | #endif |
||
215 | |||
216 | #if SQLITE_OMIT_CHECK |
||
217 | TCL.Tcl_SetVar2(interp, "sqlite_options", "check", "0", TCL.TCL_GLOBAL_ONLY); |
||
218 | #else |
||
219 | TCL.Tcl_SetVar2( interp, "sqlite_options", "check", "1", TCL.TCL_GLOBAL_ONLY ); |
||
220 | #endif |
||
221 | |||
222 | #if SQLITE_ENABLE_COLUMN_METADATA |
||
223 | TCL.Tcl_SetVar2( interp, "sqlite_options", "columnmetadata", "1", TCL.TCL_GLOBAL_ONLY ); |
||
224 | #else |
||
225 | TCL.Tcl_SetVar2( interp, "sqlite_options", "columnmetadata", "0", TCL.TCL_GLOBAL_ONLY ); |
||
226 | #endif |
||
227 | |||
228 | #if SQLITE_ENABLE_OVERSIZE_CELL_CHECK |
||
229 | TCL.Tcl_SetVar2( interp, "sqlite_options", "oversize_cell_check", "1", |
||
230 | TCL.TCL_GLOBAL_ONLY ); |
||
231 | #else |
||
232 | TCL.Tcl_SetVar2(interp, "sqlite_options", "oversize_cell_check", "0", |
||
233 | TCL.TCL_GLOBAL_ONLY); |
||
234 | #endif |
||
235 | |||
236 | #if SQLITE_OMIT_COMPILEOPTION_DIAGS |
||
237 | TCL.Tcl_SetVar2(interp, "sqlite_options", "compileoption_diags", "0", TCL.TCL_GLOBAL_ONLY); |
||
238 | #else |
||
239 | TCL.Tcl_SetVar2( interp, "sqlite_options", "compileoption_diags", "1", TCL.TCL_GLOBAL_ONLY ); |
||
240 | #endif |
||
241 | |||
242 | #if SQLITE_OMIT_COMPLETE |
||
243 | TCL.Tcl_SetVar2(interp, "sqlite_options", "complete", "0", TCL.TCL_GLOBAL_ONLY); |
||
244 | #else |
||
245 | TCL.Tcl_SetVar2( interp, "sqlite_options", "complete", "1", TCL.TCL_GLOBAL_ONLY ); |
||
246 | #endif |
||
247 | |||
248 | #if SQLITE_OMIT_COMPOUND_SELECT |
||
249 | TCL.Tcl_SetVar2(interp, "sqlite_options", "compound", "0", TCL.TCL_GLOBAL_ONLY); |
||
250 | #else |
||
251 | TCL.Tcl_SetVar2( interp, "sqlite_options", "compound", "1", TCL.TCL_GLOBAL_ONLY ); |
||
252 | #endif |
||
253 | |||
254 | TCL.Tcl_SetVar2( interp, "sqlite_options", "conflict", "1", TCL.TCL_GLOBAL_ONLY ); |
||
255 | |||
256 | #if SQLITE_OS_UNIX |
||
257 | TCL.Tcl_SetVar2(interp, "sqlite_options", "crashtest", "1", TCL.TCL_GLOBAL_ONLY); |
||
258 | #else |
||
259 | TCL.Tcl_SetVar2( interp, "sqlite_options", "crashtest", "0", TCL.TCL_GLOBAL_ONLY ); |
||
260 | #endif |
||
261 | |||
262 | #if SQLITE_OMIT_DATETIME_FUNCS |
||
263 | TCL.Tcl_SetVar2(interp, "sqlite_options", "datetime", "0", TCL.TCL_GLOBAL_ONLY); |
||
264 | #else |
||
265 | TCL.Tcl_SetVar2( interp, "sqlite_options", "datetime", "1", TCL.TCL_GLOBAL_ONLY ); |
||
266 | #endif |
||
267 | |||
268 | #if SQLITE_OMIT_DECLTYPE |
||
269 | TCL.Tcl_SetVar2(interp, "sqlite_options", "decltype", "0", TCL.TCL_GLOBAL_ONLY); |
||
270 | #else |
||
271 | TCL.Tcl_SetVar2( interp, "sqlite_options", "decltype", "1", TCL.TCL_GLOBAL_ONLY ); |
||
272 | #endif |
||
273 | |||
274 | #if SQLITE_OMIT_DEPRECATED |
||
275 | TCL.Tcl_SetVar2( interp, "sqlite_options", "deprecated", "0", TCL.TCL_GLOBAL_ONLY ); |
||
276 | #else |
||
277 | TCL.Tcl_SetVar2( interp, "sqlite_options", "deprecated", "1", TCL.TCL_GLOBAL_ONLY ); |
||
278 | #endif |
||
279 | |||
280 | #if SQLITE_OMIT_DISKIO |
||
281 | TCL.Tcl_SetVar2(interp, "sqlite_options", "diskio", "0", TCL.TCL_GLOBAL_ONLY); |
||
282 | #else |
||
283 | TCL.Tcl_SetVar2( interp, "sqlite_options", "diskio", "1", TCL.TCL_GLOBAL_ONLY ); |
||
284 | #endif |
||
285 | |||
286 | #if SQLITE_OMIT_EXPLAIN |
||
287 | TCL.Tcl_SetVar2(interp, "sqlite_options", "explain", "0", TCL.TCL_GLOBAL_ONLY); |
||
288 | #else |
||
289 | TCL.Tcl_SetVar2( interp, "sqlite_options", "explain", "1", TCL.TCL_GLOBAL_ONLY ); |
||
290 | #endif |
||
291 | |||
292 | #if SQLITE_OMIT_FLOATING_POINT |
||
293 | TCL.Tcl_SetVar2(interp, "sqlite_options", "floatingpoint", "0", TCL.TCL_GLOBAL_ONLY); |
||
294 | #else |
||
295 | TCL.Tcl_SetVar2( interp, "sqlite_options", "floatingpoint", "1", TCL.TCL_GLOBAL_ONLY ); |
||
296 | #endif |
||
297 | |||
298 | #if SQLITE_OMIT_FOREIGN_KEY |
||
299 | TCL.Tcl_SetVar2(interp, "sqlite_options", "foreignkey", "0", TCL.TCL_GLOBAL_ONLY); |
||
300 | #else |
||
301 | TCL.Tcl_SetVar2( interp, "sqlite_options", "foreignkey", "1", TCL.TCL_GLOBAL_ONLY ); |
||
302 | #endif |
||
303 | |||
304 | #if SQLITE_ENABLE_FTS1 |
||
305 | TCL.Tcl_SetVar2(interp, "sqlite_options", "fts1", "1", TCL.TCL_GLOBAL_ONLY); |
||
306 | #else |
||
307 | TCL.Tcl_SetVar2( interp, "sqlite_options", "fts1", "0", TCL.TCL_GLOBAL_ONLY ); |
||
308 | #endif |
||
309 | |||
310 | #if SQLITE_ENABLE_FTS2 |
||
311 | TCL.Tcl_SetVar2(interp, "sqlite_options", "fts2", "1", TCL.TCL_GLOBAL_ONLY); |
||
312 | #else |
||
313 | TCL.Tcl_SetVar2( interp, "sqlite_options", "fts2", "0", TCL.TCL_GLOBAL_ONLY ); |
||
314 | #endif |
||
315 | |||
316 | #if SQLITE_ENABLE_FTS3 |
||
317 | TCL.Tcl_SetVar2(interp, "sqlite_options", "fts3", "1", TCL.TCL_GLOBAL_ONLY); |
||
318 | #else |
||
319 | TCL.Tcl_SetVar2( interp, "sqlite_options", "fts3", "0", TCL.TCL_GLOBAL_ONLY ); |
||
320 | #endif |
||
321 | |||
322 | #if SQLITE_OMIT_GET_TABLE |
||
323 | TCL.Tcl_SetVar2( interp, "sqlite_options", "gettable", "0", TCL.TCL_GLOBAL_ONLY ); |
||
324 | #else |
||
325 | TCL.Tcl_SetVar2(interp, "sqlite_options", "gettable", "1", TCL.TCL_GLOBAL_ONLY); |
||
326 | #endif |
||
327 | |||
328 | #if SQLITE_ENABLE_ICU |
||
329 | TCL.Tcl_SetVar2(interp, "sqlite_options", "icu", "1", TCL.TCL_GLOBAL_ONLY); |
||
330 | #else |
||
331 | TCL.Tcl_SetVar2( interp, "sqlite_options", "icu", "0", TCL.TCL_GLOBAL_ONLY ); |
||
332 | #endif |
||
333 | |||
334 | #if SQLITE_OMIT_INCRBLOB |
||
335 | TCL.Tcl_SetVar2( interp, "sqlite_options", "incrblob", "0", TCL.TCL_GLOBAL_ONLY ); |
||
336 | #else |
||
337 | TCL.Tcl_SetVar2( interp, "sqlite_options", "incrblob", "1", TCL.TCL_GLOBAL_ONLY ); |
||
338 | #endif // * SQLITE_OMIT_AUTOVACUUM */ |
||
339 | |||
340 | #if SQLITE_OMIT_INTEGRITY_CHECK |
||
341 | TCL.Tcl_SetVar2(interp, "sqlite_options", "integrityck", "0", TCL.TCL_GLOBAL_ONLY); |
||
342 | #else |
||
343 | TCL.Tcl_SetVar2( interp, "sqlite_options", "integrityck", "1", TCL.TCL_GLOBAL_ONLY ); |
||
344 | #endif |
||
345 | |||
346 | #if !SQLITE_DEFAULT_FILE_FORMAT //SQLITE_DEFAULT_FILE_FORMAT && SQLITE_DEFAULT_FILE_FORMAT==1 |
||
347 | TCL.Tcl_SetVar2( interp, "sqlite_options", "legacyformat", "1", TCL.TCL_GLOBAL_ONLY ); |
||
348 | #else |
||
349 | TCL.Tcl_SetVar2( interp, "sqlite_options", "legacyformat", "0", TCL.TCL_GLOBAL_ONLY ); |
||
350 | #endif |
||
351 | |||
352 | #if SQLITE_OMIT_LIKE_OPTIMIZATION |
||
353 | TCL.Tcl_SetVar2(interp, "sqlite_options", "like_opt", "0", TCL.TCL_GLOBAL_ONLY); |
||
354 | #else |
||
355 | TCL.Tcl_SetVar2( interp, "sqlite_options", "like_opt", "1", TCL.TCL_GLOBAL_ONLY ); |
||
356 | #endif |
||
357 | |||
358 | #if SQLITE_OMIT_LOAD_EXTENSION |
||
359 | TCL.Tcl_SetVar2( interp, "sqlite_options", "load_ext", "0", TCL.TCL_GLOBAL_ONLY ); |
||
360 | #else |
||
361 | TCL.Tcl_SetVar2( interp, "sqlite_options", "load_ext", "1", TCL.TCL_GLOBAL_ONLY ); |
||
362 | #endif |
||
363 | |||
364 | #if SQLITE_OMIT_LOCALTIME |
||
365 | TCL.Tcl_SetVar2(interp, "sqlite_options", "localtime", "0", TCL.TCL_GLOBAL_ONLY); |
||
366 | #else |
||
367 | TCL.Tcl_SetVar2( interp, "sqlite_options", "localtime", "1", TCL.TCL_GLOBAL_ONLY ); |
||
368 | #endif |
||
369 | |||
370 | #if SQLITE_OMIT_LOOKASIDE |
||
371 | TCL.Tcl_SetVar2( interp, "sqlite_options", "lookaside", "0", TCL.TCL_GLOBAL_ONLY ); |
||
372 | #else |
||
373 | TCL.Tcl_SetVar2(interp, "sqlite_options", "lookaside", "1", TCL.TCL_GLOBAL_ONLY); |
||
374 | #endif |
||
375 | |||
376 | TCL.Tcl_SetVar2( interp, "sqlite_options", "long_double", "0", TCL.TCL_GLOBAL_ONLY ); |
||
377 | //sizeof(LONGDOUBLE_TYPE)>sizeof(double) ? "1" : "0", |
||
378 | //TCL.TCL_GLOBAL_ONLY); |
||
379 | |||
380 | #if SQLITE_OMIT_MEMORYDB |
||
381 | TCL.Tcl_SetVar2(interp, "sqlite_options", "memorydb", "0", TCL.TCL_GLOBAL_ONLY); |
||
382 | #else |
||
383 | TCL.Tcl_SetVar2( interp, "sqlite_options", "memorydb", "1", TCL.TCL_GLOBAL_ONLY ); |
||
384 | #endif |
||
385 | |||
386 | #if SQLITE_ENABLE_MEMORY_MANAGEMENT |
||
387 | TCL.Tcl_SetVar2(interp, "sqlite_options", "memorymanage", "1", TCL.TCL_GLOBAL_ONLY); |
||
388 | #else |
||
389 | TCL.Tcl_SetVar2( interp, "sqlite_options", "memorymanage", "0", TCL.TCL_GLOBAL_ONLY ); |
||
390 | #endif |
||
391 | |||
392 | #if SQLITE_OMIT_OR_OPTIMIZATION |
||
393 | TCL.Tcl_SetVar2(interp, "sqlite_options", "or_opt", "0", TCL.TCL_GLOBAL_ONLY); |
||
394 | #else |
||
395 | TCL.Tcl_SetVar2( interp, "sqlite_options", "or_opt", "1", TCL.TCL_GLOBAL_ONLY ); |
||
396 | #endif |
||
397 | |||
398 | #if SQLITE_OMIT_PAGER_PRAGMAS |
||
399 | TCL.Tcl_SetVar2(interp, "sqlite_options", "pager_pragmas", "0", TCL.TCL_GLOBAL_ONLY); |
||
400 | #else |
||
401 | TCL.Tcl_SetVar2( interp, "sqlite_options", "pager_pragmas", "1", TCL.TCL_GLOBAL_ONLY ); |
||
402 | #endif |
||
403 | |||
404 | #if SQLITE_OMIT_PRAGMA || SQLITE_OMIT_FLAG_PRAGMAS |
||
405 | TCL.Tcl_SetVar2(interp, "sqlite_options", "pragma", "0", TCL.TCL_GLOBAL_ONLY); |
||
406 | TCL.Tcl_SetVar2(interp, "sqlite_options", "integrityck", "0", TCL.TCL_GLOBAL_ONLY); |
||
407 | #else |
||
408 | TCL.Tcl_SetVar2( interp, "sqlite_options", "pragma", "1", TCL.TCL_GLOBAL_ONLY ); |
||
409 | #endif |
||
410 | |||
411 | #if SQLITE_OMIT_PROGRESS_CALLBACK |
||
412 | TCL.Tcl_SetVar2(interp, "sqlite_options", "progress", "0", TCL.TCL_GLOBAL_ONLY); |
||
413 | #else |
||
414 | TCL.Tcl_SetVar2( interp, "sqlite_options", "progress", "1", TCL.TCL_GLOBAL_ONLY ); |
||
415 | #endif |
||
416 | |||
417 | #if SQLITE_OMIT_REINDEX |
||
418 | TCL.Tcl_SetVar2(interp, "sqlite_options", "reindex", "0", TCL.TCL_GLOBAL_ONLY); |
||
419 | #else |
||
420 | TCL.Tcl_SetVar2( interp, "sqlite_options", "reindex", "1", TCL.TCL_GLOBAL_ONLY ); |
||
421 | #endif |
||
422 | |||
423 | #if SQLITE_ENABLE_RTREE |
||
424 | TCL.Tcl_SetVar2(interp, "sqlite_options", "rtree", "1", TCL.TCL_GLOBAL_ONLY); |
||
425 | #else |
||
426 | TCL.Tcl_SetVar2( interp, "sqlite_options", "rtree", "0", TCL.TCL_GLOBAL_ONLY ); |
||
427 | #endif |
||
428 | |||
429 | #if SQLITE_OMIT_SCHEMA_PRAGMAS |
||
430 | TCL.Tcl_SetVar2(interp, "sqlite_options", "schema_pragmas", "0", TCL.TCL_GLOBAL_ONLY); |
||
431 | #else |
||
432 | TCL.Tcl_SetVar2( interp, "sqlite_options", "schema_pragmas", "1", TCL.TCL_GLOBAL_ONLY ); |
||
433 | #endif |
||
434 | |||
435 | #if SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS |
||
436 | TCL.Tcl_SetVar2(interp, "sqlite_options", "schema_version", "0", TCL.TCL_GLOBAL_ONLY); |
||
437 | #else |
||
438 | TCL.Tcl_SetVar2( interp, "sqlite_options", "schema_version", "1", TCL.TCL_GLOBAL_ONLY ); |
||
439 | #endif |
||
440 | |||
441 | #if SQLITE_ENABLE_STAT2 |
||
442 | TCL.Tcl_SetVar2( interp, "sqlite_options", "stat2", "1", TCL.TCL_GLOBAL_ONLY ); |
||
443 | #else |
||
444 | TCL.Tcl_SetVar2( interp, "sqlite_options", "stat2", "0", TCL.TCL_GLOBAL_ONLY ); |
||
445 | #endif |
||
446 | |||
447 | #if !(SQLITE_ENABLE_LOCKING_STYLE) |
||
448 | # if (__APPLE__) |
||
449 | //# define SQLITE_ENABLE_LOCKING_STYLE 1 |
||
450 | # else |
||
451 | //# define SQLITE_ENABLE_LOCKING_STYLE 0 |
||
452 | # endif |
||
453 | #endif |
||
454 | #if SQLITE_ENABLE_LOCKING_STYLE && (__APPLE__) |
||
455 | TCL.Tcl_SetVar2(interp,"sqlite_options","lock_proxy_pragmas","1",TCL.TCL_GLOBAL_ONLY); |
||
456 | #else |
||
457 | TCL.Tcl_SetVar2( interp, "sqlite_options", "lock_proxy_pragmas", "0", TCL.TCL_GLOBAL_ONLY ); |
||
458 | #endif |
||
459 | #if (SQLITE_PREFER_PROXY_LOCKING) && (__APPLE__) |
||
460 | TCL.Tcl_SetVar2(interp,"sqlite_options","prefer_proxy_locking","1",TCL.TCL_GLOBAL_ONLY); |
||
461 | #else |
||
462 | TCL.Tcl_SetVar2( interp, "sqlite_options", "prefer_proxy_locking", "0", TCL.TCL_GLOBAL_ONLY ); |
||
463 | #endif |
||
464 | |||
465 | #if SQLITE_OMIT_SHARED_CACHE |
||
466 | TCL.Tcl_SetVar2( interp, "sqlite_options", "shared_cache", "0", TCL.TCL_GLOBAL_ONLY ); |
||
467 | #else |
||
468 | TCL.Tcl_SetVar2( interp, "sqlite_options", "shared_cache", "1", TCL.TCL_GLOBAL_ONLY ); |
||
469 | #endif |
||
470 | |||
471 | #if SQLITE_OMIT_SUBQUERY |
||
472 | TCL.Tcl_SetVar2(interp, "sqlite_options", "subquery", "0", TCL.TCL_GLOBAL_ONLY); |
||
473 | #else |
||
474 | TCL.Tcl_SetVar2( interp, "sqlite_options", "subquery", "1", TCL.TCL_GLOBAL_ONLY ); |
||
475 | #endif |
||
476 | |||
477 | #if SQLITE_OMIT_TCL_VARIABLE |
||
478 | TCL.Tcl_SetVar2(interp, "sqlite_options", "tclvar", "0", TCL.TCL_GLOBAL_ONLY); |
||
479 | #else |
||
480 | TCL.Tcl_SetVar2( interp, "sqlite_options", "tclvar", "1", TCL.TCL_GLOBAL_ONLY ); |
||
481 | #endif |
||
482 | |||
483 | TCL.Tcl_SetVar2( interp, "sqlite_options", "threadsafe", |
||
484 | STRINGVALUE( SQLITE_THREADSAFE ), TCL.TCL_GLOBAL_ONLY ); |
||
485 | Debug.Assert( sqlite3_threadsafe() == SQLITE_THREADSAFE ); |
||
486 | |||
487 | #if SQLITE_OMIT_TEMPDB |
||
488 | TCL.Tcl_SetVar2(interp, "sqlite_options", "tempdb", "0", TCL.TCL_GLOBAL_ONLY); |
||
489 | #else |
||
490 | TCL.Tcl_SetVar2( interp, "sqlite_options", "tempdb", "1", TCL.TCL_GLOBAL_ONLY ); |
||
491 | #endif |
||
492 | |||
493 | #if SQLITE_OMIT_TRACE |
||
494 | TCL.Tcl_SetVar2(interp, "sqlite_options", "trace", "0", TCL.TCL_GLOBAL_ONLY); |
||
495 | #else |
||
496 | TCL.Tcl_SetVar2( interp, "sqlite_options", "trace", "1", TCL.TCL_GLOBAL_ONLY ); |
||
497 | #endif |
||
498 | |||
499 | #if SQLITE_OMIT_TRIGGER |
||
500 | TCL.Tcl_SetVar2(interp, "sqlite_options", "trigger", "0", TCL.TCL_GLOBAL_ONLY); |
||
501 | #else |
||
502 | TCL.Tcl_SetVar2( interp, "sqlite_options", "trigger", "1", TCL.TCL_GLOBAL_ONLY ); |
||
503 | #endif |
||
504 | |||
505 | #if SQLITE_OMIT_TRUNCATE_OPTIMIZATION |
||
506 | TCL.Tcl_SetVar2(interp, "sqlite_options", "truncate_opt", "0", TCL.TCL_GLOBAL_ONLY); |
||
507 | #else |
||
508 | TCL.Tcl_SetVar2( interp, "sqlite_options", "truncate_opt", "1", TCL.TCL_GLOBAL_ONLY ); |
||
509 | #endif |
||
510 | |||
511 | #if SQLITE_OMIT_UTF16 |
||
512 | TCL.Tcl_SetVar2( interp, "sqlite_options", "utf16", "0", TCL.TCL_GLOBAL_ONLY ); |
||
513 | #else |
||
514 | TCL.Tcl_SetVar2(interp, "sqlite_options", "utf16", "1", TCL.TCL_GLOBAL_ONLY); |
||
515 | #endif |
||
516 | |||
517 | #if SQLITE_OMIT_VACUUM || SQLITE_OMIT_ATTACH |
||
518 | TCL.Tcl_SetVar2(interp, "sqlite_options", "vacuum", "0", TCL.TCL_GLOBAL_ONLY); |
||
519 | #else |
||
520 | TCL.Tcl_SetVar2( interp, "sqlite_options", "vacuum", "1", TCL.TCL_GLOBAL_ONLY ); |
||
521 | #endif |
||
522 | |||
523 | #if SQLITE_OMIT_VIEW |
||
524 | TCL.Tcl_SetVar2(interp, "sqlite_options", "view", "0", TCL.TCL_GLOBAL_ONLY); |
||
525 | #else |
||
526 | TCL.Tcl_SetVar2( interp, "sqlite_options", "view", "1", TCL.TCL_GLOBAL_ONLY ); |
||
527 | #endif |
||
528 | |||
529 | #if SQLITE_OMIT_VIRTUALTABLE |
||
530 | TCL.Tcl_SetVar2( interp, "sqlite_options", "vtab", "0", TCL.TCL_GLOBAL_ONLY ); |
||
531 | #else |
||
532 | TCL.Tcl_SetVar2(interp, "sqlite_options", "vtab", "1", TCL.TCL_GLOBAL_ONLY); |
||
533 | #endif |
||
534 | |||
535 | #if SQLITE_OMIT_WAL |
||
536 | TCL.Tcl_SetVar2( interp, "sqlite_options", "wal", "0", TCL.TCL_GLOBAL_ONLY ); |
||
537 | #else |
||
538 | TCL.Tcl_SetVar2(interp, "sqlite_options", "wal", "1", TCL.TCL_GLOBAL_ONLY); |
||
539 | #endif |
||
540 | |||
541 | #if SQLITE_OMIT_WSD |
||
542 | TCL.Tcl_SetVar2(interp, "sqlite_options", "wsd", "0", TCL.TCL_GLOBAL_ONLY); |
||
543 | #else |
||
544 | TCL.Tcl_SetVar2( interp, "sqlite_options", "wsd", "1", TCL.TCL_GLOBAL_ONLY ); |
||
545 | #endif |
||
546 | |||
547 | #if (SQLITE_ENABLE_UPDATE_DELETE_LIMIT) && !(SQLITE_OMIT_SUBQUERY) |
||
548 | TCL.Tcl_SetVar2( interp, "sqlite_options", "update_delete_limit", "1", TCL.TCL_GLOBAL_ONLY ); |
||
549 | #else |
||
550 | TCL.Tcl_SetVar2( interp, "sqlite_options", "update_delete_limit", "0", TCL.TCL_GLOBAL_ONLY ); |
||
551 | #endif |
||
552 | |||
553 | #if (SQLITE_ENABLE_UNLOCK_NOTIFY) |
||
554 | TCL.Tcl_SetVar2(interp, "sqlite_options", "unlock_notify", "1", TCL.TCL_GLOBAL_ONLY); |
||
555 | #else |
||
556 | TCL.Tcl_SetVar2( interp, "sqlite_options", "unlock_notify", "0", TCL.TCL_GLOBAL_ONLY ); |
||
557 | #endif |
||
558 | |||
559 | #if SQLITE_SECURE_DELETE |
||
560 | TCL.Tcl_SetVar2(interp, "sqlite_options", "secure_delete", "1", TCL.TCL_GLOBAL_ONLY); |
||
561 | #else |
||
562 | TCL.Tcl_SetVar2( interp, "sqlite_options", "secure_delete", "0", TCL.TCL_GLOBAL_ONLY ); |
||
563 | #endif |
||
564 | |||
565 | #if SQLITE_MULTIPLEX_EXT_OVWR |
||
566 | TCL.Tcl_SetVar2(interp, "sqlite_options", "multiplex_ext_overwrite", "1", TCL.TCL_GLOBAL_ONLY); |
||
567 | #else |
||
568 | TCL.Tcl_SetVar2( interp, "sqlite_options", "multiplex_ext_overwrite", "0", TCL.TCL_GLOBAL_ONLY ); |
||
569 | #endif |
||
570 | |||
571 | #if YYTRACKMAXSTACKDEPTH |
||
572 | TCL.Tcl_SetVar2(interp, "sqlite_options", "yytrackmaxstackdepth", "1", TCL.TCL_GLOBAL_ONLY); |
||
573 | #else |
||
574 | TCL.Tcl_SetVar2( interp, "sqlite_options", "yytrackmaxstackdepth", "0", TCL.TCL_GLOBAL_ONLY ); |
||
575 | #endif |
||
576 | |||
577 | //#define LINKVAR(x) { \ |
||
578 | // const int cv_ ## x = SQLITE_ ## x; \ |
||
579 | // TCL.Tcl_LinkVar(interp, "SQLITE_" #x, (char *)&(cv_ ## x), \ |
||
580 | // TCL.Tcl_LINK_INT | TCL.Tcl_LINK_READ_ONLY); } |
||
581 | |||
582 | |||
583 | //LINKVAR( MAX_LENGTH ); |
||
584 | //LINKVAR( MAX_COLUMN ); |
||
585 | //LINKVAR( MAX_SQL_LENGTH ); |
||
586 | //LINKVAR( MAX_EXPR_DEPTH ); |
||
587 | //LINKVAR( MAX_COMPOUND_SELECT ); |
||
588 | //LINKVAR( MAX_VDBE_OP ); |
||
589 | //LINKVAR( MAX_FUNCTION_ARG ); |
||
590 | //LINKVAR( MAX_VARIABLE_NUMBER ); |
||
591 | //LINKVAR( MAX_PAGE_SIZE ); |
||
592 | //LINKVAR( MAX_PAGE_COUNT ); |
||
593 | //LINKVAR( MAX_LIKE_PATTERN_LENGTH ); |
||
594 | //LINKVAR( MAX_TRIGGER_DEPTH ); |
||
595 | //LINKVAR( DEFAULT_TEMP_CACHE_SIZE ); |
||
596 | //LINKVAR( DEFAULT_CACHE_SIZE ); |
||
597 | //LINKVAR( DEFAULT_PAGE_SIZE ); |
||
598 | //LINKVAR( DEFAULT_FILE_FORMAT ); |
||
599 | //LINKVAR( MAX_ATTACHED ); |
||
600 | |||
601 | TCL.Tcl_LinkVar( interp, "SQLITE_MAX_LENGTH", SQLITE_MAX_LENGTH, VarFlags.SQLITE3_LINK_INT | VarFlags.SQLITE3_LINK_READ_ONLY ); |
||
602 | TCL.Tcl_LinkVar( interp, "SQLITE_MAX_COLUMN", SQLITE_MAX_COLUMN, VarFlags.SQLITE3_LINK_INT | VarFlags.SQLITE3_LINK_READ_ONLY ); |
||
603 | TCL.Tcl_LinkVar( interp, "SQLITE_MAX_SQL_LENGTH", SQLITE_MAX_SQL_LENGTH, VarFlags.SQLITE3_LINK_INT | VarFlags.SQLITE3_LINK_READ_ONLY ); |
||
604 | TCL.Tcl_LinkVar( interp, "SQLITE_MAX_EXPR_DEPTH", SQLITE_MAX_EXPR_DEPTH, VarFlags.SQLITE3_LINK_INT | VarFlags.SQLITE3_LINK_READ_ONLY ); |
||
605 | TCL.Tcl_LinkVar( interp, "SQLITE_MAX_COMPOUND_SELECT", SQLITE_MAX_COMPOUND_SELECT, VarFlags.SQLITE3_LINK_INT | VarFlags.SQLITE3_LINK_READ_ONLY ); |
||
606 | TCL.Tcl_LinkVar( interp, "SQLITE_MAX_VDBE_OP", SQLITE_MAX_VDBE_OP, VarFlags.SQLITE3_LINK_INT | VarFlags.SQLITE3_LINK_READ_ONLY ); |
||
607 | TCL.Tcl_LinkVar( interp, "SQLITE_MAX_FUNCTION_ARG", SQLITE_MAX_FUNCTION_ARG, VarFlags.SQLITE3_LINK_INT | VarFlags.SQLITE3_LINK_READ_ONLY ); |
||
608 | TCL.Tcl_LinkVar( interp, "SQLITE_MAX_VARIABLE_NUMBER", SQLITE_MAX_VARIABLE_NUMBER, VarFlags.SQLITE3_LINK_INT | VarFlags.SQLITE3_LINK_READ_ONLY ); |
||
609 | TCL.Tcl_LinkVar( interp, "SQLITE_MAX_PAGE_SIZE", SQLITE_MAX_PAGE_SIZE, VarFlags.SQLITE3_LINK_INT | VarFlags.SQLITE3_LINK_READ_ONLY ); |
||
610 | TCL.Tcl_LinkVar( interp, "SQLITE_MAX_PAGE_COUNT", SQLITE_MAX_PAGE_COUNT, VarFlags.SQLITE3_LINK_INT | VarFlags.SQLITE3_LINK_READ_ONLY ); |
||
611 | TCL.Tcl_LinkVar( interp, "SQLITE_MAX_LIKE_PATTERN_LENGTH", SQLITE_MAX_LIKE_PATTERN_LENGTH, VarFlags.SQLITE3_LINK_INT | VarFlags.SQLITE3_LINK_READ_ONLY ); |
||
612 | TCL.Tcl_LinkVar( interp, "SQLITE_MAX_TRIGGER_DEPTH", SQLITE_MAX_TRIGGER_DEPTH, VarFlags.SQLITE3_LINK_INT | VarFlags.SQLITE3_LINK_READ_ONLY ); |
||
613 | TCL.Tcl_LinkVar( interp, "SQLITE_DEFAULT_TEMP_CACHE_SIZE", SQLITE_DEFAULT_TEMP_CACHE_SIZE, VarFlags.SQLITE3_LINK_INT | VarFlags.SQLITE3_LINK_READ_ONLY ); |
||
614 | TCL.Tcl_LinkVar( interp, "SQLITE_DEFAULT_CACHE_SIZE", SQLITE_DEFAULT_CACHE_SIZE, VarFlags.SQLITE3_LINK_INT | VarFlags.SQLITE3_LINK_READ_ONLY ); |
||
615 | TCL.Tcl_LinkVar( interp, "SQLITE_DEFAULT_PAGE_SIZE", SQLITE_DEFAULT_PAGE_SIZE, VarFlags.SQLITE3_LINK_INT | VarFlags.SQLITE3_LINK_READ_ONLY ); |
||
616 | TCL.Tcl_LinkVar( interp, "SQLITE_DEFAULT_FILE_FORMAT", SQLITE_DEFAULT_FILE_FORMAT, VarFlags.SQLITE3_LINK_INT | VarFlags.SQLITE3_LINK_READ_ONLY ); |
||
617 | TCL.Tcl_LinkVar( interp, "SQLITE_MAX_ATTACHED", SQLITE_MAX_ATTACHED, VarFlags.SQLITE3_LINK_INT | VarFlags.SQLITE3_LINK_READ_ONLY ); |
||
618 | |||
619 | { |
||
620 | int cv_TEMP_STORE = SQLITE_TEMP_STORE; |
||
621 | TCL.Tcl_LinkVar( interp, "TEMP_STORE", cv_TEMP_STORE, VarFlags.SQLITE3_LINK_INT | VarFlags.SQLITE3_LINK_READ_ONLY ); |
||
622 | } |
||
623 | } |
||
624 | |||
625 | |||
626 | /* |
||
627 | ** Register commands with the TCL interpreter. |
||
628 | */ |
||
629 | public static int Sqliteconfig_Init( Tcl_Interp interp ) |
||
630 | { |
||
631 | set_options( interp ); |
||
632 | return TCL.TCL_OK; |
||
633 | } |
||
634 | #endif |
||
635 | } |
||
636 | } |