btreeInt.h File Reference

Go to the source code of this file.

Classes

struct  MemPage
struct  MemPage::_OvflCell
struct  Btree
struct  BtShared
struct  CellInfo
struct  BtCursor
struct  BtLock
struct  IntegrityCk

Defines

#define ROUND8(x)   ((x+7)&~7)
#define MX_CELL_SIZE(pBt)   (pBt->pageSize-8)
#define MX_CELL(pBt)   ((pBt->pageSize-8)/6)
#define SQLITE_FILE_HEADER   "SQLite format 3"
#define PTF_INTKEY   0x01
#define PTF_ZERODATA   0x02
#define PTF_LEAFDATA   0x04
#define PTF_LEAF   0x08
#define EXTRA_SIZE   sizeof(MemPage)
#define TRANS_NONE   0
#define TRANS_READ   1
#define TRANS_WRITE   2
#define BTCURSOR_MAX_DEPTH   20
#define CURSOR_INVALID   0
#define CURSOR_VALID   1
#define CURSOR_REQUIRESEEK   2
#define CURSOR_FAULT   3
#define PENDING_BYTE_PAGE(pBt)   ((PENDING_BYTE/(pBt)->pageSize)+1)
#define READ_LOCK   1
#define WRITE_LOCK   2
#define PTRMAP_PAGENO(pBt, pgno)   ptrmapPageno(pBt, pgno)
#define PTRMAP_PTROFFSET(pgptrmap, pgno)   (5*(pgno-pgptrmap-1))
#define PTRMAP_ISPAGE(pBt, pgno)   (PTRMAP_PAGENO((pBt),(pgno))==(pgno))
#define PTRMAP_ROOTPAGE   1
#define PTRMAP_FREEPAGE   2
#define PTRMAP_OVERFLOW1   3
#define PTRMAP_OVERFLOW2   4
#define PTRMAP_BTREE   5
#define btreeIntegrity(p)
#define ISAUTOVACUUM   (pBt->autoVacuum)
#define get2byte(x)   ((x)[0]<<8 | (x)[1])
#define put2byte(p, v)   ((p)[0] = (v)>>8, (p)[1] = (v))
#define get4byte   sqlite3Get4byte
#define put4byte   sqlite3Put4byte

Typedefs

typedef struct MemPage MemPage
typedef struct BtLock BtLock
typedef struct CellInfo CellInfo
typedef struct IntegrityCk IntegrityCk

Functions

int sqlite3BtreeGetPage (BtShared *, Pgno, MemPage **, int)
int sqlite3BtreeInitPage (MemPage *pPage)
void sqlite3BtreeParseCellPtr (MemPage *, u8 *, CellInfo *)
void sqlite3BtreeParseCell (MemPage *, int, CellInfo *)
int sqlite3BtreeRestoreCursorPosition (BtCursor *pCur)
void sqlite3BtreeGetTempCursor (BtCursor *pCur, BtCursor *pTempCur)
void sqlite3BtreeReleaseTempCursor (BtCursor *pCur)
void sqlite3BtreeMoveToParent (BtCursor *pCur)

Define Documentation

#define BTCURSOR_MAX_DEPTH   20

Definition at line 423 of file btreeInt.h.

Referenced by moveToChild().

#define btreeIntegrity (  ) 
Value:
assert( p->pBt->inTransaction!=TRANS_NONE || p->pBt->nTransaction==0 ); \
  assert( p->pBt->inTransaction>=p->inTrans );

Definition at line 585 of file btreeInt.h.

Referenced by lockBtreeWithRetry(), sqlite3BtreeBeginTrans(), sqlite3BtreeCommitPhaseTwo(), and sqlite3BtreeRollback().

#define CURSOR_FAULT   3
#define CURSOR_INVALID   0
#define CURSOR_REQUIRESEEK   2
#define CURSOR_VALID   1
#define EXTRA_SIZE   sizeof(MemPage)

Definition at line 301 of file btreeInt.h.

Referenced by sqlite3BtreeOpen().

#define get2byte (  )     ((x)[0]<<8 | (x)[1])
#define get4byte   sqlite3Get4byte
#define ISAUTOVACUUM   (pBt->autoVacuum)
#define MX_CELL ( pBt   )     ((pBt->pageSize-8)/6)

