summaryrefslogtreecommitdiff
path: root/plugins/CmdLine/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-20 15:08:48 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-20 15:08:48 +0300
commit8a74e7495ce5ad39de4f5c25121a84d35df90c36 (patch)
tree03e5b4870f09a3163306740c2eebee47bc15b042 /plugins/CmdLine/src
parentc5bf7d6123dd1c3b82ccb8fdb1b068077e9d56d4 (diff)
CMPlugin to receive a reference to PLUGININFOEX
Diffstat (limited to 'plugins/CmdLine/src')
-rw-r--r--plugins/CmdLine/src/CmdLine.cpp16
-rw-r--r--plugins/CmdLine/src/mimcmd_handlers.cpp3
-rw-r--r--plugins/CmdLine/src/mimcmd_handlers.h3
-rw-r--r--plugins/CmdLine/src/stdafx.h6
-rw-r--r--plugins/CmdLine/src/utils.cpp4
5 files changed, 18 insertions, 14 deletions
diff --git a/plugins/CmdLine/src/CmdLine.cpp b/plugins/CmdLine/src/CmdLine.cpp
index 55ee6fe732..5edd978456 100644
--- a/plugins/CmdLine/src/CmdLine.cpp
+++ b/plugins/CmdLine/src/CmdLine.cpp
@@ -24,7 +24,9 @@ CMPlugin g_plugin;
int &hLangpack(g_plugin.m_hLang);
CLIST_INTERFACE *pcli;
-PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -37,14 +39,20 @@ PLUGININFOEX pluginInfo = {
{0x2f1a117c, 0x3c1b, 0x4c01, {0x89, 0xea, 0x6d, 0x8f, 0xd8, 0x5a, 0x9b, 0x4c}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
if (InitServer())
@@ -54,6 +62,8 @@ extern "C" int __declspec(dllexport) Load(void)
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Unload()
{
bWaitForUnload = 0;
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp
index 2971dbd8c3..abbec32e84 100644
--- a/plugins/CmdLine/src/mimcmd_handlers.cpp
+++ b/plugins/CmdLine/src/mimcmd_handlers.cpp
@@ -1436,9 +1436,8 @@ void HandleVersionCommand(PCommand command, TArgument*, int argc, PReply reply)
}
else {
char miranda[512];
- DWORD v = pluginInfo.version;
Miranda_GetVersionText(miranda, _countof(miranda));
- mir_snwprintf(reply->message, L"Miranda %S\nCmdLine v.%d.%d.%d.%d", miranda, ((v >> 24) & 0xFF), ((v >> 16) & 0xFF), ((v >> 8) & 0xFF), (v & 0xFF));
+ mir_snwprintf(reply->message, L"Miranda %S\nCmdLine v.%d.%d.%d.%d", miranda, __MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM);
}
}
else HandleWrongParametersCount(command, reply);
diff --git a/plugins/CmdLine/src/mimcmd_handlers.h b/plugins/CmdLine/src/mimcmd_handlers.h
index 64db00bbbf..97db4f25bf 100644
--- a/plugins/CmdLine/src/mimcmd_handlers.h
+++ b/plugins/CmdLine/src/mimcmd_handlers.h
@@ -27,10 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MS_EXCHANGE_CHECKEMAIL "Exchange/CheckEmail"
#define MS_YAMN_FORCECHECK "YAMN/Service/ForceCheck"
-extern PCommand GetCommand(char *command);
-
extern HANDLE heServerBufferFull;
-extern PLUGININFOEX pluginInfo;
void HandleCommand(PCommand command, TArgument *argv, int argc, PReply reply);
diff --git a/plugins/CmdLine/src/stdafx.h b/plugins/CmdLine/src/stdafx.h
index 5e2f33eed5..1d0401030d 100644
--- a/plugins/CmdLine/src/stdafx.h
+++ b/plugins/CmdLine/src/stdafx.h
@@ -54,13 +54,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "mimcmd_handlers.h"
#include "mimcmd_data.h"
-#define ModuleName "CmdLine"
+#define MODULENAME "CmdLine"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(ModuleName)
- {}
+ CMPlugin();
};
extern int bUseANSIStrings;
diff --git a/plugins/CmdLine/src/utils.cpp b/plugins/CmdLine/src/utils.cpp
index b0e8c552c1..f67d27b198 100644
--- a/plugins/CmdLine/src/utils.cpp
+++ b/plugins/CmdLine/src/utils.cpp
@@ -141,12 +141,12 @@ int GetStringFromDatabase(MCONTACT hContact, char *szModule, char *szSettingName
int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, size_t size)
{
- return GetStringFromDatabase(NULL, ModuleName, szSettingName, szError, szResult, size);
+ return GetStringFromDatabase(NULL, MODULENAME, szSettingName, szError, szResult, size);
}
int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, size_t count)
{
- return GetStringFromDatabase(NULL, ModuleName, szSettingName, szError, szResult, count);
+ return GetStringFromDatabase(NULL, MODULENAME, szSettingName, szError, szResult, count);
}
#pragma warning (disable: 4312)