From 5d24697b0c13f3a7c68acb367882ef373d7e70e7 Mon Sep 17 00:00:00 2001 From: Andrey Prygunkov Date: Fri, 22 May 2015 20:28:05 +0000 Subject: [PATCH] refactor: reworked declaration of global objects (singletones) --- daemon/connect/WebDownloader.cpp | 4 +--- daemon/extension/PostScript.cpp | 2 -- daemon/extension/QueueScript.cpp | 3 --- daemon/extension/QueueScript.h | 2 ++ daemon/extension/ScanScript.cpp | 4 ---- daemon/feed/FeedCoordinator.cpp | 7 +------ daemon/feed/FeedCoordinator.h | 2 ++ daemon/feed/FeedFile.cpp | 4 +--- daemon/frontend/Frontend.cpp | 3 --- daemon/frontend/NCursesFrontend.cpp | 1 - daemon/main/CommandLineParser.h | 2 ++ daemon/main/Maintenance.cpp | 3 --- daemon/main/Maintenance.h | 2 ++ daemon/main/Scheduler.cpp | 6 +----- daemon/main/Scheduler.h | 4 +++- daemon/main/StackTrace.cpp | 3 +-- daemon/nntp/ArticleDownloader.cpp | 6 +----- daemon/nntp/ArticleWriter.cpp | 5 ----- daemon/nntp/ArticleWriter.h | 4 +++- daemon/nntp/ServerPool.h | 4 +++- daemon/nntp/StatMeter.cpp | 4 ---- daemon/nntp/StatMeter.h | 4 +++- daemon/postprocess/ParChecker.cpp | 2 -- daemon/postprocess/ParCoordinator.cpp | 3 --- daemon/postprocess/ParRenamer.cpp | 2 -- daemon/postprocess/PrePostProcessor.cpp | 8 -------- daemon/postprocess/PrePostProcessor.h | 4 +++- daemon/postprocess/Unpack.cpp | 2 -- daemon/queue/DiskState.cpp | 2 -- daemon/queue/DiskState.h | 2 ++ daemon/queue/DownloadInfo.cpp | 5 ----- daemon/queue/DupeCoordinator.cpp | 5 +---- daemon/queue/DupeCoordinator.h | 4 +++- daemon/queue/HistoryCoordinator.cpp | 6 ------ daemon/queue/HistoryCoordinator.h | 2 ++ daemon/queue/NZBFile.cpp | 3 --- daemon/queue/QueueCoordinator.cpp | 6 ------ daemon/queue/QueueCoordinator.h | 4 +++- daemon/queue/QueueEditor.cpp | 7 ------- daemon/queue/Scanner.cpp | 5 +---- daemon/queue/Scanner.h | 4 +++- daemon/queue/UrlCoordinator.cpp | 4 ---- daemon/queue/UrlCoordinator.h | 4 +++- daemon/remote/BinRpc.cpp | 3 --- daemon/remote/RemoteClient.cpp | 2 -- daemon/remote/RemoteServer.cpp | 4 +--- daemon/remote/WebServer.cpp | 2 -- daemon/remote/XmlRpc.cpp | 8 -------- daemon/util/Script.cpp | 2 -- 49 files changed, 48 insertions(+), 136 deletions(-) diff --git a/daemon/connect/WebDownloader.cpp b/daemon/connect/WebDownloader.cpp index 26188ace..4fb63f68 100644 --- a/daemon/connect/WebDownloader.cpp +++ b/daemon/connect/WebDownloader.cpp @@ -1,7 +1,7 @@ /* * This file is part of nzbget * - * Copyright (C) 2012-2014 Andrey Prygunkov + * Copyright (C) 2012-2015 Andrey Prygunkov * * 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 @@ -49,8 +49,6 @@ #include "Options.h" #include "Util.h" -extern Options* g_pOptions; - WebDownloader::WebDownloader() { debug("Creating WebDownloader"); diff --git a/daemon/extension/PostScript.cpp b/daemon/extension/PostScript.cpp index b773b163..f89f76fc 100644 --- a/daemon/extension/PostScript.cpp +++ b/daemon/extension/PostScript.cpp @@ -45,8 +45,6 @@ #include "Util.h" #include "Options.h" -extern Options* g_pOptions; - static const int POSTPROCESS_PARCHECK = 92; static const int POSTPROCESS_SUCCESS = 93; static const int POSTPROCESS_ERROR = 94; diff --git a/daemon/extension/QueueScript.cpp b/daemon/extension/QueueScript.cpp index 1c94d502..8c174dc1 100644 --- a/daemon/extension/QueueScript.cpp +++ b/daemon/extension/QueueScript.cpp @@ -47,9 +47,6 @@ #include "Log.h" #include "Util.h" -extern Options* g_pOptions; -extern QueueScriptCoordinator* g_pQueueScriptCoordinator; - static const char* QUEUE_EVENT_NAMES[] = { "FILE_DOWNLOADED", "NZB_ADDED", "NZB_DOWNLOADED" }; class QueueScriptController : public Thread, public NZBScriptController diff --git a/daemon/extension/QueueScript.h b/daemon/extension/QueueScript.h index 356e6dae..30850e17 100644 --- a/daemon/extension/QueueScript.h +++ b/daemon/extension/QueueScript.h @@ -73,4 +73,6 @@ public: bool HasJob(int iNZBID); }; +extern QueueScriptCoordinator* g_pQueueScriptCoordinator; + #endif diff --git a/daemon/extension/ScanScript.cpp b/daemon/extension/ScanScript.cpp index 79265cec..178b3fe7 100644 --- a/daemon/extension/ScanScript.cpp +++ b/daemon/extension/ScanScript.cpp @@ -47,10 +47,6 @@ #include "Log.h" #include "Util.h" - -extern Scanner* g_pScanner; - - void ScanScriptController::ExecuteScripts(const char* szNZBFilename, const char* szUrl, const char* szDirectory, char** pNZBName, char** pCategory, int* iPriority, NZBParameterList* pParameters, bool* bAddTop, bool* bAddPaused, diff --git a/daemon/feed/FeedCoordinator.cpp b/daemon/feed/FeedCoordinator.cpp index 716e4668..0ce0dd54 100644 --- a/daemon/feed/FeedCoordinator.cpp +++ b/daemon/feed/FeedCoordinator.cpp @@ -1,7 +1,7 @@ /* * This file is part of nzbget * - * Copyright (C) 2013-2014 Andrey Prygunkov + * Copyright (C) 2013-2015 Andrey Prygunkov * * 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 @@ -50,11 +50,6 @@ #include "DiskState.h" #include "DupeCoordinator.h" -extern Options* g_pOptions; -extern DiskState* g_pDiskState; -extern DupeCoordinator* g_pDupeCoordinator; - - FeedCoordinator::FeedCacheItem::FeedCacheItem(const char* szUrl, int iCacheTimeSec,const char* szCacheId, time_t tLastUsage, FeedItemInfos* pFeedItemInfos) { diff --git a/daemon/feed/FeedCoordinator.h b/daemon/feed/FeedCoordinator.h index 0406f4fe..746540d0 100644 --- a/daemon/feed/FeedCoordinator.h +++ b/daemon/feed/FeedCoordinator.h @@ -127,6 +127,8 @@ public: Feeds* GetFeeds() { return &m_Feeds; } }; +extern FeedCoordinator* g_pFeedCoordinator; + class FeedDownloader : public WebDownloader { private: diff --git a/daemon/feed/FeedFile.cpp b/daemon/feed/FeedFile.cpp index a68d0af9..875c8725 100644 --- a/daemon/feed/FeedFile.cpp +++ b/daemon/feed/FeedFile.cpp @@ -1,7 +1,7 @@ /* * This file is part of nzbget * - * Copyright (C) 2013-2014 Andrey Prygunkov + * Copyright (C) 2013-2015 Andrey Prygunkov * * 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 @@ -51,8 +51,6 @@ using namespace MSXML; #include "Options.h" #include "Util.h" -extern Options* g_pOptions; - FeedFile::FeedFile(const char* szFileName) { debug("Creating FeedFile"); diff --git a/daemon/frontend/Frontend.cpp b/daemon/frontend/Frontend.cpp index dd4157d4..91e8a5ff 100644 --- a/daemon/frontend/Frontend.cpp +++ b/daemon/frontend/Frontend.cpp @@ -51,9 +51,6 @@ #include "Util.h" #include "StatMeter.h" -extern Options* g_pOptions; -extern StatMeter* g_pStatMeter; - Frontend::Frontend() { debug("Creating Frontend"); diff --git a/daemon/frontend/NCursesFrontend.cpp b/daemon/frontend/NCursesFrontend.cpp index 2f1e47b7..adb98192 100644 --- a/daemon/frontend/NCursesFrontend.cpp +++ b/daemon/frontend/NCursesFrontend.cpp @@ -73,7 +73,6 @@ void curses_clear() #undef clear #endif -extern Options* g_pOptions; extern void ExitProc(); static const int NCURSES_COLORPAIR_TEXT = 1; diff --git a/daemon/main/CommandLineParser.h b/daemon/main/CommandLineParser.h index 0f2ba3e6..ec265155 100644 --- a/daemon/main/CommandLineParser.h +++ b/daemon/main/CommandLineParser.h @@ -158,4 +158,6 @@ public: bool GetPauseDownload() const { return m_bPauseDownload; } }; +extern CommandLineParser* g_pCommandLineParser; + #endif diff --git a/daemon/main/Maintenance.cpp b/daemon/main/Maintenance.cpp index c3b5c9b1..b9bb793d 100644 --- a/daemon/main/Maintenance.cpp +++ b/daemon/main/Maintenance.cpp @@ -47,9 +47,6 @@ #include "Options.h" #include "CommandLineParser.h" -extern Options* g_pOptions; -extern CommandLineParser* g_pCommandLineParser; -extern Maintenance* g_pMaintenance; extern void ExitProc(); extern int g_iArgumentCount; extern char* (*g_szArguments)[]; diff --git a/daemon/main/Maintenance.h b/daemon/main/Maintenance.h index 7c7120ab..9c3ca039 100644 --- a/daemon/main/Maintenance.h +++ b/daemon/main/Maintenance.h @@ -62,6 +62,8 @@ public: bool CheckUpdates(char** pUpdateInfo); }; +extern Maintenance* g_pMaintenance; + class UpdateScriptController : public Thread, public ScriptController { private: diff --git a/daemon/main/Scheduler.cpp b/daemon/main/Scheduler.cpp index aff25473..12023fe1 100644 --- a/daemon/main/Scheduler.cpp +++ b/daemon/main/Scheduler.cpp @@ -1,7 +1,7 @@ /* * This file is part of nzbget * - * Copyright (C) 2008-2014 Andrey Prygunkov + * Copyright (C) 2008-2015 Andrey Prygunkov * * 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 @@ -47,10 +47,6 @@ #include "FeedCoordinator.h" #include "SchedulerScript.h" -extern Options* g_pOptions; -extern ServerPool* g_pServerPool; -extern FeedCoordinator* g_pFeedCoordinator; - Scheduler::Task::Task(int iID, int iHours, int iMinutes, int iWeekDaysBits, ECommand eCommand, const char* szParam) { m_iID = iID; diff --git a/daemon/main/Scheduler.h b/daemon/main/Scheduler.h index bc8af43e..fb6bbe1d 100644 --- a/daemon/main/Scheduler.h +++ b/daemon/main/Scheduler.h @@ -1,7 +1,7 @@ /* * This file is part of nzbget * - * Copyright (C) 2008-2014 Andrey Prygunkov + * Copyright (C) 2008-2015 Andrey Prygunkov * * 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 @@ -101,4 +101,6 @@ public: void IntervalCheck(); }; +extern Scheduler* g_pScheduler; + #endif diff --git a/daemon/main/StackTrace.cpp b/daemon/main/StackTrace.cpp index 2f08d4f3..8dae841f 100644 --- a/daemon/main/StackTrace.cpp +++ b/daemon/main/StackTrace.cpp @@ -1,7 +1,7 @@ /* * This file is part of nzbget * - * Copyright (C) 2007-2014 Andrey Prygunkov + * Copyright (C) 2007-2015 Andrey Prygunkov * * 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 @@ -54,7 +54,6 @@ #include "Options.h" #include "StackTrace.h" -extern Options* g_pOptions; extern void ExitProc(); #ifdef WIN32 diff --git a/daemon/nntp/ArticleDownloader.cpp b/daemon/nntp/ArticleDownloader.cpp index 30b1c033..2a5b65db 100644 --- a/daemon/nntp/ArticleDownloader.cpp +++ b/daemon/nntp/ArticleDownloader.cpp @@ -2,7 +2,7 @@ * This file is part of nzbget * * Copyright (C) 2004 Sven Henkel - * Copyright (C) 2007-2014 Andrey Prygunkov + * Copyright (C) 2007-2015 Andrey Prygunkov * * 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 @@ -54,10 +54,6 @@ #include "StatMeter.h" #include "Util.h" -extern Options* g_pOptions; -extern ServerPool* g_pServerPool; -extern StatMeter* g_pStatMeter; - ArticleDownloader::ArticleDownloader() { debug("Creating ArticleDownloader"); diff --git a/daemon/nntp/ArticleWriter.cpp b/daemon/nntp/ArticleWriter.cpp index 5cc7702a..7be54b43 100644 --- a/daemon/nntp/ArticleWriter.cpp +++ b/daemon/nntp/ArticleWriter.cpp @@ -51,11 +51,6 @@ #include "Log.h" #include "Util.h" -extern Options* g_pOptions; -extern DiskState* g_pDiskState; -extern ArticleCache* g_pArticleCache; - - ArticleWriter::ArticleWriter() { debug("Creating ArticleWriter"); diff --git a/daemon/nntp/ArticleWriter.h b/daemon/nntp/ArticleWriter.h index 2460fcf6..e512a486 100644 --- a/daemon/nntp/ArticleWriter.h +++ b/daemon/nntp/ArticleWriter.h @@ -1,7 +1,7 @@ /* * This file is part of nzbget * - * Copyright (C) 2014 Andrey Prygunkov + * Copyright (C) 2014-2015 Andrey Prygunkov * * 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 @@ -99,4 +99,6 @@ public: bool FileBusy(FileInfo* pFileInfo) { return pFileInfo == m_pFileInfo; } }; +extern ArticleCache* g_pArticleCache; + #endif diff --git a/daemon/nntp/ServerPool.h b/daemon/nntp/ServerPool.h index 5a0ae5fc..3ee0c122 100644 --- a/daemon/nntp/ServerPool.h +++ b/daemon/nntp/ServerPool.h @@ -2,7 +2,7 @@ * This file is part of nzbget * * Copyright (C) 2004 Sven Henkel - * Copyright (C) 2007-2014 Andrey Prygunkov + * Copyright (C) 2007-2015 Andrey Prygunkov * * 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 @@ -87,4 +87,6 @@ public: void BlockServer(NewsServer* pNewsServer); }; +extern ServerPool* g_pServerPool; + #endif diff --git a/daemon/nntp/StatMeter.cpp b/daemon/nntp/StatMeter.cpp index a8c9976d..d440cb8f 100644 --- a/daemon/nntp/StatMeter.cpp +++ b/daemon/nntp/StatMeter.cpp @@ -42,10 +42,6 @@ #include "DiskState.h" #include "Util.h" -extern ServerPool* g_pServerPool; -extern Options* g_pOptions; -extern DiskState* g_pDiskState; - static const int DAYS_UP_TO_2013_JAN_1 = 15706; static const int DAYS_IN_TWENTY_YEARS = 366*20; diff --git a/daemon/nntp/StatMeter.h b/daemon/nntp/StatMeter.h index 6cd8599c..6598a867 100644 --- a/daemon/nntp/StatMeter.h +++ b/daemon/nntp/StatMeter.h @@ -1,7 +1,7 @@ /* * This file is part of nzbget * - * Copyright (C) 2014 Andrey Prygunkov + * Copyright (C) 2014-2015 Andrey Prygunkov * * 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 @@ -140,4 +140,6 @@ public: bool Load(bool* pPerfectServerMatch); }; +extern StatMeter* g_pStatMeter; + #endif diff --git a/daemon/postprocess/ParChecker.cpp b/daemon/postprocess/ParChecker.cpp index ddd4fa4f..686870dd 100644 --- a/daemon/postprocess/ParChecker.cpp +++ b/daemon/postprocess/ParChecker.cpp @@ -55,8 +55,6 @@ #include "Options.h" #include "Util.h" -extern Options* g_pOptions; - const char* Par2CmdLineErrStr[] = { "OK", "data files are damaged and there is enough recovery data available to repair them", "data files are damaged and there is insufficient recovery data available to be able to repair them", diff --git a/daemon/postprocess/ParCoordinator.cpp b/daemon/postprocess/ParCoordinator.cpp index 22c5ccda..6df78083 100644 --- a/daemon/postprocess/ParCoordinator.cpp +++ b/daemon/postprocess/ParCoordinator.cpp @@ -50,9 +50,6 @@ #include "Log.h" #include "Util.h" -extern Options* g_pOptions; -extern DiskState* g_pDiskState; - #ifndef DISABLE_PARCHECK bool ParCoordinator::PostParChecker::RequestMorePars(int iBlockNeeded, int* pBlockFound) { diff --git a/daemon/postprocess/ParRenamer.cpp b/daemon/postprocess/ParRenamer.cpp index 9cb86188..c9533920 100644 --- a/daemon/postprocess/ParRenamer.cpp +++ b/daemon/postprocess/ParRenamer.cpp @@ -52,8 +52,6 @@ #include "Options.h" #include "Util.h" -extern Options* g_pOptions; - class ParRenamerRepairer : public Par2Repairer { public: diff --git a/daemon/postprocess/PrePostProcessor.cpp b/daemon/postprocess/PrePostProcessor.cpp index 47706c72..e904c279 100644 --- a/daemon/postprocess/PrePostProcessor.cpp +++ b/daemon/postprocess/PrePostProcessor.cpp @@ -58,14 +58,6 @@ #include "QueueScript.h" #include "ParParser.h" -extern HistoryCoordinator* g_pHistoryCoordinator; -extern DupeCoordinator* g_pDupeCoordinator; -extern Options* g_pOptions; -extern Scheduler* g_pScheduler; -extern Scanner* g_pScanner; -extern StatMeter* g_pStatMeter; -extern QueueScriptCoordinator* g_pQueueScriptCoordinator; - PrePostProcessor::PrePostProcessor() { debug("Creating PrePostProcessor"); diff --git a/daemon/postprocess/PrePostProcessor.h b/daemon/postprocess/PrePostProcessor.h index 8614216e..0c6ee2a0 100644 --- a/daemon/postprocess/PrePostProcessor.h +++ b/daemon/postprocess/PrePostProcessor.h @@ -1,7 +1,7 @@ /* * This file is part of nzbget * - * Copyright (C) 2007-2014 Andrey Prygunkov + * Copyright (C) 2007-2015 Andrey Prygunkov * * 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 @@ -80,4 +80,6 @@ public: void NZBDownloaded(DownloadQueue* pDownloadQueue, NZBInfo* pNZBInfo); }; +extern PrePostProcessor* g_pPrePostProcessor; + #endif diff --git a/daemon/postprocess/Unpack.cpp b/daemon/postprocess/Unpack.cpp index bbc9341a..d9619844 100644 --- a/daemon/postprocess/Unpack.cpp +++ b/daemon/postprocess/Unpack.cpp @@ -47,8 +47,6 @@ #include "ParParser.h" #include "Options.h" -extern Options* g_pOptions; - void UnpackController::FileList::Clear() { for (iterator it = begin(); it != end(); it++) diff --git a/daemon/queue/DiskState.cpp b/daemon/queue/DiskState.cpp index 6094e677..0f262a0a 100644 --- a/daemon/queue/DiskState.cpp +++ b/daemon/queue/DiskState.cpp @@ -50,8 +50,6 @@ #include "Log.h" #include "Util.h" -extern Options* g_pOptions; - static const char* FORMATVERSION_SIGNATURE = "nzbget diskstate file version "; #ifdef WIN32 diff --git a/daemon/queue/DiskState.h b/daemon/queue/DiskState.h index 93f8b3f6..73d8bc8b 100644 --- a/daemon/queue/DiskState.h +++ b/daemon/queue/DiskState.h @@ -97,4 +97,6 @@ public: void LoadNZBMessages(int iNZBID, MessageList* pMessages); }; +extern DiskState* g_pDiskState; + #endif diff --git a/daemon/queue/DownloadInfo.cpp b/daemon/queue/DownloadInfo.cpp index e4960f67..99ec80ac 100644 --- a/daemon/queue/DownloadInfo.cpp +++ b/daemon/queue/DownloadInfo.cpp @@ -47,10 +47,6 @@ #include "Options.h" #include "Util.h" -extern Options* g_pOptions; -extern ArticleCache* g_pArticleCache; -extern DiskState* g_pDiskState; - int FileInfo::m_iIDGen = 0; int FileInfo::m_iIDMax = 0; int NZBInfo::m_iIDGen = 0; @@ -58,7 +54,6 @@ int NZBInfo::m_iIDMax = 0; DownloadQueue* DownloadQueue::g_pDownloadQueue = NULL; bool DownloadQueue::g_bLoaded = false; - NZBParameter::NZBParameter(const char* szName) { m_szName = strdup(szName); diff --git a/daemon/queue/DupeCoordinator.cpp b/daemon/queue/DupeCoordinator.cpp index 478e66fc..2d6413a2 100644 --- a/daemon/queue/DupeCoordinator.cpp +++ b/daemon/queue/DupeCoordinator.cpp @@ -1,7 +1,7 @@ /* * This file is part of nzbget * - * Copyright (C) 2007-2014 Andrey Prygunkov + * Copyright (C) 2007-2015 Andrey Prygunkov * * 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 @@ -50,9 +50,6 @@ #include "HistoryCoordinator.h" #include "DupeCoordinator.h" -extern HistoryCoordinator* g_pHistoryCoordinator; -extern Options* g_pOptions; - bool DupeCoordinator::SameNameOrKey(const char* szName1, const char* szDupeKey1, const char* szName2, const char* szDupeKey2) { diff --git a/daemon/queue/DupeCoordinator.h b/daemon/queue/DupeCoordinator.h index 048cc809..f0841c32 100644 --- a/daemon/queue/DupeCoordinator.h +++ b/daemon/queue/DupeCoordinator.h @@ -1,7 +1,7 @@ /* * This file is part of nzbget * - * Copyright (C) 2007-2014 Andrey Prygunkov + * Copyright (C) 2007-2015 Andrey Prygunkov * * 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 @@ -53,4 +53,6 @@ public: EDupeStatus GetDupeStatus(DownloadQueue* pDownloadQueue, const char* szName, const char* szDupeKey); }; +extern DupeCoordinator* g_pDupeCoordinator; + #endif diff --git a/daemon/queue/HistoryCoordinator.cpp b/daemon/queue/HistoryCoordinator.cpp index 5a6c3adc..e9c4e9cf 100644 --- a/daemon/queue/HistoryCoordinator.cpp +++ b/daemon/queue/HistoryCoordinator.cpp @@ -55,12 +55,6 @@ #include "PrePostProcessor.h" #include "DupeCoordinator.h" -extern QueueCoordinator* g_pQueueCoordinator; -extern PrePostProcessor* g_pPrePostProcessor; -extern DupeCoordinator* g_pDupeCoordinator; -extern Options* g_pOptions; -extern DiskState* g_pDiskState; - HistoryCoordinator::HistoryCoordinator() { debug("Creating HistoryCoordinator"); diff --git a/daemon/queue/HistoryCoordinator.h b/daemon/queue/HistoryCoordinator.h index 939d3046..094bb5a9 100644 --- a/daemon/queue/HistoryCoordinator.h +++ b/daemon/queue/HistoryCoordinator.h @@ -53,4 +53,6 @@ public: void Cleanup(); }; +extern HistoryCoordinator* g_pHistoryCoordinator; + #endif diff --git a/daemon/queue/NZBFile.cpp b/daemon/queue/NZBFile.cpp index e84b0132..f3aa9996 100644 --- a/daemon/queue/NZBFile.cpp +++ b/daemon/queue/NZBFile.cpp @@ -54,9 +54,6 @@ using namespace MSXML; #include "DiskState.h" #include "Util.h" -extern Options* g_pOptions; -extern DiskState* g_pDiskState; - NZBFile::NZBFile(const char* szFileName, const char* szCategory) { debug("Creating NZBFile"); diff --git a/daemon/queue/QueueCoordinator.cpp b/daemon/queue/QueueCoordinator.cpp index 1a6958a7..d1ed8146 100644 --- a/daemon/queue/QueueCoordinator.cpp +++ b/daemon/queue/QueueCoordinator.cpp @@ -53,12 +53,6 @@ #include "Decoder.h" #include "StatMeter.h" -extern Options* g_pOptions; -extern ServerPool* g_pServerPool; -extern DiskState* g_pDiskState; -extern StatMeter* g_pStatMeter; -extern ArticleCache* g_pArticleCache; - bool QueueCoordinator::CoordinatorDownloadQueue::EditEntry( int ID, EEditAction eAction, int iOffset, const char* szText) { diff --git a/daemon/queue/QueueCoordinator.h b/daemon/queue/QueueCoordinator.h index 04f983f4..0ff68a52 100644 --- a/daemon/queue/QueueCoordinator.h +++ b/daemon/queue/QueueCoordinator.h @@ -2,7 +2,7 @@ * This file is part of nzbget * * Copyright (C) 2004 Sven Henkel - * Copyright (C) 2007-2014 Andrey Prygunkov + * Copyright (C) 2007-2015 Andrey Prygunkov * * 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 @@ -97,4 +97,6 @@ public: bool SplitQueueEntries(DownloadQueue* pDownloadQueue, FileList* pFileList, const char* szName, NZBInfo** pNewNZBInfo); }; +extern QueueCoordinator* g_pQueueCoordinator; + #endif diff --git a/daemon/queue/QueueEditor.cpp b/daemon/queue/QueueEditor.cpp index ecff7ca6..3f2e1eb9 100644 --- a/daemon/queue/QueueEditor.cpp +++ b/daemon/queue/QueueEditor.cpp @@ -54,15 +54,8 @@ #include "HistoryCoordinator.h" #include "UrlCoordinator.h" -extern QueueCoordinator* g_pQueueCoordinator; -extern HistoryCoordinator* g_pHistoryCoordinator; -extern UrlCoordinator* g_pUrlCoordinator; -extern PrePostProcessor* g_pPrePostProcessor; -extern Options* g_pOptions; - const int MAX_ID = 1000000000; - class GroupSorter { public: diff --git a/daemon/queue/Scanner.cpp b/daemon/queue/Scanner.cpp index 408bb090..45d36ab5 100644 --- a/daemon/queue/Scanner.cpp +++ b/daemon/queue/Scanner.cpp @@ -1,7 +1,7 @@ /* * This file is part of nzbget * - * Copyright (C) 2007-2014 Andrey Prygunkov + * Copyright (C) 2007-2015 Andrey Prygunkov * * 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 @@ -49,9 +49,6 @@ #include "ScanScript.h" #include "Util.h" -extern QueueCoordinator* g_pQueueCoordinator; -extern Options* g_pOptions; - Scanner::FileData::FileData(const char* szFilename) { m_szFilename = strdup(szFilename); diff --git a/daemon/queue/Scanner.h b/daemon/queue/Scanner.h index f472a9e1..c3a71238 100644 --- a/daemon/queue/Scanner.h +++ b/daemon/queue/Scanner.h @@ -1,7 +1,7 @@ /* * This file is part of nzbget * - * Copyright (C) 2007-2014 Andrey Prygunkov + * Copyright (C) 2007-2015 Andrey Prygunkov * * 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 @@ -133,4 +133,6 @@ public: void InitPPParameters(const char* szCategory, NZBParameterList* pParameters, bool bReset); }; +extern Scanner* g_pScanner; + #endif diff --git a/daemon/queue/UrlCoordinator.cpp b/daemon/queue/UrlCoordinator.cpp index 07b052a2..be11f677 100644 --- a/daemon/queue/UrlCoordinator.cpp +++ b/daemon/queue/UrlCoordinator.cpp @@ -49,10 +49,6 @@ #include "Scanner.h" #include "DiskState.h" -extern Options* g_pOptions; -extern Scanner* g_pScanner; -extern DiskState* g_pDiskState; - UrlDownloader::UrlDownloader() : WebDownloader() { m_szCategory = NULL; diff --git a/daemon/queue/UrlCoordinator.h b/daemon/queue/UrlCoordinator.h index 81957f94..36b289a6 100644 --- a/daemon/queue/UrlCoordinator.h +++ b/daemon/queue/UrlCoordinator.h @@ -1,7 +1,7 @@ /* * This file is part of nzbget * - * Copyright (C) 2012-2014 Andrey Prygunkov + * Copyright (C) 2012-2015 Andrey Prygunkov * * 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 @@ -69,6 +69,8 @@ public: bool DeleteQueueEntry(DownloadQueue* pDownloadQueue, NZBInfo* pNZBInfo, bool bAvoidHistory); }; +extern UrlCoordinator* g_pUrlCoordinator; + class UrlDownloader : public WebDownloader { private: diff --git a/daemon/remote/BinRpc.cpp b/daemon/remote/BinRpc.cpp index 1e0920b9..917cd2b0 100644 --- a/daemon/remote/BinRpc.cpp +++ b/daemon/remote/BinRpc.cpp @@ -52,9 +52,6 @@ #include "Scanner.h" #include "StatMeter.h" -extern Options* g_pOptions; -extern Scanner* g_pScanner; -extern StatMeter* g_pStatMeter; extern void ExitProc(); extern void Reload(); diff --git a/daemon/remote/RemoteClient.cpp b/daemon/remote/RemoteClient.cpp index 53205249..04785206 100644 --- a/daemon/remote/RemoteClient.cpp +++ b/daemon/remote/RemoteClient.cpp @@ -51,8 +51,6 @@ #include "Log.h" #include "Util.h" -extern Options* g_pOptions; - RemoteClient::RemoteClient() { m_pConnection = NULL; diff --git a/daemon/remote/RemoteServer.cpp b/daemon/remote/RemoteServer.cpp index 9722684c..7efe1b14 100644 --- a/daemon/remote/RemoteServer.cpp +++ b/daemon/remote/RemoteServer.cpp @@ -2,7 +2,7 @@ * This file is part of nzbget * * Copyright (C) 2005 Bo Cordes Petersen - * Copyright (C) 2007-2013 Andrey Prygunkov + * Copyright (C) 2007-2015 Andrey Prygunkov * * 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 @@ -50,8 +50,6 @@ #include "Options.h" #include "Util.h" -extern Options* g_pOptions; - //***************************************************************** // RemoteServer diff --git a/daemon/remote/WebServer.cpp b/daemon/remote/WebServer.cpp index 430ddbfc..48ef06af 100644 --- a/daemon/remote/WebServer.cpp +++ b/daemon/remote/WebServer.cpp @@ -45,8 +45,6 @@ #include "Options.h" #include "Util.h" -extern Options* g_pOptions; - static const char* ERR_HTTP_BAD_REQUEST = "400 Bad Request"; static const char* ERR_HTTP_NOT_FOUND = "404 Not Found"; static const char* ERR_HTTP_SERVICE_UNAVAILABLE = "503 Service Unavailable"; diff --git a/daemon/remote/XmlRpc.cpp b/daemon/remote/XmlRpc.cpp index 5ef64aa2..fc729cd2 100644 --- a/daemon/remote/XmlRpc.cpp +++ b/daemon/remote/XmlRpc.cpp @@ -53,14 +53,6 @@ #include "DiskState.h" #include "ScriptConfig.h" -extern Options* g_pOptions; -extern Scanner* g_pScanner; -extern FeedCoordinator* g_pFeedCoordinator; -extern ServerPool* g_pServerPool; -extern Maintenance* g_pMaintenance; -extern StatMeter* g_pStatMeter; -extern ArticleCache* g_pArticleCache; -extern DiskState* g_pDiskState; extern void ExitProc(); extern void Reload(); diff --git a/daemon/util/Script.cpp b/daemon/util/Script.cpp index 2cb32df7..300fc493 100644 --- a/daemon/util/Script.cpp +++ b/daemon/util/Script.cpp @@ -56,8 +56,6 @@ // System global variable holding environments variables extern char** environ; - -extern Options* g_pOptions; extern char* (*g_szEnvironmentVariables)[]; ScriptController::RunningScripts ScriptController::m_RunningScripts;