Definition at line 228 of file btreeInt.h.

Referenced by balance_shallower(), and sqlite3BtreeInitPage().

#define MX_CELL_SIZE ( pBt   )     (pBt->pageSize-8)

Definition at line 221 of file btreeInt.h.

Referenced by lockBtree(), sqlite3BtreeDelete(), and sqlite3BtreeInsert().

#define PENDING_BYTE_PAGE ( pBt   )     ((PENDING_BYTE/(pBt)->pageSize)+1)
#define PTF_INTKEY   0x01

Definition at line 254 of file btreeInt.h.

Referenced by btreeDropTable(), decodeFlags(), and newDatabase().

#define PTF_LEAF   0x08
#define PTF_LEAFDATA   0x04

Definition at line 256 of file btreeInt.h.

Referenced by decodeFlags(), and newDatabase().

#define PTF_ZERODATA   0x02

Definition at line 255 of file btreeInt.h.

Referenced by decodeFlags().

#define PTRMAP_BTREE   5
#define PTRMAP_FREEPAGE   2

Definition at line 577 of file btreeInt.h.

Referenced by allocateBtreePage(), btreeCreateTable(), checkList(), freePage(), and incrVacuumStep().

#define PTRMAP_ISPAGE ( pBt,
pgno   )     (PTRMAP_PAGENO((pBt),(pgno))==(pgno))
#define PTRMAP_OVERFLOW1   3
#define PTRMAP_OVERFLOW2   4

Definition at line 579 of file btreeInt.h.

Referenced by checkList(), fillInCell(), getOverflowPage(), modifyPagePointer(), and relocatePage().

#define PTRMAP_PAGENO ( pBt,
pgno   )     ptrmapPageno(pBt, pgno)
#define PTRMAP_PTROFFSET ( pgptrmap,
pgno   )     (5*(pgno-pgptrmap-1))

Definition at line 542 of file btreeInt.h.

Referenced by ptrmapGet(), and ptrmapPut().

#define PTRMAP_ROOTPAGE   1
#define put2byte ( p,
 )     ((p)[0] = (v)>>8, (p)[1] = (v))
#define put4byte   sqlite3Put4byte
#define READ_LOCK   1
#define ROUND8 (  )     ((x+7)&~7)

Definition at line 215 of file btreeInt.h.

Referenced by balance_nonroot().

#define SQLITE_FILE_HEADER   "SQLite format 3"

Definition at line 247 of file btreeInt.h.

#define TRANS_NONE   0
#define TRANS_READ   1
#define TRANS_WRITE   2
#define WRITE_LOCK   2

Definition at line 524 of file btreeInt.h.

Referenced by lockTable(), queryTableLock(), and sqlite3BtreeLockTable().


Typedef Documentation

typedef struct BtLock BtLock

Definition at line 232 of file btreeInt.h.

typedef struct CellInfo CellInfo

Definition at line 402 of file btreeInt.h.

typedef struct IntegrityCk IntegrityCk

Definition at line 608 of file btreeInt.h.

typedef struct MemPage MemPage

Definition at line 231 of file btreeInt.h.


Function Documentation

int sqlite3BtreeGetPage ( BtShared ,
Pgno  ,
MemPage **  ,
int   
)
void sqlite3BtreeGetTempCursor ( BtCursor pCur,
BtCursor pTempCur 
)
int sqlite3BtreeInitPage ( MemPage pPage  ) 
void sqlite3BtreeMoveToParent ( BtCursor pCur  ) 
void sqlite3BtreeParseCell ( MemPage ,
int  ,
CellInfo  
)

Definition at line 641 of file btree.c.

References parseCell.

void sqlite3BtreeParseCellPtr ( MemPage ,
u8 ,
CellInfo  
)
void sqlite3BtreeReleaseTempCursor ( BtCursor pCur  ) 

Definition at line 2917 of file btree.c.

References BtCursor::apPage, BtCursor::iPage, MemPage::pDbPage, and sqlite3PagerUnref().

Referenced by sqlite3BtreeDelete().

int sqlite3BtreeRestoreCursorPosition ( BtCursor pCur  ) 

ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:58 2011 by Doxygen 1.6.1