Use PCRE syntax in host patterns when configured
[privoxy.git] / acconfig.h
1 #ifndef CONFIG_H_INCLUDED
2 #define CONFIG_H_INCLUDED
3 /*********************************************************************
4  *
5  * File        :  $Source: /cvsroot/ijbswa/current/acconfig.h,v $
6  *
7  * Purpose     :  This file should be the first thing included in every
8  *                .c file.  (Before even system headers).  It contains 
9  *                #define statements for various features.  It was
10  *                introduced because the compile command line started
11  *                getting ludicrously long with feature defines.
12  *
13  * Copyright   :  Written by and Copyright (C) 2001 the SourceForge
14  *                Privoxy team. http://www.privoxy.org/
15  *
16  *                Based on the Internet Junkbuster originally written
17  *                by and Copyright (C) 1997 Anonymous Coders and 
18  *                Junkbusters Corporation.  http://www.junkbusters.com
19  *
20  *                This program is free software; you can redistribute it 
21  *                and/or modify it under the terms of the GNU General
22  *                Public License as published by the Free Software
23  *                Foundation; either version 2 of the License, or (at
24  *                your option) any later version.
25  *
26  *                This program is distributed in the hope that it will
27  *                be useful, but WITHOUT ANY WARRANTY; without even the
28  *                implied warranty of MERCHANTABILITY or FITNESS FOR A
29  *                PARTICULAR PURPOSE.  See the GNU General Public
30  *                License for more details.
31  *
32  *                The GNU General Public License should be included with
33  *                this file.  If not, you can view it at
34  *                http://www.gnu.org/copyleft/gpl.html
35  *                or write to the Free Software Foundation, Inc., 59
36  *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
37  *
38  * Revisions   :
39  *    $Log: acconfig.h,v $
40  *    Revision 1.33  2006/12/17 19:15:26  fabiankeil
41  *    Added ./configure switch for FEATURE_GRACEFUL_TERMINATION.
42  *
43  *    Revision 1.32  2006/07/18 14:48:45  david__schmidt
44  *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
45  *    with what was really the latest development (the v_3_0_branch branch)
46  *
47  *    Revision 1.27.2.4  2003/12/17 16:34:40  oes
48  *    Cosmetics
49  *
50  *    Revision 1.27.2.3  2003/03/27 16:03:19  oes
51  *    Another shot at Bug #707467
52  *
53  *    Revision 1.27.2.2  2003/03/21 14:39:12  oes
54  *    Presumably fixed Bug #707467 by defining unix ifdef __unix__
55  *
56  *    Revision 1.27.2.1  2002/08/10 11:22:31  oes
57  *    - Add two AC_DEFINEs that indicate if the pcre*.h headers
58  *      are located in a pcre/ subdir to the include path.
59  *
60  *    Revision 1.27  2002/04/25 19:13:57  morcego
61  *    Removed RPM release number declaration on configure.in
62  *    Changed makefile to use given value for RPM_PACKAGEV when on uploading
63  *    targets (will produce an error, explaining who to do it, if no value
64  *    if provided).
65  *
66  *    Revision 1.26  2002/04/11 11:00:21  oes
67  *    Applied Moritz' fix for socklen_t on Solaris
68  *
69  *    Revision 1.25  2002/04/06 20:38:01  jongfoster
70  *    Renaming VC++ versions of config.h
71  *
72  *    Revision 1.24  2002/04/04 00:36:36  gliptak
73  *    always use pcre for matching
74  *
75  *    Revision 1.23  2002/04/03 22:28:03  gliptak
76  *    Removed references to gnu_regex
77  *
78  *    Revision 1.22  2002/03/26 22:29:54  swa
79  *    we have a new homepage!
80  *
81  *    Revision 1.21  2002/03/24 14:31:08  swa
82  *    remove more crappy files. set RPM
83  *    release version correctly.
84  *
85  *    Revision 1.20  2002/03/24 13:46:44  swa
86  *    name change related issue.
87  *
88  *    Revision 1.19  2002/03/24 13:25:42  swa
89  *    name change related issues
90  *
91  *    Revision 1.18  2002/03/08 16:40:28  oes
92  *    Added FEATURE_NO_GIFS
93  *
94  *    Revision 1.17  2002/03/04 17:52:44  oes
95  *    Deleted PID_FILE_PATH
96  *
97  *    Revision 1.16  2002/01/10 12:36:18  oes
98  *    Moved HAVE_*_R to acconfig.h, where they belong.
99  *
100  *    Revision 1.15  2001/12/30 14:07:31  steudten
101  *    - Add signal handling (unix)
102  *    - Add SIGHUP handler (unix)
103  *    - Add creation of pidfile (unix)
104  *    - Add action 'top' in rc file (RH)
105  *    - Add entry 'SIGNALS' to manpage
106  *    - Add exit message to logfile (unix)
107  *
108  *    Revision 1.14  2001/10/23 21:24:09  jongfoster
109  *    Support for FEATURE_CGI_EDIT_ACTIONS
110  *
111  *    Revision 1.13  2001/10/07 15:30:41  oes
112  *    Removed FEATURE_DENY_GZIP
113  *
114  *    Revision 1.12  2001/09/13 19:56:37  jongfoster
115  *    Reverting to revision 1.10 - previous checking was majorly broken.
116  *
117  *    Revision 1.10  2001/07/30 22:08:36  jongfoster
118  *    Tidying up #defines:
119  *    - All feature #defines are now of the form FEATURE_xxx
120  *    - Permanently turned off WIN_GUI_EDIT
121  *    - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS
122  *
123  *    Revision 1.9  2001/07/29 19:08:52  jongfoster
124  *    Changing _CONFIG_H to CONFIG_H_INCLUDED.
125  *    Also added protection against using a MinGW32 or CygWin version of
126  *    config.h from within MS Visual C++
127  *
128  *    Revision 1.8  2001/07/29 17:09:17  jongfoster
129  *    Major changes to build system in order to fix these bugs:
130  *    - pthreads under Linux was broken - changed -lpthread to -pthread
131  *    - Compiling in MinGW32 mode under CygWin now correctly detects
132  *      which shared libraries are available
133  *    - Solaris support (?) (Not tested under Solaris yet)
134  *
135  *    Revision 1.7  2001/07/25 22:53:59  jongfoster
136  *    Will #error if pthreads is enabled under BeOs
137  *
138  *    Revision 1.6  2001/07/15 17:54:29  jongfoster
139  *    Renaming #define STATIC to STATIC_PCRE
140  *    Adding new #define FEATURE_PTHREAD that will be used to enable
141  *    POSIX threads support.
142  *
143  *    Revision 1.5  2001/07/13 13:48:37  oes
144  *     - (Fix:) Copied CODE_STATUS #define from config.h.in
145  *     - split REGEX #define into REGEX_GNU and REGEX_PCRE
146  *       and removed PCRE.
147  *       (REGEX = REGEX_GNU || REGEX_PCRE per project.h)
148  *     - Moved STATIC (for pcre) here from Makefile.in
149  *     - Introduced STATIC_PCRS #define to allow for dynaimc linking with
150  *       libpcrs
151  *     - Removed PCRS #define, since pcrs is now needed for CGI anyway
152  *
153  *    Revision 1.4  2001/05/29 09:50:24  jongfoster
154  *    Unified blocklist/imagelist/permissionslist.
155  *    File format is still under discussion, but the internal changes
156  *    are (mostly) done.
157  *
158  *    Also modified interceptor behaviour:
159  *    - We now intercept all URLs beginning with one of the following
160  *      prefixes (and *only* these prefixes):
161  *        * http://i.j.b/
162  *        * http://ijbswa.sf.net/config/
163  *        * http://ijbswa.sourceforge.net/config/
164  *    - New interceptors "home page" - go to http://i.j.b/ to see it.
165  *    - Internal changes so that intercepted and fast redirect pages
166  *      are not replaced with an image.
167  *    - Interceptors now have the option to send a binary page direct
168  *      to the client. (i.e. ijb-send-banner uses this)
169  *    - Implemented show-url-info interceptor.  (Which is why I needed
170  *      the above interceptors changes - a typical URL is
171  *      "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif".
172  *      The previous mechanism would not have intercepted that, and
173  *      if it had been intercepted then it then it would have replaced
174  *      it with an image.)
175  *
176  *    Revision 1.3  2001/05/26 01:26:34  jongfoster
177  *    New #define, WIN_GUI_EDIT, enables the (embryonic) Win32 GUI editor.
178  *    This #define cannot be set from ./configure - there's no point, it
179  *    doesn't work yet.  See feature request # 425722
180  *
181  *    Revision 1.2  2001/05/22 17:43:35  oes
182  *
183  *    - Enabled filtering banners by size rather than URL
184  *      by adding patterns that replace all standard banner
185  *      sizes with the "Junkbuster" gif to the re_filterfile
186  *
187  *    - Enabled filtering WebBugs by providing a pattern
188  *      which kills all 1x1 images
189  *
190  *    - Added support for PCRE_UNGREEDY behaviour to pcrs,
191  *      which is selected by the (nonstandard and therefore
192  *      capital) letter 'U' in the option string.
193  *      It causes the quantifiers to be ungreedy by default.
194  *      Appending a ? turns back to greedy (!).
195  *
196  *    - Added a new interceptor ijb-send-banner, which
197  *      sends back the "Junkbuster" gif. Without imagelist or
198  *      MSIE detection support, or if tinygif = 1, or the
199  *      URL isn't recognized as an imageurl, a lame HTML
200  *      explanation is sent instead.
201  *
202  *    - Added new feature, which permits blocking remote
203  *      script redirects and firing back a local redirect
204  *      to the browser.
205  *      The feature is conditionally compiled, i.e. it
206  *      can be disabled with --disable-fast-redirects,
207  *      plus it must be activated by a "fast-redirects"
208  *      line in the config file, has its own log level
209  *      and of course wants to be displayed by show-proxy-args
210  *      Note: Boy, all the #ifdefs in 1001 locations and
211  *      all the fumbling with configure.in and acconfig.h
212  *      were *way* more work than the feature itself :-(
213  *
214  *    - Because a generic redirect template was needed for
215  *      this, tinygif = 3 now uses the same.
216  *
217  *    - Moved GIFs, and other static HTTP response templates
218  *      to project.h
219  *
220  *    - Many minor fixes
221  *
222  *    - Removed some >400 CRs again (Jon, you really worked
223  *      a lot! ;-)
224  *
225  *    Revision 1.1.1.1  2001/05/15 13:58:45  oes
226  *    Initial import of version 2.9.3 source tree
227  *
228  *
229  *********************************************************************/
230 \f
231 @TOP@
232
233 /*
234  * Version number - Major (X._._)
235  */
236 #undef VERSION_MAJOR
237
238 /*
239  * Version number - Minor (_.X._)
240  */
241 #undef VERSION_MINOR
242
243 /*
244  * Version number - Point (_._.X)
245  */
246 #undef VERSION_POINT
247
248 /*
249  * Version number, as a string
250  */
251 #undef VERSION
252
253 /*
254  * Status of the code: "alpha", "beta" or "stable".
255  */
256 #undef CODE_STATUS
257
258 /* 
259  * Should pcre be statically built in instead of linkling with libpcre?
260  * (This is determined by configure depending on the availiability of
261  * libpcre and user preferences). The name is ugly, but pcre needs it.
262  * Don't bother to change this here! Use configure instead.
263  */
264 #undef STATIC_PCRE
265
266 /* 
267  * Should pcrs be statically built in instead of linkling with libpcrs?
268  * (This is determined by configure depending on the availiability of
269  * libpcrs and user preferences).
270  * Don't bother to change this here! Use configure instead.
271  */
272 #undef STATIC_PCRS
273
274 /*
275  * Allows the use of an ACL to control access to the proxy by IP address.
276  */
277 #undef FEATURE_ACL
278
279 /*
280  * Enables the web-based configuration (actionsfile) editor.  If you
281  * have a shared proxy, you might want to turn this off.
282  */
283 #undef FEATURE_CGI_EDIT_ACTIONS
284
285 /*
286  * Allows the use of jar files to capture cookies.
287  */
288 #undef FEATURE_COOKIE_JAR
289
290 /*
291  * Locally redirect remote script-redirect URLs
292  */
293 #undef FEATURE_FAST_REDIRECTS
294
295 /*
296  * Bypass filtering for 1 page only
297  */
298 #undef FEATURE_FORCE_LOAD
299
300 /*
301  * Allow blocking using images as well as HTML.
302  * If you do not define this then everything is blocked as HTML.
303  *
304  * Note that this is required if you want to use FEATURE_IMAGE_DETECT_MSIE.
305  */
306 #undef FEATURE_IMAGE_BLOCKING
307
308 /*
309  * Detect image requests automatically for MSIE.  Will fall back to
310  * other image-detection methods (i.e. "+image" permission) for other
311  * browsers.
312  *
313  * You must also define FEATURE_IMAGE_BLOCKING to use this feature.
314  *
315  * It detects the following header pair as an image request:
316  *
317  * User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
318  * Accept: * / *
319  *
320  * And the following as a HTML request:
321  *
322  * User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
323  * Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, * / *
324  *
325  * And no, I haven't got that backwards - IE is being wierd.
326  *
327  * Known limitations: 
328  * 1) If you press shift-reload on a blocked HTML page, you get
329  *    the image "blocked" page, not the HTML "blocked" page.
330  * 2) Once an image "blocked" page has been sent, viewing it 
331  *    in it's own browser window *should* bring up the HTML
332  *    "blocked" page, but it doesn't.  You need to clear the 
333  *    browser cache to get the HTML version again.
334  *
335  * These limitations are due to IE making inconsistent choices
336  * about which "Accept:" header to send.
337  */
338 #undef FEATURE_IMAGE_DETECT_MSIE
339
340 /*
341  * Kills JavaScript popups - window.open, onunload, etc.
342  */
343 #undef FEATURE_KILL_POPUPS
344
345 /*
346  * Use PNG instead of GIF for built-in images
347  */
348 #undef FEATURE_NO_GIFS
349
350 /*
351  * Allow to shutdown Privoxy through the webinterface.
352  */
353 #undef FEATURE_GRACEFUL_TERMINATION
354
355 /*
356  * Allow PCRE syntax in host patterns.
357  */
358 #undef FEATURE_PCRE_HOST_PATTERNS
359
360 /*
361  * Use POSIX threads instead of native threads.
362  */
363 #undef FEATURE_PTHREAD
364
365 /*
366  * Enables statistics function.
367  */
368 #undef FEATURE_STATISTICS
369
370 /*
371  * Allow Privoxy to be "disabled" so it is just a normal non-blocking
372  * non-anonymizing proxy.  This is useful if you're trying to access a
373  * blocked or broken site - just change the setting in the config file,
374  * or use the handy "Disable" menu option in the Windows GUI.
375  */
376 #undef FEATURE_TOGGLE
377
378 /*
379  * Allows the use of trust files.
380  */
381 #undef FEATURE_TRUST
382
383 /*
384  * Defined on Solaris only.  Makes the system libraries thread safe.
385  */
386 #undef _REENTRANT
387
388 /*
389  * Defined on Solaris only.  Without this, many important functions are not
390  * defined in the system headers.
391  */
392 #undef __EXTENSIONS__
393
394 /*
395  * Defined always.
396  * FIXME: Don't know what it does or why we need it.
397  * (presumably something to do with MultiThreading?)
398  */
399 #undef __MT__
400
401 /* If the (nonstandard and thread-safe) function gethostbyname_r
402  * is available, select which signature to use
403  */
404 #undef HAVE_GETHOSTBYNAME_R_6_ARGS
405 #undef HAVE_GETHOSTBYNAME_R_5_ARGS
406 #undef HAVE_GETHOSTBYNAME_R_3_ARGS
407
408 /* If the (nonstandard and thread-safe) function gethostbyaddr_r
409  * is available, select which signature to use
410  */
411 #undef HAVE_GETHOSTBYADDR_R_8_ARGS
412 #undef HAVE_GETHOSTBYADDR_R_7_ARGS
413 #undef HAVE_GETHOSTBYADDR_R_5_ARGS
414
415 /* Defined if you have gmtime_r and localtime_r with a signature
416  * of (struct time *, struct tm *)
417  */
418 #undef HAVE_GMTIME_R
419 #undef HAVE_LOCALTIME_R
420
421 /* Define to 'int' if <sys/socket.h> doesn't have it. 
422  */
423 #undef socklen_t
424
425 /* Define if pcre.h must be included as <pcre/pcre.h>
426  */
427 #undef PCRE_H_IN_SUBDIR
428
429 /* Define if pcreposix.h must be included as <pcre/pcreposix.h>
430  */
431 #undef PCREPOSIX_H_IN_SUBDIR
432
433 @BOTTOM@
434
435 /*
436  * Defined always.
437  * FIXME: Don't know what it does or why we need it.
438  * (presumably something to do with ANSI Standard C?)
439  */
440 #ifndef __STDC__
441 #define __STDC__ 1
442 #endif /* ndef __STDC__ */
443
444 /*
445  * Need to set up this define only for the Pthreads library for
446  * Win32, available from http://sources.redhat.com/pthreads-win32/
447  */
448 #if defined(FEATURE_PTHREAD) && defined(_WIN32)
449 #define __CLEANUP_C
450 #endif /* defined(FEATURE_PTHREAD) && defined(_WIN32) */
451
452 /*
453  * BEOS does not currently support POSIX threads.
454  * This *should* be detected by ./configure, but let's be sure.
455  */
456 #if defined(FEATURE_PTHREAD) && defined(__BEOS__)
457 #error BEOS does not support pthread - please run ./configure again with "--disable-pthread"
458
459 #endif /* defined(FEATURE_PTHREAD) && defined(__BEOS__) */
460
461 /*
462  * On OpenBSD and maybe also FreeBSD, gcc doesn't define the cpp
463  * symbol unix; it defines __unix__ and sometimes not even that:
464  */
465 #if ( defined(__unix__) || defined(__NetBSD__) ) && !defined(unix)
466 #define unix 1
467 #endif
468
469 /*
470  * It's too easy to accidentally use a Cygwin or MinGW32 version of config.h
471  * under VC++, and it usually gives many wierd error messages.  Let's make
472  * the error messages understandable, by bailing out now.
473  */
474 #ifdef _MSC_VER
475 #error For MS VC++, please use vc_config_winthreads.h or vc_config_pthreads.h.  You can usually do this by selecting the "Build", "Clean" menu option.
476 #endif /* def _MSC_VER */
477
478 #endif /* CONFIG_H_INCLUDED */