summaryrefslogtreecommitdiff
path: root/src/modules/database/dbintf.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-10-03 18:27:17 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-10-03 18:27:17 +0000
commit8cb2a99e08a3f8fadc3b39f00228efa7d2b20050 (patch)
tree65576462073546d462936d7ad8a2aa3e4e6147d8 /src/modules/database/dbintf.cpp
parentd2da1f079fc61195437007882296184714d2fe54 (diff)
database cache migration, phase 1
git-svn-id: http://svn.miranda-ng.org/main/trunk@1772 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/database/dbintf.cpp')
-rw-r--r--src/modules/database/dbintf.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/modules/database/dbintf.cpp b/src/modules/database/dbintf.cpp
index 6c6371e6ec..da83e284d2 100644
--- a/src/modules/database/dbintf.cpp
+++ b/src/modules/database/dbintf.cpp
@@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "..\..\core\commonheaders.h"
+#include "database.h"
MIDatabase *currDb = NULL;
DATABASELINK *currDblink = NULL;
@@ -191,6 +192,24 @@ static INT_PTR srvGetCurrentDb(WPARAM wParam,LPARAM lParam)
return (INT_PTR)currDb;
}
+static INT_PTR srvInitInstance(WPARAM wParam,LPARAM lParam)
+{
+ MIDatabase* pDb = (MIDatabase*)lParam;
+ if (pDb != NULL)
+ pDb->m_cache = new MDatabaseCache();
+ return 0;
+}
+
+static INT_PTR srvDestroyInstance(WPARAM wParam,LPARAM lParam)
+{
+ MIDatabase* pDb = (MIDatabase*)lParam;
+ if (pDb != NULL) {
+ delete pDb->m_cache;
+ pDb->m_cache = NULL;
+ }
+ return 0;
+}
+
///////////////////////////////////////////////////////////////////////////////
int LoadDbintfModule()
@@ -232,5 +251,8 @@ int LoadDbintfModule()
CreateServiceFunction(MS_DB_REGISTER_PLUGIN, srvRegisterPlugin);
CreateServiceFunction(MS_DB_FIND_PLUGIN, srvFindPlugin);
CreateServiceFunction(MS_DB_GET_CURRENT, srvGetCurrentDb);
+
+ CreateServiceFunction(MS_DB_INIT_INSTANCE, srvInitInstance);
+ CreateServiceFunction(MS_DB_DESTROY_INSTANCE, srvDestroyInstance);
return 0;
}