├── .gitattributes ├── .gitignore ├── LICENSE ├── LibPrivoxy.sln ├── LibPrivoxy ├── LibPrivoxy.vcxproj ├── LibPrivoxy.vcxproj.filters ├── ReadMe.txt ├── dllmain.c ├── libprivoxy.c ├── libprivoxy.def ├── libprivoxy.h ├── stdafx.c ├── stdafx.h └── targetver.h ├── README.md └── src ├── AUTHORS ├── ChangeLog ├── GNUmakefile.in ├── INSTALL ├── LICENSE ├── Makefile ├── README ├── TODO ├── acconfig.h ├── actionlist.h ├── actions.c ├── actions.h ├── cgi.c ├── cgi.h ├── cgiedit.c ├── cgiedit.h ├── cgisimple.c ├── cgisimple.h ├── client-tags.c ├── client-tags.h ├── config ├── config.guess ├── config.h ├── config.sub ├── configure.in ├── cygwin.h ├── deanimate.c ├── deanimate.h ├── default.action.master ├── default.filter ├── doc ├── gpl.html ├── pcrs.3 ├── source │ ├── authors.sgml │ ├── buildsource.sgml │ ├── changelog.sgml │ ├── config.sgml │ ├── contacting.sgml │ ├── copyright.sgml │ ├── developer-manual.sgml │ ├── faq.sgml │ ├── history.sgml │ ├── install.sgml │ ├── ldp.dsl.in │ ├── license.sgml │ ├── newfeatures.sgml │ ├── p-authors.sgml │ ├── p-config.sgml │ ├── privoxy-man-page.sgml │ ├── privoxy.sgml │ ├── readme.sgml │ ├── seealso.sgml │ ├── supported.sgml │ ├── user-manual.sgml │ └── webserver │ │ └── index.sgml └── webserver │ ├── README.txt │ ├── announce.txt │ ├── developer-manual │ ├── coding.html │ ├── documentation.html │ ├── git.html │ ├── index.html │ ├── introduction.html │ ├── newrelease.html │ ├── testing.html │ └── webserver-update.html │ ├── error-favicon.ico │ ├── faq │ ├── configuration.html │ ├── contact.html │ ├── copyright.html │ ├── general.html │ ├── index.html │ ├── installation.html │ ├── misc.html │ └── trouble.html │ ├── favicon.ico │ ├── images │ ├── files-in-use.jpg │ └── proxy_setup.jpg │ ├── index.html │ ├── man-page │ └── privoxy-man-page.html │ ├── p_doc.css │ ├── p_feedback.css │ ├── privoxy-index.html │ ├── privoxy.css │ ├── robots.txt │ ├── sponsors │ └── index.html │ ├── team │ ├── 01stefanw.jpg │ ├── 01stefanw_t.jpg │ ├── 02jon.jpg │ ├── 02jon_t.jpg │ ├── 03andreas.jpg │ ├── 03andreas_t.jpg │ ├── 04rodney.jpg │ ├── 04rodney_t.jpg │ ├── 05david.jpg │ ├── 05david_t.jpg │ ├── 05member.jpg │ ├── 05member_t.jpg │ ├── 06member.jpg │ ├── 06member_t.jpg │ ├── 07member.jpg │ ├── 07member_t.jpg │ ├── 08member.jpg │ ├── 08member_t.jpg │ ├── 20member.jpg │ ├── 20member_t.jpg │ └── index.html │ └── user-manual │ ├── actions-file.html │ ├── appendix.html │ ├── config.html │ ├── configuration.html │ ├── contact.html │ ├── copyright.html │ ├── files-in-use.jpg │ ├── filter-file.html │ ├── index.html │ ├── installation.html │ ├── introduction.html │ ├── proxy2.jpg │ ├── proxy_setup.jpg │ ├── quickstart.html │ ├── seealso.html │ ├── startup.html │ ├── templates.html │ └── whatsnew.html ├── encode.c ├── encode.h ├── errlog.c ├── errlog.h ├── filters.c ├── filters.h ├── fuzz.c ├── gateway.c ├── gateway.h ├── icons ├── ico00001.ico ├── ico00002.ico ├── ico00003.ico ├── ico00004.ico ├── ico00005.ico ├── ico00006.ico ├── ico00007.ico ├── ico00008.ico ├── idle.ico ├── off.ico ├── os2.ico ├── os20.ico ├── os21.ico ├── os22.ico ├── os23.ico ├── os24.ico ├── os25.ico ├── os26.ico ├── os27.ico ├── os28.ico ├── privoxy.ico ├── radar-01.ico ├── radar-02.ico ├── radar-03.ico ├── radar-04.ico ├── radar-05.ico ├── radar-06.ico ├── radar-07.ico └── radar-08.ico ├── install-sh ├── jbsockets - 副本.c ├── jbsockets.c ├── jbsockets.h ├── jcc - 副本.c ├── jcc.c ├── jcc.h ├── libprivoxyext.c ├── libprivoxyext.h ├── list.c ├── list.h ├── loadcfg.c ├── loadcfg.h ├── loaders.c ├── loaders.h ├── match-all.action ├── miscutil - 副本.c ├── miscutil.c ├── miscutil.h ├── mkinstalldirs ├── parsers.c ├── parsers.h ├── pcre ├── Makefile.in ├── RunTest.in ├── chartables.c ├── config.guess ├── config.h ├── config.in ├── config.sub ├── configure ├── configure.in ├── dftables.c ├── dll.mk ├── doc │ ├── ChangeLog │ ├── NON-UNIX-USE │ ├── Tech.Notes │ ├── authors │ ├── copying │ ├── news │ ├── pcre.3 │ ├── pcre.html │ ├── pcre.txt │ ├── pcregrep.1 │ ├── pcregrep.html │ ├── pcregrep.txt │ ├── pcreposix.3 │ ├── pcreposix.html │ ├── pcreposix.txt │ ├── pcretest.txt │ ├── perltest.txt │ └── readme ├── get.c ├── install ├── install-sh ├── internal.h ├── licence ├── ltconfig ├── ltmain.sh ├── maketables.c ├── pcre-config ├── pcre-config.in ├── pcre.c ├── pcre.def ├── pcre.h ├── pcre.in ├── pcregrep.c ├── pcreposix.c ├── pcreposix.h ├── pcretest.c ├── study.c └── vc_dftables.dsp ├── pcrs.c ├── pcrs.h ├── privoxy-generic.init ├── privoxy.1 ├── project.h ├── regression-tests.action ├── resource.h ├── slackware └── rc.privoxy.orig ├── ssplit.c ├── ssplit.h ├── strptime.h ├── templates ├── blocked ├── cgi-error-404 ├── cgi-error-bad-param ├── cgi-error-disabled ├── cgi-error-file ├── cgi-error-file-read-only ├── cgi-error-modified ├── cgi-error-parse ├── cgi-style.css ├── client-tags ├── connect-failed ├── connection-timeout ├── default ├── edit-actions-add-url-form ├── edit-actions-for-url ├── edit-actions-for-url-filter ├── edit-actions-list ├── edit-actions-list-button ├── edit-actions-list-section ├── edit-actions-list-url ├── edit-actions-remove-url-form ├── edit-actions-url-form ├── forwarding-failed ├── mod-local-help ├── mod-support-and-service ├── mod-title ├── mod-unstable-warning ├── no-server-data ├── no-such-domain ├── show-request ├── show-status ├── show-status-file ├── show-url-info ├── toggle ├── toggle-mini ├── untrusted └── url-info-osd.xml ├── tools ├── privoxy-log-parser.pl ├── privoxy-regression-test.pl ├── uagen.pl └── url-pattern-translator.pl ├── trust ├── urlmatch.c ├── urlmatch.h ├── user.action ├── user.filter ├── utils ├── changelog2doc.pl ├── create-package-feed.pl ├── docbook2man │ ├── COPYING │ ├── docbook2man-spec.pl │ └── docbook2man-spec.pl.1 ├── filter2docs.pl ├── ldp_print │ ├── README │ ├── VERSION │ ├── fix_print_html.lib │ └── ldp_print ├── makeChangeLog └── prepare-configfile.pl ├── w32 - 副本.rc ├── w32.rc ├── w32log.c ├── w32log.h ├── w32res.h ├── w32svrapi.c ├── w32svrapi.h ├── w32taskbar.c ├── w32taskbar.h ├── win32.c └── win32.h /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /LibPrivoxy.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2020 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibPrivoxy", "LibPrivoxy\LibPrivoxy.vcxproj", "{799D237D-7248-49D5-925F-3FA633BBD867}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Dll_Debug|Win32 = Dll_Debug|Win32 11 | Dll_Debug|x64 = Dll_Debug|x64 12 | Dll_Release|Win32 = Dll_Release|Win32 13 | Dll_Release|x64 = Dll_Release|x64 14 | Lib_Debug|Win32 = Lib_Debug|Win32 15 | Lib_Debug|x64 = Lib_Debug|x64 16 | Lib_Release|Win32 = Lib_Release|Win32 17 | Lib_Release|x64 = Lib_Release|x64 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {799D237D-7248-49D5-925F-3FA633BBD867}.Dll_Debug|Win32.ActiveCfg = Debug|Win32 21 | {799D237D-7248-49D5-925F-3FA633BBD867}.Dll_Debug|Win32.Build.0 = Debug|Win32 22 | {799D237D-7248-49D5-925F-3FA633BBD867}.Dll_Debug|x64.ActiveCfg = Debug|Win32 23 | {799D237D-7248-49D5-925F-3FA633BBD867}.Dll_Release|Win32.ActiveCfg = Release|Win32 24 | {799D237D-7248-49D5-925F-3FA633BBD867}.Dll_Release|Win32.Build.0 = Release|Win32 25 | {799D237D-7248-49D5-925F-3FA633BBD867}.Dll_Release|x64.ActiveCfg = Release|Win32 26 | {799D237D-7248-49D5-925F-3FA633BBD867}.Lib_Debug|Win32.ActiveCfg = Lib_Debug|Win32 27 | {799D237D-7248-49D5-925F-3FA633BBD867}.Lib_Debug|Win32.Build.0 = Lib_Debug|Win32 28 | {799D237D-7248-49D5-925F-3FA633BBD867}.Lib_Debug|x64.ActiveCfg = Lib_Debug|Win32 29 | {799D237D-7248-49D5-925F-3FA633BBD867}.Lib_Release|Win32.ActiveCfg = Lib_Release|Win32 30 | {799D237D-7248-49D5-925F-3FA633BBD867}.Lib_Release|Win32.Build.0 = Lib_Release|Win32 31 | {799D237D-7248-49D5-925F-3FA633BBD867}.Lib_Release|x64.ActiveCfg = Lib_Release|Win32 32 | EndGlobalSection 33 | GlobalSection(SolutionProperties) = preSolution 34 | HideSolutionNode = FALSE 35 | EndGlobalSection 36 | GlobalSection(ExtensibilityGlobals) = postSolution 37 | SolutionGuid = {10400D5D-6CFF-478E-AD9E-3668D5A4A9DA} 38 | EndGlobalSection 39 | EndGlobal 40 | -------------------------------------------------------------------------------- /LibPrivoxy/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | DYNAMIC LINK LIBRARY : LibPrivoxy Project Overview 3 | ======================================================================== 4 | 5 | AppWizard has created this LibPrivoxy DLL for you. 6 | 7 | This file contains a summary of what you will find in each of the files that 8 | make up your LibPrivoxy application. 9 | 10 | 11 | LibPrivoxy.vcxproj 12 | This is the main project file for VC++ projects generated using an Application Wizard. 13 | It contains information about the version of Visual C++ that generated the file, and 14 | information about the platforms, configurations, and project features selected with the 15 | Application Wizard. 16 | 17 | LibPrivoxy.vcxproj.filters 18 | This is the filters file for VC++ projects generated using an Application Wizard. 19 | It contains information about the association between the files in your project 20 | and the filters. This association is used in the IDE to show grouping of files with 21 | similar extensions under a specific node (for e.g. ".cpp" files are associated with the 22 | "Source Files" filter). 23 | 24 | LibPrivoxy.cpp 25 | This is the main DLL source file. 26 | 27 | When created, this DLL does not export any symbols. As a result, it 28 | will not produce a .lib file when it is built. If you wish this project 29 | to be a project dependency of some other project, you will either need to 30 | add code to export some symbols from the DLL so that an export library 31 | will be produced, or you can set the Ignore Input Library property to Yes 32 | on the General propert page of the Linker folder in the project's Property 33 | Pages dialog box. 34 | 35 | ///////////////////////////////////////////////////////////////////////////// 36 | Other standard files: 37 | 38 | StdAfx.h, StdAfx.cpp 39 | These files are used to build a precompiled header (PCH) file 40 | named LibPrivoxy.pch and a precompiled types file named StdAfx.obj. 41 | 42 | ///////////////////////////////////////////////////////////////////////////// 43 | Other notes: 44 | 45 | AppWizard uses "TODO:" comments to indicate parts of the source code you 46 | should add to or customize. 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | -------------------------------------------------------------------------------- /LibPrivoxy/dllmain.c: -------------------------------------------------------------------------------- 1 | // dllmain.c : Defines the entry point for the DLL application. 2 | #include 3 | 4 | HMODULE g_hLibPrivoxyModule; 5 | 6 | BOOL APIENTRY DllMain( HMODULE hModule, 7 | DWORD ul_reason_for_call, 8 | LPVOID lpReserved 9 | ) 10 | { 11 | if (DLL_PROCESS_ATTACH == ul_reason_for_call) { 12 | g_hLibPrivoxyModule = hModule; 13 | } 14 | else if (DLL_PROCESS_DETACH == ul_reason_for_call) { 15 | } 16 | else if (DLL_THREAD_ATTACH == ul_reason_for_call) { 17 | } 18 | else if (DLL_THREAD_DETACH == ul_reason_for_call) { 19 | } 20 | 21 | return TRUE; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /LibPrivoxy/libprivoxy.c: -------------------------------------------------------------------------------- 1 | #include "libprivoxy.h" 2 | #include "miscutil.h" 3 | #include 4 | 5 | char g_privoxy_config_full_path[1024] = { 0 }; 6 | extern HMODULE g_hLibPrivoxyModule = NULL; 7 | extern int g_terminate; 8 | extern void close_privoxy_listening_socket(); 9 | 10 | LIBPRIVOXY_API int __stdcall StartPrivoxy(char *config_full_path) 11 | { 12 | g_terminate = 0; 13 | 14 | strcpy_s(g_privoxy_config_full_path, 1024, config_full_path); 15 | 16 | // start privoxy 17 | WinMain( NULL,NULL,NULL, 0); 18 | 19 | return 0; 20 | } 21 | 22 | LIBPRIVOXY_API void __stdcall StopPrivoxy() 23 | { 24 | g_terminate = 1; 25 | close_privoxy_listening_socket(); 26 | } 27 | 28 | LIBPRIVOXY_API int __stdcall IsRunning() 29 | { 30 | return 1 == g_terminate ? 0 : 1; 31 | } -------------------------------------------------------------------------------- /LibPrivoxy/libprivoxy.def: -------------------------------------------------------------------------------- 1 | LIBRARY LibPrivoxy 2 | EXPORTS 3 | StartPrivoxy 4 | StopPrivoxy -------------------------------------------------------------------------------- /LibPrivoxy/libprivoxy.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBPRIVOXY_EXPORT_H 2 | #define _LIBPRIVOXY_EXPORT_H 3 | 4 | #ifdef LIBPRIVOXY_EXPORTS 5 | #define LIBPRIVOXY_API __declspec(dllexport) 6 | #else 7 | #define LIBPRIVOXY_API __declspec(dllimport) 8 | #endif 9 | 10 | LIBPRIVOXY_API int __stdcall StartPrivoxy(char *config_full_path); 11 | 12 | LIBPRIVOXY_API void __stdcall StopPrivoxy(); 13 | 14 | LIBPRIVOXY_API int __stdcall IsRunning(); 15 | 16 | #endif -------------------------------------------------------------------------------- /LibPrivoxy/stdafx.c: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // LibPrivoxy.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /LibPrivoxy/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files: 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #pragma comment(lib,"ws2_32.lib") 19 | -------------------------------------------------------------------------------- /LibPrivoxy/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 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.
2 |
3 | Many people want to integrate Privoxy into their own projects, I made some changes to the Privoxy codes to compiled into a DLL or static library, so that you can better integrate it into their own projects.
4 |
5 | Base on work from: 6 |
7 | Privoxy: https://www.privoxy.org/ (based on its latest version 3.0.28) 8 |
9 | LibPrivoxy: https://github.com/tarolabs/LibPrivoxy 10 |
11 | DNS query: https://www.binarytides.com/dns-query-code-in-c-with-winsock/ 12 |
13 |
14 | Develop environment: Visual Studio 2017
15 |
16 | License: GNU GENERAL PUBLIC LICENSE Version 2 17 |
18 |
19 | Author: Shiyu Tang 20 |
21 |
22 | Notice: Important changes to original Privoxy: 23 |
24 |
25 | 1. Use custom DNS servers 26 |
27 | You can set DNS servers in config file to use specified DNS servers (of example, 8.8.8.8 and/or 208.67.222.222) instead of system-wide DNS settings. You can add no more than 6 DNS servers. Like: 28 |
29 |
30 | 31 | dns-servers 8.8.8.8;208.67.222.222 32 | 33 |
34 |
35 | Sample code (C#) of using the dll: 36 |
37 |
38 | 39 | public class PrivoxyWrapper 40 | { 41 | 42 | [DllImport(@"LibPrivoxy.dll")] 43 | public static extern int StartPrivoxy([MarshalAs(UnmanagedType.LPStr)] string configFileFullPath); 44 | 45 | [DllImport(@"LibPrivoxy.dll")] 46 | public static extern void StopPrivoxy(); 47 | 48 | [DllImport(@"LibPrivoxy.dll")] 49 | public static extern int IsRunning(); 50 | } 51 | -------------------------------------------------------------------------------- /src/AUTHORS: -------------------------------------------------------------------------------- 1 | Authors of Privoxy v2.9.x and 3.x 2 | =========================================================================== 3 | 4 | Current Privoxy Team: 5 | 6 | Fabian Keil, lead developer 7 | David Schmidt 8 | Lee Rian 9 | Roland Rosenfeld 10 | Ian Silvester 11 | 12 | Former Privoxy Team Members: 13 | 14 | Johny Agotnes 15 | Rodrigo Barbosa 16 | Moritz Barsnick 17 | Hal Burgiss 18 | Ian Cummings 19 | Brian Dessent 20 | Jon Foster 21 | Karsten Hopp 22 | Alexander Lazic 23 | Daniel Leite 24 | Gábor Lipták 25 | Adam Lock 26 | Guy Laroche 27 | Justin McMurtry 28 | Mark Miller 29 | Gerry Murphy 30 | Andreas Oesterhelt 31 | Haroon Rafique 32 | Georg Sauthoff 33 | Thomas Steudten 34 | Jörg Strohmayer 35 | Rodney Stromlund 36 | Sviatoslav Sviridov 37 | Sarantis Paskalis 38 | Stefan Waldherr 39 | 40 | Thanks to the many people who have tested Privoxy, reported bugs, provided 41 | patches, made suggestions, donated or contributed in some other way. These 42 | include (in alphabetical order): 43 | 44 | Rustam Abdullaev 45 | Clint Adams 46 | Anatoly Arzhnikov 47 | Ken Arromdee 48 | Natxo Asenjo 49 | Devin Bayer 50 | Havard Berland 51 | David Binderman 52 | David Bo 53 | Gergely Bor 54 | Francois Botha 55 | Reiner Buehl 56 | Andrew J. Caines 57 | Clifford Caoile 58 | Edward Carrel 59 | Pak Chan 60 | Wan-Teh Chang 61 | Sam Chen 62 | Ramkumar Chinchani 63 | Billy Crook 64 | Frédéric Crozat 65 | Matthew Daley 66 | Michael T. Davis 67 | Markus Dittrich 68 | Mattes Dolak 69 | Matthias Drochner 70 | Peter E. 71 | Florian Effenberger 72 | Markus Elfring 73 | Ryan Farmer 74 | Matthew Fischer 75 | Dean Gaudet 76 | Stephen Gildea 77 | John McGowan 78 | Danny Goossen 79 | Lizik Grelier 80 | Daniel Griscom 81 | Felix Gröbert 82 | Bernard Guillot 83 | Jeff H. 84 | Tim H. 85 | Aaron Hamid 86 | Darel Henman 87 | Magnus Holmgren 88 | Eric M. Hopper 89 | Ralf Horstmann 90 | Stefan Huehner 91 | Basil Hussain 92 | Peter Hyman 93 | Derek Jennings 94 | Andrew Jones 95 | Julien Joubert 96 | Ralf Jungblut 97 | Petr Kadlec 98 | Robert Klemme 99 | Steven Kolins 100 | Korda 101 | Stefan Kurtz 102 | Zeno Kugy 103 | David Laight 104 | Bert van Leeuwen 105 | Don Libes 106 | Paul Lieverse 107 | Han Liu 108 | Toby Lyward 109 | Wil Mahan 110 | Jindrich Makovicka 111 | Raphael Marichez 112 | Francois Marier 113 | Angelina Matson 114 | Jonathan McKenzie 115 | David Mediavilla 116 | Raphael Moll 117 | J. Momberger 118 | Mathew Murphy 119 | Amuro Namie 120 | Mark Nelson 121 | Tobias Netzel 122 | Adam Piggott 123 | Petr Písar 124 | Dan Price 125 | Roberto Ragusa 126 | Félix Rauch 127 | Kai Raven 128 | Marvin Renich 129 | Chris John Riley 130 | Maynard Riley 131 | Andreas Rutkauskas 132 | Bart Schelstraete 133 | Gregory Seidman 134 | Atman Sense 135 | Chung-chieh Shan 136 | Johan Sintorn 137 | Benjamin C. Wiley Sittler 138 | Simon South 139 | Dan Stahlke 140 | Oliver Stoeneberg 141 | Rick Sykes 142 | Spinor S. 143 | Peter Thoenen 144 | Marc Thomas 145 | Martin Thomas 146 | Reuben Thomas 147 | Guybrush Threepwood 148 | Joel Verhagen 149 | Bobby G. Vinyard 150 | Jochen Voss 151 | David Wagner 152 | Glenn Washburn 153 | Song Weijia 154 | Jörg Weinmann 155 | Darren Wiebe 156 | Anduin Withers 157 | Eduard Wulff 158 | Yang Xia 159 | Jarry Xu 160 | Oliver Yeoh 161 | Yossi Zahn 162 | Jamie Zawinski 163 | 164 | Privoxy is based in part on code originally developed by Junkbusters Corp. and 165 | Anonymous Coders. 166 | 167 | Privoxy heavily relies on Philip Hazel's PCRE. 168 | 169 | The code to filter compressed content makes use of zlib which is written by 170 | Jean-loup Gailly and Mark Adler. 171 | 172 | On systems that lack snprintf(), Privoxy is using a version written by Mark 173 | Martinec. On systems that lack strptime(), Privoxy is using the one from the 174 | GNU C Library written by Ulrich Drepper. 175 | 176 | If we've missed you off this list, please let us know! 177 | 178 | Privoxy team. https://www.privoxy.org/ 179 | 180 | 181 | -------------------------------------------------------------------------------- /src/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/ChangeLog -------------------------------------------------------------------------------- /src/GNUmakefile.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/GNUmakefile.in -------------------------------------------------------------------------------- /src/Makefile: -------------------------------------------------------------------------------- 1 | # Written by and Copyright (C) 2001 the SourceForge 2 | # Privoxy team. http://www.privoxy.org/ 3 | # 4 | # Based on the Internet Junkbuster originally written 5 | # by and Copyright (C) 1997 Anonymous Coders and 6 | # Junkbusters Corporation. http://www.junkbusters.com 7 | # 8 | # This program is free software; you can redistribute it 9 | # and/or modify it under the terms of the GNU General 10 | # Public License as published by the Free Software 11 | # Foundation; either version 2 of the License, or (at 12 | # your option) any later version. 13 | # 14 | # This program is distributed in the hope that it will 15 | # be useful, but WITHOUT ANY WARRANTY; without even the 16 | # implied warranty of MERCHANTABILITY or FITNESS FOR A 17 | # PARTICULAR PURPOSE. See the GNU General Public 18 | # License for more details. 19 | # 20 | # The GNU General Public License should be included with 21 | # this file. If not, you can view it at 22 | # http://www.gnu.org/copyleft/gpl.html 23 | # or write to the Free Software Foundation, Inc., 59 24 | # Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | # 26 | ############################################################################# 27 | 28 | GNU_MAKE_CMD = gmake 29 | MAKE_CMD = make 30 | 31 | error: 32 | @if [ -f GNUmakefile ]; then \ 33 | echo "***"; \ 34 | echo "*** You are not using the GNU version of Make - maybe it's called gmake"; \ 35 | echo "*** or it's in a different PATH? Please read INSTALL." ; \ 36 | echo "***"; \ 37 | exit 1; \ 38 | elif test -n "$(HOST_ARCH)" && test -z "$(MAKE_VERSION)" ; then \ 39 | echo "***"; \ 40 | echo "*** You are not using GNU Make on Solaris, please make sure you do" ; \ 41 | echo "*** and re-run 'make' "; \ 42 | echo "***"; \ 43 | exit 1 ; \ 44 | elif test -n "$(MACHINE_ARCH)" && test -z "$(MAKE_VERSION)" ; then \ 45 | echo "***"; \ 46 | echo "*** You are not using GNU Make on FreeBSD, please make sure you do" ; \ 47 | echo "*** and re-run 'make' "; \ 48 | echo "***"; \ 49 | exit 1 ; \ 50 | else \ 51 | echo "***"; \ 52 | echo "*** To build this program, you must run"; \ 53 | echo "*** autoheader && autoconf && ./configure and then run GNU make."; \ 54 | echo "***"; \ 55 | echo -n "*** Shall I do this for you now? (y/n) "; \ 56 | read answer; \ 57 | if [ "$$answer" = "y" ]; then \ 58 | autoheader && autoconf && ./configure || exit 1; \ 59 | if $(GNU_MAKE_CMD) -v |grep GNU >/dev/null 2>/dev/null; then \ 60 | $(GNU_MAKE_CMD) ;\ 61 | elif $(MAKE_CMD) -v |grep GNU >/dev/null 2>/dev/null; then \ 62 | $(MAKE_CMD) ;\ 63 | else \ 64 | echo "Neither 'make' nor 'gmake' are GNU compatible!" ; \ 65 | echo "Please read INSTALL." ; \ 66 | exit 1 ; \ 67 | fi ;\ 68 | fi; \ 69 | fi 70 | 71 | .PHONY: error 72 | 73 | ############################################################################# 74 | 75 | ## Local Variables: 76 | ## tab-width: 3 77 | ## end: 78 | -------------------------------------------------------------------------------- /src/client-tags.h: -------------------------------------------------------------------------------- 1 | #ifndef CLIENT_TAGS_H_INCLUDED 2 | #define CLIENT_TAGS_H_INCLUDED 3 | /********************************************************************* 4 | * 5 | * File : $Source: /cvsroot/ijbswa/current/client-tags.h,v $ 6 | * 7 | * Purpose : Declares functions for client-specific tags. 8 | * 9 | * Copyright : Copyright (C) 2016 Fabian Keil 10 | * 11 | * This program is free software; you can redistribute it 12 | * and/or modify it under the terms of the GNU General 13 | * Public License as published by the Free Software 14 | * Foundation; either version 2 of the License, or (at 15 | * your option) any later version. 16 | * 17 | * This program is distributed in the hope that it will 18 | * be useful, but WITHOUT ANY WARRANTY; without even the 19 | * implied warranty of MERCHANTABILITY or FITNESS FOR A 20 | * PARTICULAR PURPOSE. See the GNU General Public 21 | * License for more details. 22 | * 23 | * The GNU General Public License should be included with 24 | * this file. If not, you can view it at 25 | * http://www.gnu.org/copyleft/gpl.html 26 | * or write to the Free Software Foundation, Inc., 59 27 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 28 | * 29 | *********************************************************************/ 30 | 31 | extern int client_tag_match(const struct pattern_spec *pattern, 32 | const struct list *tags); 33 | extern void get_tag_list_for_client(struct list *tag_list, 34 | const char *client_address); 35 | extern time_t get_next_tag_timeout_for_client(const char *client_address); 36 | extern jb_err disable_client_specific_tag(struct client_state *csp, 37 | const char *tag_name); 38 | extern jb_err enable_client_specific_tag(struct client_state *csp, 39 | const char *tag_name, 40 | const time_t time_to_live); 41 | extern int client_has_requested_tag(const char *client_address, 42 | const char *tag); 43 | extern void set_client_address(struct client_state *csp, 44 | const struct list *headers); 45 | 46 | #define CLIENT_TAG_LENGTH_MAX 50 47 | #endif 48 | -------------------------------------------------------------------------------- /src/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBPRIVOXY_CONFIG_ 2 | #define _LIBPRIVOXY_CONFIG_ 3 | 4 | #define VERSION "3.0.26" 5 | #define CODE_STATUS "stable" 6 | #define VERSION_MAJOR 3 7 | #define VERSION_MINOR 0 8 | #define VERSION_POINT 26 9 | 10 | #define HAVE_SNPRINTF 1 11 | 12 | #ifdef _MSC_VER 13 | #define strcasecmp _stricmp 14 | #define strncasecmp _strnicmp 15 | #define strdup _strdup 16 | #endif 17 | 18 | #ifdef LIBPRIVOXY 19 | #define exit libprivoxy_exit 20 | #endif 21 | 22 | #define FEATURE_CONNECTION_KEEP_ALIVE 23 | 24 | #endif 25 | 26 | /* 27 | Local Variables: 28 | tab-width: 3 29 | end: 30 | */ 31 | -------------------------------------------------------------------------------- /src/cygwin.h: -------------------------------------------------------------------------------- 1 | #ifndef CYGWIN_H_INCLUDED 2 | #define CYGWIN_H_INCLUDED 3 | /********************************************************************* 4 | * 5 | * File : $Source: /cvsroot/ijbswa/current/cygwin.h,v $ 6 | * 7 | * Purpose : The windows.h file seems to be a *tad* different, so I 8 | * will bridge the gaps here. Perhaps I should convert the 9 | * latest SDK too? Shudder, I think not. 10 | * 11 | * Copyright : Written by and Copyright (C) 2001 members of the 12 | * Privoxy team. http://www.privoxy.org/ 13 | * 14 | * Based on the Internet Junkbuster originally written 15 | * by and Copyright (C) 1997 Anonymous Coders and 16 | * Junkbusters Corporation. http://www.junkbusters.com 17 | * 18 | * This program is free software; you can redistribute it 19 | * and/or modify it under the terms of the GNU General 20 | * Public License as published by the Free Software 21 | * Foundation; either version 2 of the License, or (at 22 | * your option) any later version. 23 | * 24 | * This program is distributed in the hope that it will 25 | * be useful, but WITHOUT ANY WARRANTY; without even the 26 | * implied warranty of MERCHANTABILITY or FITNESS FOR A 27 | * PARTICULAR PURPOSE. See the GNU General Public 28 | * License for more details. 29 | * 30 | * The GNU General Public License should be included with 31 | * this file. If not, you can view it at 32 | * http://www.gnu.org/copyleft/gpl.html 33 | * or write to the Free Software Foundation, Inc., 59 34 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 35 | * 36 | *********************************************************************/ 37 | 38 | /* Conditionally include this whole file. */ 39 | #ifdef __MINGW32__ 40 | 41 | /* Hmmm, seems to be overlooked. */ 42 | #define _RICHEDIT_VER 0x0300 43 | 44 | /* 45 | * Named slightly different ... but not in Cygwin v1.3.1 ... 46 | * 47 | * #define LVITEM LV_ITEM 48 | * #define LVCOLUMN LV_COLUMN 49 | */ 50 | 51 | #endif /* def __MINGW32__ */ 52 | #endif /* ndef CYGWIN_H_INCLUDED */ 53 | 54 | 55 | /* 56 | Local Variables: 57 | tab-width: 3 58 | end: 59 | */ 60 | -------------------------------------------------------------------------------- /src/deanimate.h: -------------------------------------------------------------------------------- 1 | #ifndef DEANIMATE_H_INCLUDED 2 | #define DEANIMATE_H_INCLUDED 3 | /********************************************************************* 4 | * 5 | * File : $Source: /cvsroot/ijbswa/current/deanimate.h,v $ 6 | * 7 | * Purpose : Declares functions to manipulate binary images on the 8 | * fly. High-level functions include: 9 | * - Deanimation of GIF images 10 | * 11 | * Functions declared include: gif_deanimate and buf_free. 12 | * 13 | * 14 | * Copyright : Written by and Copyright (C) 2001 - 2004 by the the 15 | * SourceForge Privoxy team. http://www.privoxy.org/ 16 | * 17 | * Based on ideas from the Image::DeAnim Perl module by 18 | * Ken MacFarlane, 19 | * 20 | * Based on the Internet Junkbuster originally written 21 | * by and Copyright (C) 1997 Anonymous Coders and 22 | * Junkbusters Corporation. http://www.junkbusters.com 23 | * 24 | * This program is free software; you can redistribute it 25 | * and/or modify it under the terms of the GNU General 26 | * Public License as published by the Free Software 27 | * Foundation; either version 2 of the License, or (at 28 | * your option) any later version. 29 | * 30 | * This program is distributed in the hope that it will 31 | * be useful, but WITHOUT ANY WARRANTY; without even the 32 | * implied warranty of MERCHANTABILITY or FITNESS FOR A 33 | * PARTICULAR PURPOSE. See the GNU General Public 34 | * License for more details. 35 | * 36 | * The GNU General Public License should be included with 37 | * this file. If not, you can view it at 38 | * http://www.gnu.org/copyleft/gpl.html 39 | * or write to the Free Software Foundation, Inc., 59 40 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 41 | * 42 | *********************************************************************/ 43 | 44 | 45 | /* 46 | * A struct that holds a buffer, a read/write offset, 47 | * and the buffer's capacity. 48 | */ 49 | struct binbuffer 50 | { 51 | char *buffer; 52 | size_t offset; 53 | size_t size; 54 | }; 55 | 56 | /* 57 | * Function prototypes 58 | */ 59 | extern int gif_deanimate(struct binbuffer *src, struct binbuffer *dst, int get_first_image); 60 | extern void buf_free(struct binbuffer *buf); 61 | 62 | 63 | #endif /* ndef DEANIMATE_H_INCLUDED */ 64 | 65 | /* 66 | Local Variables: 67 | tab-width: 3 68 | end: 69 | */ 70 | -------------------------------------------------------------------------------- /src/default.filter: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/default.filter -------------------------------------------------------------------------------- /src/doc/source/authors.sgml: -------------------------------------------------------------------------------- 1 | 23 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | ]> 33 | 34 |
35 | 36 | 38 | 39 | This is here to keep vim syntax file from breaking :/ 40 | If I knew enough to fix it, I would. 41 | PLEASE DO NOT REMOVE! HB: hal@foobox.net 42 | 43 | 44 | ]]> 45 | 46 | 47 | Authors of Privoxy v2.9.x and 3.x 48 | =========================================================================== 49 | 50 | 51 | 52 | &authors; 53 | 54 | 55 | 56 | If we've missed you off this list, please let us know! 57 | 58 | 59 | 60 | Privoxy team. https://www.privoxy.org/ 61 | privoxy-devel@lists.privoxy.org 62 | 63 | 64 |
65 | -------------------------------------------------------------------------------- /src/doc/source/config.sgml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Privoxy"> 10 | ]> 11 | 29 | 30 |
31 | 32 | &config; 33 | 34 |
35 | -------------------------------------------------------------------------------- /src/doc/source/copyright.sgml: -------------------------------------------------------------------------------- 1 | 30 | 31 | 32 | Copyright &my-copy; 2001-2018 by Privoxy Developers privoxy-devel@lists.privoxy.org 33 | 34 | 35 | 36 | Some source code is based on code Copyright &my-copy; 1997 by Anonymous Coders 37 | and Junkbusters, Inc. and licensed under the GNU General Public 38 | License. 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/doc/source/history.sgml: -------------------------------------------------------------------------------- 1 | 24 | 25 | 26 | A long time ago, there was the Internet Junkbuster, 27 | by Anonymous Coders and Junkbusters Corporation. This saved many users a lot of 28 | pain in the early days of web advertising and user tracking. 29 | 30 | 31 | 32 | But the web, its protocols and standards, and with it, the techniques for 33 | forcing ads on users, give up autonomy over their browsing, and 34 | for tracking them, keeps evolving. Unfortunately, the Internet 35 | Junkbuster did not. Version 2.0.2, published in 1998, was 36 | the last official release, available from Junkbusters Corporation. 37 | Fortunately, it had been released under the GNU 38 | GPL, 39 | which allowed further development by others. 40 | 41 | 42 | 43 | So Stefan Waldherr started maintaining an improved version of the 44 | software, to which eventually a number of people contributed patches. 45 | It could already replace banners with a transparent image, and had a first 46 | version of pop-up killing, but it was still very closely based on the 47 | original, with all its limitations, such as the lack of HTTP/1.1 support, 48 | flexible per-site configuration, or content modification. The last release 49 | from this effort was version 2.0.2-10, published in 2000. 50 | 51 | 52 | 53 | Then, some 54 | developers 55 | picked up the thread, and started turning the software inside out, upside down, 56 | and then reassembled it, adding many 57 | new 58 | features along the way. 59 | 60 | 61 | 62 | The result of this is Privoxy, whose first 63 | stable version, 3.0, was released August, 2002. 64 | 65 | 66 | 67 | 68 | As of 2012 the Junkbusters Corporation's website (http://www.junkbusters.com/) 69 | has been shut down, but Privoxy is still actively maintained. 70 | 71 | -------------------------------------------------------------------------------- /src/doc/source/license.sgml: -------------------------------------------------------------------------------- 1 | 25 | 26 | 27 | Privoxy is free software; you can 28 | redistribute it and/or modify it under the terms of the 29 | GNU General Public License, version 2, 30 | as published by the Free Software Foundation. 31 | 32 | 33 | 34 | Privoxy is distributed in the hope that 35 | it will be useful, but WITHOUT ANY WARRANTY; without even the implied 36 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 37 | See the 39 | license for details. 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/doc/source/newfeatures.sgml: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | 25 | 33 | 34 | 35 | 36 | Supports "Connection: keep-alive". Outgoing connections can 37 | be kept alive independently from the client. 38 | 39 | 40 | 41 | 42 | 43 | Supports IPv6, provided the operating system does so too, 44 | and the configure script detects it. 45 | 46 | 47 | 48 | 49 | 50 | Supports tagging which allows to change the behaviour 51 | based on client and server headers. 52 | 53 | 54 | 55 | 56 | 57 | Can be run as an "intercepting" proxy, which obviates the need to 58 | configure browsers individually. 59 | 60 | 61 | 62 | 63 | 64 | Sophisticated actions and filters for manipulating both server and client 65 | headers. 66 | 67 | 68 | 69 | 70 | 71 | Can be chained with other proxies. 72 | 73 | 74 | 75 | 76 | 77 | Integrated browser-based configuration and control utility at http://config.privoxy.org/ 79 | (shortcut: http://p.p/). Browser-based 80 | tracing of rule and filter effects. Remote toggling. 81 | 82 | 83 | 84 | 85 | 86 | Web page filtering (text replacements, removes banners based on size, 87 | invisible web-bugs and HTML annoyances, etc.) 88 | 89 | 90 | 91 | 92 | 93 | Modularized configuration that allows for standard settings and 94 | user settings to reside in separate files, so that installing updated 95 | actions files won't overwrite individual user settings. 96 | 97 | 98 | 99 | 100 | 101 | Support for Perl Compatible Regular Expressions in the configuration files, and 102 | a more sophisticated and flexible configuration syntax. 103 | 104 | 105 | 106 | 107 | 108 | GIF de-animation. 109 | 110 | 111 | 112 | 113 | 114 | Bypass many click-tracking scripts (avoids script redirection). 115 | 116 | 117 | 118 | 119 | 120 | User-customizable HTML templates for most proxy-generated pages (e.g. "blocked" page). 121 | 122 | 123 | 124 | 125 | 126 | Auto-detection and re-reading of config file changes. 127 | 128 | 129 | 130 | 131 | 132 | Most features are controllable on a per-site or per-location basis. 133 | 134 | 135 | 136 | 137 | 138 | Many smaller new features added, limitations and bugs removed. 139 | 140 | 141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /src/doc/source/privoxy.sgml: -------------------------------------------------------------------------------- 1 | 26 | 27 | 28 | Privoxy is a non-caching web proxy with advanced filtering capabilities 29 | for enhancing privacy, modifying web page data and HTTP headers, controlling 30 | access, and removing ads and other obnoxious Internet junk. Privoxy has a 31 | flexible configuration and can be customized to suit individual needs and tastes. 32 | It has application for both stand-alone systems and multi-user networks. 33 | 34 | 35 | 36 | Privoxy is Free Software and licensed under the GNU GPLv2. 37 | 38 | 39 | 40 | Privoxy is an associated project of Software in the Public Interest (SPI). 41 | 42 | 43 | 44 | Helping hands and donations are welcome: 45 | 46 | 47 | 48 | 49 | 50 | 51 | https://www.privoxy.org/faq/general.html#PARTICIPATE 52 | 53 | 54 | 55 | 56 | 57 | https://www.privoxy.org/faq/general.html#DONATE 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/doc/source/seealso.sgml: -------------------------------------------------------------------------------- 1 | 27 | 28 | 29 | Other references and sites of interest to Privoxy 30 | users: 31 | 32 | 33 | 34 | 35 | https://www.privoxy.org/, 37 | the Privoxy Home page. 38 | 39 | 40 | 41 | 42 | https://www.privoxy.org/faq/, 44 | the Privoxy FAQ. 45 | 46 | 47 | 48 | 49 | https://www.privoxy.org/developer-manual/, 51 | the Privoxy developer manual. 52 | 53 | 54 | 55 | 56 | https://sourceforge.net/projects/ijbswa/, 57 | the Project Page for Privoxy on 58 | SourceForge. 59 | 60 | 61 | 62 | 63 | http://config.privoxy.org/, 64 | the web-based user interface. Privoxy must be 65 | running for this to work. Shortcut: http://p.p/ 66 | 67 | 68 | 69 | 70 | https://sourceforge.net/tracker/?group_id=11118&atid=460288, to submit misses and other 71 | configuration related suggestions to the developers. 72 | 73 | 74 | 76 | 77 | 78 | http://www.squid-cache.org/, a popular 79 | caching proxy, which is often used together with Privoxy. 80 | 81 | 82 | 83 | 84 | http://www.pps.univ-paris-diderot.fr/~jch/software/polipo/, 85 | Polipo is a caching proxy with advanced features 86 | like pipelining, multiplexing and caching of partial instances. In many setups 87 | it can be used as Squid replacement. 88 | 89 | 90 | 91 | 92 | https://www.torproject.org/, 93 | Tor can help anonymize web browsing, 94 | web publishing, instant messaging, IRC, SSH, and other applications. 95 | 96 | 97 | ]]> 98 | 99 | -------------------------------------------------------------------------------- /src/doc/source/supported.sgml: -------------------------------------------------------------------------------- 1 | 24 | 25 | At present, Privoxy is known to run on 26 | Windows 95 and later versions (98, ME, 2000, XP, Vista, Windows 7 etc.), 27 | GNU/Linux (RedHat, SuSE, Debian, Fedora, Gentoo, Slackware and others), 28 | Mac OS X (10.4 and upwards on PPC and Intel processors), 29 | OS/2, 30 | Haiku, 31 | DragonFly, ElectroBSD, FreeBSD, NetBSD, OpenBSD, 32 | Solaris, 33 | and various other flavors of Unix. 34 | 35 | 36 | 38 | But any operating system that runs TCP/IP, can conceivably take advantage of 39 | Privoxy in a networked situation where 40 | Privoxy would run as a server on a LAN gateway. 41 | Then only the gateway needs to be running one of the above 42 | operating systems. 43 | 44 | 45 | 46 | Source code is freely available, so porting to other operating systems 47 | is always a possibility. 48 | 49 | ]]> 50 | -------------------------------------------------------------------------------- /src/doc/webserver/README.txt: -------------------------------------------------------------------------------- 1 | All files contained in this directory should eventually be 2 | on the project's homepage 3 | 4 | ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/ 5 | 6 | which is indeed http://ijbswa.sourceforge.net 7 | and http://www.privoxy.org/. 8 | 9 | -Stefan, April 2002 -------------------------------------------------------------------------------- /src/doc/webserver/developer-manual/introduction.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Introduction 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 27 |
28 |

