summaryrefslogtreecommitdiff
path: root/src/mir_core
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-18 14:11:28 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-18 14:11:28 +0000
commit4bc88d46fa9859615521f436511d4f102f20eb67 (patch)
tree3a6ee91b74be2a4f5e60520885aa601c74bc3fa7 /src/mir_core
parent4f8f5427687792492ee49e06cafb9bd50cfc53d4 (diff)
databases are still static, but are controlled via classes
git-svn-id: http://svn.miranda-ng.org/main/trunk@1014 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/mir_core')
-rw-r--r--src/mir_core/commonheaders.h1
-rw-r--r--src/mir_core/db.cpp7
2 files changed, 8 insertions, 0 deletions
diff --git a/src/mir_core/commonheaders.h b/src/mir_core/commonheaders.h
index 2d04e12f4b..5afcda256e 100644
--- a/src/mir_core/commonheaders.h
+++ b/src/mir_core/commonheaders.h
@@ -55,6 +55,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_system.h>
#include <m_system_cpp.h>
#include <m_database.h>
+#include <m_db_int.h>
#include <newpluginapi.h>
#include "miranda.h"
diff --git a/src/mir_core/db.cpp b/src/mir_core/db.cpp
index af6a89537f..36902702ff 100644
--- a/src/mir_core/db.cpp
+++ b/src/mir_core/db.cpp
@@ -23,6 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "commonheaders.h"
+static MIDatabase* currDb = NULL;
+
MIR_CORE_DLL(int) db_get_b(HANDLE hContact, const char *szModule, const char *szSetting, int errorValue)
{
DBVARIANT dbv;
@@ -202,3 +204,8 @@ MIR_CORE_DLL(INT_PTR) db_set_blob(HANDLE hContact, const char *szModule, const c
cws.value.pbVal = (unsigned char*)val;
return CallService(MS_DB_CONTACT_WRITESETTING, (WPARAM)hContact, (LPARAM)&cws);
}
+
+MIR_CORE_DLL(void) db_setCurrent(MIDatabase* _db)
+{
+ currDb = _db;
+}