提交 9842da79 编写于 作者: H Hongze Cheng

more

上级 932a77b5
......@@ -9,6 +9,7 @@ target_sources(tdb
PRIVATE
"src/db/tdbPCache.c"
"src/db/tdbPFile.c"
"src/db/tdbUtil.c"
)
target_include_directories(
......
......@@ -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
......@@ -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;
......
......@@ -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
}
......
......@@ -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
......
......@@ -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
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册