This commit is contained in:
Hongze Cheng 2022-02-23 08:49:12 +00:00
parent 9842da7909
commit df0ab85f80
5 changed files with 22 additions and 12 deletions

View File

@ -15,6 +15,7 @@
#include "tdbInt.h" #include "tdbInt.h"
#if 0
struct SBtCursor { struct SBtCursor {
SBTree *pBtree; SBTree *pBtree;
SPgno pgno; SPgno pgno;
@ -39,9 +40,9 @@ typedef struct __attribute__((__packed__)) {
typedef int (*BtreeCmprFn)(const void *, const void *); typedef int (*BtreeCmprFn)(const void *, const void *);
#define BTREE_PAGE_HDR(pPage) NULL /* TODO */ #define BTREE_PAGE_HDR(pPage) NULL /* TODO */
#define BTREE_PAGE_PAYLOAD_AT(pPage, idx) NULL /*TODO*/ #define BTREE_PAGE_PAYLOAD_AT(pPage, idx) NULL /*TODO*/
#define BTREE_PAGE_IS_LEAF(pPage) 0 /* TODO */ #define BTREE_PAGE_IS_LEAF(pPage) 0 /* TODO */
static int btreeCreate(SBTree **ppBt); static int btreeCreate(SBTree **ppBt);
static int btreeDestroy(SBTree *pBt); static int btreeDestroy(SBTree *pBt);
@ -161,4 +162,5 @@ static int btreeCursorMoveToChild(SBtCursor *pBtCur, SPgno pgno) {
SPgFile *pPgFile; SPgFile *pPgFile;
// TODO // TODO
return 0; return 0;
} }
#endif

View File

@ -15,6 +15,12 @@
#include "tdbInt.h" #include "tdbInt.h"
struct STEnv {
char * rootDir;
SPCache *pCache;
int jfd;
};
#if 0 #if 0
struct STDbEnv { struct STDbEnv {
char * rootDir; // root directory of the environment char * rootDir; // root directory of the environment

View File

@ -23,6 +23,7 @@ extern "C" {
typedef struct SBTree SBTree; typedef struct SBTree SBTree;
typedef struct SBtCursor SBtCursor; typedef struct SBtCursor SBtCursor;
#if 0
// SBTree // SBTree
int btreeOpen(SBTree **ppBt, SPgFile *pPgFile); int btreeOpen(SBTree **ppBt, SPgFile *pPgFile);
int btreeClose(SBTree *pBt); int btreeClose(SBTree *pBt);
@ -36,6 +37,7 @@ int btreeCursorNext(SBtCursor *pBtCur);
struct SBTree { struct SBTree {
SPgno root; SPgno root;
}; };
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -20,13 +20,13 @@
extern "C" { extern "C" {
#endif #endif
#if 0 typedef struct STEnv STEnv;
const char* tdbEnvGetRootDir(TENV* pEnv);
SPgFile* tdbEnvGetPageFile(TENV* pEnv, const uint8_t fileid[]); int tdbEnvOpen(STEnv **ppEnv);
SPgCache* tdbEnvGetPgCache(TENV* pEnv); int tdbEnvClose(STEnv *pEnv);
int tdbEnvRgstPageFile(TENV* pEnv, SPgFile* pPgFile);
int tdbEnvRgstDB(TENV* pEnv, TDB* pDb); int tdbEnvBegin(STEnv *pEnv);
#endif int tdbEnvCommit(STEnv *pEnv);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -116,13 +116,13 @@ typedef TD_DLIST_NODE(SPgFile) SPgFileListNode;
#include "tdbUtil.h" #include "tdbUtil.h"
// #include "tdbBtree.h" #include "tdbBtree.h"
#include "tdbPCache.h" #include "tdbPCache.h"
#include "tdbPFile.h" #include "tdbPFile.h"
// #include "tdbEnv.h" #include "tdbEnv.h"
#ifdef __cplusplus #ifdef __cplusplus
} }