~chtsanti/squid/icap-max-connections

« back to all changes in this revision

Viewing changes to src/squid.h

  • Committer: Christos Tsantilas
  • Date: 2009-02-18 22:18:35 UTC
  • mfrom: (9294.1.215 trunk)
  • Revision ID: chtsanti@users.sourceforge.net-20090218221835-lfxxe3bs8uhu0b1h
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#ifndef SQUID_H
33
33
#define SQUID_H
34
34
 
35
 
/*
36
 
 * On linux this must be defined to get PRId64 and friends
37
 
 */
38
 
#define __STDC_FORMAT_MACROS
39
 
 
40
35
#include "config.h"
41
36
 
42
37
#ifdef _SQUID_MSWIN_
45
40
/** \endcond */
46
41
#endif
47
42
 
48
 
#include "assert.h"
49
 
 
50
43
#if HAVE_UNISTD_H
51
44
#include <unistd.h>
52
45
#endif
191
184
#endif /* HAVE_POLL_H */
192
185
#endif /* USE_POLL */
193
186
 
194
 
/*
195
 
 * Filedescriptor limits in the different select loops
196
 
 *
197
 
 * NP: FreeBSD 7 defines FD_SETSIZE as unsigned but Squid needs
198
 
 *     it to be signed to compare it with signed values.
199
 
 *     Linux and others including FreeBSD <7, define it as signed.
200
 
 *     If this causes any issues please contact squid-dev@squid-cache.org
201
 
 */
202
 
#if defined(USE_SELECT) || defined(USE_SELECT_WIN32)
203
 
/* Limited by design */
204
 
# define SQUID_MAXFD_LIMIT ((signed int)FD_SETSIZE)
205
 
#elif defined(USE_POLL)
206
 
/* Limited due to delay pools */
207
 
# define SQUID_MAXFD_LIMIT ((signed int)FD_SETSIZE)
208
 
#elif defined(USE_KQUEUE) || defined(USE_EPOLL)
209
 
# define SQUID_FDSET_NOUSE 1
210
 
#else
211
 
# error Unknown select loop model!
212
 
#endif
213
 
 
214
187
 
215
188
/*
216
189
 * Trap unintentional use of fd_set. Must not be used outside the
224
197
# endif
225
198
#endif
226
199
 
227
 
#if defined(HAVE_STDARG_H)
228
 
#include <stdarg.h>
229
 
#define HAVE_STDARGS            /* let's hope that works everywhere (mj) */
230
 
#define VA_LOCAL_DECL va_list ap;
231
 
#define VA_START(f) va_start(ap, f)
232
 
#define VA_SHIFT(v,t) ;         /* no-op for ANSI */
233
 
#define VA_END va_end(ap)
234
 
#else
235
 
#if defined(HAVE_VARARGS_H)
236
 
#include <varargs.h>
237
 
#undef HAVE_STDARGS
238
 
#define VA_LOCAL_DECL va_list ap;
239
 
#define VA_START(f) va_start(ap)        /* f is ignored! */
240
 
#define VA_SHIFT(v,t) v = va_arg(ap,t)
241
 
#define VA_END va_end(ap)
242
 
#else
243
 
#error XX **NO VARARGS ** XX
244
 
#endif
245
 
#endif
246
 
 
247
 
/* Make sure syslog goes after stdarg/varargs */
248
 
#ifdef HAVE_SYSLOG_H
249
 
#ifdef _SQUID_AIX_
250
 
#define _XOPEN_EXTENDED_SOURCE
251
 
#define _XOPEN_SOURCE_EXTENDED 1
252
 
#endif
253
 
#include <syslog.h>
254
 
#endif
255
 
 
256
200
#if HAVE_MATH_H
257
201
#include <math.h>
258
202
#endif
266
210
#define MAXPATHLEN SQUID_MAXPATHLEN
267
211
#endif
268
212
 
269
 
#if !HAVE_GETRUSAGE
270
 
#if defined(_SQUID_HPUX_)
271
 
#define HAVE_GETRUSAGE 1
272
 
#define getrusage(a, b)  syscall(SYS_GETRUSAGE, a, b)
273
 
#endif
274
 
#endif
275
 
 
276
213
#if !HAVE_STRUCT_RUSAGE
277
214
/*
278
215
 * If we don't have getrusage() then we create a fake structure
329
266
#define S_ISDIR(mode) (((mode) & (_S_IFMT)) == (_S_IFDIR))
330
267
#endif
331
268
 
332
 
#ifdef USE_GNUREGEX
333
 
#ifdef __cplusplus
334
 
extern "C"
335
 
{
336
 
#endif
337
 
#include "GNUregex.h"
338
 
#ifdef __cplusplus
339
 
}
340
 
 
341
 
#endif
342
 
#elif HAVE_REGEX_H
343
 
#include <regex.h>
344
 
#endif
345
 
 
346
269
#include "md5.h"
347
270
 
348
271
#if USE_SSL
392
315
#include "initgroups.h"
393
316
#endif
394
317
 
395
 
#ifndef min
396
 
 
397
 
template<class A>
398
 
inline A const &
399
 
min(A const & lhs, A const & rhs)
400
 
{
401
 
    if (rhs < lhs)
402
 
        return rhs;
403
 
 
404
 
    return lhs;
405
 
}
406
 
 
407
 
#endif
408
 
 
409
 
#define XMIN(x,y) (min (x,y))
410
 
#ifndef max
411
 
template<class A>
412
 
inline A const &
413
 
max(A const & lhs, A const & rhs)
414
 
{
415
 
    if (rhs > lhs)
416
 
        return rhs;
417
 
 
418
 
    return lhs;
419
 
}
420
 
 
421
 
#endif
422
 
 
423
 
#define XMAX(a,b) (max (a,b))
424
 
 
425
318
#include "structs.h"
426
319
#include "protos.h"
427
320
#include "globals.h"