From b3575d7c8959681fb807bf97cbbd0ad8933479be Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Mon, 14 Feb 2022 11:05:35 +0000 Subject: [PATCH] more TDB --- source/libs/tdb/inc/tdb.h | 3 ++- source/libs/tdb/src/db/tdb.c | 4 ++++ source/libs/tdb/src/db/tdbEnv.c | 1 + source/libs/tdb/src/inc/tdbPgFile.h | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/source/libs/tdb/inc/tdb.h b/source/libs/tdb/inc/tdb.h index 1df194e24a..39a62fcc64 100644 --- a/source/libs/tdb/inc/tdb.h +++ b/source/libs/tdb/inc/tdb.h @@ -50,11 +50,12 @@ int tdbClose(TDB *pDb); int tdbSetKeyLen(TDB *pDb, int klen); int tdbSetValLen(TDB *pDb, int vlen); int tdbSetDup(TDB *pDb, int dup); - int tdbGetKeyLen(TDB *pDb, int *pklen); int tdbGetValLen(TDB *pDb, int *pvlen); int tdbGetDup(TDB *pDb, int *pdup); +int tdbInsert(TDB *pDb, const void *pKey, int nKey, const void *pData, int nData); + // TDBC #ifdef __cplusplus diff --git a/source/libs/tdb/src/db/tdb.c b/source/libs/tdb/src/db/tdb.c index 2e2e772336..3febe1a4e4 100644 --- a/source/libs/tdb/src/db/tdb.c +++ b/source/libs/tdb/src/db/tdb.c @@ -21,6 +21,10 @@ struct STDb { TENV * pEnv; // TENV containing the DB }; +struct STDbCurosr { + SBtCursor *pBtCur; +}; + int tdbCreate(TDB **ppDb) { TDB *pDb; diff --git a/source/libs/tdb/src/db/tdbEnv.c b/source/libs/tdb/src/db/tdbEnv.c index 77063c9b99..68a4212003 100644 --- a/source/libs/tdb/src/db/tdbEnv.c +++ b/source/libs/tdb/src/db/tdbEnv.c @@ -23,6 +23,7 @@ struct STDbEnv { SPgCache * pPgCache; // page cache struct { } pgfht; // page file hash table; + SJournal *pJournal; }; static int tdbEnvDestroy(TENV *pEnv); diff --git a/source/libs/tdb/src/inc/tdbPgFile.h b/source/libs/tdb/src/inc/tdbPgFile.h index 67d81ffbb1..84d8319c61 100644 --- a/source/libs/tdb/src/inc/tdbPgFile.h +++ b/source/libs/tdb/src/inc/tdbPgFile.h @@ -39,6 +39,7 @@ struct SPgFile { pgsz_t pgSize; int fd; pgno_t pgFileSize; + TDB * pDb; // For a SPgFile for multiple databases, this is the mapping DB. }; int pgFileOpen(SPgFile **ppPgFile, const char *fname, SPgCache *pPgCache); -- GitLab