summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/m_core.h2
-rw-r--r--libs/win32/mir_core.libbin478448 -> 478654 bytes
-rw-r--r--libs/win64/mir_core.libbin483626 -> 483812 bytes
-rw-r--r--plugins/Scriver/scriver.vcxproj1
-rw-r--r--plugins/Scriver/scriver.vcxproj.filters3
-rw-r--r--plugins/Scriver/src/chat.h3
-rw-r--r--plugins/Scriver/src/chat_manager.cpp4
-rw-r--r--plugins/Scriver/src/chat_tools.cpp32
-rw-r--r--plugins/TabSRMM/src/chat.h1
-rw-r--r--plugins/TabSRMM/src/chat_manager.cpp4
-rw-r--r--plugins/TabSRMM/src/chat_tools.cpp22
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp2
-rw-r--r--protocols/IRCG/src/options.cpp2
-rw-r--r--protocols/IRCG/src/stdafx.h1
-rw-r--r--protocols/IRCG/src/tools.cpp11
-rw-r--r--src/mir_app/src/chat.h2
-rw-r--r--src/mir_app/src/chat_manager.cpp2
-rw-r--r--src/mir_app/src/chat_tools.cpp11
-rw-r--r--src/mir_core/src/mir_core.def1
-rw-r--r--src/mir_core/src/mir_core64.def1
-rw-r--r--src/mir_core/src/utils.cpp10
21 files changed, 25 insertions, 90 deletions
diff --git a/include/m_core.h b/include/m_core.h
index c4a77168f4..6a9cda3b39 100644
--- a/include/m_core.h
+++ b/include/m_core.h
@@ -301,6 +301,8 @@ MIR_CORE_DLL(wchar_t*) mir_wstrdup(const wchar_t* str);
MIR_CORE_DLL(char*) mir_strndup(const char* str, size_t len);
MIR_CORE_DLL(wchar_t*) mir_wstrndup(const wchar_t *str, size_t len);
+MIR_CORE_DLL(const wchar_t*) mir_wstrstri(const wchar_t *s1, const wchar_t *s2);
+
///////////////////////////////////////////////////////////////////////////////
// print functions
diff --git a/libs/win32/mir_core.lib b/libs/win32/mir_core.lib
index 8778a0c4dd..f822dbb8b3 100644
--- a/libs/win32/mir_core.lib
+++ b/libs/win32/mir_core.lib
Binary files differ
diff --git a/libs/win64/mir_core.lib b/libs/win64/mir_core.lib
index 46042a3882..401f44989c 100644
--- a/libs/win64/mir_core.lib
+++ b/libs/win64/mir_core.lib
Binary files differ
diff --git a/plugins/Scriver/scriver.vcxproj b/plugins/Scriver/scriver.vcxproj
index eb7cb200ad..a92315853a 100644
--- a/plugins/Scriver/scriver.vcxproj
+++ b/plugins/Scriver/scriver.vcxproj
@@ -29,7 +29,6 @@
<ClCompile Include="src\chat_main.cpp" />
<ClCompile Include="src\chat_manager.cpp" />
<ClCompile Include="src\chat_options.cpp" />
- <ClCompile Include="src\chat_tools.cpp" />
<ClCompile Include="src\cmdlist.cpp" />
<ClCompile Include="src\globals.cpp" />
<ClCompile Include="src\infobar.cpp" />
diff --git a/plugins/Scriver/scriver.vcxproj.filters b/plugins/Scriver/scriver.vcxproj.filters
index a2e706e0b8..ffe211f657 100644
--- a/plugins/Scriver/scriver.vcxproj.filters
+++ b/plugins/Scriver/scriver.vcxproj.filters
@@ -11,9 +11,6 @@
<ClCompile Include="src\chat_options.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\chat_tools.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\cmdlist.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/plugins/Scriver/src/chat.h b/plugins/Scriver/src/chat.h
index 777409a828..71227293df 100644
--- a/plugins/Scriver/src/chat.h
+++ b/plugins/Scriver/src/chat.h
@@ -73,9 +73,6 @@ void FreeMsgLogBitmaps(void);
SESSION_INFO* SM_FindSessionAutoComplete(const char *pszModule, SESSION_INFO *currSession, SESSION_INFO *prevSession, const wchar_t *pszOriginal, const wchar_t *pszCurrent);
char SM_GetStatusIndicator(SESSION_INFO *si, USERINFO *ui);
-// tools.c
-const wchar_t* my_strstri(const wchar_t *s1, const wchar_t *s2);
-
/////////////////////////////////////////////////////////////////////////////////////////
#define DEFLOGFILENAME L"%miranda_logpath%\\%proto%\\%userid%.log"
diff --git a/plugins/Scriver/src/chat_manager.cpp b/plugins/Scriver/src/chat_manager.cpp
index 16a1710f07..c4f3efa815 100644
--- a/plugins/Scriver/src/chat_manager.cpp
+++ b/plugins/Scriver/src/chat_manager.cpp
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
SESSION_INFO* SM_FindSessionAutoComplete(const char *pszModule, SESSION_INFO *currSession, SESSION_INFO *prevSession, const wchar_t *pszOriginal, const wchar_t *pszCurrent)
{
SESSION_INFO *pResult = nullptr;
- if (prevSession == nullptr && my_strstri(currSession->ptszName, pszOriginal) == currSession->ptszName)
+ if (prevSession == nullptr && mir_wstrstri(currSession->ptszName, pszOriginal) == currSession->ptszName)
pResult = currSession;
else {
wchar_t *pszName = nullptr;
@@ -33,7 +33,7 @@ SESSION_INFO* SM_FindSessionAutoComplete(const char *pszModule, SESSION_INFO *cu
for (auto &si : g_chatApi.arSessions) {
if (si != currSession && !mir_strcmpi(pszModule, si->pszModule)) {
- if (my_strstri(si->ptszName, pszOriginal) == si->ptszName) {
+ if (mir_wstrstri(si->ptszName, pszOriginal) == si->ptszName) {
if (prevSession != si && mir_wstrcmpi(si->ptszName, pszCurrent) > 0 && (!pszName || mir_wstrcmpi(si->ptszName, pszName) < 0)) {
pResult = si;
pszName = si->ptszName;
diff --git a/plugins/Scriver/src/chat_tools.cpp b/plugins/Scriver/src/chat_tools.cpp
deleted file mode 100644
index c31cc839b2..0000000000
--- a/plugins/Scriver/src/chat_tools.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-Chat module plugin for Miranda IM
-
-Copyright (C) 2003 Jörgen Persson
-Copyright 2003-2009 Miranda ICQ/IM project,
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "stdafx.h"
-
-const wchar_t* my_strstri(const wchar_t *s1, const wchar_t *s2)
-{
- for (int i = 0; s1[i]; i++)
- for (int j = i, k = 0; towlower(s1[j]) == towlower(s2[k]); j++, k++)
- if (!s2[k + 1])
- return s1 + i;
-
- return nullptr;
-}
diff --git a/plugins/TabSRMM/src/chat.h b/plugins/TabSRMM/src/chat.h
index 2c9e762908..c083973fa7 100644
--- a/plugins/TabSRMM/src/chat.h
+++ b/plugins/TabSRMM/src/chat.h
@@ -113,7 +113,6 @@ int UM_CompareItem(const USERINFO *u1, const USERINFO *u2);
// tools.c
BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight, int bManyFix);
-wchar_t* my_strstri(const wchar_t* s1, const wchar_t* s2);
bool IsHighlighted(SESSION_INFO *si, GCEVENT *pszText);
char GetIndicator(SESSION_INFO *si, LPCTSTR ptszNick, int *iNickIndex);
void Chat_SetFilters(SESSION_INFO *si);
diff --git a/plugins/TabSRMM/src/chat_manager.cpp b/plugins/TabSRMM/src/chat_manager.cpp
index e42a13e2b7..ff8db52d88 100644
--- a/plugins/TabSRMM/src/chat_manager.cpp
+++ b/plugins/TabSRMM/src/chat_manager.cpp
@@ -100,7 +100,7 @@ SESSION_INFO* SM_FindSessionByHCONTACT(MCONTACT h)
SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const wchar_t* pszOriginal, const wchar_t* pszCurrent)
{
- if (prevSession == nullptr && my_strstri(currSession->ptszName, pszOriginal) == currSession->ptszName)
+ if (prevSession == nullptr && mir_wstrstri(currSession->ptszName, pszOriginal) == currSession->ptszName)
return currSession;
wchar_t *pszName = nullptr;
@@ -110,7 +110,7 @@ SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* cu
SESSION_INFO *pResult = nullptr;
for (auto &si : g_chatApi.arSessions)
if (si != currSession && !mir_strcmpi(pszModule, si->pszModule))
- if (my_strstri(si->ptszName, pszOriginal) == si->ptszName)
+ if (mir_wstrstri(si->ptszName, pszOriginal) == si->ptszName)
if (prevSession != si && mir_wstrcmpi(si->ptszName, pszCurrent) > 0 && (!pszName || mir_wstrcmpi(si->ptszName, pszName) < 0)) {
pResult = si;
pszName = si->ptszName;
diff --git a/plugins/TabSRMM/src/chat_tools.cpp b/plugins/TabSRMM/src/chat_tools.cpp
index a10947d45f..eec305efc6 100644
--- a/plugins/TabSRMM/src/chat_tools.cpp
+++ b/plugins/TabSRMM/src/chat_tools.cpp
@@ -147,10 +147,8 @@ BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce)
if (nen_options.iMUCDisable) // no popups at all. Period
return 0;
- /*
- * check the status mode against the status mask
- */
+ // check the status mode against the status mask
char *szProto = dat ? dat->m_szProto : si->pszModule;
if (nen_options.dwStatusMask != -1) {
if (szProto != nullptr) {
@@ -362,22 +360,10 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight
return true;
}
-wchar_t* my_strstri(const wchar_t* s1, const wchar_t* s2)
-{
- int i, j, k;
-
- for (i = 0; s1[i]; i++)
- for (j = i, k = 0; towlower(s1[j]) == towlower(s2[k]); j++, k++)
- if (!s2[k + 1])
- return (wchar_t*)(s1 + i);
-
- return nullptr;
-}
+/////////////////////////////////////////////////////////////////////////////////////////
+// set all filters and notification config for a session
+// uses per channel mask + filterbits, default config as backup
-/*
- * set all filters and notification config for a session
- * uses per channel mask + filterbits, default config as backup
- */
void Chat_SetFilters(SESSION_INFO *si)
{
DWORD dwFlags_default = db_get_dw(0, CHAT_MODULE, "FilterFlags", GC_EVENT_ALL);
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp
index b8b8c7ba78..80159a7eb5 100644
--- a/protocols/IRCG/src/commandmonitor.cpp
+++ b/protocols/IRCG/src/commandmonitor.cpp
@@ -2384,7 +2384,7 @@ int CIrcProto::DoPerform(const char* event)
if (pwszPerform == nullptr)
return 0;
- if (my_strstri(pwszPerform, L"/away")) {
+ if (mir_wstrstri(pwszPerform, L"/away")) {
mir_free(pwszPerform);
mir_forkthread(AwayWarningThread);
}
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp
index dff900a683..f8bb7c8dab 100644
--- a/protocols/IRCG/src/options.cpp
+++ b/protocols/IRCG/src/options.cpp
@@ -787,7 +787,7 @@ public:
{
ptrW temp(m_pertormEdit.GetText());
- if (my_strstri(temp, L"/away"))
+ if (mir_wstrstri(temp, L"/away"))
MessageBox(nullptr, TranslateT("The usage of /AWAY in your perform buffer is restricted\n as IRC sends this command automatically."), TranslateT("IRC Error"), MB_OK);
else {
PERFORM_INFO *pPerf = (PERFORM_INFO *)m_performCombo.GetCurData();
diff --git a/protocols/IRCG/src/stdafx.h b/protocols/IRCG/src/stdafx.h
index e5278318ac..9822e052fb 100644
--- a/protocols/IRCG/src/stdafx.h
+++ b/protocols/IRCG/src/stdafx.h
@@ -212,7 +212,6 @@ char* __stdcall IrcLoadFile(wchar_t * szPath);
CMStringW __stdcall GetWord(const wchar_t* text, int index);
const wchar_t* __stdcall GetWordAddress(const wchar_t* text, int index);
void __stdcall RemoveLinebreaks(CMStringW& Message);
-wchar_t* __stdcall my_strstri(const wchar_t *s1, const wchar_t *s2);
wchar_t* __stdcall DoColorCodes(const wchar_t* text, bool bStrip, bool bReplacePercent);
CMStringA __stdcall GetWord(const char* text, int index);
diff --git a/protocols/IRCG/src/tools.cpp b/protocols/IRCG/src/tools.cpp
index 6cc196b42c..133a8f9346 100644
--- a/protocols/IRCG/src/tools.cpp
+++ b/protocols/IRCG/src/tools.cpp
@@ -220,17 +220,6 @@ bool CIrcProto::IsChannel(const char* sName)
return (sChannelPrefixes.Find(sName[0]) != -1);
}
-wchar_t* __stdcall my_strstri(const wchar_t* s1, const wchar_t* s2)
-{
- int i, j, k;
- for (i = 0; s1[i]; i++)
- for (j = i, k = 0; towlower(s1[j]) == towlower(s2[k]); j++, k++)
- if (!s2[k + 1])
- return (wchar_t*)(s1 + i);
-
- return nullptr;
-}
-
static int mapIrc2srmm[] = { 15, 0, 1, 4, 14, 6, 3, 5, 13, 12, 2, 10, 9, 11, 7, 8 };
static const wchar_t* DoEnterNumber(const wchar_t *text, int &res)
diff --git a/src/mir_app/src/chat.h b/src/mir_app/src/chat.h
index 88f9660f17..3d158e5beb 100644
--- a/src/mir_app/src/chat.h
+++ b/src/mir_app/src/chat.h
@@ -126,6 +126,4 @@ CSrmmLogWindow *Srmm_GetLogWindow(CMsgDialog *pDlg);
void Chat_RemoveContact(MCONTACT hContact);
-const wchar_t* my_strstri(const wchar_t* s1, const wchar_t* s2);
-
#pragma comment(lib,"comctl32.lib")
diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp
index ce6af63eee..8daeeaadf0 100644
--- a/src/mir_app/src/chat_manager.cpp
+++ b/src/mir_app/src/chat_manager.cpp
@@ -827,7 +827,7 @@ static wchar_t* UM_FindUserAutoComplete(SESSION_INFO *si, const wchar_t* pszOrig
wchar_t *pszName = nullptr;
for (auto &ui : si->getUserList())
- if (ui->pszNick && my_strstri(ui->pszNick, pszOriginal) == ui->pszNick)
+ if (ui->pszNick && mir_wstrstri(ui->pszNick, pszOriginal) == ui->pszNick)
if (mir_wstrcmpi(ui->pszNick, pszCurrent) > 0 && (!pszName || mir_wstrcmpi(ui->pszNick, pszName) < 0))
pszName = ui->pszNick;
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp
index 980fcd2ea8..f334a128b5 100644
--- a/src/mir_app/src/chat_tools.cpp
+++ b/src/mir_app/src/chat_tools.cpp
@@ -416,17 +416,6 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight
return TRUE;
}
-const wchar_t* my_strstri(const wchar_t *s1, const wchar_t *s2)
-{
- int i, j, k;
- for (i = 0; s1[i]; i++)
- for (j = i, k = 0; towlower(s1[j]) == towlower(s2[k]); j++, k++)
- if (!s2[k + 1])
- return s1 + i;
-
- return nullptr;
-}
-
static wchar_t szTrimString[] = L":,.!?;\'>)";
bool IsHighlighted(SESSION_INFO *si, GCEVENT *gce)
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index b823bc88f8..b5dd1fc756 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -188,6 +188,7 @@ mir_closeLog @259
LoadLangPackDescr @262
PathIsAbsolute @263
PathIsAbsoluteW @264
+mir_wstrstri @265
mir_strlen @267
mir_wstrlen @268
mir_strcpy @269
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index e4515d39d6..41694e7d20 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -188,6 +188,7 @@ mir_closeLog @259
LoadLangPackDescr @262
PathIsAbsolute @263
PathIsAbsoluteW @264
+mir_wstrstri @265
mir_strlen @267
mir_wstrlen @268
mir_strcpy @269
diff --git a/src/mir_core/src/utils.cpp b/src/mir_core/src/utils.cpp
index b9cd736054..ccd89aabcc 100644
--- a/src/mir_core/src/utils.cpp
+++ b/src/mir_core/src/utils.cpp
@@ -518,6 +518,16 @@ MIR_CORE_DLL(int) mir_wstrncmpi(const wchar_t *p1, const wchar_t *p2, size_t n)
return wcsnicmp(p1, p2, n);
}
+MIR_CORE_DLL(const wchar_t*) mir_wstrstri(const wchar_t *s1, const wchar_t *s2)
+{
+ for (int i = 0; s1[i]; i++)
+ for (int j = i, k = 0; towlower(s1[j]) == towlower(s2[k]); j++, k++)
+ if (!s2[k + 1])
+ return s1 + i;
+
+ return nullptr;
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
PGENRANDOM pfnRtlGenRandom;