From: Francesco Chemolli Date: Sat, 12 Jul 2008 15:51:24 +0000 (+0200) Subject: More namespace cleanup. X-Git-Tag: SQUID_3_1_0_1~49^2~143^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5acc9f3;p=thirdparty%2Fsquid.git More namespace cleanup. --- diff --git a/src/ACLASN.h b/src/ACLASN.h index 478aba6b52..63585936d5 100644 --- a/src/ACLASN.h +++ b/src/ACLASN.h @@ -50,9 +50,6 @@ SQUIDCEXTERN int asnMatchIp(CbDataList *, IPAddress &); /// \ingroup ACLAPI SQUIDCEXTERN void asnInit(void); -/// \ingroup ACLAPI -extern void asnRegisterWithCacheManager(); - /// \ingroup ACLAPI SQUIDCEXTERN void asnFreeMemory(void); diff --git a/src/asn.cc b/src/asn.cc index cd031c99d5..8073e73eb2 100644 --- a/src/asn.cc +++ b/src/asn.cc @@ -179,6 +179,12 @@ ACLASN::prepareForUse() asnCacheStart(i->element); } +static void +asnRegisterWithCacheManager(void) +{ + CacheManager::GetInstance()->registerAction("asndb", "AS Number Database", asnStats, 0, 1); +} + /* initialize the radix tree structure */ SQUIDCEXTERN int squid_max_keylen; /* yuck.. this is in lib/radix.c */ @@ -199,12 +205,6 @@ asnInit(void) asnRegisterWithCacheManager(); } -void -asnRegisterWithCacheManager() -{ - CacheManager::GetInstance()->registerAction("asndb", "AS Number Database", asnStats, 0, 1); -} - void asnFreeMemory(void) { diff --git a/src/authenticate.cc b/src/authenticate.cc index ea584fa063..6e4d4143d8 100644 --- a/src/authenticate.cc +++ b/src/authenticate.cc @@ -73,6 +73,15 @@ authenticateSchemeCount(void) return rv; } +static void +authenticateRegisterWithCacheManager(authConfig * config) +{ + for (authConfig::iterator i = config->begin(); i != config->end(); ++i) { + AuthConfig *scheme = *i; + scheme->registerWithCacheManager(); + } +} + void authenticateInit(authConfig * config) { @@ -91,15 +100,6 @@ authenticateInit(authConfig * config) authenticateRegisterWithCacheManager(&Config.authConfiguration); } -void -authenticateRegisterWithCacheManager(authConfig * config) -{ - for (authConfig::iterator i = config->begin(); i != config->end(); ++i) { - AuthConfig *scheme = *i; - scheme->registerWithCacheManager(); - } -} - void authenticateShutdown(void) { diff --git a/src/authenticate.h b/src/authenticate.h index 6bf8fc9107..c74ba2d663 100644 --- a/src/authenticate.h +++ b/src/authenticate.h @@ -83,8 +83,6 @@ extern void authenticateAuthUserMerge(AuthUser *, AuthUser *); /// \ingroup AuthAPI extern void authenticateInit(authConfig *); /// \ingroup AuthAPI -extern void authenticateRegisterWithCacheManager(authConfig * config); -/// \ingroup AuthAPI extern void authenticateShutdown(void); /// \ingroup AuthAPI extern int authenticateAuthUserInuse(AuthUser * auth_user); diff --git a/src/comm_epoll.cc b/src/comm_epoll.cc index 0163a825ca..87f4e9a80a 100644 --- a/src/comm_epoll.cc +++ b/src/comm_epoll.cc @@ -70,6 +70,7 @@ static int max_poll_time = 1000; static struct epoll_event *pevents; +static void commEPollRegisterWithCacheManager(void); /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ @@ -216,7 +217,7 @@ commResetSelect(int fd) static void commIncomingStats(StoreEntry * sentry); -void +static void commEPollRegisterWithCacheManager(void) { CacheManager::GetInstance()-> diff --git a/src/comm_epoll.h b/src/comm_epoll.h index 0e5a54b9f4..720570f008 100644 --- a/src/comm_epoll.h +++ b/src/comm_epoll.h @@ -34,10 +34,4 @@ #ifndef SQUID_COMM_EPOLL_H #define SQUID_COMM_EPOLL_H -/* forward decls */ - -class CacheManager; - -extern void commEPollRegisterWithCacheManager(void); - #endif /* SQUID_COMM_EPOLL_H */ diff --git a/src/comm_kqueue.cc b/src/comm_kqueue.cc index 0bf475463e..391ffab871 100644 --- a/src/comm_kqueue.cc +++ b/src/comm_kqueue.cc @@ -91,6 +91,7 @@ static int kqmax; /* max structs to buffer */ static int kqoff; /* offset into the buffer */ static int max_poll_time = 1000; +static void commKQueueRegisterWithCacheManager(void); /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ /* Private functions */ @@ -326,7 +327,7 @@ comm_quick_poll_required(void) max_poll_time = 10; } -void +static void commKQueueRegisterWithCacheManager(void) { } diff --git a/src/comm_kqueue.h b/src/comm_kqueue.h index 82833b17be..33517c35fc 100644 --- a/src/comm_kqueue.h +++ b/src/comm_kqueue.h @@ -34,10 +34,4 @@ #ifndef SQUID_COMM_KQUEUE_H #define SQUID_COMM_KQUEUE_H -/* forward decls */ - -class CacheManager; - -extern void commKQueueRegisterWithCacheManager(void); - #endif /* SQUID_COMM_KQUEUE_H */ diff --git a/src/comm_poll.cc b/src/comm_poll.cc index 4675a6c939..dd2be81a9b 100644 --- a/src/comm_poll.cc +++ b/src/comm_poll.cc @@ -601,13 +601,8 @@ comm_poll_dns_incoming(void) statHistCount(&statCounter.comm_dns_incoming, nevents); } -void -comm_select_init(void) -{ - commPollRegisterWithCacheManager(); -} -void +static void commPollRegisterWithCacheManager(void) { CacheManager::GetInstance()-> @@ -616,6 +611,11 @@ commPollRegisterWithCacheManager(void) commIncomingStats, 0, 1); } +void +comm_select_init(void) +{ + commPollRegisterWithCacheManager(); +} static void commIncomingStats(StoreEntry * sentry) diff --git a/src/comm_poll.h b/src/comm_poll.h index 93f7b7a72f..e3ee514daf 100644 --- a/src/comm_poll.h +++ b/src/comm_poll.h @@ -34,10 +34,5 @@ #ifndef SQUID_COMM_POLL_H #define SQUID_COMM_POLL_H -/* forward decls */ - -class CacheManager; - -extern void commPollRegisterWithCacheManager(void); #endif /* SQUID_COMM_POLL_H */ diff --git a/src/comm_select.cc b/src/comm_select.cc index e29aeada87..aa96b3ec20 100644 --- a/src/comm_select.cc +++ b/src/comm_select.cc @@ -654,6 +654,15 @@ comm_select_dns_incoming(void) statHistCount(&statCounter.comm_dns_incoming, nevents); } +static void +commSelectRegisterWithCacheManager(void) +{ + CacheManager::GetInstance()-> + registerAction("comm_select_incoming", + "comm_incoming() stats", + commIncomingStats, 0, 1); +} + void comm_select_init(void) { @@ -666,15 +675,6 @@ comm_select_init(void) commSelectRegisterWithCacheManager(); } -void -commSelectRegisterWithCacheManager(void) -{ - CacheManager::GetInstance()-> - registerAction("comm_select_incoming", - "comm_incoming() stats", - commIncomingStats, 0, 1); -} - /* * examine_select - debug routine. * diff --git a/src/comm_select.h b/src/comm_select.h index 9f95ef5708..c80ac3108b 100644 --- a/src/comm_select.h +++ b/src/comm_select.h @@ -34,10 +34,5 @@ #ifndef SQUID_COMM_SELECT_H #define SQUID_COMM_SELECT_H -/* forward decls */ - -class CacheManager; - -extern void commSelectRegisterWithCacheManager(void); #endif /* SQUID_COMM_SELECT_H */ diff --git a/src/main.cc b/src/main.cc index 7970463d96..8ff5dcc07f 100644 --- a/src/main.cc +++ b/src/main.cc @@ -962,26 +962,11 @@ mainInitialize(void) FwdState::initModule(); /* register the modules in the cache manager menus */ - // asnRegisterWithCacheManager(); //moved to asnInit() - // authenticateRegisterWithCacheManager(&Config.authConfiguration); - // moved authenticateInit() cbdataRegisterWithCacheManager(); /* These use separate calls so that the comm loops can eventually * coexist. */ -#ifdef USE_EPOLL - //commEPollRegisterWithCacheManager(); //moved to comm_epoll::comm_select_init() -#endif -#ifdef USE_KQUEUE - // commKQueueRegisterWithCacheManager(); //moved to comm_kqueue::comm_select_init -#endif -#ifdef USE_POLL - // commPollRegisterWithCacheManager(); //moved to comm_poll::comm_select_init() -#endif -#if defined(USE_SELECT) || defined(USE_SELECT_WIN32) - // commSelectRegisterWithCacheManager(); //moved to comm_select::comm_select_init -#endif //clientdbRegisterWithCacheManager(); //moved to clientdbInit() #if DELAY_POOLS