* Signalling flags are apparently not always provided.
* TODO find out if these can be moved into specific OS portability files.
*/
+#if defined(__cplusplus)
+#include <csignal>
+#else
#if HAVE_SIGNAL_H
#include <signal.h>
#endif
+#endif
#ifndef SA_RESTART
#define SA_RESTART 0
#endif
#define sys_nerr _sys_nerr
#undef assert
-#include <assert.h>
-#include <stdio.h>
+#include <cassert>
+#include <cstring>
#include <fcntl.h>
-#include <string.h>
#include <sys/timeb.h>
#if HAVE_WIN32_PSAPI
#include <psapi.h>
// Import the stdio.h definitions first to do the state setup
#if HAVE_STDIO_H
-#include<stdio.h>
+#include <stdio.h>
#endif
// Check for the buggy case
#endif /* __USE_FILE_OFFSET64 && !__REDIRECT */
// Finally import the <cstdio> stuff we actually use
-#if HAVE_CSTDIO && defined(__cplusplus)
+#if defined(__cplusplus)
#include <cstdio>
#endif
* We provide a clean set of wrappers for the various operations
* Depending on what is available and needed.
*/
-#if HAVE_CSTDARG && defined(__cplusplus)
+#if defined(__cplusplus)
#include <cstdarg>
#else
#define VA_SHIFT(v,t) ; /* no-op for ANSI */
#define VA_END va_end(ap)
-#else
+#else /* !HAVE_STDARG_H */
#if HAVE_VARARGS_H
#include <varargs.h>
#undef HAVE_STDARGS
#define VA_SHIFT(v,t) v = va_arg(ap,t)
#define VA_END va_end(ap)
-#else
+#else /* !HAVE_VARARGS_H*/
#error XX **NO VARARGS ** XX
#endif /* HAVE_VARARGS_H */
#endif /* HAVE_STDARG_H */
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+#include <cstring>
/**
* Find the first occurrence of find in s, where the search is limited to the
#define SQUID_UNIT_TEST 1
#include "squid.h"
-#if HAVE_ASSERT_H
-#include <assert.h>
-#endif
+#include <cassert>
#include "testPreCompiler.h"
#include "squid.h"
#include "compat/xstrerror.h"
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+#include <cstring>
#if _SQUID_WINDOWS_
static struct _wsaerrtext {
AC_HEADER_STDC
AC_CHECK_HEADERS( \
- algorithm \
arpa/inet.h \
arpa/nameser.h \
assert.h \
bstring.h \
- cassert \
crypt.h \
- cstdarg \
- cstdio \
- cstdlib \
- cstring \
- list \
ctype.h \
errno.h \
execinfo.h \
glob.h \
gnumalloc.h \
grp.h \
- iosfwd \
- iomanip \
- iostream \
- fstream \
- climits \
ip_compat.h \
ip_fil_compat.h \
ip_fil.h \
lber.h \
ldap.h \
libc.h \
- limits \
limits.h \
linux/posix_types.h \
linux/types.h \
machine/byte_swap.h \
malloc.h \
- map \
math.h \
memory.h \
- memory \
mount.h \
netdb.h \
netinet/in.h \
netinet/tcp.h \
openssl/engine.h \
openssl/txt_db.h \
- ostream \
paths.h \
poll.h \
pwd.h \
sched.h \
siginfo.h \
signal.h \
- sstream \
stdarg.h \
stdbool.h \
stddef.h \
- stdexcept \
stdio.h \
stdlib.h \
- string \
string.h \
strings.h \
sys/bitypes.h \
* - initial version (Richard Huveneers <Richard.Huveneers@hekkihek.hacom.nl>)
*/
-#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>
#include "rfc1738.h"
#include "util.h"
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
+#include <cctype>
+#include <cstring>
#if _SQUID_WINDOWS_ && !_SQUID_CYGWIN_
#define snprintf _snprintf
* The code originated from denyusers.c.
*/
-#include <stdlib.h>
+#include "msntauth.h"
+#include "usersfile.h"
+
+#include <cstdlib>
+#include <cstring>
#include <unistd.h>
#include <sys/types.h>
#include <sys/param.h>
-#include <string.h>
-#include "msntauth.h"
-#include "usersfile.h"
static usersfile AllowUsers;
static int init = 0;
/* Squid provides a number of portability overrides */
#include "squid.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <cassert>
+#include <cerrno>
+#include <cstdlib>
+#include <cstring>
#include <syslog.h>
-#include <errno.h>
#include <sys/param.h>
#include <netdb.h>
-#include <assert.h>
#include "msntauth.h"
#include "valid.h"
* have been explicitly denied by the system administrator.
* Routines at the bottom also use the allowed user functions.
*/
+#include "msntauth.h"
+#include "usersfile.h"
-#include <stdlib.h>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
#include <unistd.h>
-#include <time.h>
#include <sys/types.h>
#include <sys/param.h>
-#include <string.h>
-#include "msntauth.h"
-#include "usersfile.h"
static usersfile DenyUsers;
static int init = 0;
#include "rfc1738.h"
#include "util.h"
-#include <stdio.h>
-#include <signal.h>
+#include <csignal>
+#include <cstring>
#include <syslog.h>
-#include <string.h>
#include "msntauth.h"
#include "squid.h"
#include "util.h"
-#include <stdio.h>
-#include <string.h>
+#include <cctype>
+#include <cerrno>
+#include <cstring>
+#include <ctime>
#include <syslog.h>
#include <unistd.h>
#include <sys/stat.h>
-#include <errno.h>
-#include <time.h>
-#include <ctype.h>
#include <sys/param.h>
#include <fcntl.h>
#include "rfc1738.h"
#include "util.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
+#include <cerrno>
+#include <cstring>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#if HAVE_CRYPT_H
#include <crypt.h>
#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
static hash_table *hash = NULL;
static HASHFREE my_free;
*
*/
#include "squid.h"
-
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-
#include "crypt_md5.h"
#include "md5.h"
+#include <cstring>
+
static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
#include "rfc1738.h"
#include "util.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
+#include <cstdlib>
+#include <cstring>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
*/
#include "squid.h"
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+#include <cstdlib>
+#include <cstring>
#if HAVE_SYSLOG_H
#include <syslog.h>
#endif
#include "rfc1738.h"
#include "util.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_ASSERT_H
-#include <assert.h>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-#if HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#if HAVE_TIME_H
-#include <time.h>
-#endif
+#include <cassert>
+#include <csignal>
+#include <cstring>
+#include <ctime>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "radius-util.h"
#include "radius.h"
+#include <cctype>
+#include <cerrno>
+#include <cstring>
+#include <ctime>
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#if _SQUID_WINDOWS_
#include <io.h>
#endif
-#if HAVE_CTYPE_H
-#include <ctype.h>
-#endif
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#if HAVE_PWD_H
#include <pwd.h>
#endif
-#if HAVE_TIME_H
-#include <time.h>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
#if HAVE_GETOPT_H
#include <getopt.h>
#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
/* AYJ: helper input buffer may be a lot larger than this used to expect... */
#define MAXPWNAM 254
" 2.1 Copyright 1997 Cistron Internet Services B.V.";
#include "squid.h"
+#include "md5.h"
+#include "radius-util.h"
+#include <cctype>
+#include <csignal>
+#include <ctime>
#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
+#include <sys/socket.h>
#endif
#if HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-#if HAVE_STDIO_H
-#include <stdio.h>
+#include <netinet/in.h>
#endif
#if HAVE_NETDB_H
-#include <netdb.h>
+#include <netdb.h>
#endif
#if HAVE_PWD_H
-#include <pwd.h>
-#endif
-#if HAVE_TIME_H
-#include <time.h>
+#include <pwd.h>
#endif
-#if HAVE_CTYPE_H
-#include <ctype.h>
-#endif
-#if HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-
-#include "md5.h"
-#include "radius-util.h"
/*
* Check for valid IP address in standard dot notation.
#include "rfc1738.h"
#include "util.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+#include <cerrno>
+#include <cstdlib>
+#include <cstring>
#if HAVE_SASL_SASL_H
#include <sasl/sasl.h>
#else
#include "rfc1738.h"
#include "util.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+#include <cstring>
#define NMB_UNICAST 1
#define NMB_BROADCAST 2
#include "util.h"
#include "valid.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
#if GETOPT_H
#include <getopt.h>
#endif
/* Debugging stuff */
#if defined(__GNUC__) /* this is really a gcc-ism */
-#include <stdio.h>
#include <unistd.h>
static char *__foo;
#define debug(X...) if (debug_enabled) { \
#include "squid.h"
#include "helpers/defines.h"
-#if HAVE_CSTRING
#include <cstring>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
/**
* options:
#include "squid.h"
#include "helpers/defines.h"
#include "rfc1738.h"
-//#include "util.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
+#include <cstdlib>
+#include <cstring>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
#if HAVE_CRYPT_H
#include <crypt.h>
#endif
#ifndef SQUID_DIGEST_COMMON_H_
#define SQUID_DIGEST_COMMON_H_
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_CTYPE_H
-#include <ctype.h>
-#endif
+#include <cctype>
+#include <cstdlib>
+#include <cstring>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifndef SQUID_DIGEST_COMMON_H_
#define SQUID_DIGEST_COMMON_H_
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_CTYPE_H
-#include <ctype.h>
-#endif
+#include <cctype>
+#include <cstdlib>
+#include <cstring>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
#if HAVE_STRINGS_H
#include <strings.h>
#endif
#include "rfc2617.h"
#include "util.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
+#include <cstring>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
int _wcsicmp(const wchar_t *, const wchar_t *);
#endif
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_CTYPE_H
-#include <ctype.h>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+#undef assert
+#include <cassert>
+#include <cctype>
+#include <cstring>
#if HAVE_GETOPT_H
#include <getopt.h>
#endif
-#undef assert
-#include <assert.h>
#include <windows.h>
#include <objbase.h>
#include <initguid.h>
#define LDAP_DEPRECATED 1
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-#if HAVE_CTYPE_H
-#include <ctype.h>
-#endif
+#include <cctype>
+#include <cstring>
#if _SQUID_WINDOWS_ && !_SQUID_CYGWIN_
int _wcsicmp(const wchar_t *, const wchar_t *);
#endif
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_CTYPE_H
-#include <ctype.h>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+#undef assert
+#include <cassert>
+#include <cctype>
+#include <cstring>
#if HAVE_GETOPT_H
#include <getopt.h>
#endif
-#undef assert
-#include <assert.h>
#include <windows.h>
#include <lm.h>
#include <ntsecapi.h>
#define EDUI_PROGRAM_VERSION "2.1"
/* System includes */
-#ifdef HAVE_STDIO_H
-#include <stdio.h>
-#endif
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#ifndef __USE_GNU
#define __USE_GNU
#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_CTYPE_H
-#include <ctype.h>
-#endif
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
+#include <cctype>
+#include <cerrno>
+#include <csignal>
+#include <cstdarg>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
-#ifdef HAVE_STDARG_H
-#include <stdarg.h>
-#endif
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
#ifdef HELPER_INPUT_BUFFER
#define EDUI_MAXLEN HELPER_INPUT_BUFFER
#include "rfc1738.h"
#include "util.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+#include <cstdlib>
+#include <cstring>
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_LDAP
#include "support.h"
-#ifdef HAVE_CTYPE_H
-#include <ctype.h>
-#endif
+#include <cctype>
void
init_args(struct main_args *margs)
}
#else
-#include <stdio.h>
-#include <stdlib.h>
+#include <cstdlib>
int
main(int argc, char *const argv[])
{
#define KERBEROS_LDAP_GROUP_VERSION "1.3.1sq"
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+#include <cstring>
#if HAVE_KRB5_H
#if HAVE_BROKEN_SOLARIS_KRB5_H
#ifdef HAVE_LDAP
#include "support.h"
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
+#include <ctime>
const char *
LogTime()
#endif
#include "helpers/defines.h"
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
#if HAVE_DB_H
#include <db.h>
#endif
#if HAVE_GETOPT_H
#include <getopt.h>
#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <time.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
*/
-#if HAVE_CONFIG_H
#include "squid.h"
-#endif
#include "helpers/defines.h"
+#include <cstdarg>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <string.h>
-#include <time.h>
#if HAVE_GETOPT_H
#include <getopt.h>
#endif
#include "rfc1738.h"
#include "util.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+#include <cctype>
+#include <cstring>
#if HAVE_GRP_H
#include <grp.h>
#endif
#if HAVE_PWD_H
#include <pwd.h>
#endif
-#if HAVE_CTYPE_H
-#include <ctype.h>
-#endif
/*
* Verify if user's primary group matches groupname
#include "squid.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
+#include <cassert>
+#include <cerrno>
+#include <csignal>
+#include <cstring>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
-#if HAVE_ASSERT_H
-#include <assert.h>
-#endif
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
-#if HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
#if HAVE_PATHS_H
#include <paths.h>
#endif
* -----------------------------------------------------------------------------
*/
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
+#include <cstring>
+#include <ctime>
#if HAVE_NETDB_H
#include <netdb.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_TIME_H
-#include <time.h>
-#endif
#include "base64.h"
#include "util.h"
}
}
#else
-#include <stdio.h>
-#include <stdlib.h>
+#include <cstdlib>
#ifndef MAX_AUTHTOKEN_LEN
#define MAX_AUTHTOKEN_LEN 65535
#endif
#if HAVE_GSSAPI
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
+#include <cerrno>
+#include <cstring>
+#include <ctime>
#if HAVE_NETDB_H
#include <netdb.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_TIME_H
-#include <time.h>
-#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
#include "base64.h"
#include "util.h"
}
#else
-#include <stdlib.h>
+#include <cstdlib>
int
main(int argc, char *argv[])
{
#include "squid.h"
#include "base64.h"
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
+#include <cerrno>
+#include <cstring>
+#include <cstdlib>
+#include <ctime>
#if HAVE_NETDB_H
#include <netdb.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_TIME_H
-#include <time.h>
-#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
#if !defined(HAVE_DECL_XMALLOC) || !HAVE_DECL_XMALLOC
#define xmalloc malloc
#include "helpers/defines.h"
#include "ntlmauth/ntlmauth.h"
#include "ntlmauth/support_bits.cci"
-//#include "util.h"
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-#if HAVE_CTYPE_H
-#include <ctype.h>
-#endif
+#include <cctype>
+#include <cstring>
#if HAVE_CRYPT_H
#include <crypt.h>
#endif
#if HAVE_GETOPT_H
#include <getopt.h>
#endif
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
#if HAVE_STDINT_H
#include <stdint.h>
#endif
#include "ntlmauth/support_bits.cci"
#include "rfcnb/rfcnb.h"
#include "smblib/smblib.h"
-//#include "util.h"
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+#include <cassert>
+#include <cctype>
+#include <cerrno>
+#include <csignal>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#if HAVE_GETOPT_H
#include <getopt.h>
#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-#if HAVE_CTYPE_H
-#include <ctype.h>
-#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_ASSERT_H
-#include <assert.h>
-#endif
-#if HAVE_TIME_H
-#include <time.h>
-#endif
/************* CONFIGURATION ***************/
#include "squid.h"
#include "helpers/defines.h"
-#if HAVE_CSTRING
#include <cstring>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
/**
* options:
#ifndef SQUID_RANGE_H
#define SQUID_RANGE_H
-#if HAVE_IOSFWD
#include <iosfwd>
-#endif
-#if HAVE_OSTREAM
#include <ostream>
-#endif
/* represents [start, end) */
#ifndef SQUID_UTIL_H
#define SQUID_UTIL_H
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
#if HAVE_TIME_H
#include <time.h>
#endif
*/
#include "squid.h"
-#if HAVE_ASSERT_H
-#include <assert.h>
-#endif
+
+#include <cassert>
#include "MemPool.h"
#include "MemPoolChunked.h"
#define FLUSH_LIMIT 1000 /* Flush memPool counters to memMeters after flush limit calls */
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+#include <cstring>
/*
* XXX This is a boundary violation between lib and src.. would be good
*/
#include "squid.h"
-#if HAVE_ASSERT_H
-#include <assert.h>
-#endif
+
+#include <cassert>
#include "MemPoolChunked.h"
#define MEM_MAX_MMAP_CHUNKS 2048
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+#include <cstring>
/*
* XXX This is a boundary violation between lib and src.. would be good
*/
#include "squid.h"
-#if HAVE_ASSERT_H
-#include <assert.h>
-#endif
-
#include "MemPoolMalloc.h"
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+#include <cassert>
+#include <cstring>
/*
* XXX This is a boundary violation between lib and src.. would be good
#include "squid.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
+#include <cstdlib>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "squid.h"
#include "base64.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95";
#endif /* LIBC_SCCS and not lint */
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "hash.h"
#include "profiler/Profiler.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+#include <cassert>
+#include <cmath>
+#include <cstdlib>
+#include <cstring>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#elif HAVE_MALLOC_H
#include <malloc.h>
#endif
-#if HAVE_ASSERT_H
-#include <assert.h>
-#endif
-#if HAVE_MATH_H
-#include <math.h>
-#endif
static void hash_next_bucket(hash_table * hid);
#if HAVE_STRING_H
#include <string.h>
#endif
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
#include "util.h"
#include "squid.h"
#include "html_quote.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
#if HAVE_STRING_H
#include <string.h>
#endif
#include "squid.h"
#include "util.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
#if HAVE_STRING_H
#include <string.h>
#endif
#include "squid.h"
#include "Trie.h"
-#include <stdio.h>
int
main (int argc, char **argv)
#include "libTrie/Trie.h"
#include "libTrie/TrieCharTransform.h"
-#if HAVE_IOSTREAM
#include <iostream>
-#endif
bool
CaseSensitiveCheck()
#include "profiler/Profiler.h"
#include "util.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-#if HAVE_CTYPE_H
-#include <ctype.h>
-#endif
+#include <cassert>
+#include <cctype>
+#include <cerrno>
+#include <cmath>
+#include <cstring>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#elif HAVE_MALLOC_H
#include <malloc.h>
#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#if HAVE_MATH_H
-#include <math.h>
-#endif
-#if HAVE_ASSERT_H
-#include <assert.h>
-#endif
#if MEM_GEN_TRACE
#include "squid.h"
#include "md5.h"
-#include "stdio.h"
+//#include "stdio.h" // ???
static void MDPrint(unsigned char digest[16]);
static void MDString(char *string);
#include "squid.h"
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+#include <cstring>
#if HAVE_STRINGS_H
#include <strings.h>
#endif
#if USE_XPROF_STATS
-#if HAVE_ASSERT_H
-#include <assert.h>
-#endif
+#include <cassert>
#if HAVE_GNUMALLLOC_H
#include <gnumalloc.h>
#elif HAVE_MALLOC_H
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "squid.h"
#include "util.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
#if HAVE_STRING_H
#include <string.h>
#endif
* Adapted from HTSUtils.c in CERN httpd 3.0 (http://info.cern.ch/httpd/)
* by Darren Hardy <hardy@cs.colorado.edu>, November 1994.
*/
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
#if HAVE_STRING_H
#include <string.h>
#endif
#include "squid.h"
#include "rfc1738.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
#if HAVE_STRING_H
#include <string.h>
#endif
#include "compat/inet_pton.h"
#include "util.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#endif
#include <signal.h>
#include <errno.h>
-#include <stdio.h>
#include <unistd.h>
#define TRUE 1
/* ensure we don't overwrite strings when not passed enough space. Also */
/* added code to say unknown error codes if we see any */
-#include <stdio.h>
-
typedef struct {
char *name;
int code;
#include <sys/socket.h>
#include <signal.h>
#include <errno.h>
-#include <stdio.h>
#include <unistd.h>
#include <strings.h>
#include "squid.h"
-#include <stdio.h>
-
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "squid.h"
-#include <stdio.h>
-
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#define SQUID_NO_STRING_BUFFER_PROTECT 1
#include "squid.h"
-#include <stdio.h>
-
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "snmp_vars.h"
#include "util.h"
-#include <stdio.h>
-
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "squid.h"
-#include <stdio.h>
-
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
***************************************************************************/
#include "squid.h"
-
-#include <stdio.h>
#include "snmp_api_error.h"
/***************************************************************************
**********************************************************************/
#include "squid.h"
-
-#include <stdio.h>
-
#include "snmp_error.h"
static const char *error_string[25] = {
#include "squid.h"
-#include <stdio.h>
-
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "squid.h"
-#include <stdio.h>
-
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "squid.h"
-#include <stdio.h>
-
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "squid.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
+
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#define SQUID_UNIT_TEST 1
#include "squid.h"
-#if HAVE_ASSERT_H
-#include <assert.h>
-#endif
+#include <cassert>
#include "testRFC1035.h"
#define SQUID_UNIT_TEST 1
#include "squid.h"
-#if HAVE_ASSERT_H
-#include <assert.h>
-#endif
+#include <cassert>
#include "testRFC1738.h"
#include "squid.h"
#include "util.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
#if HAVE_STRING_H
#include <string.h>
#endif
#define SQUID_CONFIGPARSER_H
#include "SquidString.h"
+
#include <queue>
#include <stack>
-#if HAVE_STRING
#include <string>
-#endif
class wordlist;
/**
#include "Debug.h"
#include "util.h"
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+#include <cerrno>
+#include <cstring>
CpuAffinitySet::CpuAffinitySet()
{
#ifndef SQUID_DEBUG_H
#define SQUID_DEBUG_H
-#if HAVE_IOSTREAM
#include <iostream>
-#endif
-
#undef assert
-#if HAVE_SSTREAM
#include <sstream>
-#endif
-#if HAVE_IOMANIP
#include <iomanip>
-#endif
#if defined(assert)
#undef assert
#endif
#include "DiskIO/DiskDaemon/diomsg.h"
#include "hash.h"
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
+#include <iostream>
#if HAVE_SYS_IPC_H
#include <sys/ipc.h>
#endif
#if HAVE_SYS_SHM_H
#include <sys/shm.h>
#endif
-#if HAVE_IOSTREAM
-#include <iostream>
-#endif
void
xassert(const char *msg, const char *file, int line)
#endif
#include "squid.h"
+#include "DiskIO/DiskThreads/CommIO.h"
#include "DiskThreads.h"
#include "SquidConfig.h"
+#include "SquidTime.h"
+#include "Store.h"
-#include <stdio.h>
+#include <csignal>
#include <sys/stat.h>
#include <fcntl.h>
#include <pthread.h>
#include <errno.h>
#include <dirent.h>
-#include <signal.h>
#if HAVE_SCHED_H
#include <sched.h>
#endif
-#include "DiskIO/DiskThreads/CommIO.h"
-#include "SquidTime.h"
-#include "Store.h"
#define RIDICULOUS_LENGTH 4096
#include "SquidTime.h"
#include "Store.h"
-#include <stdio.h>
+#include <csignal>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <dirent.h>
-#include <signal.h>
#define RIDICULOUS_LENGTH 4096
#include "squid.h"
#include "ETag.h"
-#if HAVE_CSTRING
#include <cstring>
-#endif
/*
* Note: ETag is not an http "field" like, for example HttpHdrRange. ETag is a
#include "FadingCounter.h"
#include "SquidTime.h"
-#if HAVE_MATH_H
-#include <math.h>
-#endif /* HAVE_MATH_H */
+#include <cmath>
FadingCounter::FadingCounter(): horizon(-1), precision(10), delta(-1),
lastTime(0), total(0)
#include "dlink.h"
-#if HAVE_OSTREAM
#include <ostream>
-#endif
template <class _Arg, class _Result>
struct unary_function {
#include "HelperChildConfig.h"
#include "Parsing.h"
-#include <string.h>
+#include <cstring>
HelperChildConfig::HelperChildConfig(const unsigned int m):
n_max(m),
#include "MemBuf.h"
#include "Notes.h"
-#if HAVE_OSTREAM
#include <ostream>
-#endif
class helper_stateful_server;
#include "Store.h"
#include "StrList.h"
-#if HAVE_MAP
#include <map>
-#endif
/* a row in the table used for parsing cache control header and statistics */
typedef struct {
#include "Store.h"
#include "StrList.h"
-#if HAVE_MAP
#include <map>
-#endif
/* a row in the table used for parsing surrogate-control header and statistics */
typedef struct {
#include "HttpHeader.h"
#include "typedefs.h"
-#if HAVE_FUNCTIONAL
#include <functional>
-#endif
-#if HAVE_LIST
#include <list>
-#endif
-#if HAVE_MAP
#include <map>
-#endif
-#if HAVE_STRING
#include <string>
-#endif
#if HAVE_STRINGS_H
#include <strings.h>
#endif
/* for FREE */
#include "typedefs.h"
-#if HAVE_IOSFWD
#include <iosfwd>
-#endif
class StoreEntry;
class MemPoolStats;
#include "MemBlob.h"
#include "SBufDetailedStats.h"
-#if HAVE_IOSTREAM
#include <iostream>
-#endif
MemBlobStats MemBlob::Stats;
InstanceIdDefinitions(MemBlob, "blob");
#include "SquidString.h"
#include "typedefs.h"
-#if HAVE_STRING
#include <string>
-#endif
#include <vector>
class HttpRequest;
/* a common objPackInto interface; used by debugObj */
typedef void (*ObjPackMethod) (void *obj, Packer * p);
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
/* append/vprintf's for Packer */
typedef void (*append_f) (void *, const char *buf, int size);
typedef void (*vprintf_f) (void *, const char *fmt, va_list args);
#include "SBufExceptions.h"
#include "util.h"
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-
-#if HAVE_SSTREAM
-#include <sstream>
-#endif
-
-#if HAVE_IOSTREAM
+#include <cstring>
#include <iostream>
-#endif
+#include <sstream>
#ifdef VA_COPY
#undef VA_COPY
#include "SBufExceptions.h"
#include "SquidString.h"
-#if HAVE_CLIMITS
#include <climits>
-#elif HAVE_LIMITS_H
-#include <limits.h>
-#endif
+#include <cstdarg>
+#include <iosfwd>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STDARG_H
-#include <stdarg.h>
-#endif
-#if HAVE_IOSFWD
-#include <iosfwd>
-#endif
/* SBuf placeholder for printf */
#ifndef SQUIDSBUFPH
#include "SBuf.h"
-#if HAVE_OSTREAM
#include <ostream>
-#endif
/** streambuf class for a SBuf-backed stream interface.
*
#ifndef SQUID_STRING_H
#define SQUID_STRING_H
-#if HAVE_OSTREAM
#include <ostream>
-#endif
/* squid string placeholder (for printf) */
#ifndef SQUIDSTRINGPH
#include "rfc1123.h"
-#if HAVE_TIME_H
-#include <time.h>
-#endif
+#include <ctime>
/* NP: sys/time.h is provided by libcompat */
/* globals for accessing time */
#include "squid.h"
#include "StatHist.h"
-#if HAVE_MATH_H
-#include <math.h>
-#endif
+#include <cmath>
+
/* Local functions */
static StatHistBinDumper statHistBinDumper;
#include "esi/Element.h"
#endif
-#if HAVE_OSTREAM
#include <ostream>
-#endif
class AsyncCall;
class HttpRequest;
#include "Store.h"
-#if HAVE_OSTREAM
#include <ostream>
-#endif
/*
* This class provides a streambuf interface for writing
#include "profiler/Profiler.h"
#include "Store.h"
-#if HAVE_LIMITS_H
-#include <limits.h>
-#endif
+#include <climits>
int
String::psize() const
#include "tools.h"
#include "Transients.h"
-#if HAVE_LIMITS_H
#include <limits>
-#endif
/// shared memory segment path to use for Transients maps
static const char *MapLabel = "transients_map";
#include "dlink.h"
#include "MemPool.h"
-#if HAVE_OSTREAM
#include <ostream>
-#endif
-#if HAVE_STRING
#include <string>
-#endif
#include <vector>
class ConfigParser;
#include "acl/forward.h"
#include "err_type.h"
-#if HAVE_SSTREAM
#include <sstream>
-#endif
class ConfigParser;
class dlink_list;
#include "HttpReply.h"
#include "wordlist.h"
-#if HAVE_LIMITS_H
-#include <limits.h>
-#endif
+#include <climits>
static void aclParseHTTPStatusList(SplayNode<acl_httpstatus_data *> **curlist);
static int aclHTTPStatusCompare(acl_httpstatus_data * const &a, acl_httpstatus_data * const &b);
#include <libecap/common/options.h>
#include <libecap/common/name.h>
#include <libecap/common/named_values.h>
-#if HAVE_LIMITS
#include <limits>
-#endif
#include <map>
/// libecap::adapter::services indexed by their URI
#endif
#include <cstring>
-#if HAVE_LIMITS
#include <limits>
-#endif
CBDATA_NAMESPACED_CLASS_INIT(AnyP, PortCfg);
#ifndef _SQUID_SRC_ANYP_PROTOCOLTYPE_H
#define _SQUID_SRC_ANYP_PROTOCOLTYPE_H
-#if HAVE_OSTREAM
#include <ostream>
-#endif
namespace AnyP
{
#include "anyp/ProtocolType.h"
-#if HAVE_OSTREAM
#include <ostream>
-#endif
namespace AnyP
{
#define SQUID_ANYP_URISCHEME_H
#include "anyp/ProtocolType.h"
-#if HAVE_IOSFWD
+
#include <iosfwd>
-#endif
namespace AnyP
{
#define SQUID_LRUMAP_H
#include "SquidTime.h"
-#if HAVE_LIST
+
#include <list>
-#endif
-#if HAVE_MAP
#include <map>
-#endif
template <class EntryValue, size_t EntryCost = sizeof(EntryValue)> class LruMap
{
// reference counting requires the Lock API on base classes
#include "base/Lock.h"
-#if HAVE_IOSTREAM
#include <iostream>
-#endif
/**
* Template for Reference Counting pointers.
#if HAVE_GLOB_H
#include <glob.h>
#endif
-#if HAVE_LIMITS_H
#include <limits>
-#endif
-#if HAVE_LIST
#include <list>
-#endif
#if HAVE_PWD_H
#include <pwd.h>
#endif
#include "Store.h"
#include "URL.h"
-#if HAVE_MATH_H
-#include <math.h>
-#endif
+#include <cmath>
#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
#include "Store.h"
#include "Generic.h"
-#if HAVE_LIMITS_H
-#include <limits.h>
-#endif
+#include <climits>
#if USE_CBDATA_DEBUG
-#include <vector>
#include <algorithm>
+#include <vector>
#endif
#if WITH_VALGRIND
#include "ssl/crtd_message.h"
#endif
-#if HAVE_LIMITS_H
-#include <limits.h>
-#endif
-#if HAVE_MATH_H
-#include <math.h>
-#endif
-#if HAVE_LIMITS
+#include <climits>
+#include <cmath>
#include <limits>
-#endif
#if LINGERING_CLOSE
#define comm_close comm_lingering_close
#include "ssl/support.h"
#endif
+#include <cerrno>
+#include <cmath>
#if _SQUID_CYGWIN_
#include <sys/ioctl.h>
#endif
#if HAVE_SYS_UN_H
#include <sys/un.h>
#endif
-#if HAVE_MATH_H
-#include <math.h>
-#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
/*
* New C-like simple comm code. This stuff is a mess and doesn't really buy us anything.
#include "eui/Eui64.h"
#endif
-#if HAVE_IOSFWD
#include <iosfwd>
-#endif
-#if HAVE_OSTREAM
#include <ostream>
-#endif
class CachePeer;
#include "StatHist.h"
#include "Store.h"
+#include <cerrno>
+#include <climits>
#if HAVE_SYS_DEVPOLL_H
/* Solaris /dev/poll support, see "man -s 7D poll" */
#include <sys/devpoll.h>
#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#if HAVE_LIMITS_H
-#include <limits.h>
-#endif
#define DEBUG_DEVPOLL 0
-// OPEN_MAX is defined in <limits.h>
+// OPEN_MAX is defined in <climits>
#define DEVPOLL_UPDATESIZE OPEN_MAX
#define DEVPOLL_QUERYSIZE OPEN_MAX
#include "profiler/Profiler.h"
#include "SquidTime.h"
#include "StatCounters.h"
-
#if USE_DELAY_POOLS
#include "ClientInfo.h"
#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+
+#include <cerrno>
void
Comm::Write(const Comm::ConnectionPointer &conn, MemBuf *mb, AsyncCall::Pointer &callback)
#include "esi/Expression.h"
#include "profiler/Profiler.h"
-#if HAVE_MATH_H
-#include <math.h>
-#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <cerrno>
+#include <cmath>
/* stack precedence rules:
* before pushing an operator onto the stack, the
class Address;
};
-#if HAVE_CSTRING
#include <cstring>
-#endif
-
-/* memcpy and friends */
-#if HAVE_STRING_H
-#include <string.h>
-#endif
namespace Eui
{
class Address;
}
-#if HAVE_CSTRING
#include <cstring>
-#endif
#if HAVE_SYS_EUI64_H
#include <sys/eui64.h>
#endif
-/* memcpy and friends */
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-
namespace Eui
{
#include "Store.h"
#include "tools.h"
-#if HAVE_MATH_H
-#include <math.h>
-#endif
+#include <cmath>
/* The list of event processes */
#include "SwapDir.h"
#include "tools.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-
static void
fatal_common(const char *message)
{
#include "tools.h"
#include "UFSSwapLogParser.h"
-#if HAVE_MATH_H
-#include <math.h>
-#endif
+#include <cerrno>
+#include <cmath>
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
CBDATA_NAMESPACED_CLASS_INIT(Fs::Ufs,RebuildState);
#include "tools.h"
#include "UFSSwapDir.h"
-#if HAVE_MATH_H
-#include <math.h>
-#endif
+#include <cerrno>
+#include <cmath>
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
int Fs::Ufs::UFSSwapDir::NumberOfUFSDirs = 0;
int *Fs::Ufs::UFSSwapDir::UFSDirToGlobalDirMapping = NULL;
#ifndef SQUID_FS_UFS_UFSSWAPLOGPARSER_H
#define SQUID_FS_UFS_UFSSWAPLOGPARSER_H
-#include <stdio.h>
-
class StoreSwapLogData;
namespace Fs
#include "IoStats.h"
#include "rfc2181.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-
extern char *ConfigFile; /* NULL */
extern char *IcpOpcodeStr[];
extern char tmp_error_buf[ERROR_BUF_SZ];
return 0;
}
-#else
-#include <stdio.h>
+#else / * !USE_ICMP */
+
+#include <ostream>
int
main(int argc, char *argv[])
{
- fprintf(stderr, "%s: ICMP support not compiled in.\n", argv[0]);
+ std::cerr << argv[0] << ": ICMP support not compiled in." << std::endl;
return 1;
}
#include "squid.h"
-#if HAVE_MATH_H
-#include <math.h>
-#endif
+#include <cmath>
int
isPowTen(int count)
#include "ip/tools.h"
#include "util.h"
-#if HAVE_ASSERT_H
-#include <assert.h>
-#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+#include <cassert>
+#include <cstring>
#if HAVE_ARPA_INET_H
/* for inet_ntoa() */
#include <arpa/inet.h>
#ifndef _SQUID_SRC_IP_ADDRESS_H
#define _SQUID_SRC_IP_ADDRESS_H
+#include <iosfwd>
+#include <ostream>
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <netdb.h>
#endif
-#if HAVE_IOSFWD
-#include <iosfwd>
-#endif
-#if HAVE_OSTREAM
-#include <ostream>
-#endif
-
namespace Ip
{
#endif /* PF_TRANSPARENT required headers */
#if LINUX_NETFILTER
-#if HAVE_LIMITS_H
-/* must be before including netfilter_ipv4.h */
-#include <limits.h>
-#endif
+/* <climits> must be before including netfilter_ipv4.h */
+#include <climits>
#include <linux/if.h>
#include <linux/netfilter_ipv4.h>
#if HAVE_LINUX_NETFILTER_IPV6_IP6_TABLES_H
#if HAVE_LIBNETFILTER_CONNTRACK_LIBNETFILTER_CONNTRACK_H
#include <libnetfilter_conntrack/libnetfilter_conntrack.h>
#endif
-
#if HAVE_LIBNETFILTER_CONNTRACK_LIBNETFILTER_CONNTRACK_TCP_H
#include <libnetfilter_conntrack/libnetfilter_conntrack_tcp.h>
#endif
-
-#if HAVE_LIMITS
#include <limits>
-#endif
class fde;
#define SQUID_UNIT_TEST 1
#include "squid.h"
-//#include "compat/getaddrinfo.h"
#include "ip/Address.h"
#include "ip/tools.h"
#include "testAddress.h"
-#if HAVE_CSTRING
#include <cstring>
-#endif
+#include <stdexcept>
+#include <string>
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#if HAVE_NETDB_H
#include <netdb.h>
#endif
-#if HAVE_STRING
-#include <string>
-#endif
-#if HAVE_STDEXCEPT
-#include <stdexcept>
-#endif
CPPUNIT_TEST_SUITE_REGISTRATION( testIpAddress );
#include "globals.h"
#include "ipc/Kid.h"
-#if HAVE_TIME_H
-#include <time.h>
-#endif
-
+#include <ctime>
#if HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#include "ip/forward.h"
#include "ipc/FdNotes.h"
-#if HAVE_IOSFWD
#include <iosfwd>
-#endif
namespace Ipc
{
#include "ipc/TypedMsgHdr.h"
#include "tools.h"
-#include <string.h>
+#include <cstring>
Ipc::TypedMsgHdr::TypedMsgHdr()
{
#include "squid.h"
#include "ipc/mem/Page.h"
-#if HAVE_IOSTREAM
#include <iostream>
-#endif
std::ostream &Ipc::Mem::operator <<(std::ostream &os, const PageId &page)
{
-/*
- */
-
#ifndef SQUID_IPC_MEM_PAGE_H
#define SQUID_IPC_MEM_PAGE_H
-#if HAVE_IOSFWD
#include <iosfwd>
-#endif
namespace Ipc
{
#include "base/AsyncJob.h"
#include "ip/Address.h"
-#if HAVE_LIST
#include <list>
-#endif
class MemBlob;
typedef RefCount<MemBlob> MemBlobPointer;
#include "Store.h"
#include "StoreEntryStream.h"
-#if HAVE_IOMANIP
#include <iomanip>
-#endif
-#if HAVE_OSTREAM
#include <ostream>
-#endif
/* forward declarations */
static void memFree2K(void *);
MemPoolMeter *pm = mp_st->meter;
const char *delim = "\t ";
-#if HAVE_IOMANIP
stream.setf(std::ios_base::fixed);
-#endif
stream << std::setw(20) << std::left << mp_st->label << delim;
stream << std::setw(4) << std::right << mp_st->obj_size << delim;
#include "SquidConfig.h"
#include "Store.h"
-#if HAVE_MATH_H
-#include <math.h>
-#endif
+#include <cmath>
#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
#include "SquidConfig.h"
#include "Store.h"
-#if HAVE_MATH_H
-#include <math.h>
-#endif
+#include <cmath>
#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
*/
#include "squid.h"
-#include <stdio.h>
+#include <csignal>
+#include <cstring>
#include <fcntl.h>
-#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
-#include <signal.h>
#define RECV_BUF_SIZE 8192
#include "Store.h"
#include "store_heap_replacement.h"
-#if HAVE_MATH_H
-#include <math.h>
-#endif
+#include <cmath>
/*
* Key generation function to implement the LFU-DA policy (Least
#include "snmp/Var.h"
#include "snmp_core.h"
#include "tools.h"
-#if HAVE_ALGORITHM
+
#include <algorithm>
-#endif
Snmp::Pdu::Pdu()
{
#include "ipc/TypedMsgHdr.h"
#include "snmp/Var.h"
#include "tools.h"
-#if HAVE_ALGORITHM
+
#include <algorithm>
-#endif
Snmp::Var::Var()
{
#include "squid.h"
#include "errorpage.h"
#include "ssl/ErrorDetail.h"
-#if HAVE_MAP
-#include <map>
-#endif
-#if HAVE_CLIMITS
+
#include <climits>
-#endif
+#include <map>
struct SslErrorEntry {
Ssl::ssl_error_t value;
#include "SquidString.h"
#include "ssl/support.h"
-#if HAVE_MAP
#include <map>
-#endif
-#if HAVE_STRING
#include <string>
-#endif
class HttpRequest;
#include "squid.h"
#include "ssl/certificate_db.h"
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#if HAVE_FSTREAM
+
+#include <cerrno>
#include <fstream>
-#endif
-#if HAVE_STDEXCEPT
#include <stdexcept>
-#endif
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#define SQUID_SSL_CERTIFICATE_DB_H
#include "ssl/gadgets.h"
-#if HAVE_STRING
-#include <string>
-#endif
+
#if HAVE_OPENSSL_OPENSSLV_H
#include <openssl/opensslv.h>
#endif
+#include <string>
namespace Ssl
{
#include "ssl/context_storage.h"
#include "Store.h"
#include "StoreEntryStream.h"
-#if HAVE_LIMITS
+
#include <limits>
-#endif
#if USE_SSL
#include <openssl/ssl.h>
#endif
#include "mgr/Command.h"
#include "SquidTime.h"
#include "ssl/gadgets.h"
-#if HAVE_MAP
-#include <map>
-#endif
-#if HAVE_LIST
+
#include <list>
-#endif
+#include <map>
#include <openssl/ssl.h>
/// TODO: Replace on real size.
#include "squid.h"
#include "ssl/crtd_message.h"
#include "ssl/gadgets.h"
-#if HAVE_CSTDLIB
+
#include <cstdlib>
-#endif
-#if HAVE_CSTRING
#include <cstring>
-#endif
-#if HAVE_STDEXCEPT
#include <stdexcept>
-#endif
Ssl::CrtdMessage::CrtdMessage(MessageKind kind)
: body_size(0), state(kind == REPLY ? BEFORE_LENGTH: BEFORE_CODE)
#ifndef SQUID_SSL_CRTD_MESSAGE_H
#define SQUID_SSL_CRTD_MESSAGE_H
-#if HAVE_STRING
-#include <string>
-#endif
-#if HAVE_MAP
#include <map>
-#endif
+#include <string>
namespace Ssl
{
#if HAVE_OPENSSL_TXT_DB_H
#include <openssl/txt_db.h>
#endif
-#if HAVE_STRING
#include <string>
-#endif
namespace Ssl
{
#include "ssl/certificate_db.h"
#include "ssl/crtd_message.h"
-#if HAVE_CSTRING
#include <cstring>
-#endif
-#if HAVE_SSTREAM
-#include <sstream>
-#endif
-#if HAVE_IOSTREAM
#include <iostream>
-#endif
-#if HAVE_STDEXCEPT
+#include <sstream>
#include <stdexcept>
-#endif
-#if HAVE_STRING
#include <string>
-#endif
#if HAVE_GETOPT_H
#include <getopt.h>
#endif
#if USE_DELAY_POOLS
#include "DelayPools.h"
#endif
-#if HAVE_LIMITS_H
-#include <limits.h>
-#endif
+#include <climits>
#include <stack>
#define REBUILD_TIMESTAMP_DELTA_MAX 2
#include "Store.h"
#include "StoreSearch.h"
-#if HAVE_MATH_H
-#include <math.h>
-#endif
+#include <cmath>
/*
* local types
#include "tools.h"
#include "Transients.h"
+#include <cerrno>
+#include <climits>
#if HAVE_STATVFS
#if HAVE_SYS_STATVFS_H
#include <sys/statvfs.h>
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
-#if HAVE_LIMITS_H
-#include <limits.h>
-#endif
#if HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
#if HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
static STDIRSELECT storeDirSelectSwapDirRoundRobin;
static STDIRSELECT storeDirSelectSwapDirLeastLoad;
#include "SBuf.h"
-#if HAVE_STRING
-#include <string>
-#endif
#include <set>
+#include <string>
/// Generates and executes a [configurable] large number of SBuf::*find()
/// test cases using random strings. Reports detected failures.
#define STUB_API "stub_HelperChildconfig.cc"
#include "tests/STUB.h"
-#include <string.h>
+#include <cstring>
HelperChildConfig::HelperChildConfig(const unsigned int m):
n_max(m),
#include "squid.h"
#include "Debug.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-
FILE *debug_log = NULL;
int Debug::TheDepth = 0;
#include "MemBuf.h"
#include "store_rebuild.h"
#include "SwapDir.h"
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+
+#include <cstring>
#define STUB_API "stub_store_rebuild.cc"
#include "tests/STUB.h"
#define SQUID_UNIT_TEST 1
-
#include "squid.h"
#if USE_AUTH
#include "ConfigParser.h"
#include "testACLMaxUserIP.h"
-#if HAVE_STDEXCEPT
#include <stdexcept>
-#endif
CPPUNIT_TEST_SUITE_REGISTRATION( testACLMaxUserIP );
}
}
-#if HAVE_IOSTREAM
#include <iostream>
-#endif
/* AuthUserRequest::scheme returns the correct scheme for all
* authentication types
#define SQUID_UNIT_TEST 1
-
#include "squid.h"
+
#include "testBoilerplate.h"
-#if HAVE_STDEXCEPT
#include <stdexcept>
-#endif
CPPUNIT_TEST_SUITE_REGISTRATION( testBoilerplate );
#define SQUID_UNIT_TEST 1
-
#include "squid.h"
+
#include "DiskIO/DiskIOModule.h"
#include "HttpHeader.h"
#include "HttpReply.h"
#include "testDiskIO.h"
#include "testStoreSupport.h"
-#if HAVE_STDEXCEPT
#include <stdexcept>
-#endif
CPPUNIT_TEST_SUITE_REGISTRATION( testDiskIO );
#include "SquidConfig.h"
#include "testHttpRequestMethod.h"
-#if HAVE_SSTREAM
#include <sstream>
-#endif
CPPUNIT_TEST_SUITE_REGISTRATION( testHttpRequestMethod );
#include "testRock.h"
#include "testStoreSupport.h"
+#include <stdexcept>
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
-#if HAVE_STDEXCEPT
-#include <stdexcept>
-#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "testStore.h"
#include "testStoreEntryStream.h"
-#if HAVE_IOMANIP
#include <iomanip>
-#endif
-
#include <cppunit/TestAssert.h>
CPPUNIT_TEST_SUITE_REGISTRATION( testStoreEntryStream );
#include "testURL.h"
#include "URL.h"
-#if HAVE_SSTREAM
#include <sstream>
-#endif
CPPUNIT_TEST_SUITE_REGISTRATION( testURL );
#include "testStoreSupport.h"
#include "testUfs.h"
-#if HAVE_STDEXCEPT
#include <stdexcept>
-#endif
#define TESTDIR "testUfs_Store"
#include "SquidString.h"
#include "tests/testUriScheme.h"
-#if HAVE_SSTREAM
#include <sstream>
-#endif
CPPUNIT_TEST_SUITE_REGISTRATION( testUriScheme );
#include "DelayId.h"
#endif
-#if HAVE_LIMITS_H
-#include <limits.h>
-#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#include <climits>
+#include <cerrno>
/**
* TunnelStateData is the state engine performing the tasks for
#undef malloc
#undef free
-#if HAVE_STDEXCEPT
-#include <stdexcept>
-#endif
-#if HAVE_IOSTREAM
-#include <iostream>
-#endif
-#if HAVE_CASSERT
#include <cassert>
-#endif
+#include <iostream>
+#include <stdexcept>
/* stub functions for parts of squid not factored to be dynamic yet */
void
#include "MemPool.h"
-#if HAVE_IOSTREAM
#include <iostream>
-#endif
/* TODO: put this in a libTest */
void
#include "squid.h"
-#if HAVE_IOSTREAM
#include <iostream>
-#endif
class CallCounter
{
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
#if HAVE_CTYPE_H
#include <ctype.h>
#endif
#include "mem_node.h"
#include "stmem.h"
-#if HAVE_IOSTREAM
#include <iostream>
-#endif
-#if HAVE_SSTREAM
#include <sstream>
-#endif
/*For a reason required on some platforms */
unsigned int TextException::FileNameHash(const char *fname)
#include "squid.h"
#include "mem_node.h"
-#if HAVE_IOSTREAM
#include <iostream>
-#endif
/* TODO: put this in a libTest */
void
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
#if HAVE_CTYPE_H
#include <ctype.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
#include "squid.h"
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
+#include <cstdlib>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "mem_node.h"
#include "stmem.h"
-#if HAVE_IOSTREAM
#include <iostream>
-#endif
class HasExplicit
{
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
#include "rfc1738.h"
#include "util.h"
+#include <cctype>
+#include <cerrno>
+#include <csignal>
+#include <cstring>
+#include <ctime>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if HAVE_CTYPE_H
-#include <ctype.h>
-#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
#if HAVE_PWD_H
#include <pwd.h>
#endif
-#if HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#if HAVE_TIME_H
-#include <time.h>
-#endif
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#if HAVE_LIBC_H
#include <libc.h>
#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
#if HAVE_STRINGS_H
#include <strings.h>
#endif
//
//
#include "conffile.hh"
+
+#include <cerrno>
+#include <cstdlib>
+#include <cstring>
+#include <fstream>
#include <sys/types.h>
-#include <errno.h>
#include <memory.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <fstream>
int
readConfigFile( CacheDirVector& cachedir, const char* fn, FILE* debug )
#define DEFAULT_SQUID_CONF "/usr/local/squid/etc/squid.conf"
#endif
-#include <stdio.h>
#include <vector>
struct CacheDir {
//
#include "convert.hh"
-#include <string.h>
+
+#include <cstdlib>
+#include <cstring>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
-#include <stdlib.h>
-#include <stdio.h>
#ifndef SA
#define SA struct sockaddr
#include "squid.h"
#include "copyout.hh"
-//#include <assert.h>
-//#include <sys/types.h>
#include <sys/stat.h>
-#include <stdio.h>
-#include <string.h>
+#include <cerrno>
+#include <cstring>
#include <fcntl.h>
-#include <errno.h>
#include <unistd.h>
#include <sys/mman.h>
#include "squid.h"
#include "util.h"
-#include <stdarg.h>
-#include <stdio.h>
+#include <cerrno>
+#include <climits>
+#include <csignal>
+#include <cstdarg>
+#include <cstdlib>
+#include <cstring>
#include <dirent.h>
-#include <string.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <unistd.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <signal.h>
-#include <errno.h>
#if HAVE_SIGINFO_H
#include <siginfo.h>
#include "squid.h"
#include "signal.hh"
-//#include <sys/types.h>
-#include <errno.h>
-#include <string.h>
+#include <cerrno>
+#include <cstring>
#include <memory.h>
-#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
-//#include <signal.h>
SigFunc*
Signal( int signo, SigFunc* newhandler, bool doInterrupt )
#include "squid.h"
-#if HAVE_SIGNAL_H
-#include <signal.h>
-#endif
+#include <csignal>
#if !defined(__cplusplus)
#ifndef HAVE_BOOL
//
//
#include "socket.hh"
+
+#include <cerrno>
+#include <cstring>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netdb.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
#include <unistd.h>
#include "convert.hh"
//
//
#include "squid.h"
-//#include <assert.h>
#include "squid-tlv.hh"
SquidTLV::SquidTLV( SquidMetaType _type, size_t _size, void* _data )
/** \endcond */
#endif
+#include <cerrno>
#include <csignal>
-#include <cstdio>
+#include <cstring>
#include <iostream>
-
#if _SQUID_WINDOWS_
#include <io.h>
#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
-#if HAVE_STRING_H
-#include <string.h>
-#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#if HAVE_NETDB_H
#include <netdb.h>
#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif