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