]> git.ipfire.org Git - thirdparty/squid.git/blob - src/squid.h
Remove unnecessary stub_tools dependency on String
[thirdparty/squid.git] / src / squid.h
1 /*
2 * AUTHOR: Duane Wessels
3 *
4 * SQUID Web Proxy Cache http://www.squid-cache.org/
5 * ----------------------------------------------------------
6 *
7 * Squid is the result of efforts by numerous individuals from
8 * the Internet community; see the CONTRIBUTORS file for full
9 * details. Many organizations have provided support for Squid's
10 * development; see the SPONSORS file for full details. Squid is
11 * Copyrighted (C) 2001 by the Regents of the University of
12 * California; see the COPYRIGHT file for full details. Squid
13 * incorporates software developed and/or copyrighted by other
14 * sources; see the CREDITS file for full details.
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
29 *
30 */
31
32 #ifndef SQUID_H
33 #define SQUID_H
34
35 #include "config.h"
36
37 #if _SQUID_MSWIN_
38 /** \cond AUTODOCS-IGNORE */
39 using namespace Squid;
40 /** \endcond */
41 #endif
42
43 #if HAVE_UNISTD_H
44 #include <unistd.h>
45 #endif
46 #if HAVE_STDIO_H
47 #include <stdio.h>
48 #endif
49 #if HAVE_CTYPE_H
50 #include <ctype.h>
51 #endif
52 #if HAVE_ERRNO_H
53 #include <errno.h>
54 #endif
55 #if HAVE_GRP_H
56 #include <grp.h>
57 #endif
58 #if HAVE_GNUMALLOC_H
59 #include <gnumalloc.h>
60 #elif HAVE_MALLOC_H
61 #include <malloc.h>
62 #endif
63 #if HAVE_MEMORY_H
64 #include <memory.h>
65 #endif
66 #if HAVE_NETDB_H
67 #include <netdb.h>
68 #endif
69 #if HAVE_PATHS_H
70 #include <paths.h>
71 #endif
72 #if HAVE_PWD_H
73 #include <pwd.h>
74 #endif
75 #if HAVE_SIGNAL_H
76 #include <signal.h>
77 #endif
78 #if HAVE_TIME_H
79 #include <time.h>
80 #endif
81 #if HAVE_SYS_PARAM_H
82 #include <sys/param.h>
83 #endif
84 #if HAVE_SYS_TIME_H
85 #include <sys/time.h>
86 #endif
87 #if HAVE_SYS_RESOURCE_H
88 #include <sys/resource.h> /* needs sys/time.h above it */
89 #endif
90 #if HAVE_SYS_SOCKET_H
91 #include <sys/socket.h>
92 #endif
93 #if HAVE_NETINET_IN_H
94 #include <netinet/in.h>
95 #endif
96 #if HAVE_ARPA_INET_H
97 #include <arpa/inet.h>
98 #endif
99 #if HAVE_SYS_STAT_H
100 #include <sys/stat.h>
101 #endif
102 #if HAVE_SYS_UN_H
103 #include <sys/un.h>
104 #endif
105 #if HAVE_SYS_WAIT_H
106 #include <sys/wait.h>
107 #endif
108 #if HAVE_LIBC_H
109 #include <libc.h>
110 #endif
111 #if HAVE_SYS_SYSCALL_H
112 #include <sys/syscall.h>
113 #endif
114 #if HAVE_STRING_H
115 #include <string.h>
116 #endif
117 #if HAVE_STRINGS_H
118 #include <strings.h>
119 #endif
120 #if HAVE_BSTRING_H
121 #include <bstring.h>
122 #endif
123 #if HAVE_GETOPT_H
124 #include <getopt.h>
125 #endif
126 #if HAVE_LIMITS_H
127 #include <limits.h>
128 #endif
129 #if _SQUID_WINDOWS_
130 #include <io.h>
131 #endif
132 #if HAVE_SYS_MOUNT_H
133 #include <sys/mount.h>
134 #endif
135 #if HAVE_MATH_H
136 #include <math.h>
137 #endif
138
139 #ifndef MAXPATHLEN
140 #define MAXPATHLEN SQUID_MAXPATHLEN
141 #endif
142
143 #if LEAK_CHECK_MODE
144 #define LOCAL_ARRAY(type,name,size) \
145 static type *local_##name=NULL; \
146 type *name = local_##name ? local_##name : \
147 ( local_##name = (type *)xcalloc(size, sizeof(type)) )
148 #else
149 #define LOCAL_ARRAY(type,name,size) static type name[size]
150 #endif
151
152 #if _SQUID_NEXT_ && !defined(S_ISDIR)
153 #define S_ISDIR(mode) (((mode) & (_S_IFMT)) == (_S_IFDIR))
154 #endif
155
156 #include "md5.h"
157 #if SQUID_SNMP
158 #include "cache_snmp.h"
159 #endif
160 #include "hash.h"
161 #include "rfc3596.h"
162 #include "defines.h"
163 #include "enums.h"
164 #include "typedefs.h"
165 #include "util.h"
166 #include "profiler/Profiler.h"
167 #include "MemPool.h"
168 #include "ip/Address.h"
169 #include "structs.h"
170 #include "protos.h"
171 #include "globals.h"
172
173 /*
174 * I'm sick of having to keep doing this ..
175 */
176 #define INDEXSD(i) (Config.cacheSwap.swapDirs[(i)].getRaw())
177
178 #define FD_READ_METHOD(fd, buf, len) (*fd_table[fd].read_method)(fd, buf, len)
179 #define FD_WRITE_METHOD(fd, buf, len) (*fd_table[fd].write_method)(fd, buf, len)
180
181 #ifndef IPPROTO_UDP
182 #define IPPROTO_UDP 0
183 #endif
184
185 #ifndef IPPROTO_TCP
186 #define IPPROTO_TCP 0
187 #endif
188
189 #endif /* SQUID_H */