diff --git a/source/libs/tdb/src/db/tdbDb.c b/source/libs/tdb/src/db/tdbDb.c index 01e457663c9438f90c131081b38ea35a85185637..1a66306b15c377b149fcd1811eb3e145567ce5cf 100644 --- a/source/libs/tdb/src/db/tdbDb.c +++ b/source/libs/tdb/src/db/tdbDb.c @@ -16,7 +16,7 @@ #include "tdbInt.h" struct STDB { - STEnv *pEnv; + TEnv *pEnv; SBTree *pBt; }; @@ -24,7 +24,7 @@ struct STDBC { SBTC btc; }; -int tdbDbOpen(const char *fname, int keyLen, int valLen, FKeyComparator keyCmprFn, STEnv *pEnv, TDB **ppDb) { +int tdbDbOpen(const char *fname, int keyLen, int valLen, FKeyComparator keyCmprFn, TEnv *pEnv, TDB **ppDb) { TDB *pDb; SPager *pPager; int ret; diff --git a/source/libs/tdb/src/db/tdbEnv.c b/source/libs/tdb/src/db/tdbEnv.c index ad3b5c41f21a5fd1b9ae1e471f52d768c304ce30..1fb2486a2bebc42f54d5a3266f6bbd35b02d839f 100644 --- a/source/libs/tdb/src/db/tdbEnv.c +++ b/source/libs/tdb/src/db/tdbEnv.c @@ -15,12 +15,12 @@ #include "tdbInt.h" -int tdbEnvOpen(const char *rootDir, int pageSize, int cacheSize, STEnv **ppEnv) { - STEnv *pEnv; - int dsize; - int zsize; - u8 *pPtr; - int ret; +int tdbEnvOpen(const char *rootDir, int pageSize, int cacheSize, TEnv **ppEnv) { + TEnv *pEnv; + int dsize; + int zsize; + u8 *pPtr; + int ret; *ppEnv = NULL; @@ -32,7 +32,7 @@ int tdbEnvOpen(const char *rootDir, int pageSize, int cacheSize, STEnv **ppEnv) return -1; } - pEnv = (STEnv *)pPtr; + pEnv = (TEnv *)pPtr; pPtr += sizeof(*pEnv); // pEnv->rootDir pEnv->rootDir = pPtr; @@ -59,12 +59,12 @@ int tdbEnvOpen(const char *rootDir, int pageSize, int cacheSize, STEnv **ppEnv) return 0; } -int tdbEnvClose(STEnv *pEnv) { +int tdbEnvClose(TEnv *pEnv) { // TODO return 0; } -SPager *tdbEnvGetPager(STEnv *pEnv, const char *fname) { +SPager *tdbEnvGetPager(TEnv *pEnv, const char *fname) { // TODO return NULL; } \ No newline at end of file diff --git a/source/libs/tdb/src/db/tdbTxn.c b/source/libs/tdb/src/db/tdbTxn.c index 1a2dfc77cd01fb7576e3adfde804b3ff5a31a8d1..5c7ac0678ecfbb89403a0ee3b573e786c1f2b216 100644 --- a/source/libs/tdb/src/db/tdbTxn.c +++ b/source/libs/tdb/src/db/tdbTxn.c @@ -15,17 +15,17 @@ #include "tdbInt.h" -int tdbTxnBegin(STEnv *pEnv) { +int tdbTxnBegin(TEnv *pEnv) { // TODO return 0; } -int tdbTxnCommit(STEnv *pEnv) { +int tdbTxnCommit(TEnv *pEnv) { // TODO return 0; } -int tdbTxnRollback(STEnv *pEnv) { +int tdbTxnRollback(TEnv *pEnv) { // TODO return 0; } \ No newline at end of file diff --git a/source/libs/tdb/src/inc/tdbDb.h b/source/libs/tdb/src/inc/tdbDb.h index 8b9fad96b5e85b3270e838e3b20e5f9a11e71b7e..bbeabf4d3efb3019dd90a102a57c3545861fb261 100644 --- a/source/libs/tdb/src/inc/tdbDb.h +++ b/source/libs/tdb/src/inc/tdbDb.h @@ -24,7 +24,7 @@ typedef struct STDB TDB; typedef struct STDBC TDBC; // TDB -int tdbDbOpen(const char *fname, int keyLen, int valLen, FKeyComparator keyCmprFn, STEnv *pEnv, TDB **ppDb); +int tdbDbOpen(const char *fname, int keyLen, int valLen, FKeyComparator keyCmprFn, TEnv *pEnv, TDB **ppDb); int tdbDbClose(TDB *pDb); int tdbDbDrop(TDB *pDb); int tdbDbInsert(TDB *pDb, const void *pKey, int keyLen, const void *pVal, int valLen); diff --git a/source/libs/tdb/src/inc/tdbEnv.h b/source/libs/tdb/src/inc/tdbEnv.h index 959b963a07769674e5d28979bfcb6183dde8318e..80ee2e8b0758252291cd4daa3bbd577d9482db76 100644 --- a/source/libs/tdb/src/inc/tdbEnv.h +++ b/source/libs/tdb/src/inc/tdbEnv.h @@ -21,16 +21,16 @@ extern "C" { #endif typedef struct STEnv { - char * rootDir; - char * jfname; + char *rootDir; + char *jfname; int jfd; SPCache *pCache; -} STEnv; +} TEnv; -int tdbEnvOpen(const char *rootDir, int pageSize, int cacheSize, STEnv **ppEnv); -int tdbEnvClose(STEnv *pEnv); +int tdbEnvOpen(const char *rootDir, int pageSize, int cacheSize, TEnv **ppEnv); +int tdbEnvClose(TEnv *pEnv); -SPager *tdbEnvGetPager(STEnv *pEnv, const char *fname); +SPager *tdbEnvGetPager(TEnv *pEnv, const char *fname); #ifdef __cplusplus } diff --git a/source/libs/tdb/src/inc/tdbTxn.h b/source/libs/tdb/src/inc/tdbTxn.h index 88d469ac34ef9f89a3a36989dfa36517d71abe68..06b31879de0410fab88b389aee85b2c721f8eba4 100644 --- a/source/libs/tdb/src/inc/tdbTxn.h +++ b/source/libs/tdb/src/inc/tdbTxn.h @@ -28,9 +28,9 @@ struct STxn { void *xArg; }; -int tdbTxnBegin(STEnv *pEnv); -int tdbTxnCommit(STEnv *pEnv); -int tdbTxnRollback(STEnv *pEnv); +int tdbTxnBegin(TEnv *pEnv); +int tdbTxnCommit(TEnv *pEnv); +int tdbTxnRollback(TEnv *pEnv); #ifdef __cplusplus } diff --git a/source/libs/tdb/test/tdbTest.cpp b/source/libs/tdb/test/tdbTest.cpp index 19d61a6cdf3634e59576cd68619cdcbd1b189ab9..f4a170f2c06c883a0e9d27577c914746a1058650 100644 --- a/source/libs/tdb/test/tdbTest.cpp +++ b/source/libs/tdb/test/tdbTest.cpp @@ -115,7 +115,7 @@ static int tDefaultKeyCmpr(const void *pKey1, int keyLen1, const void *pKey2, in TEST(tdb_test, simple_test) { int ret; - STEnv *pEnv; + TEnv *pEnv; TDB *pDb; FKeyComparator compFunc; int nData = 1000000;