diff --git a/source/libs/tdb/CMakeLists.txt b/source/libs/tdb/CMakeLists.txt index 9498b639e045ea7b1357a58895739416a6c5be06..9473fb83c2d65bc99debc589b20b5b0cde1a80e9 100644 --- a/source/libs/tdb/CMakeLists.txt +++ b/source/libs/tdb/CMakeLists.txt @@ -9,6 +9,7 @@ target_sources(tdb PRIVATE "src/db/tdbPCache.c" "src/db/tdbPFile.c" + "src/db/tdbUtil.c" ) target_include_directories( diff --git a/source/libs/tdb/src/db/tdbEnv.c b/source/libs/tdb/src/db/tdbEnv.c index 3670c770abd520fdee6cd8c21d82f3c0939150db..e81fbfaca8fabede5a08973785a949f64c8b10f4 100644 --- a/source/libs/tdb/src/db/tdbEnv.c +++ b/source/libs/tdb/src/db/tdbEnv.c @@ -15,6 +15,7 @@ #include "tdbInt.h" +#if 0 struct STDbEnv { char * rootDir; // root directory of the environment char * jname; // journal file name @@ -170,4 +171,5 @@ int tdbEnvRgstPageFile(TENV *pEnv, SPgFile *pPgFile) { int tdbEnvRgstDB(TENV *pEnv, TDB *pDb) { // TODO return 0; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/source/libs/tdb/src/db/tdbUtil.c b/source/libs/tdb/src/db/tdbUtil.c index 8dbba4d328db264a3e7660a11305a3c7d6179ce6..519451f757b44fa52075595d92c1e590122a58c2 100644 --- a/source/libs/tdb/src/db/tdbUtil.c +++ b/source/libs/tdb/src/db/tdbUtil.c @@ -51,7 +51,7 @@ int tdbCheckFileAccess(const char *pathname, int mode) { return access(pathname, flags); } -int tdbGetFileSize(const char *fname, pgsz_t pgSize, SPgno *pSize) { +int tdbGetFileSize(const char *fname, int pgSize, SPgno *pSize) { struct stat st; int ret; diff --git a/source/libs/tdb/src/inc/tdbEnv.h b/source/libs/tdb/src/inc/tdbEnv.h index 6cb5c7a2cda8537ee07a4820e9cb9d5ae6df93a9..823e157706bb9e9c2334f66c9ac0e791d1a2e145 100644 --- a/source/libs/tdb/src/inc/tdbEnv.h +++ b/source/libs/tdb/src/inc/tdbEnv.h @@ -20,11 +20,13 @@ extern "C" { #endif +#if 0 const char* tdbEnvGetRootDir(TENV* pEnv); SPgFile* tdbEnvGetPageFile(TENV* pEnv, const uint8_t fileid[]); SPgCache* tdbEnvGetPgCache(TENV* pEnv); int tdbEnvRgstPageFile(TENV* pEnv, SPgFile* pPgFile); int tdbEnvRgstDB(TENV* pEnv, TDB* pDb); +#endif #ifdef __cplusplus } diff --git a/source/libs/tdb/src/inc/tdbInt.h b/source/libs/tdb/src/inc/tdbInt.h index 1ba97ec7545f1f450c859a152d2ff8dce27c5195..2cef8979b09f56341519015a16d8108812427a92 100644 --- a/source/libs/tdb/src/inc/tdbInt.h +++ b/source/libs/tdb/src/inc/tdbInt.h @@ -19,7 +19,7 @@ #include "tlist.h" #include "tlockfree.h" -#include "tdb.h" +// #include "tdb.h" #ifdef __cplusplus extern "C" { @@ -70,9 +70,6 @@ typedef int32_t frame_id_t; #define TDB_DEFAULT_PGSIZE 4096 #define TDB_IS_PGSIZE_VLD(s) (((s) >= TDB_MIN_PGSIZE) && ((s) <= TDB_MAX_PGSIZE)) -// pgoff_t -typedef pgsz_t pgoff_t; - // cache #define TDB_DEFAULT_CACHE_SIZE (256 * 4096) // 1M diff --git a/source/libs/tdb/src/inc/tdbUtil.h b/source/libs/tdb/src/inc/tdbUtil.h index 629a71a09f0a857d6a179b6b232225bb9941a4f8..4526f7e350dc64d8994eab24d687053c3e54f193 100644 --- a/source/libs/tdb/src/inc/tdbUtil.h +++ b/source/libs/tdb/src/inc/tdbUtil.h @@ -35,7 +35,7 @@ int tdbGnrtFileID(const char *fname, uint8_t *fileid, bool unique); #define TDB_W_OK 0x4 int tdbCheckFileAccess(const char *pathname, int mode); -int tdbGetFileSize(const char *fname, pgsz_t pgSize, SPgno *pSize); +int tdbGetFileSize(const char *fname, int pgSize, SPgno *pSize); #ifdef __cplusplus }