more
This commit is contained in:
parent
815233ae33
commit
61e6faaf75
|
@ -25,8 +25,13 @@ struct SBTree {
|
||||||
|
|
||||||
struct SBtCursor {
|
struct SBtCursor {
|
||||||
SBTree *pBt;
|
SBTree *pBt;
|
||||||
|
int8_t iPage;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef struct SBPage {
|
||||||
|
/* TODO */
|
||||||
|
} SBPage;
|
||||||
|
|
||||||
int tdbBtreeOpen(SPgno root, SBTree **ppBt) {
|
int tdbBtreeOpen(SPgno root, SBTree **ppBt) {
|
||||||
*ppBt = NULL;
|
*ppBt = NULL;
|
||||||
/* TODO */
|
/* TODO */
|
||||||
|
@ -38,6 +43,25 @@ int tdbBtreeClose(SBTree *pBt) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int tdbBtreeCursor(SBTree *pBt, SBtCursor *pCur) {
|
||||||
|
pCur->pBt = pBt;
|
||||||
|
pCur->iPage = -1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int tdbBtreeCursorMoveTo(SBtCursor *pCur) {
|
||||||
|
/* TODO */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int tdbBtreeCursorMoveToRoot(SBtCursor *pCur) {
|
||||||
|
SPFile *pFile = pCur->pBt->pFile;
|
||||||
|
|
||||||
|
tdbPFileGet(pFile, pCur->pBt->root);
|
||||||
|
/* TODO */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
struct SBtCursor {
|
struct SBtCursor {
|
||||||
SBTree *pBtree;
|
SBTree *pBtree;
|
||||||
|
|
|
@ -70,6 +70,19 @@ int tdbPFileClose(SPFile *pFile) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SPgHdr *tdbPFileGet(SPFile *pFile, SPgno pgno) {
|
||||||
|
SPCache *pCache;
|
||||||
|
SPgid pgid;
|
||||||
|
SPgHdr * pPage;
|
||||||
|
|
||||||
|
pCache = pFile->pCache;
|
||||||
|
|
||||||
|
pPage = tdbPCacheFetch(pCache, &pgid, true);
|
||||||
|
tdbPCacheFetchFinish(pCache, pPage);
|
||||||
|
|
||||||
|
return pPage;
|
||||||
|
}
|
||||||
|
|
||||||
int tdbPFileBegin(SPFile *pFile) {
|
int tdbPFileBegin(SPFile *pFile) {
|
||||||
// TODO
|
// TODO
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -22,12 +22,12 @@ extern "C" {
|
||||||
|
|
||||||
typedef struct SPFile SPFile;
|
typedef struct SPFile SPFile;
|
||||||
|
|
||||||
int tdbPFileOpen(SPCache *pCache, const char *fileName, SPFile **ppFile);
|
int tdbPFileOpen(SPCache *pCache, const char *fileName, SPFile **ppFile);
|
||||||
int tdbPFileClose(SPFile *pFile);
|
int tdbPFileClose(SPFile *pFile);
|
||||||
void *tdbPFileGet(SPFile *pFile, SPgno pgno);
|
SPgHdr *tdbPFileGet(SPFile *pFile, SPgno pgno);
|
||||||
int tdbPFileBegin(SPFile *pFile);
|
int tdbPFileBegin(SPFile *pFile);
|
||||||
int tdbPFileCommit(SPFile *pFile);
|
int tdbPFileCommit(SPFile *pFile);
|
||||||
int tdbPFileRollback(SPFile *pFile);
|
int tdbPFileRollback(SPFile *pFile);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue