]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Namespace cleanups and dead code removal
authorFrancesco Chemolli <kinkie@squid-cache.org>
Sun, 13 Jul 2008 08:37:43 +0000 (10:37 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Sun, 13 Jul 2008 08:37:43 +0000 (10:37 +0200)
22 files changed:
include/profiling.h
src/ACLASN.h
src/AccessLogEntry.h
src/AuthConfig.h
src/DelayPools.h
src/DiskIO/DiskIOModule.h
src/ExternalACL.h
src/HttpHeader.cc
src/HttpHeader.h
src/Mem.h
src/ProfStats.cc
src/SquidString.h
src/Store.h
src/StoreFileSystem.h
src/delay_pools.cc
src/dns.cc
src/external_acl.cc
src/forward.h
src/main.cc
src/pconn.h
src/protos.h
src/store.cc

index 88d354a59328589c102e3562715a675cdd03240e..c6ab231361ddf4dc3ca1ba554b4db8165139837e 100644 (file)
@@ -213,9 +213,6 @@ SQUIDCEXTERN TimersArray *xprof_Timers;
 SQUIDCEXTERN void xprof_start(xprof_type type, const char *timer);
 SQUIDCEXTERN void xprof_stop(xprof_type type, const char *timer);
 SQUIDCEXTERN void xprof_event(void *data);
-#if __cplusplus
-extern void xprofRegisterWithCacheManager(void);
-#endif
 
 #define PROF_start(type) xprof_start(XPROF_##type, #type)
 #define PROF_stop(type) xprof_stop(XPROF_##type, #type)
index 63585936d57165710ef805ed689d6198074cbd8c..d6223adb2ed42047b65dcf86782901762cb09b2b 100644 (file)
 #include "ACLChecklist.h"
 #include "IPAddress.h"
 
-/* forward decls */
-
-class CacheManager;
-
 SQUIDCEXTERN int asnMatchIp(CbDataList<int> *, IPAddress &);
 
 /// \ingroup ACLAPI
index ef559f3df54031c9bafeed76829ed12c3690c7e8..e26facd6e8afb6687c4a862b84170c82d5069cf9 100644 (file)
@@ -40,7 +40,6 @@
 #include "HttpRequestMethod.h"
 
 /* forward decls */
-class CacheManager;
 class HttpReply;
 class HttpRequest;
 
index 6f675e3b374e0833ca50b46f991c639ea65f6459..206a8507f1e62ccca489030daa41ca2c29547dbb 100644 (file)
@@ -36,7 +36,6 @@ class AuthUserRequest;
 class StoreEntry;
 class HttpReply;
 class HttpRequest;
-class CacheManager;
 
 /* for http_hdr_type parameters-by-value */
 #include "HttpHeader.h"
index f9468fbf4b26eab4b21c9c63e8f0e7fce9dc1cda..42eb81f7c4a9a4aa2f3f7e9c3f94cad9387263b0 100644 (file)
@@ -50,7 +50,6 @@ public:
 };
 
 /* forward decls */
-class CacheManager;
 class DelayPool;
 class Updateable;
 class StoreEntry;
@@ -64,7 +63,6 @@ class DelayPools
 
 public:
     static void Init();
-    static void RegisterWithCacheManager(void);
     static void Update(void *);
     static unsigned short pools();
     static void pools (u_short pools);
@@ -82,6 +80,7 @@ private:
     static unsigned short pools_;
     static void FreeDelayData ();
     static Vector<Updateable *> toUpdate;
+    static void RegisterWithCacheManager(void);
 };
 
 #endif /* SQUID_DELAYPOOLS_H */
index a766e1c907638b4e5987494d49666ccd84cac54f..98c284704555ea9a4b467849c8e942dbf0cadbfe 100644 (file)
@@ -47,7 +47,6 @@ class DiskIOModule
 {
 
 public:
-    static void RegisterAllModulesWithCacheManager(void);
     static void SetupAllModules();
     static void ModuleAdd(DiskIOModule &);
     static void FreeAllModules();
@@ -74,6 +73,7 @@ public:
 
 protected:
     //bool initialised;
+    static void RegisterAllModulesWithCacheManager(void);
 
 private:
     static Vector<DiskIOModule*> &GetModules();
index ac6998e47258b8cf65b8ea1bb7b547ae67245923..8b15be8bea419b6b59bdd144a774bac9eff9d8b8 100644 (file)
@@ -92,6 +92,4 @@ protected:
 
 MEMPROXY_CLASS_INLINE(ACLExternal);
 
-extern void externalAclRegisterWithCacheManager(void);
-
 #endif /* SQUID_EXTERNALACL_H */
index 062088c17609a44605d1ede491114bd676154838..9d457c2db50b66f82f5e975ccdcac520ecc0065b 100644 (file)
@@ -272,6 +272,15 @@ static void httpHeaderStatDump(const HttpHeaderStat * hs, StoreEntry * e);
  * Module initialization routines
  */
 
+static void
+httpHeaderRegisterWithCacheManager(void)
+{
+    CacheManager::GetInstance()->
+        registerAction("http_headers",
+                       "HTTP Header Statistics",
+                       httpHeaderStoreReport, 0, 1);
+}
+
 void
 httpHeaderInitModule(void)
 {
@@ -330,15 +339,6 @@ httpHeaderInitModule(void)
     httpHeaderRegisterWithCacheManager();
 }
 
-void
-httpHeaderRegisterWithCacheManager(void)
-{
-    CacheManager::GetInstance()->
-        registerAction("http_headers",
-                       "HTTP Header Statistics",
-                       httpHeaderStoreReport, 0, 1);
-}
-
 void
 httpHeaderCleanModule(void)
 {
index 29a84a550275188f1760c8ebab563161985cd9f6..74225a9949e8b41821b44e80bd5f3381dc830a4e 100644 (file)
@@ -33,9 +33,6 @@
 #ifndef SQUID_HTTPHEADER_H
 #define SQUID_HTTPHEADER_H
 
-/* forward decls */
-
-class CacheManager;
 
 /* because we pass a spec by value */
 #include "HttpHeaderRange.h"
@@ -269,7 +266,6 @@ private:
 };
 
 
-extern void httpHeaderRegisterWithCacheManager(void);
 extern int httpHeaderParseQuotedString (const char *start, String *val);
 SQUIDCEXTERN int httpHeaderHasByNameListMember(const HttpHeader * hdr, const char *name, const char *member, const char separator);
 SQUIDCEXTERN void httpHeaderUpdate(HttpHeader * old, const HttpHeader * fresh, const HttpHeaderMask * denied_mask);
index ba2d3cc7b779ee05de64776d2e20e42f13c333cb..f188cc51064d772b02175f2395a488d1c78802a8 100644 (file)
--- a/src/Mem.h
+++ b/src/Mem.h
@@ -34,7 +34,6 @@
 #ifndef SQUID_MEM
 #define SQUID_MEM
 
-class CacheManager;
 class StoreEntry;
 class MemPoolStats;
 class MemPoolMeter;
index 0afa1aaa99361d0e3a0eba13e6ea350b24c6ecb7..514b93089fca612a751bf1906ab475252d9b05d4 100644 (file)
@@ -265,6 +265,13 @@ xprof_chk_overhead(int samples)
     }
 }
 
+static void
+xprofRegisterWithCacheManager(void)
+{
+    CacheManager::GetInstance()->
+         registerAction("cpu_profile", "CPU Profiling Stats", xprof_summary, 0, 1);
+}
+
 // FIXME: 
 // this gets colled once per event. This doesn't seem to make much sense,
 // does it?
@@ -282,13 +289,6 @@ xprof_Init(void)
     xprofRegisterWithCacheManager(); //moved here so it's not double-init'ed
 }
 
