summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdb/src/dbintf.h
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-01-18 21:14:32 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-01-18 21:14:32 +0000
commit78b13a92fb3bbc7d7ae3cc31e84a99758e392d4d (patch)
treeaf3d3f950b58cebd79f35249986b1ed878707fd1 /plugins/Dbx_mdb/src/dbintf.h
parentffed014ccd5370a5073594d55dd0dc88080e0b3d (diff)
bunch of small fixes, optimizations and improvements
git-svn-id: http://svn.miranda-ng.org/main/trunk@11874 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, 16 insertions, 10 deletions
diff --git a/plugins/Dbx_mdb/src/dbintf.h b/plugins/Dbx_mdb/src/dbintf.h
index ea3d2feb0f..5590b44c09 100644
--- a/plugins/Dbx_mdb/src/dbintf.h
+++ b/plugins/Dbx_mdb/src/dbintf.h
@@ -65,16 +65,15 @@ struct ModuleName
#define DBHEADER_SIGNATURE 0x40DECADEu
struct DBHeader
{
- DWORD signature;
+ DWORD dwSignature;
DWORD dwVersion; // database format version
- DWORD eventCount; // number of events in the chain for this contact
};
#define DBCONTACT_SIGNATURE 0x43DECADEu
struct DBContact
{
- DWORD signature;
- DWORD eventCount; // number of events in the chain for this contact
+ DWORD dwSignature;
+ DWORD dwEventCount; // number of events in the chain for this contact
DWORD tsFirstUnread;
DWORD dwFirstUnread;
};
@@ -82,7 +81,7 @@ struct DBContact
#define DBMODULENAME_SIGNATURE 0x4DDECADEu
struct DBModuleName
{
- DWORD signature;
+ DWORD dwSignature;
BYTE cbName; // number of characters in this module name
char name[1]; // name, no nul terminator
};
@@ -90,7 +89,7 @@ struct DBModuleName
#define DBEVENT_SIGNATURE 0x45DECADEu
struct DBEvent
{
- DWORD signature;
+ DWORD dwSignature;
MCONTACT contactID; // a contact this event belongs to
DWORD ofsModuleName; // offset to a DBModuleName struct of the name of
DWORD timestamp; // seconds since 00:00:00 01/01/1970
@@ -106,11 +105,16 @@ struct DBEvent
#include <poppack.h>
+struct DBEventSortingKey
+{
+ DWORD dwContactId, ts, dwEventId;
+};
+
struct DBCachedContact : public DBCachedContactBase
{
- DWORD dwEventCount;
- DWORD tsFirstUnread;
- DWORD dwFirstUnread;
+ void Advance(DWORD id, DBEvent &dbe);
+
+ DBContact dbc;
};
struct CDbxMdb : public MIDatabase, public MIDatabaseChecker, public MZeroedObject
@@ -241,6 +245,8 @@ protected:
MDB_dbi m_dbEvents, m_dbEventsSort;
DWORD m_dwMaxEventId;
+ void FindNextUnread(const txn_ptr &_txn, DBCachedContact *cc, DBEventSortingKey &key2);
+
////////////////////////////////////////////////////////////////////////////
// modules
@@ -264,7 +270,7 @@ protected:
int PeekSegment(DWORD ofs, PVOID buf, int cbBytes);
int ReadSegment(DWORD ofs, PVOID buf, int cbBytes);
int ReadWrittenSegment(DWORD ofs, PVOID buf, int cbBytes);
- int SignatureValid(DWORD ofs, DWORD signature);
+ int SignatureValid(DWORD ofs, DWORD dwSignature);
void FreeModuleChain();
DWORD ConvertModuleNameOfs(DWORD ofsOld);