| OLD | NEW |
| 1 /* | 1 /* |
| 2 ** 2007 May 05 | 2 ** 2007 May 05 |
| 3 ** | 3 ** |
| 4 ** The author disclaims copyright to this source code. In place of | 4 ** The author disclaims copyright to this source code. In place of |
| 5 ** a legal notice, here is a blessing: | 5 ** a legal notice, here is a blessing: |
| 6 ** | 6 ** |
| 7 ** May you do good and not evil. | 7 ** May you do good and not evil. |
| 8 ** May you find forgiveness for yourself and forgive others. | 8 ** May you find forgiveness for yourself and forgive others. |
| 9 ** May you share freely, never taking more than you give. | 9 ** May you share freely, never taking more than you give. |
| 10 ** | 10 ** |
| 11 ************************************************************************* | 11 ************************************************************************* |
| 12 ** Code for testing the btree.c module in SQLite. This code | 12 ** Code for testing the btree.c module in SQLite. This code |
| 13 ** is not included in the SQLite library. It is used for automated | 13 ** is not included in the SQLite library. It is used for automated |
| 14 ** testing of the SQLite library. | 14 ** testing of the SQLite library. |
| 15 */ | 15 */ |
| 16 #include "btreeInt.h" | 16 #include "btreeInt.h" |
| 17 #include <tcl.h> | 17 #if defined(INCLUDE_SQLITE_TCL_H) |
| 18 # include "sqlite_tcl.h" |
| 19 #else |
| 20 # include "tcl.h" |
| 21 #endif |
| 18 | 22 |
| 19 /* | 23 /* |
| 20 ** Usage: sqlite3_shared_cache_report | 24 ** Usage: sqlite3_shared_cache_report |
| 21 ** | 25 ** |
| 22 ** Return a list of file that are shared and the number of | 26 ** Return a list of file that are shared and the number of |
| 23 ** references to each file. | 27 ** references to each file. |
| 24 */ | 28 */ |
| 25 int sqlite3BtreeSharedCacheReport( | 29 int SQLITE_TCLAPI sqlite3BtreeSharedCacheReport( |
| 26 void * clientData, | 30 void * clientData, |
| 27 Tcl_Interp *interp, | 31 Tcl_Interp *interp, |
| 28 int objc, | 32 int objc, |
| 29 Tcl_Obj *CONST objv[] | 33 Tcl_Obj *CONST objv[] |
| 30 ){ | 34 ){ |
| 31 #ifndef SQLITE_OMIT_SHARED_CACHE | 35 #ifndef SQLITE_OMIT_SHARED_CACHE |
| 32 extern BtShared *sqlite3SharedCacheList; | 36 extern BtShared *sqlite3SharedCacheList; |
| 33 BtShared *pBt; | 37 BtShared *pBt; |
| 34 Tcl_Obj *pRet = Tcl_NewObj(); | 38 Tcl_Obj *pRet = Tcl_NewObj(); |
| 35 for(pBt=GLOBAL(BtShared*,sqlite3SharedCacheList); pBt; pBt=pBt->pNext){ | 39 for(pBt=GLOBAL(BtShared*,sqlite3SharedCacheList); pBt; pBt=pBt->pNext){ |
| (...skipping 17 matching lines...) Expand all Loading... |
| 53 MemPage *pPage = pCur->apPage[pCur->iPage]; | 57 MemPage *pPage = pCur->apPage[pCur->iPage]; |
| 54 char *zMode = (pCur->curFlags & BTCF_WriteFlag) ? "rw" : "ro"; | 58 char *zMode = (pCur->curFlags & BTCF_WriteFlag) ? "rw" : "ro"; |
| 55 sqlite3DebugPrintf("CURSOR %p rooted at %4d(%s) currently at %d.%d%s\n", | 59 sqlite3DebugPrintf("CURSOR %p rooted at %4d(%s) currently at %d.%d%s\n", |
| 56 pCur, pCur->pgnoRoot, zMode, | 60 pCur, pCur->pgnoRoot, zMode, |
| 57 pPage ? pPage->pgno : 0, pCur->aiIdx[pCur->iPage], | 61 pPage ? pPage->pgno : 0, pCur->aiIdx[pCur->iPage], |
| 58 (pCur->eState==CURSOR_VALID) ? "" : " eof" | 62 (pCur->eState==CURSOR_VALID) ? "" : " eof" |
| 59 ); | 63 ); |
| 60 } | 64 } |
| 61 #endif | 65 #endif |
| 62 } | 66 } |
| OLD | NEW |