diff options
author | George Hazan <george.hazan@gmail.com> | 2016-09-16 17:34:21 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-09-16 17:34:21 +0000 |
commit | cac58b5ab572889667f6e936a14f53ac6d87273a (patch) | |
tree | 4007fc8e9f76fb9f0b8b3013c91943f458ded092 | |
parent | c7c0e011ddcfed4f9c3b49637bfeb8fa0d3d5a9d (diff) |
forgotten database function
git-svn-id: http://svn.miranda-ng.org/main/trunk@17303 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | bin10/lib/mir_core.lib | bin | 305694 -> 305910 bytes | |||
-rw-r--r-- | bin10/lib/mir_core64.lib | bin | 306562 -> 306758 bytes | |||
-rw-r--r-- | bin12/lib/mir_core.lib | bin | 305694 -> 305910 bytes | |||
-rw-r--r-- | bin12/lib/mir_core64.lib | bin | 306562 -> 306758 bytes | |||
-rw-r--r-- | bin14/lib/mir_core.lib | bin | 305694 -> 305910 bytes | |||
-rw-r--r-- | bin14/lib/mir_core64.lib | bin | 306562 -> 306758 bytes | |||
-rw-r--r-- | include/m_db_int.h | 24 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/main.cpp | 2 | ||||
-rw-r--r-- | plugins/FavContacts/src/favlist.h | 2 | ||||
-rw-r--r-- | plugins/Import/src/import.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/db_intf.cpp | 6 | ||||
-rw-r--r-- | src/mir_core/src/db.cpp | 5 | ||||
-rw-r--r-- | src/mir_core/src/mir_core.def | 1 | ||||
-rw-r--r-- | src/mir_core/src/mir_core64.def | 1 |
14 files changed, 13 insertions, 30 deletions
diff --git a/bin10/lib/mir_core.lib b/bin10/lib/mir_core.lib Binary files differindex 628960dccb..51d64a242a 100644 --- a/bin10/lib/mir_core.lib +++ b/bin10/lib/mir_core.lib diff --git a/bin10/lib/mir_core64.lib b/bin10/lib/mir_core64.lib Binary files differindex e545ce6190..d1038987e6 100644 --- a/bin10/lib/mir_core64.lib +++ b/bin10/lib/mir_core64.lib diff --git a/bin12/lib/mir_core.lib b/bin12/lib/mir_core.lib Binary files differindex 628960dccb..51d64a242a 100644 --- a/bin12/lib/mir_core.lib +++ b/bin12/lib/mir_core.lib diff --git a/bin12/lib/mir_core64.lib b/bin12/lib/mir_core64.lib Binary files differindex e545ce6190..d1038987e6 100644 --- a/bin12/lib/mir_core64.lib +++ b/bin12/lib/mir_core64.lib diff --git a/bin14/lib/mir_core.lib b/bin14/lib/mir_core.lib Binary files differindex 628960dccb..51d64a242a 100644 --- a/bin14/lib/mir_core.lib +++ b/bin14/lib/mir_core.lib diff --git a/bin14/lib/mir_core64.lib b/bin14/lib/mir_core64.lib Binary files differindex e545ce6190..d1038987e6 100644 --- a/bin14/lib/mir_core64.lib +++ b/bin14/lib/mir_core64.lib diff --git a/include/m_db_int.h b/include/m_db_int.h index 81ce096276..806dc3a06f 100644 --- a/include/m_db_int.h +++ b/include/m_db_int.h @@ -222,20 +222,13 @@ struct DATABASELINK ///////////////////////////////////////////////////////////////////////////////
// cache access function
-#if defined(__cplusplus)
-extern "C"
-{
-#endif
-
-MIR_CORE_DLL(DBCachedContact*) db_get_contact(MCONTACT);
-
-#if defined(__cplusplus)
-}
-#endif
+EXTERN_C MIR_CORE_DLL(DBCachedContact*) db_get_contact(MCONTACT);
///////////////////////////////////////////////////////////////////////////////
// Database list's services
+EXTERN_C MIR_CORE_DLL(MIDatabase*) db_get_current(void);
+
// MS_DB_REGISTER_PLUGIN : registers a database plugin
// wParam : 0 (unused)
// lParam : DATABASELINK* = database link description
@@ -257,17 +250,6 @@ __forceinline DATABASELINK* FindDatabasePlugin(const wchar_t* ptszFileName) { return (DATABASELINK*)CallService(MS_DB_FIND_PLUGIN, 0, (LPARAM)ptszFileName);
}
-// MS_DB_GET_CURRENT : returns the database pointer for the current profile
-// wParam : 0 (unused)
-// lParam : 0 (unused)
-// returns MIDatabase* of the current profile or NULL on error
-
-#define MS_DB_GET_CURRENT "DB/GetCurrentDb"
-
-__forceinline MIDatabase* GetCurrentDatabase(void)
-{ return (MIDatabase*)CallService(MS_DB_GET_CURRENT, 0, 0);
-}
-
// MS_DB_INIT_INSTANCE : initializes a database instance
// wParam : 0 (unused)
// lParam : MIDatabase* = pointer to a database instance
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp index d997ab744e..045834f1ab 100644 --- a/plugins/DbEditorPP/src/main.cpp +++ b/plugins/DbEditorPP/src/main.cpp @@ -189,7 +189,7 @@ extern "C" __declspec(dllexport) int Load(void) hwnd2mainWindow = NULL;
hRestore = NULL;
- g_db = GetCurrentDatabase();
+ g_db = db_get_current();
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, DBSettingChanged);
HookEvent(ME_OPT_INITIALISE, OptInit);
diff --git a/plugins/FavContacts/src/favlist.h b/plugins/FavContacts/src/favlist.h index b111550237..b6ebc70f2e 100644 --- a/plugins/FavContacts/src/favlist.h +++ b/plugins/FavContacts/src/favlist.h @@ -94,7 +94,7 @@ private: public:
TFavContacts() : LIST<TContactInfo>(5, TContactInfo::cmp)
{
- db = GetCurrentDatabase();
+ db = db_get_current();
}
~TFavContacts()
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index 62b4260e8a..6d6a8f1443 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -961,7 +961,7 @@ void MirandaImport(HWND hdlg) {
hdlgProgress = hdlg;
- if ((dstDb = GetCurrentDatabase()) == NULL) {
+ if ((dstDb = db_get_current()) == NULL) {
AddMessage(LPGENW("Error retrieving current profile, exiting."));
return;
}
diff --git a/src/mir_app/src/db_intf.cpp b/src/mir_app/src/db_intf.cpp index eaab4d9e9b..504bc5bb34 100644 --- a/src/mir_app/src/db_intf.cpp +++ b/src/mir_app/src/db_intf.cpp @@ -50,11 +50,6 @@ static INT_PTR srvFindPlugin(WPARAM, LPARAM lParam) return NULL;
}
-static INT_PTR srvGetCurrentDb(WPARAM, LPARAM)
-{
- return (INT_PTR)currDb;
-}
-
static INT_PTR srvInitInstance(WPARAM, LPARAM lParam)
{
MIDatabase *pDb = (MIDatabase*)lParam;
@@ -80,7 +75,6 @@ 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);
diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp index 051ce6a32e..0775226498 100644 --- a/src/mir_core/src/db.cpp +++ b/src/mir_core/src/db.cpp @@ -40,6 +40,11 @@ MIR_CORE_DLL(int) db_get_contact_count(void) return (currDb) ? currDb->GetContactCount() : 0;
}
+MIR_CORE_DLL(MIDatabase*) db_get_current()
+{
+ return currDb;
+}
+
static int sttEnumVars(const char *szVarName, LPARAM lParam)
{
LIST<char>* vars = (LIST<char>*)lParam;
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index b6e57d3b9d..a9bdba9103 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -1009,3 +1009,4 @@ db_delete_module @1161 ??_7CCtrlSpin@@6B@ @1166 NONAME
?SetMaxLength@CCtrlEdit@@QAEXI@Z @1167 NONAME
?SetRange@CCtrlSpin@@QAEXFF@Z @1168 NONAME
+db_get_current @1169
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index 131140dff2..c7279247af 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -1009,3 +1009,4 @@ db_delete_module @1161 ??_7CCtrlSpin@@6B@ @1166 NONAME
?SetMaxLength@CCtrlEdit@@QEAAXI@Z @1167 NONAME
?SetRange@CCtrlSpin@@QEAAXFF@Z @1168 NONAME
+db_get_current @1169
|