-void
-xprofRegisterWithCacheManager(void)
-{
-    CacheManager::GetInstance()->
-         registerAction("cpu_profile", "CPU Profiling Stats", xprof_summary, 0, 1);
-}
-
 void
 xprof_event(void *data)
 {
index db650e3f8962ac80ba5f417a0474409eaef01ed2..fd4470740813f4a3d169301dc54134246197b22d 100644 (file)
 
 #include "config.h"
 
-/* forward decls */
-
-class CacheManager;
-
 /** todo checks to wrap this include properly */
 #include <ostream>
 
index 4dce408fac64ae1483661a21cfe972a425e9ac8d..da432a0dd9f7b2985fde473758f016be0f8366f5 100644 (file)
@@ -338,9 +338,6 @@ SQUIDCEXTERN StoreEntry *storeCreateEntry(const char *, const char *, request_fl
 /// \ingroup StoreAPI
 SQUIDCEXTERN void storeInit(void);
 
-/// \ingroup StoreAPI
-extern void storeRegisterWithCacheManager(void);
-
 /// \ingroup StoreAPI
 SQUIDCEXTERN void storeConfigure(void);
 
index 453f2caf3e8a8455fc40df712c2eab89fd176e9d..b1e1d3fd1bee2fd13d97e7565dc36e70361bcaca 100644 (file)
  *    given StoreEntry. A maxobjsize of -1 means 'any size'.
  */
 
-class CacheManager;
 class SwapDir;
 
 /**
@@ -117,7 +116,6 @@ class StoreFileSystem
 {
 
 public:
-    static void RegisterAllFsWithCacheManager(void);
     static void SetupAllFs();
     static void FsAdd(StoreFileSystem &);
     static void FreeAllFs();
@@ -131,7 +129,6 @@ public:
     virtual char const *type () const = 0;
     virtual SwapDir *createSwapDir() = 0;
     virtual void done() = 0;
-    virtual void registerWithCacheManager(void);
     virtual void setup() = 0;
     // Not implemented
     StoreFileSystem(StoreFileSystem const &);
@@ -139,10 +136,12 @@ public:
 
 protected:
     bool initialised;
+    virtual void registerWithCacheManager(void);
 
 private:
     static Vector<StoreFileSystem*> &GetFileSystems();
     static Vector<StoreFileSystem*> *_FileSystems;
+    static void RegisterAllFsWithCacheManager(void);
 };
 
 // TODO: Kill this typedef!
index c593fce3b4246a58ccda4ed1ef2e254cdf7eb76b..31efc28c46001d434954a22dae31f98ee87b2ec1 100644 (file)
@@ -550,19 +550,20 @@ time_t DelayPools::LastUpdate = 0;
 unsigned short DelayPools::pools_ (0);
 
 void
-DelayPools::Init()
+DelayPools::RegisterWithCacheManager(void)
 {
-    LastUpdate = getCurrentTime();
-    RegisterWithCacheManager();
+    CacheManager::GetInstance()->
+        registerAction("delay", "Delay Pool Levels", Stats, 0, 1);
 }
 
 void
-DelayPools::RegisterWithCacheManager(void)
+DelayPools::Init()
 {
-    CacheManager::GetInstance()->
-        registerAction("delay", "Delay Pool Levels", Stats, 0, 1);
+    LastUpdate = getCurrentTime();
+    RegisterWithCacheManager();
 }
 
+
 void
 DelayPools::InitDelayData()
 {
index 8e2c0c8f93691ad04d25aa010c65e24c25ce5a82..2b0b0a7451701bf9fdb1770d91539b8d334b145c 100644 (file)
@@ -55,6 +55,13 @@ dnsStats(StoreEntry * sentry)
     helperStats(sentry, dnsservers);
 }
 
+static void
+dnsRegisterWithCacheManager(void)
+{
+    CacheManager::GetInstance->
+        registerAction("dns", "Dnsserver Statistics", dnsStats, 0, 1);
+}
+
 void
 dnsInit(void)
 {
@@ -87,13 +94,6 @@ dnsInit(void)
     helperOpenServers(dnsservers);
 }
 
-void
-dnsRegisterWithCacheManager(void)
-{
-    CacheManager::GetInstance->
-        registerAction("dns", "Dnsserver Statistics", dnsStats, 0, 1);
-}
-
 void
 dnsShutdown(void)
 {
index 0abe12346890e9e1e40c2f27a0147cfcbf5f4ea9..513904c315b560aa7644d9f4312dc0456b36fa34 100644 (file)
@@ -1293,6 +1293,15 @@ externalAclStats(StoreEntry * sentry)
     }
 }
 
+static void
+externalAclRegisterWithCacheManager(void)
+{
+    CacheManager::GetInstance()->
+        registerAction("external_acl",
+                       "External ACL stats",
+                       externalAclStats, 0, 1);
+}
+
 void
 externalAclInit(void)
 {
@@ -1327,15 +1336,6 @@ externalAclInit(void)
     externalAclRegisterWithCacheManager();
 }
 
-void
-externalAclRegisterWithCacheManager(void)
-{
-    CacheManager::GetInstance()->
-        registerAction("external_acl",
-                       "External ACL stats",
-                       externalAclStats, 0, 1);
-}
-
 void
 externalAclShutdown(void)
 {
index 3c3b80d2bc595a9269858515451d785209ad4e6c..b9a9b90e1a005ba6caea00d495a19104df8fbf45 100644 (file)
@@ -3,7 +3,6 @@
 
 /* forward decls */
 
-class CacheManager;
 class ErrorState;
 
 #include "comm.h"
index 8ff5dcc07ff527c7de74dc39498ae0a5dfd62200..17f416f2122732b66340d2fdf8c92cf3f1d5145b 100644 (file)
@@ -968,52 +968,11 @@ mainInitialize(void)
          * coexist.
          */
 
-        //clientdbRegisterWithCacheManager(); //moved to clientdbInit()
-#if DELAY_POOLS
-
-        //DelayPools::RegisterWithCacheManager(); //moved to DelayPools::Init()
-#endif
-
-        //DiskIOModule::RegisterAllModulesWithCacheManager();
-       //  moved to each module's init() function
-#if USE_DNSSERVERS
-
-        // dnsRegisterWithCacheManager(); //moved to dnsInit()
-#endif
-
         eventInit();
-        // externalAclRegisterWithCacheManager(); //moved to externalAclInit()
-        // fqdncacheRegisterWithCacheManager(); //moved to fqdncache_init()
-        // FwdState::RegisterWithCacheManager(); //moved to FwdState::initModule
-        // httpHeaderRegisterWithCacheManager(); //moved to httpHeaderInitModule
-#if !USE_DNSSERVERS
-       //TODO: remove cache manager registration functions from namespace
-       //      (protos.h and make them static where appropriate)
-        // idnsRegisterWithCacheManager(); // moved to idnsInit()
-#endif
-
-        // ipcacheRegisterWithCacheManager(); //moved to ipcache_init()
-        // Mem::RegisterWithCacheManager(); //moved to Mem::Init()
-        // netdbRegisterWitHCacheManager(); //moved to netdbInit()
+
        // TODO: pconn is a good candidate for new-style registration
         // PconnModule::GetInstance()->registerWithCacheManager();
        //   moved to PconnModule::PconnModule()
-        // redirectRegisterWithCacheManager(); //moved to redirectInit()
-        // refreshRegisterWithCacheManager(); //moved to refreshInit()
-        // statRegisterWithCacheManager(); //moved to statInit()
-        // storeDigestRegisterWithCacheManager(); //moved to storeDigestInit()
-        // StoreFileSystem::RegisterAllFsWithCacheManager();
-        // storeRegisterWithCacheManager(); //moved to storeInit()
-        // storeLogRegisterWithCacheManager(); //moved to storeLogOpen()
-#if DEBUGSTRINGS
-        // cpu_prStringRegistry::Instance().registerWithCacheManager();
-       //   moved to class constructor
-#endif
-
-#if USE_XPROF_STATS
-        // xprofRegisterWithCacheManager(); //moved to xprof_init()
-#endif
-
     }
 
 #if USE_WCCP
index 5e612c5502897439c151181dfd0413fb0c50a18d..3253d88bb11655f8a7ecd46f4036f02186196b7a 100644 (file)
@@ -11,7 +11,6 @@
  \todo CLEANUP: Break multiple classes out of the generic pconn.h header
  */
 
-class CacheManager;
 class PconnPool;
 
 /* for CBDATA_CLASS2() macros */
@@ -90,7 +89,6 @@ private:
 };
 
 
