]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Moved some prototypes to tools.h
authorFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 30 Aug 2012 14:18:27 +0000 (16:18 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 30 Aug 2012 14:18:27 +0000 (16:18 +0200)
39 files changed:
include/fatal.h
src/CpuAffinity.cc
src/DiskIO/DiskDaemon/DiskdAction.cc
src/DiskIO/IpcIo/IpcIoFile.cc
src/Makefile.am
src/MemStore.cc
src/StoreStats.cc
src/SwapDir.cc
src/cache_manager.cc
src/event.cc
src/fs/rock/RockRebuild.cc
src/fs/rock/RockSwapDir.cc
src/fs/ufs/RebuildState.cc
src/fs/ufs/UFSSwapDir.cc
src/icmp/net_db.cc
src/ipc/Kids.cc
src/ipc/SharedListen.cc
src/ipc/StoreMap.cc
src/ipc/TypedMsgHdr.cc
src/ipc/mem/Pages.cc
src/ipc/mem/Segment.cc
src/mgr/CountersAction.cc
src/mgr/FunAction.cc
src/mgr/InfoAction.cc
src/mgr/IntervalAction.cc
src/mgr/IoAction.cc
src/mgr/ServiceTimesAction.cc
src/mgr/StoreIoAction.cc
src/protos.h
src/snmp/Pdu.cc
src/snmp/Session.cc
src/snmp/Var.cc
src/snmp_core.cc
src/stat.cc
src/store.cc
src/store_dir.cc
src/tests/stub_tools.cc
src/tools.h
src/unlinkd.cc

index 4a8892c5e8fa60fd360522c35491729ff0d90166..26ce8b2600528e876d988016f2b0ef3014f3728b 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef SQUID_FATAL_H
 #define SQUID_FATAL_H
 
-SQUIDCEXTERN void fatal(const char *message);
-SQUIDCEXTERN void fatalf(const char *fmt,...) PRINTF_FORMAT_ARG1;
+extern void fatal(const char *message);
+extern void fatalf(const char *fmt,...) PRINTF_FORMAT_ARG1;
 extern void fatal_dump(const char *message);
 
 #endif /* SQUID_FATAL_H */
index b6649221fcfa3f60f41e1768d8ebd55f1f538aaa..b944c912b5f3426f8c29f0bc76eb5ed75eeaed07 100644 (file)
@@ -13,6 +13,7 @@
 #include "Debug.h"
 #include "protos.h"
 #include "structs.h"
+#include "tools.h"
 
 #include <algorithm>
 
index b255ab16f462cc71c9a57581ce40621aa60a0083..95f09845da15295ad4f74ac2a993f56aa6670a12 100644 (file)
@@ -14,6 +14,7 @@
 #include "mgr/ActionWriter.h"
 #include "Store.h"
 #include "protos.h"
+#include "tools.h"
 
 DiskdActionData::DiskdActionData()
 {
index 0c6f5d4ad042355a0f057ddbb7e7c3302d0a59e8..03526a9f2d8148b752979d2da6a57118521fc948 100644 (file)
@@ -23,6 +23,7 @@
 #include "protos.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
+#include "tools.h"
 
 #if HAVE_ERRNO_H
 #include <errno.h>
index 6945aabcb961fb0ad4591f4c6211da9e8e043377..52de8c328326f980bb04f02977948d23df01801f 100644 (file)
@@ -1183,7 +1183,6 @@ tests_testHttpReply_LDADD=\
        $(XTRA_LIBS)
 tests_testHttpReply_DEPENDENCIES= $(SQUID_CPPUNIT_LA)
 
-
 tests_testACLMaxUserIP_SOURCES= \
        cbdata.cc \
        ClientInfo.h \
@@ -1664,8 +1663,6 @@ tests_testDiskIO_SOURCES = \
        tests/stub_store_stats.cc \
        store_rebuild.h \
        tests/stub_store_rebuild.cc \
-       tools.h \
-       tests/stub_tools.cc \
        tests/stub_UdsOp.cc \
        tests/testDiskIO.cc \
        tests/testDiskIO.h \
@@ -1678,7 +1675,9 @@ tests_testDiskIO_SOURCES = \
        URLScheme.cc \
        $(WIN32_SOURCE) \
        wordlist.h \
-       wordlist.cc
+       wordlist.cc \
+       tools.h \
+       tests/stub_tools.cc
 nodist_tests_testDiskIO_SOURCES= \
        $(TESTSOURCES) \
        $(DISKIO_GEN_SOURCE) \
index 8e560b243282cf0736dbb9ec3fcf8b031385ee86..2f7dd47e7f62e504dbe699a56edd9e7d4c78a9b8 100644 (file)
@@ -15,6 +15,7 @@
 #include "mime_header.h"
 #include "protos.h"
 #include "StoreStats.h"
+#include "tools.h"
 
 /// shared memory segment path to use for MemStore maps
 static const char *ShmLabel = "cache_mem";
index 371d4184d3cd2650174bc6139b1784f6bb34871e..9e55bb67bf39368a41b2f6725d561aef10be57ce 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #include "squid.h"
-#include "protos.h" /* for xmemset only */
+#include "tools.h"
 #include "StoreStats.h"
 
 /* StoreInfoStats */
index 40f58955593a3e117a2a9edd49ded5c7cd5a0850..a04239785ab88e62e12fcbfbd371e5082582a25f 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id$
- *
  * DEBUG: section 20    Swap Dir base object
  * AUTHOR: Robert Collins
  *
@@ -40,6 +38,7 @@
 #include "protos.h"
 #include "StoreFileSystem.h"
 #include "SwapDir.h"
+#include "tools.h"
 
 SwapDir::SwapDir(char const *aType): theType(aType),
         max_size(0),
index 83445cfe0cb43ce91a2d4c2584a3be32063d0d25..cafc1cb332731dc05e0c0a1217b8c26f5e631091 100644 (file)
@@ -1,7 +1,4 @@
-
 /*
- * $Id$
- *
  * DEBUG: section 16    Cache Manager Objects
  * AUTHOR: Duane Wessels
  *
 #include "mgr/FunAction.h"
 #include "mgr/QueryParams.h"
 #include "protos.h" /* rotate_logs() */
+#include "tools.h"
 #include "SquidTime.h"
 #include "Store.h"
 #include "wordlist.h"
+
 #include <algorithm>
 
 /// \ingroup CacheManagerInternal
index a5764cbcde1d0c919055987d61b9cb2aaa09a76b..e83783928543b2a4e1b17cfc65686f1b2b86e1c2 100644 (file)
@@ -40,6 +40,7 @@
 #include "SquidTime.h"
 #include "profiler/Profiler.h"
 #include "protos.h"
+#include "tools.h"
 
 /* The list of event processes */
 
index f1b7b3687e41ff45c2674cb3c11ab5f9c61697aa..4b2b7d8fc945e00966f93513cd83a248fe64f53b 100644 (file)
@@ -9,6 +9,7 @@
 #include "fs/rock/RockDbCell.h"
 #include "md5.h"
 #include "protos.h"
+#include "tools.h"
 #include "typedefs.h"
 #include "SquidTime.h"
 #include "store_rebuild.h"
index 7bef29a71f84a71b186ac7aa1b6f8f5931fb7d87..9bb6acc038c3534ac8e0df94fa564f727301b2d2 100644 (file)
@@ -20,6 +20,8 @@
 #include "Parsing.h"
 #include "protos.h"
 #include "SquidMath.h"
+#include "tools.h"
+
 #include <cstdlib>
 #include <iomanip>
 
index 78ea660397846a88dfc03534f4921d853423b6f1..9f345fc3d544eb87fd2512c2c8a8ff91aa0d7faa 100644 (file)
@@ -39,6 +39,7 @@
 #include "store_key_md5.h"
 #include "StoreSwapLogData.h"
 #include "store_rebuild.h"
+#include "tools.h"
 #include "UFSSwapLogParser.h"
 
 #if HAVE_MATH_H
index b72626d9189b7a18d7e3394a33718de8e64171e1..90828770c4f20cbbc8eb82047ecad19676cd816f 100644 (file)
@@ -48,6 +48,7 @@
 #include "StoreSwapLogData.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
+#include "tools.h"
 #include "UFSSwapDir.h"
 
 #if HAVE_MATH_H
index f9309018d496a61bb3b8d4e19f7b1ecc94626ab0..afe19e6a9c008b04b741927b7dbab8dbe784adac 100644 (file)
  */
 
 #include "squid.h"
-#include "icmp/net_db.h"
-#include "log/File.h"
 #include "cbdata.h"
+#include "disk.h"
 #include "event.h"
-#include "mgr/Registration.h"
-#include "Store.h"
-#include "SwapDir.h"
-#include "HttpRequest.h"
-#include "HttpReply.h"
-#include "MemObject.h"
 #include "fde.h"
 #include "forward.h"
+#include "HttpReply.h"
+#include "HttpRequest.h"
+#include "icmp/net_db.h"
 #include "internal.h"
+#include "ip/Address.h"
+#include "log/File.h"
+#include "Mem.h"
+#include "MemObject.h"
+#include "mgr/Registration.h"
 #include "mime_header.h"
+#include "neighbors.h"
 #include "protos.h"
 #include "SquidTime.h"
-#include "wordlist.h"
-#include "ip/Address.h"
-#include "neighbors.h"
-#include "URL.h"
-#include "Mem.h"
-#include "disk.h"
+#include "Store.h"
 #include "StoreClient.h"
+#include "SwapDir.h"
+#include "tools.h"
+#include "URL.h"
+#include "wordlist.h"
 
 #if HAVE_SYS_STAT_H
 #include <sys/stat.h>
index 0747b564e1cb661efb4497d53aaa2fd288aca4f3..94089cf5486513f658febb9b998b53c851a1f6e5 100644 (file)
@@ -9,6 +9,7 @@
 #include "base/TextException.h"
 #include "ipc/Kids.h"
 #include "protos.h"
+#include "tools.h"
 
 Kids TheKids;
 KidName TheKidName;
index 80fc691e80d05adb873b8933ca65e052aefe9a53..5547840c8eb9773063b4af44743bf1f5055e4b1a 100644 (file)
@@ -1,8 +1,5 @@
 /*
- * $Id$
- *
  * DEBUG: section 54    Interprocess Communication
- *
  */
 
 #include "squid.h"
@@ -17,6 +14,7 @@
 #include "ipc/StartListening.h"
 #include "ipc/SharedListen.h"
 #include "protos.h"
+#include "tools.h"
 
 #include <map>
 
index 1a97436ac4418bc0cf152e19bc54b639f3ca7d5a..b8345511fa873a76809f7e015257f45da814df99 100644 (file)
@@ -1,14 +1,13 @@
 /*
- * $Id$
- *
  * DEBUG: section 54    Interprocess Communication
  */
 
 #include "squid.h"
+#include "ipc/StoreMap.h"
 #include "protos.h"
-#include "Store.h"
 #include "store_key_md5.h"
-#include "ipc/StoreMap.h"
+#include "Store.h"
+#include "tools.h"
 
 Ipc::StoreMap::Owner *
 Ipc::StoreMap::Init(const char *const path, const int limit, const size_t extrasSize)
index 68e011064a96a45259942ae61646098626b9480d..c7ff95eab279ac29aef11707057a3edcba12aa28 100644 (file)
@@ -9,6 +9,7 @@
 #include "protos.h"
 #include "base/TextException.h"
 #include "ipc/TypedMsgHdr.h"
+#include "tools.h"
 
 #include <string.h>
 
index c99f4d5e1905a03ac0a1d87b1fde414edba01753..e8711ed88747452def4b18479aa11e35451f755a 100644 (file)
@@ -13,6 +13,7 @@
 #include "protos.h"
 #include "structs.h"
 #include "SwapDir.h"
+#include "tools.h"
 
 // Uses a single PagePool instance, for now.
 // Eventually, we may have pools dedicated to memory caching, disk I/O, etc.
index 8ce9bc95daf916c4064a1659248574cf45eb2f59..0d006ff3266c0f2e5049e534eddb36a03157a574 100644 (file)
@@ -10,6 +10,7 @@
 #include "compat/shm.h"
 #include "ipc/mem/Segment.h"
 #include "protos.h"
+#include "tools.h"
 
 #include <fcntl.h>
 #include <sys/mman.h>
index f138888c2629b7b96470221537171ce77364a04f..d4b0cab517aae5e10a4035c1083be28304c94eab 100644 (file)
@@ -13,6 +13,7 @@
 #include "protos.h"
 #include "SquidTime.h"
 #include "Store.h"
+#include "tools.h"
 
 extern void GetCountersStats(Mgr::CountersActionData& stats);
 extern void DumpCountersStats(Mgr::CountersActionData& stats, StoreEntry* sentry);
index 855c40973fc57a8375ad9d30e001ebfc05a2f0c2..14edd75941afcd927d35782c2d0e299649e38b00 100644 (file)
@@ -16,6 +16,7 @@
 #include "mgr/Request.h"
 #include "protos.h"
 #include "Store.h"
+#include "tools.h"
 
 Mgr::FunAction::Pointer
 Mgr::FunAction::Create(const Command::Pointer &aCmd, OBJH* aHandler)
index f419fbe85bd5adc54f5737df99f78e81e55b1591..6acec69f947950d17f4e6aef4c3ebf69e4675e1b 100644 (file)
@@ -20,6 +20,7 @@
 #include "protos.h"
 #include "SquidTime.h"
 #include "Store.h"
+#include "tools.h"
 
 extern void GetInfo(Mgr::InfoActionData& stats);
 extern void DumpInfo(Mgr::InfoActionData& stats, StoreEntry* sentry);
index 1e6195cabaeaff789de4783ec7b77d2593801e34..6ab1230a4e64b7022d025a783f597228180f485f 100644 (file)
@@ -13,6 +13,7 @@
 #include "protos.h"
 #include "SquidMath.h"
 #include "Store.h"
+#include "tools.h"
 
 extern void GetAvgStat(Mgr::IntervalActionData& stats, int minutes, int hours);
 extern void DumpAvgStat(Mgr::IntervalActionData& stats, StoreEntry* sentry);
index 04131dfb7cff5dce5468540b77ed60400ce7896f..5a6eb8dfde69499b779470117a1941af0af5b4d1 100644 (file)
@@ -13,6 +13,7 @@
 #include "protos.h"
 #include "SquidMath.h"
 #include "Store.h"
+#include "tools.h"
 
 extern void GetIoStats(Mgr::IoActionData& stats);
 extern void DumpIoStats(Mgr::IoActionData& stats, StoreEntry* sentry);
index f2f982fb4c517c432dee63570193ce02f1a8d6eb..7246e209eb02fd74db9a829161fe9ec6a37a1a28 100644 (file)
@@ -12,6 +12,7 @@
 #include "mgr/ServiceTimesAction.h"
 #include "protos.h"
 #include "Store.h"
+#include "tools.h"
 
 extern void GetServiceTimesStats(Mgr::ServiceTimesActionData& stats);
 extern void DumpServiceTimesStats(Mgr::ServiceTimesActionData& stats, StoreEntry* sentry);
index f47a1fe6bc460a78a1ffd24bd39ae2a3d5d243e4..72e2a674f3a29df95257c60cc72f2204f0608cbc 100644 (file)
@@ -12,6 +12,7 @@
 #include "mgr/StoreIoAction.h"
 #include "protos.h"
 #include "Store.h"
+#include "tools.h"
 
 Mgr::StoreIoActionData::StoreIoActionData()
 {
index c50b2620af68ed034520f53547ec2345851e8692..da767d3b166a39e526b3fe865493c086669ab25a 100644 (file)
@@ -90,33 +90,9 @@ class store_client;
 
 #include "fatal.h"
 
-/// whether the current process is the parent of all other Squid processes
-SQUIDCEXTERN bool IamMasterProcess();
-/**
-    whether the current process is dedicated to doing things that only
-    a single process should do, such as PID file maintenance and WCCP
-*/
-SQUIDCEXTERN bool IamPrimaryProcess();
-/// whether the current process coordinates worker processes
-SQUIDCEXTERN bool IamCoordinatorProcess();
-/// whether the current process handles HTTP transactions and such
-SQUIDCEXTERN bool IamWorkerProcess();
-/// whether the current process is dedicated to managing a cache_dir
-extern bool IamDiskProcess();
-/// Whether we are running in daemon mode
-SQUIDCEXTERN bool InDaemonMode(); // try using specific Iam*() checks above first
-/// Whether there should be more than one worker process running
-SQUIDCEXTERN bool UsingSmp(); // try using specific Iam*() checks above first
-/// number of Kid processes as defined in src/ipc/Kid.h
-SQUIDCEXTERN int NumberOfKids();
-/// a string describing this process roles such as worker or coordinator
-extern String ProcessRoles();
 SQUIDCEXTERN int DebugSignal;
 
-/* AYJ debugs function to show locations being reset with memset() */
-SQUIDCEXTERN void *xmemset(void *dst, int, size_t);
 
-SQUIDCEXTERN void debug_trap(const char *);
 SQUIDCEXTERN void logsFlush(void);
 SQUIDCEXTERN const char *checkNullString(const char *p);
 
index 10d09a8138781b2d6949cc1d7c19091f327880e8..7565ab825bce1823628137ea3e4f28786494aef5 100644 (file)
@@ -12,6 +12,7 @@
 #include "snmp_core.h"
 #include "snmp/Pdu.h"
 #include "snmp/Var.h"
+#include "tools.h"
 #if HAVE_ALGORITHM
 #include <algorithm>
 #endif
index 0afb380a0a53dd24c872bbacf10bb97c0d091bbf..1bfbda4e58ae273aedbfb737f3f87c6d17b83760 100644 (file)
@@ -10,6 +10,7 @@
 #include "ipc/TypedMsgHdr.h"
 #include "protos.h"
 #include "snmp/Session.h"
+#include "tools.h"
 
 Snmp::Session::Session()
 {
index 93b0cde846fdd939b7775d071aceeba6d9835da4..321168d2e8131843811bfe8ebdf137f246998f94 100644 (file)
@@ -10,6 +10,7 @@
 #include "ipc/TypedMsgHdr.h"
 #include "protos.h"
 #include "snmp/Var.h"
+#include "tools.h"
 #if HAVE_ALGORITHM
 #include <algorithm>
 #endif
index fa1314555b2c6a682e244409cb89a23b5bee6779..ccc42c066860c6d3955b93f9ab5d9fd2aabee320 100644 (file)
@@ -41,6 +41,7 @@
 #include "protos.h"
 #include "snmp_core.h"
 #include "snmp/Forwarder.h"
+#include "tools.h"
 
 static void snmpPortOpened(const Comm::ConnectionPointer &conn, int errNo);
 
index 67a0cbf1b0466c234a88996f3aa8733efb0fcd30..2cceb9003ab5ee1db46cfa1a87d65c1c10a1749d 100644 (file)
@@ -63,6 +63,7 @@
 #include "StoreClient.h"
 #include "Store.h"
 #include "store_digest.h"
+#include "tools.h"
 #if USE_AUTH
 #include "auth/UserRequest.h"
 #endif
index fcbf2a832401ec63fc48d5f1a6942dea43a74d10..81b214793ebc5b606ececd12f71f7f192a8ca691 100644 (file)
@@ -66,6 +66,7 @@
 #include "StrList.h"
 #include "swap_log_op.h"
 #include "SwapDir.h"
+#include "tools.h"
 #if USE_DELAY_POOLS
 #include "DelayPools.h"
 #endif
index d7f876d01f55b7ff5323b740df23a81705838efa..d437eea93718b86d05bd91148e3bbb062f9139dd 100644 (file)
@@ -47,6 +47,7 @@
 #include "StoreHashIndex.h"
 #include "SwapDir.h"
 #include "swap_log_op.h"
+#include "tools.h"
 
 #if HAVE_STATVFS
 #if HAVE_SYS_STATVFS_H
index 50f7292fd1691e758ee59672e872fa30a367d934..9202f4b5bd72d33da91b54daa83b0489d744a364 100644 (file)
@@ -1,6 +1,6 @@
 #include "squid.h"
-// tool functions still defined in protos.h - TODO extract
-#include "protos.h"
+// tool functions still defined in protos.h
+#include "tools.h"
 
 #define STUB_API "tools.cc"
 #include "tests/STUB.h"
index c14374592843136fd39e76a213178ed5040072b1..7f3a944c84a5ac7e70502d21bfb3cca34a24faca 100644 (file)
@@ -33,7 +33,8 @@
 #ifndef SQUID_TOOLS_H_
 #define SQUID_TOOLS_H_
 
-/* for kb_t */
+#include "Packer.h"
+#include "SquidString.h"
 #include "typedefs.h"
 
 class MemBuf;
@@ -65,5 +66,29 @@ extern pid_t readPidFile(void);
 extern void keepCapabilities(void);
 extern void BroadcastSignalIfAny(int& sig);
 
+/// whether the current process is the parent of all other Squid processes
+extern bool IamMasterProcess();
+/**
+ *   whether the current process is dedicated to doing things that only
+ *   a single process should do, such as PID file maintenance and WCCP
+ */
+extern bool IamPrimaryProcess();
+/// whether the current process coordinates worker processes
+extern bool IamCoordinatorProcess();
+/// whether the current process handles HTTP transactions and such
+extern bool IamWorkerProcess();
+/// whether the current process is dedicated to managing a cache_dir
+extern bool IamDiskProcess();
+/// Whether we are running in daemon mode
+extern bool InDaemonMode(); // try using specific Iam*() checks above first
+/// Whether there should be more than one worker process running
+extern bool UsingSmp(); // try using specific Iam*() checks above first
+/// number of Kid processes as defined in src/ipc/Kid.h
+extern int NumberOfKids();
+/// a string describing this process roles such as worker or coordinator
+extern String ProcessRoles();
+
+extern void debug_trap(const char *);
+extern void *xmemset(void *dst, int, size_t);
 
 #endif /* SQUID_TOOLS_H_ */
index c36a1655eab3edd6ff52d4ee00375426e721b615..022831150d006a025f787c7a9cfeac9369739774 100644 (file)
@@ -43,6 +43,7 @@
 #include "SquidTime.h"
 #include "StatCounters.h"
 #include "SwapDir.h"
+#include "tools.h"
 
 /* This code gets linked to Squid */