summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdb/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Dbx_mdb/src')
-rw-r--r--plugins/Dbx_mdb/src/commonheaders.h1
-rw-r--r--plugins/Dbx_mdb/src/database.cpp58
-rw-r--r--plugins/Dbx_mdb/src/database.h71
-rw-r--r--plugins/Dbx_mdb/src/dbevents.cpp2
-rw-r--r--plugins/Dbx_mdb/src/dbsettings.cpp8
-rw-r--r--plugins/Dbx_mdb/src/lmdb/mdb.c1
6 files changed, 1 insertions, 140 deletions
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>