From 9842da7909c16d07817b4ca1e409ee5681b9add7 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 23 Feb 2022 08:40:54 +0000 Subject: [PATCH] more --- source/libs/tdb/CMakeLists.txt | 1 + source/libs/tdb/src/db/tdbEnv.c | 4 +++- source/libs/tdb/src/db/tdbUtil.c | 2 +- source/libs/tdb/src/inc/tdbEnv.h | 2 ++ source/libs/tdb/src/inc/tdbInt.h | 5 +---- source/libs/tdb/src/inc/tdbUtil.h | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/source/libs/tdb/CMakeLists.txt b/source/libs/tdb/CMakeLists.txt index 9498b639e0..9473fb83c2 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 3670c770ab..e81fbfaca8 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 8dbba4d328..519451f757 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 6cb5c7a2cd..823e157706 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 1ba97ec754..2cef8979b0 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 629a71a09f..4526f7e350 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 } -- GitLab