From 48a214c3f19ff9f9e25b3975e7a9fbd2e57628b2 Mon Sep 17 00:00:00 2001 From: XMRig Date: Tue, 5 Jun 2018 07:34:58 +0700 Subject: [PATCH] Move files. --- CMakeLists.txt | 18 +++++++++--------- src/App.h | 2 +- src/api/ApiRouter.h | 2 +- src/common/config/CommonConfig.h | 2 +- src/common/config/ConfigLoader.cpp | 4 ++-- src/common/config/ConfigWatcher.cpp | 2 +- src/{ => common}/interfaces/IClientListener.h | 0 src/{ => common}/interfaces/IConfig.h | 6 ++++++ src/{ => common}/interfaces/IConfigCreator.h | 0 src/{ => common}/interfaces/IConsoleListener.h | 0 .../interfaces/IControllerListener.h | 0 src/{ => common}/interfaces/ILogBackend.h | 4 ++++ src/{ => common}/interfaces/IStrategy.h | 0 .../interfaces/IStrategyListener.h | 0 src/{ => common}/interfaces/IWatcherListener.h | 0 src/common/log/ConsoleLog.h | 2 +- src/common/log/FileLog.h | 2 +- src/common/log/Log.cpp | 2 +- src/common/log/Log.h | 2 +- src/common/net/Client.cpp | 2 +- src/common/net/Pool.cpp | 6 ++++++ src/common/net/strategies/FailoverStrategy.cpp | 2 +- src/common/net/strategies/FailoverStrategy.h | 4 ++-- .../net/strategies/SinglePoolStrategy.cpp | 2 +- src/common/net/strategies/SinglePoolStrategy.h | 4 ++-- src/core/ConfigCreator.h | 2 +- src/core/ConfigLoader_platform.h | 2 +- src/core/Controller.cpp | 2 +- src/core/Controller.h | 2 +- src/net/Network.h | 2 +- src/net/strategies/DonateStrategy.cpp | 2 +- src/net/strategies/DonateStrategy.h | 6 +++--- 32 files changed, 51 insertions(+), 35 deletions(-) rename src/{ => common}/interfaces/IClientListener.h (100%) rename src/{ => common}/interfaces/IConfig.h (95%) rename src/{ => common}/interfaces/IConfigCreator.h (100%) rename src/{ => common}/interfaces/IConsoleListener.h (100%) rename src/{ => common}/interfaces/IControllerListener.h (100%) rename src/{ => common}/interfaces/ILogBackend.h (94%) rename src/{ => common}/interfaces/IStrategy.h (100%) rename src/{ => common}/interfaces/IStrategyListener.h (100%) rename src/{ => common}/interfaces/IWatcherListener.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index a242970bc..e263808e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,15 @@ set(HEADERS src/common/Console.h src/common/crypto/Algorithm.h src/common/crypto/keccak.h + src/common/interfaces/IClientListener.h + src/common/interfaces/IConfig.h + src/common/interfaces/IConfigCreator.h + src/common/interfaces/IConsoleListener.h + src/common/interfaces/IControllerListener.h + src/common/interfaces/ILogBackend.h + src/common/interfaces/IStrategy.h + src/common/interfaces/IStrategyListener.h + src/common/interfaces/IWatcherListener.h src/common/log/ConsoleLog.h src/common/log/FileLog.h src/common/log/Log.h @@ -38,17 +47,8 @@ set(HEADERS src/core/ConfigLoader_platform.h src/core/Controller.h src/Cpu.h - src/interfaces/IClientListener.h - src/interfaces/IConfig.h - src/interfaces/IConfigCreator.h - src/interfaces/IConsoleListener.h - src/interfaces/IControllerListener.h src/interfaces/IJobResultListener.h - src/interfaces/ILogBackend.h - src/interfaces/IStrategy.h - src/interfaces/IStrategyListener.h src/interfaces/IThread.h - src/interfaces/IWatcherListener.h src/interfaces/IWorker.h src/Mem.h src/net/JobResult.h diff --git a/src/App.h b/src/App.h index 22269f67c..964400e6b 100644 --- a/src/App.h +++ b/src/App.h @@ -28,7 +28,7 @@ #include -#include "interfaces/IConsoleListener.h" +#include "common/interfaces/IConsoleListener.h" class Console; diff --git a/src/api/ApiRouter.h b/src/api/ApiRouter.h index 3ed458d41..9e32cdaee 100644 --- a/src/api/ApiRouter.h +++ b/src/api/ApiRouter.h @@ -26,7 +26,7 @@ #include "api/NetworkState.h" -#include "interfaces/IControllerListener.h" +#include "common/interfaces/IControllerListener.h" #include "rapidjson/fwd.h" diff --git a/src/common/config/CommonConfig.h b/src/common/config/CommonConfig.h index 95a02fb16..2a329c7ed 100644 --- a/src/common/config/CommonConfig.h +++ b/src/common/config/CommonConfig.h @@ -28,10 +28,10 @@ #include +#include "common/interfaces/IConfig.h" #include "common/net/Pool.h" #include "common/utils/c_str.h" #include "common/xmrig.h" -#include "interfaces/IConfig.h" namespace xmrig { diff --git a/src/common/config/ConfigLoader.cpp b/src/common/config/ConfigLoader.cpp index 32d0850c0..cc5d9a493 100644 --- a/src/common/config/ConfigLoader.cpp +++ b/src/common/config/ConfigLoader.cpp @@ -34,12 +34,12 @@ #include "common/config/ConfigLoader.h" #include "common/config/ConfigWatcher.h" +#include "common/interfaces/IConfig.h" +#include "common/interfaces/IWatcherListener.h" #include "common/net/Pool.h" #include "common/Platform.h" #include "core/ConfigCreator.h" #include "core/ConfigLoader_platform.h" -#include "interfaces/IConfig.h" -#include "interfaces/IWatcherListener.h" #include "rapidjson/document.h" #include "rapidjson/error/en.h" #include "rapidjson/filereadstream.h" diff --git a/src/common/config/ConfigWatcher.cpp b/src/common/config/ConfigWatcher.cpp index bde35f237..14107b62c 100644 --- a/src/common/config/ConfigWatcher.cpp +++ b/src/common/config/ConfigWatcher.cpp @@ -27,9 +27,9 @@ #include "common/config/ConfigLoader.h" #include "common/config/ConfigWatcher.h" +#include "common/interfaces/IWatcherListener.h" #include "common/log/Log.h" #include "core/ConfigCreator.h" -#include "interfaces/IWatcherListener.h" xmrig::ConfigWatcher::ConfigWatcher(const char *path, IConfigCreator *creator, IWatcherListener *listener) : diff --git a/src/interfaces/IClientListener.h b/src/common/interfaces/IClientListener.h similarity index 100% rename from src/interfaces/IClientListener.h rename to src/common/interfaces/IClientListener.h diff --git a/src/interfaces/IConfig.h b/src/common/interfaces/IConfig.h similarity index 95% rename from src/interfaces/IConfig.h rename to src/common/interfaces/IConfig.h index 77e262da6..62c7ba945 100644 --- a/src/interfaces/IConfig.h +++ b/src/common/interfaces/IConfig.h @@ -78,6 +78,12 @@ public: ThreadsKey = 't', HardwareAESKey = 1011, + // xmrig amd + OclPlatform = 1400, + OclAffinity = 1401, + OclDevices = 1402, + OclLaunch = 1403, + // xmrig-proxy AccessLogFileKey = 'A', BindKey = 'b', diff --git a/src/interfaces/IConfigCreator.h b/src/common/interfaces/IConfigCreator.h similarity index 100% rename from src/interfaces/IConfigCreator.h rename to src/common/interfaces/IConfigCreator.h diff --git a/src/interfaces/IConsoleListener.h b/src/common/interfaces/IConsoleListener.h similarity index 100% rename from src/interfaces/IConsoleListener.h rename to src/common/interfaces/IConsoleListener.h diff --git a/src/interfaces/IControllerListener.h b/src/common/interfaces/IControllerListener.h similarity index 100% rename from src/interfaces/IControllerListener.h rename to src/common/interfaces/IControllerListener.h diff --git a/src/interfaces/ILogBackend.h b/src/common/interfaces/ILogBackend.h similarity index 94% rename from src/interfaces/ILogBackend.h rename to src/common/interfaces/ILogBackend.h index 6e3f5c1c0..85a04e935 100644 --- a/src/interfaces/ILogBackend.h +++ b/src/common/interfaces/ILogBackend.h @@ -40,7 +40,11 @@ public: DEBUG }; +# ifdef APP_DEBUG + constexpr static const size_t kBufferSize = 1024; +# else constexpr static const size_t kBufferSize = 512; +# endif virtual ~ILogBackend() {} diff --git a/src/interfaces/IStrategy.h b/src/common/interfaces/IStrategy.h similarity index 100% rename from src/interfaces/IStrategy.h rename to src/common/interfaces/IStrategy.h diff --git a/src/interfaces/IStrategyListener.h b/src/common/interfaces/IStrategyListener.h similarity index 100% rename from src/interfaces/IStrategyListener.h rename to src/common/interfaces/IStrategyListener.h diff --git a/src/interfaces/IWatcherListener.h b/src/common/interfaces/IWatcherListener.h similarity index 100% rename from src/interfaces/IWatcherListener.h rename to src/common/interfaces/IWatcherListener.h diff --git a/src/common/log/ConsoleLog.h b/src/common/log/ConsoleLog.h index 81813c816..bac09a535 100644 --- a/src/common/log/ConsoleLog.h +++ b/src/common/log/ConsoleLog.h @@ -28,7 +28,7 @@ #include -#include "interfaces/ILogBackend.h" +#include "common/interfaces/ILogBackend.h" namespace xmrig { diff --git a/src/common/log/FileLog.h b/src/common/log/FileLog.h index 2c25f0932..8a58d4e40 100644 --- a/src/common/log/FileLog.h +++ b/src/common/log/FileLog.h @@ -28,7 +28,7 @@ #include -#include "interfaces/ILogBackend.h" +#include "common/interfaces/ILogBackend.h" namespace xmrig { diff --git a/src/common/log/Log.cpp b/src/common/log/Log.cpp index 763eb25b0..ccf380087 100644 --- a/src/common/log/Log.cpp +++ b/src/common/log/Log.cpp @@ -29,8 +29,8 @@ #include +#include "common/interfaces/ILogBackend.h" #include "common/log/Log.h" -#include "interfaces/ILogBackend.h" Log *Log::m_self = nullptr; diff --git a/src/common/log/Log.h b/src/common/log/Log.h index c4803e3a0..bfa307173 100644 --- a/src/common/log/Log.h +++ b/src/common/log/Log.h @@ -30,7 +30,7 @@ #include -#include "interfaces/ILogBackend.h" +#include "common/interfaces/ILogBackend.h" class Log diff --git a/src/common/net/Client.cpp b/src/common/net/Client.cpp index 921fa618b..a552ed3cd 100644 --- a/src/common/net/Client.cpp +++ b/src/common/net/Client.cpp @@ -29,9 +29,9 @@ #include +#include "common/interfaces/IClientListener.h" #include "common/log/Log.h" #include "common/net/Client.h" -#include "interfaces/IClientListener.h" #include "net/JobResult.h" #include "rapidjson/document.h" #include "rapidjson/error/en.h" diff --git a/src/common/net/Pool.cpp b/src/common/net/Pool.cpp index c12e05d55..d59435453 100644 --- a/src/common/net/Pool.cpp +++ b/src/common/net/Pool.cpp @@ -101,6 +101,12 @@ bool Pool::isCompatible(const xmrig::Algorithm &algorithm) const } } +# ifdef XMRIG_PROXY_PROJECT + if (m_algorithm.algo() == xmrig::CRYPTONIGHT && algorithm.algo() == xmrig::CRYPTONIGHT && m_algorithm.variant() == xmrig::VARIANT_XTL) { + return true; + } +# endif + return false; } diff --git a/src/common/net/strategies/FailoverStrategy.cpp b/src/common/net/strategies/FailoverStrategy.cpp index 295b4335e..fab785906 100644 --- a/src/common/net/strategies/FailoverStrategy.cpp +++ b/src/common/net/strategies/FailoverStrategy.cpp @@ -22,10 +22,10 @@ */ +#include "common/interfaces/IStrategyListener.h" #include "common/net/Client.h" #include "common/net/strategies/FailoverStrategy.h" #include "common/Platform.h" -#include "interfaces/IStrategyListener.h" FailoverStrategy::FailoverStrategy(const std::vector &urls, int retryPause, int retries, IStrategyListener *listener, bool quiet) : diff --git a/src/common/net/strategies/FailoverStrategy.h b/src/common/net/strategies/FailoverStrategy.h index f86b366a7..07095b3b1 100644 --- a/src/common/net/strategies/FailoverStrategy.h +++ b/src/common/net/strategies/FailoverStrategy.h @@ -28,9 +28,9 @@ #include +#include "common/interfaces/IClientListener.h" +#include "common/interfaces/IStrategy.h" #include "common/net/Pool.h" -#include "interfaces/IClientListener.h" -#include "interfaces/IStrategy.h" class Client; diff --git a/src/common/net/strategies/SinglePoolStrategy.cpp b/src/common/net/strategies/SinglePoolStrategy.cpp index 21ce7b34d..2cfc0976b 100644 --- a/src/common/net/strategies/SinglePoolStrategy.cpp +++ b/src/common/net/strategies/SinglePoolStrategy.cpp @@ -22,10 +22,10 @@ */ +#include "common/interfaces/IStrategyListener.h" #include "common/net/Client.h" #include "common/net/strategies/SinglePoolStrategy.h" #include "common/Platform.h" -#include "interfaces/IStrategyListener.h" SinglePoolStrategy::SinglePoolStrategy(const Pool &pool, int retryPause, int retries, IStrategyListener *listener, bool quiet) : diff --git a/src/common/net/strategies/SinglePoolStrategy.h b/src/common/net/strategies/SinglePoolStrategy.h index 41d90e349..1a48d6786 100644 --- a/src/common/net/strategies/SinglePoolStrategy.h +++ b/src/common/net/strategies/SinglePoolStrategy.h @@ -25,8 +25,8 @@ #define __SINGLEPOOLSTRATEGY_H__ -#include "interfaces/IClientListener.h" -#include "interfaces/IStrategy.h" +#include "common/interfaces/IClientListener.h" +#include "common/interfaces/IStrategy.h" class Client; diff --git a/src/core/ConfigCreator.h b/src/core/ConfigCreator.h index fcc6c5960..054eb78c9 100644 --- a/src/core/ConfigCreator.h +++ b/src/core/ConfigCreator.h @@ -24,8 +24,8 @@ #define __CONFIGCREATOR_H__ +#include "common/interfaces/IConfigCreator.h" #include "core/Config.h" -#include "interfaces/IConfigCreator.h" namespace xmrig { diff --git a/src/core/ConfigLoader_platform.h b/src/core/ConfigLoader_platform.h index 9704d5e30..bc6657d1b 100644 --- a/src/core/ConfigLoader_platform.h +++ b/src/core/ConfigLoader_platform.h @@ -33,8 +33,8 @@ #endif +#include "common/interfaces/IConfig.h" #include "version.h" -#include "interfaces/IConfig.h" namespace xmrig { diff --git a/src/core/Controller.cpp b/src/core/Controller.cpp index ac64f173b..ce73f0374 100644 --- a/src/core/Controller.cpp +++ b/src/core/Controller.cpp @@ -26,6 +26,7 @@ #include "common/config/ConfigLoader.h" +#include "common/interfaces/IControllerListener.h" #include "common/log/ConsoleLog.h" #include "common/log/FileLog.h" #include "common/log/Log.h" @@ -33,7 +34,6 @@ #include "core/Config.h" #include "core/Controller.h" #include "Cpu.h" -#include "interfaces/IControllerListener.h" #include "net/Network.h" diff --git a/src/core/Controller.h b/src/core/Controller.h index 25f91843c..2c66af532 100644 --- a/src/core/Controller.h +++ b/src/core/Controller.h @@ -25,7 +25,7 @@ #define __CONTROLLER_H__ -#include "interfaces/IWatcherListener.h" +#include "common/interfaces/IWatcherListener.h" class Network; diff --git a/src/net/Network.h b/src/net/Network.h index 353edc77c..51e95d6d2 100644 --- a/src/net/Network.h +++ b/src/net/Network.h @@ -30,8 +30,8 @@ #include "api/NetworkState.h" +#include "common/interfaces/IStrategyListener.h" #include "interfaces/IJobResultListener.h" -#include "interfaces/IStrategyListener.h" class IStrategy; diff --git a/src/net/strategies/DonateStrategy.cpp b/src/net/strategies/DonateStrategy.cpp index 7de776eff..4d353655a 100644 --- a/src/net/strategies/DonateStrategy.cpp +++ b/src/net/strategies/DonateStrategy.cpp @@ -23,13 +23,13 @@ #include "common/crypto/keccak.h" +#include "common/interfaces/IStrategyListener.h" #include "common/net/Client.h" #include "common/net/Job.h" #include "common/net/strategies/FailoverStrategy.h" #include "common/net/strategies/SinglePoolStrategy.h" #include "common/Platform.h" #include "common/xmrig.h" -#include "interfaces/IStrategyListener.h" #include "net/strategies/DonateStrategy.h" diff --git a/src/net/strategies/DonateStrategy.h b/src/net/strategies/DonateStrategy.h index 66c0375c0..95ff6608a 100644 --- a/src/net/strategies/DonateStrategy.h +++ b/src/net/strategies/DonateStrategy.h @@ -30,9 +30,9 @@ #include "common/net/Pool.h" -#include "interfaces/IClientListener.h" -#include "interfaces/IStrategy.h" -#include "interfaces/IStrategyListener.h" +#include "common/interfaces/IClientListener.h" +#include "common/interfaces/IStrategy.h" +#include "common/interfaces/IStrategyListener.h" class Client;