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">
12 <style type="text/css">
14 background-color: #EEEEEE;
17 :link { color: #0000FF }
18 :visited { color: #840084 }
19 :active { color: #0000FF }
20 hr.c2 {text-align: left}
21 dt.c1 {font-weight: bold}
25 <body class="ARTICLE">
27 <div class="TITLEPAGE">
28 <h1 class="TITLE"><a name="AEN2" id="AEN2">Privoxy Developer
31 <p class="PUBDATE"><sub><a href="copyright.html">Copyright</a> ©
32 2001-2009 by <a href="http://www.privoxy.org/" target="_top">Privoxy
33 Developers</a></sub><br></p>
35 <p class="PUBDATE">$Id: developer-manual.sgml,v 2.39 2012/03/18
36 01:16:35 diem Exp $<br></p>
38 <div class="ABSTRACT">
39 <a name="AEN9" id="AEN9"></a>
41 <p>The developer manual provides guidance on coding, testing,
42 packaging, documentation and other issues of importance to those
43 involved with <span class="APPLICATION">Privoxy</span> development.
44 It is mandatory (and helpful!) reading for anyone who wants to join
45 the team. Note that it's currently out of date and may not be
46 entirely correct. As always, patches are welcome.</p>
48 <p>Please note that this document is constantly evolving. This copy
49 represents the state at the release of version 3.0.20. You can find
50 the latest version of the this manual at <a href=
51 "http://www.privoxy.org/developer-manual/" target=
52 "_top">http://www.privoxy.org/developer-manual/</a>. Please see
53 <a href="contact.html">the Contact section</a> on how to contact the
61 <dt class="c1">Table of Contents</dt>
63 <dt>1. <a href="introduction.html">Introduction</a></dt>
67 <dt>1.1. <a href="introduction.html#QUICKSTART">Quickstart to
68 Privoxy Development</a></dt>
72 <dt>2. <a href="cvs.html">The CVS Repository</a></dt>
76 <dt>2.1. <a href="cvs.html#CVSACCESS">Access to CVS</a></dt>
78 <dt>2.2. <a href="cvs.html#CVSBRANCHES">Branches</a></dt>
80 <dt>2.3. <a href="cvs.html#CVSCOMMIT">CVS Commit
85 <dt>3. <a href="documentation.html">Documentation Guidelines</a></dt>
89 <dt>3.1. <a href="documentation.html#SGML">Quickstart to Docbook
92 <dt>3.2. <a href="documentation.html#DOCSTYLE"><span class=
93 "APPLICATION">Privoxy</span> Documentation Style</a></dt>
95 <dt>3.3. <a href="documentation.html#AEN217">Privoxy Custom
100 <dt>4. <a href="coding.html">Coding Guidelines</a></dt>
104 <dt>4.1. <a href="coding.html#S1">Introduction</a></dt>
106 <dt>4.2. <a href="coding.html#S2">Using Comments</a></dt>
110 <dt>4.2.1. <a href="coding.html#S3">Comment, Comment,
113 <dt>4.2.2. <a href="coding.html#S4">Use blocks for
116 <dt>4.2.3. <a href="coding.html#S5">Keep Comments on their
119 <dt>4.2.4. <a href="coding.html#S6">Comment each logical
122 <dt>4.2.5. <a href="coding.html#S7">Comment All Functions
125 <dt>4.2.6. <a href="coding.html#S8">Comment at the end of
126 braces if the content is more than one screen length</a></dt>
130 <dt>4.3. <a href="coding.html#S9">Naming Conventions</a></dt>
134 <dt>4.3.1. <a href="coding.html#S10">Variable Names</a></dt>
136 <dt>4.3.2. <a href="coding.html#S11">Function Names</a></dt>
138 <dt>4.3.3. <a href="coding.html#S12">Header file
141 <dt>4.3.4. <a href="coding.html#S13">Enumerations, and
144 <dt>4.3.5. <a href="coding.html#S14">Constants</a></dt>
148 <dt>4.4. <a href="coding.html#S15">Using Space</a></dt>
152 <dt>4.4.1. <a href="coding.html#S16">Put braces on a line by
155 <dt>4.4.2. <a href="coding.html#S17">ALL control statements
156 should have a block</a></dt>
158 <dt>4.4.3. <a href="coding.html#S18">Do not belabor/blow-up
159 boolean expressions</a></dt>
161 <dt>4.4.4. <a href="coding.html#S19">Use white space freely
162 because it is free</a></dt>
164 <dt>4.4.5. <a href="coding.html#S20">Don't use white space
165 around structure operators</a></dt>
167 <dt>4.4.6. <a href="coding.html#S21">Make the last brace of a
168 function stand out</a></dt>
170 <dt>4.4.7. <a href="coding.html#S22">Use 3 character
175 <dt>4.5. <a href="coding.html#S23">Initializing</a></dt>
179 <dt>4.5.1. <a href="coding.html#S24">Initialize all
184 <dt>4.6. <a href="coding.html#S25">Functions</a></dt>
188 <dt>4.6.1. <a href="coding.html#S26">Name functions that
189 return a boolean as a question.</a></dt>
191 <dt>4.6.2. <a href="coding.html#S27">Always specify a return
192 type for a function.</a></dt>
194 <dt>4.6.3. <a href="coding.html#S28">Minimize function calls
195 when iterating by using variables</a></dt>
197 <dt>4.6.4. <a href="coding.html#S29">Pass and Return by Const
200 <dt>4.6.5. <a href="coding.html#S30">Pass and Return by
203 <dt>4.6.6. <a href="coding.html#S31">Names of include
206 <dt>4.6.7. <a href="coding.html#S32">Provide multiple
207 inclusion protection</a></dt>
209 <dt>4.6.8. <a href="coding.html#S33">Use `extern "C"` when
212 <dt>4.6.9. <a href="coding.html#S34">Where Possible, Use
213 Forward Struct Declaration Instead of Includes</a></dt>
217 <dt>4.7. <a href="coding.html#S35">General Coding
222 <dt>4.7.1. <a href="coding.html#S36">Turn on
225 <dt>4.7.2. <a href="coding.html#S37">Provide a default case
226 for all switch statements</a></dt>
228 <dt>4.7.3. <a href="coding.html#S38">Try to avoid falling
229 through cases in a switch statement.</a></dt>
231 <dt>4.7.4. <a href="coding.html#S39">Use 'long' or 'short'
232 Instead of 'int'</a></dt>
234 <dt>4.7.5. <a href="coding.html#S40">Don't mix size_t and
237 <dt>4.7.6. <a href="coding.html#S41">Declare each variable
238 and struct on its own line.</a></dt>
240 <dt>4.7.7. <a href="coding.html#S42">Use malloc/zalloc
243 <dt>4.7.8. <a href="coding.html#S43">The Programmer Who Uses
244 'malloc' is Responsible for Ensuring 'free'</a></dt>
246 <dt>4.7.9. <a href="coding.html#S44">Add loaders to the
247 `file_list' structure and in order</a></dt>
249 <dt>4.7.10. <a href="coding.html#S45">"Uncertain" new code
250 and/or changes to existing code, use FIXME or XXX</a></dt>
254 <dt>4.8. <a href="coding.html#S46">Addendum: Template for files
255 and function comment blocks:</a></dt>
259 <dt>5. <a href="testing.html">Testing Guidelines</a></dt>
263 <dt>5.1. <a href="testing.html#TESTING-PLAN">Testplan for
266 <dt>5.2. <a href="testing.html#TESTING-REPORT">Test
271 <dt>6. <a href="newrelease.html">Releasing a New Version</a></dt>
275 <dt>6.1. <a href="newrelease.html#VERSIONNUMBERS">Version
278 <dt>6.2. <a href="newrelease.html#BEFORERELEASE">Before the
279 Release: Freeze</a></dt>
281 <dt>6.3. <a href="newrelease.html#THERELEASE">Building and
282 Releasing the Packages</a></dt>
286 <dt>6.3.1. <a href="newrelease.html#PACK-GUIDELINES">Note on
287 Privoxy Packaging</a></dt>
290 "newrelease.html#NEWRELEASE-TARBALL">Source Tarball</a></dt>
292 <dt>6.3.3. <a href="newrelease.html#NEWRELEASE-RPM">SuSE,
293 Conectiva or Red Hat RPM</a></dt>
296 "newrelease.html#NEWRELEASE-OS2">OS/2</a></dt>
299 "newrelease.html#NEWRELEASE-SOLARIS">Solaris</a></dt>
302 "newrelease.html#NEWRELEASE-WINDOWS">Windows</a></dt>
305 "newrelease.html#NEWRELEASE-DEBIAN">Debian</a></dt>
307 <dt>6.3.8. <a href="newrelease.html#NEWRELEASE-MACOSX">Mac OS
311 "newrelease.html#NEWRELEASE-FREEBSD">FreeBSD</a></dt>
313 <dt>6.3.10. <a href="newrelease.html#NEWRELEASE-HPUX">HP-UX
316 <dt>6.3.11. <a href="newrelease.html#NEWRELEASE-AMIGA">Amiga
320 "newrelease.html#NEWRELEASE-AIX">AIX</a></dt>
324 <dt>6.4. <a href="newrelease.html#RELEASING">Uploading and
325 Releasing Your Package</a></dt>
327 <dt>6.5. <a href="newrelease.html#AFTERRELEASE">After the
332 <dt>7. <a href="webserver-update.html">Update the Webserver</a></dt>
334 <dt>8. <a href="contact.html">Contacting the developers, Bug
335 Reporting and Feature Requests</a></dt>
339 <dt>8.1. <a href="contact.html#CONTACT-SUPPORT">Get
342 <dt>8.2. <a href="contact.html#REPORTING">Reporting
347 <dt>8.2.1. <a href="contact.html#CONTACT-ADS">Reporting Ads
348 or Other Configuration Problems</a></dt>
350 <dt>8.2.2. <a href="contact.html#CONTACT-BUGS">Reporting
355 <dt>8.3. <a href="contact.html#CONTACT-FEATURE">Request New
358 <dt>8.4. <a href="contact.html#MAILING-LISTS">Mailing
363 <dt>9. <a href="copyright.html">Privoxy Copyright, License and
368 <dt>9.1. <a href="copyright.html#AEN1248">License</a></dt>
370 <dt>9.2. <a href="copyright.html#AEN1264">History</a></dt>
374 <dt>10. <a href="seealso.html">See also</a></dt>
379 <div class="NAVFOOTER">
380 <hr class="c2" width="100%">
382 <table summary="Footer navigation table" width="100%" border="0"
383 cellpadding="0" cellspacing="0">
385 <td width="33%" align="left" valign="top"> </td>
387 <td width="34%" align="center" valign="top"> </td>
389 <td width="33%" align="right" valign="top"><a href=
390 "introduction.html" accesskey="N">Next</a></td>
394 <td width="33%" align="left" valign="top"> </td>
396 <td width="34%" align="center" valign="top"> </td>
398 <td width="33%" align="right" valign="top">Introduction</td>