summaryrefslogtreecommitdiff
path: root/db3x_autobackups/database.h
diff options
context:
space:
mode:
authorsje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-07-27 15:27:25 +0000
committersje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-07-27 15:27:25 +0000
commit0d489da11220c272765fcc64d390be6bb50ff87f (patch)
tree98b0315bfbf8296c56127cd6574f3a84312792e7 /db3x_autobackups/database.h
parente6ccc491112a9183d7ed9249c17f5f00283b4bf5 (diff)
based on mmap
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@302 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'db3x_autobackups/database.h')
-rw-r--r--db3x_autobackups/database.h31
1 files changed, 19 insertions, 12 deletions
diff --git a/db3x_autobackups/database.h b/db3x_autobackups/database.h
index 3e09949..67ed205 100644
--- a/db3x_autobackups/database.h
+++ b/db3x_autobackups/database.h
@@ -2,8 +2,8 @@
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2003 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2003 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -47,10 +47,17 @@ DBHeader
\--> ...
*/
-#define DB_RESIZE_GRANULARITY 16384
+//#define DB_RESIZE_GRANULARITY 16384
#define DB_THIS_VERSION 0x00000700u
#define DB_SETTINGS_RESIZE_GRANULARITY 128
+struct DBSignature {
+ char name[15];
+ BYTE eof;
+};
+
+static struct DBSignature dbSignature={"Miranda ICQ DB",0x1A};
+
#include <pshpack1.h>
struct DBHeader {
BYTE signature[16]; // 'Miranda ICQ DB',0,26
@@ -167,19 +174,21 @@ typedef struct
HANDLE hContact;
HANDLE hNext;
DBCachedContactValue* first;
+ DBCachedContactValue* last;
}
DBCachedContactValueList;
-
-//databasecorruption: called if any signatures are broken. very very fatal
-void DatabaseCorruption(void);
+//databasecorruption: with NULL called if any signatures are broken. very very fatal
+void DatabaseCorruption(char *text);
PBYTE DBRead(DWORD ofs,int bytesRequired,int *bytesAvail); //any preview result could be invalidated by the next call
void DBWrite(DWORD ofs,PVOID pData,int count);
+void DBFill(DWORD ofs,int bytes);
void DBFlush(int setting);
void DBMoveChunk(DWORD ofsDest,DWORD ofsSource,int bytes);
DWORD CreateNewSpace(int bytes);
void DeleteSpace(DWORD ofs,int bytes);
-int GetProfileDirectory(char *szPath,int cbPath);
+DWORD ReallocSpace(DWORD ofs,int oldSize,int newSize);
+//void GetProfileDirectory(char *szPath,int cbPath);
int GetDefaultProfilePath(char *szPath,int cbPath,int *specified);
int ShouldShowProfileManager(void);
int CheckDbHeaders(struct DBHeader * hdr);
@@ -187,11 +196,9 @@ int CreateDbHeaders(HANDLE hFile);
int LoadDatabaseModule(void);
void UnloadDatabaseModule(void);
-#ifdef _DEBUG
-#define MAXCACHEDREADSIZE 512
-#else
-#define MAXCACHEDREADSIZE 2048 //push it to 1K //technically 4096 would work, but I'm not going to push it
-#endif
+#define MAXCACHEDREADSIZE 65536
+
+//#define DBLOGGING
#ifdef _DEBUG
//#define DBLOGGING