From 7b8b7fa685ea5de62002d5637b4c34e19dfedeee Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 7 Feb 2014 14:08:15 +0000 Subject: - the internal DBContact structure extended to hold one more DWORD: contact ID; - when called from dbchecker, mmap now refuses to check the old versions of database; - old classes hierarchy removed, all classes were merged into one due to the death of db3x & mmap_sa; - version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@8061 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/dbcache.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'plugins/Db3x_mmap/src/dbcache.cpp') diff --git a/plugins/Db3x_mmap/src/dbcache.cpp b/plugins/Db3x_mmap/src/dbcache.cpp index b91362bf3b..c0bf00e738 100644 --- a/plugins/Db3x_mmap/src/dbcache.cpp +++ b/plugins/Db3x_mmap/src/dbcache.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h" -void CDb3Base::Map() +void CDb3Mmap::Map() { DWORD dwProtectMode, dwAccess; if (cb && cb->bAggressive) @@ -42,7 +42,7 @@ void CDb3Base::Map() else DatabaseCorruption( _T("%s (CreateFileMapping failed. Code: %d)")); } -void CDb3Base::ReMap(DWORD needed) +void CDb3Mmap::ReMap(DWORD needed) { KillTimer(NULL,m_flushBuffersTimerId); @@ -67,7 +67,7 @@ void CDb3Base::ReMap(DWORD needed) Map(); } -void CDb3Base::DBMoveChunk(DWORD ofsDest, DWORD ofsSource, int bytes) +void CDb3Mmap::DBMoveChunk(DWORD ofsDest, DWORD ofsSource, int bytes) { int x = 0; //log3("move %d %08x->%08x",bytes,ofsSource,ofsDest); @@ -85,7 +85,7 @@ void CDb3Base::DBMoveChunk(DWORD ofsDest, DWORD ofsSource, int bytes) } //we are assumed to be in a mutex here -PBYTE CDb3Base::DBRead(DWORD ofs, int bytesRequired, int *bytesAvail) +PBYTE CDb3Mmap::DBRead(DWORD ofs, int bytesRequired, int *bytesAvail) { // buggy read if (ofs >= m_dwFileSize) { @@ -99,7 +99,7 @@ PBYTE CDb3Base::DBRead(DWORD ofs, int bytesRequired, int *bytesAvail) } //we are assumed to be in a mutex here -void CDb3Base::DBWrite(DWORD ofs, PVOID pData, int bytes) +void CDb3Mmap::DBWrite(DWORD ofs, PVOID pData, int bytes) { //log2("write %d@%08x",bytes,ofs); if (ofs+bytes > m_dwFileSize) ReMap(ofs+bytes-m_dwFileSize); @@ -108,7 +108,7 @@ void CDb3Base::DBWrite(DWORD ofs, PVOID pData, int bytes) } //we are assumed to be in a mutex here -void CDb3Base::DBFill(DWORD ofs, int bytes) +void CDb3Mmap::DBFill(DWORD ofs, int bytes) { //log2("zerofill %d@%08x",bytes,ofs); if (ofs+bytes <= m_dwFileSize) @@ -119,7 +119,7 @@ void CDb3Base::DBFill(DWORD ofs, int bytes) static VOID CALLBACK DoBufferFlushTimerProc(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime) { for (int i=0; i < g_Dbs.getCount(); i++) { - CDb3Base *db = g_Dbs[i]; + CDb3Mmap *db = g_Dbs[i]; if (db->m_flushBuffersTimerId != idEvent) continue; @@ -139,7 +139,7 @@ static VOID CALLBACK DoBufferFlushTimerProc(HWND hwnd, UINT message, UINT_PTR id } } -void CDb3Base::DBFlush(int setting) +void CDb3Mmap::DBFlush(int setting) { if (!setting) { log0("nflush1"); @@ -160,7 +160,7 @@ void CDb3Base::DBFlush(int setting) m_flushBuffersTimerId = SetTimer(NULL, m_flushBuffersTimerId, 50, DoBufferFlushTimerProc); } -int CDb3Base::InitCache(void) +int CDb3Mmap::InitMap(void) { m_dwFileSize = GetFileSize(m_hDbFile, NULL); @@ -178,7 +178,7 @@ int CDb3Base::InitCache(void) return 0; } -DWORD CDb3Base::GetSettingsGroupOfsByModuleNameOfs(DBContact *dbc, DWORD ofsContact, DWORD ofsModuleName) +DWORD CDb3Mmap::GetSettingsGroupOfsByModuleNameOfs(DBContact *dbc, DWORD ofsContact, DWORD ofsModuleName) { DWORD ofsThis = dbc->ofsFirstSettings; while (ofsThis) { -- cgit v1.2.3