From 155a8b70c4a31154328d2f778eb407421b1c5f15 Mon Sep 17 00:00:00 2001 From: Adam Potolsky Date: Fri, 5 Jun 2015 17:07:47 -0700 Subject: [PATCH] Added version string to plugin and added to plugin loaded message --- src/lib/arch/win32/ArchPluginWindows.cpp | 7 ++++++- src/lib/plugin/ns/ns.cpp | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lib/arch/win32/ArchPluginWindows.cpp b/src/lib/arch/win32/ArchPluginWindows.cpp index ce814cf5..1f560e06 100644 --- a/src/lib/arch/win32/ArchPluginWindows.cpp +++ b/src/lib/arch/win32/ArchPluginWindows.cpp @@ -69,7 +69,12 @@ ArchPluginWindows::load() String filename = synergy::string::removeFileExt(*it); m_pluginTable.insert(std::make_pair(filename, lib)); - LOG((CLOG_DEBUG "loaded plugin: %s", (*it).c_str())); + char * version = (char*)invoke( filename.c_str(),"version",NULL); + if (version == NULL) { + version = "Pre-1.7.4"; + } + + LOG((CLOG_DEBUG "loaded plugin: %s (%s)", (*it).c_str(),version)); } } diff --git a/src/lib/plugin/ns/ns.cpp b/src/lib/plugin/ns/ns.cpp index f34e7faa..b2d8823d 100644 --- a/src/lib/plugin/ns/ns.cpp +++ b/src/lib/plugin/ns/ns.cpp @@ -24,6 +24,7 @@ #include +const char * kSynergyVers = VERSION; SecureSocket* g_secureSocket = NULL; SecureListenSocket* g_secureListenSocket = NULL; Arch* g_arch = NULL; @@ -86,6 +87,9 @@ invoke(const char* command, void** args) g_secureListenSocket = NULL; } } + else if(strcmp(command, "version") == 0) { + return (void*) kSynergyVers; + } return NULL; }