summaryrefslogtreecommitdiff
path: root/plugins/Db3x/src/dbintf3x.h
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-23 21:15:40 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-23 21:15:40 +0000
commit75115d35a7477110938f056a18edbbd43ac9a840 (patch)
treecfa7e4e8e532300542cd7ab86685aa14e4945018 /plugins/Db3x/src/dbintf3x.h
parent4352098913e5f363baafcd3bfd2aa1afce9a3052 (diff)
db3x, finally
git-svn-id: http://svn.miranda-ng.org/main/trunk@1144 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x/src/dbintf3x.h')
-rw-r--r--plugins/Db3x/src/dbintf3x.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/plugins/Db3x/src/dbintf3x.h b/plugins/Db3x/src/dbintf3x.h
new file mode 100644
index 0000000000..74dad4c4a8
--- /dev/null
+++ b/plugins/Db3x/src/dbintf3x.h
@@ -0,0 +1,74 @@
+/*
+
+Miranda NG: the free IM client for Microsoft* Windows*
+
+Copyright 2012 Miranda NG 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
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include <m_db_int.h>
+
+#include "..\..\Db3x_mmap\src\database.h"
+#include "..\..\Db3x_mmap\src\dbintf.h"
+
+#define CACHESECTIONSIZE 4096
+#define CACHESECTIONCOUNT 32
+
+#define SETTINGSGROUPOFSCOUNT 32
+
+struct CDb3x : public CDb3Base
+{
+ CDb3x(const TCHAR* tszFileName);
+ ~CDb3x();
+
+ __inline HANDLE getFile() const { return m_hDbFile; }
+
+protected:
+ virtual DWORD GetSettingsGroupOfsByModuleNameOfs(DBContact *dbc,DWORD ofsContact,DWORD ofsModuleName);
+ virtual void DBMoveChunk(DWORD ofsDest, DWORD ofsSource, int bytes);
+ virtual PBYTE DBRead(DWORD ofs, int bytesRequired, int *bytesAvail);
+ virtual void DBWrite(DWORD ofs, PVOID pData, int bytes);
+ virtual void DBFill(DWORD ofs, int bytes);
+ virtual void DBFlush(int setting);
+ virtual int InitCache(void);
+
+ PBYTE m_pDbCache;
+ DWORD m_lastUseCounter;
+
+ struct DBCacheSectionInfo
+ {
+ DWORD ofsBase;
+ DWORD lastUsed;
+ }
+ cacheSectionInfo[CACHESECTIONCOUNT];
+
+ int nextSGOCacheEntry;
+ struct SettingsGroupOfsCacheEntry {
+ DWORD ofsContact;
+ DWORD ofsModuleName;
+ DWORD ofsSettingsGroup;
+ }
+ settingsGroupOfsCache[SETTINGSGROUPOFSCOUNT];
+
+ int FindSectionForOffset(const DWORD ofs);
+ int FindLRUSection(void);
+ void LoadSection(const int i,DWORD ofs);
+ void MoveSection(int *sectId,int dest);
+
+ void InvalidateSettingsGroupOfsCacheEntry(DWORD ofsSettingsGroup);
+};