This commit is contained in:
Hongze Cheng 2022-02-14 09:01:33 +00:00
parent da7851f2e9
commit 74f73e6bab
2 changed files with 11 additions and 2 deletions

View File

@ -66,12 +66,21 @@ int btreeClose(SBTree *pBt) {
} }
static int btreeCreate(SBTree **pBt) { static int btreeCreate(SBTree **pBt) {
SBTree *pBt;
pBt = (SBTree *)calloc(1, sizeof(*pBt));
if (pBt == NULL) {
return -1;
}
// TODO // TODO
return 0; return 0;
} }
static int btreeDestroy(SBTree *pBt) { static int btreeDestroy(SBTree *pBt) {
// TODO if (pBt) {
free(pBt);
}
return 0; return 0;
} }

View File

@ -34,7 +34,7 @@ int btreeCursorMoveTo(SBtCursor *pBtCur, int kLen, const void *pKey);
int btreeCursorNext(SBtCursor *pBtCur); int btreeCursorNext(SBtCursor *pBtCur);
struct SBTree { struct SBTree {
pgno_t root; pgno_t root;
}; };
#ifdef __cplusplus #ifdef __cplusplus