wasCSharpSQLite – Blame information for rev
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | namespace Community.CsharpSqlite |
2 | { |
||
3 | #if TCLSH |
||
4 | using tcl.lang; |
||
5 | using Tcl_Interp = tcl.lang.Interp; |
||
6 | using Tcl_Obj = tcl.lang.TclObject; |
||
7 | |||
8 | |||
9 | public partial class Sqlite3 |
||
10 | { |
||
11 | /* |
||
12 | ** 2007 May 05 |
||
13 | ** |
||
14 | ** The author disclaims copyright to this source code. In place of |
||
15 | ** a legal notice, here is a blessing: |
||
16 | ** |
||
17 | ** May you do good and not evil. |
||
18 | ** May you find forgiveness for yourself and forgive others. |
||
19 | ** May you share freely, never taking more than you give. |
||
20 | ** |
||
21 | ************************************************************************* |
||
22 | ** Code for testing the btree.c module in SQLite. This code |
||
23 | ** is not included in the SQLite library. It is used for automated |
||
24 | ** testing of the SQLite library. |
||
25 | ************************************************************************* |
||
26 | ** Included in SQLite3 port to C#-SQLite; 2008 Noah B Hart |
||
27 | ** C#-SQLite is an independent reimplementation of the SQLite software library |
||
28 | ** |
||
29 | ** SQLITE_SOURCE_ID: 2010-08-23 18:52:01 42537b60566f288167f1b5864a5435986838e3a3 |
||
30 | ** |
||
31 | ************************************************************************* |
||
32 | */ |
||
33 | //#include "btreeInt.h" |
||
34 | //#include <tcl.h> |
||
35 | |||
36 | /* |
||
37 | ** Usage: sqlite3_shared_cache_report |
||
38 | ** |
||
39 | ** Return a list of file that are shared and the number of |
||
40 | ** references to each file. |
||
41 | */ |
||
42 | static int sqlite3BtreeSharedCacheReport( |
||
43 | object clientData, |
||
44 | Tcl_Interp interp, |
||
45 | int objc, |
||
46 | Tcl_Obj[] objv |
||
47 | ) |
||
48 | { |
||
49 | #if !SQLITE_OMIT_SHARED_CACHE |
||
50 | extern BtShared *sqlite3SharedCacheList; |
||
51 | BtShared *pBt; |
||
52 | Tcl_Obj *pRet = TCL.Tcl_NewObj(); |
||
53 | for(pBt=GLOBAL(BtShared*,sqlite3SharedCacheList); pBt; pBt=pBt->pNext){ |
||
54 | string zFile = sqlite3PagerFilename(pBt->pPager); |
||
55 | Tcl_ListObjAppendElement(interp, pRet, TCL.TCL_NewStringObj(zFile, -1)); |
||
56 | Tcl_ListObjAppendElement(interp, pRet, TCL.TCL_NewIntObj(pBt->nRef)); |
||
57 | } |
||
58 | Tcl_SetObjResult(interp, pRet); |
||
59 | #endif |
||
60 | return TCL.TCL_OK; |
||
61 | } |
||
62 | |||
63 | /* |
||
64 | ** Print debugging information about all cursors to standard output. |
||
65 | */ |
||
66 | static void sqlite3BtreeCursorList( Btree p ) |
||
67 | { |
||
68 | #if SQLITE_DEBUG |
||
69 | BtCursor pCur; |
||
70 | BtShared pBt = p.pBt; |
||
71 | for ( pCur = pBt.pCursor; pCur != null; pCur = pCur.pNext ) |
||
72 | { |
||
73 | MemPage pPage = pCur.apPage[pCur.iPage]; |
||
74 | string zMode = pCur.wrFlag != 0 ? "rw" : "ro"; |
||
75 | sqlite3DebugPrintf( "CURSOR %p rooted at %4d(%s) currently at %d.%d%s\n", |
||
76 | pCur, pCur.pgnoRoot, zMode, |
||
77 | pPage != null ? pPage.pgno : 0, pCur.aiIdx[pCur.iPage], |
||
78 | ( pCur.eState == CURSOR_VALID ) ? "" : " eof" |
||
79 | ); |
||
80 | } |
||
81 | #endif |
||
82 | } |
||
83 | } |
||
84 | #endif |
||
85 | } |