-class CacheManager;
 class StoreEntry;
 class PconnPool;
 
index 3ab251642ccf496345073ba21e2deedfd310127d..96cb5856fbe6720fcfec56d7f896a170d0cf841e 100644 (file)
@@ -43,7 +43,6 @@
 /* some parameters stil need this */
 #include "wordlist.h"
 
-class CacheManager;
 class HttpRequestMethod;
 
 
index 0463a19977995afd8bd8b5bbd4aec0c915e9041d..33a5aaea96fabb8f29f8b9e190007051d6e7e4e6 100644 (file)
@@ -1387,6 +1387,16 @@ StoreEntry::validLength() const
     return 0;
 }
 
+static void
+storeRegisterWithCacheManager(void)
+{
+    CacheManager *manager=CacheManager::GetInstance();
+    manager->registerAction("storedir", "Store Directory Stats", Store::Stats, 0, 1);
+    manager->registerAction("store_io", "Store IO Interface Stats", storeIOStats, 0, 1);
+    manager->registerAction("store_check_cachable_stats", "storeCheckCachable() Stats",
+                           storeCheckCachableStats, 0, 1);
+}
+
 void
 storeInit(void)
 {
@@ -1401,16 +1411,6 @@ storeInit(void)
     storeRegisterWithCacheManager();
 }
 
-void
-storeRegisterWithCacheManager(void)
-{
-    CacheManager *manager=CacheManager::GetInstance();
-    manager->registerAction("storedir", "Store Directory Stats", Store::Stats, 0, 1);
-    manager->registerAction("store_io", "Store IO Interface Stats", storeIOStats, 0, 1);
-    manager->registerAction("store_check_cachable_stats", "storeCheckCachable() Stats",
-                           storeCheckCachableStats, 0, 1);
-}
-
 void
 storeConfigure(void)
 {