-#ifndef _SQUID_COMPAT_STRNSTR_CC_
-#define _SQUID_COMPAT_STRNSTR_CC_
+#ifndef SQUID_COMPAT_STRNSTR_CC_
+#define SQUID_COMPAT_STRNSTR_CC_
/*
* Shamelessly duplicated from the FreeBSD public sources
}
#endif /* !HAVE_STRNSTR */
-#endif /* _SQUID_COMPAT_STRNSTR_CC_ */
+#endif /* SQUID_COMPAT_STRNSTR_CC_ */
-#ifndef _SQUID_COMPAT_XSTRING_H
-#define _SQUID_COMPAT_XSTRING_H
+#ifndef SQUID_COMPAT_XSTRING_H
+#define SQUID_COMPAT_XSTRING_H
#if HAVE_STRING_H
#include <string.h>
}
#endif
-#endif /* _SQUID_COMPAT_XSTRING_H */
+#endif /* SQUID_COMPAT_XSTRING_H */
-#ifndef _SQUID_XSTRTO_C_
-#define _SQUID_XSTRTO_C_
+#ifndef SQUID_XSTRTO_C_
+#define SQUID_XSTRTO_C_
/*
* Shamelessly duplicated from the netfilter iptables sources
return ret;
}
-#endif /* _SQUID_XSTRTO_C_ */
+#endif /* SQUID_XSTRTO_C_ */
#endif
/* The default PAM service name */
-#ifndef DEFAULT_SQUID_PAM_SERVICE
+#if !defined(DEFAULT_SQUID_PAM_SERVICE)
#define DEFAULT_SQUID_PAM_SERVICE "squid"
#endif
/* The default TTL */
-#ifndef DEFAULT_SQUID_PAM_TTL
+#if !defined(DEFAULT_SQUID_PAM_TTL)
#define DEFAULT_SQUID_PAM_TTL 0
#endif
* Copyright (c) 2003 Robert Collins <robertc@squid-cache.org>
*/
-#ifndef _SQUID_DIGEST_COMMON_H_
-#define _SQUID_DIGEST_COMMON_H_
+#ifndef SQUID_DIGEST_COMMON_H_
+#define SQUID_DIGEST_COMMON_H_
#if HAVE_STDIO_H
#include <stdio.h>
*/
typedef void HandleArguments(int, char **);
typedef void HHA1Creator(RequestData *);
-#endif /* _SQUID_DIGEST_COMMON_H_ */
+
+#endif /* SQUID_DIGEST_COMMON_H_ */
* Copyright (c) 2003 Robert Collins <robertc@squid-cache.org>
*/
-#ifndef _SQUID_DIGEST_COMMON_H_
-#define _SQUID_DIGEST_COMMON_H_
+#ifndef SQUID_DIGEST_COMMON_H_
+#define SQUID_DIGEST_COMMON_H_
#if HAVE_STDIO_H
#include <stdio.h>
*/
typedef void HandleArguments(int, char **);
typedef void HHA1Creator(RequestData *);
-#endif /* _SQUID_DIGEST_COMMON_H_ */
+
+#endif /* SQUID_DIGEST_COMMON_H_ */
* Copyright (c) 2003 Robert Collins <robertc@squid-cache.org>
*/
-#ifndef _SQUID_DIGEST_COMMON_H_
-#define _SQUID_DIGEST_COMMON_H_
+#ifndef SQUID_DIGEST_COMMON_H_
+#define SQUID_DIGEST_COMMON_H_
#include "hash.h"
#include "rfc2617.h"
*/
typedef void HandleArguments(int, char **);
typedef void HHA1Creator(RequestData *);
-#endif /* _SQUID_DIGEST_COMMON_H_ */
+
+#endif /* SQUID_DIGEST_COMMON_H_ */
*
*/
-#ifndef _SQUID_REFCOUNT_H_
-#define _SQUID_REFCOUNT_H_
+#ifndef SQUID_REFCOUNT_H_
+#define SQUID_REFCOUNT_H_
#if HAVE_IOSTREAM
#include <iostream>
return os << "NULL";
}
-#endif /* _SQUID_REFCOUNT_H_ */
+#endif /* SQUID_REFCOUNT_H_ */
SQUIDCEXTERN double tvSubDsec(struct timeval, struct timeval);
SQUIDCEXTERN size_t xcountws(const char *str);
SQUIDCEXTERN void Tolower(char *);
-#ifdef __cplusplus
+#if defined(__cplusplus)
/*
* Any code using libstdc++ must have externally resolvable overloads
* for void * operator new - which means in the .o for the binary,
* so, look in the translation unit containing main() in squid
* for the extern version in squid
*/
-#ifndef _SQUID_EXTERNNEW_
-#ifdef __GNUC_STDC_INLINE__
+#if !defined(_SQUID_EXTERNNEW_)
+#if defined(__GNUC_STDC_INLINE__)
#define _SQUID_EXTERNNEW_ extern inline __attribute__((gnu_inline))
#else
#define _SQUID_EXTERNNEW_ extern inline
-#ifndef _SQUID_LIBNTLMAUTH_SUPPORT_BITS_CCI
-#define _SQUID_LIBNTLMAUTH_SUPPORT_BITS_CCI
+#ifndef SQUID_LIBNTLMAUTH_SUPPORT_BITS_CCI
+#define SQUID_LIBNTLMAUTH_SUPPORT_BITS_CCI
#if HAVE_STRING_H
#include <string.h>
}
-#endif /* _SQUID_LIBNTLMAUTH_SUPPORT_BITS_CCI */
+#endif /* SQUID_LIBNTLMAUTH_SUPPORT_BITS_CCI */
PWD=`pwd`
#echo "FORMAT: ${PWD}..."
+#
+# Scan for incorrect use of #ifdef/#ifndef
+#
+grep -E "ifn?def .*_SQUID_" ./* | grep -v -E "_H$" | while read f; do echo "PROBLEM?: ${PWD} ${f}"; done
+
+#
+# Scan for file-specific actions
+#
for FILENAME in `ls -1`; do
case ${FILENAME} in
case ${FILENAME} in
*.c|*.cc)
FI=`grep "#include" ${FILENAME} | head -1`;
- if test "${FI}" != "#include \"config.h\"" -a "${FI}" != "#include \"squid.h\"" ; then
+ if test "${FI}" != "#include \"config.h\"" -a "${FI}" != "#include \"squid.h\"" -a "${FILENAME}" != "cf_gen.cc"; then
echo "ERROR: ${PWD}/${FILENAME} does not include config.h or squid.h first!"
fi
;;
*.h|*.cci)
FI=`grep "#include \"config.h\"" ${FILENAME}`;
- if test "x${FI}" != "x" ; then
+ if test "x${FI}" != "x" -a "${FILENAME}" != "squid.h"; then
echo "ERROR: ${PWD}/${FILENAME} duplicate include of config.h"
fi
;;
esac
- #
- # Scan for incorrect use of #ifdef/#ifndef
- #
- grep -R -E "ifn?def .*_SQUID_" ./* | grep -v -E "_H$" | while read f; do echo "PROBLEM?: ${f}"; done
-
#
# DEBUG Section list maintenance
#
* Internal declarations for the diskd routines
*/
-#ifndef __SQUID_DIOMSG_H__
-#define __SQUID_DIOMSG_H__
+#ifndef SQUID_DIOMSG_H__
+#define SQUID_DIOMSG_H__
enum {
_MQD_NOP,
static const int msg_snd_rcv_sz;
};
-#endif /* __SQUID_DIOMSG_H__ */
+#endif /* SQUID_DIOMSG_H__ */
sigemptyset(&newSig);
sigaddset(&newSig, SIGPIPE);
sigaddset(&newSig, SIGCHLD);
-#ifdef _SQUID_LINUX_THREADS_
+#if defined(_SQUID_LINUX_THREADS_)
sigaddset(&newSig, SIGQUIT);
sigaddset(&newSig, SIGTRAP);
#ifndef SQUID_HTTPHDRCC_H
#define SQUID_HTTPHDRCC_H
-#include "config.h"
#include "MemPool.h"
#include "SquidString.h"
);
}
-#ifdef _SQUID_RES_NSADDR6_LARRAY
+#if defined(_SQUID_RES_NSADDR6_LARRAY)
/// \ingroup dnsserver
#define _SQUID_RES_NSADDR6_LIST(i) _SQUID_RES_NSADDR6_LARRAY[i].sin6_addr
#endif
-#ifdef _SQUID_RES_NSADDR6_LPTR
+#if defined(_SQUID_RES_NSADDR6_LPTR)
/// \ingroup dnsserver
#define _SQUID_RES_NSADDR6_LIST(i) _SQUID_RES_NSADDR6_LPTR[i]->sin6_addr
#endif
void
squid_res_setservers(int reset)
{
-#if defined(_SQUID_FREEBSD_) && defined(_SQUID_RES_NSADDR6_COUNT)
+#if _SQUID_FREEBSD_ && defined(_SQUID_RES_NSADDR6_COUNT)
/* Only seems to be valid on FreeBSD 5.5 where _res_ext was provided without an ns6addr counter! */
/* Gone again on FreeBSD 6.2 along with _res_ext itself in any form. */
int ns6count = 0;
#endif
#if HAVE_RES_INIT
Ip::Address ipa;
-#ifdef _SQUID_RES_NSADDR_LIST
+#if defined(_SQUID_RES_NSADDR_LIST)
extern char *optarg;
#endif
#endif
*/
-#ifndef DEFAULT_SQUID_ERROR_DIR
+#if !defined(DEFAULT_SQUID_ERROR_DIR)
/** Where to look for errors if config path fails.
\note Please use ./configure --datadir=/path instead of patching
*/
opt_send_signal = SIGHUP;
else if (!strncmp(optarg, "rotate", strlen(optarg)))
/** \li On rotate send SIGQUIT or SIGUSR1. */
-#ifdef _SQUID_LINUX_THREADS_
-
+#if defined(_SQUID_LINUX_THREADS_)
opt_send_signal = SIGQUIT;
-
#else
-
opt_send_signal = SIGUSR1;
-
#endif
else if (!strncmp(optarg, "debug", strlen(optarg)))
/** \li On debug send SIGTRAP or SIGUSR2. */
-#ifdef _SQUID_LINUX_THREADS_
-
+#if defined(_SQUID_LINUX_THREADS_)
opt_send_signal = SIGTRAP;
-
#else
-
opt_send_signal = SIGUSR2;
-
#endif
else if (!strncmp(optarg, "shutdown", strlen(optarg)))
if (!configured_once)
writePidFile(); /* write PID file */
-#ifdef _SQUID_LINUX_THREADS_
+#if defined(_SQUID_LINUX_THREADS_)
squid_signal(SIGQUIT, rotate_logs, SA_RESTART);
{
debugs(16, DBG_IMPORTANT, "Rotate Logs by Cache Manager command.");
storeAppendPrintf(entry, "Rotating Squid Process Logs ....");
-#ifdef _SQUID_LINUX_THREADS_
+#if defined(_SQUID_LINUX_THREADS_)
rotate_logs(SIGQUIT);
#else
rotate_logs(SIGUSR1);
#endif /* __cplusplus */
-#ifndef DEFAULT_SQUID_CONF
+#if !defined(DEFAULT_SQUID_CONF)
#define DEFAULT_SQUID_CONF "/usr/local/squid/etc/squid.conf"
-#endif // DEFAULT_SQUID_CONF
+#endif
#include <stdio.h> // FILE*
#include <vector> // minimum STL container
// Revision 1.1 1999/06/15 21:10:16 voeckler
// Initial revision
//
-#ifndef _SQUID_TLV_HH
-#define _SQUID_TLV_HH
+#ifndef SQUID_TLV_HH
+#define SQUID_TLV_HH
#if !defined(__cplusplus)
#if defined(__GNUC__) || defined(__GNUG__)
SquidTLV* tail;
};
-#endif // _SQUID_TLV_HH
+#endif // SQUID_TLV_HH