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 | |
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')
-rw-r--r-- | src/core/miranda.h | 4 | ||||
-rw-r--r-- | src/core/stdplug.h | 2 | ||||
-rw-r--r-- | src/mir_core/src/protos.cpp | 13 | ||||
-rw-r--r-- | src/miranda32.def | 1 | ||||
-rw-r--r-- | src/miranda32_10.vcxproj | 2 | ||||
-rw-r--r-- | src/miranda32_12.vcxproj | 2 | ||||
-rw-r--r-- | src/modules/protocols/protocols.cpp | 21 |
7 files changed, 29 insertions, 16 deletions
diff --git a/src/core/miranda.h b/src/core/miranda.h index 5d31e64aed..ba8516baf1 100644 --- a/src/core/miranda.h +++ b/src/core/miranda.h @@ -183,4 +183,8 @@ extern "C" MIR_CORE_DLL(void) db_setCurrent(MIDatabase* _db);
MIR_CORE_DLL(PROTOCOLDESCRIPTOR*) Proto_RegisterModule(PROTOCOLDESCRIPTOR *pd);
+
+ int ProtoServiceExists(LPCSTR szModule, const char *szService);
+ INT_PTR CallContactService(MCONTACT, const char *, WPARAM, LPARAM);
+ INT_PTR CallProtoService(LPCSTR szModule, const char *szService, WPARAM wParam, LPARAM lParam);
};
diff --git a/src/core/stdplug.h b/src/core/stdplug.h index ef65298258..9a6f751829 100644 --- a/src/core/stdplug.h +++ b/src/core/stdplug.h @@ -1,6 +1,6 @@ #ifdef _STATIC
- #define MIRANDA_EXE_FUNC(T) extern "C" T __declspec(dllexport)
+ #define MIRANDA_EXE_FUNC(T) extern "C" T
#else
#define MIRANDA_EXE_FUNC(T) extern "C" T __declspec(dllimport)
#endif
diff --git a/src/mir_core/src/protos.cpp b/src/mir_core/src/protos.cpp index 154ff2ad26..051e5a9792 100644 --- a/src/mir_core/src/protos.cpp +++ b/src/mir_core/src/protos.cpp @@ -99,19 +99,6 @@ MIR_CORE_DLL(INT_PTR) ProtoBroadcastAck(const char *szModule, MCONTACT hContact, /////////////////////////////////////////////////////////////////////////////////////////
-MIR_CORE_DLL(int) ProtoServiceExists(const char *szModule, const char *szService)
-{
- if (szModule == NULL || szService == NULL)
- return false;
-
- char str[MAXMODULELABELLENGTH * 2];
- strncpy_s(str, szModule, _TRUNCATE);
- strncat_s(str, szService, _TRUNCATE);
- return ServiceExists(str);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
MIR_CORE_DLL(void) ProtoConstructor(PROTO_INTERFACE *pThis, LPCSTR pszModuleName, LPCTSTR ptszUserName)
{
pThis->m_iVersion = 2;
diff --git a/src/miranda32.def b/src/miranda32.def index c36a1b6fc4..207032d84a 100644 --- a/src/miranda32.def +++ b/src/miranda32.def @@ -16,3 +16,4 @@ IcoLib_ReleaseIcon @13 Window_FreeIcon_IcoLib @14
Window_SetIcon_IcoLib @15
Window_SetProtoIcon_IcoLib @16
+ProtoServiceExists @17
diff --git a/src/miranda32_10.vcxproj b/src/miranda32_10.vcxproj index 157ff16114..0b94c03baa 100644 --- a/src/miranda32_10.vcxproj +++ b/src/miranda32_10.vcxproj @@ -142,6 +142,7 @@ <AdditionalLibraryDirectories>$(ProfileDir)..\bin10\lib</AdditionalLibraryDirectories>
<AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
<BaseAddress>0x400000</BaseAddress>
+ <ModuleDefinitionFile>miranda32.def</ModuleDefinitionFile>
</Link>
<Manifest>
<AdditionalManifestFiles>miranda32.exe.manifest</AdditionalManifestFiles>
@@ -208,6 +209,7 @@ <AdditionalLibraryDirectories>$(SolutionDir)\lib</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(ProfileDir)..\bin10\lib</AdditionalLibraryDirectories>
<BaseAddress>0x400000</BaseAddress>
+ <ModuleDefinitionFile>miranda32.def</ModuleDefinitionFile>
</Link>
<Manifest>
<AdditionalManifestFiles>miranda32.exe.manifest</AdditionalManifestFiles>
diff --git a/src/miranda32_12.vcxproj b/src/miranda32_12.vcxproj index 7d514d96d8..2bbabfb35d 100644 --- a/src/miranda32_12.vcxproj +++ b/src/miranda32_12.vcxproj @@ -145,6 +145,7 @@ <AdditionalLibraryDirectories>$(SolutionDir)\lib</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(ProfileDir)..\bin12\lib</AdditionalLibraryDirectories>
<BaseAddress>0x400000</BaseAddress>
+ <ModuleDefinitionFile>miranda32.def</ModuleDefinitionFile>
</Link>
<Manifest>
<AdditionalManifestFiles>miranda32.exe.manifest</AdditionalManifestFiles>
@@ -212,6 +213,7 @@ <AdditionalLibraryDirectories>$(SolutionDir)\lib</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(ProfileDir)..\bin12\lib</AdditionalLibraryDirectories>
<BaseAddress>0x400000</BaseAddress>
+ <ModuleDefinitionFile>miranda32.def</ModuleDefinitionFile>
</Link>
<Manifest>
<AdditionalManifestFiles>miranda32.exe.manifest</AdditionalManifestFiles>
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);
|