diff options
Diffstat (limited to 'plugins/Dbx_mdb')
-rw-r--r-- | plugins/Dbx_mdb/Dbx_mdb_10.vcxproj | 36 | ||||
-rw-r--r-- | plugins/Dbx_mdb/Dbx_mdb_10.vcxproj.filters | 52 | ||||
-rw-r--r-- | plugins/Dbx_mdb/Dbx_mdb_12.vcxproj | 2 | ||||
-rw-r--r-- | plugins/Dbx_mdb/Dbx_mdb_12.vcxproj.filters | 6 | ||||
-rw-r--r-- | plugins/Dbx_mdb/src/commonheaders.h | 1 | ||||
-rw-r--r-- | plugins/Dbx_mdb/src/database.cpp | 58 | ||||
-rw-r--r-- | plugins/Dbx_mdb/src/database.h | 71 | ||||
-rw-r--r-- | plugins/Dbx_mdb/src/dbevents.cpp | 2 | ||||
-rw-r--r-- | plugins/Dbx_mdb/src/dbsettings.cpp | 8 | ||||
-rw-r--r-- | plugins/Dbx_mdb/src/lmdb/mdb.c | 1 |
10 files changed, 23 insertions, 214 deletions
diff --git a/plugins/Dbx_mdb/Dbx_mdb_10.vcxproj b/plugins/Dbx_mdb/Dbx_mdb_10.vcxproj index ca64db1780..497ca271ce 100644 --- a/plugins/Dbx_mdb/Dbx_mdb_10.vcxproj +++ b/plugins/Dbx_mdb/Dbx_mdb_10.vcxproj @@ -191,41 +191,20 @@ </Link>
</ItemDefinitionGroup>
<ItemGroup>
- <ClCompile Include="src\database.cpp" />
<ClCompile Include="src\dbcache.cpp" />
<ClCompile Include="src\dbcontacts.cpp" />
<ClCompile Include="src\dbcrypt.cpp" />
<ClCompile Include="src\dbevents.cpp" />
- <ClCompile Include="src\dbheaders.cpp" />
<ClCompile Include="src\dbintf.cpp" />
<ClCompile Include="src\dbmodulechain.cpp" />
<ClCompile Include="src\dbsettings.cpp" />
- <ClCompile Include="src\dbtool\aggressive.cpp">
- <PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
+ <ClCompile Include="src\lmdb\mdb.c">
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
- <ClCompile Include="src\dbtool\contactchain.cpp">
- <PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
- </ClCompile>
- <ClCompile Include="src\dbtool\disk.cpp">
- <PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
- </ClCompile>
- <ClCompile Include="src\dbtool\eventchain.cpp">
- <PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
- </ClCompile>
- <ClCompile Include="src\dbtool\finaltasks.cpp">
- <PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
- </ClCompile>
- <ClCompile Include="src\dbtool\initialchecks.cpp">
- <PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
- </ClCompile>
- <ClCompile Include="src\dbtool\modulechain.cpp">
- <PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
- </ClCompile>
- <ClCompile Include="src\dbtool\settingschain.cpp">
- <PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
- </ClCompile>
- <ClCompile Include="src\dbtool\user.cpp">
- <PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
+ <ClCompile Include="src\lmdb\midl.c">
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="src\stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
@@ -235,8 +214,9 @@ </ItemGroup>
<ItemGroup>
<ClInclude Include="src\commonheaders.h" />
- <ClInclude Include="src\database.h" />
<ClInclude Include="src\dbintf.h" />
+ <ClInclude Include="src\lmdb\lmdb.h" />
+ <ClInclude Include="src\lmdb\midl.h" />
<ClInclude Include="src\resource.h" />
<ClInclude Include="src\version.h" />
</ItemGroup>
diff --git a/plugins/Dbx_mdb/Dbx_mdb_10.vcxproj.filters b/plugins/Dbx_mdb/Dbx_mdb_10.vcxproj.filters index ce3f5306cb..ebf91d5a29 100644 --- a/plugins/Dbx_mdb/Dbx_mdb_10.vcxproj.filters +++ b/plugins/Dbx_mdb/Dbx_mdb_10.vcxproj.filters @@ -13,14 +13,11 @@ <UniqueIdentifier>{e5e10389-c0d7-4cf8-8442-6714f0d5aff1}</UniqueIdentifier>
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
</Filter>
- <Filter Include="Source Files\Checker">
- <UniqueIdentifier>{18e1a858-92e5-48e6-98f1-e08f4b562ea8}</UniqueIdentifier>
+ <Filter Include="Source Files\lmdb">
+ <UniqueIdentifier>{98bf8a14-03b2-466e-b9fc-564f91ef0ee2}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
- <ClCompile Include="src\database.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\dbcache.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -33,9 +30,6 @@ <ClCompile Include="src\dbevents.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\dbheaders.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\dbintf.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -48,47 +42,23 @@ <ClCompile Include="src\init.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\dbtool\aggressive.cpp">
- <Filter>Source Files\Checker</Filter>
- </ClCompile>
- <ClCompile Include="src\dbtool\contactchain.cpp">
- <Filter>Source Files\Checker</Filter>
- </ClCompile>
- <ClCompile Include="src\dbtool\eventchain.cpp">
- <Filter>Source Files\Checker</Filter>
- </ClCompile>
- <ClCompile Include="src\dbtool\finaltasks.cpp">
- <Filter>Source Files\Checker</Filter>
- </ClCompile>
- <ClCompile Include="src\dbtool\initialchecks.cpp">
- <Filter>Source Files\Checker</Filter>
- </ClCompile>
- <ClCompile Include="src\dbtool\modulechain.cpp">
- <Filter>Source Files\Checker</Filter>
- </ClCompile>
- <ClCompile Include="src\dbtool\settingschain.cpp">
- <Filter>Source Files\Checker</Filter>
- </ClCompile>
- <ClCompile Include="src\dbtool\user.cpp">
- <Filter>Source Files\Checker</Filter>
- </ClCompile>
- <ClCompile Include="src\dbtool\disk.cpp">
- <Filter>Source Files\Checker</Filter>
- </ClCompile>
<ClCompile Include="src\stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\ui.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="src\lmdb\mdb.c">
+ <Filter>Source Files\lmdb</Filter>
+ </ClCompile>
+ <ClCompile Include="src\lmdb\midl.c">
+ <Filter>Source Files\lmdb</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\commonheaders.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="src\database.h">
- <Filter>Header Files</Filter>
- </ClInclude>
<ClInclude Include="src\dbintf.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -98,6 +68,12 @@ <ClInclude Include="src\version.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="src\lmdb\lmdb.h">
+ <Filter>Source Files\lmdb</Filter>
+ </ClInclude>
+ <ClInclude Include="src\lmdb\midl.h">
+ <Filter>Source Files\lmdb</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\dbx_mdb.rc">
diff --git a/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj b/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj index 60c5538d50..524802fcdc 100644 --- a/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj +++ b/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj @@ -198,7 +198,6 @@ </Link>
</ItemDefinitionGroup>
<ItemGroup>
- <ClCompile Include="src\database.cpp" />
<ClCompile Include="src\dbcontacts.cpp" />
<ClCompile Include="src\dbcrypt.cpp" />
<ClCompile Include="src\dbevents.cpp" />
@@ -225,7 +224,6 @@ </ItemGroup>
<ItemGroup>
<ClInclude Include="src\commonheaders.h" />
- <ClInclude Include="src\database.h" />
<ClInclude Include="src\dbintf.h" />
<ClInclude Include="src\lmdb\lmdb.h" />
<ClInclude Include="src\lmdb\midl.h" />
diff --git a/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj.filters b/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj.filters index 101dd06651..4b988cea86 100644 --- a/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj.filters +++ b/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj.filters @@ -18,9 +18,6 @@ </Filter>
</ItemGroup>
<ItemGroup>
- <ClCompile Include="src\database.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\dbcontacts.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -59,9 +56,6 @@ <ClInclude Include="src\commonheaders.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="src\database.h">
- <Filter>Header Files</Filter>
- </ClInclude>
<ClInclude Include="src\dbintf.h">
<Filter>Header Files</Filter>
</ClInclude>
diff --git a/plugins/Dbx_mdb/src/commonheaders.h b/plugins/Dbx_mdb/src/commonheaders.h index 3daf109bef..c9f9d4b44d 100644 --- a/plugins/Dbx_mdb/src/commonheaders.h +++ b/plugins/Dbx_mdb/src/commonheaders.h @@ -48,7 +48,6 @@ extern "C" #include "lmdb\lmdb.h"
};
-#include "database.h"
#include "dbintf.h"
#include "resource.h"
#include "version.h"
diff --git a/plugins/Dbx_mdb/src/database.cpp b/plugins/Dbx_mdb/src/database.cpp deleted file mode 100644 index 5573fe925c..0000000000 --- a/plugins/Dbx_mdb/src/database.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/*
-
-Miranda NG: the free IM client for Microsoft* Windows*
-
-Copyright (ñ) 2012-15 Miranda NG project (http://miranda-ng.org)
-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 "commonheaders.h"
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-#ifdef DBLOGGING
-char* printVariant(DBVARIANT* p)
-{
- static char boo[1000];
-
- switch (p->type) {
- case DBVT_BYTE: mir_snprintf(boo, SIZEOF(boo), "byte: %d", p->bVal ); break;
- case DBVT_WORD: mir_snprintf(boo, SIZEOF(boo), "word: %d", p->wVal ); break;
- case DBVT_DWORD: mir_snprintf(boo, SIZEOF(boo), "dword: %d", p->dVal ); break;
- case DBVT_UTF8:
- case DBVT_ASCIIZ: mir_snprintf(boo, SIZEOF(boo), "string: '%s'", p->pszVal); break;
- case DBVT_DELETED: strcpy(boo, "deleted"); break;
- default: mir_snprintf(boo, SIZEOF(boo), "crap: %d", p->type ); break;
- }
- return boo;
-}
-
-void DBLog(const char *file,int line,const char *fmt,...)
-{
- FILE *fp;
- va_list vararg;
- char str[1024];
-
- va_start(vararg,fmt);
- mir_vsnprintf(str,sizeof(str),fmt,vararg);
- va_end(vararg);
- fp=fopen("c:\\mirandadatabase.log.txt","at");
- fprintf(fp,"%u: %s %d: %s\n",GetTickCount(),file,line,str);
- fclose(fp);
-}
-#endif
diff --git a/plugins/Dbx_mdb/src/database.h b/plugins/Dbx_mdb/src/database.h deleted file mode 100644 index 180620e6fd..0000000000 --- a/plugins/Dbx_mdb/src/database.h +++ /dev/null @@ -1,71 +0,0 @@ -/*
-
-Miranda NG: the free IM client for Microsoft* Windows*
-
-Copyright (ñ) 2012-15 Miranda NG project (http://miranda-ng.org)
-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.
-*/
-
-
-//all offsets are relative to the start of the file
-//offsets are 0 if there is nothing in the chain or this is the last in the
-//chain
-
-/* tree diagram
-
-DBHeader
-|-->end of file (plain offset)
-|-->first contact (DBContact)
-| |-->next contact (DBContact)
-| | \--> ...
-| |-->first settings (DBContactSettings)
-| | |-->next settings (DBContactSettings)
-| | | \--> ...
-| | \-->module name (DBModuleName)
-| \-->first/last/firstunread event
-|-->user contact (DBContact)
-| |-->next contact = NULL
-| |-->first settings as above
-| \-->first/last/firstunread event as above
-\-->first module name (DBModuleName)
-\-->next module name (DBModuleName)
-\--> ...
-*/
-
-//#define DBLOGGING
-
-#ifdef _DEBUG
-//#define DBLOGGING
-#endif
-#ifdef DBLOGGING
-char* printVariant(DBVARIANT* p);
-void DBLog(const char *file,int line,const char *fmt,...);
-#define logg() DBLog(__FILE__,__LINE__,"")
-#define log0(s) DBLog(__FILE__,__LINE__,s)
-#define log1(s,a) DBLog(__FILE__,__LINE__,s,a)
-#define log2(s,a,b) DBLog(__FILE__,__LINE__,s,a,b)
-#define log3(s,a,b,c) DBLog(__FILE__,__LINE__,s,a,b,c)
-#define log4(s,a,b,c,d) DBLog(__FILE__,__LINE__,s,a,b,c,d)
-#else
-#define logg()
-#define log0(s)
-#define log1(s,a)
-#define log2(s,a,b)
-#define log3(s,a,b,c)
-#define log4(s,a,b,c,d)
-#endif
diff --git a/plugins/Dbx_mdb/src/dbevents.cpp b/plugins/Dbx_mdb/src/dbevents.cpp index dc9638b3dd..6b7085575c 100644 --- a/plugins/Dbx_mdb/src/dbevents.cpp +++ b/plugins/Dbx_mdb/src/dbevents.cpp @@ -81,8 +81,6 @@ STDMETHODIMP_(HANDLE) CDbxMdb::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei) lck.unlock();
- log1("add event @ %08x", ofsNew);
-
// Notify only in safe mode or on really new events
NotifyEventHooks(hEventAddedEvent, contactNotifyID, (LPARAM)-1);
diff --git a/plugins/Dbx_mdb/src/dbsettings.cpp b/plugins/Dbx_mdb/src/dbsettings.cpp index 375b973c7e..f8b307936f 100644 --- a/plugins/Dbx_mdb/src/dbsettings.cpp +++ b/plugins/Dbx_mdb/src/dbsettings.cpp @@ -81,7 +81,6 @@ int CDbxMdb::GetContactSettingWorker(MCONTACT contactID, LPCSTR szModule, LPCSTR LBL_Seek:
char *szCachedSettingName = m_cache->GetCachedSetting(szModule, szSetting, moduleNameLen, settingNameLen);
- log3("get [%08p] %s (%p)", hContact, szCachedSettingName, szCachedSettingName);
DBVARIANT *pCachedValue = m_cache->GetCachedValuePtr(contactID, szCachedSettingName, 0);
if (pCachedValue != NULL) {
@@ -109,7 +108,6 @@ LBL_Seek: }
else memcpy(dbv, pCachedValue, sizeof(DBVARIANT));
- log2("get cached %s (%p)", printVariant(dbv), pCachedValue);
return (pCachedValue->type == DBVT_DELETED) ? 1 : 0;
}
@@ -223,10 +221,8 @@ LBL_Seek: /**** add to cache **********************/
if (iType != DBVT_BLOB && iType != DBVT_ENCRYPTED) {
DBVARIANT *pCachedValue = m_cache->GetCachedValuePtr(contactID, szCachedSettingName, 1);
- if (pCachedValue != NULL) {
+ if (pCachedValue != NULL)
m_cache->SetCachedVariant(dbv, pCachedValue);
- log3("set cached [%08p] %s (%p)", hContact, szCachedSettingName, pCachedValue);
- }
}
return 0;
@@ -444,7 +440,6 @@ STDMETHODIMP_(BOOL) CDbxMdb::WriteContactSetting(MCONTACT contactID, DBCONTACTWR mir_cslockfull lck(m_csDbAccess);
char *szCachedSettingName = m_cache->GetCachedSetting(dbcwWork.szModule, dbcwWork.szSetting, moduleNameLen, settingNameLen);
- log3("set [%08p] %s (%p)", hContact, szCachedSettingName, szCachedSettingName);
// we don't cache blobs and passwords
if (dbcwWork.value.type != DBVT_BLOB && dbcwWork.value.type != DBVT_ENCRYPTED && !bIsEncrypted) {
@@ -466,7 +461,6 @@ STDMETHODIMP_(BOOL) CDbxMdb::WriteContactSetting(MCONTACT contactID, DBCONTACTWR }
if (szCachedSettingName[-1] != 0) {
lck.unlock();
- log2(" set resident as %s (%p)", printVariant(&dbcwWork.value), pCachedValue);
NotifyEventHooks(hSettingChangeEvent, contactID, (LPARAM)&dbcwWork);
return 0;
}
diff --git a/plugins/Dbx_mdb/src/lmdb/mdb.c b/plugins/Dbx_mdb/src/lmdb/mdb.c index f7216726f0..2ab6bda0c5 100644 --- a/plugins/Dbx_mdb/src/lmdb/mdb.c +++ b/plugins/Dbx_mdb/src/lmdb/mdb.c @@ -97,7 +97,6 @@ extern int cacheflush(char *addr, int nbytes, int cache); #include <errno.h> #include <limits.h> #include <stddef.h> -#include <inttypes.h> #include <stdio.h> #include <stdlib.h> #include <string.h> |