Privoxy Developer Manual

By: Privoxy Developers

$Id: developer-manual.sgml,v 1.28 2002/04/08 22:59:26 hal9 Exp $

The developer manual gives the users information on how to help the developer team. It provides guidance on coding, testing, documentation and other issues.

Privoxy is a web proxy with advanced filtering capabilities for protecting privacy, filtering web page content, managing cookies, controlling access, and removing ads, banners, pop-ups and other obnoxious Internet junk. Privoxy has a very flexible configuration and can be customized to suit individual needs and tastes. Privoxy has application for both stand-alone systems and multi-user networks.

Privoxy is based on the code of the Internet Junkbuster (tm). Junkbuster was originally written by Junkbusters Corporation, and was released as free open-source software under the GNU GPL. Stefan Waldherr made many improvements, and started the SourceForge project to continue development.

Privoxy continues the Junkbuster tradition, but adds many refinements, enhancements and new features.

You can find the latest version of the this manual at http://www.privoxy.org/developer-manual/. Please see the Contact section on how to contact the developers.


Table of Contents
1. Introduction
3. Quickstart to Privoxy Development
4. Documentation Guidelines
4.1. Quickstart to Docbook and SGML
4.2. Privoxy Documentation Style
4.3. Privoxy Custom Entities
5. Coding Guidelines
5.1. Introduction
5.2. Using Comments
5.2.1. Comment, Comment, Comment
5.2.2. Use blocks for comments
5.2.3. Keep Comments on their own line
5.2.4. Comment each logical step
5.2.5. Comment All Functions Thoroughly
5.2.6. Comment at the end of braces if the content is more than one screen length
5.3. Naming Conventions
5.3.1. Variable Names
5.3.2. Function Names
5.3.3. Header file prototypes
5.3.4. Enumerations, and #defines
5.3.5. Constants
5.4. Using Space
5.4.1. Put braces on a line by themselves.
5.4.2. ALL control statements should have a block
5.4.3. Do not belabor/blow-up boolean expressions
5.4.4. Use white space freely because it is free
5.4.5. Don't use white space around structure operators
5.4.6. Make the last brace of a function stand out
5.4.7. Use 3 character indentions
5.5. Initializing
5.5.1. Initialize all variables
5.6. Functions
5.6.1. Name functions that return a boolean as a question.
5.6.2. Always specify a return type for a function.
5.6.3. Minimize function calls when iterating by using variables
5.6.4. Pass and Return by Const Reference
5.6.5. Pass and Return by Value
5.6.6. Names of include files
5.6.7. Provide multiple inclusion protection
5.6.8. Use `extern "C"` when appropriate
5.6.9. Where Possible, Use Forward Struct Declaration Instead of Includes
5.7. General Coding Practices
5.7.1. Turn on warnings
5.7.2. Provide a default case for all switch statements
5.7.3. Try to avoid falling through cases in a switch statement.
5.7.4. Use 'long' or 'short' Instead of 'int'
5.7.5. Don't mix size_t and other types
5.7.6. Declare each variable and struct on its own line.
5.7.7. Use malloc/zalloc sparingly
5.7.8. The Programmer Who Uses 'malloc' is Responsible for Ensuring 'free'
5.7.9. Add loaders to the `file_list' structure and in order
5.7.10. "Uncertain" new code and/or changes to exitinst code, use FIXME
5.8. Addendum: Template for files and function comment blocks:
6. Version Control Guidelines
7. Testing Guidelines
7.1. Testplan for releases
7.2. Test reports
8. Releasing a new version
8.1. Before the Release
8.2. Update the webserver
8.3. SuSE or Red Hat
8.4. OS/2
8.5. Solaris
8.6. Windows
8.7. Debian
8.8. Mac OSX
8.9. FreeBSD
8.10. Tarball
8.11. HP-UX 11
8.12. Amiga OS
8.13. AIX
9. Contacting the developers, Bug Reporting and Feature Requests
10. Copyright and History
10.1. Copyright
10.2. History
11. See also