]> git.ipfire.org Git - thirdparty/squid.git/blame - include/config.h
Author: Andrew Beverley <andy@andybev.com>
[thirdparty/squid.git] / include / config.h
CommitLineData
4d683a65 1/*
f04e1182 2 * $Id$
4d683a65 3 *
4 * AUTHOR: Duane Wessels
5 *
6 * SQUID Web Proxy Cache http://www.squid-cache.org/
7 * ----------------------------------------------------------
8 *
9 * Squid is the result of efforts by numerous individuals from
10 * the Internet community; see the CONTRIBUTORS file for full
11 * details. Many organizations have provided support for Squid's
12 * development; see the SPONSORS file for full details. Squid is
13 * Copyrighted (C) 2001 by the Regents of the University of
14 * California; see the COPYRIGHT file for full details. Squid
15 * incorporates software developed and/or copyrighted by other
16 * sources; see the CREDITS file for full details.
17 *
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
c5dd4956 22 *
4d683a65 23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
c5dd4956 27 *
4d683a65 28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
c5dd4956 31 *
4d683a65 32 */
33
b5638623 34#ifndef SQUID_CONFIG_H
35#define SQUID_CONFIG_H
4d683a65 36
392bbafe 37#include "autoconf.h" /* For GNU autoconf variables */
d1f95b42
AJ
38
39#if !defined(HAVE_SQUID)
40/* sub-packages define their own version details */
4d683a65 41#include "version.h"
42
d1f95b42
AJ
43#endif
44
cdb352bb
FC
45/* default values for listen ports. Usually specified in squid.conf really */
46#define CACHE_HTTP_PORT 3128
47#define CACHE_ICP_PORT 3130
48
e6ccf245 49/* To keep API definitions clear */
50#ifdef __cplusplus
51#define SQUIDCEXTERN extern "C"
52#else
53#define SQUIDCEXTERN extern
54#endif
55
73862432
FC
56#if _USE_INLINE_
57#define _SQUID_INLINE_ inline
58#else
59#define _SQUID_INLINE_
60#endif
61
4d683a65 62/****************************************************************************
63 *--------------------------------------------------------------------------*
64 * DO *NOT* MAKE ANY CHANGES below here unless you know what you're doing...*
65 *--------------------------------------------------------------------------*
66 ****************************************************************************/
67
eee95dfe 68#include "compat/compat.h"
f04e1182 69
4d683a65 70#ifdef USE_POSIX_REGEX
71#ifndef USE_RE_SYNTAX
72#define USE_RE_SYNTAX REG_EXTENDED /* default Syntax */
73#endif
74#endif
75
4d683a65 76#if !defined(CACHEMGR_HOSTNAME)
77#define CACHEMGR_HOSTNAME ""
42ad37af 78#else
79#define CACHEMGR_HOSTNAME_DEFINED 1
4d683a65 80#endif
81
6a9f6389 82#if SQUID_DETECT_UDP_SO_SNDBUF > 16384
4d683a65 83#define SQUID_UDP_SO_SNDBUF 16384
6a9f6389 84#else
85#define SQUID_UDP_SO_SNDBUF SQUID_DETECT_UDP_SO_SNDBUF
4d683a65 86#endif
87
6a9f6389 88#if SQUID_DETECT_UDP_SO_RCVBUF > 16384
4d683a65 89#define SQUID_UDP_SO_RCVBUF 16384
6a9f6389 90#else
91#define SQUID_UDP_SO_RCVBUF SQUID_DETECT_UDP_SO_RCVBUF
4d683a65 92#endif
93
32d002cb 94#if HAVE_MEMCPY
4d683a65 95#define xmemcpy(d,s,n) memcpy((d),(s),(n))
96#elif HAVE_BCOPY
97#define xmemcpy(d,s,n) bcopy((s),(d),(n))
98#elif HAVE_MEMMOVE
99#define xmemcpy(d,s,n) memmove((d),(s),(n))
100#endif
101
32d002cb 102#if HAVE_MEMMOVE
4d683a65 103#define xmemmove(d,s,n) memmove((d),(s),(n))
104#elif HAVE_BCOPY
105#define xmemmove(d,s,n) bcopy((s),(d),(n))
106#endif
107
75aa769b
AJ
108#if HAVE_CTYPE_H
109#include <ctype.h>
110#endif
4d683a65 111#define xisspace(x) isspace((unsigned char)x)
112#define xtoupper(x) toupper((unsigned char)x)
113#define xtolower(x) tolower((unsigned char)x)
114#define xisdigit(x) isdigit((unsigned char)x)
115#define xisascii(x) isascii((unsigned char)x)
116#define xislower(x) islower((unsigned char)x)
117#define xisalpha(x) isalpha((unsigned char)x)
ec451a0f 118#define xisprint(x) isprint((unsigned char)x)
119#define xisalnum(x) isalnum((unsigned char)x)
120#define xiscntrl(x) iscntrl((unsigned char)x)
121#define xispunct(x) ispunct((unsigned char)x)
122#define xisupper(x) isupper((unsigned char)x)
123#define xisxdigit(x) isxdigit((unsigned char)x)
ba53f4b8 124#define xisgraph(x) isgraph((unsigned char)x)
4d683a65 125
126#if HAVE_RANDOM
127#define squid_random random
128#define squid_srandom srandom
129#elif HAVE_LRAND48
130#define squid_random lrand48
131#define squid_srandom srand48
132#else
133#define squid_random rand
134#define squid_srandom srand
135#endif
136
798f959e 137/* gcc doesn't recognize the Windows native 64 bit formatting tags causing
138 * the compile fail, so we must disable the check on native Windows.
c5dd4956 139 */
798f959e 140
141#if __GNUC__ && !defined(_SQUID_MSWIN_)
68361fc4 142#define PRINTF_FORMAT_ARG1 __attribute__ ((format (printf, 1, 2)))
143#define PRINTF_FORMAT_ARG2 __attribute__ ((format (printf, 2, 3)))
144#define PRINTF_FORMAT_ARG3 __attribute__ ((format (printf, 3, 4)))
392bbafe 145#else
68361fc4 146#define PRINTF_FORMAT_ARG1
147#define PRINTF_FORMAT_ARG2
148#define PRINTF_FORMAT_ARG3
392bbafe 149#endif
150
b4bab919 151/*
152 * Determine if this is a leak check build or standard
153 */
154#if PURIFY
155#define LEAK_CHECK_MODE 1
156#elif WITH_VALGRIND
157#define LEAK_CHECK_MODE 1
158#elif XMALLOC_TRACE
159#define LEAK_CHECK_MODE 1
160#endif
161
82b7abe3
AJ
162/* temp hack: needs to be pre-defined for now. */
163#define SQUID_MAXPATHLEN 256
cee08cbc
AJ
164
165/*
166 * strnstr() is needed. The OS may not provide a working copy.
167 */
168#include "strnstr.h"
169
425de4c8
AJ
170/*
171 * xstrtoul() and xstrtoui() are strtoul() and strtoui() with limits.
172 */
173#include "xstrto.h"
174
b5638623 175#endif /* SQUID_CONFIG_H */