1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
6 <title>Privoxy Developer Manual</title>
7 <meta name="GENERATOR" content=
8 "Modular DocBook HTML Stylesheet Version 1.79">
9 <link rel="NEXT" title="Introduction" href="introduction.html">
10 <link rel="STYLESHEET" type="text/css" href="../p_doc.css">
11 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
14 <body class="ARTICLE" bgcolor="#EEEEEE" text="#000000" link="#0000FF" vlink=
15 "#840084" alink="#0000FF">
17 <div class="TITLEPAGE">
18 <h1 class="TITLE"><a name="AEN2" id="AEN2">Privoxy Developer
21 <p class="PUBDATE"><sub><a href=
22 "http://www.privoxy.org/user-manual/copyright.html" target=
23 "_top">Copyright</a> © 2001-2013 by <a href=
24 "http://www.privoxy.org/" target="_top">Privoxy
25 Developers</a></sub><br></p>
27 <p class="PUBDATE">$Id: developer-manual.sgml,v 2.58 2014/05/26
28 10:48:39 fabiankeil Exp $<br></p>
31 <div class="ABSTRACT">
32 <a name="AEN9" id="AEN9"></a>
34 <p>The developer manual provides guidance on coding, testing,
35 packaging, documentation and other issues of importance to those
36 involved with <span class="APPLICATION">Privoxy</span> development.
37 It is mandatory (and helpful!) reading for anyone who wants to join
38 the team. Note that it's currently out of date and may not be
39 entirely correct. As always, patches are welcome.</p>
41 <p>Please note that this document is constantly evolving. This copy
42 represents the state at the release of version 3.0.24. You can find
43 the latest version of the this manual at <a href=
44 "http://www.privoxy.org/developer-manual/" target=
45 "_top">http://www.privoxy.org/developer-manual/</a>. Please have a
47 "http://www.privoxy.org/user-manual/contact.html" target=
48 "_top">contact section in the user manual</a> if you are interested
49 in contacting the developers.</p>
57 <dt><b>Table of Contents</b></dt>
59 <dt>1. <a href="introduction.html">Introduction</a></dt>
63 <dt>1.1. <a href="introduction.html#QUICKSTART">Quickstart to
64 Privoxy Development</a></dt>
68 <dt>2. <a href="cvs.html">The CVS Repository</a></dt>
72 <dt>2.1. <a href="cvs.html#CVSACCESS">Access to CVS</a></dt>
74 <dt>2.2. <a href="cvs.html#CVSBRANCHES">Branches</a></dt>
76 <dt>2.3. <a href="cvs.html#CVSCOMMIT">CVS Commit
81 <dt>3. <a href="documentation.html">Documentation Guidelines</a></dt>
85 <dt>3.1. <a href="documentation.html#SGML">Quickstart to Docbook
88 <dt>3.2. <a href="documentation.html#DOCSTYLE"><span class=
89 "APPLICATION">Privoxy</span> Documentation Style</a></dt>
91 <dt>3.3. <a href="documentation.html#AEN208">Privoxy Custom
96 <dt>4. <a href="coding.html">Coding Guidelines</a></dt>
100 <dt>4.1. <a href="coding.html#S1">Introduction</a></dt>
102 <dt>4.2. <a href="coding.html#S2">Using Comments</a></dt>
106 <dt>4.2.1. <a href="coding.html#S3">Comment, Comment,
109 <dt>4.2.2. <a href="coding.html#S4">Use blocks for
112 <dt>4.2.3. <a href="coding.html#S5">Keep Comments on their
115 <dt>4.2.4. <a href="coding.html#S6">Comment each logical
118 <dt>4.2.5. <a href="coding.html#S7">Comment All Functions
121 <dt>4.2.6. <a href="coding.html#S8">Comment at the end of
122 braces if the content is more than one screen length</a></dt>
126 <dt>4.3. <a href="coding.html#S9">Naming Conventions</a></dt>
130 <dt>4.3.1. <a href="coding.html#S10">Variable Names</a></dt>
132 <dt>4.3.2. <a href="coding.html#S11">Function Names</a></dt>
134 <dt>4.3.3. <a href="coding.html#S12">Header file
137 <dt>4.3.4. <a href="coding.html#S13">Enumerations, and
140 <dt>4.3.5. <a href="coding.html#S14">Constants</a></dt>
144 <dt>4.4. <a href="coding.html#S15">Using Space</a></dt>
148 <dt>4.4.1. <a href="coding.html#S16">Put braces on a line by
151 <dt>4.4.2. <a href="coding.html#S17">ALL control statements
152 should have a block</a></dt>
154 <dt>4.4.3. <a href="coding.html#S18">Do not belabor/blow-up
155 boolean expressions</a></dt>
157 <dt>4.4.4. <a href="coding.html#S19">Use white space freely
158 because it is free</a></dt>
160 <dt>4.4.5. <a href="coding.html#S20">Don't use white space
161 around structure operators</a></dt>
163 <dt>4.4.6. <a href="coding.html#S21">Make the last brace of a
164 function stand out</a></dt>
166 <dt>4.4.7. <a href="coding.html#S22">Use 3 character
171 <dt>4.5. <a href="coding.html#S23">Initializing</a></dt>
175 <dt>4.5.1. <a href="coding.html#S24">Initialize all
180 <dt>4.6. <a href="coding.html#S25">Functions</a></dt>
184 <dt>4.6.1. <a href="coding.html#S26">Name functions that
185 return a boolean as a question.</a></dt>
187 <dt>4.6.2. <a href="coding.html#S27">Always specify a return
188 type for a function.</a></dt>
190 <dt>4.6.3. <a href="coding.html#S28">Minimize function calls
191 when iterating by using variables</a></dt>
193 <dt>4.6.4. <a href="coding.html#S29">Pass and Return by Const
196 <dt>4.6.5. <a href="coding.html#S30">Pass and Return by
199 <dt>4.6.6. <a href="coding.html#S31">Names of include
202 <dt>4.6.7. <a href="coding.html#S32">Provide multiple
203 inclusion protection</a></dt>
205 <dt>4.6.8. <a href="coding.html#S33">Use `extern "C"` when
208 <dt>4.6.9. <a href="coding.html#S34">Where Possible, Use
209 Forward Struct Declaration Instead of Includes</a></dt>
213 <dt>4.7. <a href="coding.html#S35">General Coding
218 <dt>4.7.1. <a href="coding.html#S36">Turn on
221 <dt>4.7.2. <a href="coding.html#S37">Provide a default case
222 for all switch statements</a></dt>
224 <dt>4.7.3. <a href="coding.html#S38">Try to avoid falling
225 through cases in a switch statement.</a></dt>
227 <dt>4.7.4. <a href="coding.html#S40">Don't mix size_t and
230 <dt>4.7.5. <a href="coding.html#S41">Declare each variable
231 and struct on its own line.</a></dt>
233 <dt>4.7.6. <a href="coding.html#S42">Use malloc/zalloc
236 <dt>4.7.7. <a href="coding.html#S43">The Programmer Who Uses
237 'malloc' is Responsible for Ensuring 'free'</a></dt>
239 <dt>4.7.8. <a href="coding.html#S44">Add loaders to the
240 `file_list' structure and in order</a></dt>
242 <dt>4.7.9. <a href="coding.html#S45">"Uncertain" new code
243 and/or changes to existing code, use XXX</a></dt>
247 <dt>4.8. <a href="coding.html#S46">Addendum: Template for files
248 and function comment blocks:</a></dt>
252 <dt>5. <a href="testing.html">Testing Guidelines</a></dt>
256 <dt>5.1. <a href="testing.html#TESTING-PLAN">Testplan for
259 <dt>5.2. <a href="testing.html#TESTING-REPORT">Test
264 <dt>6. <a href="newrelease.html">Releasing a New Version</a></dt>
268 <dt>6.1. <a href="newrelease.html#VERSIONNUMBERS">Version
271 <dt>6.2. <a href="newrelease.html#BEFORERELEASE">Before the
272 Release: Freeze</a></dt>
274 <dt>6.3. <a href="newrelease.html#THERELEASE">Building and
275 Releasing the Packages</a></dt>
279 <dt>6.3.1. <a href="newrelease.html#PACK-GUIDELINES">Note on
280 Privoxy Packaging</a></dt>
283 "newrelease.html#NEWRELEASE-TARBALL">Source Tarball</a></dt>
285 <dt>6.3.3. <a href="newrelease.html#NEWRELEASE-RPM">SuSE,
286 Conectiva or Red Hat RPM</a></dt>
289 "newrelease.html#NEWRELEASE-OS2">OS/2</a></dt>
292 "newrelease.html#NEWRELEASE-SOLARIS">Solaris</a></dt>
295 "newrelease.html#NEWRELEASE-WINDOWS">Windows</a></dt>
298 "newrelease.html#NEWRELEASE-DEBIAN">Debian</a></dt>
300 <dt>6.3.8. <a href="newrelease.html#NEWRELEASE-MACOSX">Mac OS
304 "newrelease.html#NEWRELEASE-FREEBSD">FreeBSD</a></dt>
306 <dt>6.3.10. <a href="newrelease.html#NEWRELEASE-HPUX">HP-UX
309 <dt>6.3.11. <a href="newrelease.html#NEWRELEASE-AMIGA">Amiga
313 "newrelease.html#NEWRELEASE-AIX">AIX</a></dt>
317 <dt>6.4. <a href="newrelease.html#RELEASING">Uploading and
318 Releasing Your Package</a></dt>
320 <dt>6.5. <a href="newrelease.html#AFTERRELEASE">After the
325 <dt>7. <a href="webserver-update.html">Update the Webserver</a></dt>
330 <div class="NAVFOOTER">
331 <hr align="left" width="100%">
333 <table summary="Footer navigation table" width="100%" border="0"
334 cellpadding="0" cellspacing="0">
336 <td width="33%" align="left" valign="top"> </td>
338 <td width="34%" align="center" valign="top"> </td>
340 <td width="33%" align="right" valign="top"><a href=
341 "introduction.html" accesskey="N">Next</a></td>
345 <td width="33%" align="left" valign="top"> </td>
347 <td width="34%" align="center" valign="top"> </td>
349 <td width="33%" align="right" valign="top">Introduction</td>