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="copyright.html">Copyright</a> ©
22 2001-2009 by <a href="http://www.privoxy.org/" target="_top">Privoxy
23 Developers</a></sub><br></p>
25 <p class="PUBDATE">$Id: developer-manual.sgml,v 2.38 2011/12/26
26 17:05:40 fabiankeil Exp $<br></p>
29 <div class="ABSTRACT">
30 <a name="AEN9" id="AEN9"></a>
32 <p>The developer manual provides guidance on coding, testing,
33 packaging, documentation and other issues of importance to those
34 involved with <span class="APPLICATION">Privoxy</span> development.
35 It is mandatory (and helpful!) reading for anyone who wants to join
36 the team. Note that it's currently out of date and may not be
37 entirely correct. As always, patches are welcome.</p>
39 <p>Please note that this document is constantly evolving. This copy
40 represents the state at the release of version 3.0.19. You can find
41 the latest version of the this manual at <a href=
42 "http://www.privoxy.org/developer-manual/" target=
43 "_top">http://www.privoxy.org/developer-manual/</a>. Please see
44 <a href="contact.html">the Contact section</a> on how to contact
53 <dt><b>Table of Contents</b></dt>
55 <dt>1. <a href="introduction.html">Introduction</a></dt>
59 <dt>1.1. <a href="introduction.html#QUICKSTART">Quickstart to
60 Privoxy Development</a></dt>
64 <dt>2. <a href="cvs.html">The CVS Repository</a></dt>
68 <dt>2.1. <a href="cvs.html#CVSACCESS">Access to CVS</a></dt>
70 <dt>2.2. <a href="cvs.html#CVSBRANCHES">Branches</a></dt>
72 <dt>2.3. <a href="cvs.html#CVSCOMMIT">CVS Commit
77 <dt>3. <a href="documentation.html">Documentation Guidelines</a></dt>
81 <dt>3.1. <a href="documentation.html#SGML">Quickstart to Docbook
84 <dt>3.2. <a href="documentation.html#DOCSTYLE"><span class=
85 "APPLICATION">Privoxy</span> Documentation Style</a></dt>
87 <dt>3.3. <a href="documentation.html#AEN217">Privoxy Custom
92 <dt>4. <a href="coding.html">Coding Guidelines</a></dt>
96 <dt>4.1. <a href="coding.html#S1">Introduction</a></dt>
98 <dt>4.2. <a href="coding.html#S2">Using Comments</a></dt>
102 <dt>4.2.1. <a href="coding.html#S3">Comment, Comment,
105 <dt>4.2.2. <a href="coding.html#S4">Use blocks for
108 <dt>4.2.3. <a href="coding.html#S5">Keep Comments on their
111 <dt>4.2.4. <a href="coding.html#S6">Comment each logical
114 <dt>4.2.5. <a href="coding.html#S7">Comment All Functions
117 <dt>4.2.6. <a href="coding.html#S8">Comment at the end of
118 braces if the content is more than one screen length</a></dt>
122 <dt>4.3. <a href="coding.html#S9">Naming Conventions</a></dt>
126 <dt>4.3.1. <a href="coding.html#S10">Variable Names</a></dt>
128 <dt>4.3.2. <a href="coding.html#S11">Function Names</a></dt>
130 <dt>4.3.3. <a href="coding.html#S12">Header file
133 <dt>4.3.4. <a href="coding.html#S13">Enumerations, and
136 <dt>4.3.5. <a href="coding.html#S14">Constants</a></dt>
140 <dt>4.4. <a href="coding.html#S15">Using Space</a></dt>
144 <dt>4.4.1. <a href="coding.html#S16">Put braces on a line by
147 <dt>4.4.2. <a href="coding.html#S17">ALL control statements
148 should have a block</a></dt>
150 <dt>4.4.3. <a href="coding.html#S18">Do not belabor/blow-up
151 boolean expressions</a></dt>
153 <dt>4.4.4. <a href="coding.html#S19">Use white space freely
154 because it is free</a></dt>
156 <dt>4.4.5. <a href="coding.html#S20">Don't use white space
157 around structure operators</a></dt>
159 <dt>4.4.6. <a href="coding.html#S21">Make the last brace of a
160 function stand out</a></dt>
162 <dt>4.4.7. <a href="coding.html#S22">Use 3 character
167 <dt>4.5. <a href="coding.html#S23">Initializing</a></dt>
171 <dt>4.5.1. <a href="coding.html#S24">Initialize all
176 <dt>4.6. <a href="coding.html#S25">Functions</a></dt>
180 <dt>4.6.1. <a href="coding.html#S26">Name functions that
181 return a boolean as a question.</a></dt>
183 <dt>4.6.2. <a href="coding.html#S27">Always specify a return
184 type for a function.</a></dt>
186 <dt>4.6.3. <a href="coding.html#S28">Minimize function calls
187 when iterating by using variables</a></dt>
189 <dt>4.6.4. <a href="coding.html#S29">Pass and Return by Const
192 <dt>4.6.5. <a href="coding.html#S30">Pass and Return by
195 <dt>4.6.6. <a href="coding.html#S31">Names of include
198 <dt>4.6.7. <a href="coding.html#S32">Provide multiple
199 inclusion protection</a></dt>
201 <dt>4.6.8. <a href="coding.html#S33">Use `extern "C"` when
204 <dt>4.6.9. <a href="coding.html#S34">Where Possible, Use
205 Forward Struct Declaration Instead of Includes</a></dt>
209 <dt>4.7. <a href="coding.html#S35">General Coding
214 <dt>4.7.1. <a href="coding.html#S36">Turn on
217 <dt>4.7.2. <a href="coding.html#S37">Provide a default case
218 for all switch statements</a></dt>
220 <dt>4.7.3. <a href="coding.html#S38">Try to avoid falling
221 through cases in a switch statement.</a></dt>
223 <dt>4.7.4. <a href="coding.html#S39">Use 'long' or 'short'
224 Instead of 'int'</a></dt>
226 <dt>4.7.5. <a href="coding.html#S40">Don't mix size_t and
229 <dt>4.7.6. <a href="coding.html#S41">Declare each variable
230 and struct on its own line.</a></dt>
232 <dt>4.7.7. <a href="coding.html#S42">Use malloc/zalloc
235 <dt>4.7.8. <a href="coding.html#S43">The Programmer Who Uses
236 'malloc' is Responsible for Ensuring 'free'</a></dt>
238 <dt>4.7.9. <a href="coding.html#S44">Add loaders to the
239 `file_list' structure and in order</a></dt>
241 <dt>4.7.10. <a href="coding.html#S45">"Uncertain" new code
242 and/or changes to existing code, use FIXME or XXX</a></dt>
246 <dt>4.8. <a href="coding.html#S46">Addendum: Template for files
247 and function comment blocks:</a></dt>
251 <dt>5. <a href="testing.html">Testing Guidelines</a></dt>
255 <dt>5.1. <a href="testing.html#TESTING-PLAN">Testplan for
258 <dt>5.2. <a href="testing.html#TESTING-REPORT">Test
263 <dt>6. <a href="newrelease.html">Releasing a New Version</a></dt>
267 <dt>6.1. <a href="newrelease.html#VERSIONNUMBERS">Version
270 <dt>6.2. <a href="newrelease.html#BEFORERELEASE">Before the
271 Release: Freeze</a></dt>
273 <dt>6.3. <a href="newrelease.html#THERELEASE">Building and
274 Releasing the Packages</a></dt>
278 <dt>6.3.1. <a href="newrelease.html#PACK-GUIDELINES">Note on
279 Privoxy Packaging</a></dt>
282 "newrelease.html#NEWRELEASE-TARBALL">Source Tarball</a></dt>
284 <dt>6.3.3. <a href="newrelease.html#NEWRELEASE-RPM">SuSE,
285 Conectiva or Red Hat RPM</a></dt>
288 "newrelease.html#NEWRELEASE-OS2">OS/2</a></dt>
291 "newrelease.html#NEWRELEASE-SOLARIS">Solaris</a></dt>
294 "newrelease.html#NEWRELEASE-WINDOWS">Windows</a></dt>
297 "newrelease.html#NEWRELEASE-DEBIAN">Debian</a></dt>
299 <dt>6.3.8. <a href="newrelease.html#NEWRELEASE-MACOSX">Mac OS
303 "newrelease.html#NEWRELEASE-FREEBSD">FreeBSD</a></dt>
305 <dt>6.3.10. <a href="newrelease.html#NEWRELEASE-HPUX">HP-UX
308 <dt>6.3.11. <a href="newrelease.html#NEWRELEASE-AMIGA">Amiga
312 "newrelease.html#NEWRELEASE-AIX">AIX</a></dt>
316 <dt>6.4. <a href="newrelease.html#RELEASING">Uploading and
317 Releasing Your Package</a></dt>
319 <dt>6.5. <a href="newrelease.html#AFTERRELEASE">After the
324 <dt>7. <a href="webserver-update.html">Update the Webserver</a></dt>
326 <dt>8. <a href="contact.html">Contacting the developers, Bug
327 Reporting and Feature Requests</a></dt>
331 <dt>8.1. <a href="contact.html#CONTACT-SUPPORT">Get
334 <dt>8.2. <a href="contact.html#REPORTING">Reporting
339 <dt>8.2.1. <a href="contact.html#CONTACT-ADS">Reporting Ads
340 or Other Configuration Problems</a></dt>
342 <dt>8.2.2. <a href="contact.html#CONTACT-BUGS">Reporting
347 <dt>8.3. <a href="contact.html#CONTACT-FEATURE">Request New
350 <dt>8.4. <a href="contact.html#MAILING-LISTS">Mailing
355 <dt>9. <a href="copyright.html">Privoxy Copyright, License and
360 <dt>9.1. <a href="copyright.html#AEN1231">License</a></dt>
362 <dt>9.2. <a href="copyright.html#AEN1247">History</a></dt>
366 <dt>10. <a href="seealso.html">See also</a></dt>
371 <div class="NAVFOOTER">
372 <hr align="left" width="100%">
374 <table summary="Footer navigation table" width="100%" border="0"
375 cellpadding="0" cellspacing="0">
377 <td width="33%" align="left" valign="top"> </td>
379 <td width="34%" align="center" valign="top"> </td>
381 <td width="33%" align="right" valign="top"><a href=
382 "introduction.html" accesskey="N">Next</a></td>
386 <td width="33%" align="left" valign="top"> </td>
388 <td width="34%" align="center" valign="top"> </td>
390 <td width="33%" align="right" valign="top">Introduction</td>