diff options
author | George Hazan <george.hazan@gmail.com> | 2013-06-17 21:57:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-06-17 21:57:16 +0000 |
commit | 6c4d35fca373a55252f4bce0bd0102f78eb67037 (patch) | |
tree | 14041df61249254d4d67a4d0cff411ad59b230e4 | |
parent | 5ab0462a05c80e52a629255353405d7e5c39e304 (diff) |
ProtoServiceExists moved to mir_core
all another copies of it removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@5006 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
24 files changed, 21 insertions, 91 deletions
diff --git a/bin10/lib/mir_core.lib b/bin10/lib/mir_core.lib Binary files differindex a1c798fd34..e6ca0d6dce 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 d1dd96c2f1..ab438211dc 100644 --- a/bin10/lib/mir_core64.lib +++ b/bin10/lib/mir_core64.lib diff --git a/bin11/lib/mir_core.lib b/bin11/lib/mir_core.lib Binary files differindex 2fa2e20ff5..464d66c965 100644 --- a/bin11/lib/mir_core.lib +++ b/bin11/lib/mir_core.lib diff --git a/bin11/lib/mir_core64.lib b/bin11/lib/mir_core64.lib Binary files differindex 3eb2c25c3d..a333157872 100644 --- a/bin11/lib/mir_core64.lib +++ b/bin11/lib/mir_core64.lib diff --git a/include/delphi/m_core.inc b/include/delphi/m_core.inc index 0be77bbe48..04801f8702 100644 --- a/include/delphi/m_core.inc +++ b/include/delphi/m_core.inc @@ -519,6 +519,13 @@ function mir_vsntprintf(buffer:pWideChar;count:size_t;fmt:pWideChar;va:va_list): ///////////////////////////////////////////////////////////////////////////////
+// protocol functions
+
+function ProtoServiceExists(const szModule, szName:PAnsiChar):int; stdcall;
+ external CoreDLL name 'ProtoServiceExists';
+
+
+///////////////////////////////////////////////////////////////////////////////
// sha1 functions
type
pmir_sha1_byte_t = ^mir_sha1_byte_t;
diff --git a/include/delphi/m_helpers.inc b/include/delphi/m_helpers.inc index e9bedfd7be..9c3881fe31 100644 --- a/include/delphi/m_helpers.inc +++ b/include/delphi/m_helpers.inc @@ -1,7 +1,5 @@ {$IFDEF M_API_UNIT}
-function ProtoServiceExists(const proto,service: PAnsiChar): int;
-
function CreateVersionString(version:dword;buf:PAnsiChar):PAnsiChar;
function CreateVersionStringPlugin(pluginInfo:PPluginInfoEx;buf:PAnsiChar):PAnsiChar;
function PLUGIN_MAKE_VERSION(a,b,c,d: Cardinal): int;
@@ -90,21 +88,6 @@ function Options_OpenPage(ood:POPENOPTIONSDIALOG):HWND; {$ELSE}
-function ProtoServiceExists(const proto,service: PAnsiChar): int;
-var
- buf:array [0..127] of AnsiChar;
-begin
- if (proto=nil) or (service=nil) then
- begin
- result:=0;
- exit;
- end;
- lStrCpyA(@buf,proto);
- lStrCatA(@buf,service);
- result:=ServiceExists(@buf);
-end;
-
-
function CreateVersionString(version:dword;buf:PAnsiChar):PAnsiChar;
var
vers:array [0..3] of integer;
diff --git a/include/m_core.h b/include/m_core.h index 8c8602f921..9c315e76d4 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -431,6 +431,11 @@ MIR_CORE_DLL(int) mir_vsnprintf(char *buffer, size_t count, const char* fmt, MIR_CORE_DLL(int) mir_vsntprintf(TCHAR *buffer, size_t count, const TCHAR* fmt, va_list va);
///////////////////////////////////////////////////////////////////////////////
+// protocol functions
+
+MIR_CORE_DLL(int) ProtoServiceExists(const char *szModule, const char *szService);
+
+///////////////////////////////////////////////////////////////////////////////
// sha1 functions
typedef unsigned char mir_sha1_byte_t;
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index a0ee6d8b63..3f03247a9a 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -107,19 +107,8 @@ extern INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wPar extern INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
extern INT_PTR CALLBACK DlgProcAvatarProtoInfo(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-
static int SetProtoMyAvatar(char *protocol, HBITMAP hBmp, TCHAR *originalFilename, int format, BOOL square, BOOL grow);
-// See if a protocol service exists
-int ProtoServiceExists(const char *szModule,const char *szService)
-{
- char str[MAXMODULELABELLENGTH * 2];
- strcpy(str,szModule);
- strcat(str,szService);
- return ServiceExists(str);
-}
-
-
/*
* output a notification message.
* may accept a hContact to include the contacts nickname in the notification message...
@@ -2467,8 +2456,6 @@ return = 1 (supported) or 0 (not supported) */
#define PS_ISAVATARFORMATSUPPORTED "/IsAvatarFormatSupported"
-
-
BOOL Proto_IsAvatarsEnabled(const char *proto)
{
if (ProtoServiceExists(proto, PS_GETAVATARCAPS))
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index f151f8c370..3120f43d60 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -43,7 +43,6 @@ extern void DeleteAvatarFromCache(HANDLE, BOOL); extern HBITMAP LoadPNG(struct avatarCacheEntry *ace, char *szFilename);
extern HANDLE GetContactThatHaveTheAvatar(HANDLE hContact, int locked = -1);
-extern int ProtoServiceExists(const char *szModule,const char *szService);
extern BOOL Proto_IsAvatarsEnabled(const char *proto);
extern BOOL ScreenToClient(HWND hWnd, LPRECT lpRect);
diff --git a/plugins/ListeningTo/src/commons.h b/plugins/ListeningTo/src/commons.h index 60225f3304..8ac3c7d235 100644 --- a/plugins/ListeningTo/src/commons.h +++ b/plugins/ListeningTo/src/commons.h @@ -84,8 +84,6 @@ extern BOOL loaded; void RebuildMenu();
void StartTimer();
-int ProtoServiceExists(const char *szModule, const char *szService);
-
struct ProtocolInfo
{
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index 2f9933ca82..94245af60e 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -144,15 +144,6 @@ extern "C" int __declspec(dllexport) Unload(void) return 0;
}
-
-int ProtoServiceExists(const char *szModule, const char *szService)
-{
- char str[MAXMODULELABELLENGTH];
- strcpy(str,szModule);
- strcat(str,szService);
- return ServiceExists(str);
-}
-
void UpdateGlobalStatusMenus()
{
BOOL enabled = ListeningToEnabled(NULL, TRUE);
diff --git a/plugins/MyDetails/src/commons.h b/plugins/MyDetails/src/commons.h index 0b841a2206..1a968b3327 100644 --- a/plugins/MyDetails/src/commons.h +++ b/plugins/MyDetails/src/commons.h @@ -73,15 +73,6 @@ extern bool g_bFramesExist; #define PS_GETMYAVATARMAXSIZE "/GetMyAvatarMaxSize"
#define PS_GETMYNICKNAMEMAXLENGTH "/GetMyNicknameMaxLength"
-// See if a protocol service exists
-__inline static int ProtoServiceExists(const char *szModule,const char *szService)
-{
- char str[MAXMODULELABELLENGTH];
- strcpy(str,szModule);
- strcat(str,szService);
- return ServiceExists(str);
-}
-
// Helper
static __inline int DRAW_TEXT(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, const char *protocol)
{
diff --git a/plugins/NewXstatusNotify/src/utils.cpp b/plugins/NewXstatusNotify/src/utils.cpp index 3e9d0f7f35..fddbc148f1 100644 --- a/plugins/NewXstatusNotify/src/utils.cpp +++ b/plugins/NewXstatusNotify/src/utils.cpp @@ -65,17 +65,6 @@ void ShowLog(TCHAR *file) MessageBox(0, TranslateT("Can't open the log file!"), TranslateT("NewXstatusNotify"), MB_OK | MB_ICONERROR);
}
-int ProtoServiceExists(const char *szModule, const char *szService)
-{
- char str[MAXMODULELABELLENGTH];
- if (szModule == NULL || szService == NULL)
- return 0;
-
- strcpy(str,szModule);
- strcat(str,szService);
- return ServiceExists(str);
-}
-
BOOL StatusHasAwayMessage(char *szProto, int status)
{
if (szProto != NULL) {
diff --git a/plugins/NewXstatusNotify/src/utils.h b/plugins/NewXstatusNotify/src/utils.h index 0c20662100..384b01c511 100644 --- a/plugins/NewXstatusNotify/src/utils.h +++ b/plugins/NewXstatusNotify/src/utils.h @@ -26,7 +26,6 @@ TCHAR *db2t(DBVARIANT *dbv); int DBGetStringDefault(HANDLE hContact, const char *szModule, const char *szSetting, TCHAR *setting, int size, const TCHAR *defaultValue);
void HigherLower(int maxValue, int minValue);
void ShowLog(TCHAR *file);
-int ProtoServiceExists(const char *szModule, const char *szService);
BOOL StatusHasAwayMessage(char *szProto, int status);
void LogToFile(TCHAR *stzText);
diff --git a/plugins/SkypeStatusChange/src/main.cpp b/plugins/SkypeStatusChange/src/main.cpp index 1157f4dd13..d94d0920f1 100644 --- a/plugins/SkypeStatusChange/src/main.cpp +++ b/plugins/SkypeStatusChange/src/main.cpp @@ -148,16 +148,6 @@ static void ThreadFunc(void*) }
}
-bool ProtoServiceExists(const char *szModule,const char *szService)
-{
- char str[MAXMODULELABELLENGTH * 2];
- strncpy_s(str,szModule,strlen(szModule));
- strncat_s(str,szService,strlen(szService));
-
- return (ServiceExists(str) > 0);
-}
-
-
LRESULT APIENTRY SkypeAPI_WindowProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
{
LRESULT lReturnCode = 0;
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index 9740dbd1d2..e4bcb782cd 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -20,14 +20,6 @@ Boston, MA 02111-1307, USA. #include "common.h"
-int ProtoServiceExists(const char *szModule, const char *szService)
-{
- char str[MAXMODULELABELLENGTH];
- strcpy(str,szModule);
- strcat(str,szService);
- return ServiceExists(str);
-}
-
bool DBGetContactSettingAsString(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
DBVARIANT dbv;
diff --git a/plugins/TipperYM/src/subst.h b/plugins/TipperYM/src/subst.h index fdc0b73320..d8cbf39d45 100644 --- a/plugins/TipperYM/src/subst.h +++ b/plugins/TipperYM/src/subst.h @@ -25,7 +25,6 @@ bool GetLabelText(HANDLE hContact, const DISPLAYITEM &di, TCHAR *buff, int iBuff bool GetValueText(HANDLE hContact, const DISPLAYITEM &di, TCHAR *buff, int iBufflen);
void StripBBCodesInPlace(TCHAR *text);
-int ProtoServiceExists(const char *szModule, const char *szService);
// can be used with hContact == 0 to get uid for a given proto
bool UidName(char *szProto, TCHAR *buff, int bufflen);
diff --git a/plugins/helpers/gen_helpers.cpp b/plugins/helpers/gen_helpers.cpp index c816dba8ea..39927fcece 100644 --- a/plugins/helpers/gen_helpers.cpp +++ b/plugins/helpers/gen_helpers.cpp @@ -19,14 +19,6 @@ #include "commonheaders.h"
#include "gen_helpers.h"
-int ProtoServiceExists(const char *szModule, const char *szService) {
-
- char str[MAXMODULELABELLENGTH];
- mir_snprintf(str, sizeof(str), "%s%s", szModule, szService);
-
- return ServiceExists(str);
-}
-
char *Hlp_GetProtocolNameA(const char *proto) {
char protoname[256];
diff --git a/plugins/helpers/gen_helpers.h b/plugins/helpers/gen_helpers.h index 896b2638f4..29c1dafbf7 100644 --- a/plugins/helpers/gen_helpers.h +++ b/plugins/helpers/gen_helpers.h @@ -19,7 +19,6 @@ #ifndef __GEN_HELPERS_H
#define __GEN_HELPERS_H
-int ProtoServiceExists(const char *szModule, const char *szService);
char *Hlp_GetProtocolNameA(const char *proto);
TCHAR *Hlp_GetProtocolName(const char *proto);
diff --git a/src/mir_core/mir_core.def b/src/mir_core/mir_core.def index 5f08ae2836..52a16fc917 100644 --- a/src/mir_core/mir_core.def +++ b/src/mir_core/mir_core.def @@ -161,3 +161,4 @@ wildcmpi @158 wildcmpiw @159
mir_base64_encode @160
mir_base64_decode @161
+ProtoServiceExists @162
diff --git a/src/mir_core/mir_core_10.vcxproj b/src/mir_core/mir_core_10.vcxproj index 73f0067f6b..276355415e 100644 --- a/src/mir_core/mir_core_10.vcxproj +++ b/src/mir_core/mir_core_10.vcxproj @@ -29,6 +29,7 @@ <ClCompile Include="cmdline.cpp" />
<ClCompile Include="http.cpp" />
<ClCompile Include="icons.cpp" />
+ <ClCompile Include="protos.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
diff --git a/src/mir_core/mir_core_10.vcxproj.filters b/src/mir_core/mir_core_10.vcxproj.filters index 1ccf05526a..ee68903ad7 100644 --- a/src/mir_core/mir_core_10.vcxproj.filters +++ b/src/mir_core/mir_core_10.vcxproj.filters @@ -64,6 +64,9 @@ <ClCompile Include="http.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="protos.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="commonheaders.h">
diff --git a/src/mir_core/mir_core_11.vcxproj b/src/mir_core/mir_core_11.vcxproj index 142aa99b40..aeaca83c3b 100644 --- a/src/mir_core/mir_core_11.vcxproj +++ b/src/mir_core/mir_core_11.vcxproj @@ -29,6 +29,7 @@ <ClCompile Include="cmdline.cpp" />
<ClCompile Include="http.cpp" />
<ClCompile Include="icons.cpp" />
+ <ClCompile Include="protos.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
diff --git a/src/mir_core/mir_core_11.vcxproj.filters b/src/mir_core/mir_core_11.vcxproj.filters index 1ccf05526a..ee68903ad7 100644 --- a/src/mir_core/mir_core_11.vcxproj.filters +++ b/src/mir_core/mir_core_11.vcxproj.filters @@ -64,6 +64,9 @@ <ClCompile Include="http.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="protos.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="commonheaders.h">
|