This commit is contained in:
Hongze Cheng 2022-02-23 11:07:49 +00:00
parent 81b0634f70
commit 3206461eaf
1 changed files with 12 additions and 4 deletions

View File

@ -29,7 +29,9 @@ struct SBtCursor {
}; };
typedef struct SBPage { typedef struct SBPage {
/* TODO */ u8 isInit;
u8 isLeaf;
SPgno pgno;
} SBPage; } SBPage;
int tdbBtreeOpen(SPgno root, SBTree **ppBt) { int tdbBtreeOpen(SPgno root, SBTree **ppBt) {
@ -55,10 +57,16 @@ int tdbBtreeCursorMoveTo(SBtCursor *pCur) {
} }
static int tdbBtreeCursorMoveToRoot(SBtCursor *pCur) { static int tdbBtreeCursorMoveToRoot(SBtCursor *pCur) {
SPFile *pFile = pCur->pBt->pFile; SPFile *pFile;
SPgHdr *pPage;
pFile = pCur->pBt->pFile;
pPage = tdbPFileGet(pFile, pCur->pBt->root);
if (pPage == NULL) {
return -1;
}
tdbPFileGet(pFile, pCur->pBt->root);
/* TODO */
return 0; return 0;
} }