1. Introduction

29 |

Privoxy, as an heir to Junkbuster, is a Free 30 | Software project and the code is licensed under the GNU General Public License version 2. As such, Privoxy development is potentially open to anyone who has the time, knowledge, and desire to 32 | contribute in any capacity. Our goals are simply to continue the mission, to improve Privoxy, and to make it available to as wide an audience as possible.

34 |

One does not have to be a programmer to contribute. Packaging, testing, documenting and porting, are all 35 | important jobs as well.

36 |
37 |

1.1. Quickstart to Privoxy Development

38 |

The first step is to join the privoxy-devel mailing list. You can submit your ideas or, even better, patches. Patches are best 40 | submitted to the Sourceforge tracker set up for this purpose, but can be sent to the list for review too.

41 |

You will also need to have a git package installed, which will entail having ssh installed as well, in order 42 | to access the git repository. Having the GNU build tools is also going to be important (particularly, autoconf 43 | and gmake).

44 |

For the time being (read, this section is under construction), you can also refer to the extensive comments in 45 | the source code. In fact, reading the code is recommended in any case.

46 |
47 |
48 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/doc/webserver/error-favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/error-favicon.ico -------------------------------------------------------------------------------- /src/doc/webserver/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/favicon.ico -------------------------------------------------------------------------------- /src/doc/webserver/images/files-in-use.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/images/files-in-use.jpg -------------------------------------------------------------------------------- /src/doc/webserver/images/proxy_setup.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/images/proxy_setup.jpg -------------------------------------------------------------------------------- /src/doc/webserver/man-page/privoxy-man-page.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/man-page/privoxy-man-page.html -------------------------------------------------------------------------------- /src/doc/webserver/p_doc.css: -------------------------------------------------------------------------------- 1 | /* 2 | * CSS for Privoxy documentation 3 | * 4 | */ 5 | 6 | /* 7 | * Global fonts, colors, margins: 8 | */ 9 | body,td,th { font-family: arial, helvetica, sans-serif; } 10 | body { margin: 4%; color: #000000; background-color: #eeeeee; } 11 | 12 | /* 13 | * Headings hierarchy in terms of size and color: 14 | */ 15 | h1 { color: #4c000f; font-size: 160%; } 16 | h2 { color: #660014; font-size: 140%; } 17 | h3 { color: #820019; font-size: 120%; } 18 | h4 { color: #99001d; font-size: 110%; } 19 | 20 | /* 21 | * Make headings stand out: 22 | * Indent all content in chapters, by additional 2%, 23 | * and then pull the headings back left. 24 | */ 25 | div.sect1 { margin-left: 2%; } 26 | h1,h2,h3,h4 {margin-left: -2%; } 27 | h1.title { margin-left: 0; } 28 | h2.subtitle { margin-left: 0; } 29 | 30 | /* 31 | * Underlined links disturb the examples; 32 | * Let them get darker instead of purple after visited. 33 | */ 34 | a { text-decoration: none; } 35 | a:link { color: #0c29ff; } 36 | a:visited { color: #071899; } 37 | 38 | /* 39 | * Special highlighting: 40 | * Code examples in embedded in the text flow become half-bold, 41 | * Emphasis gets h4-red. 42 | * Warnings get the same bg as in privoxy.css 43 | */ 44 | tt.literal { font-weight: 600; } 45 | i.emphasis { color: #99001d; } 46 | table.warning { border: 0; background-color: #ffdddd;} 47 | span.guibutton { 48 | white-space: nowrap; 49 | width: auto; 50 | padding: 2px; 51 | background-color: #dddddd; 52 | color: #000000; 53 | text-decoration: none; 54 | border-top: 1px solid #ffffff; 55 | border-left: 1px solid #ffffff; 56 | border-bottom: 1px solid #000000; 57 | border-right: 1px solid #000000; 58 | } 59 | 60 | /* 61 | * Misc: 62 | */ 63 | ul { list-style-type: square; } 64 | /* Privoxy, of course */ 65 | .application {font-weight: bold; font-size:105%; color: #99001d;} 66 | -------------------------------------------------------------------------------- /src/doc/webserver/p_feedback.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Vary the gereneral Privoxy Stlyesheet to 3 | * meet the needs of small popups: 4 | * 5 | */ 6 | body,td,th { font-size:10px; } 7 | div.info { width: 60%; } 8 | div.warning { width: 60%; text-align: left; } 9 | -------------------------------------------------------------------------------- /src/doc/webserver/privoxy.css: -------------------------------------------------------------------------------- 1 | /* 2 | * CSS for Privoxy CGI and script output 3 | * 4 | */ 5 | 6 | /* 7 | * General rules: Font, Color, Headings, Margins, Links 8 | */ 9 | body,td,th { font-family: arial, helvetica, helv, sans-serif; } 10 | body { background-color: #ffffff; color: #000000; } 11 | 12 | h1 { font-size: 140%; margin: 0px; } 13 | h2 { font-size: 120%; margin: 0px; } 14 | h3 { font-size: 110%; margin: 0px; } 15 | 16 | p,pre { margin-left: 15px; } 17 | li { margin: 2px 15px; } 18 | dl { margin: 2px 15px; } 19 | 20 | a:link { color: #0000dd; text-decoration: none; } 21 | a:visited { color: #330099; text-decoration: none; } 22 | a:active { color: #3333ff; text-decoration: none; } 23 | 24 | /* 25 | * Boxen as Table elements: 26 | */ 27 | td.title { border: solid black 1px; background-color: #dddddd; } 28 | td.box { border: solid black 1px; background-color: #eeeeee; } 29 | td.info { border: solid black 1px; background-color: #ccccff; } 30 | td.warning { border: solid black 1px; background-color: #ffdddd; } 31 | 32 | /* 33 | * Special Table Boxen: for nesting, naked container and for 34 | * the Status field in CGI Output: 35 | */ 36 | td.wrapbox { border: solid black 1px; padding: 5px; } 37 | td.container { padding: 0px; } 38 | td.status { border: solid black 1px; background-color: #ff0000; color: #ffffff; font-size: 300%; font-weight: bolder; } 39 | 40 | /* 41 | * Same Boxen as
s: 42 | */ 43 | div.title { border: solid black 1px; background-color: #dddddd; margin: 20px; padding: 20px; } 44 | div.box { border: solid black 1px; background-color: #eeeeee; margin: 20px; padding: 20px; } 45 | div.info { border: solid black 1px; background-color: #ccccff; margin: 20px; padding: 20px; } 46 | div.warning { border: solid black 1px; background-color: #ffdddd; margin: 20px; padding: 20px; } 47 | div.wrapbox { border: solid black 1px; margin: 20px; padding: 5px; } 48 | 49 | 50 | /* 51 | * Bold definitions in
s, Grey BG for Table headings 52 | */ 53 | dt { font-weight: bold; } 54 | th { background-color: #dddddd; } 55 | 56 | /* 57 | * Special purpose paragraphs: Small for page footers, 58 | * Important for quoting wrong or dangerous examples, 59 | * Whiteframed for the toggle?mini=y CGI 60 | */ 61 | p.small { font-size: 10px; margin: 0px; } 62 | p.important { border: solid black 1px; background-color: #ffdddd; font-weight: bold; padding: 2px; } 63 | p.whiteframed { margin: 5px; padding: 5px; border: solid black 1px; text-align: center; background-color: #eeeeee; } 64 | 65 | /* 66 | * Special red emphasis: 67 | */ 68 | em.warning { color: #ff0000 } 69 | -------------------------------------------------------------------------------- /src/doc/webserver/robots.txt: -------------------------------------------------------------------------------- 1 | # This is the Privoxy web site. 2 | # 3 | # If the robot is connecting through Privoxy, then the 4 | # control interface is at /config. It isn't very useful 5 | # to index it, and you're likely to break stuff. So go away! 6 | # 7 | # Even if you're not connected through Privoxy, the 8 | # one "Privoxy is not working" page there is not very 9 | # interesting. 10 | 11 | User-agent: * 12 | Disallow: /config/ 13 | Disallow: /actions/ 14 | Disallow: /submit/ 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/doc/webserver/sponsors/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Privoxy sponsors 6 | 7 | 8 | 9 | 10 | 11 |

Privoxy sponsors

12 |

This page lists Privoxy sponsors and their sponsor 13 | level with the exception of sponsors that preferred not to be listed here.

14 |

Bronze sponsor

15 |

https://www.betrugstest.com/

16 |

Becoming a Privoxy sponsor

17 |

If you want to become a sponsor, please have a look at the sponsor 19 | policy.

20 | 21 | 22 | -------------------------------------------------------------------------------- /src/doc/webserver/team/01stefanw.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/01stefanw.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/01stefanw_t.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/01stefanw_t.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/02jon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/02jon.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/02jon_t.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/02jon_t.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/03andreas.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/03andreas.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/03andreas_t.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/03andreas_t.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/04rodney.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/04rodney.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/04rodney_t.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/04rodney_t.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/05david.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/05david.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/05david_t.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/05david_t.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/05member.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/05member.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/05member_t.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/05member_t.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/06member.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/06member.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/06member_t.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/06member_t.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/07member.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/07member.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/07member_t.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/07member_t.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/08member.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/08member.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/08member_t.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/08member_t.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/20member.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/20member.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/20member_t.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/team/20member_t.jpg -------------------------------------------------------------------------------- /src/doc/webserver/team/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Privoxy - Team Photos 7 | 8 | 13 | 14 | 15 |

Privoxy - Team Photos

16 |
17 |

In our day jobs, we're all models ;-)

18 | 19 | 20 | 22 | 23 | 25 | 27 | 28 | 29 | 31 | 32 | 33 | 34 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /src/doc/webserver/user-manual/files-in-use.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/user-manual/files-in-use.jpg -------------------------------------------------------------------------------- /src/doc/webserver/user-manual/proxy2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/user-manual/proxy2.jpg -------------------------------------------------------------------------------- /src/doc/webserver/user-manual/proxy_setup.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/doc/webserver/user-manual/proxy_setup.jpg -------------------------------------------------------------------------------- /src/encode.h: -------------------------------------------------------------------------------- 1 | #ifndef ENCODE_H_INCLUDED 2 | #define ENCODE_H_INCLUDED 3 | /********************************************************************* 4 | * 5 | * File : $Source: /cvsroot/ijbswa/current/encode.h,v $ 6 | * 7 | * Purpose : Functions to encode and decode URLs, and also to 8 | * encode cookies and HTML text. 9 | * 10 | * Copyright : Written by and Copyright (C) 2001 members of the 11 | * Privoxy team. http://www.privoxy.org/ 12 | * 13 | * Based on the Internet Junkbuster originally written 14 | * by and Copyright (C) 1997 Anonymous Coders and 15 | * Junkbusters Corporation. http://www.junkbusters.com 16 | * 17 | * This program is free software; you can redistribute it 18 | * and/or modify it under the terms of the GNU General 19 | * Public License as published by the Free Software 20 | * Foundation; either version 2 of the License, or (at 21 | * your option) any later version. 22 | * 23 | * This program is distributed in the hope that it will 24 | * be useful, but WITHOUT ANY WARRANTY; without even the 25 | * implied warranty of MERCHANTABILITY or FITNESS FOR A 26 | * PARTICULAR PURPOSE. See the GNU General Public 27 | * License for more details. 28 | * 29 | * The GNU General Public License should be included with 30 | * this file. If not, you can view it at 31 | * http://www.gnu.org/copyleft/gpl.html 32 | * or write to the Free Software Foundation, Inc., 59 33 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 34 | * 35 | *********************************************************************/ 36 | 37 | 38 | extern char * html_encode(const char *s); 39 | extern char * url_encode(const char *s); 40 | extern char * url_decode(const char *str); 41 | extern int xtoi(const char *s); 42 | extern char * html_encode_and_free_original(char *s); 43 | extern char * percent_encode_url(const char *s); 44 | 45 | #endif /* ndef ENCODE_H_INCLUDED */ 46 | 47 | /* 48 | Local Variables: 49 | tab-width: 3 50 | end: 51 | */ 52 | -------------------------------------------------------------------------------- /src/errlog.h: -------------------------------------------------------------------------------- 1 | #ifndef ERRLOG_H_INCLUDED 2 | #define ERRLOG_H_INCLUDED 3 | /********************************************************************* 4 | * 5 | * File : $Source: /cvsroot/ijbswa/current/errlog.h,v $ 6 | * 7 | * Purpose : Log errors to a designated destination in an elegant, 8 | * printf-like fashion. 9 | * 10 | * Copyright : Written by and Copyright (C) 2001-2009 members of the 11 | * Privoxy team. http://www.privoxy.org/ 12 | * 13 | * Based on the Internet Junkbuster originally written 14 | * by and Copyright (C) 1997 Anonymous Coders and 15 | * Junkbusters Corporation. http://www.junkbusters.com 16 | * 17 | * This program is free software; you can redistribute it 18 | * and/or modify it under the terms of the GNU General 19 | * Public License as published by the Free Software 20 | * Foundation; either version 2 of the License, or (at 21 | * your option) any later version. 22 | * 23 | * This program is distributed in the hope that it will 24 | * be useful, but WITHOUT ANY WARRANTY; without even the 25 | * implied warranty of MERCHANTABILITY or FITNESS FOR A 26 | * PARTICULAR PURPOSE. See the GNU General Public 27 | * License for more details. 28 | * 29 | * The GNU General Public License should be included with 30 | * this file. If not, you can view it at 31 | * http://www.gnu.org/copyleft/gpl.html 32 | * or write to the Free Software Foundation, Inc., 59 33 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 34 | * 35 | *********************************************************************/ 36 | 37 | 38 | /* Debug level for errors */ 39 | 40 | /* XXX: Should be renamed. */ 41 | #define LOG_LEVEL_GPC 0x0001 42 | #define LOG_LEVEL_CONNECT 0x0002 43 | #define LOG_LEVEL_IO 0x0004 44 | #define LOG_LEVEL_HEADER 0x0008 45 | #define LOG_LEVEL_WRITING 0x0010 46 | #ifdef FEATURE_FORCE_LOAD 47 | #define LOG_LEVEL_FORCE 0x0020 48 | #endif /* def FEATURE_FORCE_LOAD */ 49 | #define LOG_LEVEL_RE_FILTER 0x0040 50 | #define LOG_LEVEL_REDIRECTS 0x0080 51 | #define LOG_LEVEL_DEANIMATE 0x0100 52 | #define LOG_LEVEL_CLF 0x0200 /* Common Log File format */ 53 | #define LOG_LEVEL_CRUNCH 0x0400 54 | #define LOG_LEVEL_CGI 0x0800 /* CGI / templates */ 55 | #define LOG_LEVEL_RECEIVED 0x8000 56 | #define LOG_LEVEL_ACTIONS 0x10000 57 | #ifdef FUZZ 58 | /* 59 | * Permanently disables logging through log_error(). 60 | * Useful to reduce pointless overhead when fuzzing 61 | * without watching stdout. 62 | */ 63 | #define LOG_LEVEL_STFU 0x20000 64 | #endif 65 | 66 | /* Following are always on: */ 67 | #define LOG_LEVEL_INFO 0x1000 68 | #define LOG_LEVEL_ERROR 0x2000 69 | #define LOG_LEVEL_FATAL 0x4000 /* Exits after writing log */ 70 | 71 | extern void init_error_log(const char *prog_name, const char *logfname); 72 | extern void set_debug_level(int debuglevel); 73 | extern int debug_level_is_enabled(int debuglevel); 74 | extern void disable_logging(void); 75 | extern void init_log_module(void); 76 | extern void show_version(const char *prog_name); 77 | extern void log_error(int loglevel, const char *fmt, ...); 78 | extern const char *jb_err_to_string(jb_err jb_error); 79 | 80 | #endif /* ndef ERRLOG_H_INCLUDED */ 81 | 82 | /* 83 | Local Variables: 84 | tab-width: 3 85 | end: 86 | */ 87 | 88 | -------------------------------------------------------------------------------- /src/gateway.h: -------------------------------------------------------------------------------- 1 | #ifndef GATEWAY_H_INCLUDED 2 | #define GATEWAY_H_INCLUDED 3 | /********************************************************************* 4 | * 5 | * File : $Source: /cvsroot/ijbswa/current/gateway.h,v $ 6 | * 7 | * Purpose : Contains functions to connect to a server, possibly 8 | * using a "gateway" (i.e. HTTP proxy and/or SOCKS4 9 | * proxy). Also contains the list of gateway types. 10 | * 11 | * Copyright : Written by and Copyright (C) 2001-2009 the 12 | * Privoxy team. http://www.privoxy.org/ 13 | * 14 | * Based on the Internet Junkbuster originally written 15 | * by and Copyright (C) 1997 Anonymous Coders and 16 | * Junkbusters Corporation. http://www.junkbusters.com 17 | * 18 | * This program is free software; you can redistribute it 19 | * and/or modify it under the terms of the GNU General 20 | * Public License as published by the Free Software 21 | * Foundation; either version 2 of the License, or (at 22 | * your option) any later version. 23 | * 24 | * This program is distributed in the hope that it will 25 | * be useful, but WITHOUT ANY WARRANTY; without even the 26 | * implied warranty of MERCHANTABILITY or FITNESS FOR A 27 | * PARTICULAR PURPOSE. See the GNU General Public 28 | * License for more details. 29 | * 30 | * The GNU General Public License should be included with 31 | * this file. If not, you can view it at 32 | * http://www.gnu.org/copyleft/gpl.html 33 | * or write to the Free Software Foundation, Inc., 59 34 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 35 | * 36 | *********************************************************************/ 37 | 38 | 39 | struct forward_spec; 40 | struct http_request; 41 | struct client_state; 42 | 43 | extern jb_socket forwarded_connect(const struct forward_spec * fwd, 44 | struct http_request *http, 45 | struct client_state *csp); 46 | 47 | #ifdef FEATURE_CONNECTION_SHARING 48 | extern void initialize_reusable_connections(void); 49 | extern void forget_connection(jb_socket sfd); 50 | extern void remember_connection(const struct reusable_connection *connection); 51 | extern int close_unusable_connections(void); 52 | #endif /* FEATURE_CONNECTION_SHARING */ 53 | 54 | extern void mark_connection_closed(struct reusable_connection *closed_connection); 55 | #ifdef FEATURE_CONNECTION_KEEP_ALIVE 56 | extern int connection_destination_matches(const struct reusable_connection *connection, 57 | const struct http_request *http, 58 | const struct forward_spec *fwd); 59 | #endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ 60 | 61 | #ifdef FUZZ 62 | extern jb_err socks_fuzz(struct client_state *csp); 63 | #endif 64 | 65 | #endif /* ndef GATEWAY_H_INCLUDED */ 66 | 67 | /* 68 | Local Variables: 69 | tab-width: 3 70 | end: 71 | */ 72 | -------------------------------------------------------------------------------- /src/icons/ico00001.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/ico00001.ico -------------------------------------------------------------------------------- /src/icons/ico00002.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/ico00002.ico -------------------------------------------------------------------------------- /src/icons/ico00003.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/ico00003.ico -------------------------------------------------------------------------------- /src/icons/ico00004.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/ico00004.ico -------------------------------------------------------------------------------- /src/icons/ico00005.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/ico00005.ico -------------------------------------------------------------------------------- /src/icons/ico00006.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/ico00006.ico -------------------------------------------------------------------------------- /src/icons/ico00007.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/ico00007.ico -------------------------------------------------------------------------------- /src/icons/ico00008.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/ico00008.ico -------------------------------------------------------------------------------- /src/icons/idle.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/idle.ico -------------------------------------------------------------------------------- /src/icons/off.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/off.ico -------------------------------------------------------------------------------- /src/icons/os2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/os2.ico -------------------------------------------------------------------------------- /src/icons/os20.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/os20.ico -------------------------------------------------------------------------------- /src/icons/os21.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/os21.ico -------------------------------------------------------------------------------- /src/icons/os22.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/os22.ico -------------------------------------------------------------------------------- /src/icons/os23.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/os23.ico -------------------------------------------------------------------------------- /src/icons/os24.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/os24.ico -------------------------------------------------------------------------------- /src/icons/os25.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/os25.ico -------------------------------------------------------------------------------- /src/icons/os26.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/os26.ico -------------------------------------------------------------------------------- /src/icons/os27.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/os27.ico -------------------------------------------------------------------------------- /src/icons/os28.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/os28.ico -------------------------------------------------------------------------------- /src/icons/privoxy.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/privoxy.ico -------------------------------------------------------------------------------- /src/icons/radar-01.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/radar-01.ico -------------------------------------------------------------------------------- /src/icons/radar-02.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/radar-02.ico -------------------------------------------------------------------------------- /src/icons/radar-03.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/radar-03.ico -------------------------------------------------------------------------------- /src/icons/radar-04.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/radar-04.ico -------------------------------------------------------------------------------- /src/icons/radar-05.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/radar-05.ico -------------------------------------------------------------------------------- /src/icons/radar-06.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/radar-06.ico -------------------------------------------------------------------------------- /src/icons/radar-07.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/radar-07.ico -------------------------------------------------------------------------------- /src/icons/radar-08.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/icons/radar-08.ico -------------------------------------------------------------------------------- /src/jbsockets.h: -------------------------------------------------------------------------------- 1 | #ifndef JBSOCKETS_H_INCLUDED 2 | #define JBSOCKETS_H_INCLUDED 3 | /********************************************************************* 4 | * 5 | * File : $Source: /cvsroot/ijbswa/current/jbsockets.h,v $ 6 | * 7 | * Purpose : Contains wrappers for system-specific sockets code, 8 | * so that the rest of Privoxy can be more 9 | * OS-independent. Contains #ifdefs to make this work 10 | * on many platforms. 11 | * 12 | * Copyright : Written by and Copyright (C) 2001-2014 the 13 | * Privoxy team. http://www.privoxy.org/ 14 | * 15 | * Based on the Internet Junkbuster originally written 16 | * by and Copyright (C) 1997 Anonymous Coders and 17 | * Junkbusters Corporation. http://www.junkbusters.com 18 | * 19 | * This program is free software; you can redistribute it 20 | * and/or modify it under the terms of the GNU General 21 | * Public License as published by the Free Software 22 | * Foundation; either version 2 of the License, or (at 23 | * your option) any later version. 24 | * 25 | * This program is distributed in the hope that it will 26 | * be useful, but WITHOUT ANY WARRANTY; without even the 27 | * implied warranty of MERCHANTABILITY or FITNESS FOR A 28 | * PARTICULAR PURPOSE. See the GNU General Public 29 | * License for more details. 30 | * 31 | * The GNU General Public License should be included with 32 | * this file. If not, you can view it at 33 | * http://www.gnu.org/copyleft/gpl.html 34 | * or write to the Free Software Foundation, Inc., 59 35 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 36 | * 37 | *********************************************************************/ 38 | 39 | 40 | #include "project.h" 41 | 42 | struct client_state; 43 | 44 | extern jb_socket connect_to(const char *host, int portnum, struct client_state *csp); 45 | extern int write_socket(jb_socket fd, const char *buf, size_t n); 46 | extern int write_socket_delayed(jb_socket fd, const char *buf, size_t len, unsigned int delay); 47 | extern int read_socket(jb_socket fd, char *buf, int n); 48 | extern int data_is_available(jb_socket fd, int seconds_to_wait); 49 | extern void close_socket(jb_socket fd); 50 | extern void drain_and_close_socket(jb_socket fd); 51 | 52 | extern int bind_port(const char *hostnam, int portnum, int backlog, jb_socket *pfd); 53 | extern int accept_connection(struct client_state * csp, jb_socket fds[]); 54 | extern void get_host_information(jb_socket afd, char **ip_address, char **port, char **hostname); 55 | 56 | extern unsigned long resolve_hostname_to_ip(const char *host); 57 | 58 | extern int socket_is_still_alive(jb_socket sfd); 59 | 60 | #ifdef FEATURE_EXTERNAL_FILTERS 61 | extern void mark_socket_for_close_on_execute(jb_socket fd); 62 | #endif 63 | 64 | /* 65 | * Solaris workaround 66 | * XXX: still necessary? 67 | */ 68 | #ifndef INADDR_NONE 69 | #define INADDR_NONE -1 70 | #endif 71 | 72 | 73 | #endif /* ndef JBSOCKETS_H_INCLUDED */ 74 | 75 | /* 76 | Local Variables: 77 | tab-width: 3 78 | end: 79 | */ 80 | -------------------------------------------------------------------------------- /src/libprivoxyext.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBPRIVOXYEXT_H_ 2 | #define _LIBPRIVOXYEXT_H_ 3 | 4 | //DNS header structure 5 | struct DNS_HEADER 6 | { 7 | unsigned short id; // identification number 8 | 9 | unsigned char rd : 1; // recursion desired 10 | unsigned char tc : 1; // truncated message 11 | unsigned char aa : 1; // authoritive answer 12 | unsigned char opcode : 4; // purpose of message 13 | unsigned char qr : 1; // query/response flag 14 | 15 | unsigned char rcode : 4; // response code 16 | unsigned char cd : 1; // checking disabled 17 | unsigned char ad : 1; // authenticated data 18 | unsigned char z : 1; // its z! reserved 19 | unsigned char ra : 1; // recursion available 20 | 21 | unsigned short q_count; // number of question entries 22 | unsigned short ans_count; // number of answer entries 23 | unsigned short auth_count; // number of authority entries 24 | unsigned short add_count; // number of resource entries 25 | }; 26 | 27 | //Constant sized fields of query structure 28 | struct QUESTION 29 | { 30 | unsigned short qtype; 31 | unsigned short qclass; 32 | }; 33 | 34 | //Constant sized fields of the resource record structure 35 | #pragma pack(push, 1) 36 | struct R_DATA 37 | { 38 | unsigned short type; 39 | unsigned short _class; 40 | unsigned int ttl; 41 | unsigned short data_len; 42 | }; 43 | #pragma pack(pop) 44 | 45 | //Pointers to resource record contents 46 | struct RES_RECORD 47 | { 48 | unsigned char *name; 49 | struct R_DATA *resource; 50 | unsigned char *rdata; 51 | }; 52 | 53 | //Structure of a Query 54 | typedef struct 55 | { 56 | unsigned char *name; 57 | struct QUESTION *ques; 58 | } QUERY; 59 | 60 | //List of DNS Servers registered on the system 61 | const char **dns_servers; 62 | int dns_servers_count; 63 | 64 | #ifdef WIN32 65 | int gettimeofday(struct timeval *tp, void *tzp); 66 | #endif 67 | 68 | void libprivoxy_exit(int _Code); 69 | 70 | /* this will convert www.google.com to 3www6google3com ;got it :) */ 71 | void libprivoxy_host_to_dns_format(char* dns, const char* host); 72 | 73 | unsigned char* libprivoxy_read_dns_name(unsigned char* reader, unsigned char* buffer, int* count); 74 | 75 | unsigned long libprivoxy_resolve_hostname_to_ip(const char *host); 76 | #endif -------------------------------------------------------------------------------- /src/list.h: -------------------------------------------------------------------------------- 1 | #ifndef LIST_H_INCLUDED 2 | #define LIST_H_INCLUDED 3 | /********************************************************************* 4 | * 5 | * File : $Source: /cvsroot/ijbswa/current/list.h,v $ 6 | * 7 | * Purpose : Declares functions to handle lists. 8 | * Functions declared include: 9 | * `destroy_list', `enlist' and `list_to_text' 10 | * 11 | * Copyright : Written by and Copyright (C) 2001-2007 members of the 12 | * Privoxy team. http://www.privoxy.org/ 13 | * 14 | * Based on the Internet Junkbuster originally written 15 | * by and Copyright (C) 1997 Anonymous Coders and 16 | * Junkbusters Corporation. http://www.junkbusters.com 17 | * 18 | * This program is free software; you can redistribute it 19 | * and/or modify it under the terms of the GNU General 20 | * Public License as published by the Free Software 21 | * Foundation; either version 2 of the License, or (at 22 | * your option) any later version. 23 | * 24 | * This program is distributed in the hope that it will 25 | * be useful, but WITHOUT ANY WARRANTY; without even the 26 | * implied warranty of MERCHANTABILITY or FITNESS FOR A 27 | * PARTICULAR PURPOSE. See the GNU General Public 28 | * License for more details. 29 | * 30 | * The GNU General Public License should be included with 31 | * this file. If not, you can view it at 32 | * http://www.gnu.org/copyleft/gpl.html 33 | * or write to the Free Software Foundation, Inc., 59 34 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 35 | * 36 | *********************************************************************/ 37 | 38 | 39 | #include "project.h" 40 | 41 | /* 42 | * struct list 43 | * 44 | * A linked list class. 45 | */ 46 | 47 | extern void init_list (struct list *the_list); 48 | extern void destroy_list (struct list *the_list); 49 | 50 | extern jb_err enlist (struct list *the_list, const char *str); 51 | extern jb_err enlist_unique (struct list *the_list, const char *str, size_t num_significant_chars); 52 | extern jb_err enlist_unique_header (struct list *the_list, const char *name, const char *value); 53 | extern jb_err enlist_first (struct list *the_list, const char *str); 54 | extern jb_err list_append_list_unique(struct list *dest, const struct list *src); 55 | extern jb_err list_duplicate (struct list *dest, const struct list *src); 56 | 57 | extern int list_remove_item(struct list *the_list, const char *str); 58 | extern int list_remove_list(struct list *dest, const struct list *src); 59 | extern void list_remove_all (struct list *the_list); 60 | 61 | extern int list_is_empty(const struct list *the_list); 62 | 63 | extern char * list_to_text(const struct list *the_list); 64 | 65 | extern int list_contains_item(const struct list *the_list, const char *str); 66 | 67 | /* 68 | * struct map 69 | * 70 | * A class which maps names to values. 71 | * 72 | * Note: You must allocate this through new_map() and free it 73 | * through free_map(). 74 | */ 75 | 76 | extern struct map * new_map (void); 77 | extern void free_map (struct map * the_map); 78 | 79 | extern jb_err map (struct map * the_map, 80 | const char * name, int name_needs_copying, 81 | const char * value, int value_needs_copying); 82 | extern jb_err unmap (struct map *the_map, 83 | const char *name); 84 | extern const char * lookup (const struct map * the_map, const char * name); 85 | 86 | #endif /* ndef LIST_H_INCLUDED */ 87 | 88 | /* 89 | Local Variables: 90 | tab-width: 3 91 | end: 92 | */ 93 | -------------------------------------------------------------------------------- /src/loadcfg.h: -------------------------------------------------------------------------------- 1 | #ifndef LOADCFG_H_INCLUDED 2 | #define LOADCFG_H_INCLUDED 3 | /********************************************************************* 4 | * 5 | * File : $Source: /cvsroot/ijbswa/current/loadcfg.h,v $ 6 | * 7 | * Purpose : Loads settings from the configuration file into 8 | * global variables. This file contains both the 9 | * routine to load the configuration and the global 10 | * variables it writes to. 11 | * 12 | * Copyright : Written by and Copyright (C) 2001 members of the 13 | * Privoxy team. http://www.privoxy.org/ 14 | * 15 | * Based on the Internet Junkbuster originally written 16 | * by and Copyright (C) 1997 Anonymous Coders and 17 | * Junkbusters Corporation. http://www.junkbusters.com 18 | * 19 | * This program is free software; you can redistribute it 20 | * and/or modify it under the terms of the GNU General 21 | * Public License as published by the Free Software 22 | * Foundation; either version 2 of the License, or (at 23 | * your option) any later version. 24 | * 25 | * This program is distributed in the hope that it will 26 | * be useful, but WITHOUT ANY WARRANTY; without even the 27 | * implied warranty of MERCHANTABILITY or FITNESS FOR A 28 | * PARTICULAR PURPOSE. See the GNU General Public 29 | * License for more details. 30 | * 31 | * The GNU General Public License should be included with 32 | * this file. If not, you can view it at 33 | * http://www.gnu.org/copyleft/gpl.html 34 | * or write to the Free Software Foundation, Inc., 59 35 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 36 | * 37 | *********************************************************************/ 38 | 39 | 40 | /* Don't need project.h, only this: */ 41 | struct configuration_spec; 42 | 43 | /* Global variables */ 44 | 45 | #ifdef FEATURE_TOGGLE 46 | /* Privoxy's toggle state */ 47 | extern int global_toggle_state; 48 | #endif /* def FEATURE_TOGGLE */ 49 | 50 | extern const char *configfile; 51 | 52 | 53 | /* The load_config function is now going to call: 54 | * init_proxy_args, so it will need argc and argv. 55 | * Since load_config will also be a signal handler, 56 | * we need to have these globally available. 57 | */ 58 | extern int Argc; 59 | extern char * const * Argv; 60 | extern short int MustReload; 61 | 62 | 63 | extern struct configuration_spec * load_config(void); 64 | 65 | #ifdef FEATURE_GRACEFUL_TERMINATION 66 | void unload_current_config_file(void); 67 | #endif 68 | 69 | #endif /* ndef LOADCFG_H_INCLUDED */ 70 | 71 | /* 72 | Local Variables: 73 | tab-width: 3 74 | end: 75 | */ 76 | -------------------------------------------------------------------------------- /src/match-all.action: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # 3 | # This file contains the actions that are applied to all requests and 4 | # may be overruled later on by other actions files. Less experienced 5 | # users should only edit this file through the actions file editor. 6 | # 7 | ############################################################################# 8 | { \ 9 | +change-x-forwarded-for{block} \ 10 | +client-header-tagger{css-requests} \ 11 | +client-header-tagger{image-requests} \ 12 | +client-header-tagger{range-requests} \ 13 | +hide-from-header{block} \ 14 | +set-image-blocker{pattern} \ 15 | } 16 | / # Match all URLs 17 | -------------------------------------------------------------------------------- /src/mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | errstatus=0 8 | 9 | for file 10 | do 11 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 12 | shift 13 | 14 | pathcomp= 15 | for d 16 | do 17 | pathcomp="$pathcomp$d" 18 | case "$pathcomp" in 19 | -* ) pathcomp=./$pathcomp ;; 20 | esac 21 | 22 | if test ! -d "$pathcomp"; then 23 | echo "mkdir $pathcomp" 24 | 25 | mkdir "$pathcomp" || lasterr=$? 26 | 27 | if test ! -d "$pathcomp"; then 28 | errstatus=$lasterr 29 | fi 30 | fi 31 | 32 | pathcomp="$pathcomp/" 33 | done 34 | done 35 | 36 | exit $errstatus 37 | 38 | # mkinstalldirs ends here 39 | -------------------------------------------------------------------------------- /src/parsers.h: -------------------------------------------------------------------------------- 1 | #ifndef PARSERS_H_INCLUDED 2 | #define PARSERS_H_INCLUDED 3 | /********************************************************************* 4 | * 5 | * File : $Source: /cvsroot/ijbswa/current/parsers.h,v $ 6 | * 7 | * Purpose : Declares functions to parse/crunch headers and pages. 8 | * Functions declared include: 9 | * `add_to_iob', `client_cookie_adder', `client_from', 10 | * `client_referrer', `client_send_cookie', `client_ua', 11 | * `client_uagent', `client_x_forwarded', 12 | * `client_x_forwarded_adder', `client_xtra_adder', 13 | * `content_type', `crumble', `destroy_list', `enlist', 14 | * `flush_socket', `free_http_request', `get_header', 15 | * `list_to_text', `parse_http_request', `sed', 16 | * and `server_set_cookie'. 17 | * 18 | * Copyright : Written by and Copyright (C) 2001 members of the 19 | * Privoxy team. http://www.privoxy.org/ 20 | * 21 | * Based on the Internet Junkbuster originally written 22 | * by and Copyright (C) 1997 Anonymous Coders and 23 | * Junkbusters Corporation. http://www.junkbusters.com 24 | * 25 | * This program is free software; you can redistribute it 26 | * and/or modify it under the terms of the GNU General 27 | * Public License as published by the Free Software 28 | * Foundation; either version 2 of the License, or (at 29 | * your option) any later version. 30 | * 31 | * This program is distributed in the hope that it will 32 | * be useful, but WITHOUT ANY WARRANTY; without even the 33 | * implied warranty of MERCHANTABILITY or FITNESS FOR A 34 | * PARTICULAR PURPOSE. See the GNU General Public 35 | * License for more details. 36 | * 37 | * The GNU General Public License should be included with 38 | * this file. If not, you can view it at 39 | * http://www.gnu.org/copyleft/gpl.html 40 | * or write to the Free Software Foundation, Inc., 59 41 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 42 | * 43 | *********************************************************************/ 44 | 45 | 46 | #include "project.h" 47 | 48 | /* Used for sed()'s second argument. */ 49 | #define FILTER_CLIENT_HEADERS 0 50 | #define FILTER_SERVER_HEADERS 1 51 | 52 | extern long flush_iob(jb_socket fd, struct iob *iob, unsigned int delay); 53 | extern jb_err add_to_iob(struct iob *iob, const size_t buffer_limit, char *src, long n); 54 | extern void clear_iob(struct iob *iob); 55 | extern jb_err decompress_iob(struct client_state *csp); 56 | extern char *get_header(struct iob *iob); 57 | extern char *get_header_value(const struct list *header_list, const char *header_name); 58 | extern jb_err sed(struct client_state *csp, int filter_server_headers); 59 | extern jb_err update_server_headers(struct client_state *csp); 60 | extern void get_http_time(int time_offset, char *buf, size_t buffer_size); 61 | extern jb_err get_destination_from_headers(const struct list *headers, struct http_request *http); 62 | extern unsigned long long get_expected_content_length(struct list *headers); 63 | extern jb_err client_transfer_encoding(struct client_state *csp, char **header); 64 | 65 | #ifdef FEATURE_FORCE_LOAD 66 | extern int strclean(char *string, const char *substring); 67 | #endif /* def FEATURE_FORCE_LOAD */ 68 | 69 | #endif /* ndef PARSERS_H_INCLUDED */ 70 | 71 | /* 72 | Local Variables: 73 | tab-width: 3 74 | end: 75 | */ 76 | -------------------------------------------------------------------------------- /src/pcre/RunTest.in: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This file is generated by configure from RunTest.in. Make any changes 4 | # to that file. 5 | 6 | # Run PCRE tests 7 | 8 | cf=diff 9 | 10 | # Select which tests to run; if no selection, run all 11 | 12 | do1=no 13 | do2=no 14 | do3=no 15 | do4=no 16 | do5=no 17 | do6=no 18 | 19 | while [ $# -gt 0 ] ; do 20 | case $1 in 21 | 1) do1=yes;; 22 | 2) do2=yes;; 23 | 3) do3=yes;; 24 | 4) do4=yes;; 25 | 5) do5=yes;; 26 | 6) do6=yes;; 27 | *) echo "Unknown test number $1"; exit 1;; 28 | esac 29 | shift 30 | done 31 | 32 | if [ "@UTF8@" = "" ] ; then 33 | if [ $do5 = yes ] ; then 34 | echo "Can't run test 5 because UFT8 support is not configured" 35 | exit 1 36 | fi 37 | if [ $do6 = yes ] ; then 38 | echo "Can't run test 6 because UFT8 support is not configured" 39 | exit 1 40 | fi 41 | fi 42 | 43 | if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a\ 44 | $do5 = no -a $do6 = no ] ; then 45 | do1=yes 46 | do2=yes 47 | do3=yes 48 | do4=yes 49 | if [ "@UTF8@" != "" ] ; then do5=yes; fi 50 | if [ "@UTF8@" != "" ] ; then do6=yes; fi 51 | fi 52 | 53 | # Primary test, Perl-compatible 54 | 55 | if [ $do1 = yes ] ; then 56 | echo "Testing main functionality (Perl compatible)" 57 | ./pcretest testdata/testinput1 testtry 58 | if [ $? = 0 ] ; then 59 | $cf testtry testdata/testoutput1 60 | if [ $? != 0 ] ; then exit 1; fi 61 | else exit 1 62 | fi 63 | fi 64 | 65 | # PCRE tests that are not Perl-compatible - API & error tests, mostly 66 | 67 | if [ $do2 = yes ] ; then 68 | echo "Testing API and error handling (not Perl compatible)" 69 | ./pcretest -i testdata/testinput2 testtry 70 | if [ $? = 0 ] ; then 71 | $cf testtry testdata/testoutput2 72 | if [ $? != 0 ] ; then exit 1; fi 73 | else exit 1 74 | fi 75 | fi 76 | 77 | # Additional Perl-compatible tests for Perl 5.005's new features 78 | 79 | if [ $do3 = yes ] ; then 80 | echo "Testing Perl 5.005 features (Perl 5.005 compatible)" 81 | ./pcretest testdata/testinput3 testtry 82 | if [ $? = 0 ] ; then 83 | $cf testtry testdata/testoutput3 84 | if [ $? != 0 ] ; then exit 1; fi 85 | else exit 1 86 | fi 87 | fi 88 | 89 | if [ $do1 = yes -a $do2 = yes -a $do3 = yes ] ; then 90 | echo " " 91 | echo "The three main tests all ran OK" 92 | echo " " 93 | fi 94 | 95 | # Locale-specific tests, provided the "fr" locale is available 96 | 97 | if [ $do4 = yes ] ; then 98 | locale -a | grep '^fr$' >/dev/null 99 | if [ $? -eq 0 ] ; then 100 | echo "Testing locale-specific features (using 'fr' locale)" 101 | ./pcretest testdata/testinput4 testtry 102 | if [ $? = 0 ] ; then 103 | $cf testtry testdata/testoutput4 104 | if [ $? != 0 ] ; then 105 | echo " " 106 | echo "Locale test did not run entirely successfully." 107 | echo "This usually means that there is a problem with the locale" 108 | echo "settings rather than a bug in PCRE." 109 | else 110 | echo "Locale test ran OK" 111 | fi 112 | echo " " 113 | else exit 1 114 | fi 115 | else 116 | echo "Cannot test locale-specific features - 'fr' locale not found," 117 | echo "or the \"locale\" command is not available to check for it." 118 | echo " " 119 | fi 120 | fi 121 | 122 | # Additional tests for UTF8 support 123 | 124 | if [ $do5 = yes ] ; then 125 | echo "Testing experimental, incomplete UTF8 support (Perl compatible)" 126 | ./pcretest testdata/testinput5 testtry 127 | if [ $? = 0 ] ; then 128 | $cf testtry testdata/testoutput5 129 | if [ $? != 0 ] ; then exit 1; fi 130 | else exit 1 131 | fi 132 | echo "UTF8 test ran OK" 133 | echo " " 134 | fi 135 | 136 | if [ $do6 = yes ] ; then 137 | echo "Testing API and internals for UTF8 support (not Perl compatible)" 138 | ./pcretest testdata/testinput6 testtry 139 | if [ $? = 0 ] ; then 140 | $cf testtry testdata/testoutput6 141 | if [ $? != 0 ] ; then exit 1; fi 142 | else exit 1 143 | fi 144 | echo "UTF8 internals test ran OK" 145 | echo " " 146 | fi 147 | 148 | # End 149 | -------------------------------------------------------------------------------- /src/pcre/config.h: -------------------------------------------------------------------------------- 1 | 2 | /* For Privoxy, we just use Privoxy's config.h */ 3 | 4 | #include "../config.h" 5 | 6 | -------------------------------------------------------------------------------- /src/pcre/config.in: -------------------------------------------------------------------------------- 1 | 2 | /* On Unix systems config.in is converted by configure into config.h. PCRE is 3 | written in Standard C, but there are a few non-standard things it can cope 4 | with, allowing it to run on SunOS4 and other "close to standard" systems. 5 | 6 | On a non-Unix system you should just copy this file into config.h and change 7 | the definitions of HAVE_STRERROR and HAVE_MEMMOVE to 1. Unfortunately, because 8 | of the way autoconf works, these cannot be made the defaults. If your system 9 | has bcopy() and not memmove(), change the definition of HAVE_BCOPY instead of 10 | HAVE_MEMMOVE. If your system has neither bcopy() nor memmove(), leave them both 11 | as 0; an emulation function will be used. */ 12 | 13 | /* Define to empty if the keyword does not work. */ 14 | 15 | #undef const 16 | 17 | /* Define to `unsigned' if doesn't define size_t. */ 18 | 19 | #undef size_t 20 | 21 | /* The following two definitions are mainly for the benefit of SunOS4, which 22 | doesn't have the strerror() or memmove() functions that should be present in 23 | all Standard C libraries. The macros HAVE_STRERROR and HAVE_MEMMOVE should 24 | normally be defined with the value 1 for other systems, but unfortunately we 25 | can't make this the default because "configure" files generated by autoconf 26 | will only change 0 to 1; they won't change 1 to 0 if the functions are not 27 | found. If HAVE_MEMMOVE is set to 1, the value of HAVE_BCOPY is not relevant. */ 28 | 29 | #define HAVE_STRERROR 0 30 | #define HAVE_MEMMOVE 0 31 | #define HAVE_BCOPY 0 32 | 33 | /* End */ 34 | -------------------------------------------------------------------------------- /src/pcre/configure.in: -------------------------------------------------------------------------------- 1 | dnl Process this file with autoconf to produce a configure script. 2 | 3 | dnl This is required at the start; the name is the name of a file 4 | dnl it should be seeing, to verify it is in the same directory. 5 | 6 | AC_INIT(dftables.c) 7 | 8 | dnl Arrange to build config.h from config.in. Note that pcre.h is 9 | dnl built differently, as it is just a "substitution" file. 10 | dnl Manual says this macro should come right after AC_INIT. 11 | AC_CONFIG_HEADER(config.h:config.in) 12 | 13 | dnl Provide the current PCRE version information. Do not use numbers 14 | dnl with leading zeros for the minor version, as they end up in a C 15 | dnl macro, and may be treated as octal constants. Stick to single 16 | dnl digits for minor numbers less than 10. There are unlikely to be 17 | dnl that many releases anyway. 18 | 19 | PCRE_MAJOR=3 20 | PCRE_MINOR=4 21 | PCRE_DATE=22-Aug-2000 22 | PCRE_VERSION=${PCRE_MAJOR}.${PCRE_MINOR} 23 | 24 | dnl Provide versioning information for libtool shared libraries that 25 | dnl are built by default on Unix systems. 26 | 27 | PCRE_LIB_VERSION=0:1:0 28 | PCRE_POSIXLIB_VERSION=0:0:0 29 | 30 | dnl Checks for programs. 31 | 32 | AC_PROG_CC 33 | AC_PROG_RANLIB 34 | 35 | dnl Checks for header files. 36 | 37 | AC_HEADER_STDC 38 | AC_CHECK_HEADERS(limits.h) 39 | 40 | dnl Checks for typedefs, structures, and compiler characteristics. 41 | 42 | AC_C_CONST 43 | AC_TYPE_SIZE_T 44 | 45 | dnl Checks for library functions. 46 | 47 | AC_CHECK_FUNCS(bcopy memmove strerror) 48 | 49 | dnl Handle --enable-shared-libraries 50 | 51 | LIBTOOL=./libtool 52 | LIBSUFFIX=la 53 | AC_ARG_ENABLE(shared, 54 | [ --disable-shared build PCRE as a static library], 55 | if test "$enableval" = "no"; then 56 | LIBTOOL= 57 | LIBSUFFIX=a 58 | fi 59 | ) 60 | 61 | dnl Handle --enable-utf8 62 | 63 | AC_ARG_ENABLE(utf8, 64 | [ --enable-utf8 enable UTF8 support (incomplete)], 65 | if test "$enableval" = "yes"; then 66 | UTF8=-DSUPPORT_UTF8 67 | fi 68 | ) 69 | 70 | dnl "Export" these variables 71 | 72 | AC_SUBST(HAVE_MEMMOVE) 73 | AC_SUBST(HAVE_STRERROR) 74 | AC_SUBST(LIBTOOL) 75 | AC_SUBST(LIBSUFFIX) 76 | AC_SUBST(UTF8) 77 | AC_SUBST(PCRE_MAJOR) 78 | AC_SUBST(PCRE_MINOR) 79 | AC_SUBST(PCRE_DATE) 80 | AC_SUBST(PCRE_VERSION) 81 | AC_SUBST(PCRE_LIB_VERSION) 82 | AC_SUBST(PCRE_POSIXLIB_VERSION) 83 | 84 | dnl This must be last; it determines what files are written 85 | AC_OUTPUT(Makefile pcre.h:pcre.in pcre-config:pcre-config.in RunTest:RunTest.in,[chmod a+x RunTest pcre-config]) 86 | -------------------------------------------------------------------------------- /src/pcre/dll.mk: -------------------------------------------------------------------------------- 1 | # dll.mk - auxilary Makefile to easy build dll's for mingw32 target 2 | # ver. 0.6 of 1999-03-25 3 | # 4 | # Homepage of this makefile - http://www.is.lg.ua/~paul/devel/ 5 | # Homepage of original mingw32 project - 6 | # http://www.fu.is.saga-u.ac.jp/~colin/gcc.html 7 | # 8 | # How to use: 9 | # This makefile can: 10 | # 1. Create automatical .def file from list of objects 11 | # 2. Create .dll from objects and .def file, either automatical, or your 12 | # hand-written (maybe) file, which must have same basename as dll 13 | # WARNING! There MUST be object, which name match dll's name. Make sux. 14 | # 3. Create import library from .def (as for .dll, only its name required, 15 | # not dll itself) 16 | # By convention implibs for dll have .dll.a suffix, e.g. libstuff.dll.a 17 | # Why not just libstuff.a? 'Cos that's name for static lib, ok? 18 | # Process divided into 3 phases because: 19 | # 1. Pre-existent .def possible 20 | # 2. Generating implib is enough time-consuming 21 | # 22 | # Variables: 23 | # DLL_LDLIBS - libs for linking dll 24 | # DLL_LDFLAGS - flags for linking dll 25 | # 26 | # By using $(DLL_SUFFIX) instead of 'dll', e.g. stuff.$(DLL_SUFFIX) 27 | # you may help porting makefiles to other platforms 28 | # 29 | # Put this file in your make's include path (e.g. main include dir, for 30 | # more information see include section in make doc). Put in the beginning 31 | # of your own Makefile line "include dll.mk". Specify dependences, e.g.: 32 | # 33 | # Do all stuff in one step 34 | # libstuff.dll.a: $(OBJECTS) stuff.def 35 | # stuff.def: $(OBJECTS) 36 | # 37 | # Steps separated, pre-provided .def, link with user32 38 | # 39 | # DLL_LDLIBS=-luser32 40 | # stuff.dll: $(OBJECTS) 41 | # libstuff.dll.a: $(OBJECTS) 42 | 43 | 44 | DLLWRAP=dllwrap 45 | DLLTOOL=dlltool 46 | 47 | DLL_SUFFIX=dll 48 | 49 | .SUFFIXES: .o .$(DLL_SUFFIX) 50 | 51 | _%.def: %.o 52 | $(DLLTOOL) --export-all --output-def $@ $^ 53 | 54 | %.$(DLL_SUFFIX): %.o 55 | $(DLLWRAP) --dllname $(notdir $@) --driver-name $(CC) --def $*.def -o $@ $(filter %.o,$^) $(DLL_LDFLAGS) $(DLL_LDLIBS) 56 | 57 | lib%.$(DLL_SUFFIX).a:%.def 58 | $(DLLTOOL) --dllname $(notdir $*.dll) --def $< --output-lib $@ 59 | 60 | # End 61 | -------------------------------------------------------------------------------- /src/pcre/doc/NON-UNIX-USE: -------------------------------------------------------------------------------- 1 | Compiling PCRE on non-Unix systems 2 | ---------------------------------- 3 | 4 | If you want to compile PCRE for a non-Unix system, note that it consists 5 | entirely of code written in Standard C, and so should compile successfully 6 | on any machine with a Standard C compiler and library, using normal compiling 7 | commands to do the following: 8 | 9 | (1) Copy or rename the file config.in as config.h, and change the macros that 10 | define HAVE_STRERROR and HAVE_MEMMOVE to define them as 1 rather than 0. 11 | Unfortunately, because of the way Unix autoconf works, the default setting has 12 | to be 0. 13 | 14 | (2) Copy or rename the file pcre.in as pcre.h, and change the macro definitions 15 | for PCRE_MAJOR, PCRE_MINOR, and PCRE_DATE near its start to the values set in 16 | configure.in. 17 | 18 | (3) Compile dftables.c as a stand-alone program, and then run it with 19 | the standard output sent to chartables.c. This generates a set of standard 20 | character tables. 21 | 22 | (4) Compile maketables.c, get.c, study.c and pcre.c and link them all 23 | together into an object library in whichever form your system keeps such 24 | libraries. This is the pcre library (chartables.c gets included by means of an 25 | #include directive). 26 | 27 | (5) Similarly, compile pcreposix.c and link it as the pcreposix library. 28 | 29 | (6) Compile the test program pcretest.c. This needs the functions in the 30 | pcre and pcreposix libraries when linking. 31 | 32 | (7) Run pcretest on the testinput files in the testdata directory, and check 33 | that the output matches the corresponding testoutput files. You must use the 34 | -i option when checking testinput2. 35 | 36 | If you have a system without "configure" but where you can use a Makefile, edit 37 | Makefile.in to create Makefile, substituting suitable values for the variables 38 | at the head of the file. 39 | 40 | Some help in building a Win32 DLL of PCRE in GnuWin32 environments was 41 | contributed by Paul.Sokolovsky@technologist.com. These environments are 42 | Mingw32 (http://www.xraylith.wisc.edu/~khan/software/gnu-win32/) and 43 | CygWin (http://sourceware.cygnus.com/cygwin/). Paul comments: 44 | 45 | For CygWin, set CFLAGS=-mno-cygwin, and do 'make dll'. You'll get 46 | pcre.dll (containing pcreposix also), libpcre.dll.a, and dynamically 47 | linked pgrep and pcretest. If you have /bin/sh, run RunTest (three 48 | main test go ok, locale not supported). 49 | 50 | **** 51 | -------------------------------------------------------------------------------- /src/pcre/doc/authors: -------------------------------------------------------------------------------- 1 | Written by: Philip Hazel 2 | 3 | University of Cambridge Computing Service, 4 | Cambridge, England. Phone: +44 1223 334714. 5 | 6 | Copyright (c) 1997-2000 University of Cambridge 7 | -------------------------------------------------------------------------------- /src/pcre/doc/copying: -------------------------------------------------------------------------------- 1 | PCRE LICENCE 2 | ------------ 3 | 4 | PCRE is a library of functions to support regular expressions whose syntax 5 | and semantics are as close as possible to those of the Perl 5 language. 6 | 7 | Written by: Philip Hazel 8 | 9 | University of Cambridge Computing Service, 10 | Cambridge, England. Phone: +44 1223 334714. 11 | 12 | Copyright (c) 1997-2000 University of Cambridge 13 | 14 | Permission is granted to anyone to use this software for any purpose on any 15 | computer system, and to redistribute it freely, subject to the following 16 | restrictions: 17 | 18 | 1. This software is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 21 | 22 | 2. The origin of this software must not be misrepresented, either by 23 | explicit claim or by omission. In practice, this means that if you use 24 | PCRE in software which you distribute to others, commercially or 25 | otherwise, you must put a sentence like this 26 | 27 | Regular expression support is provided by the PCRE library package, 28 | which is open source software, written by Philip Hazel, and copyright 29 | by the University of Cambridge, England. 30 | 31 | somewhere reasonably visible in your documentation and in any relevant 32 | files or online help data or similar. A reference to the ftp site for 33 | the source, that is, to 34 | 35 | ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ 36 | 37 | should also be given in the documentation. 38 | 39 | 3. Altered versions must be plainly marked as such, and must not be 40 | misrepresented as being the original software. 41 | 42 | 4. If PCRE is embedded in any software that is released under the GNU 43 | General Purpose Licence (GPL), then the terms of that licence shall 44 | supersede any condition above with which it is incompatible. 45 | 46 | End 47 | -------------------------------------------------------------------------------- /src/pcre/doc/news: -------------------------------------------------------------------------------- 1 | News about PCRE releases 2 | ------------------------ 3 | 4 | Release 3.3 01-Aug-00 5 | --------------------- 6 | 7 | There is some support for UTF-8 character strings. This is incomplete and 8 | experimental. The documentation describes what is and what is not implemented. 9 | Otherwise, this is just a bug-fixing release. 10 | 11 | 12 | Release 3.0 01-Feb-00 13 | --------------------- 14 | 15 | 1. A "configure" script is now used to configure PCRE for Unix systems. It 16 | builds a Makefile, a config.h file, and the pcre-config script. 17 | 18 | 2. PCRE is built as a shared library by default. 19 | 20 | 3. There is support for POSIX classes such as [:alpha:]. 21 | 22 | 5. There is an experimental recursion feature. 23 | 24 | ---------------------------------------------------------------------------- 25 | IMPORTANT FOR THOSE UPGRADING FROM VERSIONS BEFORE 2.00 26 | 27 | Please note that there has been a change in the API such that a larger 28 | ovector is required at matching time, to provide some additional workspace. 29 | The new man page has details. This change was necessary in order to support 30 | some of the new functionality in Perl 5.005. 31 | 32 | IMPORTANT FOR THOSE UPGRADING FROM VERSION 2.00 33 | 34 | Another (I hope this is the last!) change has been made to the API for the 35 | pcre_compile() function. An additional argument has been added to make it 36 | possible to pass over a pointer to character tables built in the current 37 | locale by pcre_maketables(). To use the default tables, this new arguement 38 | should be passed as NULL. 39 | 40 | IMPORTANT FOR THOSE UPGRADING FROM VERSION 2.05 41 | 42 | Yet another (and again I hope this really is the last) change has been made 43 | to the API for the pcre_exec() function. An additional argument has been 44 | added to make it possible to start the match other than at the start of the 45 | subject string. This is important if there are lookbehinds. The new man 46 | page has the details, but you just want to convert existing programs, all 47 | you need to do is to stick in a new fifth argument to pcre_exec(), with a 48 | value of zero. For example, change 49 | 50 | pcre_exec(pattern, extra, subject, length, options, ovec, ovecsize) 51 | to 52 | pcre_exec(pattern, extra, subject, length, 0, options, ovec, ovecsize) 53 | 54 | **** 55 | -------------------------------------------------------------------------------- /src/pcre/doc/pcregrep.1: -------------------------------------------------------------------------------- 1 | .TH PCREGREP 1 2 | .SH NAME 3 | pcregrep - a grep with Perl-compatible regular expressions. 4 | .SH SYNOPSIS 5 | .B pcregrep [-Vchilnsvx] pattern [file] ... 6 | 7 | 8 | .SH DESCRIPTION 9 | \fBpcregrep\fR searches files for character patterns, in the same way as other 10 | grep commands do, but it uses the PCRE regular expression library to support 11 | patterns that are compatible with the regular expressions of Perl 5. See 12 | \fBpcre(3)\fR for a full description of syntax and semantics. 13 | 14 | If no files are specified, \fBpcregrep\fR reads the standard input. By default, 15 | each line that matches the pattern is copied to the standard output, and if 16 | there is more than one file, the file name is printed before each line of 17 | output. However, there are options that can change how \fBpcregrep\fR behaves. 18 | 19 | Lines are limited to BUFSIZ characters. BUFSIZ is defined in \fB\fR. 20 | The newline character is removed from the end of each line before it is matched 21 | against the pattern. 22 | 23 | 24 | .SH OPTIONS 25 | .TP 10 26 | \fB-V\fR 27 | Write the version number of the PCRE library being used to the standard error 28 | stream. 29 | .TP 30 | \fB-c\fR 31 | Do not print individual lines; instead just print a count of the number of 32 | lines that would otherwise have been printed. If several files are given, a 33 | count is printed for each of them. 34 | .TP 35 | \fB-h\fR 36 | Suppress printing of filenames when searching multiple files. 37 | .TP 38 | \fB-i\fR 39 | Ignore upper/lower case distinctions during comparisons. 40 | .TP 41 | \fB-l\fR 42 | Instead of printing lines from the files, just print the names of the files 43 | containing lines that would have been printed. Each file name is printed 44 | once, on a separate line. 45 | .TP 46 | \fB-n\fR 47 | Precede each line by its line number in the file. 48 | .TP 49 | \fB-s\fR 50 | Work silently, that is, display nothing except error messages. 51 | The exit status indicates whether any matches were found. 52 | .TP 53 | \fB-v\fR 54 | Invert the sense of the match, so that lines which do \fInot\fR match the 55 | pattern are now the ones that are found. 56 | .TP 57 | \fB-x\fR 58 | Force the pattern to be anchored (it must start matching at the beginning of 59 | the line) and in addition, require it to match the entire line. This is 60 | equivalent to having ^ and $ characters at the start and end of each 61 | alternative branch in the regular expression. 62 | 63 | 64 | .SH SEE ALSO 65 | \fBpcre(3)\fR, Perl 5 documentation 66 | 67 | 68 | .SH DIAGNOSTICS 69 | Exit status is 0 if any matches were found, 1 if no matches were found, and 2 70 | for syntax errors or inacessible files (even if matches were found). 71 | 72 | 73 | .SH AUTHOR 74 | Philip Hazel 75 | .br 76 | Copyright (c) 1997-2000 University of Cambridge. 77 | -------------------------------------------------------------------------------- /src/pcre/doc/pcregrep.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | pcregrep specification 4 | 5 | 6 |

pcregrep specification

7 | This HTML document has been generated automatically from the original man page. 8 | If there is any nonsense in it, please consult the man page in case the 9 | conversion went wrong. 10 | 19 |
  • NAME 20 |

    21 | pcregrep - a grep with Perl-compatible regular expressions. 22 |

    23 |
  • SYNOPSIS 24 |

    25 | pcregrep [-Vchilnsvx] pattern [file] ... 26 |

    27 |
  • DESCRIPTION 28 |

    29 | pcregrep searches files for character patterns, in the same way as other 30 | grep commands do, but it uses the PCRE regular expression library to support 31 | patterns that are compatible with the regular expressions of Perl 5. See 32 | pcre(3) for a full description of syntax and semantics. 33 |

    34 |

    35 | If no files are specified, pcregrep reads the standard input. By default, 36 | each line that matches the pattern is copied to the standard output, and if 37 | there is more than one file, the file name is printed before each line of 38 | output. However, there are options that can change how pcregrep behaves. 39 |

    40 |

    41 | Lines are limited to BUFSIZ characters. BUFSIZ is defined in <stdio.h>. 42 | The newline character is removed from the end of each line before it is matched 43 | against the pattern. 44 |

    45 |
  • OPTIONS 46 |

    47 | -V 48 | Write the version number of the PCRE library being used to the standard error 49 | stream. 50 |

    51 |

    52 | -c 53 | Do not print individual lines; instead just print a count of the number of 54 | lines that would otherwise have been printed. If several files are given, a 55 | count is printed for each of them. 56 |

    57 |

    58 | -h 59 | Suppress printing of filenames when searching multiple files. 60 |

    61 |

    62 | -i 63 | Ignore upper/lower case distinctions during comparisons. 64 |

    65 |

    66 | -l 67 | Instead of printing lines from the files, just print the names of the files 68 | containing lines that would have been printed. Each file name is printed 69 | once, on a separate line. 70 |

    71 |

    72 | -n 73 | Precede each line by its line number in the file. 74 |

    75 |

    76 | -s 77 | Work silently, that is, display nothing except error messages. 78 | The exit status indicates whether any matches were found. 79 |

    80 |

    81 | -v 82 | Invert the sense of the match, so that lines which do not match the 83 | pattern are now the ones that are found. 84 |

    85 |

    86 | -x 87 | Force the pattern to be anchored (it must start matching at the beginning of 88 | the line) and in addition, require it to match the entire line. This is 89 | equivalent to having ^ and $ characters at the start and end of each 90 | alternative branch in the regular expression. 91 |

    92 |
  • SEE ALSO 93 |

    94 | pcre(3), Perl 5 documentation 95 |

    96 |
  • DIAGNOSTICS 97 |

    98 | Exit status is 0 if any matches were found, 1 if no matches were found, and 2 99 | for syntax errors or inacessible files (even if matches were found). 100 |

    101 |
  • AUTHOR 102 |

    103 | Philip Hazel <ph10@cam.ac.uk> 104 |
    105 | Copyright (c) 1997-2000 University of Cambridge. 106 | -------------------------------------------------------------------------------- /src/pcre/doc/pcregrep.txt: -------------------------------------------------------------------------------- 1 | NAME 2 | pcregrep - a grep with Perl-compatible regular expressions. 3 | 4 | 5 | 6 | SYNOPSIS 7 | pcregrep [-Vchilnsvx] pattern [file] ... 8 | 9 | 10 | 11 | DESCRIPTION 12 | pcregrep searches files for character patterns, in the same 13 | way as other grep commands do, but it uses the PCRE regular 14 | expression library to support patterns that are compatible 15 | with the regular expressions of Perl 5. See pcre(3) for a 16 | full description of syntax and semantics. 17 | 18 | If no files are specified, pcregrep reads the standard 19 | input. By default, each line that matches the pattern is 20 | copied to the standard output, and if there is more than one 21 | file, the file name is printed before each line of output. 22 | However, there are options that can change how pcregrep 23 | behaves. 24 | 25 | Lines are limited to BUFSIZ characters. BUFSIZ is defined in 26 | . The newline character is removed from the end of 27 | each line before it is matched against the pattern. 28 | 29 | 30 | 31 | OPTIONS 32 | -V Write the version number of the PCRE library being 33 | used to the standard error stream. 34 | 35 | -c Do not print individual lines; instead just print 36 | a count of the number of lines that would other- 37 | wise have been printed. If several files are 38 | given, a count is printed for each of them. 39 | 40 | -h Suppress printing of filenames when searching mul- 41 | tiple files. 42 | 43 | -i Ignore upper/lower case distinctions during com- 44 | parisons. 45 | 46 | -l Instead of printing lines from the files, just 47 | print the names of the files containing lines that 48 | would have been printed. Each file name is printed 49 | once, on a separate line. 50 | 51 | -n Precede each line by its line number in the file. 52 | 53 | -s Work silently, that is, display nothing except 54 | error messages. The exit status indicates whether 55 | any matches were found. 56 | 57 | -v Invert the sense of the match, so that lines which 58 | do not match the pattern are now the ones that are 59 | found. 60 | 61 | -x Force the pattern to be anchored (it must start 62 | matching at the beginning of the line) and in 63 | addition, require it to match the entire line. 64 | This is equivalent to having ^ and $ characters at 65 | the start and end of each alternative branch in 66 | the regular expression. 67 | 68 | 69 | 70 | SEE ALSO 71 | pcre(3), Perl 5 documentation 72 | 73 | 74 | 75 | 76 | 77 | DIAGNOSTICS 78 | Exit status is 0 if any matches were found, 1 if no matches 79 | were found, and 2 for syntax errors or inacessible files 80 | (even if matches were found). 81 | 82 | 83 | 84 | AUTHOR 85 | Philip Hazel 86 | Copyright (c) 1997-2000 University of Cambridge. 87 | 88 | -------------------------------------------------------------------------------- /src/pcre/doc/perltest.txt: -------------------------------------------------------------------------------- 1 | The perltest program 2 | -------------------- 3 | 4 | The perltest program tests Perl's regular expressions; it has the same 5 | specification as pcretest, and so can be given identical input, except that 6 | input patterns can be followed only by Perl's lower case modifiers and /+ (as 7 | used by pcretest), which is recognized and handled by the program. 8 | 9 | The data lines are processed as Perl double-quoted strings, so if they contain 10 | " \ $ or @ characters, these have to be escaped. For this reason, all such 11 | characters in testinput1 and testinput3 are escaped so that they can be used 12 | for perltest as well as for pcretest, and the special upper case modifiers such 13 | as /A that pcretest recognizes are not used in these files. The output should 14 | be identical, apart from the initial identifying banner. 15 | 16 | For testing UTF-8 features, an alternative form of perltest, called perltest8, 17 | is supplied. This requires Perl 5.6 or higher. It recognizes the special 18 | modifier /8 that pcretest uses to invoke UTF-8 functionality. The testinput5 19 | file can be fed to perltest8. 20 | 21 | The testinput2 and testinput4 files are not suitable for feeding to perltest, 22 | since they do make use of the special upper case modifiers and escapes that 23 | pcretest uses to test some features of PCRE. The first of these files also 24 | contains malformed regular expressions, in order to check that PCRE diagnoses 25 | them correctly. Similarly, testinput6 tests UTF-8 features that do not relate 26 | to Perl. 27 | 28 | Philip Hazel 29 | August 2000 30 | -------------------------------------------------------------------------------- /src/pcre/licence: -------------------------------------------------------------------------------- 1 | PCRE LICENCE 2 | ------------ 3 | 4 | PCRE is a library of functions to support regular expressions whose syntax 5 | and semantics are as close as possible to those of the Perl 5 language. 6 | 7 | Written by: Philip Hazel 8 | 9 | University of Cambridge Computing Service, 10 | Cambridge, England. Phone: +44 1223 334714. 11 | 12 | Copyright (c) 1997-2000 University of Cambridge 13 | 14 | Permission is granted to anyone to use this software for any purpose on any 15 | computer system, and to redistribute it freely, subject to the following 16 | restrictions: 17 | 18 | 1. This software is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 21 | 22 | 2. The origin of this software must not be misrepresented, either by 23 | explicit claim or by omission. In practice, this means that if you use 24 | PCRE in software which you distribute to others, commercially or 25 | otherwise, you must put a sentence like this 26 | 27 | Regular expression support is provided by the PCRE library package, 28 | which is open source software, written by Philip Hazel, and copyright 29 | by the University of Cambridge, England. 30 | 31 | somewhere reasonably visible in your documentation and in any relevant 32 | files or online help data or similar. A reference to the ftp site for 33 | the source, that is, to 34 | 35 | ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ 36 | 37 | should also be given in the documentation. 38 | 39 | 3. Altered versions must be plainly marked as such, and must not be 40 | misrepresented as being the original software. 41 | 42 | 4. If PCRE is embedded in any software that is released under the GNU 43 | General Purpose Licence (GPL), then the terms of that licence shall 44 | supersede any condition above with which it is incompatible. 45 | 46 | End 47 | -------------------------------------------------------------------------------- /src/pcre/pcre-config: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | prefix=/usr/local 4 | exec_prefix=${prefix} 5 | exec_prefix_set=no 6 | 7 | usage="\ 8 | Usage: pcre-config [--prefix] [--exec-prefix] [--version] [--libs] [--libs-posix] [--cflags] [--cflags-posix]" 9 | 10 | if test $# -eq 0; then 11 | echo "${usage}" 1>&2 12 | exit 1 13 | fi 14 | 15 | while test $# -gt 0; do 16 | case "$1" in 17 | -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; 18 | *) optarg= ;; 19 | esac 20 | 21 | case $1 in 22 | --prefix=*) 23 | prefix=$optarg 24 | if test $exec_prefix_set = no ; then 25 | exec_prefix=$optarg 26 | fi 27 | ;; 28 | --prefix) 29 | echo $prefix 30 | ;; 31 | --exec-prefix=*) 32 | exec_prefix=$optarg 33 | exec_prefix_set=yes 34 | ;; 35 | --exec-prefix) 36 | echo $exec_prefix 37 | ;; 38 | --version) 39 | echo 3.4 40 | ;; 41 | --cflags | --cflags-posix) 42 | if test ${prefix}/include != /usr/include ; then 43 | includes=-I${prefix}/include 44 | fi 45 | echo $includes 46 | ;; 47 | --libs-posix) 48 | echo -L${exec_prefix}/lib -lpcreposix -lpcre 49 | ;; 50 | --libs) 51 | echo -L${exec_prefix}/lib -lpcre 52 | ;; 53 | *) 54 | echo "${usage}" 1>&2 55 | exit 1 56 | ;; 57 | esac 58 | shift 59 | done 60 | -------------------------------------------------------------------------------- /src/pcre/pcre-config.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | exec_prefix_set=no 6 | 7 | usage="\ 8 | Usage: pcre-config [--prefix] [--exec-prefix] [--version] [--libs] [--libs-posix] [--cflags] [--cflags-posix]" 9 | 10 | if test $# -eq 0; then 11 | echo "${usage}" 1>&2 12 | exit 1 13 | fi 14 | 15 | while test $# -gt 0; do 16 | case "$1" in 17 | -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; 18 | *) optarg= ;; 19 | esac 20 | 21 | case $1 in 22 | --prefix=*) 23 | prefix=$optarg 24 | if test $exec_prefix_set = no ; then 25 | exec_prefix=$optarg 26 | fi 27 | ;; 28 | --prefix) 29 | echo $prefix 30 | ;; 31 | --exec-prefix=*) 32 | exec_prefix=$optarg 33 | exec_prefix_set=yes 34 | ;; 35 | --exec-prefix) 36 | echo $exec_prefix 37 | ;; 38 | --version) 39 | echo @PCRE_VERSION@ 40 | ;; 41 | --cflags | --cflags-posix) 42 | if test @includedir@ != /usr/include ; then 43 | includes=-I@includedir@ 44 | fi 45 | echo $includes 46 | ;; 47 | --libs-posix) 48 | echo -L@libdir@ -lpcreposix -lpcre 49 | ;; 50 | --libs) 51 | echo -L@libdir@ -lpcre 52 | ;; 53 | *) 54 | echo "${usage}" 1>&2 55 | exit 1 56 | ;; 57 | esac 58 | shift 59 | done 60 | -------------------------------------------------------------------------------- /src/pcre/pcre.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | 3 | pcre_malloc DATA 4 | pcre_free DATA 5 | 6 | pcre_compile 7 | pcre_copy_substring 8 | pcre_exec 9 | pcre_get_substring 10 | pcre_get_substring_list 11 | pcre_info 12 | pcre_maketables 13 | pcre_study 14 | pcre_version 15 | 16 | regcomp 17 | regexec 18 | regerror 19 | regfree 20 | -------------------------------------------------------------------------------- /src/pcre/pcre.h: -------------------------------------------------------------------------------- 1 | /************************************************* 2 | * Perl-Compatible Regular Expressions * 3 | *************************************************/ 4 | 5 | /* Copyright (c) 1997-2000 University of Cambridge */ 6 | 7 | #ifndef _PCRE_H 8 | #define _PCRE_H 9 | 10 | /* The file pcre.h is build by "configure". Do not edit it; instead 11 | make changes to pcre.in. */ 12 | 13 | #define PCRE_MAJOR 3 14 | #define PCRE_MINOR 4 15 | #define PCRE_DATE 22-Aug-2000 16 | 17 | /* Win32 uses DLL by default */ 18 | 19 | #ifdef _WIN32 20 | # ifdef STATIC_PCRE 21 | # define PCRE_DL_IMPORT 22 | # else 23 | # define PCRE_DL_IMPORT __declspec(dllimport) 24 | # endif 25 | #else 26 | # define PCRE_DL_IMPORT 27 | #endif 28 | 29 | /* Have to include stdlib.h in order to ensure that size_t is defined; 30 | it is needed here for malloc. */ 31 | 32 | #include 33 | 34 | /* Allow for C++ users */ 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /* Options */ 41 | 42 | #define PCRE_CASELESS 0x0001 43 | #define PCRE_MULTILINE 0x0002 44 | #define PCRE_DOTALL 0x0004 45 | #define PCRE_EXTENDED 0x0008 46 | #define PCRE_ANCHORED 0x0010 47 | #define PCRE_DOLLAR_ENDONLY 0x0020 48 | #define PCRE_EXTRA 0x0040 49 | #define PCRE_NOTBOL 0x0080 50 | #define PCRE_NOTEOL 0x0100 51 | #define PCRE_UNGREEDY 0x0200 52 | #define PCRE_NOTEMPTY 0x0400 53 | #define PCRE_UTF8 0x0800 54 | 55 | /* Exec-time and get-time error codes */ 56 | 57 | #define PCRE_ERROR_NOMATCH (-1) 58 | #define PCRE_ERROR_NULL (-2) 59 | #define PCRE_ERROR_BADOPTION (-3) 60 | #define PCRE_ERROR_BADMAGIC (-4) 61 | #define PCRE_ERROR_UNKNOWN_NODE (-5) 62 | #define PCRE_ERROR_NOMEMORY (-6) 63 | #define PCRE_ERROR_NOSUBSTRING (-7) 64 | 65 | /* Request types for pcre_fullinfo() */ 66 | 67 | #define PCRE_INFO_OPTIONS 0 68 | #define PCRE_INFO_SIZE 1 69 | #define PCRE_INFO_CAPTURECOUNT 2 70 | #define PCRE_INFO_BACKREFMAX 3 71 | #define PCRE_INFO_FIRSTCHAR 4 72 | #define PCRE_INFO_FIRSTTABLE 5 73 | #define PCRE_INFO_LASTLITERAL 6 74 | 75 | /* Types */ 76 | 77 | typedef void pcre; 78 | typedef void pcre_extra; 79 | 80 | /* Store get and free functions. These can be set to alternative malloc/free 81 | functions if required. Some magic is required for Win32 DLL; it is null on 82 | other OS. */ 83 | 84 | PCRE_DL_IMPORT extern void *(*pcre_malloc)(size_t); 85 | PCRE_DL_IMPORT extern void (*pcre_free)(void *); 86 | 87 | #undef PCRE_DL_IMPORT 88 | 89 | /* Functions */ 90 | 91 | extern pcre *pcre_compile(const char *, int, const char **, int *, 92 | const unsigned char *); 93 | extern int pcre_copy_substring(const char *, int *, int, int, char *, int); 94 | extern int pcre_exec(const pcre *, const pcre_extra *, const char *, 95 | int, int, int, int *, int); 96 | extern void pcre_free_substring(const char *); 97 | extern void pcre_free_substring_list(const char **); 98 | extern int pcre_get_substring(const char *, int *, int, int, const char **); 99 | extern int pcre_get_substring_list(const char *, int *, int, const char ***); 100 | extern int pcre_info(const pcre *, int *, int *); 101 | extern int pcre_fullinfo(const pcre *, const pcre_extra *, int, void *); 102 | extern unsigned const char *pcre_maketables(void); 103 | extern pcre_extra *pcre_study(const pcre *, int, const char **); 104 | extern const char *pcre_version(void); 105 | 106 | #ifdef __cplusplus 107 | } /* extern "C" */ 108 | #endif 109 | 110 | #endif /* End of pcre.h */ 111 | -------------------------------------------------------------------------------- /src/pcre/pcre.in: -------------------------------------------------------------------------------- 1 | /************************************************* 2 | * Perl-Compatible Regular Expressions * 3 | *************************************************/ 4 | 5 | /* Copyright (c) 1997-2000 University of Cambridge */ 6 | 7 | #ifndef _PCRE_H 8 | #define _PCRE_H 9 | 10 | /* The file pcre.h is build by "configure". Do not edit it; instead 11 | make changes to pcre.in. */ 12 | 13 | #define PCRE_MAJOR @PCRE_MAJOR@ 14 | #define PCRE_MINOR @PCRE_MINOR@ 15 | #define PCRE_DATE @PCRE_DATE@ 16 | 17 | /* Win32 uses DLL by default */ 18 | 19 | #ifdef _WIN32 20 | # ifdef STATIC_PCRE 21 | # define PCRE_DL_IMPORT 22 | # else 23 | # define PCRE_DL_IMPORT __declspec(dllimport) 24 | # endif 25 | #else 26 | # define PCRE_DL_IMPORT 27 | #endif 28 | 29 | /* Have to include stdlib.h in order to ensure that size_t is defined; 30 | it is needed here for malloc. */ 31 | 32 | #include 33 | 34 | /* Allow for C++ users */ 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /* Options */ 41 | 42 | #define PCRE_CASELESS 0x0001 43 | #define PCRE_MULTILINE 0x0002 44 | #define PCRE_DOTALL 0x0004 45 | #define PCRE_EXTENDED 0x0008 46 | #define PCRE_ANCHORED 0x0010 47 | #define PCRE_DOLLAR_ENDONLY 0x0020 48 | #define PCRE_EXTRA 0x0040 49 | #define PCRE_NOTBOL 0x0080 50 | #define PCRE_NOTEOL 0x0100 51 | #define PCRE_UNGREEDY 0x0200 52 | #define PCRE_NOTEMPTY 0x0400 53 | #define PCRE_UTF8 0x0800 54 | 55 | /* Exec-time and get-time error codes */ 56 | 57 | #define PCRE_ERROR_NOMATCH (-1) 58 | #define PCRE_ERROR_NULL (-2) 59 | #define PCRE_ERROR_BADOPTION (-3) 60 | #define PCRE_ERROR_BADMAGIC (-4) 61 | #define PCRE_ERROR_UNKNOWN_NODE (-5) 62 | #define PCRE_ERROR_NOMEMORY (-6) 63 | #define PCRE_ERROR_NOSUBSTRING (-7) 64 | 65 | /* Request types for pcre_fullinfo() */ 66 | 67 | #define PCRE_INFO_OPTIONS 0 68 | #define PCRE_INFO_SIZE 1 69 | #define PCRE_INFO_CAPTURECOUNT 2 70 | #define PCRE_INFO_BACKREFMAX 3 71 | #define PCRE_INFO_FIRSTCHAR 4 72 | #define PCRE_INFO_FIRSTTABLE 5 73 | #define PCRE_INFO_LASTLITERAL 6 74 | 75 | /* Types */ 76 | 77 | typedef void pcre; 78 | typedef void pcre_extra; 79 | 80 | /* Store get and free functions. These can be set to alternative malloc/free 81 | functions if required. Some magic is required for Win32 DLL; it is null on 82 | other OS. */ 83 | 84 | PCRE_DL_IMPORT extern void *(*pcre_malloc)(size_t); 85 | PCRE_DL_IMPORT extern void (*pcre_free)(void *); 86 | 87 | #undef PCRE_DL_IMPORT 88 | 89 | /* Functions */ 90 | 91 | extern pcre *pcre_compile(const char *, int, const char **, int *, 92 | const unsigned char *); 93 | extern int pcre_copy_substring(const char *, int *, int, int, char *, int); 94 | extern int pcre_exec(const pcre *, const pcre_extra *, const char *, 95 | int, int, int, int *, int); 96 | extern void pcre_free_substring(const char *); 97 | extern void pcre_free_substring_list(const char **); 98 | extern int pcre_get_substring(const char *, int *, int, int, const char **); 99 | extern int pcre_get_substring_list(const char *, int *, int, const char ***); 100 | extern int pcre_info(const pcre *, int *, int *); 101 | extern int pcre_fullinfo(const pcre *, const pcre_extra *, int, void *); 102 | extern unsigned const char *pcre_maketables(void); 103 | extern pcre_extra *pcre_study(const pcre *, int, const char **); 104 | extern const char *pcre_version(void); 105 | 106 | #ifdef __cplusplus 107 | } /* extern "C" */ 108 | #endif 109 | 110 | #endif /* End of pcre.h */ 111 | -------------------------------------------------------------------------------- /src/pcre/pcreposix.h: -------------------------------------------------------------------------------- 1 | /************************************************* 2 | * Perl-Compatible Regular Expressions * 3 | *************************************************/ 4 | 5 | /* Copyright (c) 1997-2000 University of Cambridge */ 6 | 7 | #ifndef _PCREPOSIX_H 8 | #define _PCREPOSIX_H 9 | 10 | /* This is the header for the POSIX wrapper interface to the PCRE Perl- 11 | Compatible Regular Expression library. It defines the things POSIX says should 12 | be there. I hope. */ 13 | 14 | /* Have to include stdlib.h in order to ensure that size_t is defined. */ 15 | 16 | #include 17 | 18 | /* Allow for C++ users */ 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* Options defined by POSIX. */ 25 | 26 | #define REG_ICASE 0x01 27 | #define REG_NEWLINE 0x02 28 | #define REG_NOTBOL 0x04 29 | #define REG_NOTEOL 0x08 30 | 31 | /* These are not used by PCRE, but by defining them we make it easier 32 | to slot PCRE into existing programs that make POSIX calls. */ 33 | 34 | #define REG_EXTENDED 0 35 | #define REG_NOSUB 0 36 | 37 | /* Error values. Not all these are relevant or used by the wrapper. */ 38 | 39 | enum { 40 | REG_ASSERT = 1, /* internal error ? */ 41 | REG_BADBR, /* invalid repeat counts in {} */ 42 | REG_BADPAT, /* pattern error */ 43 | REG_BADRPT, /* ? * + invalid */ 44 | REG_EBRACE, /* unbalanced {} */ 45 | REG_EBRACK, /* unbalanced [] */ 46 | REG_ECOLLATE, /* collation error - not relevant */ 47 | REG_ECTYPE, /* bad class */ 48 | REG_EESCAPE, /* bad escape sequence */ 49 | REG_EMPTY, /* empty expression */ 50 | REG_EPAREN, /* unbalanced () */ 51 | REG_ERANGE, /* bad range inside [] */ 52 | REG_ESIZE, /* expression too big */ 53 | REG_ESPACE, /* failed to get memory */ 54 | REG_ESUBREG, /* bad back reference */ 55 | REG_INVARG, /* bad argument */ 56 | REG_NOMATCH /* match failed */ 57 | }; 58 | 59 | 60 | /* The structure representing a compiled regular expression. */ 61 | 62 | typedef struct { 63 | void *re_pcre; 64 | size_t re_nsub; 65 | size_t re_erroffset; 66 | } regex_t; 67 | 68 | /* The structure in which a captured offset is returned. */ 69 | 70 | typedef int regoff_t; 71 | 72 | typedef struct { 73 | regoff_t rm_so; 74 | regoff_t rm_eo; 75 | } regmatch_t; 76 | 77 | /* The functions */ 78 | 79 | extern int regcomp(regex_t *, const char *, int); 80 | extern int regexec(regex_t *, const char *, size_t, regmatch_t *, int); 81 | extern size_t regerror(int, const regex_t *, char *, size_t); 82 | extern void regfree(regex_t *); 83 | 84 | #ifdef __cplusplus 85 | } /* extern "C" */ 86 | #endif 87 | 88 | #endif /* End of pcreposix.h */ 89 | -------------------------------------------------------------------------------- /src/slackware/rc.privoxy.orig: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ******************************************************************** 3 | # This script uses exit to return proper error codes, 4 | # sourcing (. /path/to/rc.privoxy) it in your system's 5 | # rc files is a bad idea. 6 | # ******************************************************************** 7 | 8 | RETVAL=1 9 | 10 | PRIVOXY_PRG="%PROGRAM%" 11 | PRIVOXY_BIN="%SBIN_DEST%/$PRIVOXY_PRG" 12 | PRIVOXY_CONF="%CONF_DEST%/config" 13 | PRIVOXY_USER="%USER%" 14 | PRIVOXY_GROUP="%GROUP%" 15 | PRIVOXY_PID="/var/run/$PRIVOXY_PRG.pid" 16 | 17 | declare -i check 18 | check=(`/bin/ps -e|/bin/grep $PRIVOXY_PRG|/usr/bin/wc -l`) 19 | 20 | # some checks for us 21 | if [ ! -x $PRIVOXY_BIN ] ; then exit 0 ;fi 22 | if [ ! -f $PRIVOXY_CONF ] ; then exit 0 ;fi 23 | 24 | # See how we were called. 25 | 26 | PRIVOXY="$PRIVOXY_BIN --user $PRIVOXY_USER.$PRIVOXY_GROUP --pidfile $PRIVOXY_PID $PRIVOXY_CONF" 27 | 28 | start () { 29 | # start daemon 30 | echo -n $"Starting $PRIVOXY_PRG: " 31 | 32 | if [ ! -f $PRIVOXY_PID ]; then 33 | ( $PRIVOXY 2>/dev/tty9 ) \ 34 | && echo " OK" \ 35 | && /bin/touch /var/lock/$PRIVOXY_PRG \ 36 | && RETVAL=0 37 | elif [ $check -lt 3 ]; then 38 | echo "Zombie lock file found" 39 | /bin/rm -f /var/lock/$PRIVOXY_PRG $PRIVOXY_PID 40 | echo "Retrying..." 41 | start 42 | else 43 | echo "Already running" 44 | fi 45 | echo 46 | } 47 | 48 | stop () { 49 | # stop daemon 50 | echo -n $"Stopping $PRIVOXY_PRG: " 51 | if [ -f $PRIVOXY_PID ]; then 52 | /bin/kill `/bin/cat $PRIVOXY_PID` \ 53 | && /bin/rm -f /var/lock/$PRIVOXY_PRG $PRIVOXY_PID \ 54 | && echo " OK" \ 55 | && RETVAL=0 56 | echo 57 | else 58 | echo " Not Running" 59 | fi 60 | } 61 | 62 | case "$1" in 63 | start) 64 | start 65 | ;; 66 | stop) 67 | stop 68 | ;; 69 | reload) 70 | if [ -f $PRIVOXY_PID ] ; then 71 | /bin/kill -HUP `cat $PRIVOXY_PID` \ 72 | && RETVAL=0 73 | fi 74 | ;; 75 | restart) 76 | stop 77 | start 78 | ;; 79 | kill) 80 | echo "Kill all Privoxy" 81 | /bin/rm -f /var/lock/$PRIVOXY_PRG $PRIVOXY_PID 82 | /bin/killall $PRIVOXY 83 | ;; 84 | condrestart) 85 | # restart only if already running 86 | if [ -f $PRIVOXY_PID ] ; then 87 | stop 88 | start 89 | fi 90 | ;; 91 | status) 92 | /bin/ps ax|/bin/grep $PRIVOXY_PRG|/bin/grep -v 'grep\|init\.d\|rc\.d' 93 | RETVAL=0 94 | ;; 95 | top) 96 | if [ -f $PRIVOXY_PID ]; then 97 | a="" 98 | for i in `/sbin/pidof $PRIVOXY_PRG` ; do 99 | a="$a -p $i" 100 | done 101 | /usr/bin/top $a 102 | fi 103 | ;; 104 | *) 105 | echo $"Usage: $PRIVOXY_PRG {start|stop|reload|restart|condrestart|status|top|kill}" 106 | exit 1 107 | esac 108 | 109 | exit $RETVAL 110 | -------------------------------------------------------------------------------- /src/ssplit.h: -------------------------------------------------------------------------------- 1 | #ifndef SSPLIT_H_INCLUDED 2 | #define SSPLIT_H_INCLUDED 3 | /********************************************************************* 4 | * 5 | * File : $Source: /cvsroot/ijbswa/current/ssplit.h,v $ 6 | * 7 | * Purpose : A function to split a string at specified deliminters. 8 | * 9 | * Copyright : Written by and Copyright (C) 2001 members of the 10 | * Privoxy team. http://www.privoxy.org/ 11 | * 12 | * Based on the Internet Junkbuster originally written 13 | * by and Copyright (C) 1997 Anonymous Coders and 14 | * Junkbusters Corporation. http://www.junkbusters.com 15 | * 16 | * This program is free software; you can redistribute it 17 | * and/or modify it under the terms of the GNU General 18 | * Public License as published by the Free Software 19 | * Foundation; either version 2 of the License, or (at 20 | * your option) any later version. 21 | * 22 | * This program is distributed in the hope that it will 23 | * be useful, but WITHOUT ANY WARRANTY; without even the 24 | * implied warranty of MERCHANTABILITY or FITNESS FOR A 25 | * PARTICULAR PURPOSE. See the GNU General Public 26 | * License for more details. 27 | * 28 | * The GNU General Public License should be included with 29 | * this file. If not, you can view it at 30 | * http://www.gnu.org/copyleft/gpl.html 31 | * or write to the Free Software Foundation, Inc., 59 32 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 33 | * 34 | *********************************************************************/ 35 | 36 | 37 | extern int ssplit(char *str, const char *delim, char *vec[], size_t vec_len); 38 | 39 | #endif /* ndef SSPLIT_H_INCLUDED */ 40 | 41 | /* 42 | Local Variables: 43 | tab-width: 3 44 | end: 45 | */ 46 | -------------------------------------------------------------------------------- /src/templates/connection-timeout: -------------------------------------------------------------------------------- 1 | ########################################################## 2 | # 3 | # connection-timeout Error Output template for Privoxy. 4 | # 5 | ########################################################## 6 | 7 | 8 | 9 | 10 | 504 - Connection timeout (Privoxy@@my-hostname@) 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 28 | 33 | 34 | 35 | 36 | # This will only appear if CODE_STATUS is "alpha" or "beta". See configure.in 37 | 38 | 43 | 44 | 45 | 46 | 47 | 56 | 57 | 58 | 59 | 63 | 64 | 65 | 66 | 67 | 72 | 73 | 74 | 75 | 76 | 81 | 82 | 83 |
    26 | 504 27 | 29 | 30 | #include mod-title 31 | 32 |
    39 | 40 | #include mod-unstable-warning 41 | 42 |
    48 |

    Connection timeout

    49 |

    Your request for @protocol@@hostport@@path@ 50 | could not be fulfilled, because the connection to @host@ (@host-ip@) timed out. 51 |

    52 |

    This is often a temporary failure, so you might just 53 | try again. 54 |

    55 |
    60 |

    More Privoxy:

    61 | 62 |
    68 | 69 | #include mod-local-help 70 | 71 |
    77 | 78 | #include mod-support-and-service 79 | 80 |
    84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /src/templates/edit-actions-for-url-filter: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # 3 | # File : $Source: /cvsroot/ijbswa/current/templates/edit-actions-for-url-filter,v $ 4 | # 5 | # Purpose : Template that is included from most of Privoxy's CGI pages 6 | # to show the user how to get help or report problems. 7 | # 8 | # 9 | # Copyright : Written by and Copyright (C) 2002-2007 members of 10 | # members of the Privoxy team. https://www.privoxy.org/ 11 | # 12 | # This template is free software; you can redistribute it 13 | # and/or modify it under the terms of the GNU General 14 | # Public License as published by the Free Software 15 | # Foundation; either version 2 of the License, or (at 16 | # your option) any later version. 17 | # 18 | ############################################################################## 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | @filter-type@ @name@ 28 | 29 | @description@ 30 | 31 | -------------------------------------------------------------------------------- /src/templates/edit-actions-list-button: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # 3 | # File : $Source: /cvsroot/ijbswa/current/templates/edit-actions-list-button,v $ 4 | # 5 | # Purpose : Template which forms part of edit-actions-list 6 | # 7 | # 8 | # Copyright : Written by and Copyright (C) 2001 members of the 9 | # Privoxy team. https://www.privoxy.org/ 10 | # 11 | # Original Author: Copyright (C) 2001 Jonathan Foster 12 | # http://www.jon-foster.co.uk/ 13 | # 14 | # This program is free software; you can redistribute it 15 | # and/or modify it under the terms of the GNU General 16 | # Public License as published by the Free Software 17 | # Foundation; either version 2 of the License, or (at 18 | # your option) any later version. 19 | # 20 | # This program is distributed in the hope that it will 21 | # be useful, but WITHOUT ANY WARRANTY; without even the 22 | # implied warranty of MERCHANTABILITY or FITNESS FOR A 23 | # PARTICULAR PURPOSE. See the GNU General Public 24 | # License for more details. 25 | # 26 | # The GNU General Public License should be included with 27 | # this file. If not, you can view it at 28 | # http://www.gnu.org/copyleft/gpl.html 29 | # or write to the Free Software Foundation, Inc., 59 30 | # Temple Place - Suite 330, Boston, MA 02111-1307, USA. 31 | # 32 | ############################################################################# 33 |   Set to @button-name@ 34 | -------------------------------------------------------------------------------- /src/templates/edit-actions-list-section: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # 3 | # File : $Source: /cvsroot/ijbswa/current/templates/edit-actions-list-section,v $ 4 | # 5 | # Purpose : Template which forms part of edit-actions-list 6 | # 7 | # 8 | # Copyright : Written by and Copyright (C) 2001 members of the 9 | # Privoxy team. https://www.privoxy.org/ 10 | # 11 | # Original Author: Copyright (C) 2001 Jonathan Foster 12 | # http://www.jon-foster.co.uk/ 13 | # 14 | # This program is free software; you can redistribute it 15 | # and/or modify it under the terms of the GNU General 16 | # Public License as published by the Free Software 17 | # Foundation; either version 2 of the License, or (at 18 | # your option) any later version. 19 | # 20 | # This program is distributed in the hope that it will 21 | # be useful, but WITHOUT ANY WARRANTY; without even the 22 | # implied warranty of MERCHANTABILITY or FITNESS FOR A 23 | # PARTICULAR PURPOSE. See the GNU General Public 24 | # License for more details. 25 | # 26 | # The GNU General Public License should be included with 27 | # this file. If not, you can view it at 28 | # http://www.gnu.org/copyleft/gpl.html 29 | # or write to the Free Software Foundation, Inc., 59 30 | # Temple Place - Suite 330, Boston, MA 02111-1307, USA. 31 | # 32 | ############################################################################# 33 | # 34 | # Available variables include: 35 | # 36 | # filename 37 | # ver 38 | # sectionid 39 | # urls 40 | # 41 | ############################################################################# 42 | # 43 | # ** Important note: ** 44 | # 45 | # It is important to keep this file small. That's why all the 46 | # identifiers in the HTML are short and cryptic. Currently, the main 47 | # edit-actions page is ~300k. Before it was optimized, it was ~550k. 48 | # 49 | ############################################################################# 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | @urls@ 59 | 60 | 66 |
    Actions:
    Edit
    @actions@
    URL patterns:
    Add
    Advanced:
    61 | @if-s-prev-exists-start@Move section up   @if-s-prev-exists-end@ 62 | @if-s-next-exists-start@Move section down   @if-s-next-exists-end@ 63 | Insert new section below 64 | @if-empty-section-start@   Delete whole section@if-empty-section-end@ 65 |
    67 | 68 | -------------------------------------------------------------------------------- /src/templates/edit-actions-list-url: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # 3 | # File : $Source: /cvsroot/ijbswa/current/templates/edit-actions-list-url,v $ 4 | # 5 | # Purpose : Template which forms part of edit-actions-list 6 | # 7 | # 8 | # Copyright : Written by and Copyright (C) 2001 members of the 9 | # Privoxy team. https://www.privoxy.org/ 10 | # 11 | # Original Author: Copyright (C) 2001 Jonathan Foster 12 | # http://www.jon-foster.co.uk/ 13 | # 14 | # This program is free software; you can redistribute it 15 | # and/or modify it under the terms of the GNU General 16 | # Public License as published by the Free Software 17 | # Foundation; either version 2 of the License, or (at 18 | # your option) any later version. 19 | # 20 | # This program is distributed in the hope that it will 21 | # be useful, but WITHOUT ANY WARRANTY; without even the 22 | # implied warranty of MERCHANTABILITY or FITNESS FOR A 23 | # PARTICULAR PURPOSE. See the GNU General Public 24 | # License for more details. 25 | # 26 | # The GNU General Public License should be included with 27 | # this file. If not, you can view it at 28 | # http://www.gnu.org/copyleft/gpl.html 29 | # or write to the Free Software Foundation, Inc., 59 30 | # Temple Place - Suite 330, Boston, MA 02111-1307, USA. 31 | # 32 | ############################################################################# 33 | # 34 | # Available variables include: 35 | # 36 | # filename 37 | # ver 38 | # sectionid 39 | # urls 40 | # 41 | ############################################################################# 42 | # 43 | # ** Important note: ** 44 | # 45 | # It is *extremely* important to keep this file small. That's why all the 46 | # identifiers in the HTML are short and cryptic. Currently, the main 47 | # edit-actions page is ~300k. Before it was optimized, it was ~550k. 48 | # 49 | ############################################################################# 50 | 51 | Remove   Edit  @url-html@ 54 | 55 | -------------------------------------------------------------------------------- /src/templates/mod-local-help: -------------------------------------------------------------------------------- 1 |

    Local Privoxy support:

    2 | 3 | 4 |

    You can consult the online documentation for more information about this Privoxy installation.

    5 | 6 | 7 | 8 |

    Address e-mail questions about this Privoxy installation to 9 | @admin-address@, 10 | who will be glad to help you. 11 |

    12 | 13 | -------------------------------------------------------------------------------- /src/templates/mod-support-and-service: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # 3 | # File : $Source: /cvsroot/ijbswa/current/templates/mod-support-and-service,v $ 4 | # 5 | # Purpose : Template that is included from most of Privoxy's CGI pages 6 | # to show the user how to get help or report problems. 7 | # 8 | # 9 | # Copyright : Written by and Copyright (C) 2002-2009 members of 10 | # the Privoxy team. https://www.privoxy.org/ 11 | # 12 | # This template is free software; you can redistribute it 13 | # and/or modify it under the terms of the GNU General 14 | # Public License as published by the Free Software 15 | # Foundation; either version 2 of the License, or (at 16 | # your option) any later version. 17 | # 18 | ############################################################################## 19 | # This template should be kept in sync with the "blocked" template 20 | # whose JavaScript version duplicates the content. 21 |

    Support and Service:

    22 |

    23 | The Privoxy Team values your feedback. 24 |

    25 |

    26 | Please have a look at the User Manual to learn how to 27 | get support or report problems. 29 |

    30 | If you want to support the Privoxy Team, you can 31 | participate 32 | or donate. 33 |

    34 | -------------------------------------------------------------------------------- /src/templates/mod-title: -------------------------------------------------------------------------------- 1 |

    2 | This is Privoxy @version@ on @my-hostname@ (@my-ip-address@), port @my-port@, 3 | @if-enabled-display-then@enabled@else-not-enabled-display@disabled@endif-enabled-display@ 4 |

    5 | -------------------------------------------------------------------------------- /src/templates/mod-unstable-warning: -------------------------------------------------------------------------------- 1 |

    Warning:

    2 |

    3 | This Privoxy version is based on @code-status@ code and 4 | not intended for production systems! 5 |
    Use at your own risk. See the license for details.
    7 |

    8 | -------------------------------------------------------------------------------- /src/templates/no-server-data: -------------------------------------------------------------------------------- 1 | ########################################################## 2 | # 3 | # no-server-data Error Output template for Privoxy. 4 | # 5 | ########################################################## 6 | 7 | 8 | 9 | 10 | 502 - No server or forwarder data received (Privoxy@@my-hostname@) 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 28 | 33 | 34 | 35 | 36 | # This will only appear if CODE_STATUS is "alpha" or "beta". See configure.in 37 | 38 | 43 | 44 | 45 | 46 | 47 | 65 | 66 | 67 | 68 | 72 | 73 | 74 | 75 | 76 | 81 | 82 | 83 | 84 | 85 | 90 | 91 | 92 |
    26 | 502 27 | 29 | 30 | #include mod-title 31 | 32 |
    39 | 40 | #include mod-unstable-warning 41 | 42 |
    48 |

    No server or forwarder data received

    49 |

    Your request for @protocol@@hostport@@path@ 50 | could not be fulfilled, because the connection to @host@ (@host-ip@) has been closed 51 | before Privoxy received any data for this request. 52 |

    53 |

    This is often a temporary failure, so you might just 54 | try again. 55 |

    56 |

    57 | If you get this message very often, consider disabling 58 | connection-sharing 59 | (which should be off by default). If that doesn't help, you may have to additionally 60 | disable support for connection keep-alive by setting 61 | keep-alive-timeout 62 | to 0. 63 |

    64 |
    69 |

    More Privoxy:

    70 | 71 |
    77 | 78 | #include mod-local-help 79 | 80 |
    86 | 87 | #include mod-support-and-service 88 | 89 |
    93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /src/templates/toggle-mini: -------------------------------------------------------------------------------- 1 | ########################################################## 2 | # 3 | # Toggle Output template for Privoxy. 4 | # 5 | # 6 | # USING HTML TEMPLATES: 7 | # --------------------- 8 | # 9 | # Template files are written win plain HTML, with a few 10 | # additions: 11 | # 12 | # - Lines that start with a '#' character like this one 13 | # are ignored 14 | # 15 | # - Each item in the below list of exported symbols will 16 | # be replaced by dynamically generated text, if they 17 | # are enclosed in '@'-characters. E.g. The string @version@ 18 | # will be replaced by the version number of Privoxy. 19 | # 20 | # - One special application of this is to make whole blocks 21 | # of the HTML template disappear if the condition 22 | # is not given. Simply enclose the block between the two 23 | # strings @if-start and if--end@. The strings 24 | # should be placed in HTML comments (), so the 25 | # html structure won't be messed when the magic happens. 26 | # 27 | # USABLE SYMBOLS IN THIS TEMPLATE: 28 | # -------------------------------- 29 | # 30 | # my-ip-addr: 31 | # The IP-address that the client used to reach this proxy 32 | # my-hostname: 33 | # The hostname associated with my-ip-addr 34 | # admin-address: 35 | # The email address of the proxy administrator, as configured 36 | # in the config file 37 | # default-cgi: 38 | # The URL for the "main menu" builtin CGI of this proxy 39 | # menu: 40 | # List of
  • elements linking to the other available CGIs 41 | # version: 42 | # The version number of the proxy software 43 | # code-status: 44 | # The development status of the proxy software: "alpha", "beta", 45 | # or "stable". 46 | # homepage: 47 | # The URL of the Privoxy project, which maintains this software. 48 | # 49 | # CONDITIONAL SYMBOLS FOR THIS TEMPLATE AND THEIR DEPANDANT SYMBOLS: 50 | # ------------------------------------------------------------------ 51 | # 52 | # unstable: 53 | # this is an alpha or beta release of the proxy software 54 | # have-adminaddr-info: 55 | # An e-mail address for the local Privoxy administrator has 56 | # been specified and is available through the "admin-address" 57 | # symbol 58 | # have-proxy-info: 59 | # A URL for online documentation about this proxy has been 60 | # specified and is available through the "proxy-info-url" 61 | # symbol 62 | # have-help-info: 63 | # If either have-proxy-info is true or have-adminaddr-info is 64 | # true, have-help-info is true. Used to conditionally include 65 | # a grey box for any and all help info. 66 | # @if-enabled-display-then@ on @else-not-enabled-display@ off @endif-enabled-display@ 67 | # 68 | 69 | 70 | 71 | 72 | @if-enabled-display-then@Enabled@else-not-enabled-display@Disabled@endif-enabled-display@ - Privoxy@@my-hostname@ 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 |

    83 | Privoxy is 84 | @if-enabled-display-then@enabled@else-not-enabled-display@disabled@endif-enabled-display@. 85 |
    @if-enabled-display-then@[Disable]@else-not-enabled-display@[Enable]@endif-enabled-display@ | 87 | [Close] 88 |

    89 | 90 | 91 | -------------------------------------------------------------------------------- /src/templates/url-info-osd.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Privoxy URL Info 4 | 5 | Enter a URL to see which Privoxy actions apply. 6 | Only works while the browser is configured to use Privoxy. 7 | 8 | UTF-8 9 | UTF-8 10 | Privoxy Team 11 | ijbswa-developers@lists.sourceforge.net 12 | @default-cgi@favicon.ico 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/tools/privoxy-log-parser.pl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/tools/privoxy-log-parser.pl -------------------------------------------------------------------------------- /src/tools/url-pattern-translator.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | ############################################################################ 4 | # 5 | # url-pattern-translator 6 | # 7 | # Filters Privoxy action files and changes old-school URL patterns to 8 | # use extended regular expressions for the host as well. 9 | # 10 | # While it works good enough to satisfy the regression tests in 11 | # default.action.master, it isn't perfect and you should double-check 12 | # the output and keep backups of your old action files. 13 | # 14 | # Usage: 15 | # 16 | # url-pattern-translator.pl old.action > new.action 17 | # 18 | # Only convert your files once, or, as RoboCop used to say, 19 | # there will be... trouble. 20 | # 21 | # Copyright (c) 2008 Fabian Keil 22 | # 23 | # Permission to use, copy, modify, and distribute this software for any 24 | # purpose with or without fee is hereby granted, provided that the above 25 | # copyright notice and this permission notice appear in all copies. 26 | # 27 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 28 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 29 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 30 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 31 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 32 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 33 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 34 | # 35 | ############################################################################ 36 | 37 | use strict; 38 | use warnings; 39 | 40 | sub p ($) { 41 | my $message = shift; 42 | print $message . "\n"; 43 | } 44 | 45 | sub convert_host_pattern ($) { 46 | my $host_pattern = shift; 47 | my $hp = $host_pattern; 48 | 49 | $hp =~ s@\s@@g; 50 | 51 | if ($hp =~ m@^\.@) { 52 | # Not left-anchored 53 | # 54 | # XXX: This is somewhat ugly and while it's 55 | # the equivalent pattern in most cases 56 | # \. should be good enough. 57 | $hp =~ s@^\.@(^|.)@; 58 | } else { 59 | # left-anchored 60 | $hp = '^' . $hp; 61 | } 62 | 63 | # Match-all syntax has changed ... 64 | $hp =~ s@\*@[^.]*@g; 65 | 66 | # Extended host patterns are right-anchored by default 67 | $hp =~ s@\.$@(\..*)?@; 68 | 69 | # Literal dots have to be escaped 70 | $hp =~ s@((?) { 118 | chomp; 119 | 120 | if (looks_interesting($_)) { 121 | if (m@^([^/]+)(/.*)$@) { 122 | $host = $1; 123 | $path = $2; 124 | $host = convert_host_pattern($host); 125 | $_ = $host . $path; 126 | } 127 | elsif (m@^([^/]*)$@) { 128 | $host = $1; 129 | $host = convert_host_pattern($host); 130 | $_ = $host; 131 | } 132 | } 133 | p($_); 134 | } 135 | } 136 | 137 | main(); 138 | -------------------------------------------------------------------------------- /src/trust: -------------------------------------------------------------------------------- 1 | ###################################################################### 2 | # 3 | # File : trust 4 | # 5 | # Purpose : Trustfiles are an experimental feature and can be used 6 | # to build "whitelists" (versus the usual "blacklists" 7 | # techniques). 8 | # 9 | # Copyright : Written by and Copyright 10 | # Privoxy team. http://www.privoxy.org/ 11 | # 12 | # Based on the Internet Junkbuster originally written 13 | # by and Copyright (C) 1997 Anonymous Coders and 14 | # Junkbusters Corporation. http://www.junkbusters.com 15 | # 16 | # We value your feedback. However, to provide you with the best support, 17 | # please note: 18 | # 19 | # * Use the support forum to get help: 20 | # http://sourceforge.net/tracker/?group_id=11118&atid=211118 21 | # * Submit bugs only thru our bug forum: 22 | # http://sourceforge.net/tracker/?group_id=11118&atid=111118 23 | # Make sure that the bug has not already been submitted. Please try 24 | # to verify that it is a Privoxy bug, and not a browser or site 25 | # bug first. If you are using your own custom configuration, please 26 | # try the stock configs to see if the problem is a configuration 27 | # related bug. And if not using the latest development snapshot, 28 | # please try the latest one. Or even better, CVS sources. 29 | # * Submit feature requests only thru our feature request tracker: 30 | # http://sourceforge.net/tracker/?atid=361118&group_id=11118&func=browse 31 | # 32 | # For any other issues, feel free to use the mailing lists: 33 | # http://sourceforge.net/mail/?group_id=11118 34 | # 35 | # Anyone interested in actively participating in development and related 36 | # discussions can join the appropriate mailing list here: 37 | # http://sourceforge.net/mail/?group_id=11118. Archives are available 38 | # here too. 39 | # 40 | ###################################################################### 41 | # 42 | # Sample Trustfile for Privoxy 43 | 44 | # For this file to have any effect, the line in the main config file beginning 45 | # with "trustfile" must be uncommented, with the name of this file following the 46 | # word "trustfile". 47 | 48 | # Trustfiles are an experimental feature used for building "whitelists" 49 | # of "trusted" sites (versus the usual "blacklists" technique). For more 50 | # detail, see http://www.privoxy.org/user-manual/config.html#TRUSTFILE. 51 | 52 | # List trusted domains here. The default is to block any URL that is NOT 53 | # referenced. Access to trusted domains includes all paths within that 54 | # domain. 55 | 56 | # Preceding a domain with a '+' character will designate that domain 57 | # as a "trusted referrer", meaning any requests whose HTTP "Referer" headers 58 | # contain an URL from that domain will be allowed, and the previously untrusted 59 | # host will be dynamically added to this file. Thus, this builds a "white-list" 60 | # of hosts the user is allowed to visit. 61 | 62 | # Note this means that the file will grow with use! 63 | 64 | # Also note that you can only trust referrers if you control the user's 65 | # system and make sure that there are no programs available that allow 66 | # to set arbitrary headers. 67 | 68 | # Preceding the domain with '~' character allows access to that domain only 69 | # (including all paths within that domain), but does not allow access to links 70 | # to other, outside domains. Sites that are added dynamically by trusted 71 | # referrers will include the '~' character, and thus do not become trusted 72 | # referrers themselves. 73 | 74 | # Example: to allow example.com and to white-list domains that appear to 75 | # be reached through links from example.com, uncomment this line: 76 | 77 | # +example.com 78 | 79 | # The next two lines make sure that the user can access Privoxy's 80 | # CGI pages, without automatically trusting their links. 81 | 82 | ~config.privoxy.org 83 | ~p.p 84 | -------------------------------------------------------------------------------- /src/urlmatch.h: -------------------------------------------------------------------------------- 1 | #ifndef URLMATCH_H_INCLUDED 2 | #define URLMATCH_H_INCLUDED 3 | /********************************************************************* 4 | * 5 | * File : $Source: /cvsroot/ijbswa/current/urlmatch.h,v $ 6 | * 7 | * Purpose : Declares functions to match URLs against URL 8 | * patterns. 9 | * 10 | * Copyright : Written by and Copyright (C) 2001-2002, 2006 the 11 | * Privoxy team. http://www.privoxy.org/ 12 | * 13 | * Based on the Internet Junkbuster originally written 14 | * by and Copyright (C) 1997 Anonymous Coders and 15 | * Junkbusters Corporation. http://www.junkbusters.com 16 | * 17 | * This program is free software; you can redistribute it 18 | * and/or modify it under the terms of the GNU General 19 | * Public License as published by the Free Software 20 | * Foundation; either version 2 of the License, or (at 21 | * your option) any later version. 22 | * 23 | * This program is distributed in the hope that it will 24 | * be useful, but WITHOUT ANY WARRANTY; without even the 25 | * implied warranty of MERCHANTABILITY or FITNESS FOR A 26 | * PARTICULAR PURPOSE. See the GNU General Public 27 | * License for more details. 28 | * 29 | * The GNU General Public License should be included with 30 | * this file. If not, you can view it at 31 | * http://www.gnu.org/copyleft/gpl.html 32 | * or write to the Free Software Foundation, Inc., 59 33 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 34 | * 35 | *********************************************************************/ 36 | 37 | 38 | #include "project.h" 39 | 40 | extern void free_http_request(struct http_request *http); 41 | #ifndef FEATURE_EXTENDED_HOST_PATTERNS 42 | extern jb_err init_domain_components(struct http_request *http); 43 | #endif 44 | extern jb_err parse_http_request(const char *req, struct http_request *http); 45 | extern jb_err parse_http_url(const char *url, 46 | struct http_request *http, 47 | int require_protocol); 48 | extern int url_requires_percent_encoding(const char *url); 49 | 50 | #define REQUIRE_PROTOCOL 1 51 | 52 | extern int url_match(const struct pattern_spec *pattern, 53 | const struct http_request *http); 54 | 55 | extern jb_err create_pattern_spec(struct pattern_spec *url, char *buf); 56 | extern void free_pattern_spec(struct pattern_spec *url); 57 | extern int match_portlist(const char *portlist, int port); 58 | extern jb_err parse_forwarder_address(char *address, char **hostname, int *port); 59 | 60 | #endif /* ndef URLMATCH_H_INCLUDED */ 61 | 62 | /* 63 | Local Variables: 64 | tab-width: 3 65 | end: 66 | */ 67 | -------------------------------------------------------------------------------- /src/user.filter: -------------------------------------------------------------------------------- 1 | # ******************************************************************** 2 | # 3 | # File : user.filter 4 | # 5 | # Purpose : Rules to process the content of web pages 6 | # 7 | # Copyright : Written by and Copyright (C) 2006-2008 the 8 | # Privoxy team. http://www.privoxy.org/ 9 | # 10 | # We value your feedback. However, to provide you with the best support, 11 | # please note: 12 | # 13 | # * Use the support forum to get help: 14 | # http://sourceforge.net/tracker/?group_id=11118&atid=211118 15 | # * Submit bugs only thru our bug forum: 16 | # http://sourceforge.net/tracker/?group_id=11118&atid=111118 17 | # Make sure that the bug has not already been submitted. Please try 18 | # to verify that it is a Privoxy bug, and not a browser or site 19 | # bug first. If you are using your own custom configuration, please 20 | # try the stock configs to see if the problem is a configuration 21 | # related bug. And if not using the latest development snapshot, 22 | # please try the latest one. Or even better, CVS sources. 23 | # * Submit feature requests only thru our feature request forum: 24 | # http://sourceforge.net/tracker/?atid=361118&group_id=11118&func=browse 25 | # 26 | # For any other issues, feel free to use the mailing lists: 27 | # http://sourceforge.net/mail/?group_id=11118 28 | # 29 | # Anyone interested in actively participating in development and related 30 | # discussions can join the appropriate mailing list here: 31 | # http://sourceforge.net/mail/?group_id=11118. Archives are available 32 | # here too. 33 | # 34 | ################################################################################# 35 | # 36 | # Syntax: 37 | # 38 | # Generally filters start with a line like "FILTER: name description". 39 | # They are then referrable from the actionsfile with +filter{name} 40 | # 41 | # FILTER marks a filter as content filter, other filter 42 | # types are CLIENT-HEADER-FILTER, CLIENT-HEADER-TAGGER, 43 | # SERVER-HEADER-FILTER and SERVER-HEADER-TAGGER. 44 | # 45 | # Inside the filters, write one Perl-Style substitution (job) per line. 46 | # Jobs that precede the first FILTER: line are ignored. 47 | # 48 | # For Details see the pcrs manpage contained in this distribution. 49 | # (and the perlre, perlop and pcre manpages) 50 | # 51 | # Note that you are free to choose the delimiter as you see fit. 52 | # 53 | # Note2: In addition to the Perl options gimsx, the following nonstandard 54 | # options are supported: 55 | # 56 | # 'U' turns the default to ungreedy matching. Add ? to quantifiers to 57 | # switch back to greedy. 58 | # 59 | # 'T' (trivial) prevents parsing for backreferences in the substitute. 60 | # Use if you want to include text like '$&' in your substitute without 61 | # quoting. 62 | # 63 | # 'D' (Dynamic) allows the use of variables. Supported variables are: 64 | # $host, $listen-address, $origin (the IP address the request came 65 | # from), $path and $url. 66 | # 67 | # Note that '$' is a bad choice as delimiter for dynamic filters as you 68 | # might end up with unintended variables if you use a variable name 69 | # directly after the delimiter. Variables will be resolved without 70 | # escaping anything, therefore you also have to be careful not to chose 71 | # delimiters that appear in the replacement text. For example '<' should 72 | # be save, while '?' will sooner or later cause conflicts with $url. 73 | # 74 | ################################################################################# 75 | -------------------------------------------------------------------------------- /src/utils/changelog2doc.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | ########################################################################## 4 | # 5 | # Filter to parse the ChangeLog and translate the changes for 6 | # the most recent version into something that looks like markup 7 | # for the documentation but still needs fine-tuning. 8 | # 9 | # Copyright (c) 2008, 2010 Fabian Keil 10 | # 11 | # Permission to use, copy, modify, and distribute this software for any 12 | # purpose with or without fee is hereby granted, provided that the above 13 | # copyright notice and this permission notice appear in all copies. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 16 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 17 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 18 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 19 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 20 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 21 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 22 | ########################################################################## 23 | 24 | use strict; 25 | use warnings; 26 | 27 | my @entries; 28 | 29 | sub read_entries() { 30 | my $section_reached = 0; 31 | my $i = -1; 32 | 33 | while (<>) { 34 | if (/^\*{3} /) { 35 | last if $section_reached; 36 | $section_reached = 1; 37 | next; 38 | } 39 | next unless $section_reached; 40 | next if /^\s*$/; 41 | 42 | if (/^(\s*)-/) { 43 | my $indentation = length($1); 44 | if ($i > 1 and $entries[$i]{indentation} > $indentation) { 45 | $entries[$i]{last_list_item} = 1; 46 | } 47 | $i++; 48 | $entries[$i]{description} = ''; 49 | $entries[$i]{indentation} = $indentation; 50 | } 51 | if (/:\s*$/) { 52 | $entries[$i]{list_header} = 1; 53 | } 54 | 55 | s@^\s*-?\s*@@; 56 | 57 | $entries[$i]{description} .= $_; 58 | } 59 | if ($entries[$i]{indentation} != 0) { 60 | $entries[$i]{last_list_item} = 1; 61 | } 62 | print "Parsed " . @entries . " entries.\n"; 63 | } 64 | 65 | sub create_listitem_markup($) { 66 | my $entry = shift; 67 | my $description = $entry->{description}; 68 | my $markup = ''; 69 | my $default_lws = ' '; 70 | my $lws = $default_lws x ($entry->{indentation} ? 2 : 1); 71 | 72 | chomp $description; 73 | 74 | $description =~ s@\n@\n ${lws}@g; 75 | 76 | $markup .= $lws . "\n" . 77 | $lws . " \n"; 78 | 79 | $markup .= $lws . " " . $description . "\n"; 80 | 81 | if (defined $entry->{list_header}) { 82 | $markup .= $lws . " \n"; 83 | 84 | } else { 85 | if (defined $entry->{last_list_item}) { 86 | $markup .= $lws . " \n"; 87 | $markup .= $lws . " \n"; 88 | $markup .= $lws . "\n"; 89 | $lws = $default_lws; 90 | } 91 | $markup .= $lws . " \n" . 92 | $lws . "\n"; 93 | } 94 | 95 | return $markup; 96 | } 97 | 98 | sub wrap_in_para_itemlist_markup($) { 99 | my $content = shift; 100 | my $markup = "\n" . 101 | " \n" . 102 | " $content" . 103 | " \n" . 104 | "\n"; 105 | return $markup; 106 | } 107 | 108 | sub generate_markup() { 109 | my $markup = ''; 110 | 111 | foreach my $entry (@entries) { 112 | $markup .= create_listitem_markup(\%{$entry}); 113 | } 114 | 115 | print wrap_in_para_itemlist_markup($markup); 116 | } 117 | 118 | sub main () { 119 | read_entries(); 120 | generate_markup(); 121 | } 122 | 123 | main(); 124 | -------------------------------------------------------------------------------- /src/utils/docbook2man/docbook2man-spec.pl.1: -------------------------------------------------------------------------------- 1 | .\" This manpage has been automatically generated by docbook2man 2 | .\" from a DocBook document. This tool can be found at: 3 | .\" 4 | .\" Please send any bug reports, improvements, comments, patches, 5 | .\" etc. to Steve Cheng . 6 | .TH "DOCBOOK2MAN-SPEC.PL" "1" "27 June 2002" "" "" 7 | .SH NAME 8 | docbook2man-spec.pl \- convert DocBook RefEntries to man pages 9 | .SH SYNOPSIS 10 | 11 | \fBsgmlspl\fR \fBdocbook2man-spec.pl\fR 12 | 13 | 14 | \fBnsgmls\fR [ \fB\fIsgml document\fB\fR ]\fB| sgmlspl\fR \fBdocbook2man-spec.pl\fR 15 | 16 | .SH "DESCRIPTION" 17 | .PP 18 | \fBdocbook2man\fR is a sgmlspl spec file that produced man 19 | pages (using the -man macros) from DocBook RefEntry markup. 20 | .PP 21 | The program reads ESIS produced by nsgmls (or other SGML parsers) from 22 | standard input. Markup not found in RefEntry is discarded. 23 | .PP 24 | Its output, the converted man pages, are written to the current directory. If 25 | RefMeta information is not specified in a 26 | RefEntry, then the man page will be written to standard 27 | output. 28 | .PP 29 | The file \fImanpage.links\fR will also be created, which contains 30 | any aliases of the manpages generated. This file is in the format: 31 | 32 | .nf 33 | \fI\fR \fI\fR 35 | .fi 36 | .PP 37 | The \fImanpage.refs\fR file keeps track of 38 | XRef references. Note that if the input document has any 39 | forward references, then \fBdocbook2man\fR may have to be 40 | invoked twice (the first time updating \fImanpage.refs\fR) to 41 | resolve them. 42 | .SH "REQUIREMENTS" 43 | 44 | The SGMLSpm package from CPAN. This package includes the sgmlspl script 45 | that is also needed. 46 | .SH "LIMITATIONS" 47 | .PP 48 | Trying \fBdocbook2man\fR on non-DocBook or non-conformant 49 | SGML results in undefined behavior. :-) 50 | .PP 51 | This program is a slow, dodgy Perl script. 52 | .PP 53 | This program does not come close to supporting all the possible markup 54 | in DocBook, and may produce wrong output in some cases with supported 55 | markup. 56 | .SH "TO DO" 57 | .PP 58 | Obvious stuff: 59 | .TP 0.2i 60 | \(bu 61 | Fix \fBdocbook2man\fR breakages found in 62 | the test documents, especially 63 | \fIweird.sgml\fR. 64 | .TP 0.2i 65 | \(bu 66 | Add new element handling and fix existing handling. 67 | Be robust. 68 | .TP 0.2i 69 | \(bu 70 | Produce cleanest, readable man output as possible (unlike some 71 | other converters). Follow Linux 72 | \fBman\fR(7) 73 | convention. As conversion to man pages is usually not done very often, it is 74 | better to be slower/more complicated than to produce wrong output. Also if 75 | someone wants to give up using DocBook for whatever reason, the last-converted 76 | man pages can then be maintained manually. 77 | .TP 0.2i 78 | \(bu 79 | Make it faster. I think most of the speed problems so far is with parsing 80 | ESIS. Rewrite \fISGMLS.pm\fR with C and/or get input directly 81 | from \fBSP\fR. 82 | .TP 0.2i 83 | \(bu 84 | Support other (human) languages. But what to do with non-ASCII charsets? 85 | SGMLSpm doesn't report them and \fBroff\fR does not grok them. 86 | [Comment: text after enclosed lists (and SS blocks) will break docbook2man] 87 | If we do this, more people can use DocBook. 88 | .SH "COPYRIGHT" 89 | .PP 90 | Copyright (C) 1998-1999 Steve Cheng 91 | .PP 92 | This program is free software; you can redistribute it and/or modify it 93 | under the terms of the GNU General Public License as published by the 94 | Free Software Foundation; either version 2, or (at your option) any 95 | later version. 96 | .PP 97 | You should have received a copy of the GNU General Public License along with 98 | this program; see the file \fICOPYING\fR. If not, please write 99 | to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 100 | -------------------------------------------------------------------------------- /src/utils/filter2docs.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # utils/filter2docs.pl 4 | 5 | # Parse the filter names and descriptions from a filter file and 6 | # spit out copy&paste-ready markup for the various places in 7 | # configuration and documentation where all filters are listed. 8 | 9 | use strict; 10 | use warnings; 11 | 12 | my (%comment_lines, %action_lines, %sgml_source_1, %sgml_source_2); 13 | 14 | sub main() { 15 | 16 | die "Usage: $0 filter-file\n" unless (@ARGV == 1) ; 17 | open(INPUT, "< $ARGV[0]") or die "Couldn't open input file $ARGV[0]: $!\n"; 18 | 19 | parse_file(); 20 | print_markup(); 21 | } 22 | 23 | sub sgml_escape($) { 24 | my $text = shift; 25 | 26 | $text =~ s@<@<@g; 27 | $text =~ s@>@>@g; 28 | 29 | return $text; 30 | } 31 | 32 | sub parse_file() { 33 | while () { 34 | if (/^((?:(?:SERVER|CLIENT)-HEADER-)?(?:FILTER|TAGGER)): ([-\w]+) (.*)$/) { 35 | my $type_uc = $1; 36 | my $name = $2; 37 | my $description = $3; 38 | my $type = lc($type_uc); 39 | my $sgml_description = sgml_escape($description); 40 | my $white_space = ' ' x (($type eq 'filter' ? 20 : 27) - length($name)); 41 | 42 | $comment_lines{$type} .= "# $name:" . $white_space . "$description\n"; 43 | $action_lines{$type} .= "+$type" . "{$name} \\\n"; 44 | $sgml_source_1{$type} .= " \n \n" . 45 | " +$type" . "{$name}" . $white_space . 46 | "# $sgml_description\n \n"; 47 | $sgml_source_2{$type} .= ' -$type" . "{$name} \\\n"; 49 | } 50 | } 51 | } 52 | 53 | sub print_markup() { 54 | 55 | my @filter_types = ( 56 | 'filter', 57 | 'server-header-filter', 58 | 'client-header-filter', 59 | 'server-header-tagger', 60 | 'client-header-tagger' 61 | ); 62 | 63 | foreach my $type (@filter_types) { 64 | 65 | next unless defined $action_lines{$type}; 66 | 67 | print "=" x 90; 68 | 69 | print <<" DOCMARKUP"; 70 | 71 | Producing $type markup: 72 | 73 | Comment lines for default.action.master: 74 | 75 | $comment_lines{$type} 76 | Block of $type actions for default.action.master: 77 | 78 | $action_lines{$type} 79 | SGML Source for AF chapter in U-M: 80 | 81 | $sgml_source_1{$type} 82 | SGML Source for AF Tutorial chapter in U-M: 83 | 84 | $sgml_source_2{$type} 85 | DOCMARKUP 86 | } 87 | } 88 | 89 | main(); 90 | -------------------------------------------------------------------------------- /src/utils/ldp_print/README: -------------------------------------------------------------------------------- 1 | 2 | ###################################################################### 3 | ldp_print - print tool/script for DocBook SGML/XML documents 4 | ###################################################################### 5 | 6 | Copyright (C) 2002-2000 - Greg Ferguson (gferg@metalab.unc.edu) 7 | 8 | This program is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 2 of the License, or 11 | (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | 22 | ###################################################################### 23 | 24 | This process/script is used in the production environment for the 25 | LDP. It relies on the HTMLDOC software package (GPL'ed) which can be 26 | obtained from the Easy Software Products (c) web site: 27 | 28 | http://www.easysw.com/htmldoc/ 29 | 30 | This process creates a PDF variant from the single-file HTML 31 | representation of a DocBook SGML (or XML) instance. The simple 32 | wrapper script (ldp_print) assumes that the file was created using 33 | {open}jade in a manner similar to: 34 | 35 | jade -t sgml -i html -V nochunks -d $style $fname > $fname.html 36 | 37 | Give the script the filename as an argument. It will then parse the 38 | file into 'title.html' and 'body.html' and send each to htmldoc (as 39 | the corresponding title page and body of the document). 40 | 41 | 42 | CAVEATS 43 | ======= 44 | 45 | o Assumes perl is in /usr/bin; adjust if necessary 46 | 47 | o You may need to specify where the htmldoc executable resides. 48 | The script assumes it's within your $PATH. 49 | 50 | o If you want Postscript as an output variant, uncomment the 51 | appropriate lines (see below). 52 | 53 | o Relies on output from a DocBook instance created via DSSSL/{open}jade! 54 | 55 | o Cleans up (removes) the intermediate files it creates (but not the 56 | PDF or Postscript files, obviously!) 57 | 58 | o Works silently; PDF (PostScript) will be created in the same directory 59 | as was specified for the input (single-file HTML) file. 60 | 61 | o Provided without warranty or support! 62 | 63 | o I ran into a problem with htmldoc v1.8.8 which required a source 64 | code change (I was getting a core dump from the htmldoc process). 65 | Here is the change required: 66 | 67 | htmldoc/ps-pdf.cxx : 68 | 3662,3665d3661 69 | < /* gjf = 11Oct2000 */ 70 | < if( temprow == NULL ) 71 | < break; 72 | < 73 | 74 | UPDATE (2001-10-10): It appears that later versions of htmldoc 75 | have this problem corrected. The patch is not required. 76 | 77 | ==== 78 | Greg Ferguson / gferg (at) metalab.unc.edu 79 | 11 Jan 2000 80 | 81 | -------------------------------------------------------------------------------- /src/utils/ldp_print/VERSION: -------------------------------------------------------------------------------- 1 | 0.7.0, 2002-04-04 2 | -------------------------------------------------------------------------------- /src/utils/ldp_print/ldp_print: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # 3 | # usage: ldp_print 4 | # 5 | # Creates a PDF variant of a single-file HTML representation of a 6 | # DocBook SGML (or XML) instance. This simple wrapper assumes that 7 | # the file was created using {open}jade in a manner similar to: 8 | # 9 | # jade -t sgml -i html -V nochunks -d $style $fname > $fname.html 10 | # 11 | # Give this script the filename as an argument. It will then parse 12 | # the file into 'title.html' and 'body.html' and send each to 13 | # htmldoc (as the corresponding title page and body of the document). 14 | # 15 | # 16 | # CAVEATS: 17 | # 18 | # Assumes perl is in /usr/bin; adjust if necessary 19 | # 20 | # You may need to specify where the htmldoc executable resides. 21 | # The script assumes it's within your $PATH. 22 | # 23 | # If you want Postscript as an output variant, uncomment the 24 | # appropriate lines (see below). 25 | # 26 | # Relies on output from a DocBook instance created via DSSSL/{open}jade! 27 | # 28 | # Cleans up (removes) the intermediate files it creates (but not the 29 | # PDF or Postscript files, obviously!) 30 | # 31 | # Works silently; PDF (PostScript) will be created in the same directory 32 | # as was specified for the input (single-file HTML) file. 33 | # 34 | # Provided without warranty or support! 35 | # 36 | # gferg@sgi.com / Ferg (used as part of the LDP production env) 37 | # 38 | 39 | use strict; 40 | push(@INC, "./"); 41 | require 'fix_print_html.lib'; 42 | 43 | if( $ARGV[0] eq '' || !(-r $ARGV[0]) ) { 44 | die "\nusage: ldp_print \n\n"; 45 | } 46 | 47 | my($fname_wo_ext) = $ARGV[0]; 48 | $fname_wo_ext =~ s/\.[\w]+$//; 49 | 50 | 51 | # create new files from single HTML file to use for print 52 | # 53 | &fix_print_html($ARGV[0], 'body.html', 'title.html'); 54 | 55 | my($cmd) = "htmldoc --size universal --bodyfont helvetica --fontsize 8 " . 56 | "-t pdf -f ${fname_wo_ext}.pdf --firstpage p1 --titlefile title.html" . 57 | " body.html --footer c.1"; 58 | 59 | # For postscript output; append onto the above cmd string: 60 | # 61 | # "; htmldoc --size universal -t ps -f ${fname_wo_ext}.ps " . 62 | # "--firstpage p1 --titlefile title.html body.html"; 63 | # 64 | system($cmd); 65 | die "\nldp_print: could not create ${fname_wo_ext}.pdf ($!)\n" if ($?); 66 | 67 | # cleanup 68 | # 69 | system("rm -f body.html title.html"); 70 | 71 | exit(0); 72 | 73 | -------------------------------------------------------------------------------- /src/utils/makeChangeLog: -------------------------------------------------------------------------------- 1 | #!/usr/bin/awk -f 2 | # take output from 3 | # git log [last release tag]..HEAD 4 | # and reformat as a ChangeLog 5 | # 6 | # License: GNU GENERAL PUBLIC LICENSE 7 | # Version 2, June 1991 8 | # 9 | BEGIN { 10 | print "--------------------------------------------------------------------" 11 | print "ChangeLog for Privoxy" 12 | print "--------------------------------------------------------------------" 13 | print "*** Version X.Y.ZZ stable unstable***\n" 14 | } 15 | /^commit / { new = 1; next } 16 | /^Merge: / { next } 17 | /^Author: / { next } 18 | /^Date: / { next } 19 | /^ *$/ { next } # ignore blank lines 20 | /^ / { 21 | if ( new ) { 22 | new = 0 23 | sub("^ ", " -", $0); # 1st line of a change 24 | } 25 | print $0 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/utils/prepare-configfile.pl: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/perl 2 | 3 | # This script is used by the config-file target in GNUMakefile. 4 | # 5 | # It removes garbage in the w3m output and separates comments 6 | # and active directives. 7 | 8 | use strict; 9 | use warnings; 10 | 11 | sub main() { 12 | my $hit_header = 0; 13 | my $hit_option = 0; 14 | my $header_len; 15 | my $unfold_mode = 0; 16 | my $unfolding_enabled = 0; 17 | my $windows_section_reached = 0; 18 | 19 | while (<>) { 20 | 21 | if (!$unfolding_enabled and m/=========/) { 22 | # We passed the table of contents 23 | # and can try to unfold unintentional 24 | # line breaks; 25 | $unfolding_enabled = 1; 26 | } 27 | if (m/specific to the Windows GUI/) { 28 | # The Windows section is formatted differently. 29 | $windows_section_reached = 1; 30 | } 31 | 32 | s/^1\. \@\@TITLE\@\@/ /i; 33 | 34 | if ($hit_header) { 35 | $header_len += length($_); 36 | $_ = " " . $_; 37 | } elsif (m/^(\d*\.){1,3}\s/) { 38 | # Remove the first digit as it's the 39 | # config file section in the User Manual. 40 | s/^(\d\.)//; 41 | 42 | # If it's a section header, uppercase it. 43 | $_ = uc() if (/^\d\.\s+/); 44 | 45 | # Remember to underline it. 46 | $hit_header = 1; 47 | $header_len = length($_); 48 | } 49 | 50 | if ($unfold_mode) { 51 | s/^\s+/ /; 52 | $unfold_mode = 0; 53 | } else { 54 | if ( $hit_option ) { 55 | # processing a continuation of a @@ line 56 | if ( /^\s*$/ ) { # blank line 57 | $hit_option = 0; 58 | next; 59 | } 60 | } 61 | s/^/# /; 62 | } 63 | if ($unfolding_enabled and 64 | (m/(\s+#)\s*$/ or m/forward-socks5 and$/)) { 65 | $unfold_mode = 1; 66 | chomp; 67 | } 68 | 69 | # XXX: someone should figure out what this stuff 70 | # is supposed to do (and if it really does that). 71 | s/^# #/####/ if /^# #{12,}/; 72 | s/^\n//; 73 | s/^#\s*-{20,}//; 74 | s/ *$//; 75 | $hit_option = 1 if s/^#\s+@@//; 76 | 77 | if ($windows_section_reached) { 78 | # Do not drop empty lines in the Windows section 79 | s/^\s*$/#\n/; 80 | } 81 | 82 | print unless (/^\s*$/); 83 | 84 | if ($hit_header and !$unfold_mode) { 85 | # The previous line was a section 86 | # header so we better underline it. 87 | die "Invalid header length" unless defined $header_len; 88 | print "# " . "=" x $header_len . "\n"; 89 | $hit_header = 0; 90 | $header_len = 0; 91 | }; 92 | } 93 | } 94 | main(); 95 | -------------------------------------------------------------------------------- /src/w32log.h: -------------------------------------------------------------------------------- 1 | #ifndef W32LOG_H_INCLUDED 2 | #define W32LOG_H_INCLUDED 3 | /********************************************************************* 4 | * 5 | * File : $Source: /cvsroot/ijbswa/current/w32log.h,v $ 6 | * 7 | * Purpose : Functions for creating and destroying the log window, 8 | * ouputting strings, processing messages and so on. 9 | * 10 | * Copyright : Written by and Copyright (C) 2001-2009 members of 11 | * the Privoxy team. http://www.privoxy.org/ 12 | * 13 | * Written by and Copyright (C) 1999 Adam Lock 14 | * 15 | * 16 | * This program is free software; you can redistribute it 17 | * and/or modify it under the terms of the GNU General 18 | * Public License as published by the Free Software 19 | * Foundation; either version 2 of the License, or (at 20 | * your option) any later version. 21 | * 22 | * This program is distributed in the hope that it will 23 | * be useful, but WITHOUT ANY WARRANTY; without even the 24 | * implied warranty of MERCHANTABILITY or FITNESS FOR A 25 | * PARTICULAR PURPOSE. See the GNU General Public 26 | * License for more details. 27 | * 28 | * The GNU General Public License should be included with 29 | * this file. If not, you can view it at 30 | * http://www.gnu.org/copyleft/gpl.html 31 | * or write to the Free Software Foundation, Inc., 59 32 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 33 | * 34 | *********************************************************************/ 35 | 36 | 37 | extern HWND g_hwndLogFrame; 38 | 39 | /* Indicates whether task bar shows activity animation */ 40 | extern BOOL g_bShowActivityAnimation; 41 | 42 | /* Indicates if the log window appears on the task bar */ 43 | extern BOOL g_bShowOnTaskBar; 44 | 45 | /* Indicates whether closing the log window really just hides it */ 46 | extern BOOL g_bCloseHidesWindow; 47 | 48 | /* Indicates if messages are logged at all */ 49 | extern BOOL g_bLogMessages; 50 | 51 | /* Indicates whether log messages are highlighted */ 52 | extern BOOL g_bHighlightMessages; 53 | 54 | /* Indicates if buffer is limited in size */ 55 | extern BOOL g_bLimitBufferSize; 56 | 57 | /* Maximum number of lines allowed in buffer when limited */ 58 | extern int g_nMaxBufferLines; 59 | 60 | /* Font to use */ 61 | extern char g_szFontFaceName[32]; 62 | 63 | /* Size of font to use */ 64 | extern int g_nFontSize; 65 | 66 | 67 | /* FIXME: this is a kludge */ 68 | 69 | extern const char * g_default_actions_file; 70 | extern const char * g_user_actions_file; 71 | extern const char * g_default_filterfile; 72 | extern const char * g_user_filterfile; 73 | #ifdef FEATURE_TRUST 74 | extern const char * g_trustfile; 75 | #endif /* def FEATURE_TRUST */ 76 | 77 | /* FIXME: end kludge */ 78 | 79 | extern HICON g_hiconApp; 80 | extern int LogPutString(const char *pszText); 81 | extern BOOL InitLogWindow(void); 82 | extern void TermLogWindow(void); 83 | extern void ShowLogWindow(BOOL bShow); 84 | extern void LogShowActivity(void); 85 | 86 | #endif /* ndef W32LOG_H_INCLUDED */ 87 | 88 | 89 | /* 90 | Local Variables: 91 | tab-width: 3 92 | end: 93 | */ 94 | -------------------------------------------------------------------------------- /src/w32res.h: -------------------------------------------------------------------------------- 1 | #ifndef W32RES_H_INCLUDED 2 | #define W32RES_H_INCLUDED 3 | /********************************************************************* 4 | * 5 | * File : $Source: /cvsroot/ijbswa/current/w32res.h,v $ 6 | * 7 | * Purpose : Identifiers for Windows GUI resources. 8 | * 9 | * Copyright : Written by and Copyright (C) 2001-2002 members of 10 | * the Privoxy team. http://www.privoxy.org/ 11 | * 12 | * Based on the Internet Junkbuster originally written 13 | * by and Copyright (C) 1997 Anonymous Coders and 14 | * Junkbusters Corporation. http://www.junkbusters.com 15 | * 16 | * This program is free software; you can redistribute it 17 | * and/or modify it under the terms of the GNU General 18 | * Public License as published by the Free Software 19 | * Foundation; either version 2 of the License, or (at 20 | * your option) any later version. 21 | * 22 | * This program is distributed in the hope that it will 23 | * be useful, but WITHOUT ANY WARRANTY; without even the 24 | * implied warranty of MERCHANTABILITY or FITNESS FOR A 25 | * PARTICULAR PURPOSE. See the GNU General Public 26 | * License for more details. 27 | * 28 | * The GNU General Public License should be included with 29 | * this file. If not, you can view it at 30 | * http://www.gnu.org/copyleft/gpl.html 31 | * or write to the Free Software Foundation, Inc., 59 32 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 33 | * 34 | *********************************************************************/ 35 | 36 | #define IDR_TRAYMENU 101 37 | #define IDI_IDLE 102 38 | #define IDR_LOGVIEW 103 39 | #define IDR_ACCELERATOR 104 40 | #define IDR_POPUP_SELECTION 105 41 | 42 | 43 | #define IDI_MAINICON 200 44 | #define IDI_ANIMATED1 201 45 | #define IDI_ANIMATED2 202 46 | #define IDI_ANIMATED3 203 47 | #define IDI_ANIMATED4 204 48 | #define IDI_ANIMATED5 205 49 | #define IDI_ANIMATED6 206 50 | #define IDI_ANIMATED7 207 51 | #define IDI_ANIMATED8 208 52 | #define IDI_OFF 209 53 | 54 | #define ID_TOGGLE_SHOWWINDOW 4000 55 | #define ID_HELP_ABOUT 4001 56 | #define ID_FILE_EXIT 4002 57 | #define ID_VIEW_CLEARLOG 4003 58 | #define ID_VIEW_LOGMESSAGES 4004 59 | #define ID_VIEW_MESSAGEHIGHLIGHTING 4005 60 | #define ID_VIEW_LIMITBUFFERSIZE 4006 61 | #define ID_VIEW_ACTIVITYANIMATION 4007 62 | #define ID_HELP_FAQ 4008 63 | #define ID_HELP_MANUAL 4009 64 | #define ID_HELP_GPL 4010 65 | #define ID_HELP_STATUS 4011 66 | #ifdef FEATURE_TOGGLE 67 | #define ID_TOGGLE_ENABLED 4012 68 | #endif /* def FEATURE_TOGGLE */ 69 | 70 | /* Break these out so they are easier to extend, but keep consecutive */ 71 | #define ID_TOOLS_EDITCONFIG 5000 72 | #define ID_TOOLS_EDITDEFAULTACTIONS 5001 73 | #define ID_TOOLS_EDITUSERACTIONS 5002 74 | #define ID_TOOLS_EDITDEFAULTFILTERS 5003 75 | #define ID_TOOLS_EDITUSERFILTERS 5004 76 | 77 | #ifdef FEATURE_TRUST 78 | #define ID_TOOLS_EDITTRUST 5005 79 | #endif /* def FEATURE_TRUST */ 80 | 81 | #define ID_EDIT_COPY 30000 82 | 83 | 84 | #endif /* ndef W32RES_H_INCLUDED */ 85 | 86 | /* 87 | Local Variables: 88 | tab-width: 3 89 | end: 90 | */ 91 | -------------------------------------------------------------------------------- /src/w32svrapi.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/w32svrapi.c -------------------------------------------------------------------------------- /src/w32svrapi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomtdev/LibPrivoxy/34764f6a97f8bb7492d49557d6ab050bc513bd81/src/w32svrapi.h -------------------------------------------------------------------------------- /src/w32taskbar.h: -------------------------------------------------------------------------------- 1 | #ifndef W32TASKBAR_H_INCLUDED 2 | #define W32TASKBAR_H_INCLUDED 3 | /********************************************************************* 4 | * 5 | * File : $Source: /cvsroot/ijbswa/current/w32taskbar.h,v $ 6 | * 7 | * Purpose : Functions for creating, setting and destroying the 8 | * workspace tray icon 9 | * 10 | * Copyright : Written by and Copyright (C) 2001-2002 members of 11 | * the Privoxy team. http://www.privoxy.org/ 12 | * 13 | * Written by and Copyright (C) 1999 Adam Lock 14 | * 15 | * 16 | * This program is free software; you can redistribute it 17 | * and/or modify it under the terms of the GNU General 18 | * Public License as published by the Free Software 19 | * Foundation; either version 2 of the License, or (at 20 | * your option) any later version. 21 | * 22 | * This program is distributed in the hope that it will 23 | * be useful, but WITHOUT ANY WARRANTY; without even the 24 | * implied warranty of MERCHANTABILITY or FITNESS FOR A 25 | * PARTICULAR PURPOSE. See the GNU General Public 26 | * License for more details. 27 | * 28 | * The GNU General Public License should be included with 29 | * this file. If not, you can view it at 30 | * http://www.gnu.org/copyleft/gpl.html 31 | * or write to the Free Software Foundation, Inc., 59 32 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 33 | * 34 | *********************************************************************/ 35 | 36 | 37 | extern HWND CreateTrayWindow(HINSTANCE hInstance); 38 | extern BOOL TrayAddIcon(HWND hwnd, UINT uID, HICON hicon, const char *pszToolTip); 39 | extern BOOL TraySetIcon(HWND hwnd, UINT uID, HICON hicon); 40 | extern BOOL TrayDeleteIcon(HWND hwnd, UINT uID); 41 | 42 | #endif /* ndef W32TASKBAR_H_INCLUDED */ 43 | 44 | 45 | /* 46 | Local Variables: 47 | tab-width: 3 48 | end: 49 | */ 50 | -------------------------------------------------------------------------------- /src/win32.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN32_H_INCLUDED 2 | #define WIN32_H_INCLUDED 3 | /********************************************************************* 4 | * 5 | * File : $Source: /cvsroot/ijbswa/current/win32.h,v $ 6 | * 7 | * Purpose : Win32 User Interface initialization and message loop 8 | * 9 | * Copyright : Written by and Copyright (C) 2001-2002 members of 10 | * the Privoxy team. http://www.privoxy.org/ 11 | * 12 | * Written by and Copyright (C) 1999 Adam Lock 13 | * 14 | * 15 | * This program is free software; you can redistribute it 16 | * and/or modify it under the terms of the GNU General 17 | * Public License as published by the Free Software 18 | * Foundation; either version 2 of the License, or (at 19 | * your option) any later version. 20 | * 21 | * This program is distributed in the hope that it will 22 | * be useful, but WITHOUT ANY WARRANTY; without even the 23 | * implied warranty of MERCHANTABILITY or FITNESS FOR A 24 | * PARTICULAR PURPOSE. See the GNU General Public 25 | * License for more details. 26 | * 27 | * The GNU General Public License should be included with 28 | * this file. If not, you can view it at 29 | * http://www.gnu.org/copyleft/gpl.html 30 | * or write to the Free Software Foundation, Inc., 59 31 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 32 | * 33 | *********************************************************************/ 34 | 35 | 36 | extern const char win32_blurb[]; 37 | 38 | extern void InitWin32(void); 39 | 40 | #ifdef _WIN_CONSOLE 41 | extern int hideConsole; 42 | #endif /*def _WIN_CONSOLE */ 43 | 44 | extern HINSTANCE g_hInstance; 45 | extern int g_nCmdShow; 46 | 47 | extern int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow); 48 | 49 | #endif /* ndef WIN32_H_INCLUDED */ 50 | 51 | /* 52 | Local Variables: 53 | tab-width: 3 54 | end: 55 | */ 56 | --------------------------------------------------------------------------------