#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 */
#include "Debug.h"
#include "protos.h"
#include "structs.h"
+#include "tools.h"
#include <algorithm>
#include "mgr/ActionWriter.h"
#include "Store.h"
#include "protos.h"
+#include "tools.h"
DiskdActionData::DiskdActionData()
{
#include "protos.h"
#include "SquidTime.h"
#include "StatCounters.h"
+#include "tools.h"
#if HAVE_ERRNO_H
#include <errno.h>
$(XTRA_LIBS)
tests_testHttpReply_DEPENDENCIES= $(SQUID_CPPUNIT_LA)
-
tests_testACLMaxUserIP_SOURCES= \
cbdata.cc \
ClientInfo.h \
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 \
URLScheme.cc \
$(WIN32_SOURCE) \
wordlist.h \
- wordlist.cc
+ wordlist.cc \
+ tools.h \
+ tests/stub_tools.cc
nodist_tests_testDiskIO_SOURCES= \
$(TESTSOURCES) \
$(DISKIO_GEN_SOURCE) \
#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";
*/
#include "squid.h"
-#include "protos.h" /* for xmemset only */
+#include "tools.h"
#include "StoreStats.h"
/* StoreInfoStats */
/*
- * $Id$
- *
* DEBUG: section 20 Swap Dir base object
* AUTHOR: Robert Collins
*
#include "protos.h"
#include "StoreFileSystem.h"
#include "SwapDir.h"
+#include "tools.h"
SwapDir::SwapDir(char const *aType): theType(aType),
max_size(0),
-
/*
- * $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
#include "SquidTime.h"
#include "profiler/Profiler.h"
#include "protos.h"
+#include "tools.h"
/* The list of event processes */
#include "fs/rock/RockDbCell.h"
#include "md5.h"
#include "protos.h"
+#include "tools.h"
#include "typedefs.h"
#include "SquidTime.h"
#include "store_rebuild.h"
#include "Parsing.h"
#include "protos.h"
#include "SquidMath.h"
+#include "tools.h"
+
#include <cstdlib>
#include <iomanip>
#include "store_key_md5.h"
#include "StoreSwapLogData.h"
#include "store_rebuild.h"
+#include "tools.h"
#include "UFSSwapLogParser.h"
#if HAVE_MATH_H
#include "StoreSwapLogData.h"
#include "SquidTime.h"
#include "StatCounters.h"
+#include "tools.h"
#include "UFSSwapDir.h"
#if HAVE_MATH_H
*/
#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>
#include "base/TextException.h"
#include "ipc/Kids.h"
#include "protos.h"
+#include "tools.h"
Kids TheKids;
KidName TheKidName;
/*
- * $Id$
- *
* DEBUG: section 54 Interprocess Communication
- *
*/
#include "squid.h"
#include "ipc/StartListening.h"
#include "ipc/SharedListen.h"
#include "protos.h"
+#include "tools.h"
#include <map>
/*
- * $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)
#include "protos.h"
#include "base/TextException.h"
#include "ipc/TypedMsgHdr.h"
+#include "tools.h"
#include <string.h>
#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.
#include "compat/shm.h"
#include "ipc/mem/Segment.h"
#include "protos.h"
+#include "tools.h"
#include <fcntl.h>
#include <sys/mman.h>
#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);
#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)
#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);
#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);
#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);
#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);
#include "mgr/StoreIoAction.h"
#include "protos.h"
#include "Store.h"
+#include "tools.h"
Mgr::StoreIoActionData::StoreIoActionData()
{
#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);
#include "snmp_core.h"
#include "snmp/Pdu.h"
#include "snmp/Var.h"
+#include "tools.h"
#if HAVE_ALGORITHM
#include <algorithm>
#endif
#include "ipc/TypedMsgHdr.h"
#include "protos.h"
#include "snmp/Session.h"
+#include "tools.h"
Snmp::Session::Session()
{
#include "ipc/TypedMsgHdr.h"
#include "protos.h"
#include "snmp/Var.h"
+#include "tools.h"
#if HAVE_ALGORITHM
#include <algorithm>
#endif
#include "protos.h"
#include "snmp_core.h"
#include "snmp/Forwarder.h"
+#include "tools.h"
static void snmpPortOpened(const Comm::ConnectionPointer &conn, int errNo);
#include "StoreClient.h"
#include "Store.h"
#include "store_digest.h"
+#include "tools.h"
#if USE_AUTH
#include "auth/UserRequest.h"
#endif
#include "StrList.h"
#include "swap_log_op.h"
#include "SwapDir.h"
+#include "tools.h"
#if USE_DELAY_POOLS
#include "DelayPools.h"
#endif
#include "StoreHashIndex.h"
#include "SwapDir.h"
#include "swap_log_op.h"
+#include "tools.h"
#if HAVE_STATVFS
#if HAVE_SYS_STATVFS_H
#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"
#ifndef SQUID_TOOLS_H_
#define SQUID_TOOLS_H_
-/* for kb_t */
+#include "Packer.h"
+#include "SquidString.h"
#include "typedefs.h"
class MemBuf;
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_ */
#include "SquidTime.h"
#include "StatCounters.h"
#include "SwapDir.h"
+#include "tools.h"
/* This code gets linked to Squid */