1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
2 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
6 Privoxy Developer Manual
8 <meta name="GENERATOR" content=
9 "Modular DocBook HTML Stylesheet Version 1.79">
10 <link rel="NEXT" title="Introduction" href="introduction.html">
11 <link rel="STYLESHEET" type="text/css" href="../p_doc.css">
12 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
14 <body class="ARTICLE" bgcolor="#EEEEEE" text="#000000" link="#0000FF"
15 vlink="#840084" alink="#0000FF">
17 <div class="TITLEPAGE">
19 <a name="AEN2">Privoxy Developer Manual</a>
22 <sub><a href="https://www.privoxy.org/user-manual/copyright.html"
23 target="_top">Copyright</a> © 2001-2016 by <a href=
24 "https://www.privoxy.org/" target="_top">Privoxy
25 Developers</a></sub><br>
28 $Id: developer-manual.sgml,v 2.71 2016/05/27 15:24:13 fabiankeil
32 <div class="ABSTRACT">
35 The developer manual provides guidance on coding, testing,
36 packaging, documentation and other issues of importance to
37 those involved with <span class="APPLICATION">Privoxy</span>
38 development. It is mandatory (and helpful!) reading for anyone
39 who wants to join the team. Note that it's currently out of
40 date and may not be entirely correct. As always, patches are
44 Please note that this document is constantly evolving. This
45 copy represents the state at the release of version 3.0.25. You
46 can find the latest version of the this manual at <a href=
47 "https://www.privoxy.org/developer-manual/" target=
48 "_top">https://www.privoxy.org/developer-manual/</a>. Please
49 have a look at the <a href=
50 "https://www.privoxy.org/user-manual/contact.html" target=
51 "_top">contact section in the user manual</a> if you are
52 interested in contacting the developers.
61 <b>Table of Contents</b>
64 1. <a href="introduction.html">Introduction</a>
69 1.1. <a href="introduction.html#QUICKSTART">Quickstart to
70 Privoxy Development</a>
75 2. <a href="cvs.html">The CVS Repository</a>
80 2.1. <a href="cvs.html#CVSACCESS">Access to CVS</a>
83 2.2. <a href="cvs.html#CVSBRANCHES">Branches</a>
86 2.3. <a href="cvs.html#CVSCOMMIT">CVS Commit Guidelines</a>
91 3. <a href="documentation.html">Documentation Guidelines</a>
96 3.1. <a href="documentation.html#SGML">Quickstart to Docbook
100 3.2. <a href="documentation.html#DOCSTYLE"><span class=
101 "APPLICATION">Privoxy</span> Documentation Style</a>
104 3.3. <a href="documentation.html#AEN207">Privoxy Custom
110 4. <a href="coding.html">Coding Guidelines</a>
115 4.1. <a href="coding.html#S1">Introduction</a>
118 4.2. <a href="coding.html#S2">Using Comments</a>
123 4.2.1. <a href="coding.html#S3">Comment, Comment,
127 4.2.2. <a href="coding.html#S4">Use blocks for
131 4.2.3. <a href="coding.html#S5">Keep Comments on their
135 4.2.4. <a href="coding.html#S6">Comment each logical
139 4.2.5. <a href="coding.html#S7">Comment All Functions
143 4.2.6. <a href="coding.html#S8">Comment at the end of
144 braces if the content is more than one screen length</a>
149 4.3. <a href="coding.html#S9">Naming Conventions</a>
154 4.3.1. <a href="coding.html#S10">Variable Names</a>
157 4.3.2. <a href="coding.html#S11">Function Names</a>
160 4.3.3. <a href="coding.html#S12">Header file
164 4.3.4. <a href="coding.html#S13">Enumerations, and
168 4.3.5. <a href="coding.html#S14">Constants</a>
173 4.4. <a href="coding.html#S15">Using Space</a>
178 4.4.1. <a href="coding.html#S16">Put braces on a line by
182 4.4.2. <a href="coding.html#S17">ALL control statements
183 should have a block</a>
186 4.4.3. <a href="coding.html#S18">Do not belabor/blow-up
187 boolean expressions</a>
190 4.4.4. <a href="coding.html#S19">Use white space freely
191 because it is free</a>
194 4.4.5. <a href="coding.html#S20">Don't use white space
195 around structure operators</a>
198 4.4.6. <a href="coding.html#S21">Make the last brace of a
199 function stand out</a>
202 4.4.7. <a href="coding.html#S22">Use 3 character
208 4.5. <a href="coding.html#S23">Initializing</a>
213 4.5.1. <a href="coding.html#S24">Initialize all
219 4.6. <a href="coding.html#S25">Functions</a>
224 4.6.1. <a href="coding.html#S26">Name functions that
225 return a boolean as a question.</a>
228 4.6.2. <a href="coding.html#S27">Always specify a return
229 type for a function.</a>
232 4.6.3. <a href="coding.html#S28">Minimize function calls
233 when iterating by using variables</a>
236 4.6.4. <a href="coding.html#S29">Pass and Return by Const
240 4.6.5. <a href="coding.html#S30">Pass and Return by
244 4.6.6. <a href="coding.html#S31">Names of include
248 4.6.7. <a href="coding.html#S32">Provide multiple
249 inclusion protection</a>
252 4.6.8. <a href="coding.html#S33">Use `extern "C"` when
256 4.6.9. <a href="coding.html#S34">Where Possible, Use
257 Forward Struct Declaration Instead of Includes</a>
262 4.7. <a href="coding.html#S35">General Coding Practices</a>
267 4.7.1. <a href="coding.html#S36">Turn on warnings</a>
270 4.7.2. <a href="coding.html#S37">Provide a default case
271 for all switch statements</a>
274 4.7.3. <a href="coding.html#S38">Try to avoid falling
275 through cases in a switch statement.</a>
278 4.7.4. <a href="coding.html#S40">Don't mix size_t and
282 4.7.5. <a href="coding.html#S41">Declare each variable
283 and struct on its own line.</a>
286 4.7.6. <a href="coding.html#S42">Use malloc/zalloc
290 4.7.7. <a href="coding.html#S43">The Programmer Who Uses
291 'malloc' is Responsible for Ensuring 'free'</a>
294 4.7.8. <a href="coding.html#S44">Add loaders to the
295 `file_list' structure and in order</a>
298 4.7.9. <a href="coding.html#S45">"Uncertain" new code
299 and/or changes to existing code, use XXX</a>
304 4.8. <a href="coding.html#S46">Addendum: Template for files
305 and function comment blocks:</a>
310 5. <a href="testing.html">Testing Guidelines</a>
315 5.1. <a href="testing.html#TESTING-PLAN">Testplan for
321 6. <a href="newrelease.html">Releasing a New Version</a>
326 6.1. <a href="newrelease.html#VERSIONNUMBERS">Version
330 6.2. <a href="newrelease.html#BEFORERELEASE">Before the
334 6.3. <a href="newrelease.html#THERELEASE">Building and
335 Releasing the Packages</a>
340 6.3.1. <a href="newrelease.html#PACK-GUIDELINES">Note on
341 Privoxy Packaging</a>
345 "newrelease.html#NEWRELEASE-TARBALL">Source Tarball</a>
348 6.3.3. <a href="newrelease.html#NEWRELEASE-RPM">SuSE,
349 Conectiva or Red Hat RPM</a>
352 6.3.4. <a href="newrelease.html#NEWRELEASE-OS2">OS/2</a>
356 "newrelease.html#NEWRELEASE-SOLARIS">Solaris</a>
360 "newrelease.html#NEWRELEASE-WINDOWS">Windows</a>
364 "newrelease.html#NEWRELEASE-DEBIAN">Debian</a>
367 6.3.8. <a href="newrelease.html#NEWRELEASE-MACOSX">Mac OS
372 "newrelease.html#NEWRELEASE-FREEBSD">FreeBSD</a>
377 6.4. <a href="newrelease.html#RELEASING">Uploading and
378 Releasing Your Package</a>
381 6.5. <a href="newrelease.html#AFTERRELEASE">After the
387 7. <a href="webserver-update.html">Update the Webserver</a>
392 <div class="NAVFOOTER">
393 <hr align="LEFT" width="100%">
394 <table summary="Footer navigation table" width="100%" border="0"
395 cellpadding="0" cellspacing="0">
397 <td width="33%" align="left" valign="top">
400 <td width="34%" align="center" valign="top">
403 <td width="33%" align="right" valign="top">
404 <a href="introduction.html" accesskey="N">Next</a>
408 <td width="33%" align="left" valign="top">
411 <td width="34%" align="center" valign="top">
414 <td width="33%" align="right" valign="top">