summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdb/src/dbintf.h
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-07-03 17:19:54 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-07-03 17:19:54 +0000
commited204fe350540966e492859c9f9c734b6b9f1cde (patch)
tree33be33ad2c5e903ca037fdeef82e1e4b2a9a4b62 /plugins/Dbx_mdb/src/dbintf.h
parentbe556ddb9cca86b4242781761019da7ba6a537d0 (diff)
dbx_lmdb: code optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@17057 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb/src/dbintf.h')
-rw-r--r--plugins/Dbx_mdb/src/dbintf.h26
1 files changed, 8 insertions, 18 deletions
diff --git a/plugins/Dbx_mdb/src/dbintf.h b/plugins/Dbx_mdb/src/dbintf.h
index 5aeadf3488..51ee91ed64 100644
--- a/plugins/Dbx_mdb/src/dbintf.h
+++ b/plugins/Dbx_mdb/src/dbintf.h
@@ -35,15 +35,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MARKED_READ (DBEF_READ | DBEF_SENT)
-struct ModuleName
-{
- DWORD dwId;
- char szName[];
-};
-
#include <pshpack1.h>
-#define DBHEADER_VERSION MAKELONG(1, 2)
+#define DBHEADER_VERSION MAKELONG(1, 3)
#define DBHEADER_SIGNATURE 0x40DECADEu
struct DBHeader
@@ -124,8 +118,6 @@ struct EventItem
DWORD eventId;
};
-class LMDBEventCursor;
-
struct CDbxMdb : public MIDatabase, public MIDatabaseChecker, public MZeroedObject
{
friend class LMDBEventCursor;
@@ -216,7 +208,7 @@ public:
protected:
MDB_env *m_pMdbEnv;
- MDB_txn *m_txn;
+ TXN_RO m_txn;
DWORD m_dwFileSize;
MDB_dbi m_dbGlobal;
DBHeader m_header;
@@ -261,19 +253,17 @@ protected:
MDB_dbi m_dbModules;
MDB_cursor *m_curModules;
+
+ std::map<DWORD, std::string> m_Modules;
- HANDLE m_hModHeap;
- LIST<ModuleName> m_lMods, m_lOfs;
LIST<char> m_lResidentSettings;
HANDLE hEventAddedEvent, hEventDeletedEvent, hEventFilterAddedEvent;
MCONTACT m_hLastCachedContact;
- DWORD m_maxModuleID;
- void AddToList(const char *name, DWORD ofs);
- DWORD FindExistingModuleNameOfs(const char *szName);
- int InitModuleNames(void);
- DWORD GetModuleNameOfs(const char *szName);
- char* GetModuleNameByOfs(DWORD ofs);
+ int InitModules();
+
+ DWORD GetModuleID(const char *szName);
+ char* GetModuleName(DWORD dwId);
int GetContactSettingWorker(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv, int isStatic);