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

more

上级 932a77b5
...@@ -9,6 +9,7 @@ target_sources(tdb ...@@ -9,6 +9,7 @@ target_sources(tdb
PRIVATE PRIVATE
"src/db/tdbPCache.c" "src/db/tdbPCache.c"
"src/db/tdbPFile.c" "src/db/tdbPFile.c"
"src/db/tdbUtil.c"
) )
target_include_directories( target_include_directories(
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "tdbInt.h" #include "tdbInt.h"
#if 0
struct STDbEnv { struct STDbEnv {
char * rootDir; // root directory of the environment char * rootDir; // root directory of the environment
char * jname; // journal file name char * jname; // journal file name
...@@ -170,4 +171,5 @@ int tdbEnvRgstPageFile(TENV *pEnv, SPgFile *pPgFile) { ...@@ -170,4 +171,5 @@ int tdbEnvRgstPageFile(TENV *pEnv, SPgFile *pPgFile) {
int tdbEnvRgstDB(TENV *pEnv, TDB *pDb) { int tdbEnvRgstDB(TENV *pEnv, TDB *pDb) {
// TODO // TODO
return 0; 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) { ...@@ -51,7 +51,7 @@ int tdbCheckFileAccess(const char *pathname, int mode) {
return access(pathname, flags); 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; struct stat st;
int ret; int ret;
......
...@@ -20,11 +20,13 @@ ...@@ -20,11 +20,13 @@
extern "C" { extern "C" {
#endif #endif
#if 0
const char* tdbEnvGetRootDir(TENV* pEnv); const char* tdbEnvGetRootDir(TENV* pEnv);
SPgFile* tdbEnvGetPageFile(TENV* pEnv, const uint8_t fileid[]); SPgFile* tdbEnvGetPageFile(TENV* pEnv, const uint8_t fileid[]);
SPgCache* tdbEnvGetPgCache(TENV* pEnv); SPgCache* tdbEnvGetPgCache(TENV* pEnv);
int tdbEnvRgstPageFile(TENV* pEnv, SPgFile* pPgFile); int tdbEnvRgstPageFile(TENV* pEnv, SPgFile* pPgFile);
int tdbEnvRgstDB(TENV* pEnv, TDB* pDb); int tdbEnvRgstDB(TENV* pEnv, TDB* pDb);
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "tlist.h" #include "tlist.h"
#include "tlockfree.h" #include "tlockfree.h"
#include "tdb.h" // #include "tdb.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
...@@ -70,9 +70,6 @@ typedef int32_t frame_id_t; ...@@ -70,9 +70,6 @@ typedef int32_t frame_id_t;
#define TDB_DEFAULT_PGSIZE 4096 #define TDB_DEFAULT_PGSIZE 4096
#define TDB_IS_PGSIZE_VLD(s) (((s) >= TDB_MIN_PGSIZE) && ((s) <= TDB_MAX_PGSIZE)) #define TDB_IS_PGSIZE_VLD(s) (((s) >= TDB_MIN_PGSIZE) && ((s) <= TDB_MAX_PGSIZE))
// pgoff_t
typedef pgsz_t pgoff_t;
// cache // cache
#define TDB_DEFAULT_CACHE_SIZE (256 * 4096) // 1M #define TDB_DEFAULT_CACHE_SIZE (256 * 4096) // 1M
......
...@@ -35,7 +35,7 @@ int tdbGnrtFileID(const char *fname, uint8_t *fileid, bool unique); ...@@ -35,7 +35,7 @@ int tdbGnrtFileID(const char *fname, uint8_t *fileid, bool unique);
#define TDB_W_OK 0x4 #define TDB_W_OK 0x4
int tdbCheckFileAccess(const char *pathname, int mode); 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 #ifdef __cplusplus
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册