drh | a059ad0 | 2001-04-17 20:09:11 +0000 | [diff] [blame] | 1 | /* |
drh | b19a2bc | 2001-09-16 00:13:26 +0000 | [diff] [blame] | 2 | ** 2001 September 15 |
drh | a059ad0 | 2001-04-17 20:09:11 +0000 | [diff] [blame] | 3 | ** |
drh | b19a2bc | 2001-09-16 00:13:26 +0000 | [diff] [blame] | 4 | ** The author disclaims copyright to this source code. In place of |
| 5 | ** a legal notice, here is a blessing: |
drh | a059ad0 | 2001-04-17 20:09:11 +0000 | [diff] [blame] | 6 | ** |
drh | b19a2bc | 2001-09-16 00:13:26 +0000 | [diff] [blame] | 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. |
drh | a059ad0 | 2001-04-17 20:09:11 +0000 | [diff] [blame] | 10 | ** |
| 11 | ************************************************************************* |
| 12 | ** This header file defines the interface that the sqlite B-Tree file |
drh | 6446c4d | 2001-12-15 14:22:18 +0000 | [diff] [blame] | 13 | ** subsystem. See comments in the source code for a detailed description |
| 14 | ** of what each interface routine does. |
drh | a059ad0 | 2001-04-17 20:09:11 +0000 | [diff] [blame] | 15 | */ |
drh | be0072d | 2001-09-13 14:46:09 +0000 | [diff] [blame] | 16 | #ifndef _BTREE_H_ |
| 17 | #define _BTREE_H_ |
drh | a059ad0 | 2001-04-17 20:09:11 +0000 | [diff] [blame] | 18 | |
danielk1977 | 4adee20 | 2004-05-08 08:23:19 +0000 | [diff] [blame] | 19 | /* TODO: This definition is just included so other modules compile. It |
| 20 | ** needs to be revisited. |
| 21 | */ |
| 22 | #define SQLITE_N_BTREE_META 10 |
| 23 | |
drh | 73509ee | 2003-04-06 20:44:45 +0000 | [diff] [blame] | 24 | /* |
danielk1977 | 951af80 | 2004-11-05 15:45:09 +0000 | [diff] [blame] | 25 | ** If defined as non-zero, auto-vacuum is enabled by default. Otherwise |
| 26 | ** it must be turned on for each database using "PRAGMA auto_vacuum = 1". |
| 27 | */ |
| 28 | #ifndef SQLITE_DEFAULT_AUTOVACUUM |
| 29 | #define SQLITE_DEFAULT_AUTOVACUUM 0 |
| 30 | #endif |
| 31 | |
danielk1977 | dddbcdc | 2007-04-26 14:42:34 +0000 | [diff] [blame] | 32 | #define BTREE_AUTOVACUUM_NONE 0 /* Do not do auto-vacuum */ |
| 33 | #define BTREE_AUTOVACUUM_FULL 1 /* Do full auto-vacuum */ |
| 34 | #define BTREE_AUTOVACUUM_INCR 2 /* Incremental vacuum */ |
| 35 | |
danielk1977 | 951af80 | 2004-11-05 15:45:09 +0000 | [diff] [blame] | 36 | /* |
drh | 73509ee | 2003-04-06 20:44:45 +0000 | [diff] [blame] | 37 | ** Forward declarations of structure |
| 38 | */ |
drh | a059ad0 | 2001-04-17 20:09:11 +0000 | [diff] [blame] | 39 | typedef struct Btree Btree; |
| 40 | typedef struct BtCursor BtCursor; |
danielk1977 | aef0bf6 | 2005-12-30 16:28:01 +0000 | [diff] [blame] | 41 | typedef struct BtShared BtShared; |
paul | b95a886 | 2003-04-01 21:16:41 +0000 | [diff] [blame] | 42 | |
drh | 73509ee | 2003-04-06 20:44:45 +0000 | [diff] [blame] | 43 | |
danielk1977 | 24162fe | 2004-06-04 06:22:00 +0000 | [diff] [blame] | 44 | int sqlite3BtreeOpen( |
dan | 3a6d8ae | 2011-04-23 15:54:54 +0000 | [diff] [blame] | 45 | sqlite3_vfs *pVfs, /* VFS to use with this b-tree */ |
drh | 90f5ecb | 2004-07-22 01:19:35 +0000 | [diff] [blame] | 46 | const char *zFilename, /* Name of database file to open */ |
danielk1977 | aef0bf6 | 2005-12-30 16:28:01 +0000 | [diff] [blame] | 47 | sqlite3 *db, /* Associated database connection */ |
danielk1977 | 0d19f7a | 2009-06-03 11:25:07 +0000 | [diff] [blame] | 48 | Btree **ppBtree, /* Return open Btree* here */ |
drh | 33f4e02 | 2007-09-03 15:19:34 +0000 | [diff] [blame] | 49 | int flags, /* Flags */ |
| 50 | int vfsFlags /* Flags passed through to VFS open */ |
danielk1977 | 24162fe | 2004-06-04 06:22:00 +0000 | [diff] [blame] | 51 | ); |
drh | 3aac2dd | 2004-04-26 14:10:20 +0000 | [diff] [blame] | 52 | |
| 53 | /* The flags parameter to sqlite3BtreeOpen can be the bitwise or of the |
| 54 | ** following values. |
drh | 7bec505 | 2005-02-06 02:45:41 +0000 | [diff] [blame] | 55 | ** |
| 56 | ** NOTE: These values must match the corresponding PAGER_ values in |
| 57 | ** pager.h. |
drh | 73509ee | 2003-04-06 20:44:45 +0000 | [diff] [blame] | 58 | */ |
drh | d4187c7 | 2010-08-30 22:15:45 +0000 | [diff] [blame] | 59 | #define BTREE_OMIT_JOURNAL 1 /* Do not create or use a rollback journal */ |
drh | 33f111d | 2012-01-17 15:29:14 +0000 | [diff] [blame] | 60 | #define BTREE_MEMORY 2 /* This is an in-memory DB */ |
| 61 | #define BTREE_SINGLE 4 /* The file contains at most 1 b-tree */ |
| 62 | #define BTREE_UNORDERED 8 /* Use of a hash implementation is OK */ |
drh | e53831d | 2007-08-17 01:14:38 +0000 | [diff] [blame] | 63 | |
drh | 3aac2dd | 2004-04-26 14:10:20 +0000 | [diff] [blame] | 64 | int sqlite3BtreeClose(Btree*); |
| 65 | int sqlite3BtreeSetCacheSize(Btree*,int); |
drh | c97d846 | 2010-11-19 18:23:35 +0000 | [diff] [blame] | 66 | int sqlite3BtreeSetSafetyLevel(Btree*,int,int,int); |
drh | 2c8997b | 2005-08-27 16:36:48 +0000 | [diff] [blame] | 67 | int sqlite3BtreeSyncDisabled(Btree*); |
danielk1977 | 0d19f7a | 2009-06-03 11:25:07 +0000 | [diff] [blame] | 68 | int sqlite3BtreeSetPageSize(Btree *p, int nPagesize, int nReserve, int eFix); |
drh | 90f5ecb | 2004-07-22 01:19:35 +0000 | [diff] [blame] | 69 | int sqlite3BtreeGetPageSize(Btree*); |
drh | f8e632b | 2007-05-08 14:51:36 +0000 | [diff] [blame] | 70 | int sqlite3BtreeMaxPageCount(Btree*,int); |
drh | b129915 | 2010-03-30 22:58:33 +0000 | [diff] [blame] | 71 | u32 sqlite3BtreeLastPage(Btree*); |
drh | 5b47efa | 2010-02-12 18:18:39 +0000 | [diff] [blame] | 72 | int sqlite3BtreeSecureDelete(Btree*,int); |
drh | 2011d5f | 2004-07-22 02:40:37 +0000 | [diff] [blame] | 73 | int sqlite3BtreeGetReserve(Btree*); |
danielk1977 | 951af80 | 2004-11-05 15:45:09 +0000 | [diff] [blame] | 74 | int sqlite3BtreeSetAutoVacuum(Btree *, int); |
| 75 | int sqlite3BtreeGetAutoVacuum(Btree *); |
danielk1977 | 40b38dc | 2004-06-26 08:38:24 +0000 | [diff] [blame] | 76 | int sqlite3BtreeBeginTrans(Btree*,int); |
drh | 80e35f4 | 2007-03-30 14:06:34 +0000 | [diff] [blame] | 77 | int sqlite3BtreeCommitPhaseOne(Btree*, const char *zMaster); |
dan | 60939d0 | 2011-03-29 15:40:55 +0000 | [diff] [blame] | 78 | int sqlite3BtreeCommitPhaseTwo(Btree*, int); |
drh | 3aac2dd | 2004-04-26 14:10:20 +0000 | [diff] [blame] | 79 | int sqlite3BtreeCommit(Btree*); |
drh | 0f198a7 | 2012-02-13 16:43:16 +0000 | [diff] [blame] | 80 | int sqlite3BtreeRollback(Btree*,int); |
danielk1977 | bd43455 | 2009-03-18 10:33:00 +0000 | [diff] [blame] | 81 | int sqlite3BtreeBeginStmt(Btree*,int); |
drh | 3aac2dd | 2004-04-26 14:10:20 +0000 | [diff] [blame] | 82 | int sqlite3BtreeCreateTable(Btree*, int*, int flags); |
danielk1977 | 1d850a7 | 2004-05-31 08:26:49 +0000 | [diff] [blame] | 83 | int sqlite3BtreeIsInTrans(Btree*); |
danielk1977 | 2372c2b | 2006-06-27 16:34:56 +0000 | [diff] [blame] | 84 | int sqlite3BtreeIsInReadTrans(Btree*); |
danielk1977 | 0410302 | 2009-02-03 16:51:24 +0000 | [diff] [blame] | 85 | int sqlite3BtreeIsInBackup(Btree*); |
danielk1977 | da18423 | 2006-01-05 11:34:32 +0000 | [diff] [blame] | 86 | void *sqlite3BtreeSchema(Btree *, int, void(*)(void *)); |
danielk1977 | 602b466 | 2009-07-02 07:47:33 +0000 | [diff] [blame] | 87 | int sqlite3BtreeSchemaLocked(Btree *pBtree); |
| 88 | int sqlite3BtreeLockTable(Btree *pBtree, int iTab, u8 isWriteLock); |
danielk1977 | fd7f045 | 2008-12-17 17:30:26 +0000 | [diff] [blame] | 89 | int sqlite3BtreeSavepoint(Btree *, int, int); |
drh | 3aac2dd | 2004-04-26 14:10:20 +0000 | [diff] [blame] | 90 | |
danielk1977 | 4adee20 | 2004-05-08 08:23:19 +0000 | [diff] [blame] | 91 | const char *sqlite3BtreeGetFilename(Btree *); |
danielk1977 | 5865e3d | 2004-06-14 06:03:57 +0000 | [diff] [blame] | 92 | const char *sqlite3BtreeGetJournalname(Btree *); |
danielk1977 | 4adee20 | 2004-05-08 08:23:19 +0000 | [diff] [blame] | 93 | int sqlite3BtreeCopyFile(Btree *, Btree *); |
| 94 | |
danielk1977 | dddbcdc | 2007-04-26 14:42:34 +0000 | [diff] [blame] | 95 | int sqlite3BtreeIncrVacuum(Btree *); |
| 96 | |
drh | 3aac2dd | 2004-04-26 14:10:20 +0000 | [diff] [blame] | 97 | /* The flags parameter to sqlite3BtreeCreateTable can be the bitwise OR |
drh | d4187c7 | 2010-08-30 22:15:45 +0000 | [diff] [blame] | 98 | ** of the flags shown below. |
| 99 | ** |
| 100 | ** Every SQLite table must have either BTREE_INTKEY or BTREE_BLOBKEY set. |
| 101 | ** With BTREE_INTKEY, the table key is a 64-bit integer and arbitrary data |
| 102 | ** is stored in the leaves. (BTREE_INTKEY is used for SQL tables.) With |
| 103 | ** BTREE_BLOBKEY, the key is an arbitrary BLOB and no content is stored |
| 104 | ** anywhere - the key is the content. (BTREE_BLOBKEY is used for SQL |
| 105 | ** indices.) |
drh | 73509ee | 2003-04-06 20:44:45 +0000 | [diff] [blame] | 106 | */ |
drh | 8b18dd4 | 2004-05-12 19:18:15 +0000 | [diff] [blame] | 107 | #define BTREE_INTKEY 1 /* Table has only 64-bit signed integer keys */ |
drh | d4187c7 | 2010-08-30 22:15:45 +0000 | [diff] [blame] | 108 | #define BTREE_BLOBKEY 2 /* Table has keys only - no data */ |
drh | 73509ee | 2003-04-06 20:44:45 +0000 | [diff] [blame] | 109 | |
danielk1977 | a0bf265 | 2004-11-04 14:30:04 +0000 | [diff] [blame] | 110 | int sqlite3BtreeDropTable(Btree*, int, int*); |
danielk1977 | c7af484 | 2008-10-27 13:59:33 +0000 | [diff] [blame] | 111 | int sqlite3BtreeClearTable(Btree*, int, int*); |
danielk1977 | 0d19f7a | 2009-06-03 11:25:07 +0000 | [diff] [blame] | 112 | void sqlite3BtreeTripAllCursors(Btree*, int); |
| 113 | |
danielk1977 | 602b466 | 2009-07-02 07:47:33 +0000 | [diff] [blame] | 114 | void sqlite3BtreeGetMeta(Btree *pBtree, int idx, u32 *pValue); |
drh | 3aac2dd | 2004-04-26 14:10:20 +0000 | [diff] [blame] | 115 | int sqlite3BtreeUpdateMeta(Btree*, int idx, u32 value); |
danielk1977 | 0d19f7a | 2009-06-03 11:25:07 +0000 | [diff] [blame] | 116 | |
| 117 | /* |
| 118 | ** The second parameter to sqlite3BtreeGetMeta or sqlite3BtreeUpdateMeta |
| 119 | ** should be one of the following values. The integer values are assigned |
| 120 | ** to constants so that the offset of the corresponding field in an |
| 121 | ** SQLite database header may be found using the following formula: |
| 122 | ** |
| 123 | ** offset = 36 + (idx * 4) |
| 124 | ** |
| 125 | ** For example, the free-page-count field is located at byte offset 36 of |
| 126 | ** the database file header. The incr-vacuum-flag field is located at |
| 127 | ** byte offset 64 (== 36+4*7). |
| 128 | */ |
| 129 | #define BTREE_FREE_PAGE_COUNT 0 |
| 130 | #define BTREE_SCHEMA_VERSION 1 |
| 131 | #define BTREE_FILE_FORMAT 2 |
| 132 | #define BTREE_DEFAULT_CACHE_SIZE 3 |
| 133 | #define BTREE_LARGEST_ROOT_PAGE 4 |
| 134 | #define BTREE_TEXT_ENCODING 5 |
| 135 | #define BTREE_USER_VERSION 6 |
| 136 | #define BTREE_INCR_VACUUM 7 |
paul | b95a886 | 2003-04-01 21:16:41 +0000 | [diff] [blame] | 137 | |
drh | 3aac2dd | 2004-04-26 14:10:20 +0000 | [diff] [blame] | 138 | int sqlite3BtreeCursor( |
danielk1977 | cd3e8f7 | 2008-03-25 09:47:35 +0000 | [diff] [blame] | 139 | Btree*, /* BTree containing table to open */ |
| 140 | int iTable, /* Index of root page */ |
| 141 | int wrFlag, /* 1 for writing. 0 for read-only */ |
| 142 | struct KeyInfo*, /* First argument to compare function */ |
| 143 | BtCursor *pCursor /* Space to write cursor structure */ |
drh | 3aac2dd | 2004-04-26 14:10:20 +0000 | [diff] [blame] | 144 | ); |
drh | 59020f3 | 2008-04-26 13:39:46 +0000 | [diff] [blame] | 145 | int sqlite3BtreeCursorSize(void); |
drh | f25a507 | 2009-11-18 23:01:25 +0000 | [diff] [blame] | 146 | void sqlite3BtreeCursorZero(BtCursor*); |
paul | b95a886 | 2003-04-01 21:16:41 +0000 | [diff] [blame] | 147 | |
drh | a34b676 | 2004-05-07 13:30:42 +0000 | [diff] [blame] | 148 | int sqlite3BtreeCloseCursor(BtCursor*); |
drh | e63d999 | 2008-08-13 19:11:48 +0000 | [diff] [blame] | 149 | int sqlite3BtreeMovetoUnpacked( |
| 150 | BtCursor*, |
| 151 | UnpackedRecord *pUnKey, |
| 152 | i64 intKey, |
| 153 | int bias, |
| 154 | int *pRes |
| 155 | ); |
drh | a346058 | 2008-07-11 21:02:53 +0000 | [diff] [blame] | 156 | int sqlite3BtreeCursorHasMoved(BtCursor*, int*); |
drh | 3aac2dd | 2004-04-26 14:10:20 +0000 | [diff] [blame] | 157 | int sqlite3BtreeDelete(BtCursor*); |
drh | 4a1c380 | 2004-05-12 15:15:47 +0000 | [diff] [blame] | 158 | int sqlite3BtreeInsert(BtCursor*, const void *pKey, i64 nKey, |
drh | b026e05 | 2007-05-02 01:34:31 +0000 | [diff] [blame] | 159 | const void *pData, int nData, |
danielk1977 | de63035 | 2009-05-04 11:42:29 +0000 | [diff] [blame] | 160 | int nZero, int bias, int seekResult); |
drh | 3aac2dd | 2004-04-26 14:10:20 +0000 | [diff] [blame] | 161 | int sqlite3BtreeFirst(BtCursor*, int *pRes); |
| 162 | int sqlite3BtreeLast(BtCursor*, int *pRes); |
| 163 | int sqlite3BtreeNext(BtCursor*, int *pRes); |
drh | c39e000 | 2004-05-07 23:50:57 +0000 | [diff] [blame] | 164 | int sqlite3BtreeEof(BtCursor*); |
drh | 3aac2dd | 2004-04-26 14:10:20 +0000 | [diff] [blame] | 165 | int sqlite3BtreePrevious(BtCursor*, int *pRes); |
drh | 4a1c380 | 2004-05-12 15:15:47 +0000 | [diff] [blame] | 166 | int sqlite3BtreeKeySize(BtCursor*, i64 *pSize); |
drh | 3aac2dd | 2004-04-26 14:10:20 +0000 | [diff] [blame] | 167 | int sqlite3BtreeKey(BtCursor*, u32 offset, u32 amt, void*); |
drh | e51c44f | 2004-05-30 20:46:09 +0000 | [diff] [blame] | 168 | const void *sqlite3BtreeKeyFetch(BtCursor*, int *pAmt); |
| 169 | const void *sqlite3BtreeDataFetch(BtCursor*, int *pAmt); |
drh | 3aac2dd | 2004-04-26 14:10:20 +0000 | [diff] [blame] | 170 | int sqlite3BtreeDataSize(BtCursor*, u32 *pSize); |
| 171 | int sqlite3BtreeData(BtCursor*, u32 offset, u32 amt, void*); |
drh | 7f75122 | 2009-03-17 22:33:00 +0000 | [diff] [blame] | 172 | void sqlite3BtreeSetCachedRowid(BtCursor*, sqlite3_int64); |
| 173 | sqlite3_int64 sqlite3BtreeGetCachedRowid(BtCursor*); |
drh | 144f9ea | 2003-04-16 01:28:16 +0000 | [diff] [blame] | 174 | |
drh | 1dcdbc0 | 2007-01-27 02:24:54 +0000 | [diff] [blame] | 175 | char *sqlite3BtreeIntegrityCheck(Btree*, int *aRoot, int nRoot, int, int*); |
drh | a34b676 | 2004-05-07 13:30:42 +0000 | [diff] [blame] | 176 | struct Pager *sqlite3BtreePager(Btree*); |
| 177 | |
danielk1977 | dcbb5d3 | 2007-05-04 18:36:44 +0000 | [diff] [blame] | 178 | int sqlite3BtreePutData(BtCursor*, u32 offset, u32 amt, void*); |
danielk1977 | 2dec970 | 2007-05-02 16:48:37 +0000 | [diff] [blame] | 179 | void sqlite3BtreeCacheOverflow(BtCursor *); |
danielk1977 | be51a65 | 2008-10-08 17:58:48 +0000 | [diff] [blame] | 180 | void sqlite3BtreeClearCursor(BtCursor *); |
drh | f328bc8 | 2004-05-10 23:29:49 +0000 | [diff] [blame] | 181 | |
dan | e04dc88 | 2010-04-20 18:53:15 +0000 | [diff] [blame] | 182 | int sqlite3BtreeSetVersion(Btree *pBt, int iVersion); |
| 183 | |
drh | ea8ffdf | 2009-07-22 00:35:23 +0000 | [diff] [blame] | 184 | #ifndef NDEBUG |
| 185 | int sqlite3BtreeCursorIsValid(BtCursor*); |
| 186 | #endif |
| 187 | |
danielk1977 | a553316 | 2009-02-24 10:01:51 +0000 | [diff] [blame] | 188 | #ifndef SQLITE_OMIT_BTREECOUNT |
| 189 | int sqlite3BtreeCount(BtCursor *, i64 *); |
| 190 | #endif |
| 191 | |
drh | a34b676 | 2004-05-07 13:30:42 +0000 | [diff] [blame] | 192 | #ifdef SQLITE_TEST |
drh | 3e27c02 | 2004-07-23 00:01:38 +0000 | [diff] [blame] | 193 | int sqlite3BtreeCursorInfo(BtCursor*, int*, int); |
drh | c8629a1 | 2004-05-08 20:07:40 +0000 | [diff] [blame] | 194 | void sqlite3BtreeCursorList(Btree*); |
danielk1977 | b5402fb | 2005-01-12 07:15:04 +0000 | [diff] [blame] | 195 | #endif |
drh | be0072d | 2001-09-13 14:46:09 +0000 | [diff] [blame] | 196 | |
dan | a550f2d | 2010-08-02 10:47:05 +0000 | [diff] [blame] | 197 | #ifndef SQLITE_OMIT_WAL |
dan | cdc1f04 | 2010-11-18 12:11:05 +0000 | [diff] [blame] | 198 | int sqlite3BtreeCheckpoint(Btree*, int, int *, int *); |
dan | a550f2d | 2010-08-02 10:47:05 +0000 | [diff] [blame] | 199 | #endif |
| 200 | |
drh | b1ab8ea | 2007-08-29 00:33:07 +0000 | [diff] [blame] | 201 | /* |
| 202 | ** If we are not using shared cache, then there is no need to |
| 203 | ** use mutexes to access the BtShared structures. So make the |
| 204 | ** Enter and Leave procedures no-ops. |
| 205 | */ |
danielk1977 | f7590db | 2009-04-10 12:55:16 +0000 | [diff] [blame] | 206 | #ifndef SQLITE_OMIT_SHARED_CACHE |
drh | b1ab8ea | 2007-08-29 00:33:07 +0000 | [diff] [blame] | 207 | void sqlite3BtreeEnter(Btree*); |
danielk1977 | f7590db | 2009-04-10 12:55:16 +0000 | [diff] [blame] | 208 | void sqlite3BtreeEnterAll(sqlite3*); |
| 209 | #else |
| 210 | # define sqlite3BtreeEnter(X) |
| 211 | # define sqlite3BtreeEnterAll(X) |
shane | a6f6d20 | 2008-05-29 03:01:23 +0000 | [diff] [blame] | 212 | #endif |
danielk1977 | f7590db | 2009-04-10 12:55:16 +0000 | [diff] [blame] | 213 | |
| 214 | #if !defined(SQLITE_OMIT_SHARED_CACHE) && SQLITE_THREADSAFE |
drh | dc5b047 | 2011-04-06 22:05:53 +0000 | [diff] [blame] | 215 | int sqlite3BtreeSharable(Btree*); |
danielk1977 | f7590db | 2009-04-10 12:55:16 +0000 | [diff] [blame] | 216 | void sqlite3BtreeLeave(Btree*); |
drh | ff0587c | 2007-08-29 17:43:19 +0000 | [diff] [blame] | 217 | void sqlite3BtreeEnterCursor(BtCursor*); |
| 218 | void sqlite3BtreeLeaveCursor(BtCursor*); |
drh | b1ab8ea | 2007-08-29 00:33:07 +0000 | [diff] [blame] | 219 | void sqlite3BtreeLeaveAll(sqlite3*); |
shane | a6f6d20 | 2008-05-29 03:01:23 +0000 | [diff] [blame] | 220 | #ifndef NDEBUG |
danielk1977 | f7590db | 2009-04-10 12:55:16 +0000 | [diff] [blame] | 221 | /* These routines are used inside assert() statements only. */ |
| 222 | int sqlite3BtreeHoldsMutex(Btree*); |
| 223 | int sqlite3BtreeHoldsAllMutexes(sqlite3*); |
drh | 2120608 | 2011-04-04 18:22:02 +0000 | [diff] [blame] | 224 | int sqlite3SchemaMutexHeld(sqlite3*,int,Schema*); |
shane | a6f6d20 | 2008-05-29 03:01:23 +0000 | [diff] [blame] | 225 | #endif |
danielk1977 | f7590db | 2009-04-10 12:55:16 +0000 | [diff] [blame] | 226 | #else |
| 227 | |
drh | dc5b047 | 2011-04-06 22:05:53 +0000 | [diff] [blame] | 228 | # define sqlite3BtreeSharable(X) 0 |
danielk1977 | f7590db | 2009-04-10 12:55:16 +0000 | [diff] [blame] | 229 | # define sqlite3BtreeLeave(X) |
drh | ff0587c | 2007-08-29 17:43:19 +0000 | [diff] [blame] | 230 | # define sqlite3BtreeEnterCursor(X) |
| 231 | # define sqlite3BtreeLeaveCursor(X) |
drh | b1ab8ea | 2007-08-29 00:33:07 +0000 | [diff] [blame] | 232 | # define sqlite3BtreeLeaveAll(X) |
danielk1977 | f7590db | 2009-04-10 12:55:16 +0000 | [diff] [blame] | 233 | |
| 234 | # define sqlite3BtreeHoldsMutex(X) 1 |
| 235 | # define sqlite3BtreeHoldsAllMutexes(X) 1 |
drh | e54e051 | 2011-04-05 17:31:56 +0000 | [diff] [blame] | 236 | # define sqlite3SchemaMutexHeld(X,Y,Z) 1 |
drh | 900b31e | 2007-08-28 02:27:51 +0000 | [diff] [blame] | 237 | #endif |
| 238 | |
| 239 | |
drh | be0072d | 2001-09-13 14:46:09 +0000 | [diff] [blame] | 240 | #endif /* _BTREE_H_ */ |