summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mmap_SA/database.h
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-18 14:11:28 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-18 14:11:28 +0000
commit4bc88d46fa9859615521f436511d4f102f20eb67 (patch)
tree3a6ee91b74be2a4f5e60520885aa601c74bc3fa7 /plugins/Dbx_mmap_SA/database.h
parent4f8f5427687792492ee49e06cafb9bd50cfc53d4 (diff)
databases are still static, but are controlled via classes
git-svn-id: http://svn.miranda-ng.org/main/trunk@1014 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mmap_SA/database.h')
-rw-r--r--plugins/Dbx_mmap_SA/database.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/plugins/Dbx_mmap_SA/database.h b/plugins/Dbx_mmap_SA/database.h
index 290df81723..bbacb9670a 100644
--- a/plugins/Dbx_mmap_SA/database.h
+++ b/plugins/Dbx_mmap_SA/database.h
@@ -39,7 +39,7 @@ DBHeader
| | \-->module name (DBModuleName)
| \-->first/last/firstunread event
|-->user contact (DBContact)
- | |-->next contact=NULL
+ | |-->next contact = NULL
| |-->first settings as above
| \-->first/last/firstunread event as above
\-->first module name (DBModuleName)
@@ -56,15 +56,15 @@ struct DBSignature {
BYTE eof;
};
-static struct DBSignature dbSignature={"Miranda ICQ DB",0x1A};
-static struct DBSignature dbSignatureSecured={"Miranda ICQ SD",0x1A};
+static struct DBSignature dbSignature = {"Miranda ICQ DB",0x1A};
+static struct DBSignature dbSignatureSecured = {"Miranda ICQ SD",0x1A};
#include <pshpack1.h>
struct DBHeader {
BYTE signature[16]; // 'Miranda ICQ DB',0,26
/*
- DWORD version; //as 4 bytes, ie 1.2.3.10=0x0102030a
+ DWORD version; //as 4 bytes, ie 1.2.3.10 = 0x0102030a
//this version is 0x00000700
*/
@@ -78,8 +78,8 @@ struct DBHeader {
//re-making them at the end. We should compact when
//this gets above a threshold
DWORD contactCount; //number of contacts in the chain,excluding the user
- DWORD ofsFirstContact; //offset to first struct DBContact in the chain
- DWORD ofsUser; //offset to struct DBContact representing the user
+ DWORD ofsFirstContact; //offset to first DBContact in the chain
+ DWORD ofsUser; //offset to DBContact representing the user
DWORD ofsFirstModuleName; //offset to first struct DBModuleName in the chain
};
@@ -117,13 +117,13 @@ struct DBContactSettings {
//actual size for reducing the number of moves
//required using granularity in resizing
BYTE blob[1]; //the blob. a back-to-back sequence of DBSetting
- //structs, the last has cbName=0
+ //structs, the last has cbName = 0
};
/* not a valid structure, content is figured out on the fly
struct DBSetting {
BYTE cbName; //number of bytes in the name of this setting
- //this =0 marks the end
+ //this = 0 marks the end
char szName[...]; //setting name, excluding nul
BYTE dataType; //type of data. see m_database.h, db/contact/getsetting
union { //a load of types of data, length is defined by dataType
@@ -189,6 +189,9 @@ typedef struct
//databasecorruption: with NULL called if any signatures are broken. very very fatal
void DatabaseCorruption(TCHAR *text);
PBYTE DBRead(DWORD ofs,int bytesRequired,int *bytesAvail); //any preview result could be invalidated by the next call
+__forceinline PBYTE DBRead(HANDLE hContact,int bytesRequired,int *bytesAvail)
+{ return DBRead((DWORD)hContact, bytesRequired, bytesAvail);
+}
void DBWrite(DWORD ofs,PVOID pData,int count);
void DBFill(DWORD ofs,int bytes);
void DBFlush(int setting);