diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-11 19:06:07 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-11 19:06:07 +0000 |
commit | e521cf5548352e7a443241e10614f97bc9630a2c (patch) | |
tree | f42e46cf4eb5bd7d994cd3eefa74856dc539d04f /src/modules/protocols | |
parent | e498e2e961e0edf547cbc478797e69ec8a8d42d4 (diff) |
- more transparent ProtoServiceExists implementation;
- ProtoServiceExists moved from mir_core into miranda32.exe;
- miranda32.def is used again to define the order of functions precisely;
- libraries updated
git-svn-id: http://svn.miranda-ng.org/main/trunk@14118 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/protocols')
-rw-r--r-- | src/modules/protocols/protocols.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp index c1eff7848e..273fb85dd9 100644 --- a/src/modules/protocols/protocols.cpp +++ b/src/modules/protocols/protocols.cpp @@ -100,9 +100,9 @@ INT_PTR srvProto_IsLoaded(WPARAM, LPARAM lParam) return (INT_PTR)Proto_IsProtocolLoaded((char*)lParam);
}
-static PROTO_INTERFACE* defInitProto(const char* szModuleName, const TCHAR*)
+static PROTO_INTERFACE* defInitProto(const char* szModule, const TCHAR*)
{
- return AddDefaultAccount(szModuleName);
+ return AddDefaultAccount(szModule);
}
static INT_PTR srvProto_RegisterModule(WPARAM, LPARAM lParam)
@@ -366,6 +366,23 @@ static INT_PTR Proto_BroadcastAck(WPARAM, LPARAM lParam) /////////////////////////////////////////////////////////////////////////////////////////
+int ProtoServiceExists(const char *szModule, const char *szService)
+{
+ if (szModule == NULL || szService == NULL)
+ return false;
+
+ TServiceListItem *item = (TServiceListItem*)bsearch(&szService, serviceItems, _countof(serviceItems), sizeof(serviceItems[0]), CompareServiceItems);
+ if (item != NULL)
+ return true;
+
+ char str[MAXMODULELABELLENGTH * 2];
+ strncpy_s(str, szModule, _TRUNCATE);
+ strncat_s(str, szService, _TRUNCATE);
+ return ServiceExists(str);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
INT_PTR CallProtoService(const char* szModule, const char* szService, WPARAM wParam, LPARAM lParam)
{
return CallProtoServiceInt(NULL, szModule, szService, wParam, lParam);
|