Added debian-dist and debian-upload targets. Also documented usage.
[privoxy.git] / doc / source / developer-manual.sgml
1 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN"[
2 <!entity % dummy "IGNORE"> 
3 <!entity supported SYSTEM "supported.sgml">
4 <!entity newfeatures SYSTEM "newfeatures.sgml">
5 <!entity p-intro SYSTEM "privoxy.sgml">
6 <!entity history SYSTEM "history.sgml">
7 <!entity seealso SYSTEM "seealso.sgml">
8 <!entity contacting SYSTEM "contacting.sgml">
9 <!entity copyright SYSTEM "copyright.sgml">
10 <!entity license SYSTEM "license.sgml">
11 <!entity p-version "3.1.1">
12 <!entity p-status "alpha">
13 <!entity % p-not-stable "INCLUDE">
14 <!entity % p-stable "IGNORE">
15 <!entity % p-text "IGNORE">        <!-- define we are not a text only doc -->
16 <!entity % p-doc "INCLUDE">        <!-- and we are a formal doc           -->
17 <!entity  my-copy "&copy;">        <!-- kludge for docbook2man            -->
18 ]>
19 <!--
20  File        :  $Source: /cvsroot/ijbswa/current/doc/source/developer-manual.sgml,v $
21
22  Purpose     :  developer manual
23                 This file belongs into
24                 ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/
25                 
26  $Id: developer-manual.sgml,v 1.46 2002/05/22 17:15:00 oes Exp $
27
28  Copyright (C) 2001, 2002 Privoxy Developers <developers@privoxy.org>
29  See LICENSE.
30
31  ========================================================================
32  NOTE: Please read developer-manual/documentation.html before touching 
33  anything in this, or other Privoxy documentation. You have been warned!
34  Failure to abide by this rule will result in the revocation of your license 
35  to live a peaceful existence!
36  ========================================================================
37
38 -->
39
40 <article id="index">
41   <artheader>
42     <title>Privoxy Developer Manual</title>
43     <pubdate>
44      <subscript>
45     <!-- Completely the wrong markup, but very little is allowed  -->
46     <!-- in this part of an article. FIXME -->
47       <link linkend="copyright">Copyright</link> &my-copy; 2001, 2002 by 
48       <ulink url="http://www.privoxy.org">Privoxy Developers</ulink>
49      </subscript>
50     </pubdate>
51
52
53     <pubdate>$Id: developer-manual.sgml,v 1.46 2002/05/22 17:15:00 oes Exp $</pubdate>
54
55 <!--
56
57 Note: this should generate a separate page, and a live link to it. 
58 But it doesn't for some mysterious reason. Please leave commented
59 unless it can be fixed proper. For the time being, the copyright 
60 statement will be in copyright.smgl.
61
62 Hal.
63
64 <legalnotice id="legalnotice"> 
65  <para>
66   text goes here ........
67  </para>
68 </legalnotice>
69
70 -->
71
72     <abstract>
73
74 <![%dummy;[
75  <para>
76  <comment>
77   This is here to keep vim syntax file from breaking :/
78   If I knew enough to fix it, I would.
79   PLEASE DO NOT REMOVE! HB: hal@foobox.net
80  </comment>
81  </para>
82  ]]>
83 <para>
84  The developer manual provides guidance on coding, testing, packaging, documentation
85  and other issues of importance to those involved with
86  <application>Privoxy</application> development. It is mandatory (and helpful!) reading
87  for anyone who wants to join the team.
88 </para>
89
90 <!-- Include privoxy.sgml boilerplate text: -->
91
92 <!--  &p-intro; Someone interested enough in the project to contribute
93                 will already know at this point what Privoxy is. -->
94
95 <!-- end boilerplate -->
96
97 <para>
98  You can find the latest version of the this manual at <ulink
99  url="http://www.privoxy.org/developer-manual/">http://www.privoxy.org/developer-manual/</ulink>.
100  Please see <link linkend="contact">the Contact section</link> 
101  on how to contact the developers.
102 </para>
103 <!--        <para> -->
104 <!--    Feel free to send a note to the developers at <email>ijbswa-developers@lists.sourceforge.net</email>. -->
105 <!--   </para> -->
106
107     </abstract>
108   </artheader>
109
110
111 <!--   ~~~~~       New section      ~~~~~     -->
112   <sect1 id="introduction"><title>Introduction</title>
113 <!--
114
115  I don't like seeing blank space :) So added *something* here.
116
117  --> 
118     <para>
119      <application>Privoxy</application>, as an heir to
120      <application>Junkbuster</application>, is an Open Source project 
121      and licensed under the GPL. As such, <application>Privoxy</application>
122      development is potentially open to anyone who has the time, knowledge,
123      and desire to contribute in any capacity. Our goals are simply to
124      continue the mission, to improve <application>Privoxy</application>, and
125      to make it available to as wide an audience as possible. 
126     </para>
127     <para>
128      One does not have to be a programmer to contribute. Packaging, testing,
129      and porting, are all important jobs as well.
130     </para>
131
132   <!--   ~~~~~       New section      ~~~~~     -->
133   <sect2 id="quickstart"><title>Quickstart to Privoxy Development</title>
134     <para>
135       You'll need an account on <ulink
136       url="http://sourceforge.net/">Sourceforge</ulink> to support our
137       development.  Mail your ID to <ulink
138       url="mailto:developers@privoxy.org">the list</ulink> and wait until a
139       project manager has added you.
140     </para>
141     <para>
142       For the time being (read, this section is under construction), please
143       refer to the extensive comments in the source code.
144     </para>
145    </sect2>
146   </sect1>
147
148   <!--   ~~~~~       New section      ~~~~~     -->
149   <sect1 id="cvs"><title>The CVS Repository</title>
150     <para>
151       If you intend to help us with programming, documentation or packaging
152       you will need write access to our holy grail, the CVS repository.
153       Please read this chapter completely before accessing via CVS.
154     </para>
155
156     <sect2 id="cvsaccess"><title>Access to CVS</title>
157       <para>
158         The project's CVS repository is hosted on
159         <ulink url="http://sourceforge.net/">SourceForge.</ulink>
160         Please refer to the chapters 6 and 7 in
161         <ulink url="http://sourceforge.net/docman/?group_id=1">SF's site
162         documentation</ulink> for the technical access details for your
163         operating system. For historical reasons, the CVS server is
164         called <literal>cvs.ijbswa.sourceforge.net</literal>, the repository is
165         called <literal>ijbswa</literal>, and the source tree module is called
166         <literal>current</literal>.
167       </para>
168     </sect2>
169
170     <sect2 id="cvscommit"><title>CVS Commit Guideline</title>
171       <para>
172         The source tree is the heart of every software project. Every effort must
173         be made to ensure that it is readable, compilable and consistent at all
174         times. We therefore ask anyone with CVS access to strictly adhere to the
175         following guidelines:
176         <itemizedlist>
177           <listitem><para>
178             Never (read: <emphasis>never, ever</emphasis>) be tempted to commit
179             that small change without testing it thoroughly first. When we're
180             close to a public release, ask a fellow developer to review your 
181             changes.
182           </para></listitem>
183           <listitem><para>
184             Your commit message should give a concise overview of <emphasis>what you
185             changed</emphasis> (no big details) and <emphasis>why you changed it</emphasis>
186             Just check previous messages for good examples.
187           </para></listitem>
188           <listitem><para>
189             Don't use the same message on multiple files, unless it equally applies to
190             all those files.
191           </para></listitem>
192           <listitem><para>
193             If your changes span multiple files, and the code won't recompile unless
194             all changes are commited (e.g. when changing the signature of a function),
195             then commit all files one after another, without long delays in beween.
196             If necessary, prepare the commit messages in advance.
197           </para></listitem>
198           <listitem><para>
199             Before changing things on CVS, make sure that your changes are in line
200             with the team's general consensus on what should be done (see below).
201           </para></listitem>
202         </itemizedlist>
203       </para>
204     </sect2>
205
206     <sect2 id="cvswhenask"><title>Discussing Changes First</title>
207       <para>
208         We don't have a too formal policy on this, just use common sense. Hints: If it is..
209         <orderedlist numeration="arabic">
210           <listitem><para>
211             ..a bugfix / clean-up / cosmetic thing: shoot
212           </para></listitem>
213           <listitem><para>
214             ..a new feature that can be turned off: shoot
215           </para></listitem>
216           <listitem><para>
217             ..a clear improvement w/o side effects on other parts of the code: shoot
218           </para></listitem>
219           <listitem><para>
220             ..a matter of taste: <ulink url="mailto:developers@privoxy.org">ask the list</ulink>
221           </para></listitem>
222           <listitem><para>
223             ..a major redesign of some part of the code: <ulink url="mailto:developers@privoxy.org">ask
224             the list</ulink>
225           </para></listitem>
226         </orderedlist>
227       </para>
228       <para>
229         Note that near a major public release, we get a bit more cautious - if
230         unsure, it doesn't hurt to ask first. There is always the possibility
231         to submit a patch to the <ulink
232         url="http://sourceforge.net/tracker/?atid=311118&amp;group_id=11118&amp;func=browse">patches
233         tracker</ulink> instead.
234       </para>
235     </sect2>
236   </sect1>
237         
238   <!--   ~~~~~       New section      ~~~~~     -->
239 <sect1 id="documentation"><title>Documentation Guidelines</title>
240   <para>
241     All formal documents are maintained in Docbook SGML and located in the
242     <computeroutput>doc/source/*</computeroutput> directory. You will need
243     <ulink url="http://www.docbook.org">Docbook</ulink>, the Docbook 
244     DTD's and the Docbook modular stylesheets (or comparable alternatives),
245     and either <application>jade</application> or
246     <application>openjade</application> (recommended) installed in order to
247     build docs from source. Currently there is <ulink
248     url="../user-manual/index.html"><citetitle>user-manual</citetitle></ulink>,
249     <ulink url="../faq/index.html"><citetitle>FAQ</citetitle></ulink>, and, of
250     course this, the <citetitle>developer-manual</citetitle> in this format.
251     The <citetitle>README</citetitle>, <citetitle>AUTHORS</citetitle>
252     <citetitle>privoxy.1</citetitle> (man page) files are also now maintained
253     as Docbook SGML. The finished files are all in the top-level source
254     directory are generated files! Also, <filename>index.html</filename>, the
255     <application>Privoxy</application> home page, is maintained as SGML.
256     <emphasis>DO NOT edit these directly</emphasis>. Edit the SGML source, or
257     contact someone involved in the documentation (at present Stefan and
258     Hal).
259     </para> 
260     <para>
261      Other, less formal documents (e.g. <filename>LICENSE</filename>,
262      <filename>INSTALL</filename>) are maintained as plain text files in the
263      top-level source directory. At least for the time being.
264     </para>
265     <para>
266      Packagers are encouraged to include this documentation. For those without
267      the ability to build the docs locally, text versions of each are kept in
268      CVS. HTML versions are also now being kept in CVS under 
269      <filename>doc/webserver/*</filename>.
270     </para>
271     <para>
272      Formal documents are built with the Makefile targets of
273      <computeroutput>make dok</computeroutput>, or alternately
274      <computeroutput>make redhat-dok</computeroutput>. If you have problems,
275      try both. The build process uses the document SGML sources in
276      <computeroutput>doc/source/*/*</computeroutput> to update all text files in
277      <computeroutput>doc/text/</computeroutput> and to update all HTML
278      documents in <computeroutput>doc/webserver/</computeroutput>.
279     </para>
280     <para>
281      Documentation writers should please make sure documents build
282      successfully before committing to CVS, if possible.
283     </para>
284     <para>
285      How do you update the webserver (i.e. the pages on privoxy.org)?
286      
287      <orderedlist numeration="arabic">
288       <listitem><para>
289         First, build the docs by running <computeroutput>make
290         dok</computeroutput> (or alternately <computeroutput>make
291         redhat-dok</computeroutput>).                 
292       </para></listitem>
293       <listitem><para>
294         Run <computeroutput>make webserver</computeroutput> which copies all
295         files from <computeroutput>doc/webserver</computeroutput> to the
296         sourceforge webserver via scp.
297       </para></listitem>
298      </orderedlist>
299   </para>
300
301   <para>
302    Finished docs should be occasionally submitted to CVS
303    (<filename>doc/webserver/*/*.html</filename>) so that those without 
304    the ability to build them locally, have access to them if needed.
305    This is especially important just prior to a new release! Please
306    do this <emphasis>after</emphasis> the <literal>$VERSION</literal> and
307    other release specific data in <filename>configure.in</filename> has been
308    updated (this is done just prior to a new release).
309   </para>
310
311 <!--   ~~~~~       New section      ~~~~~     -->
312 <sect2 id="sgml">
313 <title>Quickstart to Docbook and SGML</title>
314 <para>
315  If you are not familiar with SGML, it is a markup language similar to HTML. 
316  Actually, not a mark up language per se, but a language used to define 
317  markup languages. In fact, HTML is an SGML application. Both will use
318  <quote>tags</quote> to format text and other content. SGML tags can be much
319  more varied, and flexible, but do much of the same kinds of things. The tags,
320  or <quote>elements</quote>, are definable in SGML. There is no set
321  <quote>standards</quote>. Since we are using
322  <application>Docbook</application>, our tags are those that are defined by 
323  <application>Docbook</application>. Much of how the finish document is
324  rendered is determined by the <quote>stylesheets</quote>.
325  The stylesheets determine how each tag gets translated to HTML, or other
326  formats.
327 </para>
328
329 <para>
330  Tags in Docbook SGML need to be always <quote>closed</quote>. If not, you
331  will likely generate errors. Example: <literal>&lt;title&gt;My
332  Title&lt;/title&gt;</literal>. They are also case-insensitive, but we
333  strongly suggest using all lower case. This keeps compatibility with
334  [Docbook] <application>XML</application>.
335 </para>
336
337 <para>
338  Our documents use <quote>sections</quote> for the most part. Sections
339  will be processed into HTML headers (e.g. <literal>h1</literal> for 
340  <literal>sect1</literal>). The <application>Docbook</application> stylesheets
341  will use these to also generate the Table of Contents for each doc. Our 
342  TOC's are set to a depth of three. Meaning <literal>sect1</literal>, 
343  <literal>sect2</literal>, and <literal>sect3</literal> will have TOC 
344  entries, but <literal>sect4</literal> will not. Each section requires 
345  a <literal>&lt;title&gt;</literal> element, and at least one 
346  <literal>&lt;para&gt;</literal>. There is a limit of five section 
347  levels in Docbook, but generally three should be sufficient for our 
348  purposes.
349 </para>
350
351 <para>
352  Some common elements that you likely will use: 
353 </para>
354
355 <para>
356   <simplelist>
357     <member>
358       <emphasis>&lt;para&gt;&lt;/para&gt;</emphasis>, paragraph delimiter. Most 
359       text needs to be within paragraph elements (there are some exceptions).
360     </member>
361     <member>
362       <emphasis>&lt;emphasis&gt;&lt;/emphasis&gt;</emphasis>, the stylesheets
363       make this italics.
364     </member>
365     <member>
366       <emphasis>&lt;filename&gt;&lt;/filename&gt;</emphasis>, files and directories.
367     </member>
368     <member>
369       <emphasis>&lt;command&gt;&lt;/command&gt;</emphasis>, command examples.
370     </member>
371     <member>
372       <emphasis>&lt;literallayout&gt;&lt;/literallayout&gt;</emphasis>, like 
373       <literal>&lt;pre&gt;</literal>, more or less.
374     </member>
375     <member>
376       <emphasis>&lt;itemizedlist&gt;&lt;/itemizedlist&gt;</emphasis>, list with bullets.
377     </member>
378     <member>
379       <emphasis>&lt;listitem&gt;&lt;/listitem&gt;</emphasis>, member of the above.
380     </member>
381     <member>
382       <emphasis>&lt;screen&gt;&lt;/screen&gt;</emphasis>, screen output, implies 
383       <literal>&lt;literallayout&gt;</literal>.
384     </member>
385     <member>
386       <emphasis>&lt;ulink url="example.com"&gt;&lt;/ulink&gt;</emphasis>, like 
387       HTML <literal>&lt;a&gt;</literal> tag.
388     </member>
389     <member>
390       <emphasis>&lt;quote&gt;&lt;/quote&gt;</emphasis>, for, doh, quoting text. 
391     </member>
392   </simplelist>
393 </para>
394
395 <para>
396  Look at any of the existing docs for examples of all these and more.
397 </para>
398
399 <para>
400  You might also find <quote><ulink
401  url="http://www.bureau-cornavin.com/opensource/crash-course/">Writing Documentation
402  Using DocBook - A Crash Course</ulink></quote> useful.
403 </para>
404 </sect2>
405
406 <!--   ~~~~~       New section      ~~~~~     -->
407   <sect2 id="docstyle">
408   <title><application>Privoxy</application> Documentation Style</title>
409    <para>
410     It will be easier if everyone follows a similar writing style. This 
411     just makes it easier to read what someone else has written if it 
412     is all done in a similar fashion.
413    </para>
414    <para>
415     Here it is:
416    </para>
417    <para>
418     <itemizedlist>
419      <listitem>
420       <para>
421        All tags should be lower case.
422       </para>
423     </listitem> 
424     <listitem>
425      <para>
426        Tags delimiting a <emphasis>block</emphasis> of text (even small
427        blocks) should be on their own line. Like:
428        <literallayout>
429  &lt;para&gt;
430   Some text goes here.
431  &lt;/para&gt;
432        </literallayout>
433        Tags marking individual words, or few words, should be in-line:
434        <literallayout>
435   Just to &lt;emphasis&gt;emphasize&lt;/emphasis&gt;, some text goes here.
436        </literallayout>
437      </para>
438    </listitem> 
439    <listitem>
440     <para>
441       Tags should be nested and step indented for block text like: (except
442       in-line tags) 
443      <literallayout>
444  &lt;para&gt;
445   &lt;itemizedlist&gt;
446    &lt;para&gt;
447     &lt;listitem&gt;
448       Some text goes here in our list example.
449      &lt;/listitem&gt;
450    &lt;/para&gt;
451   &lt;/itemizedlist&gt;
452  &lt;/para&gt;
453        </literallayout>
454       This makes it easier to find the text amongst the tags ;-)
455     </para>
456    </listitem> 
457    <listitem>
458     <para>
459      Use white space to separate logical divisions within a document, 
460      like between sections. Running everything together consistently 
461      makes it harder to read and work on.
462     </para>
463    </listitem> 
464    <listitem>
465     <para>
466      Do not hesitate to make comments. Comments can either use the 
467      &lt;comment&gt; element, or the &lt;!--  --&gt; style comment 
468      familiar from HTML. (Note in Docbook v4.x &lt;comment&gt; is 
469      replaced by &lt;remark&gt;.)
470     </para>
471   </listitem> 
472   <listitem>
473    <para>
474      We have an international audience. Refrain from slang, or English 
475      idiosyncrasies (too many to list :). Humor also does not translate 
476      well sometimes.
477    </para>
478   </listitem> 
479   <listitem>
480    <para>
481     Try to keep overall line lengths in source files to 80 characters or less
482     for obvious reasons. This is not always possible, with lengthy URLs for
483     instance.
484    </para>
485   </listitem> 
486   <listitem>
487    <para>
488     Our documents are available in differing formats. Right now, they 
489     are just plain text, and HTML, but PDF, and others is always a 
490     future possibility. Be careful with URLs (&lt;ulink&gt;), and avoid 
491     this mistake:
492    </para>
493    <para>
494      My favorite site is &lt;ulink url="http://example.com"&gt;here&lt;/ulink&gt;.
495    </para>
496    <para>
497      This will render as <quote>My favorite site is here</quote>, which is 
498      not real helpful in a text doc. Better like this:
499    </para>
500    <para>
501      My favorite site is &lt;ulink url="http://example.com"&gt;example.com&lt;/ulink&gt;.
502    </para>
503   </listitem>
504   <listitem>
505    <para>
506     All documents should be spell checked occasionally.
507     <application>aspell</application> can check SGML with the
508     <literal>-H</literal> option. (<application>ispell</application> I think
509     too.)
510    </para>
511   </listitem> 
512
513   </itemizedlist>
514  </para> 
515   
516   </sect2>
517
518   
519  <!--   ~~~~~       New section      ~~~~~     -->
520
521  <sect2><title>Privoxy Custom Entities</title>
522  <para>
523   <application>Privoxy</application> documentation is using 
524   a number of customized <quote>entities</quote> to facilitate 
525   documentation maintenance. 
526  </para>
527  <para>
528   We are using a set of <quote>boilerplate</quote> files with generic text,
529   that is used by multiple docs. This way we can write something once, and use
530   it repeatedly without having to re-write the same content over and over again.
531   If editing such a file, keep in mind that it should be
532   <emphasis>generic</emphasis>. That is the purpose; so it can be used in varying 
533   contexts without additional modifications.
534  </para>
535  <para>
536   We are also using what <application>Docbook</application> calls 
537   <quote>internal entities</quote>. These are like variables in 
538   programming. Well, sort of. For instance, we have the
539   <literal>p-version</literal> entity that contains the current 
540   <application>Privoxy</application> version string. You are strongly 
541   encouraged to use these where possible. Some of these obviously 
542   require re-setting with each release (done by the Makefile). A sampling of
543   custom entities are listed below. See any of the main docs for examples.
544  </para>
545
546  <para>
547   <itemizedlist>
548   <listitem>
549    <para>
550     Re- <quote>boilerplate</quote> text entities are defined like:
551    </para>
552    <para>
553     <literal>&lt;!entity supported SYSTEM "supported.sgml"&gt;</literal>
554    </para>
555    <para>
556      In this example, the contents of the file,
557      <filename>supported.sgml</filename> is available for inclusion anywhere 
558      in the doc. To make this happen, just reference the now defined 
559      entity: <literal>&#38;supported;</literal> (starts with an ampersand 
560      and ends with a semi-colon), and the contents will be dumped into 
561      the finished doc at that point.
562    </para>
563   </listitem> 
564   <listitem>
565    <para>
566     Commonly used <quote>internal entities</quote>:
567   </para>
568   <simplelist>
569    <member>
570     <emphasis>p-version</emphasis>: the <application>Privoxy</application> 
571     version string, e.g. <quote>&p-version;</quote>.
572    </member>
573    <member>
574     <emphasis>p-status</emphasis>: the project status, either 
575     <quote>alpha</quote>, <quote>beta</quote>, or <quote>stable</quote>.
576    </member>
577    <member>
578     <emphasis>p-not-stable</emphasis>: use to conditionally include 
579     text in <quote>not stable</quote> releases (e.g. <quote>beta</quote>).
580    </member>
581    <member>
582     <emphasis>p-stable</emphasis>: just the opposite.
583    </member>
584    <member>
585     <emphasis>p-text</emphasis>: this doc is only generated as text.
586    </member>
587   </simplelist>
588  </listitem> 
589  </itemizedlist>
590  </para> 
591  <para>
592   There are others in various places that are defined for a specific 
593   purpose. Read the source!
594  </para>
595  
596  </sect2>
597   
598  </sect1>
599
600 <!--     <listitem><para>be consistent with the redirect script (i.e. the <application>Privoxy</application> program -->
601 <!--       points via the redirect URL at sf to valid end-points in the document)</para></listitem> -->
602
603   <!--   ~~~~~       New section      ~~~~~     -->
604   <sect1 id="coding"><title>Coding Guidelines</title>
605
606     <sect2 id="s1"><title>Introduction</title>
607
608     <para>This set of standards is designed to make our lives easier.  It is
609     developed with the simple goal of helping us keep the "new and improved
610     <application>Privoxy</application>" consistent and reliable. Thus making
611     maintenance easier and increasing chances of success of the
612     project.</para>
613
614     <para>And that of course comes back to us as individuals. If we can
615     increase our development and product efficiencies then we can solve more
616     of the request for changes/improvements and in general feel good about
617     ourselves. ;-></para>
618
619   </sect2>
620
621     <sect2 id="s2"><title>Using Comments</title>
622  
623
624     <sect3 id="s3"><title>Comment, Comment, Comment</title>
625
626     <para><emphasis>Explanation:</emphasis></para>
627
628     <para>Comment as much as possible without commenting the obvious.
629     For example do not comment "aVariable is equal to bVariable".
630     Instead explain why aVariable should be equal to the bVariable.
631     Just because a person can read code does not mean they will
632     understand why or what is being done. A reader may spend a lot
633     more time figuring out what is going on when a simple comment
634     or explanation would have prevented the extra research. Please
635     help your brother IJB'ers out!</para>
636
637     <para>The comments will also help justify the intent of the code.
638     If the comment describes something different than what the code
639     is doing then maybe a programming error is occurring.</para>
640
641     <para><emphasis>Example:</emphasis></para>
642 <programlisting>
643 /* if page size greater than 1k ... */
644 if ( PageLength() > 1024 )
645 {
646     ... "block" the page up ...
647 }
648
649 /* if page size is small, send it in blocks */
650 if ( PageLength() > 1024 )
651 {
652     ... "block" the page up ...
653 }
654
655 This demonstrates 2 cases of "what not to do".  The first is a
656 "syntax comment".  The second is a comment that does not fit what
657 is actually being done.
658 </programlisting>
659   </sect3>
660
661     
662
663     <sect3 id="s4"><title>Use blocks for comments</title>
664
665     <para><emphasis>Explanation:</emphasis></para>
666
667     <para>Comments can help or they can clutter. They help when they
668     are differentiated from the code they describe. One line
669     comments do not offer effective separation between the comment
670     and the code. Block identifiers do, by surrounding the code
671     with a clear, definable pattern.</para>
672
673     <para><emphasis>Example:</emphasis></para>
674 <programlisting>
675 /*********************************************************************
676  * This will stand out clearly in your code!
677  *********************************************************************/
678 if ( thisVariable == thatVariable )
679 {
680    DoSomethingVeryImportant();
681 }
682
683
684 /* unfortunately, this may not */
685 if ( thisVariable == thatVariable )
686 {
687    DoSomethingVeryImportant();
688 }
689
690
691 if ( thisVariable == thatVariable ) /* this may not either */
692 {
693    DoSomethingVeryImportant();
694 }</programlisting>
695
696     <para><emphasis>Exception:</emphasis></para>
697
698     <para>If you are trying to add a small logic comment and do not
699     wish to "disrupt" the flow of the code, feel free to use a 1
700     line comment which is NOT on the same line as the code.</para>
701
702     
703   </sect3>
704     
705
706     <sect3 id="s5"><title>Keep Comments on their own line</title>
707
708     <para><emphasis>Explanation:</emphasis></para>
709
710     <para>It goes back to the question of readability. If the comment
711     is on the same line as the code it will be harder to read than
712     the comment that is on its own line.</para>
713
714     <para>There are three exceptions to this rule, which should be
715     violated freely and often: during the definition of variables,
716     at the end of closing braces, when used to comment
717     parameters.</para>
718
719     <para><emphasis>Example:</emphasis></para>
720 <programlisting>
721 /*********************************************************************
722  * This will stand out clearly in your code,
723  * But the second example won't.
724  *********************************************************************/
725 if ( thisVariable == thatVariable )
726 {
727    DoSomethingVeryImportant();
728 }
729
730 if ( thisVariable == thatVariable ) /*can you see me?*/
731 {
732    DoSomethingVeryImportant(); /*not easily*/
733 }
734
735
736 /*********************************************************************
737  * But, the encouraged exceptions:
738  *********************************************************************/
739 int urls_read     = 0;     /* # of urls read + rejected */
740 int urls_rejected = 0;     /* # of urls rejected */
741
742 if ( 1 == X )
743 {
744    DoSomethingVeryImportant();
745 }
746
747
748 short DoSomethingVeryImportant(
749    short firstparam,   /* represents something */
750    short nextparam     /* represents something else */ )
751 {
752    ...code here...
753
754 }   /* -END- DoSomethingVeryImportant */
755 </programlisting>
756   </sect3>
757     
758
759     <sect3 id="s6"><title>Comment each logical step</title>
760
761     <para><emphasis>Explanation:</emphasis></para>
762
763     <para>Logical steps should be commented to help others follow the
764     intent of the written code and comments will make the code more
765     readable.</para>
766
767     <para>If you have 25 lines of code without a comment, you should
768     probably go back into it to see where you forgot to put
769     one.</para>
770
771     <para>Most "for", "while", "do", etc... loops _probably_ need a
772     comment. After all, these are usually major logic
773     containers.</para>
774
775     
776   </sect3>
777     
778
779     <sect3 id="s7"><title>Comment All Functions Thoroughly</title>
780
781     <para><emphasis>Explanation:</emphasis></para>
782
783     <para>A reader of the code should be able to look at the comments
784     just prior to the beginning of a function and discern the
785     reason for its existence and the consequences of using it. The
786     reader should not have to read through the code to determine if
787     a given function is safe for a desired use. The proper
788     information thoroughly presented at the introduction of a
789     function not only saves time for subsequent maintenance or
790     debugging, it more importantly aids in code reuse by allowing a
791     user to determine the safety and applicability of any function
792     for the problem at hand. As a result of such benefits, all
793     functions should contain the information presented in the
794     addendum section of this document.</para>
795
796     
797   </sect3>
798     
799
800     <sect3 id="s8"><title>Comment at the end of braces if the
801     content is more than one screen length</title>
802
803     <para><emphasis>Explanation:</emphasis></para>
804
805     <para>Each closing brace should be followed on the same line by a
806     comment that describes the origination of the brace if the
807     original brace is off of the screen, or otherwise far away from
808     the closing brace. This will simplify the debugging,
809     maintenance, and readability of the code.</para>
810
811     <para>As a suggestion , use the following flags to make the
812     comment and its brace more readable:</para>
813
814     <para>use following a closing brace: } /* -END- if() or while ()
815     or etc... */</para>
816
817     <para><emphasis>Example:</emphasis></para>
818 <programlisting>
819 if ( 1 == X )
820 {
821    DoSomethingVeryImportant();
822    ...some long list of commands...
823 } /* -END- if x is 1 */
824
825 or:
826
827 if ( 1 == X )
828 {
829    DoSomethingVeryImportant();
830    ...some long list of commands...
831 } /* -END- if ( 1 == X ) */
832 </programlisting>
833   </sect3>
834     
835   </sect2>
836
837     <sect2 id="s9"><title>Naming Conventions</title>
838
839     
840
841     <sect3 id="s10"><title>Variable Names</title>
842
843     <para><emphasis>Explanation:</emphasis></para>
844
845     <para>Use all lowercase, and separate words via an underscore
846     ('_'). Do not start an identifier with an underscore. (ANSI C
847     reserves these for use by the compiler and system headers.) Do
848     not use identifiers which are reserved in ANSI C++. (E.g.
849     template, class, true, false, ...). This is in case we ever
850     decide to port Privoxy to C++.</para>
851
852     <para><emphasis>Example:</emphasis></para>
853 <programlisting>
854 int ms_iis5_hack = 0;</programlisting>
855
856     <para><emphasis>Instead of:</emphasis></para>
857
858     <para>
859 <programlisting>
860 int msiis5hack = 0; int msIis5Hack = 0;
861 </programlisting>
862 </para>
863
864     
865
866   </sect3>    
867
868     <sect3 id="s11"><title>Function Names</title>
869
870     <para><emphasis>Explanation:</emphasis></para>
871
872     <para>Use all lowercase, and separate words via an underscore
873     ('_'). Do not start an identifier with an underscore. (ANSI C
874     reserves these for use by the compiler and system headers.) Do
875     not use identifiers which are reserved in ANSI C++. (E.g.
876     template, class, true, false, ...). This is in case we ever
877     decide to port Privoxy to C++.</para>
878
879     <para><emphasis>Example:</emphasis></para>
880 <programlisting>
881 int load_some_file( struct client_state *csp )</programlisting>
882
883     <para><emphasis>Instead of:</emphasis></para>
884
885     <para>
886 <programlisting>
887 int loadsomefile( struct client_state *csp )
888 int loadSomeFile( struct client_state *csp )
889 </programlisting>
890 </para>
891
892     
893   </sect3>
894     
895
896     <sect3 id="s12"><title>Header file prototypes</title>
897
898     <para><emphasis>Explanation:</emphasis></para>
899
900     <para>Use a descriptive parameter name in the function prototype
901     in header files. Use the same parameter name in the header file
902     that you use in the c file.</para>
903
904     <para><emphasis>Example:</emphasis></para>
905 <programlisting>
906 (.h) extern int load_aclfile( struct client_state *csp );
907 (.c) int load_aclfile( struct client_state *csp )</programlisting>
908
909     <para><emphasis>Instead of:</emphasis>
910 <programlisting>
911 (.h) extern int load_aclfile( struct client_state * ); or 
912 (.h) extern int load_aclfile(); 
913 (.c) int load_aclfile( struct client_state *csp )
914 </programlisting>
915 </para>
916
917     
918   </sect3>
919     
920
921     <sect3 id="s13"><title>Enumerations, and #defines</title>
922
923     <para><emphasis>Explanation:</emphasis></para>
924
925     <para>Use all capital letters, with underscores between words. Do
926     not start an identifier with an underscore. (ANSI C reserves
927     these for use by the compiler and system headers.)</para>
928
929     <para><emphasis>Example:</emphasis></para>
930 <programlisting>
931 (enumeration) : enum Boolean { FALSE, TRUE };
932 (#define) : #define DEFAULT_SIZE 100;</programlisting>
933
934     <para><emphasis>Note:</emphasis> We have a standard naming scheme for #defines
935     that toggle a feature in the preprocessor: FEATURE_>, where
936     > is a short (preferably 1 or 2 word) description.</para>
937
938     <para><emphasis>Example:</emphasis></para>
939 <programlisting>
940 #define FEATURE_FORCE 1
941
942 #ifdef FEATURE_FORCE
943 #define FORCE_PREFIX blah
944 #endif /* def FEATURE_FORCE */
945 </programlisting>
946   </sect3>
947     
948
949     <sect3 id="s14"><title>Constants</title>
950
951     <para><emphasis>Explanation:</emphasis></para>
952
953     <para>Spell common words out entirely (do not remove vowels).</para>
954
955     <para>Use only widely-known domain acronyms and abbreviations.
956     Capitalize all letters of an acronym.</para>
957
958     <para>Use underscore (_) to separate adjacent acronyms and
959     abbreviations. Never terminate a name with an underscore.</para>
960
961     <para><emphasis>Example:</emphasis></para>
962 <programlisting>
963 #define USE_IMAGE_LIST 1</programlisting>
964
965     <para><emphasis>Instead of:</emphasis></para>
966
967     <para>
968 <programlisting>
969 #define USE_IMG_LST 1 or 
970 #define _USE_IMAGE_LIST 1 or
971 #define USE_IMAGE_LIST_ 1 or 
972 #define use_image_list 1 or
973 #define UseImageList 1
974 </programlisting>
975 </para>
976
977     
978   </sect3>
979
980   </sect2>
981     
982
983     <sect2 id="s15"><title>Using Space</title>
984
985     
986
987     <sect3 id="s16"><title>Put braces on a line by themselves.</title>
988
989     <para><emphasis>Explanation:</emphasis></para>
990
991     <para>The brace needs to be on a line all by itself, not at the
992     end of the statement. Curly braces should line up with the
993     construct that they're associated with. This practice makes it
994     easier to identify the opening and closing braces for a
995     block.</para>
996
997     <para><emphasis>Example:</emphasis></para>
998 <programlisting>
999 if ( this == that )
1000 {
1001    ...
1002 }</programlisting>
1003
1004     <para><emphasis>Instead of:</emphasis></para>
1005
1006     <para>if ( this == that ) { ... }</para>
1007
1008     <para>or</para>
1009
1010     <para>if ( this == that ) { ... }</para>
1011
1012     <para><emphasis>Note:</emphasis> In the special case that the if-statement is
1013     inside a loop, and it is trivial, i.e. it tests for a
1014     condition that is obvious from the purpose of the block,
1015     one-liners as above may optically preserve the loop structure
1016     and make it easier to read.</para>
1017
1018     <para><emphasis>Status:</emphasis> developer-discretion.</para>
1019
1020     <para><emphasis>Example exception:</emphasis></para>
1021 <programlisting>
1022 while ( more lines are read )
1023 {
1024    /* Please document what is/is not a comment line here */
1025    if ( it's a comment ) continue;
1026
1027    do_something( line );
1028 }
1029 </programlisting>
1030   </sect3>
1031     
1032
1033     <sect3 id="s17"><title>ALL control statements should have a
1034     block</title>
1035
1036     <para><emphasis>Explanation:</emphasis></para>
1037
1038     <para>Using braces to make a block will make your code more
1039     readable and less prone to error. All control statements should
1040     have a block defined.</para>
1041
1042     <para><emphasis>Example:</emphasis></para>
1043 <programlisting>
1044 if ( this == that )
1045 {
1046    DoSomething();
1047    DoSomethingElse();
1048 }</programlisting>
1049
1050     <para><emphasis>Instead of:</emphasis></para>
1051
1052     <para>if ( this == that ) DoSomething(); DoSomethingElse();</para>
1053
1054     <para>or</para>
1055
1056     <para>if ( this == that ) DoSomething();</para>
1057
1058     <para><emphasis>Note:</emphasis> The first example in "Instead of" will execute
1059     in a manner other than that which the developer desired (per
1060     indentation). Using code braces would have prevented this
1061     "feature". The "explanation" and "exception" from the point
1062     above also applies.</para>
1063
1064     
1065   </sect3>
1066     
1067
1068     <sect3 id="s18"><title>Do not belabor/blow-up boolean
1069     expressions</title>
1070
1071     <para><emphasis>Example:</emphasis></para>
1072 <programlisting>
1073 structure->flag = ( condition );</programlisting>
1074
1075     <para><emphasis>Instead of:</emphasis></para>
1076
1077     <para>if ( condition ) { structure->flag = 1; } else {
1078     structure->flag = 0; }</para>
1079
1080     <para><emphasis>Note:</emphasis> The former is readable and concise. The later
1081     is wordy and inefficient. Please assume that any developer new
1082     to the project has at least a "good" knowledge of C/C++. (Hope
1083     I do not offend by that last comment ... 8-)</para>
1084
1085     
1086   </sect3>
1087     
1088
1089     <sect3 id="s19"><title>Use white space freely because it is
1090     free</title>
1091
1092     <para><emphasis>Explanation:</emphasis></para>
1093
1094     <para>Make it readable. The notable exception to using white space
1095     freely is listed in the next guideline.</para>
1096
1097     <para><emphasis>Example:</emphasis></para>
1098 <programlisting>
1099 int firstValue   = 0;
1100 int someValue    = 0;
1101 int anotherValue = 0;
1102 int thisVariable = 0;
1103
1104 if ( thisVariable == thatVariable )
1105
1106 firstValue = oldValue + ( ( someValue - anotherValue ) - whatever )
1107 </programlisting>
1108   </sect3>
1109     
1110
1111     <sect3 id="s20"><title>Don't use white space around structure
1112     operators</title>
1113
1114     <para><emphasis>Explanation:</emphasis></para>
1115
1116     <para>- structure pointer operator ( "->" ) - member operator (
1117     "." ) - functions and parentheses</para>
1118
1119     <para>It is a general coding practice to put pointers, references,
1120     and function parentheses next to names. With spaces, the
1121     connection between the object and variable/function name is not
1122     as clear.</para>
1123
1124     <para><emphasis>Example:</emphasis></para>
1125 <programlisting>
1126 aStruct->aMember;
1127 aStruct.aMember;
1128 FunctionName();</programlisting>
1129
1130     <para><emphasis>Instead of:</emphasis> aStruct -> aMember; aStruct . aMember;
1131     FunctionName ();</para>
1132
1133     
1134   </sect3>
1135     
1136
1137     <sect3 id="s21"><title>Make the last brace of a function stand
1138     out</title>
1139
1140     <para><emphasis>Example:</emphasis></para>
1141 <programlisting>
1142 int function1( ... )
1143 {
1144    ...code...
1145    return( retCode );
1146
1147 }   /* -END- function1 */
1148
1149
1150 int function2( ... )
1151 {
1152 }   /* -END- function2 */
1153 </programlisting>
1154
1155     <para><emphasis>Instead of:</emphasis></para>
1156
1157     <para>int function1( ... ) { ...code... return( retCode ); } int
1158     function2( ... ) { }</para>
1159
1160     <para><emphasis>Note:</emphasis> Use 1 blank line before the closing brace and 2
1161     lines afterward. This makes the end of function standout to
1162     the most casual viewer. Although function comments help
1163     separate functions, this is still a good coding practice. In
1164     fact, I follow these rules when using blocks in "for", "while",
1165     "do" loops, and long if {} statements too. After all whitespace
1166     is free!</para>
1167
1168     <para><emphasis>Status:</emphasis> developer-discretion on the number of blank
1169     lines. Enforced is the end of function comments.</para>
1170
1171     
1172   </sect3>
1173     
1174
1175     <sect3 id="s22"><title>Use 3 character indentions</title>
1176
1177     <para><emphasis>Explanation:</emphasis></para>
1178
1179     <para>If some use 8 character TABs and some use 3 character TABs,
1180     the code can look *very* ragged. So use 3 character indentions
1181     only. If you like to use TABs, pass your code through a filter
1182     such as "expand -t3" before checking in your code.</para>
1183
1184     <para><emphasis>Example:</emphasis></para>
1185 <programlisting>
1186 static const char * const url_code_map[256] =
1187 {
1188    NULL, ...
1189 };
1190
1191
1192 int function1( ... )
1193 {
1194    if ( 1 )
1195    {
1196       return( ALWAYS_TRUE );
1197    }
1198    else
1199    {
1200       return( HOW_DID_YOU_GET_HERE );
1201    }
1202
1203    return( NEVER_GETS_HERE );
1204
1205 }
1206 </programlisting>
1207   </sect3>
1208
1209   </sect2>
1210     
1211
1212     <sect2 id="s23"><title>Initializing</title>
1213
1214     
1215
1216     <sect3 id="s24"><title>Initialize all variables</title>
1217
1218     <para><emphasis>Explanation:</emphasis></para>
1219
1220     <para>Do not assume that the variables declared will not be used
1221     until after they have been assigned a value somewhere else in
1222     the code. Remove the chance of accidentally using an unassigned
1223     variable.</para>
1224
1225     <para><emphasis>Example:</emphasis></para>
1226 <programlisting>
1227 short anShort = 0;
1228 float aFloat  = 0;
1229 struct *ptr = NULL;</programlisting>
1230
1231     <para><emphasis>Note:</emphasis> It is much easier to debug a SIGSEGV if the
1232     message says you are trying to access memory address 00000000
1233     and not 129FA012; or arrayPtr[20] causes a SIGSEV vs.
1234     arrayPtr[0].</para>
1235
1236     <para><emphasis>Status:</emphasis> developer-discretion if and only if the
1237     variable is assigned a value "shortly after" declaration.</para>
1238
1239   </sect3>
1240   </sect2>
1241     
1242
1243     <sect2 id="s25"><title>Functions</title>
1244
1245     
1246
1247     <sect3 id="s26"><title>Name functions that return a boolean as a
1248     question.</title>
1249
1250     <para><emphasis>Explanation:</emphasis></para>
1251
1252     <para>Value should be phrased as a question that would logically
1253     be answered as a true or false statement</para>
1254
1255     <para><emphasis>Example:</emphasis></para>
1256 <programlisting>
1257 ShouldWeBlockThis();
1258 ContainsAnImage();
1259 IsWebPageBlank();
1260 </programlisting>
1261   </sect3>
1262     
1263
1264     <sect3 id="s27"><title>Always specify a return type for a
1265     function.</title>
1266
1267     <para><emphasis>Explanation:</emphasis></para>
1268
1269     <para>The default return for a function is an int. To avoid
1270     ambiguity, create a return for a function when the return has a
1271     purpose, and create a void return type if the function does not
1272     need to return anything.</para>
1273
1274     
1275   </sect3>
1276     
1277
1278     <sect3 id="s28"><title>Minimize function calls when iterating by
1279     using variables</title>
1280
1281     <para><emphasis>Explanation:</emphasis></para>
1282
1283     <para>It is easy to write the following code, and a clear argument
1284     can be made that the code is easy to understand:</para>
1285
1286     <para><emphasis>Example:</emphasis></para>
1287 <programlisting>
1288 for ( size_t cnt = 0; cnt &lt; blockListLength(); cnt ++ )
1289 {
1290    ....
1291 }</programlisting>
1292
1293     <para><emphasis>Note:</emphasis> Unfortunately, this makes a function call for
1294     each and every iteration. This increases the overhead in the
1295     program, because the compiler has to look up the function each
1296     time, call it, and return a value. Depending on what occurs in
1297     the blockListLength() call, it might even be creating and
1298     destroying structures with each iteration, even though in each
1299     case it is comparing "cnt" to the same value, over and over.
1300     Remember too - even a call to blockListLength() is a function
1301     call, with the same overhead.</para>
1302
1303     <para>Instead of using a function call during the iterations,
1304     assign the value to a variable, and evaluate using the
1305     variable.</para>
1306
1307     <para><emphasis>Example:</emphasis></para>
1308 <programlisting>
1309 size_t len = blockListLength();
1310
1311 for ( size_t cnt = 0; cnt &lt; len; cnt ++ )
1312 {
1313    ....
1314 }</programlisting>
1315
1316     <para><emphasis>Exceptions:</emphasis> if the value of blockListLength() *may*
1317     change or could *potentially* change, then you must code the
1318     function call in the for/while loop.</para>
1319
1320     
1321   </sect3>
1322     
1323
1324     <sect3 id="s29"><title>Pass and Return by Const Reference</title>
1325
1326     <para><emphasis>Explanation:</emphasis></para>
1327
1328     <para>This allows a developer to define a const pointer and call
1329     your function. If your function does not have the const
1330     keyword, we may not be able to use your function. Consider
1331     strcmp, if it were defined as: extern int strcmp( char *s1,
1332     char *s2 );</para>
1333
1334     <para>I could then not use it to compare argv's in main: int main(
1335     int argc, const char *argv[] ) { strcmp( argv[0], "privoxy"
1336     ); }</para>
1337
1338     <para>Both these pointers are *const*! If the c runtime library
1339     maintainers do it, we should too.</para>
1340
1341     
1342   </sect3>
1343     
1344
1345     <sect3 id="s30"><title>Pass and Return by Value</title>
1346
1347     <para><emphasis>Explanation:</emphasis></para>
1348
1349     <para>Most structures cannot fit onto a normal stack entry (i.e.
1350     they are not 4 bytes or less). Aka, a function declaration
1351     like: int load_aclfile( struct client_state csp )</para>
1352
1353     <para>would not work. So, to be consistent, we should declare all
1354     prototypes with "pass by value": int load_aclfile( struct
1355     client_state *csp )</para>
1356
1357     
1358   </sect3>
1359     
1360
1361     <sect3 id="s31"><title>Names of include files</title>
1362
1363     <para><emphasis>Explanation:</emphasis></para>
1364
1365     <para>Your include statements should contain the file name without
1366     a path. The path should be listed in the Makefile, using -I as
1367     processor directive to search the indicated paths. An exception
1368     to this would be for some proprietary software that utilizes a
1369     partial path to distinguish their header files from system or
1370     other header files.</para>
1371
1372     <para><emphasis>Example:</emphasis></para>
1373 <programlisting>
1374 #include &lt;iostream.h&gt;     /* This is not a local include */
1375 #include "config.h"       /* This IS a local include */
1376 </programlisting>
1377
1378     <para><emphasis>Exception:</emphasis></para>
1379
1380     <para>
1381 <programlisting>
1382 /* This is not a local include, but requires a path element. */ 
1383 #include &lt;sys/fileName.h&gt;
1384 </programlisting>
1385 </para>
1386
1387     <para><emphasis>Note:</emphasis> Please! do not add "-I." to the Makefile
1388     without a _very_ good reason. This duplicates the #include
1389     "file.h" behavior.</para>
1390
1391     
1392   </sect3>
1393     
1394
1395     <sect3 id="s32"><title>Provide multiple inclusion
1396     protection</title>
1397
1398     <para><emphasis>Explanation:</emphasis></para>
1399
1400     <para>Prevents compiler and linker errors resulting from
1401     redefinition of items.</para>
1402
1403     <para>Wrap each header file with the following syntax to prevent
1404     multiple inclusions of the file. Of course, replace PROJECT_H
1405     with your file name, with "." Changed to "_", and make it
1406     uppercase.</para>
1407
1408     <para><emphasis>Example:</emphasis></para>
1409 <programlisting>
1410 #ifndef PROJECT_H_INCLUDED
1411 #define PROJECT_H_INCLUDED
1412  ...
1413 #endif /* ndef PROJECT_H_INCLUDED */
1414 </programlisting>
1415   </sect3>
1416     
1417
1418     <sect3 id="s33"><title>Use `extern "C"` when appropriate</title>
1419
1420     <para><emphasis>Explanation:</emphasis></para>
1421
1422     <para>If our headers are included from C++, they must declare our
1423     functions as `extern "C"`. This has no cost in C, but increases
1424     the potential re-usability of our code.</para>
1425
1426     <para><emphasis>Example:</emphasis></para>
1427 <programlisting>
1428 #ifdef __cplusplus
1429 extern "C"
1430 {
1431 #endif /* def __cplusplus */
1432
1433 ... function definitions here ...
1434
1435 #ifdef __cplusplus
1436 }
1437 #endif /* def __cplusplus */
1438 </programlisting>
1439   </sect3>
1440     
1441
1442     <sect3 id="s34"><title>Where Possible, Use Forward Struct
1443     Declaration Instead of Includes</title>
1444
1445     <para><emphasis>Explanation:</emphasis></para>
1446
1447     <para>Useful in headers that include pointers to other struct's.
1448     Modifications to excess header files may cause needless
1449     compiles.</para>
1450
1451     <para><emphasis>Example:</emphasis></para>
1452 <programlisting>
1453 /*********************************************************************
1454  * We're avoiding an include statement here!
1455  *********************************************************************/
1456 struct file_list;
1457 extern file_list *xyz;</programlisting>
1458
1459     <para><emphasis>Note:</emphasis> If you declare "file_list xyz;" (without the
1460     pointer), then including the proper header file is necessary.
1461     If you only want to prototype a pointer, however, the header
1462     file is unnecessary.</para>
1463
1464     <para><emphasis>Status:</emphasis> Use with discretion.</para>
1465
1466     
1467   </sect3>
1468   </sect2>
1469
1470     <sect2 id="s35"><title>General Coding Practices</title>
1471
1472     
1473
1474     <sect3 id="s36"><title>Turn on warnings</title>
1475
1476     <para><emphasis>Explanation</emphasis></para>
1477
1478     <para>Compiler warnings are meant to help you find bugs. You
1479     should turn on as many as possible. With GCC, the switch is
1480     "-Wall". Try and fix as many warnings as possible.</para>
1481
1482     
1483   </sect3>
1484     
1485
1486     <sect3 id="s37"><title>Provide a default case for all switch
1487     statements</title>
1488
1489     <para><emphasis>Explanation:</emphasis></para>
1490
1491     <para>What you think is guaranteed is never really guaranteed. The
1492     value that you don't think you need to check is the one that
1493     someday will be passed. So, to protect yourself from the
1494     unknown, always have a default step in a switch statement.</para>
1495
1496     <para><emphasis>Example:</emphasis></para>
1497 <programlisting>
1498 switch( hash_string( cmd ) )
1499 {
1500    case hash_actions_file :
1501       ... code ...
1502       break;
1503
1504    case hash_confdir :
1505       ... code ...
1506       break;
1507
1508    default :
1509       log_error( ... );
1510       ... anomaly code goes here ...
1511       continue; / break; / exit( 1 ); / etc ...
1512
1513 } /* end switch( hash_string( cmd ) ) */</programlisting>
1514
1515     <para><emphasis>Note:</emphasis> If you already have a default condition, you
1516     are obviously exempt from this point. Of note, most of the
1517     WIN32 code calls `DefWindowProc' after the switch statement.
1518     This API call *should* be included in a default statement.</para>
1519
1520     <para><emphasis>Another Note:</emphasis> This is not so much a readability issue
1521     as a robust programming issue. The "anomaly code goes here" may
1522     be no more than a print to the STDERR stream (as in
1523     load_config). Or it may really be an ABEND condition.</para>
1524
1525     <para><emphasis>Status:</emphasis> Programmer discretion is advised.</para>
1526
1527     
1528   </sect3>
1529     
1530
1531     <sect3 id="s38"><title>Try to avoid falling through cases in a
1532     switch statement.</title>
1533
1534     <para><emphasis>Explanation:</emphasis></para>
1535
1536     <para>In general, you will want to have a 'break' statement within
1537     each 'case' of a switch statement. This allows for the code to
1538     be more readable and understandable, and furthermore can
1539     prevent unwanted surprises if someone else later gets creative
1540     and moves the code around.</para>
1541
1542     <para>The language allows you to plan the fall through from one
1543     case statement to another simply by omitting the break
1544     statement within the case statement. This feature does have
1545     benefits, but should only be used in rare cases. In general,
1546     use a break statement for each case statement.</para>
1547
1548     <para>If you choose to allow fall through, you should comment both
1549     the fact of the fall through and reason why you felt it was
1550     necessary.</para>
1551
1552     
1553   </sect3>
1554     
1555
1556     <sect3 id="s39"><title>Use 'long' or 'short' Instead of
1557     'int'</title>
1558
1559     <para><emphasis>Explanation:</emphasis></para>
1560
1561     <para>On 32-bit platforms, int usually has the range of long. On
1562     16-bit platforms, int has the range of short.</para>
1563
1564     <para><emphasis>Status:</emphasis> open-to-debate. In the case of most FSF
1565     projects (including X/GNU-Emacs), there are typedefs to int4,
1566     int8, int16, (or equivalence ... I forget the exact typedefs
1567     now). Should we add these to IJB now that we have a "configure"
1568     script?</para>
1569
1570     
1571   </sect3>
1572     
1573
1574     <sect3 id="s40"><title>Don't mix size_t and other types</title>
1575
1576     <para><emphasis>Explanation:</emphasis></para>
1577
1578     <para>The type of size_t varies across platforms. Do not make
1579     assumptions about whether it is signed or unsigned, or about
1580     how long it is. Do not compare a size_t against another
1581     variable of a different type (or even against a constant)
1582     without casting one of the values. Try to avoid using size_t if
1583     you can.</para>
1584
1585     
1586   </sect3>
1587     
1588
1589     <sect3 id="s41"><title>Declare each variable and struct on its
1590     own line.</title>
1591
1592     <para><emphasis>Explanation:</emphasis></para>
1593
1594     <para>It can be tempting to declare a series of variables all on
1595     one line. Don't.</para>
1596
1597     <para><emphasis>Example:</emphasis></para>
1598 <programlisting>
1599 long a = 0;
1600 long b = 0;
1601 long c = 0;</programlisting>
1602
1603     <para><emphasis>Instead of:</emphasis></para>
1604
1605     <para>long a, b, c;</para>
1606
1607     <para><emphasis>Explanation:</emphasis> - there is more room for comments on the
1608     individual variables - easier to add new variables without
1609     messing up the original ones - when searching on a variable to
1610     find its type, there is less clutter to "visually"
1611     eliminate</para>
1612
1613     <para><emphasis>Exceptions:</emphasis> when you want to declare a bunch of loop
1614     variables or other trivial variables; feel free to declare them
1615     on 1 line. You should, although, provide a good comment on
1616     their functions.</para>
1617
1618     <para><emphasis>Status:</emphasis> developer-discretion.</para>
1619
1620     
1621   </sect3>
1622     
1623
1624     <sect3 id="s42"><title>Use malloc/zalloc sparingly</title>
1625
1626     <para><emphasis>Explanation:</emphasis></para>
1627
1628     <para>Create a local struct (on the stack) if the variable will
1629     live and die within the context of one function call.</para>
1630
1631     <para>Only "malloc" a struct (on the heap) if the variable's life
1632     will extend beyond the context of one function call.</para>
1633
1634     <para><emphasis>Example:</emphasis></para>
1635 <programlisting>
1636 If a function creates a struct and stores a pointer to it in a
1637 list, then it should definitely be allocated via `malloc'.
1638 </programlisting>
1639   </sect3>
1640     
1641
1642     <sect3 id="s43"><title>The Programmer Who Uses 'malloc' is
1643     Responsible for Ensuring 'free'</title>
1644
1645     <para><emphasis>Explanation:</emphasis></para>
1646
1647     <para>If you have to "malloc" an instance, you are responsible for
1648     insuring that the instance is `free'd, even if the deallocation
1649     event falls within some other programmer's code. You are also
1650     responsible for ensuring that deletion is timely (i.e. not too
1651     soon, not too late). This is known as "low-coupling" and is a
1652     "good thing (tm)". You may need to offer a
1653     free/unload/destuctor type function to accommodate this.</para>
1654
1655     <para><emphasis>Example:</emphasis></para>
1656 <programlisting>
1657 int load_re_filterfile( struct client_state *csp ) { ... }
1658 static void unload_re_filterfile( void *f ) { ... }</programlisting>
1659
1660     <para><emphasis>Exceptions:</emphasis></para>
1661
1662     <para>The developer cannot be expected to provide `free'ing
1663     functions for C run-time library functions ... such as
1664     `strdup'.</para>
1665
1666     <para><emphasis>Status:</emphasis> developer-discretion. The "main" use of this
1667     standard is for allocating and freeing data structures (complex
1668     or nested).</para>
1669
1670     
1671   </sect3>
1672     
1673
1674     <sect3 id="s44"><title>Add loaders to the `file_list' structure
1675     and in order</title>
1676
1677     <para><emphasis>Explanation:</emphasis></para>
1678
1679     <para>I have ordered all of the "blocker" file code to be in alpha
1680     order. It is easier to add/read new blockers when you expect a
1681     certain order.</para>
1682
1683     <para><emphasis>Note:</emphasis> It may appear that the alpha order is broken in
1684     places by POPUP tests coming before PCRS tests. But since
1685     POPUPs can also be referred to as KILLPOPUPs, it is clear that
1686     it should come first.</para>
1687
1688     
1689   </sect3>
1690     
1691
1692     <sect3 id="s45"><title>"Uncertain" new code and/or changes to
1693     existing code, use FIXME</title>
1694
1695     <para><emphasis>Explanation:</emphasis></para>
1696
1697     <para>If you have enough confidence in new code or confidence in
1698     your changes, but are not *quite* sure of the repercussions,
1699     add this:</para>
1700
1701     <para>/* FIXME: this code has a logic error on platform XYZ, *
1702     attempting to fix */ #ifdef PLATFORM ...changed code here...
1703     #endif</para>
1704
1705     <para>or:</para>
1706
1707     <para>/* FIXME: I think the original author really meant this...
1708     */ ...changed code here...</para>
1709
1710     <para>or:</para>
1711
1712     <para>/* FIXME: new code that *may* break something else... */
1713     ...new code here...</para>
1714
1715     <para><emphasis>Note:</emphasis> If you make it clear that this may or may not
1716     be a "good thing (tm)", it will be easier to identify and
1717     include in the project (or conversely exclude from the
1718     project).</para>
1719
1720     
1721   </sect3>
1722
1723   </sect2>
1724
1725     <sect2 id="s46"><title>Addendum: Template for files and function
1726     comment blocks:</title>
1727
1728     <para><emphasis>Example for file comments:</emphasis></para>
1729 <programlisting>
1730 const char FILENAME_rcs[] = "$Id: developer-manual.sgml,v 1.46 2002/05/22 17:15:00 oes Exp $";
1731 /*********************************************************************
1732  *
1733  * File        :  $S<!-- Break CVS Substitution -->ource$
1734  *
1735  * Purpose     :  (Fill me in with a good description!)
1736  *
1737  * Copyright   :  Written by and Copyright (C) 2001 the SourceForge
1738  *                Privoxy team. http://www.privoxy.org/
1739  *
1740  *                Based on the Internet Junkbuster originally written
1741  *                by and Copyright (C) 1997 Anonymous Coders and
1742  *                Junkbusters Corporation.  http://www.junkbusters.com
1743  *
1744  *                This program is free software; you can redistribute it
1745  *                and/or modify it under the terms of the GNU General
1746  *                Public License as published by the Free Software
1747  *                Foundation; either version 2 of the License, or (at
1748  *                your option) any later version.
1749  *
1750  *                This program is distributed in the hope that it will
1751  *                be useful, but WITHOUT ANY WARRANTY; without even the
1752  *                implied warranty of MERCHANTABILITY or FITNESS FOR A
1753  *                PARTICULAR PURPOSE.  See the GNU General Public
1754  *                License for more details.
1755  *
1756  *                The GNU General Public License should be included with
1757  *                this file.  If not, you can view it at
1758  *                http://www.gnu.org/copyleft/gpl.html
1759  *                or write to the Free Software Foundation, Inc., 59
1760  *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
1761  *
1762  * Revisions   :
1763  *    $L<!-- Break CVS Substitution -->og$
1764  *
1765  *********************************************************************/
1766
1767
1768 #include "config.h"
1769
1770    ...necessary include files for us to do our work...
1771
1772 const char FILENAME_h_rcs[] = FILENAME_H_VERSION;
1773 </programlisting>
1774
1775     <para><emphasis>Note:</emphasis> This declares the rcs variables that should be
1776     added to the "show-proxy-args" page. If this is a brand new
1777     creation by you, you are free to change the "Copyright" section
1778     to represent the rights you wish to maintain.</para>
1779
1780     <para><emphasis>Note:</emphasis> The formfeed character that is present right
1781     after the comment flower box is handy for (X|GNU)Emacs users to
1782     skip the verbiage and get to the heart of the code (via
1783     `forward-page' and `backward-page'). Please include it if you
1784     can.</para>
1785
1786     <para><emphasis>Example for file header comments:</emphasis></para>
1787 <programlisting>
1788 #ifndef _FILENAME_H
1789 #define _FILENAME_H
1790 #define FILENAME_H_VERSION "$Id: developer-manual.sgml,v 1.46 2002/05/22 17:15:00 oes Exp $"
1791 /*********************************************************************
1792  *
1793  * File        :  $S<!-- Break CVS Substitution -->ource$
1794  *
1795  * Purpose     :  (Fill me in with a good description!)
1796  *
1797  * Copyright   :  Written by and Copyright (C) 2001 the SourceForge
1798  *                Privoxy team. http://www.privoxy.org/
1799  *
1800  *                Based on the Internet Junkbuster originally written
1801  *                by and Copyright (C) 1997 Anonymous Coders and
1802  *                Junkbusters Corporation.  http://www.junkbusters.com
1803  *
1804  *                This program is free software; you can redistribute it
1805  *                and/or modify it under the terms of the GNU General
1806  *                Public License as published by the Free Software
1807  *                Foundation; either version 2 of the License, or (at
1808  *                your option) any later version.
1809  *
1810  *                This program is distributed in the hope that it will
1811  *                be useful, but WITHOUT ANY WARRANTY; without even the
1812  *                implied warranty of MERCHANTABILITY or FITNESS FOR A
1813  *                PARTICULAR PURPOSE.  See the GNU General Public
1814  *                License for more details.
1815  *
1816  *                The GNU General Public License should be included with
1817  *                this file.  If not, you can view it at
1818  *                http://www.gnu.org/copyleft/gpl.html
1819  *                or write to the Free Software Foundation, Inc., 59
1820  *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
1821  *
1822  * Revisions   :
1823  *    $L<!-- Break CVS Substitution -->og$
1824  *
1825  *********************************************************************/
1826
1827
1828 #include "project.h"
1829
1830 #ifdef __cplusplus
1831 extern "C" {
1832 #endif
1833
1834    ... function headers here ...
1835
1836
1837 /* Revision control strings from this header and associated .c file */
1838 extern const char FILENAME_rcs[];
1839 extern const char FILENAME_h_rcs[];
1840
1841
1842 #ifdef __cplusplus
1843 } /* extern "C" */
1844 #endif
1845
1846 #endif /* ndef _FILENAME_H */
1847
1848 /*
1849   Local Variables:
1850   tab-width: 3
1851   end:
1852 */
1853 </programlisting>
1854
1855     <para><emphasis>Example for function comments:</emphasis></para>
1856 <programlisting>
1857 /*********************************************************************
1858  *
1859  * Function    :  FUNCTION_NAME
1860  *
1861  * Description :  (Fill me in with a good description!)
1862  *
1863  * parameters  :
1864  *          1  :  param1 = pointer to an important thing
1865  *          2  :  x      = pointer to something else
1866  *
1867  * Returns     :  0 => Ok, everything else is an error.
1868  *
1869  *********************************************************************/
1870 int FUNCTION_NAME( void *param1, const char *x )
1871 {
1872    ...
1873    return( 0 );
1874
1875 }
1876 </programlisting>
1877
1878     <para><emphasis>Note:</emphasis> If we all follow this practice, we should be
1879     able to parse our code to create a "self-documenting" web
1880     page.</para>
1881
1882   </sect2>
1883
1884   </sect1>
1885
1886   <!--   ~~~~~       New section      ~~~~~     -->
1887   <sect1 id="testing"><title>Testing Guidelines</title>
1888     <para>To be filled.
1889 </para>
1890
1891     <!--   ~~~~~       New section      ~~~~~     -->
1892     <sect2 id="testing-plan"><title>Testplan for releases</title>
1893       <para>
1894        Explain release numbers. major, minor. developer releases. etc.
1895
1896 <orderedlist numeration="arabic">
1897           <listitem><para>
1898 Remove any existing rpm with rpm -e
1899 </para></listitem>
1900           <listitem><para>
1901 Remove any file that was left over. This includes (but is not limited to)
1902       <itemizedlist>
1903                 <listitem><para>/var/log/privoxy</para></listitem>
1904                 <listitem><para>/etc/privoxy</para></listitem>
1905                 <listitem><para>/usr/sbin/privoxy</para></listitem>
1906                 <listitem><para>/etc/init.d/privoxy</para></listitem>
1907                 <listitem><para>/usr/doc/privoxy*</para></listitem>
1908               </itemizedlist>
1909 </para></listitem>
1910           <listitem><para>
1911 Install the rpm. Any error messages?
1912 </para></listitem>
1913           <listitem><para>start,stop,status <application>Privoxy</application> with the specific script
1914       (e.g. /etc/rc.d/init/privoxy stop). Reboot your machine. Does
1915       autostart work?</para></listitem>
1916           <listitem><para>Start browsing. Does <application>Privoxy</application> work? Logfile written?</para></listitem>
1917           <listitem><para>Remove the rpm. Any error messages? All files removed?</para></listitem>
1918         </orderedlist>
1919 </para>
1920     </sect2>
1921
1922     <!--   ~~~~~       New section      ~~~~~     -->
1923     <sect2 id="testing-report"><title>Test reports</title>
1924       <para>
1925 Please submit test reports only with the <ulink url="http://sourceforge.net/tracker/?func=add&amp;group_id=11118&amp;atid=395005">test form</ulink>
1926 at sourceforge. Three simple steps:
1927         <itemizedlist>
1928           
1929           <listitem><para>Select category: the distribution you test on.</para></listitem>
1930           <listitem><para>Select group: the version of <application>Privoxy</application> that we are about to release.</para></listitem>
1931           <listitem><para>Fill the Summary and Detailed Description with something
1932               intelligent (keep it short and precise).</para>
1933           </listitem>
1934         </itemizedlist>
1935         Do not mail to the mailinglist (we cannot keep track on issues there).
1936       </para>
1937     </sect2>
1938     
1939   </sect1>
1940
1941   <!--   ~~~~~       New section      ~~~~~     -->
1942   <sect1 id="newrelease"><title>Releasing a New Version</title>
1943     <para>
1944         When we release versions of <application>Privoxy</application>,
1945         our work leaves our cozy secret lab and has to work in the cold
1946         RealWorld[tm]. Once it is released, there is no way to call it
1947         back, so it is very important that great care is taken to ensure
1948         that everything runs fine, and not to introduce problems in the
1949         very last minute.
1950     </para>
1951     <para>
1952         So when releasing a new version, please adhere exactly to the
1953         procedure outlined in this chapter.
1954     </para>
1955
1956     <para>
1957         The following programs are required to follow this process:
1958         <filename>ncftpput</filename> (ncftp), <filename>scp, ssh</filename> (ssh),
1959         <filename>gmake</filename> (GNU's version of make), autoconf, cvs.
1960     </para>
1961
1962     <sect2 id="versionnumbers">
1963     <title>Version numbers</title>
1964
1965     <para>
1966       First you need to determine which version number the release will have. 
1967       <application>Privoxy</application> version numbers consist of three numbers,
1968       separated by dots, like in X.Y.Z, where:
1969         <itemizedlist>
1970           <listitem>
1971             <para>
1972               X, the version major, is rarely ever changed. It is increased by one if
1973               turning a development branch into stable substantially changes the functionality,
1974               user interface or configuration syntax. Majors 1 and 2 were 
1975               <application>Junkbuster</application>, and 3 will be the first stable
1976               <application>Privoxy</application> release.
1977             </para>
1978           </listitem>
1979           <listitem>
1980             <para>
1981               Y, the version minor, represents the branch within the major version.
1982               At any point in time, there are two branches being maintained:
1983               The stable branch, with an even minor, say, 2N, in which no functionality is
1984               being added and only bugfixes are made, and 2N+1, the development branch, in
1985               which the further development of <application>Privoxy</application> takes
1986               place.
1987               This enables us to turn the code upside down and inside out, while at the same time
1988               providing and maintaining a stable version.
1989               The minor is reset to zero (and one) when the major is inrcemented. When a development
1990               branch has matured to the point where it can be turned into stable, the old stable branch
1991               2N is given up (i.e. no longer maintained), the former development branch 2N+1 becomes the
1992               new stable branch 2N+2, and a new development branch 2N+3 is opened.
1993             </para>
1994           </listitem>
1995           <listitem>
1996             <para>
1997               Z, the point or sub version, represents a release of the software within a branch.
1998               It is therefore incremented immediately before each code freeze. 
1999               In development branches, only the even point versions correspond to actual releases,
2000               while the odd ones denote the evolving state of the sources on CVS in between.
2001               It follows that Z is odd on CVS in development branches most of the time. There, it gets
2002               increased to an even number immediately before a code freeze, and is increased to an odd
2003               number again immediately thereafter.
2004               This ensures that builds from CVS snapshots are easily distinguished from released versions.
2005               The point version is reset to zero when the minor changes.
2006             </para>
2007           </listitem>
2008         </itemizedlist>
2009     </para>
2010
2011     </sect2>
2012      
2013     <sect2 id="beforerelease">
2014     <title>Before the Release: Freeze</title>
2015      <para>
2016        The following <emphasis>must be done by one of the
2017        developers</emphasis> prior to each new release.
2018      </para>
2019      <para>
2020       <itemizedlist>
2021        <listitem>
2022         <para>
2023          Make sure that everybody who has worked on the code in the last
2024          couple of days has had a chance to yell <quote>no!</quote> in case
2025          they have pending changes/fixes in their pipelines. Announce the
2026          freeze so that nobody will interfere with last minute changes.
2027         </para>
2028       </listitem> 
2029       <listitem>
2030        <para>
2031          Increment the version number (point from odd to even in development
2032          branches!) in <filename>configure.in</filename>.
2033        </para>
2034       </listitem> 
2035       <listitem>
2036        <para>
2037         If <filename>default.action</filename> has changed since last
2038         release (i.e. software release or standalone actions file release),
2039         bump up its version info to A.B in this line:
2040        </para>
2041        <para> 
2042         <programlisting>
2043   {+add-header{X-Actions-File-Version: A.B} -filter -no-popups}
2044 </programlisting>
2045        </para>
2046        <para> 
2047         Then change the version info in doc/webserver/actions/index.php,
2048         line: '$required_actions_file_version = "A.B";'
2049        </para>
2050       </listitem>
2051       <listitem>
2052        <para>
2053         If the HTML documentation is not in sync with the SGML sources
2054         you need to regenerate and upload it to the webserver. (If in
2055         doubt, just do it.) See the Section "Updating the webserver" in
2056         this manual for details.
2057        </para>
2058       </listitem> 
2059       <listitem>
2060        <para>
2061         <emphasis>Commit all files that were changed in the above steps!</emphasis>
2062        </para>
2063       </listitem>
2064       <listitem>
2065        <para>
2066         Tag all files in CVS with the version number with
2067         <quote><command>cvs tag v_X_Y_Z</command></quote>.
2068         Don't use vX_Y_Z, ver_X_Y_Z, v_X.Y.Z (won't work) etc.
2069        </para>
2070       </listitem> 
2071      <listitem>
2072        <para>
2073         If the release was in a development branch, increase the point version
2074         from even to odd (X.Y.(Z+1)) again in <filename>configure.in</filename> and
2075         commit your change.
2076        </para>
2077       </listitem> 
2078      <listitem>
2079        <para>
2080         On the webserver, copy the user manual to a new top-level directory
2081         called <filename>X.Y.Z</filename>. This ensures that help links from the CGI
2082         pages, which have the version as a prefix, will go into the right version of the manual.
2083         If this is a development branch release, also symlink <filename>X.Y.(Z-1)</filename>
2084         to <filename>X.Y.Z</filename> and <filename>X.Y.(Z+1)</filename> to
2085         <filename>.</filename> (i.e. dot). 
2086        </para>
2087       </listitem> 
2088       </itemizedlist>
2089      </para> 
2090     </sect2>
2091     
2092     <sect2 id="therelease">
2093     <title>Building and Releasing the Packages</title>
2094      <para>
2095       Now the individual packages can be built and released. Note that for
2096       GPL reasons the first package to be released is always the source tarball.
2097      </para>
2098  
2099      <para>
2100       For <emphasis>all</emphasis> types of packages, including the source tarball,
2101       <emphasis>you must make sure that you build from clean sources by exporting
2102       the right version from CVS into an empty directory:</emphasis>.
2103      </para>
2104       
2105      <para>
2106       <programlisting>
2107   mkdir dist # delete or choose different name if it already exists
2108   cd dist
2109   cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
2110   cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa export -r v_X_Y_Z current
2111 </programlisting>
2112     </para>
2113   
2114     <para>
2115      <emphasis>Do NOT change</emphasis> a single bit, including, but not limited to
2116      version information after export from CVS. This is to make sure that
2117      all release packages, and with them, all future bug reports, are based
2118      on exactly the same code.
2119     </para>
2120   
2121     <para>
2122      Please find additional instructions for the source tarball and the
2123      individual platform dependent binary packages below. And details 
2124      on the Sourceforge release process below that.
2125     </para>
2126
2127     <sect3 id="pack-guidelines">
2128     <title>Note on Privoxy Packaging</title>
2129      <para>
2130       Please keep these general guidelines in mind when putting together 
2131       your package. These apply to <emphasis>all</emphasis> platforms!
2132      </para>
2133      <para>
2134       <itemizedlist>
2135        <listitem>
2136         <para>
2137           <application>Privoxy</application> <emphasis>requires</emphasis>
2138           write access to: all <filename>*.action</filename> files, all 
2139           logfiles, and the <filename>trust</filename> file. You will 
2140           need to determine the best way to do this for your platform.
2141         </para>
2142        </listitem> 
2143        <listitem>
2144         <para>
2145           Please include up to date documentation. At a bare minimum:
2146         </para>
2147         <simplelist>
2148          <member>
2149           <filename>LICENSE</filename> (toplevel directory)
2150          </member>
2151         </simplelist>
2152         <simplelist>
2153          <member>
2154           <filename>README</filename> (toplevel directory)
2155          </member>
2156         </simplelist>
2157         <simplelist>
2158          <member>
2159           <filename>AUTHORS</filename> (toplevel directory)
2160          </member>
2161         </simplelist>
2162         <simplelist>
2163          <member>
2164           <filename>man page</filename> (toplevel directory, Unix-like
2165           platforms only)
2166          </member>
2167         </simplelist>
2168         <simplelist>
2169          <member>
2170           <filename>The User Manual</filename> (doc/webserver/user-manual/)
2171          </member>
2172         </simplelist>
2173         <simplelist>
2174          <member>
2175           <filename>FAQ</filename> (doc/webserver/faq/)
2176          </member>
2177         </simplelist>
2178         <para>
2179           Also suggested: <filename>Developer Manual</filename>
2180           (doc/webserver/devel-manual) and <filename>ChangeLog</filename>
2181           (toplevel directory). <filename>FAQ</filename> and the manuals are
2182           HTML docs. There are also text versions in
2183           <filename>doc/text/</filename> which could conceivably also be
2184           included.
2185         </para>
2186         <para>
2187          The documentation has been designed such that the manuals are linked
2188          to each other from parallel directories, and should be packaged 
2189          that way. <filename>index.html</filename> can also be included and 
2190          can serve as a focal point for docs and other links of interest.
2191          This should be one level up from the manuals. There are two 
2192          css stylesheets that can be included for better presentation:
2193          <filename>p_doc.css</filename> and <filename>p_web.css</filename>.
2194          These should be in the same directory with
2195          <filename>index.html</filename>, (i.e. one level up from the manual 
2196          directories).
2197         </para>
2198       </listitem> 
2199       <listitem>
2200        <para>
2201         <filename>user.action</filename> is designed for local preferences. 
2202         Make sure this does not get overwritten!
2203        </para>
2204       </listitem> 
2205       <listitem>
2206        <para>
2207         Other configuration files should be installed as the new defaults, 
2208         but all previously installed configuration files should be preserved
2209         as backups. This is just good manners :-)
2210        </para>
2211      </listitem> 
2212      <listitem>
2213       <para>
2214        Please check platform specific notes in this doc, if you haven't 
2215        done <quote>Privoxy</quote> packaging before for other platform 
2216        specific issues. Conversely, please add any notes that you know 
2217        are important for your platform (or contact one of the doc 
2218        maintainers to do this if you can't).
2219       </para>
2220     </listitem> 
2221
2222       </itemizedlist>
2223      </para> 
2224     
2225     </sect3>
2226
2227     <sect3 id="newrelease-tarball"><title>Source Tarball</title>
2228         <para>
2229         First, <emphasis>make sure that you have freshly exported the right
2230         version into an empty directory</emphasis>. (See "Building and releasing
2231         packages" above). Then run:
2232         </para>
2233         <para>
2234         <programlisting>
2235   cd current
2236   autoheader && autoconf && ./configure
2237 </programlisting>
2238         </para>
2239         <para>
2240         Then do:
2241         </para>
2242         <para>
2243         <programlisting>
2244   make tarball-dist
2245 </programlisting>
2246         </para>
2247         <para>
2248         To upload the package to Sourceforge, simply issue
2249         </para>
2250         <para>
2251         <programlisting>
2252   make tarball-upload
2253 </programlisting>
2254         </para>
2255         <para>
2256         Go to the displayed URL and release the file publicly on Sourceforge.
2257         For the change log field, use the relevant section of the
2258         <filename>ChangeLog</filename> file.
2259       </para>
2260     </sect3>
2261
2262     <sect3 id="newrelease-rpm"><title>SuSE, Conectiva or Red Hat RPM</title>
2263         <para>
2264         In following text, replace <replaceable class="parameter">dist</replaceable>
2265         with either <quote>rh</quote> for Red Hat or <quote>suse</quote> for SuSE.
2266         </para>
2267         <para>
2268         First, <emphasis>make sure that you have freshly exported the right
2269         version into an empty directory</emphasis>. (See "Building and releasing
2270         packages" above). 
2271         </para>
2272         <para>
2273         As the only exception to not changing anything after export from CVS,
2274         now examine the file <filename>privoxy-</filename><replaceable class="parameter">dist</replaceable><filename>.spec</filename>
2275         and make sure that the version information and the RPM release number are
2276         correct. The RPM release numbers for each version start at one. Hence it must
2277         be reset to one if this is the first RPM for
2278         <replaceable class="parameter">dist</replaceable> which is built from version
2279         X.Y.Z. Check the
2280         <ulink url="http://sourceforge.net/project/showfiles.php?group_id=11118">file
2281         list</ulink> if unsure. Else, it must be set to the highest already available RPM
2282         release number for that version plus one.
2283         </para>
2284         <para>
2285         Then run:
2286         </para>
2287         <para>
2288         <programlisting>
2289   cd current
2290   autoheader && autoconf && ./configure
2291 </programlisting>
2292         </para>
2293         <para>
2294         Then do
2295         </para>
2296         <para>
2297         <programlisting>
2298   make <replaceable class="parameter">dist</replaceable>-dist
2299 </programlisting>
2300         </para>
2301         <para>
2302         To upload the package to Sourceforge, simply issue
2303         </para>
2304         <para>
2305         <programlisting>
2306   make <replaceable class="parameter">dist</replaceable>-upload <replaceable class="parameter">rpm_packagerev</replaceable>
2307 </programlisting>
2308         </para>
2309         <para>
2310         where <replaceable class="parameter">rpm_packagerev</replaceable> is the
2311         RPM release number as determined above.
2312         Go to the displayed URL and release the file publicly on Sourceforge.
2313         Use the release notes and change log from the source tarball package.
2314       </para>
2315     </sect3>
2316
2317     <sect3 id="newrelease-os2"><title>OS/2</title>
2318       <para>
2319         First, <emphasis>make sure that you have freshly exported the right
2320         version into an empty directory</emphasis>. (See "Building and releasing
2321         packages" above). Then get the OS/2 Setup module:
2322         </para>
2323         <para>
2324         <programlisting>
2325   cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co os2setup
2326 </programlisting>
2327         </para>
2328         <para>
2329         You will need a mix of development tools.
2330         The main compilation takes place with IBM Visual Age C++.
2331         Some ancillary work takes place with GNU tools, available from
2332         various sources like hobbes.nmsu.edu.
2333         Specificially, you will need <filename>autoheader</filename>,
2334         <filename>autoconf</filename> and <filename>sh</filename> tools.
2335         The packaging takes place with WarpIN, available from various sources, including
2336         its home page: <ulink url="http://www.xworkplace.org/">xworkplace</ulink>.
2337         </para>
2338         <para>
2339         Change directory to the <filename>os2setup</filename> directory.
2340         Edit the os2build.cmd file to set the final executable filename.
2341         For example, 
2342         </para>
2343         <para>
2344         <programlisting>
2345   installExeName='privoxyos2_setup_X.Y.Z.exe'
2346 </programlisting>
2347         </para>
2348         <para>
2349         Next, edit the <filename>IJB.wis</filename> file so the release number matches
2350         in the <filename>PACKAGEID</filename> section:
2351         </para>
2352         <para>
2353         <programlisting>
2354   PACKAGEID="Privoxy Team\Privoxy\Privoxy Package\X\Y\Z"
2355 </programlisting>
2356         </para>
2357         <para>
2358         You're now ready to build.  Run:
2359         </para>
2360         <para>
2361         <programlisting>
2362   os2build
2363 </programlisting>
2364         </para>
2365         <para>
2366          You will find the  WarpIN-installable executable in the
2367         <filename>./files</filename> directory. Upload this anonymously to
2368          <filename>uploads.sourceforge.net/incoming</filename>, create a release
2369          for it, and you're done. Use the release notes and Change Log from the
2370          source tarball package.
2371         </para>
2372     </sect3>
2373
2374     <sect3 id="newrelease-solaris"><title>Solaris</title>
2375       <para>
2376         Login to Sourceforge's compilefarm via ssh:
2377         </para>
2378         <para>
2379         <programlisting>
2380   ssh cf.sourceforge.net
2381 </programlisting>
2382         </para>
2383         <para>
2384         Choose the right operating system (not the Debian one).
2385         When logged in, <emphasis>make sure that you have freshly exported the right
2386         version into an empty directory</emphasis>. (See "Building and releasing
2387         packages" above). Then run:
2388         </para>
2389         <para>
2390         <programlisting>
2391   cd current
2392   autoheader && autoconf && ./configure
2393 </programlisting>
2394         </para>
2395         <para>
2396         Then run
2397         </para>
2398         <para>
2399         <programlisting>
2400   gmake solaris-dist
2401 </programlisting>
2402         </para>
2403         <para>
2404         which creates a gzip'ed tar archive. Sadly, you cannot use <command>make
2405         solaris-upload</command> on the Sourceforge machine (no ncftpput). You now have
2406         to manually upload the archive to Sourceforge's ftp server and release
2407         the file publicly. Use the release notes and Change Log from the
2408         source tarball package.
2409         </para>
2410     </sect3>
2411
2412     <sect3 id="newrelease-windows"><title>Windows</title>
2413       <para>
2414         You should ensure you have the latest version of Cygwin (from
2415         <ulink url="http://www.cygwin.com/">http://www.cygwin.com/</ulink>).
2416         Run the following commands from within a Cygwin bash shell.
2417       </para>
2418       <para>
2419         First, <emphasis>make sure that you have freshly exported the right
2420         version into an empty directory</emphasis>. (See "Building and releasing
2421         packages" above). Then get the Windows setup module:
2422       </para>
2423       <para>
2424       <programlisting>
2425         cvs -z3  -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co winsetup
2426 </programlisting>
2427       </para>
2428       <para>
2429         Then you can build the package.  This is fully automated, and is
2430         controlled by <filename>winsetup/GNUmakefile</filename>.
2431         All you need to do is:
2432       </para>
2433       <para>
2434       <programlisting>
2435         cd winsetup
2436         make
2437 </programlisting>
2438       </para>
2439       <para>
2440         Now you can manually rename <filename>privoxy_setup.exe</filename> to
2441         <filename>privoxy_setup_X_Y_Z.exe</filename>, and upload it to
2442         SourceForge. When releasing the package on SourceForge, use the release notes
2443         and Change Log from the source tarball package.
2444       </para>
2445     </sect3>
2446
2447     <sect3 id="newrelease-debian"><title>Debian</title>
2448       <para>
2449         First, <emphasis>make sure that you have freshly exported the right
2450         version into an empty directory</emphasis>. (See "Building and releasing
2451         packages" above). Then, run:
2452       </para>
2453       <para>
2454         <programlisting>
2455   cd current
2456   autoheader && autoconf && ./configure
2457 </programlisting>
2458       </para>
2459       <para>
2460         Then, run:
2461       </para>
2462       <para>
2463         <programlisting>
2464   make debian-dist
2465 </programlisting>
2466       </para>
2467       <para>
2468         To upload the package to Sourceforge, simply issue
2469       </para>
2470       <para>
2471         <programlisting>
2472   make debian-upload
2473 </programlisting>
2474       </para>
2475     </sect3>
2476
2477     <sect3 id="newrelease-macosx"><title>Mac OSX</title>
2478       <para>
2479         First, <emphasis>make sure that you have freshly exported the right
2480         version into an empty directory</emphasis>. (See "Building and releasing
2481         packages" above). Then get the Mac OSX setup module:
2482         </para>
2483         <para>
2484         <programlisting>
2485   cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co osxsetup
2486 </programlisting>
2487         </para>
2488         <para>
2489         Then run:
2490         </para>
2491         <para>
2492         <programlisting>
2493   cd osxsetup
2494   build
2495 </programlisting>
2496         </para>
2497         <para>
2498         This will run <filename>autoheader</filename>, <filename>autoconf</filename> and
2499         <filename>configure</filename> as well as <filename>make</filename>.
2500         Finally, it will copy over the necessary files to the ./osxsetup/files directory
2501         for further processing by <filename>PackageMaker</filename>.
2502         </para>
2503         <para>
2504         Bring up PackageMaker with the PrivoxyPackage.pmsp definition file, modify the package
2505         name to match the release, and hit the "Create package" button.
2506         If you specify ./Privoxy.pkg as the output package name, you can then create
2507         the distributable zip file with the command:
2508         </para>
2509         <para>
2510         <programlisting>
2511 zip -r privoxyosx_setup_x.y.z.zip Privoxy.pkg
2512 </programlisting>
2513         </para>
2514         <para>
2515         You can then upload <filename>privoxyosx_setup_x.y.z.zip</filename> anonymously to 
2516         <filename>uploads.sourceforge.net/incoming</filename>,
2517         create a release for it, and you're done. Use the release notes
2518         and Change Log from the source tarball package.
2519         </para>
2520     </sect3>
2521
2522     <sect3 id="newrelease-freebsd"><title>FreeBSD</title>
2523       <para>
2524         Login to Sourceforge's compilefarm via ssh:
2525         </para>
2526         <para>
2527         <programlisting>
2528   ssh cf.sourceforge.net
2529 </programlisting>
2530         </para>
2531         <para>
2532         Choose the right operating system.
2533         When logged in, <emphasis>make sure that you have freshly exported the right
2534         version into an empty directory</emphasis>. (See "Building and releasing
2535         packages" above). Then run:
2536         </para>
2537         <para>
2538         <programlisting>
2539   cd current
2540   autoheader && autoconf && ./configure
2541 </programlisting>
2542         </para>
2543         <para>
2544         Then run:
2545         </para>
2546         <para>
2547         <programlisting>
2548   gmake freebsd-dist
2549 </programlisting>
2550         </para>
2551         <para>
2552         which creates a gzip'ed tar archive. Sadly, you cannot use <command>make
2553         freebsd-upload</command> on the Sourceforge machine (no ncftpput). You now have
2554         to manually upload the archive to Sourceforge's ftp server and release
2555         the file publicly. Use the release notes and Change Log from the
2556         source tarball package.
2557         </para>
2558     </sect3>
2559
2560     <sect3 id="newrelease-hpux"><title>HP-UX 11</title>
2561       <para>
2562         First, <emphasis>make sure that you have freshly exported the right
2563         version into an empty directory</emphasis>. (See "Building and releasing
2564         packages" above). Then run:
2565         </para>
2566         <para>
2567         <programlisting>
2568   cd current
2569   autoheader && autoconf && ./configure
2570 </programlisting>
2571         </para>
2572         <para>
2573         Then do FIXME.
2574         </para>
2575     </sect3>
2576
2577     <sect3 id="newrelease-amiga"><title>Amiga OS</title>
2578       <para>
2579         First, <emphasis>make sure that you have freshly exported the right
2580         version into an empty directory</emphasis>. (See "Building and releasing
2581         packages" above). Then run:
2582         </para>
2583         <para>
2584         <programlisting>
2585   cd current
2586   autoheader && autoconf && ./configure
2587 </programlisting>
2588         </para>
2589         <para>
2590         Then do FIXME.
2591         </para>
2592     </sect3>
2593
2594     <sect3 id="newrelease-aix"><title>AIX</title>
2595       <para>
2596         Login to Sourceforge's compilefarm via ssh:
2597         </para>
2598         <para>
2599         <programlisting>
2600   ssh cf.sourceforge.net
2601 </programlisting>
2602         </para>
2603         <para>
2604         Choose the right operating system.
2605         When logged in, <emphasis>make sure that you have freshly exported the right
2606         version into an empty directory</emphasis>. (See "Building and releasing
2607         packages" above). Then run:
2608         </para>
2609         <para>
2610         <programlisting>
2611   cd current
2612   autoheader && autoconf && ./configure
2613 </programlisting>
2614         </para>
2615         <para>
2616         Then run:
2617         </para>
2618         <para>
2619         <programlisting>
2620   make aix-dist
2621 </programlisting>
2622         </para>
2623         <para>
2624         which creates a gzip'ed tar archive. Sadly, you cannot use <command>make
2625         aix-upload</command> on the Sourceforge machine (no ncftpput). You now have
2626         to manually upload the archive to Sourceforge's ftp server and release
2627         the file publicly. Use the release notes and Change Log from the
2628         source tarball package.
2629         </para>
2630     </sect3>
2631    </sect2>
2632
2633    <sect2 id="releasing">
2634    <title>Uploading and Releasing Your Package</title>
2635     <para>
2636       After the package is ready, it is time to upload it 
2637       to SourceForge, and go through the release steps. The upload
2638       is done via FTP:
2639     </para>
2640      <para>
2641       <itemizedlist>
2642        <listitem>
2643         <para>
2644           Upload to: <ulink url="ftp://upload.sourceforge.net/incoming">ftp://upload.sourceforge.net/incoming</ulink>
2645         </para>
2646       </listitem> 
2647       <listitem>
2648        <para>
2649          user: <literal>anonymous</literal>
2650        </para>
2651       </listitem> 
2652       <listitem>
2653        <para>
2654          password: <literal>ijbswa-developers@lists.sourceforge.net</literal>
2655        </para>
2656       </listitem> 
2657      </itemizedlist>
2658     </para> 
2659     <para>
2660      Or use the <command>make</command> targets as described above.
2661     </para>
2662     <para>
2663      Once this done go to <ulink url="http://sourceforge.net/project/admin/editpackages.php?group_id=11118">http://sourceforge.net/project/admin/editpackages.php?group_id=11118</ulink>, 
2664      making sure you are logged in. Find your target platform in the 
2665      second column, and click <literal>Add Release</literal>. You will 
2666      then need to create a new release for your package, using the format 
2667      of <literal>$VERSION ($CODE_STATUS)</literal>, e.g. <emphasis>&p-version;
2668      (beta)</emphasis>.
2669     </para>
2670     <para>
2671      Now just follow the prompts. Be sure to add any appropriate Release
2672      notes. You should see your freshly uploaded packages in 
2673      <quote>Step 2. Add Files To This Release</quote>. Check the 
2674      appropriate box(es). Remember at each step to hit the 
2675      <quote>Refresh/Submit</quote> buttons! You should now see your 
2676      file(s) listed in Step 3. Fill out the forms with the appropriate 
2677      information for your platform, being sure to hit <quote>Update</quote>
2678      for each file. If anyone is monitoring your platform, check the 
2679      <quote>email</quote> box at the very bottom to notify them of 
2680      the new package. This should do it!
2681     </para>
2682     <para>
2683      If you have made errors, or need to make changes, you can go through 
2684      essentially the same steps, but select <literal>Edit Release</literal>, 
2685      instead of <literal>Add Release</literal>.
2686     </para>
2687    </sect2>
2688
2689     <sect2 id="afterrelease">
2690     <title>After the Release</title>
2691      <para>
2692       When all (or: most of the) packages have been uploaded and made available,
2693       send an email to the <ulink url="mailto:ijbswa-announce@lists.sourceforge.net">announce
2694       mailing list</ulink>, Subject: "Version X.Y.Z available for download". Be sure to
2695       include the
2696       <ulink url="http://sourceforge.net/project/showfiles.php?group_id=11118">download
2697       location</ulink>, the release notes and the change log.
2698      </para>
2699    </sect2>
2700
2701   </sect1>
2702   
2703   <!--   ~~~~~       New section      ~~~~~     -->
2704   <sect1 id="webserver-update"><title>Update the Webserver</title>
2705    <para>
2706     When updating the webserver, please follow these steps to make
2707     sure that no broken links, incosistent contents or permission
2708     problems will occur:
2709    </para>
2710    <para>
2711     If you have changed anything in the documentation source SGML files,
2712     do:
2713    </para>
2714    <para>
2715     <programlisting>
2716   make dok # (or make redkat-dok if make dok doesn't work for you)
2717 </programlisting>
2718    </para>
2719    <para>
2720     That will generate <filename>doc/webserver/user-manual</filename>,
2721     <filename>doc/webserver/developer-manual</filename>,
2722     <filename>doc/webserver/faq</filename> and
2723     <filename>doc/webserver/index.html</filename> automatically.
2724    </para>
2725    <para>
2726     If you changed the manual page source, generate
2727     <filename>doc/webserver/man-page/privoxy-man-page.html</filename>
2728     by running <quote><command>make man</command></quote>. (This is
2729     a separate target due to dependencies on some obscure perl scripts. 
2730     See comments in <filename>GNUmakefile</filename>.)
2731    </para>
2732    <para>
2733     If you want to add new files to the webserver, create them locally in
2734     the <filename>doc/webserver/*</filename> directory (or
2735     create new directories under <filename>doc/webserver</filename>).
2736    </para>
2737    <para>
2738     Next, commit any changes from the above steps to CVS. All set? Then do
2739    </para>
2740    <para>
2741     <programlisting>
2742   make webserver
2743 </programlisting>
2744    </para>
2745    <para>
2746     This will do the upload to <ulink url="http://www.privoxy.org/">the
2747     webserver</ulink> (www.privoxy.org) and ensure all files and directories
2748     there are group writable.
2749    </para>
2750    <para>
2751     Please do <emphasis>NOT</emphasis> use any other means of transferring
2752     files to the webserver to avoid permission problems.
2753    </para>
2754   </sect1>
2755
2756   <!--   ~~~~~       New section      ~~~~~     -->
2757   <sect1 id="contact"><title>Contacting the developers, Bug Reporting and Feature Requests</title>
2758 <!-- Include contacting.sgml  -->
2759  &contacting;
2760 <!-- end contacting -->
2761   </sect1>
2762   
2763
2764 <!--   ~~~~~~~~       New section Header    ~~~~~~~~~     -->
2765 <sect1 id="copyright"><title>Privoxy Copyright, License and History</title>
2766
2767 <!-- Include copyright.sgml -->
2768  &copyright;
2769 <!-- end -->
2770
2771 <!--   ~~~~~       New section      ~~~~~     -->
2772 <sect2><title>License</title>
2773 <!-- Include copyright.sgml: -->
2774  &license;
2775 <!-- end copyright -->
2776 </sect2>
2777 <!--  ~  End section  ~  -->
2778
2779 <!--   ~~~~~       New section      ~~~~~     -->
2780 <sect2><title>History</title>
2781 <!-- Include history.sgml -->
2782  &history;
2783 <!-- end -->
2784 </sect2>
2785
2786 </sect1>
2787   
2788   <!--   ~~~~~       New section      ~~~~~     -->
2789   <sect1 id="seealso"><title>See also</title>
2790 <!-- Include seealso.sgml -->
2791  &seealso;
2792 <!-- end  -->
2793
2794   </sect1>
2795
2796   <!--
2797
2798   This program is free software; you can redistribute it 
2799   and/or modify it under the terms of the GNU General
2800   Public License as published by the Free Software
2801   Foundation; either version 2 of the License, or (at
2802   your option) any later version.
2803
2804   This program is distributed in the hope that it will
2805   be useful, but WITHOUT ANY WARRANTY; without even the
2806   implied warranty of MERCHANTABILITY or FITNESS FOR A
2807   PARTICULAR PURPOSE.  See the GNU General Public
2808   License for more details.
2809
2810   The GNU General Public License should be included with
2811   this file.  If not, you can view it at
2812   http://www.gnu.org/copyleft/gpl.html
2813   or write to the Free Software Foundation, Inc., 59
2814   Temple Place - Suite 330, Boston, MA  02111-1307, USA.
2815
2816   $Log: developer-manual.sgml,v $
2817   Revision 1.46  2002/05/22 17:15:00  oes
2818   Updated intro
2819
2820   Revision 1.45  2002/05/19 23:01:54  hal9
2821   Add small section on general packaging guidelines (e.g. actions files must
2822   be writable).
2823
2824   Revision 1.44  2002/05/15 03:55:17  hal9
2825   Fix ulink -> link, and minor modification to release process section for
2826   clarification.
2827
2828   Revision 1.43  2002/05/10 01:48:19  hal9
2829   This is mostly proposed copyright/licensing additions and changes. Docs
2830   are still GPL, but licensing and copyright are more visible. Also, copyright
2831   changed in doc header comments (eliminate references to JB except FAQ).
2832
2833   Revision 1.42  2002/05/05 20:26:02  hal9
2834   Sorting out license vs copyright in these docs.
2835
2836   Revision 1.41  2002/05/04 08:44:44  swa
2837   bumped version
2838
2839   Revision 1.40  2002/05/04 00:43:43  hal9
2840   -Remove TOC/first page kludge with proper stylesheet fix.
2841   -Combined the two very brief sections: Intro and Quickstart.
2842
2843   Revision 1.39  2002/05/02 15:08:25  oes
2844   Added explanation about version numbers and RPM package revisions
2845
2846   Revision 1.38  2002/04/29 02:20:31  hal9
2847   Add info on steps for uploading and the release process on SF.
2848
2849   Revision 1.37  2002/04/26 17:23:29  swa
2850   bookmarks cleaned, changed structure of user manual, screen and programlisting cleanups, and numerous other changes that I forgot
2851
2852   Revision 1.36  2002/04/26 05:25:23  hal9
2853   Mass commit to catch a few scattered fixes.
2854
2855   Revision 1.35  2002/04/17 15:16:15  oes
2856   Added link to docbook crash course
2857
2858   Revision 1.34  2002/04/15 23:39:32  oes
2859    - Extended & fixed the release section
2860    - Added CVS guideline sections
2861    - Separated webserver section from release section
2862    - Commented out boilerplate inclusion (If you don't know yet what it is,
2863      you shouldn't mess with its code ;-)
2864    - Nits & fixes
2865
2866   Revision 1.33  2002/04/12 03:49:53  hal9
2867   Spell checked. Clarification on where docs are kept.
2868
2869   Revision 1.32  2002/04/11 21:29:58  jongfoster
2870   Documenting Win32 release procedure
2871
2872   Revision 1.31  2002/04/11 09:32:52  oes
2873   more nits
2874
2875   Revision 1.30  2002/04/11 09:24:53  oes
2876   nits
2877
2878   Revision 1.29  2002/04/10 18:45:14  swa
2879   generated
2880
2881   Revision 1.28  2002/04/08 22:59:26  hal9
2882   Version update. Spell chkconfig correctly :)
2883
2884   Revision 1.27  2002/04/08 15:31:18  hal9
2885   Touch ups to documentation section.
2886
2887   Revision 1.26  2002/04/07 23:50:08  hal9
2888   Documentation changes to reflect HTML docs now in CVS, and new generated files
2889   list.
2890
2891   Revision 1.25  2002/04/06 05:07:28  hal9
2892   -Add privoxy-man-page.sgml, for man page.
2893   -Add authors.sgml for AUTHORS (and p-authors.sgml)
2894   -Reworked various aspects of various docs.
2895   -Added additional comments to sub-docs.
2896
2897   Revision 1.24  2002/04/04 21:33:37  hal9
2898   More on documenting the documents.
2899
2900   Revision 1.23  2002/04/04 18:46:47  swa
2901   consistent look. reuse of copyright, history et. al.
2902
2903   Revision 1.22  2002/04/04 17:27:56  swa
2904   more single file to be included at multiple points. make maintaining easier
2905
2906   Revision 1.21  2002/04/04 06:48:37  hal9
2907   Structural changes to allow for conditional inclusion/exclusion of content
2908   based on entity toggles, e.g. 'entity % p-not-stable  "INCLUDE"'. And
2909   definition of internal entities, e.g. 'entity p-version "2.9.13"' that will
2910   eventually be set by Makefile.
2911   More boilerplate text for use across multiple docs.
2912
2913   Revision 1.20  2002/04/04 03:28:27  david__schmidt
2914   Add Mac OSX section
2915
2916   Revision 1.19  2002/04/03 15:09:42  david__schmidt
2917   Add OS/2 build section
2918
2919   Revision 1.18  2002/04/03 03:51:48  hal9
2920   Touch ups.
2921
2922   Revision 1.17  2002/04/03 01:21:17  hal9
2923   Implementing Andreas's suggestions for Release sections.
2924
2925   Revision 1.16  2002/03/31 23:04:40  hal9
2926   Fleshed out the doc section, and added something for an intro so it was not
2927   blank.
2928
2929   Revision 1.15  2002/03/30 22:29:47  swa
2930   wrong make flavour
2931
2932   Revision 1.14  2002/03/30 19:04:08  swa
2933   people release differently. no good.
2934   I want to make parts of the docs only.
2935
2936   Revision 1.13  2002/03/27 01:16:41  hal9
2937   ditto
2938
2939   Revision 1.12  2002/03/27 01:02:51  hal9
2940   Touch up on name change...
2941
2942   Revision 1.11  2002/03/26 22:29:55  swa
2943   we have a new homepage!
2944
2945   Revision 1.10  2002/03/24 12:33:01  swa
2946   more additions.
2947
2948   Revision 1.9  2002/03/24 11:01:05  swa
2949   name change
2950
2951   Revision 1.8  2002/03/23 15:13:11  swa
2952   renamed every reference to the old name with foobar.
2953   fixed "application foobar application" tag, fixed
2954   "the foobar" with "foobar". left junkbustser in cvs
2955   comments and remarks to history untouched.
2956
2957   Revision 1.7  2002/03/11 13:13:27  swa
2958   correct feedback channels
2959
2960   Revision 1.6  2002/02/24 14:25:06  jongfoster
2961   Formatting changes.  Now changing the doctype to DocBook XML 4.1
2962   will work - no other changes are needed.
2963
2964   Revision 1.5  2001/10/31 18:16:51  swa
2965   documentation added: howto generate docs in text and html
2966   format, howto move stuff to the webserver.
2967
2968   Revision 1.4  2001/09/23 10:13:48  swa
2969   upload process established. run make webserver and
2970   the documentation is moved to the webserver. documents
2971   are now linked correctly.
2972
2973   Revision 1.3  2001/09/13 15:27:40  swa
2974   cosmetics
2975
2976   Revision 1.2  2001/09/13 15:20:17  swa
2977   merged standards into developer manual
2978
2979   Revision 1.1  2001/09/12 15:36:41  swa
2980   source files for junkbuster documentation
2981
2982   Revision 1.3  2001/09/10 17:43:59  swa
2983   first proposal of a structure.
2984
2985   Revision 1.2  2001/06/13 14:28:31  swa
2986   docs should have an author.
2987
2988   Revision 1.1  2001/06/13 14:20:37  swa
2989   first import of project's documentation for the webserver.
2990
2991   -->
2992
2993 </article>