[tor-commits] [orbot/master] removed privoxy source

n8fr8 at torproject.org n8fr8 at torproject.org
Mon Oct 1 07:41:25 UTC 2012


commit a8fab5e851e1f9c082c4902132ee81c461bd11a1
Author: n8fr8 <nathan at freitas.net>
Date:   Fri Jul 6 14:53:01 2012 -0400

    removed privoxy source
---
 external/privoxy/AUTHORS                           |  116 -
 external/privoxy/ChangeLog                         |  717 --
 external/privoxy/GNUmakefile.in                    | 2156 -----
 external/privoxy/INSTALL                           |  173 -
 external/privoxy/LICENSE                           |  339 -
 external/privoxy/Makefile                          |  108 -
 external/privoxy/README                            |  280 -
 external/privoxy/acconfig.h                        |  495 --
 external/privoxy/actionlist.h                      |  306 -
 external/privoxy/actions.c                         | 2021 -----
 external/privoxy/actions.h                         |  187 -
 external/privoxy/amiga.c                           |  341 -
 external/privoxy/amiga.h                           |  176 -
 external/privoxy/cgi.c                             | 2987 -------
 external/privoxy/cgi.h                             |  289 -
 external/privoxy/cgiedit.c                         | 4924 -----------
 external/privoxy/cgiedit.h                         |  175 -
 external/privoxy/cgisimple.c                       | 2295 -----
 external/privoxy/cgisimple.h                       |  185 -
 external/privoxy/config                            | 1530 ----
 external/privoxy/config.guess                      | 1530 ----
 external/privoxy/config.orig                       | 1530 ----
 external/privoxy/config.sub                        | 1773 ----
 external/privoxy/configure.in                      | 1463 ---
 external/privoxy/cygwin.h                          |   80 -
 external/privoxy/deanimate.c                       |  554 --
 external/privoxy/deanimate.h                       |  126 -
 external/privoxy/default.action.master             | 2162 -----
 external/privoxy/default.filter                    | 1289 ---
 external/privoxy/doc/gpl.html                      |  560 --
 external/privoxy/doc/pcrs.3                        |  488 -
 external/privoxy/doc/source/authors.sgml           |   67 -
 external/privoxy/doc/source/buildsource.sgml       |  256 -
 external/privoxy/doc/source/config.sgml            |   36 -
 external/privoxy/doc/source/contacting.sgml        |  262 -
 external/privoxy/doc/source/copyright.sgml         |   47 -
 external/privoxy/doc/source/developer-manual.sgml  | 3304 -------
 external/privoxy/doc/source/faq.sgml               | 3454 --------
 external/privoxy/doc/source/history.sgml           |   71 -
 external/privoxy/doc/source/install.sgml           |  106 -
 external/privoxy/doc/source/ldp.dsl.in             |  420 -
 external/privoxy/doc/source/license.sgml           |   50 -
 external/privoxy/doc/source/newfeatures.sgml       |  156 -
 external/privoxy/doc/source/p-authors.sgml         |  159 -
 external/privoxy/doc/source/p-config.sgml          | 2756 ------
 external/privoxy/doc/source/privoxy-man-page.sgml  |  352 -
 external/privoxy/doc/source/privoxy.sgml           |   44 -
 external/privoxy/doc/source/readme.sgml            |  268 -
 external/privoxy/doc/source/seealso.sgml           |  113 -
 external/privoxy/doc/source/supported.sgml         |   46 -
 external/privoxy/doc/source/temp/manpage.refs      |    4 -
 external/privoxy/doc/source/user-manual.sgml       | 9328 --------------------
 external/privoxy/doc/source/webserver/index.sgml   |  372 -
 external/privoxy/doc/webserver/README.txt          |    9 -
 external/privoxy/doc/webserver/announce.txt        |  126 -
 .../doc/webserver/developer-manual/coding.html     | 2602 ------
 .../doc/webserver/developer-manual/contact.html    |  510 --
 .../doc/webserver/developer-manual/copyright.html  |  298 -
 .../doc/webserver/developer-manual/cvs.html        |  330 -
 .../webserver/developer-manual/documentation.html  |  944 --
 .../doc/webserver/developer-manual/index.html      |  688 --
 .../webserver/developer-manual/introduction.html   |  199 -
 .../doc/webserver/developer-manual/newrelease.html | 1956 ----
 .../doc/webserver/developer-manual/quickstart.html |  150 -
 .../doc/webserver/developer-manual/seealso.html    |  405 -
 .../doc/webserver/developer-manual/testing.html    |  259 -
 .../developer-manual/webserver-update.html         |  260 -
 .../privoxy/doc/webserver/faq/configuration.html   | 1797 ----
 external/privoxy/doc/webserver/faq/contact.html    |  510 --
 external/privoxy/doc/webserver/faq/copyright.html  |  301 -
 external/privoxy/doc/webserver/faq/general.html    | 1076 ---
 external/privoxy/doc/webserver/faq/index.html      |  999 ---
 .../privoxy/doc/webserver/faq/installation.html    |  569 --
 external/privoxy/doc/webserver/faq/misc.html       | 1745 ----
 external/privoxy/doc/webserver/faq/trouble.html    | 1276 ---
 .../privoxy/doc/webserver/images/files-in-use.jpg  |  Bin 16587 -> 0 bytes
 .../privoxy/doc/webserver/images/proxy_setup.jpg   |  Bin 33275 -> 0 bytes
 external/privoxy/doc/webserver/index.html          |  328 -
 .../doc/webserver/man-page/privoxy-man-page.html   |  294 -
 external/privoxy/doc/webserver/p_doc.css           |   66 -
 external/privoxy/doc/webserver/p_feedback.css      |    9 -
 external/privoxy/doc/webserver/privoxy-index.html  |  283 -
 external/privoxy/doc/webserver/privoxy.css         |   69 -
 external/privoxy/doc/webserver/robots.txt          |   17 -
 external/privoxy/doc/webserver/team/01stefanw.jpg  |  Bin 10327 -> 0 bytes
 .../privoxy/doc/webserver/team/01stefanw_t.jpg     |  Bin 1896 -> 0 bytes
 external/privoxy/doc/webserver/team/02jon.jpg      |  Bin 85888 -> 0 bytes
 external/privoxy/doc/webserver/team/02jon_t.jpg    |  Bin 2039 -> 0 bytes
 external/privoxy/doc/webserver/team/03andreas.jpg  |  Bin 42354 -> 0 bytes
 .../privoxy/doc/webserver/team/03andreas_t.jpg     |  Bin 1894 -> 0 bytes
 external/privoxy/doc/webserver/team/04rodney.jpg   |  Bin 57055 -> 0 bytes
 external/privoxy/doc/webserver/team/04rodney_t.jpg |  Bin 2138 -> 0 bytes
 external/privoxy/doc/webserver/team/05david.jpg    |  Bin 62834 -> 0 bytes
 external/privoxy/doc/webserver/team/05david_t.jpg  |  Bin 3950 -> 0 bytes
 external/privoxy/doc/webserver/team/05member.jpg   |  Bin 932 -> 0 bytes
 external/privoxy/doc/webserver/team/05member_t.jpg |  Bin 1049 -> 0 bytes
 external/privoxy/doc/webserver/team/06member.jpg   |  Bin 932 -> 0 bytes
 external/privoxy/doc/webserver/team/06member_t.jpg |  Bin 1049 -> 0 bytes
 external/privoxy/doc/webserver/team/07member.jpg   |  Bin 932 -> 0 bytes
 external/privoxy/doc/webserver/team/07member_t.jpg |  Bin 1049 -> 0 bytes
 external/privoxy/doc/webserver/team/08member.jpg   |  Bin 932 -> 0 bytes
 external/privoxy/doc/webserver/team/08member_t.jpg |  Bin 1049 -> 0 bytes
 external/privoxy/doc/webserver/team/20member.jpg   |  Bin 932 -> 0 bytes
 external/privoxy/doc/webserver/team/20member_t.jpg |  Bin 1049 -> 0 bytes
 external/privoxy/doc/webserver/team/index.html     |   26 -
 .../doc/webserver/user-manual/actions-file.html    | 8214 -----------------
 .../doc/webserver/user-manual/appendix.html        | 2187 -----
 .../privoxy/doc/webserver/user-manual/config.html  | 4121 ---------
 .../doc/webserver/user-manual/configuration.html   |  514 --
 .../privoxy/doc/webserver/user-manual/contact.html |  514 --
 .../doc/webserver/user-manual/copyright.html       |  424 -
 .../doc/webserver/user-manual/files-in-use.jpg     |  Bin 16587 -> 0 bytes
 .../doc/webserver/user-manual/filter-file.html     | 1652 ----
 .../privoxy/doc/webserver/user-manual/index.html   |  963 --
 .../doc/webserver/user-manual/installation.html    | 1082 ---
 .../doc/webserver/user-manual/introduction.html    |  292 -
 .../privoxy/doc/webserver/user-manual/proxy2.jpg   |  Bin 45431 -> 0 bytes
 .../doc/webserver/user-manual/proxy_setup.jpg      |  Bin 33275 -> 0 bytes
 .../doc/webserver/user-manual/quickstart.html      |  943 --
 .../privoxy/doc/webserver/user-manual/seealso.html |  418 -
 .../privoxy/doc/webserver/user-manual/startup.html |  902 --
 .../doc/webserver/user-manual/templates.html       |  321 -
 .../doc/webserver/user-manual/upgradersnote.html   |  296 -
 .../doc/webserver/user-manual/whatsnew.html        |  351 -
 external/privoxy/encode.c                          |  430 -
 external/privoxy/encode.h                          |   94 -
 external/privoxy/errlog.c                          | 1547 ----
 external/privoxy/errlog.h                          |  215 -
 external/privoxy/filters.c                         | 2709 ------
 external/privoxy/filters.h                         |  382 -
 external/privoxy/gateway.c                         | 1379 ---
 external/privoxy/gateway.h                         |  158 -
 external/privoxy/genclspec.sh                      |   55 -
 external/privoxy/icons/ico00001.ico                |  Bin 318 -> 0 bytes
 external/privoxy/icons/ico00002.ico                |  Bin 318 -> 0 bytes
 external/privoxy/icons/ico00003.ico                |  Bin 318 -> 0 bytes
 external/privoxy/icons/ico00004.ico                |  Bin 318 -> 0 bytes
 external/privoxy/icons/ico00005.ico                |  Bin 318 -> 0 bytes
 external/privoxy/icons/ico00006.ico                |  Bin 318 -> 0 bytes
 external/privoxy/icons/ico00007.ico                |  Bin 318 -> 0 bytes
 external/privoxy/icons/ico00008.ico                |  Bin 318 -> 0 bytes
 external/privoxy/icons/idle.ico                    |  Bin 318 -> 0 bytes
 external/privoxy/icons/off.ico                     |  Bin 318 -> 0 bytes
 external/privoxy/icons/os2.ico                     |  Bin 2968 -> 0 bytes
 external/privoxy/icons/os20.ico                    |  Bin 498 -> 0 bytes
 external/privoxy/icons/os21.ico                    |  Bin 498 -> 0 bytes
 external/privoxy/icons/os22.ico                    |  Bin 498 -> 0 bytes
 external/privoxy/icons/os23.ico                    |  Bin 498 -> 0 bytes
 external/privoxy/icons/os24.ico                    |  Bin 498 -> 0 bytes
 external/privoxy/icons/os25.ico                    |  Bin 498 -> 0 bytes
 external/privoxy/icons/os26.ico                    |  Bin 498 -> 0 bytes
 external/privoxy/icons/os27.ico                    |  Bin 498 -> 0 bytes
 external/privoxy/icons/os28.ico                    |  Bin 498 -> 0 bytes
 external/privoxy/icons/privoxy.ico                 |  Bin 318 -> 0 bytes
 external/privoxy/install-sh                        |  251 -
 external/privoxy/jbsockets.c                       | 1054 ---
 external/privoxy/jbsockets.h                       |  149 -
 external/privoxy/jcc.c                             | 4486 ----------
 external/privoxy/jcc.c.rej                         |   20 -
 external/privoxy/jcc.h                             |  261 -
 external/privoxy/list.c                            | 1229 ---
 external/privoxy/list.h                            |  181 -
 external/privoxy/loadcfg.c                         | 2041 -----
 external/privoxy/loadcfg.h                         |  199 -
 external/privoxy/loaders.c                         | 1762 ----
 external/privoxy/loaders.h                         |  250 -
 external/privoxy/match-all.action                  |   14 -
 external/privoxy/miscutil.c                        | 1907 ----
 external/privoxy/miscutil.h                        |  259 -
 external/privoxy/mkinstalldirs                     |   40 -
 external/privoxy/parsers.c                         | 4740 ----------
 external/privoxy/parsers.c.rej                     |   16 -
 external/privoxy/parsers.h                         |  323 -
 external/privoxy/pcre/Makefile.in                  |  219 -
 external/privoxy/pcre/RunTest.in                   |  148 -
 external/privoxy/pcre/chartables.c                 |  183 -
 external/privoxy/pcre/config.guess                 | 1121 ---
 external/privoxy/pcre/config.h                     |    5 -
 external/privoxy/pcre/config.in                    |   33 -
 external/privoxy/pcre/config.sub                   | 1232 ---
 external/privoxy/pcre/configure                    | 1568 ----
 external/privoxy/pcre/configure.in                 |   85 -
 external/privoxy/pcre/dftables                     |  Bin 22917 -> 0 bytes
 external/privoxy/pcre/dftables.c                   |  148 -
 external/privoxy/pcre/dll.mk                       |   60 -
 external/privoxy/pcre/doc/ChangeLog                |  655 --
 external/privoxy/pcre/doc/NON-UNIX-USE             |   50 -
 external/privoxy/pcre/doc/Tech.Notes               |  243 -
 external/privoxy/pcre/doc/authors                  |    6 -
 external/privoxy/pcre/doc/copying                  |   46 -
 external/privoxy/pcre/doc/news                     |   54 -
 external/privoxy/pcre/doc/pcre.3                   | 1810 ----
 external/privoxy/pcre/doc/pcre.html                | 2397 -----
 external/privoxy/pcre/doc/pcre.txt                 | 2125 -----
 external/privoxy/pcre/doc/pcregrep.1               |   76 -
 external/privoxy/pcre/doc/pcregrep.html            |  105 -
 external/privoxy/pcre/doc/pcregrep.txt             |   87 -
 external/privoxy/pcre/doc/pcreposix.3              |  149 -
 external/privoxy/pcre/doc/pcreposix.html           |  191 -
 external/privoxy/pcre/doc/pcreposix.txt            |  159 -
 external/privoxy/pcre/doc/pcretest.txt             |  246 -
 external/privoxy/pcre/doc/perltest.txt             |   29 -
 external/privoxy/pcre/doc/readme                   |  270 -
 external/privoxy/pcre/get.c                        |  227 -
 external/privoxy/pcre/install                      |  185 -
 external/privoxy/pcre/install-sh                   |  251 -
 external/privoxy/pcre/internal.h                   |  381 -
 external/privoxy/pcre/licence                      |   46 -
 external/privoxy/pcre/ltconfig                     | 3078 -------
 external/privoxy/pcre/ltmain.sh                    | 4012 ---------
 external/privoxy/pcre/maketables.c                 |  132 -
 external/privoxy/pcre/pcre-config                  |   59 -
 external/privoxy/pcre/pcre-config.in               |   59 -
 external/privoxy/pcre/pcre.c                       | 5151 -----------
 external/privoxy/pcre/pcre.def                     |   19 -
 external/privoxy/pcre/pcre.h                       |  110 -
 external/privoxy/pcre/pcre.in                      |  110 -
 external/privoxy/pcre/pcregrep.c                   |  228 -
 external/privoxy/pcre/pcreposix.c                  |  280 -
 external/privoxy/pcre/pcreposix.h                  |   88 -
 external/privoxy/pcre/pcretest.c                   | 1225 ---
 external/privoxy/pcre/study.c                      |  397 -
 external/privoxy/pcre/vc_dftables.dsp              |  296 -
 external/privoxy/pcrs.c                            | 1317 ---
 external/privoxy/pcrs.h                            |  221 -
 external/privoxy/privoxy-generic.init              |  182 -
 external/privoxy/privoxy-rh.spec                   | 1196 ---
 external/privoxy/privoxy-suse.spec                 |  556 --
 external/privoxy/privoxy.1                         |  216 -
 external/privoxy/privoxy.init                      |  276 -
 external/privoxy/privoxy.init.suse                 |  127 -
 external/privoxy/privoxy.logrotate                 |  107 -
 external/privoxy/project.h                         | 1885 ----
 external/privoxy/regression-tests.action           |  782 --
 external/privoxy/slackware/rc.privoxy.orig         |  109 -
 external/privoxy/ssplit.c                          |  218 -
 external/privoxy/ssplit.h                          |   84 -
 external/privoxy/strptime.h                        | 1003 ---
 external/privoxy/templates/blocked                 |  287 -
 external/privoxy/templates/cgi-error-404           |  149 -
 external/privoxy/templates/cgi-error-bad-param     |  156 -
 external/privoxy/templates/cgi-error-disabled      |  169 -
 external/privoxy/templates/cgi-error-file          |  139 -
 .../privoxy/templates/cgi-error-file-read-only     |  146 -
 external/privoxy/templates/cgi-error-modified      |  157 -
 external/privoxy/templates/cgi-error-parse         |  176 -
 external/privoxy/templates/cgi-style.css           |  173 -
 external/privoxy/templates/connect-failed          |  156 -
 external/privoxy/templates/default                 |  131 -
 .../privoxy/templates/edit-actions-add-url-form    |  216 -
 external/privoxy/templates/edit-actions-for-url    | 1425 ---
 .../privoxy/templates/edit-actions-for-url-filter  |   40 -
 external/privoxy/templates/edit-actions-list       |  412 -
 .../privoxy/templates/edit-actions-list-button     |   49 -
 .../privoxy/templates/edit-actions-list-section    |  125 -
 external/privoxy/templates/edit-actions-list-url   |   95 -
 .../privoxy/templates/edit-actions-remove-url-form |  196 -
 external/privoxy/templates/edit-actions-url-form   |  219 -
 external/privoxy/templates/forwarding-failed       |  167 -
 external/privoxy/templates/mod-local-help          |   12 -
 external/privoxy/templates/mod-support-and-service |   61 -
 external/privoxy/templates/mod-title               |    4 -
 external/privoxy/templates/mod-unstable-warning    |    7 -
 external/privoxy/templates/no-such-domain          |  158 -
 external/privoxy/templates/show-request            |  154 -
 external/privoxy/templates/show-status             |  343 -
 external/privoxy/templates/show-status-file        |  146 -
 external/privoxy/templates/show-url-info           |  340 -
 external/privoxy/templates/show-version            |  159 -
 external/privoxy/templates/toggle                  |  180 -
 external/privoxy/templates/toggle-mini             |   91 -
 external/privoxy/templates/untrusted               |  191 -
 external/privoxy/templates/url-info-osd.xml        |   14 -
 external/privoxy/tools/privoxy-log-parser.pl       | 2064 -----
 external/privoxy/tools/privoxy-regression-test.pl  | 1754 ----
 external/privoxy/tools/url-pattern-translator.pl   |  139 -
 external/privoxy/trust                             |   85 -
 external/privoxy/urlmatch.c                        | 1452 ---
 external/privoxy/urlmatch.h                        |  136 -
 external/privoxy/user.action                       |  169 -
 external/privoxy/user.filter                       |   75 -
 external/privoxy/utils/changelog2doc.pl            |   66 -
 external/privoxy/utils/docbook2man/COPYING         |  340 -
 .../privoxy/utils/docbook2man/docbook2man-spec.pl  | 1229 ---
 .../utils/docbook2man/docbook2man-spec.pl.1        |   99 -
 external/privoxy/utils/filter2docs.pl              |   81 -
 external/privoxy/utils/ldp_print/README            |   80 -
 external/privoxy/utils/ldp_print/VERSION           |    1 -
 .../privoxy/utils/ldp_print/fix_print_html.lib     |  227 -
 external/privoxy/utils/ldp_print/ldp_print         |   72 -
 external/privoxy/utils/prepare-configfile.pl       |   50 -
 external/privoxy/vc_config_pthreads.h              |  484 -
 external/privoxy/vc_config_winthreads.h            |  675 --
 external/privoxy/vc_console.dsp                    |  405 -
 external/privoxy/vc_privoxy.dsp                    |  488 -
 external/privoxy/vc_privoxy.dsw                    |   59 -
 external/privoxy/w32.rc                            |  343 -
 external/privoxy/w32log.c                          | 1480 ----
 external/privoxy/w32log.h                          |  181 -
 external/privoxy/w32res.h                          |  194 -
 external/privoxy/w32svrapi.c                       |  952 --
 external/privoxy/w32svrapi.h                       |  146 -
 external/privoxy/w32taskbar.c                      |  313 -
 external/privoxy/w32taskbar.h                      |   82 -
 external/privoxy/win32.c                           |  366 -
 external/privoxy/win32.h                           |   94 -
 306 files changed, 0 insertions(+), 179609 deletions(-)

diff --git a/external/privoxy/AUTHORS b/external/privoxy/AUTHORS
deleted file mode 100644
index 3f8a609..0000000
--- a/external/privoxy/AUTHORS
+++ /dev/null
@@ -1,116 +0,0 @@
-              Authors of Privoxy v2.9.x and 3.x
-===========================================================================
-
-Current Privoxy Team:
-
- Fabian Keil, lead developer
- David Schmidt, developer
-
- Hal Burgiss
- Mark Miller
- Gerry Murphy
- Lee Rian
- Roland Rosenfeld
- Jörg Strohmayer
-
-Former Privoxy Team Members:
-
- Johny Agotnes
- Rodrigo Barbosa
- Moritz Barsnick
- Ian Cummings
- Brian Dessent
- Jon Foster
- Karsten Hopp
- Alexander Lazic
- Daniel Leite
- Gábor Lipták
- Adam Lock
- Guy Laroche
- Justin McMurtry
- Andreas Oesterhelt
- Haroon Rafique
- Georg Sauthoff
- Thomas Steudten
- Rodney Stromlund
- Sviatoslav Sviridov
- Sarantis Paskalis
- Stefan Waldherr
-
-Thanks to the many people who have tested Privoxy, reported bugs, provided
-patches, made suggestions or contributed in some way. These include (in
-alphabetical order):
-
- Ken Arromdee
- Devin Bayer
- Gergely Bor
- Reiner Buehl
- Andrew J. Caines
- Clifford Caoile
- Frédéric Crozat
- Michael T. Davis
- Mattes Dolak
- Matthias Drochner
- Peter E.
- Florian Effenberger
- Markus Elfring
- Dean Gaudet
- Stephen Gildea
- Daniel Griscom
- Felix Gröbert
- Aaron Hamid
- Darel Henman
- Magnus Holmgren
- Eric M. Hopper
- Ralf Horstmann
- Stefan Huehner 
- Peter Hyman
- Derek Jennings
- Petr Kadlec
- David Laight
- Bert van Leeuwen
- Don Libes
- Paul Lieverse
- Toby Lyward
- Wil Mahan
- Jindrich Makovicka
- David Mediavilla
- Raphael Moll
- Amuro Namie
- Adam Piggott
- Dan Price
- Roberto Ragusa
- Félix Rauch
- Maynard Riley
- Chung-chieh Shan
- Spinor S.
- Bart Schelstraete
- Oliver Stoeneberg
- Peter Thoenen
- Martin Thomas
- Bobby G. Vinyard
- Jochen Voss
- Glenn Washburn
- Song Weijia
- Jörg Weinmann
- Darren Wiebe
- Anduin Withers
- Oliver Yeoh
- Jamie Zawinski
-
-Privoxy is based in part on code originally developed by Junkbusters Corp. and
-Anonymous Coders.
-
-Privoxy heavily relies on Philip Hazel's PCRE.
-
-The code to filter compressed content makes use of zlib which is written by
-Jean-loup Gailly and Mark Adler.
-
-On systems that lack snprintf(), Privoxy is using a version written by Mark
-Martinec. On systems that lack strptime(), Privoxy is using the one from the
-GNU C Library written by Ulrich Drepper.
-
-If we've missed you off this list, please let us know!
-
- Privoxy team. http://www.privoxy.org/
- <ijbswa-developers at lists.sourceforge.net>
diff --git a/external/privoxy/ChangeLog b/external/privoxy/ChangeLog
deleted file mode 100644
index 54cc625..0000000
--- a/external/privoxy/ChangeLog
+++ /dev/null
@@ -1,717 +0,0 @@
---------------------------------------------------------------------
-ChangeLog for Privoxy
---------------------------------------------------------------------
-*** Version 3.0.12 (UNRELEASED) ***
-
-- The socket-timeout option now also works on platforms whose
-  select() implementation modifies the timeout structure.
-  Previously the timeout was triggered even if the connection
-  didn't stall. Reported by cyberpatrol.
-- The Connection: keep-alive code properly deals with files
-  larger than 2GB. Previously the connection was closed too
-  early.
-- The content length for files above 2GB is logged correctly.
-- The user-manual directive on the show-status page links to
-  the documentation location specified with the directive,
-  not to the Privoxy website.
-- When running in daemon mode, Privoxy doesn't log anything
-  to the console unless there are errors before the logfile
-  has been opened.
-- The show-status page prints warnings about invalid directives
-  on the same line as the directives themselves.
-- Fixed several justified (but harmless) compiler warnings,
-  mostly on 64 bit platforms.
-- The mingw32 version explicitly requests the default charset
-  to prevent display problems with some fonts available on more
-  recent Windows versions. Patch by Burberry.
-- The mingw32 version uses the Privoxy icon in the alt-tab
-  windows. Patch by Burberry.
-- The timestamp and the thread id is omitted in the "Fatal error"
-  message box on mingw32.
-- Fixed two related mingw32-only buffer overflows. Triggering
-  them required control over the configuration file, therefore
-  this isn't seen as a security issue.
-- In verbose mode, or if the new option --show-skipped-tests
-  is used, Privoxy-Regression-Test logs skipped tests and the
-  skip reason.
-
-*** Version 3.0.11 ***
-	
-- On most platforms, outgoing connections can be kept alive and
-  reused if the server supports it. Whether or not this improves
-  things depends on the connection.
-- When dropping privileges, membership in supplementary groups
-  is given up as well. Not doing that can lead to Privoxy running
-  with more rights than necessary and violates the principle of
-  least privilege. Users of the --user option are advised to update.
-  Thanks to Matthias Drochner for reporting the problem,
-  providing the initial patch and testing the final version.
-- Passing invalid users or groups with the --user option
-  didn't lead to program exit. Regression introduced in 3.0.7.
-- The match all section has been moved from default.action
-  to a new file called match-all.action. As a result the
-  default.action no longer needs to be touched by the user
-  and can be safely overwritten by updates.
-- The standard.action file has been removed. Its content
-  is now part of the default.action file.
-- In some situations the logged content length was slightly too low.
-- Crunched requests are logged with their own log level.
-  If you used "debug 1" in the past, you'll probably want
-  to additionally enable "debug 1024", otherwise only passed
-  requests will be logged. If you only care about crunched
-  requests, simply replace "debug 1" with "debug 1024".
-- The crunch reason has been moved to the beginning of the
-  crunch message. For HTTP URLs, the protocol is logged as well.
-- Log messages are shortened by printing the thread id on its
-  own (as opposed to putting it inside the string "Privoxy()").
-- The config option socket-timeout has been added to control
-  the time Privoxy waits for data to arrive on a socket.
-- Support for remote toggling is controlled by the configure
-  option --disable-toggle only. In previous versions it also
-  depended on the action editor and thus configuring with the
-  --disable-editor option would disable remote toggling support
-  as well.
-- Requests with invalid HTTP versions are rejected.
-- The template symbol @date@ can be used to include a date(1)-like
-  time string. Initial patch submitted by Endre Szabo.
-- Responses from shoutcast servers are accepted again.
-  Problem reported and fix suggested by Stefan.
-- The hide-forwarded-for-headers action has been replaced with
-  the change-x-forwarded-for{} action which can also be used to
-  add X-Forwarded-For headers. The latter functionality already
-  existed in Privoxy versions prior to 3.0.7 but has been removed
-  as it was often used unintentionally (by not using the
-  hide-forwarded-for-headers action).
-- A "clear log" view option was added to the mingw32 version
-  to clear out all of the lines in the Privoxy log window.
-  Based on a patch submitted by T Ford.
-- The mingw32 version uses "critical sections" now, which prevents
-  log message corruption under load. As a side effect, the
-  "no thread-safe PRNG" warning could be removed as well.
-- The mingw32 version's task bar icon is crossed out and
-  the color changed to gray if Privoxy is toggled off.
-
-*** Version 3.0.10 ***
-
-- Ordinary configuration file changes no longer cause program
-  termination on OS/2 if the name of the logfile hasn't been
-  changed as well. This regression probably crept in with the
-  logging improvements in 3.0.7. Reported by Maynard.
-- The img-reorder filter is less likely to mess up JavaScript code in
-  img tags. Problem and solution reported by Glenn Washburn in #2014552.
-- The source tar ball now includes Privoxy-Log-Parser,
-  a syntax-highlighter for Privoxy logs. For fancy screenshots see:
-  http://www.fabiankeil.de/sourcecode/privoxy-log-parser/
-  Documentation is available through perldoc(1).
-
-*** Version 3.0.9 Beta ***
-
-- Added SOCKS5 support (with address resolution done by
-  the SOCKS5 server). Patch provided by Eric M. Hopper.
-- The "blocked" CGI pages include a block reason that was
-  provided as argument to the last-applying block action.
-- If enable-edit-actions is disabled (the default since 3.0.7 beta)
-  the show-status page hides the edit buttons and explains why.
-  Previously the user would get the "this feature has been disabled"
-  message after using the edit button.
-- Forbidden CONNECT requests are treated like blocks by default.
-  The now-pointless treat-forbidden-connects-like-blocks action
-  has been removed.
-- Not enabling limit-connect now allows CONNECT requests to all ports.
-  In previous versions it would only allow CONNECT requests to port 443.
-  Use +limit-connect{443} if you think you need the old default behaviour.
-- The CGI editor gets turned off after three edit requests with invalid
-  file modification timestamps. This makes life harder for attackers
-  who can leverage browser bugs to send fake Referers and intend to
-  brute-force edit URLs.
-- Action settings for multiple patterns in the same section are
-  shared in memory. As a result these sections take up less space
-  (and are loaded slightly faster). Problem reported by Franz Schwartau.
-- Linear white space in HTTP headers will be normalized to single
-  spaces before parsing the header's content, headers split across
-  multiple lines get merged first. This should prevent problems like:
-   * letting the session-cookies-only action slip
-     some Cookies through unmodified,
-   * only suppressing the first line of a header,
-     thus creating an invalid one, and
-   * to incorrectly block headers with valid timestamps
-     that weren't properly recognized.
-  Headers that could trigger these problems are unlikely to appear
-  in "normal" web traffic, but could be intentionally generated to
-  fool some of Privoxy's header parsers.
-- Host information is gathered outside the main thread so it's less
-  likely to delay other incoming connections if the host is misconfigured.
-- New config option "hostname" to use a hostname other than
-  the one returned by the operating system. Useful to speed-up responses
-  for CGI requests on misconfigured systems. Requested by Max Khon.
-- The CGI editor supports the "disable all filters of this type"
-  directives "-client-header-filter", "-server-header-filter",
-  "-client-header-tagger" and "-server-header-tagger".
-- Fixed false-positives with the link-by-url filter and URLs that
-  contain the pattern "/jump/".
-- The less-download-windows filter no longer messes
-  "Content-Type: application/x-shockwave-flash" headers up.
-- In the show-url-info page's "Final results" section active and
-  inactive actions are listed separately. Patch provided by Lee.
-- The GNUmakefile supports the DESTDIR variable. Patch for
-  the install target submitted by Radoslaw Zielinski.
-- Embedding the content of configuration files in the show-status
-  page is significantly faster now. For a largish action file (1 MB)
-  a speedup of about 2450 times has been measured. This is mostly
-  interesting if you are using large action files or regularly use
-  Privoxy-Regression-Test while running Privoxy through Valgrind,
-  for stock configuration files it doesn't really matter.
-- If zlib support is unavailable and there are content
-  filters active but the prevent-compression action is disabled,
-  the show-url-info page includes a warning that compression
-  might prevent filtering.
-- The show-url-info page provides an OpenSearch Description that
-  allows to access the page through browser search plugins.
-- Custom client-header filters that rewrite the request line
-  incorrectly no longer cause Privoxy to crash. Reported by din_a4.
-- The obsolete kill-popups action has been removed as the
-  PCRS-based popup filters can do the same and are slightly
-  less unreliable.
-- The inspect-jpegs action has been removed.
-- The send-wafer and send-vanilla-wafer actions have been removed.
-  They weren't particular useful and their behaviour could be emulated
-  with add-header anyway.
-- Privoxy-Regression-Test has been significantly improved.
-- Most sections in the default.action file contain tests for
-  Privoxy-Regression-Test to verify that they are working as intended.
-- Parts of Privoxy have been refactored to increase maintainability.
-- Building with zlib (if available) is done by default.
-
-*** Version 3.0.8 ***
-
-- Fixed a small memory leak when listen-address only specifies the port.
-- The source tar balls now include Privoxy-Regression-Test which
-  (upon other things) can be used to automatically detect some
-  packaging problems. Packagers are welcome to give it a try.
-- Reverted a change in 3.0.7 that caused path patterns to be checked
-  even if the host pattern match already failed. While this doesn't
-  noticeable affect the performance, it makes it less likely to run
-  out of stack space with overly-complex path patterns the user might
-  have added.
-- Updated the msn, yahoo and google filters to work as advertised again.
-- The warning message shown by the show-status CGI page is easier to
-  understand. Previously it wasn't clear that the error message
-  is shown below the invalid directive. (Reported by Lee)
-- When regenerating Content-Disposition headers the more common
-  spelling is used for the name. Previously it was written without caps.
-- Less confusing log message if the content type isn't overwritten
-  because force-text-type wasn't used but the old type doesn't look
-  like content that would be filtered normally.
-- Better log messages if the user tries to execute filters that
-  don't exist.
-- Treat the non-standard Request-Range headers like standard range
-  headers and suppress them if content filtering is enabled.
-- Prevent the log messages for CONNECT requests to unacceptable
-  ports from printing the limit-connect argument as [null] if
-  limit-connect hasn't been explicitly enabled.
-- Don't disable the mingw32 log window if the logfile directive
-  isn't used. While it was an intentional change in 3.0.7 at least
-  one user perceived it as a regression and the same effect can
-  be achieved by disabling all debug directives.
-- Fixed two minor problems related to the win32 build process: a css
-  file was not being in the installer and the trustfile comment in the
-  config.txt referenced a nonexisting file
-- Minor documentation fixes.
-
-*** Version 3.0.7 Beta ***
-
-- Added zlib support to filter content with gzip and deflate
-  encoding. (Patch provided by Wil Mahan)
-- Dedicated filters and actions are used for header filtering.
-  "filter-client-headers" and "filter-client-headers" are no longer
-  supported, use server-header-filter{} and client-header-filter{}
-  instead.
-- Tags can be used to change actions based on HTTP headers.
-- New server-header filter: less-download-windows.
-- New client-header taggers: css-requests, image-requests,
-  client-ip-address, http-method, allow-post, complete-url,
-  user-agent and privoxy-control.
-- New server-header taggers: content-type and privoxy-control.
-- The forward-override{} action allows to change the forwarding
-  settings through the action files, for example based on client
-  headers like the User-Agent, or the request origin.
-- Socks errors are no longer handled by the CGI page for
-  DNS resolution failures.
-- CGI pages use favicons to signal whether they are error
-  or control pages. This is useful if you rely heavily on
-  browser tabs.
-- The show-url-info CGI page shows the forwarding settings.
-- "Crunch!" log messages (used when Privoxy answers requests
-  by itself) now also contain the reason.
-- Allow to rewrite the request destination behind the client's back.
-- Fix socks requests on big-endian platforms. Patch provided by Song Weijia.
-- Fixes possible deadlocks and crashes on OpenBSD.
-  Patch provided by Ralf Horstmann.
-- The CGI action editor allows to edit actionfiles with previously
-  forbidden characters like dots.
-- New trust entries are saved with a comment that contains the
-  trusted referring URL (Suggested by Daniel Griscom).
-- Filter descriptions are HTML encoded automatically. 	
-- New config option "split-large-forms" to work
-  around a browser bug that caused IE6 and IE7 to ignore
-  the Submit button on the edit-actions-for-url CGI page.
-- New config option "allow-cgi-request-crunching" to allow
-  requests for Privoxy's CGI pages to be blocked, redirected
-  or (un)trusted like ordinary requests.
-- Empty filter files no longer interrupt the filtering process
-  prematurely and are correctly listed on the show-status CGI page.
-- New config option "accept-intercepted-requests" to combine
-  Privoxy with any packet filter to build an intercepting proxy
-  for HTTP/1.1 requests (and for HTTP/1.0 requests with Host header set).
-- fast-redirects{} catch redirects to https URLs as well.
-- redirect{s at foo@bar@} can be used to redirect to a rewritten
-  version of the original URL.
-- Trap unsupported gopher proxy requests.
-- Fixed a bug in the User Manual delivery on Windows
-  (mingw32 only). Images now show up correctly and HTML
-  pages are no longer padded with garbage data.
-- Fixed several minor memory leaks, most of them discovered with Valgrind.
-- Only unlink the pidfile if it's actually used.
-- Retries after connection problems with forced requests
-  aren't blocked again.
-- On Unix SIGABRT causes a core dump as expected and is no
-  longer treated as normal shutdown signal.
-- The "access denied" CGI page is more descriptive and
-  allows retries to circumvent the referrer check.
-- Updated PCRS to handle unexpected PCRE errors properly.
-  Fixed crashes that could occur if Privoxy was build
-  with external PCRE versions newer than Privoxy's internal
-  one. (Reported by Chung-chieh Shan)
-- Fixed crashes with null bytes in PCRS replacement strings
-  (Patch provided by Felix Gröbert).
-- Fixed crashes with header time randomization on mingw32.
-- The CGI style sheet is no longer delivered if the referring
-  page isn't a Privoxy CGI page. This prevents a JavaScript-based
-  Privoxy detection "attack". Note that detecting Privoxy is
-  still possible through other ways and Privoxy was never intended
-  to be invisible anyway.
-- Added support for AmigaOS 4, fixed build for AmigaOS 3.x.	
-- The show-url-info CGI page displays a warning if Privoxy
-  is currently toggled off.
-- The show-status CGI page suppresses the edit button
-  for action files if Privoxy has no write access.	
-- Most CGI error pages react properly to HEAD requests.
-- Requests with RFC 3253 HTTP methods (used by Subversion)
-  are accepted. (Patch provided by Petr Kadlec)
-- New config option "templdir" to change the location
-  of the CGI templates to make sure customized templates
-  aren't "updated".
-- Better handling of "HTTP/1.1 100 Continue" responses.
-- The background of the PNG pattern is transparent.
-- Fixed XML syntax errors caused by banners-by-size and banners-by-url.
-- Fixed crashes and possible action file corruptions
-  when lines containing hashes are written through the CGI editor.
-- Supports dynamic filters which can contain variables.
-- Supports tags to change the actions based on client or server headers.
-- Incorrect actions are logged before program termination.
-- The "actionsfile" syntax in the configuration file is consistent
-  with the rest of the configuration options and requires the
-  whole file name. This is an incompatible change, if you use
-  an old configuration file you might have to append ".action"
-  to your "actionsfile" directives.
-- With the configuration file option "enforce-blocks" the
-  "go there anyway" mechanism can be disabled without recompiling
-  Privoxy.
-- More precise error messages in case of incorrect acl syntax.
-- Logs a warning if filtering is enabled but impossible due
-  to lack of zlib support or use of the prevent-compression action.
-- Less noisy handling of Cookie:" and "Connection:" headers.
-- Improved error messages in case of connection problems.
-- Fix a command-line-parsing bug that was introduced before 3.0.5
-  beta and caused Privoxy to treat the last argument as configuration
-  file if no configuration file was specified.
-- Treat unknown command line options as fatal errors instead
-  of silently ignoring them.
-- Use string functions with length checks more often.
-- Don't log CONNECT requests twice.
-- Allow to log the source address for ACL-related connection drops.
-- Don't ignore applying filters if the server didn't
-  specify a Content-Type. Bug reported by Amuro Namie.
-- Rejected CONNECT requests are logged with log level info
-  (enabled by default) and the reason for the block.
-- New command line option "--pre-chroot-nslookup hostname" to
-  intialize the resolver library before chroot'ing. On some systems this
-  reduces the number of files that must be copied into the chroot tree.
-  (Patch provided by Stephen Gildea)
-- Fix a long-standing memory corruption bug that could cause
-  Privoxy to overwrite a single byte in memory it didn't explicitly
-  allocate (but that probably was allocated anyway due to bucket size).
-- Send template-based CGI pages as HTTP/1.1 unless the client
-  asked for HTTP/1.0.
-- Let the first line in connection established responses
-  end in \r\n as required by RFC1945. Reported by Bert van Leeuwen.
-- If no log file has been specified, disable logging instead of logging
-  to stderr.
-- Don't block stderr when in daemon mode.
-- Ignore missing zero-chunks when filtering chunk-encoded content.
-  Earlier Privoxy versions would buffer and then forward the content
-  unmodified which caused some browsers to simply show empty pages.
-- Fix double free in cgi_edit_actions_list(). Reported by Venustech AD-LAB.
-- The code to add X-Forwarded-For headers when the hide-forwarded-for-headers
-  action isn't being used has been removed.
-- Fixed trustfile feature which previously didn't work without FEATURE_TOGGLE.
-  Reported by Lee.
-- Minor code clean-ups, filter and action file updates.
-  (Some of them reported by Davide Alberani, Markus Elfring,
-   Stefan Huehner and Adam Piggott)
-
-*** Version 3.0.6 ***
-
-- New content filters: no-ping, google, msn, yahoo and blogspot.
-- New header filters:  x-httpd-php-to-html, html-to-xml, xml-to-html
-                       and hide-tor-exit-notation.
-- The special header "X-Filter: No" now disables header filtering as well.
-- Improved the filters img-reorder, js-annoyances, webbugs,
-  banners-by-size, banners-by-link and ie-exploits to make them
-  less likely to break anything.
-- Removed outdated URL patterns in default.action and added new ones. 
-- Added redirection from http://p.p/user-manual to http://p.p/user-manual/
-- Changed webinterface default values for hide-user-agent, hide-referrer
-  and set-image-blocker.
-	
-*** Version 3.0.5 Beta ***
-
-- Windows version can be installed/started as a service.
-- Windows icon stays blue when Privoxy is idle, green when busy.
-- Integrated Fabian Keil's extensive patch.  See:
-  http://www.fabiankeil.de/sourcecode/privoxy/. Includes the 
-  following new or significantly improved actions (among many 
-  other improvements):
-
-     content-type-overwrite{}
-     crunch-client-header{string}
-     crunch-if-none-match
-     crunch-server-header{string}
-     fast-redirects{check-decoded-url}
-     filter-client-headers
-     filter-server-headers
-     force-text-mode
-     handle-as-empty-document
-     hide-accept-language{}
-     hide-content-disposition{}
-     hide-if-modified-since
-     hide-referrer{conditional-block}
-     overwrite-last-modified{}
-     redirect{URL}
-     treat-forbidden-connects-like-blocks
-
-- Standard-compliant clients are prevented from displaying cached
-  copies of Privoxy's error messages after the cause of the problem
-  has gone.
-- Improved DNS error handling.
-- Multiple filter files can now be specified in config.
-- Added jpeg filtering to defend against MS jpeg vulnerability MS04-028
-  with the new inspect-jpegs action.
-- Removed the "arbitrary" 1000 filter limit - addresses tracker #911950
-- Thanks to Jindrich Makovicka for a race condition fix for the log 
-  file.  The race condition remains for non-pthread implementations.
-  Reference patch #1175720. Various other logging enhancements.
-- A pile of assorted bug fixes, memory leaks, enhancements, etc.
-- Moved Actions file reporting mechanism to SF tracker.
-- Two new options for config: enable-remote-http-toggle and 
-  forwarded-connect-retries.
-- Trap unsupported FTP requests.
-- Let text/xml be filtered.
-- Numerous updates to default.action
-- Increase the compiled in limit of trusted referrers from 64 to 512 
-  (for trustfile users).
-
-*** Version 3.0.3 ***
-
-- Fixed yet another two memory leaks. Process growth seems stopped now.
-- Further tightened security against malicious toggle-off links.
-- Excluded text/plain MIME types from filtering. This fixes a
-  couple of client-crashing, download corruption and
-  Privoxy performance issues, whose root cause lies in
-  web servers labelling content of unknown type as text/plain.
-- Assorted fixes for POSIX compliance, signal handling, graceful
-  termination, compiler warnings, OSX support, Win32 systray,
-  error logging, hostname wildcards, correct detection of NetBSD.
-- Workarounds for client (iTunes etc) and server (PHP < 4.2.3) bugs
-  including the notorious "blank page" problem.
-- Various filter improvements; most notably the unsolicited-popups
-  filter became less destructive     
-- Major revamp of the actions file
-	
-*** Version 3.0.2 ***
-
-- Fixed two memory leaks, one serious
-- Fixed bug in pcrs which could cause crashes with user-defined filters
-- Fixed bug in domain name matching
-- Assorted small fixes (Win32 menu, CGI URL editor, ..) 
-- Added basic support for the OPTIONS and TRACE http methods
-- Added workaround for Bug in Mac OSX that made Privoxy crash occasionally
-- Refined the default action file through >400 items of user feedback
-- Filter changes:
-  - Assorted refinements, optimizations and fixes in the js-annoyances,
-    img-reorder, banners-by-size, banners-by-link, webbugs, refresh-tags,
-    html-annoyances, content-cookies and fun filters
-  - Replaced filter "popups" by choice between two modes:
-    - "unsolicited-popups" tries to catch only the unsolicited ones
-    - "all-popups" tries to kill them all (as before)
-  - New filter "tiny-textforms" Help those tiny or hard-wrap textareas. 
-  - New filter "jumping-windows" that prevents windows from resizing
-    and moving themselves
-  - New filter "demoronizer" which fixes MS's abuse of std charsets
-    (common cases anyway).
-  - Replaced "nimda" with more general "ie-exploits" filter in which
-    all filters for exploits shall be collected
-- Improved cookie logging
-- Rewrote make install target. Added uninstall and install-strip
-  targets.
-- Fixed a potential (application-level, NOT OS-level!) security
-  problem involving remote toggling and action file manipulation
-  by mailicious websites.
-- Added ability to chroot (thanks to Sviatoslav Sviridov)
-- Added more action aliases for prehistoric action names
-- Add Slackware support to Makefile.
-
-*** Version 3.0  ***
-
-- Fixed Windows startmenu items, log window and tray icon menus.
-- Added warning for bogus install target
-- Added quicktime-kioskmode filter and improved frameset-borders
-- Updated default.action based on latest feedback
-- New PDF doc build process
-- Add a user contrib module to cvs: 
-  http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ijbswa/contrib/
-
-*** Version 2.9.18  ***
-
-- Added workaround for IE bug that broke CGI interface
-- Bugfix: String actions now reliably editable through CGI interface
-- Three filters fixed (again!)
-- Assorted small fixes and doc enhancements
-
-*** Version 2.9.16  *** 
-
-- Major revamp of default.action to get rid of years of cruft.
-- Same for default.filter
-- Re-design and major improvements to the CGI editor interface.
-- Address spurious 'out of memory' error due to incorrect file permissions.
-- Impose buffer limits while reading client and server headers.
-- Better memory and CPU optimization.
-- Add Conectiva Linux package.
-- user-manual directive added to config for help links from within CGI
-  editor.
-- Multiple actions files can now be specified in config.
-- Actions files are changed to: default.action, standard.action, and 
-  user.action. user.action is for personal/local configuration.
-- The usual many small and miscellaneous bug and security fixes.
-
-*** Version 2.9.14 Beta *** 
-
-- Fix Solaris compile problem (gateway.h and filters.h)
-- Makefile fixes for Solaris, FreeBSD (?)
-- Fix build failure where certain features were disabled.
-- 'blocked-compact' template is removed. Various CGI improvements,
-  including an adaptive 'blocked' template.
-- Various tweaks for actions file to get ready for stable 3.0
-- Included a 'Bookmarklet' and PHP scripts for reporting actions file
-  problems via web interface at privoxy.org. Accessed via internal CGIs.
-- Include cgi-style.css for templates.
-- #include mechansim for common text in templates
-- Various other minor fixes.
-
-*** Version 2.9.13 Beta *** 
-
-- *NEWS*: The project has been renamed to Privoxy! The new name is 
-  reflected throughout (file locations, etc).
-- ijb.action is now default.action. re_filterfile is now 
-  default.filter.
-- http://i.j.b/ is now http://p.p/
-- The 'logo' option for replacing ad iamges is removed now. 'Pattern' 
-  (checkerboard) is now the default.
-- RPM spec file make over.
-
-
-*** Version 2.9.12 Beta *** 
-
-- **READ**: The default listening PORT is NOW 8118!!! Changed from 
-  8000 due to conflict with NAS (Network Audio Server, whatever that 
-  is.)
-- More CGI actions editor fixes and improvements.
-- Win32 command line fix ups.
-- re_filterfile now has modular sections that can be activated on a 
-  per site basis. Some new goodies there too.
-- +filter now takes arguments to match FILTER sections in re_filterfile
-  for even more flexibility. 
-- Added a new image blocker option: +image-blocker{pattern}, which 
-  displays a checkerboard patthern and scales better than the logo.
-- PNG images will be used in place of GIF for JB built-in images
-  if configured with --enable-no-gif.
-- Clean up compiler warnings (mostly).
-- Improved handling of failed DNS lookups & diagnostics for failed bind
-  to listen socket
-- Made --no-daemon mode log to tty instead of logfile.
-- Various spec file and init script cleanups and improvements (Redhat and
-  SuSE).
-- CGI Editor works on OS/2 now.
-- Fix restart failure where sockets were in TIME_WAIT.
-- Fixes for actions cgi editor, make sure we have right file.
-- A --pidfile command line option now, in addition to --help, 
-  --version, --no-daemon, --user and configfile. --no-daemon replaces
-  the former -d option and _DEBUG define. --user will drop privileges 
-  to the specified user.
-- Signal handling cleanups (*nix).
-- CGI actions editor improvements and fixes.
-- Error handling improvements, especially out of memory.
-- Default re_filterfile fix that caused spurious IJB logos 
-  (instead of 'blank').
-- configure.in threading fixes for Solaris.
-- Various other minor fixes.
-
-
-*** Version 2.9.11 Beta Changes ***
-
-- Add "session" cookie concept where cookies exist for the life 
-of that browser session only (ie never goes to disk). 
-- Checks for correct header length.
-- Fix user:pass at host.domain.com auth bug.
-- Better signal handling on *nix.
-- Fix CFLAGS hard-coded in configure.in
-- Fix threading bug re: gethostbyname() that caused random 
-URLs to fail in some cases.
-
-
-*** Version 2.9.11 Alpha Changes ***
-
-- A web-based editor for the actions file is included (go to http://i.j.b/).
-- Web-based toggle IJB on/off support.
-- Cookie handling has changed - the new +no-cookies-keep feature is now the
-default.
-- actionsfile is renamed to ijb.action.
-- junkbstr.txt is now config.txt on Win32.
-- Support for running IJB as a UNIX daemon process has improved.
-- Unix daemon now returns error code on failed start.
-- Timestamps in logfile and jarfile now.
-- Fix for the Netscape bug reintroduced in 2.9.9.
-- make should now abort if gmake (GNU make) not present.
-- Many other minor bugfixes
-- Start a ChangeLog :)
-
-
-
-*** Version 2.9.3 pre-Alpha Changes ***
-
-- Amiga support (completely untested by me - I don't have an Amiga)
-- "tinygif 3" support (redirects blocked images to a specified URL, so
-the browser doesn't have to load and cache many copies of the same
-image).
-- one case where there were both local and global "referrer" variables
-(yuck!) clarified by renaming the local one to "refer".
-- Fixed some places where close() was used instead of close_socket().
-Thanks to Jörg Strohmayer (joergs at users.sourceforge.net) for these.
-- Temporary hack to get FORCE_LOAD to work with IE.  I just lowercased the
-FORCE_LOAD_PREFIX.  Needs fixing properly.
-- Most URLs hardcoded into Junkbuster were changed to go through a script
-e.g. http://ijbswa.sourceforge.net/redirect.php?v=2.9.3&to=faq
-The only other URLs left are the GNU GPL:
-  http://www.fsf.org/copyleft/gpl.html
-and the home page:
-  http://ijbswa.sourceforge.net/
-... and various URLs which will be intercepted by Junkbuster anyway.
-TODO: Still need to do something with the URLs in Junkbuster Corp's 
-copyright/trademark notice on the bottom of the show-proxy-args page.
-- PCRE or GNU Regex is now a #define option.
-
-
-*** Version 2.9.2 pre-Alpha Changes ***
-
-- Andreas applied the latest version of the FORCE patch.
-
-
-*** Version 2.9.1 pre-Alpha Changes ***
-
-- in parsers.c, fixed two #ifdef FORCE to #ifdef FORCE_LOAD
-(BTW: I think FORCE is precise enough, since loading remote
-data is the whole purpose of a proxy..)
-- Set the FORCE_PREFIX (back) to 'IJB-FORCE-LOAD-'. While 'noijb.'
-is more elegant and looks like a hostname in the URL, it doesn't
-make clear to the inexperienced user that the proxy is bypassed. It
-also has a higher name collision risk.
-- Filled in the function header templates for my functions in
-parsers.c (again). They obviously got lost in our current
-patch war ;-)
-- Cut the credit for the §-referrer-option from the config file,
-that Stefan had placed there.
-- Improved the re_filterfile 
-
-
-*** Version 2.9.0 pre-Alpha Changes ***
-
--  Now use PCRE, not GNU REGEX.  I have not yet had chance to check the
-syntax of the block/image/cookie file to ensure that they match what
-is expected - however they seem to work.
--  Replaced "configure" script with one generated by "autoconf".  Also 
-use a header "config.h" (was ijbconfig.h in my previous release) for 
-the #defines.  "config.h" is now generated with "autoheader" from 
-"acconfig.h" and "configure.in".  (Note that to install you do not
-need autoconf or autoheader - just run "./configure".)
-To see command-line options, run "./configure --help".
-This is my first ever autoconf script, so it has some rough edges
-(how PCRE is handled is the roughest).
--  Error logging code replaced with new module errlog.c, based on the
-one from JunkbusterMT (but with the threading code removed).
--  Most of Rodney's 0.21 and 0.21A patches applied. (Marked *).  I did not
-apply all of these, since I had already independently done conditional
-popup file, conditional image file, and integration of popup code.
-- ACL, Jar and trust files conditionally compiled.
-- New source file headers.
-- Various cosmetic changes.  (But I have not consistently ordered the 
-config files - I think that's worthwhile, but it's 1am and I want to
-get this released!)
-- RCS tags on .h files.
--  RCS tags are const char[] rather than const char *.  (Saves 4 bytes
-per tag ;-)
-- VC++ project files renamed to vc_junkbuster.*.
-- show-proxy-args now shows status of all conditionals, not just REGEX
-- Various functions moved around.  Most notably all the system-specific
-sockets code which was spread between jcc.c, bind.c, and connect.c,
-has been moved to "jbsockets.c".  The non-system-specific code from
-connect.c and socks4.c has been movet to "gateway.c".  Also, the
-config file loader and the global variables it writes to have been
-moved to "loadcfg.c".  (Maybe this should go into loaders.c?)
-And candidate for the "worst filename ever" award is "miscutil.c",
-which contains, well, miscellaneous utility functions like zalloc.
-(Suggestions for a better name for this file are welcome!)
-- Loaders now use a common function to read a line and skip comments,
-and this function also stores the proxy_args.
-- Added ./junkbuster --help     (Not for Win32 GUI)
-- Added ./junkbuster --version  (Not for Win32 GUI)
-- Win32 resources are now all marked as "U.S. English", rather than
-being a mix of "U.S. English", "U.K. English" and "Irish English".
-- Version number changes to 2.9.0
-
-
-
-----------------------------------------------------------------------
-Copyright   :  Written by and Copyright (C) 2001-2008 the SourceForge
-               Privoxy team. http://www.privoxy.org/
-
-               Based on the Internet Junkbuster originally written
-               by and Copyright (C) 1997 Anonymous Coders and 
-               Junkbusters Corporation.  http://www.junkbusters.com/
-
-               This program is free software; you can redistribute it 
-               and/or modify it under the terms of the GNU General
-               Public License as published by the Free Software
-               Foundation; either version 2 of the License, or (at
-               your option) any later version.
-
-               This program is distributed in the hope that it will
-               be useful, but WITHOUT ANY WARRANTY; without even the
-               implied warranty of MERCHANTABILITY or FITNESS FOR A
-               PARTICULAR PURPOSE.  See the GNU General Public
-               License for more details.
-
-               The GNU General Public License should be included with
-               this file.  If not, you can view it at
-               http://www.gnu.org/copyleft/gpl.html
-               or write to the Free Software Foundation, Inc., 59
-               Temple Place - Suite 330, Boston, MA  02111-1307, USA.
diff --git a/external/privoxy/GNUmakefile.in b/external/privoxy/GNUmakefile.in
deleted file mode 100644
index 481633c..0000000
--- a/external/privoxy/GNUmakefile.in
+++ /dev/null
@@ -1,2156 +0,0 @@
-# Note:  Makefile is built automatically from Makefile.in
-#
-# $Id: GNUmakefile.in,v 1.180 2009/02/28 08:28:14 fabiankeil Exp $
-#
-# Written by and Copyright (C) 2001 - 2008 the SourceForge
-# Privoxy team. http://www.privoxy.org/
-#
-# Based on the Internet Junkbuster originally written
-# by and Copyright (C) 1997 Anonymous Coders and 
-# Junkbusters Corporation.  http://www.junkbusters.com
-#
-# This program is free software; you can redistribute it 
-# and/or modify it under the terms of the GNU General
-# Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at
-# your option) any later version.
-#
-# This program is distributed in the hope that it will
-# be useful, but WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.  See the GNU General Public
-# License for more details.
-#
-# The GNU General Public License should be included with
-# this file.  If not, you can view it at
-# http://www.gnu.org/copyleft/gpl.html
-# or write to the Free Software Foundation, Inc., 59
-# Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-#
-
-#############################################################################
-# Set make command correctly
-#############################################################################
- at SET_MAKE@
-
-#############################################################################
-# Version number (for RPM)
-#############################################################################
-
-VERSION_MAJOR = @VERSION_MAJOR@
-VERSION_MINOR = @VERSION_MINOR@
-VERSION_POINT = @VERSION_POINT@
-CODE_STATUS   = @CODE_STATUS@
-VERSION       = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_POINT)
-RPM_VERSION   = $(VERSION)
-RPM_PACKAGEV  = ""
-SNAPVERSION   = $(RPM_VERSION)-$(shell date "+%Y%m%d")
-
-
-#############################################################################
-# "make install" directories and variables
-#############################################################################
-
-#User Group paras
-USER         = @USER@
-GROUP	   = @GROUP@
-
-datarootdir  = @datarootdir@
-prefix       = @prefix@
-exec_prefix  = @exec_prefix@
-CONF_BASE    = @sysconfdir@
-SBIN_DEST    = @sbindir@
-MAN_DIR      = @mandir@
-MAN_DEST     = $(MAN_DIR)/man1
-SHARE_DEST   = @datadir@
-DOC_DEST     = $(SHARE_DEST)/doc/privoxy
-VAR_DEST     = @localstatedir@
-LOGS_DEST    = $(VAR_DEST)/log/privoxy
-PIDS_DEST    = $(VAR_DEST)/run
-
-# if $prefix = /usr/local then the default CONFDEST change from 
-# CONF_DEST = $(CONF_BASE) to CONF_DEST = $(CONF_BASE)/privoxy  
-# by the target rule CONF_DEST
-#
-# also if the $prefix is /usr/local and there is no
-# $(SHARE_DEST)/doc, it checks for $prefix/doc and installs there
-# instead in this situation
-#
-# finally if $prefix=/usr/local and VAR_DEST=$prefix/var it 
-# changes this to /var for storing the logs and pidfile
-
-# used in source dir only, the install goes to $share_dest/doc/privoxy
-DOK_WEB = doc/webserver/
-
-# Install usage should be compatible with install-sh.
-INSTALL    = @INSTALL@
-# Binaries
-BIN_MODE	 = 0755
-# Support files, docs, etc.
-RA_MODE   = 0664
-# Directory
-DIR_MODE   = 0755
-# Files daemon writes to.
-RWD_MODE   = 0660
-INSTALL_P  = -m $(BIN_MODE)  
-INSTALL_T  = -m $(RA_MODE)
-INSTALL_D  = -m $(DIR_MODE) -d
-INSTALL_R  = -m $(RWD_MODE)
-
-# install options for superuser install
-#INSTALL_S  = -g @GROUP@ -o @USER@ 
-
-#############################################################################
-# Build tools
-#############################################################################
-
-PROGRAM    = privoxy at EXEEXT@
-CC         = @CC@
-ECHO       = echo
-GZIP_PROG  = gzip
-
-# id -u is not universal. FIXME: need to set from configure. Breaks on
-# Solaris.
-#ID         = id -u
-ID         = id
-LD         = @CC@
-RM         = rm -f
-CP         = cp -f
-RMDIR      = rmdir
-MKDIR      = ./mkinstalldirs
-STRIP_PROG = strip
-SED        = sed
-GREP       = grep
-CAT        = cat
-RPM        = rpm
-RPMBUILD   = rpmbuild
-MV         = mv
-TAR        = tar
-LN         = ln
-TOUCH      = touch
-KILL       = kill
-CHMOD      = chmod
-CHOWN      = chown
-CHGRP      = chgrp
-GROUPS     = groups
-WDUMP      = @WDUMP@ -dump
-JADECAT    = @JADECAT@
-JADEBIN    = @JADEBIN@
-DB         = $(JADEBIN) $(JADECAT) -ihtml -t sgml  -D.. -d ldp.dsl\#html
-DB2HTML    = @DB2HTML@
-MAN2HTML   = @MAN2HTML@
-G2H_CMD    = groff -mandoc -Thtml
-TARGET_OS  = @host@
-PERL       = perl
-DOC_DIR    = doc/source
-DOC_TMP    = $(DOC_DIR)/tmp
-DOC_STATUS = @DOC_STATUS@
-
-# Program to do LF->CRLF
-#
-# The sed version should be the most portable, but it doesn't for for me,
-# the other two do.  FIXME.
-#   - Jon
-#DOSFILTER  = $(SED) -e $$'s,$$,\r,'
-#DOSFILTER  = gawk -v ORS='\r\n' '{print $0;}'
-DOSFILTER  = $(PERL) -p -e 's/\n/\r\n/'
-CVSROOT    = :pserver:anonymous at ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa
-#TMPDIR     := $(shell mktemp -d /tmp/$(PROGRAM).XXXXXX)
-
-#############################################################################
-# Setup for make distribution rh and suse for now 
-#############################################################################
-
-TAR_ARCH = /tmp/privoxy-$(RPM_VERSION).tar.gz
-RPM_BASE = @RPM_BASE@
-
-#############################################################################
-# We include these files in our distributions
-#############################################################################
-CONFIGS = config trust default.action match-all.action user.action default.filter user.filter
-# take care that no CVS .cvsignore or other crappy files
-# are included here
-# and escape every '#' in the find. doh.
-CONFIG_FILES = $(CONFIGS) \
-		`find templates/ -type f | grep -v "CVS" | grep -v "\.\#" | grep -v ".*~" | grep -v ".cvsignore" | grep -v "TAGS"`
-
-DOC_FILES = AUTHORS LICENSE README ChangeLog INSTALL \
-		`find doc/webserver/ -name "*.html" | grep -v "\(webserver\|team\)\/index\.html"` \
-		`find doc/webserver/ -name "*.css"` \
-                privoxy.1
-
-#############################################################################
-# Filenames and libraries
-#############################################################################
-
-C_SRC  = actions.c cgi.c cgiedit.c cgisimple.c deanimate.c encode.c \
-         errlog.c filters.c gateway.c jbsockets.c jcc.c \
-         list.c loadcfg.c loaders.c miscutil.c parsers.c ssplit.c \
-         urlmatch.c
-
-C_OBJS = $(C_SRC:.c=. at OBJEXT@)
-C_HDRS = $(C_SRC:.c=.h) project.h actionlist.h
-
-W32_SRC   = @WIN_ONLY at w32log.c w32taskbar.c win32.c w32svrapi.c
-W32_FILES = @WIN_ONLY at w32.res
-W32_OBJS  = @WIN_ONLY@$(W32_SRC:.c=. at OBJEXT@) $(W32_FILES)
-W32_HDRS  = @WIN_ONLY at w32log.h w32taskbar.h win32.h w32res.h w32svrapi.h
-W32_LIB   = @WIN_ONLY at -lwsock32 -lcomctl32
-W32_INIS  = @WIN_ONLY at config.txt trust.txt
-
-PCRS_SRC     = @STATIC_PCRS_ONLY at pcrs.c
-PCRS_OBJS    = @STATIC_PCRS_ONLY@$(PCRS_SRC:.c=. at OBJEXT@)
-PCRS_HDRS    = @STATIC_PCRS_ONLY@$(PCRS_SRC:.c=.h)
-
-PCRE_SRC     = @STATIC_PCRE_ONLY at pcre/get.c pcre/maketables.c pcre/study.c pcre/pcre.c
-PCRE_OBJS    = @STATIC_PCRE_ONLY@$(PCRE_SRC:.c=. at OBJEXT@)
-PCRE_HDRS    = @STATIC_PCRE_ONLY at pcre/config.h pcre/chartables.c pcre/internal.h pcre/pcre.h
-
-# No REGEX (maybe because dynamically linked pcreposix):
-REGEX_SRC    =
- at STATIC_PCRE_ONLY@REGEX_SRC = pcre/pcreposix.c
-
-REGEX_OBJS   = $(REGEX_SRC:.c=. at OBJEXT@)
-REGEX_HDRS   = $(REGEX_SRC:.c=.h)
-
-# Dependencies introduced by #include "project.h".
-PROJECT_H_DEPS = project.h $(REGEX_HDRS) $(PCRS_HDRS) @STATIC_PCRE_ONLY at pcre/pcre.h
-
-# Socket libraries for platforms that need them explicitly defined
-SOCKET_LIB   = @SOCKET_LIB@
-
-# PThreads library, if needed.
-PTHREAD_LIB  = @PTHREAD_ONLY@@PTHREAD_LIB@
-
-SRCS         = $(C_SRC)  $(W32_SRC)  $(PCRS_SRC)  $(PCRE_SRC)  $(REGEX_SRC)
-OBJS         = $(C_OBJS) $(W32_OBJS) $(PCRS_OBJS) $(PCRE_OBJS) $(REGEX_OBJS)
-HDRS         = $(C_HDRS) $(W32_HDRS) $(PCRS_HDRS) $(PCRE_OBJS) $(REGEX_HDRS)
-LIBS         = @LIBS@ $(W32_LIB) $(SOCKET_LIB) $(PTHREAD_LIB)
-
-
-#############################################################################
-# Compiler switches
-#############################################################################
-
-# The flag "-mno-win32" can be used by Cygwin to emulate a un?x type build.
-# The flag "-mwindows -mno-cygwin" will cause Cygwin to use MingW32 for a
-# Win32 GUI build.
-# The flag "-pthread" is required if using Pthreads under Linux (and
-# possibly other OSs).
-SPECIAL_CFLAGS = @SPECIAL_CFLAGS@
-
-# Add your flags here 
-OTHER_CFLAGS =   
-
-CFLAGS = @CFLAGS@ @CPPFLAGS@ $(OTHER_CFLAGS) $(SPECIAL_CFLAGS) -Wall \
-         @STATIC_PCRE_ONLY@ -Ipcre 
-
-LDFLAGS = @LDFLAGS@ $(DEBUG_CFLAGS) $(SPECIAL_CFLAGS)
-
-
-#############################################################################
-# Build section.
-#
-# There should NOT be any targets above this line.
-#############################################################################
-all: $(PROGRAM) default.action
-
-
-#############################################################################
-# Phony targets
-#############################################################################
-.PHONY: all inifiles redhat-dist redhat-upload solaris-dist suse-dist \
-suse-upload win-dist tarball-dist dok redhat-dok webserver clean clobber tags \
-install conectiva-spec conectiva-dist conectiva-upload CONF_DEST LOG_DEST \
-PID_DEST check_doc install-strip uninstall GROUP_T
-
-#############################################################################
-# Define this explicitly because Solaris is broken!
-#############################################################################
-%.o: %.c
-	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
-
-
-#############################################################################
-# Strip master copy comments from default.action:
-#############################################################################
-default.action: default.action.master
-	$(GREP) -v '^#MASTER#' $< > $@
-
-#############################################################################
-# Win32 config files
-#############################################################################
-
-inifiles: $(W32_INIS)
-
-config.txt: config
-	$(SED) -e 's!\trustfile trust!trustfile trust.txt!' \
-	       -e 's!\logfile logfile!logfile privoxy.log!' \
-	       -e 's!#Win32-only: !!' \
-	       < $< | \
-	       $(DOSFILTER) > $@
-	# LF to CRLF in default.action
-	$(DOSFILTER) <default.action >default.action.txt && mv default.action.txt default.action
-	# LF to CRLF in default.filter
-	$(DOSFILTER) <default.filter >default.filter.txt && mv default.filter.txt default.filter
-
-trust.txt: trust
-	$(DOSFILTER) < $< > $@ 
-
-#############################################################################
-# Pre-dist check:
-#############################################################################
-dist-check:
-	@if [ -d CVS ]; then \
-           $(ECHO) "***************************************************"; \
-           $(ECHO) "***                                             ***"; \
-           $(ECHO) "***                  WARNING                    ***"; \
-           $(ECHO) "***                                             ***"; \
-           $(ECHO) "*** The presence of a CVS subdirectory suggests ***"; \
-           $(ECHO) "*** that you are trying to build a distribution ***"; \
-           $(ECHO) "*** package based on a checked out, not an      ***"; \
-           $(ECHO) "*** exported copy of the source tree. Please    ***"; \
-           $(ECHO) "*** see \"Releasing a new version\" in the        ***"; \
-           $(ECHO) "*** developer manual.                           ***"; \
-           $(ECHO) "***                                             ***"; \
-           $(ECHO) "***************************************************"; \
-           $(ECHO) "Type \"yes i am sure\" if you are sure that you"; \
-           $(ECHO) -n "really want to proceed: "; \
-           read answer; \
-           if [ "$$answer" != "yes i am sure" ]; then exit 1; fi \
-         fi;
-
-
-#############################################################################
-# create tar.gz from CVS:
-# This make-target is usually called through 'create-archive'. If you 
-# run 'make create-snapshot' without setting SNAPVERSION, you'll get a
-# tar.gz with the current date in the name and as a releasenumber in the 
-# spec-file. But the main usage is to run it as follows (Red Hat example):
-# make SNAPVERSION=1.6x create-snapshot
-# This creates a tar.gz and spec-file for a Red Hat 6.x version.
-#############################################################################
-create-snapshot:
-	@tag=`cvs -d $(CVSROOT) status Makefile | awk ' /Sticky Tag/ { print $$3 } '` 2> /dev/null; \
-	[ x"$$tag" = x"(none)" ] && tag=HEAD; \
-	echo "*** Creating package from $$tag!"; \
-	TMPDIR=$(shell mktemp -d /tmp/$(PROGRAM).XXXXXX); \
-	cd $$TMPDIR ; cvs -Q -d $(CVSROOT) export -r $$tag current || echo "Um... export aborted."; \
-	cd $$TMPDIR/current; \
-	TMPFILE=$$(mktemp -q /tmp/$(PROGRAM).XXXXXX); \
-	if $(SED) -e 's/^\(Version:\).*/\1 $(RPM_VERSION)/g' \
-		-e 's/^\(Release:\).*/\1 $(SNAPVERSION)/g' \
-		privoxy-rh.spec > $$TMPFILE ; then \
-			$(MV) -f $$TMPFILE privoxy-rh.spec; \
-	else \
-		$(ECHO) "Could not set version info in specfile."; \
-		exit 1;\
-	fi;\
-	if $(SED) -e 's/^\(Version:\).*/\1 $(RPM_VERSION)/g' \
-             -e 's/^\(Release:\).*/\1 $(SNAPVERSION)/g' \
-              privoxy-suse.spec > $$TMPFILE ; then \
-			$(MV) -f $$TMPFILE privoxy-suse.spec; \
-	else \
-		$(ECHO) "Could not set version info in specfile."; \
-		exit 1;\
-	fi; \
-	$(RM) $$TMPFILE; \
-	cd $$TMPDIR/current; \
-	$(TAR) --exclude ".cvsignore" --exclude "CVS" \
-		-czf /tmp/$(PROGRAM)-$(VERSION).tar.gz .; \
-	$(RM) -rf $$TMPDIR
-	@echo "Resulting file is /tmp/$(PROGRAM)-$(VERSION).tar.gz"
-
-
-#############################################################################
-# looks at the version of Makefile and exports a corresponding source-tree
-# example: if the Makefile has the sticky tag v_2_9_13, you'll get 
-# privoxy-*-2.4.13.tar.gz. Two different tar files will be written, one for
-# Red Hat and one for SuSe (different spec-files)
-#############################################################################
-create-archive:
-	make SNAPVERSION=$(SNAPVERSION) create-snapshot
-
-#############################################################################
-# RPM specifice stuff (SuSE or Redhat, ..)
-#############################################################################
-rpm-stuff: dist-check clean clobber 
-	for dir in RPMS SRPMS BUILD SOURCES SPECS; do \
-		if [ ! -w $(RPM_BASE)/$$dir ]; then \
-			$(ECHO) "$(RPM_BASE)/$$dir is not writable for you. Maybe try as root."; \
-			$(ECHO) "Or add a suitable path to .rpmmacros like."; \
-			$(ECHO) "%_topdir /home/foo/rpm-build"; \
-			exit 1; \
-		fi; \
-	done; \
-
-check-release:
-	@if [ "$(RPM_PACKAGEV)" = "" ]; then \
-		echo ; \
-		echo "	ERROR: NO RPM_PACKAGEV VALUE"; \
-		echo "	No value given for RPM_PACKAGEV. Please use:"; \
-		echo "	make dist-upload RPM_PACKAGEV=release"; \
-		echo "	where \"release\" is the release number you want to and"; \
-		echo "	where \"dist\" is the name of the distro (redhat or suse)"; \
-		echo ; \
-		echo "	Ex: make redhat-upload RPM_PACKAGEV=1"; \
-		echo ""; \
-		echo "ATTENTION: If your distribution use a specific tag on the"; \
-		echo "           release field (like \"cl\" for Conectiva, and"; \
-		echo "           \"mdk\" for Mandrake), DO NOT put it on the value"; \
-		echo "           given to RPM_PACKAGEV. It will be added automaticaly."; \
-		echo "           Do it like you would do for a redhat package,"; \
-		echo "           (i.e. just the number)."; \
-		echo ; \
-		exit 1; \
-	fi
-
-
-#############################################################################
-# Create Conectiva specfile from RedHat specfile
-#############################################################################
-conectiva-spec:
-	$(RM) privoxy-cl.spec
-	chmod a+x genclspec.sh
-	./genclspec.sh
-
-#############################################################################
-# Conectiva distribution for x86
-#############################################################################
-conectiva-dist: rpm-stuff conectiva-spec
-
-	$(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-suse.spec" --exclude "privoxy-rh.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) .
-	$(RPMBUILD) --clean -ta  $(TAR_ARCH)
-	if [ -f $(TAR_ARCH) ]; then  $(RM) $(TAR_ARCH); fi
-
-conectiva-upload: check-release
-	make redhat-upload RPM_PACKAGEV=$(RPM_PACKAGEV)cl
-
-#############################################################################
-# redhat distribution alpha and x86
-#############################################################################
-redhat-dist: rpm-stuff
-	echo $(CONFIG_FILES)
-	$(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-suse.spec" --exclude "privoxy-cl.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) .
-	$(RPMBUILD) --clean -ta  $(TAR_ARCH)
-	if [ -f $(TAR_ARCH) ]; then  $(RM) $(TAR_ARCH); fi
-
-# For testing build issues only! Use redhat-dist for official releases.
-redhat-test: 
-	echo $(CONFIG_FILES)
-	$(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-suse.spec" --exclude "privoxy-cl.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) .
-	$(RPMBUILD) --clean -tb  $(TAR_ARCH)
-	if [ -f $(TAR_ARCH) ]; then  $(RM) $(TAR_ARCH); fi
-	@echo "WARNING: This target is only for testing. Use redhat-dist for releases!!!"
-
-# anonymously ncftps the rpms to sourceforge
-redhat-upload: check-release
-	ncftpput -u anonymous -p ijbswa-developers at lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/SRPMS/privoxy-$(RPM_VERSION)-$(RPM_PACKAGEV).src.rpm
-# better should use `arch` here instead of ix86 to support other platforms too
-	ncftpput -u anonymous -p ijbswa-developers at lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/RPMS/*/privoxy-$(RPM_VERSION)-$(RPM_PACKAGEV).*.rpm
-	@$(ECHO) -------------------------------------------------------
-	@$(ECHO) Now goto
-	@$(ECHO) https://sourceforge.net/project/admin/editpackages.php?group_id=11118
-	@$(ECHO) ... and release the files.
-	@$(ECHO) -------------------------------------------------------
-     # w3m http://sourceforge.net/project/admin/editpackages.php?group_id=11118
-
-
-#############################################################################
-# Creates a Red Hat sourcepackage from CVS (not from the current sources
-# on disk)
-#############################################################################
-redhat-srpm: 
-	make create-archive
-	$(RPMBUILD) -ts --nodeps $(PROGRAM)-$(VERSION).tar.gz
-
-
-#############################################################################
-# suse distribution. works fine. no need to be root. 
-#############################################################################
-suse-dist: rpm-stuff
-# 	TMPFILE=$$(mktemp -q /tmp/$(PROGRAM).XXXXXX); \
-# 	if $(SED) -e 's/^\(Version:\).*/\1 $(RPM_VERSION)/g' \
-#              -e 's/^\(Release:\).*/\1 $(RPM_PACKAGEV)/g' \
-#               privoxy-suse.spec > $$TMPFILE ; then \
-# 	$(MV) -f $$TMPFILE privoxy-suse.spec; \
-# 	else \
-# 		$(ECHO) "Could not set version info in specfile."; \
-# 	exit 1;\
-# 	fi
-
-	$(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-rh.spec" --exclude "privoxy-cl.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) .
-	$(RPMBUILD) --clean -ta  $(TAR_ARCH)
-	if [ -f $(TAR_ARCH) ]; then  $(RM) $(TAR_ARCH); fi
-
-# anonymously ncftps the rpms to sourceforge
-suse-upload: check-release
-	ncftpput -u anonymous -p ijbswa-developers at lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/SRPMS/privoxy-suse-$(RPM_VERSION)-$(RPM_PACKAGEV).src.rpm
-# better should use `arch` here instead of ix86 to support other platforms too
-	ncftpput -u anonymous -p ijbswa-developers at lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/RPMS/*/privoxy-suse-$(RPM_VERSION)-$(RPM_PACKAGEV).*.rpm
-	@$(ECHO) -------------------------------------------------------
-	@$(ECHO) Now goto
-	@$(ECHO) https://sourceforge.net/project/admin/editpackages.php?group_id=11118
-	@$(ECHO) ... and release the files.
-	@$(ECHO) -------------------------------------------------------
-
-# handle with care. use with root.
-suse-clean:
-	$(RPM) -e junkbuster-suse || true
-	$(RM) -r /etc/junkbuster
-	$(RM) -r /etc/rc.d/junkbuster*
-	$(RM) -r /var/run/junkbuster.pid 
-	$(RM) -r /var/log/junkbuster
-	$(RM) /etc/init.d/junkbuster
-	$(RM) /usr/sbin/junkbuster
-	$(RM) /usr/sbin/rcjunkbuster
-	$(RM) /usr/share/man/man1/junkbuster.1.gz
-	$(RPM) -e privoxy-suse || true
-	$(RM) -r /etc/privoxy
-	$(RM) -r /etc/rc.d/privoxy*
-	$(RM) -r /var/run/privoxy.pid 
-	$(RM) -r /var/log/privoxy
-	$(RM) /etc/init.d/privoxy
-	$(RM) /usr/sbin/privoxy
-	$(RM) /usr/sbin/rcprivoxy
-	$(RM) /usr/share/man/man1/privoxy.1.gz
-
-#############################################################################
-# generic distribution
-#############################################################################
-gen-dist: dist-check
-	@$(ECHO) ""
-	@$(ECHO) "You have run autoconf && autoheader && ./configure right?"
-	@$(ECHO) ""
-	$(MAKE) $(PROGRAM)
-	$(STRIP_PROG) $(PROGRAM)
-	$(LN) -s current ../privoxy-$(VERSION)-$(CODE_STATUS)
-# add program
-	(cd .. && $(TAR) -cvhf --exclude "PACKAGERS" privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar privoxy-$(VERSION)-$(CODE_STATUS)/$(PROGRAM))
-# add config files
-	for foo in $(CONFIG_FILES); do \
-		(cd .. && $(TAR) -uvhf --exclude "PACKAGERS" privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar privoxy-$(VERSION)-$(CODE_STATUS)/$$foo;) \
-	done; 
-# add documentation
-	for foo in $(DOC_FILES); do \
-		(cd .. && $(TAR) -uvhf --exclude "PACKAGERS" privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar privoxy-$(VERSION)-$(CODE_STATUS)/$$foo;) \
-	done;
-# and zip the archive
-	$(RM) ../privoxy-$(VERSION)-$(CODE_STATUS)
-	$(GZIP_PROG) ../privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar
-	@$(ECHO) Distribution with binary created.
-
-# anonymously ncftps the package to sourceforge
-gen-upload:
-	ncftpput -u anonymous -p ijbswa-developers at lists.sourceforge.net upload.sourceforge.net /incoming ../privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar.gz
-	@$(ECHO) -------------------------------------------------------
-	@$(ECHO) Now goto
-	@$(ECHO) https://sourceforge.net/project/admin/editpackages.php?group_id=11118
-	@$(ECHO) ... and release the files.
-	@$(ECHO) -------------------------------------------------------
-
-# use with care
-gen-clean:
-	$(RM) privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar*
-
-#############################################################################
-# solaris distribution. verified on SF machines by swa.
-#############################################################################
-solaris-dist: gen-dist
-	@$(ECHO) Done.
-# anonymously ncftps the package to sourceforge
-solaris-upload: gen-upload
-	@$(ECHO) Done.
-# use with care
-solaris-clean: gen-clean
-	@$(ECHO) Done.
-
-#############################################################################
-# hpux distribution
-#############################################################################
-hpux-dist:
-	@$(ECHO) coming soon. 
-hpux-upload:
-	@$(ECHO) coming soon. 
-
-#############################################################################
-# debian distribution
-#############################################################################
-debian-dist:
-	@$(ECHO) coming soon. 
-debian-upload:
-	@$(ECHO) coming soon. 
-
-#############################################################################
-# macosx distribution
-#############################################################################
-macosx-dist:
-	@$(ECHO) coming soon. 
-macosx-upload:
-	@$(ECHO) coming soon. 
-
-#############################################################################
-# amiga distribution
-#############################################################################
-amiga-dist:
-	@$(ECHO) coming soon. 
-amiga-upload:
-	@$(ECHO) coming soon. 
-
-#############################################################################
-# freebsd distribution. verified on SF machines by swa.
-#############################################################################
-freebsd-dist: gen-dist
-	@$(ECHO) Done.
-# anonymously ncftps the package to sourceforge
-freebsd-upload: gen-upload
-	@$(ECHO) Done.
-# use with care
-freebsd-clean: gen-clean
-	@$(ECHO) Done.
-
-#############################################################################
-# Windows distribution
-#############################################################################
-win-dist:
-	$(ECHO) Not implemented.
-
-
-#############################################################################
-# Tarball distribution: No CVS dirs, dotfiles, debian build dir,
-# (FIXME:) only parts of the static / generated docs mix in doc/webserver
-#############################################################################
-
-tarball-dist: dist-check clean clobber
-	$(LN) -s current ../privoxy-$(VERSION)-$(CODE_STATUS)
-
-	for i in `find . -type f -a -not \( -path "*/CVS*" -o -name ".*" \
-	-o -path "*/debian/*" -o -path "*/actions/*" -o -name "*.php" -o \
-	-name "PACKAGERS" \)`; do \
-	   files="$$files privoxy-$(VERSION)-$(CODE_STATUS)/$$i"; \
-	done &&  \
-	cd .. && $(TAR) -cvhf privoxy-$(VERSION)-$(CODE_STATUS)-src.tar $$files ; \
-
-# and zip the archive
-	$(RM) ../privoxy-$(VERSION)-$(CODE_STATUS) 
-	$(GZIP_PROG) ../privoxy-$(VERSION)-$(CODE_STATUS)-src.tar
-	@$(ECHO) Tarball distribution created.
-
-# anonymously ncftps the tarball to sourceforge
-tarball-upload:
-	ncftpput -u anonymous -p ijbswa-developers at lists.sourceforge.net upload.sourceforge.net /incoming ../privoxy-$(VERSION)-$(CODE_STATUS)-src.tar.gz
-	@$(ECHO) -------------------------------------------------------
-	@$(ECHO) Now goto
-	@$(ECHO) https://sourceforge.net/project/admin/editpackages.php?group_id=11118
-	@$(ECHO) ... and release the files.
-	@$(ECHO) -------------------------------------------------------
-
-tarball-clean:
-	$(RM) ../privoxy-$(VERSION)-$(CODE_STATUS)-src.tar.gz
-
-#############################################################################
-#
-# Documentation
-#
-# converts doc/source/*.sgml into html and man pages
-#
-#############################################################################
-
-# developer manual
-dok-devel: 
-	$(RM) doc/webserver/developer-manual/*.html
-	$(RM) -r doc/source/developer-manual
-	mkdir -p doc/source/developer-manual
-	cd doc/source/developer-manual && $(DB) ../developer-manual.sgml && cd .. && cp developer-manual/*.html ../webserver/developer-manual/
-
-# user manual
-dok-user: 
-	$(RM) doc/webserver/user-manual/*.html
-	$(RM) -r doc/source/user-manual/
-	mkdir -p doc/source/user-manual
-	cd doc/source/user-manual && $(DB) -iuser-man ../user-manual.sgml && cd .. && cp user-manual/*.html ../webserver/user-manual/
-	# FIXME: temp fix so same stylesheet gets in more than one place so it works
-	# for all doc set-ups, including the 'user manual' config option in local
-	# system where it MUST be in same directory as html.
-	$(PERL) -pi.bak -e 's/<\/head/\n<LINK REL=\"STYLESHEET\" TYPE=\"text\/css\" HREF=\"p_doc.css\">\n<\/head/i' doc/webserver/user-manual/*html
-
-# faq
-dok-faq: 
-	$(RM) doc/webserver/faq/*.html
-	$(RM) -r doc/source/faq
-	mkdir -p doc/source/faq
-	cd doc/source/faq && $(DB) ../faq.sgml && cd .. && cp faq/*.html ../webserver/faq/
-
-# man page, one variation. Try to use the next target, just 'make man'. 
-dok-man: 
-	$(RM) doc/man/* doc/webserver/man-page/*.html
-ifneq ($(MAN2HTML),false)
-	$(ECHO) "<html><head><title>Privoxy Man page</title><link rel=\"stylesheet\" type=\"text/css\" href=\"../p_web.css\"></head><body><H2>NAME</H2>" > doc/webserver/man-page/privoxy-man-page.html
-	man ./privoxy.1 | $(MAN2HTML) -bare >> doc/webserver/man-page/privoxy-man-page.html
-	$(ECHO) "</body></html>" >> doc/webserver/man-page/privoxy-man-page.html
-else
-	$(MAKE) groff2html
-endif
-
-# Build man page from sgml. This requires the SGMLSpm perl module.
-# See CPAN, or your favorite perl repository. This is the preferred 
-# target for man page generation!
-man: dok-release
-	mkdir -p doc/source/temp && cd doc/source/temp && $(RM) * ;\
-	nsgmls ../privoxy-man-page.sgml  | sgmlspl ../../../utils/docbook2man/docbook2man-spec.pl &&\
-	perl -pi.bak -e 's/ <URL:.*>//; s/\[ /\[/g' privoxy.1 ;\
-	perl -pi.bak -e "s/\[ /\[/g;s/á/\\\\['a]/g;s/é/\\\\['e]/g" privoxy.1; \
-	perl -pi.bak -e "s/ö/\\\\[:o]/g" privoxy.1; \
-	perl -pi.bak -e 's/([ {])-([a-z])/$$1\\-$$2/g' privoxy.1; \
-	perl -pi.bak -e 's/ --([a-z])/ \\-\\-$$1/g' privoxy.1; \
-	perl -pi.bak -e 's/\\fB--/\\fB\\-\\-/g' privoxy.1; \
-	$(DB) ../privoxy-man-page.sgml && $(MV) -f privoxy.1 ../../../privoxy.1
-
-# For those with man2html ala RH7s.
-man2html:
-	mkdir -p doc/webserver/man-page
-ifneq ($(MAN2HTML),false)
-	$(MAN2HTML) privoxy.1 |grep -v "^Content-type" > tmp.html
-	$(PERL) -pi.bak -e 's/<A .*Contents<\/A>//; s/<A .*man2html<\/A>/man2html/' tmp.html
-	$(PERL) -pi.bak -e 's/(<\/HEAD>)/<LINK REL=\"STYLESHEET\" TYPE=\"text\/css\" HREF=\"..\/p_doc.css\"><\/HEAD>/' tmp.html
-# Twice because my version of man2html is pulling in commas and periods in URLs.
-	$(PERL) -pi.bak -e 's/(<A.*),(">)/$$1$$2/g' tmp.html
-	$(PERL) -pi.bak -e 's,\.">,">,g' tmp.html
-	$(PERL) -pi.bak -e "s/\['a\]/\á/g;s/\['e\]/\é/g" tmp.html
-# Get rid of spurious  from conversion. (How to do this with perl?)
-	$(SED) -e 's///g' tmp.html > doc/webserver/man-page/privoxy-man-page.html && $(RM) tmp.*
-else
-	$(MAKE) groff2html
-endif
-
-
-# Otherwise we get plain groff conversion.
-groff2html:
-	$(G2H_CMD) ./privoxy.1 | $(SED) -e 's@</head>@<link REL="STYLESHEET" TYPE="text/css" HREF="../p_doc.css"></head>@' > doc/webserver/man-page/privoxy-man-page.html
-
-
-# readme page and INSTALL file
-dok-readme: dok-release
-	cd doc/source && $(DB)-notoc -V nochunks readme.sgml > tmp.html &&\
-	env -u LANG $(WDUMP) tmp.html > ../../README ;\
-	$(DB)-notoc -V nochunks install.sgml > tmp.html &&\
-	env -u LANG $(WDUMP) tmp.html > ../../INSTALL ;\
-	$(RM) tmp.*
-
-# index.sgml is used to create both the Home Page, and a local index
-# for documentation, etc.
-#
-# index.html for webserver:
-dok-webserver: 
-	cd doc/source/webserver && $(DB)-notoc -ip-homepage -V nochunks index.sgml > ../../webserver/index.html
-	$(PERL) -pi.bak -e 's/..\/p_doc.css/p_doc.css/;\
-	s/<\/HEAD/\n<meta name=\"description\" content=\"Privoxy helps users to protect their privacy.\"><\/HEAD/;\
-	s/<\/HEAD/\n<meta name="MSSmartTagsPreventParsing" content="TRUE"><\/HEAD/;\
-	s/\.\d\. //;\
-	s/__copy/©/'\
-     doc/webserver/index.html && $(RM) doc/webserver/*.bak
-
-# privoxy-index.html for local documentation:
-dok-index: 
-	cd doc/source/webserver && $(DB)-notoc -ip-index -V nochunks index.sgml > ../../webserver/privoxy-index.html
-	$(PERL) -pi.bak -e 's/..\/p_doc.css/p_doc.css/;\
-	s/<\/HEAD/\n<meta name=\"description\" content=\"Privoxy helps users to protect their privacy.\"><\/HEAD/;\
-	s/<\/HEAD/\n<meta name="MSSmartTagsPreventParsing" content="TRUE"><\/HEAD/;\
-	s/\.\d\. //;\
-	s/__copy/©/' \
-     doc/webserver/privoxy-index.html && $(RM) doc/webserver/*.bak
-
-# Main documentation target.
-dok: dok-release dok-devel dok-user dok-faq dok-readme dok-webserver dok-authors dok-index
-	@$(ECHO) Documentation created.
-
-#
-# an alternative to the above dok. disabled man page creation for the moment
-#
-redhat-dok: dok-release dok-devel dok-user dok-faq redhat-readme dok-webserver dok-authors
-	@$(ECHO) Documentation created.
-
-## Make README
-redhat-readme: 
-	cd doc/source && $(DB)-notoc -V nochunks readme.sgml > tmp.html && $(WDUMP) \
-	  tmp.html > ../../README && $(RM) -r tmp.html
-
-## Make AUTHORS file
-dok-authors: 
-	cd doc/source && $(DB) -V nochunks authors.sgml > tmp.html && env -u LANG $(WDUMP) \
-	  tmp.html > ../../AUTHORS && $(RM) tmp.html
-
-# Set doc entities for VERSION and CODE_STATUS in sgml docs. Toggle content
-# exceptions accordingly. This needs to go before any doc building (doh).
-dok-release:
-	@$(ECHO) Setting doc version and status to $(VERSION), $(CODE_STATUS)
-	@$(PERL) -pi.bak -e 's/<!entity +p-version.*>/<!entity p-version "$(VERSION)">/;\
-     s/<!entity +p-status.*>/<!entity p-status "$(CODE_STATUS)">/' \
-     doc/source/*sgml doc/source/*/*sgml
-	$(RM) -r doc/source/*bak doc/source/*/*bak
-ifeq ($(CODE_STATUS),stable)
-	@$(ECHO) Setting docs to stable $(VERSION)
-	@$(PERL) -pi.bak -e 's/<!entity +% +p-stable.*>/<!entity % p-stable "INCLUDE">/;\
-     s/<!entity +% +p-not-stable.*>/<!entity % p-not-stable "IGNORE">/' \
-     doc/source/*sgml doc/source/*/*sgml
-	$(RM) -r doc/source/*bak doc/source/*/*bak
-else
-	@$(ECHO) Setting docs to not stable $(VERSION)
-	@$(PERL) -pi.bak -e 's/<!entity +% +p-stable.*>/<!entity % p-stable "IGNORE">/;\
-     s/<!entity +% +p-not-stable.*>/<!entity % p-not-stable "INCLUDE">/' \
-     doc/source/*sgml doc/source/*/*sgml
-	$(RM) -r doc/source/*bak doc/source/*/*bak
-endif
-
-# Create release announcement in text and html, with short and long versions.
-# This is a standalone target, and must be invoked directly.
-# announce: dok-release
-# 	mkdir -p $(DOC_TMP)
-# 	cd $(DOC_TMP) && cp -f ../announce.sgml . && $(DB) -iannounce-big announce.sgml &&\
-# 	mv -f index.html announce.html && $(WDUMP) announce.html > announce.txt
-# 	cd $(DOC_TMP) && $(DB) announce.sgml &&\
-# 	mv -f index.html announce-mini.html && $(WDUMP) announce-mini.html > announce-mini.txt &&\
-# 	mv -f *html *txt ../../.. 
-# 	rm -fr $(DOC_TMP)
-
-# The main Privoxy config file, generated from sgml sources. 
-# NOTE: This will require some hand editing. The new file is outputted 
-# as config.new so that problem sections can be compared to previous
-# version. This is hardcored to w3m for html/text conversion. Also, 
-# requires the shell util 'fmt'.
-config-file: dok-release
-	cd doc/source && $(DB)-notoc -iconfig-file -V nochunks config.sgml > __tmp.html &&\
-	env -u LANG w3m -dump __tmp.html | fmt -w 70 > ../../config.new && $(RM) -r __tmp.*
-	$(PERL) -i.bak utils/prepare-configfile.pl config.new
-
-	$(RM) *.bak
-	@$(ECHO)  "****************************************************"
-	@$(ECHO)  "The output file is config.new."
-	@$(ECHO)  "Now -- you need to hand edit the results!!!"
-	@$(ECHO)  "In particular, check the Debug levels, the"
-	@$(ECHO)  "permit-access, forward & socks examples and the"
-	@$(ECHO)  "various user-manual examples, which all"
-	@$(ECHO)  "probably got hammered."
-	@$(ECHO)  "****************************************************"
-
-# config file, alternate version using lynx (perl stuff unfinished). Lynx
-# does not do so good a job.
-config-file-alt: 
-	cd doc/source && $(ECHO) -e ".h2 JUSTIFY\\nJUSTIFY:FALSE" > __tmp.lynx_cfg &&\
-	$(DB)-notoc -iconfig-file -V nochunks config.sgml > __tmp.html &&\
-	lynx -cfg=__tmp.lynx_cfg -width=78 -dump __tmp.html > ../../config.new && $(RM) -r __tmp.*
-	$(PERL) -pi -e 's/^(   )//;\
-	                s/:$\/:\n/' config.new
-
-#############################################################################
-#
-# Webserver
-#
-# moves dokumentation to webserver
-#
-#############################################################################
-webserver: tidy
-	@$(ECHO) -------------------------------------------------------
-	@$(ECHO) You will need to "create" a SF shell first:
-	@$(ECHO)    ssh -t USER,PROJECT at shell.sourceforge.net create
-	@$(ECHO) Please make sure your documentation files are up to date.
-	@$(ECHO) Note that this command updates the home page and scps 
-	@$(ECHO) all stuff to the webserver, it will not remove obsolete documents.
-	@$(ECHO) You will also need to change the user-manual symlink manually.
-	@$(ECHO) -------------------------------------------------------
-
-	@$(ECHO) Uploading html
-	@cd doc/webserver; \
-          upload=`find . -type f -a -not \( -path "*/CVS*" -o -path "*/results*" \)`; \
-          $(TAR) c $$upload | ssh shell.sf.net 'cd /home/groups/i/ij/ijbswa/htdocs/; tar xvm 2>&1 | grep -v timestamp'
-
-	@$(ECHO) Fixing permissions
-	@ssh shell.sf.net 'chmod -R 775 /home/groups/i/ij/ijbswa/htdocs 2>/dev/null; true'
-	@ssh shell.sf.net 'find /home/groups/i/ij/ijbswa/htdocs/ -type f | xargs chmod 664 2>/dev/null; true'
-	@ssh shell.sf.net 'chmod 666 /home/groups/i/ij/ijbswa/htdocs/actions/results/actions-feedback.txt 2>/dev/null; true'
-
-
-web-actions: tidy
-	@$(ECHO) Uploading 
-	@cd doc/webserver/actions; \
-          upload=`find . -type f -a -not \( -path "*/CVS*" -o -path "*/results*" \)`; \
-          $(TAR) c $$upload | ssh ijbswa.sourceforge.net 'cd /home/groups/i/ij/ijbswa/htdocs/actions; tar xvm'
-
-	@$(ECHO) Fixing permissions
-	@ssh ijbswa.sourceforge.net 'find /home/groups/i/ij/ijbswa/htdocs/actions/ -type f | xargs chmod 664 2>/dev/null'
-	@ssh ijbswa.sourceforge.net 'chmod 666 /home/groups/i/ij/ijbswa/htdocs/actions/results/actions-feedback.txt 2>/dev/null'
-
-## 
-dok-put:
-	tar --exclude ".cvsignore" --exclude "CVS" --exclude "source" --exclude ".htaccess" \
-	     --exclude "obsolete" --exclude "actions" --exclude "*.zip" --exclude "robots.txt"\
-		doc/* INSTALL LICENSE AUTHORS README \
-		-czf $(DOC_FILE) ;\
-		$(ECHO) "Uploading doc package ..." ;\
-		scp $(DOC_FILE) ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/docs/
-		@ssh ijbswa.sourceforge.net 'chmod 775 /home/groups/i/ij/ijbswa/htdocs/docs/*gz 2>/dev/null; true'
-		$(RM) $(DOC_FILE)
-
-dok-get:
-	cd /tmp ;\
-	$(WGET) http://www.privoxy.org/docs/$(DOC_FILE) ;\
-	$(TAR) -zxvf $(DOC_FILE)
-
-
-#############################################################################
-# Source file dependencies
-#############################################################################
-
-actions. at OBJEXT@:   actions.c   actions.h   config.h $(PROJECT_H_DEPS) errlog.h jcc.h list.h loaders.h miscutil.h actionlist.h ssplit.h
-cgi. at OBJEXT@:       cgi.c       cgi.h       config.h $(PROJECT_H_DEPS) cgiedit.h cgisimple.h jbsockets.h list.h pcrs.h encode.h ssplit.h jcc.h filters.h actions.h errlog.h miscutil.h
-cgiedit. at OBJEXT@:   cgiedit.c   cgiedit.h   config.h $(PROJECT_H_DEPS) cgi.h list.h pcrs.h encode.h ssplit.h jcc.h filters.h actionlist.h actions.h errlog.h miscutil.h
-cgisimple. at OBJEXT@: cgisimple.c cgisimple.h config.h $(PROJECT_H_DEPS) cgi.h list.h pcrs.h encode.h ssplit.h jcc.h filters.h actions.h errlog.h miscutil.h urlmatch.h
-deanimate. at OBJEXT@: deanimate.c deanimate.h config.h $(PROJECT_H_DEPS)
-encode. at OBJEXT@:    encode.c    encode.h    config.h
-errlog. at OBJEXT@:    errlog.c    errlog.h    config.h $(PROJECT_H_DEPS) @WIN_ONLY at w32log.h
-filters. at OBJEXT@:   filters.c   filters.h   config.h $(PROJECT_H_DEPS) errlog.h encode.h gateway.h jbsockets.h jcc.h loadcfg.h parsers.h ssplit.h cgi.h deanimate.h urlmatch.h @WIN_ONLY at win32.h 
-gateway. at OBJEXT@:   gateway.c   gateway.h   config.h $(PROJECT_H_DEPS) errlog.h jbsockets.h jcc.h loadcfg.h
-jbsockets. at OBJEXT@: jbsockets.c jbsockets.h config.h $(PROJECT_H_DEPS) filters.h
-jcc. at OBJEXT@:       jcc.c       jcc.h       config.h $(PROJECT_H_DEPS) errlog.h filters.h gateway.h jbsockets.h loadcfg.h loaders.h miscutil.h parsers.h @WIN_ONLY at w32log.h win32.h w32svrapi.h cgi.h
-list. at OBJEXT@:      list.c      list.h      config.h $(PROJECT_H_DEPS) list.h miscutil.h
-loadcfg. at OBJEXT@:   loadcfg.c   loadcfg.h   config.h $(PROJECT_H_DEPS) errlog.h filters.h gateway.h jbsockets.h jcc.h loaders.h miscutil.h parsers.h @WIN_ONLY at w32log.h win32.h
-loaders. at OBJEXT@:   loaders.c   loaders.h   config.h $(PROJECT_H_DEPS) errlog.h encode.h filters.h gateway.h jcc.h loadcfg.h miscutil.h parsers.h ssplit.h
-miscutil. at OBJEXT@:  miscutil.c  miscutil.h  config.h
-parsers. at OBJEXT@:   parsers.c   parsers.h   config.h $(PROJECT_H_DEPS) errlog.h filters.h jbsockets.h jcc.h loadcfg.h loaders.h miscutil.h ssplit.h
-ssplit. at OBJEXT@:    ssplit.c    ssplit.h    config.h miscutil.h
-urlmatch. at OBJEXT@:  urlmatch.c  urlmatch.h  config.h $(PROJECT_H_DEPS) errlog.h miscutil.h ssplit.h
-
-# GNU regex
-gnu_regex. at OBJEXT@: gnu_regex.c gnu_regex.h config.h
-
-# PCRS
-pcrs. at OBJEXT@: pcrs.c pcrs.h config.h @STATIC_PCRE_ONLY at pcre/pcre.h 
-
-# PCRE
-pcre/get. at OBJEXT@:        pcre/get.c        pcre/config.h pcre/internal.h pcre/pcre.h
-pcre/maketables. at OBJEXT@: pcre/maketables.c pcre/config.h pcre/internal.h pcre/pcre.h
-pcre/pcre. at OBJEXT@:       pcre/pcre.c       pcre/config.h pcre/internal.h pcre/pcre.h pcre/chartables.c 
-pcre/pcreposix. at OBJEXT@:  pcre/pcreposix.c  pcre/config.h pcre/internal.h pcre/pcre.h pcre/pcreposix.h
-pcre/study. at OBJEXT@:      pcre/study.c      pcre/config.h pcre/internal.h pcre/pcre.h
-
-# An auxiliary program makes the PCRE default character table source
-
-pcre/chartables.c:   pcre/dftables at EXEEXT@
-		pcre/dftables at EXEEXT@ >pcre/chartables.c
-
-pcre/dftables at EXEEXT@:       pcre/dftables.c pcre/maketables.c pcre/pcre.h pcre/internal.h pcre/config.h
-		$(CC) -o pcre/dftables at EXEEXT@ $(CFLAGS) pcre/dftables.c
-
-# Win32
-w32log. at OBJEXT@: w32log.c errlog.h config.h jcc.h loadcfg.h miscutil.h pcre/pcre.h pcre/pcreposix.h pcrs.h project.h w32log.h w32taskbar.h win32.h
-w32taskbar. at OBJEXT@: w32taskbar.c config.h w32log.h w32taskbar.h
-win32. at OBJEXT@: win32.c config.h jcc.h loadcfg.h pcre/pcre.h pcre/pcreposix.h pcrs.h project.h w32log.h win32.h w32svrapi.h
-
-w32.res: w32.rc w32res.h icons/ico00001.ico icons/ico00002.ico icons/ico00003.ico icons/ico00004.ico icons/ico00005.ico icons/ico00006.ico icons/ico00007.ico icons/ico00008.ico icons/idle.ico icons/privoxy.ico config.h
-	windres -D__MINGW32__=0.2 -O coff -i $< -o $@
-
-# AmigaOS
- at AMIGAOS_ONLY@OBJS += amiga.o
- at AMIGAOS_ONLY@ifeq ($(shell $(CC) -dumpmachine), m68k-amigaos)
- at AMIGAOS_ONLY@CFLAGS += -D__AMIGAVERSION__=\"$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_POINT)\" -D__AMIGADATE__=\"`date +%d.%m.%Y`\" -W -m68020 -noixemul -fbaserel -msmall-code
- at AMIGAOS_ONLY@LDFLAGS += -m68020 -noixemul -fbaserel
- at AMIGAOS_ONLY@LIBS = -lm /gg/lib/libb/libm020/libnix/swapstack.o
- at AMIGAOS_ONLY@else
- at AMIGAOS_ONLY@CFLAGS += -D__AMIGAVERSION__=\"$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_POINT)\" -D__AMIGADATE__=\"`date +%d.%m.%Y`\" -Wextra -D__USE_INLINE__ -D__NO_INTUITION_RJ_MACROS
- at AMIGAOS_ONLY@endif
- at AMIGAOS_ONLY@amiga.o: amiga.c amiga.h config.h
-
-
-$(PROGRAM): $(OBJS) $(W32_FILES)
-	$(LD) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
-
-clean:
-	$(RM) a.out $(OBJS) $(W32_FILES) $(W32_INIS) $(PROGRAM) default.action `find . -name TAGS -o -name tags` config.base config.tmp
-
-tidy:
-	$(RM) `find . -name "*~"`
-	$(RM) `find . -name "#*#"` # Emacs backup files
-	$(RM) `find . -name ".\#*"`
-
-clobber: tidy
-	$(RM) GNUmakefile configure config.h.in config.h config.cache config.status config.log logfile \
-              privoxy.log core *.tar.gz *.tar privoxy-cl.spec doc/source/ldp.dsl config.new
-	$(RM) -r autom4te.cache
-
-#
-# FIXME: What is all this? 
-#
-	$(RM) cscope.*  *.pdb *.lib *.exp 
-
-distclean: clobber
-
-tags: $(SRCS) $(HDRS)
-	etags $(SRCS) $(HDRS)
-
-CONF_DEST:=$(shell if [ "$(prefix)" = "/usr/local" ] && [ "$(CONF_BASE)" = "$(prefix)/etc" ];then \
-		$(ECHO) "$(CONF_BASE)/privoxy";\
-	 else\
-		 $(ECHO) "$(CONF_BASE)";\
-	 fi)
-
-LOG_DEST:=$(shell if [ "$(prefix)" = "/usr/local" ] && [ "$(LOGS_DEST)" = "$(prefix)/var/log/privoxy" ];then \
-		$(ECHO) "/var/log/privoxy" ;\
-	 else\
-		 $(ECHO) "$(LOGS_DEST)";\
-	 fi)
-
-PID_DEST:=$(shell if [ "$(prefix)" = "/usr/local" ] && [ "$(PIDS_DEST)" = "$(prefix)/var/run" ];then \
-		$(ECHO) "/var/run" ;\
-	 else\
-		 $(ECHO) "$(PIDS_DEST)";\
-	 fi)
-
-check_doc:=$(shell if [ ! -d "$(SHARE_DEST)/doc" ] && [ "$(prefix)" = "/usr/local" ]  && [ -d "$(prefix)/doc" ];then \
-		$(ECHO) "1";\
-	 else\
-		 $(ECHO) "0";\
-	 fi)
-
-# If USER is specified but no GROUP, assume there is a GROUP of same name.
-GROUP_T:=$(shell if [ x$(GROUP) = x ] && [ x$(USER) != x ];then \
-		$(ECHO) "$(USER)" ;\
-	 else\
-		 $(ECHO) "$(GROUP)";\
-	 fi)
-
-install-strip:
-	$(MAKE) install STRIP=-s
-
-# FIXME: Test USER and GROUP on Slack to make sure this works as 
-# intended.
-#
-# FIXME: id handling needs help, probably via configure, since 'id -u' is not 
-# universally reliable (eg Solaris). Group handling could be better. 
-# Perhaps the whole user/group validation should be done here, and simplified.
-PROGRAM_V = Privoxy $(VERSION) $(CODE_STATUS)
-install: CONF_DEST LOG_DEST PID_DEST check_doc GROUP_T
-	@# Quick test for valid USER.
-	@if [ -n "$(USER)" ]; then \
-		$(ID) $(USER) >/dev/null || exit 1;\
-	fi
-	@# Test for valid group. FIXME. USER does not have to belong to GROUP 
-	@# for file ownership purposes.
-# 	if [ -n "$(GROUP_T)" ] && [ -n "$(USER)" ] && ! $(GROUPS) $(USER) | $(GREP) "\<$(GROUP_T)\>" >/dev/null; then \
-# 		$(ECHO) Group $(GROUP_T) for User $(USER) is invalid && exit 1 ;\
-# 	fi
-
-	@$(ECHO) "Creating directories, and preparing $(PROGRAM_V) installation"
-	$(CHMOD) $(DIR_MODE) $(MKDIR)
-	@$(MKDIR) $(DESTDIR)$(SBIN_DEST) $(DESTDIR)$(prefix) $(DESTDIR)$(CONF_DEST) \
-		$(DESTDIR)$(CONF_DEST)/templates $(DESTDIR)$(SHARE_DEST) \
-		$(DESTDIR)$(LOG_DEST) $(DESTDIR)$(PID_DEST)
-	@# Install the executable binary, strip if invoked as install-strip
-	@test -n "$(STRIP)" &&\
-	$(ECHO) Installing $(PROGRAM) stripped executable to $(SBIN_DEST) ||\
-	$(ECHO) Installing $(PROGRAM) executable to $(DESTDIR)$(SBIN_DEST)
-	$(INSTALL) $(INSTALL_P) $(STRIP) $(PROGRAM) $(DESTDIR)$(SBIN_DEST)
-
-	@# Install the DOCS and man page. install-sh only does one file at a time.
-	@# FIXME: only handles jpegs.
-	- at if [ $(check_doc) = 0 ]; then \
-		DOC=$(DOC_DEST) ;\
-	else \
-		DOC=$(prefix)/doc/privoxy ;\
-	fi;\
-	$(MKDIR) $(DESTDIR)$$DOC $(DESTDIR)$$DOC/user-manual $(DESTDIR)$$DOC/faq $(DESTDIR)$$DOC/developer-manual \
-	     $(DESTDIR)$$DOC/man-page $(DESTDIR)$$DOC/images $(DESTDIR)$(MAN_DEST) ;\
-	if [ -d "$(DOK_WEB)" ]; then \
-		$(ECHO) Installing FAQ, Manual, and other docs to $(DESTDIR)$$DOC;\
-          for i in user-manual developer-manual faq; do \
-               for ii in $(DOK_WEB)/$$i/*html; do \
-                    $(INSTALL) $(INSTALL_T) $$ii $(DESTDIR)$$DOC/$$i;\
-               done ;\
-          done ;\
-		for i in $(DOK_WEB)/user-manual/*jpg; do \
-               $(INSTALL) $(INSTALL_T) $$i $(DESTDIR)$$DOC/user-manual;\
-          done ;\
-		$(INSTALL) $(INSTALL_T) $(DOK_WEB)/man-page/*html $(DESTDIR)$$DOC/man-page;\
-		$(INSTALL) $(INSTALL_T) $(DOK_WEB)/privoxy-index.html $(DESTDIR)$$DOC/index.html;\
-		$(INSTALL) $(INSTALL_T) AUTHORS $(DESTDIR)$$DOC;\
-		$(INSTALL) $(INSTALL_T) LICENSE $(DESTDIR)$$DOC;\
-		$(INSTALL) $(INSTALL_T) README $(DESTDIR)$$DOC;\
-		$(INSTALL) $(INSTALL_T) ChangeLog $(DESTDIR)$$DOC;\
-		$(INSTALL) $(INSTALL_T) $(DOK_WEB)/p_doc.css $(DESTDIR)$$DOC;\
-		$(INSTALL) $(INSTALL_T) $(DOK_WEB)/p_doc.css $(DESTDIR)$$DOC/user-manual;\
-	fi
-	@# Not all platforms support gzipped man pages.
-	@$(ECHO) Installing man page to $(DESTDIR)$(MAN_DEST)/privoxy.1
-	-$(INSTALL) $(INSTALL_T) privoxy.1  $(DESTDIR)$(MAN_DEST)/privoxy.1
-
-	@# Change the config file default directories according to the configured ones
-	@$(ECHO) Rewriting config for this installation
-	@if [ -f config.base ] ; then \
-		$(CAT) config >config~ ;\
-		$(MV) config.base config ;\
-	fi
-	$(SED) 's+^confdir \.+confdir $(CONF_DEST)+' config | \
-	$(SED) 's+^logdir \.+logdir $(LOG_DEST)+' >config.tmp
-	- at if [ $(check_doc) = 0 ]; then \
-      $(SED) 's+^#\?user-manual .*+user-manual $(DOC_DEST)/user-manual/+' config.tmp >config.updated ;\
-	else \
-      $(SED) 's+^#\?user-manual .*+user-manual $(prefix)/doc/privoxy/user-manual/+' config.tmp >config.updated ;\
-	fi;\
-	$(MV) config config.base
-	$(MV) config.updated config 
-
-	@# Install the config support files. Test for root install, and abort 
-	@# if there is no privoxy user, and no other user was enabled during 
-	@# configure. Later, install init script if appropriate.
-	@$(ECHO) Installing templates to $(DESTDIR)$(CONF_DEST)/templates
-	@for i in `find templates -type f`; do \
-		$(INSTALL) $(INSTALL_T) $$i $(DESTDIR)$(CONF_DEST)/templates ;\
-	done
-
-	@# FIXME: group/user validation is overly convoluted.
-	@# If superuser install ... we require a minimum of group ownership
-	@# of those files the daemon writes to, to be non-root owned.
-	@if [ "`$(ID) |sed 's/(.*//' |sed 's/.*=//'`" = "0" ] ;then\
-		if [ x$(USER) = x ] || [ $(USER) = root ]; then \
-			if [ x$(GROUP) = x ] || [ $(GROUP) = root ]; then \
-				if [ "`$(ID) privoxy`" ] && \
-					$(GROUPS) privoxy | $(SED) 's/^.*://' |$(GREP) "\<privoxy\>" >/dev/null; then \
-					$(ECHO) "Warning: Setting group owner to privoxy";\
-					GROUP_T=privoxy ;\
-				else \
-					$(ECHO)  "******************************************************************" ;\
-					$(ECHO)  " WARNING! WARNING! installing config files as root!" ;\
-					$(ECHO)  " It is strongly recommended to run $(PROGRAM) as a non-root user," ;\
-					$(ECHO)  " and to install the config files as that user and/or group!" ;\
-					$(ECHO)  " Please read INSTALL, and create a privoxy user and group!" ;\
-					$(ECHO)  "*******************************************************************" ;\
-					exit 1 ;\
-				fi ;\
-			else \
-				GROUP_T=$(GROUP) ;\
-			fi ;\
-			INSTALL_CONF="$(INSTALL_R) -g $$GROUP_T " ;\
-		else \
-			$(ECHO) "Superuser install, installing config files as $(USER):$(GROUP_T)" ;\
-			INSTALL_CONF="$(INSTALL_R) -o $(USER) -g $(GROUP_T)" ;\
-			GROUP_T=$(GROUP_T) ;\
-		fi ;\
-	else \
-		if [ ! "`id $(USER)`" = "`id`" ] ;then \
-			$(ECHO) "** WARNING ** current install user different from configured user!!" ;\
-			$(ECHO) "Edit may fail." ;\
-		fi ;\
-		INSTALL_CONF="$(INSTALL_R)" ;\
-	fi ;\
-	$(ECHO) Installing configuration files to $(DESTDIR)$(CONF_DEST);\
-	for i in $(CONFIGS); do \
-		if [ "$$i" = "default.action" ] || [ "$$i" = "default.filter" ] ; then \
-			$(RM) $(DESTDIR)$(CONF_DEST)/$$i ;\
-			$(ECHO) Installing fresh $$i;\
-			$(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST) || exit 1;\
-		elif [ -s "$(CONF_DEST)/$$i" ]; then \
-			$(ECHO) Installing $$i as $$i.new ;\
-			$(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST)/$$i.new || exit 1;\
-			NEW=1;\
-		else \
-			$(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST) || exit 1;\
-		fi ;\
-	done ;\
-	if [ -n "$$NEW" ]; then \
-		$(CHMOD) $(RWD_MODE) $(DESTDIR)$(CONF_DEST)/*.new || exit 1 ;\
-		$(ECHO) "Warning: Older config files are preserved. Check new versions for changes!" ;\
-	fi ;\
-	[ ! -f $(DESTDIR)$(LOG_DEST)/logfile ] && $(ECHO) Creating logfiles in $(DESTDIR)$(LOG_DEST) || \
-		$(ECHO) Checking logfiles in $(DESTDIR)$(LOG_DEST) ;\
-		$(TOUCH) $(DESTDIR)$(LOG_DEST)/logfile || exit 1 ;\
-	if [ x$$USER != x ]; then \
-		$(CHOWN) $$USER $(DESTDIR)$(LOG_DEST)/logfile || \
-		$(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\
-	fi ;\
-	if [ x$$GROUP_T != x ]; then \
-		$(CHGRP) $$GROUP_T $(DESTDIR)$(LOG_DEST)/logfile || \
-		$(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\
-	fi ;\
-	$(CHMOD) $(RWD_MODE) $(DESTDIR)$(LOG_DEST)/logfile || exit 1 ;\
-	if [ "$(prefix)" = "/usr/local" ] || [ "$(prefix)" = "/usr" ]; then \
-		if [ -f /etc/slackware-version ] && [ -d /etc/rc.d/ ] && [ -w /etc/rc.d/ ] ; then \
-               $(SED) 's+%PROGRAM%+$(PROGRAM)+' slackware/rc.privoxy.orig | \
-               $(SED) 's+%SBIN_DEST%+$(SBIN_DEST)+' | \
-               $(SED) 's+%CONF_DEST%+$(CONF_DEST)+' | \
-               $(SED) 's+%USER%+$(USER)+' | \
-               $(SED) 's+%GROUP%+$(GROUP_T)+' >slackware/rc.privoxy ;\
-			$(INSTALL) $(INSTALL_P) slackware/rc.privoxy $(DESTDIR)/etc/rc.d/ ;\
-               $(ECHO) "Installing for Slackware." ;\
-               $(ECHO) "Dont forget to add the rc.privoxy to rc.local if you want it started at every boot" ;\
-		elif [ -f /etc/redhat-release ] && [ -d /etc/rc.d/init.d/ ] && [ -w /etc/rc.d/init.d/ ] ; then \
-               $(ECHO) "Installing init script to /etc/rc.d/init.d/privoxy" ;\
-			$(SED) 's,^PRIVOXY_BIN=.*,PRIVOXY_BIN="/usr/local/sbin/$(PROGRAM)",' privoxy.init |\
-			$(SED) 's,^PRIVOXY_CONF=.*,PRIVOXY_CONF="$(CONF_DEST)/config",' |\
-			$(SED) "s,^PRIVOXY_USER=.*,PRIVOXY_USER=$$USER," > init.tmp ;\
-			$(INSTALL) $(INSTALL_P) init.tmp $(DESTDIR)/etc/rc.d/init.d/privoxy && $(RM) init.tmp;\
-			$(MKDIR) $(DESTDIR)/etc/logrotate.d/ ;\
-			$(ECHO) "Installing logrotate script to $(DESTDIR)/etc/logrotate.d/" ;\
-			$(INSTALL) -m 0644 privoxy.logrotate $(DESTDIR)/etc/logrotate.d/privoxy ;\
-		elif [ -d $(DESTDIR)/etc/init.d ] && [ -w $(DESTDIR)/etc/init.d ] ; then \
-			$(ECHO) "Installing generic init script to $(DESTDIR)/etc/init.d/privoxy" ;\
-			$(ECHO) "Please check that the PATHs are correct, and edit if needed." ;\
-			$(INSTALL) $(INSTALL_P) privoxy-generic.init $(DESTDIR)/etc/init.d/privoxy ;\
-		fi ;\
-	else \
-		$(ECHO) "No init script installed, install it manually if needed" ;\
-	fi
-	$(RM) config.base config.tmp
-	@# mmmmm, good.
-	@$(ECHO) "$(PROGRAM_V) installation succeeded!"
-	@$(ECHO) "The Privoxy configuration files have been installed in $(DESTDIR)$(CONF_DEST)"
-
-# rmdir is used as a precaution since it will not remove non-empty
-# directories. RH init script creates lock file and pid file.
-uninstall: CONF_DEST LOG_DEST PID_DEST check_doc
-	@$(ECHO) Starting Privoxy uninstallation
-	@# KILL privoxy if running
-	@# XXX: the chkconfig line may need a DESTDIR prefix.
-	- at if [ -f $(DESTDIR)/etc/redhat-release ] && [ -x $(DESTDIR)/etc/rc.d/init.d/privoxy ]; then \
-		$(DESTDIR)/etc/rc.d/init.d/privoxy stop >/dev/null 2>/dev/null ;\
-		chkconfig --del $(PROGRAM) 2>/dev/null;\
-	fi
-	- at test -f $(DESTDIR)$(PID_DEST)/privoxy.pid && $(ECHO) Stopping $(PROGRAM) &&\
-         $(KILL) `$(CAT) $(DESTDIR)$(PID_DEST)/privoxy.pid` || :
-	- at test -f $(DESTDIR)/var/run/privoxy.pid && $(ECHO) Stopping $(PROGRAM) &&\
-          $(KILL) `$(CAT) $(DESTDIR)/var/run/privoxy.pid ` || :
-
-	@# Program binary
-	@$(ECHO) Removing $(PROGRAM) binary
-	$(RM) $(DESTDIR)$(SBIN_DEST)/$(PROGRAM) $(SBIN_DEST)/$(PROGRAM)~
-
-	@# config files and dir, and maybe old install backups
-	- at if [ -d $(DESTDIR)$(CONF_DEST) ]; then \
-		$(ECHO) Saving $(PROGRAM) config files to $(DESTDIR)/tmp/$(PROGRAM)-save ;\
-		$(MKDIR) $(DESTDIR)/tmp/$(PROGRAM)-save ;\
-		cd $(DESTDIR)$(CONF_DEST) ;\
-		for i in $(DESTDIR)$(CONFIGS); do \
-			[ -f $$i ] && $(CP) $$i $(DESTDIR)/tmp/$(PROGRAM)-save ;\
-		done ;\
-	fi
-	@$(ECHO) Removing $(PROGRAM) config files
-	- at for i in $(DESTDIR)$(CONFIGS); do \
-		test -f $(CONF_DEST)/$$i && $(ECHO) Removing $$i ;\
-		$(RM) $(DESTDIR)$(CONF_DEST)/$$i $(DESTDIR)$(CONF_DEST)/$$i~ $(DESTDIR)$(CONF_DEST)/$$i.new ;\
-	done
-	- at test -d $(DESTDIR)$(CONF_DEST)/templates && $(RM) -r $(DESTDIR)$(CONF_DEST)/templates &&\
-	$(ECHO) "Removing $(DESTDIR)$(CONF_DEST)/templates/*"
-
-	@# man page and docs
-	@$(ECHO) Removing $(PROGRAM) docs
-	-$(RM) $(DESTDIR)$(MAN_DEST)/privoxy.1*
-	-$(RM) -r $(DESTDIR)$(DOC_DEST) || $(RM) -r $(DESTDIR)$(prefix)/doc/privoxy
-
-	@# Log and pidfile
-	@$(ECHO) Removing $(PROGRAM) logs
-	-$(RM) $(DESTDIR)$(LOG_DEST)/logfile $(DESTDIR)$(PID_DEST)/privoxy.pid
-
-	@# Final clean up of unused directories. Special handling of CONF and LOG
-     # destinations.
-	@$(ECHO) Removing $(PROGRAM) directories
-	@for i in $(DESTDIR)$(LOG_DEST) $(DESTDIR)$(CONF_DEST); do \
-		if test -d $$i; then \
-			$(ECHO) Removing $$i ;\
-			$(RMDIR) $$i || $(ECHO) "$$i is not empty, not removed" ;\
-		fi;\
-	done
-	@if [  ! "$(prefix)" = "/usr/local" ] ;then \
-		for i in $(DESTDIR)$(MAN_DEST) $(DESTDIR)$(MAN_DIR) $(DESTDIR)$(SHARE_DEST)/doc \
-                         $(DESTDIR)$(SHARE_DEST) $(DESTDIR)$(SBIN_DEST); do \
-			if test -d $$i; then \
-				$(ECHO) Removing $$i ;\
-				$(RMDIR) $$i || $(ECHO) "$$i is not empty, not removed" ;\
-			fi;\
-		done;\
-		if test $(LOG_DEST) != /var/log/privoxy && test -d $(DESTDIR)$(prefix)/var/log; then \
-			$(ECHO) Removing $(DESTDIR)$(prefix)/var/log ;\
-			$(RMDIR) $(DESTDIR)$(prefix)/var/log || $(ECHO) "$(DESTDIR)$(prefix)/var/log is not empty, not removed";\
-		fi ;\
-		if test $(PID_DEST) != /var/run && test -d $(DESTDIR)$(prefix)/var/run; then \
-			$(ECHO) Removing $(DESTDIR)$(prefix)/var/run ;\
-			$(RMDIR) $(DESTDIR)$(prefix)/var/run || $(ECHO) "$(DESTDIR)$(prefix)/var/run is not empty, not removed";\
-		fi ;\
-		if test $(prefix)/var != /var && test -d $(DESTDIR)$(prefix)/var; then \
-			$(ECHO) Removing $(DESTDIR)$(prefix)/var ;\
-			$(RMDIR) $(DESTDIR)$(prefix)/var || $(ECHO) "$(DESTDIR)$(prefix)/var is not empty, not removed" ;\
-		fi ;\
-		if test $(prefix) != / && test $(prefix) != /usr && test -d $(DESTDIR)$(prefix); then \
-			$(ECHO) Removing $(DESTDIR)$(prefix) ;\
-			$(ECHO) Removing installation directory $(DESTDIR)$(prefix) ;\
-			$(RMDIR) $(DESTDIR)$(prefix) || $(ECHO) "$(DESTDIR)$(prefix) is not empty, not removed" ;\
-		fi;\
-	fi
-
-	@# init scripts and logrotate
-	@if [ "$(prefix)" = "/usr/local" ] || [ "$(prefix)" = "/usr" ]; then \
-		$(ECHO) Removing $(PROGRAM) init script ;\
-		if [ -f $(DESTDIR)/etc/slackware-version ] && \
-	                [ -d $(DESTDIR)/etc/rc.d/ ]  && [ -w $(DESTDIR)/etc/rc.d/ ] ; then \
-			$(RM) $(DESTDIR)/etc/rc.d/rc.privoxy ;\
-		elif [ -f $(DESTDIR)/etc/redhat-release ] && [ -d $(DESTDIR)/etc/rc.d/init.d/ ] \
-                       && [ -w $(DESTDIR)/etc/rc.d/init.d/ ] ; then \
-			$(RM) $(DESTDIR)/etc/rc.d/init.d/privoxy $(DESTDIR)/etc/logrotate.d/privoxy;\
-		elif [ -d $(DESTDIR)/etc/init.d ] && [ -w $(DESTDIR)/etc/init.d ] ; then \
-			$(RM) $(DESTDIR)/etc/init.d/privoxy ;\
-		else \
-			$(ECHO) "Unable to remove privoxy init script, not installed or permission denied" ;\
-		fi ;\
-	fi
-	@$(ECHO) Privoxy uninstalled, bye
-
-coffee:
-	 @perl	-e 'print pack "C*", (31,139,8,8,153,63,226,60,2,3,99,111,102,102,101,'	 \
-		-e '101,0,109,143,205,13,192,32,8,133,239,78,241,110,234,1,28,160,171,'  \
-		-e '152,208,53,26,117,247,22,165,73,137,125,9,1,62,126,2,128,169,5,243,' \
-		-e '143,13,139,49,164,65,100,149,152,102,73,141,88,73,178,116,205,100,'  \
-		-e '69,253,36,102,81,49,83,236,19,225,171,131,214,172,163,73,4,168,123,' \
-		-e '115,71,126,247,122,94,128,178,227,95,154,12,86,215,122,197,249,146,' \
-		-e '187,54,220,125,193,51,228,11,1,0,0);' | zcat
-
-#############################################################################
-
-## Local Variables:
-## tab-width: 3
-## end:
-
-# $Log: GNUmakefile.in,v $
-# Revision 1.180  2009/02/28 08:28:14  fabiankeil
-# pcrs.o doesn't depend on pcre/pcre.h if we are linking
-# dynamically. Patch provided by drauh in #2056286.
-#
-# Revision 1.179  2009/02/22 14:48:31  hal9
-# Updates to the 'make webserver' target that recreates the home page and uploads
-# fresh documents to reflect new SF realities, and more explanation of process.
-#
-# Revision 1.178  2009/02/08 18:35:48  fabiankeil
-# Move the match-all section into a separate file
-# (match-all.action) so we can safely overwrite the
-# default actions when updating. Based on Roland's
-# patch #1563977.
-#
-# Revision 1.177  2009/01/13 16:44:32  fabiankeil
-# Delete the standard.action file after moving
-# the pre-settings over to the default actions.
-#
-# Revision 1.176  2008/09/21 13:24:37  fabiankeil
-# Add Roland's man page fixes from 19_manpage_fixup.dpatch.
-#
-# Revision 1.175  2008/08/30 12:03:07  fabiankeil
-# Remove FEATURE_COOKIE_JAR.
-#
-# Revision 1.174  2008/07/18 17:50:47  fabiankeil
-# Fix whitespace.
-#
-# Revision 1.173  2008/06/18 18:28:42  fabiankeil
-# Remove PDF-related stuff.
-#
-# Revision 1.172  2008/06/17 16:16:08  fabiankeil
-# - Stop building text files nobody cares about.
-# - Update copyright year.
-#
-# Revision 1.171  2008/06/13 15:24:57  fabiankeil
-# Move previously inline'd Perl code for the config-file target
-# into a separate file, have it work with older perl releases,
-# clean it up a bit and fix the "underlining" code.
-#
-# Revision 1.170  2008/06/12 16:38:50  fabiankeil
-# Add third-level domain to URL in dok-get target.
-#
-# Revision 1.169  2008/06/09 17:28:31  fabiankeil
-# - Recommend https for releasing files.
-# - Fix a warning about datarootdir being ignored.
-#
-# Revision 1.168  2008/05/23 18:03:12  fabiankeil
-# - Shorten meta description inserted in dok-webserver
-#   and dok-index target.
-# - In config-file target, unset LANG for w3m as we
-#   might otherwise end up with multi-byte characters.
-#
-# Revision 1.167  2008/05/23 14:39:09  fabiankeil
-# Silence dok-user complaint about @# not being found.
-#
-# Revision 1.166  2008/05/23 14:04:57  fabiankeil
-# - Get config-file target working with more recent Perl
-#   versions. The generated file is still messed up, though.
-# - Fix comment typo.
-#
-# Revision 1.165  2008/05/22 16:57:23  fabiankeil
-# Fix coffee machine.
-#
-# Revision 1.164  2008/05/22 10:26:26  fabiankeil
-# - Remove parsers. at OBJEXT@'s dependency on encode.h.
-# - Include Emacs backup files in tidy target again.
-#
-# Revision 1.163  2008/05/04 18:01:53  fabiankeil
-# Dependency fixes: cgisimple.c and filters.c depend on urlmatch.h.
-#
-# Revision 1.162  2008/03/30 13:31:42  fabiankeil
-# Add DESTDIR support for the uninstall target.
-#
-# Revision 1.161  2008/03/30 13:19:13  fabiankeil
-# Add DESTDIR support for the install target. Closes PR#1910612.
-# Patch by Radoslaw Zielinski with minor modifications.
-#
-# Revision 1.160  2008/03/27 18:27:19  fabiankeil
-# Remove kill-popups action.
-#
-# Revision 1.159  2008/03/21 11:13:53  fabiankeil
-# Only gather host information if it's actually needed.
-# Also move the code out of accept_connection() so it's less likely
-# to delay other incoming connections if the host is misconfigured.
-#
-# Revision 1.158  2007/12/11 21:29:25  fabiankeil
-# Fix dependency list for cgiedit.c.
-#
-# Revision 1.157  2007/12/10 02:28:02  hal9
-# Unset $LANG for text processing of docs so we get pure text.
-#
-# Revision 1.156  2007/11/15 03:17:43  hal9
-# Some workaround changes to the config file perl stuff and comments, which is
-# broken here all by itself on perl 5.8.8.
-#
-# Revision 1.155  2007/09/22 16:23:25  fabiankeil
-# Update copyright line.
-#
-# Revision 1.154  2007/02/07 11:52:40  fabiankeil
-# Fix suse-dist as described in BR#1654052.
-# (I didn't test it, but it's done the same
-# way in redhat-dist which is known to work).
-#
-# Revision 1.153  2007/01/07 07:36:36  joergs
-# Added AmigaOS4 support.
-#
-# Revision 1.152  2006/12/13 14:53:51  etresoft
-# Include any existing LDFLAGS environment when linking so that a MacOS X Universal Binary can be created.
-#
-# Revision 1.151  2006/11/30 01:08:55  hal9
-# Fix problem with variable declarations in the Slackware section. Thanks to higuita.
-#
-# Revision 1.150  2006/10/25 11:55:45  fabiankeil
-# Fix sed regexes for rewriting "confdir ." and "logdir .".
-# Thanks to Darel Henman for reporting this.
-#
-# Revision 1.149  2006/10/11 01:40:28  hal9
-# Apply patch from  Neil McCalden to fix syntax issue.
-#
-# Revision 1.148  2006/09/26 10:57:58  hal9
-# Including Karsten's patch to fix make create-snapshot.
-#
-# Revision 1.147  2006/09/13 01:25:16  hal9
-# Make sure install forces in new default.action, default.filter, and
-# standard.filter. These are privoxy files, not user files.
-#
-# Revision 1.146  2006/09/08 23:57:19  hal9
-# User manual images are now user-manual doc directory, and fix make install
-# target accordingly.
-#
-# Revision 1.145  2006/09/08 02:32:00  hal9
-# Various changes to implement building and installing docs to be compatible
-# with the new "user-manual" settings in config from Roland. Docbook does not
-# seem to like dealing with more than one css file, so workaround that here.
-# Change 'make install' so it provides p_doc.css in the user-manual doc
-# directory so that functions well, and lastly modify 'make install' so that the
-# PATH is automatically set, and the 'user-manual' directive should done during
-# the install.
-#
-# Revision 1.144  2006/09/07 22:53:20  hal9
-# Make sure config sgml build related artifacts are cleaned out.
-#
-# Revision 1.143  2006/09/02 15:59:40  hal9
-# Add to code status to make install output.
-#
-# Revision 1.142  2006/08/29 01:46:24  hal9
-# Add user.filter to $CONFIGS.
-#
-# Revision 1.141  2006/08/12 03:54:37  david__schmidt
-# Windows service integration
-#
-# Revision 1.140  2006/07/18 14:48:45  david__schmidt
-# Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
-# with what was really the latest development (the v_3_0_branch branch)
-#
-# Revision 1.104.2.28  2004/06/10 17:06:05  hal9
-# Fix bug #959617, by moving TMPDIR var to create-snapshot target, which is the
-# only place it is used.
-#
-# Revision 1.104.2.27  2004/02/07 16:11:10  oes
-# Make clobber remove the autom4te.cache dir.
-# Closes BR #889300
-#
-# Revision 1.104.2.26  2004/01/31 16:32:25  oes
-# Adding a check for an htmldoc variant from the debian diff
-#
-# Revision 1.104.2.25  2004/01/31 01:15:33  oes
-# Fixed a typo; updated copyright notice
-#
-# Revision 1.104.2.24  2003/12/03 10:30:02  oes
-# - Added new dependency: actions.c -> ssplit.h
-# - Excluded PDF docs from src tarball
-#
-# Revision 1.104.2.23  2003/04/20 17:28:52  hal9
-# Strip trailing spaces from config-file generation, bug #724596.
-#
-# Revision 1.104.2.22  2003/03/28 03:32:01  hal9
-# Minor changes for Privoxy home page:
-#  - Handle © more sanely
-#  - include link to announce.txt
-# Also, disable 'make announce' target.
-#
-# Revision 1.104.2.21  2002/11/04 07:04:03  hal9
-# Catch up with main trunk install/uninstall. Quiet output, etc.
-#
-# Revision 1.104.2.20  2002/10/25 02:44:22  hal9
-# Port of make install, etc from main trunk. Needs testing! Add Slackware
-# support, and other related changes. Update related docs.
-#
-# Revision 1.104.2.19  2002/09/26 22:50:02  hal9
-# New user-manual examples in config-file are getting wrapped. Add warning.
-#
-# Revision 1.104.2.18  2002/08/23 12:22:40  oes
-# Added warning to broken install target
-#
-# Revision 1.104.2.17  2002/08/16 03:19:34  hal9
-# More (minor) cleanup of html before pdf processing to make some relative
-# links work as pdf -> pdf. Upload pdf as zip archive now.
-#
-# Revision 1.104.2.16  2002/08/14 16:43:27  hal9
-# Added pdf docs to make webserver target.
-#
-# Revision 1.104.2.15  2002/08/11 20:02:41  hal9
-# New targets for man page (make man) and pdf (make dok-pdf) targets.
-#
-# Revision 1.104.2.14  2002/08/10 11:19:37  oes
-# - Make -Ipcre (again) conditional on STATIC_PCRE
-# - $(RPMBUILD) -> $(RPM) for SuSE
-# - Add dependency: pcrs.o deps on config.h
-#
-# Revision 1.104.2.13  2002/08/07 15:13:54  hal9
-# Remove pdf2 target, and make it dok-shtml (single page html for pdf
-# conversion).
-#
-# Revision 1.104.2.12  2002/08/06 11:29:36  oes
-# Fixed detection/inclusion of pcre.h, which is in a pcre subdir on RH
-#
-# Revision 1.104.2.11  2002/07/30 19:38:11  hal9
-# Add redhat-test target for testing purposes only. Fix RPM_PACKAGEV to what
-# *I think* it was supposed to be (was breaking upload targets since it was
-# set to RPM_VERSION).
-#
-# Revision 1.104.2.10  2002/07/27 22:56:53  kick_
-# cleanups of the redhat-srpm target
-#
-# Revision 1.104.2.9  2002/07/26 15:17:02  oes
-# - Added generation of default.action from defaul.action.master
-# - Deleted obsolete re_filterfile.txt generation
-#
-# Revision 1.104.2.8  2002/07/12 10:04:32  kick_
-# added helper targets to the makefile. They shouldn't break anything, but
-# make my life a lot easier.
-#
-# The new rpm has been splitted into two parts, one for package installation/
-# removal, one for package building.
-# Therefore rpm -ta isn't a valid command anymore and needs to be replaced
-# by rpmbuild -ta  (this is backwards compatible)
-#
-# Revision 1.104.2.7  2002/06/07 00:23:47  hal9
-# Fixing a quirk of man2html (on my system) that pulls punctuation into URLs,
-# thus breaking them completely.
-#
-# Revision 1.104.2.6  2002/06/02 03:26:25  hal9
-# Update CONFIG_FILES (ie update basic.action, etc), and also DOC_FILES (exclude
-# index.html and team/index.html)
-#
-# Revision 1.104.2.5  2002/05/30 15:35:01  hal9
-# This is more cleanup on the make config-file target. Most issues for
-# automatic generation are taken care of. There are still some problems
-# that require hand editing. Namely, some of the examples that are > 80 chars.
-#
-# Revision 1.104.2.4  2002/05/29 02:12:17  hal9
-# Ooops...forgot about perl -pi cygwin problem. Add -pi.bak. Also, the
-# new target is 'make config-file', _not_ make config.
-#
-# Revision 1.104.2.3  2002/05/29 02:05:48  hal9
-# 'make config' target added (WIP) for future generation of config file from
-# text in u-m so the two are in sync. New generated config, which requires
-# some hand editing for the time being.
-#
-# Revision 1.104.2.2  2002/05/28 02:32:55  hal9
-# New target 'make dok-index' for privoxy-index.html. Also, fixed *.bak files
-# not being cleaned up in doc/webserver.
-#
-# Revision 1.104.2.1  2002/05/26 17:19:34  hal9
-# Remove Table of Contents from readme with oes's dsl trick.
-#
-# Revision 1.104  2002/05/24 00:03:49  oes
-# Use p_doc.css for the Homepage for consistency
-#
-# Revision 1.103  2002/05/23 23:19:00  oes
-# Use dsl without TOC for the homepage
-#
-# Revision 1.102  2002/05/16 01:20:17  hal9
-# make announce target added.
-#
-# Revision 1.101  2002/05/15 12:28:46  oes
-# Trying to keep Hal happy :)
-#
-# Revision 1.100  2002/05/08 13:48:18  hal9
-# Ooops, that trashed JB v2.0.2 comment. Fixed.
-#
-# Revision 1.99  2002/05/08 13:42:07  hal9
-# This fixes the numbering problem on index.html in contact info section (.1.). Using
-# perl, since its way too convoluted to try to fix proper with docbook.
-#
-# Revision 1.98  2002/05/03 14:33:06  oes
-# Replaced ldp(OK).dsl handling with generation via autoconf; handle all file exeptions to src tarball via find
-#
-# Revision 1.97  2002/04/27 20:27:43  swa
-# no longer needed due to new
-# PACKAGE_VERSION process
-#
-# Revision 1.96  2002/04/27 17:44:32  morcego
-# - Correcting typo in my name (Rodrigo, not Rodgrigo) :-)
-# - Using the RM macro everywhere rm is called (either we use, or don't)
-# - Same for RPM
-#
-# Revision 1.95  2002/04/27 15:37:25  swa
-# replacing directory in document creation process
-# no longer necessary.
-#
-# Revision 1.94  2002/04/27 08:23:29  swa
-# pdf process reviewed and cleaned up
-#
-# Revision 1.93  2002/04/27 04:55:53  morcego
-# privoxy-cl.spec now gets removed by clobber target
-#
-# Revision 1.92  2002/04/27 04:53:40  morcego
-# Adding --exclude "PACKAGERS" to every tar command that applies (not for
-#   webserver target)
-#
-# Revision 1.91  2002/04/27 04:44:51  morcego
-# GNUmakefile.in: The tarball created on redhat-dist and suse-dist now ignore
-#   the PACKAGERS file, as well privoxy-cl.spec (in case it was created)
-# GNUmakefile.in: New targets -> conectiva-spec, conectiva-dist and
-#   conectiva-upload
-# genclspec.sh  : New file to generate, from privoxy-rh.spec, a specfile
-#   for Conectiva Linux
-#
-# Revision 1.90  2002/04/26 17:46:53  swa
-# be consistent
-#
-# Revision 1.89  2002/04/26 17:20:54  swa
-# just produce single html files to proces them later with Destiller or somesuch. looks prettier.
-#
-# Revision 1.88  2002/04/25 19:13:57  morcego
-# Removed RPM release number declaration on configure.in
-# Changed makefile to use given value for RPM_PACKAGEV when on uploading
-# targets (will produce an error, explaining who to do it, if no value
-# if provided).
-#
-# Revision 1.87  2002/04/23 14:10:59  swa
-# now create pdf documents
-#
-# Revision 1.86  2002/04/15 04:30:27  hal9
-# Missed two -pi.bak's on perl/cygwin problem.
-#
-# Revision 1.85  2002/04/14 01:05:34  hal9
-# Revert dok-webserver change for SF logo.
-#
-# Revision 1.84  2002/04/13 22:43:25  hal9
-# -Fix dok-webserver for SF logo (more perl).
-# -Change all perl -pi to perl -pi.bak for Cygwin problem.
-#
-# Revision 1.83  2002/04/12 09:39:25  oes
-# Excluding yet more files from tarball; making dist warning yet more scary
-#
-# Revision 1.82  2002/04/11 21:07:11  oes
-# Excluding more files from tarball build
-#
-# Revision 1.81  2002/04/11 14:40:27  oes
-# Fixed typo -- Thanks, Moritz!
-#
-# Revision 1.80  2002/04/11 12:50:00  oes
-# Fixed tarball-dist target
-#
-# Revision 1.79  2002/04/11 06:49:28  oes
-# webserver target: silenced timestamp warnings resulting from uploading westwards, made permissions fixing independant of screwed local dir permissions, suppress (false alarm) make error if not owner of feedback log
-#
-# Revision 1.78  2002/04/09 13:37:11  sarantis
-# fix tar options typo
-#
-# Revision 1.77  2002/04/09 13:28:53  swa
-# build suse and gen-dist with html docs
-#
-# Revision 1.76  2002/04/08 22:43:41  oes
-# Fix: Include dotfiles in fixing webserver permissions
-#
-# Revision 1.75  2002/04/08 22:14:59  oes
-# Silencing tar warnings in the web* targets
-#
-# Revision 1.74  2002/04/08 15:22:44  hal9
-# This has finishing touches for dok building. Should be ready to go.
-# -The main doc build is now 'make dok', should work on Redhat too.
-# -Removed man page from main doc build. It is built separately due to
-#  perl scripts that most aren't likely to have.
-#
-# Revision 1.73  2002/04/08 14:03:24  oes
-# oes for al: Fix install target
-#
-# Revision 1.72  2002/04/08 13:42:11  oes
-# Added safety check to *-dist targets; fixed permissions for feedback logfile
-#
-# Revision 1.71  2002/04/07 20:32:03  hal9
-# -Add meta data kludge for make dok-webserver via $(PERL).
-# -Add subdirs for 'make dok-release'.
-#
-# Revision 1.70  2002/04/07 08:59:40  swa
-# generated files. do NOT edit.
-# fixed directory bug in makefile.
-#
-# Revision 1.69  2002/04/07 08:10:47  swa
-# create some of the webserver docs
-# automatically (in particular if
-# those docs recycle other documentation
-# fragments). Now committed webserver's
-# index file.
-#
-# Revision 1.68  2002/04/07 07:58:11  swa
-# create some of the webserver docs
-# automatically (in particular if
-# those docs recycle other documentation
-# fragments)
-#
-# Revision 1.67  2002/04/07 05:31:42  hal9
-# Add 'dok-release' target:
-# -Set doc entities to VERSION and CODE_STATUS during make.
-# -Set doc conditional content flags (stable vs non-stable).
-# A separate target for the time being but needs to be incorporated into
-# dok build at some point.
-# -Filter out a spurious ^G from new man page > html converion in man2html.
-#
-# Revision 1.66  2002/04/06 20:28:21  jongfoster
-# Prettifying groff2html.
-# Using GNU Make's conditional makefile feature rather than shell "if"s.
-# (The shell "if"s were hiding errors)
-# "perl" -> "$(PERL)"
-# Spaces->tabs in a couple of places.
-#
-# Revision 1.65  2002/04/06 05:16:39  hal9
-# -Add 'authors' and 'man' targets for AUTHORS and man-page (WIP).
-# -Both of these will soon be generated files.
-#
-# Revision 1.64  2002/04/04 22:14:51  oes
-# No longer rely on find honoring -iname
-#
-# Revision 1.63  2002/04/04 21:06:22  swa
-# cosmetics.
-#
-# Revision 1.62  2002/04/04 20:49:50  swa
-# attempt to consolidate the
-# different dokbook versions.
-#
-# Revision 1.61  2002/04/04 19:18:21  swa
-# readme was leftover directory. use w3m instead
-# of lynx to be consistent among developers. use
-# consistent target naming.
-#
-# Revision 1.60  2002/04/04 12:25:41  oes
-# Tidy webserver upload w/o *~ files, CVS dirs and logfiles and with proper dir and file permissions
-#
-# Revision 1.59  2002/04/04 08:32:45  swa
-# wrong name for tarball-dist target. further fixed content of tarball dist
-#
-# Revision 1.58  2002/04/04 06:32:58  hal9
-# New dok targets for make readme.
-#
-# Revision 1.57  2002/04/04 00:36:36  gliptak
-# always use pcre for matching
-#
-# Revision 1.56  2002/04/03 22:28:03  gliptak
-# Removed references to gnu_regex
-#
-# Revision 1.55  2002/04/03 19:54:29  swa
-# freebsd tested to work. attempt to move tarball dist target forward
-#
-# Revision 1.54  2002/04/03 14:54:07  oes
-# Standard clean and clobber semantics II
-#
-# Revision 1.53  2002/04/03 14:19:16  oes
-# Standard clean and clobber semantics
-#
-# Revision 1.52  2002/04/03 02:56:18  hal9
-# Revert previous FAQ numbering kludge.
-#
-# Revision 1.51  2002/04/02 13:03:56  oes
-# Added fix for webserver permissions
-#
-# Revision 1.50  2002/04/02 03:46:24  hal9
-# Rewrite ldpOK.dsl so that sections are NOT numbered on FAQ, in an effort
-# to make the Table of Contents not so 'busy' looking. SuSE needs testing :)
-#
-# Revision 1.49  2002/03/30 22:20:12  swa
-# cd didn't work. neither did find.
-#
-# Revision 1.48  2002/03/30 19:04:06  swa
-# people release differently. no good.
-# I want to make parts of the docs only.
-#
-# Revision 1.47  2002/03/30 09:05:21  swa
-# better packaging. better rpm building.
-# tar failed on sun (no exclude there).
-#
-# Revision 1.46  2002/03/29 20:09:01  swa
-# al's patch
-#
-# Revision 1.45  2002/03/29 19:45:45  swa
-# for lazy swa
-#
-# Revision 1.44  2002/03/29 17:42:44  gliptak
-# Correcting for Solaris tar limitations
-#
-# Revision 1.43  2002/03/29 07:40:03  swa
-# fixed make webserver. doh
-#
-# Revision 1.42  2002/03/29 06:59:04  swa
-# other users could not modify files on webserver
-#
-# Revision 1.41  2002/03/28 20:43:00  swa
-# set make correctly
-#
-# Revision 1.40  2002/03/28 04:22:44  hal9
-# More on man2html stuff.
-#
-# Revision 1.39  2002/03/28 01:04:14  hal9
-# More man2html stuff for docs.
-#
-# Revision 1.38  2002/03/27 16:02:30  swa
-# have a generic target
-#
-# Revision 1.37  2002/03/27 15:30:26  swa
-# have a consistent appearance
-#
-# Revision 1.36  2002/03/27 14:58:08  swa
-# can be used by mutilple targets
-#
-# Revision 1.35  2002/03/27 14:53:19  swa
-# added solaris-dist
-#
-# Revision 1.34  2002/03/27 10:30:11  swa
-# we want a html man file on the webserver
-#
-# Revision 1.33  2002/03/27 03:05:35  hal9
-# Added man2html target for docs (redhat-dok only for now)
-#
-# Revision 1.32  2002/03/26 22:29:54  swa
-# we have a new homepage!
-#
-# Revision 1.31  2002/03/26 14:00:18  swa
-# fixed make tarball, tarball-dist, tarball-clean
-#
-# Revision 1.30  2002/03/25 12:52:25  swa
-# new targets
-#
-# Revision 1.29  2002/03/24 17:03:55  jongfoster
-# Name change
-#
-# Revision 1.28  2002/03/24 16:19:48  swa
-# configure needs to be generated.
-#
-# Revision 1.27  2002/03/24 16:13:57  swa
-# generated files are a nono in cvs
-#
-# Revision 1.26  2002/03/24 15:36:02  swa
-# did not build.
-#
-# Revision 1.25  2002/03/24 14:31:08  swa
-# remove more crappy files. set RPM
-# release version correctly.
-#
-# Revision 1.24  2002/03/24 14:19:55  swa
-# set rpm package release in configure.in. nowhere else.
-#
-# Revision 1.23  2002/03/24 13:06:49  swa
-# suse-clean now runs fine
-#
-# Revision 1.22  2002/03/24 12:56:21  swa
-# name change related issues.
-#
-# Revision 1.21  2002/03/24 12:43:57  swa
-# name change
-#
-# Revision 1.20  2002/03/24 11:39:17  jongfoster
-# Renaming config files
-#
-# Revision 1.19  2002/03/22 20:53:03  morcego
-# - Ongoing process to change name to JunkbusterNG
-# - configure/configure.in: no change needed
-# - GNUmakefile.in:
-#         - TAR_ARCH = /tmp/JunkbusterNG-$(RPM_VERSION).tar.gz
-#         - PROGRAM    = jbng at EXEEXT@
-#         - rh-spec now references as junkbusterng-rh.spec
-#         - redhat-upload: references changed to junkbusterng-* (package names)
-#         - tarball-dist: references changed to JunkbusterNG-distribution-*
-#         - tarball-src: now JunkbusterNG-*
-#         - install: initscript now junkbusterng.init and junkbusterng (when
-#                    installed)
-# - junkbuster-rh.spec: renamed to junkbusterng-rh.spec
-# - junkbusterng.spec:
-#         - References to the expression ijb where changed where possible
-#         - New package name: junkbusterng (all in lower case, acording to
-#           the LSB recomendation)
-#         - Version changed to: 2.9.13
-#         - Release: 1
-#         - Added: junkbuster to obsoletes and conflicts (Not sure this is
-#           right. If it obsoletes, why conflict ? Have to check it later)
-#         - Summary changed: Stefan, please check and aprove it
-#         - Changes description to use the new name
-#         - Sed string was NOT changed. Have to wait to the manpage to
-#           change first
-#         - Keeping the user junkbuster for now. It will require some aditional
-#           changes on the script (scheduled for the next specfile release)
-#         - Added post entry to move the old logfile to the new log directory
-#         - Removing "chkconfig --add" entry (not good to have it automaticaly
-#           added to the startup list).
-#         - Added preun section to stop the service with the old name, as well
-#           as remove it from the startup list
-#         - Removed the chkconfig --del entry from the conditional block on
-#           the preun scriptlet (now handled on the %files section)
-# - junkbuster.init: renamed to junkbusterng.init
-# - junkbusterng.init:
-#         - Changed JB_BIN to jbng
-#         - Created JB_OBIN with the old value of JB_BIN (junkbuster), to
-#           be used where necessary (config dir)
-#
-# Aditional notes:
-# - The config directory is /etc/junkbuster yet. Have to change it on the
-# specfile, after it is changes on the code
-# - The only files that got renamed on the cvs tree were the rh specfile and
-# the init file. Some file references got changes on the makefile and on the
-# rh-spec (as listed above)
-#
-# Revision 1.18  2002/03/21 23:00:00  swa
-# want to autogenerate stuff.
-#
-# Revision 1.17  2002/03/19 19:30:04  morcego
-# - Fixing stylesheet checking on configure. If it is found, no further checks
-#   should be done
-#
-# - configure will now check for db2html or docbook2html (should work now
-#   on SuSe without the docbktls package)
-#
-# Revision 1.16  2002/03/14 22:32:32  hal9
-# Bumped the RPM version.
-#
-# Revision 1.15  2002/03/08 20:00:28  swa
-# some leftovers.
-#
-# Revision 1.14  2002/03/07 18:25:56  swa
-# synced redhat and suse build process
-#
-# Revision 1.13  2002/03/07 17:17:56  oes
-# (Hopefully) fixed for older make versions
-#
-# Revision 1.12  2002/03/07 15:28:27  swa
-# more informative
-#
-# Revision 1.11  2002/03/06 14:33:18  sarantis
-# Use proper temp file, not "abc".
-#
-# Revision 1.10  2002/03/06 14:19:35  sarantis
-# Cleanup PID_FILE_PATH from redhat-dist target
-#
-# Revision 1.9  2002/03/05 17:31:11  morcego
-# Search for docbook.dsl. Should solve portability problems for SuSe.
-#
-# Revision 1.8  2002/03/05 14:07:42  morcego
-# configure now detects rpm topdir, and change GNUmakefile acordingly
-#    (based on sugestion by Sarantis Paskalis)
-#
-# Revision 1.7  2002/03/05 13:43:28  morcego
-# Checking for text browser, so redhat-dok can work.
-#
-# Revision 1.6  2002/03/05 13:10:51  morcego
-# Changes to implement redhat-dok (Hal Burgiss)
-# Changes to make it work on other distros and out-of-the-shelf configurations
-#
-# Revision 1.5  2002/02/27 15:30:39  hal9
-# Reset $(RPM_PACKAGEV) to 1 (was 2)
-#
-# Revision 1.4  2002/01/17 21:44:04  jongfoster
-# Adding urlmatch.[ch]
-#
-# Revision 1.3  2002/01/04 15:26:08  oes
-# Added tarball-src target
-#
-# Revision 1.2  2001/12/30 14:07:31  steudten
-# - Add signal handling (unix)
-# - Add SIGHUP handler (unix)
-# - Add creation of pidfile (unix)
-# - Add action 'top' in rc file (RH)
-# - Add entry 'SIGNALS' to manpage
-# - Add exit message to logfile (unix)
-#
-# Revision 1.1  2001/12/01 11:22:57  jongfoster
-# Renaming Makefile.in to GNUmakefile.in so that non-GNU versions of
-# make break in a more obvious way.
-# Adding .PHONY section.
-#
-# Revision 1.40  2001/12/01 00:24:11  jongfoster
-# Renaming various config files
-# Fixing CR->CRLF under Win32 (I hope)
-#
-# Revision 1.39  2001/11/06 12:07:30  steudten
-# Add --clean for building rpm in target redhat-dist.
-#
-# Revision 1.38  2001/11/05 21:35:23  steudten
-# Complete rewrite for the 'redhat-dist' target.
-# Checks for writeable RPM build directories for calling user.
-# So you must not be root, just set the modes to 1777 to
-# build a RH package.
-# Fix the upload-target to be arch independant.
-# Add target for 'solaris-dist' - coming soon.
-#
-# Revision 1.37  2001/11/01 00:52:04  hal9
-# Redhat-upload stuff per Stefan.
-#
-# Revision 1.36  2001/10/31 19:26:13  swa
-# automate process of uploading new releases
-# to sf.
-#
-# Revision 1.35  2001/10/15 22:14:59  joergs
-# Removed -O2 and -Wall from AmigaOS-only CFLAGS since they are now in
-#  the general CFLAGS already.
-#
-# Revision 1.34  2001/10/15 18:28:06  steudten
-# remove config.cache for target clobber.
-# Cleanup make dist for RH and S.u.S.E.
-#
-# Revision 1.33  2001/10/10 12:43:33  oes
-# Added ugly hack to make install target work at least for some setups.
-#
-# Revision 1.32  2001/10/09 22:38:19  jongfoster
-# Correcting actionsfile filename for Win32 INI build
-#
-# Revision 1.31  2001/09/23 10:13:48  swa
-# upload process established. run make webserver and
-# the documentation is moved to the webserver. documents
-# are now linked correctly.
-#
-# Revision 1.30  2001/09/19 17:55:49  oes
-# Fixed CFLAGS
-#
-# Revision 1.29  2001/09/16 17:34:27  jongfoster
-# Removing showargs.[ch], adding cgi(simple|edit).[ch]
-# Replacing $(OBJEXT) with @OBJEXT@ - this seems to be a common source
-# of build problems.
-#
-# Revision 1.28  2001/09/13 15:19:08  swa
-# we want text files as well.
-#
-# Revision 1.27  2001/09/13 13:11:37  steudten
-#
-# Replace DEBUG_CFLAGS with OTHER_CFLAGS
-#
-# Revision 1.26  2001/09/12 23:44:54  david__schmidt
-# Mac OSX (Darwin) support added.
-#
-# Revision 1.25  2001/09/12 22:55:45  joergs
-# AmigaOS support added.
-#
-# Revision 1.24  2001/09/12 17:28:59  david__schmidt
-#
-# OS/2 port: update autoconf'd support for the platform.
-#
-# Revision 1.23  2001/09/12 16:28:42  swa
-# added "make dok" section to generate html pages from
-# the sgml source documents. note that the we do not want
-# generated stuff in cvs.
-#
-# Revision 1.22  2001/09/10 16:31:23  swa
-# buildroot definition in the specfile fucks up the build
-# process under suse. hence I moved it to the "rpm -ta"
-# command
-#
-# Revision 1.21  2001/09/10 11:12:49  oes
-# Turning on -Wall
-#
-# Revision 1.20  2001/08/02 22:04:29  jongfoster
-# Removing some remaining references to obsolete w32rulesdlg.[ch]
-#
-# Revision 1.19  2001/07/30 22:14:03  jongfoster
-# Removing obsolete w32rulesdlg.c and w32rulesdlg.h
-#
-# Revision 1.18  2001/07/29 17:09:17  jongfoster
-# Major changes to build system in order to fix these bugs:
-# - pthreads under Linux was broken - changed -lpthread to -pthread
-# - Compiling in MinGW32 mode under CygWin now correctly detects
-#   which shared libraries are available
-# - Solaris support (?) (Not tested under Solaris yet)
-#
-# Revision 1.17  2001/07/28 16:44:54  oes
-# Fixed sed LF->CRLF conversion and removed deprecated files
-#
-# Revision 1.16  2001/07/15 19:45:33  jongfoster
-# Added support for linking with POSIX threads library
-#
-# Revision 1.15  2001/07/13 13:48:07  oes
-#  - Moved STATIC #define for pcre to (ac)config.h
-#  - Made -Ipcre depandant on static pcre compilation to
-#    avoid version conflicts
-#  - Included compilation and depandancies for new deanimate.c
-#  - Made changes to the pcre/pcreposix/pcrs build process
-#    as required by the new library autodetection in
-#    configure.in
-#
-# Revision 1.14  2001/07/01 16:27:44  oes
-# Fixed misplaced dependancy
-#
-# Revision 1.13  2001/06/29 13:18:36  oes
-# - added depandancy of filters.o on cgi.h
-#
-# Revision 1.12  2001/06/12 17:15:56  swa
-# fixes, because a clean build on rh6.1 was impossible.
-# GZIP confuses make, %configure confuses rpm, etc.
-#
-# Revision 1.11  2001/06/11 11:26:35  sarantis
-# RPM version should be the same as ijbswa version.  The rpm release is
-# specified in the specfile.
-#
-# Revision 1.10  2001/06/07 17:27:45  swa
-# added suse build section
-#
-# Revision 1.9  2001/06/04 18:31:58  swa
-# files are now prefixed with either `confdir' or `logdir'.
-# `make redhat-dist' replaces both entries confdir and logdir
-# with redhat values
-#
-# Revision 1.8  2001/06/04 10:44:57  swa
-# `make redhatr-dist' now works. Except for the paths
-# in the config file.
-#
-# Revision 1.7  2001/06/03 17:09:09  swa
-# swa for oes: reversed my earlier change
-#
-# Revision 1.6  2001/06/03 17:07:27  swa
-# swa for oes
-#
-# Revision 1.5  2001/06/03 13:57:26  swa
-# compile cgi.c (for andreas' GUI)
-#
-# Revision 1.4  2001/05/31 21:18:45  jongfoster
-# Added files actions.[ch], actionlist.h, list.[ch] to Makefile
-#
-# Revision 1.3  2001/05/29 20:02:48  joergs
-# Changes for AmigaOS added.
-#
-# Revision 1.2  2001/05/17 22:23:23  oes
-#  - Added auto-generation of CRLFs for Win32 config files
-#  - Added comment-prefix to all Win32-only options in the config file
-#    and provided auto stripping of this prefix for the Win32 platform by make
-#
-# Revision 1.1.1.1  2001/05/15 13:59:00  oes
-# Initial import of version 2.9.3 source tree
-#
-#
diff --git a/external/privoxy/INSTALL b/external/privoxy/INSTALL
deleted file mode 100644
index f17eadb..0000000
--- a/external/privoxy/INSTALL
+++ /dev/null
@@ -1,173 +0,0 @@
-/*********************************************************************
- *
- * File        :  $Source: /cvsroot/ijbswa/current/INSTALL,v $
- *
- * Purpose     :  INSTALL file to help with installing from source.
- *
- * Copyright   :  Written by and Copyright (C) 2001-2009 the
- *                Privoxy team. http://www.privoxy.org/
- *
- *                Based on the Internet Junkbuster originally written
- *                by and Copyright (C) 1997 Anonymous Coders and 
- *                Junkbusters Corporation.  http://www.junkbusters.com
- *
- *                This program is free software; you can redistribute it 
- *                and/or modify it under the terms of the GNU General
- *                Public License as published by the Free Software
- *                Foundation; either version 2 of the License, or (at
- *                your option) any later version.
- *
- *                This program is distributed in the hope that it will
- *                be useful, but WITHOUT ANY WARRANTY; without even the
- *                implied warranty of MERCHANTABILITY or FITNESS FOR A
- *                PARTICULAR PURPOSE.  See the GNU General Public
- *                License for more details.
- *
- *                The GNU General Public License should be included with
- *                this file.  If not, you can view it at
- *                http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
- *                or write to the Free Software Foundation, Inc., 
- *                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
- *                USA
- *
- *********************************************************************/
-   
-
--------------------------------------------------------------------------------
-
-To build Privoxy from source, autoconf, GNU make (gmake), and, of course, a C
-compiler like gcc are required.
-
-When building from a source tarball, first unpack the source:
-
- tar xzvf privoxy-3.0.12-stable-src.tar.gz
- cd privoxy-3.0.12-stable
-
-
-For retrieving the current CVS sources, you'll need a CVS client installed.
-Note that sources from CVS are typically development quality, and may not be
-stable, or well tested. To download CVS source, check the Sourceforge
-documentation, which might give commands like:
-
-  cvs -d:pserver:anonymous at ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa login
-  cvs -z3 -d:pserver:anonymous at ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co current
-  cd current
-
-
-This will create a directory named current/, which will contain the source
-tree.
-
-You can also check out any Privoxy "branch", just exchange the current name
-with the wanted branch name (Example: v_3_0_branch for the 3.0 cvs tree).
-
-It is also strongly recommended to not run Privoxy as root. You should
-configure/install/run Privoxy as an unprivileged user, preferably by creating a
-"privoxy" user and group just for this purpose. See your local documentation
-for the correct command line to do add new users and groups (something like
-adduser, but the command syntax may vary from platform to platform).
-
-/etc/passwd might then look like:
-
-  privoxy:*:7777:7777:privoxy proxy:/no/home:/no/shell
-
-
-And then /etc/group, like:
-
-  privoxy:*:7777:
-
-
-Some binary packages may do this for you.
-
-Then, to build from either unpacked tarball or CVS source:
-
- autoheader
- autoconf
- ./configure      # (--help to see options)
- make             # (the make from GNU, sometimes called gmake)
- su               # Possibly required
- make -n install  # (to see where all the files will go)
- make -s install  # (to really install, -s to silence output)
-
-
-Using GNU make, you can have the first four steps automatically done for you by
-just typing:
-
-  make
-
-
-in the freshly downloaded or unpacked source directory.
-
-To build an executable with security enhanced features so that users cannot
-easily bypass the proxy (e.g. "Go There Anyway"), or alter their own
-configurations, configure like this:
-
- ./configure  --disable-toggle  --disable-editor  --disable-force
-
-
-Then build as above. In Privoxy 3.0.7 and later, all of these options can also
-be disabled through the configuration file.
-
-WARNING: If installing as root, the install will fail unless a non-root user or
-group is specified, or a privoxy user and group already exist on the system. If
-a non-root user is specified, and no group, then the installation will try to
-also use a group of the same name as "user". If a group is specified (and no
-user), then the support files will be installed as writable by that group, and
-owned by the user running the installation.
-
-configure accepts --with-user and --with-group options for setting user and
-group ownership of the configuration files (which need to be writable by the
-daemon). The specified user must already exist. When starting Privoxy, it must
-be run as this same user to insure write access to configuration and log files!
-
-Alternately, you can specify user and group on the make command line, but be
-sure both already exist:
-
- make -s install  USER=privoxy GROUP=privoxy
-
-
-The default installation path for make install is /usr/local. This may of
-course be customized with the various ./configure path options. If you are
-doing an install to anywhere besides /usr/local, be sure to set the appropriate
-paths with the correct configure options (./configure --help). Non-privileged
-users must of course have write access permissions to wherever the target
-installation is going.
-
-If you do install to /usr/local, the install will use sysconfdir=$prefix/etc/
-privoxy by default. All other destinations, and the direct usage of
---sysconfdir flag behave like normal, i.e. will not add the extra privoxy
-directory. This is for a safer install, as there may already exist another
-program that uses a file with the "config" name, and thus makes /usr/local/etc
-cleaner.
-
-If installing to /usr/local, the documentation will go by default to $prefix/
-share/doc. But if this directory doesn't exist, it will then try $prefix/doc
-and install there before creating a new $prefix/share/doc just for Privoxy.
-
-Again, if the installs goes to /usr/local, the localstatedir (ie: var/) will
-default to /var instead of $prefix/var so the logs will go to /var/log/privoxy
-/, and the pid file will be created in /var/run/privoxy.pid.
-
-make install will attempt to set the correct values in config (main
-configuration file). You should check this to make sure all values are correct.
-If appropriate, an init script will be installed, but it is up to the user to
-determine how and where to start Privoxy. The init script should be checked for
-correct paths and values, if anything other than a default install is done.
-
-If install finds previous versions of local configuration files, most of these
-will not be overwritten, and the new ones will be installed with a "new"
-extension. default.action and default.filter will be overwritten. You will then
-need to manually update the other installed configuration files as needed. The
-default template files will be overwritten. If you have customized, local
-templates, these should be stored safely in a separate directory and defined in
-config by the "templdir" directive. It is of course wise to always back-up any
-important configuration files "just in case". If a previous version of Privoxy
-is already running, you will have to restart it manually.
-
-For more detailed instructions on how to build Redhat RPMs, Windows
-self-extracting installers, building on platforms with special requirements
-etc, please consult the developer manual.
-
-The simplest command line to start Privoxy is $path/privoxy --user=privoxy
-$path/etc/privoxy/config. See privoxy --usage, or the man page, for other
-options, and configuration.
-
diff --git a/external/privoxy/LICENSE b/external/privoxy/LICENSE
deleted file mode 100644
index d511905..0000000
--- a/external/privoxy/LICENSE
+++ /dev/null
@@ -1,339 +0,0 @@
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-			    NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License along
-    with this program; if not, write to the Free Software Foundation, Inc.,
-    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/external/privoxy/Makefile b/external/privoxy/Makefile
deleted file mode 100644
index ed6d7ac..0000000
--- a/external/privoxy/Makefile
+++ /dev/null
@@ -1,108 +0,0 @@
-# $Id: Makefile,v 1.11 2006/07/18 14:48:45 david__schmidt Exp $
-#
-# Written by and Copyright (C) 2001 the SourceForge
-# Privoxy team. http://www.privoxy.org/
-#
-# Based on the Internet Junkbuster originally written
-# by and Copyright (C) 1997 Anonymous Coders and 
-# Junkbusters Corporation.  http://www.junkbusters.com
-#
-# This program is free software; you can redistribute it 
-# and/or modify it under the terms of the GNU General
-# Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at
-# your option) any later version.
-#
-# This program is distributed in the hope that it will
-# be useful, but WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.  See the GNU General Public
-# License for more details.
-#
-# The GNU General Public License should be included with
-# this file.  If not, you can view it at
-# http://www.gnu.org/copyleft/gpl.html
-# or write to the Free Software Foundation, Inc., 59
-# Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-#
-# $Log: Makefile,v $
-# Revision 1.11  2006/07/18 14:48:45  david__schmidt
-# Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
-# with what was really the latest development (the v_3_0_branch branch)
-#
-# Revision 1.5.2.2  2002/10/25 02:44:23  hal9
-# Port of make install, etc from main trunk. Needs testing! Add Slackware
-# support, and other related changes. Update related docs.
-#
-# Revision 1.5.2.1  2002/08/05 17:46:13  oes
-# Change make to gmake to fix auto-build on Solaris
-#
-# Revision 1.5  2002/04/11 12:51:34  oes
-# Bugfix
-#
-# Revision 1.4  2002/04/09 16:38:10  oes
-# Added option to run the whole build process
-#
-# Revision 1.3  2002/03/26 22:29:54  swa
-# we have a new homepage!
-#
-# Revision 1.2  2002/03/24 13:25:42  swa
-# name change related issues
-#
-# Revision 1.1  2001/12/01 11:24:29  jongfoster
-# Will display a warning if non-GNU make is used
-#
-#
-
-#############################################################################
-
-GNU_MAKE_CMD = gmake
-MAKE_CMD     = make
-
-error:
-	@if [ -f GNUmakefile ]; then \
-	    echo "***"; \
-	    echo "*** You are not using the GNU version of Make - maybe it's called gmake"; \
-	    echo "*** or it's in a different PATH? Please read INSTALL." ; \
-	    echo "***"; \
-	    exit 1; \
-	 elif test -n "$(HOST_ARCH)"  && test -z "$(MAKE_VERSION)" ; then \
-	    echo "***"; \
-	    echo "*** You are not using GNU Make on Solaris, please make sure you do" ; \
-	    echo "*** and re-run 'make' "; \
-	    echo "***"; \
-	    exit 1 ; \
-	 elif test -n "$(MACHINE_ARCH)"  && test -z "$(MAKE_VERSION)" ; then \
-	    echo "***"; \
-	    echo "*** You are not using GNU Make on FreeBSD, please make sure you do" ; \
-	    echo "*** and re-run 'make' "; \
-	    echo "***"; \
-	    exit 1 ; \
-	 else \
-	    echo "***"; \
-	    echo "*** To build this program, you must run"; \
-	    echo "*** autoheader && autoconf && ./configure and then run GNU make."; \
-	    echo "***"; \
-	    echo -n "*** Shall I do this for you now? (y/n) "; \
-	    read answer; \
-	    if [ "$$answer" = "y" ]; then \
-		autoheader && autoconf && ./configure || exit 1; \
-	  	if $(GNU_MAKE_CMD) -v |grep GNU >/dev/null 2>/dev/null; then \
-		   $(GNU_MAKE_CMD) ;\
-		elif $(MAKE_CMD) -v |grep GNU >/dev/null 2>/dev/null; then \
-		   $(MAKE_CMD) ;\
-		else \
-		   echo "Neither 'make' nor 'gmake' are GNU compatible!" ; \
-		   echo "Please read INSTALL." ; \
-		   exit 1 ; \
-		fi ;\
-	    fi; \
-	 fi
-
-.PHONY: error
-
-#############################################################################
-
-## Local Variables:
-## tab-width: 3
-## end:
diff --git a/external/privoxy/README b/external/privoxy/README
deleted file mode 100644
index a145e81..0000000
--- a/external/privoxy/README
+++ /dev/null
@@ -1,280 +0,0 @@
-/*********************************************************************
- *
- * File        :  $Source: /cvsroot/ijbswa/current/README,v $
- *
- * Purpose     :  README file to give a short intro.
- *
- * Copyright   :  Written by and Copyright (C) 2001-2009  the SourceForge
- *                Privoxy team. http://www.privoxy.org/
- *
- *                Based on the Internet Junkbuster originally written
- *                by and Copyright (C) 1997 Anonymous Coders and 
- *                Junkbusters Corporation.  http://www.junkbusters.com
- *
- *                This program is free software; you can redistribute it 
- *                and/or modify it under the terms of the GNU General
- *                Public License as published by the Free Software
- *                Foundation; either version 2 of the License, or (at
- *                your option) any later version.
- *
- *                This program is distributed in the hope that it will
- *                be useful, but WITHOUT ANY WARRANTY; without even the
- *                implied warranty of MERCHANTABILITY or FITNESS FOR A
- *                PARTICULAR PURPOSE.  See the GNU General Public
- *                License for more details.
- *
- *                The GNU General Public License should be included with
- *                this file.  If not, you can view it at
- *                http://www.gnu.org/copyleft/gpl.html
- *                or write to the Free Software Foundation, Inc., 
- *                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
- *                USA
- *
- *********************************************************************/
-
-This README is included with Privoxy 3.0.12. See http://www.privoxy.org/ for
-more information. The current code maturity level is "stable".
-
--------------------------------------------------------------------------------
-
-Privoxy is a non-caching web proxy with advanced filtering capabilities for
-enhancing privacy, modifying web page data and HTTP headers, controlling
-access, and removing ads and other obnoxious Internet junk. Privoxy has a
-flexible configuration and can be customized to suit individual needs and
-tastes. It has application for both stand-alone systems and multi-user
-networks.
-
-Privoxy is Free Software and licensed under the GPL2.
-
-Privoxy is an associated project of Software in the Public Interest (SPI).
-Donations are welcome.
-
--------------------------------------------------------------------------------
-
-1. IMPORTANT CHANGES
-
-March 2009, Privoxy 3.0.12 is released.
-
-This is primarily a bug fix release. See the "ChangeLog", and the "What's New"
-section and the "Upgrader's Notes" in the User Manual for details.
-
-February 2009, Privoxy 3.0.11 is released.
-
-As usual there are changes that effect the configuration. See the "ChangeLog",
-and the "What's New" section and the "Upgrader's Notes" in the User Manual for
-details and specifics.
-
-This is a stable release, and marks a departure for Privoxy development.
-
-Previously, odd numbered releases were considered beta versions and were only
-released at the end of the development cycle when the code was already believed
-to be stable. Usually it was, so the stable release contained pretty much the
-same code, but got a higher version number. In the future we intend to release
-several snapshots between stable releases. There will probably still be about
-two stable releases per year, but hopefully about six snapshots instead of the
-two betas we have now. The intentions is to make testing without CVS access
-easier.
-
--------------------------------------------------------------------------------
-
-2. INSTALL
-
-See the INSTALL file in this directory, for installing from raw source, and the
-User Manual, for all other installation types.
-
--------------------------------------------------------------------------------
-
-3. RUN
-
-privoxy [--help] [--version] [--no-daemon] [--pidfile PIDFILE] [--user USER
-[.GROUP]] [--chroot] [--pre-chroot-nslookup HOSTNAME ][config_file]
-
-See the man page or User Manual for an explanation of each option, and other
-configuration and usage issues.
-
-If no config_file is specified on the command line, Privoxy will look for a
-file named 'config' in the current directory (except Win32 which will look for
-'config.txt'). If no config_file is found, Privoxy will fail to start.
-
-Or for Red Hat and Fedora based distributions: /etc/rc.d/init.d/privoxy start
-
-Or Debian and Ubuntu: /etc/init.d/privoxy start
-
--------------------------------------------------------------------------------
-
-4. CONFIGURATION
-
-See: 'config', 'default.action', 'user.action', 'default.filter', and
-'user.filter'. 'user.action' and 'user.filter' are for personal and local
-configuration preferences. These are all well commented. Most of the magic is
-in '*.action' files. 'user.action' should be used for any actions
-customizations. On Unix-like systems, these files are typically installed in /
-etc/privoxy. On Windows, then wherever the executable itself is installed.
-There are many significant changes and advances from earlier versions. The User
-Manual has an explanation of all configuration options, and examples: http://
-www.privoxy.org/user-manual/.
-
-Be sure to set your browser(s) for HTTP/HTTPS Proxy at <IP>:<Port>, or whatever
-you specify in the config file under 'listen-address'. DEFAULT is
-localhost:8118. Note that Privoxy ONLY proxies HTTP (and HTTPS) traffic. Do not
-try it with FTP or other protocols for the simple reason it does not work.
-
-The actions list can be configured via the web interface accessed via http://
-p.p/, as well other options.
-
--------------------------------------------------------------------------------
-
-5. DOCUMENTATION
-
-There should be documentation in the 'doc' subdirectory. In particular, see the
-User Manual there, the FAQ, and those interested in Privoxy development, should
-look at developer-manual.
-
-The source and configuration files are all well commented. The main
-configuration files are: 'config', 'default.action', and 'default.filter'.
-
-Included documentation may vary according to platform and packager. All
-documentation is posted on http://www.privoxy.org, in case you don't have it,
-or can't find it.
-
--------------------------------------------------------------------------------
-
-6. CONTACTING THE DEVELOPERS, BUG REPORTING AND FEATURE REQUESTS
-
-We value your feedback. In fact, we rely on it to improve Privoxy and its
-configuration. However, please note the following hints, so we can provide you
-with the best support:
-
--------------------------------------------------------------------------------
-
-6.1. Get Support
-
-For casual users, our support forum at SourceForge is probably best suited:
-http://sourceforge.net/tracker/?group_id=11118&atid=211118
-
-All users are of course welcome to discuss their issues on the users mailing
-list, where the developers also hang around.
-
-Please don't sent private support requests to individual Privoxy developers,
-either use the mailing lists or the support trackers.
-
-Note that the Privoxy mailing lists are moderated. Posts from unsubscribed
-addresses have to be accepted manually by a moderator. This may cause a delay
-of several days and if you use a subject that doesn't clearly mention Privoxy
-or one of its features, your message may be accidentally discarded as spam.
-
-If you aren't subscribed, you should therefore spend a few seconds to come up
-with a proper subject. Additionally you should make it clear that you want to
-get CC'd. Otherwise some responses will be directed to the mailing list only,
-and you won't see them.
-
--------------------------------------------------------------------------------
-
-6.2. Reporting Problems
-
-"Problems" for our purposes, come in two forms:
-
-  * Configuration issues, such as ads that slip through, or sites that don't
-    function properly due to one Privoxy "action" or another being turned "on".
-
-  * "Bugs" in the programming code that makes up Privoxy, such as that might
-    cause a crash.
-
--------------------------------------------------------------------------------
-
-6.2.1. Reporting Ads or Other Configuration Problems
-
-Please send feedback on ads that slipped through, innocent images that were
-blocked, sites that don't work properly, and other configuration related
-problem of default.action file, to http://sourceforge.net/tracker/?group_id=
-11118&atid=460288, the Actions File Tracker.
-
-New, improved default.action files may occasionally be made available based on
-your feedback. These will be announced on the ijbswa-announce list and
-available from our the files section of our project page.
-
--------------------------------------------------------------------------------
-
-6.2.2. Reporting Bugs
-
-Please report all bugs through our bug tracker: http://sourceforge.net/tracker
-/?group_id=11118&atid=111118.
-
-Before doing so, please make sure that the bug has not already been submitted
-and observe the additional hints at the top of the submit form. If already
-submitted, please feel free to add any info to the original report that might
-help to solve the issue.
-
-Please try to verify that it is a Privoxy bug, and not a browser or site bug or
-documented behaviour that just happens to be different than what you expected.
-If unsure, try toggling off Privoxy, and see if the problem persists.
-
-If you are using your own custom configuration, please try the stock configs to
-see if the problem is configuration related. If you're having problems with a
-feature that is disabled by default, please ask around on the mailing list if
-others can reproduce the problem.
-
-If you aren't using the latest Privoxy version, the bug may have been found and
-fixed in the meantime. We would appreciate if you could take the time to
-upgrade to the latest version (or even the latest CVS snapshot) and verify that
-your bug still exists.
-
-Please be sure to provide the following information:
-
-  * The exact Privoxy version you are using (if you got the source from CVS,
-    please also provide the source code revisions as shown in http://
-    config.privoxy.org/show-version).
-
-  * The operating system and versions you run Privoxy on, (e.g. Windows XP
-    SP2), if you are using a Unix flavor, sending the output of "uname -a"
-    should do, in case of GNU/Linux, please also name the distribution.
-
-  * The name, platform, and version of the browser you were using (e.g.
-    Internet Explorer v5.5 for Mac).
-
-  * The URL where the problem occurred, or some way for us to duplicate the
-    problem (e.g. http://somesite.example.com/?somethingelse=123).
-
-  * Whether your version of Privoxy is one supplied by the Privoxy developers
-    via SourceForge, or if you got your copy somewhere else.
-
-  * Whether you are using Privoxy in tandem with another proxy such as Tor. If
-    so, please temporary disable the other proxy to see if the symptoms change.
-
-  * Whether you are using a personal firewall product. If so, does Privoxy work
-    without it?
-
-  * Any other pertinent information to help identify the problem such as config
-    or log file excerpts (yes, you should have log file entries for each action
-    taken).
-
-You don't have to tell us your actual name when filing a problem report, but
-please use a nickname so we can differentiate between your messages and the
-ones entered by other "anonymous" users that may respond to your request if
-they have the same problem or already found a solution.
-
-Please also check the status of your request a few days after submitting it, as
-we may request additional information. If you use a SF id, you should
-automatically get a mail when someone responds to your request.
-
-The appendix of the Privoxy User Manual also has helpful information on
-understanding actions, and action debugging.
-
--------------------------------------------------------------------------------
-
-6.3. Request New Features
-
-You are welcome to submit ideas on new features or other proposals for
-improvement through our feature request tracker at http://sourceforge.net/
-tracker/?atid=361118&group_id=11118.
-
--------------------------------------------------------------------------------
-
-6.4. Other
-
-For any other issues, feel free to use the mailing lists. Technically
-interested users and people who wish to contribute to the project are also
-welcome on the developers list! You can find an overview of all Privoxy-related
-mailing lists, including list archives, at: http://sourceforge.net/mail/?
-group_id=11118.
-
diff --git a/external/privoxy/acconfig.h b/external/privoxy/acconfig.h
deleted file mode 100644
index ea2792d..0000000
--- a/external/privoxy/acconfig.h
+++ /dev/null
@@ -1,495 +0,0 @@
-#ifndef CONFIG_H_INCLUDED
-#define CONFIG_H_INCLUDED
-/*********************************************************************
- *
- * File        :  $Source: /cvsroot/ijbswa/current/acconfig.h,v $
- *
- * Purpose     :  This file should be the first thing included in every
- *                .c file.  (Before even system headers).  It contains 
- *                #define statements for various features.  It was
- *                introduced because the compile command line started
- *                getting ludicrously long with feature defines.
- *
- * Copyright   :  Written by and Copyright (C) 2001 the SourceForge
- *                Privoxy team. http://www.privoxy.org/
- *
- *                Based on the Internet Junkbuster originally written
- *                by and Copyright (C) 1997 Anonymous Coders and 
- *                Junkbusters Corporation.  http://www.junkbusters.com
- *
- *                This program is free software; you can redistribute it 
- *                and/or modify it under the terms of the GNU General
- *                Public License as published by the Free Software
- *                Foundation; either version 2 of the License, or (at
- *                your option) any later version.
- *
- *                This program is distributed in the hope that it will
- *                be useful, but WITHOUT ANY WARRANTY; without even the
- *                implied warranty of MERCHANTABILITY or FITNESS FOR A
- *                PARTICULAR PURPOSE.  See the GNU General Public
- *                License for more details.
- *
- *                The GNU General Public License should be included with
- *                this file.  If not, you can view it at
- *                http://www.gnu.org/copyleft/gpl.html
- *                or write to the Free Software Foundation, Inc., 59
- *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * Revisions   :
- *    $Log: acconfig.h,v $
- *    Revision 1.36  2008/10/18 11:17:52  fabiankeil
- *    Connection keep-alive support is ready for testing,
- *    allow enabling it through the configure script.
- *
- *    Revision 1.35  2008/04/06 15:18:33  fabiankeil
- *    Oh well, rename the --enable-pcre-host-patterns option to
- *    --enable-extended-host-patterns as it's not really PCRE syntax.
- *
- *    Revision 1.34  2008/04/06 14:54:26  fabiankeil
- *    Use PCRE syntax in host patterns when configured
- *    with --enable-pcre-host-patterns.
- *
- *    Revision 1.33  2006/12/17 19:15:26  fabiankeil
- *    Added ./configure switch for FEATURE_GRACEFUL_TERMINATION.
- *
- *    Revision 1.32  2006/07/18 14:48:45  david__schmidt
- *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
- *    with what was really the latest development (the v_3_0_branch branch)
- *
- *    Revision 1.27.2.4  2003/12/17 16:34:40  oes
- *    Cosmetics
- *
- *    Revision 1.27.2.3  2003/03/27 16:03:19  oes
- *    Another shot at Bug #707467
- *
- *    Revision 1.27.2.2  2003/03/21 14:39:12  oes
- *    Presumably fixed Bug #707467 by defining unix ifdef __unix__
- *
- *    Revision 1.27.2.1  2002/08/10 11:22:31  oes
- *    - Add two AC_DEFINEs that indicate if the pcre*.h headers
- *      are located in a pcre/ subdir to the include path.
- *
- *    Revision 1.27  2002/04/25 19:13:57  morcego
- *    Removed RPM release number declaration on configure.in
- *    Changed makefile to use given value for RPM_PACKAGEV when on uploading
- *    targets (will produce an error, explaining who to do it, if no value
- *    if provided).
- *
- *    Revision 1.26  2002/04/11 11:00:21  oes
- *    Applied Moritz' fix for socklen_t on Solaris
- *
- *    Revision 1.25  2002/04/06 20:38:01  jongfoster
- *    Renaming VC++ versions of config.h
- *
- *    Revision 1.24  2002/04/04 00:36:36  gliptak
- *    always use pcre for matching
- *
- *    Revision 1.23  2002/04/03 22:28:03  gliptak
- *    Removed references to gnu_regex
- *
- *    Revision 1.22  2002/03/26 22:29:54  swa
- *    we have a new homepage!
- *
- *    Revision 1.21  2002/03/24 14:31:08  swa
- *    remove more crappy files. set RPM
- *    release version correctly.
- *
- *    Revision 1.20  2002/03/24 13:46:44  swa
- *    name change related issue.
- *
- *    Revision 1.19  2002/03/24 13:25:42  swa
- *    name change related issues
- *
- *    Revision 1.18  2002/03/08 16:40:28  oes
- *    Added FEATURE_NO_GIFS
- *
- *    Revision 1.17  2002/03/04 17:52:44  oes
- *    Deleted PID_FILE_PATH
- *
- *    Revision 1.16  2002/01/10 12:36:18  oes
- *    Moved HAVE_*_R to acconfig.h, where they belong.
- *
- *    Revision 1.15  2001/12/30 14:07:31  steudten
- *    - Add signal handling (unix)
- *    - Add SIGHUP handler (unix)
- *    - Add creation of pidfile (unix)
- *    - Add action 'top' in rc file (RH)
- *    - Add entry 'SIGNALS' to manpage
- *    - Add exit message to logfile (unix)
- *
- *    Revision 1.14  2001/10/23 21:24:09  jongfoster
- *    Support for FEATURE_CGI_EDIT_ACTIONS
- *
- *    Revision 1.13  2001/10/07 15:30:41  oes
- *    Removed FEATURE_DENY_GZIP
- *
- *    Revision 1.12  2001/09/13 19:56:37  jongfoster
- *    Reverting to revision 1.10 - previous checking was majorly broken.
- *
- *    Revision 1.10  2001/07/30 22:08:36  jongfoster
- *    Tidying up #defines:
- *    - All feature #defines are now of the form FEATURE_xxx
- *    - Permanently turned off WIN_GUI_EDIT
- *    - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS
- *
- *    Revision 1.9  2001/07/29 19:08:52  jongfoster
- *    Changing _CONFIG_H to CONFIG_H_INCLUDED.
- *    Also added protection against using a MinGW32 or CygWin version of
- *    config.h from within MS Visual C++
- *
- *    Revision 1.8  2001/07/29 17:09:17  jongfoster
- *    Major changes to build system in order to fix these bugs:
- *    - pthreads under Linux was broken - changed -lpthread to -pthread
- *    - Compiling in MinGW32 mode under CygWin now correctly detects
- *      which shared libraries are available
- *    - Solaris support (?) (Not tested under Solaris yet)
- *
- *    Revision 1.7  2001/07/25 22:53:59  jongfoster
- *    Will #error if pthreads is enabled under BeOs
- *
- *    Revision 1.6  2001/07/15 17:54:29  jongfoster
- *    Renaming #define STATIC to STATIC_PCRE
- *    Adding new #define FEATURE_PTHREAD that will be used to enable
- *    POSIX threads support.
- *
- *    Revision 1.5  2001/07/13 13:48:37  oes
- *     - (Fix:) Copied CODE_STATUS #define from config.h.in
- *     - split REGEX #define into REGEX_GNU and REGEX_PCRE
- *       and removed PCRE.
- *       (REGEX = REGEX_GNU || REGEX_PCRE per project.h)
- *     - Moved STATIC (for pcre) here from Makefile.in
- *     - Introduced STATIC_PCRS #define to allow for dynaimc linking with
- *       libpcrs
- *     - Removed PCRS #define, since pcrs is now needed for CGI anyway
- *
- *    Revision 1.4  2001/05/29 09:50:24  jongfoster
- *    Unified blocklist/imagelist/permissionslist.
- *    File format is still under discussion, but the internal changes
- *    are (mostly) done.
- *
- *    Also modified interceptor behaviour:
- *    - We now intercept all URLs beginning with one of the following
- *      prefixes (and *only* these prefixes):
- *        * http://i.j.b/
- *        * http://ijbswa.sf.net/config/
- *        * http://ijbswa.sourceforge.net/config/
- *    - New interceptors "home page" - go to http://i.j.b/ to see it.
- *    - Internal changes so that intercepted and fast redirect pages
- *      are not replaced with an image.
- *    - Interceptors now have the option to send a binary page direct
- *      to the client. (i.e. ijb-send-banner uses this)
- *    - Implemented show-url-info interceptor.  (Which is why I needed
- *      the above interceptors changes - a typical URL is
- *      "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif".
- *      The previous mechanism would not have intercepted that, and
- *      if it had been intercepted then it then it would have replaced
- *      it with an image.)
- *
- *    Revision 1.3  2001/05/26 01:26:34  jongfoster
- *    New #define, WIN_GUI_EDIT, enables the (embryonic) Win32 GUI editor.
- *    This #define cannot be set from ./configure - there's no point, it
- *    doesn't work yet.  See feature request # 425722
- *
- *    Revision 1.2  2001/05/22 17:43:35  oes
- *
- *    - Enabled filtering banners by size rather than URL
- *      by adding patterns that replace all standard banner
- *      sizes with the "Junkbuster" gif to the re_filterfile
- *
- *    - Enabled filtering WebBugs by providing a pattern
- *      which kills all 1x1 images
- *
- *    - Added support for PCRE_UNGREEDY behaviour to pcrs,
- *      which is selected by the (nonstandard and therefore
- *      capital) letter 'U' in the option string.
- *      It causes the quantifiers to be ungreedy by default.
- *      Appending a ? turns back to greedy (!).
- *
- *    - Added a new interceptor ijb-send-banner, which
- *      sends back the "Junkbuster" gif. Without imagelist or
- *      MSIE detection support, or if tinygif = 1, or the
- *      URL isn't recognized as an imageurl, a lame HTML
- *      explanation is sent instead.
- *
- *    - Added new feature, which permits blocking remote
- *      script redirects and firing back a local redirect
- *      to the browser.
- *      The feature is conditionally compiled, i.e. it
- *      can be disabled with --disable-fast-redirects,
- *      plus it must be activated by a "fast-redirects"
- *      line in the config file, has its own log level
- *      and of course wants to be displayed by show-proxy-args
- *      Note: Boy, all the #ifdefs in 1001 locations and
- *      all the fumbling with configure.in and acconfig.h
- *      were *way* more work than the feature itself :-(
- *
- *    - Because a generic redirect template was needed for
- *      this, tinygif = 3 now uses the same.
- *
- *    - Moved GIFs, and other static HTTP response templates
- *      to project.h
- *
- *    - Many minor fixes
- *
- *    - Removed some >400 CRs again (Jon, you really worked
- *      a lot! ;-)
- *
- *    Revision 1.1.1.1  2001/05/15 13:58:45  oes
- *    Initial import of version 2.9.3 source tree
- *
- *
- *********************************************************************/
-
- at TOP@
-
-/*
- * Version number - Major (X._._)
- */
-#undef VERSION_MAJOR
-
-/*
- * Version number - Minor (_.X._)
- */
-#undef VERSION_MINOR
-
-/*
- * Version number - Point (_._.X)
- */
-#undef VERSION_POINT
-
-/*
- * Version number, as a string
- */
-#undef VERSION
-
-/*
- * Status of the code: "alpha", "beta" or "stable".
- */
-#undef CODE_STATUS
-
-/* 
- * Should pcre be statically built in instead of linkling with libpcre?
- * (This is determined by configure depending on the availiability of
- * libpcre and user preferences). The name is ugly, but pcre needs it.
- * Don't bother to change this here! Use configure instead.
- */
-#undef STATIC_PCRE
-
-/* 
- * Should pcrs be statically built in instead of linkling with libpcrs?
- * (This is determined by configure depending on the availiability of
- * libpcrs and user preferences).
- * Don't bother to change this here! Use configure instead.
- */
-#undef STATIC_PCRS
-
-/*
- * Allows the use of an ACL to control access to the proxy by IP address.
- */
-#undef FEATURE_ACL
-
-/*
- * Enables the web-based configuration (actionsfile) editor.  If you
- * have a shared proxy, you might want to turn this off.
- */
-#undef FEATURE_CGI_EDIT_ACTIONS
-
-/*
- * Allows the use of jar files to capture cookies.
- */
-#undef FEATURE_COOKIE_JAR
-
-/*
- * Locally redirect remote script-redirect URLs
- */
-#undef FEATURE_FAST_REDIRECTS
-
-/*
- * Bypass filtering for 1 page only
- */
-#undef FEATURE_FORCE_LOAD
-
-/*
- * Allow blocking using images as well as HTML.
- * If you do not define this then everything is blocked as HTML.
- *
- * Note that this is required if you want to use FEATURE_IMAGE_DETECT_MSIE.
- */
-#undef FEATURE_IMAGE_BLOCKING
-
-/*
- * Detect image requests automatically for MSIE.  Will fall back to
- * other image-detection methods (i.e. "+image" permission) for other
- * browsers.
- *
- * You must also define FEATURE_IMAGE_BLOCKING to use this feature.
- *
- * It detects the following header pair as an image request:
- *
- * User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
- * Accept: * / *
- *
- * And the following as a HTML request:
- *
- * User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
- * Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, * / *
- *
- * And no, I haven't got that backwards - IE is being wierd.
- *
- * Known limitations: 
- * 1) If you press shift-reload on a blocked HTML page, you get
- *    the image "blocked" page, not the HTML "blocked" page.
- * 2) Once an image "blocked" page has been sent, viewing it 
- *    in it's own browser window *should* bring up the HTML
- *    "blocked" page, but it doesn't.  You need to clear the 
- *    browser cache to get the HTML version again.
- *
- * These limitations are due to IE making inconsistent choices
- * about which "Accept:" header to send.
- */
-#undef FEATURE_IMAGE_DETECT_MSIE
-
-/*
- * Kills JavaScript popups - window.open, onunload, etc.
- */
-#undef FEATURE_KILL_POPUPS
-
-/*
- * Use PNG instead of GIF for built-in images
- */
-#undef FEATURE_NO_GIFS
-
-/*
- * Allow to shutdown Privoxy through the webinterface.
- */
-#undef FEATURE_GRACEFUL_TERMINATION
-
-/*
- * Allow PCRE syntax in host patterns.
- */
-#undef FEATURE_EXTENDED_HOST_PATTERNS
-
-/*
- * Keep outgoing connections alive if possible.
- */
-#undef FEATURE_CONNECTION_KEEP_ALIVE
-
-/*
- * Use POSIX threads instead of native threads.
- */
-#undef FEATURE_PTHREAD
-
-/*
- * Enables statistics function.
- */
-#undef FEATURE_STATISTICS
-
-/*
- * Allow Privoxy to be "disabled" so it is just a normal non-blocking
- * non-anonymizing proxy.  This is useful if you're trying to access a
- * blocked or broken site - just change the setting in the config file,
- * or use the handy "Disable" menu option in the Windows GUI.
- */
-#undef FEATURE_TOGGLE
-
-/*
- * Allows the use of trust files.
- */
-#undef FEATURE_TRUST
-
-/*
- * Defined on Solaris only.  Makes the system libraries thread safe.
- */
-#undef _REENTRANT
-
-/*
- * Defined on Solaris only.  Without this, many important functions are not
- * defined in the system headers.
- */
-#undef __EXTENSIONS__
-
-/*
- * Defined always.
- * FIXME: Don't know what it does or why we need it.
- * (presumably something to do with MultiThreading?)
- */
-#undef __MT__
-
-/* If the (nonstandard and thread-safe) function gethostbyname_r
- * is available, select which signature to use
- */
-#undef HAVE_GETHOSTBYNAME_R_6_ARGS
-#undef HAVE_GETHOSTBYNAME_R_5_ARGS
-#undef HAVE_GETHOSTBYNAME_R_3_ARGS
-
-/* If the (nonstandard and thread-safe) function gethostbyaddr_r
- * is available, select which signature to use
- */
-#undef HAVE_GETHOSTBYADDR_R_8_ARGS
-#undef HAVE_GETHOSTBYADDR_R_7_ARGS
-#undef HAVE_GETHOSTBYADDR_R_5_ARGS
-
-/* Defined if you have gmtime_r and localtime_r with a signature
- * of (struct time *, struct tm *)
- */
-#undef HAVE_GMTIME_R
-#undef HAVE_LOCALTIME_R
-
-/* Define to 'int' if <sys/socket.h> doesn't have it. 
- */
-#undef socklen_t
-
-/* Define if pcre.h must be included as <pcre/pcre.h>
- */
-#undef PCRE_H_IN_SUBDIR
-
-/* Define if pcreposix.h must be included as <pcre/pcreposix.h>
- */
-#undef PCREPOSIX_H_IN_SUBDIR
-
- at BOTTOM@
-
-/*
- * Defined always.
- * FIXME: Don't know what it does or why we need it.
- * (presumably something to do with ANSI Standard C?)
- */
-#ifndef __STDC__
-#define __STDC__ 1
-#endif /* ndef __STDC__ */
-
-/*
- * Need to set up this define only for the Pthreads library for
- * Win32, available from http://sources.redhat.com/pthreads-win32/
- */
-#if defined(FEATURE_PTHREAD) && defined(_WIN32)
-#define __CLEANUP_C
-#endif /* defined(FEATURE_PTHREAD) && defined(_WIN32) */
-
-/*
- * BEOS does not currently support POSIX threads.
- * This *should* be detected by ./configure, but let's be sure.
- */
-#if defined(FEATURE_PTHREAD) && defined(__BEOS__)
-#error BEOS does not support pthread - please run ./configure again with "--disable-pthread"
-
-#endif /* defined(FEATURE_PTHREAD) && defined(__BEOS__) */
-
-/*
- * On OpenBSD and maybe also FreeBSD, gcc doesn't define the cpp
- * symbol unix; it defines __unix__ and sometimes not even that:
- */
-#if ( defined(__unix__) || defined(__NetBSD__) ) && !defined(unix)
-#define unix 1
-#endif
-
-/*
- * It's too easy to accidentally use a Cygwin or MinGW32 version of config.h
- * under VC++, and it usually gives many wierd error messages.  Let's make
- * the error messages understandable, by bailing out now.
- */
-#ifdef _MSC_VER
-#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.
-#endif /* def _MSC_VER */
-
-#endif /* CONFIG_H_INCLUDED */
diff --git a/external/privoxy/actionlist.h b/external/privoxy/actionlist.h
deleted file mode 100644
index 339c878..0000000
--- a/external/privoxy/actionlist.h
+++ /dev/null
@@ -1,306 +0,0 @@
-/*********************************************************************
- *
- * File        :  $Source: /cvsroot/ijbswa/current/actionlist.h,v $
- *
- * Purpose     :  Master list of supported actions.
- *                Not really a header, since it generates code.
- *                This is included (3 times!) from actions.c
- *                Each time, the following macros are defined to
- *                suitable values beforehand:
- *                    DEFINE_ACTION_MULTI()
- *                    DEFINE_ACTION_STRING()
- *                    DEFINE_ACTION_BOOL()
- *                    DEFINE_ACTION_ALIAS
- *
- * Copyright   :  Written by and Copyright (C) 2001-2008 the SourceForge
- *                Privoxy team. http://www.privoxy.org/
- *
- *                Based on the Internet Junkbuster originally written
- *                by and Copyright (C) 1997 Anonymous Coders and 
- *                Junkbusters Corporation.  http://www.junkbusters.com
- *
- *                This program is free software; you can redistribute it 
- *                and/or modify it under the terms of the GNU General
- *                Public License as published by the Free Software
- *                Foundation; either version 2 of the License, or (at
- *                your option) any later version.
- *
- *                This program is distributed in the hope that it will
- *                be useful, but WITHOUT ANY WARRANTY; without even the
- *                implied warranty of MERCHANTABILITY or FITNESS FOR A
- *                PARTICULAR PURPOSE.  See the GNU General Public
- *                License for more details.
- *
- *                The GNU General Public License should be included with
- *                this file.  If not, you can view it at
- *                http://www.gnu.org/copyleft/gpl.html
- *                or write to the Free Software Foundation, Inc., 59
- *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * Revisions   :
- *    $Log: actionlist.h,v $
- *    Revision 1.36  2008/09/20 10:04:33  fabiankeil
- *    Remove hide-forwarded-for-headers action which has
- *    been obsoleted by change-x-forwarded-for{block}.
- *
- *    Revision 1.35  2008/09/19 15:43:54  fabiankeil
- *    Fix sorting.
- *
- *    Revision 1.34  2008/09/19 15:26:28  fabiankeil
- *    Add change-x-forwarded-for{} action to block or add
- *    X-Forwarded-For headers. Mostly based on code removed
- *    before 3.0.7.
- *
- *    Revision 1.33  2008/03/29 12:13:45  fabiankeil
- *    Remove send-wafer and send-vanilla-wafer actions.
- *
- *    Revision 1.32  2008/03/28 15:13:42  fabiankeil
- *    Remove inspect-jpegs action.
- *
- *    Revision 1.31  2008/03/27 18:27:20  fabiankeil
- *    Remove kill-popups action.
- *
- *    Revision 1.30  2008/03/04 18:30:34  fabiankeil
- *    Remove the treat-forbidden-connects-like-blocks action. We now
- *    use the "blocked" page for forbidden CONNECT requests by default.
- *
- *    Revision 1.29  2008/03/01 14:00:43  fabiankeil
- *    Let the block action take the reason for the block
- *    as argument and show it on the "blocked" page.
- *
- *    Revision 1.28  2007/12/11 21:08:29  fabiankeil
- *    Let the CGI editor suggest a forward-override
- *    parameter whose syntax is actually valid.
- *
- *    Revision 1.27  2007/11/10 15:04:08  fabiankeil
- *    Tell the CGI editor about +hide-referrer{conditional-forge}.
- *
- *    Revision 1.26  2007/06/01 16:54:28  fabiankeil
- *    Add forward-override{} to change the forwarding settings through
- *    action sections. This is mainly interesting to forward different
- *    clients differently (for example based on User-Agent or request
- *    origin).
- *
- *    Revision 1.25  2007/04/15 16:39:20  fabiankeil
- *    Introduce tags as alternative way to specify which
- *    actions apply to a request. At the moment tags can be
- *    created based on client and server headers.
- *
- *    Revision 1.24  2007/03/20 15:16:34  fabiankeil
- *    Use dedicated header filter actions instead of abusing "filter".
- *    Replace "filter-client-headers" and "filter-client-headers"
- *    with "server-header-filter" and "client-header-filter".
- *
- *    Revision 1.23  2006/10/09 10:26:18  fabiankeil
- *    Changed the path in set-image-blocker's redirection default to
- *    "send-banner?type=pattern" instead of "show-banner?type=pattern"
- *    which isn't caught by Privoxy. Fixes BR 1573468.
- *
- *    Changed hide-user-agent's default value to "Privoxy VERSION".
- *
- *    Changed hide-referrer's default fake value to "http://www.privoxy.org/".
- *    A static referrer is obviously fake anyway, so we might as well
- *    advertise ourselves.
- *
- *    Revision 1.22  2006/09/01 17:14:18  hal9
- *    Re-ordered the actions list so that they display in the actions editor in
- *    alphabetical order. Some of the new actions were "out of order".
- *
- *    Revision 1.21  2006/08/14 08:25:19  fabiankeil
- *    Split filter-headers{} into filter-client-headers{}
- *    and filter-server-headers{}.
- *    Added parse_header_time() to share some code.
- *    Replaced timegm() with mktime().
- *
- *    Revision 1.20  2006/08/03 02:46:41  david__schmidt
- *    Incorporate Fabian Keil's patch work:http://www.fabiankeil.de/sourcecode/privoxy/
- *
- *    Revision 1.19  2006/07/18 14:48:45  david__schmidt
- *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
- *    with what was really the latest development (the v_3_0_branch branch)
- *
- *    Revision 1.17.2.3  2004/10/03 12:53:32  david__schmidt
- *    Add the ability to check jpeg images for invalid
- *    lengths of comment blocks.  Defensive strategy
- *    against the exploit:
- *       Microsoft Security Bulletin MS04-028
- *       Buffer Overrun in JPEG Processing (GDI+) Could
- *       Allow Code Execution (833987)
- *    Enabled with +inspect-jpegs in actions files.
- *
- *    Revision 1.17.2.2  2002/09/25 15:25:25  oes
- *    Added more aliases for prehistoric action names
- *
- *    Revision 1.17.2.1  2002/08/02 12:50:47  oes
- *    Consistency with docs: Change default name for action from hide-referer to hide-referrer
- *
- *    Revision 1.17  2002/05/14 21:25:55  oes
- *    Renamed prevent-(setting/reading)-cookies to crunch-(incoming/outgoing)-cookies
- *
- *    Revision 1.16  2002/04/24 02:15:18  oes
- *    Renamed actions as discussed, Aliased old action names to new ones.
- *
- *    Revision 1.15  2002/03/26 22:29:54  swa
- *    we have a new homepage!
- *
- *    Revision 1.14  2002/03/24 16:32:08  jongfoster
- *    Removing logo option
- *
- *    Revision 1.13  2002/03/24 15:23:33  jongfoster
- *    Name changes
- *
- *    Revision 1.12  2002/03/24 13:25:43  swa
- *    name change related issues
- *
- *    Revision 1.11  2002/03/12 01:42:49  oes
- *    Introduced modular filters
- *
- *    Revision 1.10  2002/03/08 18:19:14  jongfoster
- *    Adding +image-blocker{pattern} option to edit interface
- *
- *    Revision 1.9  2001/11/22 21:58:41  jongfoster
- *    Adding action +no-cookies-keep
- *
- *    Revision 1.8  2001/10/10 16:42:52  oes
- *    Fixed a bug, Added +limit-connect string action
- *
- *    Revision 1.7  2001/10/07 15:33:59  oes
- *    Introduced a +no-compression action
- *    Introduced a +downgrade action
- *
- *    Revision 1.6  2001/09/16 15:47:37  jongfoster
- *    First version of CGI-based edit interface.  This is very much a
- *    work-in-progress, and you can't actually use it to edit anything
- *    yet.  You must #define FEATURE_CGI_EDIT_ACTIONS for these changes
- *    to have any effect.
- *
- *    Revision 1.5  2001/07/18 12:27:03  oes
- *    Changed deanimate-gifs to string action
- *
- *    Revision 1.4  2001/07/13 13:52:12  oes
- *     - Formatting
- *     - Introduced new action ACTION_DEANIMATE
- *
- *    Revision 1.3  2001/06/07 23:03:56  jongfoster
- *    Added standard comment at top of file.
- *
- *
- *********************************************************************/
-
-
-#if !(defined(DEFINE_ACTION_BOOL) && defined(DEFINE_ACTION_MULTI) && defined(DEFINE_ACTION_STRING))
-#error Please define lots of macros before including "actionlist.h".
-#endif /* !defined(all the DEFINE_ACTION_xxx macros) */
-
-#ifndef DEFINE_CGI_PARAM_RADIO
-#define DEFINE_CGI_PARAM_RADIO(name, bit, index, value, is_default)
-#define DEFINE_CGI_PARAM_CUSTOM(name, bit, index, default_val)
-#define DEFINE_CGI_PARAM_NO_RADIO(name, bit, index, default_val)
-#endif /* ndef DEFINE_CGI_PARAM_RADIO */
-
-DEFINE_ACTION_MULTI      ("add-header",                 ACTION_MULTI_ADD_HEADER)
-DEFINE_ACTION_STRING     ("block",                      ACTION_BLOCK, ACTION_STRING_BLOCK)
-DEFINE_CGI_PARAM_NO_RADIO("block",                      ACTION_BLOCK, ACTION_STRING_BLOCK, "No reason specified.")
-DEFINE_ACTION_STRING     ("change-x-forwarded-for",     ACTION_CHANGE_X_FORWARDED_FOR,  ACTION_STRING_CHANGE_X_FORWARDED_FOR)
-DEFINE_CGI_PARAM_RADIO   ("change-x-forwarded-for",     ACTION_CHANGE_X_FORWARDED_FOR,  ACTION_STRING_CHANGE_X_FORWARDED_FOR, "block", 0)
-DEFINE_CGI_PARAM_RADIO   ("change-x-forwarded-for",     ACTION_CHANGE_X_FORWARDED_FOR,  ACTION_STRING_CHANGE_X_FORWARDED_FOR, "add", 1)
-DEFINE_ACTION_MULTI      ("client-header-filter",       ACTION_MULTI_CLIENT_HEADER_FILTER)
-DEFINE_ACTION_MULTI      ("client-header-tagger",       ACTION_MULTI_CLIENT_HEADER_TAGGER)
-DEFINE_ACTION_STRING     ("content-type-overwrite",     ACTION_CONTENT_TYPE_OVERWRITE, ACTION_STRING_CONTENT_TYPE)
-DEFINE_CGI_PARAM_NO_RADIO("content-type-overwrite",     ACTION_CONTENT_TYPE_OVERWRITE, ACTION_STRING_CONTENT_TYPE,    "text/html")
-DEFINE_ACTION_STRING     ("crunch-client-header",       ACTION_CRUNCH_CLIENT_HEADER, ACTION_STRING_CLIENT_HEADER)
-DEFINE_CGI_PARAM_NO_RADIO("crunch-client-header",       ACTION_CRUNCH_CLIENT_HEADER, ACTION_STRING_CLIENT_HEADER,          "X-Whatever:")
-DEFINE_ACTION_BOOL       ("crunch-if-none-match",       ACTION_CRUNCH_IF_NONE_MATCH)
-DEFINE_ACTION_BOOL       ("crunch-incoming-cookies",    ACTION_NO_COOKIE_SET)
-DEFINE_ACTION_BOOL       ("crunch-outgoing-cookies",    ACTION_NO_COOKIE_READ)
-DEFINE_ACTION_STRING     ("crunch-server-header",       ACTION_CRUNCH_SERVER_HEADER, ACTION_STRING_SERVER_HEADER)
-DEFINE_CGI_PARAM_NO_RADIO("crunch-server-header",       ACTION_CRUNCH_SERVER_HEADER, ACTION_STRING_SERVER_HEADER,          "X-Whatever:")
-DEFINE_ACTION_STRING     ("deanimate-gifs",             ACTION_DEANIMATE,       ACTION_STRING_DEANIMATE)
-DEFINE_CGI_PARAM_RADIO   ("deanimate-gifs",             ACTION_DEANIMATE,       ACTION_STRING_DEANIMATE,     "first", 0)
-DEFINE_CGI_PARAM_RADIO   ("deanimate-gifs",             ACTION_DEANIMATE,       ACTION_STRING_DEANIMATE,     "last",  1)
-DEFINE_ACTION_BOOL       ("downgrade-http-version",     ACTION_DOWNGRADE)
-DEFINE_ACTION_STRING     ("fast-redirects",             ACTION_FAST_REDIRECTS,  ACTION_STRING_FAST_REDIRECTS)
-DEFINE_CGI_PARAM_RADIO   ("fast-redirects",             ACTION_FAST_REDIRECTS,  ACTION_STRING_FAST_REDIRECTS, "simple-check",  0)
-DEFINE_CGI_PARAM_RADIO   ("fast-redirects",             ACTION_FAST_REDIRECTS,  ACTION_STRING_FAST_REDIRECTS, "check-decoded-url",  1)
-DEFINE_ACTION_MULTI      ("filter",                     ACTION_MULTI_FILTER)
-DEFINE_ACTION_BOOL       ("force-text-mode",            ACTION_FORCE_TEXT_MODE)
-DEFINE_ACTION_STRING     ("forward-override",           ACTION_FORWARD_OVERRIDE, ACTION_STRING_FORWARD_OVERRIDE)
-DEFINE_CGI_PARAM_CUSTOM  ("forward-override",           ACTION_FORWARD_OVERRIDE, ACTION_STRING_FORWARD_OVERRIDE, "forward .")
-DEFINE_ACTION_BOOL       ("handle-as-empty-document",   ACTION_HANDLE_AS_EMPTY_DOCUMENT)
-DEFINE_ACTION_BOOL       ("handle-as-image",            ACTION_IMAGE)
-DEFINE_ACTION_STRING     ("hide-accept-language",       ACTION_HIDE_ACCEPT_LANGUAGE, ACTION_STRING_LANGUAGE)
-DEFINE_CGI_PARAM_RADIO   ("hide-accept-language",       ACTION_HIDE_ACCEPT_LANGUAGE, ACTION_STRING_LANGUAGE, "block", 0)
-DEFINE_CGI_PARAM_CUSTOM  ("hide-accept-language",       ACTION_HIDE_ACCEPT_LANGUAGE, ACTION_STRING_LANGUAGE, "de-de")
-DEFINE_ACTION_STRING     ("hide-content-disposition",   ACTION_HIDE_CONTENT_DISPOSITION, ACTION_STRING_CONTENT_DISPOSITION)
-DEFINE_CGI_PARAM_RADIO   ("hide-content-disposition",   ACTION_HIDE_CONTENT_DISPOSITION, ACTION_STRING_CONTENT_DISPOSITION,    "block", 0)
-DEFINE_CGI_PARAM_CUSTOM  ("hide-content-disposition",   ACTION_HIDE_CONTENT_DISPOSITION, ACTION_STRING_CONTENT_DISPOSITION,    "attachment; filename=WHATEVER.txt")
-DEFINE_ACTION_STRING     ("hide-from-header",           ACTION_HIDE_FROM,       ACTION_STRING_FROM)
-DEFINE_CGI_PARAM_RADIO   ("hide-from-header",           ACTION_HIDE_FROM,       ACTION_STRING_FROM,          "block", 1)
-DEFINE_CGI_PARAM_CUSTOM  ("hide-from-header",           ACTION_HIDE_FROM,       ACTION_STRING_FROM,          "spam_me_senseless at sittingduck.xyz")
-DEFINE_ACTION_STRING     ("hide-if-modified-since",     ACTION_HIDE_IF_MODIFIED_SINCE, ACTION_STRING_IF_MODIFIED_SINCE)
-DEFINE_CGI_PARAM_RADIO   ("hide-if-modified-since",     ACTION_HIDE_IF_MODIFIED_SINCE, ACTION_STRING_IF_MODIFIED_SINCE, "block", 0)
-DEFINE_CGI_PARAM_CUSTOM  ("hide-if-modified-since",     ACTION_HIDE_IF_MODIFIED_SINCE, ACTION_STRING_IF_MODIFIED_SINCE, "-1")
-DEFINE_ACTION_STRING     ("hide-referrer",              ACTION_HIDE_REFERER,    ACTION_STRING_REFERER)
-DEFINE_CGI_PARAM_RADIO   ("hide-referrer",              ACTION_HIDE_REFERER,    ACTION_STRING_REFERER,       "conditional-forge", 3)
-DEFINE_CGI_PARAM_RADIO   ("hide-referrer",              ACTION_HIDE_REFERER,    ACTION_STRING_REFERER,       "conditional-block", 2)
-DEFINE_CGI_PARAM_RADIO   ("hide-referrer",              ACTION_HIDE_REFERER,    ACTION_STRING_REFERER,       "forge", 1)
-DEFINE_CGI_PARAM_RADIO   ("hide-referrer",              ACTION_HIDE_REFERER,    ACTION_STRING_REFERER,       "block", 0)
-DEFINE_CGI_PARAM_CUSTOM  ("hide-referrer",              ACTION_HIDE_REFERER,    ACTION_STRING_REFERER,       "http://www.privoxy.org/")
-DEFINE_ACTION_STRING     ("hide-user-agent",            ACTION_HIDE_USER_AGENT, ACTION_STRING_USER_AGENT)
-DEFINE_CGI_PARAM_NO_RADIO("hide-user-agent",            ACTION_HIDE_USER_AGENT, ACTION_STRING_USER_AGENT,    "Privoxy " VERSION)
-DEFINE_ACTION_STRING     ("limit-connect",              ACTION_LIMIT_CONNECT,   ACTION_STRING_LIMIT_CONNECT)
-DEFINE_CGI_PARAM_NO_RADIO("limit-connect",              ACTION_LIMIT_CONNECT,   ACTION_STRING_LIMIT_CONNECT,  "443")
-DEFINE_ACTION_STRING     ("overwrite-last-modified",    ACTION_OVERWRITE_LAST_MODIFIED, ACTION_STRING_LAST_MODIFIED)
-DEFINE_CGI_PARAM_RADIO   ("overwrite-last-modified",    ACTION_OVERWRITE_LAST_MODIFIED, ACTION_STRING_LAST_MODIFIED, "block", 0)
-DEFINE_CGI_PARAM_RADIO   ("overwrite-last-modified",    ACTION_OVERWRITE_LAST_MODIFIED, ACTION_STRING_LAST_MODIFIED, "reset-to-request-time", 1)
-DEFINE_CGI_PARAM_RADIO   ("overwrite-last-modified",    ACTION_OVERWRITE_LAST_MODIFIED, ACTION_STRING_LAST_MODIFIED, "randomize", 2)
-DEFINE_ACTION_BOOL       ("prevent-compression",        ACTION_NO_COMPRESSION)
-DEFINE_ACTION_STRING     ("redirect",                   ACTION_REDIRECT,        ACTION_STRING_REDIRECT)
-DEFINE_CGI_PARAM_NO_RADIO("redirect",                   ACTION_REDIRECT,        ACTION_STRING_REDIRECT,  "http://localhost/")
-DEFINE_ACTION_MULTI      ("server-header-filter",       ACTION_MULTI_SERVER_HEADER_FILTER)
-DEFINE_ACTION_MULTI      ("server-header-tagger",       ACTION_MULTI_SERVER_HEADER_TAGGER)
-DEFINE_ACTION_BOOL       ("session-cookies-only",       ACTION_NO_COOKIE_KEEP)
-DEFINE_ACTION_STRING     ("set-image-blocker",          ACTION_IMAGE_BLOCKER,   ACTION_STRING_IMAGE_BLOCKER)
-DEFINE_CGI_PARAM_RADIO   ("set-image-blocker",          ACTION_IMAGE_BLOCKER,   ACTION_STRING_IMAGE_BLOCKER, "pattern", 1)
-DEFINE_CGI_PARAM_RADIO   ("set-image-blocker",          ACTION_IMAGE_BLOCKER,   ACTION_STRING_IMAGE_BLOCKER, "blank", 0)
-DEFINE_CGI_PARAM_CUSTOM  ("set-image-blocker",          ACTION_IMAGE_BLOCKER,   ACTION_STRING_IMAGE_BLOCKER,  CGI_PREFIX "send-banner?type=pattern")
-
-#if DEFINE_ACTION_ALIAS
-
-/* 
- * Alternative spellings
- */
-DEFINE_ACTION_STRING     ("hide-referer",   ACTION_HIDE_REFERER,    ACTION_STRING_REFERER)
-DEFINE_ACTION_BOOL       ("prevent-keeping-cookies", ACTION_NO_COOKIE_KEEP)
-
-/* 
- * Pre-3.0.7 (pseudo) compatibility
- */
-DEFINE_ACTION_MULTI      ("filter-client-headers",       ACTION_MULTI_CLIENT_HEADER_FILTER)
-DEFINE_ACTION_MULTI      ("filter-server-headers",       ACTION_MULTI_SERVER_HEADER_FILTER)
-
-/* 
- * Pre-3.0 compatibility
- */
-DEFINE_ACTION_BOOL       ("no-cookie-read",          ACTION_NO_COOKIE_READ)
-DEFINE_ACTION_BOOL       ("no-cookie-set",           ACTION_NO_COOKIE_SET)
-DEFINE_ACTION_BOOL       ("prevent-reading-cookies", ACTION_NO_COOKIE_READ)
-DEFINE_ACTION_BOOL       ("prevent-setting-cookies", ACTION_NO_COOKIE_SET)
-DEFINE_ACTION_BOOL       ("downgrade",               ACTION_DOWNGRADE)
-DEFINE_ACTION_STRING     ("hide-from",               ACTION_HIDE_FROM,       ACTION_STRING_FROM)
-DEFINE_ACTION_BOOL       ("image",                   ACTION_IMAGE)
-DEFINE_ACTION_STRING     ("image-blocker",           ACTION_IMAGE_BLOCKER,   ACTION_STRING_IMAGE_BLOCKER)
-DEFINE_ACTION_BOOL       ("no-compression",          ACTION_NO_COMPRESSION)
-DEFINE_ACTION_BOOL       ("no-cookies-keep",         ACTION_NO_COOKIE_KEEP)
-DEFINE_ACTION_BOOL       ("no-cookies-read",         ACTION_NO_COOKIE_READ)
-DEFINE_ACTION_BOOL       ("no-cookies-set",          ACTION_NO_COOKIE_SET)
-#endif /* if DEFINE_ACTION_ALIAS */
-
-#undef DEFINE_ACTION_MULTI
-#undef DEFINE_ACTION_STRING
-#undef DEFINE_ACTION_BOOL
-#undef DEFINE_ACTION_ALIAS
-#undef DEFINE_CGI_PARAM_CUSTOM
-#undef DEFINE_CGI_PARAM_RADIO
-#undef DEFINE_CGI_PARAM_NO_RADIO
-
diff --git a/external/privoxy/actions.c b/external/privoxy/actions.c
deleted file mode 100644
index 172085f..0000000
--- a/external/privoxy/actions.c
+++ /dev/null
@@ -1,2021 +0,0 @@
-const char actions_rcs[] = "$Id: actions.c,v 1.56 2009/03/08 14:19:21 fabiankeil Exp $";
-/*********************************************************************
- *
- * File        :  $Source: /cvsroot/ijbswa/current/actions.c,v $
- *
- * Purpose     :  Declares functions to work with actions files
- *                Functions declared include: FIXME
- *
- * Copyright   :  Written by and Copyright (C) 2001-2008 the SourceForge
- *                Privoxy team. http://www.privoxy.org/
- *
- *                Based on the Internet Junkbuster originally written
- *                by and Copyright (C) 1997 Anonymous Coders and
- *                Junkbusters Corporation.  http://www.junkbusters.com
- *
- *                This program is free software; you can redistribute it
- *                and/or modify it under the terms of the GNU General
- *                Public License as published by the Free Software
- *                Foundation; either version 2 of the License, or (at
- *                your option) any later version.
- *
- *                This program is distributed in the hope that it will
- *                be useful, but WITHOUT ANY WARRANTY; without even the
- *                implied warranty of MERCHANTABILITY or FITNESS FOR A
- *                PARTICULAR PURPOSE.  See the GNU General Public
- *                License for more details.
- *
- *                The GNU General Public License should be included with
- *                this file.  If not, you can view it at
- *                http://www.gnu.org/copyleft/gpl.html
- *                or write to the Free Software Foundation, Inc., 59
- *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * Revisions   :
- *    $Log: actions.c,v $
- *    Revision 1.56  2009/03/08 14:19:21  fabiankeil
- *    Fix justified (but harmless) compiler warnings
- *    on platforms where sizeof(int) < sizeof(long).
- *
- *    Revision 1.55  2008/12/04 18:18:56  fabiankeil
- *    Fix some cparser warnings.
- *
- *    Revision 1.54  2008/09/20 10:04:33  fabiankeil
- *    Remove hide-forwarded-for-headers action which has
- *    been obsoleted by change-x-forwarded-for{block}.
- *
- *    Revision 1.53  2008/05/26 16:04:04  fabiankeil
- *    s at memorey@memory@
- *
- *    Revision 1.52  2008/04/27 16:26:59  fabiankeil
- *    White space fix for the last commit.
- *
- *    Revision 1.51  2008/04/27 16:20:19  fabiankeil
- *    Complain about every block action without reason found.
- *
- *    Revision 1.50  2008/03/30 14:52:00  fabiankeil
- *    Rename load_actions_file() and load_re_filterfile()
- *    as they load multiple files "now".
- *
- *    Revision 1.49  2008/03/29 12:13:45  fabiankeil
- *    Remove send-wafer and send-vanilla-wafer actions.
- *
- *    Revision 1.48  2008/03/28 18:17:14  fabiankeil
- *    In action_used_to_be_valid(), loop through an array of formerly
- *    valid actions instead of using an OR-chain of strcmpic() calls.
- *
- *    Revision 1.47  2008/03/28 15:13:37  fabiankeil
- *    Remove inspect-jpegs action.
- *
- *    Revision 1.46  2008/03/27 18:27:20  fabiankeil
- *    Remove kill-popups action.
- *
- *    Revision 1.45  2008/03/24 11:21:02  fabiankeil
- *    Share the action settings for multiple patterns in the same
- *    section so we waste less memory for gigantic block lists
- *    (and load them slightly faster). Reported by Franz Schwartau.
- *
- *    Revision 1.44  2008/03/04 18:30:34  fabiankeil
- *    Remove the treat-forbidden-connects-like-blocks action. We now
- *    use the "blocked" page for forbidden CONNECT requests by default.
- *
- *    Revision 1.43  2008/03/01 14:00:43  fabiankeil
- *    Let the block action take the reason for the block
- *    as argument and show it on the "blocked" page.
- *
- *    Revision 1.42  2008/02/09 15:15:38  fabiankeil
- *    List active and inactive actions in the show-url-info's
- *    "Final results" section separately. Patch submitted by Lee
- *    in #1830056, modified to list active actions first.
- *
- *    Revision 1.41  2008/01/28 20:17:40  fabiankeil
- *    - Mark some parameters as immutable.
- *    - Hide update_action_bits_for_all_tags() while it's unused.
- *
- *    Revision 1.40  2007/05/21 10:26:50  fabiankeil
- *    - Use strlcpy() instead of strcpy().
- *    - Provide a reason why loading the actions
- *      file might have failed.
- *
- *    Revision 1.39  2007/04/17 18:21:45  fabiankeil
- *    Split update_action_bits() into
- *    update_action_bits_for_all_tags()
- *    and update_action_bits_for_tag().
- *
- *    Revision 1.38  2007/04/15 16:39:20  fabiankeil
- *    Introduce tags as alternative way to specify which
- *    actions apply to a request. At the moment tags can be
- *    created based on client and server headers.
- *
- *    Revision 1.37  2007/03/11 15:56:12  fabiankeil
- *    Add kludge to log unknown aliases and actions before exiting.
- *
- *    Revision 1.36  2006/12/28 17:15:42  fabiankeil
- *    Fix gcc43 conversion warning.
- *
- *    Revision 1.35  2006/07/18 14:48:45  david__schmidt
- *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
- *    with what was really the latest development (the v_3_0_branch branch)
- *
- *    Revision 1.32.2.6  2006/01/29 23:10:56  david__schmidt
- *    Multiple filter file support
- *
- *    Revision 1.32.2.5  2005/06/09 01:18:41  david__schmidt
- *    Tweaks to conditionally include pthread.h if FEATURE_PTHREAD is enabled -
- *    this becomes important when jcc.h gets included later down the line.
- *
- *    Revision 1.32.2.4  2003/12/03 10:33:11  oes
- *    - Implemented Privoxy version requirement through
- *      for-privoxy-version= statement in {{settings}}
- *      block
- *    - Fix for unchecked out-of-memory condition
- *
- *    Revision 1.32.2.3  2003/02/28 12:52:10  oes
- *    Fixed memory leak reported by Dan Price in Bug #694713
- *
- *    Revision 1.32.2.2  2002/11/20 14:36:55  oes
- *    Extended unload_current_actions_file() to multiple AFs.
- *    Thanks to Oliver Stoeneberg for the hint.
- *
- *    Revision 1.32.2.1  2002/05/26 12:13:16  roro
- *    Change unsigned to unsigned long in actions_name struct.  This closes
- *    SourceForge Bug #539284.
- *
- *    Revision 1.32  2002/05/12 21:36:29  jongfoster
- *    Correcting function comments
- *
- *    Revision 1.31  2002/05/06 07:56:50  oes
- *    Made actions_to_html independent of FEATURE_CGI_EDIT_ACTIONS
- *
- *    Revision 1.30  2002/04/30 11:14:52  oes
- *    Made csp the first parameter in *action_to_html
- *
- *    Revision 1.29  2002/04/26 19:30:54  jongfoster
- *    - current_action_to_html(): Adding help link for the "-" form of
- *      one-string actions.
- *    - Some actions had "<br>-", some "<br> -" (note the space).
- *      Standardizing on no space.
- *    - Greatly simplifying some of the code by using string_join()
- *      where appropriate.
- *
- *    Revision 1.28  2002/04/26 12:53:15  oes
- *     - CGI AF editor now writes action lines split into
- *       single lines with line continuation
- *     - actions_to_html now embeds each action name in
- *       link to chapter
- *     - current_action_to_text is now called current_action_to_html
- *       and acts like actions_to_html
- *
- *    Revision 1.27  2002/04/24 02:10:31  oes
- *     - Jon's patch for multiple AFs:
- *       - split load_actions_file, add load_one_actions_file
- *       - make csp->actions_list files an array
- *       - remember file id with each action
- *     - Copy_action now frees dest action before copying
- *
- *    Revision 1.26  2002/03/26 22:29:54  swa
- *    we have a new homepage!
- *
- *    Revision 1.25  2002/03/24 13:25:43  swa
- *    name change related issues
- *
- *    Revision 1.24  2002/03/16 23:54:06  jongfoster
- *    Adding graceful termination feature, to help look for memory leaks.
- *    If you enable this (which, by design, has to be done by hand
- *    editing config.h) and then go to http://i.j.b/die, then the program
- *    will exit cleanly after the *next* request.  It should free all the
- *    memory that was used.
- *
- *    Revision 1.23  2002/03/07 03:46:16  oes
- *    Fixed compiler warnings
- *
- *    Revision 1.22  2002/01/21 00:27:02  jongfoster
- *    Allowing free_action(NULL).
- *    Moving the functions that #include actionlist.h to the end of the file,
- *    because the Visual C++ 97 debugger gets extremely confused if you try
- *    to debug any code that comes after them in the file.
- *
- *    Revision 1.21  2002/01/17 20:54:44  jongfoster
- *    Renaming free_url to free_url_spec, since it frees a struct url_spec.
- *
- *    Revision 1.20  2001/11/22 21:56:49  jongfoster
- *    Making action_spec->flags into an unsigned long rather than just an
- *    unsigned int.
- *    Fixing a bug in the display of -add-header and -wafer
- *
- *    Revision 1.19  2001/11/13 00:14:07  jongfoster
- *    Fixing stupid bug now I've figured out what || means.
- *    (It always returns 0 or 1, not one of it's paramaters.)
- *
- *    Revision 1.18  2001/11/07 00:06:06  steudten
- *    Add line number in error output for lineparsing for
- *    actionsfile.
- *
- *    Revision 1.17  2001/10/25 03:40:47  david__schmidt
- *    Change in porting tactics: OS/2's EMX porting layer doesn't allow multiple
- *    threads to call select() simultaneously.  So, it's time to do a real, live,
- *    native OS/2 port.  See defines for __EMX__ (the porting layer) vs. __OS2__
- *    (native). Both versions will work, but using __OS2__ offers multi-threading.
- *
- *    Revision 1.16  2001/10/23 21:30:30  jongfoster
- *    Adding error-checking to selected functions.
- *
- *    Revision 1.15  2001/10/14 21:58:22  jongfoster
- *    Adding support for the CGI-based editor:
- *    - Exported get_actions()
- *    - Added new function free_alias_list()
- *    - Added support for {{settings}} and {{description}} blocks
- *      in the actions file.  They are currently ignored.
- *    - Added restriction to only one {{alias}} block which must appear
- *      first in the file, to simplify the editor's rewriting rules.
- *    - Note that load_actions_file() is no longer used by the CGI-based
- *      editor, but some of the other routines in this file are.
- *
- *    Revision 1.14  2001/09/22 16:36:59  jongfoster
- *    Removing unused parameter fs from read_config_line()
- *
- *    Revision 1.13  2001/09/16 15:47:37  jongfoster
- *    First version of CGI-based edit interface.  This is very much a
- *    work-in-progress, and you can't actually use it to edit anything
- *    yet.  You must #define FEATURE_CGI_EDIT_ACTIONS for these changes
- *    to have any effect.
- *
- *    Revision 1.12  2001/09/16 13:21:27  jongfoster
- *    Changes to use new list functions.
- *
- *    Revision 1.11  2001/09/14 00:17:32  jongfoster
- *    Tidying up memory allocation. New function init_action().
- *
- *    Revision 1.10  2001/09/10 10:14:34  oes
- *    Removing unused variable
- *
- *    Revision 1.9  2001/07/30 22:08:36  jongfoster
- *    Tidying up #defines:
- *    - All feature #defines are now of the form FEATURE_xxx
- *    - Permanently turned off WIN_GUI_EDIT
- *    - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS
- *
- *    Revision 1.8  2001/06/29 13:19:52  oes
- *    Removed logentry from cancelled commit
- *
- *    Revision 1.7  2001/06/09 10:55:28  jongfoster
- *    Changing BUFSIZ ==> BUFFER_SIZE
- *
- *    Revision 1.6  2001/06/07 23:04:34  jongfoster
- *    Made get_actions() static.
- *
- *    Revision 1.5  2001/06/03 19:11:48  oes
- *    adapted to new enlist_unique arg format
- *
- *    Revision 1.4  2001/06/01 20:03:42  jongfoster
- *    Better memory management - current_action->strings[] now
- *    contains copies of the strings, not the original.
- *
- *    Revision 1.3  2001/06/01 18:49:17  jongfoster
- *    Replaced "list_share" with "list" - the tiny memory gain was not
- *    worth the extra complexity.
- *
- *    Revision 1.2  2001/05/31 21:40:00  jongfoster
- *    Removing some commented out, obsolete blocks of code.
- *
- *    Revision 1.1  2001/05/31 21:16:46  jongfoster
- *    Moved functions to process the action list into this new file.
- *
- *
- *********************************************************************/
-
-
-#include "config.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <stdlib.h>
-
-#ifdef FEATURE_PTHREAD
-#include <pthread.h>
-#endif
-
-#include "project.h"
-#include "jcc.h"
-#include "list.h"
-#include "actions.h"
-#include "miscutil.h"
-#include "errlog.h"
-#include "loaders.h"
-#include "encode.h"
-#include "urlmatch.h"
-#include "cgi.h"
-#include "ssplit.h"
-
-const char actions_h_rcs[] = ACTIONS_H_VERSION;
-
-
-/*
- * We need the main list of options.
- *
- * First, we need a way to tell between boolean, string, and multi-string
- * options.  For string and multistring options, we also need to be
- * able to tell the difference between a "+" and a "-".  (For bools,
- * the "+"/"-" information is encoded in "add" and "mask").  So we use
- * an enumerated type (well, the preprocessor equivalent).  Here are
- * the values:
- */
-#define AV_NONE       0 /* +opt -opt */
-#define AV_ADD_STRING 1 /* +stropt{string} */
-#define AV_REM_STRING 2 /* -stropt */
-#define AV_ADD_MULTI  3 /* +multiopt{string} +multiopt{string2} */
-#define AV_REM_MULTI  4 /* -multiopt{string} -multiopt          */
-
-/*
- * We need a structure to hold the name, flag changes,
- * type, and string index.
- */
-struct action_name
-{
-   const char * name;
-   unsigned long mask;   /* a bit set to "0" = remove action */
-   unsigned long add;    /* a bit set to "1" = add action */
-   int takes_value;      /* an AV_... constant */
-   int index;            /* index into strings[] or multi[] */
-};
-
-/*
- * And with those building blocks in place, here's the array.
- */
-static const struct action_name action_names[] =
-{
-   /*
-    * Well actually there's no data here - it's in actionlist.h
-    * This keeps it together to make it easy to change.
-    *
-    * Here's the macros used to format it:
-    */
-#define DEFINE_ACTION_MULTI(name,index)                   \
-   { "+" name, ACTION_MASK_ALL, 0, AV_ADD_MULTI, index }, \
-   { "-" name, ACTION_MASK_ALL, 0, AV_REM_MULTI, index },
-#define DEFINE_ACTION_STRING(name,flag,index)                 \
-   { "+" name, ACTION_MASK_ALL, flag, AV_ADD_STRING, index }, \
-   { "-" name, ~flag, 0, AV_REM_STRING, index },
-#define DEFINE_ACTION_BOOL(name,flag)   \
-   { "+" name, ACTION_MASK_ALL, flag }, \
-   { "-" name, ~flag, 0 },
-#define DEFINE_ACTION_ALIAS 1 /* Want aliases please */
-
-#include "actionlist.h"
-
-#undef DEFINE_ACTION_MULTI
-#undef DEFINE_ACTION_STRING
-#undef DEFINE_ACTION_BOOL
-#undef DEFINE_ACTION_ALIAS
-
-   { NULL, 0, 0 } /* End marker */
-};
-
-
-static int load_one_actions_file(struct client_state *csp, int fileid);
-
-
-/*********************************************************************
- *
- * Function    :  merge_actions
- *
- * Description :  Merge two actions together.
- *                Similar to "dest += src".
- *
- * Parameters  :
- *          1  :  dest = Actions to modify.
- *          2  :  src = Action to add.
- *
- * Returns     :  JB_ERR_OK or JB_ERR_MEMORY
- *
- *********************************************************************/
-jb_err merge_actions (struct action_spec *dest,
-                      const struct action_spec *src)
-{
-   int i;
-   jb_err err;
-
-   dest->mask &= src->mask;
-   dest->add  &= src->mask;
-   dest->add  |= src->add;
-
-   for (i = 0; i < ACTION_STRING_COUNT; i++)
-   {
-      char * str = src->string[i];
-      if (str)
-      {
-         freez(dest->string[i]);
-         dest->string[i] = strdup(str);
-         if (NULL == dest->string[i])
-         {
-            return JB_ERR_MEMORY;
-         }
-      }
-   }
-
-   for (i = 0; i < ACTION_MULTI_COUNT; i++)
-   {
-      if (src->multi_remove_all[i])
-      {
-         /* Remove everything from dest */
-         list_remove_all(dest->multi_remove[i]);
-         dest->multi_remove_all[i] = 1;
-
-         err = list_duplicate(dest->multi_add[i], src->multi_add[i]);
-      }
-      else if (dest->multi_remove_all[i])
-      {
-         /*
-          * dest already removes everything, so we only need to worry
-          * about what we add.
-          */
-         list_remove_list(dest->multi_add[i], src->multi_remove[i]);
-         err = list_append_list_unique(dest->multi_add[i], src->multi_add[i]);
-      }
-      else
-      {
-         /* No "remove all"s to worry about. */
-         list_remove_list(dest->multi_add[i], src->multi_remove[i]);
-         err = list_append_list_unique(dest->multi_remove[i], src->multi_remove[i]);
-         if (!err) err = list_append_list_unique(dest->multi_add[i], src->multi_add[i]);
-      }
-
-      if (err)
-      {
-         return err;
-      }
-   }
-
-   return JB_ERR_OK;
-}
-
-
-/*********************************************************************
- *
- * Function    :  copy_action
- *
- * Description :  Copy an action_specs.
- *                Similar to "dest = src".
- *
- * Parameters  :
- *          1  :  dest = Destination of copy.
- *          2  :  src = Source for copy.
- *
- * Returns     :  N/A
- *
- *********************************************************************/
-jb_err copy_action (struct action_spec *dest,
-                    const struct action_spec *src)
-{
-   int i;
-   jb_err err = JB_ERR_OK;
-
-   free_action(dest);
-   memset(dest, '\0', sizeof(*dest));
-
-   dest->mask = src->mask;
-   dest->add  = src->add;
-
-   for (i = 0; i < ACTION_STRING_COUNT; i++)
-   {
-      char * str = src->string[i];
-      if (str)
-      {
-         str = strdup(str);
-         if (!str)
-         {
-            return JB_ERR_MEMORY;
-         }
-         dest->string[i] = str;
-      }
-   }
-
-   for (i = 0; i < ACTION_MULTI_COUNT; i++)
-   {
-      dest->multi_remove_all[i] = src->multi_remove_all[i];
-      err = list_duplicate(dest->multi_remove[i], src->multi_remove[i]);
-      if (err)
-      {
-         return err;
-      }
-      err = list_duplicate(dest->multi_add[i],    src->multi_add[i]);
-      if (err)
-      {
-         return err;
-      }
-   }
-   return err;
-}
-
-/*********************************************************************
- *
- * Function    :  free_action_spec
- *
- * Description :  Frees an action_spec and the memory used by it.
- *
- * Parameters  :
- *          1  :  src = Source to free.
- *
- * Returns     :  N/A
- *
- *********************************************************************/
-void free_action_spec(struct action_spec *src)
-{
-   free_action(src);
-   freez(src);
-}
-
-
-/*********************************************************************
- *
- * Function    :  free_action
- *
- * Description :  Destroy an action_spec.  Frees memory used by it,
- *                except for the memory used by the struct action_spec
- *                itself.
- *
- * Parameters  :
- *          1  :  src = Source to free.
- *
- * Returns     :  N/A
- *
- *********************************************************************/
-void free_action (struct action_spec *src)
-{
-   int i;
-
-   if (src == NULL)
-   {
-      return;
-   }
-
-   for (i = 0; i < ACTION_STRING_COUNT; i++)
-   {
-      freez(src->string[i]);
-   }
-
-   for (i = 0; i < ACTION_MULTI_COUNT; i++)
-   {
-      destroy_list(src->multi_remove[i]);
-      destroy_list(src->multi_add[i]);
-   }
-
-   memset(src, '\0', sizeof(*src));
-}
-
-
-/*********************************************************************
- *
- * Function    :  get_action_token
- *
- * Description :  Parses a line for the first action.
- *                Modifies it's input array, doesn't allocate memory.
- *                e.g. given:
- *                *line="  +abc{def}  -ghi "
- *                Returns:
- *                *line="  -ghi "
- *                *name="+abc"
- *                *value="def"
- *
- * Parameters  :
- *          1  :  line = [in] The line containing the action.
- *                       [out] Start of next action on line, or
- *                       NULL if we reached the end of line before
- *                       we found an action.
- *          2  :  name = [out] Start of action name, null
- *                       terminated.  NULL on EOL
- *          3  :  value = [out] Start of action value, null
- *                        terminated.  NULL if none or EOL.
- *
- * Returns     :  JB_ERR_OK => Ok
- *                JB_ERR_PARSE => Mismatched {} (line was trashed anyway)
- *
- *********************************************************************/
-jb_err get_action_token(char **line, char **name, char **value)
-{
-   char * str = *line;
-   char ch;
-
-   /* set default returns */
-   *line = NULL;
-   *name = NULL;
-   *value = NULL;
-
-   /* Eat any leading whitespace */
-   while ((*str == ' ') || (*str == '\t'))
-   {
-      str++;
-   }
-
-   if (*str == '\0')
-   {
-      return 0;
-   }
-
-   if (*str == '{')
-   {
-      /* null name, just value is prohibited */
-      return JB_ERR_PARSE;
-   }
-
-   *name = str;
-
-   /* parse option */
-   while (((ch = *str) != '\0') &&
-          (ch != ' ') && (ch != '\t') && (ch != '{'))
-   {
-      if (ch == '}')
-      {
-         /* error, '}' without '{' */
-         return JB_ERR_PARSE;
-      }
-      str++;
-   }
-   *str = '\0';
-
-   if (ch != '{')
-   {
-      /* no value */
-      if (ch == '\0')
-      {
-         /* EOL - be careful not to run off buffer */
-         *line = str;
-      }
-      else
-      {
-         /* More to parse next time. */
-         *line = str + 1;
-      }
-      return JB_ERR_OK;
-   }
-
-   str++;
-   *value = str;
-
-   str = strchr(str, '}');
-   if (str == NULL)
-   {
-      /* error */
-      *value = NULL;
-      return JB_ERR_PARSE;
-   }
-
-   /* got value */
-   *str = '\0';
-   *line = str + 1;
-
-   chomp(*value);
-
-   return JB_ERR_OK;
-}
-
-/*********************************************************************
- *
- * Function    :  action_used_to_be_valid
- *
- * Description :  Checks if unrecognized actions were valid in earlier
- *                releases.
- *
- * Parameters  :
- *          1  :  action = The string containing the action to check.
- *
- * Returns     :  True if yes, otherwise false.
- *
- *********************************************************************/
-static int action_used_to_be_valid(const char *action)
-{
-   static const char *formerly_valid_actions[] = {
-      "inspect-jpegs",
-      "kill-popups",
-      "send-vanilla-wafer",
-      "send-wafer",
-      "treat-forbidden-connects-like-blocks",
-      "vanilla-wafer",
-      "wafer"
-   };
-   unsigned int i;
-
-   for (i = 0; i < SZ(formerly_valid_actions); i++)
-   {
-      if (0 == strcmpic(action, formerly_valid_actions[i]))
-      {
-         return TRUE;
-      }
-   }
-
-   return FALSE;
-}
-
-/*********************************************************************
- *
- * Function    :  get_actions
- *
- * Description :  Parses a list of actions.
- *
- * Parameters  :
- *          1  :  line = The string containing the actions.
- *                       Will be written to by this function.
- *          2  :  alias_list = Custom alias list, or NULL for none.
- *          3  :  cur_action = Where to store the action.  Caller
- *                             allocates memory.
- *
- * Returns     :  JB_ERR_OK => Ok
- *                JB_ERR_PARSE => Parse error (line was trashed anyway)
- *                nonzero => Out of memory (line was trashed anyway)
- *
- *********************************************************************/
-jb_err get_actions(char *line,
-                   struct action_alias * alias_list,
-                   struct action_spec *cur_action)
-{
-   jb_err err;
-   init_action(cur_action);
-   cur_action->mask = ACTION_MASK_ALL;
-
-   while (line)
-   {
-      char * option = NULL;
-      char * value = NULL;
-
-      err = get_action_token(&line, &option, &value);
-      if (err)
-      {
-         return err;
-      }
-
-      if (option)
-      {
-         /* handle option in 'option' */
-
-         /* Check for standard action name */
-         const struct action_name * action = action_names;
-
-         while ( (action->name != NULL) && (0 != strcmpic(action->name, option)) )
-         {
-            action++;
-         }
-         if (action->name != NULL)
-         {
-            /* Found it */
-            cur_action->mask &= action->mask;
-            cur_action->add  &= action->mask;
-            cur_action->add  |= action->add;
-
-            switch (action->takes_value)
-            {
-            case AV_NONE:
-               /* ignore any option. */
-               break;
-            case AV_ADD_STRING:
-               {
-                  /* add single string. */
-
-                  if ((value == NULL) || (*value == '\0'))
-                  {
-                     if (0 != strcmpic(action->name, "block"))
-                     {
-                        /*
-                         * XXX: Temporary backwards compatibility hack.
-                         * XXX: should include line number.
-                         */
-                        value = "No reason specified.";
-                        log_error(LOG_LEVEL_ERROR,
-                           "block action without reason found. This may "
-                           "become a fatal error in future versions.");
-                     }
-                     else
-                     {
-                        return JB_ERR_PARSE;
-                     }
-                  }
-                  /* FIXME: should validate option string here */
-                  freez (cur_action->string[action->index]);
-                  cur_action->string[action->index] = strdup(value);
-                  if (NULL == cur_action->string[action->index])
-                  {
-                     return JB_ERR_MEMORY;
-                  }
-                  break;
-               }
-            case AV_REM_STRING:
-               {
-                  /* remove single string. */
-
-                  freez (cur_action->string[action->index]);
-                  break;
-               }
-            case AV_ADD_MULTI:
-               {
-                  /* append multi string. */
-
-                  struct list * remove_p = cur_action->multi_remove[action->index];
-                  struct list * add_p    = cur_action->multi_add[action->index];
-
-                  if ((value == NULL) || (*value == '\0'))
-                  {
-                     return JB_ERR_PARSE;
-                  }
-
-                  list_remove_item(remove_p, value);
-                  err = enlist_unique(add_p, value, 0);
-                  if (err)
-                  {
-                     return err;
-                  }
-                  break;
-               }
-            case AV_REM_MULTI:
-               {
-                  /* remove multi string. */
-
-                  struct list * remove_p = cur_action->multi_remove[action->index];
-                  struct list * add_p    = cur_action->multi_add[action->index];
-
-                  if ( (value == NULL) || (*value == '\0')
-                     || ((*value == '*') && (value[1] == '\0')) )
-                  {
-                     /*
-                      * no option, or option == "*".
-                      *
-                      * Remove *ALL*.
-                      */
-                     list_remove_all(remove_p);
-                     list_remove_all(add_p);
-                     cur_action->multi_remove_all[action->index] = 1;
-                  }
-                  else
-                  {
-                     /* Valid option - remove only 1 option */
-
-                     if ( !cur_action->multi_remove_all[action->index] )
-                     {
-                        /* there isn't a catch-all in the remove list already */
-                        err = enlist_unique(remove_p, value, 0);
-                        if (err)
-                        {
-                           return err;
-                        }
-                     }
-                     list_remove_item(add_p, value);
-                  }
-                  break;
-               }
-            default:
-               /* Shouldn't get here unless there's memory corruption. */
-               assert(0);
-               return JB_ERR_PARSE;
-            }
-         }
-         else
-         {
-            /* try user aliases. */
-            const struct action_alias * alias = alias_list;
-
-            while ( (alias != NULL) && (0 != strcmpic(alias->name, option)) )
-            {
-               alias = alias->next;
-            }
-            if (alias != NULL)
-            {
-               /* Found it */
-               merge_actions(cur_action, alias->action);
-            }
-            else if (((size_t)2 < strlen(option)) && action_used_to_be_valid(option+1))
-            {
-               log_error(LOG_LEVEL_ERROR, "Action '%s' is no longer valid "
-                  "in this Privoxy release. Ignored.", option+1);
-            }
-            else if (((size_t)2 < strlen(option)) && 0 == strcmpic(option+1, "hide-forwarded-for-headers"))
-            {
-               log_error(LOG_LEVEL_FATAL, "The action 'hide-forwarded-for-headers' "
-                  "is no longer valid in this Privoxy release. "
-                  "Use 'change-x-forwarded-for' instead.");
-            }
-            else
-            {
-               /* Bad action name */
-               /*
-                * XXX: This is a fatal error and Privoxy will later on exit
-                * in load_one_actions_file() because of an "invalid line".
-                *
-                * It would be preferable to name the offending option in that
-                * error message, but currently there is no way to do that and
-                * we have to live with two error messages for basically the
-                * same reason.
-                */
-               log_error(LOG_LEVEL_ERROR, "Unknown action or alias: %s", option);
-               return JB_ERR_PARSE;
-            }
-         }
-      }
-   }
-
-   return JB_ERR_OK;
-}
-
-
-/*********************************************************************
- *
- * Function    :  init_current_action
- *
- * Description :  Zero out an action.
- *
- * Parameters  :
- *          1  :  dest = An uninitialized current_action_spec.
- *
- * Returns     :  N/A
- *
- *********************************************************************/
-void init_current_action (struct current_action_spec *dest)
-{
-   memset(dest, '\0', sizeof(*dest));
-
-   dest->flags = ACTION_MOST_COMPATIBLE;
-}
-
-
-/*********************************************************************
- *
- * Function    :  init_action
- *
- * Description :  Zero out an action.
- *
- * Parameters  :
- *          1  :  dest = An uninitialized action_spec.
- *
- * Returns     :  N/A
- *
- *********************************************************************/
-void init_action (struct action_spec *dest)
-{
-   memset(dest, '\0', sizeof(*dest));
-}
-
-
-/*********************************************************************
- *
- * Function    :  merge_current_action
- *
- * Description :  Merge two actions together.
- *                Similar to "dest += src".
- *                Differences between this and merge_actions()
- *                is that this one doesn't allocate memory for
- *                strings (so "src" better be in memory for at least
- *                as long as "dest" is, and you'd better free
- *                "dest" using "free_current_action").
- *                Also, there is no  mask or remove lists in dest.
- *                (If we're applying it to a URL, we don't need them)
- *
- * Parameters  :
- *          1  :  dest = Current actions, to modify.
- *          2  :  src = Action to add.
- *
- * Returns  0  :  no error
- *        !=0  :  error, probably JB_ERR_MEMORY.
- *
- *********************************************************************/
-jb_err merge_current_action (struct current_action_spec *dest,
-                             const struct action_spec *src)
-{
-   int i;
-   jb_err err = JB_ERR_OK;
-
-   dest->flags  &= src->mask;
-   dest->flags  |= src->add;
-
-   for (i = 0; i < ACTION_STRING_COUNT; i++)
-   {
-      char * str = src->string[i];
-      if (str)
-      {
-         str = strdup(str);
-         if (!str)
-         {
-            return JB_ERR_MEMORY;
-         }
-         freez(dest->string[i]);
-         dest->string[i] = str;
-      }
-   }
-
-   for (i = 0; i < ACTION_MULTI_COUNT; i++)
-   {
-      if (src->multi_remove_all[i])
-      {
-         /* Remove everything from dest, then add src->multi_add */
-         err = list_duplicate(dest->multi[i], src->multi_add[i]);
-         if (err)
-         {
-            return err;
-         }
-      }
-      else
-      {
-         list_remove_list(dest->multi[i], src->multi_remove[i]);
-         err = list_append_list_unique(dest->multi[i], src->multi_add[i]);
-         if (err)
-         {
-            return err;
-         }
-      }
-   }
-   return err;
-}
-
-#if 0
-/*********************************************************************
- *
- * Function    :  update_action_bits_for_all_tags
- *
- * Description :  Updates the action bits based on all matching tags.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *
- * Returns     :  0 if no tag matched, or
- *                1 otherwise
- *
- *********************************************************************/
-int update_action_bits_for_all_tags(struct client_state *csp)
-{
-   struct list_entry *tag;
-   int updated = 0;
-
-   for (tag = csp->tags->first; tag != NULL; tag = tag->next)
-   {
-      if (update_action_bits_for_tag(csp, tag->str))
-      {
-         updated = 1;
-      }
-   }
-
-   return updated;
-}
-#endif
-
-/*********************************************************************
- *
- * Function    :  update_action_bits_for_tag
- *
- * Description :  Updates the action bits based on the action sections
- *                whose tag patterns match a provided tag.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  tag = The tag on which the update should be based on
- *
- * Returns     :  0 if no tag matched, or
- *                1 otherwise
- *
- *********************************************************************/
-int update_action_bits_for_tag(struct client_state *csp, const char *tag)
-{
-   struct file_list *fl;
-   struct url_actions *b;
-
-   int updated = 0;
-   int i;
-
-   assert(tag);
-   assert(list_contains_item(csp->tags, tag));
-
-   /* Run through all action files, */
-   for (i = 0; i < MAX_AF_FILES; i++)
-   {
-      if (((fl = csp->actions_list[i]) == NULL) || ((b = fl->f) == NULL))
-      {
-         /* Skip empty files */
-         continue;
-      }
-
-      /* and through all the action patterns, */
-      for (b = b->next; NULL != b; b = b->next)
-      {
-         /* skip the URL patterns, */
-         if (NULL == b->url->tag_regex)
-         {
-            continue;
-         }
-
-         /* and check if one of the tag patterns matches the tag, */
-         if (0 == regexec(b->url->tag_regex, tag, 0, NULL, 0))
-         {
-            /* if it does, update the action bit map, */
-            if (merge_current_action(csp->action, b->action))
-            {
-               log_error(LOG_LEVEL_ERROR,
-                  "Out of memory while changing action bits");
-            }
-            /* and signal the change. */
-            updated = 1;
-         }
-      }
-   }
-
-   return updated;
-}
-
-
-/*********************************************************************
- *
- * Function    :  free_current_action
- *
- * Description :  Free memory used by a current_action_spec.
- *                Does not free the current_action_spec itself.
- *
- * Parameters  :
- *          1  :  src = Source to free.
- *
- * Returns     :  N/A
- *
- *********************************************************************/
-void free_current_action (struct current_action_spec *src)
-{
-   int i;
-
-   for (i = 0; i < ACTION_STRING_COUNT; i++)
-   {
-      freez(src->string[i]);
-   }
-
-   for (i = 0; i < ACTION_MULTI_COUNT; i++)
-   {
-      destroy_list(src->multi[i]);
-   }
-
-   memset(src, '\0', sizeof(*src));
-}
-
-
-static struct file_list *current_actions_file[MAX_AF_FILES]  = {
-   NULL, NULL, NULL, NULL, NULL,
-   NULL, NULL, NULL, NULL, NULL
-};
-
-
-#ifdef FEATURE_GRACEFUL_TERMINATION
-/*********************************************************************
- *
- * Function    :  unload_current_actions_file
- *
- * Description :  Unloads current actions file - reset to state at
- *                beginning of program.
- *
- * Parameters  :  None
- *
- * Returns     :  N/A
- *
- *********************************************************************/
-void unload_current_actions_file(void)
-{
-   int i;
-
-   for (i = 0; i < MAX_AF_FILES; i++)
-   {
-      if (current_actions_file[i])
-      {
-         current_actions_file[i]->unloader = unload_actions_file;
-         current_actions_file[i] = NULL;
-      }
-   }
-}
-#endif /* FEATURE_GRACEFUL_TERMINATION */
-
-
-/*********************************************************************
- *
- * Function    :  unload_actions_file
- *
- * Description :  Unloads an actions module.
- *
- * Parameters  :
- *          1  :  file_data = the data structure associated with the
- *                            actions file.
- *
- * Returns     :  N/A
- *
- *********************************************************************/
-void unload_actions_file(void *file_data)
-{
-   struct url_actions * next;
-   struct url_actions * cur = (struct url_actions *)file_data;
-   while (cur != NULL)
-   {
-      next = cur->next;
-      free_url_spec(cur->url);
-      if ((next == NULL) || (next->action != cur->action))
-      {
-         /*
-          * As the action settings might be shared,
-          * we can only free them if the current
-          * url pattern is the last one, or if the
-          * next one is using different settings.
-          */
-         free_action_spec(cur->action);
-      }
-      freez(cur);
-      cur = next;
-   }
-}
-
-
-/*********************************************************************
- *
- * Function    :  free_alias_list
- *
- * Description :  Free memory used by a list of aliases.
- *
- * Parameters  :
- *          1  :  alias_list = Linked list to free.
- *
- * Returns     :  N/A
- *
- *********************************************************************/
-void free_alias_list(struct action_alias *alias_list)
-{
-   while (alias_list != NULL)
-   {
-      struct action_alias * next = alias_list->next;
-      alias_list->next = NULL;
-      freez(alias_list->name);
-      free_action(alias_list->action);
-      free(alias_list);
-      alias_list = next;
-   }
-}
-
-
-/*********************************************************************
- *
- * Function    :  load_action_files
- *
- * Description :  Read and parse all the action files and add to files
- *                list.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *
- * Returns     :  0 => Ok, everything else is an error.
- *
- *********************************************************************/
-int load_action_files(struct client_state *csp)
-{
-   int i;
-   int result;
-
-   for (i = 0; i < MAX_AF_FILES; i++)
-   {
-      if (csp->config->actions_file[i])
-      {
-         result = load_one_actions_file(csp, i);
-         if (result)
-         {
-            return result;
-         }
-      }
-      else if (current_actions_file[i])
-      {
-         current_actions_file[i]->unloader = unload_actions_file;
-         current_actions_file[i] = NULL;
-      }
-   }
-
-   return 0;
-}
-
-/*********************************************************************
- *
- * Function    :  load_one_actions_file
- *
- * Description :  Read and parse a action file and add to files
- *                list.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  fileid = File index to load.
- *
- * Returns     :  0 => Ok, everything else is an error.
- *
- *********************************************************************/
-static int load_one_actions_file(struct client_state *csp, int fileid)
-{
-
-   /*
-    * Parser mode.
-    * Note: Keep these in the order they occur in the file, they are
-    * sometimes tested with <=
-    */
-#define MODE_START_OF_FILE 1
-#define MODE_SETTINGS      2
-#define MODE_DESCRIPTION   3
-#define MODE_ALIAS         4
-#define MODE_ACTIONS       5
-
-   int mode = MODE_START_OF_FILE;
-
-   FILE *fp;
-   struct url_actions *last_perm;
-   struct url_actions *perm;
-   char  buf[BUFFER_SIZE];
-   struct file_list *fs;
-   struct action_spec * cur_action = NULL;
-   int cur_action_used = 0;
-   struct action_alias * alias_list = NULL;
-   unsigned long linenum = 0;
-
-   if (!check_file_changed(current_actions_file[fileid], csp->config->actions_file[fileid], &fs))
-   {
-      /* No need to load */
-      csp->actions_list[fileid] = current_actions_file[fileid];
-      return 0;
-   }
-   if (!fs)
-   {
-      log_error(LOG_LEVEL_FATAL, "can't load actions file '%s': %E. "
-         "Note that beginning with Privoxy 3.0.7, actions files have to be specified "
-         "with their complete file names.", csp->config->actions_file[fileid]);
-      return 1; /* never get here */
-   }
-
-   fs->f = last_perm = (struct url_actions *)zalloc(sizeof(*last_perm));
-   if (last_perm == NULL)
-   {
-      log_error(LOG_LEVEL_FATAL, "can't load actions file '%s': out of memory!",
-                csp->config->actions_file[fileid]);
-      return 1; /* never get here */
-   }
-
-   if ((fp = fopen(csp->config->actions_file[fileid], "r")) == NULL)
-   {
-      log_error(LOG_LEVEL_FATAL, "can't load actions file '%s': error opening file: %E",
-                csp->config->actions_file[fileid]);
-      return 1; /* never get here */
-   }
-
-   while (read_config_line(buf, sizeof(buf), fp, &linenum) != NULL)
-   {
-      if (*buf == '{')
-      {
-         /* It's a header block */
-         if (buf[1] == '{')
-         {
-            /* It's {{settings}} or {{alias}} */
-            size_t len = strlen(buf);
-            char * start = buf + 2;
-            char * end = buf + len - 1;
-            if ((len < (size_t)5) || (*end-- != '}') || (*end-- != '}'))
-            {
-               /* too short */
-               fclose(fp);
-               log_error(LOG_LEVEL_FATAL,
-                  "can't load actions file '%s': invalid line (%lu): %s", 
-                  csp->config->actions_file[fileid], linenum, buf);
-               return 1; /* never get here */
-            }
-
-            /* Trim leading and trailing whitespace. */
-            end[1] = '\0';
-            chomp(start);
-
-            if (*start == '\0')
-            {
-               /* too short */
-               fclose(fp);
-               log_error(LOG_LEVEL_FATAL,
-                  "can't load actions file '%s': invalid line (%lu): {{ }}",
-                  csp->config->actions_file[fileid], linenum);
-               return 1; /* never get here */
-            }
-
-            /*
-             * An actionsfile can optionally contain the following blocks.
-             * They *MUST* be in this order, to simplify processing:
-             *
-             * {{settings}}
-             * name=value...
-             *
-             * {{description}}
-             * ...free text, format TBD, but no line may start with a '{'...
-             *
-             * {{alias}}
-             * name=actions...
-             *
-             * The actual actions must be *after* these special blocks.
-             * None of these special blocks may be repeated.
-             *
-             */
-            if (0 == strcmpic(start, "settings"))
-            {
-               /* it's a {{settings}} block */
-               if (mode >= MODE_SETTINGS)
-               {
-                  /* {{settings}} must be first thing in file and must only
-                   * appear once.
-                   */
-                  fclose(fp);
-                  log_error(LOG_LEVEL_FATAL,
-                     "can't load actions file '%s': line %lu: {{settings}} must only appear once, and it must be before anything else.",
-                     csp->config->actions_file[fileid], linenum);
-               }
-               mode = MODE_SETTINGS;
-            }
-            else if (0 == strcmpic(start, "description"))
-            {
-               /* it's a {{description}} block */
-               if (mode >= MODE_DESCRIPTION)
-               {
-                  /* {{description}} is a singleton and only {{settings}} may proceed it
-                   */
-                  fclose(fp);
-                  log_error(LOG_LEVEL_FATAL,
-                     "can't load actions file '%s': line %lu: {{description}} must only appear once, and only a {{settings}} block may be above it.",
-                     csp->config->actions_file[fileid], linenum);
-               }
-               mode = MODE_DESCRIPTION;
-            }
-            else if (0 == strcmpic(start, "alias"))
-            {
-               /* it's an {{alias}} block */
-               if (mode >= MODE_ALIAS)
-               {
-                  /* {{alias}} must be first thing in file, possibly after
-                   * {{settings}} and {{description}}
-                   *
-                   * {{alias}} must only appear once.
-                   *
-                   * Note that these are new restrictions introduced in
-                   * v2.9.10 in order to make actionsfile editing simpler.
-                   * (Otherwise, reordering actionsfile entries without
-                   * completely rewriting the file becomes non-trivial)
-                   */
-                  fclose(fp);
-                  log_error(LOG_LEVEL_FATAL,
-                     "can't load actions file '%s': line %lu: {{alias}} must only appear once, and it must be before all actions.",
-                     csp->config->actions_file[fileid], linenum);
-               }
-               mode = MODE_ALIAS;
-            }
-            else
-            {
-               /* invalid {{something}} block */
-               fclose(fp);
-               log_error(LOG_LEVEL_FATAL,
-                  "can't load actions file '%s': invalid line (%lu): {{%s}}",
-                  csp->config->actions_file[fileid], linenum, start);
-               return 1; /* never get here */
-            }
-         }
-         else
-         {
-            /* It's an actions block */
-
-            char  actions_buf[BUFFER_SIZE];
-            char * end;
-
-            /* set mode */
-            mode    = MODE_ACTIONS;
-
-            /* free old action */
-            if (cur_action)
-            {
-               if (!cur_action_used)
-               {
-                  free_action_spec(cur_action);
-               }
-               cur_action = NULL;
-            }
-            cur_action_used = 0;
-            cur_action = (struct action_spec *)zalloc(sizeof(*cur_action));
-            if (cur_action == NULL)
-            {
-               fclose(fp);
-               log_error(LOG_LEVEL_FATAL,
-                  "can't load actions file '%s': out of memory",
-                  csp->config->actions_file[fileid]);
-               return 1; /* never get here */
-            }
-            init_action(cur_action);
-
-            /* trim { */
-            strlcpy(actions_buf, buf + 1, sizeof(actions_buf));
-
-            /* check we have a trailing } and then trim it */
-            end = actions_buf + strlen(actions_buf) - 1;
-            if (*end != '}')
-            {
-               /* No closing } */
-               fclose(fp);
-               log_error(LOG_LEVEL_FATAL,
-                  "can't load actions file '%s': invalid line (%lu): %s",
-                  csp->config->actions_file[fileid], linenum, buf);
-               return 1; /* never get here */
-            }
-            *end = '\0';
-
-            /* trim any whitespace immediately inside {} */
-            chomp(actions_buf);
-
-            if (get_actions(actions_buf, alias_list, cur_action))
-            {
-               /* error */
-               fclose(fp);
-               log_error(LOG_LEVEL_FATAL,
-                  "can't load actions file '%s': invalid line (%lu): %s",
-                  csp->config->actions_file[fileid], linenum, buf);
-               return 1; /* never get here */
-            }
-         }
-      }
-      else if (mode == MODE_SETTINGS)
-      {
-         /*
-          * Part of the {{settings}} block.
-          * For now only serves to check if the file's minimum Privoxy
-          * version requirement is met, but we may want to read & check
-          * permissions when we go multi-user.
-          */
-         if (!strncmp(buf, "for-privoxy-version=", 20))
-         {
-            char *version_string, *fields[3];
-            int num_fields;
-
-            if ((version_string = strdup(buf + 20)) == NULL)
-            {
-               fclose(fp);
-               log_error(LOG_LEVEL_FATAL,
-                         "can't load actions file '%s': out of memory!",
-                         csp->config->actions_file[fileid]);
-               return 1; /* never get here */
-            }
-            
-            num_fields = ssplit(version_string, ".", fields, 3, TRUE, FALSE);
-
-            if (num_fields < 1 || atoi(fields[0]) == 0)
-            {
-               log_error(LOG_LEVEL_ERROR,
-                 "While loading actions file '%s': invalid line (%lu): %s",
-                  csp->config->actions_file[fileid], linenum, buf);
-            }
-            else if (                      atoi(fields[0]) > VERSION_MAJOR
-                     || (num_fields > 1 && atoi(fields[1]) > VERSION_MINOR)
-                     || (num_fields > 2 && atoi(fields[2]) > VERSION_POINT))
-            {
-               fclose(fp);
-               log_error(LOG_LEVEL_FATAL,
-                         "Actions file '%s', line %lu requires newer Privoxy version: %s",
-                         csp->config->actions_file[fileid], linenum, buf );
-               return 1; /* never get here */
-            }
-            free(version_string);
-         }
-      }
-      else if (mode == MODE_DESCRIPTION)
-      {
-         /*
-          * Part of the {{description}} block.
-          * Ignore for now.
-          */
-      }
-      else if (mode == MODE_ALIAS)
-      {
-         /*
-          * define an alias
-          */
-         char  actions_buf[BUFFER_SIZE];
-         struct action_alias * new_alias;
-
-         char * start = strchr(buf, '=');
-         char * end = start;
-
-         if ((start == NULL) || (start == buf))
-         {
-            log_error(LOG_LEVEL_FATAL,
-               "can't load actions file '%s': invalid alias line (%lu): %s",
-               csp->config->actions_file[fileid], linenum, buf);
-            return 1; /* never get here */
-         }
-
-         if ((new_alias = zalloc(sizeof(*new_alias))) == NULL)
-         {
-            fclose(fp);
-            log_error(LOG_LEVEL_FATAL,
-               "can't load actions file '%s': out of memory!",
-               csp->config->actions_file[fileid]);
-            return 1; /* never get here */
-         }
-
-         /* Eat any the whitespace before the '=' */
-         end--;
-         while ((*end == ' ') || (*end == '\t'))
-         {
-            /*
-             * we already know we must have at least 1 non-ws char
-             * at start of buf - no need to check
-             */
-            end--;
-         }
-         end[1] = '\0';
-
-         /* Eat any the whitespace after the '=' */
-         start++;
-         while ((*start == ' ') || (*start == '\t'))
-         {
-            start++;
-         }
-         if (*start == '\0')
-         {
-            log_error(LOG_LEVEL_FATAL,
-               "can't load actions file '%s': invalid alias line (%lu): %s",
-               csp->config->actions_file[fileid], linenum, buf);
-            return 1; /* never get here */
-         }
-
-         if ((new_alias->name = strdup(buf)) == NULL)
-         {
-            fclose(fp);
-            log_error(LOG_LEVEL_FATAL,
-               "can't load actions file '%s': out of memory!",
-               csp->config->actions_file[fileid]);
-            return 1; /* never get here */
-         }
-
-         strlcpy(actions_buf, start, sizeof(actions_buf));
-
-         if (get_actions(actions_buf, alias_list, new_alias->action))
-         {
-            /* error */
-            fclose(fp);
-            log_error(LOG_LEVEL_FATAL,
-               "can't load actions file '%s': invalid alias line (%lu): %s = %s",
-               csp->config->actions_file[fileid], linenum, buf, start);
-            return 1; /* never get here */
-         }
-
-         /* add to list */
-         new_alias->next = alias_list;
-         alias_list = new_alias;
-      }
-      else if (mode == MODE_ACTIONS)
-      {
-         /* it's a URL pattern */
-
-         /* allocate a new node */
-         if ((perm = zalloc(sizeof(*perm))) == NULL)
-         {
-            fclose(fp);
-            log_error(LOG_LEVEL_FATAL,
-               "can't load actions file '%s': out of memory!",
-               csp->config->actions_file[fileid]);
-            return 1; /* never get here */
-         }
-
-         perm->action = cur_action;
-         cur_action_used = 1;
-
-         /* Save the URL pattern */
-         if (create_url_spec(perm->url, buf))
-         {
-            fclose(fp);
-            log_error(LOG_LEVEL_FATAL,
-               "can't load actions file '%s': line %lu: cannot create URL pattern from: %s",
-               csp->config->actions_file[fileid], linenum, buf);
-            return 1; /* never get here */
-         }
-
-         /* add it to the list */
-         last_perm->next = perm;
-         last_perm = perm;
-      }
-      else if (mode == MODE_START_OF_FILE)
-      {
-         /* oops - please have a {} line as 1st line in file. */
-         fclose(fp);
-         log_error(LOG_LEVEL_FATAL,
-            "can't load actions file '%s': first needed line (%lu) is invalid: %s",
-            csp->config->actions_file[fileid], linenum, buf);
-         return 1; /* never get here */
-      }
-      else
-      {
-         /* How did we get here? This is impossible! */
-         fclose(fp);
-         log_error(LOG_LEVEL_FATAL,
-            "can't load actions file '%s': INTERNAL ERROR - mode = %d",
-            csp->config->actions_file[fileid], mode);
-         return 1; /* never get here */
-      }
-   }
-
-   fclose(fp);
-
-   if (!cur_action_used)
-   {
-      free_action_spec(cur_action);
-   }
-   free_alias_list(alias_list);
-
-   /* the old one is now obsolete */
-   if (current_actions_file[fileid])
-   {
-      current_actions_file[fileid]->unloader = unload_actions_file;
-   }
-
-   fs->next    = files->next;
-   files->next = fs;
-   current_actions_file[fileid] = fs;
-
-   csp->actions_list[fileid] = fs;
-
-   return(0);
-
-}
-
-
-/*********************************************************************
- *
- * Function    :  actions_to_text
- *
- * Description :  Converts a actionsfile entry from the internal
- *                structure into a text line.  The output is split
- *                into one line for each action with line continuation. 
- *
- * Parameters  :
- *          1  :  action = The action to format.
- *
- * Returns     :  A string.  Caller must free it.
- *                NULL on out-of-memory error.
- *
- *********************************************************************/
-char * actions_to_text(const struct action_spec *action)
-{
-   unsigned long mask = action->mask;
-   unsigned long add  = action->add;
-   char *result = strdup("");
-   struct list_entry * lst;
-
-   /* sanity - prevents "-feature +feature" */
-   mask |= add;
-
-
-#define DEFINE_ACTION_BOOL(__name, __bit)          \
-   if (!(mask & __bit))                            \
-   {                                               \
-      string_append(&result, " -" __name " \\\n"); \
-   }                                               \
-   else if (add & __bit)                           \
-   {                                               \
-      string_append(&result, " +" __name " \\\n"); \
-   }
-
-#define DEFINE_ACTION_STRING(__name, __bit, __index)   \
-   if (!(mask & __bit))                                \
-   {                                                   \
-      string_append(&result, " -" __name " \\\n");     \
-   }                                                   \
-   else if (add & __bit)                               \
-   {                                                   \
-      string_append(&result, " +" __name "{");         \
-      string_append(&result, action->string[__index]); \
-      string_append(&result, "} \\\n");                \
-   }
-
-#define DEFINE_ACTION_MULTI(__name, __index)         \
-   if (action->multi_remove_all[__index])            \
-   {                                                 \
-      string_append(&result, " -" __name " \\\n");   \
-   }                                                 \
-   else                                              \
-   {                                                 \
-      lst = action->multi_remove[__index]->first;    \
-      while (lst)                                    \
-      {                                              \
-         string_append(&result, " -" __name "{");    \
-         string_append(&result, lst->str);           \
-         string_append(&result, "} \\\n");           \
-         lst = lst->next;                            \
-      }                                              \
-   }                                                 \
-   lst = action->multi_add[__index]->first;          \
-   while (lst)                                       \
-   {                                                 \
-      string_append(&result, " +" __name "{");       \
-      string_append(&result, lst->str);              \
-      string_append(&result, "} \\\n");              \
-      lst = lst->next;                               \
-   }
-
-#define DEFINE_ACTION_ALIAS 0 /* No aliases for output */
-
-#include "actionlist.h"
-
-#undef DEFINE_ACTION_MULTI
-#undef DEFINE_ACTION_STRING
-#undef DEFINE_ACTION_BOOL
-#undef DEFINE_ACTION_ALIAS
-
-   return result;
-}
-
-
-/*********************************************************************
- *
- * Function    :  actions_to_html
- *
- * Description :  Converts a actionsfile entry from numeric form
- *                ("mask" and "add") to a <br>-seperated HTML string
- *                in which each action is linked to its chapter in
- *                the user manual.
- *
- * Parameters  :
- *          1  :  csp    = Client state (for config)
- *          2  :  action = Action spec to be converted
- *
- * Returns     :  A string.  Caller must free it.
- *                NULL on out-of-memory error.
- *
- *********************************************************************/
-char * actions_to_html(const struct client_state *csp,
-                       const struct action_spec *action)
-{
-   unsigned long mask = action->mask;
-   unsigned long add  = action->add;
-   char *result = strdup("");
-   struct list_entry * lst;
-
-   /* sanity - prevents "-feature +feature" */
-   mask |= add;
-
-
-#define DEFINE_ACTION_BOOL(__name, __bit)       \
-   if (!(mask & __bit))                         \
-   {                                            \
-      string_append(&result, "\n<br>-");        \
-      string_join(&result, add_help_link(__name, csp->config)); \
-   }                                            \
-   else if (add & __bit)                        \
-   {                                            \
-      string_append(&result, "\n<br>+");        \
-      string_join(&result, add_help_link(__name, csp->config)); \
-   }
-
-#define DEFINE_ACTION_STRING(__name, __bit, __index) \
-   if (!(mask & __bit))                              \
-   {                                                 \
-      string_append(&result, "\n<br>-");             \
-      string_join(&result, add_help_link(__name, csp->config)); \
-   }                                                 \
-   else if (add & __bit)                             \
-   {                                                 \
-      string_append(&result, "\n<br>+");             \
-      string_join(&result, add_help_link(__name, csp->config)); \
-      string_append(&result, "{");                   \
-      string_join(&result, html_encode(action->string[__index])); \
-      string_append(&result, "}");                   \
-   }
-
-#define DEFINE_ACTION_MULTI(__name, __index)          \
-   if (action->multi_remove_all[__index])             \
-   {                                                  \
-      string_append(&result, "\n<br>-");              \
-      string_join(&result, add_help_link(__name, csp->config)); \
-   }                                                  \
-   else                                               \
-   {                                                  \
-      lst = action->multi_remove[__index]->first;     \
-      while (lst)                                     \
-      {                                               \
-         string_append(&result, "\n<br>-");           \
-         string_join(&result, add_help_link(__name, csp->config)); \
-         string_append(&result, "{");                 \
-         string_join(&result, html_encode(lst->str)); \
-         string_append(&result, "}");                 \
-         lst = lst->next;                             \
-      }                                               \
-   }                                                  \
-   lst = action->multi_add[__index]->first;           \
-   while (lst)                                        \
-   {                                                  \
-      string_append(&result, "\n<br>+");              \
-      string_join(&result, add_help_link(__name, csp->config)); \
-      string_append(&result, "{");                    \
-      string_join(&result, html_encode(lst->str));    \
-      string_append(&result, "}");                    \
-      lst = lst->next;                                \
-   }
-
-#define DEFINE_ACTION_ALIAS 0 /* No aliases for output */
-
-#include "actionlist.h"
-
-#undef DEFINE_ACTION_MULTI
-#undef DEFINE_ACTION_STRING
-#undef DEFINE_ACTION_BOOL
-#undef DEFINE_ACTION_ALIAS
-
-   /* trim leading <br> */
-   if (result && *result)
-   {
-      char * s = result;
-      result = strdup(result + 5);
-      free(s);
-   }
-
-   return result;
-}
-
-
-/*********************************************************************
- *
- * Function    :  current_actions_to_html
- *
- * Description :  Converts a curren action spec to a <br> seperated HTML
- *                text in which each action is linked to its chapter in
- *                the user manual.
- *
- * Parameters  :
- *          1  :  csp    = Client state (for config) 
- *          2  :  action = Current action spec to be converted
- *
- * Returns     :  A string.  Caller must free it.
- *                NULL on out-of-memory error.
- *
- *********************************************************************/
-char *current_action_to_html(const struct client_state *csp,
-                             const struct current_action_spec *action)
-{
-   unsigned long flags  = action->flags;
-   struct list_entry * lst;
-   char *result   = strdup("");
-   char *active   = strdup("");
-   char *inactive = strdup("");
-
-#define DEFINE_ACTION_BOOL(__name, __bit)  \
-   if (flags & __bit)                      \
-   {                                       \
-      string_append(&active, "\n<br>+");   \
-      string_join(&active, add_help_link(__name, csp->config)); \
-   }                                       \
-   else                                    \
-   {                                       \
-      string_append(&inactive, "\n<br>-"); \
-      string_join(&inactive, add_help_link(__name, csp->config)); \
-   }
-
-#define DEFINE_ACTION_STRING(__name, __bit, __index)   \
-   if (flags & __bit)                                  \
-   {                                                   \
-      string_append(&active, "\n<br>+");               \
-      string_join(&active, add_help_link(__name, csp->config)); \
-      string_append(&active, "{");                     \
-      string_join(&active, html_encode(action->string[__index])); \
-      string_append(&active, "}");                     \
-   }                                                   \
-   else                                                \
-   {                                                   \
-      string_append(&inactive, "\n<br>-");             \
-      string_join(&inactive, add_help_link(__name, csp->config)); \
-   }
-
-#define DEFINE_ACTION_MULTI(__name, __index)           \
-   lst = action->multi[__index]->first;                \
-   if (lst == NULL)                                    \
-   {                                                   \
-      string_append(&inactive, "\n<br>-");             \
-      string_join(&inactive, add_help_link(__name, csp->config)); \
-   }                                                   \
-   else                                                \
-   {                                                   \
-      while (lst)                                      \
-      {                                                \
-         string_append(&active, "\n<br>+");            \
-         string_join(&active, add_help_link(__name, csp->config)); \
-         string_append(&active, "{");                  \
-         string_join(&active, html_encode(lst->str));  \
-         string_append(&active, "}");                  \
-         lst = lst->next;                              \
-      }                                                \
-   }
-
-#define DEFINE_ACTION_ALIAS 0 /* No aliases for output */
-
-#include "actionlist.h"
-
-#undef DEFINE_ACTION_MULTI
-#undef DEFINE_ACTION_STRING
-#undef DEFINE_ACTION_BOOL
-#undef DEFINE_ACTION_ALIAS
-
-   if (active != NULL)
-   {
-      string_append(&result, active);
-      freez(active);
-   }
-   string_append(&result, "\n<br>");
-   if (inactive != NULL)
-   {
-      string_append(&result, inactive);
-      freez(inactive);
-   }
-   return result;
-}
diff --git a/external/privoxy/actions.h b/external/privoxy/actions.h
deleted file mode 100644
index 733a853..0000000
--- a/external/privoxy/actions.h
+++ /dev/null
@@ -1,187 +0,0 @@
-#ifndef ACTIONS_H_INCLUDED
-#define ACTIONS_H_INCLUDED
-#define ACTIONS_H_VERSION "$Id: actions.h,v 1.18 2008/03/30 14:52:00 fabiankeil Exp $"
-/*********************************************************************
- *
- * File        :  $Source: /cvsroot/ijbswa/current/actions.h,v $
- *
- * Purpose     :  Declares functions to work with actions files
- *                Functions declared include: FIXME
- *
- * Copyright   :  Written by and Copyright (C) 2001-2007 the SourceForge
- *                Privoxy team. http://www.privoxy.org/
- *
- *                Based on the Internet Junkbuster originally written
- *                by and Copyright (C) 1997 Anonymous Coders and 
- *                Junkbusters Corporation.  http://www.junkbusters.com
- *
- *                This program is free software; you can redistribute it 
- *                and/or modify it under the terms of the GNU General
- *                Public License as published by the Free Software
- *                Foundation; either version 2 of the License, or (at
- *                your option) any later version.
- *
- *                This program is distributed in the hope that it will
- *                be useful, but WITHOUT ANY WARRANTY; without even the
- *                implied warranty of MERCHANTABILITY or FITNESS FOR A
- *                PARTICULAR PURPOSE.  See the GNU General Public
- *                License for more details.
- *
- *                The GNU General Public License should be included with
- *                this file.  If not, you can view it at
- *                http://www.gnu.org/copyleft/gpl.html
- *                or write to the Free Software Foundation, Inc., 59
- *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * Revisions   :
- *    $Log: actions.h,v $
- *    Revision 1.18  2008/03/30 14:52:00  fabiankeil
- *    Rename load_actions_file() and load_re_filterfile()
- *    as they load multiple files "now".
- *
- *    Revision 1.17  2008/01/28 20:17:40  fabiankeil
- *    - Mark some parameters as immutable.
- *    - Hide update_action_bits_for_all_tags() while it's unused.
- *
- *    Revision 1.16  2007/04/17 18:21:45  fabiankeil
- *    Split update_action_bits() into
- *    update_action_bits_for_all_tags()
- *    and update_action_bits_for_tag().
- *
- *    Revision 1.15  2007/04/15 16:39:20  fabiankeil
- *    Introduce tags as alternative way to specify which
- *    actions apply to a request. At the moment tags can be
- *    created based on client and server headers.
- *
- *    Revision 1.14  2006/07/18 14:48:45  david__schmidt
- *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
- *    with what was really the latest development (the v_3_0_branch branch)
- *
- *    Revision 1.12  2002/05/06 07:56:50  oes
- *    Made actions_to_html independent of FEATURE_CGI_EDIT_ACTIONS
- *
- *    Revision 1.11  2002/04/30 11:14:52  oes
- *    Made csp the first parameter in *action_to_html
- *
- *    Revision 1.10  2002/04/26 12:53:33  oes
- *     -  actions_to_html signature change
- *     -  current_action_to_text: renamed to current_action_to_html
- *        and signature change
- *
- *    Revision 1.9  2002/03/26 22:29:54  swa
- *    we have a new homepage!
- *
- *    Revision 1.8  2002/03/24 13:25:43  swa
- *    name change related issues
- *
- *    Revision 1.7  2002/03/16 23:54:06  jongfoster
- *    Adding graceful termination feature, to help look for memory leaks.
- *    If you enable this (which, by design, has to be done by hand
- *    editing config.h) and then go to http://i.j.b/die, then the program
- *    will exit cleanly after the *next* request.  It should free all the
- *    memory that was used.
- *
- *    Revision 1.6  2001/10/23 21:30:30  jongfoster
- *    Adding error-checking to selected functions.
- *
- *    Revision 1.5  2001/10/14 21:58:22  jongfoster
- *    Adding support for the CGI-based editor:
- *    - Exported get_actions()
- *    - Added new function free_alias_list()
- *    - Added support for {{settings}} and {{description}} blocks
- *      in the actions file.  They are currently ignored.
- *    - Added restriction to only one {{alias}} block which must appear
- *      first in the file, to simplify the editor's rewriting rules.
- *    - Note that load_actions_file() is no longer used by the CGI-based
- *      editor, but some of the other routines in this file are.
- *
- *    Revision 1.4  2001/09/16 15:47:37  jongfoster
- *    First version of CGI-based edit interface.  This is very much a
- *    work-in-progress, and you can't actually use it to edit anything
- *    yet.  You must #define FEATURE_CGI_EDIT_ACTIONS for these changes
- *    to have any effect.
- *
- *    Revision 1.3  2001/09/14 00:17:32  jongfoster
- *    Tidying up memory allocation. New function init_action().
- *
- *    Revision 1.2  2001/07/29 19:01:11  jongfoster
- *    Changed _FILENAME_H to FILENAME_H_INCLUDED.
- *    Added forward declarations for needed structures.
- *
- *    Revision 1.1  2001/05/31 21:16:46  jongfoster
- *    Moved functions to process the action list into this new file.
- *
- *
- *********************************************************************/
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-struct action_spec;
-struct current_action_spec;
-struct client_state;
-
-
-
-/* This structure is used to hold user-defined aliases */
-struct action_alias
-{
-   const char * name;
-   struct action_spec action[1];
-   struct action_alias * next;
-};
-
-
-extern jb_err get_actions (char *line, 
-                           struct action_alias * alias_list,
-                           struct action_spec *cur_action);
-extern void free_alias_list(struct action_alias *alias_list);
-
-extern void init_action(struct action_spec *dest);
-extern void free_action(struct action_spec *src);
-extern jb_err merge_actions (struct action_spec *dest, 
-                             const struct action_spec *src);
-#if 0
-extern int update_action_bits_for_all_tags(struct client_state *csp);
-#endif
-extern int update_action_bits_for_tag(struct client_state *csp, const char *tag);
-extern jb_err copy_action (struct action_spec *dest, 
-                           const struct action_spec *src);
-extern char * actions_to_text     (const struct action_spec *action);
-extern char * actions_to_html     (const struct client_state *csp,
-                                   const struct action_spec *action);
-extern void init_current_action     (struct current_action_spec *dest);
-extern void free_current_action     (struct current_action_spec *src);
-extern jb_err merge_current_action  (struct current_action_spec *dest, 
-                                     const struct action_spec *src);
-extern char * current_action_to_html(const struct client_state *csp,
-                                     const struct current_action_spec *action);
-
-extern jb_err get_action_token(char **line, char **name, char **value);
-extern void unload_actions_file(void *file_data);
-extern int load_action_files(struct client_state *csp);
-
-#ifdef FEATURE_GRACEFUL_TERMINATION
-void unload_current_actions_file(void);
-#endif
-
-
-/* Revision control strings from this header and associated .c file */
-extern const char actions_rcs[];
-extern const char actions_h_rcs[];
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* ndef ACTIONS_H_INCLUDED */
-
-/*
-  Local Variables:
-  tab-width: 3
-  end:
-*/
-
diff --git a/external/privoxy/amiga.c b/external/privoxy/amiga.c
deleted file mode 100644
index 68193fb..0000000
--- a/external/privoxy/amiga.c
+++ /dev/null
@@ -1,341 +0,0 @@
-const char amiga_rcs[] = "$Id: amiga.c,v 1.12 2007/01/07 07:40:52 joergs Exp $";
-/*********************************************************************
- *
- * File        :  $Source: /cvsroot/ijbswa/current/amiga.c,v $
- *
- * Purpose     :  Amiga-specific declarations.
- *
- * Copyright   :  Written by and Copyright (C) 2001 the SourceForge
- *                Privoxy team. http://www.privoxy.org/
- *
- *                This program is free software; you can redistribute it 
- *                and/or modify it under the terms of the GNU General
- *                Public License as published by the Free Software
- *                Foundation; either version 2 of the License, or (at
- *                your option) any later version.
- *
- *                This program is distributed in the hope that it will
- *                be useful, but WITHOUT ANY WARRANTY; without even the
- *                implied warranty of MERCHANTABILITY or FITNESS FOR A
- *                PARTICULAR PURPOSE.  See the GNU General Public
- *                License for more details.
- *
- *                The GNU General Public License should be included with
- *                this file.  If not, you can view it at
- *                http://www.gnu.org/copyleft/gpl.html
- *                or write to the Free Software Foundation, Inc., 59
- *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * Revisions   :
- *    $Log: amiga.c,v $
- *    Revision 1.12  2007/01/07 07:40:52  joergs
- *    Added AmigaOS4 support and made it work on AmigaOS 3.x with current sources.
- *
- *    Revision 1.11  2006/07/18 14:48:45  david__schmidt
- *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
- *    with what was really the latest development (the v_3_0_branch branch)
- *
- *    Revision 1.9  2002/03/26 22:29:54  swa
- *    we have a new homepage!
- *
- *    Revision 1.8  2002/03/25 19:32:15  joergs
- *    Name in version string changed from junkbuster to Privoxy.
- *
- *    Revision 1.7  2002/03/24 13:25:43  swa
- *    name change related issues
- *
- *    Revision 1.6  2002/03/09 20:03:52  jongfoster
- *    - Making various functions return int rather than size_t.
- *      (Undoing a recent change).  Since size_t is unsigned on
- *      Windows, functions like read_socket that return -1 on
- *      error cannot return a size_t.
- *
- *      THIS WAS A MAJOR BUG - it caused frequent, unpredictable
- *      crashes, and also frequently caused JB to jump to 100%
- *      CPU and stay there.  (Because it thought it had just
- *      read ((unsigned)-1) == 4Gb of data...)
- *
- *    - The signature of write_socket has changed, it now simply
- *      returns success=0/failure=nonzero.
- *
- *    - Trying to get rid of a few warnings --with-debug on
- *      Windows, I've introduced a new type "jb_socket".  This is
- *      used for the socket file descriptors.  On Windows, this
- *      is SOCKET (a typedef for unsigned).  Everywhere else, it's
- *      an int.  The error value can't be -1 any more, so it's
- *      now JB_INVALID_SOCKET (which is -1 on UNIX, and in
- *      Windows it maps to the #define INVALID_SOCKET.)
- *
- *    - The signature of bind_port has changed.
- *
- *    Revision 1.5  2002/03/03 09:18:03  joergs
- *    Made jumbjuster work on AmigaOS again.
- *
- *    Revision 1.4  2001/10/07 15:35:13  oes
- *    Replaced 6 boolean members of csp with one bitmap (csp->flags)
- *
- *    Revision 1.3  2001/09/12 22:54:51  joergs
- *    Stacksize of main thread increased.
- *
- *    Revision 1.2  2001/05/23 00:13:58  joergs
- *    AmigaOS support fixed.
- *
- *    Revision 1.1.1.1  2001/05/15 13:58:46  oes
- *    Initial import of version 2.9.3 source tree
- *
- *
- *********************************************************************/
-
-
-#include "config.h"
-
-#ifdef AMIGA
-
-#include <stdio.h>
-#include <signal.h>
-
-#include "project.h"
-
-const char amiga_h_rcs[] = AMIGA_H_VERSION;
-
-static char *ver USED = "$VER: Privoxy " __AMIGAVERSION__ " (" __AMIGADATE__ ")";
-#ifdef __amigaos4__
-static char *stack USED = "$STACK: 524288";
-#else
-unsigned long __stack = 100*1024;
-#endif
-struct Task *main_task = NULL;
-int childs = 0;
-
-void serve(struct client_state *csp);
-
-SAVEDS ULONG server_thread(void)
-{
-   struct client_state *local_csp;
-   struct UserData UserData;
-   struct Task *me=FindTask(NULL);
-#ifdef __amigaos4__
-   struct Library *SocketBase;
-#endif
-
-   Wait(SIGF_SINGLE);
-   local_csp=(struct client_state *)(me->tc_UserData);
-   me->tc_UserData=&UserData;
-   SocketBase=(APTR)OpenLibrary("bsdsocket.library",3);
-   if (SocketBase)
-#ifdef __amigaos4__
-   {
-      ISocket = (struct SocketIFace *)GetInterface(SocketBase, "main", 1, NULL);
-   }
-   if (ISocket)
-#endif
-   {
-      SetErrnoPtr(&(UserData.eno),sizeof(int));
-      local_csp->cfd=ObtainSocket(local_csp->cfd, AF_INET, SOCK_STREAM, 0);
-      if(JB_INVALID_SOCKET!=local_csp->cfd)
-      {
-         Signal(main_task,SIGF_SINGLE);
-         serve((struct client_state *) local_csp);
-      } else {
-         local_csp->flags &= ~CSP_FLAG_ACTIVE;
-         Signal(main_task,SIGF_SINGLE);
-      }
-#ifdef __amigaos4__
-      DropInterface((struct Interface *)ISocket);
-#endif
-      CloseLibrary(SocketBase);
-   } else {
-#ifdef __amigaos4__
-      CloseLibrary(SocketBase);
-#endif
-      local_csp->flags &= ~CSP_FLAG_ACTIVE;
-      Signal(main_task,SIGF_SINGLE);
-   }
-   childs--;
-   return 0;
-}
-
-static BPTR olddir;
-
-void amiga_exit(void)
-{
-#ifdef __amigaos4__
-   if (ISocket)
-#else
-   if (SocketBase)
-#endif
-   {
-#ifdef __amigaos4__
-      struct Library *SocketBase = ISocket->Data.LibBase;
-      DropInterface((struct Interface *)ISocket);
-#endif
-      CloseLibrary(SocketBase);
-   }
-   CurrentDir(olddir);
-}
-
-#ifndef __amigaos4__
-static struct SignalSemaphore memsem;
-static struct SignalSemaphore *memsemptr = NULL;
-#endif
-static struct UserData GlobalUserData;
-
-void InitAmiga(void)
-{
-#ifdef __amigaos4__
-   struct Library *SocketBase;
-#endif
-
-   main_task = FindTask(NULL);
-   main_task->tc_UserData = &GlobalUserData;
-
-   if (((struct Library *)SysBase)->lib_Version < 39)
-   {
-      exit(RETURN_FAIL);
-   }
-
-   signal(SIGINT,SIG_IGN);
-   SocketBase = (APTR)OpenLibrary("bsdsocket.library",3);
-#ifdef __amigaos4__
-   if (SocketBase)
-   {
-      ISocket = (struct SocketIFace *)GetInterface(SocketBase, "main", 1, NULL);
-   }
-   if (!ISocket)
-#else
-   if (!SocketBase)
-#endif
-   {
-#ifdef __amigaos4__
-      CloseLibrary(SocketBase);
-#endif
-      fprintf(stderr, "Can't open bsdsocket.library V3+\n");
-      exit(RETURN_ERROR);
-   }
-   SetErrnoPtr(&(GlobalUserData.eno),sizeof(int));
-#ifndef __amigaos4__
-   InitSemaphore(&memsem);
-   memsemptr = &memsem;
-#endif
-
-   olddir=CurrentDir(GetProgramDir());
-   atexit(amiga_exit);
-}
-
-#ifndef __amigaos4__
-#ifdef __GNUC__
-#ifdef libnix
-/* multithreadingsafe libnix replacements */
-static void *memPool=NULL;
-
-void *malloc (size_t s)
-{
-   ULONG *mem;
-   LONG size = s;
-
-   if (size<=0)
-   {
-      return NULL;
-   }
-   if (!memPool)
-   {
-      if (!(memPool=CreatePool(MEMF_ANY,32*1024,8*1024)))
-      {
-         return NULL;
-      }
-   }
-   size += sizeof(ULONG) + MEM_BLOCKMASK;
-   size &= ~MEM_BLOCKMASK;
-   if (memsemptr)
-   {
-      ObtainSemaphore(memsemptr);
-   }
-   if ((mem=AllocPooled(memPool,size)))
-   {
-      *mem++=size;
-   }
-   if (memsemptr)
-   {
-      ReleaseSemaphore(memsemptr);
-   }
-   return mem;
-}
-
-void free (void *m)
-{
-   ULONG *mem = m;
-
-   if(mem && memPool)
-   {
-      ULONG size=*--mem;
-
-      if (memsemptr)
-      {
-         ObtainSemaphore(memsemptr);
-      }
-      FreePooled(memPool,mem,size);
-      if (memsemptr)
-      {
-         ReleaseSemaphore(memsemptr);
-      }
-   }
-}
-
-void *realloc (void *old, size_t ns)
-{
-   void *new;
-   LONG osize, *o = old;
-   LONG nsize = ns;
-
-   if (!old)
-   {
-      return malloc(nsize);
-   }
-   osize = (*(o-1)) - sizeof(ULONG);
-   if (nsize <= osize)
-   {
-      return old;
-   }
-   if ((new = malloc(nsize)))
-   {
-      ULONG *n = new;
-
-      osize >>= 2;
-      while(osize--)
-      {
-         *n++ = *o++;
-      }
-      free(old);
-   }
-   return new;
-}
-
-void __memCleanUp (void)
-{
-   if (memsemptr)
-   {
-      ObtainSemaphore(memsemptr);
-   }
-   if (memPool)
-   {
-      DeletePool(memPool);
-   }
-   if (memsemptr)
-   {
-      ReleaseSemaphore(memsemptr);
-   }
-}
-
-#define ADD2LIST(a,b,c) asm(".stabs \"_" #b "\"," #c ",0,0,_" #a )
-#define ADD2EXIT(a,pri) ADD2LIST(a,__EXIT_LIST__,22); \
-                        asm(".stabs \"___EXIT_LIST__\",20,0,0," #pri "+128")
-ADD2EXIT(__memCleanUp,-50);
-#elif !defined(ixemul)
-#error No libnix and no ixemul!?
-#endif /* libnix */
-#else
-#error Only GCC is supported, multithreading safe malloc/free required.
-#endif /* __GNUC__ */
-#endif /* !__amigaos4__ */
-
-#endif /* def AMIGA */
diff --git a/external/privoxy/amiga.h b/external/privoxy/amiga.h
deleted file mode 100644
index 43ebda6..0000000
--- a/external/privoxy/amiga.h
+++ /dev/null
@@ -1,176 +0,0 @@
-#ifdef AMIGA
-#ifndef AMIGA_H_INCLUDED
-#define AMIGA_H_INCLUDED
-#define AMIGA_H_VERSION "$Id: amiga.h,v 1.12 2007/01/07 07:40:52 joergs Exp $"
-/*********************************************************************
- *
- * File        :  $Source: /cvsroot/ijbswa/current/amiga.h,v $
- *
- * Purpose     :  Amiga-specific declarations.
- *
- * Copyright   :  Written by and Copyright (C) 2001 the SourceForge
- *                Privoxy team. http://www.privoxy.org/
- *
- *                This program is free software; you can redistribute it 
- *                and/or modify it under the terms of the GNU General
- *                Public License as published by the Free Software
- *                Foundation; either version 2 of the License, or (at
- *                your option) any later version.
- *
- *                This program is distributed in the hope that it will
- *                be useful, but WITHOUT ANY WARRANTY; without even the
- *                implied warranty of MERCHANTABILITY or FITNESS FOR A
- *                PARTICULAR PURPOSE.  See the GNU General Public
- *                License for more details.
- *
- *                The GNU General Public License should be included with
- *                this file.  If not, you can view it at
- *                http://www.gnu.org/copyleft/gpl.html
- *                or write to the Free Software Foundation, Inc., 59
- *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * Revisions   :
- *    $Log: amiga.h,v $
- *    Revision 1.12  2007/01/07 07:40:52  joergs
- *    Added AmigaOS4 support and made it work on AmigaOS 3.x with current sources.
- *
- *    Revision 1.11  2006/07/18 14:48:45  david__schmidt
- *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
- *    with what was really the latest development (the v_3_0_branch branch)
- *
- *    Revision 1.9  2002/03/26 22:29:54  swa
- *    we have a new homepage!
- *
- *    Revision 1.8  2002/03/24 13:25:43  swa
- *    name change related issues
- *
- *    Revision 1.7  2002/03/03 09:18:03  joergs
- *    Made jumbjuster work on AmigaOS again.
- *
- *    Revision 1.6  2001/10/13 12:46:08  joergs
- *    Added #undef EINTR to avoid warnings
- *
- *    Revision 1.5  2001/07/29 18:43:08  jongfoster
- *    Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to
- *    ANSI C rules.
- *
- *    Revision 1.4  2001/05/29 20:05:06  joergs
- *    Fixed exit() macro not exiting if called before InitAmiga()
- *    (junkbuster --help and --version).
- *
- *    Revision 1.3  2001/05/25 21:53:27  jongfoster
- *    Fixing indentation
- *
- *    Revision 1.2  2001/05/23 00:13:58  joergs
- *    AmigaOS support fixed.
- *
- *    Revision 1.1.1.1  2001/05/15 13:58:46  oes
- *    Initial import of version 2.9.3 source tree
- *
- *
- *********************************************************************/
-
-
-#define _KERNEL
-#include <sys/socket.h>
-#undef _KERNEL
-
-#define __NOLIBBASE__
-#define __NOGLOBALIFACE__
-#include <proto/socket.h>
-#undef __NOLIBBASE__
-#undef __NOGLOBALIFACE__
-
-#define __CONSTLIBBASEDECL__ const
-#include <proto/exec.h>
-#include <exec/tasks.h>
-#include <proto/dos.h>
-#include <dos/dostags.h>
-
-struct UserData
-{
-#ifdef __amigaos4__
-   struct SocketIFace *si;
-#else
-   struct Library *sb;
-#endif
-   int eno;
-};
-
-#ifdef __amigaos4__
-#define ISocket (((struct UserData *)(FindTask(NULL)->tc_UserData))->si)
-#undef errno
-#else
-#define SocketBase ((struct Library *)(((struct UserData *)(FindTask(NULL)->tc_UserData))->sb))
-#endif
-#define errno (((struct UserData *)(FindTask(NULL)->tc_UserData))->eno)
-#define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,NULL)
-#define inet_ntoa(x) Inet_NtoA(x.s_addr)
-
-extern int childs;
-extern struct Task *main_task;
-
-void InitAmiga(void);
-void amiga_exit(void);
-void __memCleanUp(void);
-SAVEDS ULONG server_thread(void);
-
-#ifdef __amigaos4__
-#define exit(x)                                             \
-{                                                           \
-   if(main_task)                                            \
-   {                                                        \
-      if(main_task == FindTask(NULL))                       \
-      {                                                     \
-         while(childs) Delay(10*TICKS_PER_SECOND); exit(x); \
-      }                                                     \
-      else                                                  \
-      {                                                     \
-         if (ISocket)                                       \
-         {                                                  \
-             struct Library *sb = ISocket->Data.LibBase;    \
-             DropInterface((struct Interface *)ISocket);    \
-             CloseLibrary(sb);                              \
-         }                                                  \
-         childs--;                                          \
-         RemTask(NULL);                                     \
-      }                                                     \
-   }                                                        \
-   else                                                     \
-   {                                                        \
-      exit(x);                                              \
-   }                                                        \
-}
-#else
-#define exit(x)                                             \
-{                                                           \
-   if(main_task)                                            \
-   {                                                        \
-      if(main_task == FindTask(NULL))                       \
-      {                                                     \
-         while(childs) Delay(10*TICKS_PER_SECOND); exit(x); \
-      }                                                     \
-      else                                                  \
-      {                                                     \
-         CloseLibrary(SocketBase);                          \
-         childs--;                                          \
-         RemTask(NULL);                                     \
-      }                                                     \
-   }                                                        \
-   else                                                     \
-   {                                                        \
-      exit(x);                                              \
-   }                                                        \
-}
-
-#undef HAVE_RANDOM
-#define h_errno 0
-#define HAVE_TIMEGM
-#define timegm(tm) mktime(tm)
-#endif /* __amigaos4__ */
-
-#undef EINTR
-#define EINTR 0
-
-#endif /* ndef AMIGA_H_INCLUDED */
-#endif /* def AMIGA */
diff --git a/external/privoxy/cgi.c b/external/privoxy/cgi.c
deleted file mode 100644
index 61ff069..0000000
--- a/external/privoxy/cgi.c
+++ /dev/null
@@ -1,2987 +0,0 @@
-const char cgi_rcs[] = "$Id: cgi.c,v 1.116 2009/03/15 14:59:34 fabiankeil Exp $";
-/*********************************************************************
- *
- * File        :  $Source: /cvsroot/ijbswa/current/cgi.c,v $
- *
- * Purpose     :  Declares functions to intercept request, generate
- *                html or gif answers, and to compose HTTP resonses.
- *                This only contains the framework functions, the
- *                actual handler functions are declared elsewhere.
- *                
- *                Functions declared include:
- * 
- *
- * Copyright   :  Written by and Copyright (C) 2001-2004, 2006-2008
- *                the SourceForge Privoxy team. http://www.privoxy.org/
- *
- *                Based on the Internet Junkbuster originally written
- *                by and Copyright (C) 1997 Anonymous Coders and 
- *                Junkbusters Corporation.  http://www.junkbusters.com
- *
- *                This program is free software; you can redistribute it 
- *                and/or modify it under the terms of the GNU General
- *                Public License as published by the Free Software
- *                Foundation; either version 2 of the License, or (at
- *                your option) any later version.
- *
- *                This program is distributed in the hope that it will
- *                be useful, but WITHOUT ANY WARRANTY; without even the
- *                implied warranty of MERCHANTABILITY or FITNESS FOR A
- *                PARTICULAR PURPOSE.  See the GNU General Public
- *                License for more details.
- *
- *                The GNU General Public License should be included with
- *                this file.  If not, you can view it at
- *                http://www.gnu.org/copyleft/gpl.html
- *                or write to the Free Software Foundation, Inc., 59
- *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * Revisions   :
- *    $Log: cgi.c,v $
- *    Revision 1.116  2009/03/15 14:59:34  fabiankeil
- *    Cosmetics.
- *
- *    Revision 1.115  2009/03/01 18:28:23  fabiankeil
- *    Help clang understand that we aren't dereferencing
- *    NULL pointers here.
- *
- *    Revision 1.114  2008/12/04 18:15:04  fabiankeil
- *    Fix some cparser warnings.
- *
- *    Revision 1.113  2008/09/04 08:13:58  fabiankeil
- *    Prepare for critical sections on Windows by adding a
- *    layer of indirection before the pthread mutex functions.
- *
- *    Revision 1.112  2008/08/31 16:08:12  fabiankeil
- *    "View the request headers" isn't more equal than the other
- *    menu items and thus doesn't need a trailing dot either.
- *
- *    Revision 1.111  2008/08/31 15:59:02  fabiankeil
- *    There's no reason to let remote toggling support depend
- *    on FEATURE_CGI_EDIT_ACTIONS, so make sure it doesn't.
- *
- *    Revision 1.110  2008/08/31 14:55:43  fabiankeil
- *    Add a @date@ symbol to include a date(1)-like time string
- *    in templates. Modified version of the patch Endre Szabo
- *    submitted in #2026468.
- *
- *    Revision 1.109  2008/07/26 09:40:27  fabiankeil
- *    Remove the unconditional block in get_http_time().
- *    It's pointless now that it's no longer used to limit
- *    dummy's scope. While at it, remove obvious comments
- *    and a trailing space.
- *
- *    Revision 1.108  2008/05/26 17:30:53  fabiankeil
- *    Provide an OpenSearch Description to access the
- *    show-url-info page through "search engine plugins".
- *
- *    Revision 1.107  2008/05/26 16:23:19  fabiankeil
- *    - Fix spelling in template-not-found message.
- *    - Declare referrer_is_safe()'s alternative_prefix[] static.
- *
- *    Revision 1.106  2008/05/21 15:24:38  fabiankeil
- *    Mark csp as immutable for a bunch of functions.
- *
- *    Revision 1.105  2008/04/17 14:40:47  fabiankeil
- *    Provide get_http_time() with the buffer size so it doesn't
- *    have to blindly assume that the buffer is big enough.
- *
- *    Revision 1.104  2008/03/26 18:07:06  fabiankeil
- *    Add hostname directive. Closes PR#1918189.
- *
- *    Revision 1.103  2008/03/21 11:13:57  fabiankeil
- *    Only gather host information if it's actually needed.
- *    Also move the code out of accept_connection() so it's less likely
- *    to delay other incoming connections if the host is misconfigured.
- *
- *    Revision 1.102  2008/02/23 16:33:43  fabiankeil
- *    Let forward_url() use the standard parameter ordering
- *    and mark its second parameter immutable.
- *
- *    Revision 1.101  2008/02/03 15:45:06  fabiankeil
- *    Add SOCKS5 support for "Forwarding failure" CGI page.
- *
- *    Revision 1.100  2007/10/17 18:40:53  fabiankeil
- *    - Send CGI pages as HTTP/1.1 unless the client asked for HTTP/1.0.
- *    - White space fix.
- *
- *    Revision 1.99  2007/08/05 13:42:22  fabiankeil
- *    #1763173 from Stefan Huehner: declare some more functions static.
- *
- *    Revision 1.98  2007/05/14 10:33:51  fabiankeil
- *    - Use strlcpy() and strlcat() instead of strcpy() and strcat().
- *
- *    Revision 1.97  2007/04/09 18:11:35  fabiankeil
- *    Don't mistake VC++'s _snprintf() for a snprintf() replacement.
- *
- *    Revision 1.96  2007/03/08 17:41:05  fabiankeil
- *    Use sizeof() more often.
- *
- *    Revision 1.95  2007/02/10 17:01:37  fabiankeil
- *    Don't overlook map result for the forwarding-type.
- *
- *    Revision 1.94  2007/02/08 19:44:49  fabiankeil
- *    Use a transparent background for the PNG replacement pattern.
- *
- *    Revision 1.93  2007/02/07 10:45:22  fabiankeil
- *    - Save the reason for generating http_responses.
- *    - Fix --disable-toggle (again).
- *    - Use TBL birthday hack for 403 responses as well.
- *    - Uglify the @menu@ again to fix JavaScript
- *      errors on the "blocked" template.
- *    - Escape an ampersand in cgi_error_unknown().
- *
- *    Revision 1.92  2007/01/28 13:41:17  fabiankeil
- *    - Add HEAD support to finish_http_response.
- *    - Add error favicon to internal HTML error messages.
- *
- *    Revision 1.91  2007/01/27 13:09:16  fabiankeil
- *    Add new config option "templdir" to
- *    change the templates directory.
- *
- *    Revision 1.90  2007/01/25 13:47:26  fabiankeil
- *    Added "forwarding-failed" template support for error_response().
- *
- *    Revision 1.89  2007/01/23 15:51:16  fabiankeil
- *    Add favicon delivery functions.
- *
- *    Revision 1.88  2007/01/23 13:14:32  fabiankeil
- *    - Map variables that aren't guaranteed to be
- *      pure ASCII html_encoded.
- *    - Use CGI_PREFIX to generate URL for user manual
- *      CGI page to make sure CGI_SITE_2_PATH is included.
- *
- *    Revision 1.87  2007/01/22 15:34:13  fabiankeil
- *    - "Protect" against a rather lame JavaScript-based
- *      Privoxy detection "attack" and check the referrer
- *      before delivering the CGI style sheet.
- *    - Move referrer check for unsafe CGI pages into
- *      referrer_is_safe() and log the result.
- *    - Map @url@ in cgi-error-disabled page.
- *      It's required for the "go there anyway" link.
- *    - Mark *csp as immutable for grep_cgi_referrer().
- *
- *    Revision 1.86  2007/01/09 11:54:26  fabiankeil
- *    Fix strdup() error handling in cgi_error_unknown()
- *    and cgi_error_no_template(). Reported by Markus Elfring.
- *
- *    Revision 1.85  2007/01/05 14:19:02  fabiankeil
- *    Handle pcrs_execute() errors in template_fill() properly.
- *
- *    Revision 1.84  2006/12/28 17:54:22  fabiankeil
- *    Fixed gcc43 conversion warnings and replaced sprintf
- *    calls with snprintf to give OpenBSD's gcc one less reason
- *    to complain.
- *
- *    Revision 1.83  2006/12/17 19:35:19  fabiankeil
- *    Escape ampersand in Privoxy menu.
- *
- *    Revision 1.82  2006/12/17 17:53:39  fabiankeil
- *    Suppress the toggle link if remote toggling is disabled.
- *
- *    Revision 1.81  2006/12/09 13:49:16  fabiankeil
- *    Fix configure option --disable-toggle.
- *    Thanks to Peter Thoenen for reporting this.
- *
- *    Revision 1.80  2006/12/08 14:45:32  fabiankeil
- *    Don't lose the FORCE_PREFIX in case of
- *    connection problems. Fixes #612235.
- *
- *    Revision 1.79  2006/11/13 19:05:50  fabiankeil
- *    Make pthread mutex locking more generic. Instead of
- *    checking for OSX and OpenBSD, check for FEATURE_PTHREAD
- *    and use mutex locking unless there is an _r function
- *    available. Better safe than sorry.
- *
- *    Fixes "./configure --disable-pthread" and should result
- *    in less threading-related problems on pthread-using platforms,
- *    but it still doesn't fix BR#1122404.
- *
- *    Revision 1.78  2006/09/21 19:22:07  fabiankeil
- *    Use CGI_PREFIX to check the referrer.
- *    The check for "http://config.privoxy.org/" fails
- *    if the user modified CGI_SITE_2_HOST.
- *
- *    Revision 1.77  2006/09/21 15:17:23  fabiankeil
- *    Adjusted headers for Privoxy's cgi responses:
- *    Don't set Last-Modified, Expires and Cache-Control
- *    headers for redirects; always set "Connection: close".
- *
- *    Revision 1.76  2006/09/07 14:06:38  fabiankeil
- *    Only predate the Last-Modified header for cgi responses
- *    that are delivered with status code 404 or 503.
- *
- *    Revision 1.75  2006/09/07 11:56:39  fabiankeil
- *    Mark cgi_send_user_manual as harmless,
- *    to fix the access denied problem Hal spotted.
- *    The manual has no secret content, therefore we
- *    don't have to care about "secure" referrers.
- *
- *    Revision 1.74  2006/09/06 18:45:03  fabiankeil
- *    Incorporate modified version of Roland Rosenfeld's patch to
- *    optionally access the user-manual via Privoxy. Closes patch 679075.
- *
- *    Formatting changed to Privoxy style, added call to
- *    cgi_error_no_template if the requested file doesn't
- *    exist and modified check whether or not Privoxy itself
- *    should serve the manual. Should work cross-platform now.
- *
- *    Revision 1.73  2006/08/03 02:46:41  david__schmidt
- *    Incorporate Fabian Keil's patch work:http://www.fabiankeil.de/sourcecode/privoxy/
- *
- *    Revision 1.72  2006/07/18 14:48:45  david__schmidt
- *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
- *    with what was really the latest development (the v_3_0_branch branch)
- *
- *    Revision 1.70.2.13  2004/02/17 13:30:23  oes
- *    Moved cgi_error_disabled() from cgiedit.c to
- *    cgi.c to re-enable build with --disable-editor.
- *    Fixes Bug #892744. Thanks to Matthew Fischer
- *    for spotting.
- *
- *    Revision 1.70.2.12  2003/12/17 16:33:16  oes
- *     - Added new function cgi_redirect to handle creation of
- *       HTTP redirect messages formerly repeated in the code.
- *     - Send cgi_error_disabled instead of cgi_error_404 when
- *       referrer check fails
- *     - Dynamic content now gets Expires header field with date
- *       in the past
- *
- *    Revision 1.70.2.11  2003/10/23 12:29:26  oes
- *    Bugfix: Transparent PNG was not transparent. Thanks to
- *    Dan Razzell of Starfish Systems for notice and new PNG.
- *
- *    Revision 1.70.2.10  2003/06/06 07:54:25  oes
- *    Security fix: dspatch_known_cgi no longer considers an empty
- *    referrer safe for critical CGIs, since malicious links could
- *    reside on https:// locations which browsers don't advertize as
- *    referrers. Closes bug #749916, thanks to Jeff Epler for the
- *    hint. Goodbye One-Click[tm] toggling :-(
- *
- *    Revision 1.70.2.9  2003/05/08 15:11:31  oes
- *    Nit
- *
- *    Revision 1.70.2.8  2003/04/29 13:33:51  oes
- *    Killed a compiler warning on OSX
- *
- *    Revision 1.70.2.7  2003/04/03 13:50:58  oes
- *    - Don't call cgi_error_disabled ifndef FEATURE_CGI_EDIT_ACTIONS
- *      (fixes bug #710056)
- *    - Show toggle info only if we have it
- *
- *    Revision 1.70.2.6  2003/03/12 01:26:25  david__schmidt
- *    Move declaration of struct tm dummy outside of a control block so it is
- *    accessible later on during snprintf in get_http_time.
- *
- *    Revision 1.70.2.5  2003/03/11 11:53:58  oes
- *    Cosmetic: Renamed cryptic variable
- *
- *    Revision 1.70.2.4  2003/03/07 03:41:03  david__schmidt
- *    Wrapping all *_r functions (the non-_r versions of them) with mutex semaphores for OSX.  Hopefully this will take care of all of those pesky crash reports.
- *
- *    Revision 1.70.2.3  2002/11/28 18:14:32  oes
- *    Disable access to critical CGIs via untrusted referrers.
- *    This prevents users from being tricked by malicious websites
- *    into making unintentional configuration changes:
- *
- *     - Added flag to each cgi_dispatcher that allows or denies
- *       external linking
- *     - Introduced proviorical function that greps for the
- *       referrer header before regular header parsing happens
- *     - Added safety check to dispatch_known_cgi. CGI is called
- *       if (cgi harmless || no referrer || we are referrer).
- *       Else a) toggle calls are modified not to change status and
- *       b) all other calls are denied.
- *
- *    Revision 1.70.2.2  2002/11/12 16:20:37  oes
- *    Added missing #ifdef FEATURE_TOGGLE around g_bToggleIJB; fixes bug #636651
- *
- *    Revision 1.70.2.1  2002/08/05 11:17:46  oes
- *    Fixed Bug #587820, i.e. added workaround for IE bug that includes fragment identifier in (cgi) query
- *
- *    Revision 1.70  2002/05/19 11:33:20  jongfoster
- *    If a CGI error was not handled, and propogated back to
- *    dispatch_known_cgi(), then it was assumed to be "out of memory".
- *    This gave a very misleading error message.
- *
- *    Now other errors will cause a simple message giving the error
- *    number and asking the user to report a bug.
- *
- *    Bug report:
- *    http://sourceforge.net/tracker/index.php?func=detail
- *    &aid=557905&group_id=11118&atid=111118
- *
- *    Revision 1.69  2002/05/14 21:28:40  oes
- *     - Fixed add_help_link to link to the (now split) actions
- *       part of the config chapter
- *     - Renamed helplink export to actions-help-prefix
- *
- *    Revision 1.68  2002/05/12 21:36:29  jongfoster
- *    Correcting function comments
- *
- *    Revision 1.67  2002/04/30 12:02:07  oes
- *    Nit: updated a comment
- *
- *    Revision 1.66  2002/04/26 18:32:57  jongfoster
- *    Fixing a memory leak on error
- *
- *    Revision 1.65  2002/04/26 12:53:51  oes
- *     - New function add_help_link
- *     - default_exports now exports links to the user manual
- *       and a prefix for links into the config chapter
- *
- *    Revision 1.64  2002/04/24 02:17:21  oes
- *     - Better descriptions for CGIs
- *     - Hide edit-actions, more shortcuts
- *     - Moved get_char_param, get_string_param and get_number_param here
- *       from cgiedit.c
- *
- *    Revision 1.63  2002/04/15 19:06:43  jongfoster
- *    Typos
- *
- *    Revision 1.62  2002/04/10 19:59:46  jongfoster
- *    Fixes to #include in templates:
- *    - Didn't close main file if loading an included template fails.
- *    - I'm paranoid and want to disallow "#include /etc/passwd".
- *
- *    Revision 1.61  2002/04/10 13:37:48  oes
- *    Made templates modular: template_load now recursive with max depth 1
- *
- *    Revision 1.60  2002/04/08 20:50:25  swa
- *    fixed JB spelling
- *
- *    Revision 1.59  2002/04/05 15:51:51  oes
- *     - added send-stylesheet CGI
- *     - bugfix: error-pages now get correct request protocol
- *     - fixed
- *     - kludged CGI descriptions and menu not to break JS syntax
- *
- *    Revision 1.58  2002/03/29 03:33:13  david__schmidt
- *    Fix Mac OSX compiler warnings
- *
- *    Revision 1.57  2002/03/26 22:29:54  swa
- *    we have a new homepage!
- *
- *    Revision 1.56  2002/03/24 17:50:46  jongfoster
- *    Fixing compile error if actions file editor disabled
- *
- *    Revision 1.55  2002/03/24 16:55:06  oes
- *    Making GIF checkerboard transparent
- *
- *    Revision 1.54  2002/03/24 16:18:15  jongfoster
- *    Removing old logo
- *
- *    Revision 1.53  2002/03/24 16:06:00  oes
- *    Correct transparency for checkerboard PNG. Thanks, Magnus!
- *
- *    Revision 1.52  2002/03/24 15:23:33  jongfoster
- *    Name changes
- *
- *    Revision 1.51  2002/03/24 13:25:43  swa
- *    name change related issues
- *
- *    Revision 1.50  2002/03/16 23:54:06  jongfoster
- *    Adding graceful termination feature, to help look for memory leaks.
- *    If you enable this (which, by design, has to be done by hand
- *    editing config.h) and then go to http://i.j.b/die, then the program
- *    will exit cleanly after the *next* request.  It should free all the
- *    memory that was used.
- *
- *    Revision 1.49  2002/03/13 00:27:04  jongfoster
- *    Killing warnings
- *
- *    Revision 1.48  2002/03/08 17:47:07  jongfoster
- *    Adding comments
- *
- *    Revision 1.47  2002/03/08 16:41:33  oes
- *    Added GIF images again
- *
- *    Revision 1.46  2002/03/07 03:48:38  oes
- *     - Changed built-in images from GIF to PNG
- *       (with regard to Unisys patent issue)
- *     - Added a 4x4 pattern PNG which is less intrusive
- *       than the logo but also clearly marks the deleted banners
- *
- *    Revision 1.45  2002/03/06 22:54:35  jongfoster
- *    Automated function-comment nitpicking.
- *
- *    Revision 1.44  2002/03/05 22:43:45  david__schmidt
- *    - Better error reporting on OS/2
- *    - Fix double-slash comment (oops)
- *
- *    Revision 1.43  2002/03/05 21:33:45  david__schmidt
- *    - Re-enable OS/2 building after new parms were added
- *    - Fix false out of memory report when resolving CGI templates when no IP
- *      address is available of failed attempt (a la no such domain)
- *
- *    Revision 1.42  2002/01/21 00:33:20  jongfoster
- *    Replacing strsav() with the safer string_append() or string_join().
- *    Adding map_block_keep() to save a few bytes in the edit-actions-list HTML.
- *    Adding missing html_encode() to error message generators.
- *    Adding edit-actions-section-swap and many "shortcuts" to the list of CGIs.
- *
- *    Revision 1.41  2002/01/17 20:56:22  jongfoster
- *    Replacing hard references to the URL of the config interface
- *    with #defines from project.h
- *
- *    Revision 1.40  2002/01/09 14:26:46  oes
- *    Added support for thread-safe gmtime_r call.
- *
- *    Revision 1.39  2001/11/16 00:48:13  jongfoster
- *    Fixing a compiler warning
- *
- *    Revision 1.38  2001/11/13 00:31:21  jongfoster
- *    - Adding new CGIs for use by non-JavaScript browsers:
- *        edit-actions-url-form
- *        edit-actions-add-url-form
- *        edit-actions-remove-url-form
- *    - Fixing make_menu()'s HTML generation - it now quotes the href parameter.
- *    - Fixing || bug.
- *
- *    Revision 1.37  2001/11/01 14:28:47  david__schmidt
- *    Show enablement/disablement status in almost all templates.
- *    There is a little trickiness here: apparent recursive resolution of
- *    @if-enabled-then@ caused the toggle template to show status out-of-phase with
- *    the actual enablement status.  So a similar construct,
- *    @if-enabled-display-then@, is used to resolve the status display on non-'toggle'
- *    templates.
- *
- *    Revision 1.36  2001/10/26 17:33:27  oes
- *    marginal bugfix
- *
- *    Revision 1.35  2001/10/23 21:48:19  jongfoster
- *    Cleaning up error handling in CGI functions - they now send back
- *    a HTML error page and should never cause a FATAL error.  (Fixes one
- *    potential source of "denial of service" attacks).
- *
- *    CGI actions file editor that works and is actually useful.
- *
- *    Ability to toggle Junkbuster remotely using a CGI call.
- *
- *    You can turn off both the above features in the main configuration
- *    file, e.g. if you are running a multi-user proxy.
- *
- *    Revision 1.34  2001/10/18 22:22:09  david__schmidt
- *    Only show "Local support" on templates conditionally:
- *      - if either 'admin-address' or 'proxy-info-url' are uncommented in config
- *      - if not, no Local support section appears
- *
- *    Revision 1.33  2001/10/14 22:28:41  jongfoster
- *    Fixing stupid typo.
- *
- *    Revision 1.32  2001/10/14 22:20:18  jongfoster
- *    - Changes to CGI dispatching method to match CGI names exactly,
- *      rather than doing a prefix match.
- *    - No longer need to count the length of the CGI handler names by hand.
- *    - Adding new handler for 404 error when disptching a CGI, if none of
- *      the handlers match.
- *    - Adding new handlers for CGI actionsfile editor.
- *
- *    Revision 1.31  2001/10/10 10:56:39  oes
- *    Failiure to load template now fatal. Before, the user got a hard-to-understand assertion failure from cgi.c
- *
- *    Revision 1.30  2001/10/02 15:30:57  oes
- *    Introduced show-request cgi
- *
- *    Revision 1.29  2001/09/20 15:47:44  steudten
- *
- *    Fix BUG: Modify int size to size_t size in fill_template()
- *     - removes big trouble on machines where sizeof(int) != sizeof(size_t).
- *
- *    Revision 1.28  2001/09/19 18:00:37  oes
- *     - Deletef time() FIXME (Can't fail under Linux either, if
- *       the argument is guaranteed to be in out address space,
- *       which it is.)
- *     - Fixed comments
- *     - Pointer notation cosmetics
- *     - Fixed a minor bug in template_fill(): Failiure of
- *       pcrs_execute() now secure.
- *
- *    Revision 1.27  2001/09/16 17:08:54  jongfoster
- *    Moving simple CGI functions from cgi.c to new file cgisimple.c
- *
- *    Revision 1.26  2001/09/16 15:47:37  jongfoster
- *    First version of CGI-based edit interface.  This is very much a
- *    work-in-progress, and you can't actually use it to edit anything
- *    yet.  You must #define FEATURE_CGI_EDIT_ACTIONS for these changes
- *    to have any effect.
- *
- *    Revision 1.25  2001/09/16 15:02:35  jongfoster
- *    Adding i.j.b/robots.txt.
- *    Inlining add_stats() since it's only ever called from one place.
- *
- *    Revision 1.24  2001/09/16 11:38:01  jongfoster
- *    Splitting fill_template() into 2 functions:
- *    template_load() loads the file
- *    template_fill() performs the PCRS regexps.
- *    This is because the CGI edit interface has a "table row"
- *    template which is used many times in the page - this
- *    change means it's only loaded from disk once.
- *
- *    Revision 1.23  2001/09/16 11:16:05  jongfoster
- *    Better error handling in dispatch_cgi() and parse_cgi_parameters()
- *
- *    Revision 1.22  2001/09/16 11:00:10  jongfoster
- *    New function alloc_http_response, for symmetry with free_http_response
- *
- *    Revision 1.21  2001/09/13 23:53:03  jongfoster
- *    Support for both static and dynamically generated CGI pages.
- *    Correctly setting Last-Modified: and Expires: HTTP headers.
- *
- *    Revision 1.20  2001/09/13 23:40:36  jongfoster
- *    (Cosmetic only) Indentation correction
- *
- *    Revision 1.19  2001/09/13 23:31:25  jongfoster
- *    Moving image data to cgi.c rather than cgi.h.
- *
- *    Revision 1.18  2001/08/05 16:06:20  jongfoster
- *    Modifiying "struct map" so that there are now separate header and
- *    "map_entry" structures.  This means that functions which modify a
- *    map no longer need to return a pointer to the modified map.
- *    Also, it no longer reverses the order of the entries (which may be
- *    important with some advanced template substitutions).
- *
- *    Revision 1.17  2001/08/05 15:57:38  oes
- *    Adapted finish_http_response to new list_to_text
- *
- *    Revision 1.16  2001/08/01 21:33:18  jongfoster
- *    Changes to fill_template() that reduce memory usage without having
- *    an impact on performance.  I also renamed some variables so as not
- *    to clash with the C++ keywords "new" and "template".
- *
- *    Revision 1.15  2001/08/01 21:19:22  jongfoster
- *    Moving file version information to a separate CGI page.
- *
- *    Revision 1.14  2001/08/01 00:19:03  jongfoster
- *    New function: map_conditional() for an if-then-else syntax.
- *    Changing to use new version of show_defines()
- *
- *    Revision 1.13  2001/07/30 22:08:36  jongfoster
- *    Tidying up #defines:
- *    - All feature #defines are now of the form FEATURE_xxx
- *    - Permanently turned off WIN_GUI_EDIT
- *    - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS
- *
- *    Revision 1.12  2001/07/29 18:47:05  jongfoster
- *    Adding missing #include "loadcfg.h"
- *
- *    Revision 1.11  2001/07/18 17:24:37  oes
- *    Changed to conform to new pcrs interface
- *
- *    Revision 1.10  2001/07/13 13:53:13  oes
- *    Removed all #ifdef PCRS and related code
- *
- *    Revision 1.9  2001/06/29 21:45:41  oes
- *    Indentation, CRLF->LF, Tab-> Space
- *
- *    Revision 1.8  2001/06/29 13:21:46  oes
- *    - Cosmetics: renamed and reordered functions, variables,
- *      texts, improved comments  etc
- *
- *    - Removed ij_untrusted_url() The relevant
- *      info is now part of the "untrusted" page,
- *      which is generated by filters.c:trust_url()
- *
- *    - Generators of content now call finish_http_response()
- *      themselves, making jcc.c:chat() a little less
- *      cluttered
- *
- *    - Removed obsolete "Pragma: no-cache" from our headers
- *
- *    - http_responses now know their head length
- *
- *    - fill_template now uses the new interface to pcrs, so that
- *       - long jobs (like whole files) no longer have to be assembled
- *         in a fixed size buffer
- *       - the new T (trivial) option is used, and the replacement may
- *         contain Perl syntax backrefs without confusing pcrs
- *
- *    - Introduced default_exports() which generates a set of exports
- *      common to all CGIs and other content generators
- *
- *    - Introduced convenience function map_block_killer()
- *
- *    - Introduced convenience function make_menu()
- *
- *    - Introduced CGI-like function error_response() which generates
- *      the "No such domain" and "Connect failed" messages using the
- *      CGI platform
- *
- *    - cgi_show_url_info:
- *      - adapted to new CGI features
- *      - form and answers now generated from same template
- *      - http:// prefix in URL now OK
- *
- *    - cgi_show_status:
- *      - adapted to new CGI features
- *      - no longer uses csp->init_proxy_args
- *
- *    - cgi_default:
- *      - moved menu generation to make_menu()
- *
- *    - add_stats now writes single export map entries instead
- *      of a fixed string
- *
- *    - Moved redirect_url() to filters.c
- *
- *    - Fixed mem leak in free_http_response(), map_block_killer(),
- *
- *    - Removed logentry from cancelled commit
- *
- *    Revision 1.7  2001/06/09 10:51:58  jongfoster
- *    Changing "show URL info" handler to new style.
- *    Changing BUFSIZ ==> BUFFER_SIZE
- *
- *    Revision 1.6  2001/06/07 23:05:19  jongfoster
- *    Removing code related to old forward and ACL files.
- *
- *    Revision 1.5  2001/06/05 19:59:16  jongfoster
- *    Fixing multiline character string (a GCC-only "feature"), and snprintf (it's _snprintf under VC++).
- *
- *    Revision 1.4  2001/06/04 10:41:52  swa
- *    show version string of cgi.h and cgi.c
- *
- *    Revision 1.3  2001/06/03 19:12:16  oes
- *    introduced new cgi handling
- *
- *    No revisions before 1.3
- *
- **********************************************************************/
-
-
-#include "config.h"
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <limits.h>
-#include <assert.h>
-
-#include "project.h"
-#include "cgi.h"
-#include "list.h"
-#include "encode.h"
-#include "ssplit.h"
-#include "errlog.h"
-#include "filters.h"
-#include "miscutil.h"
-#include "cgisimple.h"
-#include "jbsockets.h"
-#if defined(FEATURE_CGI_EDIT_ACTIONS) || defined(FEATURE_TOGGLE)
-#include "cgiedit.h"
-#endif /* defined(FEATURE_CGI_EDIT_ACTIONS) || defined (FEATURE_TOGGLE) */
-#include "loadcfg.h"
-/* loadcfg.h is for global_toggle_state only */
-#ifdef FEATURE_PTHREAD
-#include "jcc.h"
-/* jcc.h is for mutex semaphore globals only */
-#endif /* def FEATURE_PTHREAD */
-const char cgi_h_rcs[] = CGI_H_VERSION;
-
-/*
- * List of CGI functions: name, handler, description
- * Note: Do NOT use single quotes in the description;
- *       this will break the dynamic "blocked" template!
- */
-static const struct cgi_dispatcher cgi_dispatchers[] = {
-   { "",
-         cgi_default,
-         "Privoxy main page",
-         TRUE },
-#ifdef FEATURE_GRACEFUL_TERMINATION
-   { "die", 
-         cgi_die,  
-         "<b>Shut down</b> - <em class=\"warning\">Do not deploy this build in a production environment, "
-        "this is a one click Denial Of Service attack!!!</em>",
-         FALSE }, 
-#endif
-   { "show-status", 
-         cgi_show_status,  
-#ifdef FEATURE_CGI_EDIT_ACTIONS
-        "View & change the current configuration",
-#else
-        "View the current configuration",
-#endif
-         TRUE }, 
-   { "show-version", 
-         cgi_show_version,  
-         "View the source code version numbers",
-          TRUE }, 
-   { "show-request", 
-         cgi_show_request,  
-         "View the request headers",
-         TRUE }, 
-   { "show-url-info",
-         cgi_show_url_info, 
-         "Look up which actions apply to a URL and why",
-         TRUE },
-#ifdef FEATURE_TOGGLE
-   { "toggle",
-         cgi_toggle, 
-         "Toggle Privoxy on or off",
-         FALSE },
-#endif /* def FEATURE_TOGGLE */
-#ifdef FEATURE_CGI_EDIT_ACTIONS
-   { "edit-actions", /* Edit the actions list */
-         cgi_edit_actions, 
-         NULL, FALSE },
-   { "eaa", /* Shortcut for edit-actions-add-url-form */
-         cgi_edit_actions_add_url_form, 
-         NULL, FALSE },
-   { "eau", /* Shortcut for edit-actions-url-form */
-         cgi_edit_actions_url_form, 
-         NULL, FALSE },
-   { "ear", /* Shortcut for edit-actions-remove-url-form */
-         cgi_edit_actions_remove_url_form, 
-         NULL, FALSE },
-   { "eal", /* Shortcut for edit-actions-list */
-         cgi_edit_actions_list, 
-         NULL, FALSE },
-   { "eafu", /* Shortcut for edit-actions-for-url */
-         cgi_edit_actions_for_url, 
-         NULL, FALSE },
-   { "eas", /* Shortcut for edit-actions-submit */
-         cgi_edit_actions_submit, 
-         NULL, FALSE },
-   { "easa", /* Shortcut for edit-actions-section-add */
-         cgi_edit_actions_section_add, 
-         NULL, FALSE  },
-   { "easr", /* Shortcut for edit-actions-section-remove */
-         cgi_edit_actions_section_remove, 
-         NULL, FALSE  },
-   { "eass", /* Shortcut for edit-actions-section-swap */
-         cgi_edit_actions_section_swap, 
-         NULL, FALSE  },
-   { "edit-actions-for-url",
-         cgi_edit_actions_for_url, 
-         NULL, FALSE  /* Edit the actions for (a) specified URL(s) */ },
-   { "edit-actions-list",
-         cgi_edit_actions_list, 
-         NULL, TRUE /* Edit the actions list */ },
-   { "edit-actions-submit",
-         cgi_edit_actions_submit, 
-         NULL, FALSE /* Change the actions for (a) specified URL(s) */ },
-   { "edit-actions-url",
-         cgi_edit_actions_url, 
-         NULL, FALSE /* Change a URL pattern in the actionsfile */ },
-   { "edit-actions-url-form",
-         cgi_edit_actions_url_form, 
-         NULL, FALSE /* Form to change a URL pattern in the actionsfile */ },
-   { "edit-actions-add-url",
-         cgi_edit_actions_add_url, 
-         NULL, FALSE /* Add a URL pattern to the actionsfile */ },
-   { "edit-actions-add-url-form",
-         cgi_edit_actions_add_url_form, 
-         NULL, FALSE /* Form to add a URL pattern to the actionsfile */ },
-   { "edit-actions-remove-url",
-         cgi_edit_actions_remove_url, 
-         NULL, FALSE /* Remove a URL pattern from the actionsfile */ },
-   { "edit-actions-remove-url-form",
-         cgi_edit_actions_remove_url_form, 
-         NULL, FALSE /* Form to remove a URL pattern from the actionsfile */ },
-   { "edit-actions-section-add",
-         cgi_edit_actions_section_add, 
-         NULL, FALSE /* Remove a section from the actionsfile */ },
-   { "edit-actions-section-remove",
-         cgi_edit_actions_section_remove, 
-         NULL, FALSE /* Remove a section from the actionsfile */ },
-   { "edit-actions-section-swap",
-         cgi_edit_actions_section_swap, 
-         NULL, FALSE /* Swap two sections in the actionsfile */ },
-#endif /* def FEATURE_CGI_EDIT_ACTIONS */
-   { "error-favicon.ico", 
-         cgi_send_error_favicon,  
-         NULL, TRUE /* Sends the favicon image for error pages. */ },
-   { "favicon.ico", 
-         cgi_send_default_favicon,  
-         NULL, TRUE /* Sends the default favicon image. */ },
-   { "robots.txt", 
-         cgi_robots_txt,  
-         NULL, TRUE /* Sends a robots.txt file to tell robots to go away. */ }, 
-   { "send-banner",
-         cgi_send_banner, 
-         NULL, TRUE /* Send a built-in image */ },
-   { "send-stylesheet",
-         cgi_send_stylesheet, 
-         NULL, FALSE /* Send templates/cgi-style.css */ },
-   { "t",
-         cgi_transparent_image, 
-         NULL, TRUE /* Send a transparent image (short name) */ },
-   { "url-info-osd.xml",
-         cgi_send_url_info_osd, 
-         NULL, TRUE /* Send templates/url-info-osd.xml */ },
-   { "user-manual",
-          cgi_send_user_manual,
-          NULL, TRUE /* Send user-manual */ },
-   { NULL, /* NULL Indicates end of list and default page */
-         cgi_error_404,
-         NULL, TRUE /* Unknown CGI page */ }
-};
-
-
-/*
- * Built-in images for ad replacement
- *
- * Hint: You can encode your own images like this:
- * cat your-image | perl -e 'while (read STDIN, $c, 1) { printf("\\%.3o", unpack("C", $c)); }'
- */
-
-#ifdef FEATURE_NO_GIFS
-
-/*
- * Checkerboard pattern, as a PNG.
- */
-const char image_pattern_data[] =
-   "\211\120\116\107\015\012\032\012\000\000\000\015\111\110\104"
-   "\122\000\000\000\004\000\000\000\004\010\006\000\000\000\251"
-   "\361\236\176\000\000\000\006\142\113\107\104\000\000\000\000"
-   "\000\000\371\103\273\177\000\000\000\033\111\104\101\124\010"
-   "\327\143\140\140\140\060\377\377\377\077\003\234\106\341\060"
-   "\060\230\063\020\124\001\000\161\021\031\241\034\364\030\143"
-   "\000\000\000\000\111\105\116\104\256\102\140\202";
-
-/*
- * 1x1 transparant PNG.
- */
-const char image_blank_data[] =
- "\211\120\116\107\015\012\032\012\000\000\000\015\111\110\104\122"
- "\000\000\000\001\000\000\000\001\001\003\000\000\000\045\333\126"
- "\312\000\000\000\003\120\114\124\105\377\377\377\247\304\033\310"
- "\000\000\000\001\164\122\116\123\000\100\346\330\146\000\000\000"
- "\001\142\113\107\104\000\210\005\035\110\000\000\000\012\111\104"
- "\101\124\170\001\143\140\000\000\000\002\000\001\163\165\001\030"
- "\000\000\000\000\111\105\116\104\256\102\140\202";
-#else
-
-/*
- * Checkerboard pattern, as a GIF.
- */
-const char image_pattern_data[] =
-   "\107\111\106\070\071\141\004\000\004\000\200\000\000\310\310"
-   "\310\377\377\377\041\376\016\111\040\167\141\163\040\141\040"
-   "\142\141\156\156\145\162\000\041\371\004\001\012\000\001\000"
-   "\054\000\000\000\000\004\000\004\000\000\002\005\104\174\147"
-   "\270\005\000\073";
-
-/*
- * 1x1 transparant GIF.
- */
-const char image_blank_data[] =
-   "GIF89a\001\000\001\000\200\000\000\377\377\377\000\000"
-   "\000!\371\004\001\000\000\000\000,\000\000\000\000\001"
-   "\000\001\000\000\002\002D\001\000;";
-#endif
-
-const size_t image_pattern_length = sizeof(image_pattern_data) - 1;
-const size_t image_blank_length   = sizeof(image_blank_data) - 1;
-
-
-static struct http_response cgi_error_memory_response[1];
-
-static struct http_response *dispatch_known_cgi(struct client_state * csp,
-                                                const char * path);
-static struct map *parse_cgi_parameters(char *argstring);
-
-
-/*********************************************************************
- * 
- * Function    :  dispatch_cgi
- *
- * Description :  Checks if a request URL has either the magical
- *                hostname CGI_SITE_1_HOST (usually http://p.p/) or
- *                matches CGI_SITE_2_HOST CGI_SITE_2_PATH (usually
- *                http://config.privoxy.org/). If so, it passes
- *                the (rest of the) path onto dispatch_known_cgi, which
- *                calls the relevant CGI handler function.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *
- * Returns     :  http_response if match, NULL if nonmatch or handler fail
- *
- *********************************************************************/
-struct http_response *dispatch_cgi(struct client_state *csp)
-{
-   const char *host = csp->http->host;
-   const char *path = csp->http->path;
-
-   /*
-    * Should we intercept ?
-    */
-
-   /* Note: "example.com" and "example.com." are equivalent hostnames. */
-
-   /* Either the host matches CGI_SITE_1_HOST ..*/
-   if (   ( (0 == strcmpic(host, CGI_SITE_1_HOST))
-         || (0 == strcmpic(host, CGI_SITE_1_HOST ".")))
-       && (path[0] == '/') )
-   {
-      /* ..then the path will all be for us.  Remove leading '/' */
-      path++;
-   }
-   /* Or it's the host part CGI_SITE_2_HOST, and the path CGI_SITE_2_PATH */
-   else if ( ( (0 == strcmpic(host, CGI_SITE_2_HOST ))
-            || (0 == strcmpic(host, CGI_SITE_2_HOST ".")) )
-          && (0 == strncmpic(path, CGI_SITE_2_PATH, strlen(CGI_SITE_2_PATH))) )
-   {
-      /* take everything following CGI_SITE_2_PATH */
-      path += strlen(CGI_SITE_2_PATH);
-      if (*path == '/')
-      {
-         /* skip the forward slash after CGI_SITE_2_PATH */
-         path++;
-      }
-      else if (*path != '\0')
-      {
-         /*
-          * weirdness: URL is /configXXX, where XXX is some string
-          * Do *NOT* intercept.
-          */
-         return NULL;
-      }
-   }
-   else
-   {
-      /* Not a CGI */
-      return NULL;
-   }
-
-   /* 
-    * This is a CGI call.
-    */
-
-   return dispatch_known_cgi(csp, path);
-}
-
-
-/*********************************************************************
- *
- * Function    :  grep_cgi_referrer
- *
- * Description :  Ugly provisorical fix that greps the value of the
- *                referer HTTP header field out of a linked list of
- *                strings like found at csp->headers. Will disappear
- *                in Privoxy 3.1.
- *
- *                FIXME: csp->headers ought to be csp->http->headers
- *                FIXME: Parsing all client header lines should
- *                       happen right after the request is received!
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *
- * Returns     :  pointer to value (no copy!), or NULL if none found.
- *
- *********************************************************************/
-static char *grep_cgi_referrer(const struct client_state *csp)
-{
-   struct list_entry *p;
-
-   for (p = csp->headers->first; p != NULL; p = p->next)
-   {
-      if (p->str == NULL) continue;
-      if (strncmpic(p->str, "Referer: ", 9) == 0)
-      {
-         return ((p->str) + 9);
-      }
-   }
-   return NULL;
-
-}
-
-
-/*********************************************************************
- * 
- * Function    :  referrer_is_safe
- *
- * Description :  Decides whether we trust the Referer for
- *                CGI pages which are only meant to be reachable
- *                through Privoxy's web interface directly.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *
- * Returns     :  TRUE  if the referrer is safe, or
- *                FALSE if the referrer is unsafe or not set.
- *
- *********************************************************************/
-static int referrer_is_safe(const struct client_state *csp)
-{
-   char *referrer;
-   static const char alternative_prefix[] = "http://" CGI_SITE_1_HOST "/";
-
-   referrer = grep_cgi_referrer(csp);
-
-   if (NULL == referrer)
-   {
-      /* No referrer, no access  */
-      log_error(LOG_LEVEL_ERROR, "Denying access to %s. No referrer found.",
-         csp->http->url);
-   }
-   else if ((0 == strncmp(referrer, CGI_PREFIX, sizeof(CGI_PREFIX)-1)
-         || (0 == strncmp(referrer, alternative_prefix, strlen(alternative_prefix)))))
-   {
-      /* Trustworthy referrer */
-      log_error(LOG_LEVEL_CGI, "Granting access to %s, referrer %s is trustworthy.",
-         csp->http->url, referrer);
-
-      return TRUE;
-   }
-   else
-   {
-      /* Untrustworthy referrer */
-      log_error(LOG_LEVEL_ERROR, "Denying access to %s, referrer %s isn't trustworthy.",
-         csp->http->url, referrer);
-   }
-
-   return FALSE;
-
-}
-
-/*********************************************************************
- * 
- * Function    :  dispatch_known_cgi
- *
- * Description :  Processes a CGI once dispatch_cgi has determined that
- *                it matches one of the magic prefixes. Parses the path
- *                as a cgi name plus query string, prepares a map that
- *                maps CGI parameter names to their values, initializes
- *                the http_response struct, and calls the relevant CGI
- *                handler function.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  path = Path of CGI, with the CGI prefix removed.
- *                       Should not have a leading "/".
- *
- * Returns     :  http_response, or NULL on handler failure or out of
- *                memory.
- *
- *********************************************************************/
-static struct http_response *dispatch_known_cgi(struct client_state * csp,
-                                                const char * path)
-{
-   const struct cgi_dispatcher *d;
-   struct map *param_list;
-   struct http_response *rsp;
-   char *query_args_start;
-   char *path_copy;
-   jb_err err;
-
-   if (NULL == (path_copy = strdup(path)))
-   {
-      return cgi_error_memory();
-   }
-   query_args_start = path_copy;
-   while (*query_args_start && *query_args_start != '?' && *query_args_start != '/')
-   {
-      query_args_start++;
-   }
-   if (*query_args_start == '/') 
-   {
-      *query_args_start++ = '\0';
-      if ((param_list = new_map()))
-      {
-         map(param_list, "file", 1, url_decode(query_args_start), 0);
-      }
-   }
-   else
-   {
-      if (*query_args_start == '?')
-      {
-         *query_args_start++ = '\0';
-      }
-      if (NULL == (param_list = parse_cgi_parameters(query_args_start)))
-      {
-         free(path_copy);
-         return cgi_error_memory();
-      }
-   }
-
-   /*
-    * At this point:
-    * path_copy        = CGI call name
-    * param_list       = CGI params, as map
-    */
-
-   /* Get mem for response or fail*/
-   if (NULL == (rsp = alloc_http_response()))
-   {
-      free(path_copy);
-      free_map(param_list);
-      return cgi_error_memory();
-   }
-
-   /* 
-    * Find and start the right CGI function
-    */
-   d = cgi_dispatchers;
-   for (;;)
-   {
-      if ((d->name == NULL) || (strcmp(path_copy, d->name) == 0))
-      {
-         /*
-          * If the called CGI is either harmless, or referred
-          * from a trusted source, start it.
-          */
-         if (d->harmless || referrer_is_safe(csp))
-         {
-            err = (d->handler)(csp, rsp, param_list);
-         }
-         else
-         {
-            /*
-             * Else, modify toggle calls so that they only display
-             * the status, and deny all other calls.
-             */
-            if (0 == strcmp(path_copy, "toggle"))
-            {
-               unmap(param_list, "set");
-               err = (d->handler)(csp, rsp, param_list);
-            }
-            else
-            {
-               err = cgi_error_disabled(csp, rsp);
-            }
-         }
-
-         free(path_copy);
-         free_map(param_list);
-
-         if (err == JB_ERR_CGI_PARAMS)
-         {
-            err = cgi_error_bad_param(csp, rsp);
-         }
-         if (err && (err != JB_ERR_MEMORY))
-         {
-            /* Unexpected error! Shouldn't get here */
-            log_error(LOG_LEVEL_ERROR, "Unexpected CGI error %d in top-level handler.  Please file a bug report!", err);
-            err = cgi_error_unknown(csp, rsp, err);
-         }
-         if (!err)
-         {
-            /* It worked */
-            rsp->reason = RSP_REASON_CGI_CALL;
-            return finish_http_response(csp, rsp);
-         }
-         else
-         {
-            /* Error in handler, probably out-of-memory */
-            free_http_response(rsp);
-            return cgi_error_memory();
-         }
-      }
-      d++;
-   }
-}
-   
-        
-/*********************************************************************
- *
- * Function    :  parse_cgi_parameters
- *
- * Description :  Parse a URL-encoded argument string into name/value
- *                pairs and store them in a struct map list.
- *
- * Parameters  :
- *          1  :  argstring = string to be parsed.  Will be trashed.
- *
- * Returns     :  pointer to param list, or NULL if out of memory.
- *
- *********************************************************************/
-static struct map *parse_cgi_parameters(char *argstring)
-{
-   char *p;
-   char *vector[BUFFER_SIZE];
-   int pairs, i;
-   struct map *cgi_params;
-
-   if (NULL == (cgi_params = new_map()))
-   {
-      return NULL;
-   }
-
-   /* 
-    * IE 5 does, of course, violate RFC 2316 Sect 4.1 and sends
-    * the fragment identifier along with the request, so we must
-    * cut it off here, so it won't pollute the CGI params:
-    */
-   if (NULL != (p = strchr(argstring, '#')))
-   {
-      *p = '\0';
-   }
-
-   pairs = ssplit(argstring, "&", vector, SZ(vector), 1, 1);
-
-   for (i = 0; i < pairs; i++)
-   {
-      if ((NULL != (p = strchr(vector[i], '='))) && (*(p+1) != '\0'))
-      {
-         *p = '\0';
-         if (map(cgi_params, url_decode(vector[i]), 0, url_decode(++p), 0))
-         {
-            free_map(cgi_params);
-            return NULL;
-         }
-      }
-   }
-
-   return cgi_params;
-
-}
-
-
-/*********************************************************************
- *
- * Function    :  get_char_param
- *
- * Description :  Get a single-character parameter passed to a CGI
- *                function.
- *
- * Parameters  :
- *          1  :  parameters = map of cgi parameters
- *          2  :  param_name = The name of the parameter to read
- *
- * Returns     :  Uppercase character on success, '\0' on error.
- *
- *********************************************************************/
-char get_char_param(const struct map *parameters,
-                    const char *param_name)
-{
-   char ch;
-
-   assert(parameters);
-   assert(param_name);
-
-   ch = *(lookup(parameters, param_name));
-   if ((ch >= 'a') && (ch <= 'z'))
-   {
-      ch = (char)(ch - 'a' + 'A');
-   }
-
-   return ch;
-}
-
-
-/*********************************************************************
- *
- * Function    :  get_string_param
- *
- * Description :  Get a string paramater, to be used as an
- *                ACTION_STRING or ACTION_MULTI paramater.
- *                Validates the input to prevent stupid/malicious
- *                users from corrupting their action file.
- *
- * Parameters  :
- *          1  :  parameters = map of cgi parameters
- *          2  :  param_name = The name of the parameter to read
- *          3  :  pparam = destination for paramater.  Allocated as
- *                part of the map "parameters", so don't free it.
- *                Set to NULL if not specified.
- *
- * Returns     :  JB_ERR_OK         on success, or if the paramater
- *                                  was not specified.
- *                JB_ERR_MEMORY     on out-of-memory.
- *                JB_ERR_CGI_PARAMS if the paramater is not valid.
- *
- *********************************************************************/
-jb_err get_string_param(const struct map *parameters,
-                        const char *param_name,
-                        const char **pparam)
-{
-   const char *param;
-   const char *s;
-   char ch;
-
-   assert(parameters);
-   assert(param_name);
-   assert(pparam);
-
-   *pparam = NULL;
-
-   param = lookup(parameters, param_name);
-   if (!*param)
-   {
-      return JB_ERR_OK;
-   }
-
-   if (strlen(param) >= CGI_PARAM_LEN_MAX)
-   {
-      /*
-       * Too long.
-       *
-       * Note that the length limit is arbitrary, it just seems
-       * sensible to limit it to *something*.  There's no
-       * technical reason for any limit at all.
-       */
-      return JB_ERR_CGI_PARAMS;
-   }
-
-   /* Check every character to see if it's legal */
-   s = param;
-   while ((ch = *s++) != '\0')
-   {
-      if ( ((unsigned char)ch < (unsigned char)' ')
-        || (ch == '}') )
-      {
-         /* Probable hack attempt, or user accidentally used '}'. */
-         return JB_ERR_CGI_PARAMS;
-      }
-   }
-
-   /* Success */
-   *pparam = param;
-
-   return JB_ERR_OK;
-}
-
-
-/*********************************************************************
- *
- * Function    :  get_number_param
- *
- * Description :  Get a non-negative integer from the parameters
- *                passed to a CGI function.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  parameters = map of cgi parameters
- *          3  :  name = Name of CGI parameter to read
- *          4  :  pvalue = destination for value.
- *                         Set to -1 on error.
- *
- * Returns     :  JB_ERR_OK         on success
- *                JB_ERR_MEMORY     on out-of-memory
- *                JB_ERR_CGI_PARAMS if the parameter was not specified
- *                                  or is not valid.
- *
- *********************************************************************/
-jb_err get_number_param(struct client_state *csp,
-                        const struct map *parameters,
-                        char *name,
-                        unsigned *pvalue)
-{
-   const char *param;
-   char ch;
-   unsigned value;
-
-   assert(csp);
-   assert(parameters);
-   assert(name);
-   assert(pvalue);
-
-   *pvalue = 0; 
-
-   param = lookup(parameters, name);
-   if (!*param)
-   {
-      return JB_ERR_CGI_PARAMS;
-   }
-
-   /* We don't use atoi because I want to check this carefully... */
-
-   value = 0;
-   while ((ch = *param++) != '\0')
-   {
-      if ((ch < '0') || (ch > '9'))
-      {
-         return JB_ERR_CGI_PARAMS;
-      }
-
-      ch = (char)(ch - '0');
-
-      /* Note:
-       *
-       * <limits.h> defines UINT_MAX
-       *
-       * (UINT_MAX - ch) / 10 is the largest number that
-       *     can be safely multiplied by 10 then have ch added.
-       */
-      if (value > ((UINT_MAX - (unsigned)ch) / 10U))
-      {
-         return JB_ERR_CGI_PARAMS;
-      }
-
-      value = value * 10 + (unsigned)ch;
-   }
-
-   /* Success */
-   *pvalue = value;
-
-   return JB_ERR_OK;
-
-}
-
-
-/*********************************************************************
- *
- * Function    :  error_response
- *
- * Description :  returns an http_response that explains the reason
- *                why a request failed.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  templatename = Which template should be used for the answer
- *          3  :  sys_err = system error number
- *
- * Returns     :  A http_response.  If we run out of memory, this
- *                will be cgi_error_memory().
- *
- *********************************************************************/
-struct http_response *error_response(struct client_state *csp,
-                                     const char *templatename,
-                                     int sys_err)
-{
-   jb_err err;
-   struct http_response *rsp;
-   struct map *exports = default_exports(csp, NULL);
-   char *path = NULL;
-
-   if (exports == NULL)
-   {
-      return cgi_error_memory();
-   }
-
-   if (NULL == (rsp = alloc_http_response()))
-   {
-      free_map(exports);
-      return cgi_error_memory();
-   }
-
-#ifdef FEATURE_FORCE_LOAD
-   if (csp->flags & CSP_FLAG_FORCED)
-   {
-      path = strdup(FORCE_PREFIX);
-   }
-   else
-#endif /* def FEATURE_FORCE_LOAD */
-   {
-      path = strdup("");
-   }
-   err = string_append(&path, csp->http->path);
-
-   if (!err) err = map(exports, "host", 1, html_encode(csp->http->host), 0);
-   if (!err) err = map(exports, "hostport", 1, html_encode(csp->http->hostport), 0);
-   if (!err) err = map(exports, "path", 1, html_encode_and_free_original(path), 0);
-   if (!err) err = map(exports, "error", 1, html_encode_and_free_original(safe_strerror(sys_err)), 0);
-   if (!err) err = map(exports, "protocol", 1, csp->http->ssl ? "https://" : "http://", 1); 
-   if (!err)
-   {
-     err = map(exports, "host-ip", 1, html_encode(csp->http->host_ip_addr_str), 0);
-     if (err)
-     {
-       /* Some failures, like "404 no such domain", don't have an IP address. */
-       err = map(exports, "host-ip", 1, html_encode(csp->http->host), 0);
-     }
-   }
-
-
-   if (err)
-   {
-      free_map(exports);
-      free_http_response(rsp);
-      return cgi_error_memory();
-   }
-
-   if (!strcmp(templatename, "no-such-domain"))
-   {
-      rsp->status = strdup("404 No such domain");
-      if (rsp->status == NULL)
-      {
-         free_map(exports);
-         free_http_response(rsp);
-         return cgi_error_memory();
-      }
-      rsp->reason = RSP_REASON_NO_SUCH_DOMAIN;
-   }
-   else if (!strcmp(templatename, "forwarding-failed"))
-   {
-      const struct forward_spec *fwd = forward_url(csp, csp->http);
-      char *socks_type = NULL;
-      if (fwd == NULL)
-      {
-         log_error(LOG_LEVEL_FATAL, "gateway spec is NULL. This shouldn't happen!");
-         /* Never get here - LOG_LEVEL_FATAL causes program exit */
-      }
-
-      /*
-       * XXX: While the template is called forwarding-failed,
-       * it currently only handles socks forwarding failures.
-       */
-      assert(fwd != NULL);
-      assert(fwd->type != SOCKS_NONE);
-
-      /*
-       * Map failure reason, forwarding type and forwarder.
-       */
-      if (NULL == csp->error_message)
-      {
-         /*
-          * Either we forgot to record the failure reason,
-          * or the memory allocation failed.
-          */
-         log_error(LOG_LEVEL_ERROR, "Socks failure reason missing.");
-         csp->error_message = strdup("Failure reason missing. Check the log file for details.");
-      }
-      if (!err) err = map(exports, "gateway", 1, fwd->gateway_host, 1);
-
-      /*
-       * XXX: this is almost the same code as in cgi_show_url_info()
-       * and thus should be factored out and shared.
-       */
-      switch (fwd->type)
-      {
-         case SOCKS_4:
-            socks_type = "socks4-";
-            break;
-         case SOCKS_4A:
-            socks_type = "socks4a-";
-            break;
-         case SOCKS_5:
-            socks_type = "socks5-";
-            break;
-         default:
-            log_error(LOG_LEVEL_FATAL, "Unknown socks type: %d.", fwd->type);
-      }
-
-      if (!err) err = map(exports, "forwarding-type", 1, socks_type, 1);
-      if (!err) err = map(exports, "error-message", 1, html_encode(csp->error_message), 0);
-
-      if (!err) rsp->status = strdup("503 Forwarding failure");
-      if ((rsp->status == NULL) || (NULL == csp->error_message) || err)
-      {
-         free_map(exports);
-         free_http_response(rsp);
-         return cgi_error_memory();
-      }
-      rsp->reason = RSP_REASON_FORWARDING_FAILED;
-   }
-   else if (!strcmp(templatename, "connect-failed"))
-   {
-      rsp->status = strdup("503 Connect failed");
-      if (rsp->status == NULL)
-      {
-         free_map(exports);
-         free_http_response(rsp);
-         return cgi_error_memory();
-      }
-      rsp->reason = RSP_REASON_CONNECT_FAILED;
-   }
-
-   err = template_fill_for_cgi(csp, templatename, exports, rsp);
-   if (err)
-   {
-      free_http_response(rsp);
-      return cgi_error_memory();
-   }
-
-   return finish_http_response(csp, rsp);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_error_disabled
- *
- * Description :  CGI function that is called to generate an error
- *                response if the actions editor or toggle CGI are
- *                accessed despite having being disabled at compile-
- *                or run-time, or if the user followed an untrusted link
- *                to access a unsafe CGI feature that is only reachable
- *                through Privoxy directly.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *
- * CGI Parameters : none
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.
- *
- *********************************************************************/
-jb_err cgi_error_disabled(const struct client_state *csp,
-                          struct http_response *rsp)
-{
-   struct map *exports;
-
-   assert(csp);
-   assert(rsp);
-
-   if (NULL == (exports = default_exports(csp, "cgi-error-disabled")))
-   {
-      return JB_ERR_MEMORY;
-   }
-   if (map(exports, "url", 1, html_encode(csp->http->url), 0))
-   {
-      /* Not important enough to do anything */
-      log_error(LOG_LEVEL_ERROR, "Failed to fill in url.");
-   }
-
-   return template_fill_for_cgi(csp, "cgi-error-disabled", exports, rsp);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_init_error_messages
- *
- * Description :  Call at the start of the program to initialize
- *                the error message used by cgi_error_memory().
- *
- * Parameters  :  N/A
- *
- * Returns     :  N/A
- *
- *********************************************************************/
-void cgi_init_error_messages(void)
-{
-   memset(cgi_error_memory_response, '\0', sizeof(*cgi_error_memory_response));
-   cgi_error_memory_response->head =
-      "HTTP/1.0 500 Internal Privoxy Error\r\n"
-      "Content-Type: text/html\r\n"
-      "\r\n";
-   cgi_error_memory_response->body =
-      "<html>\r\n"
-      "<head>\r\n"
-      " <title>500 Internal Privoxy Error</title>\r\n"
-      " <link rel=\"shortcut icon\" href=\"" CGI_PREFIX "error-favicon.ico\" type=\"image/x-icon\">"
-      "</head>\r\n"
-      "<body>\r\n"
-      "<h1>500 Internal Privoxy Error</h1>\r\n"
-      "<p>Privoxy <b>ran out of memory</b> while processing your request.</p>\r\n"
-      "<p>Please contact your proxy administrator, or try again later</p>\r\n"
-      "</body>\r\n"
-      "</html>\r\n";
-
-   cgi_error_memory_response->head_length =
-      strlen(cgi_error_memory_response->head);
-   cgi_error_memory_response->content_length =
-      strlen(cgi_error_memory_response->body);
-   cgi_error_memory_response->reason = RSP_REASON_OUT_OF_MEMORY;
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_error_memory
- *
- * Description :  Called if a CGI function runs out of memory.
- *                Returns a statically-allocated error response.
- *
- * Parameters  :  N/A
- *
- * Returns     :  http_response data structure for output.  This is
- *                statically allocated, for obvious reasons.
- *
- *********************************************************************/
-struct http_response *cgi_error_memory(void)
-{
-   /* assert that it's been initialized. */
-   assert(cgi_error_memory_response->head);
-
-   return cgi_error_memory_response;
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_error_no_template
- *
- * Description :  Almost-CGI function that is called if a template
- *                cannot be loaded.  Note this is not a true CGI,
- *                it takes a template name rather than a map of 
- *                parameters.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  template_name = Name of template that could not
- *                                be loaded.
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err cgi_error_no_template(const struct client_state *csp,
-                             struct http_response *rsp,
-                             const char *template_name)
-{
-   static const char status[] =
-      "500 Internal Privoxy Error";
-   static const char body_prefix[] =
-      "<html>\r\n"
-      "<head>\r\n"
-      " <title>500 Internal Privoxy Error</title>\r\n"
-      " <link rel=\"shortcut icon\" href=\"" CGI_PREFIX "error-favicon.ico\" type=\"image/x-icon\">"
-      "</head>\r\n"
-      "<body>\r\n"
-      "<h1>500 Internal Privoxy Error</h1>\r\n"
-      "<p>Privoxy encountered an error while processing your request:</p>\r\n"
-      "<p><b>Could not load template file <code>";
-   static const char body_suffix[] =
-      "</code> or one of its included components.</b></p>\r\n"
-      "<p>Please contact your proxy administrator.</p>\r\n"
-      "<p>If you are the proxy administrator, please put the required file(s)"
-      "in the <code><i>(confdir)</i>/templates</code> directory.  The "
-      "location of the <code><i>(confdir)</i></code> directory "
-      "is specified in the main Privoxy <code>config</code> "
-      "file.  (It's typically the Privoxy install directory"
-#ifndef _WIN32
-      ", or <code>/etc/privoxy/</code>"
-#endif /* ndef _WIN32 */
-      ").</p>\r\n"
-      "</body>\r\n"
-      "</html>\r\n";
-   const size_t body_size = strlen(body_prefix) + strlen(template_name) + strlen(body_suffix) + 1;
-
-   assert(csp);
-   assert(rsp);
-   assert(template_name);
-
-   /* Reset rsp, if needed */
-   freez(rsp->status);
-   freez(rsp->head);
-   freez(rsp->body);
-   rsp->content_length = 0;
-   rsp->head_length = 0;
-   rsp->is_static = 0;
-
-   rsp->body = malloc(body_size);
-   if (rsp->body == NULL)
-   {
-      return JB_ERR_MEMORY;
-   }
-   strlcpy(rsp->body, body_prefix, body_size);
-   strlcat(rsp->body, template_name, body_size);
-   strlcat(rsp->body, body_suffix, body_size);
-
-   rsp->status = strdup(status);
-   if (rsp->status == NULL)
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   return JB_ERR_OK;
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_error_unknown
- *
- * Description :  Almost-CGI function that is called if an unexpected
- *                error occurs in the top-level CGI dispatcher.
- *                In this context, "unexpected" means "anything other
- *                than JB_ERR_MEMORY or JB_ERR_CGI_PARAMS" - CGIs are
- *                expected to handle all other errors internally,
- *                since they can give more relavent error messages
- *                that way.
- *
- *                Note this is not a true CGI, it takes an error
- *                code rather than a map of parameters.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  error_to_report = Error code to report.
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err cgi_error_unknown(const struct client_state *csp,
-                         struct http_response *rsp,
-                         jb_err error_to_report)
-{
-   static const char status[] =
-      "500 Internal Privoxy Error";
-   static const char body_prefix[] =
-      "<html>\r\n"
-      "<head>\r\n"
-      " <title>500 Internal Privoxy Error</title>\r\n"
-      " <link rel=\"shortcut icon\" href=\"" CGI_PREFIX "error-favicon.ico\" type=\"image/x-icon\">"
-      "</head>\r\n"
-      "<body>\r\n"
-      "<h1>500 Internal Privoxy Error</h1>\r\n"
-      "<p>Privoxy encountered an error while processing your request:</p>\r\n"
-      "<p><b>Unexpected internal error: ";
-   static const char body_suffix[] =
-      "</b></p>\r\n"
-      "<p>Please "
-      "<a href=\"http://sourceforge.net/tracker/?group_id=11118&atid=111118\">"
-      "file a bug report</a>.</p>\r\n"
-      "</body>\r\n"
-      "</html>\r\n";
-   char errnumbuf[30];
-   /*
-    * Due to sizeof(errnumbuf), body_size will be slightly
-    * bigger than necessary but it doesn't really matter.
-    */
-   const size_t body_size = strlen(body_prefix) + sizeof(errnumbuf) + strlen(body_suffix) + 1;
-   assert(csp);
-   assert(rsp);
-
-   /* Reset rsp, if needed */
-   freez(rsp->status);
-   freez(rsp->head);
-   freez(rsp->body);
-   rsp->content_length = 0;
-   rsp->head_length = 0;
-   rsp->is_static = 0;
-   rsp->reason = RSP_REASON_INTERNAL_ERROR;
-
-   snprintf(errnumbuf, sizeof(errnumbuf), "%d", error_to_report);
-
-   rsp->body = malloc(body_size);
-   if (rsp->body == NULL)
-   {
-      return JB_ERR_MEMORY;
-   }
-   strlcpy(rsp->body, body_prefix, body_size);
-   strlcat(rsp->body, errnumbuf,   body_size);
-   strlcat(rsp->body, body_suffix, body_size);
-
-   rsp->status = strdup(status);
-   if (rsp->status == NULL)
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   return JB_ERR_OK;
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_error_bad_param
- *
- * Description :  CGI function that is called if the parameters
- *                (query string) for a CGI were wrong.
- *               
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *
- * CGI Parameters : none
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err cgi_error_bad_param(const struct client_state *csp,
-                           struct http_response *rsp)
-{
-   struct map *exports;
-
-   assert(csp);
-   assert(rsp);
-
-   if (NULL == (exports = default_exports(csp, NULL)))
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   return template_fill_for_cgi(csp, "cgi-error-bad-param", exports, rsp);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_redirect 
- *
- * Description :  CGI support function to generate a HTTP redirect
- *                message
- *
- * Parameters  :
- *          1  :  rsp = http_response data structure for output
- *          2  :  target = string with the target URL
- *
- * CGI Parameters : None
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err cgi_redirect (struct http_response * rsp, const char *target)
-{
-   jb_err err;
-
-   assert(rsp);
-   assert(target);
-
-   err = enlist_unique_header(rsp->headers, "Location", target);
-
-   rsp->status = strdup("302 Local Redirect from Privoxy");
-   if (rsp->status == NULL)
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   return err;
-}
-
-
-/*********************************************************************
- *
- * Function    :  add_help_link
- *
- * Description :  Produce a copy of the string given as item,
- *                embedded in an HTML link to its corresponding
- *                section (item name in uppercase) in the actions
- *                chapter of the user manual, (whose URL is given in
- *                the config and defaults to our web site).
- *
- *                FIXME: I currently only work for actions, and would
- *                       like to be generalized for other topics.
- *
- * Parameters  :  
- *          1  :  item = item (will NOT be free()d.) 
- *                       It is assumed to be HTML-safe.
- *          2  :  config = The current configuration.
- *
- * Returns     :  String with item embedded in link, or NULL on
- *                out-of-memory
- *
- *********************************************************************/
-char *add_help_link(const char *item,
-                    struct configuration_spec *config)
-{
-   char *result;
-
-   if (!item) return NULL;
-
-   result = strdup("<a href=\"");
-   if (!strncmpic(config->usermanual, "file://", 7) ||
-       !strncmpic(config->usermanual, "http", 4))
-   {
-      string_append(&result, config->usermanual);
-   }
-   else
-   {
-      string_append(&result, "http://");
-      string_append(&result, CGI_SITE_2_HOST);
-      string_append(&result, "/user-manual/");
-   }
-   string_append(&result, ACTIONS_HELP_PREFIX);
-   string_join  (&result, string_toupper(item));
-   string_append(&result, "\">");
-   string_append(&result, item);
-   string_append(&result, "</a> ");
-
-   return result;
-}
-
-
-/*********************************************************************
- *
- * Function    :  get_http_time
- *
- * Description :  Get the time in a format suitable for use in a
- *                HTTP header - e.g.:
- *                "Sun, 06 Nov 1994 08:49:37 GMT"
- *
- * Parameters  :  
- *          1  :  time_offset = Time returned will be current time
- *                              plus this number of seconds.
- *          2  :  buf = Destination for result.
- *          3  :  buffer_size = Size of the buffer above. Must be big
- *                              enough to hold 29 characters plus a
- *                              trailing zero.
- *
- * Returns     :  N/A
- *
- *********************************************************************/
-void get_http_time(int time_offset, char *buf, size_t buffer_size)
-{
-   static const char day_names[7][4] =
-      { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
-   static const char month_names[12][4] =
-      { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
-        "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
-
-   struct tm *t;
-   time_t current_time;
-#if defined(HAVE_GMTIME_R)
-   struct tm dummy;
-#endif
-
-   assert(buf);
-   assert(buffer_size > (size_t)29);
-
-   time(&current_time);
-
-   current_time += time_offset;
-
-   /* get and save the gmt */
-#if HAVE_GMTIME_R
-   t = gmtime_r(&current_time, &dummy);
-#elif FEATURE_PTHREAD
-   privoxy_mutex_lock(&gmtime_mutex);
-   t = gmtime(&current_time);
-   privoxy_mutex_unlock(&gmtime_mutex);
-#else
-   t = gmtime(&current_time);
-#endif
-
-   /* Format: "Sun, 06 Nov 1994 08:49:37 GMT" */
-   snprintf(buf, buffer_size,
-      "%s, %02d %s %4d %02d:%02d:%02d GMT",
-      day_names[t->tm_wday],
-      t->tm_mday,
-      month_names[t->tm_mon],
-      t->tm_year + 1900,
-      t->tm_hour,
-      t->tm_min,
-      t->tm_sec
-      );
-
-}
-
-/*********************************************************************
- *
- * Function    :  get_locale_time
- *
- * Description :  Get the time in a date(1)-like format
- *                according to the current locale - e.g.:
- *                "Fri Aug 29 19:37:12 CEST 2008"
- *
- *                XXX: Should we allow the user to change the format?
- *
- * Parameters  :
- *          1  :  buf         = Destination for result.
- *          2  :  buffer_size = Size of the buffer above. Must be big
- *                              enough to hold 29 characters plus a
- *                              trailing zero.
- *
- * Returns     :  N/A
- *
- *********************************************************************/
-static void get_locale_time(char *buf, size_t buffer_size)
-{
-   struct tm *timeptr;
-   time_t current_time;
-#if defined(HAVE_LOCALTIME_R)
-   struct tm dummy;
-#endif
-
-   assert(buf);
-   assert(buffer_size > (size_t)29);
-
-   time(&current_time);
-
-#if HAVE_LOCALTIME_R
-   timeptr = localtime_r(&current_time, &dummy);
-#elif FEATURE_PTHREAD
-   privoxy_mutex_lock(&localtime_mutex);
-   timeptr = localtime(&current_time);
-   privoxy_mutex_unlock(&localtime_mutex);
-#else
-   timeptr = localtime(&current_time);
-#endif
-
-   strftime(buf, buffer_size, "%a %b %d %X %Z %Y", timeptr);
-
-}
-
-/*********************************************************************
- *
- * Function    :  finish_http_response
- *
- * Description :  Fill in the missing headers in an http response,
- *                and flatten the headers to an http head.
- *                For HEAD requests the body is freed once
- *                the Content-Length header is set.
- *
- * Parameters  :
- *          1  :  rsp = pointer to http_response to be processed
- *
- * Returns     :  A http_response, usually the rsp parameter.
- *                On error, free()s rsp and returns cgi_error_memory()
- *
- *********************************************************************/
-struct http_response *finish_http_response(const struct client_state *csp, struct http_response *rsp)
-{
-   char buf[BUFFER_SIZE];
-   jb_err err;
-
-   /* Special case - do NOT change this statically allocated response,
-    * which is ready for output anyway.
-    */
-   if (rsp == cgi_error_memory_response)
-   {
-      return rsp;
-   }
-
-   /* 
-    * Fill in the HTTP Status, using HTTP/1.1
-    * unless the client asked for HTTP/1.0.
-    */
-   snprintf(buf, sizeof(buf), "%s %s",
-      strcmpic(csp->http->ver, "HTTP/1.0") ? "HTTP/1.1" : "HTTP/1.0",
-      rsp->status ? rsp->status : "200 OK");
-   err = enlist_first(rsp->headers, buf);
-
-   /* 
-    * Set the Content-Length
-    */
-   if (rsp->content_length == 0)
-   {
-      rsp->content_length = rsp->body ? strlen(rsp->body) : 0;
-   }
-   if (!err)
-   {
-      snprintf(buf, sizeof(buf), "Content-Length: %d", (int)rsp->content_length);
-      err = enlist(rsp->headers, buf);
-   }
-
-   if (0 == strcmpic(csp->http->gpc, "head"))
-   {
-      /*
-       * The client only asked for the head. Dispose
-       * the body and log an offensive message.
-       *
-       * While it may seem to be a bit inefficient to
-       * prepare the body if it isn't needed, it's the
-       * only way to get the Content-Length right for
-       * dynamic pages. We could have disposed the body
-       * earlier, but not without duplicating the
-       * Content-Length setting code above.
-       */
-      log_error(LOG_LEVEL_CGI, "Preparing to give head to %s.", csp->ip_addr_str);
-      freez(rsp->body);
-      rsp->content_length = 0;
-   }
-
-   if (strncmpic(rsp->status, "302", 3))
-   {
-      /*
-       * If it's not a redirect without any content,
-       * set the Content-Type to text/html if it's
-       * not already specified.
-       */
-      if (!err) err = enlist_unique(rsp->headers, "Content-Type: text/html", 13);
-   }
-
-   /*
-    * Fill in the rest of the default headers:
-    *
-    * Date: set to current date/time.
-    * Last-Modified: set to date/time the page was last changed.
-    * Expires: set to date/time page next needs reloading.
-    * Cache-Control: set to "no-cache" if applicable.
-    * 
-    * See http://www.w3.org/Protocols/rfc2068/rfc2068
-    */
-   if (rsp->is_static)
-   {
-      /*
-       * Set Expires to about 10 min into the future so it'll get reloaded
-       * occasionally, e.g. if Privoxy gets upgraded.
-       */
-
-      if (!err)
-      {
-         get_http_time(0, buf, sizeof(buf));
-         err = enlist_unique_header(rsp->headers, "Date", buf);
-      }
-
-      /* Some date in the past. */
-      if (!err) err = enlist_unique_header(rsp->headers, "Last-Modified", "Sat, 17 Jun 2000 12:00:00 GMT");
-
-      if (!err)
-      {
-         get_http_time(10 * 60, buf, sizeof(buf)); /* 10 * 60sec = 10 minutes */
-         err = enlist_unique_header(rsp->headers, "Expires", buf);
-      }
-   }
-   else if (!strncmpic(rsp->status, "302", 3))
-   {
-      get_http_time(0, buf, sizeof(buf));
-      if (!err) err = enlist_unique_header(rsp->headers, "Date", buf);
-   }
-   else
-   {
-      /*
-       * Setting "Cache-Control" to "no-cache" and  "Expires" to
-       * the current time doesn't exactly forbid caching, it just
-       * requires the client to revalidate the cached copy.
-       *
-       * If a temporary problem occurs and the user tries again after
-       * getting Privoxy's error message, a compliant browser may set the
-       * If-Modified-Since header with the content of the error page's
-       * Last-Modified header. More often than not, the document on the server
-       * is older than Privoxy's error message, the server would send status code
-       * 304 and the browser would display the outdated error message again and again.
-       *
-       * For documents delivered with status code 403, 404 and 503 we set "Last-Modified"
-       * to Tim Berners-Lee's birthday, which predates the age of any page on the web
-       * and can be safely used to "revalidate" without getting a status code 304.
-       *
-       * There is no need to let the useless If-Modified-Since header reach the
-       * server, it is therefore stripped by client_if_modified_since in parsers.c.
-       */
-      if (!err) err = enlist_unique_header(rsp->headers, "Cache-Control", "no-cache");
-
-      get_http_time(0, buf, sizeof(buf));
-      if (!err) err = enlist_unique_header(rsp->headers, "Date", buf);
-      if (!strncmpic(rsp->status, "403", 3)
-       || !strncmpic(rsp->status, "404", 3)
-       || !strncmpic(rsp->status, "503", 3))
-      {
-         if (!err) err = enlist_unique_header(rsp->headers, "Last-Modified", "Wed, 08 Jun 1955 12:00:00 GMT");
-      }
-      else
-      {
-         if (!err) err = enlist_unique_header(rsp->headers, "Last-Modified", buf);
-      }
-      if (!err) err = enlist_unique_header(rsp->headers, "Expires", "Sat, 17 Jun 2000 12:00:00 GMT");
-      if (!err) err = enlist_unique_header(rsp->headers, "Pragma", "no-cache");
-   }
-
-   /*
-    * Quoting RFC 2616:
-    *
-    * HTTP/1.1 applications that do not support persistent connections MUST
-    * include the "close" connection option in every message.
-    */
-   if (!err) err = enlist_unique_header(rsp->headers, "Connection", "close");
-
-   /* 
-    * Write the head
-    */
-   if (err || (NULL == (rsp->head = list_to_text(rsp->headers))))
-   {
-      free_http_response(rsp);
-      return cgi_error_memory();
-   }
-   rsp->head_length = strlen(rsp->head);
-
-   return rsp;
-
-}
-
-
-/*********************************************************************
- *
- * Function    :  alloc_http_response
- *
- * Description :  Allocates a new http_response structure.
- *
- * Parameters  :  N/A
- *
- * Returns     :  pointer to a new http_response, or NULL.
- *
- *********************************************************************/
-struct http_response *alloc_http_response(void)
-{
-   return (struct http_response *) zalloc(sizeof(struct http_response));
-
-}
-
-
-/*********************************************************************
- *
- * Function    :  free_http_response
- *
- * Description :  Free the memory occupied by an http_response
- *                and its depandant structures.
- *
- * Parameters  :
- *          1  :  rsp = pointer to http_response to be freed
- *
- * Returns     :  N/A
- *
- *********************************************************************/
-void free_http_response(struct http_response *rsp)
-{
-   /*
-    * Must special case cgi_error_memory_response, which is never freed.
-    */
-   if (rsp && (rsp != cgi_error_memory_response))
-   {
-      freez(rsp->status);
-      freez(rsp->head);
-      freez(rsp->body);
-      destroy_list(rsp->headers);
-      free(rsp);
-   }
-
-}
-
-
-/*********************************************************************
- *
- * Function    :  template_load
- *
- * Description :  CGI support function that loads a given HTML
- *                template, ignoring comment lines and following
- *                #include statements up to a depth of 1.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  template_ptr = Destination for pointer to loaded
- *                               template text.
- *          3  :  templatename = name of the HTML template to be used
- *          4  :  recursive = Flag set if this function calls itself
- *                            following an #include statament
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *                JB_ERR_FILE if the template file cannot be read
- *
- *********************************************************************/
-jb_err template_load(const struct client_state *csp, char **template_ptr, 
-                     const char *templatename, int recursive)
-{
-   jb_err err;
-   char *templates_dir_path;
-   char *full_path;
-   char *file_buffer;
-   char *included_module;
-   const char *p;
-   FILE *fp;
-   char buf[BUFFER_SIZE];
-
-   assert(csp);
-   assert(template_ptr);
-   assert(templatename);
-
-   *template_ptr = NULL;
-
-   /* Validate template name.  Paranoia. */
-   for (p = templatename; *p != 0; p++)
-   {
-      if ( ((*p < 'a') || (*p > 'z'))
-        && ((*p < 'A') || (*p > 'Z'))
-        && ((*p < '0') || (*p > '9'))
-        && (*p != '-')
-        && (*p != '.'))
-      {
-         /* Illegal character */
-         return JB_ERR_FILE;
-      }
-   }
-
-   /*
-    * Generate full path using either templdir
-    * or confdir/templates as base directory.
-    */
-   if (NULL != csp->config->templdir)
-   {
-      templates_dir_path = strdup(csp->config->templdir);
-   }
-   else
-   {
-      templates_dir_path = make_path(csp->config->confdir, "templates");
-   }
-
-   if (templates_dir_path == NULL)
-   {
-      log_error(LOG_LEVEL_ERROR, "Out of memory while generating template path for %s.",
-         templatename);
-      return JB_ERR_MEMORY;
-   }
-
-   full_path = make_path(templates_dir_path, templatename);
-   free(templates_dir_path);
-   if (full_path == NULL)
-   {
-      log_error(LOG_LEVEL_ERROR, "Out of memory while generating full template path for %s.",
-         templatename);
-      return JB_ERR_MEMORY;
-   }
-
-   /* Allocate buffer */
-
-   file_buffer = strdup("");
-   if (file_buffer == NULL)
-   {
-      log_error(LOG_LEVEL_ERROR, "Not enough free memory to buffer %s.", full_path);
-      free(full_path);
-      return JB_ERR_MEMORY;
-   }
-
-   /* Open template file */
-
-   if (NULL == (fp = fopen(full_path, "r")))
-   {
-      log_error(LOG_LEVEL_ERROR, "Cannot open template file %s: %E", full_path);
-      free(full_path);
-      free(file_buffer);
-      return JB_ERR_FILE;
-   }
-   free(full_path);
-
-   /* 
-    * Read the file, ignoring comments, and honoring #include
-    * statements, unless we're already called recursively.
-    *
-    * XXX: The comment handling could break with lines lengths > sizeof(buf).
-    *      This is unlikely in practise.
-    */
-   while (fgets(buf, sizeof(buf), fp))
-   {
-      if (!recursive && !strncmp(buf, "#include ", 9))
-      {
-         if (JB_ERR_OK != (err = template_load(csp, &included_module, chomp(buf + 9), 1)))
-         {
-            free(file_buffer);
-            fclose(fp);
-            return err;
-         }
-
-         if (string_join(&file_buffer, included_module))
-         {
-            fclose(fp);
-            return JB_ERR_MEMORY;
-         }
-
-         continue;
-      }
-
-      /* skip lines starting with '#' */
-      if (*buf == '#')
-      {
-         continue;
-      }
-
-      if (string_append(&file_buffer, buf))
-      {
-         fclose(fp);
-         return JB_ERR_MEMORY;
-      }
-   }
-   fclose(fp);
-
-   *template_ptr = file_buffer;
-
-   return JB_ERR_OK;
-}
-
-
-/*********************************************************************
- *
- * Function    :  template_fill
- *
- * Description :  CGI support function that fills in a pre-loaded
- *                HTML template by replacing @name@ with value using
- *                pcrs, for each item in the output map.
- *
- *                Note that a leading '$' charachter in the export map's
- *                values will be stripped and toggle on backreference
- *                interpretation.
- *
- * Parameters  :
- *          1  :  template_ptr = IN: Template to be filled out.
- *                                   Will be free()d.
- *                               OUT: Filled out template.
- *                                    Caller must free().
- *          2  :  exports = map with fill in symbol -> name pairs
- *
- * Returns     :  JB_ERR_OK on success (and for uncritical errors)
- *                JB_ERR_MEMORY on out-of-memory error
- *
- *********************************************************************/
-jb_err template_fill(char **template_ptr, const struct map *exports)
-{
-   struct map_entry *m;
-   pcrs_job *job;
-   char buf[BUFFER_SIZE];
-   char *tmp_out_buffer;
-   char *file_buffer;
-   size_t size;
-   int error;
-   const char *flags;
-
-   assert(template_ptr);
-   assert(*template_ptr);
-   assert(exports);
-
-   file_buffer = *template_ptr;
-   size = strlen(file_buffer) + 1;
-
-   /* 
-    * Assemble pcrs joblist from exports map
-    */
-   for (m = exports->first; m != NULL; m = m->next)
-   {
-      if (*m->name == '$')
-      {
-         /*
-          * First character of name is '$', so remove this flag
-          * character and allow backreferences ($1 etc) in the
-          * "replace with" text.
-          */
-         snprintf(buf, sizeof(buf), "%s", m->name + 1);
-         flags = "sigU";
-      }
-      else
-      {
-         /*
-          * Treat the "replace with" text as a literal string - 
-          * no quoting needed, no backreferences allowed.
-          * ("Trivial" ['T'] flag).
-          */
-         flags = "sigTU";
-
-         /* Enclose name in @@ */
-         snprintf(buf, sizeof(buf), "@%s@", m->name);
-      }
-
-      log_error(LOG_LEVEL_CGI, "Substituting: s/%s/%s/%s", buf, m->value, flags);
-
-      /* Make and run job. */
-      job = pcrs_compile(buf, m->value, flags,  &error);
-      if (job == NULL) 
-      {
-         if (error == PCRS_ERR_NOMEM)
-         {
-            free(file_buffer);
-            *template_ptr = NULL;
-            return JB_ERR_MEMORY;
-         }
-         else
-         {
-            log_error(LOG_LEVEL_ERROR, "Error compiling template fill job %s: %d", m->name, error);
-            /* Hope it wasn't important and silently ignore the invalid job */
-         }
-      }
-      else
-      {
-         error = pcrs_execute(job, file_buffer, size, &tmp_out_buffer, &size);
-
-         pcrs_free_job(job);
-         if (NULL == tmp_out_buffer)
-         {
-            *template_ptr = NULL;
-            return JB_ERR_MEMORY;
-         }
-
-         if (error < 0)
-         {
-            /* 
-             * Substitution failed, keep the original buffer,
-             * log the problem and ignore it.
-             * 
-             * The user might see some unresolved @CGI_VARIABLES@,
-             * but returning a special CGI error page seems unreasonable
-             * and could mask more important error messages.
-             */
-            free(tmp_out_buffer);
-            log_error(LOG_LEVEL_ERROR, "Failed to execute s/%s/%s/%s. %s",
-               buf, m->value, flags, pcrs_strerror(error));
-         }
-         else
-         {
-            /* Substitution succeeded, use modified buffer. */
-            free(file_buffer);
-            file_buffer = tmp_out_buffer;
-         }
-      }
-   }
-
-   /*
-    * Return
-    */
-   *template_ptr = file_buffer;
-   return JB_ERR_OK;
-}
-
-
-/*********************************************************************
- *
- * Function    :  template_fill_for_cgi
- *
- * Description :  CGI support function that loads a HTML template
- *                and fills it in.  Handles file-not-found errors
- *                by sending a HTML error message.  For convenience,
- *                this function also frees the passed "exports" map.
- *
- * Parameters  :
- *          1  :  csp = Client state
- *          2  :  templatename = name of the HTML template to be used
- *          3  :  exports = map with fill in symbol -> name pairs.
- *                          Will be freed by this function.
- *          4  :  rsp = Response structure to fill in.
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error
- *
- *********************************************************************/
-jb_err template_fill_for_cgi(const struct client_state *csp,
-                             const char *templatename,
-                             struct map *exports,
-                             struct http_response *rsp)
-{
-   jb_err err;
-   
-   assert(csp);
-   assert(templatename);
-   assert(exports);
-   assert(rsp);
-
-   err = template_load(csp, &rsp->body, templatename, 0);
-   if (err == JB_ERR_FILE)
-   {
-      free_map(exports);
-      return cgi_error_no_template(csp, rsp, templatename);
-   }
-   else if (err)
-   {
-      free_map(exports);
-      return err; /* JB_ERR_MEMORY */
-   }
-   err = template_fill(&rsp->body, exports);
-   free_map(exports);
-   return err;
-}
-
-
-/*********************************************************************
- *
- * Function    :  default_exports
- *
- * Description :  returns a struct map list that contains exports
- *                which are common to all CGI functions.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  caller = name of CGI who calls us and which should
- *                         be excluded from the generated menu. May be
- *                         NULL.
- * Returns     :  NULL if no memory, else a new map.  Caller frees.
- *
- *********************************************************************/
-struct map *default_exports(const struct client_state *csp, const char *caller)
-{
-   char buf[30];
-   jb_err err;
-   struct map * exports;
-   int local_help_exists = 0;
-   char *ip_address = NULL;
-   char *hostname = NULL;
-
-   assert(csp);
-
-   exports = new_map();
-   if (exports == NULL)
-   {
-      return NULL;
-   }
-
-   if (csp->config->hostname)
-   {
-      get_host_information(csp->cfd, &ip_address, NULL);
-      hostname = strdup(csp->config->hostname);
-   }
-   else
-   {
-      get_host_information(csp->cfd, &ip_address, &hostname);
-   }
-
-   err = map(exports, "version", 1, html_encode(VERSION), 0);
-   get_locale_time(buf, sizeof(buf));
-   if (!err) err = map(exports, "time",          1, html_encode(buf), 0);
-   if (!err) err = map(exports, "my-ip-address", 1, html_encode(ip_address ? ip_address : "unknown"), 0);
-   freez(ip_address);
-   if (!err) err = map(exports, "my-hostname",   1, html_encode(hostname ? hostname : "unknown"), 0);
-   freez(hostname);
-   if (!err) err = map(exports, "homepage",      1, html_encode(HOME_PAGE_URL), 0);
-   if (!err) err = map(exports, "default-cgi",   1, html_encode(CGI_PREFIX), 0);
-   if (!err) err = map(exports, "menu",          1, make_menu(caller, csp->config->feature_flags), 0);
-   if (!err) err = map(exports, "code-status",   1, CODE_STATUS, 1);
-   if (!strncmpic(csp->config->usermanual, "file://", 7) ||
-       !strncmpic(csp->config->usermanual, "http", 4))
-   {
-      /* Manual is located somewhere else, just link to it. */
-      if (!err) err = map(exports, "user-manual", 1, html_encode(csp->config->usermanual), 0);
-   }
-   else
-   {
-      /* Manual is delivered by Privoxy. */
-      if (!err) err = map(exports, "user-manual", 1, html_encode(CGI_PREFIX"user-manual/"), 0);
-   }
-   if (!err) err = map(exports, "actions-help-prefix", 1, ACTIONS_HELP_PREFIX ,1);
-#ifdef FEATURE_TOGGLE
-   if (!err) err = map_conditional(exports, "enabled-display", global_toggle_state);
-#else
-   if (!err) err = map_block_killer(exports, "can-toggle");
-#endif
-
-   snprintf(buf, sizeof(buf), "%d", csp->config->hport);
-   if (!err) err = map(exports, "my-port", 1, buf, 1);
-
-   if(!strcmp(CODE_STATUS, "stable"))
-   {
-      if (!err) err = map_block_killer(exports, "unstable");
-   }
-
-   if (csp->config->admin_address != NULL)
-   {
-      if (!err) err = map(exports, "admin-address", 1, html_encode(csp->config->admin_address), 0);
-      local_help_exists = 1;
-   }
-   else
-   {
-      if (!err) err = map_block_killer(exports, "have-adminaddr-info");
-   }
-
-   if (csp->config->proxy_info_url != NULL)
-   {
-      if (!err) err = map(exports, "proxy-info-url", 1, html_encode(csp->config->proxy_info_url), 0);
-      local_help_exists = 1;
-   }
-   else
-   {
-      if (!err) err = map_block_killer(exports, "have-proxy-info");
-   }
-
-   if (local_help_exists == 0)
-   {
-      if (!err) err = map_block_killer(exports, "have-help-info");
-   }
-
-   if (err)
-   {
-      free_map(exports);
-      return NULL;
-   }
-
-   return exports;
-}
-
-
-/*********************************************************************
- *
- * Function    :  map_block_killer
- *
- * Description :  Convenience function.
- *                Adds a "killer" for the conditional HTML-template
- *                block <name>, i.e. a substitution of the regex
- *                "if-<name>-start.*if-<name>-end" to the given
- *                export list.
- *
- * Parameters  :  
- *          1  :  exports = map to extend
- *          2  :  name = name of conditional block
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err map_block_killer(struct map *exports, const char *name)
-{
-   char buf[1000]; /* Will do, since the names are hardwired */
-
-   assert(exports);
-   assert(name);
-   assert(strlen(name) < (size_t)490);
-
-   snprintf(buf, sizeof(buf), "if-%s-start.*if-%s-end", name, name);
-   return map(exports, buf, 1, "", 1);
-}
-
-
-/*********************************************************************
- *
- * Function    :  map_block_keep
- *
- * Description :  Convenience function.  Removes the markers used
- *                by map-block-killer, to save a few bytes.
- *                i.e. removes "@if-<name>-start@" and "@if-<name>-end@"
- *
- * Parameters  :  
- *          1  :  exports = map to extend
- *          2  :  name = name of conditional block
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err map_block_keep(struct map *exports, const char *name)
-{
-   jb_err err;
-   char buf[500]; /* Will do, since the names are hardwired */
-
-   assert(exports);
-   assert(name);
-   assert(strlen(name) < (size_t)490);
-
-   snprintf(buf, sizeof(buf), "if-%s-start", name);
-   err = map(exports, buf, 1, "", 1);
-
-   if (err)
-   {
-      return err;
-   }
-
-   snprintf(buf, sizeof(buf), "if-%s-end", name);
-   return map(exports, buf, 1, "", 1);
-}
-
-
-/*********************************************************************
- *
- * Function    :  map_conditional
- *
- * Description :  Convenience function.
- *                Adds an "if-then-else" for the conditional HTML-template
- *                block <name>, i.e. a substitution of the form:
- *                @if-<name>-then@
- *                   True text
- *                @else-not-<name>@
- *                   False text
- *                @endif-<name>@
- *
- *                The control structure and one of the alternatives
- *                will be hidden.
- *
- * Parameters  :  
- *          1  :  exports = map to extend
- *          2  :  name = name of conditional block
- *          3  :  choose_first = nonzero for first, zero for second.
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err map_conditional(struct map *exports, const char *name, int choose_first)
-{
-   char buf[1000]; /* Will do, since the names are hardwired */
-   jb_err err;
-
-   assert(exports);
-   assert(name);
-   assert(strlen(name) < (size_t)480);
-
-   snprintf(buf, sizeof(buf), (choose_first
-      ? "else-not-%s at .*@endif-%s"
-      : "if-%s-then at .*@else-not-%s"),
-      name, name);
-
-   err = map(exports, buf, 1, "", 1);
-   if (err)
-   {
-      return err;
-   }
-
-   snprintf(buf, sizeof(buf), (choose_first ? "if-%s-then" : "endif-%s"), name);
-   return map(exports, buf, 1, "", 1);
-}
-
-
-/*********************************************************************
- *
- * Function    :  make_menu
- *
- * Description :  Returns an HTML-formatted menu of the available 
- *                unhidden CGIs, excluding the one given in <self>
- *                and the toggle CGI if toggling is disabled.
- *
- * Parameters  :
- *          1  :  self = name of CGI to leave out, can be NULL for
- *                complete listing.
- *          2  :  feature_flags = feature bitmap from csp->config
- *                
- *
- * Returns     :  menu string, or NULL on out-of-memory error.
- *
- *********************************************************************/
-char *make_menu(const char *self, const unsigned feature_flags)
-{
-   const struct cgi_dispatcher *d;
-   char *result = strdup("");
-
-   if (self == NULL)
-   {
-      self = "NO-SUCH-CGI!";
-   }
-
-   /* List available unhidden CGI's and export as "other-cgis" */
-   for (d = cgi_dispatchers; d->name; d++)
-   {
-
-#ifdef FEATURE_TOGGLE
-      if (!(feature_flags & RUNTIME_FEATURE_CGI_TOGGLE) && !strcmp(d->name, "toggle"))
-      {
-         /*
-          * Suppress the toggle link if remote toggling is disabled.
-          */
-         continue;
-      }
-#endif /* def FEATURE_TOGGLE */
-
-      if (d->description && strcmp(d->name, self))
-      {
-         char *html_encoded_prefix;
-
-         /*
-          * Line breaks would be great, but break
-          * the "blocked" template's JavaScript.
-          */
-         string_append(&result, "<li><a href=\"");
-         html_encoded_prefix = html_encode(CGI_PREFIX);
-         if (html_encoded_prefix == NULL)
-         {
-            return NULL;  
-         }
-         else
-         {
-            string_append(&result, html_encoded_prefix);
-            free(html_encoded_prefix);
-         }
-         string_append(&result, d->name);
-         string_append(&result, "\">");
-         string_append(&result, d->description);
-         string_append(&result, "</a></li>");
-      }
-   }
-
-   return result;
-}
-
-
-/*********************************************************************
- *
- * Function    :  dump_map
- *
- * Description :  HTML-dump a map for debugging (as table)
- *
- * Parameters  :
- *          1  :  the_map = map to dump
- *
- * Returns     :  string with HTML
- *
- *********************************************************************/
-char *dump_map(const struct map *the_map)
-{
-   struct map_entry *cur_entry;
-   char *ret = strdup("");
-
-   string_append(&ret, "<table>\n");
-
-   for (cur_entry = the_map->first;
-        (cur_entry != NULL) && (ret != NULL);
-        cur_entry = cur_entry->next)
-   {
-      string_append(&ret, "<tr><td><b>");
-      string_join  (&ret, html_encode(cur_entry->name));
-      string_append(&ret, "</b></td><td>");
-      string_join  (&ret, html_encode(cur_entry->value));
-      string_append(&ret, "</td></tr>\n");
-   }
-
-   string_append(&ret, "</table>\n");
-   return ret;
-}
-
-
-/*
-  Local Variables:
-  tab-width: 3
-  end:
-*/
diff --git a/external/privoxy/cgi.h b/external/privoxy/cgi.h
deleted file mode 100644
index 6228b32..0000000
--- a/external/privoxy/cgi.h
+++ /dev/null
@@ -1,289 +0,0 @@
-#ifndef CGI_H_INCLUDED
-#define CGI_H_INCLUDED
-#define CGI_H_VERSION "$Id: cgi.h,v 1.35 2008/05/21 15:24:37 fabiankeil Exp $"
-/*********************************************************************
- *
- * File        :  $Source: /cvsroot/ijbswa/current/cgi.h,v $
- *
- * Purpose     :  Declares functions to intercept request, generate
- *                html or gif answers, and to compose HTTP resonses.
- *                
- *                Functions declared include:
- * 
- *
- * Copyright   :  Written by and Copyright (C) 2001-2007 the SourceForge
- *                Privoxy team. http://www.privoxy.org/
- *
- *                Based on the Internet Junkbuster originally written
- *                by and Copyright (C) 1997 Anonymous Coders and 
- *                Junkbusters Corporation.  http://www.junkbusters.com
- *
- *                This program is free software; you can redistribute it 
- *                and/or modify it under the terms of the GNU General
- *                Public License as published by the Free Software
- *                Foundation; either version 2 of the License, or (at
- *                your option) any later version.
- *
- *                This program is distributed in the hope that it will
- *                be useful, but WITHOUT ANY WARRANTY; without even the
- *                implied warranty of MERCHANTABILITY or FITNESS FOR A
- *                PARTICULAR PURPOSE.  See the GNU General Public
- *                License for more details.
- *
- *                The GNU General Public License should be included with
- *                this file.  If not, you can view it at
- *                http://www.gnu.org/copyleft/gpl.html
- *                or write to the Free Software Foundation, Inc., 59
- *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * Revisions   :
- *    $Log: cgi.h,v $
- *    Revision 1.35  2008/05/21 15:24:37  fabiankeil
- *    Mark csp as immutable for a bunch of functions.
- *
- *    Revision 1.34  2008/04/17 14:40:48  fabiankeil
- *    Provide get_http_time() with the buffer size so it doesn't
- *    have to blindly assume that the buffer is big enough.
- *
- *    Revision 1.33  2007/01/28 13:41:17  fabiankeil
- *    - Add HEAD support to finish_http_response.
- *    - Add error favicon to internal HTML error messages.
- *
- *    Revision 1.32  2006/12/17 17:53:39  fabiankeil
- *    Suppress the toggle link if remote toggling is disabled.
- *
- *    Revision 1.31  2006/07/18 14:48:45  david__schmidt
- *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
- *    with what was really the latest development (the v_3_0_branch branch)
- *
- *    Revision 1.29.2.2  2004/02/17 13:30:23  oes
- *    Moved cgi_error_disabled() from cgiedit.c to
- *    cgi.c to re-enable build with --disable-editor.
- *    Fixes Bug #892744. Thanks to Matthew Fischer
- *    for spotting.
- *
- *    Revision 1.29.2.1  2003/12/17 16:33:28  oes
- *    Added prototype of new function cgi_redirect
- *
- *    Revision 1.29  2002/05/19 11:33:21  jongfoster
- *    If a CGI error was not handled, and propogated back to
- *    dispatch_known_cgi(), then it was assumed to be "out of memory".
- *    This gave a very misleading error message.
- *
- *    Now other errors will cause a simple message giving the error
- *    number and asking the user to report a bug.
- *
- *    Bug report:
- *    http://sourceforge.net/tracker/index.php?func=detail
- *    &aid=557905&group_id=11118&atid=111118
- *
- *    Revision 1.28  2002/04/26 12:54:03  oes
- *    New function add_help_link
- *
- *    Revision 1.27  2002/04/24 02:16:51  oes
- *    Moved get_char_param, get_string_param and get_number_param here from cgiedit.c
- *
- *    Revision 1.26  2002/04/10 13:38:35  oes
- *    load_template signature changed
- *
- *    Revision 1.25  2002/04/08 20:50:25  swa
- *    fixed JB spelling
- *
- *    Revision 1.24  2002/03/26 22:29:54  swa
- *    we have a new homepage!
- *
- *    Revision 1.23  2002/03/24 16:18:15  jongfoster
- *    Removing old logo
- *
- *    Revision 1.22  2002/03/24 13:25:43  swa
- *    name change related issues
- *
- *    Revision 1.21  2002/03/07 03:48:38  oes
- *     - Changed built-in images from GIF to PNG
- *       (with regard to Unisys patent issue)
- *     - Added a 4x4 pattern PNG which is less intrusive
- *       than the logo but also clearly marks the deleted banners
- *
- *    Revision 1.20  2002/03/04 17:53:22  oes
- *    Fixed compiled warning
- *
- *    Revision 1.19  2002/01/21 00:33:52  jongfoster
- *    Adding map_block_keep() to save a few bytes in the edit-actions-list HTML.
- *
- *    Revision 1.18  2001/11/16 00:46:31  jongfoster
- *    Fixing compiler warnings
- *
- *    Revision 1.17  2001/10/23 21:48:19  jongfoster
- *    Cleaning up error handling in CGI functions - they now send back
- *    a HTML error page and should never cause a FATAL error.  (Fixes one
- *    potential source of "denial of service" attacks).
- *
- *    CGI actions file editor that works and is actually useful.
- *
- *    Ability to toggle Junkbuster remotely using a CGI call.
- *
- *    You can turn off both the above features in the main configuration
- *    file, e.g. if you are running a multi-user proxy.
- *
- *    Revision 1.16  2001/09/16 17:08:54  jongfoster
- *    Moving simple CGI functions from cgi.c to new file cgisimple.c
- *
- *    Revision 1.15  2001/09/16 15:02:35  jongfoster
- *    Adding i.j.b/robots.txt.
- *    Inlining add_stats() since it's only ever called from one place.
- *
- *    Revision 1.14  2001/09/16 11:38:02  jongfoster
- *    Splitting fill_template() into 2 functions:
- *    template_load() loads the file
- *    template_fill() performs the PCRS regexps.
- *    This is because the CGI edit interface has a "table row"
- *    template which is used many times in the page - this
- *    change means it's only loaded from disk once.
- *
- *    Revision 1.13  2001/09/16 11:00:10  jongfoster
- *    New function alloc_http_response, for symmetry with free_http_response
- *
- *    Revision 1.12  2001/09/13 23:31:25  jongfoster
- *    Moving image data to cgi.c rather than cgi.h.
- *
- *    Revision 1.11  2001/08/05 16:06:20  jongfoster
- *    Modifiying "struct map" so that there are now separate header and
- *    "map_entry" structures.  This means that functions which modify a
- *    map no longer need to return a pointer to the modified map.
- *    Also, it no longer reverses the order of the entries (which may be
- *    important with some advanced template substitutions).
- *
- *    Revision 1.10  2001/08/01 21:19:22  jongfoster
- *    Moving file version information to a separate CGI page.
- *
- *    Revision 1.9  2001/08/01 00:17:54  jongfoster
- *    Adding prototype for map_conditional
- *
- *    Revision 1.8  2001/07/30 22:08:36  jongfoster
- *    Tidying up #defines:
- *    - All feature #defines are now of the form FEATURE_xxx
- *    - Permanently turned off WIN_GUI_EDIT
- *    - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS
- *
- *    Revision 1.7  2001/07/29 18:43:08  jongfoster
- *    Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to
- *    ANSI C rules.
- *
- *    Revision 1.6  2001/06/29 21:45:41  oes
- *    Indentation, CRLF->LF, Tab-> Space
- *
- *    Revision 1.5  2001/06/29 13:22:44  oes
- *    - Cleaned up
- *    - Added new functions: default_exports(), make_menu(),
- *      error_response() etc, ranamed others and changed
- *      param and return types.
- *    - Removed HTTP/HTML snipplets
- *    - Removed logentry from cancelled commit
- *
- *    Revision 1.4  2001/06/09 10:50:58  jongfoster
- *    Changing "show URL info" handler to new style.
- *    Adding "extern" to some function prototypes.
- *
- *    Revision 1.3  2001/06/03 19:12:16  oes
- *    introduced new cgi handling
- *
- *    No revisions before 1.3
- *
- **********************************************************************/
-
-
-#include "project.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Main dispatch function
- */
-extern struct http_response *dispatch_cgi(struct client_state *csp);
-
-/* Not exactly a CGI */
-extern struct http_response * error_response(struct client_state *csp,
-                                             const char *templatename,
-                                             int err);
-
-/*
- * CGI support functions
- */
-extern struct http_response * alloc_http_response(void);
-extern void free_http_response(struct http_response *rsp);
-
-extern struct http_response *finish_http_response(const struct client_state *csp,
-                                                  struct http_response *rsp);
-
-extern struct map * default_exports(const struct client_state *csp, const char *caller);
-
-extern jb_err map_block_killer (struct map *exports, const char *name);
-extern jb_err map_block_keep   (struct map *exports, const char *name);
-extern jb_err map_conditional  (struct map *exports, const char *name, int choose_first);
-
-extern jb_err template_load(const struct client_state *csp, char ** template_ptr, 
-                            const char *templatename, int recursive);
-extern jb_err template_fill(char ** template_ptr, const struct map *exports);
-extern jb_err template_fill_for_cgi(const struct client_state *csp,
-                                    const char *templatename,
-                                    struct map *exports,
-                                    struct http_response *rsp);
-
-extern void cgi_init_error_messages(void);
-extern struct http_response *cgi_error_memory(void);
-extern jb_err cgi_redirect (struct http_response * rsp, const char *target);
-
-extern jb_err cgi_error_no_template(const struct client_state *csp,
-                                    struct http_response *rsp,
-                                    const char *template_name);
-extern jb_err cgi_error_bad_param(const struct client_state *csp,
-                                  struct http_response *rsp);
-extern jb_err cgi_error_disabled(const struct client_state *csp,
-                                 struct http_response *rsp);
-extern jb_err cgi_error_unknown(const struct client_state *csp,
-                         struct http_response *rsp,
-                         jb_err error_to_report);
-
-extern jb_err get_number_param(struct client_state *csp,
-                               const struct map *parameters,
-                               char *name,
-                               unsigned *pvalue);
-extern jb_err get_string_param(const struct map *parameters,
-                               const char *param_name,
-                               const char **pparam);
-extern char   get_char_param(const struct map *parameters,
-                             const char *param_name);
-
-/*
- * Text generators
- */
-extern void get_http_time(int time_offset, char *buf, size_t buffer_size);
-extern char *add_help_link(const char *item, struct configuration_spec *config);
-extern char *make_menu(const char *self, const unsigned feature_flags);
-extern char *dump_map(const struct map *the_map);
-
-/*
- * Ad replacement images
- */
-extern const char image_pattern_data[];
-extern const size_t  image_pattern_length;
-extern const char image_blank_data[];
-extern const size_t  image_blank_length;
-
-/* Revision control strings from this header and associated .c file */
-extern const char cgi_rcs[];
-extern const char cgi_h_rcs[];
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* ndef CGI_H_INCLUDED */
-
-/*
-  Local Variables:
-  tab-width: 3
-  end:
-*/
diff --git a/external/privoxy/cgiedit.c b/external/privoxy/cgiedit.c
deleted file mode 100644
index 6fca21f..0000000
--- a/external/privoxy/cgiedit.c
+++ /dev/null
@@ -1,4924 +0,0 @@
-const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.65 2009/03/08 14:19:22 fabiankeil Exp $";
-/*********************************************************************
- *
- * File        :  $Source: /cvsroot/ijbswa/current/cgiedit.c,v $
- *
- * Purpose     :  CGI-based actionsfile editor.
- *
- *                Functions declared include: cgi_edit_*
- *
- *                NOTE: The CGIs in this file use parameter names
- *                such as "f" and "s" which are really *BAD* choices.
- *                However, I'm trying to save bytes in the
- *                edit-actions-list HTML page - the standard actions
- *                file generated a 550kbyte page, which is ridiculous.
- *
- *                Stick to the short names in this file for consistency.
- *
- * Copyright   :  Written by and Copyright (C) 2001-2008 the SourceForge
- *                Privoxy team. http://www.privoxy.org/
- *
- *                Based on the Internet Junkbuster originally written
- *                by and Copyright (C) 1997 Anonymous Coders and
- *                Junkbusters Corporation.  http://www.junkbusters.com
- *
- *                This program is free software; you can redistribute it
- *                and/or modify it under the terms of the GNU General
- *                Public License as published by the Free Software
- *                Foundation; either version 2 of the License, or (at
- *                your option) any later version.
- *
- *                This program is distributed in the hope that it will
- *                be useful, but WITHOUT ANY WARRANTY; without even the
- *                implied warranty of MERCHANTABILITY or FITNESS FOR A
- *                PARTICULAR PURPOSE.  See the GNU General Public
- *                License for more details.
- *
- *                The GNU General Public License should be included with
- *                this file.  If not, you can view it at
- *                http://www.gnu.org/copyleft/gpl.html
- *                or write to the Free Software Foundation, Inc., 59
- *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * Revisions   :
- *    $Log: cgiedit.c,v $
- *    Revision 1.65  2009/03/08 14:19:22  fabiankeil
- *    Fix justified (but harmless) compiler warnings
- *    on platforms where sizeof(int) < sizeof(long).
- *
- *    Revision 1.64  2009/03/01 18:43:09  fabiankeil
- *    Fix cparser warnings.
- *
- *    Revision 1.63  2008/12/04 18:15:38  fabiankeil
- *    Fix some cparser warnings.
- *
- *    Revision 1.62  2008/08/31 15:59:02  fabiankeil
- *    There's no reason to let remote toggling support depend
- *    on FEATURE_CGI_EDIT_ACTIONS, so make sure it doesn't.
- *
- *    Revision 1.61  2008/03/24 18:12:52  fabiankeil
- *    Use sizeof() more often.
- *
- *    Revision 1.60  2008/03/15 14:52:35  fabiankeil
- *    Add CGI editor support for the "disable all filters of this type"
- *    directives "-client-header-filter", "-server-header-filter",
- *    "-client-header-tagger" and "-server-header-tagger".
- *
- *    Revision 1.59  2008/03/08 16:25:56  fabiankeil
- *    After three file modification time mismatches, turn the CGI editor off.
- *
- *    Revision 1.58  2007/11/28 17:57:01  fabiankeil
- *    Fix double free in cgi_edit_actions_list().
- *    Reported by adlab in BR#1840145.
- *
- *    Revision 1.57  2007/10/27 13:32:23  fabiankeil
- *    Plug minor 5-year-old memory leak. Spotted by
- *    Valgrind and triggered by Privoxy-Regression-Test.
- *
- *    Revision 1.56  2007/08/05 13:47:03  fabiankeil
- *    #1763173 from Stefan Huehner: s at const static at static const at .
- *
- *    Revision 1.55  2007/05/31 11:50:20  fabiankeil
- *    Re-enable support for old-school URLs like
- *    http://config.privoxy.org/edit-actions-list?f=default
- *    in the action editor.
- *
- *    They are no longer used by the CGI pages, but make it easier
- *    to reach the editor directly, without knowing the requested
- *    file's index in csp->config->actions_file[].
- *
- *    Revision 1.54  2007/05/14 10:33:51  fabiankeil
- *    - Use strlcpy() and strlcat() instead of strcpy() and strcat().
- *
- *    Revision 1.53  2007/04/15 16:39:20  fabiankeil
- *    Introduce tags as alternative way to specify which
- *    actions apply to a request. At the moment tags can be
- *    created based on client and server headers.
- *
- *    Revision 1.52  2007/04/12 10:41:23  fabiankeil
- *    - Don't mistake VC++'s _snprintf() for a snprintf() replacement.
- *    - Move some cgi_edit_actions_for_url() variables into structs.
- *    - Remove bogus comment.
- *
- *    Revision 1.51  2007/04/08 13:21:05  fabiankeil
- *    Reference action files in CGI URLs by id instead
- *    of using the first part of the file name.
- *    Fixes BR 1694250 and BR 1590556.
- *
- *    Revision 1.50  2007/03/29 11:40:34  fabiankeil
- *    Divide @filter-params@ into @client-header-filter-params@
- *    @content-filter-params@ and @server-header-filter-params at .
- *
- *    Revision 1.49  2007/03/20 15:16:34  fabiankeil
- *    Use dedicated header filter actions instead of abusing "filter".
- *    Replace "filter-client-headers" and "filter-client-headers"
- *    with "server-header-filter" and "client-header-filter".
- *
- *    Revision 1.48  2007/02/13 14:35:25  fabiankeil
- *    Replace hash escaping code to prevent
- *    crashes, memory and file corruption.
- *
- *    Revision 1.47  2006/12/28 18:04:25  fabiankeil
- *    Fixed gcc43 conversion warnings.
- *
- *    Revision 1.46  2006/12/27 18:44:52  fabiankeil
- *    Stop shadowing string.h's index().
- *
- *    Revision 1.45  2006/12/21 12:57:48  fabiankeil
- *    Add config option "split-large-forms"
- *    to work around the browser bug reported
- *    in BR #1570678.
- *
- *    Revision 1.44  2006/12/09 13:49:16  fabiankeil
- *    Fix configure option --disable-toggle.
- *    Thanks to Peter Thoenen for reporting this.
- *
- *    Revision 1.43  2006/07/18 14:48:45  david__schmidt
- *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
- *    with what was really the latest development (the v_3_0_branch branch)
- *
- *    Revision 1.41.2.12  2006/01/30 15:16:25  david__schmidt
- *    Remove a little residual debugging info
- *
- *    Revision 1.41.2.11  2006/01/29 23:10:56  david__schmidt
- *    Multiple filter file support
- *
- *    Revision 1.41.2.10  2005/07/04 03:13:43  david__schmidt
- *    Undo some damaging memory leak patches
- *
- *    Revision 1.41.2.9  2005/07/04 00:31:04  david__schmidt
- *    Removing a double free
- *
- *    Revision 1.41.2.8  2005/05/07 21:50:54  david__schmidt
- *    A few memory leaks plugged (mostly on error paths)
- *
- *    Revision 1.41.2.7  2004/02/17 13:30:23  oes
- *    Moved cgi_error_disabled() from cgiedit.c to
- *    cgi.c to re-enable build with --disable-editor.
- *    Fixes Bug #892744. Thanks to Matthew Fischer
- *    for spotting.
- *
- *    Revision 1.41.2.6  2003/12/18 08:13:48  oes
- *    One line lost in last commit
- *
- *    Revision 1.41.2.5  2003/12/17 16:33:47  oes
- *     - All edit functions that redirect back to the list page
- *       now use cgi_redirect
- *     - All redirects now contain useless parameter "foo", whose
- *       value are raw seconds since epoch, in order to force
- *       Opera and Konqueror to properly reload the list. Closes
- *       bug #859993
- *
- *    Revision 1.41.2.4  2003/03/11 11:53:59  oes
- *    Cosmetic: Renamed cryptic variable
- *
- *    Revision 1.41.2.3  2002/11/12 15:01:41  oes
- *    Fix: Don't free uninitialized struct editable_file
- *
- *    Revision 1.41.2.2  2002/08/05 20:02:59  oes
- *    Bugfix: "Insert new section at top" did not work properly if first non-comment line in file was of type FILE_LINE_ACTION
- *
- *    Revision 1.41.2.1  2002/08/02 12:43:14  oes
- *    Fixed bug #588514: first_time now set on a per-string basis in actions_from_radio; javascriptify now called on copies
- *
- *    Revision 1.41  2002/05/21 19:09:45  oes
- *     - Made Add/Edit/Remove URL Submit and Cancel
- *       buttons jump back to relevant section in eal
- *     - Bugfix: remove-url-form needs p export
- *
- *    Revision 1.40  2002/05/19 11:34:35  jongfoster
- *    Handling read-only actions files better - report the actual
- *    error, not "Out of memory"!
- *
- *    Bug report:
- *    http://sourceforge.net/tracker/index.php?func=detail
- *    &aid=557905&group_id=11118&atid=111118
- *
- *    Revision 1.39  2002/05/12 21:39:15  jongfoster
- *    - Adding Doxygen-style comments to structures and #defines.
- *    - Correcting function comments
- *
- *    Revision 1.38  2002/05/03 23:00:38  jongfoster
- *    Support for templates for "standard actions" buttons.
- *    See bug #549871
- *
- *    Revision 1.37  2002/04/30 11:14:52  oes
- *    Made csp the first parameter in *action_to_html
- *
- *    Revision 1.36  2002/04/26 21:53:30  jongfoster
- *    Fixing a memory leak.  (Near, but not caused by, my earlier commit).
- *
- *    Revision 1.35  2002/04/26 21:50:02  jongfoster
- *    Honouring default exports in edit-actions-for-url-filter template.
- *
- *    Revision 1.34  2002/04/26 12:54:17  oes
- *    Adaptions to changes in actions.c
- *
- *    Revision 1.33  2002/04/24 02:17:47  oes
- *     - Moved get_char_param, get_string_param and get_number_param to cgi.c
- *     - Comments
- *     - Activated Jon's code for editing multiple AFs
- *     - cgi_edit_list_actions now provides context-sensitive
- *       help, looks up all action sets from standard.action and
- *       makes buttons for them in the catchall section
- *     - cgi_edit_action_submit now honors a p parameter, looks up
- *       the corresponding action set, and sets the catchall pattern's
- *       actions accordingly.
- *
- *    Revision 1.32  2002/04/19 16:55:31  jongfoster
- *    Fixing newline problems.  If we do our own text file newline
- *    mangling, we don't want the library to do any, so we need to
- *    open the files in *binary* mode.
- *
- *    Revision 1.31  2002/04/18 19:21:08  jongfoster
- *    Added code to detect "conventional" action files, that start
- *    with a set of actions for all URLs (the pattern "/").
- *    These are special-cased in the "edit-actions-list" CGI, so
- *    that a special UI can be written for them.
- *
- *    Revision 1.30  2002/04/10 13:38:35  oes
- *    load_template signature changed
- *
- *    Revision 1.29  2002/04/08 16:59:08  oes
- *    Fixed comment
- *
- *    Revision 1.28  2002/03/27 12:30:29  oes
- *    Deleted unsused variable
- *
- *    Revision 1.27  2002/03/26 23:06:04  jongfoster
- *    Removing duplicate @ifs on the toggle page
- *
- *    Revision 1.26  2002/03/26 22:59:17  jongfoster
- *    Fixing /toggle to display status consistently.
- *
- *    Revision 1.25  2002/03/26 22:29:54  swa
- *    we have a new homepage!
- *
- *    Revision 1.24  2002/03/24 15:23:33  jongfoster
- *    Name changes
- *
- *    Revision 1.23  2002/03/24 13:32:41  swa
- *    name change related issues
- *
- *    Revision 1.22  2002/03/24 13:25:43  swa
- *    name change related issues
- *
- *    Revision 1.21  2002/03/22 18:02:48  jongfoster
- *    Fixing remote toggle
- *
- *    Revision 1.20  2002/03/16 20:28:34  oes
- *    Added descriptions to the filters so users will know what they select in the cgi editor
- *
- *    Revision 1.19  2002/03/16 18:38:14  jongfoster
- *    Stopping stupid or malicious users from breaking the actions
- *    file using the web-based editor.
- *
- *    Revision 1.18  2002/03/16 14:57:44  jongfoster
- *    Full support for enabling/disabling modular filters.
- *
- *    Revision 1.17  2002/03/16 14:26:42  jongfoster
- *    First version of modular filters support - READ ONLY!
- *    Fixing a double-free bug in the out-of-memory handling in map_radio().
- *
- *    Revision 1.16  2002/03/07 03:46:17  oes
- *    Fixed compiler warnings
- *
- *    Revision 1.15  2002/03/06 22:54:35  jongfoster
- *    Automated function-comment nitpicking.
- *
- *    Revision 1.14  2002/03/05 00:24:51  jongfoster
- *    Patch to always edit the current actions file.
- *
- *    Revision 1.13  2002/03/04 02:07:59  david__schmidt
- *    Enable web editing of actions file on OS/2 (it had been broken all this time!)
- *
- *    Revision 1.12  2002/03/03 09:18:03  joergs
- *    Made jumbjuster work on AmigaOS again.
- *
- *    Revision 1.11  2002/01/23 01:03:31  jongfoster
- *    Fixing gcc [CygWin] compiler warnings
- *
- *    Revision 1.10  2002/01/23 00:22:59  jongfoster
- *    Adding new function cgi_edit_actions_section_swap(), to reorder
- *    the actions file.
- *
- *    Adding get_url_spec_param() to get a validated URL pattern.
- *
- *    Moving edit_read_line() out of this file and into loaders.c.
- *
- *    Adding missing html_encode() to many CGI functions.
- *
- *    Moving the functions that #include actionlist.h to the end of the file,
- *    because the Visual C++ 97 debugger gets extremely confused if you try
- *    to debug any code that comes after them in the file.
- *
- *    Major optimizations in cgi_edit_actions_list() to reduce the size of
- *    the generated HTML (down 40% from 550k to 304k), with major side-effects
- *    throughout the editor and templates.  In particular, the length of the
- *    URLs throughout the editor has been drastically reduced, by cutting
- *    paramater names down to 1 character and CGI names down to 3-4
- *    characters, by removing all non-essential CGI paramaters even at the
- *    expense of having to re-read the actions file for the most trivial
- *    page, and by using relative rather than absolute URLs.  This means
- *    that this (typical example):
- *
- *    <a href="http://ijbswa.sourceforge.net/config/edit-actions-url-form?
- *    filename=ijb&ver=1011487572&section=12&pattern=13
- *    &oldval=www.oesterhelt.org%2Fdeanimate-demo">
- *
- *    is now this:
- *
- *    <a href="eau?f=ijb&v=1011487572&p=13">
- *
- *    Revision 1.9  2002/01/17 20:56:22  jongfoster
- *    Replacing hard references to the URL of the config interface
- *    with #defines from project.h
- *
- *    Revision 1.8  2001/11/30 23:35:51  jongfoster
- *    Renaming actionsfile to ijb.action
- *
- *    Revision 1.7  2001/11/13 00:28:24  jongfoster
- *    - Renaming parameters from edit-actions-for-url so that they only
- *      contain legal JavaScript characters.  If we wanted to write
- *      JavaScript that worked with Netscape 4, this is nessacery.
- *      (Note that at the moment the JavaScript doesn't actually work
- *      with Netscape 4, but now this is purely a template issue, not
- *      one affecting code).
- *    - Adding new CGIs for use by non-JavaScript browsers:
- *        edit-actions-url-form
- *        edit-actions-add-url-form
- *        edit-actions-remove-url-form
- *    - Fixing || bug.
- *
- *    Revision 1.6  2001/10/29 03:48:09  david__schmidt
- *    OS/2 native needed a snprintf() routine.  Added one to miscutil, brackedted
- *    by and __OS2__ ifdef.
- *
- *    Revision 1.5  2001/10/25 03:40:48  david__schmidt
- *    Change in porting tactics: OS/2's EMX porting layer doesn't allow multiple
- *    threads to call select() simultaneously.  So, it's time to do a real, live,
- *    native OS/2 port.  See defines for __EMX__ (the porting layer) vs. __OS2__
- *    (native). Both versions will work, but using __OS2__ offers multi-threading.
- *
- *    Revision 1.4  2001/10/23 21:48:19  jongfoster
- *    Cleaning up error handling in CGI functions - they now send back
- *    a HTML error page and should never cause a FATAL error.  (Fixes one
- *    potential source of "denial of service" attacks).
- *
- *    CGI actions file editor that works and is actually useful.
- *
- *    Ability to toggle JunkBuster remotely using a CGI call.
- *
- *    You can turn off both the above features in the main configuration
- *    file, e.g. if you are running a multi-user proxy.
- *
- *    Revision 1.3  2001/10/14 22:12:49  jongfoster
- *    New version of CGI-based actionsfile editor.
- *    Major changes, including:
- *    - Completely new file parser and file output routines
- *    - edit-actions CGI renamed edit-actions-for-url
- *    - All CGIs now need a filename parameter, except for...
- *    - New CGI edit-actions which doesn't need a filename,
- *      to allow you to start the editor up.
- *    - edit-actions-submit now works, and now automatically
- *      redirects you back to the main edit-actions-list handler.
- *
- *    Revision 1.2  2001/09/16 17:05:14  jongfoster
- *    Removing unused #include showarg.h
- *
- *    Revision 1.1  2001/09/16 15:47:37  jongfoster
- *    First version of CGI-based edit interface.  This is very much a
- *    work-in-progress, and you can't actually use it to edit anything
- *    yet.  You must #define FEATURE_CGI_EDIT_ACTIONS for these changes
- *    to have any effect.
- *
- *
- **********************************************************************/
-
-
-#include "config.h"
-
-/*
- * FIXME: Following includes copied from cgi.c - which are actually needed?
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <ctype.h>
-#include <string.h>
-#include <assert.h>
-#include <sys/stat.h>
-
-#include "project.h"
-#include "cgi.h"
-#include "cgiedit.h"
-#include "cgisimple.h"
-#include "list.h"
-#include "encode.h"
-#include "actions.h"
-#include "miscutil.h"
-#include "errlog.h"
-#include "loaders.h"
-#ifdef FEATURE_TOGGLE
-/* loadcfg.h is for global_toggle_state only */
-#include "loadcfg.h"
-#endif /* def FEATURE_TOGGLE */
-#include "urlmatch.h"
-
-const char cgiedit_h_rcs[] = CGIEDIT_H_VERSION;
-
-
-#ifdef FEATURE_CGI_EDIT_ACTIONS
-
-/**
- * A line in an editable_file.
- */
-struct file_line
-{
-   /** Next entry in the linked list */
-   struct file_line * next;
-   
-   /** The raw data, to write out if this line is unmodified. */
-   char * raw;
-   
-   /** Comments and/or whitespace to put before this line if it's modified
-       and then written out. */
-   char * prefix;
-
-   /** The actual data, as a string.  Line continuation and comment removal
-       are performed on the data read from file before it's stored here, so
-       it will be a single line of data.  */
-   char * unprocessed;
-   
-   /** The type of data on this line.  One of the FILE_LINE_xxx constants. */
-   int type;
-
-   /** The actual data, processed into some sensible data type. */
-   union
-   {
-
-      /** An action specification. */
-      struct action_spec action[1];
-
-      /** A name=value pair. */
-      struct
-      {
-
-         /** The name in the name=value pair. */
-         char * name;
-
-         /** The value in the name=value pair, as a string. */
-         char * svalue;
-
-         /** The value in the name=value pair, as an integer. */
-         int ivalue;
-
-      } setting;
-
-      /* Add more data types here... e.g.
-
-
-      struct url_spec url[1];
-
-      struct
-      {
-         struct action_spec action[1];
-         const char * name;
-      } alias;
-
-      */
-
-   } data;
-
-};
-
-/** This file_line has not been processed yet. */
-#define FILE_LINE_UNPROCESSED           1
-
-/** This file_line is blank. Can only appear at the end of a file, due to
-    the way the parser works. */
-#define FILE_LINE_BLANK                 2
-
-/** This file_line says {{alias}}. */
-#define FILE_LINE_ALIAS_HEADER          3
-
-/** This file_line defines an alias. */
-#define FILE_LINE_ALIAS_ENTRY           4
-
-/** This file_line defines an {action}. */
-#define FILE_LINE_ACTION                5
-
-/** This file_line specifies a URL pattern. */
-#define FILE_LINE_URL                   6
-
-/** This file_line says {{settings}}. */
-#define FILE_LINE_SETTINGS_HEADER       7
-
-/** This file_line is in a {{settings}} block. */
-#define FILE_LINE_SETTINGS_ENTRY        8
-
-/** This file_line says {{description}}. */
-#define FILE_LINE_DESCRIPTION_HEADER    9
-
-/** This file_line is in a {{description}} block. */
-#define FILE_LINE_DESCRIPTION_ENTRY    10
-
-/*
- * Number of file modification time mismatches
- * before the CGI editor gets turned off.
- */
-#define ACCEPTABLE_TIMESTAMP_MISMATCHES 3
-
-/**
- * A configuration file, in a format that can be edited and written back to
- * disk.
- */
-struct editable_file
-{
-   struct file_line * lines;  /**< The contents of the file.  A linked list of lines. */
-   const char * filename;     /**< Full pathname - e.g. "/etc/privoxy/wibble.action". */
-   unsigned identifier;       /**< The file name's position in csp->config->actions_file[]. */
-   const char * version_str;  /**< Last modification time, as a string.  For CGI param. */
-                              /**< Can be used in URL without using url_param(). */
-   unsigned version;          /**< Last modification time - prevents chaos with
-                                   the browser's "back" button.  Note that this is a
-                                   time_t cast to an unsigned.  When comparing, always
-                                   cast the time_t to an unsigned, and *NOT* vice-versa.
-                                   This may lose the top few bits, but they're not
-                                   significant anyway. */
-   int newline;               /**< Newline convention - one of the NEWLINE_xxx constants.
-                                   Note that changing this after the file has been
-                                   read in will cause a mess. */
-   struct file_line * parse_error; /**< On parse error, this is the offending line. */
-   const char * parse_error_text;  /**< On parse error, this is the problem.
-                                        (Statically allocated) */
-};
-
-/**
- * Information about the filter types.
- * Used for macro replacement in cgi_edit_actions_for_url.
- */
-struct filter_type_info
-{
-   const int multi_action_index; /**< The multi action index as defined in project.h */
-   const char *macro_name;       /**< Name of the macro that has to be replaced
-                                      with the prepared templates.
-                                      For example "content-filter-params" */
-   const char *type;             /**< Name of the filter type,
-                                      for example "server-header-filter". */
-   /* XXX: check if these two can be combined. */
-   const char *disable_all_option; /**< Name of the catch-all radio option that has
-                                        to be checked or unchecked for this filter type. */
-   const char *disable_all_param;  /**< Name of the parameter that causes all filters of
-                                        this type to be disabled. */
-   const char *abbr_type;        /**< Abbreviation of the filter type, usually the
-                                      first or second character capitalized */
-   const char *anchor;           /**< Anchor for the User Manual link,
-                                      for example "SERVER-HEADER-FILTER"  */
-};
-
-/* Accessed by index, keep the order in the way the FT_ macros are defined. */
-static const struct filter_type_info filter_type_info[] =
-{
-   {
-      ACTION_MULTI_FILTER,
-      "content-filter-params", "filter",
-      "filter-all", "filter_all",
-      "F", "FILTER"
-   },
-   {
-      ACTION_MULTI_CLIENT_HEADER_FILTER,
-      "client-header-filter-params", "client-header-filter",
-      "client-header-filter-all", "client_header_filter_all",
-      "C", "CLIENT-HEADER-FILTER"
-   },
-   {
-      ACTION_MULTI_SERVER_HEADER_FILTER,
-      "server-header-filter-params", "server-header-filter",
-      "server-header-filter-all", "server_header_filter_all",
-      "S", "SERVER-HEADER-FILTER"
-   },
-   {
-      ACTION_MULTI_CLIENT_HEADER_TAGGER,
-      "client-header-tagger-params", "client-header-tagger",
-      "client-header-tagger-all", "client_header_tagger_all",
-      "L", "CLIENT-HEADER-TAGGER"
-   },
-   {
-      ACTION_MULTI_SERVER_HEADER_TAGGER,
-      "server-header-tagger-params", "server-header-tagger",
-      "server-header-tagger-all", "server_header_tagger_all",
-      "E", "SERVER-HEADER-TAGGER"
-   },
-};
-
-/* FIXME: Following non-static functions should be prototyped in .h or made static */
-
-/* Functions to read and write arbitrary config files */
-jb_err edit_read_file(struct client_state *csp,
-                      const struct map *parameters,
-                      int require_version,
-                      struct editable_file **pfile);
-jb_err edit_write_file(struct editable_file * file);
-void   edit_free_file(struct editable_file * file);
-
-/* Functions to read and write actions files */
-jb_err edit_parse_actions_file(struct editable_file * file);
-jb_err edit_read_actions_file(struct client_state *csp,
-                              struct http_response *rsp,
-                              const struct map *parameters,
-                              int require_version,
-                              struct editable_file **pfile);
-
-/* Error handlers */
-jb_err cgi_error_modified(struct client_state *csp,
-                          struct http_response *rsp,
-                          const char *filename);
-jb_err cgi_error_parse(struct client_state *csp,
-                       struct http_response *rsp,
-                       struct editable_file *file);
-jb_err cgi_error_file(struct client_state *csp,
-                      struct http_response *rsp,
-                      const char *filename);
-jb_err cgi_error_file_read_only(struct client_state *csp,
-                                struct http_response *rsp,
-                                const char *filename);
-
-/* Internal arbitrary config file support functions */
-static jb_err edit_read_file_lines(FILE *fp, struct file_line ** pfile, int *newline);
-static void edit_free_file_lines(struct file_line * first_line);
-
-/* Internal actions file support functions */
-static int match_actions_file_header_line(const char * line, const char * name);
-static jb_err split_line_on_equals(const char * line, char ** pname, char ** pvalue);
-
-/* Internal parameter parsing functions */
-static jb_err get_url_spec_param(struct client_state *csp,
-                                 const struct map *parameters,
-                                 const char *name,
-                                 char **pvalue);
-
-
-/* Internal actionsfile <==> HTML conversion functions */
-static jb_err map_radio(struct map * exports,
-                        const char * optionname,
-                        const char * values,
-                        int value);
-static jb_err actions_to_radio(struct map * exports,
-                               const struct action_spec *action);
-static jb_err actions_from_radio(const struct map * parameters,
-                                 struct action_spec *action);
-
-
-static jb_err map_copy_parameter_html(struct map *out,
-                                      const struct map *in,
-                                      const char *name);
-#if 0 /* unused function */
-static jb_err map_copy_parameter_url(struct map *out,
-                                     const struct map *in,
-                                     const char *name);
-#endif /* unused function */
-
-static jb_err get_file_name_param(struct client_state *csp, 	 
-	                                   const struct map *parameters, 	 
-	                                   const char *param_name, 	 
-	                                   const char **pfilename);
-
-/* Internal convenience functions */
-static char *section_target(const unsigned sectionid);
-
-/*********************************************************************
- *
- * Function    :  section_target
- *
- * Description :  Given an unsigned (section id) n, produce a dynamically
- *                allocated string of the form #l<n>, for use in link
- *                targets.
- *
- *                XXX: The hash should be moved into the templates
- *                to make this function more generic and render
- *                stringify() obsolete.
- *
- * Parameters  :
- *          1  :  sectionid = start line number of section
- *
- * Returns     :  String with link target, or NULL if out of
- *                memory
- *
- *********************************************************************/
-static char *section_target(const unsigned sectionid)
-{
-   char buf[30];
-
-   snprintf(buf, sizeof(buf), "#l%d", sectionid);
-   return(strdup(buf));
-
-}
-
-
-/*********************************************************************
- *
- * Function    :  stringify
- *
- * Description :  Convert a number into a dynamically allocated string.
- *
- * Parameters  :
- *          1  :  number = The number to convert.
- *
- * Returns     :  String with link target, or NULL if out of memory
- *
- *********************************************************************/
-static char *stringify(const unsigned number)
-{
-   char buf[6];
-
-   snprintf(buf, sizeof(buf), "%i", number);
-   return strdup(buf);
-}
-
-
-/*********************************************************************
- *
- * Function    :  map_copy_parameter_html
- *
- * Description :  Copy a CGI parameter from one map to another, HTML
- *                encoding it.
- *
- * Parameters  :
- *          1  :  out = target map
- *          2  :  in = source map
- *          3  :  name = name of cgi parameter to copy
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory
- *                JB_ERR_CGI_PARAMS if the parameter doesn't exist
- *                                  in the source map
- *
- *********************************************************************/
-static jb_err map_copy_parameter_html(struct map *out,
-                                      const struct map *in,
-                                      const char *name)
-{
-   const char * value;
-   jb_err err;
-
-   assert(out);
-   assert(in);
-   assert(name);
-
-   value = lookup(in, name);
-   err = map(out, name, 1, html_encode(value), 0);
-
-   if (err)
-   {
-      /* Out of memory */
-      return err;
-   }
-   else if (*value == '\0')
-   {
-      return JB_ERR_CGI_PARAMS;
-   }
-   else
-   {
-      return JB_ERR_OK;
-   }
-}
-
-
-#if 0 /* unused function */
-/*********************************************************************
- *
- * Function    :  map_copy_parameter_url
- *
- * Description :  Copy a CGI parameter from one map to another, URL
- *                encoding it.
- *
- * Parameters  :
- *          1  :  out = target map
- *          2  :  in = source map
- *          3  :  name = name of cgi parameter to copy
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory
- *                JB_ERR_CGI_PARAMS if the parameter doesn't exist
- *                                  in the source map
- *
- *********************************************************************/
-static jb_err map_copy_parameter_url(struct map *out,
-                                     const struct map *in,
-                                     const char *name)
-{
-   const char * value;
-   jb_err err;
-
-   assert(out);
-   assert(in);
-   assert(name);
-
-   value = lookup(in, name);
-   err = map(out, name, 1, url_encode(value), 0);
-
-   if (err)
-   {
-      /* Out of memory */
-      return err;
-   }
-   else if (*value == '\0')
-   {
-      return JB_ERR_CGI_PARAMS;
-   }
-   else
-   {
-      return JB_ERR_OK;
-   }
-}
-#endif /* 0 - unused function */
-
-
-/*********************************************************************
- *
- * Function    :  cgi_edit_actions_url_form
- *
- * Description :  CGI function that displays a form for
- *                edit-actions-url
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters
- *           i : (action index) Identifies the file to edit
- *           v : (version) File's last-modified time
- *           p : (pattern) Line number of pattern to edit
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory
- *                JB_ERR_CGI_PARAMS if the CGI parameters are not
- *                                  specified or not valid.
- *
- *********************************************************************/
-jb_err cgi_edit_actions_url_form(struct client_state *csp,
-                                 struct http_response *rsp,
-                                 const struct map *parameters)
-{
-   struct map * exports;
-   unsigned patternid;
-   struct editable_file * file;
-   struct file_line * cur_line;
-   unsigned line_number;
-   unsigned section_start_line_number = 0;
-   jb_err err;
-
-   assert(csp);
-   assert(rsp);
-   assert(parameters);
-
-   if (0 == (csp->config->feature_flags & RUNTIME_FEATURE_CGI_EDIT_ACTIONS))
-   {
-      return cgi_error_disabled(csp, rsp);
-   }
-
-   err = get_number_param(csp, parameters, "p", &patternid);
-   if (err)
-   {
-      return err;
-   }
-
-   err = edit_read_actions_file(csp, rsp, parameters, 1, &file);
-   if (err)
-   {
-      /* No filename specified, can't read file, modified, or out of memory. */
-      return (err == JB_ERR_FILE ? JB_ERR_OK : err);
-   }
-
-   cur_line = file->lines;
-
-   for (line_number = 1; (cur_line != NULL) && (line_number < patternid); line_number++)
-   {
-      if (cur_line->type == FILE_LINE_ACTION)
-      {
-         section_start_line_number = line_number;
-      }
-      cur_line = cur_line->next;
-   }
-
-   if ( (cur_line == NULL)
-     || (line_number != patternid)
-     || (patternid < 1U)
-     || (cur_line->type != FILE_LINE_URL))
-   {
-      /* Invalid "patternid" parameter */
-      edit_free_file(file);
-      return JB_ERR_CGI_PARAMS;
-   }
-
-   if (NULL == (exports = default_exports(csp, NULL)))
-   {
-      edit_free_file(file);
-      return JB_ERR_MEMORY;
-   }
-
-   err = map(exports, "f", 1, stringify(file->identifier), 0);
-   if (!err) err = map(exports, "v", 1, file->version_str, 1);
-   if (!err) err = map(exports, "p", 1, url_encode(lookup(parameters, "p")), 0);
-   if (!err) err = map(exports, "u", 1, html_encode(cur_line->unprocessed), 0);
-   if (!err) err = map(exports, "jumptarget", 1, section_target(section_start_line_number), 0);
-
-   edit_free_file(file);
-
-   if (err)
-   {
-      free_map(exports);
-      return err;
-   }
-
-   return template_fill_for_cgi(csp, "edit-actions-url-form", exports, rsp);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_edit_actions_add_url_form
- *
- * Description :  CGI function that displays a form for
- *                edit-actions-url
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters :
- *           f : (filename) Identifies the file to edit
- *           v : (version) File's last-modified time
- *           s : (section) Line number of section to edit
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory
- *                JB_ERR_CGI_PARAMS if the CGI parameters are not
- *                                  specified or not valid.
- *
- *********************************************************************/
-jb_err cgi_edit_actions_add_url_form(struct client_state *csp,
-                                     struct http_response *rsp,
-                                     const struct map *parameters)
-{
-   struct map *exports;
-   jb_err err;
-
-   assert(csp);
-   assert(rsp);
-   assert(parameters);
-
-   if (0 == (csp->config->feature_flags & RUNTIME_FEATURE_CGI_EDIT_ACTIONS))
-   {
-      return cgi_error_disabled(csp, rsp);
-   }
-
-   if (NULL == (exports = default_exports(csp, NULL)))
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   err = map_copy_parameter_html(exports, parameters, "f");
-   if (!err) err = map_copy_parameter_html(exports, parameters, "v");
-   if (!err) err = map_copy_parameter_html(exports, parameters, "s");
-
-   if (err)
-   {
-      free_map(exports);
-      return err;
-   }
-
-   return template_fill_for_cgi(csp, "edit-actions-add-url-form", exports, rsp);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_edit_actions_remove_url_form
- *
- * Description :  CGI function that displays a form for
- *                edit-actions-url
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters :
- *           f : (number)  The action file identifier.
- *           v : (version) File's last-modified time
- *           p : (pattern) Line number of pattern to edit
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory
- *                JB_ERR_CGI_PARAMS if the CGI parameters are not
- *                                  specified or not valid.
- *
- *********************************************************************/
-jb_err cgi_edit_actions_remove_url_form(struct client_state *csp,
-                                     struct http_response *rsp,
-                                     const struct map *parameters)
-{
-   struct map * exports;
-   unsigned patternid;
-   struct editable_file * file;
-   struct file_line * cur_line;
-   unsigned line_number;
-   unsigned section_start_line_number = 0;
-   jb_err err;
-
-   assert(csp);
-   assert(rsp);
-   assert(parameters);
-
-   if (0 == (csp->config->feature_flags & RUNTIME_FEATURE_CGI_EDIT_ACTIONS))
-   {
-      return cgi_error_disabled(csp, rsp);
-   }
-
-   err = get_number_param(csp, parameters, "p", &patternid);
-   if (err)
-   {
-      return err;
-   }
-
-   err = edit_read_actions_file(csp, rsp, parameters, 1, &file);
-   if (err)
-   {
-      /* No filename specified, can't read file, modified, or out of memory. */
-      return (err == JB_ERR_FILE ? JB_ERR_OK : err);
-   }
-
-   cur_line = file->lines;
-
-   for (line_number = 1; (cur_line != NULL) && (line_number < patternid); line_number++)
-   {
-      if (cur_line->type == FILE_LINE_ACTION)
-      {
-         section_start_line_number = line_number;
-      }      
-      cur_line = cur_line->next;
-   }
-
-   if ( (cur_line == NULL)
-     || (line_number != patternid)
-     || (patternid < 1U)
-     || (cur_line->type != FILE_LINE_URL))
-   {
-      /* Invalid "patternid" parameter */
-      edit_free_file(file);
-      return JB_ERR_CGI_PARAMS;
-   }
-
-   if (NULL == (exports = default_exports(csp, NULL)))
-   {
-      edit_free_file(file);
-      return JB_ERR_MEMORY;
-   }
-
-   err = map(exports, "f", 1, stringify(file->identifier), 0);
-   if (!err) err = map(exports, "v", 1, file->version_str, 1);
-   if (!err) err = map(exports, "p", 1, url_encode(lookup(parameters, "p")), 0);
-   if (!err) err = map(exports, "u", 1, html_encode(cur_line->unprocessed), 0);
-   if (!err) err = map(exports, "jumptarget", 1, section_target(section_start_line_number), 0);
-   if (!err) err = map(exports, "actions-file", 1, html_encode(file->filename), 0);
-
-   edit_free_file(file);
-
-   if (err)
-   {
-      free_map(exports);
-      return err;
-   }
-
-   return template_fill_for_cgi(csp, "edit-actions-remove-url-form", exports, rsp);
-}
-
-
-/*********************************************************************
- *
- * Function    :  edit_write_file
- *
- * Description :  Write a complete file to disk.
- *
- * Parameters  :
- *          1  :  file = File to write.
- *
- * Returns     :  JB_ERR_OK     on success
- *                JB_ERR_FILE   on error writing to file.
- *                JB_ERR_MEMORY on out of memory
- *
- *********************************************************************/
-jb_err edit_write_file(struct editable_file * file)
-{
-   FILE * fp;
-   struct file_line * cur_line;
-   struct stat statbuf[1];
-   char version_buf[22]; /* 22 = ceil(log10(2^64)) + 2 = max number of
-                            digits in time_t, assuming this is a 64-bit
-                            machine, plus null terminator, plus one
-                            for paranoia */
-
-   assert(file);
-   assert(file->filename);
-
-   if (NULL == (fp = fopen(file->filename, "wb")))
-   {
-      return JB_ERR_FILE;
-   }
-
-   cur_line = file->lines;
-   while (cur_line != NULL)
-   {
-      if (cur_line->raw)
-      {
-         if (fputs(cur_line->raw, fp) < 0)
-         {
-            fclose(fp);
-            return JB_ERR_FILE;
-         }
-      }
-      else
-      {
-         if (cur_line->prefix)
-         {
-            if (fputs(cur_line->prefix, fp) < 0)
-            {
-               fclose(fp);
-               return JB_ERR_FILE;
-            }
-         }
-         if (cur_line->unprocessed)
-         {
-
-            if (NULL != strchr(cur_line->unprocessed, '#'))
-            {
-               /* Must quote '#' characters */
-               int numhash = 0;
-               size_t len;
-               char * src;
-               char * dest;
-               char * str;
-
-               /* Count number of # characters, so we know length of output string */
-               src = cur_line->unprocessed;
-               while (NULL != (src = strchr(src, '#')))
-               {
-                  numhash++;
-                  src++;
-               }
-               assert(numhash > 0);
-
-               /* Allocate new memory for string */
-               len = strlen(cur_line->unprocessed) + (size_t)numhash;
-               if (NULL == (str = malloc(len + 1)))
-               {
-                  /* Uh oh, just trashed file! */
-                  fclose(fp);
-                  return JB_ERR_MEMORY;
-               }
-
-               /* Copy string but quote hashes */
-               src  = cur_line->unprocessed;
-               dest = str;
-               while (*src)
-               {
-                  if (*src == '#')
-                  {
-                     *dest++ = '\\';
-                     numhash--;
-                     assert(numhash >= 0);
-                  }
-                  *dest++ = *src++;
-               }
-               *dest = '\0';
-
-               assert(numhash == 0);
-               assert(strlen(str) == len);
-               assert(str == dest - len);
-               assert(src - len <= cur_line->unprocessed);
-
-               if ((strlen(str) != len) || (numhash != 0))
-               {
-                  /*
-                   * Escaping didn't work as expected, go spread the news.
-                   * Only reached in non-debugging builds.
-                   */
-                  log_error(LOG_LEVEL_ERROR,
-                     "Looks like hash escaping failed. %s might be corrupted now.",
-                     file->filename);
-               }
-
-               if (fputs(str, fp) < 0)
-               {
-                  free(str);
-                  fclose(fp);
-                  return JB_ERR_FILE;
-               }
-
-               free(str);
-            }
-            else
-            {
-               /* Can write without quoting '#' characters. */
-               if (fputs(cur_line->unprocessed, fp) < 0)
-               {
-                  fclose(fp);
-                  return JB_ERR_FILE;
-               }
-            }
-            if (fputs(NEWLINE(file->newline), fp) < 0)
-            {
-               fclose(fp);
-               return JB_ERR_FILE;
-            }
-         }
-         else
-         {
-            /* FIXME: Write data from file->data->whatever */
-            assert(0);
-         }
-      }
-      cur_line = cur_line->next;
-   }
-
-   fclose(fp);
-
-
-   /* Update the version stamp in the file structure, since we just
-    * wrote to the file & changed it's date.
-    */
-   if (stat(file->filename, statbuf) < 0)
-   {
-      /* Error, probably file not found. */
-      return JB_ERR_FILE;
-   }
-   file->version = (unsigned)statbuf->st_mtime;
-
-   /* Correct file->version_str */
-   freez(file->version_str);
-   snprintf(version_buf, sizeof(version_buf), "%u", file->version);
-   version_buf[sizeof(version_buf)-1] = '\0';
-   file->version_str = strdup(version_buf);
-   if (version_buf == NULL)
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   return JB_ERR_OK;
-}
-
-
-/*********************************************************************
- *
- * Function    :  edit_free_file
- *
- * Description :  Free a complete file in memory.
- *
- * Parameters  :
- *          1  :  file = Data structure to free.
- *
- * Returns     :  N/A
- *
- *********************************************************************/
-void edit_free_file(struct editable_file * file)
-{
-   if (!file)
-   {
-      /* Silently ignore NULL pointer */
-      return;
-   }
-
-   edit_free_file_lines(file->lines);
-   freez(file->version_str);
-   file->version = 0;
-   file->parse_error_text = NULL; /* Statically allocated */
-   file->parse_error = NULL;
-
-   free(file);
-}
-
-
-/*********************************************************************
- *
- * Function    :  edit_free_file_lines
- *
- * Description :  Free an entire linked list of file lines.
- *
- * Parameters  :
- *          1  :  first_line = Data structure to free.
- *
- * Returns     :  N/A
- *
- *********************************************************************/
-static void edit_free_file_lines(struct file_line * first_line)
-{
-   struct file_line * next_line;
-
-   while (first_line != NULL)
-   {
-      next_line = first_line->next;
-      first_line->next = NULL;
-      freez(first_line->raw);
-      freez(first_line->prefix);
-      freez(first_line->unprocessed);
-      switch(first_line->type)
-      {
-         case 0: /* special case if memory zeroed */
-         case FILE_LINE_UNPROCESSED:
-         case FILE_LINE_BLANK:
-         case FILE_LINE_ALIAS_HEADER:
-         case FILE_LINE_SETTINGS_HEADER:
-         case FILE_LINE_DESCRIPTION_HEADER:
-         case FILE_LINE_DESCRIPTION_ENTRY:
-         case FILE_LINE_ALIAS_ENTRY:
-         case FILE_LINE_URL:
-            /* No data is stored for these */
-            break;
-
-         case FILE_LINE_ACTION:
-            free_action(first_line->data.action);
-            break;
-
-         case FILE_LINE_SETTINGS_ENTRY:
-            freez(first_line->data.setting.name);
-            freez(first_line->data.setting.svalue);
-            break;
-         default:
-            /* Should never happen */
-            assert(0);
-            break;
-      }
-      first_line->type = 0; /* paranoia */
-      free(first_line);
-      first_line = next_line;
-   }
-}
-
-
-/*********************************************************************
- *
- * Function    :  match_actions_file_header_line
- *
- * Description :  Match an actions file {{header}} line
- *
- * Parameters  :
- *          1  :  line = String from file
- *          2  :  name = Header to match against
- *
- * Returns     :  0 iff they match.
- *
- *********************************************************************/
-static int match_actions_file_header_line(const char * line, const char * name)
-{
-   size_t len;
-
-   assert(line);
-   assert(name);
-
-   /* Look for "{{" */
-   if ((line[0] != '{') || (line[1] != '{'))
-   {
-      return 1;
-   }
-   line += 2;
-
-   /* Look for optional whitespace */
-   while ( (*line == ' ') || (*line == '\t') )
-   {
-      line++;
-   }
-
-   /* Look for the specified name (case-insensitive) */
-   len = strlen(name);
-   if (0 != strncmpic(line, name, len))
-   {
-      return 1;
-   }
-   line += len;
-
-   /* Look for optional whitespace */
-   while ( (*line == ' ') || (*line == '\t') )
-   {
-      line++;
-   }
-
-   /* Look for "}}" and end of string*/
-   if ((line[0] != '}') || (line[1] != '}') || (line[2] != '\0'))
-   {
-      return 1;
-   }
-
-   /* It matched!! */
-   return 0;
-}
-
-
-/*********************************************************************
- *
- * Function    :  match_actions_file_header_line
- *
- * Description :  Match an actions file {{header}} line
- *
- * Parameters  :
- *          1  :  line = String from file.  Must not start with
- *                       whitespace (else infinite loop!)
- *          2  :  pname = Destination for name
- *          2  :  pvalue = Destination for value
- *
- * Returns     :  JB_ERR_OK     on success
- *                JB_ERR_MEMORY on out-of-memory
- *                JB_ERR_PARSE  if there's no "=" sign, or if there's
- *                              nothing before the "=" sign (but empty
- *                              values *after* the "=" sign are legal).
- *
- *********************************************************************/
-static jb_err split_line_on_equals(const char * line, char ** pname, char ** pvalue)
-{
-   const char * name_end;
-   const char * value_start;
-   size_t name_len;
-
-   assert(line);
-   assert(pname);
-   assert(pvalue);
-   assert(*line != ' ');
-   assert(*line != '\t');
-
-   *pname = NULL;
-   *pvalue = NULL;
-
-   value_start = strchr(line, '=');
-   if ((value_start == NULL) || (value_start == line))
-   {
-      return JB_ERR_PARSE;
-   }
-
-   name_end = value_start - 1;
-
-   /* Eat any whitespace before the '=' */
-   while ((*name_end == ' ') || (*name_end == '\t'))
-   {
-      /*
-       * we already know we must have at least 1 non-ws char
-       * at start of buf - no need to check
-       */
-      name_end--;
-   }
-
-   name_len = (size_t)(name_end - line) + 1; /* Length excluding \0 */
-   if (NULL == (*pname = (char *) malloc(name_len + 1)))
-   {
-      return JB_ERR_MEMORY;
-   }
-   strncpy(*pname, line, name_len);
-   (*pname)[name_len] = '\0';
-
-   /* Eat any the whitespace after the '=' */
-   value_start++;
-   while ((*value_start == ' ') || (*value_start == '\t'))
-   {
-      value_start++;
-   }
-
-   if (NULL == (*pvalue = strdup(value_start)))
-   {
-      free(*pname);
-      *pname = NULL;
-      return JB_ERR_MEMORY;
-   }
-
-   return JB_ERR_OK;
-}
-
-
-/*********************************************************************
- *
- * Function    :  edit_parse_actions_file
- *
- * Description :  Parse an actions file in memory.
- *
- *                Passed linked list must have the "data" member
- *                zeroed, and must contain valid "next" and
- *                "unprocessed" fields.  The "raw" and "prefix"
- *                fields are ignored, and "type" is just overwritten.
- *
- *                Note that on error the file may have been
- *                partially parsed.
- *
- * Parameters  :
- *          1  :  file = Actions file to be parsed in-place.
- *
- * Returns     :  JB_ERR_OK     on success
- *                JB_ERR_MEMORY on out-of-memory
- *                JB_ERR_PARSE  on error
- *
- *********************************************************************/
-jb_err edit_parse_actions_file(struct editable_file * file)
-{
-   struct file_line * cur_line;
-   size_t len;
-   const char * text; /* Text from a line */
-   char * name;  /* For lines of the form name=value */
-   char * value; /* For lines of the form name=value */
-   struct action_alias * alias_list = NULL;
-   jb_err err = JB_ERR_OK;
-
-   /* alias_list contains the aliases defined in this file.
-    * It might be better to use the "file_line.data" fields
-    * in the relavent places instead.
-    */
-
-   cur_line = file->lines;
-
-   /* A note about blank line support: Blank lines should only
-    * ever occur as the last line in the file.  This function
-    * is more forgiving than that - FILE_LINE_BLANK can occur
-    * anywhere.
-    */
-
-   /* Skip leading blanks.  Should only happen if file is
-    * empty (which is valid, but pointless).
-    */
-   while ( (cur_line != NULL)
-        && (cur_line->unprocessed[0] == '\0') )
-   {
-      /* Blank line */
-      cur_line->type = FILE_LINE_BLANK;
-      cur_line = cur_line->next;
-   }
-
-   if ( (cur_line != NULL)
-     && (cur_line->unprocessed[0] != '{') )
-   {
-      /* File doesn't start with a header */
-      file->parse_error = cur_line;
-      file->parse_error_text = "First (non-comment) line of the file must contain a header.";
-      return JB_ERR_PARSE;
-   }
-
-   if ( (cur_line != NULL) && (0 ==
-      match_actions_file_header_line(cur_line->unprocessed, "settings") ) )
-   {
-      cur_line->type = FILE_LINE_SETTINGS_HEADER;
-
-      cur_line = cur_line->next;
-      while ((cur_line != NULL) && (cur_line->unprocessed[0] != '{'))
-      {
-         if (cur_line->unprocessed[0])
-         {
-            cur_line->type = FILE_LINE_SETTINGS_ENTRY;
-
-            err = split_line_on_equals(cur_line->unprocessed,
-                     &cur_line->data.setting.name,
-                     &cur_line->data.setting.svalue);
-            if (err == JB_ERR_MEMORY)
-            {
-               return err;
-            }
-            else if (err != JB_ERR_OK)
-            {
-               /* Line does not contain a name=value pair */
-               file->parse_error = cur_line;
-               file->parse_error_text = "Expected a name=value pair on this {{description}} line, but couldn't find one.";
-               return JB_ERR_PARSE;
-            }
-         }
-         else
-         {
-            cur_line->type = FILE_LINE_BLANK;
-         }
-         cur_line = cur_line->next;
-      }
-   }
-
-   if ( (cur_line != NULL) && (0 ==
-      match_actions_file_header_line(cur_line->unprocessed, "description") ) )
-   {
-      cur_line->type = FILE_LINE_DESCRIPTION_HEADER;
-
-      cur_line = cur_line->next;
-      while ((cur_line != NULL) && (cur_line->unprocessed[0] != '{'))
-      {
-         if (cur_line->unprocessed[0])
-         {
-            cur_line->type = FILE_LINE_DESCRIPTION_ENTRY;
-         }
-         else
-         {
-            cur_line->type = FILE_LINE_BLANK;
-         }
-         cur_line = cur_line->next;
-      }
-   }
-
-   if ( (cur_line != NULL) && (0 ==
-      match_actions_file_header_line(cur_line->unprocessed, "alias") ) )
-   {
-      cur_line->type = FILE_LINE_ALIAS_HEADER;
-
-      cur_line = cur_line->next;
-      while ((cur_line != NULL) && (cur_line->unprocessed[0] != '{'))
-      {
-         if (cur_line->unprocessed[0])
-         {
-            /* define an alias */
-            struct action_alias * new_alias;
-
-            cur_line->type = FILE_LINE_ALIAS_ENTRY;
-
-            err = split_line_on_equals(cur_line->unprocessed, &name, &value);
-            if (err == JB_ERR_MEMORY)
-            {
-               return err;
-            }
-            else if (err != JB_ERR_OK)
-            {
-               /* Line does not contain a name=value pair */
-               file->parse_error = cur_line;
-               file->parse_error_text = "Expected a name=value pair on this {{alias}} line, but couldn't find one.";
-               return JB_ERR_PARSE;
-            }
-
-            if ((new_alias = zalloc(sizeof(*new_alias))) == NULL)
-            {
-               /* Out of memory */
-               free(name);
-               free(value);
-               free_alias_list(alias_list);
-               return JB_ERR_MEMORY;
-            }
-
-            err = get_actions(value, alias_list, new_alias->action);
-            if (err)
-            {
-               /* Invalid action or out of memory */
-               free(name);
-               free(value);
-               free(new_alias);
-               free_alias_list(alias_list);
-               if (err == JB_ERR_MEMORY)
-               {
-                  return err;
-               }
-               else
-               {
-                  /* Line does not contain a name=value pair */
-                  file->parse_error = cur_line;
-                  file->parse_error_text = "This alias does not specify a valid set of actions.";
-                  return JB_ERR_PARSE;
-               }
-            }
-
-            free(value);
-
-            new_alias->name = name;
-
-            /* add to list */
-            new_alias->next = alias_list;
-            alias_list = new_alias;
-         }
-         else
-         {
-            cur_line->type = FILE_LINE_BLANK;
-         }
-         cur_line = cur_line->next;
-      }
-   }
-
-   /* Header done, process the main part of the file */
-   while (cur_line != NULL)
-   {
-      /* At this point, (cur_line->unprocessed[0] == '{') */
-      assert(cur_line->unprocessed[0] == '{');
-      text = cur_line->unprocessed + 1;
-      len = strlen(text) - 1;
-      if (text[len] != '}')
-      {
-         /* No closing } on header */
-         free_alias_list(alias_list);
-         file->parse_error = cur_line;
-         file->parse_error_text = "Headers starting with '{' must have a "
-            "closing bracket ('}').  Headers starting with two brackets ('{{') "
-            "must close with two brackets ('}}').";
-         return JB_ERR_PARSE;
-      }
-
-      if (text[0] == '{')
-      {
-         /* An invalid {{ header.  */
-         free_alias_list(alias_list);
-         file->parse_error = cur_line;
-         file->parse_error_text = "Unknown or unexpected two-bracket header.  "
-            "Please remember that the system (two-bracket) headers must "
-            "appear in the order {{settings}}, {{description}}, {{alias}}, "
-            "and must appear before any actions (one-bracket) headers.  "
-            "Also note that system headers may not be repeated.";
-         return JB_ERR_PARSE;
-      }
-
-      while ( (*text == ' ') || (*text == '\t') )
-      {
-         text++;
-         len--;
-      }
-      while ( (len > (size_t)0)
-           && ( (text[len - 1] == ' ')
-             || (text[len - 1] == '\t') ) )
-      {
-         len--;
-      }
-
-      cur_line->type = FILE_LINE_ACTION;
-
-      /* Remove {} and make copy */
-      if (NULL == (value = (char *) malloc(len + 1)))
-      {
-         /* Out of memory */
-         free_alias_list(alias_list);
-         return JB_ERR_MEMORY;
-      }
-      strncpy(value, text, len);
-      value[len] = '\0';
-
-      /* Get actions */
-      err = get_actions(value, alias_list, cur_line->data.action);
-      if (err)
-      {
-         /* Invalid action or out of memory */
-         free(value);
-         free_alias_list(alias_list);
-         if (err == JB_ERR_MEMORY)
-         {
-            return err;
-         }
-         else
-         {
-            /* Line does not contain a name=value pair */
-            file->parse_error = cur_line;
-            file->parse_error_text = "This header does not specify a valid set of actions.";
-            return JB_ERR_PARSE;
-         }
-      }
-
-      /* Done with string - it was clobbered anyway */
-      free(value);
-
-      /* Process next line */
-      cur_line = cur_line->next;
-
-      /* Loop processing URL patterns */
-      while ((cur_line != NULL) && (cur_line->unprocessed[0] != '{'))
-      {
-         if (cur_line->unprocessed[0])
-         {
-            /* Could parse URL here, but this isn't currently needed */
-
-            cur_line->type = FILE_LINE_URL;
-         }
-         else
-         {
-            cur_line->type = FILE_LINE_BLANK;
-         }
-         cur_line = cur_line->next;
-      }
-   } /* End main while(cur_line != NULL) loop */
-
-   free_alias_list(alias_list);
-
-   return JB_ERR_OK;
-}
-
-
-/*********************************************************************
- *
- * Function    :  edit_read_file_lines
- *
- * Description :  Read all the lines of a file into memory.
- *                Handles whitespace, comments and line continuation.
- *
- * Parameters  :
- *          1  :  fp = File to read from.  On return, this will be
- *                     at EOF but it will not have been closed.
- *          2  :  pfile = Destination for a linked list of file_lines.
- *                        Will be set to NULL on error.
- *          3  :  newline = How to handle newlines.
- *
- * Returns     :  JB_ERR_OK     on success
- *                JB_ERR_MEMORY on out-of-memory
- *
- *********************************************************************/
-jb_err edit_read_file_lines(FILE *fp, struct file_line ** pfile, int *newline)
-{
-   struct file_line * first_line; /* Keep for return value or to free */
-   struct file_line * cur_line;   /* Current line */
-   struct file_line * prev_line;  /* Entry with prev_line->next = cur_line */
-   jb_err rval;
-
-   assert(fp);
-   assert(pfile);
-
-   *pfile = NULL;
-
-   cur_line = first_line = zalloc(sizeof(struct file_line));
-   if (cur_line == NULL)
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   cur_line->type = FILE_LINE_UNPROCESSED;
-
-   rval = edit_read_line(fp, &cur_line->raw, &cur_line->prefix, &cur_line->unprocessed, newline, NULL);
-   if (rval)
-   {
-      /* Out of memory or empty file. */
-      /* Note that empty file is not an error we propogate up */
-      free(cur_line);
-      return ((rval == JB_ERR_FILE) ? JB_ERR_OK : rval);
-   }
-
-   do
-   {
-      prev_line = cur_line;
-      cur_line = prev_line->next = zalloc(sizeof(struct file_line));
-      if (cur_line == NULL)
-      {
-         /* Out of memory */
-         edit_free_file_lines(first_line);
-         return JB_ERR_MEMORY;
-      }
-
-      cur_line->type = FILE_LINE_UNPROCESSED;
-
-      rval = edit_read_line(fp, &cur_line->raw, &cur_line->prefix, &cur_line->unprocessed, newline, NULL);
-      if ((rval != JB_ERR_OK) && (rval != JB_ERR_FILE))
-      {
-         /* Out of memory */
-         edit_free_file_lines(first_line);
-         return JB_ERR_MEMORY;
-      }
-
-   }
-   while (rval != JB_ERR_FILE);
-
-   /* EOF */
-
-   /* We allocated one too many - free it */
-   prev_line->next = NULL;
-   free(cur_line);
-
-   *pfile = first_line;
-   return JB_ERR_OK;
-}
-
-
-/*********************************************************************
- *
- * Function    :  edit_read_file
- *
- * Description :  Read a complete file into memory.
- *                Handles CGI parameter parsing.  If requested, also
- *                checks the file's modification timestamp.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  parameters = map of cgi parameters.
- *          3  :  require_version = true to check "ver" parameter.
- *          4  :  pfile = Destination for the file.  Will be set
- *                        to NULL on error.
- *
- * CGI Parameters :
- *           f :  The action file identifier.
- *         ver :  (Only if require_version is nonzero)
- *                Timestamp of the actions file.  If wrong, this
- *                function fails with JB_ERR_MODIFIED.
- *
- * Returns     :  JB_ERR_OK     on success
- *                JB_ERR_MEMORY on out-of-memory
- *                JB_ERR_CGI_PARAMS if "filename" was not specified
- *                                  or is not valid.
- *                JB_ERR_FILE   if the file cannot be opened or
- *                              contains no data
- *                JB_ERR_MODIFIED if version checking was requested and
- *                                failed - the file was modified outside
- *                                of this CGI editor instance.
- *
- *********************************************************************/
-jb_err edit_read_file(struct client_state *csp,
-                      const struct map *parameters,
-                      int require_version,
-                      struct editable_file **pfile)
-{
-   struct file_line * lines;
-   FILE * fp;
-   jb_err err;
-   const char *filename = NULL;
-   struct editable_file * file;
-   unsigned version = 0;
-   struct stat statbuf[1];
-   char version_buf[22];
-   int newline = NEWLINE_UNKNOWN;
-   unsigned i;
-
-   assert(csp);
-   assert(parameters);
-   assert(pfile);
-
-   *pfile = NULL;
-
-   err = get_number_param(csp, parameters, "f", &i);
-   if ((JB_ERR_OK == err) && (i < MAX_AF_FILES) && (NULL != csp->config->actions_file[i]))
-   {
-      filename = csp->config->actions_file[i];
-   }
-   else if (JB_ERR_CGI_PARAMS == err)
-   {
-      /*
-       * Probably an old-school URL like
-       * http://config.privoxy.org/edit-actions-list?f=default
-       */
-      err = get_file_name_param(csp, parameters, "f", &filename);
-   }
-
-   if (NULL == filename || stat(filename, statbuf) < 0)
-   {
-      /* Error, probably file not found. */
-      return JB_ERR_FILE;
-   }
-   version = (unsigned) statbuf->st_mtime;
-
-   if (require_version)
-   {
-      unsigned specified_version;
-      err = get_number_param(csp, parameters, "v", &specified_version);
-      if (err)
-      {
-         return err;
-      }
-
-      if (version != specified_version)
-      {
-         return JB_ERR_MODIFIED;
-      }
-   }
-
-   if (NULL == (fp = fopen(filename,"rb")))
-   {
-      return JB_ERR_FILE;
-   }
-
-   err = edit_read_file_lines(fp, &lines, &newline);
-
-   fclose(fp);
-
-   if (err)
-   {
-      return err;
-   }
-
-   file = (struct editable_file *) zalloc(sizeof(*file));
-   if (err)
-   {
-      edit_free_file_lines(lines);
-      return err;
-   }
-
-   file->lines = lines;
-   file->newline = newline;
-   file->filename = filename;
-   file->version = version;
-   file->identifier = i;
-
-   /* Correct file->version_str */
-   freez(file->version_str);
-   snprintf(version_buf, sizeof(version_buf), "%u", file->version);
-   version_buf[sizeof(version_buf)-1] = '\0';
-   file->version_str = strdup(version_buf);
-   if (version_buf == NULL)
-   {
-      edit_free_file(file);
-      return JB_ERR_MEMORY;
-   }
-
-   *pfile = file;
-   return JB_ERR_OK;
-}
-
-
-/*********************************************************************
- *
- * Function    :  edit_read_actions_file
- *
- * Description :  Read a complete actions file into memory.
- *                Handles CGI parameter parsing.  If requested, also
- *                checks the file's modification timestamp.
- *
- *                If this function detects an error in the categories
- *                JB_ERR_FILE, JB_ERR_MODIFIED, or JB_ERR_PARSE,
- *                then it handles it by filling in the specified
- *                response structure and returning JB_ERR_FILE.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = HTTP response.  Only filled in on error.
- *          2  :  parameters = map of cgi parameters.
- *          3  :  require_version = true to check "ver" parameter.
- *          4  :  pfile = Destination for the file.  Will be set
- *                        to NULL on error.
- *
- * CGI Parameters :
- *           f :  The actions file identifier.
- *         ver :  (Only if require_version is nonzero)
- *                Timestamp of the actions file.  If wrong, this
- *                function fails with JB_ERR_MODIFIED.
- *
- * Returns     :  JB_ERR_OK     on success
- *                JB_ERR_MEMORY on out-of-memory
- *                JB_ERR_CGI_PARAMS if "filename" was not specified
- *                                  or is not valid.
- *                JB_ERR_FILE  if the file does not contain valid data,
- *                             or if file cannot be opened or
- *                             contains no data, or if version
- *                             checking was requested and failed.
- *
- *********************************************************************/
-jb_err edit_read_actions_file(struct client_state *csp,
-                              struct http_response *rsp,
-                              const struct map *parameters,
-                              int require_version,
-                              struct editable_file **pfile)
-{
-   jb_err err;
-   struct editable_file *file;
-   static int acceptable_failures = ACCEPTABLE_TIMESTAMP_MISMATCHES - 1;
-
-   assert(csp);
-   assert(parameters);
-   assert(pfile);
-
-   *pfile = NULL;
-
-   err = edit_read_file(csp, parameters, require_version, &file);
-   if (err)
-   {
-      /* Try to handle if possible */
-      if (err == JB_ERR_FILE)
-      {
-         err = cgi_error_file(csp, rsp, lookup(parameters, "f"));
-      }
-      else if (err == JB_ERR_MODIFIED)
-      {
-         assert(require_version);
-         err = cgi_error_modified(csp, rsp, lookup(parameters, "f"));
-         log_error(LOG_LEVEL_ERROR,
-            "Blocking CGI edit request due to modification time mismatch.");
-         if (acceptable_failures > 0)
-         {
-            log_error(LOG_LEVEL_INFO,
-               "The CGI editor will be turned off after another %d mismatche(s).",
-               acceptable_failures);
-            acceptable_failures--;
-         }
-         else
-         {
-            log_error(LOG_LEVEL_INFO,
-               "Timestamp mismatch limit reached, turning CGI editor off. "
-               "Reload the configuration file to reenable it.");
-            csp->config->feature_flags &= ~RUNTIME_FEATURE_CGI_EDIT_ACTIONS;
-         }
-      }
-      if (err == JB_ERR_OK)
-      {
-         /*
-          * Signal to higher-level CGI code that there was a problem but we
-          * handled it, they should just return JB_ERR_OK.
-          */
-         err = JB_ERR_FILE;
-      }
-      return err;
-   }
-
-   err = edit_parse_actions_file(file);
-   if (err)
-   {
-      if (err == JB_ERR_PARSE)
-      {
-         err = cgi_error_parse(csp, rsp, file);
-         if (err == JB_ERR_OK)
-         {
-            /*
-             * Signal to higher-level CGI code that there was a problem but we
-             * handled it, they should just return JB_ERR_OK.
-             */
-            err = JB_ERR_FILE;
-         }
-      }
-      edit_free_file(file);
-      return err;
-   }
-
-   *pfile = file;
-   return JB_ERR_OK;
-}
-
-
-/*********************************************************************
- *
- * Function    :  get_file_name_param
- *
- * Description :  Get the name of the file to edit from the parameters
- *                passed to a CGI function using the old syntax.
- *                This function handles security checks and only
- *                accepts files that Privoxy already knows.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  parameters = map of cgi parameters
- *          3  :  param_name = The name of the parameter to read
- *          4  :  pfilename = pointer to the filename in
- *                csp->config->actions_file[] if found. Set to NULL on error.
- *
- * Returns     :  JB_ERR_OK         on success
- *                JB_ERR_MEMORY     on out-of-memory
- *                JB_ERR_CGI_PARAMS if "filename" was not specified
- *                                  or is not valid.
- *
- *********************************************************************/
-static jb_err get_file_name_param(struct client_state *csp,
-                                  const struct map *parameters,
-                                  const char *param_name,
-                                  const char **pfilename)
-{
-   const char *param;
-   const char suffix[] = ".action";
-   const char *s;
-   char *name;
-   char *fullpath;
-   char ch;
-   size_t len;
-   size_t name_size;
-   int i;
-
-   assert(csp);
-   assert(parameters);
-   assert(pfilename);
-
-   *pfilename = NULL;
-
-   param = lookup(parameters, param_name);
-   if (!*param)
-   {
-      return JB_ERR_CGI_PARAMS;
-   }
-
-   len = strlen(param);
-   if (len >= FILENAME_MAX)
-   {
-      /* Too long. */
-      return JB_ERR_CGI_PARAMS;
-   }
-
-   /*
-    * Check every character to see if it's legal.
-    * Totally unnecessary but we do it anyway.
-    */
-   s = param;
-   while ((ch = *s++) != '\0')
-   {
-      if ( ((ch < 'A') || (ch > 'Z'))
-        && ((ch < 'a') || (ch > 'z'))
-        && ((ch < '0') || (ch > '9'))
-        && (ch != '-')
-        && (ch != '_') )
-      {
-         /* Probable hack attempt. */
-         return JB_ERR_CGI_PARAMS;
-      }
-   }
-
-   /* Append extension */
-   name_size = len + strlen(suffix) + 1;
-   name = malloc(name_size);
-   if (name == NULL)
-   {
-      return JB_ERR_MEMORY;
-   }
-   strlcpy(name, param, name_size);
-   strlcat(name, suffix, name_size);
-
-   /* Prepend path */
-   fullpath = make_path(csp->config->confdir, name);
-   free(name);
-
-   if (fullpath == NULL)
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   /* Check if the file is known */
-   for (i = 0; i < MAX_AF_FILES; i++)
-   {
-      if (NULL != csp->config->actions_file[i] &&
-          !strcmp(fullpath, csp->config->actions_file[i]))
-      {
-         /* Success */
-         *pfilename = csp->config->actions_file[i];
-         freez(fullpath);
-
-         return JB_ERR_OK;
-      }
-   }
-   freez(fullpath);
-
-   return JB_ERR_CGI_PARAMS;
-}
-
-
-/*********************************************************************
- *
- * Function    :  get_url_spec_param
- *
- * Description :  Get a URL pattern from the parameters
- *                passed to a CGI function.  Removes leading/trailing
- *                spaces and validates it.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  parameters = map of cgi parameters
- *          3  :  name = Name of CGI parameter to read
- *          4  :  pvalue = destination for value.  Will be malloc()'d.
- *                         Set to NULL on error.
- *
- * Returns     :  JB_ERR_OK         on success
- *                JB_ERR_MEMORY     on out-of-memory
- *                JB_ERR_CGI_PARAMS if the parameter was not specified
- *                                  or is not valid.
- *
- *********************************************************************/
-static jb_err get_url_spec_param(struct client_state *csp,
-                                 const struct map *parameters,
-                                 const char *name,
-                                 char **pvalue)
-{
-   const char *orig_param;
-   char *param;
-   char *s;
-   struct url_spec compiled[1];
-   jb_err err;
-
-   assert(csp);
-   assert(parameters);
-   assert(name);
-   assert(pvalue);
-
-   *pvalue = NULL;
-
-   orig_param = lookup(parameters, name);
-   if (!*orig_param)
-   {
-      return JB_ERR_CGI_PARAMS;
-   }
-
-   /* Copy and trim whitespace */
-   param = strdup(orig_param);
-   if (param == NULL)
-   {
-      return JB_ERR_MEMORY;
-   }
-   chomp(param);
-
-   /* Must be non-empty, and can't allow 1st character to be '{' */
-   if (param[0] == '\0' || param[0] == '{')
-   {
-      free(param);
-      return JB_ERR_CGI_PARAMS;
-   }
-
-   /* Check for embedded newlines */
-   for (s = param; *s != '\0'; s++)
-   {
-      if ((*s == '\r') || (*s == '\n'))
-      {
-         free(param);
-         return JB_ERR_CGI_PARAMS;
-      }
-   }
-
-   /* Check that regex is valid */
-   s = strdup(param);
-   if (s == NULL)
-   {
-      free(param);
-      return JB_ERR_MEMORY;
-   }
-   err = create_url_spec(compiled, s);
-   free(s);
-   if (err)
-   {
-      free(param);
-      return (err == JB_ERR_MEMORY) ? JB_ERR_MEMORY : JB_ERR_CGI_PARAMS;
-   }
-   free_url_spec(compiled);
-
-   if (param[strlen(param) - 1] == '\\')
-   {
-      /*
-       * Must protect trailing '\\' from becoming line continuation character.
-       * Two methods: 1) If it's a domain only, add a trailing '/'.
-       * 2) For path, add the do-nothing PCRE expression (?:) to the end
-       */
-      if (strchr(param, '/') == NULL)
-      {
-         err = string_append(&param, "/");
-      }
-      else
-      {
-         err = string_append(&param, "(?:)");
-      }
-      if (err)
-      {
-         return err;
-      }
-
-      /* Check that the modified regex is valid */
-      s = strdup(param);
-      if (s == NULL)
-      {
-         free(param);
-         return JB_ERR_MEMORY;
-      }
-      err = create_url_spec(compiled, s);
-      free(s);
-      if (err)
-      {
-         free(param);
-         return (err == JB_ERR_MEMORY) ? JB_ERR_MEMORY : JB_ERR_CGI_PARAMS;
-      }
-      free_url_spec(compiled);
-   }
-
-   *pvalue = param;
-   return JB_ERR_OK;
-}
-
-/*********************************************************************
- *
- * Function    :  map_radio
- *
- * Description :  Map a set of radio button values.  E.g. if you have
- *                3 radio buttons, declare them as:
- *                  <option type="radio" name="xyz" @xyz-a@>
- *                  <option type="radio" name="xyz" @xyz-b@>
- *                  <option type="radio" name="xyz" @xyz-c@>
- *                Then map one of the @xyz-?@ variables to "checked"
- *                and all the others to empty by calling:
- *                map_radio(exports, "xyz", "abc", sel)
- *                Where 'sel' is 'a', 'b', or 'c'.
- *
- * Parameters  :
- *          1  :  exports = Exports map to modify.
- *          2  :  optionname = name for map
- *          3  :  values = null-terminated list of values;
- *          4  :  value = Selected value.
- *
- * CGI Parameters : None
- *
- * Returns     :  JB_ERR_OK     on success
- *                JB_ERR_MEMORY on out-of-memory
- *
- *********************************************************************/
-static jb_err map_radio(struct map * exports,
-                        const char * optionname,
-                        const char * values,
-                        int value)
-{
-   char * buf;
-   char * p;
-   char c;
-   const size_t len = strlen(optionname);
-   const size_t buf_size = len + 3;
-
-   assert(exports);
-   assert(optionname);
-   assert(values);
-
-   buf = malloc(buf_size);
-   if (buf == NULL)
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   strlcpy(buf, optionname, buf_size);
-
-   /* XXX: this looks ... interesting */
-   p = buf + len;
-   *p++ = '-';
-   p[1] = '\0';
-
-   while ((c = *values++) != '\0')
-   {
-      if (c != value)
-      {
-         *p = c;
-         if (map(exports, buf, 1, "", 1))
-         {
-            return JB_ERR_MEMORY;
-         }
-      }
-   }
-
-   *p = (char)value;
-   return map(exports, buf, 0, "checked", 1);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_error_modified
- *
- * Description :  CGI function that is called when a file is modified
- *                outside the CGI editor.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  filename = The file that was modified.
- *
- * CGI Parameters : none
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.
- *
- *********************************************************************/
-jb_err cgi_error_modified(struct client_state *csp,
-                          struct http_response *rsp,
-                          const char *filename)
-{
-   struct map *exports;
-   jb_err err;
-
-   assert(csp);
-   assert(rsp);
-   assert(filename);
-
-   if (NULL == (exports = default_exports(csp, NULL)))
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   err = map(exports, "f", 1, html_encode(filename), 0);
-   if (err)
-   {
-      free_map(exports);
-      return err;
-   }
-
-   return template_fill_for_cgi(csp, "cgi-error-modified", exports, rsp);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_error_parse
- *
- * Description :  CGI function that is called when a file cannot
- *                be parsed by the CGI editor.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  file = The file that was modified.
- *
- * CGI Parameters : none
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.
- *
- *********************************************************************/
-jb_err cgi_error_parse(struct client_state *csp,
-                       struct http_response *rsp,
-                       struct editable_file *file)
-{
-   struct map *exports;
-   jb_err err;
-   struct file_line *cur_line;
-
-   assert(csp);
-   assert(rsp);
-   assert(file);
-
-   if (NULL == (exports = default_exports(csp, NULL)))
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   err = map(exports, "f", 1, stringify(file->identifier), 0);
-   if (!err) err = map(exports, "parse-error", 1, html_encode(file->parse_error_text), 0);
-
-   cur_line = file->parse_error;
-   assert(cur_line);
-
-   if (!err) err = map(exports, "line-raw", 1, html_encode(cur_line->raw), 0);
-   if (!err) err = map(exports, "line-data", 1, html_encode(cur_line->unprocessed), 0);
-
-   if (err)
-   {
-      free_map(exports);
-      return err;
-   }
-
-   return template_fill_for_cgi(csp, "cgi-error-parse", exports, rsp);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_error_file
- *
- * Description :  CGI function that is called when a file cannot be
- *                opened by the CGI editor.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  filename = The file that was modified.
- *
- * CGI Parameters : none
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.
- *
- *********************************************************************/
-jb_err cgi_error_file(struct client_state *csp,
-                      struct http_response *rsp,
-                      const char *filename)
-{
-   struct map *exports;
-   jb_err err;
-
-   assert(csp);
-   assert(rsp);
-   assert(filename);
-
-   if (NULL == (exports = default_exports(csp, NULL)))
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   err = map(exports, "f", 1, html_encode(filename), 0);
-   if (err)
-   {
-      free_map(exports);
-      return err;
-   }
-
-   return template_fill_for_cgi(csp, "cgi-error-file", exports, rsp);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_error_file_read_only
- *
- * Description :  CGI function that is called when a file cannot be
- *                opened for writing by the CGI editor.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  filename = The file that we can't write to
- *
- * CGI Parameters : none
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.
- *
- *********************************************************************/
-jb_err cgi_error_file_read_only(struct client_state *csp,
-                                struct http_response *rsp,
-                                const char *filename)
-{
-   struct map *exports;
-   jb_err err;
-
-   assert(csp);
-   assert(rsp);
-   assert(filename);
-
-   if (NULL == (exports = default_exports(csp, NULL)))
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   err = map(exports, "f", 1, html_encode(filename), 0);
-   if (err)
-   {
-      free_map(exports);
-      return err;
-   }
-
-   return template_fill_for_cgi(csp, "cgi-error-file-read-only", exports, rsp);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_edit_actions
- *
- * Description :  CGI function that allows the user to choose which
- *                actions file to edit.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters : None
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error
- *
- *********************************************************************/
-jb_err cgi_edit_actions(struct client_state *csp,
-                        struct http_response *rsp,
-                        const struct map *parameters)
-{
-   (void)parameters;
-
-   if (0 == (csp->config->feature_flags & RUNTIME_FEATURE_CGI_EDIT_ACTIONS))
-   {
-      return cgi_error_disabled(csp, rsp);
-   }
-
-   /* FIXME: Incomplete */
-
-   return cgi_redirect(rsp, CGI_PREFIX "edit-actions-list?f=default");
-
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_edit_actions_list
- *
- * Description :  CGI function that edits the actions list.
- *                FIXME: This function shouldn't FATAL ever.
- *                FIXME: This function doesn't check the retval of map()
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters : filename
- *
- * Returns     :  JB_ERR_OK     on success
- *                JB_ERR_MEMORY on out-of-memory
- *                JB_ERR_FILE   if the file cannot be opened or
- *                              contains no data
- *                JB_ERR_CGI_PARAMS if "filename" was not specified
- *                                  or is not valid.
- *
- *********************************************************************/
-jb_err cgi_edit_actions_list(struct client_state *csp,
-                             struct http_response *rsp,
-                             const struct map *parameters)
-{
-   char * section_template;
-   char * url_template;
-   char * sections;
-   char * urls;
-   char buf[150];
-   char * s;
-   struct map * exports;
-   struct map * section_exports;
-   struct map * url_exports;
-   struct editable_file * file;
-   struct file_line * cur_line;
-   unsigned line_number = 0;
-   unsigned prev_section_line_number = ((unsigned) (-1));
-   int i, url_1_2;
-   struct file_list * fl;
-   struct url_actions * b;
-   char * buttons = NULL;
-   jb_err err;
-
-   if (0 == (csp->config->feature_flags & RUNTIME_FEATURE_CGI_EDIT_ACTIONS))
-   {
-      return cgi_error_disabled(csp, rsp);
-   }
-
-   if (NULL == (exports = default_exports(csp, NULL)))
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   /* Load actions file */
-   err = edit_read_actions_file(csp, rsp, parameters, 0, &file);
-   if (err)
-   {
-      /* No filename specified, can't read file, or out of memory. */
-      free_map(exports);
-      return (err == JB_ERR_FILE ? JB_ERR_OK : err);
-   }
-
-   /* Find start of actions in file */
-   cur_line = file->lines;
-   line_number = 1;
-   while ((cur_line != NULL) && (cur_line->type != FILE_LINE_ACTION))
-   {
-      cur_line = cur_line->next;
-      line_number++;
-   }
-
-   /*
-    * Conventional actions files should have a match all block
-    * at the start:
-    * cur_line             = {...global actions...}
-    * cur_line->next       = /
-    * cur_line->next->next = {...actions...} or EOF
-    */
-   if ( (cur_line != NULL)
-     && (cur_line->type == FILE_LINE_ACTION)
-     && (cur_line->next != NULL)
-     && (cur_line->next->type == FILE_LINE_URL)
-     && (0 == strcmp(cur_line->next->unprocessed, "/"))
-     && ( (cur_line->next->next == NULL)
-       || (cur_line->next->next->type != FILE_LINE_URL)
-      ) )
-   {
-      /*
-       * Generate string with buttons to set actions for "/" to
-       * any predefined set of actions (named standard.*, probably
-       * residing in standard.action).
-       */
-
-      err = template_load(csp, &section_template, "edit-actions-list-button", 0);
-      if (err)
-      {
-         edit_free_file(file);
-         free_map(exports);
-         if (err == JB_ERR_FILE)
-         {
-            return cgi_error_no_template(csp, rsp, "edit-actions-list-button");
-         }
-         return err;
-      }
-
-      err = template_fill(&section_template, exports);
-      if (err)
-      {
-         edit_free_file(file);
-         free_map(exports);
-         return err;
-      }
-
-      buttons = strdup("");
-      for (i = 0; i < MAX_AF_FILES; i++)
-      {
-         if (((fl = csp->actions_list[i]) != NULL) && ((b = fl->f) != NULL))
-         {
-            for (b = b->next; NULL != b; b = b->next)
-            {
-               if (!strncmp(b->url->spec, "standard.", 9) && *(b->url->spec + 9) != '\0')
-               {
-                  if (err || (NULL == (section_exports = new_map())))
-                  {
-                     freez(buttons);
-                     free(section_template);
-                     edit_free_file(file);
-                     free_map(exports);
-                     return JB_ERR_MEMORY;
-                  }
-
-                  err = map(section_exports, "button-name", 1, b->url->spec + 9, 1);
-
-                  if (err || (NULL == (s = strdup(section_template))))
-                  {
-                     free_map(section_exports);
-                     freez(buttons);
-                     free(section_template);
-                     edit_free_file(file);
-                     free_map(exports);
-                     return JB_ERR_MEMORY;
-                  }
-
-                  if (!err) err = template_fill(&s, section_exports);
-                  free_map(section_exports);
-                  if (!err) err = string_join(&buttons, s);
-               }
-            }
-         }
-      }
-      freez(section_template);
-      if (!err) err = map(exports, "all-urls-buttons", 1, buttons, 0);
-
-      /*
-       * Conventional actions file, supply extra editing help.
-       * (e.g. don't allow them to make it an unconventional one).
-       */
-      if (!err) err = map_conditional(exports, "all-urls-present", 1);
-
-      snprintf(buf, sizeof(buf), "%d", line_number);
-      if (!err) err = map(exports, "all-urls-s", 1, buf, 1);
-      snprintf(buf, sizeof(buf), "%d", line_number + 2);
-      if (!err) err = map(exports, "all-urls-s-next", 1, buf, 1);
-      if (!err) err = map(exports, "all-urls-actions", 1,
-                          actions_to_html(csp, cur_line->data.action), 0);
-
-       /* Skip the 2 lines */
-      cur_line = cur_line->next->next;
-      line_number += 2;
-
-      /*
-       * Note that prev_section_line_number is NOT set here.
-       * This is deliberate and not a bug.  It stops a "Move up"
-       * option appearing on the next section.  Clicking "Move
-       * up" would make the actions file unconventional, which
-       * we don't want, so we hide this option.
-       */
-   }
-   else
-   {
-      /*
-       * Non-standard actions file - does not begin with
-       * the "All URLs" section.
-       */
-      if (!err) err = map_conditional(exports, "all-urls-present", 0);
-   }
-
-   /* Set up global exports */
-
-   if (!err) err = map(exports, "actions-file", 1, html_encode(file->filename), 0);
-   if (!err) err = map(exports, "f", 1, stringify(file->identifier), 0);
-   if (!err) err = map(exports, "v", 1, file->version_str, 1);
-
-   /* Discourage private additions to default.action */
-
-   if (!err) err = map_conditional(exports, "default-action",
-                                   (strstr("default.action", file->filename) != NULL));
-   if (err)
-   {
-      edit_free_file(file);
-      free_map(exports);
-      return err;
-   }
-
-   /* Should do all global exports above this point */
-
-   /* Load templates */
-
-   err = template_load(csp, &section_template, "edit-actions-list-section", 0);
-   if (err)
-   {
-      edit_free_file(file);
-      free_map(exports);
-      if (err == JB_ERR_FILE)
-      {
-         return cgi_error_no_template(csp, rsp, "edit-actions-list-section");
-      }
-      return err;
-   }
-
-   err = template_load(csp, &url_template, "edit-actions-list-url", 0);
-   if (err)
-   {
-      free(section_template);
-      edit_free_file(file);
-      free_map(exports);
-      if (err == JB_ERR_FILE)
-      {
-         return cgi_error_no_template(csp, rsp, "edit-actions-list-url");
-      }
-      return err;
-   }
-
-   err = template_fill(&section_template, exports);
-   if (err)
-   {
-      free(url_template);
-      edit_free_file(file);
-      free_map(exports);
-      return err;
-   }
-
-   err = template_fill(&url_template, exports);
-   if (err)
-   {
-      free(section_template);
-      edit_free_file(file);
-      free_map(exports);
-      return err;
-   }
-
-   if (NULL == (sections = strdup("")))
-   {
-      free(section_template);
-      free(url_template);
-      edit_free_file(file);
-      free_map(exports);
-      return JB_ERR_MEMORY;
-   }
-
-   while ((cur_line != NULL) && (cur_line->type == FILE_LINE_ACTION))
-   {
-      if (NULL == (section_exports = new_map()))
-      {
-         free(sections);
-         free(section_template);
-         free(url_template);
-         edit_free_file(file);
-         free_map(exports);
-         return JB_ERR_MEMORY;
-      }
-
-      snprintf(buf, sizeof(buf), "%d", line_number);
-      err = map(section_exports, "s", 1, buf, 1);
-      if (!err) err = map(section_exports, "actions", 1,
-                          actions_to_html(csp, cur_line->data.action), 0);
-
-      if ( (!err)
-        && (cur_line->next != NULL)
-        && (cur_line->next->type == FILE_LINE_URL))
-      {
-         /* This section contains at least one URL, don't allow delete */
-         err = map_block_killer(section_exports, "empty-section");
-      }
-      else
-      {
-         if (!err) err = map_block_keep(section_exports, "empty-section");
-      }
-
-      if (prev_section_line_number != ((unsigned)(-1)))
-      {
-         /* Not last section */
-         snprintf(buf, sizeof(buf), "%d", prev_section_line_number);
-         if (!err) err = map(section_exports, "s-prev", 1, buf, 1);
-         if (!err) err = map_block_keep(section_exports, "s-prev-exists");
-      }
-      else
-      {
-         /* Last section */
-         if (!err) err = map_block_killer(section_exports, "s-prev-exists");
-      }
-      prev_section_line_number = line_number;
-
-      if (err)
-      {
-         free(sections);
-         free(section_template);
-         free(url_template);
-         edit_free_file(file);
-         free_map(exports);
-         free_map(section_exports);
-         return err;
-      }
-
-      /* Should do all section-specific exports above this point */
-
-      if (NULL == (urls = strdup("")))
-      {
-         free(sections);
-         free(section_template);
-         free(url_template);
-         edit_free_file(file);
-         free_map(exports);
-         free_map(section_exports);
-         return JB_ERR_MEMORY;
-      }
-
-      url_1_2 = 2;
-
-      cur_line = cur_line->next;
-      line_number++;
-
-      while ((cur_line != NULL) && (cur_line->type == FILE_LINE_URL))
-      {
-         if (NULL == (url_exports = new_map()))
-         {
-            free(urls);
-            free(sections);
-            free(section_template);
-            free(url_template);
-            edit_free_file(file);
-            free_map(exports);
-            free_map(section_exports);
-            return JB_ERR_MEMORY;
-         }
-
-         snprintf(buf, sizeof(buf), "%d", line_number);
-         err = map(url_exports, "p", 1, buf, 1);
-
-         snprintf(buf, sizeof(buf), "%d", url_1_2);
-         if (!err) err = map(url_exports, "url-1-2", 1, buf, 1);
-
-         if (!err) err = map(url_exports, "url-html", 1,
-                             html_encode(cur_line->unprocessed), 0);
-         if (!err) err = map(url_exports, "url", 1,
-                             url_encode(cur_line->unprocessed), 0);
-
-         if (err)
-         {
-            free(urls);
-            free(sections);
-            free(section_template);
-            free(url_template);
-            edit_free_file(file);
-            free_map(exports);
-            free_map(section_exports);
-            free_map(url_exports);
-            return err;
-         }
-
-         if (NULL == (s = strdup(url_template)))
-         {
-            free(urls);
-            free(sections);
-            free(section_template);
-            free(url_template);
-            edit_free_file(file);
-            free_map(exports);
-            free_map(section_exports);
-            free_map(url_exports);
-            return JB_ERR_MEMORY;
-         }
-
-         err = template_fill(&s, section_exports);
-         if (!err) err = template_fill(&s, url_exports);
-         if (!err) err = string_append(&urls, s);
-
-         free_map(url_exports);
-         freez(s);
-
-         if (err)
-         {
-            freez(urls);
-            free(sections);
-            free(section_template);
-            free(url_template);
-            edit_free_file(file);
-            free_map(exports);
-            free_map(section_exports);
-            return err;
-         }
-
-         url_1_2 = 3 - url_1_2;
-
-         cur_line = cur_line->next;
-         line_number++;
-      }
-
-      err = map(section_exports, "urls", 1, urls, 0);
-
-      /* Could also do section-specific exports here, but it wouldn't be as fast */
-
-      snprintf(buf, sizeof(buf), "%d", line_number);
-      if (!err) err = map(section_exports, "s-next", 1, buf, 1);
-
-      if ( (cur_line != NULL)
-        && (cur_line->type == FILE_LINE_ACTION))
-      {
-         /* Not last section */
-         if (!err) err = map_block_keep(section_exports, "s-next-exists");
-      }
-      else
-      {
-         /* Last section */
-         if (!err) err = map_block_killer(section_exports, "s-next-exists");
-      }
-
-      if (err)
-      {
-         free(sections);
-         free(section_template);
-         free(url_template);
-         edit_free_file(file);
-         free_map(exports);
-         free_map(section_exports);
-         return err;
-      }
-
-      if (NULL == (s = strdup(section_template)))
-      {
-         free(sections);
-         free(section_template);
-         free(url_template);
-         edit_free_file(file);
-         free_map(exports);
-         free_map(section_exports);
-         return JB_ERR_MEMORY;
-      }
-
-      err = template_fill(&s, section_exports);
-      if (!err) err = string_append(&sections, s);
-
-      freez(s);
-      free_map(section_exports);
-
-      if (err)
-      {
-         freez(sections);
-         free(section_template);
-         free(url_template);
-         edit_free_file(file);
-         free_map(exports);
-         return err;
-      }
-   }
-
-   edit_free_file(file);
-   free(section_template);
-   free(url_template);
-
-   err = map(exports, "sections", 1, sections, 0);
-   if (err)
-   {
-      free_map(exports);
-      return err;
-   }
-
-   /* Could also do global exports here, but it wouldn't be as fast */
-
-   return template_fill_for_cgi(csp, "edit-actions-list", exports, rsp);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_edit_actions_for_url
- *
- * Description :  CGI function that edits the Actions list.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters : None
- *
- * Returns     :  JB_ERR_OK     on success
- *                JB_ERR_MEMORY on out-of-memory
- *                JB_ERR_CGI_PARAMS if the CGI parameters are not
- *                                  specified or not valid.
- *
- *********************************************************************/
-jb_err cgi_edit_actions_for_url(struct client_state *csp,
-                                struct http_response *rsp,
-                                const struct map *parameters)
-{
-   struct map * exports;
-   unsigned sectionid;
-   struct editable_file * file;
-   struct file_line * cur_line;
-   unsigned line_number;
-   jb_err err;
-   struct re_filterfile_spec *filter_group;
-   int i, have_filters = 0;
-
-   if (0 == (csp->config->feature_flags & RUNTIME_FEATURE_CGI_EDIT_ACTIONS))
-   {
-      return cgi_error_disabled(csp, rsp);
-   }
-
-   err = get_number_param(csp, parameters, "s", &sectionid);
-   if (err)
-   {
-      return err;
-   }
-
-   err = edit_read_actions_file(csp, rsp, parameters, 1, &file);
-   if (err)
-   {
-      /* No filename specified, can't read file, modified, or out of memory. */
-      return (err == JB_ERR_FILE ? JB_ERR_OK : err);
-   }
-
-   cur_line = file->lines;
-
-   for (line_number = 1; (cur_line != NULL) && (line_number < sectionid); line_number++)
-   {
-      cur_line = cur_line->next;
-   }
-
-   if ( (cur_line == NULL)
-     || (line_number != sectionid)
-     || (sectionid < 1)
-     || (cur_line->type != FILE_LINE_ACTION))
-   {
-      /* Invalid "sectionid" parameter */
-      edit_free_file(file);
-      return JB_ERR_CGI_PARAMS;
-   }
-
-   if (NULL == (exports = default_exports(csp, NULL)))
-   {
-      edit_free_file(file);
-      return JB_ERR_MEMORY;
-   }
-
-   err = map(exports, "f", 1, stringify(file->identifier), 0);
-   if (!err) err = map(exports, "v", 1, file->version_str, 1);
-   if (!err) err = map(exports, "s", 1, url_encode(lookup(parameters, "s")), 0);
-
-   if (!err) err = actions_to_radio(exports, cur_line->data.action);
-
-   /*
-    * XXX: Some browsers (at least IE6 and IE7) have an artifical URL
-    * length limitation and ignore clicks on the Submit buttons if
-    * the resulting GET URL would be longer than their limit.
-    *
-    * In Privoxy 3.0.5 beta the standard edit-actions-for-url template
-    * reached this limit and action editing stopped working in these
-    * browsers (BR #1570678).
-    *
-    * The config option split-large-forms works around this browser
-    * bug (HTTP has no URL lenght limitation) by deviding the action
-    * list form into multiple smaller ones. It means the URLs are shorter
-    * and work in broken browsers as well, but the user can no longer change
-    * all actions with one submit.
-    *
-    * A better solution would be to switch to POST requests,
-    * but this will do for now.
-    */
-   if(!err && (csp->config->feature_flags & RUNTIME_FEATURE_SPLIT_LARGE_FORMS))
-   {
-      /* Generate multiple smaller form by killing the big one. */
-      err = map_block_killer(exports, "one-form-only");
-   }
-   else
-   {
-      /* Default: Generate one large form by killing the smaller ones. */
-      err = map_block_killer(exports, "multiple-forms");
-   }
-
-   for (i = 0; i < MAX_AF_FILES; i++)
-   {
-      if ((csp->rlist[i] != NULL) && (csp->rlist[i]->f != NULL))
-      {
-         if (!err) err = map_conditional(exports, "any-filters-defined", 1);
-         have_filters = 1;
-         break;
-      }
-   }
-
-   if (err)
-   {
-      edit_free_file(file);
-      free_map(exports);
-      return err;
-   }
-
-   if (0 == have_filters)
-   {
-      err = map(exports, "filter-params", 1, "", 1);
-   }
-   else
-   {
-      /*
-       * List available filters and their settings.
-       */
-      char *filter_template;
-      int filter_identifier = 0;
-      char *prepared_templates[MAX_FILTER_TYPES];
-
-      for (i = 0; i < MAX_FILTER_TYPES; i++)
-      {
-         prepared_templates[i] = strdup("");
-      }
-
-      err = template_load(csp, &filter_template, "edit-actions-for-url-filter", 0);
-      if (err)
-      {
-         edit_free_file(file);
-         free_map(exports);
-         if (err == JB_ERR_FILE)
-         {
-            return cgi_error_no_template(csp, rsp, "edit-actions-for-url-filter");
-         }
-         return err;
-      }
-
-      err = template_fill(&filter_template, exports);
-
-      for (i = 0; i < MAX_AF_FILES; i++)
-      {
-         if ((csp->rlist[i] != NULL) && (csp->rlist[i]->f != NULL))
-         {
-            filter_group = csp->rlist[i]->f;
-            for (;(!err) && (filter_group != NULL); filter_group = filter_group->next)
-            {
-               char current_mode = 'x';
-               char number[20];
-               struct list_entry *filter_name;
-               struct map *line_exports;
-               const int type = filter_group->type;
-               const int multi_action_index = filter_type_info[type].multi_action_index;
-
-               assert(type < MAX_FILTER_TYPES);
-
-               filter_name = cur_line->data.action->multi_add[multi_action_index]->first;
-               while ((filter_name != NULL)
-                   && (0 != strcmp(filter_group->name, filter_name->str)))
-               {
-                    filter_name = filter_name->next;
-               }
-
-               if (filter_name != NULL)
-               {
-                  current_mode = 'y';
-               }
-               else
-               {
-                  filter_name = cur_line->data.action->multi_remove[multi_action_index]->first;
-                  while ((filter_name != NULL)
-                      && (0 != strcmp(filter_group->name, filter_name->str)))
-                  {
-                       filter_name = filter_name->next;
-                  }
-                  if (filter_name != NULL)
-                  {
-                     current_mode = 'n';
-                  }
-               }
-
-               /* Generate a unique serial number */
-               snprintf(number, sizeof(number), "%x", filter_identifier++);
-               number[sizeof(number) - 1] = '\0';
-
-               line_exports = new_map();
-               if (line_exports == NULL)
-               {
-                  err = JB_ERR_MEMORY;
-               }
-               else
-               {
-                  char *filter_line;
-
-                  if (!err) err = map(line_exports, "index", 1, number, 1);
-                  if (!err) err = map(line_exports, "name",  1, filter_group->name, 1);
-                  if (!err) err = map(line_exports, "description",  1, filter_group->description, 1);
-                  if (!err) err = map_radio(line_exports, "this-filter", "ynx", current_mode);
-                  if (!err) err = map(line_exports, "filter-type", 1, filter_type_info[type].type, 1);
-                  if (!err) err = map(line_exports, "abbr-filter-type", 1, filter_type_info[type].abbr_type, 1);
-                  if (!err) err = map(line_exports, "anchor", 1, filter_type_info[type].anchor, 1);
-
-                  if (!err)
-                  {
-                     filter_line = strdup(filter_template);
-                     if (filter_line == NULL) err = JB_ERR_MEMORY;
-                  }
-                  if (!err) err = template_fill(&filter_line, line_exports);
-                  string_join(&prepared_templates[type], filter_line);
-
-                  free_map(line_exports);
-               }
-            }
-         }
-      }
-      freez(filter_template);
-
-      /* Replace all filter macros with the aggregated templates */
-      for (i = 0; i < MAX_FILTER_TYPES; i++)
-      {
-         if (err) break;
-         err = map(exports, filter_type_info[i].macro_name, 1, prepared_templates[i], 0);
-      }
-
-      if (err)
-      {
-         /* Free aggregated templates */
-         for (i = 0; i < MAX_FILTER_TYPES; i++)
-         {
-            freez(prepared_templates[i]);
-         }
-      }
-   }
-
-   /* Check or uncheck the "disable all of this type" radio buttons. */
-   for (i = 0; i < MAX_FILTER_TYPES; i++)
-   {
-      const int a = filter_type_info[i].multi_action_index;
-      const int disable_all = cur_line->data.action->multi_remove_all[a];
-      if (err) break;
-      err = map_radio(exports, filter_type_info[i].disable_all_option, "nx", (disable_all ? 'n' : 'x'));
-   }
-
-   edit_free_file(file);
-
-   if (err)
-   {
-      free_map(exports);
-      return err;
-   }
-
-   return template_fill_for_cgi(csp, "edit-actions-for-url", exports, rsp);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_edit_actions_submit
- *
- * Description :  CGI function that actually edits the Actions list.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters : None
- *
- * Returns     :  JB_ERR_OK     on success
- *                JB_ERR_MEMORY on out-of-memory
- *                JB_ERR_CGI_PARAMS if the CGI parameters are not
- *                                  specified or not valid.
- *
- *********************************************************************/
-jb_err cgi_edit_actions_submit(struct client_state *csp,
-                               struct http_response *rsp,
-                               const struct map *parameters)
-{
-   unsigned sectionid;
-   char * actiontext;
-   char * newtext;
-   size_t newtext_size;
-   size_t len;
-   struct editable_file * file;
-   struct file_line * cur_line;
-   unsigned line_number;
-   char target[1024];
-   jb_err err;
-   int filter_identifier;
-   int i;
-   const char * action_set_name;
-   struct file_list * fl;
-   struct url_actions * b;
-
-   if (0 == (csp->config->feature_flags & RUNTIME_FEATURE_CGI_EDIT_ACTIONS))
-   {
-      return cgi_error_disabled(csp, rsp);
-   }
-
-   err = get_number_param(csp, parameters, "s", &sectionid);
-   if (err)
-   {
-      return err;
-   }
-
-   err = edit_read_actions_file(csp, rsp, parameters, 1, &file);
-   if (err)
-   {
-      /* No filename specified, can't read file, modified, or out of memory. */
-      return (err == JB_ERR_FILE ? JB_ERR_OK : err);
-   }
-
-   cur_line = file->lines;
-
-   for (line_number = 1; (cur_line != NULL) && (line_number < sectionid); line_number++)
-   {
-      cur_line = cur_line->next;
-   }
-
-   if ( (cur_line == NULL)
-     || (line_number != sectionid)
-     || (sectionid < 1)
-     || (cur_line->type != FILE_LINE_ACTION))
-   {
-      /* Invalid "sectionid" parameter */
-      edit_free_file(file);
-      return JB_ERR_CGI_PARAMS;
-   }
-
-   get_string_param(parameters, "p", &action_set_name);
-   if (action_set_name != NULL)
-   {
-      for (filter_identifier = 0; filter_identifier < MAX_AF_FILES; filter_identifier++)
-      {
-         if (((fl = csp->actions_list[filter_identifier]) != NULL) && ((b = fl->f) != NULL))
-         {
-            for (b = b->next; NULL != b; b = b->next)
-            {
-               if (!strncmp(b->url->spec, "standard.", 9) && !strcmp(b->url->spec + 9, action_set_name))
-               {
-                  copy_action(cur_line->data.action, b->action);
-                  goto found;
-               }
-            }
-         }
-      }
-      edit_free_file(file);
-      return JB_ERR_CGI_PARAMS;
-
-      found: ;
-   }
-   else
-   {
-      err = actions_from_radio(parameters, cur_line->data.action);
-   }
-
-   if (err)
-   {
-      /* Out of memory */
-      edit_free_file(file);
-      return err;
-   }
-
-   /* Check the "disable all of this type" parameters. */
-   for (i = 0; i < MAX_FILTER_TYPES; i++)
-   {
-      const int multi_action_index = filter_type_info[i].multi_action_index;
-      const char ch = get_char_param(parameters, filter_type_info[i].disable_all_param);
-
-      if (ch == 'N')
-      {
-         list_remove_all(cur_line->data.action->multi_add[multi_action_index]);
-         list_remove_all(cur_line->data.action->multi_remove[multi_action_index]);
-         cur_line->data.action->multi_remove_all[multi_action_index] = 1;
-      }
-      else if (ch == 'X')
-      {
-         cur_line->data.action->multi_remove_all[multi_action_index] = 0;
-      }
-   }
-
-   for (filter_identifier = 0; !err; filter_identifier++)
-   {
-      char key_value[30];
-      char key_name[30];
-      char key_type[30];
-      const char *name;
-      char value; /*
-                   * Filter state. Valid states are: 'Y' (active),
-                   * 'N' (inactive) and 'X' (no change).
-                   * XXX: bad name.
-                   */
-      char type;  /*
-                   * Abbreviated filter type. Valid types are: 'F' (content filter),
-                   * 'S' (server-header filter) and 'C' (client-header filter).
-                   */
-      int multi_action_index = 0;
-
-      /* Generate the keys */
-      snprintf(key_value, sizeof(key_value), "filter_r%x", filter_identifier);
-      key_value[sizeof(key_value) - 1] = '\0'; /* XXX: Why? */
-      snprintf(key_name, sizeof(key_name), "filter_n%x", filter_identifier);
-      key_name[sizeof(key_name) - 1] = '\0'; /* XXX: Why? */
-      snprintf(key_type, sizeof(key_type), "filter_t%x", filter_identifier);
-
-      err = get_string_param(parameters, key_name, &name);
-      if (err) break;
-
-      if (name == NULL)
-      {
-         /* End of list */
-         break;
-      }
-
-      type = get_char_param(parameters, key_type);
-      switch (type)
-      {
-         case 'F':
-            multi_action_index = ACTION_MULTI_FILTER;
-            break;
-         case 'S':
-            multi_action_index = ACTION_MULTI_SERVER_HEADER_FILTER;
-            break;
-         case 'C':
-            multi_action_index = ACTION_MULTI_CLIENT_HEADER_FILTER;
-            break;
-         case 'L':
-            multi_action_index = ACTION_MULTI_CLIENT_HEADER_TAGGER;
-            break;
-         case 'E':
-            multi_action_index = ACTION_MULTI_SERVER_HEADER_TAGGER;
-            break;
-         default:
-            log_error(LOG_LEVEL_ERROR,
-               "Unknown filter type: %c for filter %s. Filter ignored.", type, name);
-            continue;
-      }
-      assert(multi_action_index);
-
-      value = get_char_param(parameters, key_value);
-      if (value == 'Y')
-      {
-         list_remove_item(cur_line->data.action->multi_add[multi_action_index], name);
-         if (!err) err = enlist(cur_line->data.action->multi_add[multi_action_index], name);
-         list_remove_item(cur_line->data.action->multi_remove[multi_action_index], name);
-      }
-      else if (value == 'N')
-      {
-         list_remove_item(cur_line->data.action->multi_add[multi_action_index], name);
-         if (!cur_line->data.action->multi_remove_all[multi_action_index])
-         {
-            list_remove_item(cur_line->data.action->multi_remove[multi_action_index], name);
-            if (!err) err = enlist(cur_line->data.action->multi_remove[multi_action_index], name);
-         }
-      }
-      else if (value == 'X')
-      {
-         list_remove_item(cur_line->data.action->multi_add[multi_action_index], name);
-         list_remove_item(cur_line->data.action->multi_remove[multi_action_index], name);
-      }
-   }
-
-   if(err)
-   {
-      /* Out of memory */
-      edit_free_file(file);
-      return err;
-   }
-
-   if (NULL == (actiontext = actions_to_text(cur_line->data.action)))
-   {
-      /* Out of memory */
-      edit_free_file(file);
-      return JB_ERR_MEMORY;
-   }
-
-   len = strlen(actiontext);
-   if (len == 0)
-   {
-      /*
-       * Empty action - must special-case this.
-       * Simply setting len to 1 is sufficient...
-       */
-      len = 1;
-   }
-
-   newtext_size = len + 2;
-   if (NULL == (newtext = malloc(newtext_size)))
-   {
-      /* Out of memory */
-      free(actiontext);
-      edit_free_file(file);
-      return JB_ERR_MEMORY;
-   }
-   strlcpy(newtext, actiontext, newtext_size);
-   free(actiontext);
-   newtext[0]       = '{';
-   newtext[len]     = '}';
-   newtext[len + 1] = '\0';
-
-   freez(cur_line->raw);
-   freez(cur_line->unprocessed);
-   cur_line->unprocessed = newtext;
-
-   err = edit_write_file(file);
-   if (err)
-   {
-      /* Error writing file */
-      if (err == JB_ERR_FILE)
-      {
-         /* Read-only file. */
-         err = cgi_error_file_read_only(csp, rsp, file->filename);
-      }
-      edit_free_file(file);
-      return err;
-   }
-
-   snprintf(target, sizeof(target), CGI_PREFIX "edit-actions-list?foo=%lu&f=%i#l%d",
-            (long) time(NULL), file->identifier, sectionid);
-
-   edit_free_file(file);
-
-   return cgi_redirect(rsp, target);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_edit_actions_url
- *
- * Description :  CGI function that actually edits a URL pattern in
- *                an actions file.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters :
- *    filename : Identifies the file to edit
- *         ver : File's last-modified time
- *     section : Line number of section to edit
- *     pattern : Line number of pattern to edit
- *      newval : New value for pattern
- *
- * Returns     :  JB_ERR_OK     on success
- *                JB_ERR_MEMORY on out-of-memory
- *                JB_ERR_CGI_PARAMS if the CGI parameters are not
- *                                  specified or not valid.
- *
- *********************************************************************/
-jb_err cgi_edit_actions_url(struct client_state *csp,
-                            struct http_response *rsp,
-                            const struct map *parameters)
-{
-   unsigned patternid;
-   char * new_pattern;
-   struct editable_file * file;
-   struct file_line * cur_line;
-   unsigned line_number;
-   unsigned section_start_line_number = 0;
-   char target[1024];
-   jb_err err;
-
-   assert(csp);
-   assert(rsp);
-   assert(parameters);
-
-   if (0 == (csp->config->feature_flags & RUNTIME_FEATURE_CGI_EDIT_ACTIONS))
-   {
-      return cgi_error_disabled(csp, rsp);
-   }
-
-   err = get_number_param(csp, parameters, "p", &patternid);
-   if (err)
-   {
-      return err;
-   }
-   if (patternid < 1U)
-   {
-      return JB_ERR_CGI_PARAMS;
-   }
-
-   err = get_url_spec_param(csp, parameters, "u", &new_pattern);
-   if (err)
-   {
-      return err;
-   }
-
-   err = edit_read_actions_file(csp, rsp, parameters, 1, &file);
-   if (err)
-   {
-      /* No filename specified, can't read file, modified, or out of memory. */
-      free(new_pattern);
-      return (err == JB_ERR_FILE ? JB_ERR_OK : err);
-   }
-
-   line_number = 1;
-   cur_line = file->lines;
-
-   while ((cur_line != NULL) && (line_number < patternid))
-   {
-      if (cur_line->type == FILE_LINE_ACTION)
-      {
-         section_start_line_number = line_number;
-      }      
-      cur_line = cur_line->next;
-      line_number++;
-   }
-
-   if ( (cur_line == NULL)
-     || (cur_line->type != FILE_LINE_URL))
-   {
-      /* Invalid "patternid" parameter */
-      free(new_pattern);
-      edit_free_file(file);
-      return JB_ERR_CGI_PARAMS;
-   }
-
-   /* At this point, the line to edit is in cur_line */
-
-   freez(cur_line->raw);
-   freez(cur_line->unprocessed);
-   cur_line->unprocessed = new_pattern;
-
-   err = edit_write_file(file);
-   if (err)
-   {
-      /* Error writing file */
-      if (err == JB_ERR_FILE)
-      {
-         /* Read-only file. */
-         err = cgi_error_file_read_only(csp, rsp, file->filename);
-      }
-      edit_free_file(file);
-      return err;
-   }
-
-   snprintf(target, sizeof(target), CGI_PREFIX "edit-actions-list?foo=%lu&f=%i#l%d",
-            (long) time(NULL), file->identifier, section_start_line_number);
-
-   edit_free_file(file);
-
-   return cgi_redirect(rsp, target);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_edit_actions_add_url
- *
- * Description :  CGI function that actually adds a URL pattern to
- *                an actions file.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters :
- *    filename : Identifies the file to edit
- *         ver : File's last-modified time
- *     section : Line number of section to edit
- *      newval : New pattern
- *
- * Returns     :  JB_ERR_OK     on success
- *                JB_ERR_MEMORY on out-of-memory
- *                JB_ERR_CGI_PARAMS if the CGI parameters are not
- *                                  specified or not valid.
- *
- *********************************************************************/
-jb_err cgi_edit_actions_add_url(struct client_state *csp,
-                                struct http_response *rsp,
-                                const struct map *parameters)
-{
-   unsigned sectionid;
-   char * new_pattern;
-   struct file_line * new_line;
-   struct editable_file * file;
-   struct file_line * cur_line;
-   unsigned line_number;
-   char target[1024];
-   jb_err err;
-
-   if (0 == (csp->config->feature_flags & RUNTIME_FEATURE_CGI_EDIT_ACTIONS))
-   {
-      return cgi_error_disabled(csp, rsp);
-   }
-
-   err = get_number_param(csp, parameters, "s", &sectionid);
-   if (err)
-   {
-      return err;
-   }
-   if (sectionid < 1U)
-   {
-      return JB_ERR_CGI_PARAMS;
-   }
-
-   err = get_url_spec_param(csp, parameters, "u", &new_pattern);
-   if (err)
-   {
-      return err;
-   }
-
-   err = edit_read_actions_file(csp, rsp, parameters, 1, &file);
-   if (err)
-   {
-      /* No filename specified, can't read file, modified, or out of memory. */
-      free(new_pattern);
-      return (err == JB_ERR_FILE ? JB_ERR_OK : err);
-   }
-
-   line_number = 1;
-   cur_line = file->lines;
-
-   while ((cur_line != NULL) && (line_number < sectionid))
-   {
-      cur_line = cur_line->next;
-      line_number++;
-   }
-
-   if ( (cur_line == NULL)
-     || (cur_line->type != FILE_LINE_ACTION))
-   {
-      /* Invalid "sectionid" parameter */
-      free(new_pattern);
-      edit_free_file(file);
-      return JB_ERR_CGI_PARAMS;
-   }
-
-   /* At this point, the section header is in cur_line - add after this. */
-
-   /* Allocate the new line */
-   new_line = (struct file_line *)zalloc(sizeof(*new_line));
-   if (new_line == NULL)
-   {
-      free(new_pattern);
-      edit_free_file(file);
-      return JB_ERR_MEMORY;
-   }
-
-   /* Fill in the data members of the new line */
-   new_line->raw = NULL;
-   new_line->prefix = NULL;
-   new_line->unprocessed = new_pattern;
-   new_line->type = FILE_LINE_URL;
-
-   /* Link new_line into the list, after cur_line */
-   new_line->next = cur_line->next;
-   cur_line->next = new_line;
-
-   /* Done making changes, now commit */
-
-   err = edit_write_file(file);
-   if (err)
-   {
-      /* Error writing file */
-      if (err == JB_ERR_FILE)
-      {
-         /* Read-only file. */
-         err = cgi_error_file_read_only(csp, rsp, file->filename);
-      }
-      edit_free_file(file);
-      return err;
-   }
-
-   snprintf(target, sizeof(target), CGI_PREFIX "edit-actions-list?foo=%lu&f=%i#l%d",
-            (long) time(NULL), file->identifier, sectionid);
-
-   edit_free_file(file);
-
-   return cgi_redirect(rsp, target);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_edit_actions_remove_url
- *
- * Description :  CGI function that actually removes a URL pattern from
- *                the actions file.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters :
- *           f : (filename) Identifies the file to edit
- *           v : (version) File's last-modified time
- *           p : (pattern) Line number of pattern to remove
- *
- * Returns     :  JB_ERR_OK     on success
- *                JB_ERR_MEMORY on out-of-memory
- *                JB_ERR_CGI_PARAMS if the CGI parameters are not
- *                                  specified or not valid.
- *
- *********************************************************************/
-jb_err cgi_edit_actions_remove_url(struct client_state *csp,
-                                   struct http_response *rsp,
-                                   const struct map *parameters)
-{
-   unsigned patternid;
-   struct editable_file * file;
-   struct file_line * cur_line;
-   struct file_line * prev_line;
-   unsigned line_number;
-   unsigned section_start_line_number = 0;
-   char target[1024];
-   jb_err err;
-
-   if (0 == (csp->config->feature_flags & RUNTIME_FEATURE_CGI_EDIT_ACTIONS))
-   {
-      return cgi_error_disabled(csp, rsp);
-   }
-
-   err = get_number_param(csp, parameters, "p", &patternid);
-   if (err)
-   {
-      return err;
-   }
-
-   err = edit_read_actions_file(csp, rsp, parameters, 1, &file);
-   if (err)
-   {
-      /* No filename specified, can't read file, modified, or out of memory. */
-      return (err == JB_ERR_FILE ? JB_ERR_OK : err);
-   }
-
-   line_number = 1;
-   prev_line = NULL;
-   cur_line = file->lines;
-
-   while ((cur_line != NULL) && (line_number < patternid))
-   {
-      if (cur_line->type == FILE_LINE_ACTION)
-      {
-         section_start_line_number = line_number;
-      }
-      prev_line = cur_line;
-      cur_line = cur_line->next;
-      line_number++;
-   }
-
-   if ( (cur_line == NULL)
-     || (prev_line == NULL)
-     || (cur_line->type != FILE_LINE_URL))
-   {
-      /* Invalid "patternid" parameter */
-      edit_free_file(file);
-      return JB_ERR_CGI_PARAMS;
-   }
-
-   /* At this point, the line to remove is in cur_line, and the previous
-    * one is in prev_line
-    */
-
-   /* Unlink cur_line */
-   prev_line->next = cur_line->next;
-   cur_line->next = NULL;
-
-   /* Free cur_line */
-   edit_free_file_lines(cur_line);
-
-   err = edit_write_file(file);
-   if (err)
-   {
-      /* Error writing file */
-      if (err == JB_ERR_FILE)
-      {
-         /* Read-only file. */
-         err = cgi_error_file_read_only(csp, rsp, file->filename);
-      }
-      edit_free_file(file);
-      return err;
-   }
-
-   snprintf(target, sizeof(target), CGI_PREFIX "edit-actions-list?foo=%lu&f=%i#l%d",
-            (long) time(NULL), file->identifier, section_start_line_number);
-
-   edit_free_file(file);
-
-   return cgi_redirect(rsp, target);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_edit_actions_section_remove
- *
- * Description :  CGI function that actually removes a whole section from
- *                the actions file.  The section must be empty first
- *                (else JB_ERR_CGI_PARAMS).
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters :
- *           f : (filename) Identifies the file to edit
- *           v : (version) File's last-modified time
- *           s : (section) Line number of section to edit
- *
- * Returns     :  JB_ERR_OK     on success
- *                JB_ERR_MEMORY on out-of-memory
- *                JB_ERR_CGI_PARAMS if the CGI parameters are not
- *                                  specified or not valid.
- *
- *********************************************************************/
-jb_err cgi_edit_actions_section_remove(struct client_state *csp,
-                                       struct http_response *rsp,
-                                       const struct map *parameters)
-{
-   unsigned sectionid;
-   struct editable_file * file;
-   struct file_line * cur_line;
-   struct file_line * prev_line;
-   unsigned line_number;
-   char target[1024];
-   jb_err err;
-
-   if (0 == (csp->config->feature_flags & RUNTIME_FEATURE_CGI_EDIT_ACTIONS))
-   {
-      return cgi_error_disabled(csp, rsp);
-   }
-
-   err = get_number_param(csp, parameters, "s", &sectionid);
-   if (err)
-   {
-      return err;
-   }
-
-   err = edit_read_actions_file(csp, rsp, parameters, 1, &file);
-   if (err)
-   {
-      /* No filename specified, can't read file, modified, or out of memory. */
-      return (err == JB_ERR_FILE ? JB_ERR_OK : err);
-   }
-
-   line_number = 1;
-   cur_line = file->lines;
-
-   prev_line = NULL;
-   while ((cur_line != NULL) && (line_number < sectionid))
-   {
-      prev_line = cur_line;
-      cur_line = cur_line->next;
-      line_number++;
-   }
-
-   if ( (cur_line == NULL)
-     || (cur_line->type != FILE_LINE_ACTION) )
-   {
-      /* Invalid "sectionid" parameter */
-      edit_free_file(file);
-      return JB_ERR_CGI_PARAMS;
-   }
-
-   if ( (cur_line->next != NULL)
-     && (cur_line->next->type == FILE_LINE_URL) )
-   {
-      /* Section not empty. */
-      edit_free_file(file);
-      return JB_ERR_CGI_PARAMS;
-   }
-
-   /* At this point, the line to remove is in cur_line, and the previous
-    * one is in prev_line
-    */
-
-   /* Unlink cur_line */
-   if (prev_line == NULL)
-   {
-      /* Removing the first line from the file */
-      file->lines = cur_line->next;
-   }
-   else
-   {
-      prev_line->next = cur_line->next;
-   }
-   cur_line->next = NULL;
-
-   /* Free cur_line */
-   edit_free_file_lines(cur_line);
-
-   err = edit_write_file(file);
-   if (err)
-   {
-      /* Error writing file */
-      if (err == JB_ERR_FILE)
-      {
-         /* Read-only file. */
-         err = cgi_error_file_read_only(csp, rsp, file->filename);
-      }
-      edit_free_file(file);
-      return err;
-   }
-
-   snprintf(target, sizeof(target), CGI_PREFIX "edit-actions-list?foo=%lu&f=%i",
-            (long) time(NULL), file->identifier);
-
-   edit_free_file(file);
-
-   return cgi_redirect(rsp, target);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_edit_actions_section_add
- *
- * Description :  CGI function that adds a new empty section to
- *                an actions file.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters :
- *           f : (filename) Identifies the file to edit
- *           v : (version) File's last-modified time
- *           s : (section) Line number of section to add after, 0 for
- *               start of file.
- *
- * Returns     :  JB_ERR_OK     on success
- *                JB_ERR_MEMORY on out-of-memory
- *                JB_ERR_CGI_PARAMS if the CGI parameters are not
- *                                  specified or not valid.
- *
- *********************************************************************/
-jb_err cgi_edit_actions_section_add(struct client_state *csp,
-                                    struct http_response *rsp,
-                                    const struct map *parameters)
-{
-   unsigned sectionid;
-   struct file_line * new_line;
-   char * new_text;
-   struct editable_file * file;
-   struct file_line * cur_line;
-   unsigned line_number;
-   char target[1024];
-   jb_err err;
-
-   if (0 == (csp->config->feature_flags & RUNTIME_FEATURE_CGI_EDIT_ACTIONS))
-   {
-      return cgi_error_disabled(csp, rsp);
-   }
-
-   err = get_number_param(csp, parameters, "s", &sectionid);
-   if (err)
-   {
-      return err;
-   }
-
-   err = edit_read_actions_file(csp, rsp, parameters, 1, &file);
-   if (err)
-   {
-      /* No filename specified, can't read file, modified, or out of memory. */
-      return (err == JB_ERR_FILE ? JB_ERR_OK : err);
-   }
-
-   line_number = 1;
-   cur_line = file->lines;
-
-   if (sectionid <= 1U)
-   {
-      /* Add to start of file */
-      if (cur_line != NULL && cur_line->type != FILE_LINE_ACTION)
-      {
-         /* There's something in the file, find the line before the first
-          * action.
-          */
-         while ( (cur_line->next != NULL)
-              && (cur_line->next->type != FILE_LINE_ACTION) )
-         {
-            cur_line = cur_line->next;
-            line_number++;
-         }
-      }
-      else
-      {
-         /* File starts with action line, so insert at top */
-         cur_line = NULL;
-      }
-   }
-   else
-   {
-      /* Add after stated section. */
-      while ((cur_line != NULL) && (line_number < sectionid))
-      {
-         cur_line = cur_line->next;
-         line_number++;
-      }
-
-      if ( (cur_line == NULL)
-        || (cur_line->type != FILE_LINE_ACTION))
-      {
-         /* Invalid "sectionid" parameter */
-         edit_free_file(file);
-         return JB_ERR_CGI_PARAMS;
-      }
-
-      /* Skip through the section to find the last line in it. */
-      while ( (cur_line->next != NULL)
-           && (cur_line->next->type != FILE_LINE_ACTION) )
-      {
-         cur_line = cur_line->next;
-         line_number++;
-      }
-   }
-
-   /* At this point, the last line in the previous section is in cur_line
-    * - add after this.  (Or if we need to add as the first line, cur_line
-    * will be NULL).
-    */
-
-   new_text = strdup("{}");
-   if (NULL == new_text)
-   {
-      edit_free_file(file);
-      return JB_ERR_MEMORY;
-   }
-
-   /* Allocate the new line */
-   new_line = (struct file_line *)zalloc(sizeof(*new_line));
-   if (new_line == NULL)
-   {
-      free(new_text);
-      edit_free_file(file);
-      return JB_ERR_MEMORY;
-   }
-
-   /* Fill in the data members of the new line */
-   new_line->raw = NULL;
-   new_line->prefix = NULL;
-   new_line->unprocessed = new_text;
-   new_line->type = FILE_LINE_ACTION;
-
-   if (cur_line != NULL)
-   {
-      /* Link new_line into the list, after cur_line */
-      new_line->next = cur_line->next;
-      cur_line->next = new_line;
-   }
-   else
-   {
-      /* Link new_line into the list, as first line */
-      new_line->next = file->lines;
-      file->lines = new_line;
-   }
-
-   /* Done making changes, now commit */
-
-   err = edit_write_file(file);
-   if (err)
-   {
-      /* Error writing file */
-      if (err == JB_ERR_FILE)
-      {
-         /* Read-only file. */
-         err = cgi_error_file_read_only(csp, rsp, file->filename);
-      }
-      edit_free_file(file);
-      return err;
-   }
-
-   snprintf(target, sizeof(target), CGI_PREFIX "edit-actions-list?foo=%lu&f=%i",
-            (long) time(NULL), file->identifier);
-
-   edit_free_file(file);
-
-   return cgi_redirect(rsp, target);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_edit_actions_section_swap
- *
- * Description :  CGI function that swaps the order of two sections
- *                in the actions file.  Note that this CGI can actually
- *                swap any two arbitrary sections, but the GUI interface
- *                currently only allows consecutive sections to be
- *                specified.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters :
- *           f : (filename) Identifies the file to edit
- *           v : (version) File's last-modified time
- *          s1 : (section1) Line number of first section to swap
- *          s2 : (section2) Line number of second section to swap
- *
- * Returns     :  JB_ERR_OK     on success
- *                JB_ERR_MEMORY on out-of-memory
- *                JB_ERR_CGI_PARAMS if the CGI parameters are not
- *                                  specified or not valid.
- *
- *********************************************************************/
-jb_err cgi_edit_actions_section_swap(struct client_state *csp,
-                                     struct http_response *rsp,
-                                     const struct map *parameters)
-{
-   unsigned section1;
-   unsigned section2;
-   struct editable_file * file;
-   struct file_line * cur_line;
-   struct file_line * prev_line;
-   struct file_line * line_before_section1;
-   struct file_line * line_start_section1;
-   struct file_line * line_end_section1;
-   struct file_line * line_after_section1;
-   struct file_line * line_before_section2;
-   struct file_line * line_start_section2;
-   struct file_line * line_end_section2;
-   struct file_line * line_after_section2;
-   unsigned line_number;
-   char target[1024];
-   jb_err err;
-
-   if (0 == (csp->config->feature_flags & RUNTIME_FEATURE_CGI_EDIT_ACTIONS))
-   {
-      return cgi_error_disabled(csp, rsp);
-   }
-
-   err = get_number_param(csp, parameters, "s1", &section1);
-   if (!err) err = get_number_param(csp, parameters, "s2", &section2);
-   if (err)
-   {
-      return err;
-   }
-
-   if (section1 > section2)
-   {
-      unsigned temp = section2;
-      section2 = section1;
-      section1 = temp;
-   }
-
-   err = edit_read_actions_file(csp, rsp, parameters, 1, &file);
-   if (err)
-   {
-      /* No filename specified, can't read file, modified, or out of memory. */
-      return (err == JB_ERR_FILE ? JB_ERR_OK : err);
-   }
-
-   /* Start at the beginning... */
-   line_number = 1;
-   cur_line = file->lines;
-   prev_line = NULL;
-
-   /* ... find section1 ... */
-   while ((cur_line != NULL) && (line_number < section1))
-   {
-      prev_line = cur_line;
-      cur_line = cur_line->next;
-      line_number++;
-   }
-
-   if ( (cur_line == NULL)
-     || (cur_line->type != FILE_LINE_ACTION) )
-   {
-      /* Invalid "section1" parameter */
-      edit_free_file(file);
-      return JB_ERR_CGI_PARAMS;
-   }
-
-   /* If no-op, we've validated params and can skip the rest. */
-   if (section1 != section2)
-   {
-      /* ... find the end of section1 ... */
-      line_before_section1 = prev_line;
-      line_start_section1 = cur_line;
-      do
-      {
-         prev_line = cur_line;
-         cur_line = cur_line->next;
-         line_number++;
-      }
-      while ((cur_line != NULL) && (cur_line->type == FILE_LINE_URL));
-      line_end_section1 = prev_line;
-      line_after_section1 = cur_line;
-
-      /* ... find section2 ... */
-      while ((cur_line != NULL) && (line_number < section2))
-      {
-         prev_line = cur_line;
-         cur_line = cur_line->next;
-         line_number++;
-      }
-
-      if ( (cur_line == NULL)
-        || (cur_line->type != FILE_LINE_ACTION) )
-      {
-         /* Invalid "section2" parameter */
-         edit_free_file(file);
-         return JB_ERR_CGI_PARAMS;
-      }
-
-      /* ... find the end of section2 ... */
-      line_before_section2 = prev_line;
-      line_start_section2 = cur_line;
-      do
-      {
-         prev_line = cur_line;
-         cur_line = cur_line->next;
-         line_number++;
-      }
-      while ((cur_line != NULL) && (cur_line->type == FILE_LINE_URL));
-      line_end_section2 = prev_line;
-      line_after_section2 = cur_line;
-
-      /* Now have all the pointers we need. Do the swap. */
-
-      /* Change the pointer to section1 to point to section2 instead */
-      if (line_before_section1 == NULL)
-      {
-         file->lines = line_start_section2;
-      }
-      else
-      {
-         line_before_section1->next = line_start_section2;
-      }
-
-      if (line_before_section2 == line_end_section1)
-      {
-         /* Consecutive sections */
-         line_end_section2->next = line_start_section1;
-      }
-      else
-      {
-         line_end_section2->next = line_after_section1;
-         line_before_section2->next = line_start_section1;
-      }
-
-      /* Set the pointer from the end of section1 to the rest of the file */
-      line_end_section1->next = line_after_section2;
-
-      err = edit_write_file(file);
-      if (err)
-      {
-         /* Error writing file */
-         if (err == JB_ERR_FILE)
-         {
-            /* Read-only file. */
-            err = cgi_error_file_read_only(csp, rsp, file->filename);
-         }
-         edit_free_file(file);
-         return err;
-      }
-   } /* END if (section1 != section2) */
-
-   snprintf(target, sizeof(target), CGI_PREFIX "edit-actions-list?foo=%lu&f=%i",
-            (long) time(NULL), file->identifier);
-
-   edit_free_file(file);
-
-   return cgi_redirect(rsp, target);
-}
-
-
-/*********************************************************************
- *
- * Function    :  javascriptify
- *
- * Description :  Converts a string into a form JavaScript will like.
- *
- *                Netscape 4's JavaScript sucks - it doesn't use 
- *                "id" parameters, so you have to set the "name"
- *                used to submit a form element to something JavaScript
- *                will like.  (Or access the elements by index in an
- *                array.  That array contains >60 elements and will
- *                be changed whenever we add a new action to the
- *                editor, so I'm NOT going to use indexes that have
- *                to be figured out by hand.)
- *
- *                Currently the only thing we have to worry about
- *                is "-" ==> "_" conversion.
- *
- *                This is a length-preserving operation so it is
- *                carried out in-place, no memory is allocated
- *                or freed.
- *
- * Parameters  :
- *          1  :  identifier = String to make JavaScript-friendly.
- *
- * Returns     :  N/A
- *
- *********************************************************************/
-static void javascriptify(char * identifier)
-{
-   char * p = identifier;
-   while (NULL != (p = strchr(p, '-')))
-   {
-      *p++ = '_';
-   }
-}
-
-
-/*********************************************************************
- *
- * Function    :  actions_to_radio
- *
- * Description :  Converts a actionsfile entry into settings for
- *                radio buttons and edit boxes on a HTML form.
- *
- * Parameters  :
- *          1  :  exports = List of substitutions to add to.
- *          2  :  action  = Action to read
- *
- * Returns     :  JB_ERR_OK     on success
- *                JB_ERR_MEMORY on out-of-memory
- *
- *********************************************************************/
-static jb_err actions_to_radio(struct map * exports,
-                               const struct action_spec *action)
-{
-   unsigned long mask;
-   unsigned long add;
-   int mapped_param;
-   int checked;
-   char current_mode;
-
-   assert(exports);
-   assert(action);
-
-   mask = action->mask;
-   add  = action->add;
-
-   /* sanity - prevents "-feature +feature" */
-   mask |= add;
-
-
-#define DEFINE_ACTION_BOOL(name, bit)                 \
-   if (!(mask & bit))                                 \
-   {                                                  \
-      current_mode = 'n';                             \
-   }                                                  \
-   else if (add & bit)                                \
-   {                                                  \
-      current_mode = 'y';                             \
-   }                                                  \
-   else                                               \
-   {                                                  \
-      current_mode = 'x';                             \
-   }                                                  \
-   if (map_radio(exports, name, "ynx", current_mode)) \
-   {                                                  \
-      return JB_ERR_MEMORY;                           \
-   }
-
-#define DEFINE_ACTION_STRING(name, bit, index)        \
-   DEFINE_ACTION_BOOL(name, bit);                     \
-   mapped_param = 0;
-
-#define DEFINE_CGI_PARAM_RADIO(name, bit, index, value, is_default)  \
-   if (add & bit)                                                    \
-   {                                                                 \
-      checked = !strcmp(action->string[index], value);               \
-   }                                                                 \
-   else                                                              \
-   {                                                                 \
-      checked = is_default;                                          \
-   }                                                                 \
-   mapped_param |= checked;                                          \
-   if (map(exports, name "-param-" value, 1, (checked ? "checked" : ""), 1)) \
-   {                                                                 \
-      return JB_ERR_MEMORY;                                          \
-   }
-
-#define DEFINE_CGI_PARAM_CUSTOM(name, bit, index, default_val)       \
-   if (map(exports, name "-param-custom", 1,                         \
-           ((!mapped_param) ? "checked" : ""), 1))                   \
-   {                                                                 \
-      return JB_ERR_MEMORY;                                          \
-   }                                                                 \
-   if (map(exports, name "-param", 1,                                \
-           (((add & bit) && !mapped_param) ?                         \
-           action->string[index] : default_val), 1))                 \
-   {                                                                 \
-      return JB_ERR_MEMORY;                                          \
-   }
-
-#define DEFINE_CGI_PARAM_NO_RADIO(name, bit, index, default_val)     \
-   if (map(exports, name "-param", 1,                                \
-           ((add & bit) ? action->string[index] : default_val), 1))  \
-   {                                                                 \
-      return JB_ERR_MEMORY;                                          \
-   }
-
-#define DEFINE_ACTION_MULTI(name, index)              \
-   if (action->multi_add[index]->first)               \
-   {                                                  \
-      current_mode = 'y';                             \
-   }                                                  \
-   else if (action->multi_remove_all[index])          \
-   {                                                  \
-      current_mode = 'n';                             \
-   }                                                  \
-   else if (action->multi_remove[index]->first)       \
-   {                                                  \
-      current_mode = 'y';                             \
-   }                                                  \
-   else                                               \
-   {                                                  \
-      current_mode = 'x';                             \
-   }                                                  \
-   if (map_radio(exports, name, "ynx", current_mode)) \
-   {                                                  \
-      return JB_ERR_MEMORY;                           \
-   }
-
-#define DEFINE_ACTION_ALIAS 0 /* No aliases for output */
-
-#include "actionlist.h"
-
-#undef DEFINE_ACTION_MULTI
-#undef DEFINE_ACTION_STRING
-#undef DEFINE_ACTION_BOOL
-#undef DEFINE_ACTION_ALIAS
-#undef DEFINE_CGI_PARAM_CUSTOM
-#undef DEFINE_CGI_PARAM_RADIO
-#undef DEFINE_CGI_PARAM_NO_RADIO
-
-   return JB_ERR_OK;
-}
-
-
-/*********************************************************************
- *
- * Function    :  actions_from_radio
- *
- * Description :  Converts a map of parameters passed to a CGI function
- *                into an actionsfile entry.
- *
- * Parameters  :
- *          1  :  parameters = parameters to the CGI call
- *          2  :  action  = Action to change.  Must be valid before
- *                          the call, actions not specified will be
- *                          left unchanged.
- *
- * Returns     :  JB_ERR_OK     on success
- *                JB_ERR_MEMORY on out-of-memory
- *
- *********************************************************************/
-static jb_err actions_from_radio(const struct map * parameters,
-                                 struct action_spec *action)
-{
-   const char * param;
-   char * param_dup;
-   char ch;
-   const char * js_name;
-   jb_err err = JB_ERR_OK;
-
-   assert(parameters);
-   assert(action);
-
-   /* Statics are generally a potential race condition,
-    * but in this case we're safe and don't need semaphores.
-    * Be careful if you modify this function.
-    * - Jon
-    * The js_name_arr's are never free()d, but this is no
-    * problem, since they will only be created once and
-    * used by all threads thereafter. -oes
-    */
-
-#define JAVASCRIPTIFY(dest_var, string)               \
-   {                                                  \
-     static int first_time = 1;                       \
-     static char *js_name_arr;                        \
-      if (first_time)                                 \
-      {                                               \
-         js_name_arr = strdup(string);                \
-         javascriptify(js_name_arr);                  \
-      }                                               \
-      dest_var = js_name_arr;                         \
-      first_time = 0;                                 \
-   }                                                  \
-
-#define DEFINE_ACTION_BOOL(name, bit)                 \
-   JAVASCRIPTIFY(js_name, name);                      \
-   ch = get_char_param(parameters, js_name);          \
-   if (ch == 'Y')                                     \
-   {                                                  \
-      action->add  |= bit;                            \
-      action->mask |= bit;                            \
-   }                                                  \
-   else if (ch == 'N')                                \
-   {                                                  \
-      action->add  &= ~bit;                           \
-      action->mask &= ~bit;                           \
-   }                                                  \
-   else if (ch == 'X')                                \
-   {                                                  \
-      action->add  &= ~bit;                           \
-      action->mask |= bit;                            \
-   }                                                  \
-
-#define DEFINE_ACTION_STRING(name, bit, index)                 \
-   JAVASCRIPTIFY(js_name, name);                               \
-   ch = get_char_param(parameters, js_name);                   \
-   if (ch == 'Y')                                              \
-   {                                                           \
-      param = NULL;                                            \
-      JAVASCRIPTIFY(js_name, name "-mode");                    \
-      if (!err) err = get_string_param(parameters, js_name, &param);    \
-      if ((param == NULL) || (0 == strcmp(param, "CUSTOM")))            \
-      {                                                                 \
-         JAVASCRIPTIFY(js_name, name "-param");                         \
-         if (!err) err = get_string_param(parameters, js_name, &param); \
-      }                                                        \
-      if (param != NULL)                                       \
-      {                                                        \
-         if (NULL == (param_dup = strdup(param)))              \
-         {                                                     \
-            return JB_ERR_MEMORY;                              \
-         }                                                     \
-         freez(action->string[index]);                         \
-         action->add  |= bit;                                  \
-         action->mask |= bit;                                  \
-         action->string[index] = param_dup;                    \
-      }                                                        \
-   }                                                           \
-   else if (ch == 'N')                                         \
-   {                                                           \
-      if (action->add & bit)                                   \
-      {                                                        \
-         freez(action->string[index]);                         \
-      }                                                        \
-      action->add  &= ~bit;                                    \
-      action->mask &= ~bit;                                    \
-   }                                                           \
-   else if (ch == 'X')                                         \
-   {                                                           \
-      if (action->add & bit)                                   \
-      {                                                        \
-         freez(action->string[index]);                         \
-      }                                                        \
-      action->add  &= ~bit;                                    \
-      action->mask |= bit;                                     \
-   }                                                           \
-
-#define DEFINE_ACTION_MULTI(name, index)                       \
-   JAVASCRIPTIFY(js_name, name);                               \
-   ch = get_char_param(parameters, js_name);                   \
-   if (ch == 'Y')                                              \
-   {                                                           \
-      /* FIXME */                                              \
-   }                                                           \
-   else if (ch == 'N')                                         \
-   {                                                           \
-      list_remove_all(action->multi_add[index]);               \
-      list_remove_all(action->multi_remove[index]);            \
-      action->multi_remove_all[index] = 1;                     \
-   }                                                           \
-   else if (ch == 'X')                                         \
-   {                                                           \
-      list_remove_all(action->multi_add[index]);               \
-      list_remove_all(action->multi_remove[index]);            \
-      action->multi_remove_all[index] = 0;                     \
-   }                                                           \
-
-#define DEFINE_ACTION_ALIAS 0 /* No aliases for URL parsing */
-
-#include "actionlist.h"
-
-#undef DEFINE_ACTION_MULTI
-#undef DEFINE_ACTION_STRING
-#undef DEFINE_ACTION_BOOL
-#undef DEFINE_ACTION_ALIAS
-#undef JAVASCRIPTIFY
-
-   return err;
-}
-#endif /* def FEATURE_CGI_EDIT_ACTIONS */
-
-
-#ifdef FEATURE_TOGGLE
-/*********************************************************************
- *
- * Function    :  cgi_toggle
- *
- * Description :  CGI function that adds a new empty section to
- *                an actions file.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters :
- *         set : If present, how to change toggle setting:
- *               "enable", "disable", "toggle", or none (default).
- *        mini : If present, use mini reply template.
- *
- * Returns     :  JB_ERR_OK     on success
- *                JB_ERR_MEMORY on out-of-memory
- *
- *********************************************************************/
-jb_err cgi_toggle(struct client_state *csp,
-                  struct http_response *rsp,
-                  const struct map *parameters)
-{
-   struct map *exports;
-   char mode;
-   const char *template_name;
-
-   assert(csp);
-   assert(rsp);
-   assert(parameters);
-
-   if (0 == (csp->config->feature_flags & RUNTIME_FEATURE_CGI_TOGGLE))
-   {
-      return cgi_error_disabled(csp, rsp);
-   }
-
-   mode = get_char_param(parameters, "set");
-
-   if (mode == 'E')
-   {
-      /* Enable */
-      global_toggle_state = 1;
-   }
-   else if (mode == 'D')
-   {
-      /* Disable */
-      global_toggle_state = 0;
-   }
-   else if (mode == 'T')
-   {
-      /* Toggle */
-      global_toggle_state = !global_toggle_state;
-   }
-
-   if (NULL == (exports = default_exports(csp, "toggle")))
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   template_name = (get_char_param(parameters, "mini")
-                 ? "toggle-mini"
-                 : "toggle");
-
-   return template_fill_for_cgi(csp, template_name, exports, rsp);
-}
-#endif /* def FEATURE_TOGGLE */
-
-
-/*
-  Local Variables:
-  tab-width: 3
-  end:
-*/
diff --git a/external/privoxy/cgiedit.h b/external/privoxy/cgiedit.h
deleted file mode 100644
index ceb5248..0000000
--- a/external/privoxy/cgiedit.h
+++ /dev/null
@@ -1,175 +0,0 @@
-#ifndef CGIEDIT_H_INCLUDED
-#define CGIEDIT_H_INCLUDED
-#define CGIEDIT_H_VERSION "$Id: cgiedit.h,v 1.10 2008/08/31 15:59:03 fabiankeil Exp $"
-/*********************************************************************
- *
- * File        :  $Source: /cvsroot/ijbswa/current/cgiedit.h,v $
- *
- * Purpose     :  CGI-based actionsfile editor.
- *                
- *                Functions declared include:
- * 
- *
- * Copyright   :  Written by and Copyright (C) 2001 the SourceForge
- *                Privoxy team. http://www.privoxy.org/
- *
- *                Based on the Internet Junkbuster originally written
- *                by and Copyright (C) 1997 Anonymous Coders and 
- *                Junkbusters Corporation.  http://www.junkbusters.com
- *
- *                This program is free software; you can redistribute it 
- *                and/or modify it under the terms of the GNU General
- *                Public License as published by the Free Software
- *                Foundation; either version 2 of the License, or (at
- *                your option) any later version.
- *
- *                This program is distributed in the hope that it will
- *                be useful, but WITHOUT ANY WARRANTY; without even the
- *                implied warranty of MERCHANTABILITY or FITNESS FOR A
- *                PARTICULAR PURPOSE.  See the GNU General Public
- *                License for more details.
- *
- *                The GNU General Public License should be included with
- *                this file.  If not, you can view it at
- *                http://www.gnu.org/copyleft/gpl.html
- *                or write to the Free Software Foundation, Inc., 59
- *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * Revisions   :
- *    $Log: cgiedit.h,v $
- *    Revision 1.10  2008/08/31 15:59:03  fabiankeil
- *    There's no reason to let remote toggling support depend
- *    on FEATURE_CGI_EDIT_ACTIONS, so make sure it doesn't.
- *
- *    Revision 1.9  2006/07/18 14:48:45  david__schmidt
- *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
- *    with what was really the latest development (the v_3_0_branch branch)
- *
- *    Revision 1.7.2.2  2004/02/17 13:30:23  oes
- *    Moved cgi_error_disabled() from cgiedit.c to
- *    cgi.c to re-enable build with --disable-editor.
- *    Fixes Bug #892744. Thanks to Matthew Fischer
- *    for spotting.
- *
- *    Revision 1.7.2.1  2002/11/28 18:15:17  oes
- *    Added cgi_error_disabled
- *
- *    Revision 1.7  2002/03/26 22:29:54  swa
- *    we have a new homepage!
- *
- *    Revision 1.6  2002/03/24 13:25:43  swa
- *    name change related issues
- *
- *    Revision 1.5  2002/01/22 23:24:48  jongfoster
- *    Adding edit-actions-section-swap
- *
- *    Revision 1.4  2001/11/13 00:28:51  jongfoster
- *    Adding new CGIs for use by non-JavaScript browsers:
- *      edit-actions-url-form
- *      edit-actions-add-url-form
- *      edit-actions-remove-url-form
- *
- *    Revision 1.3  2001/10/23 21:48:19  jongfoster
- *    Cleaning up error handling in CGI functions - they now send back
- *    a HTML error page and should never cause a FATAL error.  (Fixes one
- *    potential source of "denial of service" attacks).
- *
- *    CGI actions file editor that works and is actually useful.
- *
- *    Ability to toggle JunkBuster remotely using a CGI call.
- *
- *    You can turn off both the above features in the main configuration
- *    file, e.g. if you are running a multi-user proxy.
- *
- *    Revision 1.2  2001/10/14 22:12:49  jongfoster
- *    New version of CGI-based actionsfile editor.
- *    Major changes, including:
- *    - Completely new file parser and file output routines
- *    - edit-actions CGI renamed edit-actions-for-url
- *    - All CGIs now need a filename parameter, except for...
- *    - New CGI edit-actions which doesn't need a filename,
- *      to allow you to start the editor up.
- *    - edit-actions-submit now works, and now automatically
- *      redirects you back to the main edit-actions-list handler.
- *
- *    Revision 1.1  2001/09/16 15:47:37  jongfoster
- *    First version of CGI-based edit interface.  This is very much a
- *    work-in-progress, and you can't actually use it to edit anything
- *    yet.  You must #define FEATURE_CGI_EDIT_ACTIONS for these changes
- *    to have any effect.
- *
- *
- **********************************************************************/
-
-
-#include "project.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * CGI functions
- */
-#ifdef FEATURE_CGI_EDIT_ACTIONS
-extern jb_err cgi_edit_actions        (struct client_state *csp,
-                                       struct http_response *rsp,
-                                       const struct map *parameters);
-extern jb_err cgi_edit_actions_for_url(struct client_state *csp,
-                                       struct http_response *rsp,
-                                       const struct map *parameters);
-extern jb_err cgi_edit_actions_list   (struct client_state *csp,
-                                       struct http_response *rsp,
-                                       const struct map *parameters);
-extern jb_err cgi_edit_actions_submit (struct client_state *csp,
-                                       struct http_response *rsp,
-                                       const struct map *parameters);
-extern jb_err cgi_edit_actions_url    (struct client_state *csp,
-                                       struct http_response *rsp,
-                                       const struct map *parameters);
-extern jb_err cgi_edit_actions_url_form(struct client_state *csp,
-                                        struct http_response *rsp,
-                                        const struct map *parameters);
-extern jb_err cgi_edit_actions_add_url(struct client_state *csp,
-                                       struct http_response *rsp,
-                                       const struct map *parameters);
-extern jb_err cgi_edit_actions_add_url_form(struct client_state *csp,
-                                            struct http_response *rsp,
-                                            const struct map *parameters);
-extern jb_err cgi_edit_actions_remove_url    (struct client_state *csp,
-                                              struct http_response *rsp,
-                                              const struct map *parameters);
-extern jb_err cgi_edit_actions_remove_url_form(struct client_state *csp,
-                                            struct http_response *rsp,
-                                            const struct map *parameters);
-extern jb_err cgi_edit_actions_section_remove(struct client_state *csp,
-                                              struct http_response *rsp,
-                                              const struct map *parameters);
-extern jb_err cgi_edit_actions_section_add   (struct client_state *csp,
-                                              struct http_response *rsp,
-                                              const struct map *parameters);
-extern jb_err cgi_edit_actions_section_swap  (struct client_state *csp,
-                                              struct http_response *rsp,
-                                              const struct map *parameters);
-#endif /* def FEATURE_CGI_EDIT_ACTIONS */
-#ifdef FEATURE_TOGGLE
-extern jb_err cgi_toggle(struct client_state *csp,
-                         struct http_response *rsp,
-                         const struct map *parameters);
-#endif /* def FEATURE_TOGGLE */
-
-/* Revision control strings from this header and associated .c file */
-extern const char cgiedit_rcs[];
-extern const char cgiedit_h_rcs[];
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* ndef CGI_H_INCLUDED */
-
-/*
-  Local Variables:
-  tab-width: 3
-  end:
-*/
diff --git a/external/privoxy/cgisimple.c b/external/privoxy/cgisimple.c
deleted file mode 100644
index 3543611..0000000
--- a/external/privoxy/cgisimple.c
+++ /dev/null
@@ -1,2295 +0,0 @@
-const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.91 2009/03/08 14:19:23 fabiankeil Exp $";
-/*********************************************************************
- *
- * File        :  $Source: /cvsroot/ijbswa/current/cgisimple.c,v $
- *
- * Purpose     :  Simple CGIs to get information about Privoxy's
- *                status.
- *                
- *                Functions declared include:
- * 
- *
- * Copyright   :  Written by and Copyright (C) 2001-2008 the SourceForge
- *                Privoxy team. http://www.privoxy.org/
- *
- *                Based on the Internet Junkbuster originally written
- *                by and Copyright (C) 1997 Anonymous Coders and 
- *                Junkbusters Corporation.  http://www.junkbusters.com
- *
- *                This program is free software; you can redistribute it 
- *                and/or modify it under the terms of the GNU General
- *                Public License as published by the Free Software
- *                Foundation; either version 2 of the License, or (at
- *                your option) any later version.
- *
- *                This program is distributed in the hope that it will
- *                be useful, but WITHOUT ANY WARRANTY; without even the
- *                implied warranty of MERCHANTABILITY or FITNESS FOR A
- *                PARTICULAR PURPOSE.  See the GNU General Public
- *                License for more details.
- *
- *                The GNU General Public License should be included with
- *                this file.  If not, you can view it at
- *                http://www.gnu.org/copyleft/gpl.html
- *                or write to the Free Software Foundation, Inc., 59
- *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * Revisions   :
- *    $Log: cgisimple.c,v $
- *    Revision 1.91  2009/03/08 14:19:23  fabiankeil
- *    Fix justified (but harmless) compiler warnings
- *    on platforms where sizeof(int) < sizeof(long).
- *
- *    Revision 1.90  2009/03/01 18:43:09  fabiankeil
- *    Fix cparser warnings.
- *
- *    Revision 1.89  2008/10/11 11:31:14  fabiankeil
- *    Add FEATURE_CONNECTION_KEEP_ALIVE to the list
- *    of conditional defines on the show-status page.
- *
- *    Revision 1.88  2008/08/30 12:03:07  fabiankeil
- *    Remove FEATURE_COOKIE_JAR.
- *
- *    Revision 1.87  2008/08/29 15:59:22  fabiankeil
- *    Fix two comments.
- *
- *    Revision 1.86  2008/06/28 14:19:05  fabiankeil
- *    Protocol detection is done case-insensitive, fix assertion
- *    to do the same. Yay for Privoxy-Regression-Test and zzuf.
- *
- *    Revision 1.85  2008/05/26 17:30:55  fabiankeil
- *    Provide an OpenSearch Description to access the
- *    show-url-info page through "search engine plugins".
- *
- *    Revision 1.84  2008/05/26 16:16:55  fabiankeil
- *    Spell error correctly.
- *
- *    Revision 1.83  2008/05/12 14:51:30  fabiankeil
- *    Don't complain about an invalid URL if show-url-info is requested
- *    without parameters. Regression introduced in 1.81 by yours truly.
- *
- *    Revision 1.82  2008/05/10 20:01:47  fabiankeil
- *    Fix an assertion that could erroneously
- *    trigger in case of memory shortage.
- *
- *    Revision 1.81  2008/05/05 09:54:39  fabiankeil
- *    In cgi_show_url_info(), make sure ftp URLs are
- *    declared invalid. Also simplify the code that adds
- *    "http://" if no protocol has been specified.
- *
- *    Revision 1.80  2008/05/04 16:18:32  fabiankeil
- *    Provide parse_http_url() with a third parameter to specify
- *    whether or not URLs without protocol are acceptable.
- *
- *    Revision 1.79  2008/05/04 13:30:56  fabiankeil
- *    Streamline parse_http_url()'s prototype.
- *
- *    Revision 1.78  2008/05/03 16:50:11  fabiankeil
- *    Leverage content_filters_enabled() in cgi_show_url_info().
- *
- *    Revision 1.77  2008/05/02 09:47:48  fabiankeil
- *    In cgi_show_url_info, pass an initialized http structure
- *    to parse_http_url() as that will be required soonish and
- *    assert that https URLs are recognized correctly.
- *
- *    Revision 1.76  2008/04/28 09:13:30  fabiankeil
- *    In load_file(), remember the error reason and fclose()
- *    and return later on instead of right away.
- *
- *    Revision 1.75  2008/04/27 13:52:52  fabiankeil
- *    Move CGI file loading code into load_file() and
- *    add checks for unexpected errors.
- *
- *    Revision 1.74  2008/04/26 15:50:56  fabiankeil
- *    Fix macro name in cgi_show_file() error path.
- *
- *    Revision 1.73  2008/04/26 12:21:55  fabiankeil
- *    Forget about JB_ERR_PARSE. JB_ERR_CGI_PARAMS to the rescue.
- *
- *    Revision 1.72  2008/04/26 10:34:15  fabiankeil
- *    If zlib support is unavailable and there are content filters active
- *    but the prevent-compression action is disabled, include a warning
- *    on the show-url-info page that compression might prevent filtering.
- *
- *    Revision 1.71  2008/04/25 13:33:56  fabiankeil
- *    - Factor cgi_show_file() out of cgi_show_status().
- *    - Adjust cgi_show_status()'s parameter description to match reality.
- *
- *    Revision 1.70  2008/04/24 16:12:38  fabiankeil
- *    In cgi_show_status(), load the requested file at once.
- *    Using string_join() for every line really doesn't scale.
- *
- *    Revision 1.69  2008/04/17 14:40:48  fabiankeil
- *    Provide get_http_time() with the buffer size so it doesn't
- *    have to blindly assume that the buffer is big enough.
- *
- *    Revision 1.68  2008/03/27 18:27:21  fabiankeil
- *    Remove kill-popups action.
- *
- *    Revision 1.67  2008/03/27 17:00:05  fabiankeil
- *    Turn the favicon blobs into locals.
- *
- *    Revision 1.66  2008/02/23 16:57:12  fabiankeil
- *    Rename url_actions() to get_url_actions() and let it
- *    use the standard parameter ordering.
- *
- *    Revision 1.65  2008/02/23 16:33:43  fabiankeil
- *    Let forward_url() use the standard parameter ordering
- *    and mark its second parameter immutable.
- *
- *    Revision 1.64  2008/02/03 13:56:07  fabiankeil
- *    Add SOCKS5 support for show-url-info CGI page.
- *
- *    Revision 1.63  2008/02/01 06:04:31  fabiankeil
- *    If edit buttons on the show-url-info CGI page are hidden, explain why.
- *
- *    Revision 1.62  2008/02/01 05:52:40  fabiankeil
- *    Hide edit buttons on the show-url-info CGI page if enable-edit-action
- *    is disabled. Patch by Lee with additional white space adjustments.
- *
- *    Revision 1.61  2008/01/26 11:13:25  fabiankeil
- *    If enable-edit-actions is disabled, hide the edit buttons and explain why.
- *
- *    Revision 1.60  2007/10/27 13:12:13  fabiankeil
- *    Finish 1.49 and check write access before
- *    showing edit buttons on show-url-info page.
- *
- *    Revision 1.59  2007/10/19 16:42:36  fabiankeil
- *    Plug memory leak I introduced five months ago.
- *    Yay Valgrind and Privoxy-Regression-Test.
- *
- *    Revision 1.58  2007/07/21 12:19:50  fabiankeil
- *    If show-url-info is called with an URL that Privoxy
- *    would reject as invalid, don't show unresolved forwarding
- *    variables, "final matches" or claim the site's secure.
- *
- *    Revision 1.57  2007/06/01 16:53:05  fabiankeil
- *    Adjust cgi_show_url_info() to show what forward-override{}
- *    would do with the requested URL (instead of showing how the
- *    request for the CGI page would be forwarded if it wasn't a
- *    CGI request).
- *
- *    Revision 1.56  2007/05/21 10:50:35  fabiankeil
- *    - Use strlcpy() instead of strcpy().
- *    - Stop treating actions files special. Expect a complete file name
- *      (with or without path) like it's done for the rest of the files.
- *      Closes FR#588084.
- *    - Don't rerun sed() in cgi_show_request().
- *
- *    Revision 1.55  2007/04/13 13:36:46  fabiankeil
- *    Reference action files in CGI URLs by id instead
- *    of using the first part of the file name.
- *    Fixes BR 1694250 and BR 1590556.
- *
- *    Revision 1.54  2007/04/09 18:11:35  fabiankeil
- *    Don't mistake VC++'s _snprintf() for a snprintf() replacement.
- *
- *    Revision 1.53  2007/04/08 13:21:04  fabiankeil
- *    Reference action files in CGI URLs by id instead
- *    of using the first part of the file name.
- *    Fixes BR 1694250 and BR 1590556.
- *
- *    Revision 1.52  2007/02/13 15:10:26  fabiankeil
- *    Apparently fopen()ing in "binary" mode doesn't require
- *    #ifdefs, it's already done without them in cgiedit.c.
- *
- *    Revision 1.51  2007/02/10 16:55:22  fabiankeil
- *    - Show forwarding settings on the show-url-info page
- *    - Fix some HTML syntax errors.
- *
- *    Revision 1.50  2007/01/23 15:51:17  fabiankeil
- *    Add favicon delivery functions.
- *
- *    Revision 1.49  2007/01/20 16:29:38  fabiankeil
- *    Suppress edit buttons for action files if Privoxy has
- *    no write access. Suggested by Roland in PR 1564026.
- *
- *    Revision 1.48  2007/01/20 15:31:31  fabiankeil
- *    Display warning if show-url-info CGI page
- *    is used while Privoxy is toggled off.
- *
- *    Revision 1.47  2007/01/12 15:07:10  fabiankeil
- *    Use zalloc in cgi_send_user_manual.
- *
- *    Revision 1.46  2007/01/02 12:49:46  fabiankeil
- *    Add FEATURE_ZLIB to the list of conditional
- *    defines at the show-status page.
- *
- *    Revision 1.45  2006/12/28 18:16:41  fabiankeil
- *    Fixed gcc43 compiler warnings, zero out cgi_send_user_manual's
- *    body memory before using it, replaced sprintf calls with snprintf.
- *
- *    Revision 1.44  2006/12/22 14:19:27  fabiankeil
- *    Removed checks whether or not AF_FILES have
- *    data structures associated with them in cgi_show_status.
- *    It doesn't matter as we're only interested in the file names.
- *
- *    For the action files the checks were always true,
- *    but they prevented empty filter files from being
- *    listed. Fixes parts of BR 1619208.
- *
- *    Revision 1.43  2006/12/17 17:57:56  fabiankeil
- *    - Added FEATURE_GRACEFUL_TERMINATION to the
- *      "conditional #defines" section
- *    - Escaped ampersands in generated HTML.
- *    - Renamed re-filter-filename to re-filter-filenames
- *
- *    Revision 1.42  2006/11/21 15:43:12  fabiankeil
- *    Add special treatment for WIN32 to make sure
- *    cgi_send_user_manual opens the files in binary mode.
- *    Fixes BR 1600411 and unbreaks image delivery.
- *
- *    Remove outdated comment.
- *
- *    Revision 1.41  2006/10/09 19:18:28  roro
- *    Redirect http://p.p/user-manual (without trailing slash) to
- *    http://p.p/user-manual/ (with trailing slash), otherwise links will be broken.
- *
- *    Revision 1.40  2006/09/09 13:05:33  fabiankeil
- *    Modified cgi_send_user_manual to serve binary
- *    content without destroying it first. Should also be
- *    faster now. Added ".jpg" check for Content-Type guessing.
- *
- *    Revision 1.39  2006/09/08 09:49:23  fabiankeil
- *    Deliver documents in the user-manual directory
- *    with "Content-Type text/css" if their filename
- *    ends with ".css".
- *
- *    Revision 1.38  2006/09/06 18:45:03  fabiankeil
- *    Incorporate modified version of Roland Rosenfeld's patch to
- *    optionally access the user-manual via Privoxy. Closes patch 679075.
- *
- *    Formatting changed to Privoxy style, added call to
- *    cgi_error_no_template if the requested file doesn't
- *    exist and modified check whether or not Privoxy itself
- *    should serve the manual. Should work cross-platform now.
- *
- *    Revision 1.37  2006/07/18 14:48:45  david__schmidt
- *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
- *    with what was really the latest development (the v_3_0_branch branch)
- *
- *    Revision 1.35.2.7  2006/01/29 23:10:56  david__schmidt
- *    Multiple filter file support
- *
- *    Revision 1.35.2.6  2005/07/04 03:13:43  david__schmidt
- *    Undo some damaging memory leak patches
- *
- *    Revision 1.35.2.5  2005/05/07 21:50:55  david__schmidt
- *    A few memory leaks plugged (mostly on error paths)
- *
- *    Revision 1.35.2.4  2005/04/04 02:21:24  david__schmidt
- *    Another instance of:
- *    Don't show "Edit" buttons #ifndef FEATURE_CGI_EDIT_ACTIONS
- *    Thanks to Magnus Holmgren for the patch
- *
- *    Revision 1.35.2.3  2003/12/17 16:34:15  oes
- *     - Prevent line wrap beween "View/Edit" link buttons on status page
- *     - Some (mostly irrelevant) fixes for Out-of-mem-case handling
- *
- *    Revision 1.35.2.2  2003/04/03 13:48:28  oes
- *    Don't show "Edit" buttons #ifndef FEATURE_CGI_EDIT_ACTIONS
- *
- *    Revision 1.35.2.1  2002/07/04 15:02:38  oes
- *    Added ability to send redirects to send-banner CGI, so that it can completely mimic the image blocking action if called with type=auto
- *
- *    Revision 1.35.2.1  2002/07/01 17:32:04  morcego
- *    Applying patch from Andreas as provided by Hal on the list.
- *    Message-ID: <20020701121218.V1606 at feenix.burgiss.net>
- *
- *    Revision 1.35  2002/05/12 21:44:44  jongfoster
- *    Adding amiga.[ch] revision information, if on an amiga.
- *
- *    Revision 1.34  2002/04/30 12:06:12  oes
- *    Deleted unused code from default_cgi
- *
- *    Revision 1.33  2002/04/30 11:14:52  oes
- *    Made csp the first parameter in *action_to_html
- *
- *    Revision 1.32  2002/04/26 18:29:13  jongfoster
- *    Fixing this Visual C++ warning:
- *    cgisimple.c(775) : warning C4018: '<' : signed/unsigned mismatch
- *
- *    Revision 1.31  2002/04/26 12:54:36  oes
- *     - Kill obsolete REDIRECT_URL code
- *     - Error handling fixes
- *     - Style sheet related HTML snipplet changes
- *     - cgi_show_url_info:
- *       - Matches now in table, actions on single lines,
- *         linked to help
- *       - standard.action suppressed
- *       - Buttons to View and Edit AFs
- *
- *    Revision 1.30  2002/04/24 02:18:08  oes
- *     - show-status is now the starting point for editing
- *       the actions files, generate list of all AFs with buttons
- *       for viewing and editing, new look for file list (Jon:
- *       buttons now aligned ;-P ), view mode now supports multiple
- *       AFs, name changes, no view links for unspecified files,
- *       no edit link for standard.action.
- *
- *     - Jon's multiple AF patch: cgi_show_url_info now uses all
- *       AFs and marks the output accordingly
- *
- *    Revision 1.29  2002/04/10 13:38:35  oes
- *    load_template signature changed
- *
- *    Revision 1.28  2002/04/07 15:42:12  jongfoster
- *    Fixing send-banner?type=auto when the image-blocker is
- *    a redirect to send-banner
- *
- *    Revision 1.27  2002/04/05 15:50:48  oes
- *    added send-stylesheet CGI
- *
- *    Revision 1.26  2002/04/04 00:36:36  gliptak
- *    always use pcre for matching
- *
- *    Revision 1.25  2002/04/03 22:28:03  gliptak
- *    Removed references to gnu_regex
- *
- *    Revision 1.24  2002/04/02 16:12:47  oes
- *    Fix: moving misplaced lines into #ifdef FEATURE_FORCE
- *
- *    Revision 1.23  2002/03/26 22:29:54  swa
- *    we have a new homepage!
- *
- *    Revision 1.22  2002/03/24 16:18:15  jongfoster
- *    Removing old logo
- *
- *    Revision 1.21  2002/03/24 15:23:33  jongfoster
- *    Name changes
- *
- *    Revision 1.20  2002/03/24 13:25:43  swa
- *    name change related issues
- *
- *    Revision 1.19  2002/03/16 23:54:06  jongfoster
- *    Adding graceful termination feature, to help look for memory leaks.
- *    If you enable this (which, by design, has to be done by hand
- *    editing config.h) and then go to http://i.j.b/die, then the program
- *    will exit cleanly after the *next* request.  It should free all the
- *    memory that was used.
- *
- *    Revision 1.18  2002/03/12 01:44:49  oes
- *    Changed default for "blocked" image from jb logo to checkboard pattern
- *
- *    Revision 1.17  2002/03/08 16:43:18  oes
- *    Added choice beween GIF and PNG built-in images
- *
- *    Revision 1.16  2002/03/07 03:48:38  oes
- *     - Changed built-in images from GIF to PNG
- *       (with regard to Unisys patent issue)
- *     - Added a 4x4 pattern PNG which is less intrusive
- *       than the logo but also clearly marks the deleted banners
- *
- *    Revision 1.15  2002/03/06 22:54:35  jongfoster
- *    Automated function-comment nitpicking.
- *
- *    Revision 1.14  2002/03/02 04:14:50  david__schmidt
- *    Clean up a little CRLF unpleasantness that suddenly appeared
- *
- *    Revision 1.13  2002/02/21 00:10:37  jongfoster
- *    Adding send-banner?type=auto option
- *
- *    Revision 1.12  2002/01/23 01:03:32  jongfoster
- *    Fixing gcc [CygWin] compiler warnings
- *
- *    Revision 1.11  2002/01/23 00:01:04  jongfoster
- *    Adding cgi_transparent_gif() for http://i.j.b/t
- *    Adding missing html_encode() to many CGI functions.
- *    Adding urlmatch.[ch] to http://i.j.b/show-version
- *
- *    Revision 1.10  2002/01/17 21:10:37  jongfoster
- *    Changes to cgi_show_url_info to use new matching code from urlmatch.c.
- *    Also fixing a problem in the same function with improperly quoted URLs
- *    in output HTML, and adding code to handle https:// URLs correctly.
- *
- *    Revision 1.9  2001/11/30 23:09:15  jongfoster
- *    Now reports on FEATURE_CGI_EDIT_ACTIONS
- *    Removing FEATURE_DENY_GZIP from template
- *
- *    Revision 1.8  2001/11/13 00:14:07  jongfoster
- *    Fixing stupid bug now I've figured out what || means.
- *    (It always returns 0 or 1, not one of it's paramaters.)
- *
- *    Revision 1.7  2001/10/23 21:48:19  jongfoster
- *    Cleaning up error handling in CGI functions - they now send back
- *    a HTML error page and should never cause a FATAL error.  (Fixes one
- *    potential source of "denial of service" attacks).
- *
- *    CGI actions file editor that works and is actually useful.
- *
- *    Ability to toggle JunkBuster remotely using a CGI call.
- *
- *    You can turn off both the above features in the main configuration
- *    file, e.g. if you are running a multi-user proxy.
- *
- *    Revision 1.6  2001/10/14 22:00:32  jongfoster
- *    Adding support for a 404 error when an invalid CGI page is requested.
- *
- *    Revision 1.5  2001/10/07 15:30:41  oes
- *    Removed FEATURE_DENY_GZIP
- *
- *    Revision 1.4  2001/10/02 15:31:12  oes
- *    Introduced show-request cgi
- *
- *    Revision 1.3  2001/09/22 16:34:44  jongfoster
- *    Removing unneeded #includes
- *
- *    Revision 1.2  2001/09/19 18:01:11  oes
- *    Fixed comments; cosmetics
- *
- *    Revision 1.1  2001/09/16 17:08:54  jongfoster
- *    Moving simple CGI functions from cgi.c to new file cgisimple.c
- *
- *
- **********************************************************************/
-
-
-#include "config.h"
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <assert.h>
-
-#ifdef HAVE_ACCESS
-#include <unistd.h>
-#endif /* def HAVE_ACCESS */
-
-#include "project.h"
-#include "cgi.h"
-#include "cgisimple.h"
-#include "list.h"
-#include "encode.h"
-#include "jcc.h"
-#include "filters.h"
-#include "actions.h"
-#include "miscutil.h"
-#include "loadcfg.h"
-#include "parsers.h"
-#include "urlmatch.h"
-#include "errlog.h"
-
-const char cgisimple_h_rcs[] = CGISIMPLE_H_VERSION;
-
-static char *show_rcs(void);
-static jb_err show_defines(struct map *exports);
-static jb_err cgi_show_file(struct client_state *csp,
-                            struct http_response *rsp,
-                            const struct map *parameters);
-static jb_err load_file(const char *filename, char **buffer, size_t *length);
-
-/*********************************************************************
- *
- * Function    :  cgi_default
- *
- * Description :  CGI function that is called for the CGI_SITE_1_HOST
- *                and CGI_SITE_2_HOST/CGI_SITE_2_PATH base URLs.
- *                Boring - only exports the default exports.
- *               
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters : none
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory
- *
- *********************************************************************/
-jb_err cgi_default(struct client_state *csp,
-                   struct http_response *rsp,
-                   const struct map *parameters)
-{
-   struct map *exports;
-
-   (void)parameters;
-
-   assert(csp);
-   assert(rsp);
-
-   if (NULL == (exports = default_exports(csp, "")))
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   return template_fill_for_cgi(csp, "default", exports, rsp);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_error_404
- *
- * Description :  CGI function that is called if an unknown action was
- *                given.
- *               
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters : none
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err cgi_error_404(struct client_state *csp,
-                     struct http_response *rsp,
-                     const struct map *parameters)
-{
-   struct map *exports;
-
-   assert(csp);
-   assert(rsp);
-   assert(parameters);
-
-   if (NULL == (exports = default_exports(csp, NULL)))
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   rsp->status = strdup("404 Privoxy configuration page not found");
-   if (rsp->status == NULL)
-   {
-      free_map(exports);
-      return JB_ERR_MEMORY;
-   }
-
-   return template_fill_for_cgi(csp, "cgi-error-404", exports, rsp);
-}
-
-
-#ifdef FEATURE_GRACEFUL_TERMINATION
-/*********************************************************************
- *
- * Function    :  cgi_die
- *
- * Description :  CGI function to shut down Privoxy.
- *                NOTE: Turning this on in a production build
- *                would be a BAD idea.  An EXTREMELY BAD idea.
- *                In short, don't do it.
- *               
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters : none
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err cgi_die (struct client_state *csp,
-                struct http_response *rsp,
-                const struct map *parameters)
-{
-   assert(csp);
-   assert(rsp);
-   assert(parameters);
-
-   /* quit */
-   g_terminate = 1;
-
-   /*
-    * I don't really care what gets sent back to the browser.
-    * Take the easy option - "out of memory" page.
-    */
-
-   return JB_ERR_MEMORY;
-}
-#endif /* def FEATURE_GRACEFUL_TERMINATION */
-
-
-/*********************************************************************
- *
- * Function    :  cgi_show_request
- *
- * Description :  Show the client's request and what sed() would have
- *                made of it.
- *               
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters : none
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err cgi_show_request(struct client_state *csp,
-                        struct http_response *rsp,
-                        const struct map *parameters)
-{
-   char *p;
-   struct map *exports;
-
-   assert(csp);
-   assert(rsp);
-   assert(parameters);
-
-   if (NULL == (exports = default_exports(csp, "show-request")))
-   {
-      return JB_ERR_MEMORY;
-   }
-   
-   /*
-    * Repair the damage done to the IOB by get_header()
-    */
-   for (p = csp->iob->buf; p < csp->iob->eod; p++)
-   {
-      if (*p == '\0') *p = '\n';
-   }
-
-   /*
-    * Export the original client's request and the one we would
-    * be sending to the server if this wasn't a CGI call
-    */
-
-   if (map(exports, "client-request", 1, html_encode(csp->iob->buf), 0))
-   {
-      free_map(exports);
-      return JB_ERR_MEMORY;
-   }
-
-   if (map(exports, "processed-request", 1,
-         html_encode_and_free_original(list_to_text(csp->headers)), 0))
-   {
-      free_map(exports);
-      return JB_ERR_MEMORY;
-   }
-
-   return template_fill_for_cgi(csp, "show-request", exports, rsp);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_send_banner
- *
- * Description :  CGI function that returns a banner. 
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters :
- *           type : Selects the type of banner between "trans", "logo",
- *                  and "auto". Defaults to "logo" if absent or invalid.
- *                  "auto" means to select as if we were image-blocking.
- *                  (Only the first character really counts; b and t are
- *                  equivalent).
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err cgi_send_banner(struct client_state *csp,
-                       struct http_response *rsp,
-                       const struct map *parameters)
-{
-   char imagetype = lookup(parameters, "type")[0];
-
-   /*
-    * If type is auto, then determine the right thing
-    * to do from the set-image-blocker action
-    */
-   if (imagetype == 'a') 
-   {
-      /*
-       * Default to pattern
-       */
-      imagetype = 'p';
-
-#ifdef FEATURE_IMAGE_BLOCKING
-      if ((csp->action->flags & ACTION_IMAGE_BLOCKER) != 0)
-      {
-         static const char prefix1[] = CGI_PREFIX "send-banner?type=";
-         static const char prefix2[] = "http://" CGI_SITE_1_HOST "/send-banner?type=";
-         const char *p = csp->action->string[ACTION_STRING_IMAGE_BLOCKER];
-
-         if (p == NULL)
-         {
-            /* Use default - nothing to do here. */
-         }
-         else if (0 == strcmpic(p, "blank"))
-         {
-            imagetype = 'b';
-         }
-         else if (0 == strcmpic(p, "pattern"))
-         {
-            imagetype = 'p';
-         }
-
-         /*
-          * If the action is to call this CGI, determine
-          * the argument:
-          */
-         else if (0 == strncmpic(p, prefix1, sizeof(prefix1) - 1))
-         {
-            imagetype = p[sizeof(prefix1) - 1];
-         }
-         else if (0 == strncmpic(p, prefix2, sizeof(prefix2) - 1))
-         {
-            imagetype = p[sizeof(prefix2) - 1];
-         }
-
-         /*
-          * Everything else must (should) be a URL to
-          * redirect to.
-          */
-         else
-         {
-            imagetype = 'r';
-         }
-      }
-#endif /* def FEATURE_IMAGE_BLOCKING */
-   }
-      
-   /*
-    * Now imagetype is either the non-auto type we were called with,
-    * or it was auto and has since been determined. In any case, we
-    * can proceed to actually answering the request by sending a redirect
-    * or an image as appropriate:
-    */
-   if (imagetype == 'r') 
-   {
-      rsp->status = strdup("302 Local Redirect from Privoxy");
-      if (rsp->status == NULL)
-      {
-         return JB_ERR_MEMORY;
-      }
-      if (enlist_unique_header(rsp->headers, "Location",
-                               csp->action->string[ACTION_STRING_IMAGE_BLOCKER]))
-      {
-         return JB_ERR_MEMORY;
-      }
-   }
-   else
-   {
-      if ((imagetype == 'b') || (imagetype == 't')) 
-      {
-         rsp->body = bindup(image_blank_data, image_blank_length);
-         rsp->content_length = image_blank_length;
-      }
-      else
-      {
-         rsp->body = bindup(image_pattern_data, image_pattern_length);
-         rsp->content_length = image_pattern_length;
-      }
-
-      if (rsp->body == NULL)
-      {
-         return JB_ERR_MEMORY;
-      }
-      if (enlist(rsp->headers, "Content-Type: " BUILTIN_IMAGE_MIMETYPE))
-      {
-         return JB_ERR_MEMORY;
-      }
-
-      rsp->is_static = 1;
-   }
-
-   return JB_ERR_OK;
-
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_transparent_image
- *
- * Description :  CGI function that sends a 1x1 transparent image.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters : None
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err cgi_transparent_image(struct client_state *csp,
-                             struct http_response *rsp,
-                             const struct map *parameters)
-{
-   (void)csp;
-   (void)parameters;
-
-   rsp->body = bindup(image_blank_data, image_blank_length);
-   rsp->content_length = image_blank_length;
-
-   if (rsp->body == NULL)
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   if (enlist(rsp->headers, "Content-Type: " BUILTIN_IMAGE_MIMETYPE))
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   rsp->is_static = 1;
-
-   return JB_ERR_OK;
-
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_send_default_favicon
- *
- * Description :  CGI function that sends the standard favicon.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters : None
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err cgi_send_default_favicon(struct client_state *csp,
-                                struct http_response *rsp,
-                                const struct map *parameters)
-{
-   static const char default_favicon_data[] =
-      "\000\000\001\000\001\000\020\020\002\000\000\000\000\000\260"
-      "\000\000\000\026\000\000\000\050\000\000\000\020\000\000\000"
-      "\040\000\000\000\001\000\001\000\000\000\000\000\100\000\000"
-      "\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000"
-      "\000\000\377\377\377\000\377\000\052\000\017\360\000\000\077"
-      "\374\000\000\161\376\000\000\161\376\000\000\361\377\000\000"
-      "\361\377\000\000\360\017\000\000\360\007\000\000\361\307\000"
-      "\000\361\307\000\000\361\307\000\000\360\007\000\000\160\036"
-      "\000\000\177\376\000\000\077\374\000\000\017\360\000\000\360"
-      "\017\000\000\300\003\000\000\200\001\000\000\200\001\000\000"
-      "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
-      "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
-      "\000\000\200\001\000\000\200\001\000\000\300\003\000\000\360"
-      "\017\000\000";
-   static const size_t favicon_length = sizeof(default_favicon_data) - 1;
-
-   (void)csp;
-   (void)parameters;
-
-   rsp->body = bindup(default_favicon_data, favicon_length);
-   rsp->content_length = favicon_length;
-
-   if (rsp->body == NULL)
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   if (enlist(rsp->headers, "Content-Type: image/x-icon"))
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   rsp->is_static = 1;
-
-   return JB_ERR_OK;
-
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_send_error_favicon
- *
- * Description :  CGI function that sends the favicon for error pages.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters : None
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err cgi_send_error_favicon(struct client_state *csp,
-                              struct http_response *rsp,
-                              const struct map *parameters)
-{
-   static const char error_favicon_data[] =
-      "\000\000\001\000\001\000\020\020\002\000\000\000\000\000\260"
-      "\000\000\000\026\000\000\000\050\000\000\000\020\000\000\000"
-      "\040\000\000\000\001\000\001\000\000\000\000\000\100\000\000"
-      "\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000"
-      "\000\000\377\377\377\000\000\000\377\000\017\360\000\000\077"
-      "\374\000\000\161\376\000\000\161\376\000\000\361\377\000\000"
-      "\361\377\000\000\360\017\000\000\360\007\000\000\361\307\000"
-      "\000\361\307\000\000\361\307\000\000\360\007\000\000\160\036"
-      "\000\000\177\376\000\000\077\374\000\000\017\360\000\000\360"
-      "\017\000\000\300\003\000\000\200\001\000\000\200\001\000\000"
-      "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
-      "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
-      "\000\000\200\001\000\000\200\001\000\000\300\003\000\000\360"
-      "\017\000\000";
-   static const size_t favicon_length = sizeof(error_favicon_data) - 1;
-
-   (void)csp;
-   (void)parameters;
-
-   rsp->body = bindup(error_favicon_data, favicon_length);
-   rsp->content_length = favicon_length;
-
-   if (rsp->body == NULL)
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   if (enlist(rsp->headers, "Content-Type: image/x-icon"))
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   rsp->is_static = 1;
-
-   return JB_ERR_OK;
-
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_send_stylesheet
- *
- * Description :  CGI function that sends a css stylesheet found
- *                in the cgi-style.css template
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters : None
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err cgi_send_stylesheet(struct client_state *csp,
-                           struct http_response *rsp,
-                           const struct map *parameters)
-{
-   jb_err err;
-   
-   assert(csp);
-   assert(rsp);
-
-   (void)parameters;
-
-   err = template_load(csp, &rsp->body, "cgi-style.css", 0);
-
-   if (err == JB_ERR_FILE)
-   {
-      /*
-       * No way to tell user; send empty stylesheet
-       */
-      log_error(LOG_LEVEL_ERROR, "Could not find cgi-style.css template");
-   }
-   else if (err)
-   {
-      return err; /* JB_ERR_MEMORY */
-   }
-
-   if (enlist(rsp->headers, "Content-Type: text/css"))
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   return JB_ERR_OK;
-
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_send_url_info_osd
- *
- * Description :  CGI function that sends the OpenSearch Description
- *                template for the show-url-info page. It allows to
- *                access the page through "search engine plugins".
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters : None
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err cgi_send_url_info_osd(struct client_state *csp,
-                               struct http_response *rsp,
-                               const struct map *parameters)
-{
-   jb_err err = JB_ERR_MEMORY;
-   struct map *exports = default_exports(csp, NULL);
-
-   (void)csp;
-   (void)parameters;
-
-   if (NULL != exports)
-   {
-      err = template_fill_for_cgi(csp, "url-info-osd.xml", exports, rsp);
-      if (JB_ERR_OK == err)
-      {
-         err = enlist(rsp->headers,
-            "Content-Type: application/opensearchdescription+xml");
-      }
-   }
-
-   return err;
-
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_send_user_manual
- *
- * Description :  CGI function that sends a file in the user
- *                manual directory.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters : file=name.html, the name of the HTML file
- *                  (relative to user-manual from config)
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err cgi_send_user_manual(struct client_state *csp,
-                            struct http_response *rsp,
-                            const struct map *parameters)
-{
-   const char * filename;
-   char *full_path;
-   jb_err err = JB_ERR_OK;
-   size_t length;
-
-   assert(csp);
-   assert(rsp);
-   assert(parameters);
-
-   if (!parameters->first)
-   {
-      /* requested http://p.p/user-manual (without trailing slash) */
-      return cgi_redirect(rsp, CGI_PREFIX "user-manual/");
-   }
-
-   get_string_param(parameters, "file", &filename);
-   /* Check paramter for hack attempts */
-   if (filename && strchr(filename, '/'))
-   {
-      return JB_ERR_CGI_PARAMS;
-   }
-   if (filename && strstr(filename, ".."))
-   {
-      return JB_ERR_CGI_PARAMS;
-   }
-
-   full_path = make_path(csp->config->usermanual, filename ? filename : "index.html");
-   if (full_path == NULL)
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   err = load_file(full_path, &rsp->body, &rsp->content_length);
-   if (JB_ERR_OK != err)
-   {
-      assert((JB_ERR_FILE == err) || (JB_ERR_MEMORY == err));
-      if (JB_ERR_FILE == err)
-      {
-         err = cgi_error_no_template(csp, rsp, full_path);
-      }
-      freez(full_path);
-      return err;
-   }
-   freez(full_path);
-
-   /* Guess correct Content-Type based on the filename's ending */
-   if (filename)
-   {
-      length = strlen(filename);
-   }
-   else
-   {
-      length = 0;
-   } 
-   if((length>=4) && !strcmp(&filename[length-4], ".css"))
-   {
-      err = enlist(rsp->headers, "Content-Type: text/css");
-   }
-   else if((length>=4) && !strcmp(&filename[length-4], ".jpg"))
-   {
-      err = enlist(rsp->headers, "Content-Type: image/jpeg");
-   }
-   else
-   {
-      err = enlist(rsp->headers, "Content-Type: text/html");
-   }
-
-   return err;
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_show_version
- *
- * Description :  CGI function that returns a a web page describing the
- *                file versions of Privoxy.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters : none
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err cgi_show_version(struct client_state *csp,
-                        struct http_response *rsp,
-                        const struct map *parameters)
-{
-   struct map *exports;
-
-   assert(csp);
-   assert(rsp);
-   assert(parameters);
-
-   if (NULL == (exports = default_exports(csp, "show-version")))
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   if (map(exports, "sourceversions", 1, show_rcs(), 0))
-   {
-      free_map(exports);
-      return JB_ERR_MEMORY;
-   }
-
-   return template_fill_for_cgi(csp, "show-version", exports, rsp);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_show_status
- *
- * Description :  CGI function that returns a web page describing the
- *                current status of Privoxy.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters :
- *        file :  Which file to show.  Only first letter is checked,
- *                valid values are:
- *                - "a"ction file
- *                - "r"egex
- *                - "t"rust
- *                Default is to show menu and other information.
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err cgi_show_status(struct client_state *csp,
-                       struct http_response *rsp,
-                       const struct map *parameters)
-{
-   char *s = NULL;
-   unsigned i;
-   int j;
-
-   char buf[BUFFER_SIZE];
-#ifdef FEATURE_STATISTICS
-   float perc_rej;   /* Percentage of http requests rejected */
-   int local_urls_read;
-   int local_urls_rejected;
-#endif /* ndef FEATURE_STATISTICS */
-   jb_err err = JB_ERR_OK;
-
-   struct map *exports;
-
-   assert(csp);
-   assert(rsp);
-   assert(parameters);
-
-   if ('\0' != *(lookup(parameters, "file")))
-   {
-      return cgi_show_file(csp, rsp, parameters);
-   }
-
-   if (NULL == (exports = default_exports(csp, "show-status")))
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   s = strdup("");
-   for (j = 0; (s != NULL) && (j < Argc); j++)
-   {
-      if (!err) err = string_join  (&s, html_encode(Argv[j]));
-      if (!err) err = string_append(&s, " ");
-   }
-   if (!err) err = map(exports, "invocation", 1, s, 0);
-
-   if (!err) err = map(exports, "options", 1, csp->config->proxy_args, 1);
-   if (!err) err = show_defines(exports);
-
-   if (err) 
-   {
-      free_map(exports);
-      return JB_ERR_MEMORY;
-   }
-
-#ifdef FEATURE_STATISTICS
-   local_urls_read     = urls_read;
-   local_urls_rejected = urls_rejected;
-
-   /*
-    * Need to alter the stats not to include the fetch of this
-    * page.
-    *
-    * Can't do following thread safely! doh!
-    *
-    * urls_read--;
-    * urls_rejected--; * This will be incremented subsequently *
-    */
-
-   if (local_urls_read == 0)
-   {
-      if (!err) err = map_block_killer(exports, "have-stats");
-   }
-   else
-   {
-      if (!err) err = map_block_killer(exports, "have-no-stats");
-
-      perc_rej = (float)local_urls_rejected * 100.0F /
-            (float)local_urls_read;
-
-      snprintf(buf, sizeof(buf), "%d", local_urls_read);
-      if (!err) err = map(exports, "requests-received", 1, buf, 1);
-
-      snprintf(buf, sizeof(buf), "%d", local_urls_rejected);
-      if (!err) err = map(exports, "requests-blocked", 1, buf, 1);
-
-      snprintf(buf, sizeof(buf), "%6.2f", perc_rej);
-      if (!err) err = map(exports, "percent-blocked", 1, buf, 1);
-   }
-
-#else /* ndef FEATURE_STATISTICS */
-   err = err || map_block_killer(exports, "statistics");
-#endif /* ndef FEATURE_STATISTICS */
-   
-   /* 
-    * List all action files in use, together with view and edit links,
-    * except for standard.action, which should only be viewable. (Not
-    * enforced in the editor itself)
-    * FIXME: Shouldn't include hardwired HTML here, use line template instead!
-    */
-   s = strdup("");
-   for (i = 0; i < MAX_AF_FILES; i++)
-   {
-      if (csp->actions_list[i] != NULL)
-      {
-         if (!err) err = string_append(&s, "<tr><td>");
-         if (!err) err = string_join(&s, html_encode(csp->actions_list[i]->filename));
-         snprintf(buf, sizeof(buf),
-            "</td><td class=\"buttons\"><a href=\"/show-status?file=actions&index=%u\">View</a>", i);
-         if (!err) err = string_append(&s, buf);
-
-#ifdef FEATURE_CGI_EDIT_ACTIONS
-         if ((csp->config->feature_flags & RUNTIME_FEATURE_CGI_EDIT_ACTIONS)
-            && (NULL == strstr(csp->actions_list[i]->filename, "standard.action"))
-            && (NULL != csp->config->actions_file_short[i]))
-         {
-#ifdef HAVE_ACCESS
-            if (access(csp->config->actions_file[i], W_OK) == 0)
-            {
-#endif /* def HAVE_ACCESS */
-               snprintf(buf, sizeof(buf), "  <a href=\"/edit-actions-list?f=%u\">Edit</a>", i);
-               if (!err) err = string_append(&s, buf);
-#ifdef HAVE_ACCESS
-            }
-            else
-            {
-               if (!err) err = string_append(&s, "  <strong>No write access.</strong>");
-            }
-#endif /* def HAVE_ACCESS */
-         }
-#endif
-
-         if (!err) err = string_append(&s, "</td></tr>\n");
-      }
-   }
-   if (*s != '\0')   
-   {
-      if (!err) err = map(exports, "actions-filenames", 1, s, 0);
-   }
-   else
-   {
-      if (!err) err = map(exports, "actions-filenames", 1, "<tr><td>None specified</td></tr>", 1);
-   }
-
-   /* 
-    * List all re_filterfiles in use, together with view options.
-    * FIXME: Shouldn't include hardwired HTML here, use line template instead!
-    */
-   s = strdup("");
-   for (i = 0; i < MAX_AF_FILES; i++)
-   {
-      if (csp->rlist[i] != NULL)
-      {
-         if (!err) err = string_append(&s, "<tr><td>");
-         if (!err) err = string_join(&s, html_encode(csp->rlist[i]->filename));
-         snprintf(buf, sizeof(buf),
-            "</td><td class=\"buttons\"><a href=\"/show-status?file=filter&index=%u\">View</a>", i);
-         if (!err) err = string_append(&s, buf);
-         if (!err) err = string_append(&s, "</td></tr>\n");
-      }
-   }
-   if (*s != '\0')   
-   {
-      if (!err) err = map(exports, "re-filter-filenames", 1, s, 0);
-   }
-   else
-   {
-      if (!err) err = map(exports, "re-filter-filenames", 1, "<tr><td>None specified</td></tr>", 1);
-      if (!err) err = map_block_killer(exports, "have-filterfile");
-   }
-
-#ifdef FEATURE_TRUST
-   if (csp->tlist)
-   {
-      if (!err) err = map(exports, "trust-filename", 1, html_encode(csp->tlist->filename), 0);
-   }
-   else
-   {
-      if (!err) err = map(exports, "trust-filename", 1, "None specified", 1);
-      if (!err) err = map_block_killer(exports, "have-trustfile");
-   }
-#else
-   if (!err) err = map_block_killer(exports, "trust-support");
-#endif /* ndef FEATURE_TRUST */
-
-#ifdef FEATURE_CGI_EDIT_ACTIONS
-   if (!err && (csp->config->feature_flags & RUNTIME_FEATURE_CGI_EDIT_ACTIONS))
-   {
-      err = map_block_killer(exports, "cgi-editor-is-disabled");
-   }
-#endif /* ndef CGI_EDIT_ACTIONS */
-
-   if (err)
-   {
-      free_map(exports);
-      return JB_ERR_MEMORY;
-   }
-
-   return template_fill_for_cgi(csp, "show-status", exports, rsp);
-}
-
- 
-/*********************************************************************
- *
- * Function    :  cgi_show_url_info
- *
- * Description :  CGI function that determines and shows which actions
- *                Privoxy will perform for a given url, and which
- *                matches starting from the defaults have lead to that.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters :
- *            url : The url whose actions are to be determined.
- *                  If url is unset, the url-given conditional will be
- *                  set, so that all but the form can be suppressed in
- *                  the template.
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err cgi_show_url_info(struct client_state *csp,
-                         struct http_response *rsp,
-                         const struct map *parameters)
-{
-   char *url_param;
-   struct map *exports;
-   char buf[150];
-
-   assert(csp);
-   assert(rsp);
-   assert(parameters);
-
-   if (NULL == (exports = default_exports(csp, "show-url-info")))
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   /*
-    * Get the url= parameter (if present) and remove any leading/trailing spaces.
-    */
-   url_param = strdup(lookup(parameters, "url"));
-   if (url_param == NULL)
-   {
-      free_map(exports);
-      return JB_ERR_MEMORY;
-   }
-   chomp(url_param);
-
-   /*
-    * Handle prefixes.  4 possibilities:
-    * 1) "http://" or "https://" prefix present and followed by URL - OK
-    * 2) Only the "http://" or "https://" part is present, no URL - change
-    *    to empty string so it will be detected later as "no URL".
-    * 3) Parameter specified but doesn't contain "http(s?)://" - add a
-    *    "http://" prefix.
-    * 4) Parameter not specified or is empty string - let this fall through
-    *    for now, next block of code will handle it.
-    */
-   if (0 == strncmp(url_param, "http://", 7))
-   {
-      if (url_param[7] == '\0')
-      {
-         /*
-          * Empty URL (just prefix).
-          * Make it totally empty so it's caught by the next if()
-          */
-         url_param[0] = '\0';
-      }
-   }
-   else if (0 == strncmp(url_param, "https://", 8))
-   {
-      if (url_param[8] == '\0')
-      {
-         /*
-          * Empty URL (just prefix).
-          * Make it totally empty so it's caught by the next if()
-          */
-         url_param[0] = '\0';
-      }
-   }
-   else if ((url_param[0] != '\0') && (NULL == strstr(url_param, "://")))
-   {
-      /* No prefix - assume http:// */
-      char *url_param_prefixed = strdup("http://");
-
-      if (JB_ERR_OK != string_join(&url_param_prefixed, url_param))
-      {
-         free_map(exports);
-         return JB_ERR_MEMORY;
-      }
-      url_param = url_param_prefixed;
-   }
-
-   /*
-    * Hide "toggle off" warning if Privoxy is toggled on.
-    */
-   if (
-#ifdef FEATURE_TOGGLE
-       (global_toggle_state == 1) &&
-#endif /* def FEATURE_TOGGLE */
-       map_block_killer(exports, "privoxy-is-toggled-off")
-      )
-   {
-      free_map(exports);
-      return JB_ERR_MEMORY;
-   }
-
-   if (url_param[0] == '\0')
-   {
-      /* URL paramater not specified, display query form only. */
-      free(url_param);
-      if (map_block_killer(exports, "url-given")
-        || map(exports, "url", 1, "", 1))
-      {
-         free_map(exports);
-         return JB_ERR_MEMORY;
-      }
-   }
-   else
-   {
-      /* Given a URL, so query it. */
-      jb_err err;
-      char *matches;
-      char *s;
-      int hits = 0;
-      struct file_list *fl;
-      struct url_actions *b;
-      struct http_request url_to_query[1];
-      struct current_action_spec action[1];
-      int i;
-      
-      if (map(exports, "url", 1, html_encode(url_param), 0))
-      {
-         free(url_param);
-         free_map(exports);
-         return JB_ERR_MEMORY;
-      }
-
-      init_current_action(action);
-
-      if (map(exports, "default", 1, current_action_to_html(csp, action), 0))
-      {
-         free_current_action(action);
-         free(url_param);
-         free_map(exports);
-         return JB_ERR_MEMORY;
-      }
-
-      memset(url_to_query, '\0', sizeof(url_to_query));
-      err = parse_http_url(url_param, url_to_query, REQUIRE_PROTOCOL);
-      assert((err != JB_ERR_OK) || (url_to_query->ssl == !strncmpic(url_param, "https://", 8)));
-
-      free(url_param);
-
-      if (err == JB_ERR_MEMORY)
-      {
-         free_http_request(url_to_query);
-         free_current_action(action);
-         free_map(exports);
-         return JB_ERR_MEMORY;
-      }
-      else if (err)
-      {
-         /* Invalid URL */
-
-         err = map(exports, "matches", 1, "<b>[Invalid URL specified!]</b>" , 1);
-         if (!err) err = map(exports, "final", 1, lookup(exports, "default"), 1);
-         if (!err) err = map_block_killer(exports, "valid-url");
-
-         free_current_action(action);
-         free_http_request(url_to_query);
-
-         if (err)
-         {
-            free_map(exports);
-            return JB_ERR_MEMORY;
-         }
-
-         return template_fill_for_cgi(csp, "show-url-info", exports, rsp);
-      }
-
-      /*
-       * We have a warning about SSL paths.  Hide it for unencrypted sites.
-       */
-      if (!url_to_query->ssl)
-      {
-         if (map_block_killer(exports, "https"))
-         {
-            free_current_action(action);
-            free_map(exports);
-            free_http_request(url_to_query);
-            return JB_ERR_MEMORY;
-         }
-      }
-
-      matches = strdup("<table summary=\"\" class=\"transparent\">");
-
-      for (i = 0; i < MAX_AF_FILES; i++)
-      {
-         if (NULL == csp->config->actions_file_short[i]
-             || !strcmp(csp->config->actions_file_short[i], "standard.action")) continue;
-
-         b = NULL;
-         hits = 1;
-         if ((fl = csp->actions_list[i]) != NULL)
-         {
-            if ((b = fl->f) != NULL)
-            {
-               /* FIXME: Hardcoded HTML! */
-               string_append(&matches, "<tr><th>In file: ");
-               string_join  (&matches, html_encode(csp->config->actions_file_short[i]));
-               snprintf(buf, sizeof(buf), " <a class=\"cmd\" href=\"/show-status?file=actions&index=%d\">", i);
-               string_append(&matches, buf);
-               string_append(&matches, "View</a>");
-#ifdef FEATURE_CGI_EDIT_ACTIONS
-               if (csp->config->feature_flags & RUNTIME_FEATURE_CGI_EDIT_ACTIONS)
-               {
-#ifdef HAVE_ACCESS
-                  if (access(csp->config->actions_file[i], W_OK) == 0)
-                  {
-#endif /* def HAVE_ACCESS */
-                     snprintf(buf, sizeof(buf),
-                        " <a class=\"cmd\" href=\"/edit-actions-list?f=%d\">", i);
-                     string_append(&matches, buf);
-                     string_append(&matches, "Edit</a>");
-#ifdef HAVE_ACCESS
-                  }
-                  else
-                  {
-                     string_append(&matches, " <strong>No write access.</strong>");
-                  }
-#endif /* def HAVE_ACCESS */
-               }
-#endif /* FEATURE_CGI_EDIT_ACTIONS */
-
-               string_append(&matches, "</th></tr>\n");
-
-               hits = 0;
-               b = b->next;
-            }
-         }
-
-         for (; (b != NULL) && (matches != NULL); b = b->next)
-         {
-            if (url_match(b->url, url_to_query))
-            {
-               string_append(&matches, "<tr><td>{");
-               string_join  (&matches, actions_to_html(csp, b->action));
-               string_append(&matches, " }<br>\n<code>");
-               string_join  (&matches, html_encode(b->url->spec));
-               string_append(&matches, "</code></td></tr>\n");
-
-               if (merge_current_action(action, b->action))
-               {
-                  freez(matches);
-                  free_http_request(url_to_query);
-                  free_current_action(action);
-                  free_map(exports);
-                  return JB_ERR_MEMORY;
-               }
-               hits++;
-            }
-         }
-
-         if (!hits)
-         {
-            string_append(&matches, "<tr><td>(no matches in this file)</td></tr>\n");
-         }
-      }
-      string_append(&matches, "</table>\n");
-
-      /*
-       * XXX: Kludge to make sure the "Forward settings" section
-       * shows what forward-override{} would do with the requested URL.
-       * No one really cares how the CGI request would be forwarded
-       * if it wasn't intercepted as CGI request in the first place.
-       *
-       * From here on the action bitmask will no longer reflect
-       * the real url (http://config.privoxy.org/show-url-info?url=.*),
-       * but luckily it's no longer required later on anyway.
-       */
-      free_current_action(csp->action);
-      get_url_actions(csp, url_to_query);
-
-      /*
-       * Fill in forwarding settings.
-       *
-       * The possibilities are:
-       *  - no forwarding
-       *  - http forwarding only
-       *  - socks4(a) forwarding only
-       *  - socks4(a) and http forwarding.
-       *
-       * XXX: Parts of this code could be reused for the
-       * "forwarding-failed" template which currently doesn't
-       * display the proxy port and an eventual second forwarder.
-       */
-      {
-         const struct forward_spec *fwd = forward_url(csp, url_to_query);
-
-         if ((fwd->gateway_host == NULL) && (fwd->forward_host == NULL))
-         {
-            if (!err) err = map_block_killer(exports, "socks-forwarder");
-            if (!err) err = map_block_killer(exports, "http-forwarder");
-         }
-         else
-         {
-            char port[10]; /* We save proxy ports as int but need a string here */
-
-            if (!err) err = map_block_killer(exports, "no-forwarder");
-
-            if (fwd->gateway_host != NULL)
-            {
-               char *socks_type = NULL;
-
-               switch (fwd->type)
-               {
-                  case SOCKS_4:
-                     socks_type = "socks4";
-                     break;
-                  case SOCKS_4A:
-                     socks_type = "socks4a";
-                     break;
-                  case SOCKS_5:
-                     socks_type = "socks5";
-                     break;
-                  default:
-                     log_error(LOG_LEVEL_FATAL, "Unknown socks type: %d.", fwd->type);
-               }
-
-               if (!err) err = map(exports, "socks-type", 1, socks_type, 1);
-               if (!err) err = map(exports, "gateway-host", 1, fwd->gateway_host, 1);
-               snprintf(port, sizeof(port), "%d", fwd->gateway_port);
-               if (!err) err = map(exports, "gateway-port", 1, port, 1);
-            }
-            else
-            {
-               if (!err) err = map_block_killer(exports, "socks-forwarder");
-            }
-
-            if (fwd->forward_host != NULL)
-            {
-               if (!err) err = map(exports, "forward-host", 1, fwd->forward_host, 1);
-               snprintf(port, sizeof(port), "%d", fwd->forward_port);
-               if (!err) err = map(exports, "forward-port", 1, port, 1);
-            }
-            else
-            {
-               if (!err) err = map_block_killer(exports, "http-forwarder");
-            }
-         }
-      }
-
-      free_http_request(url_to_query);
-
-      if (err || matches == NULL)
-      {
-         free_current_action(action);
-         free_map(exports);
-         return JB_ERR_MEMORY;
-      }
-
-#ifdef FEATURE_CGI_EDIT_ACTIONS
-      if ((csp->config->feature_flags & RUNTIME_FEATURE_CGI_EDIT_ACTIONS))
-      {
-         err = map_block_killer(exports, "cgi-editor-is-disabled");
-      }
-#endif /* FEATURE_CGI_EDIT_ACTIONS */
-
-      /*
-       * If zlib support is available, if no content filters
-       * are enabled or if the prevent-compression action is enabled,
-       * suppress the "compression could prevent filtering" warning.
-       */
-#ifndef FEATURE_ZLIB
-      if (!content_filters_enabled(action) ||
-         (action->flags & ACTION_NO_COMPRESSION))
-#endif
-      {
-         if (!err) err = map_block_killer(exports, "filters-might-be-ineffective");
-      }
-
-      if (err || map(exports, "matches", 1, matches , 0))
-      {
-         free_current_action(action);
-         free_map(exports);
-         return JB_ERR_MEMORY;
-      }
-
-      s = current_action_to_html(csp, action);
-
-      free_current_action(action);
-
-      if (map(exports, "final", 1, s, 0))
-      {
-         free_map(exports);
-         return JB_ERR_MEMORY;
-      }
-   }
-
-   return template_fill_for_cgi(csp, "show-url-info", exports, rsp);
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_robots_txt
- *
- * Description :  CGI function to return "/robots.txt".
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters : None
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-jb_err cgi_robots_txt(struct client_state *csp,
-                      struct http_response *rsp,
-                      const struct map *parameters)
-{
-   char buf[100];
-   jb_err err;
-
-   (void)csp;
-   (void)parameters;
-
-   rsp->body = strdup(
-      "# This is the Privoxy control interface.\n"
-      "# It isn't very useful to index it, and you're likely to break stuff.\n"
-      "# So go away!\n"
-      "\n"
-      "User-agent: *\n"
-      "Disallow: /\n"
-      "\n");
-   if (rsp->body == NULL)
-   {
-      return JB_ERR_MEMORY;
-   }
-
-   err = enlist_unique(rsp->headers, "Content-Type: text/plain", 13);
-
-   rsp->is_static = 1;
-
-   get_http_time(7 * 24 * 60 * 60, buf, sizeof(buf)); /* 7 days into future */
-   if (!err) err = enlist_unique_header(rsp->headers, "Expires", buf);
-
-   return (err ? JB_ERR_MEMORY : JB_ERR_OK);
-}
-
-
-/*********************************************************************
- *
- * Function    :  show_defines
- *
- * Description :  Add to a map the state od all conditional #defines
- *                used when building
- *
- * Parameters  :
- *          1  :  exports = map to extend
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-static jb_err show_defines(struct map *exports)
-{
-   jb_err err = JB_ERR_OK;
-
-#ifdef FEATURE_ACL
-   if (!err) err = map_conditional(exports, "FEATURE_ACL", 1);
-#else /* ifndef FEATURE_ACL */
-   if (!err) err = map_conditional(exports, "FEATURE_ACL", 0);
-#endif /* ndef FEATURE_ACL */
-
-#ifdef FEATURE_CGI_EDIT_ACTIONS
-   if (!err) err = map_conditional(exports, "FEATURE_CGI_EDIT_ACTIONS", 1);
-#else /* ifndef FEATURE_CGI_EDIT_ACTIONS */
-   if (!err) err = map_conditional(exports, "FEATURE_CGI_EDIT_ACTIONS", 0);
-#endif /* ndef FEATURE_CGI_EDIT_ACTIONS */
-
-#ifdef FEATURE_CONNECTION_KEEP_ALIVE
-   if (!err) err = map_conditional(exports, "FEATURE_CONNECTION_KEEP_ALIVE", 1);
-#else /* ifndef FEATURE_CGI_EDIT_ACTIONS */
-   if (!err) err = map_conditional(exports, "FEATURE_CONNECTION_KEEP_ALIVE", 0);
-#endif /* ndef FEATURE_CONNECTION_KEEP_ALIVE */
-
-#ifdef FEATURE_FAST_REDIRECTS
-   if (!err) err = map_conditional(exports, "FEATURE_FAST_REDIRECTS", 1);
-#else /* ifndef FEATURE_FAST_REDIRECTS */
-   if (!err) err = map_conditional(exports, "FEATURE_FAST_REDIRECTS", 0);
-#endif /* ndef FEATURE_FAST_REDIRECTS */
-
-#ifdef FEATURE_FORCE_LOAD
-   if (!err) err = map_conditional(exports, "FEATURE_FORCE_LOAD", 1);
-   if (!err) err = map(exports, "FORCE_PREFIX", 1, FORCE_PREFIX, 1);
-#else /* ifndef FEATURE_FORCE_LOAD */
-   if (!err) err = map_conditional(exports, "FEATURE_FORCE_LOAD", 0);
-   if (!err) err = map(exports, "FORCE_PREFIX", 1, "(none - disabled)", 1);
-#endif /* ndef FEATURE_FORCE_LOAD */
-
-#ifdef FEATURE_GRACEFUL_TERMINATION
-   if (!err) err = map_conditional(exports, "FEATURE_GRACEFUL_TERMINATION", 1);
-#else /* ifndef FEATURE_GRACEFUL_TERMINATION */
-   if (!err) err = map_conditional(exports, "FEATURE_GRACEFUL_TERMINATION", 0);
-#endif /* ndef FEATURE_GRACEFUL_TERMINATION */
-
-#ifdef FEATURE_IMAGE_BLOCKING
-   if (!err) err = map_conditional(exports, "FEATURE_IMAGE_BLOCKING", 1);
-#else /* ifndef FEATURE_IMAGE_BLOCKING */
-   if (!err) err = map_conditional(exports, "FEATURE_IMAGE_BLOCKING", 0);
-#endif /* ndef FEATURE_IMAGE_BLOCKING */
-
-#ifdef FEATURE_IMAGE_DETECT_MSIE
-   if (!err) err = map_conditional(exports, "FEATURE_IMAGE_DETECT_MSIE", 1);
-#else /* ifndef FEATURE_IMAGE_DETECT_MSIE */
-   if (!err) err = map_conditional(exports, "FEATURE_IMAGE_DETECT_MSIE", 0);
-#endif /* ndef FEATURE_IMAGE_DETECT_MSIE */
-
-#ifdef FEATURE_NO_GIFS
-   if (!err) err = map_conditional(exports, "FEATURE_NO_GIFS", 1);
-#else /* ifndef FEATURE_NO_GIFS */
-   if (!err) err = map_conditional(exports, "FEATURE_NO_GIFS", 0);
-#endif /* ndef FEATURE_NO_GIFS */
-
-#ifdef FEATURE_PTHREAD
-   if (!err) err = map_conditional(exports, "FEATURE_PTHREAD", 1);
-#else /* ifndef FEATURE_PTHREAD */
-   if (!err) err = map_conditional(exports, "FEATURE_PTHREAD", 0);
-#endif /* ndef FEATURE_PTHREAD */
-
-#ifdef FEATURE_STATISTICS
-   if (!err) err = map_conditional(exports, "FEATURE_STATISTICS", 1);
-#else /* ifndef FEATURE_STATISTICS */
-   if (!err) err = map_conditional(exports, "FEATURE_STATISTICS", 0);
-#endif /* ndef FEATURE_STATISTICS */
-
-#ifdef FEATURE_TOGGLE
-   if (!err) err = map_conditional(exports, "FEATURE_TOGGLE", 1);
-#else /* ifndef FEATURE_TOGGLE */
-   if (!err) err = map_conditional(exports, "FEATURE_TOGGLE", 0);
-#endif /* ndef FEATURE_TOGGLE */
-
-#ifdef FEATURE_TRUST
-   if (!err) err = map_conditional(exports, "FEATURE_TRUST", 1);
-#else /* ifndef FEATURE_TRUST */
-   if (!err) err = map_conditional(exports, "FEATURE_TRUST", 0);
-#endif /* ndef FEATURE_TRUST */
-
-#ifdef FEATURE_ZLIB
-   if (!err) err = map_conditional(exports, "FEATURE_ZLIB", 1);
-#else /* ifndef FEATURE_ZLIB */
-   if (!err) err = map_conditional(exports, "FEATURE_ZLIB", 0);
-#endif /* ndef FEATURE_ZLIB */
-
-#ifdef STATIC_PCRE
-   if (!err) err = map_conditional(exports, "STATIC_PCRE", 1);
-#else /* ifndef STATIC_PCRE */
-   if (!err) err = map_conditional(exports, "STATIC_PCRE", 0);
-#endif /* ndef STATIC_PCRE */
-
-#ifdef STATIC_PCRS
-   if (!err) err = map_conditional(exports, "STATIC_PCRS", 1);
-#else /* ifndef STATIC_PCRS */
-   if (!err) err = map_conditional(exports, "STATIC_PCRS", 0);
-#endif /* ndef STATIC_PCRS */
-
-   return err;
-}
-
-
-/*********************************************************************
- *
- * Function    :  show_rcs
- *
- * Description :  Create a string with the rcs info for all sourcefiles
- *
- * Parameters  :  None
- *
- * Returns     :  A string, or NULL on out-of-memory.
- *
- *********************************************************************/
-static char *show_rcs(void)
-{
-   char *result = strdup("");
-   char buf[BUFFER_SIZE];
-
-   /* Instead of including *all* dot h's in the project (thus creating a
-    * tremendous amount of dependencies), I will concede to declaring them
-    * as extern's.  This forces the developer to add to this list, but oh well.
-    */
-
-#define SHOW_RCS(__x)              \
-   {                               \
-      extern const char __x[];     \
-      snprintf(buf, sizeof(buf), " %s\n", __x);   \
-      string_append(&result, buf); \
-   }
-
-   /* In alphabetical order */
-   SHOW_RCS(actions_h_rcs)
-   SHOW_RCS(actions_rcs)
-#ifdef AMIGA
-   SHOW_RCS(amiga_h_rcs)
-   SHOW_RCS(amiga_rcs)
-#endif /* def AMIGA */
-   SHOW_RCS(cgi_h_rcs)
-   SHOW_RCS(cgi_rcs)
-#ifdef FEATURE_CGI_EDIT_ACTIONS
-   SHOW_RCS(cgiedit_h_rcs)
-   SHOW_RCS(cgiedit_rcs)
-#endif /* def FEATURE_CGI_EDIT_ACTIONS */
-   SHOW_RCS(cgisimple_h_rcs)
-   SHOW_RCS(cgisimple_rcs)
-#ifdef __MINGW32__
-   SHOW_RCS(cygwin_h_rcs)
-#endif
-   SHOW_RCS(deanimate_h_rcs)
-   SHOW_RCS(deanimate_rcs)
-   SHOW_RCS(encode_h_rcs)
-   SHOW_RCS(encode_rcs)
-   SHOW_RCS(errlog_h_rcs)
-   SHOW_RCS(errlog_rcs)
-   SHOW_RCS(filters_h_rcs)
-   SHOW_RCS(filters_rcs)
-   SHOW_RCS(gateway_h_rcs)
-   SHOW_RCS(gateway_rcs)
-   SHOW_RCS(jbsockets_h_rcs)
-   SHOW_RCS(jbsockets_rcs)
-   SHOW_RCS(jcc_h_rcs)
-   SHOW_RCS(jcc_rcs)
-   SHOW_RCS(list_h_rcs)
-   SHOW_RCS(list_rcs)
-   SHOW_RCS(loadcfg_h_rcs)
-   SHOW_RCS(loadcfg_rcs)
-   SHOW_RCS(loaders_h_rcs)
-   SHOW_RCS(loaders_rcs)
-   SHOW_RCS(miscutil_h_rcs)
-   SHOW_RCS(miscutil_rcs)
-   SHOW_RCS(parsers_h_rcs)
-   SHOW_RCS(parsers_rcs)
-   SHOW_RCS(pcrs_rcs)
-   SHOW_RCS(pcrs_h_rcs)
-   SHOW_RCS(project_h_rcs)
-   SHOW_RCS(ssplit_h_rcs)
-   SHOW_RCS(ssplit_rcs)
-   SHOW_RCS(urlmatch_h_rcs)
-   SHOW_RCS(urlmatch_rcs)
-#ifdef _WIN32
-#ifndef _WIN_CONSOLE
-   SHOW_RCS(w32log_h_rcs)
-   SHOW_RCS(w32log_rcs)
-   SHOW_RCS(w32res_h_rcs)
-   SHOW_RCS(w32taskbar_h_rcs)
-   SHOW_RCS(w32taskbar_rcs)
-#endif /* ndef _WIN_CONSOLE */
-   SHOW_RCS(win32_h_rcs)
-   SHOW_RCS(win32_rcs)
-#endif /* def _WIN32 */
-
-#undef SHOW_RCS
-
-   return result;
-
-}
-
-
-/*********************************************************************
- *
- * Function    :  cgi_show_file
- *
- * Description :  CGI function that shows the content of a
- *                configuration file.
- *
- * Parameters  :
- *          1  :  csp = Current client state (buffers, headers, etc...)
- *          2  :  rsp = http_response data structure for output
- *          3  :  parameters = map of cgi parameters
- *
- * CGI Parameters :
- *        file :  Which file to show.  Only first letter is checked,
- *                valid values are:
- *                - "a"ction file
- *                - "r"egex
- *                - "t"rust
- *                Default is to show menu and other information.
- *
- * Returns     :  JB_ERR_OK on success
- *                JB_ERR_MEMORY on out-of-memory error.  
- *
- *********************************************************************/
-static jb_err cgi_show_file(struct client_state *csp,
-                            struct http_response *rsp,
-                            const struct map *parameters)
-{
-   unsigned i;
-   const char * filename = NULL;
-   char * file_description = NULL;
-
-   assert(csp);
-   assert(rsp);
-   assert(parameters);
-
-   switch (*(lookup(parameters, "file")))
-   {
-   case 'a':
-      if (!get_number_param(csp, parameters, "index", &i) && i < MAX_AF_FILES && csp->actions_list[i])
-      {
-         filename = csp->actions_list[i]->filename;
-         file_description = "Actions File";
-      }
-      break;
-
-   case 'f':
-      if (!get_number_param(csp, parameters, "index", &i) && i < MAX_AF_FILES && csp->rlist[i])
-      {
-         filename = csp->rlist[i]->filename;
-         file_description = "Filter File";
-      }
-      break;
-
-#ifdef FEATURE_TRUST
-   case 't':
-      if (csp->tlist)
-      {
-         filename = csp->tlist->filename;
-         file_description = "Trust File";
-      }
-      break;
-#endif /* def FEATURE_TRUST */
-   }
-
-   if (NULL != filename)
-   {
-      struct map *exports;
-      char *s;
-      jb_err err;
-      size_t length;
-
-      exports = default_exports(csp, "show-status");
-      if (NULL == exports)
-      {
-         return JB_ERR_MEMORY;
-      }
-
-      if ( map(exports, "file-description", 1, file_description, 1)
-        || map(exports, "filepath", 1, html_encode(filename), 0) )
-      {
-         free_map(exports);
-         return JB_ERR_MEMORY;
-      }
-
-      err = load_file(filename, &s, &length);
-      if (JB_ERR_OK != err)
-      {
-         if (map(exports, "contents", 1, "<h1>ERROR OPENING FILE!</h1>", 1))
-         {
-            free_map(exports);
-            return JB_ERR_MEMORY;
-         }
-      }
-      else
-      {
-         s = html_encode_and_free_original(s);
-         if (NULL == s)
-         {
-            return JB_ERR_MEMORY;
-         }
-
-         if (map(exports, "contents", 1, s, 0))
-         {
-            free_map(exports);
-            return JB_ERR_MEMORY;
-         }
-      }
-
-      return template_fill_for_cgi(csp, "show-status-file", exports, rsp);
-   }
-
-   return JB_ERR_CGI_PARAMS;
-}
-
- 
-/*********************************************************************
- *
- * Function    :  load_file
- *
- * Description :  Loads a file into a buffer.
- *
- * Parameters  :
- *          1  :  filename = Name of the file to be loaded.
- *          2  :  buffer   = Used to return the file's content.
- *          3  :  length   = Used to return the size of the file.
- *
- * Returns     :  JB_ERR_OK in case of success,
- *                JB_ERR_FILE in case of ordinary file loading errors
- *                            (fseek() and ftell() errors are fatal)
- *                JB_ERR_MEMORY in case of out-of-memory.
- *
- *********************************************************************/
-static jb_err load_file(const char *filename, char **buffer, size_t *length)
-{
-   FILE *fp;
-   long ret;
-   jb_err err = JB_ERR_OK;
-
-   fp = fopen(filename, "rb");
-   if (NULL == fp)
-   {
-      return JB_ERR_FILE;
-   }
-
-   /* Get file length */
-   if (fseek(fp, 0, SEEK_END))
-   {
-      log_error(LOG_LEVEL_FATAL,
-         "Unexpected error while fseek()ing to the end of %s: %E",
-         filename);
-   }
-   ret = ftell(fp);
-   if (-1 == ret)
-   {
-      log_error(LOG_LEVEL_FATAL,
-         "Unexpected ftell() error while loading %s: %E",
-         filename);
-   }
-   *length = (size_t)ret;
-
-   /* Go back to the beginning. */
-   if (fseek(fp, 0, SEEK_SET))
-   {
-      log_error(LOG_LEVEL_FATAL,
-         "Unexpected error while fseek()ing to the beginning of %s: %E",
-         filename);
-   }
-
-   *buffer = (char *)zalloc(*length + 1);
-   if (NULL == *buffer)
-   {
-      err = JB_ERR_MEMORY;
-   }
-   else if (!fread(*buffer, *length, 1, fp))
-   {
-      /*
-       * May happen if the file size changes between fseek() and
-       * fread(). If it does, we just log it and serve what we got.
-       */
-      log_error(LOG_LEVEL_ERROR,
-         "Couldn't completely read file %s.", filename);
-      err = JB_ERR_FILE;
-   }
-
-   fclose(fp);
-
-   return err;
-
-}
-
-
-/*
-  Local Variables:
-  tab-width: 3
-  end:
-*/
diff --git a/external/privoxy/cgisimple.h b/external/privoxy/cgisimple.h
deleted file mode 100644
index 2bce214..0000000
--- a/external/privoxy/cgisimple.h
+++ /dev/null
@@ -1,185 +0,0 @@
-#ifndef CGISIMPLE_H_INCLUDED
-#define CGISIMPLE_H_INCLUDED
-#define CGISIMPLE_H_VERSION "$Id: cgisimple.h,v 1.16 2008/05/26 17:30:55 fabiankeil Exp $"
-/*********************************************************************
- *
- * File        :  $Source: /cvsroot/ijbswa/current/cgisimple.h,v $
- *
- * Purpose     :  Declares functions to intercept request, generate
- *                html or gif answers, and to compose HTTP resonses.
- *                
- *                Functions declared include:
- * 
- *
- * Copyright   :  Written by and Copyright (C) 2001-2007 the SourceForge
- *                Privoxy team. http://www.privoxy.org/
- *
- *                Based on the Internet Junkbuster originally written
- *                by and Copyright (C) 1997 Anonymous Coders and 
- *                Junkbusters Corporation.  http://www.junkbusters.com
- *
- *                This program is free software; you can redistribute it 
- *                and/or modify it under the terms of the GNU General
- *                Public License as published by the Free Software
- *                Foundation; either version 2 of the License, or (at
- *                your option) any later version.
- *
- *                This program is distributed in the hope that it will
- *                be useful, but WITHOUT ANY WARRANTY; without even the
- *                implied warranty of MERCHANTABILITY or FITNESS FOR A
- *                PARTICULAR PURPOSE.  See the GNU General Public
- *                License for more details.
- *
- *                The GNU General Public License should be included with
- *                this file.  If not, you can view it at
- *                http://www.gnu.org/copyleft/gpl.html
- *                or write to the Free Software Foundation, Inc., 59
- *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * Revisions   :
- *    $Log: cgisimple.h,v $
- *    Revision 1.16  2008/05/26 17:30:55  fabiankeil
- *    Provide an OpenSearch Description to access the
- *    show-url-info page through "search engine plugins".
- *
- *    Revision 1.15  2007/01/23 15:51:17  fabiankeil
- *    Add favicon delivery functions.
- *
- *    Revision 1.14  2006/09/06 18:45:03  fabiankeil
- *    Incorporate modified version of Roland Rosenfeld's patch to
- *    optionally access the user-manual via Privoxy. Closes patch 679075.
- *
- *    Formatting changed to Privoxy style, added call to
- *    cgi_error_no_template if the requested file doesn't
- *    exist and modified check whether or not Privoxy itself
- *    should serve the manual. Should work cross-platform now.
- *
- *    Revision 1.13  2006/07/18 14:48:45  david__schmidt
- *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
- *    with what was really the latest development (the v_3_0_branch branch)
- *
- *    Revision 1.11  2002/04/05 15:50:53  oes
- *    added send-stylesheet CGI
- *
- *    Revision 1.10  2002/03/26 22:29:54  swa
- *    we have a new homepage!
- *
- *    Revision 1.9  2002/03/24 13:25:43  swa
- *    name change related issues
- *
- *    Revision 1.8  2002/03/16 23:54:06  jongfoster
- *    Adding graceful termination feature, to help look for memory leaks.
- *    If you enable this (which, by design, has to be done by hand
- *    editing config.h) and then go to http://i.j.b/die, then the program
- *    will exit cleanly after the *next* request.  It should free all the
- *    memory that was used.
- *
- *    Revision 1.7  2002/03/08 16:43:59  oes
- *    Renamed cgi_transparent_png to cgi_transparent_image
- *
- *    Revision 1.6  2002/03/07 03:48:59  oes
- *     - Changed built-in images from GIF to PNG
- *       (with regard to Unisys patent issue)
- *
- *    Revision 1.5  2002/01/22 23:26:03  jongfoster
- *    Adding cgi_transparent_gif() for http://i.j.b/t
- *
- *    Revision 1.4  2001/10/23 21:48:19  jongfoster
- *    Cleaning up error handling in CGI functions - they now send back
- *    a HTML error page and should never cause a FATAL error.  (Fixes one
- *    potential source of "denial of service" attacks).
- *
- *    CGI actions file editor that works and is actually useful.
- *
- *    Ability to toggle JunkBuster remotely using a CGI call.
- *
- *    You can turn off both the above features in the main configuration
- *    file, e.g. if you are running a multi-user proxy.
- *
- *    Revision 1.3  2001/10/14 22:00:32  jongfoster
- *    Adding support for a 404 error when an invalid CGI page is requested.
- *
- *    Revision 1.2  2001/10/02 15:31:20  oes
- *    Introduced show-request cgi
- *
- *    Revision 1.1  2001/09/16 17:08:54  jongfoster
- *    Moving simple CGI functions from cgi.c to new file cgisimple.c
- *
- *
- **********************************************************************/
-
-
-#include "project.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * CGI functions
- */
-extern jb_err cgi_default      (struct client_state *csp,
-                                struct http_response *rsp,
-                                const struct map *parameters);
-extern jb_err cgi_error_404    (struct client_state *csp,
-                                struct http_response *rsp,
-                                const struct map *parameters);
-extern jb_err cgi_robots_txt   (struct client_state *csp,
-                                struct http_response *rsp,
-                                const struct map *parameters);
-extern jb_err cgi_send_banner  (struct client_state *csp,
-                                struct http_response *rsp,
-                                const struct map *parameters);
-extern jb_err cgi_show_status  (struct client_state *csp,
-                                struct http_response *rsp,
-                                const struct map *parameters);
-extern jb_err cgi_show_url_info(struct client_state *csp,
-                                struct http_response *rsp,
-                                const struct map *parameters);
-extern jb_err cgi_show_version (struct client_state *csp,
-                                struct http_response *rsp,
-                                const struct map *parameters);
-extern jb_err cgi_show_request (struct client_state *csp,
-                                struct http_response *rsp,
-                                const struct map *parameters);
-extern jb_err cgi_transparent_image (struct client_state *csp,
-                                     struct http_response *rsp,
-                                     const struct map *parameters);
-extern jb_err cgi_send_error_favicon (struct client_state *csp,
-                                      struct http_response *rsp,
-                                      const struct map *parameters);
-extern jb_err cgi_send_default_favicon (struct client_state *csp,
-                                        struct http_response *rsp,
-                                        const struct map *parameters);
-extern jb_err cgi_send_stylesheet(struct client_state *csp,
-                                  struct http_response *rsp,
-                                  const struct map *parameters);
-extern jb_err cgi_send_url_info_osd(struct client_state *csp,
-                                    struct http_response *rsp,
-                                    const struct map *parameters);
-extern jb_err cgi_send_user_manual(struct client_state *csp,
-                                   struct http_response *rsp,
-                                   const struct map *parameters);
-
-
-#ifdef FEATURE_GRACEFUL_TERMINATION
-extern jb_err cgi_die (struct client_state *csp,
-                       struct http_response *rsp,
-                       const struct map *parameters);
-#endif
-
-/* Revision control strings from this header and associated .c file */
-extern const char cgisimple_rcs[];
-extern const char cgisimple_h_rcs[];
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* ndef CGISIMPLE_H_INCLUDED */
-
-/*
-  Local Variables:
-  tab-width: 3
-  end:
-*/
diff --git a/external/privoxy/config b/external/privoxy/config
deleted file mode 100644
index 741382a..0000000
--- a/external/privoxy/config
+++ /dev/null
@@ -1,1530 +0,0 @@
-#        Sample Configuration File for Privoxy v3.0.12
-#
-#  $Id: config,v 1.76 2009/03/21 11:51:51 fabiankeil Exp $
-#
-#  Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/
-#
-####################################################################
-#                                                                  #
-#                      Table of Contents                           #
-#                                                                  #
-#        I. INTRODUCTION                                           #
-#       II. FORMAT OF THE CONFIGURATION FILE                       #
-#                                                                  #
-#        1. LOCAL SET-UP DOCUMENTATION                             #
-#        2. CONFIGURATION AND LOG FILE LOCATIONS                   #
-#        3. DEBUGGING                                              #
-#        4. ACCESS CONTROL AND SECURITY                            #
-#        5. FORWARDING                                             #
-#        6. WINDOWS GUI OPTIONS                                    #
-#                                                                  #
-####################################################################
-#
-#
-#  I. INTRODUCTION
-#   ===============
-#
-#  This file holds Privoxy's main configuration. Privoxy detects
-#  configuration changes automatically, so you don't have to restart
-#  it unless you want to load a different configuration file.
-#
-#  The configuration will be reloaded with the first request after
-#  the change was done, this request itself will still use the old
-#  configuration, though. In other words: it takes two requests before
-#  you see the result of your changes.  Requests that are dropped due
-#  to ACL don't trigger reloads.
-#
-#  When starting Privoxy on Unix systems, give the location of this
-#  file as last argument. On Windows systems, Privoxy will look for
-#  this file with the name 'config.txt' in the current working directory
-#  of the Privoxy process.
-#
-#
-#  II. FORMAT OF THE CONFIGURATION FILE
-#  ====================================
-#
-#  Configuration lines consist of an initial keyword followed by a
-#  list of values, all separated by whitespace (any number of spaces
-#  or tabs). For example,
-#
-#  actionsfile default.action
-#
-#  Indicates that the actionsfile is named 'default.action'.
-#
-#  The '#' indicates a comment. Any part of a line following a '#'
-#  is ignored, except if the '#' is preceded by a '\'.
-#
-#  Thus, by placing a # at the start of an existing configuration
-#  line, you can make it a comment and it will be treated as if it
-#  weren't there. This is called "commenting out" an option and can
-#  be useful. Removing the # again is called "uncommenting".
-#
-#  Note that commenting out an option and leaving it at its default
-#  are two completely different things! Most options behave very
-#  differently when unset.  See the "Effect if unset" explanation in
-#  each option's description for details.
-#
-#  Long lines can be continued on the next line by using a `\' as the
-#  last character.
-#
-#
-#
-#  1. LOCAL SET-UP DOCUMENTATION
-#  ==============================
-#
-#  If you intend to operate Privoxy for more users than just yourself,
-#  it might be a good idea to let them know how to reach you, what
-#  you block and why you do that, your policies, etc.
-#
-#
-#
-#  1.1. user-manual
-#  =================
-#
-#  Specifies:
-#
-#      Location of the Privoxy User Manual.
-#
-#  Type of value:
-#
-#      A fully qualified URI
-#
-#  Default value:
-#
-#      Unset
-#
-#  Effect if unset:
-#
-#      http://www.privoxy.org/version/user-manual/ will be used,
-#      where version is the Privoxy version.
-#
-#  Notes:
-#
-#      The User Manual URI is the single best source of information on
-#      Privoxy, and is used for help links from some of the internal
-#      CGI pages. The manual itself is normally packaged with the
-#      binary distributions, so you probably want to set this to a
-#      locally installed copy.
-#
-#      Examples:
-#
-#      The best all purpose solution is simply to put the full local
-#      PATH to where the User Manual is located:
-#
-#        user-manual  /usr/share/doc/privoxy/user-manual
-#
-#
-#      The User Manual is then available to anyone with
-#      access to Privoxy, by following the built-in URL:
-#      http://config.privoxy.org/user-manual/ (or the shortcut:
-#      http://p.p/user-manual/).
-#
-#      If the documentation is not on the local system, it can be
-#      accessed from a remote server, as:
-#
-#        user-manual  http://example.com/privoxy/user-manual/
-#
-#
-#      WARNING!!!
-#
-#          If set, this option should be the first option in the config
-#          file, because it is used while the config file is being read.
-#
-#user-manual http://www.privoxy.org/user-manual/
-#
-#
-#  1.2. trust-info-url
-#  ====================
-#
-#  Specifies:
-#
-#      A URL to be displayed in the error page that users will see if
-#      access to an untrusted page is denied.
-#
-#  Type of value:
-#
-#      URL
-#
-#  Default value:
-#
-#      Unset
-#
-#  Effect if unset:
-#
-#      No links are displayed on the "untrusted" error page.
-#
-#  Notes:
-#
-#      The value of this option only matters if the experimental trust
-#      mechanism has been activated. (See trustfile below.)
-#
-#      If you use the trust mechanism, it is a good idea to write
-#      up some on-line documentation about your trust policy and to
-#      specify the URL(s) here. Use multiple times for multiple URLs.
-#
-#      The URL(s) should be added to the trustfile as well, so users
-#      don't end up locked out from the information on why they were
-#      locked out in the first place!
-#
-#trust-info-url  http://www.example.com/why_we_block.html
-#trust-info-url  http://www.example.com/what_we_allow.html
-#
-#
-#  1.3. admin-address
-#  ===================
-#
-#  Specifies:
-#
-#      An email address to reach the Privoxy administrator.
-#
-#  Type of value:
-#
-#      Email address
-#
-#  Default value:
-#
-#      Unset
-#
-#  Effect if unset:
-#
-#      No email address is displayed on error pages and the CGI user
-#      interface.
-#
-#  Notes:
-#
-#      If both admin-address and proxy-info-url are unset, the whole
-#      "Local Privoxy Support" box on all generated pages will not
-#      be shown.
-#
-#admin-address privoxy-admin at example.com
-#
-#
-#  1.4. proxy-info-url
-#  ====================
-#
-#  Specifies:
-#
-#      A URL to documentation about the local Privoxy setup,
-#      configuration or policies.
-#
-#  Type of value:
-#
-#      URL
-#
-#  Default value:
-#
-#      Unset
-#
-#  Effect if unset:
-#
-#      No link to local documentation is displayed on error pages and
-#      the CGI user interface.
-#
-#  Notes:
-#
-#      If both admin-address and proxy-info-url are unset, the whole
-#      "Local Privoxy Support" box on all generated pages will not
-#      be shown.
-#
-#      This URL shouldn't be blocked ;-)
-#
-#proxy-info-url http://www.example.com/proxy-service.html
-#
-#
-#  2. CONFIGURATION AND LOG FILE LOCATIONS
-#  ========================================
-#
-#  Privoxy can (and normally does) use a number of other files for
-#  additional configuration, help and logging. This section of the
-#  configuration file tells Privoxy where to find those other files.
-#
-#  The user running Privoxy, must have read permission for all
-#  configuration files, and write permission to any files that would
-#  be modified, such as log files and actions files.
-#
-#
-#
-#  2.1. confdir
-#  =============
-#
-#  Specifies:
-#
-#      The directory where the other configuration files are located.
-#
-#  Type of value:
-#
-#      Path name
-#
-#  Default value:
-#
-#      /etc/privoxy (Unix) or Privoxy installation dir (Windows)
-#
-#  Effect if unset:
-#
-#      Mandatory
-#
-#  Notes:
-#
-#      No trailing "/", please.
-#
-confdir .
-#
-#
-#  2.2. templdir
-#  ==============
-#
-#  Specifies:
-#
-#      An alternative directory where the templates are loaded from.
-#
-#  Type of value:
-#
-#      Path name
-#
-#  Default value:
-#
-#      unset
-#
-#  Effect if unset:
-#
-#      The templates are assumed to be located in confdir/template.
-#
-#  Notes:
-#
-#      Privoxy's original templates are usually overwritten with each
-#      update. Use this option to relocate customized templates that
-#      should be kept. As template variables might change between
-#      updates, you shouldn't expect templates to work with Privoxy
-#      releases other than the one they were part of, though.
-#
-#templdir .
-#
-#
-#  2.3. logdir
-#  ============
-#
-#  Specifies:
-#
-#      The directory where all logging takes place (i.e. where the
-#      logfile is located).
-#
-#  Type of value:
-#
-#      Path name
-#
-#  Default value:
-#
-#      /var/log/privoxy (Unix) or Privoxy installation dir (Windows)
-#
-#  Effect if unset:
-#
-#      Mandatory
-#
-#  Notes:
-#
-#      No trailing "/", please.
-#
-logdir .
-#
-#
-#  2.4. actionsfile
-#  =================
-#
-#  Specifies:
-#
-#      The actions file(s) to use
-#
-#  Type of value:
-#
-#      Complete file name, relative to confdir
-#
-#  Default values:
-#
-#        match-all.action # Actions that are applied to all sites and maybe overruled later on.
-#
-#        default.action   # Main actions file
-#
-#        user.action      # User customizations
-#
-#  Effect if unset:
-#
-#      No actions are taken at all. More or less neutral proxying.
-#
-#  Notes:
-#
-#      Multiple actionsfile lines are permitted, and are in fact
-#      recommended!
-#
-#      The default values are default.action, which is the "main"
-#      actions file maintained by the developers, and user.action,
-#      where you can make your personal additions.
-#
-#      Actions files contain all the per site and per URL configuration
-#      for ad blocking, cookie management, privacy considerations,
-#      etc. There is no point in using Privoxy without at least one
-#      actions file.
-#
-#      Note that since Privoxy 3.0.7, the complete filename, including
-#      the ".action" extension has to be specified. The syntax change
-#      was necessary to be consistent with the other file options and
-#      to allow previously forbidden characters.
-#
-actionsfile match-all.action # Actions that are applied to all sites and maybe overruled later on.
-actionsfile default.action   # Main actions file
-actionsfile user.action      # User customizations
-#
-#
-#  2.5. filterfile
-#  ================
-#
-#  Specifies:
-#
-#      The filter file(s) to use
-#
-#  Type of value:
-#
-#      File name, relative to confdir
-#
-#  Default value:
-#
-#      default.filter (Unix) or default.filter.txt (Windows)
-#
-#  Effect if unset:
-#
-#      No textual content filtering takes place, i.e. all +filter{name}
-#      actions in the actions files are turned neutral.
-#
-#  Notes:
-#
-#      Multiple filterfile lines are permitted.
-#
-#      The filter files contain content modification rules that use
-#      regular expressions. These rules permit powerful changes on the
-#      content of Web pages, and optionally the headers as well, e.g.,
-#      you could try to disable your favorite JavaScript annoyances,
-#      re-write the actual displayed text, or just have some fun
-#      playing buzzword bingo with web pages.
-#
-#      The +filter{name} actions rely on the relevant filter (name)
-#      to be defined in a filter file!
-#
-#      A pre-defined filter file called default.filter that contains a
-#      number of useful filters for common problems is included in the
-#      distribution. See the section on the filter action for a list.
-#
-#      It is recommended to place any locally adapted filters into a
-#      separate file, such as user.filter.
-#
-filterfile default.filter
-#filterfile user.filter      # User customizations
-#
-#
-#  2.6. logfile
-#  =============
-#
-#  Specifies:
-#
-#      The log file to use
-#
-#  Type of value:
-#
-#      File name, relative to logdir
-#
-#  Default value:
-#
-#      Unset (commented out). When activated: logfile (Unix) or
-#      privoxy.log (Windows).
-#
-#  Effect if unset:
-#
-#      No logfile is written.
-#
-#  Notes:
-#
-#      The logfile is where all logging and error messages are
-#      written. The level of detail and number of messages are set with
-#      the debug option (see below).  The logfile can be useful for
-#      tracking down a problem with Privoxy (e.g., it's not blocking
-#      an ad you think it should block) and it can help you to monitor
-#      what your browser is doing.
-#
-#      Depending on the debug options below, the logfile may be a
-#      privacy risk if third parties can get access to it. As most
-#      users will never look at it, Privoxy 3.0.7 and later only log
-#      fatal errors by default.
-#
-#      For most troubleshooting purposes, you will have to change that,
-#      please refer to the debugging section for details.
-#
-#      Your logfile will grow indefinitely, and you will probably
-#      want to periodically remove it. On Unix systems, you can do
-#      this with a cron job (see "man cron"). For Red Hat based Linux
-#      distributions, a logrotate script has been included.
-#
-#      Any log files must be writable by whatever user Privoxy is
-#      being run as (on Unix, default user id is "privoxy").
-#
-logfile logfile
-#
-#
-#  2.7. trustfile
-#  ===============
-#
-#  Specifies:
-#
-#      The name of the trust file to use
-#
-#  Type of value:
-#
-#      File name, relative to confdir
-#
-#  Default value:
-#
-#      Unset (commented out). When activated: trust (Unix) or trust.txt
-#      (Windows)
-#
-#  Effect if unset:
-#
-#      The entire trust mechanism is disabled.
-#
-#  Notes:
-#
-#      The trust mechanism is an experimental feature for building
-#      white-lists and should be used with care. It is NOT recommended
-#      for the casual user.
-#
-#      If you specify a trust file, Privoxy will only allow access to
-#      sites that are specified in the trustfile. Sites can be listed
-#      in one of two ways:
-#
-#      Prepending a ~ character limits access to this site only (and
-#      any sub-paths within this site), e.g. ~www.example.com allows
-#      access to ~www.example.com/ features/news.html, etc.
-#
-#      Or, you can designate sites as trusted referrers, by prepending
-#      the name with a + character. The effect is that access to
-#      untrusted sites will be granted -- but only if a link from
-#      this trusted referrer was used to get there. The link target
-#      will then be added to the "trustfile" so that future, direct
-#      accesses will be granted. Sites added via this mechanism do
-#      not become trusted referrers themselves (i.e. they are added
-#      with a ~ designation). There is a limit of 512 such entries,
-#      after which new entries will not be made.
-#
-#      If you use the + operator in the trust file, it may grow
-#      considerably over time.
-#
-#      It is recommended that Privoxy be compiled with the
-#      --disable-force, --disable-toggle and --disable-editor options,
-#      if this feature is to be used.
-#
-#      Possible applications include limiting Internet access for
-#      children.
-#
-#trustfile trust
-#
-#
-#  3. DEBUGGING
-#  =============
-#
-#  These options are mainly useful when tracing a problem. Note that
-#  you might also want to invoke Privoxy with the --no-daemon command
-#  line option when debugging.
-#
-#
-#
-#  3.1. debug
-#  ===========
-#
-#  Specifies:
-#
-#      Key values that determine what information gets logged.
-#
-#  Type of value:
-#
-#      Integer values
-#
-#  Default value:
-#
-#      0 (i.e.: only fatal errors (that cause Privoxy to exit) are logged)
-#
-#  Effect if unset:
-#
-#      Default value is used (see above).
-#
-#  Notes:
-#
-#      The available debug levels are:
-#
-#        debug         1 # Log the destination for each request Privoxy let through. See also debug 1024.
-#        debug         2 # show each connection status
-#        debug         4 # show I/O status
-#        debug         8 # show header parsing
-#        debug        16 # log all data written to the network into the logfile
-#        debug        32 # debug force feature
-#        debug        64 # debug regular expression filters
-#        debug       128 # debug redirects
-#        debug       256 # debug GIF de-animation
-#        debug       512 # Common Log Format
-#        debug      1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
-#        debug      2048 # CGI user interface
-#        debug      4096 # Startup banner and warnings.
-#        debug      8192 # Non-fatal errors
-#
-#
-#      To select multiple debug levels, you can either add them or
-#      use multiple debug lines.
-#
-#      A debug level of 1 is informative because it will show you each
-#      request as it happens. 1, 4096 and 8192 are recommended so that
-#      you will notice when things go wrong. The other levels are
-#      probably only of interest if you are hunting down a specific
-#      problem. They can produce a hell of an output (especially 16).
-#
-#      Privoxy used to ship with the debug levels recommended above
-#      enabled by default, but due to privacy concerns 3.0.7 and later
-#      are configured to only log fatal errors.
-#
-#      If you are used to the more verbose settings, simply enable
-#      the debug lines below again.
-#
-#      If you want to use pure CLF (Common Log Format), you should set
-#      "debug 512" ONLY and not enable anything else.
-#
-#      Privoxy has a hard-coded limit for the length of log messages. If
-#      it's reached, messages are logged truncated and marked with
-#      "... [too long, truncated]".
-#
-#      Please don't file any support requests without trying to
-#      reproduce the problem with increased debug level first. Once
-#      you read the log messages, you may even be able to solve the
-#      problem on your own.
-#
-#debug      1 # Log the destination for each request Privoxy let through.
-#debug   1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
-#debug   4096 # Startup banner and warnings
-#debug   8192 # Non-fatal errors
-#
-#
-#  3.2. single-threaded
-#  =====================
-#
-#  Specifies:
-#
-#      Whether to run only one server thread.
-#
-#  Type of value:
-#
-#      None
-#
-#  Default value:
-#
-#      Unset
-#
-#  Effect if unset:
-#
-#      Multi-threaded (or, where unavailable: forked) operation,
-#      i.e. the ability to serve multiple requests simultaneously.
-#
-#  Notes:
-#
-#      This option is only there for debugging purposes. It will
-#      drastically reduce performance.
-#
-#single-threaded
-#
-#
-#  3.3. hostname
-#  ==============
-#
-#  Specifies:
-#
-#      The hostname shown on the CGI pages.
-#
-#  Type of value:
-#
-#      Text
-#
-#  Default value:
-#
-#      Unset
-#
-#  Effect if unset:
-#
-#      The hostname provided by the operating system is used.
-#
-#  Notes:
-#
-#      On some misconfigured systems resolving the hostname fails or
-#      takes too much time and slows Privoxy down. Setting a fixed
-#      hostname works around the problem.
-#
-#      In other circumstances it might be desirable to show a hostname
-#      other than the one returned by the operating system. For example
-#      if the system has several different hostnames and you don't
-#      want to use the first one.
-#
-#      Note that Privoxy does not validate the specified hostname value.
-#
-#hostname hostname.example.org
-#
-#
-#  4. ACCESS CONTROL AND SECURITY
-#  ===============================
-#
-#  This section of the config file controls the security-relevant
-#  aspects of Privoxy's configuration.
-#
-#
-#
-#  4.1. listen-address
-#  ====================
-#
-#  Specifies:
-#
-#      The IP address and TCP port on which Privoxy will listen for
-#      client requests.
-#
-#  Type of value:
-#
-#      [IP-Address]:Port
-#
-#  Default value:
-#
-#      127.0.0.1:8118
-#
-#  Effect if unset:
-#
-#      Bind to 127.0.0.1 (localhost), port 8118. This is suitable and
-#      recommended for home users who run Privoxy on the same machine
-#      as their browser.
-#
-#  Notes:
-#
-#      You will need to configure your browser(s) to this proxy address
-#      and port.
-#
-#      If you already have another service running on port 8118, or
-#      if you want to serve requests from other machines (e.g. on your
-#      local network) as well, you will need to override the default.
-#
-#      If you leave out the IP address, Privoxy will bind to all
-#      interfaces (addresses) on your machine and may become reachable
-#      from the Internet. In that case, consider using access control
-#      lists (ACL's, see below), and/or a firewall.
-#
-#      If you open Privoxy to untrusted users, you will also
-#      want to make sure that the following actions are disabled:
-#      enable-edit-actions and enable-remote-toggle
-#
-#  Example:
-#
-#      Suppose you are running Privoxy on a machine which has the
-#      address 192.168.0.1 on your local private network (192.168.0.0)
-#      and has another outside connection with a different address. You
-#      want it to serve requests from inside only:
-#
-#        listen-address  192.168.0.1:8118
-#
-#
-listen-address  127.0.0.1:8118
-#
-#
-#  4.2. toggle
-#  ============
-#
-#  Specifies:
-#
-#      Initial state of "toggle" status
-#
-#  Type of value:
-#
-#      1 or 0
-#
-#  Default value:
-#
-#      1
-#
-#  Effect if unset:
-#
-#      Act as if toggled on
-#
-#  Notes:
-#
-#      If set to 0, Privoxy will start in "toggled off" mode,
-#      i.e. mostly behave like a normal, content-neutral proxy
-#      with both ad blocking and content filtering disabled. See
-#      enable-remote-toggle below.
-#
-#      The windows version will only display the toggle icon in the
-#      system tray if this option is present.
-#
-toggle  1
-#
-#
-#  4.3. enable-remote-toggle
-#  ==========================
-#
-#  Specifies:
-#
-#      Whether or not the web-based toggle feature may be used
-#
-#  Type of value:
-#
-#      0 or 1
-#
-#  Default value:
-#
-#      0
-#
-#  Effect if unset:
-#
-#      The web-based toggle feature is disabled.
-#
-#  Notes:
-#
-#      When toggled off, Privoxy mostly acts like a normal,
-#      content-neutral proxy, i.e. doesn't block ads or filter content.
-#
-#      Access to the toggle feature can not be controlled separately by
-#      "ACLs" or HTTP authentication, so that everybody who can access
-#      Privoxy (see "ACLs" and listen-address above) can toggle it
-#      for all users. So this option is not recommended for multi-user
-#      environments with untrusted users.
-#
-#      Note that malicious client side code (e.g Java) is also capable
-#      of using this option.
-#
-#      As a lot of Privoxy users don't read documentation, this feature
-#      is disabled by default.
-#
-#      Note that you must have compiled Privoxy with support for this
-#      feature, otherwise this option has no effect.
-#
-enable-remote-toggle  0
-#
-#
-#  4.4. enable-remote-http-toggle
-#  ===============================
-#
-#  Specifies:
-#
-#      Whether or not Privoxy recognizes special HTTP headers to change
-#      its behaviour.
-#
-#  Type of value:
-#
-#      0 or 1
-#
-#  Default value:
-#
-#      0
-#
-#  Effect if unset:
-#
-#      Privoxy ignores special HTTP headers.
-#
-#  Notes:
-#
-#      When toggled on, the client can change Privoxy's behaviour by
-#      setting special HTTP headers. Currently the only supported
-#      special header is "X-Filter: No", to disable filtering for
-#      the ongoing request, even if it is enabled in one of the
-#      action files.
-#
-#      This feature is disabled by default. If you are using Privoxy in
-#      a environment with trusted clients, you may enable this feature
-#      at your discretion. Note that malicious client side code (e.g
-#      Java) is also capable of using this feature.
-#
-#      This option will be removed in future releases as it has been
-#      obsoleted by the more general header taggers.
-#
-enable-remote-http-toggle  0
-#
-#
-#  4.5. enable-edit-actions
-#  =========================
-#
-#  Specifies:
-#
-#      Whether or not the web-based actions file editor may be used
-#
-#  Type of value:
-#
-#      0 or 1
-#
-#  Default value:
-#
-#      0
-#
-#  Effect if unset:
-#
-#      The web-based actions file editor is disabled.
-#
-#  Notes:
-#
-#      Access to the editor can not be controlled separately by
-#      "ACLs" or HTTP authentication, so that everybody who can access
-#      Privoxy (see "ACLs" and listen-address above) can modify its
-#      configuration for all users.
-#
-#      This option is not recommended for environments with untrusted
-#      users and as a lot of Privoxy users don't read documentation,
-#      this feature is disabled by default.
-#
-#      Note that malicious client side code (e.g Java) is also capable
-#      of using the actions editor and you shouldn't enable this
-#      options unless you understand the consequences and are sure
-#      your browser is configured correctly.
-#
-#      Note that you must have compiled Privoxy with support for this
-#      feature, otherwise this option has no effect.
-#
-enable-edit-actions 0
-#
-#
-#  4.6. enforce-blocks
-#  ====================
-#
-#  Specifies:
-#
-#      Whether the user is allowed to ignore blocks and can "go there
-#      anyway".
-#
-#  Type of value:
-#
-#      0 or 1
-#
-#  Default value:
-#
-#      0
-#
-#  Effect if unset:
-#
-#      Blocks are not enforced.
-#
-#  Notes:
-#
-#      Privoxy is mainly used to block and filter requests as a service
-#      to the user, for example to block ads and other junk that clogs
-#      the pipes.  Privoxy's configuration isn't perfect and sometimes
-#      innocent pages are blocked. In this situation it makes sense to
-#      allow the user to enforce the request and have Privoxy ignore
-#      the block.
-#
-#      In the default configuration Privoxy's "Blocked" page contains
-#      a "go there anyway" link to adds a special string (the force
-#      prefix) to the request URL. If that link is used, Privoxy
-#      will detect the force prefix, remove it again and let the
-#      request pass.
-#
-#      Of course Privoxy can also be used to enforce a network
-#      policy. In that case the user obviously should not be able to
-#      bypass any blocks, and that's what the "enforce-blocks" option
-#      is for. If it's enabled, Privoxy hides the "go there anyway"
-#      link. If the user adds the force prefix by hand, it will not
-#      be accepted and the circumvention attempt is logged.
-#
-#  Examples:
-#
-#      enforce-blocks 1
-#
-enforce-blocks 0
-#
-#
-#  4.7. ACLs: permit-access and deny-access
-#  =========================================
-#
-#  Specifies:
-#
-#      Who can access what.
-#
-#  Type of value:
-#
-#      src_addr[/src_masklen] [dst_addr[/dst_masklen]]
-#
-#      Where src_addr and dst_addr are IP addresses in dotted decimal
-#      notation or valid DNS names, and src_masklen and dst_masklen are
-#      subnet masks in CIDR notation, i.e. integer values from 2 to 30
-#      representing the length (in bits) of the network address. The
-#      masks and the whole destination part are optional.
-#
-#  Default value:
-#
-#      Unset
-#
-#  Effect if unset:
-#
-#      Don't restrict access further than implied by listen-address
-#
-#  Notes:
-#
-#      Access controls are included at the request of ISPs and systems
-#      administrators, and are not usually needed by individual
-#      users. For a typical home user, it will normally suffice to
-#      ensure that Privoxy only listens on the localhost (127.0.0.1)
-#      or internal (home) network address by means of the listen-address
-#      option.
-#
-#      Please see the warnings in the FAQ that Privoxy is not intended
-#      to be a substitute for a firewall or to encourage anyone to
-#      defer addressing basic security weaknesses.
-#
-#      Multiple ACL lines are OK. If any ACLs are specified, Privoxy
-#      only talks to IP addresses that match at least one permit-access
-#      line and don't match any subsequent deny-access line. In other
-#      words, the last match wins, with the default being deny-access.
-#
-#      If Privoxy is using a forwarder (see forward below) for a
-#      particular destination URL, the dst_addr that is examined is
-#      the address of the forwarder and NOT the address of the ultimate
-#      target. This is necessary because it may be impossible for the
-#      local Privoxy to determine the IP address of the ultimate target
-#      (that's often what gateways are used for).
-#
-#      You should prefer using IP addresses over DNS names, because
-#      the address lookups take time. All DNS names must resolve! You
-#      can not use domain patterns like "*.org" or partial domain
-#      names. If a DNS name resolves to multiple IP addresses, only
-#      the first one is used.
-#
-#      Denying access to particular sites by ACL may have undesired
-#      side effects if the site in question is hosted on a machine
-#      which also hosts other sites (most sites are).
-#
-#  Examples:
-#
-#      Explicitly define the default behavior if no ACL and
-#      listen-address are set: "localhost" is OK. The absence of a
-#      dst_addr implies that all destination addresses are OK:
-#
-#        permit-access  localhost
-#
-#
-#      Allow any host on the same class C subnet as www.privoxy.org
-#      access to nothing but www.example.com (or other domains hosted
-#      on the same system):
-#
-#        permit-access  www.privoxy.org/24 www.example.com/32
-#
-#
-#      Allow access from any host on the 26-bit subnet 192.168.45.64 to
-#      anywhere, with the exception that 192.168.45.73 may not access
-#      the IP address behind www.dirty-stuff.example.com:
-#
-#        permit-access  192.168.45.64/26 
-#        deny-access   192.168.45.73  www.dirty-stuff.example.com
-#
-#
-#
-#  4.8. buffer-limit
-#  ==================
-#
-#  Specifies:
-#
-#      Maximum size of the buffer for content filtering.
-#
-#  Type of value:
-#
-#      Size in Kbytes
-#
-#  Default value:
-#
-#      4096
-#
-#  Effect if unset:
-#
-#      Use a 4MB (4096 KB) limit.
-#
-#  Notes:
-#
-#      For content filtering, i.e. the +filter and +deanimate-gif
-#      actions, it is necessary that Privoxy buffers the entire document
-#      body. This can be potentially dangerous, since a server could
-#      just keep sending data indefinitely and wait for your RAM to
-#      exhaust -- with nasty consequences.  Hence this option.
-#
-#      When a document buffer size reaches the buffer-limit, it is
-#      flushed to the client unfiltered and no further attempt to filter
-#      the rest of the document is made. Remember that there may be
-#      multiple threads running, which might require up to buffer-limit
-#      Kbytes each, unless you have enabled "single-threaded" above.
-#
-buffer-limit 4096
-#
-#
-#  5. FORWARDING
-#  ==============
-#
-#  This feature allows routing of HTTP requests through a chain of
-#  multiple proxies.
-#
-#  Forwarding can be used to chain Privoxy with a caching proxy to
-#  speed up browsing. Using a parent proxy may also be necessary if
-#  the machine that Privoxy runs on has no direct Internet access.
-#
-#  Note that parent proxies can severely decrease your privacy
-#  level. For example a parent proxy could add your IP address to the
-#  request headers and if it's a caching proxy it may add the "Etag"
-#  header to revalidation requests again, even though you configured
-#  Privoxy to remove it. It may also ignore Privoxy's header time
-#  randomization and use the original values which could be used by
-#  the server as cookie replacement to track your steps between visits.
-#
-#  Also specified here are SOCKS proxies. Privoxy supports the SOCKS
-#  4 and SOCKS 4A protocols.
-#
-#
-#
-#  5.1. forward
-#  =============
-#
-#  Specifies:
-#
-#      To which parent HTTP proxy specific requests should be routed.
-#
-#  Type of value:
-#
-#      target_pattern http_parent[:port]
-#
-#      where target_pattern is a URL pattern that specifies to which
-#      requests (i.e. URLs) this forward rule shall apply. Use /
-#      to denote "all URLs".  http_parent[:port] is the DNS name or
-#      IP address of the parent HTTP proxy through which the requests
-#      should be forwarded, optionally followed by its listening port
-#      (default: 8080). Use a single dot (.) to denote "no forwarding".
-#
-#  Default value:
-#
-#      Unset
-#
-#  Effect if unset:
-#
-#      Don't use parent HTTP proxies.
-#
-#  Notes:
-#
-#      If http_parent is ".", then requests are not forwarded to
-#      another HTTP proxy but are made directly to the web servers.
-#
-#      Multiple lines are OK, they are checked in sequence, and the
-#      last match wins.
-#
-#  Examples:
-#
-#      Everything goes to an example parent proxy, except SSL on port
-#      443 (which it doesn't handle):
-#
-#        forward   /      parent-proxy.example.org:8080 
-#        forward   :443   .
-#
-#
-#      Everything goes to our example ISP's caching proxy, except for
-#      requests to that ISP's sites:
-#
-#        forward   /                  caching-proxy.isp.example.net:8000
-#        forward   .isp.example.net   .
-#
-#
-#
-#
-#  5.2. forward-socks4, forward-socks4a and forward-socks5
-#  ========================================================
-#
-#  Specifies:
-#
-#      Through which SOCKS proxy (and optionally to which parent HTTP
-#      proxy) specific requests should be routed.
-#
-#  Type of value:
-#
-#      target_pattern socks_proxy[:port] http_parent[:port]
-#
-#      where target_pattern is a URL pattern that specifies to which
-#      requests (i.e. URLs) this forward rule shall apply. Use / to
-#      denote "all URLs".  http_parent and socks_proxy are IP addresses
-#      in dotted decimal notation or valid DNS names (http_parent may
-#      be "." to denote "no HTTP forwarding"), and the optional port
-#      parameters are TCP ports, i.e. integer values from 1 to 65535
-#
-#  Default value:
-#
-#      Unset
-#
-#  Effect if unset:
-#
-#      Don't use SOCKS proxies.
-#
-#  Notes:
-#
-#      Multiple lines are OK, they are checked in sequence, and the
-#      last match wins.
-#
-#      The difference between forward-socks4 and forward-socks4a
-#      is that in the SOCKS 4A protocol, the DNS resolution of the
-#      target hostname happens on the SOCKS server, while in SOCKS 4
-#      it happens locally.
-#
-#      With forward-socks5 the DNS resolution will happen on the remote
-#      server as well.
-#
-#      If http_parent is ".", then requests are not forwarded to another
-#      HTTP proxy but are made (HTTP-wise) directly to the web servers,
-#      albeit through a SOCKS proxy.
-#
-#  Examples:
-#
-#      From the company example.com, direct connections are made to all
-#      "internal" domains, but everything outbound goes through their
-#      ISP's proxy by way of example.com's corporate SOCKS 4A gateway
-#      to the Internet.
-#
-#        forward-socks4a   /       socks-gw.example.com:1080    www-cache.isp.example.net:8080 
-#        forward           .example.com        .
-#
-#
-#      A rule that uses a SOCKS 4 gateway for all destinations but no
-#      HTTP parent looks like this:
-#
-#        forward-socks4   /               socks-gw.example.com:1080  .
-#
-#
-#      To chain Privoxy and Tor, both running on the same system,
-#      you would use something like:
-#
-#        forward-socks4a   /               127.0.0.1:9050 .
-#
-#
-#      The public Tor network can't be used to reach your local network,
-#      if you need to access local servers you therefore might want
-#      to make some exceptions:
-#
-#        forward         192.168.*.*/     .  
-#        forward         10.*.*.*/        .  
-#        forward         127.*.*.*/       .
-#
-#
-#      Unencrypted connections to systems in these address ranges will
-#      be as (un) secure as the local network is, but the alternative
-#      is that you can't reach the local network through Privoxy at
-#      all. Of course this may actually be desired and there is no
-#      reason to make these exceptions if you aren't sure you need them.
-#
-#      If you also want to be able to reach servers in your local
-#      network by using their names, you will need additional exceptions
-#      that look like this:
-#
-#       forward           localhost/     .
-#
-#
-#
-#
-#  5.3. forwarded-connect-retries
-#  ===============================
-#
-#  Specifies:
-#
-#      How often Privoxy retries if a forwarded connection request
-#      fails.
-#
-#  Type of value:
-#
-#      Number of retries.
-#
-#  Default value:
-#
-#      0
-#
-#  Effect if unset:
-#
-#      Connections forwarded through other proxies are treated like
-#      direct connections and no retry attempts are made.
-#
-#  Notes:
-#
-#      forwarded-connect-retries is mainly interesting for socks4a
-#      connections, where Privoxy can't detect why the connections
-#      failed. The connection might have failed because of a DNS timeout
-#      in which case a retry makes sense, but it might also have failed
-#      because the server doesn't exist or isn't reachable. In this
-#      case the retry will just delay the appearance of Privoxy's
-#      error message.
-#
-#      Note that in the context of this option, "forwarded connections"
-#      includes all connections that Privoxy forwards through other
-#      proxies. This option is not limited to the HTTP CONNECT method.
-#
-#      Only use this option, if you are getting lots of
-#      forwarding-related error messages that go away when you try again
-#      manually. Start with a small value and check Privoxy's logfile
-#      from time to time, to see how many retries are usually needed.
-#
-#  Examples:
-#
-#      forwarded-connect-retries 1
-#
-forwarded-connect-retries  0
-#
-#
-#  5.4. accept-intercepted-requests
-#  =================================
-#
-#  Specifies:
-#
-#      Whether intercepted requests should be treated as valid.
-#
-#  Type of value:
-#
-#      0 or 1
-#
-#  Default value:
-#
-#      0
-#
-#  Effect if unset:
-#
-#      Only proxy requests are accepted, intercepted requests are
-#      treated as invalid.
-#
-#  Notes:
-#
-#      If you don't trust your clients and want to force them to use
-#      Privoxy, enable this option and configure your packet filter
-#      to redirect outgoing HTTP connections into Privoxy.
-#
-#      Make sure that Privoxy's own requests aren't redirected as well.
-#      Additionally take care that Privoxy can't intentionally connect
-#      to itself, otherwise you could run into redirection loops if
-#      Privoxy's listening port is reachable by the outside or an
-#      attacker has access to the pages you visit.
-#
-#  Examples:
-#
-#      accept-intercepted-requests 1
-#
-accept-intercepted-requests 0
-#
-#
-#  5.5. allow-cgi-request-crunching
-#  =================================
-#
-#  Specifies:
-#
-#      Whether requests to Privoxy's CGI pages can be blocked or
-#      redirected.
-#
-#  Type of value:
-#
-#      0 or 1
-#
-#  Default value:
-#
-#      0
-#
-#  Effect if unset:
-#
-#      Privoxy ignores block and redirect actions for its CGI pages.
-#
-#  Notes:
-#
-#      By default Privoxy ignores block or redirect actions for
-#      its CGI pages.  Intercepting these requests can be useful in
-#      multi-user setups to implement fine-grained access control,
-#      but it can also render the complete web interface useless and
-#      make debugging problems painful if done without care.
-#
-#      Don't enable this option unless you're sure that you really
-#      need it.
-#
-#  Examples:
-#
-#      allow-cgi-request-crunching 1
-#
-allow-cgi-request-crunching 0
-#
-#
-#  5.6. split-large-forms
-#  =======================
-#
-#  Specifies:
-#
-#      Whether the CGI interface should stay compatible with broken
-#      HTTP clients.
-#
-#  Type of value:
-#
-#      0 or 1
-#
-#  Default value:
-#
-#      0
-#
-#  Effect if unset:
-#
-#      The CGI form generate long GET URLs.
-#
-#  Notes:
-#
-#      Privoxy's CGI forms can lead to rather long URLs. This isn't
-#      a problem as far as the HTTP standard is concerned, but it can
-#      confuse clients with arbitrary URL length limitations.
-#
-#      Enabling split-large-forms causes Privoxy to divide big forms
-#      into smaller ones to keep the URL length down. It makes editing
-#      a lot less convenient and you can no longer submit all changes
-#      at once, but at least it works around this browser bug.
-#
-#      If you don't notice any editing problems, there is no reason
-#      to enable this option, but if one of the submit buttons appears
-#      to be broken, you should give it a try.
-#
-#  Examples:
-#
-#      split-large-forms 1
-#
-split-large-forms 0
-#
-#
-#  5.7. keep-alive-timeout
-#  ========================
-#
-#  Specifies:
-#
-#      Number of seconds after which an open connection will no longer
-#      be reused.
-#
-#  Type of value:
-#
-#      Time in seconds.
-#
-#  Default value:
-#
-#      None
-#
-#  Effect if unset:
-#
-#      Connections are not reused.
-#
-#  Notes:
-#
-#      This option has no effect if Privoxy has been compiled without
-#      keep-alive support.
-#
-#  Notes:
-#
-#      Note that reusing connections doesn't necessary cause
-#      speedups. There are also a few privacy implications you should
-#      be aware of.
-#
-#      Outgoing connections are shared between clients (if there are
-#      more than one) and closing the client that initiated the outgoing
-#      connection does not affect the connection between Privoxy and
-#      the server unless the client's request hasn't been completed
-#      yet. If the outgoing connection is idle, it will not be closed
-#      until either Privoxy's or the server's timeout is reached. While
-#      it's open, the server knows that the system running Privoxy is
-#      still there.
-#
-#  Examples:
-#
-#      keep-alive-timeout 300
-#
-keep-alive-timeout 300
-#
-#
-#  5.8. socket-timeout
-#  ====================
-#
-#  Specifies:
-#
-#      Number of seconds after which a socket times out if no data
-#      is received.
-#
-#  Type of value:
-#
-#      Time in seconds.
-#
-#  Default value:
-#
-#      None
-#
-#  Effect if unset:
-#
-#      A default value of 300 seconds is used.
-#
-#  Notes:
-#
-#      For SOCKS requests the timeout currently doesn't start until
-#      the SOCKS server accepted the request. This will be fixed in
-#      the next release.
-#
-#  Examples:
-#
-#      socket-timeout 300
-#
-socket-timeout 300
-#
-#
-#  6. WINDOWS GUI OPTIONS
-#  =======================
-#
-#  Privoxy has a number of options specific to the Windows GUI
-#  interface:
-#
-#
-#  If "activity-animation" is set to 1, the Privoxy icon will animate
-#  when "Privoxy" is active. To turn off, set to 0.
-#
-#activity-animation   1
-#
-#  If "log-messages" is set to 1, Privoxy will log messages to the
-#  console window:
-#
-#log-messages   1
-#
-#  If "log-buffer-size" is set to 1, the size of the log buffer,
-#  i.e. the amount of memory used for the log messages displayed in
-#  the console window, will be limited to "log-max-lines" (see below).
-#
-#  Warning: Setting this to 0 will result in the buffer to grow
-#  infinitely and eat up all your memory!
-#
-#log-buffer-size 1
-#
-#  log-max-lines is the maximum number of lines held in the log
-#  buffer. See above.
-#
-#log-max-lines 200
-#
-#  If "log-highlight-messages" is set to 1, Privoxy will highlight
-#  portions of the log messages with a bold-faced font:
-#
-#log-highlight-messages 1
-#
-#  The font used in the console window:
-#
-#log-font-name Comic Sans MS
-#
-#  Font size used in the console window:
-#
-#log-font-size 8
-#
-#  "show-on-task-bar" controls whether or not Privoxy will appear as
-#  a button on the Task bar when minimized:
-#
-#show-on-task-bar 0
-#
-#  If "close-button-minimizes" is set to 1, the Windows close button
-#  will minimize Privoxy instead of closing the program (close with
-#  the exit option on the File menu).
-#
-#close-button-minimizes 1
-#
-#  The "hide-console" option is specific to the MS-Win console version
-#  of Privoxy.  If this option is used, Privoxy will disconnect from
-#  and hide the command console.
-#
-#hide-console
-#
-#
diff --git a/external/privoxy/config.guess b/external/privoxy/config.guess
deleted file mode 100644
index d622a44..0000000
--- a/external/privoxy/config.guess
+++ /dev/null
@@ -1,1530 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012 Free Software Foundation, Inc.
-
-timestamp='2012-02-10'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner.  Please send patches (context
-# diff format) to <config-patches at gnu.org> and include a ChangeLog
-# entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub.  If it succeeds, it prints the system name on stdout, and
-# exits with 0.  Otherwise, it exits with 1.
-#
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
-  -h, --help         print this help, then exit
-  -t, --time-stamp   print date of last modification, then exit
-  -v, --version      print version number, then exit
-
-Report bugs and patches to <config-patches at gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
-  case $1 in
-    --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
-    --version | -v )
-       echo "$version" ; exit ;;
-    --help | --h* | -h )
-       echo "$usage"; exit ;;
-    -- )     # Stop option processing
-       shift; break ;;
-    - )	# Use stdin as input.
-       break ;;
-    -* )
-       echo "$me: invalid option $1$help" >&2
-       exit 1 ;;
-    * )
-       break ;;
-  esac
-done
-
-if test $# != 0; then
-  echo "$me: too many arguments$help" >&2
-  exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int x;" > $dummy.c ;
-	for c in cc gcc c89 c99 ; do
-	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
-	     CC_FOR_BUILD="$c"; break ;
-	  fi ;
-	done ;
-	if test x"$CC_FOR_BUILD" = x ; then
-	  CC_FOR_BUILD=no_compiler_found ;
-	fi
-	;;
- ,,*)   CC_FOR_BUILD=$CC ;;
- ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi at noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
-	PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
-    *:NetBSD:*:*)
-	# NetBSD (nbsd) targets should (where applicable) match one or
-	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
-	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
-	# switched to ELF, *-*-netbsd* would select the old
-	# object file format.  This provides both forward
-	# compatibility and a consistent mechanism for selecting the
-	# object file format.
-	#
-	# Note: NetBSD doesn't particularly care about the vendor
-	# portion of the name.  We always set it to "unknown".
-	sysctl="sysctl -n hw.machine_arch"
-	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
-	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
-	case "${UNAME_MACHINE_ARCH}" in
-	    armeb) machine=armeb-unknown ;;
-	    arm*) machine=arm-unknown ;;
-	    sh3el) machine=shl-unknown ;;
-	    sh3eb) machine=sh-unknown ;;
-	    sh5el) machine=sh5le-unknown ;;
-	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
-	esac
-	# The Operating System including object format, if it has switched
-	# to ELF recently, or will in the future.
-	case "${UNAME_MACHINE_ARCH}" in
-	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-		eval $set_cc_for_build
-		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
-			| grep -q __ELF__
-		then
-		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
-		    # Return netbsd for either.  FIX?
-		    os=netbsd
-		else
-		    os=netbsdelf
-		fi
-		;;
-	    *)
-		os=netbsd
-		;;
-	esac
-	# The OS release
-	# Debian GNU/NetBSD machines have a different userland, and
-	# thus, need a distinct triplet. However, they do not need
-	# kernel version information, so it can be replaced with a
-	# suitable tag, in the style of linux-gnu.
-	case "${UNAME_VERSION}" in
-	    Debian*)
-		release='-gnu'
-		;;
-	    *)
-		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
-		;;
-	esac
-	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
-	# contains redundant information, the shorter form:
-	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-	echo "${machine}-${os}${release}"
-	exit ;;
-    *:OpenBSD:*:*)
-	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
-	exit ;;
-    *:ekkoBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
-	exit ;;
-    *:SolidBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
-	exit ;;
-    macppc:MirBSD:*:*)
-	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
-	exit ;;
-    *:MirBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
-	exit ;;
-    alpha:OSF1:*:*)
-	case $UNAME_RELEASE in
-	*4.0)
-		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
-		;;
-	*5.*)
-		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
-		;;
-	esac
-	# According to Compaq, /usr/sbin/psrinfo has been available on
-	# OSF/1 and Tru64 systems produced since 1995.  I hope that
-	# covers most systems running today.  This code pipes the CPU
-	# types through head -n 1, so we only detect the type of CPU 0.
-	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
-	case "$ALPHA_CPU_TYPE" in
-	    "EV4 (21064)")
-		UNAME_MACHINE="alpha" ;;
-	    "EV4.5 (21064)")
-		UNAME_MACHINE="alpha" ;;
-	    "LCA4 (21066/21068)")
-		UNAME_MACHINE="alpha" ;;
-	    "EV5 (21164)")
-		UNAME_MACHINE="alphaev5" ;;
-	    "EV5.6 (21164A)")
-		UNAME_MACHINE="alphaev56" ;;
-	    "EV5.6 (21164PC)")
-		UNAME_MACHINE="alphapca56" ;;
-	    "EV5.7 (21164PC)")
-		UNAME_MACHINE="alphapca57" ;;
-	    "EV6 (21264)")
-		UNAME_MACHINE="alphaev6" ;;
-	    "EV6.7 (21264A)")
-		UNAME_MACHINE="alphaev67" ;;
-	    "EV6.8CB (21264C)")
-		UNAME_MACHINE="alphaev68" ;;
-	    "EV6.8AL (21264B)")
-		UNAME_MACHINE="alphaev68" ;;
-	    "EV6.8CX (21264D)")
-		UNAME_MACHINE="alphaev68" ;;
-	    "EV6.9A (21264/EV69A)")
-		UNAME_MACHINE="alphaev69" ;;
-	    "EV7 (21364)")
-		UNAME_MACHINE="alphaev7" ;;
-	    "EV7.9 (21364A)")
-		UNAME_MACHINE="alphaev79" ;;
-	esac
-	# A Pn.n version is a patched version.
-	# A Vn.n version is a released version.
-	# A Tn.n version is a released field test version.
-	# A Xn.n version is an unreleased experimental baselevel.
-	# 1.2 uses "1.2" for uname -r.
-	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
-	exitcode=$?
-	trap '' 0
-	exit $exitcode ;;
-    Alpha\ *:Windows_NT*:*)
-	# How do we know it's Interix rather than the generic POSIX subsystem?
-	# Should we change UNAME_MACHINE based on the output of uname instead
-	# of the specific Alpha model?
-	echo alpha-pc-interix
-	exit ;;
-    21064:Windows_NT:50:3)
-	echo alpha-dec-winnt3.5
-	exit ;;
-    Amiga*:UNIX_System_V:4.0:*)
-	echo m68k-unknown-sysv4
-	exit ;;
-    *:[Aa]miga[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-amigaos
-	exit ;;
-    *:[Mm]orph[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-morphos
-	exit ;;
-    *:OS/390:*:*)
-	echo i370-ibm-openedition
-	exit ;;
-    *:z/VM:*:*)
-	echo s390-ibm-zvmoe
-	exit ;;
-    *:OS400:*:*)
-	echo powerpc-ibm-os400
-	exit ;;
-    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
-	echo arm-acorn-riscix${UNAME_RELEASE}
-	exit ;;
-    arm:riscos:*:*|arm:RISCOS:*:*)
-	echo arm-unknown-riscos
-	exit ;;
-    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
-	echo hppa1.1-hitachi-hiuxmpp
-	exit ;;
-    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
-	# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
-	if test "`(/bin/universe) 2>/dev/null`" = att ; then
-		echo pyramid-pyramid-sysv3
-	else
-		echo pyramid-pyramid-bsd
-	fi
-	exit ;;
-    NILE*:*:*:dcosx)
-	echo pyramid-pyramid-svr4
-	exit ;;
-    DRS?6000:unix:4.0:6*)
-	echo sparc-icl-nx6
-	exit ;;
-    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
-	case `/usr/bin/uname -p` in
-	    sparc) echo sparc-icl-nx7; exit ;;
-	esac ;;
-    s390x:SunOS:*:*)
-	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    sun4H:SunOS:5.*:*)
-	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
-	echo i386-pc-auroraux${UNAME_RELEASE}
-	exit ;;
-    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-	eval $set_cc_for_build
-	SUN_ARCH="i386"
-	# If there is a compiler, see if it is configured for 64-bit objects.
-	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
-	# This test works for both compilers.
-	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
-		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		grep IS_64BIT_ARCH >/dev/null
-	    then
-		SUN_ARCH="x86_64"
-	    fi
-	fi
-	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    sun4*:SunOS:6*:*)
-	# According to config.sub, this is the proper way to canonicalize
-	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
-	# it's likely to be more like Solaris than SunOS4.
-	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    sun4*:SunOS:*:*)
-	case "`/usr/bin/arch -k`" in
-	    Series*|S4*)
-		UNAME_RELEASE=`uname -v`
-		;;
-	esac
-	# Japanese Language versions have a version number like `4.1.3-JL'.
-	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
-	exit ;;
-    sun3*:SunOS:*:*)
-	echo m68k-sun-sunos${UNAME_RELEASE}
-	exit ;;
-    sun*:*:4.2BSD:*)
-	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
-	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
-	case "`/bin/arch`" in
-	    sun3)
-		echo m68k-sun-sunos${UNAME_RELEASE}
-		;;
-	    sun4)
-		echo sparc-sun-sunos${UNAME_RELEASE}
-		;;
-	esac
-	exit ;;
-    aushp:SunOS:*:*)
-	echo sparc-auspex-sunos${UNAME_RELEASE}
-	exit ;;
-    # The situation for MiNT is a little confusing.  The machine name
-    # can be virtually everything (everything which is not
-    # "atarist" or "atariste" at least should have a processor
-    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
-    # to the lowercase version "mint" (or "freemint").  Finally
-    # the system name "TOS" denotes a system which is actually not
-    # MiNT.  But MiNT is downward compatible to TOS, so this should
-    # be no problem.
-    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
-	exit ;;
-    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
-	exit ;;
-    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
-	exit ;;
-    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-	echo m68k-milan-mint${UNAME_RELEASE}
-	exit ;;
-    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-	echo m68k-hades-mint${UNAME_RELEASE}
-	exit ;;
-    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-	echo m68k-unknown-mint${UNAME_RELEASE}
-	exit ;;
-    m68k:machten:*:*)
-	echo m68k-apple-machten${UNAME_RELEASE}
-	exit ;;
-    powerpc:machten:*:*)
-	echo powerpc-apple-machten${UNAME_RELEASE}
-	exit ;;
-    RISC*:Mach:*:*)
-	echo mips-dec-mach_bsd4.3
-	exit ;;
-    RISC*:ULTRIX:*:*)
-	echo mips-dec-ultrix${UNAME_RELEASE}
-	exit ;;
-    VAX*:ULTRIX*:*:*)
-	echo vax-dec-ultrix${UNAME_RELEASE}
-	exit ;;
-    2020:CLIX:*:* | 2430:CLIX:*:*)
-	echo clipper-intergraph-clix${UNAME_RELEASE}
-	exit ;;
-    mips:*:*:UMIPS | mips:*:*:RISCos)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h>  /* for printf() prototype */
-	int main (int argc, char *argv[]) {
-#else
-	int main (argc, argv) int argc; char *argv[]; {
-#endif
-	#if defined (host_mips) && defined (MIPSEB)
-	#if defined (SYSTYPE_SYSV)
-	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
-	#endif
-	#if defined (SYSTYPE_SVR4)
-	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
-	#endif
-	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
-	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
-	#endif
-	#endif
-	  exit (-1);
-	}
-EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c &&
-	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
-	  SYSTEM_NAME=`$dummy $dummyarg` &&
-	    { echo "$SYSTEM_NAME"; exit; }
-	echo mips-mips-riscos${UNAME_RELEASE}
-	exit ;;
-    Motorola:PowerMAX_OS:*:*)
-	echo powerpc-motorola-powermax
-	exit ;;
-    Motorola:*:4.3:PL8-*)
-	echo powerpc-harris-powermax
-	exit ;;
-    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
-	echo powerpc-harris-powermax
-	exit ;;
-    Night_Hawk:Power_UNIX:*:*)
-	echo powerpc-harris-powerunix
-	exit ;;
-    m88k:CX/UX:7*:*)
-	echo m88k-harris-cxux7
-	exit ;;
-    m88k:*:4*:R4*)
-	echo m88k-motorola-sysv4
-	exit ;;
-    m88k:*:3*:R3*)
-	echo m88k-motorola-sysv3
-	exit ;;
-    AViiON:dgux:*:*)
-	# DG/UX returns AViiON for all architectures
-	UNAME_PROCESSOR=`/usr/bin/uname -p`
-	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
-	then
-	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
-	       [ ${TARGET_BINARY_INTERFACE}x = x ]
-	    then
-		echo m88k-dg-dgux${UNAME_RELEASE}
-	    else
-		echo m88k-dg-dguxbcs${UNAME_RELEASE}
-	    fi
-	else
-	    echo i586-dg-dgux${UNAME_RELEASE}
-	fi
-	exit ;;
-    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
-	echo m88k-dolphin-sysv3
-	exit ;;
-    M88*:*:R3*:*)
-	# Delta 88k system running SVR3
-	echo m88k-motorola-sysv3
-	exit ;;
-    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
-	echo m88k-tektronix-sysv3
-	exit ;;
-    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
-	echo m68k-tektronix-bsd
-	exit ;;
-    *:IRIX*:*:*)
-	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
-	exit ;;
-    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
-	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
-    i*86:AIX:*:*)
-	echo i386-ibm-aix
-	exit ;;
-    ia64:AIX:*:*)
-	if [ -x /usr/bin/oslevel ] ; then
-		IBM_REV=`/usr/bin/oslevel`
-	else
-		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
-	fi
-	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
-	exit ;;
-    *:AIX:2:3)
-	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-		eval $set_cc_for_build
-		sed 's/^		//' << EOF >$dummy.c
-		#include <sys/systemcfg.h>
-
-		main()
-			{
-			if (!__power_pc())
-				exit(1);
-			puts("powerpc-ibm-aix3.2.5");
-			exit(0);
-			}
-EOF
-		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
-		then
-			echo "$SYSTEM_NAME"
-		else
-			echo rs6000-ibm-aix3.2.5
-		fi
-	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
-		echo rs6000-ibm-aix3.2.4
-	else
-		echo rs6000-ibm-aix3.2
-	fi
-	exit ;;
-    *:AIX:*:[4567])
-	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
-	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
-		IBM_ARCH=rs6000
-	else
-		IBM_ARCH=powerpc
-	fi
-	if [ -x /usr/bin/oslevel ] ; then
-		IBM_REV=`/usr/bin/oslevel`
-	else
-		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
-	fi
-	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
-	exit ;;
-    *:AIX:*:*)
-	echo rs6000-ibm-aix
-	exit ;;
-    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
-	echo romp-ibm-bsd4.4
-	exit ;;
-    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
-	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
-	exit ;;                             # report: romp-ibm BSD 4.3
-    *:BOSX:*:*)
-	echo rs6000-bull-bosx
-	exit ;;
-    DPX/2?00:B.O.S.:*:*)
-	echo m68k-bull-sysv3
-	exit ;;
-    9000/[34]??:4.3bsd:1.*:*)
-	echo m68k-hp-bsd
-	exit ;;
-    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
-	echo m68k-hp-bsd4.4
-	exit ;;
-    9000/[34678]??:HP-UX:*:*)
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-	case "${UNAME_MACHINE}" in
-	    9000/31? )            HP_ARCH=m68000 ;;
-	    9000/[34]?? )         HP_ARCH=m68k ;;
-	    9000/[678][0-9][0-9])
-		if [ -x /usr/bin/getconf ]; then
-		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-		    case "${sc_cpu_version}" in
-		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
-		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
-		      532)                      # CPU_PA_RISC2_0
-			case "${sc_kernel_bits}" in
-			  32) HP_ARCH="hppa2.0n" ;;
-			  64) HP_ARCH="hppa2.0w" ;;
-			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
-			esac ;;
-		    esac
-		fi
-		if [ "${HP_ARCH}" = "" ]; then
-		    eval $set_cc_for_build
-		    sed 's/^		//' << EOF >$dummy.c
-
-		#define _HPUX_SOURCE
-		#include <stdlib.h>
-		#include <unistd.h>
-
-		int main ()
-		{
-		#if defined(_SC_KERNEL_BITS)
-		    long bits = sysconf(_SC_KERNEL_BITS);
-		#endif
-		    long cpu  = sysconf (_SC_CPU_VERSION);
-
-		    switch (cpu)
-			{
-			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-			case CPU_PA_RISC2_0:
-		#if defined(_SC_KERNEL_BITS)
-			    switch (bits)
-				{
-				case 64: puts ("hppa2.0w"); break;
-				case 32: puts ("hppa2.0n"); break;
-				default: puts ("hppa2.0"); break;
-				} break;
-		#else  /* !defined(_SC_KERNEL_BITS) */
-			    puts ("hppa2.0"); break;
-		#endif
-			default: puts ("hppa1.0"); break;
-			}
-		    exit (0);
-		}
-EOF
-		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
-		    test -z "$HP_ARCH" && HP_ARCH=hppa
-		fi ;;
-	esac
-	if [ ${HP_ARCH} = "hppa2.0w" ]
-	then
-	    eval $set_cc_for_build
-
-	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
-	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
-	    # generating 64-bit code.  GNU and HP use different nomenclature:
-	    #
-	    # $ CC_FOR_BUILD=cc ./config.guess
-	    # => hppa2.0w-hp-hpux11.23
-	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
-	    # => hppa64-hp-hpux11.23
-
-	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
-		grep -q __LP64__
-	    then
-		HP_ARCH="hppa2.0w"
-	    else
-		HP_ARCH="hppa64"
-	    fi
-	fi
-	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
-	exit ;;
-    ia64:HP-UX:*:*)
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-	echo ia64-hp-hpux${HPUX_REV}
-	exit ;;
-    3050*:HI-UX:*:*)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#include <unistd.h>
-	int
-	main ()
-	{
-	  long cpu = sysconf (_SC_CPU_VERSION);
-	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
-	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
-	     results, however.  */
-	  if (CPU_IS_PA_RISC (cpu))
-	    {
-	      switch (cpu)
-		{
-		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
-		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
-		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
-		  default: puts ("hppa-hitachi-hiuxwe2"); break;
-		}
-	    }
-	  else if (CPU_IS_HP_MC68K (cpu))
-	    puts ("m68k-hitachi-hiuxwe2");
-	  else puts ("unknown-hitachi-hiuxwe2");
-	  exit (0);
-	}
-EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
-		{ echo "$SYSTEM_NAME"; exit; }
-	echo unknown-hitachi-hiuxwe2
-	exit ;;
-    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
-	echo hppa1.1-hp-bsd
-	exit ;;
-    9000/8??:4.3bsd:*:*)
-	echo hppa1.0-hp-bsd
-	exit ;;
-    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
-	echo hppa1.0-hp-mpeix
-	exit ;;
-    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
-	echo hppa1.1-hp-osf
-	exit ;;
-    hp8??:OSF1:*:*)
-	echo hppa1.0-hp-osf
-	exit ;;
-    i*86:OSF1:*:*)
-	if [ -x /usr/sbin/sysversion ] ; then
-	    echo ${UNAME_MACHINE}-unknown-osf1mk
-	else
-	    echo ${UNAME_MACHINE}-unknown-osf1
-	fi
-	exit ;;
-    parisc*:Lites*:*:*)
-	echo hppa1.1-hp-lites
-	exit ;;
-    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
-	echo c1-convex-bsd
-	exit ;;
-    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
-	if getsysinfo -f scalar_acc
-	then echo c32-convex-bsd
-	else echo c2-convex-bsd
-	fi
-	exit ;;
-    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
-	echo c34-convex-bsd
-	exit ;;
-    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
-	echo c38-convex-bsd
-	exit ;;
-    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
-	echo c4-convex-bsd
-	exit ;;
-    CRAY*Y-MP:*:*:*)
-	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    CRAY*[A-Z]90:*:*:*)
-	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
-	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-	      -e 's/\.[^.]*$/.X/'
-	exit ;;
-    CRAY*TS:*:*:*)
-	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    CRAY*T3E:*:*:*)
-	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    CRAY*SV1:*:*:*)
-	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    *:UNICOS/mp:*:*)
-	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
-	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-	exit ;;
-    5000:UNIX_System_V:4.*:*)
-	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
-	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-	exit ;;
-    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
-	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
-	exit ;;
-    sparc*:BSD/OS:*:*)
-	echo sparc-unknown-bsdi${UNAME_RELEASE}
-	exit ;;
-    *:BSD/OS:*:*)
-	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-	exit ;;
-    *:FreeBSD:*:*)
-	UNAME_PROCESSOR=`/usr/bin/uname -p`
-	case ${UNAME_PROCESSOR} in
-	    amd64)
-		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-	    *)
-		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-	esac
-	exit ;;
-    i*:CYGWIN*:*)
-	echo ${UNAME_MACHINE}-pc-cygwin
-	exit ;;
-    *:MINGW*:*)
-	echo ${UNAME_MACHINE}-pc-mingw32
-	exit ;;
-    i*:MSYS*:*)
-	echo ${UNAME_MACHINE}-pc-msys
-	exit ;;
-    i*:windows32*:*)
-	# uname -m includes "-pc" on this system.
-	echo ${UNAME_MACHINE}-mingw32
-	exit ;;
-    i*:PW*:*)
-	echo ${UNAME_MACHINE}-pc-pw32
-	exit ;;
-    *:Interix*:*)
-	case ${UNAME_MACHINE} in
-	    x86)
-		echo i586-pc-interix${UNAME_RELEASE}
-		exit ;;
-	    authenticamd | genuineintel | EM64T)
-		echo x86_64-unknown-interix${UNAME_RELEASE}
-		exit ;;
-	    IA64)
-		echo ia64-unknown-interix${UNAME_RELEASE}
-		exit ;;
-	esac ;;
-    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
-	echo i${UNAME_MACHINE}-pc-mks
-	exit ;;
-    8664:Windows_NT:*)
-	echo x86_64-pc-mks
-	exit ;;
-    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
-	# How do we know it's Interix rather than the generic POSIX subsystem?
-	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
-	# UNAME_MACHINE based on the output of uname instead of i386?
-	echo i586-pc-interix
-	exit ;;
-    i*:UWIN*:*)
-	echo ${UNAME_MACHINE}-pc-uwin
-	exit ;;
-    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
-	echo x86_64-unknown-cygwin
-	exit ;;
-    p*:CYGWIN*:*)
-	echo powerpcle-unknown-cygwin
-	exit ;;
-    prep*:SunOS:5.*:*)
-	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    *:GNU:*:*)
-	# the GNU system
-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-	exit ;;
-    *:GNU/*:*:*)
-	# other systems with GNU libc and userland
-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
-	exit ;;
-    i*86:Minix:*:*)
-	echo ${UNAME_MACHINE}-pc-minix
-	exit ;;
-    aarch64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    aarch64_be:Linux:*:*)
-	UNAME_MACHINE=aarch64_be
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    alpha:Linux:*:*)
-	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
-	  EV5)   UNAME_MACHINE=alphaev5 ;;
-	  EV56)  UNAME_MACHINE=alphaev56 ;;
-	  PCA56) UNAME_MACHINE=alphapca56 ;;
-	  PCA57) UNAME_MACHINE=alphapca56 ;;
-	  EV6)   UNAME_MACHINE=alphaev6 ;;
-	  EV67)  UNAME_MACHINE=alphaev67 ;;
-	  EV68*) UNAME_MACHINE=alphaev68 ;;
-	esac
-	objdump --private-headers /bin/sh | grep -q ld.so.1
-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
-	exit ;;
-    arm*:Linux:*:*)
-	eval $set_cc_for_build
-	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
-	    | grep -q __ARM_EABI__
-	then
-	    echo ${UNAME_MACHINE}-unknown-linux-gnu
-	else
-	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
-		| grep -q __ARM_PCS_VFP
-	    then
-		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
-	    else
-		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
-	    fi
-	fi
-	exit ;;
-    avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    cris:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
-	exit ;;
-    crisv32:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
-	exit ;;
-    frv:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    hexagon:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    i*86:Linux:*:*)
-	LIBC=gnu
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#ifdef __dietlibc__
-	LIBC=dietlibc
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
-	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
-	exit ;;
-    ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    mips:Linux:*:* | mips64:Linux:*:*)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#undef CPU
-	#undef ${UNAME_MACHINE}
-	#undef ${UNAME_MACHINE}el
-	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-	CPU=${UNAME_MACHINE}el
-	#else
-	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-	CPU=${UNAME_MACHINE}
-	#else
-	CPU=
-	#endif
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
-	;;
-    or32:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    padre:Linux:*:*)
-	echo sparc-unknown-linux-gnu
-	exit ;;
-    parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-gnu
-	exit ;;
-    parisc:Linux:*:* | hppa:Linux:*:*)
-	# Look for CPU level
-	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
-	  *)    echo hppa-unknown-linux-gnu ;;
-	esac
-	exit ;;
-    ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-gnu
-	exit ;;
-    ppc:Linux:*:*)
-	echo powerpc-unknown-linux-gnu
-	exit ;;
-    s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-ibm-linux
-	exit ;;
-    sh64*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    tile*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    vax:Linux:*:*)
-	echo ${UNAME_MACHINE}-dec-linux-gnu
-	exit ;;
-    x86_64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    xtensa*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    i*86:DYNIX/ptx:4*:*)
-	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
-	# earlier versions are messed up and put the nodename in both
-	# sysname and nodename.
-	echo i386-sequent-sysv4
-	exit ;;
-    i*86:UNIX_SV:4.2MP:2.*)
-	# Unixware is an offshoot of SVR4, but it has its own version
-	# number series starting with 2...
-	# I am not positive that other SVR4 systems won't match this,
-	# I just have to hope.  -- rms.
-	# Use sysv4.2uw... so that sysv4* matches it.
-	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-	exit ;;
-    i*86:OS/2:*:*)
-	# If we were able to find `uname', then EMX Unix compatibility
-	# is probably installed.
-	echo ${UNAME_MACHINE}-pc-os2-emx
-	exit ;;
-    i*86:XTS-300:*:STOP)
-	echo ${UNAME_MACHINE}-unknown-stop
-	exit ;;
-    i*86:atheos:*:*)
-	echo ${UNAME_MACHINE}-unknown-atheos
-	exit ;;
-    i*86:syllable:*:*)
-	echo ${UNAME_MACHINE}-pc-syllable
-	exit ;;
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
-	echo i386-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    i*86:*DOS:*:*)
-	echo ${UNAME_MACHINE}-pc-msdosdjgpp
-	exit ;;
-    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
-	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
-	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
-	else
-		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
-	fi
-	exit ;;
-    i*86:*:5:[678]*)
-	# UnixWare 7.x, OpenUNIX and OpenServer 6.
-	case `/bin/uname -X | grep "^Machine"` in
-	    *486*)	     UNAME_MACHINE=i486 ;;
-	    *Pentium)	     UNAME_MACHINE=i586 ;;
-	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
-	esac
-	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
-	exit ;;
-    i*86:*:3.2:*)
-	if test -f /usr/options/cb.name; then
-		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
-	elif /bin/uname -X 2>/dev/null >/dev/null ; then
-		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
-		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
-		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
-			&& UNAME_MACHINE=i586
-		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
-			&& UNAME_MACHINE=i686
-		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
-			&& UNAME_MACHINE=i686
-		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
-	else
-		echo ${UNAME_MACHINE}-pc-sysv32
-	fi
-	exit ;;
-    pc:*:*:*)
-	# Left here for compatibility:
-	# uname -m prints for DJGPP always 'pc', but it prints nothing about
-	# the processor, so we play safe by assuming i586.
-	# Note: whatever this is, it MUST be the same as what config.sub
-	# prints for the "djgpp" host, or else GDB configury will decide that
-	# this is a cross-build.
-	echo i586-pc-msdosdjgpp
-	exit ;;
-    Intel:Mach:3*:*)
-	echo i386-pc-mach3
-	exit ;;
-    paragon:*:*:*)
-	echo i860-intel-osf1
-	exit ;;
-    i860:*:4.*:*) # i860-SVR4
-	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
-	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
-	else # Add other i860-SVR4 vendors below as they are discovered.
-	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
-	fi
-	exit ;;
-    mini*:CTIX:SYS*5:*)
-	# "miniframe"
-	echo m68010-convergent-sysv
-	exit ;;
-    mc68k:UNIX:SYSTEM5:3.51m)
-	echo m68k-convergent-sysv
-	exit ;;
-    M680?0:D-NIX:5.3:*)
-	echo m68k-diab-dnix
-	exit ;;
-    M68*:*:R3V[5678]*:*)
-	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
-    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
-	OS_REL=''
-	test -r /etc/.relid \
-	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
-	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
-	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
-    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
-	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && { echo i486-ncr-sysv4; exit; } ;;
-    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
-	OS_REL='.3'
-	test -r /etc/.relid \
-	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
-	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
-	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
-	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
-	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
-    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-	echo m68k-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    mc68030:UNIX_System_V:4.*:*)
-	echo m68k-atari-sysv4
-	exit ;;
-    TSUNAMI:LynxOS:2.*:*)
-	echo sparc-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    rs6000:LynxOS:2.*:*)
-	echo rs6000-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
-	echo powerpc-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    SM[BE]S:UNIX_SV:*:*)
-	echo mips-dde-sysv${UNAME_RELEASE}
-	exit ;;
-    RM*:ReliantUNIX-*:*:*)
-	echo mips-sni-sysv4
-	exit ;;
-    RM*:SINIX-*:*:*)
-	echo mips-sni-sysv4
-	exit ;;
-    *:SINIX-*:*:*)
-	if uname -p 2>/dev/null >/dev/null ; then
-		UNAME_MACHINE=`(uname -p) 2>/dev/null`
-		echo ${UNAME_MACHINE}-sni-sysv4
-	else
-		echo ns32k-sni-sysv
-	fi
-	exit ;;
-    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-			# says <Richard.M.Bartel at ccMail.Census.GOV>
-	echo i586-unisys-sysv4
-	exit ;;
-    *:UNIX_System_V:4*:FTX*)
-	# From Gerald Hewes <hewes at openmarket.com>.
-	# How about differentiating between stratus architectures? -djm
-	echo hppa1.1-stratus-sysv4
-	exit ;;
-    *:*:*:FTX*)
-	# From seanf at swdc.stratus.com.
-	echo i860-stratus-sysv4
-	exit ;;
-    i*86:VOS:*:*)
-	# From Paul.Green at stratus.com.
-	echo ${UNAME_MACHINE}-stratus-vos
-	exit ;;
-    *:VOS:*:*)
-	# From Paul.Green at stratus.com.
-	echo hppa1.1-stratus-vos
-	exit ;;
-    mc68*:A/UX:*:*)
-	echo m68k-apple-aux${UNAME_RELEASE}
-	exit ;;
-    news*:NEWS-OS:6*:*)
-	echo mips-sony-newsos6
-	exit ;;
-    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
-	if [ -d /usr/nec ]; then
-		echo mips-nec-sysv${UNAME_RELEASE}
-	else
-		echo mips-unknown-sysv${UNAME_RELEASE}
-	fi
-	exit ;;
-    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
-	echo powerpc-be-beos
-	exit ;;
-    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
-	echo powerpc-apple-beos
-	exit ;;
-    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
-	echo i586-pc-beos
-	exit ;;
-    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
-	echo i586-pc-haiku
-	exit ;;
-    SX-4:SUPER-UX:*:*)
-	echo sx4-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-5:SUPER-UX:*:*)
-	echo sx5-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-6:SUPER-UX:*:*)
-	echo sx6-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-7:SUPER-UX:*:*)
-	echo sx7-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-8:SUPER-UX:*:*)
-	echo sx8-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-8R:SUPER-UX:*:*)
-	echo sx8r-nec-superux${UNAME_RELEASE}
-	exit ;;
-    Power*:Rhapsody:*:*)
-	echo powerpc-apple-rhapsody${UNAME_RELEASE}
-	exit ;;
-    *:Rhapsody:*:*)
-	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
-	exit ;;
-    *:Darwin:*:*)
-	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	case $UNAME_PROCESSOR in
-	    i386)
-		eval $set_cc_for_build
-		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		      grep IS_64BIT_ARCH >/dev/null
-		  then
-		      UNAME_PROCESSOR="x86_64"
-		  fi
-		fi ;;
-	    unknown) UNAME_PROCESSOR=powerpc ;;
-	esac
-	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
-	exit ;;
-    *:procnto*:*:* | *:QNX:[0123456789]*:*)
-	UNAME_PROCESSOR=`uname -p`
-	if test "$UNAME_PROCESSOR" = "x86"; then
-		UNAME_PROCESSOR=i386
-		UNAME_MACHINE=pc
-	fi
-	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
-	exit ;;
-    *:QNX:*:4*)
-	echo i386-pc-qnx
-	exit ;;
-    NEO-?:NONSTOP_KERNEL:*:*)
-	echo neo-tandem-nsk${UNAME_RELEASE}
-	exit ;;
-    NSE-?:NONSTOP_KERNEL:*:*)
-	echo nse-tandem-nsk${UNAME_RELEASE}
-	exit ;;
-    NSR-?:NONSTOP_KERNEL:*:*)
-	echo nsr-tandem-nsk${UNAME_RELEASE}
-	exit ;;
-    *:NonStop-UX:*:*)
-	echo mips-compaq-nonstopux
-	exit ;;
-    BS2000:POSIX*:*:*)
-	echo bs2000-siemens-sysv
-	exit ;;
-    DS/*:UNIX_System_V:*:*)
-	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
-	exit ;;
-    *:Plan9:*:*)
-	# "uname -m" is not consistent, so use $cputype instead. 386
-	# is converted to i386 for consistency with other x86
-	# operating systems.
-	if test "$cputype" = "386"; then
-	    UNAME_MACHINE=i386
-	else
-	    UNAME_MACHINE="$cputype"
-	fi
-	echo ${UNAME_MACHINE}-unknown-plan9
-	exit ;;
-    *:TOPS-10:*:*)
-	echo pdp10-unknown-tops10
-	exit ;;
-    *:TENEX:*:*)
-	echo pdp10-unknown-tenex
-	exit ;;
-    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
-	echo pdp10-dec-tops20
-	exit ;;
-    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
-	echo pdp10-xkl-tops20
-	exit ;;
-    *:TOPS-20:*:*)
-	echo pdp10-unknown-tops20
-	exit ;;
-    *:ITS:*:*)
-	echo pdp10-unknown-its
-	exit ;;
-    SEI:*:*:SEIUX)
-	echo mips-sei-seiux${UNAME_RELEASE}
-	exit ;;
-    *:DragonFly:*:*)
-	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-	exit ;;
-    *:*VMS:*:*)
-	UNAME_MACHINE=`(uname -p) 2>/dev/null`
-	case "${UNAME_MACHINE}" in
-	    A*) echo alpha-dec-vms ; exit ;;
-	    I*) echo ia64-dec-vms ; exit ;;
-	    V*) echo vax-dec-vms ; exit ;;
-	esac ;;
-    *:XENIX:*:SysV)
-	echo i386-pc-xenix
-	exit ;;
-    i*86:skyos:*:*)
-	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
-	exit ;;
-    i*86:rdos:*:*)
-	echo ${UNAME_MACHINE}-pc-rdos
-	exit ;;
-    i*86:AROS:*:*)
-	echo ${UNAME_MACHINE}-pc-aros
-	exit ;;
-    x86_64:VMkernel:*:*)
-	echo ${UNAME_MACHINE}-unknown-esx
-	exit ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
-  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
-     I don't know....  */
-  printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
-  printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
-	"4"
-#else
-	""
-#endif
-	); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
-  printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
-  int version;
-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  if (version < 4)
-    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
-  else
-    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
-  exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
-  printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
-  printf ("ns32k-encore-mach\n"); exit (0);
-#else
-  printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
-  printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
-  printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
-  printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
-    struct utsname un;
-
-    uname(&un);
-
-    if (strncmp(un.version, "V2", 2) == 0) {
-	printf ("i386-sequent-ptx2\n"); exit (0);
-    }
-    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
-	printf ("i386-sequent-ptx1\n"); exit (0);
-    }
-    printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-#  include <sys/param.h>
-#  if defined (BSD)
-#   if BSD == 43
-      printf ("vax-dec-bsd4.3\n"); exit (0);
-#   else
-#    if BSD == 199006
-      printf ("vax-dec-bsd4.3reno\n"); exit (0);
-#    else
-      printf ("vax-dec-bsd\n"); exit (0);
-#    endif
-#   endif
-#  else
-    printf ("vax-dec-bsd\n"); exit (0);
-#  endif
-# else
-    printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
-  printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
-  exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
-	{ echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
-    case `getsysinfo -f cpu_type` in
-    c1*)
-	echo c1-convex-bsd
-	exit ;;
-    c2*)
-	if getsysinfo -f scalar_acc
-	then echo c32-convex-bsd
-	else echo c2-convex-bsd
-	fi
-	exit ;;
-    c34*)
-	echo c34-convex-bsd
-	exit ;;
-    c38*)
-	echo c38-convex-bsd
-	exit ;;
-    c4*)
-	echo c4-convex-bsd
-	exit ;;
-    esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-and
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches at gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo               = `(hostinfo) 2>/dev/null`
-/bin/universe          = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch              = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM  = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/external/privoxy/config.orig b/external/privoxy/config.orig
deleted file mode 100644
index 176dd5f..0000000
--- a/external/privoxy/config.orig
+++ /dev/null
@@ -1,1530 +0,0 @@
-#        Sample Configuration File for Privoxy v3.0.12
-#
-#  $Id: config,v 1.75 2009/03/21 11:35:37 hal9 Exp $
-#
-#  Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/
-#
-####################################################################
-#                                                                  #
-#                      Table of Contents                           #
-#                                                                  #
-#        I. INTRODUCTION                                           #
-#       II. FORMAT OF THE CONFIGURATION FILE                       #
-#                                                                  #
-#        1. LOCAL SET-UP DOCUMENTATION                             #
-#        2. CONFIGURATION AND LOG FILE LOCATIONS                   #
-#        3. DEBUGGING                                              #
-#        4. ACCESS CONTROL AND SECURITY                            #
-#        5. FORWARDING                                             #
-#        6. WINDOWS GUI OPTIONS                                    #
-#                                                                  #
-####################################################################
-#
-#
-#  I. INTRODUCTION
-#   ===============
-#
-#  This file holds Privoxy's main configuration. Privoxy detects
-#  configuration changes automatically, so you don't have to restart
-#  it unless you want to load a different configuration file.
-#
-#  The configuration will be reloaded with the first request after
-#  the change was done, this request itself will still use the old
-#  configuration, though. In other words: it takes two requests before
-#  you see the result of your changes.  Requests that are dropped due
-#  to ACL don't trigger reloads.
-#
-#  When starting Privoxy on Unix systems, give the location of this
-#  file as last argument. On Windows systems, Privoxy will look for
-#  this file with the name 'config.txt' in the current working directory
-#  of the Privoxy process.
-#
-#
-#  II. FORMAT OF THE CONFIGURATION FILE
-#  ====================================
-#
-#  Configuration lines consist of an initial keyword followed by a
-#  list of values, all separated by whitespace (any number of spaces
-#  or tabs). For example,
-#
-#  actionsfile default.action
-#
-#  Indicates that the actionsfile is named 'default.action'.
-#
-#  The '#' indicates a comment. Any part of a line following a '#'
-#  is ignored, except if the '#' is preceded by a '\'.
-#
-#  Thus, by placing a # at the start of an existing configuration
-#  line, you can make it a comment and it will be treated as if it
-#  weren't there. This is called "commenting out" an option and can
-#  be useful. Removing the # again is called "uncommenting".
-#
-#  Note that commenting out an option and leaving it at its default
-#  are two completely different things! Most options behave very
-#  differently when unset.  See the "Effect if unset" explanation in
-#  each option's description for details.
-#
-#  Long lines can be continued on the next line by using a `\' as the
-#  last character.
-#
-#
-#
-#  1. LOCAL SET-UP DOCUMENTATION
-#  ==============================
-#
-#  If you intend to operate Privoxy for more users than just yourself,
-#  it might be a good idea to let them know how to reach you, what
-#  you block and why you do that, your policies, etc.
-#
-#
-#
-#  1.1. user-manual
-#  =================
-#
-#  Specifies:
-#
-#      Location of the Privoxy User Manual.
-#
-#  Type of value:
-#
-#      A fully qualified URI
-#
-#  Default value:
-#
-#      Unset
-#
-#  Effect if unset:
-#
-#      http://www.privoxy.org/version/user-manual/ will be used,
-#      where version is the Privoxy version.
-#
-#  Notes:
-#
-#      The User Manual URI is the single best source of information on
-#      Privoxy, and is used for help links from some of the internal
-#      CGI pages. The manual itself is normally packaged with the
-#      binary distributions, so you probably want to set this to a
-#      locally installed copy.
-#
-#      Examples:
-#
-#      The best all purpose solution is simply to put the full local
-#      PATH to where the User Manual is located:
-#
-#        user-manual  /usr/share/doc/privoxy/user-manual
-#
-#
-#      The User Manual is then available to anyone with
-#      access to Privoxy, by following the built-in URL:
-#      http://config.privoxy.org/user-manual/ (or the shortcut:
-#      http://p.p/user-manual/).
-#
-#      If the documentation is not on the local system, it can be
-#      accessed from a remote server, as:
-#
-#        user-manual  http://example.com/privoxy/user-manual/
-#
-#
-#      WARNING!!!
-#
-#          If set, this option should be the first option in the config
-#          file, because it is used while the config file is being read.
-#
-user-manual /home/halb/privoxy/share/doc/privoxy/user-manual/
-#
-#
-#  1.2. trust-info-url
-#  ====================
-#
-#  Specifies:
-#
-#      A URL to be displayed in the error page that users will see if
-#      access to an untrusted page is denied.
-#
-#  Type of value:
-#
-#      URL
-#
-#  Default value:
-#
-#      Unset
-#
-#  Effect if unset:
-#
-#      No links are displayed on the "untrusted" error page.
-#
-#  Notes:
-#
-#      The value of this option only matters if the experimental trust
-#      mechanism has been activated. (See trustfile below.)
-#
-#      If you use the trust mechanism, it is a good idea to write
-#      up some on-line documentation about your trust policy and to
-#      specify the URL(s) here. Use multiple times for multiple URLs.
-#
-#      The URL(s) should be added to the trustfile as well, so users
-#      don't end up locked out from the information on why they were
-#      locked out in the first place!
-#
-#trust-info-url  http://www.example.com/why_we_block.html
-#trust-info-url  http://www.example.com/what_we_allow.html
-#
-#
-#  1.3. admin-address
-#  ===================
-#
-#  Specifies:
-#
-#      An email address to reach the Privoxy administrator.
-#
-#  Type of value:
-#
-#      Email address
-#
-#  Default value:
-#
-#      Unset
-#
-#  Effect if unset:
-#
-#      No email address is displayed on error pages and the CGI user
-#      interface.
-#
-#  Notes:
-#
-#      If both admin-address and proxy-info-url are unset, the whole
-#      "Local Privoxy Support" box on all generated pages will not
-#      be shown.
-#
-#admin-address privoxy-admin at example.com
-#
-#
-#  1.4. proxy-info-url
-#  ====================
-#
-#  Specifies:
-#
-#      A URL to documentation about the local Privoxy setup,
-#      configuration or policies.
-#
-#  Type of value:
-#
-#      URL
-#
-#  Default value:
-#
-#      Unset
-#
-#  Effect if unset:
-#
-#      No link to local documentation is displayed on error pages and
-#      the CGI user interface.
-#
-#  Notes:
-#
-#      If both admin-address and proxy-info-url are unset, the whole
-#      "Local Privoxy Support" box on all generated pages will not
-#      be shown.
-#
-#      This URL shouldn't be blocked ;-)
-#
-#proxy-info-url http://www.example.com/proxy-service.html
-#
-#
-#  2. CONFIGURATION AND LOG FILE LOCATIONS
-#  ========================================
-#
-#  Privoxy can (and normally does) use a number of other files for
-#  additional configuration, help and logging. This section of the
-#  configuration file tells Privoxy where to find those other files.
-#
-#  The user running Privoxy, must have read permission for all
-#  configuration files, and write permission to any files that would
-#  be modified, such as log files and actions files.
-#
-#
-#
-#  2.1. confdir
-#  =============
-#
-#  Specifies:
-#
-#      The directory where the other configuration files are located.
-#
-#  Type of value:
-#
-#      Path name
-#
-#  Default value:
-#
-#      /etc/privoxy (Unix) or Privoxy installation dir (Windows)
-#
-#  Effect if unset:
-#
-#      Mandatory
-#
-#  Notes:
-#
-#      No trailing "/", please.
-#
-confdir /home/halb/privoxy/etc
-#
-#
-#  2.2. templdir
-#  ==============
-#
-#  Specifies:
-#
-#      An alternative directory where the templates are loaded from.
-#
-#  Type of value:
-#
-#      Path name
-#
-#  Default value:
-#
-#      unset
-#
-#  Effect if unset:
-#
-#      The templates are assumed to be located in confdir/template.
-#
-#  Notes:
-#
-#      Privoxy's original templates are usually overwritten with each
-#      update. Use this option to relocate customized templates that
-#      should be kept. As template variables might change between
-#      updates, you shouldn't expect templates to work with Privoxy
-#      releases other than the one they were part of, though.
-#
-#templdir .
-#
-#
-#  2.3. logdir
-#  ============
-#
-#  Specifies:
-#
-#      The directory where all logging takes place (i.e. where the
-#      logfile is located).
-#
-#  Type of value:
-#
-#      Path name
-#
-#  Default value:
-#
-#      /var/log/privoxy (Unix) or Privoxy installation dir (Windows)
-#
-#  Effect if unset:
-#
-#      Mandatory
-#
-#  Notes:
-#
-#      No trailing "/", please.
-#
-logdir /home/halb/privoxy/var/log/privoxy
-#
-#
-#  2.4. actionsfile
-#  =================
-#
-#  Specifies:
-#
-#      The actions file(s) to use
-#
-#  Type of value:
-#
-#      Complete file name, relative to confdir
-#
-#  Default values:
-#
-#        match-all.action # Actions that are applied to all sites and maybe overruled later on.
-#
-#        default.action   # Main actions file
-#
-#        user.action      # User customizations
-#
-#  Effect if unset:
-#
-#      No actions are taken at all. More or less neutral proxying.
-#
-#  Notes:
-#
-#      Multiple actionsfile lines are permitted, and are in fact
-#      recommended!
-#
-#      The default values are default.action, which is the "main"
-#      actions file maintained by the developers, and user.action,
-#      where you can make your personal additions.
-#
-#      Actions files contain all the per site and per URL configuration
-#      for ad blocking, cookie management, privacy considerations,
-#      etc. There is no point in using Privoxy without at least one
-#      actions file.
-#
-#      Note that since Privoxy 3.0.7, the complete filename, including
-#      the ".action" extension has to be specified. The syntax change
-#      was necessary to be consistent with the other file options and
-#      to allow previously forbidden characters.
-#
-actionsfile match-all.action # Actions that are applied to all sites and maybe overruled later on.
-actionsfile default.action   # Main actions file
-actionsfile user.action      # User customizations
-#
-#
-#  2.5. filterfile
-#  ================
-#
-#  Specifies:
-#
-#      The filter file(s) to use
-#
-#  Type of value:
-#
-#      File name, relative to confdir
-#
-#  Default value:
-#
-#      default.filter (Unix) or default.filter.txt (Windows)
-#
-#  Effect if unset:
-#
-#      No textual content filtering takes place, i.e. all +filter{name}
-#      actions in the actions files are turned neutral.
-#
-#  Notes:
-#
-#      Multiple filterfile lines are permitted.
-#
-#      The filter files contain content modification rules that use
-#      regular expressions. These rules permit powerful changes on the
-#      content of Web pages, and optionally the headers as well, e.g.,
-#      you could try to disable your favorite JavaScript annoyances,
-#      re-write the actual displayed text, or just have some fun
-#      playing buzzword bingo with web pages.
-#
-#      The +filter{name} actions rely on the relevant filter (name)
-#      to be defined in a filter file!
-#
-#      A pre-defined filter file called default.filter that contains a
-#      number of useful filters for common problems is included in the
-#      distribution. See the section on the filter action for a list.
-#
-#      It is recommended to place any locally adapted filters into a
-#      separate file, such as user.filter.
-#
-filterfile default.filter
-#filterfile user.filter      # User customizations
-#
-#
-#  2.6. logfile
-#  =============
-#
-#  Specifies:
-#
-#      The log file to use
-#
-#  Type of value:
-#
-#      File name, relative to logdir
-#
-#  Default value:
-#
-#      Unset (commented out). When activated: logfile (Unix) or
-#      privoxy.log (Windows).
-#
-#  Effect if unset:
-#
-#      No logfile is written.
-#
-#  Notes:
-#
-#      The logfile is where all logging and error messages are
-#      written. The level of detail and number of messages are set with
-#      the debug option (see below).  The logfile can be useful for
-#      tracking down a problem with Privoxy (e.g., it's not blocking
-#      an ad you think it should block) and it can help you to monitor
-#      what your browser is doing.
-#
-#      Depending on the debug options below, the logfile may be a
-#      privacy risk if third parties can get access to it. As most
-#      users will never look at it, Privoxy 3.0.7 and later only log
-#      fatal errors by default.
-#
-#      For most troubleshooting purposes, you will have to change that,
-#      please refer to the debugging section for details.
-#
-#      Your logfile will grow indefinitely, and you will probably
-#      want to periodically remove it. On Unix systems, you can do
-#      this with a cron job (see "man cron"). For Red Hat based Linux
-#      distributions, a logrotate script has been included.
-#
-#      Any log files must be writable by whatever user Privoxy is
-#      being run as (on Unix, default user id is "privoxy").
-#
-logfile logfile
-#
-#
-#  2.7. trustfile
-#  ===============
-#
-#  Specifies:
-#
-#      The name of the trust file to use
-#
-#  Type of value:
-#
-#      File name, relative to confdir
-#
-#  Default value:
-#
-#      Unset (commented out). When activated: trust (Unix) or trust.txt
-#      (Windows)
-#
-#  Effect if unset:
-#
-#      The entire trust mechanism is disabled.
-#
-#  Notes:
-#
-#      The trust mechanism is an experimental feature for building
-#      white-lists and should be used with care. It is NOT recommended
-#      for the casual user.
-#
-#      If you specify a trust file, Privoxy will only allow access to
-#      sites that are specified in the trustfile. Sites can be listed
-#      in one of two ways:
-#
-#      Prepending a ~ character limits access to this site only (and
-#      any sub-paths within this site), e.g. ~www.example.com allows
-#      access to ~www.example.com/ features/news.html, etc.
-#
-#      Or, you can designate sites as trusted referrers, by prepending
-#      the name with a + character. The effect is that access to
-#      untrusted sites will be granted -- but only if a link from
-#      this trusted referrer was used to get there. The link target
-#      will then be added to the "trustfile" so that future, direct
-#      accesses will be granted. Sites added via this mechanism do
-#      not become trusted referrers themselves (i.e. they are added
-#      with a ~ designation). There is a limit of 512 such entries,
-#      after which new entries will not be made.
-#
-#      If you use the + operator in the trust file, it may grow
-#      considerably over time.
-#
-#      It is recommended that Privoxy be compiled with the
-#      --disable-force, --disable-toggle and --disable-editor options,
-#      if this feature is to be used.
-#
-#      Possible applications include limiting Internet access for
-#      children.
-#
-#trustfile trust
-#
-#
-#  3. DEBUGGING
-#  =============
-#
-#  These options are mainly useful when tracing a problem. Note that
-#  you might also want to invoke Privoxy with the --no-daemon command
-#  line option when debugging.
-#
-#
-#
-#  3.1. debug
-#  ===========
-#
-#  Specifies:
-#
-#      Key values that determine what information gets logged.
-#
-#  Type of value:
-#
-#      Integer values
-#
-#  Default value:
-#
-#      0 (i.e.: only fatal errors (that cause Privoxy to exit) are logged)
-#
-#  Effect if unset:
-#
-#      Default value is used (see above).
-#
-#  Notes:
-#
-#      The available debug levels are:
-#
-#        debug         1 # Log the destination for each request Privoxy let through. See also debug 1024.
-#        debug         2 # show each connection status
-#        debug         4 # show I/O status
-#        debug         8 # show header parsing
-#        debug        16 # log all data written to the network into the logfile
-#        debug        32 # debug force feature
-#        debug        64 # debug regular expression filters
-#        debug       128 # debug redirects
-#        debug       256 # debug GIF de-animation
-#        debug       512 # Common Log Format
-#        debug      1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
-#        debug      2048 # CGI user interface
-#        debug      4096 # Startup banner and warnings.
-#        debug      8192 # Non-fatal errors
-#
-#
-#      To select multiple debug levels, you can either add them or
-#      use multiple debug lines.
-#
-#      A debug level of 1 is informative because it will show you each
-#      request as it happens. 1, 4096 and 8192 are recommended so that
-#      you will notice when things go wrong. The other levels are
-#      probably only of interest if you are hunting down a specific
-#      problem. They can produce a hell of an output (especially 16).
-#
-#      Privoxy used to ship with the debug levels recommended above
-#      enabled by default, but due to privacy concerns 3.0.7 and later
-#      are configured to only log fatal errors.
-#
-#      If you are used to the more verbose settings, simply enable
-#      the debug lines below again.
-#
-#      If you want to use pure CLF (Common Log Format), you should set
-#      "debug 512" ONLY and not enable anything else.
-#
-#      Privoxy has a hard-coded limit for the length of log messages. If
-#      it's reached, messages are logged truncated and marked with
-#      "... [too long, truncated]".
-#
-#      Please don't file any support requests without trying to
-#      reproduce the problem with increased debug level first. Once
-#      you read the log messages, you may even be able to solve the
-#      problem on your own.
-#
-#debug      1 # Log the destination for each request Privoxy let through.
-#debug   1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
-#debug   4096 # Startup banner and warnings
-#debug   8192 # Non-fatal errors
-#
-#
-#  3.2. single-threaded
-#  =====================
-#
-#  Specifies:
-#
-#      Whether to run only one server thread.
-#
-#  Type of value:
-#
-#      None
-#
-#  Default value:
-#
-#      Unset
-#
-#  Effect if unset:
-#
-#      Multi-threaded (or, where unavailable: forked) operation,
-#      i.e. the ability to serve multiple requests simultaneously.
-#
-#  Notes:
-#
-#      This option is only there for debugging purposes. It will
-#      drastically reduce performance.
-#
-#single-threaded
-#
-#
-#  3.3. hostname
-#  ==============
-#
-#  Specifies:
-#
-#      The hostname shown on the CGI pages.
-#
-#  Type of value:
-#
-#      Text
-#
-#  Default value:
-#
-#      Unset
-#
-#  Effect if unset:
-#
-#      The hostname provided by the operating system is used.
-#
-#  Notes:
-#
-#      On some misconfigured systems resolving the hostname fails or
-#      takes too much time and slows Privoxy down. Setting a fixed
-#      hostname works around the problem.
-#
-#      In other circumstances it might be desirable to show a hostname
-#      other than the one returned by the operating system. For example
-#      if the system has several different hostnames and you don't
-#      want to use the first one.
-#
-#      Note that Privoxy does not validate the specified hostname value.
-#
-#hostname hostname.example.org
-#
-#
-#  4. ACCESS CONTROL AND SECURITY
-#  ===============================
-#
-#  This section of the config file controls the security-relevant
-#  aspects of Privoxy's configuration.
-#
-#
-#
-#  4.1. listen-address
-#  ====================
-#
-#  Specifies:
-#
-#      The IP address and TCP port on which Privoxy will listen for
-#      client requests.
-#
-#  Type of value:
-#
-#      [IP-Address]:Port
-#
-#  Default value:
-#
-#      127.0.0.1:8118
-#
-#  Effect if unset:
-#
-#      Bind to 127.0.0.1 (localhost), port 8118. This is suitable and
-#      recommended for home users who run Privoxy on the same machine
-#      as their browser.
-#
-#  Notes:
-#
-#      You will need to configure your browser(s) to this proxy address
-#      and port.
-#
-#      If you already have another service running on port 8118, or
-#      if you want to serve requests from other machines (e.g. on your
-#      local network) as well, you will need to override the default.
-#
-#      If you leave out the IP address, Privoxy will bind to all
-#      interfaces (addresses) on your machine and may become reachable
-#      from the Internet. In that case, consider using access control
-#      lists (ACL's, see below), and/or a firewall.
-#
-#      If you open Privoxy to untrusted users, you will also
-#      want to make sure that the following actions are disabled:
-#      enable-edit-actions and enable-remote-toggle
-#
-#  Example:
-#
-#      Suppose you are running Privoxy on a machine which has the
-#      address 192.168.0.1 on your local private network (192.168.0.0)
-#      and has another outside connection with a different address. You
-#      want it to serve requests from inside only:
-#
-#        listen-address  192.168.0.1:8118
-#
-#
-listen-address  127.0.0.1:8118
-#
-#
-#  4.2. toggle
-#  ============
-#
-#  Specifies:
-#
-#      Initial state of "toggle" status
-#
-#  Type of value:
-#
-#      1 or 0
-#
-#  Default value:
-#
-#      1
-#
-#  Effect if unset:
-#
-#      Act as if toggled on
-#
-#  Notes:
-#
-#      If set to 0, Privoxy will start in "toggled off" mode,
-#      i.e. mostly behave like a normal, content-neutral proxy
-#      with both ad blocking and content filtering disabled. See
-#      enable-remote-toggle below.
-#
-#      The windows version will only display the toggle icon in the
-#      system tray if this option is present.
-#
-toggle  1
-#
-#
-#  4.3. enable-remote-toggle
-#  ==========================
-#
-#  Specifies:
-#
-#      Whether or not the web-based toggle feature may be used
-#
-#  Type of value:
-#
-#      0 or 1
-#
-#  Default value:
-#
-#      0
-#
-#  Effect if unset:
-#
-#      The web-based toggle feature is disabled.
-#
-#  Notes:
-#
-#      When toggled off, Privoxy mostly acts like a normal,
-#      content-neutral proxy, i.e. doesn't block ads or filter content.
-#
-#      Access to the toggle feature can not be controlled separately by
-#      "ACLs" or HTTP authentication, so that everybody who can access
-#      Privoxy (see "ACLs" and listen-address above) can toggle it
-#      for all users. So this option is not recommended for multi-user
-#      environments with untrusted users.
-#
-#      Note that malicious client side code (e.g Java) is also capable
-#      of using this option.
-#
-#      As a lot of Privoxy users don't read documentation, this feature
-#      is disabled by default.
-#
-#      Note that you must have compiled Privoxy with support for this
-#      feature, otherwise this option has no effect.
-#
-enable-remote-toggle  0
-#
-#
-#  4.4. enable-remote-http-toggle
-#  ===============================
-#
-#  Specifies:
-#
-#      Whether or not Privoxy recognizes special HTTP headers to change
-#      its behaviour.
-#
-#  Type of value:
-#
-#      0 or 1
-#
-#  Default value:
-#
-#      0
-#
-#  Effect if unset:
-#
-#      Privoxy ignores special HTTP headers.
-#
-#  Notes:
-#
-#      When toggled on, the client can change Privoxy's behaviour by
-#      setting special HTTP headers. Currently the only supported
-#      special header is "X-Filter: No", to disable filtering for
-#      the ongoing request, even if it is enabled in one of the
-#      action files.
-#
-#      This feature is disabled by default. If you are using Privoxy in
-#      a environment with trusted clients, you may enable this feature
-#      at your discretion. Note that malicious client side code (e.g
-#      Java) is also capable of using this feature.
-#
-#      This option will be removed in future releases as it has been
-#      obsoleted by the more general header taggers.
-#
-enable-remote-http-toggle  0
-#
-#
-#  4.5. enable-edit-actions
-#  =========================
-#
-#  Specifies:
-#
-#      Whether or not the web-based actions file editor may be used
-#
-#  Type of value:
-#
-#      0 or 1
-#
-#  Default value:
-#
-#      0
-#
-#  Effect if unset:
-#
-#      The web-based actions file editor is disabled.
-#
-#  Notes:
-#
-#      Access to the editor can not be controlled separately by
-#      "ACLs" or HTTP authentication, so that everybody who can access
-#      Privoxy (see "ACLs" and listen-address above) can modify its
-#      configuration for all users.
-#
-#      This option is not recommended for environments with untrusted
-#      users and as a lot of Privoxy users don't read documentation,
-#      this feature is disabled by default.
-#
-#      Note that malicious client side code (e.g Java) is also capable
-#      of using the actions editor and you shouldn't enable this
-#      options unless you understand the consequences and are sure
-#      your browser is configured correctly.
-#
-#      Note that you must have compiled Privoxy with support for this
-#      feature, otherwise this option has no effect.
-#
-enable-edit-actions 0
-#
-#
-#  4.6. enforce-blocks
-#  ====================
-#
-#  Specifies:
-#
-#      Whether the user is allowed to ignore blocks and can "go there
-#      anyway".
-#
-#  Type of value:
-#
-#      0 or 1
-#
-#  Default value:
-#
-#      0
-#
-#  Effect if unset:
-#
-#      Blocks are not enforced.
-#
-#  Notes:
-#
-#      Privoxy is mainly used to block and filter requests as a service
-#      to the user, for example to block ads and other junk that clogs
-#      the pipes.  Privoxy's configuration isn't perfect and sometimes
-#      innocent pages are blocked. In this situation it makes sense to
-#      allow the user to enforce the request and have Privoxy ignore
-#      the block.
-#
-#      In the default configuration Privoxy's "Blocked" page contains
-#      a "go there anyway" link to adds a special string (the force
-#      prefix) to the request URL. If that link is used, Privoxy
-#      will detect the force prefix, remove it again and let the
-#      request pass.
-#
-#      Of course Privoxy can also be used to enforce a network
-#      policy. In that case the user obviously should not be able to
-#      bypass any blocks, and that's what the "enforce-blocks" option
-#      is for. If it's enabled, Privoxy hides the "go there anyway"
-#      link. If the user adds the force prefix by hand, it will not
-#      be accepted and the circumvention attempt is logged.
-#
-#  Examples:
-#
-#      enforce-blocks 1
-#
-enforce-blocks 0
-#
-#
-#  4.7. ACLs: permit-access and deny-access
-#  =========================================
-#
-#  Specifies:
-#
-#      Who can access what.
-#
-#  Type of value:
-#
-#      src_addr[/src_masklen] [dst_addr[/dst_masklen]]
-#
-#      Where src_addr and dst_addr are IP addresses in dotted decimal
-#      notation or valid DNS names, and src_masklen and dst_masklen are
-#      subnet masks in CIDR notation, i.e. integer values from 2 to 30
-#      representing the length (in bits) of the network address. The
-#      masks and the whole destination part are optional.
-#
-#  Default value:
-#
-#      Unset
-#
-#  Effect if unset:
-#
-#      Don't restrict access further than implied by listen-address
-#
-#  Notes:
-#
-#      Access controls are included at the request of ISPs and systems
-#      administrators, and are not usually needed by individual
-#      users. For a typical home user, it will normally suffice to
-#      ensure that Privoxy only listens on the localhost (127.0.0.1)
-#      or internal (home) network address by means of the listen-address
-#      option.
-#
-#      Please see the warnings in the FAQ that Privoxy is not intended
-#      to be a substitute for a firewall or to encourage anyone to
-#      defer addressing basic security weaknesses.
-#
-#      Multiple ACL lines are OK. If any ACLs are specified, Privoxy
-#      only talks to IP addresses that match at least one permit-access
-#      line and don't match any subsequent deny-access line. In other
-#      words, the last match wins, with the default being deny-access.
-#
-#      If Privoxy is using a forwarder (see forward below) for a
-#      particular destination URL, the dst_addr that is examined is
-#      the address of the forwarder and NOT the address of the ultimate
-#      target. This is necessary because it may be impossible for the
-#      local Privoxy to determine the IP address of the ultimate target
-#      (that's often what gateways are used for).
-#
-#      You should prefer using IP addresses over DNS names, because
-#      the address lookups take time. All DNS names must resolve! You
-#      can not use domain patterns like "*.org" or partial domain
-#      names. If a DNS name resolves to multiple IP addresses, only
-#      the first one is used.
-#
-#      Denying access to particular sites by ACL may have undesired
-#      side effects if the site in question is hosted on a machine
-#      which also hosts other sites (most sites are).
-#
-#  Examples:
-#
-#      Explicitly define the default behavior if no ACL and
-#      listen-address are set: "localhost" is OK. The absence of a
-#      dst_addr implies that all destination addresses are OK:
-#
-#        permit-access  localhost
-#
-#
-#      Allow any host on the same class C subnet as www.privoxy.org
-#      access to nothing but www.example.com (or other domains hosted
-#      on the same system):
-#
-#        permit-access  www.privoxy.org/24 www.example.com/32
-#
-#
-#      Allow access from any host on the 26-bit subnet 192.168.45.64 to
-#      anywhere, with the exception that 192.168.45.73 may not access
-#      the IP address behind www.dirty-stuff.example.com:
-#
-#        permit-access  192.168.45.64/26 
-#        deny-access   192.168.45.73  www.dirty-stuff.example.com
-#
-#
-#
-#  4.8. buffer-limit
-#  ==================
-#
-#  Specifies:
-#
-#      Maximum size of the buffer for content filtering.
-#
-#  Type of value:
-#
-#      Size in Kbytes
-#
-#  Default value:
-#
-#      4096
-#
-#  Effect if unset:
-#
-#      Use a 4MB (4096 KB) limit.
-#
-#  Notes:
-#
-#      For content filtering, i.e. the +filter and +deanimate-gif
-#      actions, it is necessary that Privoxy buffers the entire document
-#      body. This can be potentially dangerous, since a server could
-#      just keep sending data indefinitely and wait for your RAM to
-#      exhaust -- with nasty consequences.  Hence this option.
-#
-#      When a document buffer size reaches the buffer-limit, it is
-#      flushed to the client unfiltered and no further attempt to filter
-#      the rest of the document is made. Remember that there may be
-#      multiple threads running, which might require up to buffer-limit
-#      Kbytes each, unless you have enabled "single-threaded" above.
-#
-buffer-limit 4096
-#
-#
-#  5. FORWARDING
-#  ==============
-#
-#  This feature allows routing of HTTP requests through a chain of
-#  multiple proxies.
-#
-#  Forwarding can be used to chain Privoxy with a caching proxy to
-#  speed up browsing. Using a parent proxy may also be necessary if
-#  the machine that Privoxy runs on has no direct Internet access.
-#
-#  Note that parent proxies can severely decrease your privacy
-#  level. For example a parent proxy could add your IP address to the
-#  request headers and if it's a caching proxy it may add the "Etag"
-#  header to revalidation requests again, even though you configured
-#  Privoxy to remove it. It may also ignore Privoxy's header time
-#  randomization and use the original values which could be used by
-#  the server as cookie replacement to track your steps between visits.
-#
-#  Also specified here are SOCKS proxies. Privoxy supports the SOCKS
-#  4 and SOCKS 4A protocols.
-#
-#
-#
-#  5.1. forward
-#  =============
-#
-#  Specifies:
-#
-#      To which parent HTTP proxy specific requests should be routed.
-#
-#  Type of value:
-#
-#      target_pattern http_parent[:port]
-#
-#      where target_pattern is a URL pattern that specifies to which
-#      requests (i.e. URLs) this forward rule shall apply. Use /
-#      to denote "all URLs".  http_parent[:port] is the DNS name or
-#      IP address of the parent HTTP proxy through which the requests
-#      should be forwarded, optionally followed by its listening port
-#      (default: 8080). Use a single dot (.) to denote "no forwarding".
-#
-#  Default value:
-#
-#      Unset
-#
-#  Effect if unset:
-#
-#      Don't use parent HTTP proxies.
-#
-#  Notes:
-#
-#      If http_parent is ".", then requests are not forwarded to
-#      another HTTP proxy but are made directly to the web servers.
-#
-#      Multiple lines are OK, they are checked in sequence, and the
-#      last match wins.
-#
-#  Examples:
-#
-#      Everything goes to an example parent proxy, except SSL on port
-#      443 (which it doesn't handle):
-#
-#        forward   /      parent-proxy.example.org:8080 
-#        forward   :443   .
-#
-#
-#      Everything goes to our example ISP's caching proxy, except for
-#      requests to that ISP's sites:
-#
-#        forward   /                  caching-proxy.isp.example.net:8000
-#        forward   .isp.example.net   .
-#
-#
-#
-#
-#  5.2. forward-socks4, forward-socks4a and forward-socks5
-#  ========================================================
-#
-#  Specifies:
-#
-#      Through which SOCKS proxy (and optionally to which parent HTTP
-#      proxy) specific requests should be routed.
-#
-#  Type of value:
-#
-#      target_pattern socks_proxy[:port] http_parent[:port]
-#
-#      where target_pattern is a URL pattern that specifies to which
-#      requests (i.e. URLs) this forward rule shall apply. Use / to
-#      denote "all URLs".  http_parent and socks_proxy are IP addresses
-#      in dotted decimal notation or valid DNS names (http_parent may
-#      be "." to denote "no HTTP forwarding"), and the optional port
-#      parameters are TCP ports, i.e. integer values from 1 to 65535
-#
-#  Default value:
-#
-#      Unset
-#
-#  Effect if unset:
-#
-#      Don't use SOCKS proxies.
-#
-#  Notes:
-#
-#      Multiple lines are OK, they are checked in sequence, and the
-#      last match wins.
-#
-#      The difference between forward-socks4 and forward-socks4a
-#      is that in the SOCKS 4A protocol, the DNS resolution of the
-#      target hostname happens on the SOCKS server, while in SOCKS 4
-#      it happens locally.
-#
-#      With forward-socks5 the DNS resolution will happen on the remote
-#      server as well.
-#
-#      If http_parent is ".", then requests are not forwarded to another
-#      HTTP proxy but are made (HTTP-wise) directly to the web servers,
-#      albeit through a SOCKS proxy.
-#
-#  Examples:
-#
-#      From the company example.com, direct connections are made to all
-#      "internal" domains, but everything outbound goes through their
-#      ISP's proxy by way of example.com's corporate SOCKS 4A gateway
-#      to the Internet.
-#
-#        forward-socks4a   /       socks-gw.example.com:1080    www-cache.isp.example.net:8080 
-#        forward           .example.com        .
-#
-#
-#      A rule that uses a SOCKS 4 gateway for all destinations but no
-#      HTTP parent looks like this:
-#
-#        forward-socks4   /               socks-gw.example.com:1080  .
-#
-#
-#      To chain Privoxy and Tor, both running on the same system,
-#      you would use something like:
-#
-#        forward-socks4a   /               127.0.0.1:9050 .
-#
-#
-#      The public Tor network can't be used to reach your local network,
-#      if you need to access local servers you therefore might want
-#      to make some exceptions:
-#
-#        forward         192.168.*.*/     .  
-#        forward         10.*.*.*/        .  
-#        forward         127.*.*.*/       .
-#
-#
-#      Unencrypted connections to systems in these address ranges will
-#      be as (un) secure as the local network is, but the alternative
-#      is that you can't reach the local network through Privoxy at
-#      all. Of course this may actually be desired and there is no
-#      reason to make these exceptions if you aren't sure you need them.
-#
-#      If you also want to be able to reach servers in your local
-#      network by using their names, you will need additional exceptions
-#      that look like this:
-#
-#       forward           localhost/     .
-#
-#
-#
-#
-#  5.3. forwarded-connect-retries
-#  ===============================
-#
-#  Specifies:
-#
-#      How often Privoxy retries if a forwarded connection request
-#      fails.
-#
-#  Type of value:
-#
-#      Number of retries.
-#
-#  Default value:
-#
-#      0
-#
-#  Effect if unset:
-#
-#      Connections forwarded through other proxies are treated like
-#      direct connections and no retry attempts are made.
-#
-#  Notes:
-#
-#      forwarded-connect-retries is mainly interesting for socks4a
-#      connections, where Privoxy can't detect why the connections
-#      failed. The connection might have failed because of a DNS timeout
-#      in which case a retry makes sense, but it might also have failed
-#      because the server doesn't exist or isn't reachable. In this
-#      case the retry will just delay the appearance of Privoxy's
-#      error message.
-#
-#      Note that in the context of this option, "forwarded connections"
-#      includes all connections that Privoxy forwards through other
-#      proxies. This option is not limited to the HTTP CONNECT method.
-#
-#      Only use this option, if you are getting lots of
-#      forwarding-related error messages that go away when you try again
-#      manually. Start with a small value and check Privoxy's logfile
-#      from time to time, to see how many retries are usually needed.
-#
-#  Examples:
-#
-#      forwarded-connect-retries 1
-#
-forwarded-connect-retries  0
-#
-#
-#  5.4. accept-intercepted-requests
-#  =================================
-#
-#  Specifies:
-#
-#      Whether intercepted requests should be treated as valid.
-#
-#  Type of value:
-#
-#      0 or 1
-#
-#  Default value:
-#
-#      0
-#
-#  Effect if unset:
-#
-#      Only proxy requests are accepted, intercepted requests are
-#      treated as invalid.
-#
-#  Notes:
-#
-#      If you don't trust your clients and want to force them to use
-#      Privoxy, enable this option and configure your packet filter
-#      to redirect outgoing HTTP connections into Privoxy.
-#
-#      Make sure that Privoxy's own requests aren't redirected as well.
-#      Additionally take care that Privoxy can't intentionally connect
-#      to itself, otherwise you could run into redirection loops if
-#      Privoxy's listening port is reachable by the outside or an
-#      attacker has access to the pages you visit.
-#
-#  Examples:
-#
-#      accept-intercepted-requests 1
-#
-accept-intercepted-requests 0
-#
-#
-#  5.5. allow-cgi-request-crunching
-#  =================================
-#
-#  Specifies:
-#
-#      Whether requests to Privoxy's CGI pages can be blocked or
-#      redirected.
-#
-#  Type of value:
-#
-#      0 or 1
-#
-#  Default value:
-#
-#      0
-#
-#  Effect if unset:
-#
-#      Privoxy ignores block and redirect actions for its CGI pages.
-#
-#  Notes:
-#
-#      By default Privoxy ignores block or redirect actions for
-#      its CGI pages.  Intercepting these requests can be useful in
-#      multi-user setups to implement fine-grained access control,
-#      but it can also render the complete web interface useless and
-#      make debugging problems painful if done without care.
-#
-#      Don't enable this option unless you're sure that you really
-#      need it.
-#
-#  Examples:
-#
-#      allow-cgi-request-crunching 1
-#
-allow-cgi-request-crunching 0
-#
-#
-#  5.6. split-large-forms
-#  =======================
-#
-#  Specifies:
-#
-#      Whether the CGI interface should stay compatible with broken
-#      HTTP clients.
-#
-#  Type of value:
-#
-#      0 or 1
-#
-#  Default value:
-#
-#      0
-#
-#  Effect if unset:
-#
-#      The CGI form generate long GET URLs.
-#
-#  Notes:
-#
-#      Privoxy's CGI forms can lead to rather long URLs. This isn't
-#      a problem as far as the HTTP standard is concerned, but it can
-#      confuse clients with arbitrary URL length limitations.
-#
-#      Enabling split-large-forms causes Privoxy to divide big forms
-#      into smaller ones to keep the URL length down. It makes editing
-#      a lot less convenient and you can no longer submit all changes
-#      at once, but at least it works around this browser bug.
-#
-#      If you don't notice any editing problems, there is no reason
-#      to enable this option, but if one of the submit buttons appears
-#      to be broken, you should give it a try.
-#
-#  Examples:
-#
-#      split-large-forms 1
-#
-split-large-forms 0
-#
-#
-#  5.7. keep-alive-timeout
-#  ========================
-#
-#  Specifies:
-#
-#      Number of seconds after which an open connection will no longer
-#      be reused.
-#
-#  Type of value:
-#
-#      Time in seconds.
-#
-#  Default value:
-#
-#      None
-#
-#  Effect if unset:
-#
-#      Connections are not reused.
-#
-#  Notes:
-#
-#      This option has no effect if Privoxy has been compiled without
-#      keep-alive support.
-#
-#  Notes:
-#
-#      Note that reusing connections doesn't necessary cause
-#      speedups. There are also a few privacy implications you should
-#      be aware of.
-#
-#      Outgoing connections are shared between clients (if there are
-#      more than one) and closing the client that initiated the outgoing
-#      connection does not affect the connection between Privoxy and
-#      the server unless the client's request hasn't been completed
-#      yet. If the outgoing connection is idle, it will not be closed
-#      until either Privoxy's or the server's timeout is reached. While
-#      it's open, the server knows that the system running Privoxy is
-#      still there.
-#
-#  Examples:
-#
-#      keep-alive-timeout 300
-#
-keep-alive-timeout 300
-#
-#
-#  5.8. socket-timeout
-#  ====================
-#
-#  Specifies:
-#
-#      Number of seconds after which a socket times out if no data
-#      is received.
-#
-#  Type of value:
-#
-#      Time in seconds.
-#
-#  Default value:
-#
-#      None
-#
-#  Effect if unset:
-#
-#      A default value of 300 seconds is used.
-#
-#  Notes:
-#
-#      For SOCKS requests the timeout currently doesn't start until
-#      the SOCKS server accepted the request. This will be fixed in
-#      the next release.
-#
-#  Examples:
-#
-#      socket-timeout 300
-#
-socket-timeout 300
-#
-#
-#  6. WINDOWS GUI OPTIONS
-#  =======================
-#
-#  Privoxy has a number of options specific to the Windows GUI
-#  interface:
-#
-#
-#  If "activity-animation" is set to 1, the Privoxy icon will animate
-#  when "Privoxy" is active. To turn off, set to 0.
-#
-#activity-animation   1
-#
-#  If "log-messages" is set to 1, Privoxy will log messages to the
-#  console window:
-#
-#log-messages   1
-#
-#  If "log-buffer-size" is set to 1, the size of the log buffer,
-#  i.e. the amount of memory used for the log messages displayed in
-#  the console window, will be limited to "log-max-lines" (see below).
-#
-#  Warning: Setting this to 0 will result in the buffer to grow
-#  infinitely and eat up all your memory!
-#
-#log-buffer-size 1
-#
-#  log-max-lines is the maximum number of lines held in the log
-#  buffer. See above.
-#
-#log-max-lines 200
-#
-#  If "log-highlight-messages" is set to 1, Privoxy will highlight
-#  portions of the log messages with a bold-faced font:
-#
-#log-highlight-messages 1
-#
-#  The font used in the console window:
-#
-#log-font-name Comic Sans MS
-#
-#  Font size used in the console window:
-#
-#log-font-size 8
-#
-#  "show-on-task-bar" controls whether or not Privoxy will appear as
-#  a button on the Task bar when minimized:
-#
-#show-on-task-bar 0
-#
-#  If "close-button-minimizes" is set to 1, the Windows close button
-#  will minimize Privoxy instead of closing the program (close with
-#  the exit option on the File menu).
-#
-#close-button-minimizes 1
-#
-#  The "hide-console" option is specific to the MS-Win console version
-#  of Privoxy.  If this option is used, Privoxy will disconnect from
-#  and hide the command console.
-#
-#hide-console
-#
-#
diff --git a/external/privoxy/config.sub b/external/privoxy/config.sub
deleted file mode 100644
index c894da4..0000000
--- a/external/privoxy/config.sub
+++ /dev/null
@@ -1,1773 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012 Free Software Foundation, Inc.
-
-timestamp='2012-02-10'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine.  It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Please send patches to <config-patches at gnu.org>.  Submit a context
-# diff and a properly formatted GNU ChangeLog entry.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support.  The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
-       $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
-  -h, --help         print this help, then exit
-  -t, --time-stamp   print date of last modification, then exit
-  -v, --version      print version number, then exit
-
-Report bugs and patches to <config-patches at gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
-  case $1 in
-    --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
-    --version | -v )
-       echo "$version" ; exit ;;
-    --help | --h* | -h )
-       echo "$usage"; exit ;;
-    -- )     # Stop option processing
-       shift; break ;;
-    - )	# Use stdin as input.
-       break ;;
-    -* )
-       echo "$me: invalid option $1$help"
-       exit 1 ;;
-
-    *local*)
-       # First pass through any local machine types.
-       echo $1
-       exit ;;
-
-    * )
-       break ;;
-  esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
-    exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
-    exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
-  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | \
-  kopensolaris*-gnu* | \
-  storm-chaos* | os2-emx* | rtmk-nova*)
-    os=-$maybe_os
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-    ;;
-  android-linux)
-    os=-linux-android
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
-    ;;
-  *)
-    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
-    if [ $basic_machine != $1 ]
-    then os=`echo $1 | sed 's/.*-/-/'`
-    else os=; fi
-    ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work.  We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
-	-sun*os*)
-		# Prevent following clause from handling this invalid input.
-		;;
-	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis | -knuth | -cray | -microblaze)
-		os=
-		basic_machine=$1
-		;;
-	-bluegene*)
-		os=-cnk
-		;;
-	-sim | -cisco | -oki | -wec | -winbond)
-		os=
-		basic_machine=$1
-		;;
-	-scout)
-		;;
-	-wrs)
-		os=-vxworks
-		basic_machine=$1
-		;;
-	-chorusos*)
-		os=-chorusos
-		basic_machine=$1
-		;;
-	-chorusrdb)
-		os=-chorusrdb
-		basic_machine=$1
-		;;
-	-hiux*)
-		os=-hiuxwe2
-		;;
-	-sco6)
-		os=-sco5v6
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco5)
-		os=-sco3.2v5
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco4)
-		os=-sco3.2v4
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco3.2.[4-9]*)
-		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco3.2v[4-9]*)
-		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco5v6*)
-		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco*)
-		os=-sco3.2v2
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-udk*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-isc)
-		os=-isc2.2
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-clix*)
-		basic_machine=clipper-intergraph
-		;;
-	-isc*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-lynx*)
-		os=-lynxos
-		;;
-	-ptx*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
-		;;
-	-windowsnt*)
-		os=`echo $os | sed -e 's/windowsnt/winnt/'`
-		;;
-	-psos*)
-		os=-psos
-		;;
-	-mint | -mint[0-9]*)
-		basic_machine=m68k-atari
-		os=-mint
-		;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
-	# Recognize the basic CPU types without company name.
-	# Some are omitted here because they have special meanings below.
-	1750a | 580 \
-	| a29k \
-	| aarch64 | aarch64_be \
-	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
-	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
-	| am33_2.0 \
-	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
-        | be32 | be64 \
-	| bfin \
-	| c4x | clipper \
-	| d10v | d30v | dlx | dsp16xx \
-	| epiphany \
-	| fido | fr30 | frv \
-	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
-	| hexagon \
-	| i370 | i860 | i960 | ia64 \
-	| ip2k | iq2000 \
-	| le32 | le64 \
-	| lm32 \
-	| m32c | m32r | m32rle | m68000 | m68k | m88k \
-	| maxq | mb | microblaze | mcore | mep | metag \
-	| mips | mipsbe | mipseb | mipsel | mipsle \
-	| mips16 \
-	| mips64 | mips64el \
-	| mips64octeon | mips64octeonel \
-	| mips64orion | mips64orionel \
-	| mips64r5900 | mips64r5900el \
-	| mips64vr | mips64vrel \
-	| mips64vr4100 | mips64vr4100el \
-	| mips64vr4300 | mips64vr4300el \
-	| mips64vr5000 | mips64vr5000el \
-	| mips64vr5900 | mips64vr5900el \
-	| mipsisa32 | mipsisa32el \
-	| mipsisa32r2 | mipsisa32r2el \
-	| mipsisa64 | mipsisa64el \
-	| mipsisa64r2 | mipsisa64r2el \
-	| mipsisa64sb1 | mipsisa64sb1el \
-	| mipsisa64sr71k | mipsisa64sr71kel \
-	| mipstx39 | mipstx39el \
-	| mn10200 | mn10300 \
-	| moxie \
-	| mt \
-	| msp430 \
-	| nds32 | nds32le | nds32be \
-	| nios | nios2 \
-	| ns16k | ns32k \
-	| open8 \
-	| or32 \
-	| pdp10 | pdp11 | pj | pjl \
-	| powerpc | powerpc64 | powerpc64le | powerpcle \
-	| pyramid \
-	| rl78 | rx \
-	| score \
-	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
-	| sh64 | sh64le \
-	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
-	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-	| spu \
-	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
-	| ubicom32 \
-	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
-	| we32k \
-	| x86 | xc16x | xstormy16 | xtensa \
-	| z8k | z80)
-		basic_machine=$basic_machine-unknown
-		;;
-	c54x)
-		basic_machine=tic54x-unknown
-		;;
-	c55x)
-		basic_machine=tic55x-unknown
-		;;
-	c6x)
-		basic_machine=tic6x-unknown
-		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
-		basic_machine=$basic_machine-unknown
-		os=-none
-		;;
-	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
-		;;
-	ms1)
-		basic_machine=mt-unknown
-		;;
-
-	strongarm | thumb | xscale)
-		basic_machine=arm-unknown
-		;;
-	xgate)
-		basic_machine=$basic_machine-unknown
-		os=-none
-		;;
-	xscaleeb)
-		basic_machine=armeb-unknown
-		;;
-
-	xscaleel)
-		basic_machine=armel-unknown
-		;;
-
-	# We use `pc' rather than `unknown'
-	# because (1) that's what they normally are, and
-	# (2) the word "unknown" tends to confuse beginning users.
-	i*86 | x86_64)
-	  basic_machine=$basic_machine-pc
-	  ;;
-	# Object if more than one company name word.
-	*-*-*)
-		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-		exit 1
-		;;
-	# Recognize the basic CPU types with company name.
-	580-* \
-	| a29k-* \
-	| aarch64-* | aarch64_be-* \
-	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
-	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
-	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-	| avr-* | avr32-* \
-	| be32-* | be64-* \
-	| bfin-* | bs2000-* \
-	| c[123]* | c30-* | [cjt]90-* | c4x-* \
-	| clipper-* | craynv-* | cydra-* \
-	| d10v-* | d30v-* | dlx-* \
-	| elxsi-* \
-	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
-	| h8300-* | h8500-* \
-	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
-	| hexagon-* \
-	| i*86-* | i860-* | i960-* | ia64-* \
-	| ip2k-* | iq2000-* \
-	| le32-* | le64-* \
-	| lm32-* \
-	| m32c-* | m32r-* | m32rle-* \
-	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
-	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
-	| mips16-* \
-	| mips64-* | mips64el-* \
-	| mips64octeon-* | mips64octeonel-* \
-	| mips64orion-* | mips64orionel-* \
-	| mips64r5900-* | mips64r5900el-* \
-	| mips64vr-* | mips64vrel-* \
-	| mips64vr4100-* | mips64vr4100el-* \
-	| mips64vr4300-* | mips64vr4300el-* \
-	| mips64vr5000-* | mips64vr5000el-* \
-	| mips64vr5900-* | mips64vr5900el-* \
-	| mipsisa32-* | mipsisa32el-* \
-	| mipsisa32r2-* | mipsisa32r2el-* \
-	| mipsisa64-* | mipsisa64el-* \
-	| mipsisa64r2-* | mipsisa64r2el-* \
-	| mipsisa64sb1-* | mipsisa64sb1el-* \
-	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
-	| mipstx39-* | mipstx39el-* \
-	| mmix-* \
-	| mt-* \
-	| msp430-* \
-	| nds32-* | nds32le-* | nds32be-* \
-	| nios-* | nios2-* \
-	| none-* | np1-* | ns16k-* | ns32k-* \
-	| open8-* \
-	| orion-* \
-	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
-	| pyramid-* \
-	| rl78-* | romp-* | rs6000-* | rx-* \
-	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
-	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
-	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
-	| tahoe-* \
-	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-	| tile*-* \
-	| tron-* \
-	| ubicom32-* \
-	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
-	| vax-* \
-	| we32k-* \
-	| x86-* | x86_64-* | xc16x-* | xps100-* \
-	| xstormy16-* | xtensa*-* \
-	| ymp-* \
-	| z8k-* | z80-*)
-		;;
-	# Recognize the basic CPU types without company name, with glob match.
-	xtensa*)
-		basic_machine=$basic_machine-unknown
-		;;
-	# Recognize the various machine names and aliases which stand
-	# for a CPU type and a company and sometimes even an OS.
-	386bsd)
-		basic_machine=i386-unknown
-		os=-bsd
-		;;
-	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
-		basic_machine=m68000-att
-		;;
-	3b*)
-		basic_machine=we32k-att
-		;;
-	a29khif)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	abacus)
-		basic_machine=abacus-unknown
-		;;
-	adobe68k)
-		basic_machine=m68010-adobe
-		os=-scout
-		;;
-	alliant | fx80)
-		basic_machine=fx80-alliant
-		;;
-	altos | altos3068)
-		basic_machine=m68k-altos
-		;;
-	am29k)
-		basic_machine=a29k-none
-		os=-bsd
-		;;
-	amd64)
-		basic_machine=x86_64-pc
-		;;
-	amd64-*)
-		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	amdahl)
-		basic_machine=580-amdahl
-		os=-sysv
-		;;
-	amiga | amiga-*)
-		basic_machine=m68k-unknown
-		;;
-	amigaos | amigados)
-		basic_machine=m68k-unknown
-		os=-amigaos
-		;;
-	amigaunix | amix)
-		basic_machine=m68k-unknown
-		os=-sysv4
-		;;
-	apollo68)
-		basic_machine=m68k-apollo
-		os=-sysv
-		;;
-	apollo68bsd)
-		basic_machine=m68k-apollo
-		os=-bsd
-		;;
-	aros)
-		basic_machine=i386-pc
-		os=-aros
-		;;
-	aux)
-		basic_machine=m68k-apple
-		os=-aux
-		;;
-	balance)
-		basic_machine=ns32k-sequent
-		os=-dynix
-		;;
-	blackfin)
-		basic_machine=bfin-unknown
-		os=-linux
-		;;
-	blackfin-*)
-		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	bluegene*)
-		basic_machine=powerpc-ibm
-		os=-cnk
-		;;
-	c54x-*)
-		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c55x-*)
-		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c6x-*)
-		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c90)
-		basic_machine=c90-cray
-		os=-unicos
-		;;
-	cegcc)
-		basic_machine=arm-unknown
-		os=-cegcc
-		;;
-	convex-c1)
-		basic_machine=c1-convex
-		os=-bsd
-		;;
-	convex-c2)
-		basic_machine=c2-convex
-		os=-bsd
-		;;
-	convex-c32)
-		basic_machine=c32-convex
-		os=-bsd
-		;;
-	convex-c34)
-		basic_machine=c34-convex
-		os=-bsd
-		;;
-	convex-c38)
-		basic_machine=c38-convex
-		os=-bsd
-		;;
-	cray | j90)
-		basic_machine=j90-cray
-		os=-unicos
-		;;
-	craynv)
-		basic_machine=craynv-cray
-		os=-unicosmp
-		;;
-	cr16 | cr16-*)
-		basic_machine=cr16-unknown
-		os=-elf
-		;;
-	crds | unos)
-		basic_machine=m68k-crds
-		;;
-	crisv32 | crisv32-* | etraxfs*)
-		basic_machine=crisv32-axis
-		;;
-	cris | cris-* | etrax*)
-		basic_machine=cris-axis
-		;;
-	crx)
-		basic_machine=crx-unknown
-		os=-elf
-		;;
-	da30 | da30-*)
-		basic_machine=m68k-da30
-		;;
-	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
-		basic_machine=mips-dec
-		;;
-	decsystem10* | dec10*)
-		basic_machine=pdp10-dec
-		os=-tops10
-		;;
-	decsystem20* | dec20*)
-		basic_machine=pdp10-dec
-		os=-tops20
-		;;
-	delta | 3300 | motorola-3300 | motorola-delta \
-	      | 3300-motorola | delta-motorola)
-		basic_machine=m68k-motorola
-		;;
-	delta88)
-		basic_machine=m88k-motorola
-		os=-sysv3
-		;;
-	dicos)
-		basic_machine=i686-pc
-		os=-dicos
-		;;
-	djgpp)
-		basic_machine=i586-pc
-		os=-msdosdjgpp
-		;;
-	dpx20 | dpx20-*)
-		basic_machine=rs6000-bull
-		os=-bosx
-		;;
-	dpx2* | dpx2*-bull)
-		basic_machine=m68k-bull
-		os=-sysv3
-		;;
-	ebmon29k)
-		basic_machine=a29k-amd
-		os=-ebmon
-		;;
-	elxsi)
-		basic_machine=elxsi-elxsi
-		os=-bsd
-		;;
-	encore | umax | mmax)
-		basic_machine=ns32k-encore
-		;;
-	es1800 | OSE68k | ose68k | ose | OSE)
-		basic_machine=m68k-ericsson
-		os=-ose
-		;;
-	fx2800)
-		basic_machine=i860-alliant
-		;;
-	genix)
-		basic_machine=ns32k-ns
-		;;
-	gmicro)
-		basic_machine=tron-gmicro
-		os=-sysv
-		;;
-	go32)
-		basic_machine=i386-pc
-		os=-go32
-		;;
-	h3050r* | hiux*)
-		basic_machine=hppa1.1-hitachi
-		os=-hiuxwe2
-		;;
-	h8300hms)
-		basic_machine=h8300-hitachi
-		os=-hms
-		;;
-	h8300xray)
-		basic_machine=h8300-hitachi
-		os=-xray
-		;;
-	h8500hms)
-		basic_machine=h8500-hitachi
-		os=-hms
-		;;
-	harris)
-		basic_machine=m88k-harris
-		os=-sysv3
-		;;
-	hp300-*)
-		basic_machine=m68k-hp
-		;;
-	hp300bsd)
-		basic_machine=m68k-hp
-		os=-bsd
-		;;
-	hp300hpux)
-		basic_machine=m68k-hp
-		os=-hpux
-		;;
-	hp3k9[0-9][0-9] | hp9[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hp9k2[0-9][0-9] | hp9k31[0-9])
-		basic_machine=m68000-hp
-		;;
-	hp9k3[2-9][0-9])
-		basic_machine=m68k-hp
-		;;
-	hp9k6[0-9][0-9] | hp6[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hp9k7[0-79][0-9] | hp7[0-79][0-9])
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k78[0-9] | hp78[0-9])
-		# FIXME: really hppa2.0-hp
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
-		# FIXME: really hppa2.0-hp
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k8[0-9][13679] | hp8[0-9][13679])
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k8[0-9][0-9] | hp8[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hppa-next)
-		os=-nextstep3
-		;;
-	hppaosf)
-		basic_machine=hppa1.1-hp
-		os=-osf
-		;;
-	hppro)
-		basic_machine=hppa1.1-hp
-		os=-proelf
-		;;
-	i370-ibm* | ibm*)
-		basic_machine=i370-ibm
-		;;
-	i*86v32)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv32
-		;;
-	i*86v4*)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv4
-		;;
-	i*86v)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv
-		;;
-	i*86sol2)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-solaris2
-		;;
-	i386mach)
-		basic_machine=i386-mach
-		os=-mach
-		;;
-	i386-vsta | vsta)
-		basic_machine=i386-unknown
-		os=-vsta
-		;;
-	iris | iris4d)
-		basic_machine=mips-sgi
-		case $os in
-		    -irix*)
-			;;
-		    *)
-			os=-irix4
-			;;
-		esac
-		;;
-	isi68 | isi)
-		basic_machine=m68k-isi
-		os=-sysv
-		;;
-	m68knommu)
-		basic_machine=m68k-unknown
-		os=-linux
-		;;
-	m68knommu-*)
-		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	m88k-omron*)
-		basic_machine=m88k-omron
-		;;
-	magnum | m3230)
-		basic_machine=mips-mips
-		os=-sysv
-		;;
-	merlin)
-		basic_machine=ns32k-utek
-		os=-sysv
-		;;
-	microblaze)
-		basic_machine=microblaze-xilinx
-		;;
-	mingw32)
-		basic_machine=i386-pc
-		os=-mingw32
-		;;
-	mingw32ce)
-		basic_machine=arm-unknown
-		os=-mingw32ce
-		;;
-	miniframe)
-		basic_machine=m68000-convergent
-		;;
-	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
-		basic_machine=m68k-atari
-		os=-mint
-		;;
-	mips3*-*)
-		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
-		;;
-	mips3*)
-		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
-		;;
-	monitor)
-		basic_machine=m68k-rom68k
-		os=-coff
-		;;
-	morphos)
-		basic_machine=powerpc-unknown
-		os=-morphos
-		;;
-	msdos)
-		basic_machine=i386-pc
-		os=-msdos
-		;;
-	ms1-*)
-		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
-		;;
-	msys)
-		basic_machine=i386-pc
-		os=-msys
-		;;
-	mvs)
-		basic_machine=i370-ibm
-		os=-mvs
-		;;
-	nacl)
-		basic_machine=le32-unknown
-		os=-nacl
-		;;
-	ncr3000)
-		basic_machine=i486-ncr
-		os=-sysv4
-		;;
-	netbsd386)
-		basic_machine=i386-unknown
-		os=-netbsd
-		;;
-	netwinder)
-		basic_machine=armv4l-rebel
-		os=-linux
-		;;
-	news | news700 | news800 | news900)
-		basic_machine=m68k-sony
-		os=-newsos
-		;;
-	news1000)
-		basic_machine=m68030-sony
-		os=-newsos
-		;;
-	news-3600 | risc-news)
-		basic_machine=mips-sony
-		os=-newsos
-		;;
-	necv70)
-		basic_machine=v70-nec
-		os=-sysv
-		;;
-	next | m*-next )
-		basic_machine=m68k-next
-		case $os in
-		    -nextstep* )
-			;;
-		    -ns2*)
-		      os=-nextstep2
-			;;
-		    *)
-		      os=-nextstep3
-			;;
-		esac
-		;;
-	nh3000)
-		basic_machine=m68k-harris
-		os=-cxux
-		;;
-	nh[45]000)
-		basic_machine=m88k-harris
-		os=-cxux
-		;;
-	nindy960)
-		basic_machine=i960-intel
-		os=-nindy
-		;;
-	mon960)
-		basic_machine=i960-intel
-		os=-mon960
-		;;
-	nonstopux)
-		basic_machine=mips-compaq
-		os=-nonstopux
-		;;
-	np1)
-		basic_machine=np1-gould
-		;;
-	neo-tandem)
-		basic_machine=neo-tandem
-		;;
-	nse-tandem)
-		basic_machine=nse-tandem
-		;;
-	nsr-tandem)
-		basic_machine=nsr-tandem
-		;;
-	op50n-* | op60c-*)
-		basic_machine=hppa1.1-oki
-		os=-proelf
-		;;
-	openrisc | openrisc-*)
-		basic_machine=or32-unknown
-		;;
-	os400)
-		basic_machine=powerpc-ibm
-		os=-os400
-		;;
-	OSE68000 | ose68000)
-		basic_machine=m68000-ericsson
-		os=-ose
-		;;
-	os68k)
-		basic_machine=m68k-none
-		os=-os68k
-		;;
-	pa-hitachi)
-		basic_machine=hppa1.1-hitachi
-		os=-hiuxwe2
-		;;
-	paragon)
-		basic_machine=i860-intel
-		os=-osf
-		;;
-	parisc)
-		basic_machine=hppa-unknown
-		os=-linux
-		;;
-	parisc-*)
-		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	pbd)
-		basic_machine=sparc-tti
-		;;
-	pbb)
-		basic_machine=m68k-tti
-		;;
-	pc532 | pc532-*)
-		basic_machine=ns32k-pc532
-		;;
-	pc98)
-		basic_machine=i386-pc
-		;;
-	pc98-*)
-		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentium | p5 | k5 | k6 | nexgen | viac3)
-		basic_machine=i586-pc
-		;;
-	pentiumpro | p6 | 6x86 | athlon | athlon_*)
-		basic_machine=i686-pc
-		;;
-	pentiumii | pentium2 | pentiumiii | pentium3)
-		basic_machine=i686-pc
-		;;
-	pentium4)
-		basic_machine=i786-pc
-		;;
-	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
-		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentiumpro-* | p6-* | 6x86-* | athlon-*)
-		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
-		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentium4-*)
-		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pn)
-		basic_machine=pn-gould
-		;;
-	power)	basic_machine=power-ibm
-		;;
-	ppc | ppcbe)	basic_machine=powerpc-unknown
-		;;
-	ppc-* | ppcbe-*)
-		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ppcle | powerpclittle | ppc-le | powerpc-little)
-		basic_machine=powerpcle-unknown
-		;;
-	ppcle-* | powerpclittle-*)
-		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ppc64)	basic_machine=powerpc64-unknown
-		;;
-	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
-		basic_machine=powerpc64le-unknown
-		;;
-	ppc64le-* | powerpc64little-*)
-		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ps2)
-		basic_machine=i386-ibm
-		;;
-	pw32)
-		basic_machine=i586-unknown
-		os=-pw32
-		;;
-	rdos)
-		basic_machine=i386-pc
-		os=-rdos
-		;;
-	rom68k)
-		basic_machine=m68k-rom68k
-		os=-coff
-		;;
-	rm[46]00)
-		basic_machine=mips-siemens
-		;;
-	rtpc | rtpc-*)
-		basic_machine=romp-ibm
-		;;
-	s390 | s390-*)
-		basic_machine=s390-ibm
-		;;
-	s390x | s390x-*)
-		basic_machine=s390x-ibm
-		;;
-	sa29200)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	sb1)
-		basic_machine=mipsisa64sb1-unknown
-		;;
-	sb1el)
-		basic_machine=mipsisa64sb1el-unknown
-		;;
-	sde)
-		basic_machine=mipsisa32-sde
-		os=-elf
-		;;
-	sei)
-		basic_machine=mips-sei
-		os=-seiux
-		;;
-	sequent)
-		basic_machine=i386-sequent
-		;;
-	sh)
-		basic_machine=sh-hitachi
-		os=-hms
-		;;
-	sh5el)
-		basic_machine=sh5le-unknown
-		;;
-	sh64)
-		basic_machine=sh64-unknown
-		;;
-	sparclite-wrs | simso-wrs)
-		basic_machine=sparclite-wrs
-		os=-vxworks
-		;;
-	sps7)
-		basic_machine=m68k-bull
-		os=-sysv2
-		;;
-	spur)
-		basic_machine=spur-unknown
-		;;
-	st2000)
-		basic_machine=m68k-tandem
-		;;
-	stratus)
-		basic_machine=i860-stratus
-		os=-sysv4
-		;;
-	strongarm-* | thumb-*)
-		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	sun2)
-		basic_machine=m68000-sun
-		;;
-	sun2os3)
-		basic_machine=m68000-sun
-		os=-sunos3
-		;;
-	sun2os4)
-		basic_machine=m68000-sun
-		os=-sunos4
-		;;
-	sun3os3)
-		basic_machine=m68k-sun
-		os=-sunos3
-		;;
-	sun3os4)
-		basic_machine=m68k-sun
-		os=-sunos4
-		;;
-	sun4os3)
-		basic_machine=sparc-sun
-		os=-sunos3
-		;;
-	sun4os4)
-		basic_machine=sparc-sun
-		os=-sunos4
-		;;
-	sun4sol2)
-		basic_machine=sparc-sun
-		os=-solaris2
-		;;
-	sun3 | sun3-*)
-		basic_machine=m68k-sun
-		;;
-	sun4)
-		basic_machine=sparc-sun
-		;;
-	sun386 | sun386i | roadrunner)
-		basic_machine=i386-sun
-		;;
-	sv1)
-		basic_machine=sv1-cray
-		os=-unicos
-		;;
-	symmetry)
-		basic_machine=i386-sequent
-		os=-dynix
-		;;
-	t3e)
-		basic_machine=alphaev5-cray
-		os=-unicos
-		;;
-	t90)
-		basic_machine=t90-cray
-		os=-unicos
-		;;
-	tile*)
-		basic_machine=$basic_machine-unknown
-		os=-linux-gnu
-		;;
-	tx39)
-		basic_machine=mipstx39-unknown
-		;;
-	tx39el)
-		basic_machine=mipstx39el-unknown
-		;;
-	toad1)
-		basic_machine=pdp10-xkl
-		os=-tops20
-		;;
-	tower | tower-32)
-		basic_machine=m68k-ncr
-		;;
-	tpf)
-		basic_machine=s390x-ibm
-		os=-tpf
-		;;
-	udi29k)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	ultra3)
-		basic_machine=a29k-nyu
-		os=-sym1
-		;;
-	v810 | necv810)
-		basic_machine=v810-nec
-		os=-none
-		;;
-	vaxv)
-		basic_machine=vax-dec
-		os=-sysv
-		;;
-	vms)
-		basic_machine=vax-dec
-		os=-vms
-		;;
-	vpp*|vx|vx-*)
-		basic_machine=f301-fujitsu
-		;;
-	vxworks960)
-		basic_machine=i960-wrs
-		os=-vxworks
-		;;
-	vxworks68)
-		basic_machine=m68k-wrs
-		os=-vxworks
-		;;
-	vxworks29k)
-		basic_machine=a29k-wrs
-		os=-vxworks
-		;;
-	w65*)
-		basic_machine=w65-wdc
-		os=-none
-		;;
-	w89k-*)
-		basic_machine=hppa1.1-winbond
-		os=-proelf
-		;;
-	xbox)
-		basic_machine=i686-pc
-		os=-mingw32
-		;;
-	xps | xps100)
-		basic_machine=xps100-honeywell
-		;;
-	xscale-* | xscalee[bl]-*)
-		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
-		;;
-	ymp)
-		basic_machine=ymp-cray
-		os=-unicos
-		;;
-	z8k-*-coff)
-		basic_machine=z8k-unknown
-		os=-sim
-		;;
-	z80-*-coff)
-		basic_machine=z80-unknown
-		os=-sim
-		;;
-	none)
-		basic_machine=none-none
-		os=-none
-		;;
-
-# Here we handle the default manufacturer of certain CPU types.  It is in
-# some cases the only manufacturer, in others, it is the most popular.
-	w89k)
-		basic_machine=hppa1.1-winbond
-		;;
-	op50n)
-		basic_machine=hppa1.1-oki
-		;;
-	op60c)
-		basic_machine=hppa1.1-oki
-		;;
-	romp)
-		basic_machine=romp-ibm
-		;;
-	mmix)
-		basic_machine=mmix-knuth
-		;;
-	rs6000)
-		basic_machine=rs6000-ibm
-		;;
-	vax)
-		basic_machine=vax-dec
-		;;
-	pdp10)
-		# there are many clones, so DEC is not a safe bet
-		basic_machine=pdp10-unknown
-		;;
-	pdp11)
-		basic_machine=pdp11-dec
-		;;
-	we32k)
-		basic_machine=we32k-att
-		;;
-	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
-		basic_machine=sh-unknown
-		;;
-	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
-		basic_machine=sparc-sun
-		;;
-	cydra)
-		basic_machine=cydra-cydrome
-		;;
-	orion)
-		basic_machine=orion-highlevel
-		;;
-	orion105)
-		basic_machine=clipper-highlevel
-		;;
-	mac | mpw | mac-mpw)
-		basic_machine=m68k-apple
-		;;
-	pmac | pmac-mpw)
-		basic_machine=powerpc-apple
-		;;
-	*-unknown)
-		# Make sure to match an already-canonicalized machine name.
-		;;
-	*)
-		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-		exit 1
-		;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
-	*-digital*)
-		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
-		;;
-	*-commodore*)
-		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
-		;;
-	*)
-		;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
-	# First match some system type aliases
-	# that might get confused with valid system types.
-	# -solaris* is a basic system type, with this one exception.
-	-auroraux)
-		os=-auroraux
-		;;
-	-solaris1 | -solaris1.*)
-		os=`echo $os | sed -e 's|solaris1|sunos4|'`
-		;;
-	-solaris)
-		os=-solaris2
-		;;
-	-svr4*)
-		os=-sysv4
-		;;
-	-unixware*)
-		os=-sysv4.2uw
-		;;
-	-gnu/linux*)
-		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
-		;;
-	# First accept the basic system types.
-	# The portable systems comes first.
-	# Each alternative MUST END IN A *, to match a version number.
-	# -sysv* is not here because it comes later, after sysvr4.
-	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
-	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-	      | -sym* | -kopensolaris* \
-	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-	      | -aos* | -aros* \
-	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
-	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-	      | -openbsd* | -solidbsd* \
-	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
-	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
-	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
-	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-	      | -chorusos* | -chorusrdb* | -cegcc* \
-	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-android* \
-	      | -linux-newlib* | -linux-uclibc* \
-	      | -uxpv* | -beos* | -mpeix* | -udk* \
-	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
-	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
-	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
-	# Remember, each alternative MUST END IN *, to match a version number.
-		;;
-	-qnx*)
-		case $basic_machine in
-		    x86-* | i*86-*)
-			;;
-		    *)
-			os=-nto$os
-			;;
-		esac
-		;;
-	-nto-qnx*)
-		;;
-	-nto*)
-		os=`echo $os | sed -e 's|nto|nto-qnx|'`
-		;;
-	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
-	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
-		;;
-	-mac*)
-		os=`echo $os | sed -e 's|mac|macos|'`
-		;;
-	-linux-dietlibc)
-		os=-linux-dietlibc
-		;;
-	-linux*)
-		os=`echo $os | sed -e 's|linux|linux-gnu|'`
-		;;
-	-sunos5*)
-		os=`echo $os | sed -e 's|sunos5|solaris2|'`
-		;;
-	-sunos6*)
-		os=`echo $os | sed -e 's|sunos6|solaris3|'`
-		;;
-	-opened*)
-		os=-openedition
-		;;
-	-os400*)
-		os=-os400
-		;;
-	-wince*)
-		os=-wince
-		;;
-	-osfrose*)
-		os=-osfrose
-		;;
-	-osf*)
-		os=-osf
-		;;
-	-utek*)
-		os=-bsd
-		;;
-	-dynix*)
-		os=-bsd
-		;;
-	-acis*)
-		os=-aos
-		;;
-	-atheos*)
-		os=-atheos
-		;;
-	-syllable*)
-		os=-syllable
-		;;
-	-386bsd)
-		os=-bsd
-		;;
-	-ctix* | -uts*)
-		os=-sysv
-		;;
-	-nova*)
-		os=-rtmk-nova
-		;;
-	-ns2 )
-		os=-nextstep2
-		;;
-	-nsk*)
-		os=-nsk
-		;;
-	# Preserve the version number of sinix5.
-	-sinix5.*)
-		os=`echo $os | sed -e 's|sinix|sysv|'`
-		;;
-	-sinix*)
-		os=-sysv4
-		;;
-	-tpf*)
-		os=-tpf
-		;;
-	-triton*)
-		os=-sysv3
-		;;
-	-oss*)
-		os=-sysv3
-		;;
-	-svr4)
-		os=-sysv4
-		;;
-	-svr3)
-		os=-sysv3
-		;;
-	-sysvr4)
-		os=-sysv4
-		;;
-	# This must come after -sysvr4.
-	-sysv*)
-		;;
-	-ose*)
-		os=-ose
-		;;
-	-es1800*)
-		os=-ose
-		;;
-	-xenix)
-		os=-xenix
-		;;
-	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-		os=-mint
-		;;
-	-aros*)
-		os=-aros
-		;;
-	-kaos*)
-		os=-kaos
-		;;
-	-zvmoe)
-		os=-zvmoe
-		;;
-	-dicos*)
-		os=-dicos
-		;;
-	-nacl*)
-		;;
-	-none)
-		;;
-	*)
-		# Get rid of the `-' at the beginning of $os.
-		os=`echo $os | sed 's/[^-]*-//'`
-		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
-		exit 1
-		;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system.  Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
-	score-*)
-		os=-elf
-		;;
-	spu-*)
-		os=-elf
-		;;
-	*-acorn)
-		os=-riscix1.2
-		;;
-	arm*-rebel)
-		os=-linux
-		;;
-	arm*-semi)
-		os=-aout
-		;;
-	c4x-* | tic4x-*)
-		os=-coff
-		;;
-	tic54x-*)
-		os=-coff
-		;;
-	tic55x-*)
-		os=-coff
-		;;
-	tic6x-*)
-		os=-coff
-		;;
-	# This must come before the *-dec entry.
-	pdp10-*)
-		os=-tops20
-		;;
-	pdp11-*)
-		os=-none
-		;;
-	*-dec | vax-*)
-		os=-ultrix4.2
-		;;
-	m68*-apollo)
-		os=-domain
-		;;
-	i386-sun)
-		os=-sunos4.0.2
-		;;
-	m68000-sun)
-		os=-sunos3
-		;;
-	m68*-cisco)
-		os=-aout
-		;;
-	mep-*)
-		os=-elf
-		;;
-	mips*-cisco)
-		os=-elf
-		;;
-	mips*-*)
-		os=-elf
-		;;
-	or32-*)
-		os=-coff
-		;;
-	*-tti)	# must be before sparc entry or we get the wrong os.
-		os=-sysv3
-		;;
-	sparc-* | *-sun)
-		os=-sunos4.1.1
-		;;
-	*-be)
-		os=-beos
-		;;
-	*-haiku)
-		os=-haiku
-		;;
-	*-ibm)
-		os=-aix
-		;;
-	*-knuth)
-		os=-mmixware
-		;;
-	*-wec)
-		os=-proelf
-		;;
-	*-winbond)
-		os=-proelf
-		;;
-	*-oki)
-		os=-proelf
-		;;
-	*-hp)
-		os=-hpux
-		;;
-	*-hitachi)
-		os=-hiux
-		;;
-	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
-		os=-sysv
-		;;
-	*-cbm)
-		os=-amigaos
-		;;
-	*-dg)
-		os=-dgux
-		;;
-	*-dolphin)
-		os=-sysv3
-		;;
-	m68k-ccur)
-		os=-rtu
-		;;
-	m88k-omron*)
-		os=-luna
-		;;
-	*-next )
-		os=-nextstep
-		;;
-	*-sequent)
-		os=-ptx
-		;;
-	*-crds)
-		os=-unos
-		;;
-	*-ns)
-		os=-genix
-		;;
-	i370-*)
-		os=-mvs
-		;;
-	*-next)
-		os=-nextstep3
-		;;
-	*-gould)
-		os=-sysv
-		;;
-	*-highlevel)
-		os=-bsd
-		;;
-	*-encore)
-		os=-bsd
-		;;
-	*-sgi)
-		os=-irix
-		;;
-	*-siemens)
-		os=-sysv4
-		;;
-	*-masscomp)
-		os=-rtu
-		;;
-	f30[01]-fujitsu | f700-fujitsu)
-		os=-uxpv
-		;;
-	*-rom68k)
-		os=-coff
-		;;
-	*-*bug)
-		os=-coff
-		;;
-	*-apple)
-		os=-macos
-		;;
-	*-atari*)
-		os=-mint
-		;;
-	*)
-		os=-none
-		;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer.  We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
-	*-unknown)
-		case $os in
-			-riscix*)
-				vendor=acorn
-				;;
-			-sunos*)
-				vendor=sun
-				;;
-			-cnk*|-aix*)
-				vendor=ibm
-				;;
-			-beos*)
-				vendor=be
-				;;
-			-hpux*)
-				vendor=hp
-				;;
-			-mpeix*)
-				vendor=hp
-				;;
-			-hiux*)
-				vendor=hitachi
-				;;
-			-unos*)
-				vendor=crds
-				;;
-			-dgux*)
-				vendor=dg
-				;;
-			-luna*)
-				vendor=omron
-				;;
-			-genix*)
-				vendor=ns
-				;;
-			-mvs* | -opened*)
-				vendor=ibm
-				;;
-			-os400*)
-				vendor=ibm
-				;;
-			-ptx*)
-				vendor=sequent
-				;;
-			-tpf*)
-				vendor=ibm
-				;;
-			-vxsim* | -vxworks* | -windiss*)
-				vendor=wrs
-				;;
-			-aux*)
-				vendor=apple
-				;;
-			-hms*)
-				vendor=hitachi
-				;;
-			-mpw* | -macos*)
-				vendor=apple
-				;;
-			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-				vendor=atari
-				;;
-			-vos*)
-				vendor=stratus
-				;;
-		esac
-		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
-		;;
-esac
-
-echo $basic_machine$os
-exit
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/external/privoxy/configure.in b/external/privoxy/configure.in
deleted file mode 100644
index 2945a7a..0000000
--- a/external/privoxy/configure.in
+++ /dev/null
@@ -1,1463 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-dnl 
-dnl $Id: configure.in,v 1.126 2009/03/21 10:45:06 fabiankeil Exp $
-dnl 
-dnl Written by and Copyright (C) 2001-2009 the
-dnl Privoxy team. http://www.privoxy.org/
-dnl
-dnl Based on the Internet Junkbuster originally written
-dnl by and Copyright (C) 1997 Anonymous Coders and 
-dnl Junkbusters Corporation.  http://www.junkbusters.com
-dnl
-dnl This program is free software; you can redistribute it 
-dnl and/or modify it under the terms of the GNU General
-dnl Public License as published by the Free Software
-dnl Foundation; either version 2 of the License, or (at
-dnl your option) any later version.
-dnl 
-dnl This program is distributed in the hope that it will
-dnl be useful, but WITHOUT ANY WARRANTY; without even the
-dnl implied warranty of MERCHANTABILITY or FITNESS FOR A
-dnl PARTICULAR PURPOSE.  See the GNU General Public
-dnl License for more details.
-dnl 
-dnl The GNU General Public License should be included with
-dnl this file.  If not, you can view it at
-dnl http://www.gnu.org/copyleft/gpl.html
-dnl or write to the Free Software Foundation, Inc., 59
-dnl Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-dnl 
-dnl $Log: configure.in,v $
-dnl Revision 1.126  2009/03/21 10:45:06  fabiankeil
-dnl Declare the code stable.
-dnl
-dnl Revision 1.125  2009/02/25 16:58:03  fabiankeil
-dnl And the journey continues. Bump version to 3.0.12 UNRELEASED.
-dnl
-dnl Revision 1.124  2009/02/12 15:42:00  fabiankeil
-dnl Declare the code stable.
-dnl
-dnl Revision 1.123  2009/02/06 18:17:32  fabiankeil
-dnl Boldly enable keep-alive support where possible.
-dnl
-dnl Revision 1.122  2008/10/18 11:17:52  fabiankeil
-dnl Connection keep-alive support is ready for testing,
-dnl allow enabling it through the configure script.
-dnl
-dnl Revision 1.121  2008/08/30 12:03:07  fabiankeil
-dnl Remove FEATURE_COOKIE_JAR.
-dnl
-dnl Revision 1.120  2008/08/21 17:19:50  fabiankeil
-dnl Change version to 3.0.11 UNRELEASED.
-dnl
-dnl Revision 1.119  2008/08/13 16:53:50  fabiankeil
-dnl Change version to 3.0.10 stable.
-dnl
-dnl Revision 1.118  2008/06/27 12:50:44  fabiankeil
-dnl Here's looking at you, Gentoo Linux: Show a warning if
-dnl --disable-pthread is used even though pthreads are available.
-dnl
-dnl Revision 1.117  2008/06/14 12:47:30  fabiankeil
-dnl Set CODE_STATUS to beta.
-dnl
-dnl Revision 1.116  2008/06/08 11:55:09  fabiankeil
-dnl - Show a warning if the soon-to-be-removed static PCRE code is used.
-dnl - Hide the "using built-in static pcrs" message. With dynamic linking
-dnl   against PCRS disabled, the message isn't particularly useful.
-dnl
-dnl Revision 1.115  2008/05/25 15:50:14  fabiankeil
-dnl Try to use zlib by default, but just show a warning if it's
-dnl unavailable. Remove --enable-zlib, add  --disable-zlib.
-dnl
-dnl Revision 1.114  2008/04/06 15:18:33  fabiankeil
-dnl Oh well, rename the --enable-pcre-host-patterns option to
-dnl --enable-extended-host-patterns as it's not really PCRE syntax.
-dnl
-dnl Revision 1.113  2008/04/06 14:54:26  fabiankeil
-dnl Use PCRE syntax in host patterns when configured
-dnl with --enable-pcre-host-patterns.
-dnl
-dnl Revision 1.112  2008/03/27 18:27:22  fabiankeil
-dnl Remove kill-popups action.
-dnl
-dnl Revision 1.111  2008/02/03 14:40:47  fabiankeil
-dnl Remove unused OSX_DARWIN macro. Reported by Mark Miller in #1852529.
-dnl
-dnl Revision 1.110  2008/01/26 10:52:13  fabiankeil
-dnl Change version to 3.0.9 UNRELEASED.
-dnl
-dnl Revision 1.109  2008/01/20 14:07:09  fabiankeil
-dnl Set CODE_STATUS to stable.
-dnl
-dnl Revision 1.108  2007/12/10 02:30:00  hal9
-dnl Change versioning for > 3.0.7 && < 3.0.8
-dnl
-dnl Revision 1.107  2007/11/15 02:50:14  hal9
-dnl Setting to "beta" (for doc builds, etc).
-dnl
-dnl Revision 1.106  2007/05/11 11:49:41  fabiankeil
-dnl Check for strlcat().
-dnl
-dnl Revision 1.105  2007/04/09 17:34:58  fabiankeil
-dnl Check for snprintf().
-dnl
-dnl Revision 1.104  2007/03/31 13:35:11  fabiankeil
-dnl Add checks for gettimeofday() and strlcpy().
-dnl
-dnl Revision 1.103  2007/01/20 16:29:38  fabiankeil
-dnl Suppress edit buttons for action files if Privoxy has
-dnl no write access. Suggested by Roland in PR 1564026.
-dnl
-dnl Revision 1.102  2007/01/18 14:55:45  fabiankeil
-dnl Check for tzset() and putenv() to make sure the
-dnl replacement timegm() isn't included on systems
-dnl where it fails to compile.
-dnl
-dnl Revision 1.101  2007/01/12 15:20:17  fabiankeil
-dnl Temporarily ignore external libpcrs to prevent
-dnl problems that are fixed in Privoxy's own version.
-dnl
-dnl Revision 1.100  2007/01/07 07:38:10  joergs
-dnl Disabled -pipe for AmigaOS4.
-dnl
-dnl Revision 1.99  2007/01/01 19:36:37  fabiankeil
-dnl Integrate a modified version of Wil Mahan's
-dnl zlib patch (PR #895531).
-dnl
-dnl Revision 1.98  2006/12/17 19:15:26  fabiankeil
-dnl Added ./configure switch for FEATURE_GRACEFUL_TERMINATION.
-dnl
-dnl Revision 1.97  2006/11/21 18:32:46  hal9
-dnl Setting version to 3.0.7 UNRELEASED for lack of a better setting.
-dnl
-dnl Revision 1.96  2006/11/18 14:42:51  fabiankeil
-dnl Mark as stable.
-dnl
-dnl Revision 1.95  2006/11/14 02:08:59  hal9
-dnl Setting version string to 3.0.6 UNRELEASED. This needs to be reset to 3.0.6
-dnl stable just before CVS is tagged for release.
-dnl
-dnl Revision 1.94  2006/11/13 19:05:50  fabiankeil
-dnl Make pthread mutex locking more generic. Instead of
-dnl checking for OSX and OpenBSD, check for FEATURE_PTHREAD
-dnl and use mutex locking unless there is an _r function
-dnl available. Better safe than sorry.
-dnl
-dnl Fixes "./configure --disable-pthread" and should result
-dnl in less threading-related problems on pthread-using platforms,
-dnl but it still doesn't fix BR#1122404.
-dnl
-dnl Revision 1.93  2006/09/22 01:26:20  hal9
-dnl Set version to 3.0.5 BETA for hopefully release this weekend.
-dnl
-dnl Revision 1.92  2006/08/17 17:09:49  fabiankeil
-dnl Added check for timegm().
-dnl
-dnl Revision 1.91  2006/08/13 22:01:51  fabiankeil
-dnl Added checks for strptime() and random()
-dnl
-dnl Revision 1.90  2006/07/18 14:48:45  david__schmidt
-dnl Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
-dnl with what was really the latest development (the v_3_0_branch branch)
-dnl
-dnl Revision 1.68.2.20  2004/01/31 16:31:46  oes
-dnl Resetting version info to 0.0.0 UNRELEASED
-dnl
-dnl Revision 1.68.2.19  2004/01/30 09:26:03  oes
-dnl Added docbook paths for debian sarge; set status for release
-dnl
-dnl Revision 1.68.2.18  2003/12/08 15:10:29  oes
-dnl Bugfix: --with-docbook now correctly accepts its path parameter. Thanks, Roland!
-dnl
-dnl Revision 1.68.2.17  2003/10/18 18:41:26  david__schmidt
-dnl Update to remain buildable on OS/2 - remove the failures
-dnl due to missing unixisms
-dnl
-dnl Revision 1.68.2.16  2003/03/26 16:05:14  oes
-dnl Marked as 0.0.0 UNRELEASED
-dnl
-dnl Revision 1.68.2.15  2003/03/26 00:25:00  oes
-dnl Bump version for 3.0.2
-dnl
-dnl Revision 1.68.2.14  2003/03/25 13:27:12  hal9
-dnl Manually apply Docbook/FreeBSD patch #708081 from a.go at tiscali.nl.
-dnl
-dnl Revision 1.68.2.13  2003/03/18 19:38:57  oes
-dnl Set version info for 3.0.1 release
-dnl
-dnl Revision 1.68.2.12  2003/03/07 03:41:04  david__schmidt
-dnl Wrapping all *_r functions (the non-_r versions of them) with mutex semaphores for OSX.  Hopefully this will take care of all of those pesky crash reports.
-dnl
-dnl Revision 1.68.2.11  2003/03/06 15:22:37  oes
-dnl Fixed minor shell syntax bug
-dnl
-dnl Revision 1.68.2.10  2003/01/08 16:39:41  oes
-dnl Changing default to exclude FEATURE_IMAGE_DETECT_MSIE because of problem reports with recent IEs
-dnl
-dnl Revision 1.68.2.9  2002/12/13 23:47:45  hal9
-dnl Add openbsd $specialflags per gunner at styx2002.no-ip.org
-dnl
-dnl Revision 1.68.2.8  2002/11/27 12:55:26  oes
-dnl Fixed broken handling of pre-set CFLAGS
-dnl
-dnl Revision 1.68.2.7  2002/10/25 02:44:22  hal9
-dnl Port of make install, etc from main trunk. Needs testing! Add Slackware
-dnl support, and other related changes. Update related docs.
-dnl
-dnl Revision 1.68.2.6  2002/09/25 15:35:15  oes
-dnl Marking as non-release
-dnl
-dnl Revision 1.68.2.5  2002/08/25 23:37:00  hal9
-dnl Getting ready for 3.0 release.
-dnl
-dnl Revision 1.68.2.4  2002/08/10 11:21:57  oes
-dnl - Set Version to 2.9.20 (beta)
-dnl - Add two AC_DEFINEs that indicate if the pcre*.h headers
-dnl   are located in a pcre/ subdir to the include path.
-dnl
-dnl Revision 1.68.2.3  2002/08/06 11:29:36  oes
-dnl Fixed detection/inclusion of pcre.h, which is in a pcre subdir on RH
-dnl
-dnl Revision 1.68.2.2  2002/07/30 19:36:09  hal9
-dnl Bump version to 2.9.17.
-dnl
-dnl Revision 1.68.2.1  2002/07/26 15:21:12  oes
-dnl  Bumped version number for 2.9.16 freeze
-dnl
-dnl Revision 1.68  2002/05/25 16:54:54  jongfoster
-dnl Detect if the compiler supports -pthread.
-dnl Hopefully this will fix bug 560442.  (I don't have a HP PA-RISC
-dnl machine to test this!)
-dnl
-dnl Revision 1.67  2002/05/03 14:33:59  oes
-dnl Generate doc/soucre/ldp.dsl
-dnl
-dnl Revision 1.66  2002/05/03 00:41:56  oes
-dnl Set version to 2.9.15 to comply with new versioning scheme
-dnl
-dnl Revision 1.65  2002/04/25 19:13:57  morcego
-dnl Removed RPM release number declaration on configure.in
-dnl Changed makefile to use given value for RPM_PACKAGEV when on uploading
-dnl targets (will produce an error, explaining who to do it, if no value
-dnl if provided).
-dnl
-dnl Revision 1.64  2002/04/22 16:32:31  morcego
-dnl configure.in, *.spec: Bumping release to 2 (2.9.14-2)
-dnl -rh.spec: uid and gid are now macros
-dnl -suse.spec: Changing the header Copyright to License (Copyright is
-dnl             deprecable)
-dnl
-dnl Revision 1.63  2002/04/11 11:00:21  oes
-dnl Applied Moritz' fix for socklen_t on Solaris
-dnl
-dnl Revision 1.62  2002/04/11 10:09:20  oes
-dnl Version 2.9.14
-dnl
-dnl Revision 1.61  2002/04/10 18:14:45  morcego
-dnl - (privoxy-rh.spec only) Relisting template files on the %%files section
-dnl - (configure.in, privoxy-rh.spec) Bumped package release to 5
-dnl
-dnl Revision 1.60  2002/04/09 16:38:49  oes
-dnl Added detection of missing config.h.in
-dnl
-dnl Revision 1.59  2002/04/06 20:23:55  jongfoster
-dnl Removing unnessacery tests (C++, ranlib)
-dnl
-dnl Revision 1.58  2002/04/04 20:49:20  swa
-dnl attempt to consolidate the
-dnl different dokbook versions.
-dnl
-dnl Revision 1.57  2002/04/04 00:36:36  gliptak
-dnl always use pcre for matching
-dnl
-dnl Revision 1.56  2002/04/03 22:28:03  gliptak
-dnl Removed references to gnu_regex
-dnl
-dnl Revision 1.55  2002/04/03 03:54:38  gliptak
-dnl Checking pcre version
-dnl
-dnl Revision 1.54  2002/04/01 00:54:24  gliptak
-dnl More changes needed around regex support.
-dnl
-dnl Revision 1.53  2002/03/29 20:09:01  swa
-dnl al's patch
-dnl
-dnl Revision 1.52  2002/03/29 19:51:40  gliptak
-dnl Correcting compile problem with Debian
-dnl
-dnl Revision 1.51  2002/03/28 20:43:00  swa
-dnl set make correctly
-dnl
-dnl Revision 1.50  2002/03/27 03:03:45  hal9
-dnl Add test for man2html
-dnl
-dnl Revision 1.49  2002/03/27 02:19:52  david__schmidt
-dnl More Mac OSX support:
-dnl - Get rid of extraneous, noisy -pthread warnings
-dnl - Define unix so we get oes' unix-tagged changes
-dnl
-dnl Revision 1.48  2002/03/26 22:29:54  swa
-dnl we have a new homepage!
-dnl
-dnl Revision 1.47  2002/03/26 16:41:00  hal9
-dnl Upped RPM Release to 3 (need to build new RH packages)
-dnl
-dnl Revision 1.46  2002/03/24 18:55:06  jongfoster
-dnl Making Docbook work under Windows
-dnl
-dnl Revision 1.45  2002/03/24 14:19:55  swa
-dnl set rpm package release in configure.in. nowhere else.
-dnl
-dnl Revision 1.44  2002/03/24 13:25:43  swa
-dnl name change related issues
-dnl
-dnl Revision 1.43  2002/03/24 12:56:21  swa
-dnl name change related issues.
-dnl
-dnl Revision 1.42  2002/03/22 18:11:37  jongfoster
-dnl Bumping version number to 2.9.12
-dnl
-dnl Revision 1.41  2002/03/19 19:30:04  morcego
-dnl - Fixing stylesheet checking on configure. If it is found, no further checks
-dnl   should be done
-dnl
-dnl - configure will now check for db2html or docbook2html (should work now
-dnl   on SuSe without the docbktls package)
-dnl
-dnl Revision 1.40  2002/03/09 14:33:30  oes
-dnl Fixing the (harmless) AC_CHECK_FILE warnings
-dnl
-dnl Revision 1.39  2002/03/08 16:46:13  oes
-dnl Added --enable-no-gifs
-dnl
-dnl Revision 1.38  2002/03/08 14:13:50  morcego
-dnl Fixing configure, to remove a command not found error.
-dnl
-dnl Revision 1.37  2002/03/08 12:58:21  oes
-dnl Tiny bugfix in AC_ARG_WITH(debug)
-dnl
-dnl Revision 1.36  2002/03/06 23:50:36  morcego
-dnl Will not test for a text browser if we are not using docbook.
-dnl
-dnl Revision 1.35  2002/03/06 21:55:52  morcego
-dnl New configure option: --with-docbook=(yes|no|directory)
-dnl Preliminary new platform detection code included. Will work with the
-dnl old one for now. No use just trowing it away
-dnl
-dnl Revision 1.34  2002/03/06 20:57:00  morcego
-dnl Fixing detection of stylesheets on SuSe.
-dnl
-dnl Revision 1.33  2002/03/05 17:31:11  morcego
-dnl Search for docbook.dsl. Should solve portability problems for SuSe.
-dnl
-dnl Revision 1.32  2002/03/05 14:07:43  morcego
-dnl configure now detects rpm topdir, and change GNUmakefile acordingly
-dnl    (based on sugestion by Sarantis Paskalis)
-dnl
-dnl Revision 1.31  2002/03/05 13:43:28  morcego
-dnl Checking for text browser, so redhat-dok can work.
-dnl
-dnl Revision 1.30  2002/03/04 17:58:01  oes
-dnl Deleted _DEBUG and PID_FILE_PATH
-dnl
-dnl Revision 1.29  2002/02/28 14:20:53  oes
-dnl Fixed detection of gethost*_r functions on Solaris
-dnl
-dnl Revision 1.28  2002/02/27 15:02:38  oes
-dnl Incremented version number
-dnl
-dnl Revision 1.27  2002/01/10 12:35:18  oes
-dnl Added cross-compile defaults to the AC_CHECK_SIZEOF macros
-dnl to silence autoconf warnings. Numbers are for Intel/Linux.
-dnl Is there a better way?
-dnl
-dnl Revision 1.26  2002/01/09 14:29:49  oes
-dnl - Added AC_CHECK_FUNC tests for the availability of
-dnl   gethostbyname_r, gethostbyaddr_r, gmtime_r and
-dnl   localtime_r, as well as AC_TRY_COMPILE tests to
-dnl   determine their signatures.
-dnl
-dnl - Fixed a bug with the init of CFLAGS that was
-dnl   reported by barsnick
-dnl
-dnl Revision 1.25  2002/01/04 15:27:18  oes
-dnl Changed quoting of CODE_STATUS for use in make
-dnl
-dnl Revision 1.24  2001/12/30 14:07:31  steudten
-dnl - Add signal handling (unix)
-dnl - Add SIGHUP handler (unix)
-dnl - Add creation of pidfile (unix)
-dnl - Add action 'top' in rc file (RH)
-dnl - Add entry 'SIGNALS' to manpage
-dnl - Add exit message to logfile (unix)
-dnl
-dnl Revision 1.23  2001/12/09 20:24:42  david__schmidt
-dnl Change from "alpha" to "beta" in configure.in
-dnl
-dnl Revision 1.22  2001/12/01 11:24:01  jongfoster
-dnl Renaming Makefile.in to GNUmakefile.in so that non-GNU versions of
-dnl make break in a more obvious way.
-dnl
-dnl Revision 1.21  2001/11/30 21:35:54  jongfoster
-dnl Bumping version number to 2.9.10
-dnl
-dnl Revision 1.20  2001/10/23 21:24:09  jongfoster
-dnl Support for FEATURE_CGI_EDIT_ACTIONS
-dnl
-dnl Revision 1.19  2001/10/07 15:33:14  oes
-dnl Removed FEATURE_DENY_GZIP
-dnl Bumped up version number
-dnl
-dnl Revision 1.18  2001/09/13 13:10:24  steudten
-dnl
-dnl PreWork for Debug Interface.
-dnl Add new option "--with-debug" to enable debugging (flags aso.)
-dnl
-dnl Revision 1.17  2001/09/12 23:44:55  david__schmidt
-dnl Mac OSX (Darwin) support added.
-dnl
-dnl Revision 1.16  2001/09/12 22:55:45  joergs
-dnl AmigaOS support added.
-dnl
-dnl Revision 1.15  2001/09/12 17:28:59  david__schmidt
-dnl
-dnl OS/2 port: update autoconf'd support for the platform.
-dnl
-dnl Revision 1.14  2001/07/30 22:12:11  jongfoster
-dnl Fixing Solaris build (I hope) and tidying up #defines:
-dnl - All feature #defines are now of the form FEATURE_xxx
-dnl - Permanently turned off WIN_GUI_EDIT
-dnl - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS
-dnl
-dnl Revision 1.13  2001/07/29 17:09:17  jongfoster
-dnl Major changes to build system in order to fix these bugs:
-dnl - pthreads under Linux was broken - changed -lpthread to -pthread
-dnl - Compiling in MinGW32 mode under CygWin now correctly detects
-dnl   which shared libraries are available
-dnl - Solaris support (?) (Not tested under Solaris yet)
-dnl
-dnl Revision 1.12  2001/07/25 19:16:27  oes
-dnl Bumping version number to 2.9.8
-dnl
-dnl Revision 1.11  2001/07/21 18:00:07  jongfoster
-dnl Bumping version number to 2.9.7
-dnl
-dnl Revision 1.10  2001/07/18 17:25:04  oes
-dnl Fixed a typo
-dnl
-dnl Revision 1.9  2001/07/15 19:45:13  jongfoster
-dnl Added support for linking with POSIX threads library
-dnl
-dnl Revision 1.8  2001/07/15 17:54:29  jongfoster
-dnl Renaming #define STATIC to STATIC_PCRE
-dnl Adding new #define FEATURE_PTHREAD that will be used to enable
-dnl POSIX threads support.
-dnl
-dnl Revision 1.7  2001/07/13 13:58:05  oes
-dnl    Completely reorganized the selection scheme for
-dnl    pcre, pcreposix, pcrs and gnu_regex:
-dnl
-dnl    The presence of shared pcre, pcreposix or pcrs
-dnl    libraried is now autodetected. Additionally, the
-dnl    user can enforce using the built-in static variants
-dnl    by specifying --disable-dynamic-(pcre|pcrs).
-dnl    Care is taken to avoid that pcre is dyn, while pcreposix
-dnl    is static, if both are used and that pcrs is static if
-dnl    pcrs is.
-dnl
-dnl    The choice between pcre, gnu or no regex for actionsfile
-dnl    URL matching is now via
-dnl    --(enable|disable)-regex-matching[=(gnu|pcre|no)] with the
-dnl    default being pcre.
-dnl
-dnl Revision 1.6  2001/06/29 21:56:40  oes
-dnl Version -> 2.9.5
-dnl
-dnl Revision 1.5  2001/06/29 13:26:27  oes
-dnl Introduced #define CODE_STATUS
-dnl
-dnl Revision 1.4  2001/05/29 09:50:24  jongfoster
-dnl Unified blocklist/imagelist/permissionslist.
-dnl File format is still under discussion, but the internal changes
-dnl are (mostly) done.
-dnl
-dnl Also modified interceptor behaviour:
-dnl - We now intercept all URLs beginning with one of the following
-dnl   prefixes (and *only* these prefixes):
-dnl     * http://i.j.b/
-dnl     * http://ijbswa.sf.net/config/
-dnl     * http://ijbswa.sourceforge.net/config/
-dnl - New interceptors "home page" - go to http://i.j.b/ to see it.
-dnl - Internal changes so that intercepted and fast redirect pages
-dnl   are not replaced with an image.
-dnl - Interceptors now have the option to send a binary page direct
-dnl   to the client. (i.e. ijb-send-banner uses this)
-dnl - Implemented show-url-info interceptor.  (Which is why I needed
-dnl   the above interceptors changes - a typical URL is
-dnl   "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif".
-dnl   The previous mechanism would not have intercepted that, and
-dnl   if it had been intercepted then it then it would have replaced
-dnl   it with an image.)
-dnl
-dnl Revision 1.3  2001/05/22 18:46:04  oes
-dnl
-dnl - Enabled filtering banners by size rather than URL
-dnl   by adding patterns that replace all standard banner
-dnl   sizes with the "Junkbuster" gif to the re_filterfile
-dnl
-dnl - Enabled filtering WebBugs by providing a pattern
-dnl   which kills all 1x1 images
-dnl
-dnl - Added support for PCRE_UNGREEDY behaviour to pcrs,
-dnl   which is selected by the (nonstandard and therefore
-dnl   capital) letter 'U' in the option string.
-dnl   It causes the quantifiers to be ungreedy by default.
-dnl   Appending a ? turns back to greedy (!).
-dnl
-dnl - Added a new interceptor ijb-send-banner, which
-dnl   sends back the "Junkbuster" gif. Without imagelist or
-dnl   MSIE detection support, or if tinygif = 1, or the
-dnl   URL isn't recognized as an imageurl, a lame HTML
-dnl   explanation is sent instead.
-dnl
-dnl - Added new feature, which permits blocking remote
-dnl   script redirects and firing back a local redirect
-dnl   to the browser.
-dnl   The feature is conditionally compiled, i.e. it
-dnl   can be disabled with --disable-fast-redirects,
-dnl   plus it must be activated by a "fast-redirects"
-dnl   line in the config file, has its own log level
-dnl   and of course wants to be displayed by show-proxy-args
-dnl   Note: Boy, all the #ifdefs in 1001 locations and
-dnl   all the fumbling with configure.in and acconfig.h
-dnl   were *way* more work than the feature itself :-(
-dnl
-dnl - Because a generic redirect template was needed for
-dnl   this, tinygif = 3 now uses the same.
-dnl
-dnl - Moved GIFs, and other static HTTP response templates
-dnl   to project.h
-dnl
-dnl - Some minor fixes
-dnl
-dnl - Removed some >400 CRs again (Jon, you really worked
-dnl   a lot! ;-)
-dnl
-dnl Revision 1.2  2001/05/20 01:21:20  jongfoster
-dnl Version 2.9.4 checkin.
-dnl - Merged popupfile and cookiefile, and added control over PCRS
-dnl   filtering, in new "permissionsfile".
-dnl - Implemented LOG_LEVEL_FATAL, so that if there is a configuration
-dnl   file error you now get a message box (in the Win32 GUI) rather
-dnl   than the program exiting with no explanation.
-dnl - Made killpopup use the PCRS MIME-type checking and HTTP-header
-dnl   skipping.
-dnl - Removed tabs from "config"
-dnl - Moved duplicated url parsing code in "loaders.c" to a new funcition.
-dnl - Bumped up version number.
-dnl
-dnl Revision 1.1.1.1  2001/05/15 13:58:50  oes
-dnl Initial import of version 2.9.3 source tree
-dnl
-dnl 
-
-
-dnl =================================================================
-dnl AutoConf Initialization
-dnl =================================================================
-
-AC_REVISION($Revision: 1.126 $)
-AC_INIT(jcc.c)
-
-if test ! -f config.h.in; then
-   echo "You need to run autoheader first. "
-   echo -n "Shall I do this for you now? (y/n) "
-   read answer
-   if test "$answer" != "y"; then
-      exit 1
-   else
-      autoheader
-  fi
-fi  
-
-AC_CONFIG_HEADER([config.h])
-AC_CANONICAL_HOST
-
-dodk=auto
-DKPREFIX=none
-AC_ARG_WITH(docbook, dnl
-  --with-docbook=[[yes|no|directory]]	
-                           Enable docbook documentation creation 
-			   (default = yes, for gnu and linux),[dnl
-case "$with_docbook" in
-yes) dodk=yes;;
-no) dodk=no;;
-*) 
-	dodk=yes
-	DKPREFIX=$withval
-	;;
-esac
-])
-DB2HTML=false
-AC_ARG_WITH(db2html, dnl
-  --with-db2html=<path/executable>
-                          Set the location of the docbook to html converter
-                          (default = search),[dnl
-DB2HTML=$withval
-])
-
-dnl =================================================================
-dnl Application version number
-dnl =================================================================
-
-VERSION_MAJOR=3
-VERSION_MINOR=0
-VERSION_POINT=12
-CODE_STATUS="stable"
-
-dnl CODE_STATUS can be "alpha", "beta", or "stable", and will be
-dnl used for CGI output. Set version to 0.0.0 and status to "UNRELEASED"
-dnl whenever CVS in a stable branch differs from the last release.
-
-dnl =================================================================
-dnl Substitute the version numbers
-dnl =================================================================
-
-AC_SUBST(VERSION_MAJOR)
-AC_SUBST(VERSION_MINOR)
-AC_SUBST(VERSION_POINT)
-AC_SUBST(CODE_STATUS)
-
-dnl
-AC_DEFINE_UNQUOTED(VERSION_MAJOR,${VERSION_MAJOR})
-AC_DEFINE_UNQUOTED(VERSION_MINOR,${VERSION_MINOR})
-AC_DEFINE_UNQUOTED(VERSION_POINT,${VERSION_POINT})
-AC_DEFINE_UNQUOTED(VERSION,"${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_POINT}")
-AC_DEFINE_UNQUOTED(CODE_STATUS,"${CODE_STATUS}")
-
-dnl =================================================================
-dnl Checks for programs needed to build.
-dnl =================================================================
-
-dnl Keep AC_PROG_CC from setting its own defaults:
-if test "X$CFLAGS" = "X"; then
-   CFLAGS=" "
-fi
-
-AC_PROG_CC
-AC_PROG_CPP
-AC_PROG_INSTALL
-AC_PROG_LN_S
-AC_PROG_MAKE_SET
-AC_PROG_AWK
-
-AC_CHECK_PROG(GDB,gdb,yes,no)
-AC_PATH_PROG(BGROUPS,groups,no,/bin:/usr/bin:/usr/local/bin)
-AC_PATH_PROG(ID,id,no,/bin:/usr/bin:/usr/local/bin)
-AC_SUBST(ID)
-AC_SUBST(BGROUPS)
-
-dnl =================================================================
-dnl debug, gcc and gdb support 
-dnl =================================================================
-
-AC_ARG_WITH(debug,
-        [  --with-debug            Enable debug mode],
-        [
-                if test "x$withval" != "xno" ; then
-                    if test $ac_cv_prog_cc_g = yes; then
-                      if test "$GCC" = yes; then
-                        if test "$GDB"; then
-                          CFLAGS="$CFLAGS -ggdb"
-                        else
-                          CFLAGS="$CFLAGS -g"
-                        fi
-                        CFLAGS="$CFLAGS -Wshadow  -Wconversion"
-                      else
-                        CFLAGS="$CFLAGS -g"
-                      fi
-                   fi
-                fi
-        ],
-        [
-            if test "X$CFLAGS" = "X "; then # if CFLAGS were unset (see above)
-              if test "$GCC" = yes; then
-                CFLAGS="-O2"
-              fi
-            fi
-        ]
-)
-
-dnl =================================================================
-dnl Check for user and group validity
-dnl =================================================================
-
-
-if test "$EMXOS2" = yes; then
-  echo "Skipping user and group validity stuff.";
-
-else
-
-  $ID privoxy >/dev/null 2>/dev/null
-  if test $? -ne 0 ; then
-   AC_MSG_WARN(There is no user 'privoxy' on this system)
-  fi
-  AC_MSG_CHECKING([for user])
-  AC_ARG_WITH(user,
-        [  --with-user=privoxy          Set user under which privoxy will run],
-        [
-                if test "x$withval" != "xyes"; then
-                  if test $ID = no ; then
-                    AC_MSG_ERROR(There is no 'id' program on this system)
-                  else
-                    AC_MSG_RESULT($with_user)
-                    $ID $with_user 2>/dev/null >/dev/null
-                    if test $? -eq 0 ; then
-                      USER=$with_user;
-                    else
-                      AC_MSG_ERROR(There is no user '$with_user' on this system)
-                    fi
-                  fi
-                  else
-                   AC_MSG_ERROR(We need a user if you give me this parameter)
-                fi
-        ],
-        [
-          if test $ID = no ; then
-            AC_MSG_ERROR(There is no 'id' programm on this system)
-          else
-            AC_MSG_RESULT(none specified)
-            USER=$with_user
-          fi
-        ]
-  )
-  AC_SUBST(USER)
-
-  AC_MSG_CHECKING([for group])
-  AC_ARG_WITH(group,
-        [  --with-group=privoxy         Set group for privoxy],
-        [ 
-                if test "x$withval" != "xyes"; then
-                  if test $BGROUPS = no ; then
-                    AC_MSG_ERROR(There is no 'groups' program on this system)
-                  else
-                    AC_MSG_RESULT($with_group)
-                    $BGROUPS $USER >/dev/null
-                    if test $? -eq 0 ; then
-                    # FIXME: this fails if valid group, but not first group
-                    # listed.
-                      if test "$with_group" != "`$BGROUPS $USER | sed 's/.*: //' 2>/dev/null |$AWK '{print $1}'`" ; then
-                        AC_MSG_ERROR(The given value '$withval' does not match group entry)
-                      else
-                        GROUP=$with_group;
-                      fi
-                    else
-                      AC_MSG_ERROR(There is no group entry for user '$USER')
-                    fi
-                  fi
-                else
-                   AC_MSG_ERROR(We need a group if you give me this parameter)
-                fi
-        ],
-        [
-          if test $BGROUPS = no ; then
-            AC_MSG_ERROR(There is no 'groups' programm on this system)
-          else
-            AC_MSG_RESULT(none specified)
-            GROUP=$with_group;
-          fi
-        ]
-  )
-  AC_SUBST(GROUP)
-
-fi
-
-dnl =================================================================
-dnl additional gcc flags
-dnl =================================================================
-dnl 
-if test "$GCC"; then
-  if test "$host" != "powerpc-unknown-amigaos"; then
-    CFLAGS="-pipe $CFLAGS"
-  fi
-fi
-
-
-dnl =================================================================
-dnl Build type
-dnl =================================================================
-dnl
-dnl Must do this first.
-dnl
-dnl Reason: This sets CFLAGS in order to switch the Cygwin compiler
-dnl into Cygwin or MinGW32 modes.  Depending on the mode selected,
-dnl the compiler will use completely different sets of library
-dnl and include files.
-dnl 
-dnl =================================================================
-
-AC_MINGW32
-AC_CYGWIN
-
-if test "$MINGW32" = "yes"; then
-  target_type=mingw
-else
-  if test "$CYGWIN" = "yes"; then
-    target_type=cygwin
-  else
-    target_type=unix
-  fi
-fi
-
-if test $dodk = auto; then
-	dodk=no
-	if test $target_type = unix; then
-		case "$host_os" in
-		linux* | gnu*)
-			dodk=yes
-		;;
-		esac
-	fi
-fi
-
-dnl Decide what to do based on target_type
-dnl Note: PTHREAD_LIB is always set, even if pthread is disabled.
-dnl This is because we don't know yet whether pthread is enabled.
-
-AC_ARG_ENABLE(mingw32,
-[  --enable-mingw32                Use mingw32 for a Windows GUI],
-[if test $enableval = yes; then
-  target_type=mingw
-fi])
-
-if test $target_type = mingw; then
-  WIN_ONLY=
-  SPECIAL_CFLAGS="-mwindows -mno-cygwin"
-  PTHREAD_LIB=-lpthreadGC
-  echo "Using mingw32 (Win32 GUI)"
-else
-  WIN_ONLY=#
-  if test $target_type = cygwin; then
-    SPECIAL_CFLAGS="-mno-win32"
-    PTHREAD_LIB=
-    echo "Using Cygnus (Win32 command line)"
-  else
-    SPECIAL_CFLAGS=
-dnl    PTHREAD_LIB=-lpthread
-  fi
-fi
-AC_SUBST(WIN_ONLY)
-
-dnl Checking which text html browser we have avaliable
-if test $dodk != no; then
-	AC_CHECK_PROGS(WDUMP,w3m lynx links,false)
-	if test "$WDUMP" = false; then
-		AC_MSG_WARN(You need some kind of text browser to build documentation \(w3m, lynx and links are supported\))
-	fi
-	if test $DB2HTML = false; then
-		dnl We need to clean the variable, otherwise AC_CHECK_PROGS
-		dnl will fail	
-		DB2HTML=""
-		AC_CHECK_PROGS(DB2HTML,db2html docbook2html,false)
-	fi
-fi
-AC_SUBST(WDUMP)
-AC_SUBST(DB2HTML)
-
-dnl If we use rpm, we need to check where %_topdir is
-AC_CHECK_PROGS(RPMBIN,rpm,false)
-if test $RPMBIN != false; then
-		RPM_BASE=`rpm --eval "%{_topdir}"`
-		if test "$RPM_BASE" = ""; then
-			RPM_BASE=/usr/src/redhat
-		fi
-fi
-AC_SUBST(RPM_BASE)
-
-dnl Check for jade, so we can build the documentation
-AC_CHECK_PROGS(JADEBIN,jade openjade,false)
-AC_SUBST(JADEBIN)
-
-dnl Check for man2html for docs.
-AC_CHECK_PROGS(MAN2HTML,man2html,false)
-AC_SUBST(MAN2HTML)
-
-dnl Set doc status flag for conditional content inclusions
-DOC_STATUS=p-not-stable
-if  test $CODE_STATUS = stable; then
-     DOC_STATUS="p-stable"
-fi
-AC_SUBST(DOC_STATUS)
-
-dnl Checking for the docbook.dsl stylesheet file
-dnl It is still not portable (directory slash)
-JADECAT=""
-if test $dodk = yes; then
-  if test $DKPREFIX = none; then
-    for i in /usr/share/sgml/docbook/dsssl-stylesheets \
-             /usr/share/sgml/docbkdsl /usr/share/sgml/docbook-dsssl \
-             /usr/local/share/sgml/docbook/dsssl/modular \
-             /usr/share/sgml/docbook/stylesheet/dsssl/modular/ \
-             ; do
-dnl  echo -n does not fly with /bin/sh.
-dnl      echo -n "checking for $i/html/docbook.dsl..."
-      AC_MSG_CHECKING([for $i])
-      if test -f $i/html/docbook.dsl; then
-        echo "yes"
-        DKPREFIX=$i
-        break
-      else
-        echo "no"
-      fi
-    done
-# where are the catalogs?
-    for i in /usr/share/sgml/CATALOG.docbk30 \
-             /usr/share/sgml/CATALOG.docbk31 \
-             /usr/share/sgml/CATALOG.docbk31 \
-             /usr/local/share/sgml/docbook/3.0/docbook.cat \
-             /usr/local/share/sgml/docbook/3.1/docbook.cat \
-             /usr/share/sgml/docbook/dtd/3.1/docbook.cat \
-             ; do
-dnl     echo -n "checking for $i..."
-      AC_MSG_CHECKING([for $i])
-      if test -f $i; then
-        echo "yes"
-        JADECAT="$JADECAT -c $i"
-      else
-        echo "no"
-      fi
-    done
-  fi
-fi
-AC_SUBST(JADECAT)
-AC_SUBST(DKPREFIX)
-
-dnl Save old CFLAGS so we can restore them later, then add SPECIAL_CFLAGS
-old_CFLAGS_nospecial=$CFLAGS
-CFLAGS="$CFLAGS $SPECIAL_CFLAGS"
-
-# Hack to force AutoConf to use the CFLAGS we just set
-dnl Warning: This may break with a future version of Autoconf
-dnl          Tested with autoconf 2.13
-ac_cpp='$CPP $CPPFLAGS $SPECIAL_CFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-
-
-dnl =================================================================
-dnl Thread support
-dnl =================================================================
-
-AC_CHECK_HEADER(pthread.h, [have_pthread=yes], [have_pthread=no])
-
-AC_ARG_ENABLE(pthread,
-[  --disable-pthread               Don't use POSIX threads (pthreads)],
-[if test $enableval = no; then
-  # Disable pthreads
-  if test $have_pthread = yes; then
-     AC_MSG_WARN([pthreads seem to be available but you are using --disable-pthread.]) 
-     AC_MSG_WARN([This is almost always a mistake and can render Privoxy unacceptable slow.])
-  fi
-  have_pthread=no
-fi])
-
-if test $have_pthread = yes; then
-  PTHREAD_ONLY=
-  AC_DEFINE(FEATURE_PTHREAD)
-  echo Using POSIX threads
-  if test "$GCC" = "yes"; then
-    # Set a GCC specific switch:
-    if test "$target_type" = "unix"; then
-      ac_jgf_save_CFLAGS=$CFLAGS
-      CFLAGS="$CFLAGS -pthread"
-      AC_TRY_LINK([#include <pthread.h>],
-        [void *p = pthread_create;],
-        [
-          # This compiler switch makes GCC on Linux thread-safe
-          # However, it's not supported on most other OS.
-          PTHREAD_LIB=
-          SPECIAL_CFLAGS="-pthread"
-        ])
-      CFLAGS=$ac_jgf_save_CFLAGS
-    fi
-  fi
-else
-  PTHREAD_ONLY=#
-  echo Using native threads
-fi
-
-AC_SUBST(PTHREAD_ONLY)
-
-dnl =================================================================
-dnl Support for thread-safe versions of gethostbyaddr, gethostbyname,
-dnl gmtime and localtime
-dnl =================================================================
-
-dnl Next line needed to find the gethost*_r functions on Solaris
-AC_CHECK_LIB(nsl, gethostbyname)
-
-AC_CHECK_FUNC(gethostbyaddr_r, [
-  AC_MSG_CHECKING([signature of gethostbyaddr_r])
-  AC_TRY_COMPILE([
-#   include <netdb.h>
-  ], [
-    struct hostent *h, *hp;
-    char *a, *b;
-    int l, bl, t, e;
-    (void) gethostbyaddr_r(a, l, t, h, b, bl, &hp, &e)
-  ], [
-    AC_DEFINE(HAVE_GETHOSTBYADDR_R_8_ARGS)
-    AC_MSG_RESULT([8 args])
-  ], [
-    AC_TRY_COMPILE([
-#     include <netdb.h>
-    ], [
-      struct hostent *h;
-      char *a, *b;
-      int l, bl, t, e;
-      (void) gethostbyaddr_r(a, l, t, h, b, bl, &e)
-    ], [
-      AC_DEFINE(HAVE_GETHOSTBYADDR_R_7_ARGS)
-      AC_MSG_RESULT([7 args])
-    ], [
-      AC_TRY_COMPILE([
-#       include <netdb.h>
-      ], [
-        struct hostent_data *d;
-        struct hostent *h;
-        char a,
-        int l, t;
-        (void) gethostbyaddr_r(a, l, t, h, d)
-      ], [
-        AC_DEFINE(HAVE_GETHOSTBYADDR_R_5_ARGS)
-        AC_MSG_RESULT([5 args])
-      ], [
-        AC_MSG_RESULT(unrecognised)
-      ])
-    ])
-  ])
-], [
-  AC_MSG_RESULT(no)
-])
-
-AC_CHECK_FUNC(gethostbyname_r, [
-  AC_MSG_CHECKING([signature of gethostbyname_r])
-  AC_TRY_COMPILE([
-#   include <netdb.h>
-  ], [
-    struct hostent *h, *r;
-    char *n, *b;
-    int bl, e;
-    (void) gethostbyname_r(n, h, b, bl, &r, &e)
-  ], [
-    AC_DEFINE(HAVE_GETHOSTBYNAME_R_6_ARGS)
-    AC_MSG_RESULT([6 args])
-  ], [
-    AC_TRY_COMPILE([
-#     include <netdb.h>
-    ], [
-      struct hostent *h;
-      char *n, *b;
-      int bl, e;
-      (void) gethostbyname_r(n, h, b, bl, &e)
-    ], [
-      AC_DEFINE(HAVE_GETHOSTBYNAME_R_5_ARGS)
-      AC_MSG_RESULT([5 args])
-    ], [
-      AC_TRY_COMPILE([
-#       include <netdb.h>
-      ], [
-        struct hostent_data *d;
-        struct hostent *h;
-        char *n,
-        (void) gethostbyname_r(n, h, d)
-      ], [
-        AC_DEFINE(HAVE_GETHOSTBYNAME_R_3_ARGS)
-        AC_MSG_RESULT([3 args])
-      ], [
-        AC_MSG_RESULT(unrecognised)
-      ])
-    ])
-  ])
-], [
-  AC_MSG_RESULT(no)
-])
-
-AC_CHECK_FUNC(gmtime_r, [
-  AC_MSG_CHECKING([signature of gmtime_r])
-  AC_TRY_COMPILE([
-#   include <time.h>
-  ], [
-    struct time *t;
-    struct tm *tm;
-    (void) gmtime_r(t, tm)
-  ], [
-    AC_MSG_RESULT(ok)
-    AC_DEFINE(HAVE_GMTIME_R)
-  ], [
-    AC_MSG_RESULT(unrecognised)
-  ])
-], [
-  AC_MSG_RESULT(no)
-])
-
-AC_CHECK_FUNC(localtime_r, [
-  AC_MSG_CHECKING([signature of localtime_r])
-  AC_TRY_COMPILE([
-#   include <time.h>
-  ], [
-    struct time *t;
-    struct tm *tm;
-    (void) localtime_r(t, tm)
-  ], [
-    AC_MSG_RESULT(ok)
-    AC_DEFINE(HAVE_LOCALTIME_R)
-  ], [
-    AC_MSG_RESULT(unrecognised)
-  ])
-], [
-  AC_MSG_RESULT(no)
-])
-
-dnl =================================================================
-dnl Solaris specific
-dnl FIXME: Not tested on Solaris yet...
-dnl ISFIXED: Have tested it on Solaris, but there are other ways to
-dnl 	make these checks generic, e.g.:
-dnl AC_CHECK_FUNC(getsockopt, , AC_CHECK_LIB(socket, getsockopt))
-dnl	(Moritz Barsnick <moritz at barsnick.net>)
-dnl =================================================================
-
-
-SOCKET_LIB=
-
-case "$host" in
-*-solaris*) SOCKET_LIB="-lsocket -lnsl"
-            AC_DEFINE(__EXTENSIONS__)
-            if test "$GCC" = "yes"; then
-              # Set a GCC specific switch:
-              # This compiler switch makes Solaris thread-safe
-              PTHREAD_LIB=
-              SPECIAL_CFLAGS="-pthreads"
-            else
-              # What do we do without GCC? Guess this:
-              SPECIAL_CFLAGS="-D_REENTRANT"
-            fi
-;;
-esac
-
-AC_SUBST(SOCKET_LIB)
-
-dnl =================================================================
-dnl Solaris problem, and others perhaps (socklen_t is undefined)
-dnl =================================================================
-
-AC_MSG_CHECKING([for socklen_t])
-AC_EGREP_HEADER(socklen_t, sys/socket.h, AC_MSG_RESULT([yes]),
-	AC_MSG_RESULT([no])
-	AC_DEFINE(socklen_t,int,
-		[ Define to 'int' if <sys/socket.h> doesn't have it. ]))
-
-
-dnl =================================================================
-dnl OS/2 specific
-dnl =================================================================
-
-case "$host" in
-*-os2-emx*) SOCKET_LIB=-lsocket
-;;
-esac
-
-AC_SUBST(SOCKET_LIB)
-
-dnl =================================================================
-dnl Mac OSX specific
-dnl =================================================================
-    
-case "$host" in
-*-apple-darwin*) SPECIAL_CFLAGS="-Dunix"
-;;  
-esac
-
-dnl =================================================================
-dnl OpenBSD specific
-dnl =================================================================
-
-case "$host" in
-*-openbsd*) SPECIAL_CFLAGS="$SPECIAL_CFLAGS -Dunix"
-;;
-esac
-
-dnl =================================================================
-dnl AmigaOS specific
-dnl =================================================================
-
-AMIGAOS_ONLY=#
-
-case "$host" in
-*-amigaos) AMIGAOS_ONLY=
-;;
-esac
-
-AC_SUBST(AMIGAOS_ONLY)
-
-dnl =================================================================
-dnl Check for standard compiler stuff
-dnl =================================================================
-
-AC_EXEEXT
-AC_OBJEXT
-AC_HEADER_STDC
-AC_HEADER_DIRENT
-AC_C_CONST
-AC_TYPE_SIZE_T
-AC_TYPE_PID_T
-AC_HEADER_TIME
-AC_STRUCT_TM
-AC_CHECK_SIZEOF(int, 4)
-AC_CHECK_SIZEOF(char *, 4)
-AC_CHECK_SIZEOF(long, 4)
-AC_CHECK_SIZEOF(long long, 8)
-AC_CHECK_SIZEOF(size_t, 4)
-
-dnl Checks for header files.
-dnl AC_HEADER_SYS_WAIT
-dnl AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/time.h unistd.h)
-AC_CHECK_HEADERS([OS.h arpa/inet.h errno.h fcntl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h sys/timeb.h sys/wait.h unistd.h])
-
-dnl Checks for library functions.
-dnl AC_TYPE_SIGNAL
-dnl AC_CHECK_FUNC(strstr)
-dnl bcopy and memmove are for PCRE
-AC_CHECK_FUNCS([strerror bcopy memmove])
-AC_PROG_GCC_TRADITIONAL
-dnl uncommenting does not work for swa. suse linux
-dnl AC_FUNC_MALLOC
-AC_FUNC_SETPGRP
-AC_TYPE_SIGNAL
-dnl uncommenting does not work for swa. suse linux
-dnl AC_FUNC_STAT
-AC_CHECK_FUNCS([access atexit getcwd gethostbyaddr gethostbyaddr_r gethostbyname gethostbyname_r gettimeofday inet_ntoa localtime_r memchr memmove memset poll putenv random regcomp select setlocale snprintf socket strchr strdup strerror strftime strlcat strlcpy strptime strstr strtoul timegm tzset])
-
-
-dnl =================================================================
-dnl Checks for libraries.
-dnl =================================================================
-dnl Note: Some systems may have the library but not the system header
-dnl       file, so we must check for both.
-dnl       Also check for correct version
-AC_CHECK_LIB(pcre, pcre_compile, [
-   AC_CHECK_HEADER(pcre.h, [
-      AC_EGREP_HEADER(pcre_fullinfo, pcre.h, [have_pcre=yes], [AC_MSG_WARN([[pcre old version installed]]); have_pcre=no])
-   ], [
-      AC_CHECK_HEADER(pcre/pcre.h, [
-         AC_EGREP_HEADER(pcre_fullinfo, pcre/pcre.h, [have_pcre=yes]; [AC_DEFINE(PCRE_H_IN_SUBDIR)], [AC_MSG_WARN([[pcre old version installed]]); have_pcre=no])
-      ], [have_pcre=no])
-   ])
-], [have_pcre=no])
- 
-AC_CHECK_LIB(pcreposix, regcomp, [
-   AC_CHECK_HEADER(pcreposix.h, [
-      AC_EGREP_HEADER(pcreposix_regerror, pcreposix.h, [AC_MSG_WARN([[pcreposix old version installed]]); have_pcreposix=no], [have_pcreposix=yes])
-   ], [
-      AC_CHECK_HEADER(pcre/pcreposix.h, [
-         AC_EGREP_HEADER(pcreposix_regerror, pcre/pcreposix.h, [AC_MSG_WARN([[pcreposix old version installed]]); have_pcreposix=no], [have_pcreposix=yes]; [AC_DEFINE(PCREPOSIX_H_IN_SUBDIR)])
-      ], [have_pcreposix=no])
-   ])
-], [have_pcreposix=no], -lpcre) 
-
-dnl ================================================================
-dnl libpcrs is temporarily disabled.
-dnl
-dnl Privoxy's own pcrs version fixes some problems that
-dnl are present in libpcrs 0.3, the last pcrs release we
-dnl know of, and as libpcrs seems to be currently unmaintained
-dnl we can't send these fixes upstream.
-dnl ================================================================
-dnl
-dnl AC_CHECK_LIB(pcrs, pcrs_compile, [AC_CHECK_HEADER(pcrs.h, [have_pcrs=yes], [have_pcrs=no])], [have_pcrs=no], -lpcre)
-
-dnl =================================================================
-dnl Always defined
-dnl =================================================================
-
-AC_DEFINE(__MT__)
-
-dnl =================================================================
-dnl Features
-dnl =================================================================
-
-AC_ARG_ENABLE(toggle,
-[  --disable-toggle                Don't support temporary disable],
-[if test $enableval = yes; then
-  AC_DEFINE(FEATURE_TOGGLE)
-fi],AC_DEFINE(FEATURE_TOGGLE))
-
-AC_ARG_ENABLE(force,
-[  --disable-force                 Don't allow single-page disable],
-[if test $enableval = yes; then
-  AC_DEFINE(FEATURE_FORCE_LOAD)
-fi],AC_DEFINE(FEATURE_FORCE_LOAD))
-
-AC_ARG_ENABLE(fast-redirects,
-[  --disable-fast-redirects        Don't support fast redirects],
-[if test $enableval = yes; then
-  AC_DEFINE(FEATURE_FAST_REDIRECTS)
-fi], AC_DEFINE(FEATURE_FAST_REDIRECTS))
-
-AC_ARG_ENABLE(stats,
-[  --disable-stats                 Don't keep statistics],
-[if test $enableval = yes; then
-  AC_DEFINE(FEATURE_STATISTICS)
-fi],AC_DEFINE(FEATURE_STATISTICS))
-
-AC_ARG_ENABLE(ie-images,
-[  --enable-ie-images              Enable a quick but not always reliable auto-detect whether requests from
-                                  MS Internet Explorer are for an image or not.],
-[if test $enableval = yes; then
-  AC_DEFINE(FEATURE_IMAGE_DETECT_MSIE)
-fi],)
-
-AC_ARG_ENABLE(image-blocking,
-[  --disable-image-blocking        Don't try to figure out whether a request is 
-                                  for an image or HTML - assume HTML.],
-[if test $enableval = yes; then
-  AC_DEFINE(FEATURE_IMAGE_BLOCKING)
-fi],
-AC_DEFINE(FEATURE_IMAGE_BLOCKING))
-
-AC_ARG_ENABLE(acl-files,
-[  --disable-acl-files             Prevents the use of ACL files to control access to
-                                  Privoxy by IP address.],
-[if test $enableval = yes; then
-  AC_DEFINE(FEATURE_ACL)
-fi],
-AC_DEFINE(FEATURE_ACL))
-
-AC_ARG_ENABLE(trust-files,
-[  --disable-trust-files           Prevents the use of trust files.],
-[if test $enableval = yes; then
-  AC_DEFINE(FEATURE_TRUST)
-fi],
-AC_DEFINE(FEATURE_TRUST))
-
-AC_ARG_ENABLE(editor,
-[  --disable-editor                Prevents the use of the web-based actions file
-                                  editor and web-based temporary disable setting.],
-[if test $enableval = yes; then
-  AC_DEFINE(FEATURE_CGI_EDIT_ACTIONS)
-fi],
-AC_DEFINE(FEATURE_CGI_EDIT_ACTIONS))
-
-AC_ARG_ENABLE(no-gifs,
-[  --enable-no-gifs                Use politically correct PNG format instead of GIF
-                                  for built-in images. May not work with all browsers.],
-[if test $enableval = yes; then
-  AC_DEFINE(FEATURE_NO_GIFS)
-fi])
-
-AC_ARG_ENABLE(graceful-termination,
-[  --enable-graceful-termination   Allow to shutdown Privoxy through the webinterface.],
-[if test $enableval = yes; then
-  AC_DEFINE(FEATURE_GRACEFUL_TERMINATION)
-fi])
-
-AC_ARG_ENABLE(extended-host-patterns,
-[  --enable-extended-host-patterns Allow extended regular expressions in host patterns.],
-[if test $enableval = yes; then
-  AC_DEFINE(FEATURE_EXTENDED_HOST_PATTERNS)
-fi])
-
-dnl pcre/pcrs is needed for CGI anyway, so
-dnl the choice is only between static and
-dnl dynamic:
-
-AC_ARG_ENABLE(dynamic-pcre,
-[  --disable-dynamic-pcre          Use the built-in, static pcre, even if libpcre is available],
-[ if test $enableval = "no"; then have_pcre=no; fi ])
-
-dnl =================================================
-dnl libpcrs is temporarily disabled,
-dnl see comment above for the reason.
-dnl =================================================
-dnl AC_ARG_ENABLE(dynamic-pcrs,
-dnl [  --disable-dynamic-pcrs          Use the built-in, static pcrs, even if libpcrs is available],
-dnl [ if test $enableval = "no"; then have_pcrs=no; fi ])
-
-
-dnl ====================================================
-dnl This check is incomplete. For mingw32 zlib is found
-dnl by configure, but not necessarily by the compiler.
-dnl ====================================================
-AC_ARG_ENABLE(zlib,
-[  --disable-zlib                  Don't use zlib to decompress data before filtering.],
-[enableval2=$enableval],
-[enableval2=yes])
-if test $enableval2 = yes; then
-  AC_CHECK_LIB(z, zlibVersion, [have_zlib="yes"], [have_zlib="no"])
-  if test $have_zlib = "yes"; then
-    LIBS="$LIBS -lz"
-    AC_DEFINE(FEATURE_ZLIB,1,[Define to 1 to use compression through the zlib library.])
-  else
-   AC_MSG_WARN([No zlib found.
-   Privoxy will not be able to filter compressed content.
-   This may become a fatal error in the future.])
-  fi  
-fi
-
-
-# If we have libpcre and either we also have pcreposix or
-# we don't need pcreposix, then link pcre dynamically; else
-# build it and link statically
-#
-if test $have_pcre = "yes"; then
-  echo "using libpcre"
-  pcre_dyn=yes
-  STATIC_PCRE_ONLY=#
-  LIBS="$LIBS -lpcre -lpcreposix"
-else
-  AC_MSG_WARN([You are using the static PCRE code which is scheduled for removal, for details see: 
-    https://sourceforge.net/mailarchive/message.php?msg_id=20080511195555.2dc6cfdc%40fabiankeil.de])
-  pcre_dyn=no
-  AC_DEFINE(STATIC_PCRE)
-  STATIC_PCRE_ONLY=
-fi
-
-if test $have_pthread = "yes" -o $target_type = "mingw"; then
-  echo Enabling keep-alive support for outgoing connections.
-  AC_DEFINE(FEATURE_CONNECTION_KEEP_ALIVE)
-fi
-
-dnl =================================================
-dnl libpcrs is temporarily disabled,
-dnl see comment above for the reason.
-dnl =================================================
-dnl # If we have libpcrs and pcre is linked dynamically
-dnl # then also link pcrs dynamically, else build and link
-dnl # pcrs statically
-dnl
-dnl if test $have_pcrs = "yes" -a $pcre_dyn = "yes"; then
-dnl  echo "using libpcrs"
-dnl  STATIC_PCRS_ONLY=#
-dnl  LIBS="$LIBS -lpcrs"
-dnl else
-dnl  echo "using built-in static pcrs"
-  AC_DEFINE(STATIC_PCRS)
-  STATIC_PCRS_ONLY=
-dnl fi
-
-AC_SUBST(STATIC_PCRE_ONLY)
-AC_SUBST(STATIC_PCRS_ONLY)
-
-dnl =================================================================
-dnl Final cleanup and output
-dnl =================================================================
-
-dnl Remove the SPECIAL_CFLAGS stuff from CFLAGS, and add it seperately
-dnl in the Makefile
-CFLAGS=$old_CFLAGS_nospecial
-AC_SUBST(SPECIAL_CFLAGS)
-
-AC_SUBST(PTHREAD_LIB)
-
-AC_OUTPUT(GNUmakefile doc/source/ldp.dsl)
diff --git a/external/privoxy/cygwin.h b/external/privoxy/cygwin.h
deleted file mode 100644
index 526f8d0..0000000
--- a/external/privoxy/cygwin.h
+++ /dev/null
@@ -1,80 +0,0 @@
-#ifndef CYGWIN_H_INCLUDED
-#define CYGWIN_H_INCLUDED
-#define CYGWIN_H_VERSION "$Id: cygwin.h,v 1.6 2006/07/18 14:48:45 david__schmidt Exp $"
-/*********************************************************************
- *
- * File        :  $Source: /cvsroot/ijbswa/current/cygwin.h,v $
- *
- * Purpose     :  The windows.h file seems to be a *tad* different, so I
- *                will bridge the gaps here.  Perhaps I should convert the
- *                latest SDK too?  Shudder, I think not.
- *
- * Copyright   :  Written by and Copyright (C) 2001 the SourceForge
- *                Privoxy team. http://www.privoxy.org/
- *
- *                Based on the Internet Junkbuster originally written
- *                by and Copyright (C) 1997 Anonymous Coders and 
- *                Junkbusters Corporation.  http://www.junkbusters.com
- *
- *                This program is free software; you can redistribute it 
- *                and/or modify it under the terms of the GNU General
- *                Public License as published by the Free Software
- *                Foundation; either version 2 of the License, or (at
- *                your option) any later version.
- *
- *                This program is distributed in the hope that it will
- *                be useful, but WITHOUT ANY WARRANTY; without even the
- *                implied warranty of MERCHANTABILITY or FITNESS FOR A
- *                PARTICULAR PURPOSE.  See the GNU General Public
- *                License for more details.
- *
- *                The GNU General Public License should be included with
- *                this file.  If not, you can view it at
- *                http://www.gnu.org/copyleft/gpl.html
- *                or write to the Free Software Foundation, Inc., 59
- *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * Revisions   :
- *    $Log: cygwin.h,v $
- *    Revision 1.6  2006/07/18 14:48:45  david__schmidt
- *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
- *    with what was really the latest development (the v_3_0_branch branch)
- *
- *    Revision 1.4  2002/03/26 22:29:54  swa
- *    we have a new homepage!
- *
- *    Revision 1.3  2002/03/24 13:25:43  swa
- *    name change related issues
- *
- *    Revision 1.2  2001/07/29 18:43:08  jongfoster
- *    Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to
- *    ANSI C rules.
- *
- *    Revision 1.1.1.1  2001/05/15 13:58:51  oes
- *    Initial import of version 2.9.3 source tree
- *
- *
- *********************************************************************/
-
-/* Conditionally include this whole file. */
-#ifdef __MINGW32__
-
-/* Hmmm, seems to be overlooked. */
-#define _RICHEDIT_VER 0x0300
-
-/*
- * Named slightly different ... but not in Cygwin v1.3.1 ...
- *
- * #define LVITEM   LV_ITEM
- * #define LVCOLUMN LV_COLUMN
- */
-
-#endif /* def __MINGW32__ */
-#endif /* ndef CYGWIN_H_INCLUDED */
-
-
-/*
-  Local Variables:
-  tab-width: 3
-  end:
-*/
diff --git a/external/privoxy/deanimate.c b/external/privoxy/deanimate.c
deleted file mode 100644
index 01fc97c..0000000
--- a/external/privoxy/deanimate.c
+++ /dev/null
@@ -1,554 +0,0 @@
-const char deanimate_rcs[] = "$Id: deanimate.c,v 1.19 2008/05/21 15:29:35 fabiankeil Exp $";
-/*********************************************************************
- *
- * File        :  $Source: /cvsroot/ijbswa/current/deanimate.c,v $
- *
- * Purpose     :  Declares functions to manipulate binary images on the
- *                fly.  High-level functions include:
- *                  - Deanimation of GIF images
- *                
- *                Functions declared include: gif_deanimate, buf_free,
- *                buf_copy,  buf_getbyte, gif_skip_data_block
- *                and gif_extract_image
- *
- * Copyright   :  Written by and Copyright (C) 2001 - 2004, 2006 by the
- *                SourceForge Privoxy team. http://www.privoxy.org/
- *
- *                Based on the GIF file format specification (see
- *                http://tronche.com/computer-graphics/gif/gif89a.html)
- *                and ideas from the Image::DeAnim Perl module by
- *                Ken MacFarlane, <ksm+cpan at universal.dca.net>
- *
- *                This program is free software; you can redistribute it 
- *                and/or modify it under the terms of the GNU General
- *                Public License as published by the Free Software
- *                Foundation; either version 2 of the License, or (at
- *                your option) any later version.
- *
- *                This program is distributed in the hope that it will
- *                be useful, but WITHOUT ANY WARRANTY; without even the
- *                implied warranty of MERCHANTABILITY or FITNESS FOR A
- *                PARTICULAR PURPOSE.  See the GNU General Public
- *                License for more details.
- *
- *                The GNU General Public License should be included with
- *                this file.  If not, you can view it at
- *                http://www.gnu.org/copyleft/gpl.html
- *                or write to the Free Software Foundation, Inc., 59
- *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * Revisions   :
- *    $Log: deanimate.c,v $
- *    Revision 1.19  2008/05/21 15:29:35  fabiankeil
- *    Fix gcc43 warnings.
- *
- *    Revision 1.18  2008/03/28 15:13:38  fabiankeil
- *    Remove inspect-jpegs action.
- *
- *    Revision 1.17  2007/08/05 13:42:22  fabiankeil
- *    #1763173 from Stefan Huehner: declare some more functions static.
- *
- *    Revision 1.16  2007/07/14 08:01:58  fabiankeil
- *    s at failiure@failure@
- *
- *    Revision 1.15  2007/01/03 14:39:19  fabiankeil
- *    Fix a gcc43 warning and mark the binbuffer
- *    as immutable for buf_getbyte().
- *
- *    Revision 1.14  2006/07/18 14:48:45  david__schmidt
- *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
- *    with what was really the latest development (the v_3_0_branch branch)
- *
- *    Revision 1.12.2.1  2004/10/03 12:53:32  david__schmidt
- *    Add the ability to check jpeg images for invalid
- *    lengths of comment blocks.  Defensive strategy
- *    against the exploit:
- *       Microsoft Security Bulletin MS04-028
- *       Buffer Overrun in JPEG Processing (GDI+) Could
- *       Allow Code Execution (833987)
- *    Enabled with +inspect-jpegs in actions files.
- *
- *    Revision 1.12  2002/05/12 21:36:29  jongfoster
- *    Correcting function comments
- *
- *    Revision 1.11  2002/03/26 22:29:54  swa
- *    we have a new homepage!
- *
- *    Revision 1.10  2002/03/24 13:25:43  swa
- *    name change related issues
- *
- *    Revision 1.9  2002/03/13 00:27:04  jongfoster
- *    Killing warnings
- *
- *    Revision 1.8  2002/03/09 19:42:47  jongfoster
- *    Fixing more warnings
- *
- *    Revision 1.7  2002/03/08 17:46:04  jongfoster
- *    Fixing int/size_t warnings
- *
- *    Revision 1.6  2002/03/07 03:46:17  oes
- *    Fixed compiler warnings
- *
- *    Revision 1.5  2001/09/10 10:16:06  oes
- *    Silenced compiler warnings
- *
- *    Revision 1.4  2001/07/18 12:28:49  oes
- *    - Added feature for extracting the first frame
- *      to gif_deanimate
- *    - Separated image buffer extension into buf_extend
- *    - Extended gif deanimation to GIF87a (untested!)
- *    - Cosmetics
- *
- *    Revision 1.3  2001/07/15 13:57:50  jongfoster
- *    Adding #includes string.h and miscutil.h
- *
- *    Revision 1.2  2001/07/13 13:46:20  oes
- *    Introduced GIF deanimation feature
- *
- *
- **********************************************************************/
-
-
-#include "config.h"
-
-#include <string.h>
-#include <fcntl.h>
-
-#include "errlog.h"
-#include "project.h"
-#include "deanimate.h"
-#include "miscutil.h"
-
-const char deanimate_h_rcs[] = DEANIMATE_H_VERSION;
-
-/*********************************************************************
- * 
- * Function    :  buf_free
- *
- * Description :  Safely frees a struct binbuffer
- *
- * Parameters  :
- *          1  :  buf = Pointer to the binbuffer to be freed
- *
- * Returns     :  N/A
- *
- *********************************************************************/
-void buf_free(struct binbuffer *buf)
-{
-   if (buf == NULL) return;
-
-   if (buf->buffer != NULL)
-   {
-      free(buf->buffer);
-   }
-
-   free(buf);
-
-}
-
-
-/*********************************************************************
- * 
- * Function    :  buf_extend
- *
- * Description :  Ensure that a given binbuffer can hold a given amount
- *                of bytes, by reallocating its buffer if necessary.
- *                Allocate new mem in chunks of 1024 bytes, so we don't
- *                have to realloc() too often.
- *
- * Parameters  :
- *          1  :  buf = Pointer to the binbuffer
- *          2  :  length = Desired minimum size
- *                
- *
- * Returns     :  0 on success, 1 on failure.
- *
- *********************************************************************/
-static int buf_extend(struct binbuffer *buf, size_t length)
-{
-   char *newbuf;
-
-   if (buf->offset + length > buf->size)
-   {
-      buf->size = ((buf->size + length + (size_t)1023) & ~(size_t)1023);
-      newbuf = (char *)realloc(buf->buffer, buf->size);
-
-      if (newbuf == NULL)
-      {
-         freez(buf->buffer);
-         return 1;
-      }
-      else
-      {
-         buf->buffer = newbuf;
-         return 0;
-      }
-   }
-   return 0;
-
-}
-
-
-/*********************************************************************
- * 
- * Function    :  buf_copy
- *
- * Description :  Safely copies a given amount of bytes from one
- *                struct binbuffer to another, advancing the
- *                offsets appropriately.
- *
- * Parameters  :
- *          1  :  src = Pointer to the source binbuffer
- *          2  :  dst = Pointer to the destination binbuffer
- *          3  :  length = Number of bytes to be copied
- *
- * Returns     :  0 on success, 1 on failure.
- *
- *********************************************************************/
-static int buf_copy(struct binbuffer *src, struct binbuffer *dst, size_t length)
-{
-
-   /*
-    * Sanity check: Can't copy more data than we have
-    */
-   if (src->offset + length > src->size) 
-   {
-      return 1;
-   }
-
-   /*
-    * Ensure that dst can hold the new data
-    */
-   if (buf_extend(dst, length)) 
-   {
-      return 1;
-   }
-
-   /*
-    * Now that it's safe, memcpy() the desired amount of
-    * data from src to dst and adjust the offsets
-    */
-   memcpy(dst->buffer + dst->offset, src->buffer + src->offset, length);
-   src->offset += length;
-   dst->offset += length;
-
-   return 0;
-
-}
-
-
-/*********************************************************************
- * 
- * Function    :  buf_getbyte
- *
- * Description :  Safely gets a byte from a given binbuffer at a
- *                given offset
- *
- * Parameters  :
- *          1  :  src = Pointer to the source binbuffer
- *          2  :  offset = Offset to the desired byte
- *
- * Returns     :  The byte on success, or 0 on failure
- *
- *********************************************************************/
-static unsigned char buf_getbyte(const struct binbuffer *src, size_t offset)
-{
-   if (src->offset + offset < src->size)
-   {
-      return (unsigned char)*(src->buffer + src->offset + offset);
-   }
-   else
-   {
-      return '\0';
-   }
-
-}
-
-
-/*********************************************************************
- * 
- * Function    :  gif_skip_data_block
- *
- * Description :  Safely advances the offset of a given struct binbuffer
- *                that contains a GIF image and whose offset is
- *                positioned at the start of a data block, behind
- *                that block.
- *
- * Parameters  :
- *          1  :  buf = Pointer to the binbuffer
- *
- * Returns     :  0 on success, or 1 on failure
- *
- *********************************************************************/
-static int gif_skip_data_block(struct binbuffer *buf)
-{
-   unsigned char c;
-
-   /* 
-    * Data blocks are sequences of chunks, which are headed
-    * by a one-byte length field, with the last chunk having
-    * zero length.
-    */
-   while((c = buf_getbyte(buf, 0)) != '\0')
-   {
-      buf->offset += (size_t)c + 1;
-      if (buf->offset >= buf->size - 1)
-      {
-         return 1;
-      }
-   }
-   buf->offset++;
-
-   return 0;
-
-}
-
-
-/*********************************************************************
- * 
- * Function    :  gif_extract_image
- *
- * Description :  Safely extracts an image data block from a given
- *                struct binbuffer that contains a GIF image and whose
- *                offset is positioned at the start of a data block 
- *                into a given destination binbuffer.
- *
- * Parameters  :
- *          1  :  src = Pointer to the source binbuffer
- *          2  :  dst = Pointer to the destination binbuffer
- *
- * Returns     :  0 on success, or 1 on failure
- *
- *********************************************************************/
-static int gif_extract_image(struct binbuffer *src, struct binbuffer *dst)
-{
-   unsigned char c;
-
-   /*
-    * Remember the colormap flag and copy the image head
-    */
-   c = buf_getbyte(src, 9);
-   if (buf_copy(src, dst, 10))
-   {
-      return 1;
-   }
-
-   /*
-    * If the image has a local colormap, copy it.
-    */
-   if (c & 0x80)
-   {
-      int map_length = 3 * (1 << ((c & 0x07) + 1));
-      if (map_length <= 0)
-      {
-         log_error(LOG_LEVEL_DEANIMATE,
-            "colormap length = %d (%c)?", map_length, c);
-         return 1;
-      }
-      if (buf_copy(src, dst, (size_t)map_length))
-      {
-         return 1;
-      }           
-   }
-   if (buf_copy(src, dst, 1)) return 1;
-
-   /*
-    * Copy the image chunk by chunk.
-    */
-   while((c = buf_getbyte(src, 0)) != '\0')
-   {
-      if (buf_copy(src, dst, 1 + (size_t) c)) return 1;
-   }
-   if (buf_copy(src, dst, 1)) return 1;
-
-   /*
-    * Trim and rewind the dst buffer
-    */
-   if (NULL == (dst->buffer = (char *)realloc(dst->buffer, dst->offset))) return 1;
-   dst->size = dst->offset;
-   dst->offset = 0;
-
-   return(0);
-
-}
-
-/*********************************************************************
- * 
- * Function    :  gif_deanimate
- *
- * Description :  Deanimate a given GIF image, i.e. given a GIF with
- *                an (optional) image block and an arbitrary number
- *                of image extension blocks, produce an output GIF with
- *                only one image block that contains the last image
- *                (extenstion) block of the original.
- *                Also strip Comments, Application extenstions, etc.
- *
- * Parameters  :
- *          1  :  src = Pointer to the source binbuffer
- *          2  :  dst = Pointer to the destination binbuffer
- *          3  :  get_first_image = Flag: If set, get the first image
- *                                        If unset (default), get the last
- *
- * Returns     :  0 on success, or 1 on failure
- *
- *********************************************************************/
-int gif_deanimate(struct binbuffer *src, struct binbuffer *dst, int get_first_image)
-{
-   unsigned char c;
-   struct binbuffer *image;
-
-   if (NULL == src || NULL == dst)
-   {
-      return 1;
-   }
-
-   c = buf_getbyte(src, 10);
-
-   /*
-    * Check & copy GIF header 
-    */
-   if (strncmp(src->buffer, "GIF89a", 6) && strncmp(src->buffer, "GIF87a", 6)) 
-   {
-      return 1;
-   }
-   else
-   {
-      if (buf_copy(src, dst, 13))
-      {
-         return 1;
-      }
-   }
-
-   /*
-    * Look for global colormap and  copy if found.
-    */
-   if(c & 0x80)
-   {
-      int map_length = 3 * (1 << ((c & 0x07) + 1));
-      if (map_length <= 0)
-      {
-         log_error(LOG_LEVEL_DEANIMATE,
-            "colormap length = %d (%c)?", map_length, c);
-         return 1;
-      }
-      if (buf_copy(src, dst, (size_t)map_length))
-      {
-         return 1;
-      }
-   }
-
-   /*
-    * Reserve a buffer for the current image block
-    */
-   if (NULL == (image = (struct binbuffer *)zalloc(sizeof(*image))))
-   {
-      return 1;
-   }
-
-   /*
-    * Parse the GIF block by block and copy the relevant
-    * parts to dst
-    */
-   while(src->offset < src->size)
-   {
-      switch(buf_getbyte(src, 0))
-      {
-         /*
-          *  End-of-GIF Marker: Append current image and return
-          */
-      case 0x3b:
-         goto write;
-
-         /* 
-          * Image block: Extract to current image buffer.
-          */
-      case 0x2c:
-         image->offset = 0;
-         if (gif_extract_image(src, image)) goto failed;
-         if (get_first_image) goto write;
-         continue;
-
-         /*
-          * Extension block: Look at next byte and decide
-          */
-      case 0x21:
-         switch (buf_getbyte(src, 1))
-         {
-            /*
-             * Image extension: Copy extension  header and image
-             *                  to the current image buffer
-             */
-         case 0xf9:
-            image->offset = 0;
-            if (buf_copy(src, image, 8) || buf_getbyte(src, 0) != 0x2c) goto failed;
-            if (gif_extract_image(src, image)) goto failed;
-            if (get_first_image) goto write;
-            continue;
-
-            /*
-             * Application extension: Skip
-             */
-         case 0xff:
-            if ((src->offset += 14) >= src->size || gif_skip_data_block(src)) goto failed;
-            continue;
-
-            /*
-             * Comment extension: Skip
-             */
-         case 0xfe:
-            if ((src->offset += 2) >= src->size || gif_skip_data_block(src)) goto failed;
-            continue;
-
-            /*
-             * Plain text extension: Skip
-             */
-         case 0x01:
-            if ((src->offset += 15) >= src->size || gif_skip_data_block(src)) goto failed;
-            continue;
-
-            /*
-             * Ooops, what type of extension is that?
-             */
-         default:
-            goto failed;
-
-         }
-
-         /*
-          * Ooops, what type of block is that?
-          */
-      default:
-         goto failed;
-         
-      }
-   } /* -END- while src */
-
-   /*
-    * Either we got here by goto, or because the GIF is
-    * bogus and EOF was reached before an end-of-gif marker 
-    * was found.
-    */
-
-failed:
-   buf_free(image);
-   return 1;
-
-   /*
-    * Append the current image to dst and return
-    */
-
-write:
-   if (buf_copy(image, dst, image->size)) goto failed;
-   if (buf_extend(dst, 1)) goto failed;
-   *(dst->buffer + dst->offset++) = 0x3b;
-   buf_free(image);
-   return 0;
-
-}
-
-
-/*
-  Local Variables:
-  tab-width: 3
-  end:
-*/
diff --git a/external/privoxy/deanimate.h b/external/privoxy/deanimate.h
deleted file mode 100644
index 53af6f1..0000000
--- a/external/privoxy/deanimate.h
+++ /dev/null
@@ -1,126 +0,0 @@
-#ifndef DEANIMATE_H_INCLUDED
-#define DEANIMATE_H_INCLUDED
-#define DEANIMATE_H_VERSION "$Id: deanimate.h,v 1.12 2008/03/28 15:13:39 fabiankeil Exp $"
-/*********************************************************************
- *
- * File        :  $Source: /cvsroot/ijbswa/current/deanimate.h,v $
- *
- * Purpose     :  Declares functions to manipulate binary images on the
- *                fly.  High-level functions include:
- *                  - Deanimation of GIF images
- *                
- *                Functions declared include: gif_deanimate and buf_free.
- *                
- *
- * Copyright   :  Written by and Copyright (C) 2001 - 2004 by the the
- *                SourceForge Privoxy team. http://www.privoxy.org/
- *
- *                Based on ideas from the Image::DeAnim Perl module by
- *                Ken MacFarlane, <ksm+cpan at universal.dca.net>
- *
- *                Based on the Internet Junkbuster originally written
- *                by and Copyright (C) 1997 Anonymous Coders and 
- *                Junkbusters Corporation.  http://www.junkbusters.com
- *
- *                This program is free software; you can redistribute it 
- *                and/or modify it under the terms of the GNU General
- *                Public License as published by the Free Software
- *                Foundation; either version 2 of the License, or (at
- *                your option) any later version.
- *
- *                This program is distributed in the hope that it will
- *                be useful, but WITHOUT ANY WARRANTY; without even the
- *                implied warranty of MERCHANTABILITY or FITNESS FOR A
- *                PARTICULAR PURPOSE.  See the GNU General Public
- *                License for more details.
- *
- *                The GNU General Public License should be included with
- *                this file.  If not, you can view it at
- *                http://www.gnu.org/copyleft/gpl.html
- *                or write to the Free Software Foundation, Inc., 59
- *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * Revisions   :
- *    $Log: deanimate.h,v $
- *    Revision 1.12  2008/03/28 15:13:39  fabiankeil
- *    Remove inspect-jpegs action.
- *
- *    Revision 1.11  2007/01/12 15:41:00  fabiankeil
- *    Remove some white space at EOL.
- *
- *    Revision 1.10  2006/07/18 14:48:45  david__schmidt
- *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
- *    with what was really the latest development (the v_3_0_branch branch)
- *
- *    Revision 1.8.2.1  2004/10/03 12:53:32  david__schmidt
- *    Add the ability to check jpeg images for invalid
- *    lengths of comment blocks.  Defensive strategy
- *    against the exploit:
- *       Microsoft Security Bulletin MS04-028
- *       Buffer Overrun in JPEG Processing (GDI+) Could
- *       Allow Code Execution (833987)
- *    Enabled with +inspect-jpegs in actions files.
- *
- *    Revision 1.8  2002/03/26 22:29:54  swa
- *    we have a new homepage!
- *
- *    Revision 1.7  2002/03/24 13:25:43  swa
- *    name change related issues
- *
- *    Revision 1.6  2002/03/08 17:46:04  jongfoster
- *    Fixing int/size_t warnings
- *
- *    Revision 1.5  2002/03/07 03:46:17  oes
- *    Fixed compiler warnings
- *
- *    Revision 1.4  2001/07/29 18:50:04  jongfoster
- *    Fixing "extern C" block, and renaming #define _DEANIMATE_H
- *
- *    Revision 1.3  2001/07/18 12:29:05  oes
- *    Updated prototype for gif_deanimate
- *
- *    Revision 1.2  2001/07/13 13:46:20  oes
- *    Introduced GIF deanimation feature
- *
- *
- *********************************************************************/
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * A struct that holds a buffer, a read/write offset,
- * and the buffer's capacity.
- */
-struct binbuffer
-{
-   char *buffer;
-   size_t offset;
-   size_t size;
-};
-
-/*
- * Function prototypes
- */
-extern int gif_deanimate(struct binbuffer *src, struct binbuffer *dst, int get_first_image);
-extern void buf_free(struct binbuffer *buf);
-
-/* 
- * Revision control strings from this header and associated .c file
- */
-extern const char deanimate_rcs[];
-extern const char deanimate_h_rcs[];
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* ndef DEANIMATE_H_INCLUDED */
-
-/*
-  Local Variables:
-  tab-width: 3
-  end:
-*/
diff --git a/external/privoxy/default.action.master b/external/privoxy/default.action.master
deleted file mode 100644
index 81c4138..0000000
--- a/external/privoxy/default.action.master
+++ /dev/null
@@ -1,2162 +0,0 @@
-#MASTER# COMMENT:
-#MASTER# COMMENT:  Anyone adding specific rules to this file,
-#MASTER# COMMENT:  wherever possible please include a *full* URL
-#MASTER# COMMENT:  which can be used to verify the problem, and if
-#MASTER# COMMENT:  the problem may not always be fully obvious, a
-#MASTER# COMMENT:  brief explanation. Please also add tests for
-#MASTER# COMMENT:  Privoxy-Regression-Test so we can automatically
-#MASTER# COMMENT:  verify that your rules are effective. Thanks.
-#MASTER# COMMENT:
-######################################################################
-#
-#  File        :  $Source: /cvsroot/ijbswa/current/default.action.master,v $
-#
-#  $Id: default.action.master,v 1.170 2009/03/04 15:05:00 ler762 Exp $
-#
-#  Requires    :  This version requires Privoxy v3.0.11 or later due to
-#                 syntax changes.
-#
-#  Purpose     :  Default actions file, see
-#                 http://www.privoxy.org/user-manual/actions-file.html.
-#                 This file is subject to periodic updating. It is
-#                 not supposed to be edited by the user. Local exceptions
-#                 and enhancements are better placed in user.action,
-#                 the match-all section has been moved to match-all.action.
-#
-#  Copyright   :  Written by and Copyright (C) 2001-2009 the
-#                 Privoxy team. http://www.privoxy.org/
-#
-#  Note: Updated versions of this file will be made available from time
-#        to time. Check http://sourceforge.net/project/showfiles.php?group_id=11118
-#        for updates and/or subscribe to the announce mailing list
-#        (http://lists.sourceforge.net/lists/listinfo/ijbswa-announce) if you
-#        wish to receive an email notice whenever updates are released.
-#
-# We value your feedback. However, to provide you with the best support,
-# please note:
-#
-#  * Use the support forum to get help:
-#    http://sourceforge.net/tracker/?group_id=11118&atid=211118
-#  * Submit feedback for this actions file only through the
-#    SF actions file feedback tracker:
-#    http://sourceforge.net/tracker/?group_id=11118&atid=460288
-#  * Submit bugs only through our bug forum:
-#    http://sourceforge.net/tracker/?group_id=11118&atid=111118
-#    Make sure that the bug has not already been submitted. Please try
-#    to verify that it is a Privoxy bug, and not a browser or site
-#    bug first. If you are using your own custom configuration, please
-#    try the stock configs to see if the problem is a configuration
-#    related bug. And if possible please try the latest CVS sources.
-#  * Submit feature requests only through our feature request forum:
-#    http://sourceforge.net/tracker/?atid=361118&group_id=11118&func=browse
-#
-# For any other issues, feel free to use the mailing lists:
-# http://sourceforge.net/mail/?group_id=11118
-#
-# Anyone interested in actively participating in development and related
-# discussions can join the appropriate mailing list here:
-# http://sourceforge.net/mail/?group_id=11118. Archives are available
-# here too.
-#
-# The current development version of this file is located:
-# http://ijbswa.cvs.sourceforge.net/*checkout*/ijbswa/current/default.action.master
-#
-#############################################################################
-# Syntax
-#############################################################################
-#
-# A much better explanation can be found in the user manual which is
-# part of the distribution and can be found at http://www.privoxy.org/user-manual
-#
-# To determine which actions apply to a request, the URL of the request is
-# compared to all patterns in this file. Every time it matches, the list of
-# applicable actions for this URL is incrementally updated. You can trace
-# this process by visiting http://config.privoxy.org/show-url-info
-#
-# There are 4 types of lines in this file: comments (like this line),
-# actions, aliases and patterns, all of which are explained below.
-#
-#############################################################################
-# Pattern Syntax
-#############################################################################
-#
-# 1. On Domains and Paths
-# -----------------------
-#
-# Generally, a pattern has the form <domain>/<path>, where both the <domain>
-# and <path> part are optional. The pattern matching syntax is different for
-# each. If you only specify a domain part, the "/" can be left out, but it is
-# required for the path part.
-#
-# www.example.com
-#   is a domain-only pattern and will match any request to www.example.com
-#
-# www.example.com/
-#   means exactly the same (but is slightly less efficient)
-#
-# www.example.com/index.html
-#   matches only the document /index.html on www.example.com
-#
-# /index.html
-#   matches the document /index.html, regardless of the domain
-#
-# index.html
-#   matches nothing, since it would be interpreted as a domain name and
-#   there is no top-level domain called ".html".
-#
-# 2. Domain Syntax
-# ----------------
-#
-# The matching of the domain part offers some flexible options: If the
-# domain starts or ends with a dot, it becomes unanchored at that end:
-#
-# www.example.com
-#   matches only www.example.com
-#
-# .example.com
-#   matches any domain that ENDS in .example.com
-#
-# www.
-#   matches any domain that STARTS with www.
-#
-# .example.
-#   matches any domain that CONTAINS example
-#
-#
-# Additionally, there are wildcards that you can use in the domain names
-# themselves. They work pretty similar to shell wildcards: "*" stands for
-# zero or more arbitrary characters, "?" stands for one, and you can define
-# character classes in square brackets and they can be freely mixed:
-#
-# ad*.example.com
-#   matches adserver.example.com, ads.example.com, etc but not sfads.example.com
-#
-# *ad*.example.com
-#   matches all of the above
-#
-# .?pix.com
-#   matches www.ipix.com, pictures.epix.com, a.b.c.d.e.upix.com etc
-#
-# www[1-9a-ez].example.com
-#   matches www1.example.com, www4.example.com, wwwd.example.com,
-#   wwwz.example.com etc, but not wwww.example.com
-#
-# You get the idea?
-#
-# 2. Path Syntax
-# --------------
-#
-# Paths are specified as full regular expressions, and are more flexible than
-# the domain syntax above. A comprehensive discussion of regular expressions
-# wouldn't fit here.
-#
-# Perl compatible regular expressions are used. See the pcre/docs/ direcory or
-# man perlre (also available at http://perldoc.perl.org/perlre.html) for
-# details. The appendix to our User Manual also has some detail.
-#
-# Please note that matching in the path is CASE INSENSITIVE by default, but
-# you can switch to case sensitive by starting the pattern with the "(?-i)"
-# switch:
-#
-# www.example.com/(?-i)PaTtErN.*
-#   will match only documents whose path starts with PaTtErN in exactly this
-#   capitalization.
-#
-# Partially case-sensitive and partially case-insensitive patterns are
-# possible, but the rules about splitting them up are extremely complex
-# - see the PCRE documentation for more information.
-#
-#############################################################################
-# Action Syntax
-#############################################################################
-#
-# There are 3 kinds of actions:
-#
-# Boolean (e.g. "handle-as-image"):
-#   +name  # enable
-#   -name  # disable
-#
-# Parameterized (e.g. "hide-user-agent"):
-#   +name{param}  # enable and set parameter to "param"
-#   -name         # disable
-#
-# Multi-value (e.g. "add-header", "filter"):
-#   +name{param}  # enable and add parameter "param"
-#   -name{param}  # remove the parameter "param"
-#   -name         # disable totally
-#
-# The default (if you don't specify anything in this file) is not to take
-# any actions - i.e completely disabled, so Privoxy will just be a
-# normal, non-blocking, non-anonymizing proxy.  You must specifically
-# enable the privacy and blocking features you need (although the
-# provided default actions file will do that for you).
-#
-# Later actions always override earlier ones.  For multi-valued actions,
-# the actions are applied in the order they are specified.
-#
-#############################################################################
-# Valid actions are:
-#############################################################################
-#
-# +add-header{Name: value}
-#    Adds the specified HTTP header, which is not checked for validity.
-#    You may specify this many times to specify many headers.
-#
-# +block{reason}
-#    Block this URL. Instead of forwarding the request, Privoxy will
-#    send a "block" page containing the specified reason.
-#
-# +change-x-forwarded-for{add}
-# +change-x-forwarded-for{block}
-#   Adds or blocks the "X-Forwarded-For:" HTTP header in client
-#   requests.
-#
-# +client-header-filter{name}
-#    All client headers to which this action applies are filtered on-the-fly
-#    through the specified regular expression based substitutions.
-#
-#    Client-header filters predefined in the supplied default.filter include:
-#
-#     hide-tor-exit-notation: Removes the Tor exit node notation in Host and Referer headers.
-#     privoxy-control:        Removes X-Privoxy-Control headers.
-#
-# +client-header-tagger{string}
-#    Tag requests based on their headers. Client headers to which this
-#    action applies are filtered on-the-fly through the specified regular
-#    expression based substitutions, the result is used as a tag.
-#    Client-header taggers are the first actions that are executed and their
-#    tags can be used to control every other action.
-#
-#    Client-header taggers predefined in the supplied default.filter include:
-#
-#     image-requests:    Tags detected image requests as "IMAGE-REQUEST".
-#     css-requests:      Tags detected CSS requests as "CSS-REQUEST".
-#     client-ip-address: Tags the request with the client's IP address.
-#     http-method:       Tags the request with its HTTP method.
-#     allow-post:        Tags POST requests as "ALLOWED-POST".
-#     complete-url:      Tags the request with the whole request URL.
-#     user-agent:        Tags the request with the complete User-Agent header.
-#     privoxy-control:   Creates tags with the content of X-Privoxy-Control headers.
-#
-# +content-type-overwrite
-#    Replaces the "Content-Type:" HTTP server header, so that unwanted
-#    download menus will not pop up, or changes the browser's rendering mode.
-#
-# +crunch-client-header{string}
-#    Deletes every header sent by the client that contains the string the
-#    user supplied as parameter.
-#
-# +crunch-if-none-match
-#     Deletes the "If-None-Match:" HTTP client header.
-#
-# +crunch-server-header{string}
-#    Deletes every header sent by the server that contains the string the
-#    user supplied as a parameter.
-#
-# +deanimate-gifs{last}
-# +deanimate-gifs{first}
-#    Deanimate all animated GIF images, i.e. reduce them to their last
-#    frame. This will also shrink the images considerably. (In bytes,
-#    not pixels!)
-#    If the option "first" is given, the first frame of the animation
-#    is used as the replacement. If "last" is given, the last frame of
-#    the animation is used instead, which propably makes more sense for
-#    most banner animations, but also has the risk of not showing the
-#    entire last frame (if it is only a delta to an earlier frame).
-#
-# +downgrade-http-version
-#    Downgrade HTTP/1.1 client requests to HTTP/1.0 and downgrade the
-#    responses as well. Use this action for servers that use HTTP/1.1
-#    protocol features that Privoxy currently can't handle yet.
-#
-# +fast-redirects{check-decoded-url}
-# +fast-redirects{simple-check}
-#    Many sites, like yahoo.com, don't just link to other sites.
-#    Instead, they will link to some script on their own server,
-#    giving the destination as a parameter, which will then redirect
-#    you to the final target.
-#
-#    URLs resulting from this scheme typically look like:
-#    http://some.place/some_script?http://some.where-else
-#
-#    Sometimes, there are even multiple consecutive redirects encoded
-#    in the URL. These redirections via scripts make your web browsing
-#    more traceable, since the server from which you follow such a link
-#    can see where you go to. Apart from that, valuable bandwidth and
-#    time is wasted, while your browser asks the server for one redirect
-#    after the other. Plus, it feeds the advertisers.
-#
-#    The +fast-redirects{check-decoded-url} option enables interception of
-#    these requests by Privoxy, who will cut off all but the last valid URL
-#    in the request and send a local redirect back to your browser without
-#    contacting the intermediate sites. NOTE: Syntax change as of v.3.0.4.
-#
-# +filter{name}
-#    All files of text-based type, most notably HTML and JavaScript, to which
-#    this action applies, can be filtered on-the-fly through the specified
-#    regular expression based substitutions. (Note: plain text documents are
-#    exempted from filtering, because web servers often use the text/plain
-#    MIME type for all files whose type they don't know.) By default,
-#    filtering works only on the raw document content itself (that which can
-#    be seen with View Source), not the headers. Repeat for multiple filters.
-#    Use with caution: filters can be very intrusive.
-#
-#    Filters predefined in the supplied default.filter include:
-#
-#     js-annoyances:       Get rid of particularly annoying JavaScript abuse.
-#     js-events:           Kill all JS event bindings and timers (Radically destructive! Only for extra nasty sites).
-#     html-annoyances:     Get rid of particularly annoying HTML abuse.
-#     content-cookies:     Kill cookies that come in the HTML or JS content.
-#     refresh-tags:        Kill automatic refresh tags (for dial-on-demand setups).
-#     unsolicited-popups:  Disable only unsolicited pop-up windows.
-#     all-popups:          Kill all popups in JavaScript and HTML.
-#     img-reorder:         Reorder attributes in <img> tags to make the banners-by-* filters more effective.
-#     banners-by-size:     Kill banners by size.
-#     banners-by-link:     Kill banners by their links to known clicktrackers.
-#     webbugs:             Squish WebBugs (1x1 invisible GIFs used for user tracking).
-#     tiny-textforms:      Extend those tiny textareas up to 40x80 and kill the hard wrap.
-#     jumping-windows:     Prevent windows from resizing and moving themselves.
-#     frameset-borders:    Give frames a border and make them resizable.
-#     demoronizer:         Fix MS's non-standard use of standard charsets.
-#     shockwave-flash:     Kill embedded Shockwave Flash objects.
-#     quicktime-kioskmode: Make Quicktime movies saveable.
-#     fun:                 Text replacements for subversive browsing fun!
-#     crude-parental:      Crude parental filtering. Note that this filter doesn't work reliably.
-#     ie-exploits:         Disable some known Internet Explorer bug exploits.
-#     site-specifics:      Cure for site-specific problems. Don't apply generally!
-#     no-ping:             Removes non-standard ping attributes in <a> and <area> tags.
-#     google:              CSS-based block for Google text ads. Also removes a width limitation and the toolbar advertisement.
-#     yahoo:               CSS-based block for Yahoo text ads. Also removes a width limitation.
-#     msn:                 CSS-based block for MSN text ads. Also removes tracking URLs and a width limitation.
-#     blogspot:            Cleans up some Blogspot blogs. Read the fine print before using this.
-#
-# +force-text-mode
-#    Declares a document as plain text, even if the "Content-Type:" isn't detected
-#    as such.
-#
-# +forward-override{forward .}
-# +forward-override{forward 127.0.0.1:8123}
-# +forward-override{forward-socks4a 127.0.0.1:9050 .}
-# +forward-override{forward-socks4a 127.0.0.1:9050 proxy.example.org:8000}
-# +forward-override{forward-socks5 127.0.0.1:9050 .}
-# +forward-override{forward-socks5 127.0.0.1:9050 proxy.example.org:8000}
-#   This action overrules the forward directives in the configuration file.
-#
-# +handle-as-empty-document
-#   This action alone doesn't do anything noticeable. It just marks URLs. If
-#   the block action also applies, the presence or absence of this mark
-#   decides whether an HTML "blocked"  page, or an empty document will be sent
-#   to the client as a substitute for the blocked content.
-#
-# +handle-as-image
-#    Treat this URL as an image.  This only matters if it's also "+block"ed,
-#    in which case a "blocked" image can be sent rather than a HTML page.
-#    See +set-image-blocker{} for the control over what is actually sent.
-#
-# +hide-accept-language{lang}
-# +hide-accept-language{block}
-#   Deletes or replaces the "Accept-Language:" HTTP header in client
-#   requests.
-#
-# +hide-content-disposition{block}
-# +hide-content-disposition{string}
-#   Deletes or replaces the "Content-Disposition:" HTTP header set by some
-#   servers. This can be used to prevent download menus for content you
-#   prefer to view inside the browser, for example.
-#
-# +hide-from-header{block}
-# +hide-from-header{spam at sittingduck.xqq}
-#   If the browser sends a "From:" header containing your e-mail address,
-#   either completely removes the header ("block"), or change it to the
-#   specified e-mail address.
-#
-# +hide-if-modified-since{block}
-# +hide-if-modified-since{-60}
-#   Deletes the "If-Modified-Since:" HTTP client header or modifies its
-#   value, preventing another way to track users.
-#
-# +hide-referer{block}
-# +hide-referer{forge}
-# +hide-referer{http://nowhere.com}
-#    Don't send the "Referer:" (sic) header to the web site.  You can
-#    block it, forge a URL to the same server as the request (which is
-#    preferred because some sites will not send images otherwise) or
-#    set it to a constant string.
-#
-# +hide-referrer{...}
-#    Alternative spelling of +hide-referer.  Has the same parameters,
-#    and can be freely mixed with, "+hide-referer".  ("referrer" is the
-#    correct English spelling, however the HTTP specification has a
-#    bug - it requires it to be spelt "referer").
-#
-# +hide-user-agent{browser-type}
-#    Change the "User-Agent:" header so web servers can't tell your
-#    browser type.  (Breaks many web sites).  Specify the user-agent
-#    value you want - e.g., to pretend to be using Netscape on Linux:
-#      +hide-user-agent{Mozilla (X11; I; Linux 2.0.32 i586)}
-#    Or to identify yourself explicitly as a Privoxy user:
-#      +hide-user-agent{Privoxy/1.0}
-#    (Don't change the version number from 1.0 - after all, why tell them?)
-#
-# +limit-connect{portlist}
-#
-#    By default, i.e. if no limit-connect action applies, Privoxy
-#    allows HTTP CONNECT requests to all ports. Use limit-connect
-#    if fine-grained control is desired for some or all destinations.
-#    The CONNECT methods exists in HTTP to allow access to secure websites
-#    ("https://" URLs) through proxies. It works very simply: the proxy
-#    connects to the server on the specified port, and then short-circuits
-#    its connections to the client and to the remote server. This means
-#    CONNECT-enabled proxies can be used as TCP relays very easily. Privoxy
-#    relays HTTPS traffic without seeing the decoded content. Websites can
-#    leverage this limitation to circumvent Privoxy's filters. By specifying
-#    an invalid port range you can disable HTTPS entirely.
-#
-#    +limit-connect{443}                   # Only port 443 is OK.
-#    +limit-connect{80,443}                # Ports 80 and 443 are OK.
-#    +limit-connect{-3, 7, 20-100, 500-}   # Ports less than 3, 7, 20 to 100 and above 500 are OK.
-#    +limit-connect{-}                     # All ports are OK
-#    +limit-connect{,}                     # No HTTPS/SSL traffic is allowed
-#
-# +overwrite-last-modified{block}
-# +overwrite-last-modified{reset-to-request-time}
-# +overwrite-last-modified{randomize}
-#    Removing the "Last-Modified:" header is useful for filter testing, where
-#    you want to force a real reload instead of getting status code "304",
-#    which would cause the browser to reuse the old version of the page.
-#
-#    The "randomize" option overwrites the value of the "Last-Modified:"
-#    header with a randomly chosen time between the original value and the
-#    current time. In theory the server could send each document with a
-#    different "Last-Modified:" header to track visits without using cookies.
-#    "Randomize" makes it impossible and the browser can still revalidate
-#    cached documents.
-#
-#    "reset-to-request-time" overwrites the value of the "Last-Modified:"
-#    header with the current time. You could use this option together with
-#    hide-if-modified-since to further customize your random range.
-#
-# +prevent-compression
-#    Prevent the website from compressing the data. Some websites do
-#    that, which is a problem for Privoxy when built without zlib support,
-#    since +filter and +gif-deanimate will not work on compressed data.
-#    Will slow down connections to those websites, though.
-#
-# +server-header-filter{name}
-#    All server headers to which this action applies are filtered on-the-fly
-#    through the specified regular expression based substitutions.
-#
-#    Server-header filters predefined in the supplied default.filter include:
-#
-#     x-httpd-php-to-html:   Changes the Content-Type header from x-httpd-php to html.
-#     html-to-xml:           Changes the Content-Type header from html to xml.
-#     xml-to-html:           Changes the Content-Type header from xml to html.
-#     less-download-windows: Prevent annoying download windows for content types the browser can handle itself.
-#     privoxy-control:       Removes X-Privoxy-Control headers.
-#
-# +server-header-tagger{content-type}
-#    Server headers to which this action applies are filtered on-the-fly
-#    through the specified regular expression based substitutions, the result
-#    is used as a tag. Server-header taggers are executed before all other
-#    header actions that modify server headers. Their tags can be used to
-#    control all of the other server-header actions, the content filters and
-#    the crunch actions (redirect and block).
-#
-#    Server-header taggers predefined in the supplied default.filter include:
-#
-#     content-type:    Tags the request with the content type declared by the server.
-#     privoxy-control: Creates tags with the content of X-Privoxy-Control headers.
-#
-# +session-cookies-only
-#    If the website sets cookies, make sure they are erased when you exit
-#    and restart your web browser.  This makes profiling cookies useless,
-#    but won't break sites which require cookies so that you can log in
-#    or for transactions.
-#
-# +set-image-blocker{blank}
-# +set-image-blocker{pattern}
-# +set-image-blocker{<URL>} with <url> being any valid image URL
-#    Decides what to do with URLs that end up tagged with {+block +handle-as-image}.
-#    There are 4 options:
-#      * "-set-image-blocker" will send a HTML "blocked" page, usually
-#         resulting in a "broken image" icon.
-#      * "+set-image-blocker{blank}" will send a 1x1 transparent image
-#      * "+set-image-blocker{pattern}" will send a 4x4 grey/white pattern
-#        which is less intrusive than the logo but easier to recognize
-#        than the transparent one.
-#      * "+set-image-blocker{<URL>}" will send a HTTP temporary redirect
-#        to the specified image URL.
-#
-#
-# +crunch-outgoing-cookies
-#    Prevent the website from reading cookies
-#
-# +crunch-incoming-cookies
-#    Prevent the website from setting cookies
-#
-# +redirect{<URL>}
-# +redirect{<pcrs command>}
-#    Convinces the browser that the requested document has been moved to
-#    another location and the browser should get it from the specified
-#    URL.
-#
-#############################################################################
-
-#############################################################################
-# Settings -- Don't change.
-#############################################################################
-{{settings}}
-#############################################################################
-#MASTER# COMMENT: The minimum Privoxy version:
-for-privoxy-version=3.0.11
-
-#############################################################################
-# Aliases
-#############################################################################
-{{alias}}
-#############################################################################
-#
-# You can define a short form for a list of permissions - e.g., instead
-# of "-crunch-incoming-cookies -crunch-outgoing-cookies -filter -fast-redirects",
-# you can just write "shop". This is called an alias.
-#
-# Currently, an alias can contain any character except space, tab, '=', '{'
-# or '}'.
-# But please use only 'a'-'z', '0'-'9', '+', and '-'.
-#
-# Alias names are not case sensitive.
-#
-# Aliases beginning with '+' or '-' may be used for system action names
-# in future releases - so try to avoid alias names like this.  (e.g.
-# "+crunch-all-cookies" below is not a good name)
-#
-# Aliases must be defined before they are used.
-#
-
-# These aliases just save typing later:
-#
-+crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
--crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
- allow-all-cookies  = -crunch-all-cookies -session-cookies-only
- allow-popups       = -filter{all-popups} -filter{unsolicited-popups}
-+block-as-image     = +block{Blocked image request.} +handle-as-image
--block-as-image     = -block
-
-# These aliases define combinations of actions
-# that are useful for certain types of sites:
-#
-fragile     = -block -crunch-all-cookies -filter -fast-redirects -hide-referer -prevent-compression
-shop        = -crunch-all-cookies allow-popups
-
-# Your favourite blend of filters:
-#
-myfilters   = +filter{html-annoyances} +filter{js-annoyances} +filter{all-popups}\
-              +filter{webbugs} +filter{banners-by-size}
-
-# Allow ads for selected useful free sites:
-#
-allow-ads   = -block -filter{banners-by-size} -filter{banners-by-link}
-
-################
-#
-# Cautious settings -- safe for all sites, but offer little privacy protection
-#
-{ \
-+change-x-forwarded-for{block} \
-+hide-from-header{block} \
-+set-image-blocker{pattern} \
-}
-standard.Cautious
-
-################
-#
-# Medium settings -- safe for most sites, with reasonable protection/damage tradeoff
-#
-{ \
-+change-x-forwarded-for{block} \
-+deanimate-gifs{last} \
-+filter{refresh-tags} \
-+filter{img-reorder} \
-+filter{banners-by-size} \
-+filter{webbugs} \
-+filter{jumping-windows} \
-+filter{ie-exploits} \
-+hide-from-header{block} \
-+hide-referrer{conditional-block} \
-+session-cookies-only \
-+set-image-blocker{pattern} \
-}
-standard.Medium
-
-################
-#
-# Advanced settings -- reasonable privacy protection but
-# require some exceptions for trusted sites, most likely
-# because of cookies or SSL. Also testing ground for
-# new options.
-#
-# CAUTION: These settings can still be subverted by a
-# misconfigured client that executes code from untrusted
-# sources.
-#
-{ \
-+change-x-forwarded-for{block} \
-+client-header-tagger{css-requests} \
-+client-header-tagger{image-requests} \
-+crunch-if-none-match \
-+crunch-outgoing-cookies \
-+crunch-incoming-cookies \
-+deanimate-gifs{last} \
-+fast-redirects{check-decoded-url} \
-+filter{html-annoyances} \
-+filter{content-cookies} \
-+filter{refresh-tags} \
-+filter{img-reorder} \
-+filter{banners-by-size} \
-+filter{banners-by-link} \
-+filter{webbugs} \
-+filter{jumping-windows} \
-+filter{frameset-borders} \
-+filter{quicktime-kioskmode} \
-+hide-if-modified-since{-60} \
-+hide-from-header{block} \
-+hide-referrer{conditional-block} \
-+limit-connect{,} \
-+overwrite-last-modified{randomize} \
-+set-image-blocker{pattern} \
-}
-standard.Advanced
-
-#############################################################################
-# These extensions belong to images:
-#############################################################################
-{+handle-as-image -filter}
-#############################################################################
-/.*\.(gif|jpe?g|png|bmp|ico)($|\?)
-
-#############################################################################
-# These don't:
-#############################################################################
-{-handle-as-image}
-/.*\.(js|php|css|.?html?)
-
-#############################################################################
-# Generic block patterns by host:
-#############################################################################
-{+block{Host matches generic block pattern.}}
-ad*.
-.*ads.
-#MASTER# REMARKS: removed .ad. 2007-12-18 HB
-#MASTER# REMARKS: Modifications per Actionsfile feedback item #1807613
-.ad.?.
-.ad.[a-ik-z][a-oq-z].
-.ad.jp.*.
-.ad.???*.
-# Blocked URL = http://alternativos.iw-advertising.com/
-.*advert*.
-*banner*.
-count*.
-*counter.
-#MASTER# PROBLEM URL: http://www.newegg.com
-promotions.
-#MASTER# BLOCK-REFERRER: http://tech.cybernetnews.com/
-# Blocked URL = http://metrics.performancing.com/
-metrics.
-
-#############################################################################
-# Generic unblockers by host:
-#############################################################################
-{-block}
-adsl.
-ad[udmw]*.
-adbl*.
-adam*.
-adapt*.
-adob*.
-adrenaline.
-adtp*.
-adv[oia]*.
-adventure*.
-.*road*.
-.olympiad*.
-.*load*.
-.*[epu]ad*.
-county*.
-countr*.
-
-#############################################################################
-# Generic block patterns by path:
-#############################################################################
-{+block{Path matches generic block pattern.}}
-/(.*/)?ad(\?|/|s|v|_?(image|se?rv|box)|cycle|rotate|mentor|click|f[ra]m|script|stream|fetch|log|space)
-# Blocked URL = http://www.example.org/adimage
-# Blocked URL = http://www.example.org/adspace
-/phpads(new)?/
-/(.*/)?(ad|all|nn|db|promo(tion)?)?[-_]?banner
-/(.*/)?(publicite|werbung|rekla(me|am)|annonse|maino(kset|nta|s)?/)
-/.*(count|track|compteur|(?<!relo)adframe|adse?rve?|banner)(er|run)?(\?|\.(pl|cgi|exe|dll|asp|php|cpt))
-/(.*/)?clicktrack
-/(.*/)?(full)?pop[-_]?(up|over|under|open(er)?)?s?(/|\.)
-/(.*/)?((flash)?pop|live(cnt|count(er)?)).*\.(js|php|cgi)
-
-#############################################################################
-# Generic unblockers by path:
-#############################################################################
-{-block}
-# Sticky Actions = -block
-/.*ad(sl|v(i[cs]|o|an|ertencia|ent|.*search|erse)) # advice/advisories/advan*/advertencia (spanish) adverse
-/.*(lo|thre|he|d|gr|l|ro|re|squ|class(ified)?)ads
-/.*account
-support./(.*/)?track
-
-#############################################################################
-# Exceptions for academia and non-profits
-#############################################################################
-.edu
-.ac.*/
-.uni-*.de
-.tu-*.de
-.gov
-.hs-*.de
-.fh-*.de
-#MASTER# REMARKS: Try to avoid harmless names in non-commercial organizations. Added 10/24/06
-# URL = http://www.gnu.org/graphics/gnu-head-banner.png
-.org/.*(image|banner)
-
-#############################################################################
-# Catch-all for false-positives that are just TOO obvious to let go
-#############################################################################
-{+block{Catch-all block for false-positives.}}
-#MASTER# REMARKS: Going for adsrv, adserve, adserver*.
-.ads[erv][rv]*.
-# Blocked URL = http://ads.facebook.com/ads/spreadshirt/banner120x600.jpg
-.ads.
-/(.*/)?ad(se?rv|click|stream|image|log|farm|script)
-# Blocked URL = http://www.torrentportal.com/topad.html
-#MASTER# REMARKS: Action tracker 1637648 and a bit of imagination. Added 2007-01-20.
-#MASTER# REMARKS: Added "text" 20070730 as per http://www.pcworld.com/textad?Keywords=System Resources Tune-Up.&type=pcworld_downloads_search&count=3&ord=906010128&serveUrl=http%3A%2F%2Fwww.pcworld.com%2Fdownloads%2Ffile%2Ffid%2C7661-order%2C1-page%2C1-c%2Csystemresourcestuneup%2Fdescription.html Adam Piggott
-/.*(top|bottom|left|right|text)_?ad
-
-#############################################################################
-# Site-specific block patterns;
-#############################################################################
-{+block{Domain parking site}}
-#MASTER# BLOCK-REFERRER: http://www.inetcat.org
-# Blocked URL = http://www.sedoparking.com/www.inetcat.org
-.sedoparking.com/
-# Blocked URL = http://landing.trafficz.com/index.php?domain=www.inetcat.org
-landing.trafficz.com/
-# Blocked URL = http://www.searchnut.com/?domain=www.inetcat.org
-.searchnut.com/\?domain
-
-{+block{Site-specific block pattern matches.}}
-#MASTER# BLOCK-REFERRER: http://www.brooksbrothers.com/ 10/18/06
-#MASTER# BLOCK-REFERRER: http://www.autodesk.com/
-# Blocked URL = http://www.hitbox.com/foobar
-.hitbox.com
-#MASTER# BLOCK-REFERRER: http://www.the-gadgeteer.com/palmos.html 10/18/06
-# Blocked URL = http://www..the-gadgeteer.com/cgi-bin/getimage.cgi/
-.the-gadgeteer.com/cgi-bin/getimage.cgi/
-#MASTER# BLOCK-REFERRER: http://dest.travelocity.com/DestGuides/geo_frontdoor/0,,TRAVELOCITY,00.html?HPTRACK=icon_dest
-# Blocked URL = http://dest.travelocity.com/website/destinations/images/partner_frommers.gif
-# Blocked URL = http://dest.travelocity.com/website/destinations/images/travelex_logo.gif
-dest.travelocity.com/website/destinations/images/partner_frommers.gif
-dest.travelocity.com/website/destinations/images/travelex_logo.gif
-#MASTER# BLOCK-REFERRER: http://us.imdb.com/Title?0110912 10/18/06
-#MASTER# BLOCK-REFERRER: http://www.imdb.com/help/boards/markup
-#MASTER# REMARKS: 2nd is for emoticons exception
-i.imdb.com/Photos/CMSIcons/(?!buttons|emoticons)
-rcm.amazon.com
-#MASTER# BLOCK-REFERRER: http://www.nytimes.com/ 10/18/06
-# Blocked URL = http://www.nytimes.com/adx/foo
-.nytimes.com/adx/
-#MASTER# BLOCK-REFERRER: http://www.sharereactor.com/ 10/19/06
-#MASTER# BLOCK-REFERRER: http://www.popupad.net/
-#www.popupad.net/ats/
-.adtrak.net
-.elitemediagroup.net
-.popuptraffic.com
-#MASTER# BLOCK-REFERRER: http://www.famousbabes.com/gabrielleR/grpics1.htm 10/19/06
-#MASTER# BLOCK-REFERRER: http://www.hit-now.com/
-.hit-now.com
-#MASTER# BLOCK-REFERRER: http://www.pgpi.org/ 10/18/06
-[a-v]*.valueclick.com
-#MASTER# BLOCK-REFERRER: http://astalavista.box.sk/
-#MASTER# REMARKS: Yea, all these at one site! 10/19/06
-.cpays.com
-.oxado.com
-.adult*finder.com
-#MASTER# DONT-VERIFY: Opera's list of banners to load (XML)
-/scripts/cms/xcms.asp
-#MASTER# REMARKS: Actionsfile tracker 1559740 09/16/06 See http://www.vibrantmedia.com/whatisIntelliTXT.asp
-#MASTER# BLOCK-REFERRER: http://www.hartware.de/news_40795.html
-/.*intellitxt/
-.intellitxt.com
-#MASTER# REMARKS: per Actions File tracker: #1597893 11/17/06, similar to intellitxt
-.kontera.com
-#MASTER# REMARKS: 2007-08-17 HB, similar to intellitxt
-#MASTER# BLOCK-REFERRER: http://www.webhostingtalk.com/archive/index.php/t-533369.html
-.tribalfusion.com/ctxt
-#MASTER# REMARKS: Video advertizer, owned by doubleclick.net.
-#MASTER# BLOCK-REFERRER: http://www.ign.com/ 09/17/06
-.klipmart.com
-#MASTER# BLOCK-REFERRER: http://gamespot.com 09/26/06
-#MASTER# REMARKS: adlog.com.com and ads.com.com
-ad*.com.com
-#MASTER# REMARKS: used in redirects: dw.com.com 12/18/06
-#MASTER# BLOCK-REFERRER: http://verizon.net 09/29/06
-sales.liveperson.net
-#MASTER# BLOCK-REFERRER: www.avclub.com/ 10/14/06
-.iad.liveperson.net
-#MASTER# BLOCK-REFERRER: http://homedepot.com 09/29/06
-#MASTER# BLOCK-REFERRER: http://weather.com 11/03/06
-.coremetrics.com/
-#MASTER# BLOCK-REFERRER: http://wired.com 09/29/06
-.realmedia.com/data/
-#MASTER# REMARKS: webbugs, ads and user tracking js in many places.
-#MASTER# BLOCK-REFERRER: http://washingtonpost.com & http://tomshardware.com 09/29/06
-.revsci.net
-#MASTER# BLOCK-REFERRER: http://www.time.com/time/business/article/0,8599,1073341,00.html 09/29/06
-.clickability.com
-/.*clickability(.com)?/
-#MASTER# BLOCK-REFERRER: http://washingtonpost.com 09/29/06
-stats.*.ihost.com
-#MASTER# BLOCK-REFERRER: http://msnbc.com and many others 09/29/06
-.2o7.net
-#MASTER# BLOCK-REFERRER: http://microsoft.com 09/29/06
-.webtrends.com
-#MASTER# BLOCK-REFERRER: http://tomshardware.com 09/29/06
-.tacoda.
-#MASTER# BLOCK-REFERRER: http://www.torrentazos.com 10/04/06
-ad.theadhost.com
-#MASTER# BLOCK-REFERRER: http://www.stuff.co.nz 10/06/06
-.adbureau.net
-#MASTER# BLOCK-REFERRER: http://drudgereport.com 10/06/06
-.adgardener.com
-#MASTER# BLOCK-REFERRER: http://www.connected-media.com/riven/hints.htm 10/14/06
-#MASTER# REMARKS: ads.kw.revenue.net/? etc
-.revenue.net
-#MASTER# BLOCK-REFERRER: http://www.geocities.com/the_sockman1/index.html 10/15/06
-#MASTER# REMARKS: ..and any other page on geocities. Source of the obnoxious Geocities drop-in menu.
-.geocities.com/js_source
-#MASTER# BLOCK-REFERRER: http://www.google.com 09/28/06
-.dartsearch.net
-#MASTER# BLOCK-REFERRER: http://wunderground.com 11/02/06
-.zedo.com
-#MASTER# BLOCK-REFERRER: http://realtor.org 11/03/06
-.trk.sodoit.com/
-#MASTER# BLOCK-REFERRER: http://www.freenews.fr 11/23/06 Actionsfile feedback item #1597034
-.espace.netavenir.com
-#MASTER# BLOCK-REFERRER: http://www.powerdvd.com/ 12/28/06
-.hitfarm.com
-#MASTER# BLOCK-REFERRER: http://www.uk-businessdirectory.co.uk/
-#MASTER# REMARKS: Action tracker 1616457. Added 2007-01-20.
-.topnemo.com/engine
-.top100categories.com/engine
-#MASTER# REMARKS: Actionsfile feedback item #1647852 2007-01-30
-#MASTER# REMARKS: Domain squatting onload pop-ups
-#MASTER# BLOCK-REFERRER: http://www.memtest.com/
-/(t|search)\.php\?uid=ws[a-z0-9]+\.[a-z0-9]+
-#MASTER# BLOCK-REFERRER: via Yahoo groups
-#MASTER# REMARKS: Actionsfile tracker 1645513 2007-01-26
-.adinterax.com/(?!(.*)\.(js|gif|jpg))
-#MASTER# BLOCK-REFERRER:  http://www.weilpod.com
-#MASTER# REMARKS: Actionsfile feedback item #1710951 2007-05-02
-img.bluehost.com
-#MASTER# BLOCK-REFERRER: http://www.linuxinsider.com/story/57759.html
-#MASTER# REMARKS: Actionsfile feedback item #1736213 at 2007-06-12
-linuxinsider.com/images/sda/
-#MASTER# REMARKS: 20070711 Adam Piggott Actionsfile feedback #1700692
-#MASTER# REMARKS: Tracking JavaScript
-#MASTER# BLOCK-REFERRER: http://www.hants.gov.uk/record-office/
-[a-z].clickdensity.com
-#MASTER# REMARKS: Obnoxious "widget" adverts
-#MASTER# BLOCK-REFERRER: http://www.quickonlinetips.com/archives/2007/08/nokia-offers-free-bl-5c-battery-replacement-for-overheating/
-.widgetbucks.com
-#MASTER# BLOCK-REFERRER: http://www.dailymail.co.uk/pages/live/articles/news/news.html?in_article_id=559547&in_page_id=1770
-# Blocked URL = http://img.dailymail.co.uk/i/promo_boxes/groTime_promo.jpg
-# Blocked URL = http://img.dailymail.co.uk/i/promo_boxes/idealhome_promo.gif
-img.dailymail.co.uk/i/promo_boxes/
-#MASTER# REMARKS: Flash ad, Actionsfile feedback item #2003465 2008-07-01
-# Blocked URL = http://cache.opt.fimserve.com/contents/325/84/84325/LIN728x90.swf?%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20clickTag=http%3A//delb.opt.fimserve.com/lnk/%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Fk%3DODk1ODc7Mzs0MDA7ODQzMjU7Zi44LjkuaHYuaGdseHBzbG9uaCBvem0uNzYuZkBAeHp5b3ZAQGxobmxAQCs4XzlAQHhsbnN2biBoZHZ3dm1AQGh2QEBmOzEyMTQ1MTE1MjgzMzA7Mjs7MTMxfDsxOzQ7NzIxODs4ODAyODc3NQ%3D%3Dhref%3Dhttp%3A//www.myspace.com/liveinnordics&clickTarget=_new
-.fimserve.com
-#MASTER# REMARKS: Actionsfile feedback item #2004311 2008-07-01, are they all images?
-# Blocked URL = http://static.lycos-europe.net/lea/se/pricerunner/040608_728x90_payback_digitalkamer.gif
-static.lycos-europe.net
-#MASTER# REMARKS: Actionsfile feedback item #2005285
-#MASTER# BLOCK-REFERRER: http://hitta.se
-# Blocked URL = http://82.99.18.195/media.1/112/9460/146016/150x175_Hitta_FV_Feb08.gif
-82.99.18.195
-#MASTER# REMARKS: Actionsfile feedback item #1888197  2008-02-06
-#MASTER# REMARKS: Have a "go there anyway" link for clk.atdmt.com
-#MASTER# BLOCK-REFERRER: http://www.networkworld.com/resourcelibrary/?tid=4&type=special%20report
-# Blocked URL = http://clk.atdmt.com/
-.atdmt.com/
-
-#----------------------------------------------------------------------------
-# Misc Web-bugs, JS and just plain Junk. Images here aren't normal images.
-#----------------------------------------------------------------------------
-{+block{Might be a web-bug.} +handle-as-empty-document -handle-as-image}
-#MASTER# REMARKS: signature for user tracking nytimes, cnn.com,latimes.com and many others. 10/06/06
-/b/ss/.+
-#MASTER# BLOCK-REFERRER: http://www.thesun.co.uk/article/0,,11071-10784,00.html
-#MASTER# REMARKS: widespread hitbox signature 10/06/06
-/HG\?hc=
-#MASTER# BLOCK-REFERRER: http://macaddict.com 10/06/06
-.visistat.com
-#MASTER# REMARKS: See <http://www.google.com/analytics/> for user tracking.
-#MASTER# REMARKS: There is a ssl.google-analytics as well.
-.google-analytics./
-#MASTER# BLOCK-REFERRER: http://versiontracker.com and many others. 10/20/06
-/(.*/)?__utm.gif\?
-#MASTER# REMARKS: Below Moved here from -handle-as-image 10/16/06 ##########
-#MASTER# BLOCK-REFERRER: http://forums2.gardenweb.com/forums/orchids/ 09/25/06
-#MASTER# REMARKS: Mostly JS and plain text stuff
-.overture.
-#MASTER# PROBLEM-URL: http://www.linuxtoday.com/
-#MASTER# REMARKS: /adi has HTML snipplets for use in IFRAMEs 10/15/06
-.doubleclick.net/adi
-.doubleclick.net/(.*/)?adj/
-#MASTER# PROBLEM-URL: http://maps.yahoo.com/
-#MASTER# REMARKS: /AVE/iview has HTML snipplets for use in IFRAMEs 10/15/06
-view.atdmt.com/(.*/)?iview/
-#MASTER# REMARKS: Above Moved here from -handle-as-image 10/16/06 ##########
-#MASTER# REMARKS: Generic, re: tracking.foxnews.com/HG? 10/01/06
-tracking.
-#MASTER# BLOCK-REFERRER: http://netcraft.com and many others 10/22/06
-/(.*/)?adjs\.php\?
-#MASTER# BLOCK-REFERRER: http://washingpost.com and others 10/25/06
-/.*\.gif\?D=DM
-#MASTER# BLOCK-REFERRER: http://www.washingtonpost.com/
-#stats.surfaid.ihost.com/(crc/)?images/(bounce/)?uc.GIF
-#MASTER# BLOCK-REFERRER: http://www.ibm.com 10/09/06
-#MASTER# REMARKS: Similar hostname and paths appear in multiple locations.
-# Blocked URL = http://stats.surfaid.ihost.com/crc/images/bounce/uc.GIF
-# Blocked URL = http://stats.surfaid.ihost.com/rc/images/bounce/uc.GIF
-stats./c?rc/.*/uc.gif
-#MASTER# BLOCK-REFERRER: http://priceline.com 10/20/06
-#MASTER# REMARKS: User tracking, webbug stuff
-/(.*/)?dcs.gif\?&?dcs
-#MASTER# BLOCK-REFERRER: http://www.msnbc.com 10/07/06
-#MASTER# REMARKS: And MANY others. Webbug stuff.
-/(.*/)?c(lear)?\.gif\?.
-#MASTER# BLOCK-REFERRER: http://www.investorguide.com 10/08/06
-#MASTER# BLOCK-REFERRER: http://foodnetwork.com, http://gardenweb.com 10/20/06
-#MASTER# REMARK: webbug type gif used in MANY places.
-#MASTER# REMARK: Too many false positives
-#/(.*/)?(clear|(trans_?1x|blank)?1).gif
-#MASTER# REMARK: Let's try this way.
-/(.*/)?(clear|blank|(trans_?|1x)?1).gif\?.
-#MASTER# BLOCK-REFERRER: http://groups.yahoo.com/group/epdf/ 10/08/06
-.bc.yahoo.com/b\?P=
-#MASTER# BLOCK-REFERRER: http://www.motherboard.cz 10/30/06
-x*.alexa.com
-#MASTER# BLOCK-REFERRER: http://actorstheatre.org 11/02/06
-stats./.*\.gif\?
-#MASTER# BLOCK-REFERRER: http://mplayernetwork.com 11/07/06
-#MASTER# BLOCK-REFERRER: http://eetimes.com 09/26/06
-/event.ng/
-#MASTER# BLOCK-REFERRER: http://www.homedepot.com/ 11/08/06
-#MASTER# BLOCK-REFERRER: http://www.williams-sonoma.com/ 11/08/06
-/cm\?[tc]
-#MASTER# BLOCK-REFERRER: http://www.snapfiles.com/feedback/ 12/13/06 SF tracker
-.snapfiles.net/rotation/.*\.asp
-#MASTER# BLOCK-REFERRER: not provided. SF tracker #1616034 12/16/06
-#MASTER# COMMENT: JS pop-ups
-spa.snap.com/
-#MASTER# BLOCK-REFERRER: http://www.gamefaqs.com/computer/doswin/game/914819.html 12/18/06
-#MASTER# COMMENT: user tracking, and run-away assorted 'junk'
-#MASTER# BLOCK-REFERRER: http://formwood.com 2007-11-12
-.insitemetrics.com/
-#MASTER# COMMENT: user tracking, and assorted 'junk'
-#MASTER# BLOCK-REFERRER: http://blogblog.com 2007-11-12
-.extreme-dm.com/
-#MASTER# COMMENT: user tracking, and assorted 'junk'
-#MASTER# BLOCK-REFERRER: http://www.schillmania.com 2007-11-12
-stats.reinvigorate.net/
-#MASTER# COMMENT: user tracking, and assorted 'junk'
-#MASTER# BLOCK-REFERRER: http://wordpress.com 2007-11-12
-.getclicky.com/
-#MASTER# COMMENT: user tracking, and assorted 'junk'
-#MASTER# BLOCK-REFERRER: http://infoworld.com 2007-11-12
-.quantserve.com
-# Blocked URL = http://media.adrevolver.com/adrevolver/trace?sip=123&cpy=123
-media.adrevolver.com/
-
-#----------------------------------------------------------------------------
-# JavaScripts and Texts for ad and popup generation
-#----------------------------------------------------------------------------
-#MASTER# BLOCK-REFERRER: http://www.chip.de/artikel/c_artikelunterseite_10423683.html
-# Blocked URL = http://pagead.googlesyndication.example.com/foo/bar/baz.js
-pagead*.googlesyndication./.*\.js
-#MASTER# REMARKS: broadening scope from a.tfag.de/js.ng/ 10/23/06
-# Blocked URL = http://a.tfag.de/js.ng/
-/js\.ng/
-#MASTER# BLOCK-REFERRER: http://www.britannica.com/ 10/23/06
-/popunder
-#MASTER# BLOCK-REFERRER: http://www.pcmag.com/ 11/22/06 per SF Tracker # 1601148
-/js/slider\.js
-#MASTER# BLOCK-REFERRER: http://www.earthcore.com/ feedback item #1605385 12/14/06
-/t\.php\?cat=.*&kw=.*&sc=
-#MASTER# BLOCK-REFERRER: http://floodle.net 2007-01-21 SF tracker
-scripts.chitika.net/.*\.js
-#MASTER# REMARKS: Actionsfile tracker #1674363 2007-03-05, text ads
-#MASTER# BLOCK-REFERRER: http://www.securityfocus.com/archive/1/461489/30/0/threaded
-jlinks.industrybrains.com/
-#MASTER# BLOCK-REFERRER: via Yahoo groups
-#MASTER# REMARKS: Actionsfile tracker 1645513 2007-01-26
-.adinterax.com/.*\.js
-#MASTER# BLOCK-REFERRER: http://dictionary.reference.com/search?q=privacy&db=*
-#MASTER# REMARKS: Actionsfile tracker 1650798 2007-02-02
-.googleadservices.com/gampad/.*\.js
-#MASTER# BLOCK-REFERRER: http://www.linuxworld.com/news/2007/061307-brian-aker-interview.html
-#MASTER# REMARKS: Actionsfile feedback item #1736794 2007-06-13
-js.adsonar.
-#MASTER# BLOCK-REFERRER: http://news.zdnet.co.uk/software/0,1000000121,39209666,00.htm
-#MASTER# REMARKS: Actionsfile feedback item #1736879 2007-06-13, sponsored links. 2007-08-02, more hosts using this scheme, broadening scope.
-#bwp.zdnet.
-bwp.
-# Blocked URL = http://us.mc123.mail.yahoo.com/mc/stampNonJs
-.yahoo.com/mc/stampNonJs
-# Blocked URL = http://richmedia.yimg.com/js/123/personnals_banners/PER_happy_sara1_4_425x600/ad.js?q=123
-/.*/ad\.js\?
-# Blocked URL = http://ad.yieldmanager.com/st?ad_type=iframe&ad_size=728x90&site=123&section_code=123
-/.*\?ad_(type|size)=
-
-#############################################################################
-# Generic block-as-image patterns:
-#############################################################################
-{+block-as-image}
-# XXX: Should use "+block{Blocked image request.}", but Privoxy-Regression-Test
-# isn't smart enough to split that properly.
-# Sticky Actions = +block +handle-as-image
-#MASTER# BLOCK-REFERRER: http://experts-exchange.com/os2gen/
-/.*ad_?image\.(php|cgi)
-#MASTER# BLOCK-REFERRER: http://flashhentai.com/Tgp/28-09-2002/index4.html
-#MASTER# BLOCK-REFERRER: http://www.thughosting.com/www/ixix/a912/912s2.html
-#MASTER# BLOCK-REFERRER: http://www.fantasiegirl.com/cumshots/3/spunkpatrolgirl302.htm
-#MASTER# BLOCK-REFERRER: http://www.asianuncut.com/asian2/sep5628.html
-#MASTER# BLOCK-REFERRER: http://www.tatgirls.com/gals/redhot-2/kitty-carl/lb10.html
-#MASTER# BLOCK-REFERRER: http://www.cream-porn.com/1/hard/29/02.html
-/.*recips?/
-#MASTER# BLOCK-REFERRER: http://www.paroles.net/texte/10818
-/bandeaux/
-#MASTER# COMMENT: SF tracker 09/15/06
-/.*client_?ad\.(php|cgi)
-#MASTER# COMMENT: SF tracker 09/15/06
-/.*AIM_UAC.adp
-#MASTER# BLOCK-REFERRER: http://www.wunderground.com/ 2007-01-20
-#MASTER# COMMENT: banner at top of page http://server2.as5000.com/AS5000/adserver/click?ID=ADST-00015&C=0&T=1169332403
-/(.*/)?adserver/image
-#MASTER# COMMENT: Also from wunderground.com: http://icons-aa.wunderground.com/ads/images/TripAdvisor-Blinky.gif 2007-01-20
-# Blocked URL = http://icons-aa.wunderground.com/ads/images/TripAdvisor-Blinky.gif
-# URL = http://icons-aa.wunderground.com/ads/images/TripAdvisor-Blinky.gif
-/(.*/)?ads/images/
-
-#############################################################################
-# Site-specific block-as-image patterns:
-#############################################################################
-#----------------------------------------------------------------------------
-# Banner farms:
-#----------------------------------------------------------------------------
-#MASTER# BLOCK-REFERRER: http://www.cnn.com/
-#MASTER# BLOCK-REFERRER: http://www.aol.com/
-#MASTER# COMMENT: There are at least ar.atwola and pr.atwola. 10/01/06
-# Blocked URL = http://ar.atwola.com/
-# Blocked URL = http://pr.atwola.com/
-?r.atwola.com
-#MASTER# BLOCK-REFERRER: http://www.altavista.com/
-#MASTER# BLOCK-REFERRER: http://www.tecchannel.de/
-#MASTER# BLOCK-REFERRER: http://www.whowhere.lycos.com/
-#MASTER# REMARKS: Do NOT block /adj or /adi here since these are typically JS
-.[a-vx-z]*.doubleclick.net/(?!(.*/)?ad[ji])
-#MASTER# BLOCK-REFERRER: http://www.joecartoon.com/  10/17/06
-.*servedby.advertising.com
-#MASTER# BLOCK-REFERRER: http://www.yahoo.com/
-#.a.yimg.com/(?:(?!/i/).)*$
-#.a[0-9].yimg.com/(?:(?!/i/).)*$
-#.yimg.com/(.*/)?a/
-#.yimg.com/.*/(flash|java)/promotions
-#.yimg.com/a/.*/flash/
-#MASTER# REMARKS: The above replaced with below. Actions file tracker #1645616 2007-01-27
-.yimg.com/.*\.yimg\.com/a/
-bs*.gsanet.com
-bs*.einets.com
-.qkimg.net
-#MASTER# BLOCK-REFERRER: http://salon.com/ 10/19/06
-#MASTER# BLOCK-REFERRER: http://maps.yahoo.com/
-#MASTER# REMARKS: Banner farms; just exclude their corp. info
-#MASTER# REMARKS: and have a "go there anyway" link for clk.atdmt.com
-#MASTER# REMARKS:   (Actionsfile feedback item #1888197)
-[abd-vx-z]*.atdmt.com/
-#MASTER# BLOCK-REFERRER: http://www.exactaudiocopy.de/ 09/11/06
-#MASTER# BLOCK-REFERRER: http://stanford.facebook.com/home.php
-# URL = http://www.fastclick.net/
-.fastclick.net
-#MASTER# BLOCK-REFERRER: http://www.math.com/school/subject2/lessons/S2U3L6DP.html 09/11/06
-.casalemedia.com
-#MASTER# BLOCK-REFERRER: http://www.macnn.com/ 10/09/06
-kermit.macnn.com/
-#MASTER# BLOCK-REFERRER: http://www.globalseeker.com/freesamples/ 10/09/06
-quinst.com/images
-valuepage.com/images
-#MASTER# BLOCK-REFERRER: http://www.imdb.com/
-ia.imdb.com/.*\.swf
-#MASTER# BLOCK-REFERRER: http://www.dietngo.com/ 10/09/06
-.reactivpub.
-#MASTER# BLOCK-REFERRER: http://freemail.web.de/  10/17/06
-#MASTER# BLOCK-REFERRER: http://www.nytimes.com/2003/11/19/politics/19DEAN.html?ex=1069822800&en=dc82dfff0502faeb&ei=5062&partner=GOOGLE
-.as*.falkag.
-#MASTER# BLOCK-REFERRER: http://www.macnn.com/news/18944 10/17/06
-a.tribalfusion.com/
-#MASTER# BLOCK-REFERRER: http://reviews.infosyncworld.com/palmos/featured/index.html?start=1&offset=10 10/19/06
-.adserver.com/
-#MASTER# BLOCK-REFERRER: http://computers.cnet.com/hardware/0-1027-404-20857400.html?tag=rev
-#MASTER# REMARKS: Pointdexter
-.ru4.com/
-#MASTER# BLOCK-REFERRER: http://www.boursorama.com/infos/actualites/detail_actu_marches.phtml?news=1510287
-www.smartadserver.com/
-#MASTER# BLOCK-REFERRER: http://www.chez.tiscali.fr/ 10/07/06
-admedia.
-#MASTER# REMARKS: Bannerfarm used by Morpheus file sharing software
-jmcms.cydoor.com/
-#MASTER# BLOCK-REFERRER: http://www.tech-report.com/etc/2003q2/3dmurk03/index.x?pg=7
-#MASTER# REMARKS: Netshelter.com farm
-#MASTER# REMARKS: Not found but leaving 10/07/06
-.adtrix.com
-#MASTER# BLOCK-REFERRER: http://discussion.brighthand.com/forumdisplay.php?s=fee44a5b2a6fc2e9e79d6472bc8fbe94&forumid=197 10/19/06
-*[0-9].tribalfusion.com/
-#MASTER# REMARKS: Actions file tracker 1547656 09/02/06
-#MASTER# REMARKS: Update pattern: Actionsfile feedback item #1698822, was opened at 2007-04-11 to catch https://secure.img-cdn.mediaplex.com/0....
-# Blocked URL = https://secure.img-cdn.mediaplex.com/0/7454/43775/YA3149_17566_728x90_FCR_07.gif
-.img*.mediaplex.com
-#MASTER# BLOCK-REFERRER: http://www.tomshardware.com/ 09/28/06
-#MASTER# REMARKS: There is adfarm and altfarm.mediaplex
-#MASTER# REMARKS: 20070711 Actionsfile feedback #1749013 /ad/fm/ appended, as click-throughs were being blocked. Could only find adverts being served from /ad/fm/
-a*farm.mediaplex.com/ad/fm/
-#MASTER# REMARKS: Support request 1312362 09/08/06
-#MASTER# DUPLICATED: adserver.itsfogo.com
-#MASTER# REMARKS: Actionsfile feedback 09/11/06 http://matrix.mediavantage.de/mx.one?p=210&pa=1060&pb=1906&pd=10944&aid=399&x=120&y=240&ts=2005.06.27.21.38.08
-# URL = http://matrix.mediavantage.de/mx.one?p=210&pa=1060&pb=1906&pd=10944&aid=399&x=120&y=240&ts=2005.06.27.21.38.08
-#MASTER# BLOCK-REFERRER: http://www.heise.de/newsticker/meldung/61067
-matrix.mediavantage.
-#MASTER# REMARKS Ad generator, SF user tracker 09/11/06
-.cibleclick.com
-#MASTER# REMARKS: Ad generator 09/11/06  http://c1.netshelter.net/campaigns/ITTTech/itttech09_728x90.gif
-#MASTER# BLOCK-REFERRER: http://www.osnews.com/ 09/11/06
-.netracker.net
-#MASTER# REMARKS: ad generator domain per SF tracker 09/11/06
-.interclick.com
-#MASTER# REMARKS: Ad generator http://c4.maxserving.com/iserver/site=5314/area=ad728x90/aamfmt=normal/aamsz=banner/PageID=
-#MASTER# BLOCK-REFERRER: http://www.imdb.com/name/nm0000168/bio 09/12/06
-# URL = http://c4.maxserving.com/iserver/site=5314/area=ad728x90/aamfmt=normal/aamsz=banner/PageID=
-.maxserving.com
-#MASTER# REMARKS: Ad generator http://partner.gonamic.de/Affiliate/ViewCounter/index.cfm?trackingID=368232&bIsAffiliate=0
-#MASTER# BLOCK-REFERRER:  http://torrent.to/torrent/ 09/12/06
-# URL = http://partner.gonamic.de/Affiliate/ViewCounter/index.cfm?trackingID=368232&bIsAffiliate=0
-.gonamic.de
-# URL = http://img.webads.nl/
-.webads.
-#MASTER# REMARKS: Ad generator http://media.adlegend.com/centrport/20060/511290/GM_emplyee_300x250.gif
-# URL = http://media.adlegend.com/centrport/20060/511290/GM_emplyee_300x250.gif
-#MASTER# BLOCK-REFERRER:  http://news.yahoo.com/news?tmpl=story&cid=534&e=1&u=/ap/20050613/ap_on_he_me/cancer_research
-.adlegend.com
-#MASTER# REMARKS: Ad generator 09/12/06 http://dist.belnk.com//4/placement/1738/alt_offer/static.jpg
-# URL = http://dist.belnk.com//4/placement/1738/alt_offer/static.jpg
-#MASTER# BLOCK-REFERRER: http://groups.yahoo.com/group/louisianaandmardigra/messages/1?viscount=100
-.belnk.com
-.euros4click.
-#MASTER# BLOCK-REFERRER: http://www.planet3dnow.de/cgi-bin/newspub/viewnews.cgi?id=1129904195
-ads-*.quarterserver.
-#MASTER# BLOCK-REFERRER: http://adrian.adrian.org/ 10/07/06
-searchportal.information.com/
-#MASTER# BLOCK-REFERRER: http://www.nbc4.com/news/2672416/detail.html 10/17/06
-images.ibsys.com/
-#MASTER# BLOCK-REFERRER: http://www.rentalhouses.com/search_results.php?searchnew=1&citys_city=&citys_county=&citys_state=&ssubmit=Search&Szip=40205&keyword=&listingid=&strs_state=&strs_city=&strs_street= 11/05/06
-.lduhtrp.net/image
-#MASTER# BLOCK-REFERRER: http://floodle.net 2007-01-21 SF tracker
-scripts.chitika.net/.*\.(gif|png|jpg)
-#MASTER# REMARKS: Actionsfile feedback item #1648478 2007-01-30
-.projectwonderful.com/gen.php
-#MASTER# BLOCK-REFERRER: http://www.multimap.com/ (sporadic)
-#MASTER# REMARKS: Actionsfile feedback item #1665682 2007-02-21
-.akamai.net/.*\.adtech\.de/.*\.(gif|png)
-#MASTER# BLOCK-REFERRER: via Yahoo groups
-#MASTER# REMARKS: Actionsfile tracker 1645513 2007-01-26
-.adinterax.com/.*\.(gif|jpg)
-#MASTER# BLOCK-REFERRER: http://www.wotzon.com/profilepage.html?comp_id=1002310&CatID=2
-#MASTER# REMARKS: Ad generator per Actionsfile feedback item #1749870 2007-07-08
-# URL = http://img.directtrack.com
-img.directtrack.com
-#MASTER# BLOCK-REFERRER: http://www.thinkbroadband.com/news/3621-complaint-about-orange-broadband-advertising-upheld.html
-# URL = http://eas.apm.emediate.eu/media.5/1/1228/19193/ACT1215_120x600_v3.gif
-.emediate.eu/
-# URL = http://feedads.googleadservices.com/~a/dPlpGU767u4D4kVO8EGuUlnf1Q0/i
-# URL = http://feedads.googleadservices.com/~at/EpX-FnAXxwdaBSq-GRze37-rG0M/i