diff --git a/source/libs/tdb/inc/tdb.h b/source/libs/tdb/inc/tdb.h index 1df194e24a06a9e7ae5c4e85a57a93b3e88b5ae5..39a62fcc64c2db20dcf2003e1bd2e564d1c91945 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 2e2e772336a5d0028e2b4a96dd02412794e37e4c..3febe1a4e44d9be674afafeca2e2681bdac261f6 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 77063c9b997298b8c7583c82fff673be4b428ae3..68a42120030affed33a37a0fb187e9ac69199c96 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 67d81ffbb1d1c697541d0700dce9f798133e79ba..84d8319c61e14f384fa2f774d0c8ab2adc5c819b 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);