9c8c8c6ee34aa8b5bddce77a67bda8dfbc79bd81
[privoxy.git] / doc / webserver / developer-manual / index.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
3 <html>
4 <head>
5   <title>Privoxy Developer Manual</title>
6   <meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.79">
7   <link rel="NEXT" title="Introduction" href="introduction.html">
8   <link rel="STYLESHEET" type="text/css" href="../p_doc.css">
9   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
10 </head>
11 <body class="ARTICLE" bgcolor="#EEEEEE" text="#000000" link="#0000FF" vlink="#840084" alink="#0000FF">
12   <div class="ARTICLE">
13     <div class="TITLEPAGE">
14       <h1 class="TITLE"><a name="AEN2" id="AEN2">Privoxy Developer Manual</a></h1>
15       <p class="PUBDATE"><sub><a href="https://www.privoxy.org/user-manual/copyright.html" target="_top">Copyright</a>
16       &copy; 2001-2018 by <a href="https://www.privoxy.org/" target="_top">Privoxy Developers</a></sub><br></p>
17       <div>
18         <div class="ABSTRACT">
19           <a name="AEN8" id="AEN8"></a>
20           <p>The developer manual provides guidance on coding, testing, packaging, documentation and other issues of
21           importance to those involved with <span class="APPLICATION">Privoxy</span> development. It is mandatory (and
22           helpful!) reading for anyone who wants to join the team. Note that it's currently out of date and may not be
23           entirely correct. As always, patches are welcome.</p>
24           <p>Please note that this document is constantly evolving. This copy represents the state at the release of
25           version 3.0.27. You can find the latest version of the this manual at <a href=
26           "https://www.privoxy.org/developer-manual/" target="_top">https://www.privoxy.org/developer-manual/</a>.
27           Please have a look at the <a href="https://www.privoxy.org/user-manual/contact.html" target="_top">contact
28           section in the user manual</a> if you are interested in contacting the developers.</p>
29         </div>
30       </div>
31       <hr>
32     </div>
33     <div class="TOC">
34       <dl>
35         <dt><b>Table of Contents</b></dt>
36         <dt>1. <a href="introduction.html">Introduction</a></dt>
37         <dd>
38           <dl>
39             <dt>1.1. <a href="introduction.html#QUICKSTART">Quickstart to Privoxy Development</a></dt>
40           </dl>
41         </dd>
42         <dt>2. <a href="git.html">The Git Repository</a></dt>
43         <dd>
44           <dl>
45             <dt>2.1. <a href="git.html#GITACCESS">Access to Git</a></dt>
46             <dt>2.2. <a href="git.html#GITBRANCHES">Branches</a></dt>
47             <dt>2.3. <a href="git.html#GITCOMMIT">Git Commit Guidelines</a></dt>
48           </dl>
49         </dd>
50         <dt>3. <a href="documentation.html">Documentation Guidelines</a></dt>
51         <dd>
52           <dl>
53             <dt>3.1. <a href="documentation.html#SGML">Quickstart to Docbook and SGML</a></dt>
54             <dt>3.2. <a href="documentation.html#DOCSTYLE"><span class="APPLICATION">Privoxy</span> Documentation
55             Style</a></dt>
56             <dt>3.3. <a href="documentation.html#AEN203">Privoxy Custom Entities</a></dt>
57           </dl>
58         </dd>
59         <dt>4. <a href="coding.html">Coding Guidelines</a></dt>
60         <dd>
61           <dl>
62             <dt>4.1. <a href="coding.html#S1">Introduction</a></dt>
63             <dt>4.2. <a href="coding.html#S2">Using Comments</a></dt>
64             <dd>
65               <dl>
66                 <dt>4.2.1. <a href="coding.html#S3">Comment, Comment, Comment</a></dt>
67                 <dt>4.2.2. <a href="coding.html#S4">Use blocks for comments</a></dt>
68                 <dt>4.2.3. <a href="coding.html#S5">Keep Comments on their own line</a></dt>
69                 <dt>4.2.4. <a href="coding.html#S6">Comment each logical step</a></dt>
70                 <dt>4.2.5. <a href="coding.html#S7">Comment All Functions Thoroughly</a></dt>
71                 <dt>4.2.6. <a href="coding.html#S8">Comment at the end of braces if the content is more than one screen
72                 length</a></dt>
73               </dl>
74             </dd>
75             <dt>4.3. <a href="coding.html#S9">Naming Conventions</a></dt>
76             <dd>
77               <dl>
78                 <dt>4.3.1. <a href="coding.html#S10">Variable Names</a></dt>
79                 <dt>4.3.2. <a href="coding.html#S11">Function Names</a></dt>
80                 <dt>4.3.3. <a href="coding.html#S12">Header file prototypes</a></dt>
81                 <dt>4.3.4. <a href="coding.html#S13">Enumerations, and #defines</a></dt>
82                 <dt>4.3.5. <a href="coding.html#S14">Constants</a></dt>
83               </dl>
84             </dd>
85             <dt>4.4. <a href="coding.html#S15">Using Space</a></dt>
86             <dd>
87               <dl>
88                 <dt>4.4.1. <a href="coding.html#S16">Put braces on a line by themselves.</a></dt>
89                 <dt>4.4.2. <a href="coding.html#S17">ALL control statements should have a block</a></dt>
90                 <dt>4.4.3. <a href="coding.html#S18">Do not belabor/blow-up boolean expressions</a></dt>
91                 <dt>4.4.4. <a href="coding.html#S19">Use white space freely because it is free</a></dt>
92                 <dt>4.4.5. <a href="coding.html#S20">Don't use white space around structure operators</a></dt>
93                 <dt>4.4.6. <a href="coding.html#S21">Make the last brace of a function stand out</a></dt>
94                 <dt>4.4.7. <a href="coding.html#S22">Use 3 character indentions</a></dt>
95               </dl>
96             </dd>
97             <dt>4.5. <a href="coding.html#S23">Initializing</a></dt>
98             <dd>
99               <dl>
100                 <dt>4.5.1. <a href="coding.html#S24">Initialize all variables</a></dt>
101               </dl>
102             </dd>
103             <dt>4.6. <a href="coding.html#S25">Functions</a></dt>
104             <dd>
105               <dl>
106                 <dt>4.6.1. <a href="coding.html#S26">Name functions that return a boolean as a question.</a></dt>
107                 <dt>4.6.2. <a href="coding.html#S27">Always specify a return type for a function.</a></dt>
108                 <dt>4.6.3. <a href="coding.html#S28">Minimize function calls when iterating by using variables</a></dt>
109                 <dt>4.6.4. <a href="coding.html#S29">Pass and Return by Const Reference</a></dt>
110                 <dt>4.6.5. <a href="coding.html#S30">Pass and Return by Value</a></dt>
111                 <dt>4.6.6. <a href="coding.html#S31">Names of include files</a></dt>
112                 <dt>4.6.7. <a href="coding.html#S32">Provide multiple inclusion protection</a></dt>
113                 <dt>4.6.8. <a href="coding.html#S33">Use `extern "C"` when appropriate</a></dt>
114                 <dt>4.6.9. <a href="coding.html#S34">Where Possible, Use Forward Struct Declaration Instead of
115                 Includes</a></dt>
116               </dl>
117             </dd>
118             <dt>4.7. <a href="coding.html#S35">General Coding Practices</a></dt>
119             <dd>
120               <dl>
121                 <dt>4.7.1. <a href="coding.html#S36">Turn on warnings</a></dt>
122                 <dt>4.7.2. <a href="coding.html#S37">Provide a default case for all switch statements</a></dt>
123                 <dt>4.7.3. <a href="coding.html#S38">Try to avoid falling through cases in a switch statement.</a></dt>
124                 <dt>4.7.4. <a href="coding.html#S40">Don't mix size_t and other types</a></dt>
125                 <dt>4.7.5. <a href="coding.html#S41">Declare each variable and struct on its own line.</a></dt>
126                 <dt>4.7.6. <a href="coding.html#S42">Use malloc/zalloc sparingly</a></dt>
127                 <dt>4.7.7. <a href="coding.html#S43">The Programmer Who Uses 'malloc' is Responsible for Ensuring
128                 'free'</a></dt>
129                 <dt>4.7.8. <a href="coding.html#S44">Add loaders to the `file_list' structure and in order</a></dt>
130                 <dt>4.7.9. <a href="coding.html#S45">"Uncertain" new code and/or changes to existing code, use
131                 XXX</a></dt>
132               </dl>
133             </dd>
134             <dt>4.8. <a href="coding.html#S46">Addendum: Template for files and function comment blocks:</a></dt>
135           </dl>
136         </dd>
137         <dt>5. <a href="testing.html">Testing Guidelines</a></dt>
138         <dd>
139           <dl>
140             <dt>5.1. <a href="testing.html#TESTING-PLAN">Testplan for releases</a></dt>
141             <dt>5.2. <a href="testing.html#FUZZING">Fuzzing Privoxy</a></dt>
142           </dl>
143         </dd>
144         <dt>6. <a href="newrelease.html">Releasing a New Version</a></dt>
145         <dd>
146           <dl>
147             <dt>6.1. <a href="newrelease.html#VERSIONNUMBERS">Version numbers</a></dt>
148             <dt>6.2. <a href="newrelease.html#BEFORERELEASE">Before the Release</a></dt>
149             <dt>6.3. <a href="newrelease.html#THERELEASE">Building and Releasing the Packages</a></dt>
150             <dd>
151               <dl>
152                 <dt>6.3.1. <a href="newrelease.html#PACK-GUIDELINES">Note on Privoxy Packaging</a></dt>
153                 <dt>6.3.2. <a href="newrelease.html#NEWRELEASE-TARBALL">Source Tarball</a></dt>
154                 <dt>6.3.3. <a href="newrelease.html#NEWRELEASE-RPM">SuSE, Conectiva or Red Hat RPM</a></dt>
155                 <dt>6.3.4. <a href="newrelease.html#NEWRELEASE-OS2">OS/2</a></dt>
156                 <dt>6.3.5. <a href="newrelease.html#NEWRELEASE-SOLARIS">Solaris</a></dt>
157                 <dt>6.3.6. <a href="newrelease.html#NEWRELEASE-WINDOWS">Windows</a></dt>
158                 <dt>6.3.7. <a href="newrelease.html#NEWRELEASE-DEBIAN">Debian</a></dt>
159                 <dt>6.3.8. <a href="newrelease.html#NEWRELEASE-MACOSX">Mac OS X</a></dt>
160                 <dt>6.3.9. <a href="newrelease.html#NEWRELEASE-FREEBSD">FreeBSD</a></dt>
161               </dl>
162             </dd>
163             <dt>6.4. <a href="newrelease.html#RELEASING">Uploading and Releasing Your Package</a></dt>
164             <dt>6.5. <a href="newrelease.html#AFTERRELEASE">After the Release</a></dt>
165           </dl>
166         </dd>
167         <dt>7. <a href="webserver-update.html">Update the Webserver</a></dt>
168       </dl>
169     </div>
170   </div>
171   <div class="NAVFOOTER">
172     <hr align="left" width="100%">
173     <table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
174       <tr>
175         <td width="33%" align="left" valign="top">&nbsp;</td>
176         <td width="34%" align="center" valign="top">&nbsp;</td>
177         <td width="33%" align="right" valign="top"><a href="introduction.html" accesskey="N">Next</a></td>
178       </tr>
179       <tr>
180         <td width="33%" align="left" valign="top">&nbsp;</td>
181         <td width="34%" align="center" valign="top">&nbsp;</td>
182         <td width="33%" align="right" valign="top">Introduction</td>
183       </tr>
184     </table>
185   </div>
186 </body>
187 </html>