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 SYSTEM "doc_version.tmp">
12 <!entity p-status SYSTEM "doc_status.tmp">
13 <!entity % p-not-stable "IGNORE">
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 "©"> <!-- kludge for docbook2man -->
20 File : $Source: /cvsroot/ijbswa/current/doc/source/developer-manual.sgml,v $
22 Purpose : developer manual
23 This file belongs into
24 ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/
26 $Id: developer-manual.sgml,v 2.1 2002/07/29 22:08:40 jongfoster Exp $
28 Copyright (C) 2001, 2002 Privoxy Developers <developers@privoxy.org>
31 ========================================================================
32 NOTE: Please read developer-manual/documentation.html before touching
33 anything in this, or other Privoxy documentation.
34 ========================================================================
40 <title>Privoxy Developer Manual</title>
43 <!-- Completely the wrong markup, but very little is allowed -->
44 <!-- in this part of an article. FIXME -->
45 <link linkend="copyright">Copyright</link> &my-copy; 2001, 2002 by
46 <ulink url="http://www.privoxy.org">Privoxy Developers</ulink>
51 <pubdate>$Id: developer-manual.sgml,v 1.46.2.8 2002/08/17 00:16:10 hal9 Exp $</pubdate>
55 Note: this should generate a separate page, and a live link to it.
56 But it doesn't for some mysterious reason. Please leave commented
57 unless it can be fixed proper. For the time being, the copyright
58 statement will be in copyright.smgl.
62 <legalnotice id="legalnotice">
64 text goes here ........
75 This is here to keep vim syntax file from breaking :/
76 If I knew enough to fix it, I would.
77 PLEASE DO NOT REMOVE! HB: hal@foobox.net
82 The developer manual provides guidance on coding, testing, packaging, documentation
83 and other issues of importance to those involved with
84 <application>Privoxy</application> development. It is mandatory (and helpful!) reading
85 for anyone who wants to join the team.
88 <!-- Include privoxy.sgml boilerplate text: -->
90 <!-- &p-intro; Someone interested enough in the project to contribute
91 will already know at this point what Privoxy is. -->
93 <!-- end boilerplate -->
96 Please note that this document is constantly evolving. This copy represents
97 the state at the release of version &p-version;.
98 You can find the latest version of the this manual at <ulink
99 url="http://www.privoxy.org/developer-manual/">http://www.privoxy.org/developer-manual/</ulink>.
100 Please see <link linkend="contact">the Contact section</link>
101 on how to contact the developers.
104 <!-- Feel free to send a note to the developers at <email>ijbswa-developers@lists.sourceforge.net</email>. -->
111 <!-- ~~~~~ New section ~~~~~ -->
112 <sect1 id="introduction"><title>Introduction</title>
115 I don't like seeing blank space :) So added *something* here.
119 <application>Privoxy</application>, as an heir to
120 <application>Junkbuster</application>, is an Open Source project
121 and licensed under the GPL. As such, <application>Privoxy</application>
122 development is potentially open to anyone who has the time, knowledge,
123 and desire to contribute in any capacity. Our goals are simply to
124 continue the mission, to improve <application>Privoxy</application>, and
125 to make it available to as wide an audience as possible.
128 One does not have to be a programmer to contribute. Packaging, testing,
129 and porting, are all important jobs as well.
132 <!-- ~~~~~ New section ~~~~~ -->
133 <sect2 id="quickstart"><title>Quickstart to Privoxy Development</title>
135 You'll need an account on <ulink
136 url="http://sourceforge.net/">Sourceforge</ulink> to support our
137 development. Mail your ID to <ulink
138 url="mailto:developers@privoxy.org">the list</ulink> and wait until a
139 project manager has added you.
142 You will also need to have a cvs package installed, which will
143 entail having ssh installed as well (which seems to be a requirement of
144 SourceForge), in order to access the cvs repository. Having the GNU build
145 tools is also going to be important (particularly, autoconf and gmake).
148 For the time being (read, this section is under construction), please
149 refer to the extensive comments in the source code.
154 <!-- ~~~~~ New section ~~~~~ -->
155 <sect1 id="cvs"><title>The CVS Repository</title>
157 If you intend to help us with programming, documentation or packaging
158 you will need write access to our holy grail, the CVS repository.
159 Please read this chapter completely before accessing via CVS.
162 <sect2 id="cvsaccess"><title>Access to CVS</title>
164 The project's CVS repository is hosted on
165 <ulink url="http://sourceforge.net/">SourceForge.</ulink>
166 Please refer to the chapters 6 and 7 in
167 <ulink url="http://sourceforge.net/docman/?group_id=1">SF's site
168 documentation</ulink> for the technical access details for your
169 operating system. For historical reasons, the CVS server is
170 called <literal>cvs.ijbswa.sourceforge.net</literal>, the repository is
171 called <literal>ijbswa</literal>, and the source tree module is called
172 <literal>current</literal>.
176 <sect2 id="cvsbranches">
177 <title>Branches</title>
179 Within the CVS repository, there are modules and branches. As
180 mentioned, the sources are in the <literal>current</literal>
181 <quote>module</quote>. Other modules are present for platform specific
182 issues. There is a webview of the CVS hierarchy at <ulink
183 url="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ijbswa/">http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ijbswa/</ulink>,
184 which might help with visualizing how these pieces fit together.
187 Branches are used to fork a sub-development path from the main trunk.
188 Within the <literal>current</literal> module where the sources are, there
189 is always at least one <quote>branch</quote> from the main trunk
190 devoted to a stable release series. The main trunk is where active
191 development takes place for the next stable series (e.g. 3.2.x).
192 So just prior to each stable series (e.g. 3.0.x), a branch is created
193 just for stable series releases (e.g. 3.0.0 -> 3.0.1 -> 3.0.2, etc).
194 Once the initial stable release of any stable branch has taken place,
195 this branch is <emphasis>only used for bugfixes</emphasis>, which have
196 had prior testing before being committed to CVS. (See <link
197 linkend="versionnumbers">Version Numbers</link> below for details on
202 <sect2 id="cvscommit"><title>CVS Commit Guidelines</title>
204 The source tree is the heart of every software project. Every effort must
205 be made to ensure that it is readable, compilable and consistent at all
206 times. There are differing guidelines for the stable branch and the
207 main development trunk, and we ask anyone with CVS access to strictly
208 adhere to the following guidelines:
212 Basic Guidelines, for all branches:
217 Never (read: <emphasis>never, ever</emphasis>) be tempted to commit
218 that small change without testing it thoroughly first. When we're
219 close to a public release, ask a fellow developer to review your
223 Your commit message should give a concise overview of <emphasis>what you
224 changed</emphasis> (no big details) and <emphasis>why you changed it</emphasis>
225 Just check previous messages for good examples.
228 Don't use the same message on multiple files, unless it equally applies to
232 If your changes span multiple files, and the code won't recompile unless
233 all changes are committed (e.g. when changing the signature of a function),
234 then commit all files one after another, without long delays in between.
235 If necessary, prepare the commit messages in advance.
238 Before changing things on CVS, make sure that your changes are in line
239 with the team's general consensus on what should be done.
243 Note that near a major public release, we get more cautious.
244 There is always the possibility to submit a patch to the <ulink
245 url="http://sourceforge.net/tracker/?atid=311118&group_id=11118&func=browse">patch
246 tracker</ulink> instead.
253 Stable branches are handled with more care, especially after the
254 initial *.*.0 release, and we are just in bugfix mode. In addition to
255 the above, the below applies only to the stable branch (currently the
256 v_3_0_branchpoint branch):
262 Do <emphasis>not commit anything</emphasis> into the stable branch,
263 unless immediately before a new release! There needs to be testing
264 done before it hits CVS, and to ensure that all changes are
265 appropriate just to fix whatever the problem is.
269 Submit any proposed changes as patches first to the patch tracker on
270 Sourceforge: <ulink url="http://sourceforge.net/tracker/?group_id=11118&atid=311118">http://sourceforge.net/tracker/?group_id=11118&atid=311118</ulink>.
271 Then ask for peer review.
276 Do not commit <emphasis>anything</emphasis> unless your patches
277 been well tested first, by other members of the project,
278 and has prior approval of the project leaders or consensus of the
284 Do not even think about anything except bugfixes. No new features!
293 This sounds vague, dated, and out of step with current development style.
294 Removing 09/03/02, HB.
296 <sect2 id="cvswhenask"><title>Discussing Changes First</title>
298 We don't have a formal policy for the development branch, just use
299 common sense. Hints: If it is..
300 <orderedlist numeration="arabic">
302 ..a bug-fix / clean-up / cosmetic thing: shoot
305 ..a new feature that can be turned off: shoot
308 ..a clear improvement w/o side effects on other parts of the code: shoot
311 ..a matter of taste: <ulink url="mailto:developers@privoxy.org">ask the list</ulink>
314 ..a major redesign of some part of the code: <ulink url="mailto:developers@privoxy.org">ask
320 Note that near a major public release, we get a bit more cautious - if
321 unsure, it doesn't hurt to ask first. There is always the possibility
322 to submit a patch to the <ulink
323 url="http://sourceforge.net/tracker/?atid=311118&group_id=11118&func=browse">patches
324 tracker</ulink> instead.
330 <!-- ~~~~~ New section ~~~~~ -->
331 <sect1 id="documentation"><title>Documentation Guidelines</title>
333 All formal documents are maintained in Docbook SGML and located in the
334 <computeroutput>doc/source/*</computeroutput> directory. You will need
335 <ulink url="http://www.docbook.org">Docbook</ulink>, the Docbook
336 DTD's and the Docbook modular stylesheets (or comparable alternatives),
337 and either <application>jade</application> or
338 <application>openjade</application> (recommended) installed in order to
339 build docs from source. Currently there is <ulink
340 url="../user-manual/index.html"><citetitle>user-manual</citetitle></ulink>,
341 <ulink url="../faq/index.html"><citetitle>FAQ</citetitle></ulink>, and, of
342 course this, the <citetitle>developer-manual</citetitle> in this format.
343 The <citetitle>README</citetitle>, <citetitle>AUTHORS</citetitle>
344 <citetitle>privoxy.1</citetitle> (man page), and
345 <citetitle>config</citetitle> files are also now maintained as Docbook
346 SGML. These files, when built, in the top-level source directory are
347 generated files! Also, the <application>Privoxy</application> <filename>index.html</filename> (and a
348 variation on this file, <filename>privoxy-index.html</filename>,
349 meant for inclusion with doc packages), are maintained as SGML as well.
350 <emphasis>DO NOT edit these directly</emphasis>. Edit the SGML source, or
351 contact someone involved in the documentation (at present Hal).
354 <filename>config</filename> requires some special handling. The reason it
355 is maintained this way is so that the extensive comments in the file
356 mirror those in <citetitle>user-manual</citetitle>. But the conversion
357 process requires going from SGML to HTML to text to special formatting
358 required for the embedded comments. Some of this does not survive so
359 well. Especially some of the examples that are longer than 80 characters.
360 The build process for this file outputs to <filename>config.new</filename>,
361 which should be reviewed for errors and mis-formatting. Once satisfied
362 that it is correct, then it should be hand copied to
363 <filename>config</filename>.
366 Other, less formal documents (e.g. <filename>LICENSE</filename>,
367 <filename>INSTALL</filename>) are maintained as plain text files in the
368 top-level source directory. At least for the time being.
371 Packagers are encouraged to include this documentation. For those without
372 the ability to build the docs locally, text versions of each are kept in
373 CVS. HTML versions are also now being kept in CVS under
374 <filename>doc/webserver/*</filename>.
377 Formal documents are built with the Makefile targets of
378 <computeroutput>make dok</computeroutput>, or alternately
379 <computeroutput>make redhat-dok</computeroutput>. If you have problems,
380 try both. The build process uses the document SGML sources in
381 <computeroutput>doc/source/*/*</computeroutput> to update all text files in
382 <computeroutput>doc/text/</computeroutput> and to update all HTML
383 documents in <computeroutput>doc/webserver/</computeroutput>.
386 Documentation writers should please make sure documents build
387 successfully before committing to CVS, if possible.
390 How do you update the webserver (i.e. the pages on privoxy.org)?
392 <orderedlist numeration="arabic">
394 First, build the docs by running <computeroutput>make
395 dok</computeroutput> (or alternately <computeroutput>make
396 redhat-dok</computeroutput>). For PDF docs, do <computeroutput>make
397 dok-pdf</computeroutput>.
400 Run <computeroutput>make webserver</computeroutput> which copies all
401 files from <computeroutput>doc/webserver</computeroutput> to the
402 sourceforge webserver via scp.
408 Finished docs should be occasionally submitted to CVS
409 (<filename>doc/webserver/*/*.html</filename>) so that those without
410 the ability to build them locally, have access to them if needed.
411 This is especially important just prior to a new release! Please
412 do this <emphasis>after</emphasis> the <literal>$VERSION</literal> and
413 other release specific data in <filename>configure.in</filename> has been
414 updated (this is done just prior to a new release).
417 <!-- ~~~~~ New section ~~~~~ -->
419 <title>Quickstart to Docbook and SGML</title>
421 If you are not familiar with SGML, it is a markup language similar to HTML.
422 Actually, not a mark up language per se, but a language used to define
423 markup languages. In fact, HTML is an SGML application. Both will use
424 <quote>tags</quote> to format text and other content. SGML tags can be much
425 more varied, and flexible, but do much of the same kinds of things. The tags,
426 or <quote>elements</quote>, are definable in SGML. There is no set
427 <quote>standards</quote>. Since we are using
428 <application>Docbook</application>, our tags are those that are defined by
429 <application>Docbook</application>. Much of how the finish document is
430 rendered is determined by the <quote>stylesheets</quote>.
431 The stylesheets determine how each tag gets translated to HTML, or other
436 Tags in Docbook SGML need to be always <quote>closed</quote>. If not, you
437 will likely generate errors. Example: <literal><title>My
438 Title</title></literal>. They are also case-insensitive, but we
439 strongly suggest using all lower case. This keeps compatibility with
440 [Docbook] <application>XML</application>.
444 Our documents use <quote>sections</quote> for the most part. Sections
445 will be processed into HTML headers (e.g. <literal>h1</literal> for
446 <literal>sect1</literal>). The <application>Docbook</application> stylesheets
447 will use these to also generate the Table of Contents for each doc. Our
448 TOC's are set to a depth of three. Meaning <literal>sect1</literal>,
449 <literal>sect2</literal>, and <literal>sect3</literal> will have TOC
450 entries, but <literal>sect4</literal> will not. Each section requires
451 a <literal><title></literal> element, and at least one
452 <literal><para></literal>. There is a limit of five section
453 levels in Docbook, but generally three should be sufficient for our
458 Some common elements that you likely will use:
464 <emphasis><para></para></emphasis>, paragraph delimiter. Most
465 text needs to be within paragraph elements (there are some exceptions).
468 <emphasis><emphasis></emphasis></emphasis>, the stylesheets
472 <emphasis><filename></filename></emphasis>, files and directories.
475 <emphasis><command></command></emphasis>, command examples.
478 <emphasis><literallayout></literallayout></emphasis>, like
479 <literal><pre></literal>, more or less.
482 <emphasis><itemizedlist></itemizedlist></emphasis>, list with bullets.
485 <emphasis><listitem></listitem></emphasis>, member of the above.
488 <emphasis><screen></screen></emphasis>, screen output, implies
489 <literal><literallayout></literal>.
492 <emphasis><ulink url="example.com"></ulink></emphasis>, like
493 HTML <literal><a></literal> tag.
496 <emphasis><quote></quote></emphasis>, for, doh, quoting text.
502 Look at any of the existing docs for examples of all these and more.
506 You might also find <quote><ulink
507 url="http://www.bureau-cornavin.com/opensource/crash-course/">Writing Documentation
508 Using DocBook - A Crash Course</ulink></quote> useful.
512 <!-- ~~~~~ New section ~~~~~ -->
513 <sect2 id="docstyle">
514 <title><application>Privoxy</application> Documentation Style</title>
516 It will be easier if everyone follows a similar writing style. This
517 just makes it easier to read what someone else has written if it
518 is all done in a similar fashion.
527 All tags should be lower case.
532 Tags delimiting a <emphasis>block</emphasis> of text (even small
533 blocks) should be on their own line. Like:
539 Tags marking individual words, or few words, should be in-line:
541 Just to <emphasis>emphasize</emphasis>, some text goes here.
547 Tags should be nested and step indented for block text like: (except
554 Some text goes here in our list example.
557 </itemizedlist>
560 This makes it easier to find the text amongst the tags ;-)
565 Use white space to separate logical divisions within a document,
566 like between sections. Running everything together consistently
567 makes it harder to read and work on.
572 Do not hesitate to make comments. Comments can either use the
573 <comment> element, or the <!-- --> style comment
574 familiar from HTML. (Note in Docbook v4.x <comment> is
575 replaced by <remark>.)
580 We have an international audience. Refrain from slang, or English
581 idiosyncrasies (too many to list :). Humor also does not translate
587 Try to keep overall line lengths in source files to 80 characters or less
588 for obvious reasons. This is not always possible, with lengthy URLs for
594 Our documents are available in differing formats. Right now, they
595 are just plain text, TML, and PDF, but others are always a
596 future possibility. Be careful with URLs (<ulink>), and avoid
600 My favorite site is <ulink url="http://example.com">here</ulink>.
603 This will render as <quote>My favorite site is here</quote>, which is
604 not real helpful in a text doc. Better like this:
607 My favorite site is <ulink url="http://example.com">example.com</ulink>.
612 All documents should be spell checked occasionally.
613 <application>aspell</application> can check SGML with the
614 <literal>-H</literal> option. (<application>ispell</application> I think
625 <!-- ~~~~~ New section ~~~~~ -->
627 <sect2><title>Privoxy Custom Entities</title>
629 <application>Privoxy</application> documentation is using
630 a number of customized <quote>entities</quote> to facilitate
631 documentation maintenance.
634 We are using a set of <quote>boilerplate</quote> files with generic text,
635 that is used by multiple docs. This way we can write something once, and use
636 it repeatedly without having to re-write the same content over and over again.
637 If editing such a file, keep in mind that it should be
638 <emphasis>generic</emphasis>. That is the purpose; so it can be used in varying
639 contexts without additional modifications.
642 We are also using what <application>Docbook</application> calls
643 <quote>internal entities</quote>. These are like variables in
644 programming. Well, sort of. For instance, we have the
645 <literal>p-version</literal> entity that contains the current
646 <application>Privoxy</application> version string. You are strongly
647 encouraged to use these where possible. Some of these obviously
648 require re-setting with each release (done by the Makefile). A sampling of
649 custom entities are listed below. See any of the main docs for examples.
656 Re- <quote>boilerplate</quote> text entities are defined like:
659 <literal><!entity supported SYSTEM "supported.sgml"></literal>
662 In this example, the contents of the file,
663 <filename>supported.sgml</filename> is available for inclusion anywhere
664 in the doc. To make this happen, just reference the now defined
665 entity: <literal>&supported;</literal> (starts with an ampersand
666 and ends with a semi-colon), and the contents will be dumped into
667 the finished doc at that point.
672 Commonly used <quote>internal entities</quote>:
676 <emphasis>p-version</emphasis>: the <application>Privoxy</application>
677 version string, e.g. <quote>&p-version;</quote>.
680 <emphasis>p-status</emphasis>: the project status, either
681 <quote>alpha</quote>, <quote>beta</quote>, or <quote>stable</quote>.
684 <emphasis>p-not-stable</emphasis>: use to conditionally include
685 text in <quote>not stable</quote> releases (e.g. <quote>beta</quote>).
688 <emphasis>p-stable</emphasis>: just the opposite.
691 <emphasis>p-text</emphasis>: this doc is only generated as text.
698 There are others in various places that are defined for a specific
699 purpose. Read the source!
706 <!-- <listitem><para>be consistent with the redirect script (i.e. the <application>Privoxy</application> program -->
707 <!-- points via the redirect URL at sf to valid end-points in the document)</para></listitem> -->
709 <!-- ~~~~~ New section ~~~~~ -->
710 <sect1 id="coding"><title>Coding Guidelines</title>
712 <sect2 id="s1"><title>Introduction</title>
714 <para>This set of standards is designed to make our lives easier. It is
715 developed with the simple goal of helping us keep the "new and improved
716 <application>Privoxy</application>" consistent and reliable. Thus making
717 maintenance easier and increasing chances of success of the
720 <para>And that of course comes back to us as individuals. If we can
721 increase our development and product efficiencies then we can solve more
722 of the request for changes/improvements and in general feel good about
723 ourselves. ;-></para>
727 <sect2 id="s2"><title>Using Comments</title>
730 <sect3 id="s3"><title>Comment, Comment, Comment</title>
732 <para><emphasis>Explanation:</emphasis></para>
734 <para>Comment as much as possible without commenting the obvious.
735 For example do not comment "aVariable is equal to bVariable".
736 Instead explain why aVariable should be equal to the bVariable.
737 Just because a person can read code does not mean they will
738 understand why or what is being done. A reader may spend a lot
739 more time figuring out what is going on when a simple comment
740 or explanation would have prevented the extra research. Please
741 help your brother IJB'ers out!</para>
743 <para>The comments will also help justify the intent of the code.
744 If the comment describes something different than what the code
745 is doing then maybe a programming error is occurring.</para>
747 <para><emphasis>Example:</emphasis></para>
749 /* if page size greater than 1k ... */
750 if ( PageLength() > 1024 )
752 ... "block" the page up ...
755 /* if page size is small, send it in blocks */
756 if ( PageLength() > 1024 )
758 ... "block" the page up ...
761 This demonstrates 2 cases of "what not to do". The first is a
762 "syntax comment". The second is a comment that does not fit what
763 is actually being done.
769 <sect3 id="s4"><title>Use blocks for comments</title>
771 <para><emphasis>Explanation:</emphasis></para>
773 <para>Comments can help or they can clutter. They help when they
774 are differentiated from the code they describe. One line
775 comments do not offer effective separation between the comment
776 and the code. Block identifiers do, by surrounding the code
777 with a clear, definable pattern.</para>
779 <para><emphasis>Example:</emphasis></para>
781 /*********************************************************************
782 * This will stand out clearly in your code!
783 *********************************************************************/
784 if ( thisVariable == thatVariable )
786 DoSomethingVeryImportant();
790 /* unfortunately, this may not */
791 if ( thisVariable == thatVariable )
793 DoSomethingVeryImportant();
797 if ( thisVariable == thatVariable ) /* this may not either */
799 DoSomethingVeryImportant();
802 <para><emphasis>Exception:</emphasis></para>
804 <para>If you are trying to add a small logic comment and do not
805 wish to "disrupt" the flow of the code, feel free to use a 1
806 line comment which is NOT on the same line as the code.</para>
812 <sect3 id="s5"><title>Keep Comments on their own line</title>
814 <para><emphasis>Explanation:</emphasis></para>
816 <para>It goes back to the question of readability. If the comment
817 is on the same line as the code it will be harder to read than
818 the comment that is on its own line.</para>
820 <para>There are three exceptions to this rule, which should be
821 violated freely and often: during the definition of variables,
822 at the end of closing braces, when used to comment
825 <para><emphasis>Example:</emphasis></para>
827 /*********************************************************************
828 * This will stand out clearly in your code,
829 * But the second example won't.
830 *********************************************************************/
831 if ( thisVariable == thatVariable )
833 DoSomethingVeryImportant();
836 if ( thisVariable == thatVariable ) /*can you see me?*/
838 DoSomethingVeryImportant(); /*not easily*/
842 /*********************************************************************
843 * But, the encouraged exceptions:
844 *********************************************************************/
845 int urls_read = 0; /* # of urls read + rejected */
846 int urls_rejected = 0; /* # of urls rejected */
850 DoSomethingVeryImportant();
854 short DoSomethingVeryImportant(
855 short firstparam, /* represents something */
856 short nextparam /* represents something else */ )
860 } /* -END- DoSomethingVeryImportant */
865 <sect3 id="s6"><title>Comment each logical step</title>
867 <para><emphasis>Explanation:</emphasis></para>
869 <para>Logical steps should be commented to help others follow the
870 intent of the written code and comments will make the code more
873 <para>If you have 25 lines of code without a comment, you should
874 probably go back into it to see where you forgot to put
877 <para>Most "for", "while", "do", etc... loops _probably_ need a
878 comment. After all, these are usually major logic
885 <sect3 id="s7"><title>Comment All Functions Thoroughly</title>
887 <para><emphasis>Explanation:</emphasis></para>
889 <para>A reader of the code should be able to look at the comments
890 just prior to the beginning of a function and discern the
891 reason for its existence and the consequences of using it. The
892 reader should not have to read through the code to determine if
893 a given function is safe for a desired use. The proper
894 information thoroughly presented at the introduction of a
895 function not only saves time for subsequent maintenance or
896 debugging, it more importantly aids in code reuse by allowing a
897 user to determine the safety and applicability of any function
898 for the problem at hand. As a result of such benefits, all
899 functions should contain the information presented in the
900 addendum section of this document.</para>
906 <sect3 id="s8"><title>Comment at the end of braces if the
907 content is more than one screen length</title>
909 <para><emphasis>Explanation:</emphasis></para>
911 <para>Each closing brace should be followed on the same line by a
912 comment that describes the origination of the brace if the
913 original brace is off of the screen, or otherwise far away from
914 the closing brace. This will simplify the debugging,
915 maintenance, and readability of the code.</para>
917 <para>As a suggestion , use the following flags to make the
918 comment and its brace more readable:</para>
920 <para>use following a closing brace: } /* -END- if() or while ()
923 <para><emphasis>Example:</emphasis></para>
927 DoSomethingVeryImportant();
928 ...some long list of commands...
929 } /* -END- if x is 1 */
935 DoSomethingVeryImportant();
936 ...some long list of commands...
937 } /* -END- if ( 1 == X ) */
943 <sect2 id="s9"><title>Naming Conventions</title>
947 <sect3 id="s10"><title>Variable Names</title>
949 <para><emphasis>Explanation:</emphasis></para>
951 <para>Use all lowercase, and separate words via an underscore
952 ('_'). Do not start an identifier with an underscore. (ANSI C
953 reserves these for use by the compiler and system headers.) Do
954 not use identifiers which are reserved in ANSI C++. (E.g.
955 template, class, true, false, ...). This is in case we ever
956 decide to port Privoxy to C++.</para>
958 <para><emphasis>Example:</emphasis></para>
960 int ms_iis5_hack = 0;</programlisting>
962 <para><emphasis>Instead of:</emphasis></para>
966 int msiis5hack = 0; int msIis5Hack = 0;
974 <sect3 id="s11"><title>Function Names</title>
976 <para><emphasis>Explanation:</emphasis></para>
978 <para>Use all lowercase, and separate words via an underscore
979 ('_'). Do not start an identifier with an underscore. (ANSI C
980 reserves these for use by the compiler and system headers.) Do
981 not use identifiers which are reserved in ANSI C++. (E.g.
982 template, class, true, false, ...). This is in case we ever
983 decide to port Privoxy to C++.</para>
985 <para><emphasis>Example:</emphasis></para>
987 int load_some_file( struct client_state *csp )</programlisting>
989 <para><emphasis>Instead of:</emphasis></para>
993 int loadsomefile( struct client_state *csp )
994 int loadSomeFile( struct client_state *csp )
1002 <sect3 id="s12"><title>Header file prototypes</title>
1004 <para><emphasis>Explanation:</emphasis></para>
1006 <para>Use a descriptive parameter name in the function prototype
1007 in header files. Use the same parameter name in the header file
1008 that you use in the c file.</para>
1010 <para><emphasis>Example:</emphasis></para>
1012 (.h) extern int load_aclfile( struct client_state *csp );
1013 (.c) int load_aclfile( struct client_state *csp )</programlisting>
1015 <para><emphasis>Instead of:</emphasis>
1017 (.h) extern int load_aclfile( struct client_state * ); or
1018 (.h) extern int load_aclfile();
1019 (.c) int load_aclfile( struct client_state *csp )
1027 <sect3 id="s13"><title>Enumerations, and #defines</title>
1029 <para><emphasis>Explanation:</emphasis></para>
1031 <para>Use all capital letters, with underscores between words. Do
1032 not start an identifier with an underscore. (ANSI C reserves
1033 these for use by the compiler and system headers.)</para>
1035 <para><emphasis>Example:</emphasis></para>
1037 (enumeration) : enum Boolean { FALSE, TRUE };
1038 (#define) : #define DEFAULT_SIZE 100;</programlisting>
1040 <para><emphasis>Note:</emphasis> We have a standard naming scheme for #defines
1041 that toggle a feature in the preprocessor: FEATURE_>, where
1042 > is a short (preferably 1 or 2 word) description.</para>
1044 <para><emphasis>Example:</emphasis></para>
1046 #define FEATURE_FORCE 1
1048 #ifdef FEATURE_FORCE
1049 #define FORCE_PREFIX blah
1050 #endif /* def FEATURE_FORCE */
1055 <sect3 id="s14"><title>Constants</title>
1057 <para><emphasis>Explanation:</emphasis></para>
1059 <para>Spell common words out entirely (do not remove vowels).</para>
1061 <para>Use only widely-known domain acronyms and abbreviations.
1062 Capitalize all letters of an acronym.</para>
1064 <para>Use underscore (_) to separate adjacent acronyms and
1065 abbreviations. Never terminate a name with an underscore.</para>
1067 <para><emphasis>Example:</emphasis></para>
1069 #define USE_IMAGE_LIST 1</programlisting>
1071 <para><emphasis>Instead of:</emphasis></para>
1075 #define USE_IMG_LST 1 or
1076 #define _USE_IMAGE_LIST 1 or
1077 #define USE_IMAGE_LIST_ 1 or
1078 #define use_image_list 1 or
1079 #define UseImageList 1
1089 <sect2 id="s15"><title>Using Space</title>
1093 <sect3 id="s16"><title>Put braces on a line by themselves.</title>
1095 <para><emphasis>Explanation:</emphasis></para>
1097 <para>The brace needs to be on a line all by itself, not at the
1098 end of the statement. Curly braces should line up with the
1099 construct that they're associated with. This practice makes it
1100 easier to identify the opening and closing braces for a
1103 <para><emphasis>Example:</emphasis></para>
1110 <para><emphasis>Instead of:</emphasis></para>
1112 <para>if ( this == that ) { ... }</para>
1116 <para>if ( this == that ) { ... }</para>
1118 <para><emphasis>Note:</emphasis> In the special case that the if-statement is
1119 inside a loop, and it is trivial, i.e. it tests for a
1120 condition that is obvious from the purpose of the block,
1121 one-liners as above may optically preserve the loop structure
1122 and make it easier to read.</para>
1124 <para><emphasis>Status:</emphasis> developer-discretion.</para>
1126 <para><emphasis>Example exception:</emphasis></para>
1128 while ( more lines are read )
1130 /* Please document what is/is not a comment line here */
1131 if ( it's a comment ) continue;
1133 do_something( line );
1139 <sect3 id="s17"><title>ALL control statements should have a
1142 <para><emphasis>Explanation:</emphasis></para>
1144 <para>Using braces to make a block will make your code more
1145 readable and less prone to error. All control statements should
1146 have a block defined.</para>
1148 <para><emphasis>Example:</emphasis></para>
1156 <para><emphasis>Instead of:</emphasis></para>
1158 <para>if ( this == that ) DoSomething(); DoSomethingElse();</para>
1162 <para>if ( this == that ) DoSomething();</para>
1164 <para><emphasis>Note:</emphasis> The first example in "Instead of" will execute
1165 in a manner other than that which the developer desired (per
1166 indentation). Using code braces would have prevented this
1167 "feature". The "explanation" and "exception" from the point
1168 above also applies.</para>
1174 <sect3 id="s18"><title>Do not belabor/blow-up boolean
1177 <para><emphasis>Example:</emphasis></para>
1179 structure->flag = ( condition );</programlisting>
1181 <para><emphasis>Instead of:</emphasis></para>
1183 <para>if ( condition ) { structure->flag = 1; } else {
1184 structure->flag = 0; }</para>
1186 <para><emphasis>Note:</emphasis> The former is readable and concise. The later
1187 is wordy and inefficient. Please assume that any developer new
1188 to the project has at least a "good" knowledge of C/C++. (Hope
1189 I do not offend by that last comment ... 8-)</para>
1195 <sect3 id="s19"><title>Use white space freely because it is
1198 <para><emphasis>Explanation:</emphasis></para>
1200 <para>Make it readable. The notable exception to using white space
1201 freely is listed in the next guideline.</para>
1203 <para><emphasis>Example:</emphasis></para>
1207 int anotherValue = 0;
1208 int thisVariable = 0;
1210 if ( thisVariable == thatVariable )
1212 firstValue = oldValue + ( ( someValue - anotherValue ) - whatever )
1217 <sect3 id="s20"><title>Don't use white space around structure
1220 <para><emphasis>Explanation:</emphasis></para>
1222 <para>- structure pointer operator ( "->" ) - member operator (
1223 "." ) - functions and parentheses</para>
1225 <para>It is a general coding practice to put pointers, references,
1226 and function parentheses next to names. With spaces, the
1227 connection between the object and variable/function name is not
1230 <para><emphasis>Example:</emphasis></para>
1234 FunctionName();</programlisting>
1236 <para><emphasis>Instead of:</emphasis> aStruct -> aMember; aStruct . aMember;
1237 FunctionName ();</para>
1243 <sect3 id="s21"><title>Make the last brace of a function stand
1246 <para><emphasis>Example:</emphasis></para>
1248 int function1( ... )
1253 } /* -END- function1 */
1256 int function2( ... )
1258 } /* -END- function2 */
1261 <para><emphasis>Instead of:</emphasis></para>
1263 <para>int function1( ... ) { ...code... return( retCode ); } int
1264 function2( ... ) { }</para>
1266 <para><emphasis>Note:</emphasis> Use 1 blank line before the closing brace and 2
1267 lines afterward. This makes the end of function standout to
1268 the most casual viewer. Although function comments help
1269 separate functions, this is still a good coding practice. In
1270 fact, I follow these rules when using blocks in "for", "while",
1271 "do" loops, and long if {} statements too. After all whitespace
1274 <para><emphasis>Status:</emphasis> developer-discretion on the number of blank
1275 lines. Enforced is the end of function comments.</para>
1281 <sect3 id="s22"><title>Use 3 character indentions</title>
1283 <para><emphasis>Explanation:</emphasis></para>
1285 <para>If some use 8 character TABs and some use 3 character TABs,
1286 the code can look *very* ragged. So use 3 character indentions
1287 only. If you like to use TABs, pass your code through a filter
1288 such as "expand -t3" before checking in your code.</para>
1290 <para><emphasis>Example:</emphasis></para>
1292 static const char * const url_code_map[256] =
1298 int function1( ... )
1302 return( ALWAYS_TRUE );
1306 return( HOW_DID_YOU_GET_HERE );
1309 return( NEVER_GETS_HERE );
1318 <sect2 id="s23"><title>Initializing</title>
1322 <sect3 id="s24"><title>Initialize all variables</title>
1324 <para><emphasis>Explanation:</emphasis></para>
1326 <para>Do not assume that the variables declared will not be used
1327 until after they have been assigned a value somewhere else in
1328 the code. Remove the chance of accidentally using an unassigned
1331 <para><emphasis>Example:</emphasis></para>
1335 struct *ptr = NULL;</programlisting>
1337 <para><emphasis>Note:</emphasis> It is much easier to debug a SIGSEGV if the
1338 message says you are trying to access memory address 00000000
1339 and not 129FA012; or arrayPtr[20] causes a SIGSEV vs.
1342 <para><emphasis>Status:</emphasis> developer-discretion if and only if the
1343 variable is assigned a value "shortly after" declaration.</para>
1349 <sect2 id="s25"><title>Functions</title>
1353 <sect3 id="s26"><title>Name functions that return a boolean as a
1356 <para><emphasis>Explanation:</emphasis></para>
1358 <para>Value should be phrased as a question that would logically
1359 be answered as a true or false statement</para>
1361 <para><emphasis>Example:</emphasis></para>
1363 ShouldWeBlockThis();
1370 <sect3 id="s27"><title>Always specify a return type for a
1373 <para><emphasis>Explanation:</emphasis></para>
1375 <para>The default return for a function is an int. To avoid
1376 ambiguity, create a return for a function when the return has a
1377 purpose, and create a void return type if the function does not
1378 need to return anything.</para>
1384 <sect3 id="s28"><title>Minimize function calls when iterating by
1385 using variables</title>
1387 <para><emphasis>Explanation:</emphasis></para>
1389 <para>It is easy to write the following code, and a clear argument
1390 can be made that the code is easy to understand:</para>
1392 <para><emphasis>Example:</emphasis></para>
1394 for ( size_t cnt = 0; cnt < blockListLength(); cnt ++ )
1399 <para><emphasis>Note:</emphasis> Unfortunately, this makes a function call for
1400 each and every iteration. This increases the overhead in the
1401 program, because the compiler has to look up the function each
1402 time, call it, and return a value. Depending on what occurs in
1403 the blockListLength() call, it might even be creating and
1404 destroying structures with each iteration, even though in each
1405 case it is comparing "cnt" to the same value, over and over.
1406 Remember too - even a call to blockListLength() is a function
1407 call, with the same overhead.</para>
1409 <para>Instead of using a function call during the iterations,
1410 assign the value to a variable, and evaluate using the
1413 <para><emphasis>Example:</emphasis></para>
1415 size_t len = blockListLength();
1417 for ( size_t cnt = 0; cnt < len; cnt ++ )
1422 <para><emphasis>Exceptions:</emphasis> if the value of blockListLength() *may*
1423 change or could *potentially* change, then you must code the
1424 function call in the for/while loop.</para>
1430 <sect3 id="s29"><title>Pass and Return by Const Reference</title>
1432 <para><emphasis>Explanation:</emphasis></para>
1434 <para>This allows a developer to define a const pointer and call
1435 your function. If your function does not have the const
1436 keyword, we may not be able to use your function. Consider
1437 strcmp, if it were defined as: extern int strcmp( char *s1,
1440 <para>I could then not use it to compare argv's in main: int main(
1441 int argc, const char *argv[] ) { strcmp( argv[0], "privoxy"
1444 <para>Both these pointers are *const*! If the c runtime library
1445 maintainers do it, we should too.</para>
1451 <sect3 id="s30"><title>Pass and Return by Value</title>
1453 <para><emphasis>Explanation:</emphasis></para>
1455 <para>Most structures cannot fit onto a normal stack entry (i.e.
1456 they are not 4 bytes or less). Aka, a function declaration
1457 like: int load_aclfile( struct client_state csp )</para>
1459 <para>would not work. So, to be consistent, we should declare all
1460 prototypes with "pass by value": int load_aclfile( struct
1461 client_state *csp )</para>
1467 <sect3 id="s31"><title>Names of include files</title>
1469 <para><emphasis>Explanation:</emphasis></para>
1471 <para>Your include statements should contain the file name without
1472 a path. The path should be listed in the Makefile, using -I as
1473 processor directive to search the indicated paths. An exception
1474 to this would be for some proprietary software that utilizes a
1475 partial path to distinguish their header files from system or
1476 other header files.</para>
1478 <para><emphasis>Example:</emphasis></para>
1480 #include <iostream.h> /* This is not a local include */
1481 #include "config.h" /* This IS a local include */
1484 <para><emphasis>Exception:</emphasis></para>
1488 /* This is not a local include, but requires a path element. */
1489 #include <sys/fileName.h>
1493 <para><emphasis>Note:</emphasis> Please! do not add "-I." to the Makefile
1494 without a _very_ good reason. This duplicates the #include
1495 "file.h" behavior.</para>
1501 <sect3 id="s32"><title>Provide multiple inclusion
1504 <para><emphasis>Explanation:</emphasis></para>
1506 <para>Prevents compiler and linker errors resulting from
1507 redefinition of items.</para>
1509 <para>Wrap each header file with the following syntax to prevent
1510 multiple inclusions of the file. Of course, replace PROJECT_H
1511 with your file name, with "." Changed to "_", and make it
1514 <para><emphasis>Example:</emphasis></para>
1516 #ifndef PROJECT_H_INCLUDED
1517 #define PROJECT_H_INCLUDED
1519 #endif /* ndef PROJECT_H_INCLUDED */
1524 <sect3 id="s33"><title>Use `extern "C"` when appropriate</title>
1526 <para><emphasis>Explanation:</emphasis></para>
1528 <para>If our headers are included from C++, they must declare our
1529 functions as `extern "C"`. This has no cost in C, but increases
1530 the potential re-usability of our code.</para>
1532 <para><emphasis>Example:</emphasis></para>
1537 #endif /* def __cplusplus */
1539 ... function definitions here ...
1543 #endif /* def __cplusplus */
1548 <sect3 id="s34"><title>Where Possible, Use Forward Struct
1549 Declaration Instead of Includes</title>
1551 <para><emphasis>Explanation:</emphasis></para>
1553 <para>Useful in headers that include pointers to other struct's.
1554 Modifications to excess header files may cause needless
1557 <para><emphasis>Example:</emphasis></para>
1559 /*********************************************************************
1560 * We're avoiding an include statement here!
1561 *********************************************************************/
1563 extern file_list *xyz;</programlisting>
1565 <para><emphasis>Note:</emphasis> If you declare "file_list xyz;" (without the
1566 pointer), then including the proper header file is necessary.
1567 If you only want to prototype a pointer, however, the header
1568 file is unnecessary.</para>
1570 <para><emphasis>Status:</emphasis> Use with discretion.</para>
1576 <sect2 id="s35"><title>General Coding Practices</title>
1580 <sect3 id="s36"><title>Turn on warnings</title>
1582 <para><emphasis>Explanation</emphasis></para>
1584 <para>Compiler warnings are meant to help you find bugs. You
1585 should turn on as many as possible. With GCC, the switch is
1586 "-Wall". Try and fix as many warnings as possible.</para>
1592 <sect3 id="s37"><title>Provide a default case for all switch
1595 <para><emphasis>Explanation:</emphasis></para>
1597 <para>What you think is guaranteed is never really guaranteed. The
1598 value that you don't think you need to check is the one that
1599 someday will be passed. So, to protect yourself from the
1600 unknown, always have a default step in a switch statement.</para>
1602 <para><emphasis>Example:</emphasis></para>
1604 switch( hash_string( cmd ) )
1606 case hash_actions_file :
1616 ... anomaly code goes here ...
1617 continue; / break; / exit( 1 ); / etc ...
1619 } /* end switch( hash_string( cmd ) ) */</programlisting>
1621 <para><emphasis>Note:</emphasis> If you already have a default condition, you
1622 are obviously exempt from this point. Of note, most of the
1623 WIN32 code calls `DefWindowProc' after the switch statement.
1624 This API call *should* be included in a default statement.</para>
1626 <para><emphasis>Another Note:</emphasis> This is not so much a readability issue
1627 as a robust programming issue. The "anomaly code goes here" may
1628 be no more than a print to the STDERR stream (as in
1629 load_config). Or it may really be an ABEND condition.</para>
1631 <para><emphasis>Status:</emphasis> Programmer discretion is advised.</para>
1637 <sect3 id="s38"><title>Try to avoid falling through cases in a
1638 switch statement.</title>
1640 <para><emphasis>Explanation:</emphasis></para>
1642 <para>In general, you will want to have a 'break' statement within
1643 each 'case' of a switch statement. This allows for the code to
1644 be more readable and understandable, and furthermore can
1645 prevent unwanted surprises if someone else later gets creative
1646 and moves the code around.</para>
1648 <para>The language allows you to plan the fall through from one
1649 case statement to another simply by omitting the break
1650 statement within the case statement. This feature does have
1651 benefits, but should only be used in rare cases. In general,
1652 use a break statement for each case statement.</para>
1654 <para>If you choose to allow fall through, you should comment both
1655 the fact of the fall through and reason why you felt it was
1662 <sect3 id="s39"><title>Use 'long' or 'short' Instead of
1665 <para><emphasis>Explanation:</emphasis></para>
1667 <para>On 32-bit platforms, int usually has the range of long. On
1668 16-bit platforms, int has the range of short.</para>
1670 <para><emphasis>Status:</emphasis> open-to-debate. In the case of most FSF
1671 projects (including X/GNU-Emacs), there are typedefs to int4,
1672 int8, int16, (or equivalence ... I forget the exact typedefs
1673 now). Should we add these to IJB now that we have a "configure"
1680 <sect3 id="s40"><title>Don't mix size_t and other types</title>
1682 <para><emphasis>Explanation:</emphasis></para>
1684 <para>The type of size_t varies across platforms. Do not make
1685 assumptions about whether it is signed or unsigned, or about
1686 how long it is. Do not compare a size_t against another
1687 variable of a different type (or even against a constant)
1688 without casting one of the values. Try to avoid using size_t if
1695 <sect3 id="s41"><title>Declare each variable and struct on its
1698 <para><emphasis>Explanation:</emphasis></para>
1700 <para>It can be tempting to declare a series of variables all on
1701 one line. Don't.</para>
1703 <para><emphasis>Example:</emphasis></para>
1707 long c = 0;</programlisting>
1709 <para><emphasis>Instead of:</emphasis></para>
1711 <para>long a, b, c;</para>
1713 <para><emphasis>Explanation:</emphasis> - there is more room for comments on the
1714 individual variables - easier to add new variables without
1715 messing up the original ones - when searching on a variable to
1716 find its type, there is less clutter to "visually"
1719 <para><emphasis>Exceptions:</emphasis> when you want to declare a bunch of loop
1720 variables or other trivial variables; feel free to declare them
1721 on 1 line. You should, although, provide a good comment on
1722 their functions.</para>
1724 <para><emphasis>Status:</emphasis> developer-discretion.</para>
1730 <sect3 id="s42"><title>Use malloc/zalloc sparingly</title>
1732 <para><emphasis>Explanation:</emphasis></para>
1734 <para>Create a local struct (on the stack) if the variable will
1735 live and die within the context of one function call.</para>
1737 <para>Only "malloc" a struct (on the heap) if the variable's life
1738 will extend beyond the context of one function call.</para>
1740 <para><emphasis>Example:</emphasis></para>
1742 If a function creates a struct and stores a pointer to it in a
1743 list, then it should definitely be allocated via `malloc'.
1748 <sect3 id="s43"><title>The Programmer Who Uses 'malloc' is
1749 Responsible for Ensuring 'free'</title>
1751 <para><emphasis>Explanation:</emphasis></para>
1753 <para>If you have to "malloc" an instance, you are responsible for
1754 insuring that the instance is `free'd, even if the deallocation
1755 event falls within some other programmer's code. You are also
1756 responsible for ensuring that deletion is timely (i.e. not too
1757 soon, not too late). This is known as "low-coupling" and is a
1758 "good thing (tm)". You may need to offer a
1759 free/unload/destructor type function to accommodate this.</para>
1761 <para><emphasis>Example:</emphasis></para>
1763 int load_re_filterfile( struct client_state *csp ) { ... }
1764 static void unload_re_filterfile( void *f ) { ... }</programlisting>
1766 <para><emphasis>Exceptions:</emphasis></para>
1768 <para>The developer cannot be expected to provide `free'ing
1769 functions for C run-time library functions ... such as
1772 <para><emphasis>Status:</emphasis> developer-discretion. The "main" use of this
1773 standard is for allocating and freeing data structures (complex
1780 <sect3 id="s44"><title>Add loaders to the `file_list' structure
1781 and in order</title>
1783 <para><emphasis>Explanation:</emphasis></para>
1785 <para>I have ordered all of the "blocker" file code to be in alpha
1786 order. It is easier to add/read new blockers when you expect a
1787 certain order.</para>
1789 <para><emphasis>Note:</emphasis> It may appear that the alpha order is broken in
1790 places by POPUP tests coming before PCRS tests. But since
1791 POPUPs can also be referred to as KILLPOPUPs, it is clear that
1792 it should come first.</para>
1798 <sect3 id="s45"><title>"Uncertain" new code and/or changes to
1799 existing code, use FIXME</title>
1801 <para><emphasis>Explanation:</emphasis></para>
1803 <para>If you have enough confidence in new code or confidence in
1804 your changes, but are not *quite* sure of the repercussions,
1807 <para>/* FIXME: this code has a logic error on platform XYZ, *
1808 attempting to fix */ #ifdef PLATFORM ...changed code here...
1813 <para>/* FIXME: I think the original author really meant this...
1814 */ ...changed code here...</para>
1818 <para>/* FIXME: new code that *may* break something else... */
1819 ...new code here...</para>
1821 <para><emphasis>Note:</emphasis> If you make it clear that this may or may not
1822 be a "good thing (tm)", it will be easier to identify and
1823 include in the project (or conversely exclude from the
1831 <sect2 id="s46"><title>Addendum: Template for files and function
1832 comment blocks:</title>
1834 <para><emphasis>Example for file comments:</emphasis></para>
1836 const char FILENAME_rcs[] = "$Id: developer-manual.sgml,v 1.46.2.8 2002/08/17 00:16:10 hal9 Exp $";
1837 /*********************************************************************
1839 * File : $S<!-- Break CVS Substitution -->ource$
1841 * Purpose : (Fill me in with a good description!)
1843 * Copyright : Written by and Copyright (C) 2001 the SourceForge
1844 * Privoxy team. http://www.privoxy.org/
1846 * Based on the Internet Junkbuster originally written
1847 * by and Copyright (C) 1997 Anonymous Coders and
1848 * Junkbusters Corporation. http://www.junkbusters.com
1850 * This program is free software; you can redistribute it
1851 * and/or modify it under the terms of the GNU General
1852 * Public License as published by the Free Software
1853 * Foundation; either version 2 of the License, or (at
1854 * your option) any later version.
1856 * This program is distributed in the hope that it will
1857 * be useful, but WITHOUT ANY WARRANTY; without even the
1858 * implied warranty of MERCHANTABILITY or FITNESS FOR A
1859 * PARTICULAR PURPOSE. See the GNU General Public
1860 * License for more details.
1862 * The GNU General Public License should be included with
1863 * this file. If not, you can view it at
1864 * http://www.gnu.org/copyleft/gpl.html
1865 * or write to the Free Software Foundation, Inc., 59
1866 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1869 * $L<!-- Break CVS Substitution -->og$
1871 *********************************************************************/
1876 ...necessary include files for us to do our work...
1878 const char FILENAME_h_rcs[] = FILENAME_H_VERSION;
1881 <para><emphasis>Note:</emphasis> This declares the rcs variables that should be
1882 added to the "show-proxy-args" page. If this is a brand new
1883 creation by you, you are free to change the "Copyright" section
1884 to represent the rights you wish to maintain.</para>
1886 <para><emphasis>Note:</emphasis> The formfeed character that is present right
1887 after the comment flower box is handy for (X|GNU)Emacs users to
1888 skip the verbiage and get to the heart of the code (via
1889 `forward-page' and `backward-page'). Please include it if you
1892 <para><emphasis>Example for file header comments:</emphasis></para>
1896 #define FILENAME_H_VERSION "$Id: developer-manual.sgml,v 1.46.2.8 2002/08/17 00:16:10 hal9 Exp $"
1897 /*********************************************************************
1899 * File : $S<!-- Break CVS Substitution -->ource$
1901 * Purpose : (Fill me in with a good description!)
1903 * Copyright : Written by and Copyright (C) 2001 the SourceForge
1904 * Privoxy team. http://www.privoxy.org/
1906 * Based on the Internet Junkbuster originally written
1907 * by and Copyright (C) 1997 Anonymous Coders and
1908 * Junkbusters Corporation. http://www.junkbusters.com
1910 * This program is free software; you can redistribute it
1911 * and/or modify it under the terms of the GNU General
1912 * Public License as published by the Free Software
1913 * Foundation; either version 2 of the License, or (at
1914 * your option) any later version.
1916 * This program is distributed in the hope that it will
1917 * be useful, but WITHOUT ANY WARRANTY; without even the
1918 * implied warranty of MERCHANTABILITY or FITNESS FOR A
1919 * PARTICULAR PURPOSE. See the GNU General Public
1920 * License for more details.
1922 * The GNU General Public License should be included with
1923 * this file. If not, you can view it at
1924 * http://www.gnu.org/copyleft/gpl.html
1925 * or write to the Free Software Foundation, Inc., 59
1926 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1929 * $L<!-- Break CVS Substitution -->og$
1931 *********************************************************************/
1934 #include "project.h"
1940 ... function headers here ...
1943 /* Revision control strings from this header and associated .c file */
1944 extern const char FILENAME_rcs[];
1945 extern const char FILENAME_h_rcs[];
1952 #endif /* ndef _FILENAME_H */
1961 <para><emphasis>Example for function comments:</emphasis></para>
1963 /*********************************************************************
1965 * Function : FUNCTION_NAME
1967 * Description : (Fill me in with a good description!)
1970 * 1 : param1 = pointer to an important thing
1971 * 2 : x = pointer to something else
1973 * Returns : 0 => Ok, everything else is an error.
1975 *********************************************************************/
1976 int FUNCTION_NAME( void *param1, const char *x )
1984 <para><emphasis>Note:</emphasis> If we all follow this practice, we should be
1985 able to parse our code to create a "self-documenting" web
1992 <!-- ~~~~~ New section ~~~~~ -->
1993 <sect1 id="testing"><title>Testing Guidelines</title>
1997 <!-- ~~~~~ New section ~~~~~ -->
1998 <sect2 id="testing-plan"><title>Testplan for releases</title>
2000 Explain release numbers. major, minor. developer releases. etc.
2002 <orderedlist numeration="arabic">
2004 Remove any existing rpm with rpm -e
2007 Remove any file that was left over. This includes (but is not limited to)
2009 <listitem><para>/var/log/privoxy</para></listitem>
2010 <listitem><para>/etc/privoxy</para></listitem>
2011 <listitem><para>/usr/sbin/privoxy</para></listitem>
2012 <listitem><para>/etc/init.d/privoxy</para></listitem>
2013 <listitem><para>/usr/doc/privoxy*</para></listitem>
2017 Install the rpm. Any error messages?
2019 <listitem><para>start,stop,status <application>Privoxy</application> with the specific script
2020 (e.g. /etc/rc.d/init/privoxy stop). Reboot your machine. Does
2021 autostart work?</para></listitem>
2022 <listitem><para>Start browsing. Does <application>Privoxy</application> work? Logfile written?</para></listitem>
2023 <listitem><para>Remove the rpm. Any error messages? All files removed?</para></listitem>
2028 <!-- ~~~~~ New section ~~~~~ -->
2029 <sect2 id="testing-report"><title>Test reports</title>
2031 Please submit test reports only with the <ulink url="http://sourceforge.net/tracker/?func=add&group_id=11118&atid=395005">test form</ulink>
2032 at sourceforge. Three simple steps:
2035 <listitem><para>Select category: the distribution you test on.</para></listitem>
2036 <listitem><para>Select group: the version of <application>Privoxy</application> that we are about to release.</para></listitem>
2037 <listitem><para>Fill the Summary and Detailed Description with something
2038 intelligent (keep it short and precise).</para>
2041 Do not mail to the mailing list (we cannot keep track on issues there).
2047 <!-- ~~~~~ New section ~~~~~ -->
2048 <sect1 id="newrelease"><title>Releasing a New Version</title>
2050 When we release versions of <application>Privoxy</application>,
2051 our work leaves our cozy secret lab and has to work in the cold
2052 RealWorld[tm]. Once it is released, there is no way to call it
2053 back, so it is very important that great care is taken to ensure
2054 that everything runs fine, and not to introduce problems in the
2058 So when releasing a new version, please adhere exactly to the
2059 procedure outlined in this chapter.
2063 The following programs are required to follow this process:
2064 <filename>ncftpput</filename> (ncftp), <filename>scp, ssh</filename> (ssh),
2065 <filename>gmake</filename> (GNU's version of make), autoconf, cvs.
2068 <sect2 id="versionnumbers">
2069 <title>Version numbers</title>
2072 First you need to determine which version number the release will have.
2073 <application>Privoxy</application> version numbers consist of three numbers,
2074 separated by dots, like in X.Y.Z (e.g. 3.0.0), where:
2078 X, the version major, is rarely ever changed. It is increased by one if
2079 turning a development branch into stable substantially changes the functionality,
2080 user interface or configuration syntax. Majors 1 and 2 were
2081 <application>Junkbuster</application>, and 3 will be the first stable
2082 <application>Privoxy</application> release.
2087 Y, the version minor, represents the branch within the major version.
2088 At any point in time, there are two branches being maintained:
2089 The stable branch, with an even minor, say, 2N, in which no functionality is
2090 being added and only bug-fixes are made, and 2N+1, the development branch, in
2091 which the further development of <application>Privoxy</application> takes
2093 This enables us to turn the code upside down and inside out, while at the same time
2094 providing and maintaining a stable version.
2095 The minor is reset to zero (and one) when the major is incremented. When a development
2096 branch has matured to the point where it can be turned into stable, the old stable branch
2097 2N is given up (i.e. no longer maintained), the former development branch 2N+1 becomes the
2098 new stable branch 2N+2, and a new development branch 2N+3 is opened.
2103 Z, the point or sub version, represents a release of the software within a branch.
2104 It is therefore incremented immediately before each code freeze.
2105 In development branches, only the even point versions correspond to actual releases,
2106 while the odd ones denote the evolving state of the sources on CVS in between.
2107 It follows that Z is odd on CVS in development branches most of the time. There, it gets
2108 increased to an even number immediately before a code freeze, and is increased to an odd
2109 number again immediately thereafter.
2110 This ensures that builds from CVS snapshots are easily distinguished from released versions.
2111 The point version is reset to zero when the minor changes.
2117 In summary, the main CVS trunk is the development branch where new
2118 features are being worked on for the next stable series. This should
2119 almost always be where the most activity takes place. There is always at
2120 least one stable branch from the trunk, e.g now it is 3.0, which is only
2121 used to release stable versions. Once the initial .0 release of the
2122 stable branch has been done, then as a rule, only bugfixes that have had
2123 prior testing should be committed to the stable branch. At that point, it
2124 is mostly <quote>hands off</quote>. Once there are enough bugfixes to
2125 justify a new release, the version of this branch is again incremented
2126 Example: 3.0.0 -> 3.0.1 -> 3.0.2, etc are all stable releases from within
2127 the stable branch. 3.1.x is currently the main trunk, and where work on
2128 3.2.x is taking place. If any questions, please post to the devel list
2129 <emphasis>before</emphasis> committing to a stable branch!
2135 <sect2 id="beforerelease">
2136 <title>Before the Release: Freeze</title>
2138 The following <emphasis>must be done by one of the
2139 developers</emphasis> prior to each new release.
2145 Make sure that everybody who has worked on the code in the last
2146 couple of days has had a chance to yell <quote>no!</quote> in case
2147 they have pending changes/fixes in their pipelines. Announce the
2148 freeze so that nobody will interfere with last minute changes.
2153 Increment the version number (point from odd to even in development
2154 branches!) in <filename>configure.in</filename>. (RPM spec files
2155 will need to be incremented as well.)
2160 If <filename>default.action</filename> has changed since last
2161 release (i.e. software release or standalone actions file release),
2162 bump up its version info to A.B in this line:
2166 {+add-header{X-Actions-File-Version: A.B} -filter -no-popups}
2170 Then change the version info in doc/webserver/actions/index.php,
2171 line: '$required_actions_file_version = "A.B";'
2176 All documentation should be rebuild after the version bump.
2177 Finished docs should be then be committed to CVS (for those
2178 without the ability to build these). Some docs may require
2179 rather obscure processing tools. <filename>config</filename>,
2180 the man page (and the html version of the man page), and the PDF docs
2181 fall in this category. REAMDE, the man page, AUTHORS, and config
2182 should all also be committed to CVS for other packagers. The
2183 formal docs should be uploaded to the webserver. See the
2184 Section "Updating the webserver" in this manual for details.
2189 The <citetitle>User Manual</citetitle> is also used for context
2190 sensitive help for the CGI editor. This is version sensitive, so that
2191 the user will get appropriate help for his/her release. So with
2192 each release a fresh version should be uploaded to the webserver
2193 (this is in addition to the main <citetitle>User Manual</citetitle>
2194 link from the main page since we need to keep manuals for various
2195 versions available). The CGI pages will link to something like
2196 <literal>http://privoxy.org/$(VERSION)/user-manual/</literal>. This
2197 will need to be updated for each new release. There is no Makefile
2198 target for this at this time!!! It needs to be done manually.
2203 All developers should look at the <filename>ChangeLog</filename> and
2204 make sure noteworthy changes are referenced.
2209 <emphasis>Commit all files that were changed in the above steps!</emphasis>
2214 Tag all files in CVS with the version number with
2215 <quote><command>cvs tag v_X_Y_Z</command></quote>.
2216 Don't use vX_Y_Z, ver_X_Y_Z, v_X.Y.Z (won't work) etc.
2221 If the release was in a development branch, increase the point version
2222 from even to odd (X.Y.(Z+1)) again in <filename>configure.in</filename> and
2228 On the webserver, copy the user manual to a new top-level directory
2229 called <filename>X.Y.Z</filename>. This ensures that help links from the CGI
2230 pages, which have the version as a prefix, will go into the right version of the manual.
2231 If this is a development branch release, also symlink <filename>X.Y.(Z-1)</filename>
2232 to <filename>X.Y.Z</filename> and <filename>X.Y.(Z+1)</filename> to
2233 <filename>.</filename> (i.e. dot).
2240 <sect2 id="therelease">
2241 <title>Building and Releasing the Packages</title>
2243 Now the individual packages can be built and released. Note that for
2244 GPL reasons the first package to be released is always the source tarball.
2248 For <emphasis>all</emphasis> types of packages, including the source tarball,
2249 <emphasis>you must make sure that you build from clean sources by exporting
2250 the right version from CVS into an empty directory</emphasis> (just press return when
2251 asked for a password):
2256 mkdir dist # delete or choose different name if it already exists
2258 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
2259 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa export -r v_X_Y_Z current
2264 <emphasis>Do NOT change</emphasis> a single bit, including, but not limited to
2265 version information after export from CVS. This is to make sure that
2266 all release packages, and with them, all future bug reports, are based
2267 on exactly the same code.
2271 Please find additional instructions for the source tarball and the
2272 individual platform dependent binary packages below. And details
2273 on the Sourceforge release process below that.
2276 <sect3 id="pack-guidelines">
2277 <title>Note on Privoxy Packaging</title>
2279 Please keep these general guidelines in mind when putting together
2280 your package. These apply to <emphasis>all</emphasis> platforms!
2286 <application>Privoxy</application> <emphasis>requires</emphasis>
2287 write access to: all <filename>*.action</filename> files, all
2288 logfiles, and the <filename>trust</filename> file. You will
2289 need to determine the best way to do this for your platform.
2294 Please include up to date documentation. At a bare minimum:
2298 <filename>LICENSE</filename> (top-level directory)
2303 <filename>README</filename> (top-level directory)
2308 <filename>AUTHORS</filename> (top-level directory)
2313 <filename>man page</filename> (top-level directory, Unix-like
2319 <filename>The User Manual</filename> (doc/webserver/user-manual/)
2324 <filename>FAQ</filename> (doc/webserver/faq/)
2328 Also suggested: <filename>Developer Manual</filename>
2329 (doc/webserver/developer-manual) and <filename>ChangeLog</filename>
2330 (top-level directory). <filename>FAQ</filename> and the manuals are
2331 HTML docs. There are also text versions in
2332 <filename>doc/text/</filename> which could conceivably also be
2336 The documentation has been designed such that the manuals are linked
2337 to each other from parallel directories, and should be packaged
2338 that way. <filename>privoxy-index.html</filename> can also be
2339 included and can serve as a focal point for docs and other links of
2340 interest (and possibly renamed to <filename>index.html</filename>).
2341 This should be one level up from the manuals. There is a link also
2342 on this page to an HTMLized version of the man page. To avoid 404 for
2343 this, it is in CVS as
2344 <filename>doc/webserver/man-page/privoxy-man-page.html</filename>,
2345 and should be included along with the manuals. There is also a
2346 css stylesheets that can be included for better presentation:
2347 <filename>p_doc.css</filename>. This should be in the same directory
2348 with <filename>privoxy-index.html</filename>, (i.e. one level up from
2349 the manual directories).
2354 <filename>user.action</filename> is designed for local preferences.
2355 Make sure this does not get overwritten!
2360 Other configuration files should be installed as the new defaults,
2361 but all previously installed configuration files should be preserved
2362 as backups. This is just good manners :-)
2367 Please check platform specific notes in this doc, if you haven't
2368 done <quote>Privoxy</quote> packaging before for other platform
2369 specific issues. Conversely, please add any notes that you know
2370 are important for your platform (or contact one of the doc
2371 maintainers to do this if you can't).
2376 Packagers should do a <quote>clean</quote> install of their
2377 package after building it. So any previous installs should be
2378 removed first to ensure the integrity of the newly built package.
2379 Then run the package for a while to make sure there are no
2380 obvious problems, before uploading.
2389 <sect3 id="newrelease-tarball"><title>Source Tarball</title>
2391 First, <emphasis>make sure that you have freshly exported the right
2392 version into an empty directory</emphasis>. (See "Building and releasing
2393 packages" above). Then run:
2398 autoheader && autoconf && ./configure
2410 To upload the package to Sourceforge, simply issue
2418 Go to the displayed URL and release the file publicly on Sourceforge.
2419 For the change log field, use the relevant section of the
2420 <filename>ChangeLog</filename> file.
2424 <sect3 id="newrelease-rpm"><title>SuSE, Conectiva or Red Hat RPM</title>
2426 In following text, replace <replaceable class="parameter">dist</replaceable>
2427 with either <quote>rh</quote> for Red Hat or <quote>suse</quote> for SuSE.
2430 First, <emphasis>make sure that you have freshly exported the right
2431 version into an empty directory</emphasis>. (See "Building and releasing
2435 As the only exception to not changing anything after export from CVS,
2436 now examine the file <filename>privoxy-</filename><replaceable class="parameter">dist</replaceable><filename>.spec</filename>
2437 and make sure that the version information and the RPM release number are
2438 correct. The RPM release numbers for each version start at one. Hence it must
2439 be reset to one if this is the first RPM for
2440 <replaceable class="parameter">dist</replaceable> which is built from version
2442 <ulink url="http://sourceforge.net/project/showfiles.php?group_id=11118">file
2443 list</ulink> if unsure. Else, it must be set to the highest already available RPM
2444 release number for that version plus one.
2452 autoheader && autoconf && ./configure
2460 make <replaceable class="parameter">dist</replaceable>-dist
2464 To upload the package to Sourceforge, simply issue
2468 make <replaceable class="parameter">dist</replaceable>-upload <replaceable class="parameter">rpm_packagerev</replaceable>
2472 where <replaceable class="parameter">rpm_packagerev</replaceable> is the
2473 RPM release number as determined above.
2474 Go to the displayed URL and release the file publicly on Sourceforge.
2475 Use the release notes and change log from the source tarball package.
2479 <sect3 id="newrelease-os2"><title>OS/2</title>
2481 First, <emphasis>make sure that you have freshly exported the right
2482 version into an empty directory</emphasis>. (See "Building and releasing
2483 packages" above). Then get the OS/2 Setup module:
2487 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co os2setup
2491 You will need a mix of development tools.
2492 The main compilation takes place with IBM Visual Age C++.
2493 Some ancillary work takes place with GNU tools, available from
2494 various sources like hobbes.nmsu.edu.
2495 Specificially, you will need <filename>autoheader</filename>,
2496 <filename>autoconf</filename> and <filename>sh</filename> tools.
2497 The packaging takes place with WarpIN, available from various sources, including
2498 its home page: <ulink url="http://www.xworkplace.org/">xworkplace</ulink>.
2501 Change directory to the <filename>os2setup</filename> directory.
2502 Edit the os2build.cmd file to set the final executable filename.
2507 installExeName='privoxyos2_setup_X.Y.Z.exe'
2511 Next, edit the <filename>IJB.wis</filename> file so the release number matches
2512 in the <filename>PACKAGEID</filename> section:
2516 PACKAGEID="Privoxy Team\Privoxy\Privoxy Package\X\Y\Z"
2520 You're now ready to build. Run:
2528 You will find the WarpIN-installable executable in the
2529 <filename>./files</filename> directory. Upload this anonymously to
2530 <filename>uploads.sourceforge.net/incoming</filename>, create a release
2531 for it, and you're done. Use the release notes and Change Log from the
2532 source tarball package.
2536 <sect3 id="newrelease-solaris"><title>Solaris</title>
2538 Login to Sourceforge's compilefarm via ssh:
2542 ssh cf.sourceforge.net
2546 Choose the right operating system (not the Debian one).
2547 When logged in, <emphasis>make sure that you have freshly exported the right
2548 version into an empty directory</emphasis>. (See "Building and releasing
2549 packages" above). Then run:
2554 autoheader && autoconf && ./configure
2566 which creates a gzip'ed tar archive. Sadly, you cannot use <command>make
2567 solaris-upload</command> on the Sourceforge machine (no ncftpput). You now have
2568 to manually upload the archive to Sourceforge's ftp server and release
2569 the file publicly. Use the release notes and Change Log from the
2570 source tarball package.
2574 <sect3 id="newrelease-windows"><title>Windows</title>
2576 You should ensure you have the latest version of Cygwin (from
2577 <ulink url="http://www.cygwin.com/">http://www.cygwin.com/</ulink>).
2578 Run the following commands from within a Cygwin bash shell.
2581 First, <emphasis>make sure that you have freshly exported the right
2582 version into an empty directory</emphasis>. (See "Building and releasing
2583 packages" above). Then get the Windows setup module:
2587 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co winsetup
2591 Then you can build the package. This is fully automated, and is
2592 controlled by <filename>winsetup/GNUmakefile</filename>.
2593 All you need to do is:
2602 Now you can manually rename <filename>privoxy_setup.exe</filename> to
2603 <filename>privoxy_setup_X_Y_Z.exe</filename>, and upload it to
2604 SourceForge. When releasing the package on SourceForge, use the release notes
2605 and Change Log from the source tarball package.
2609 <sect3 id="newrelease-debian"><title>Debian</title>
2611 First, <emphasis>make sure that you have freshly exported the
2612 right version into an empty directory</emphasis>. (See
2613 "Building and releasing packages" above). Then add a log
2614 entry to <filename>debian/changelog</filename>, if it is not
2615 already there, for example by running:
2619 debchange -v &p-version;-&p-status;-1 "New upstream version"
2627 dpkg-buildpackage -rfakeroot -us -uc -b
2632 <filename>../privoxy_&p-version;-&p-status;-1_i386.deb</filename>
2633 which can be uploaded. To upload the package to Sourceforge, simply
2643 <sect3 id="newrelease-macosx"><title>Mac OSX</title>
2645 First, <emphasis>make sure that you have freshly exported the right
2646 version into an empty directory</emphasis>. (See "Building and releasing
2647 packages" above). Then get the Mac OSX setup module:
2651 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co osxsetup
2664 This will run <filename>autoheader</filename>, <filename>autoconf</filename> and
2665 <filename>configure</filename> as well as <filename>make</filename>.
2666 Finally, it will copy over the necessary files to the ./osxsetup/files directory
2667 for further processing by <filename>PackageMaker</filename>.
2670 Bring up PackageMaker with the PrivoxyPackage.pmsp definition file, modify the package
2671 name to match the release, and hit the "Create package" button.
2672 If you specify ./Privoxy.pkg as the output package name, you can then create
2673 the distributable zip file with the command:
2677 zip -r privoxyosx_setup_x.y.z.zip Privoxy.pkg
2681 You can then upload <filename>privoxyosx_setup_x.y.z.zip</filename> anonymously to
2682 <filename>uploads.sourceforge.net/incoming</filename>,
2683 create a release for it, and you're done. Use the release notes
2684 and Change Log from the source tarball package.
2688 <sect3 id="newrelease-freebsd"><title>FreeBSD</title>
2690 Login to Sourceforge's compile-farm via ssh:
2694 ssh cf.sourceforge.net
2698 Choose the right operating system.
2699 When logged in, <emphasis>make sure that you have freshly exported the right
2700 version into an empty directory</emphasis>. (See "Building and releasing
2701 packages" above). Then run:
2706 autoheader && autoconf && ./configure
2718 which creates a gzip'ed tar archive. Sadly, you cannot use <command>make
2719 freebsd-upload</command> on the Sourceforge machine (no ncftpput). You now have
2720 to manually upload the archive to Sourceforge's ftp server and release
2721 the file publicly. Use the release notes and Change Log from the
2722 source tarball package.
2726 <sect3 id="newrelease-hpux"><title>HP-UX 11</title>
2728 First, <emphasis>make sure that you have freshly exported the right
2729 version into an empty directory</emphasis>. (See "Building and releasing
2730 packages" above). Then run:
2735 autoheader && autoconf && ./configure
2743 <sect3 id="newrelease-amiga"><title>Amiga OS</title>
2745 First, <emphasis>make sure that you have freshly exported the right
2746 version into an empty directory</emphasis>. (See "Building and releasing
2747 packages" above). Then run:
2752 autoheader && autoconf && ./configure
2760 <sect3 id="newrelease-aix"><title>AIX</title>
2762 Login to Sourceforge's compilefarm via ssh:
2766 ssh cf.sourceforge.net
2770 Choose the right operating system.
2771 When logged in, <emphasis>make sure that you have freshly exported the right
2772 version into an empty directory</emphasis>. (See "Building and releasing
2773 packages" above). Then run:
2778 autoheader && autoconf && ./configure
2790 which creates a gzip'ed tar archive. Sadly, you cannot use <command>make
2791 aix-upload</command> on the Sourceforge machine (no ncftpput). You now have
2792 to manually upload the archive to Sourceforge's ftp server and release
2793 the file publicly. Use the release notes and Change Log from the
2794 source tarball package.
2799 <sect2 id="releasing">
2800 <title>Uploading and Releasing Your Package</title>
2802 After the package is ready, it is time to upload it
2803 to SourceForge, and go through the release steps. The upload
2810 Upload to: <ulink url="ftp://upload.sourceforge.net/incoming">ftp://upload.sourceforge.net/incoming</ulink>
2815 user: <literal>anonymous</literal>
2820 password: <literal>ijbswa-developers@lists.sourceforge.net</literal>
2826 Or use the <command>make</command> targets as described above.
2829 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>,
2830 making sure you are logged in. Find your target platform in the
2831 second column, and click <literal>Add Release</literal>. You will
2832 then need to create a new release for your package, using the format
2833 of <literal>$VERSION ($CODE_STATUS)</literal>, e.g. <emphasis>&p-version;
2837 Now just follow the prompts. Be sure to add any appropriate Release
2838 notes. You should see your freshly uploaded packages in
2839 <quote>Step 2. Add Files To This Release</quote>. Check the
2840 appropriate box(es). Remember at each step to hit the
2841 <quote>Refresh/Submit</quote> buttons! You should now see your
2842 file(s) listed in Step 3. Fill out the forms with the appropriate
2843 information for your platform, being sure to hit <quote>Update</quote>
2844 for each file. If anyone is monitoring your platform, check the
2845 <quote>email</quote> box at the very bottom to notify them of
2846 the new package. This should do it!
2849 If you have made errors, or need to make changes, you can go through
2850 essentially the same steps, but select <literal>Edit Release</literal>,
2851 instead of <literal>Add Release</literal>.
2855 <sect2 id="afterrelease">
2856 <title>After the Release</title>
2858 When all (or: most of the) packages have been uploaded and made available,
2859 send an email to the <ulink url="mailto:ijbswa-announce@lists.sourceforge.net">announce
2860 mailing list</ulink>, Subject: "Version X.Y.Z available for download". Be sure to
2862 <ulink url="http://sourceforge.net/project/showfiles.php?group_id=11118">download
2863 location</ulink>, the release notes and the Changelog. Also, post an
2864 updated News item on the project page Sourceforge, and update the Home
2865 page and docs linked from the Home page (see below).
2871 <!-- ~~~~~ New section ~~~~~ -->
2872 <sect1 id="webserver-update"><title>Update the Webserver</title>
2874 The webserver should be updated at least with each stable release. When
2875 updating, please follow these steps to make sure that no broken links,
2876 inconsistent contents or permission problems will occur (as it has many
2877 times in the past!):
2880 If you have changed anything in the stable-branch documentation source
2885 make dok dok-pdf # (or 'make redhat-dok dok-pdf' if 'make dok' doesn't work for you)
2889 That will generate <filename>doc/webserver/user-manual</filename>,
2890 <filename>doc/webserver/developer-manual</filename>,
2891 <filename>doc/webserver/faq</filename>,
2892 <filename>doc/pdf/*.pdf</filename> and
2893 <filename>doc/webserver/index.html</filename> automatically.
2896 If you changed the manual page sources, generate
2897 <filename>doc/webserver/man-page/privoxy-man-page.html</filename>
2898 by running <quote><command>make man</command></quote>. (This is
2899 a separate target due to dependencies on some obscure perl scripts
2900 [now in CVS, but not well tested]. See comments in <filename>GNUmakefile</filename>.)
2903 If you want to add new files to the webserver, create them locally in
2904 the <filename>doc/webserver/*</filename> directory (or
2905 create new directories under <filename>doc/webserver</filename>).
2908 Next, commit any changes from the above steps to CVS. All set?
2909 If these are docs in the stable branch, then do:
2917 This will do the upload to <ulink url="http://www.privoxy.org/">the
2918 webserver</ulink> (www.privoxy.org) and ensure all files and directories
2919 there are group writable.
2922 Please do <emphasis>NOT</emphasis> use any other means of transferring
2923 files to the webserver to avoid permission problems. Also, please do not
2924 upload docs from development branches or versions. The publicly posted
2925 docs should be in sync with the last official release.
2929 <!-- ~~~~~ New section ~~~~~ -->
2930 <sect1 id="contact"><title>Contacting the developers, Bug Reporting and Feature Requests</title>
2931 <!-- Include contacting.sgml -->
2933 <!-- end contacting -->
2937 <!-- ~~~~~~~~ New section Header ~~~~~~~~~ -->
2938 <sect1 id="copyright"><title>Privoxy Copyright, License and History</title>
2940 <!-- Include copyright.sgml -->
2944 <!-- ~~~~~ New section ~~~~~ -->
2945 <sect2><title>License</title>
2946 <!-- Include copyright.sgml: -->
2948 <!-- end copyright -->
2950 <!-- ~ End section ~ -->
2952 <!-- ~~~~~ New section ~~~~~ -->
2953 <sect2><title>History</title>
2954 <!-- Include history.sgml -->
2961 <!-- ~~~~~ New section ~~~~~ -->
2962 <sect1 id="seealso"><title>See also</title>
2963 <!-- Include seealso.sgml -->
2971 This program is free software; you can redistribute it
2972 and/or modify it under the terms of the GNU General
2973 Public License as published by the Free Software
2974 Foundation; either version 2 of the License, or (at
2975 your option) any later version.
2977 This program is distributed in the hope that it will
2978 be useful, but WITHOUT ANY WARRANTY; without even the
2979 implied warranty of MERCHANTABILITY or FITNESS FOR A
2980 PARTICULAR PURPOSE. See the GNU General Public
2981 License for more details.
2983 The GNU General Public License should be included with
2984 this file. If not, you can view it at
2985 http://www.gnu.org/copyleft/gpl.html
2986 or write to the Free Software Foundation, Inc., 59
2987 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2989 $Log: developer-manual.sgml,v $
2990 Revision 1.46.2.8 2002/08/17 00:16:10 hal9
2991 Add note on updating webserver for User-manual/CGI editor, which is version
2992 dependent (and different from main UM link).
2994 Revision 1.46.2.7 2002/08/14 17:29:25 hal9
2995 Add small notes on post-release steps, and uploading docs to webserver.
2997 Revision 1.46.2.6 2002/08/10 11:40:25 oes
2998 Added disclaimer about probably being out-of-date and two small hints
3000 Revision 1.46.2.5 2002/08/09 01:15:12 hal9
3001 Added some notes on pre-release steps (test builds first, update ChangeLog).
3003 Revision 1.46.2.4 2002/05/29 00:30:59 mal0rd
3004 Fixed a little formatting. Clarified debian section.
3006 Revision 1.46.2.3 2002/05/28 04:32:45 hal9
3007 Change hints on bundling index.html to privoxy-index.html
3009 Revision 1.46.2.2 2002/05/26 17:04:24 hal9
3010 -Spellcheck, very minor edits, and sync across branches
3012 Revision 1.48 2002/05/26 12:48:31 roro
3013 Add releasing information about Debian.
3015 Revision 1.47 2002/05/26 04:55:11 mal0rd
3016 Added debian-dist and debian-upload targets. Also documented usage.
3018 Revision 1.46 2002/05/22 17:15:00 oes
3021 Revision 1.45 2002/05/19 23:01:54 hal9
3022 Add small section on general packaging guidelines (e.g. actions files must
3025 Revision 1.44 2002/05/15 03:55:17 hal9
3026 Fix ulink -> link, and minor modification to release process section for
3029 Revision 1.43 2002/05/10 01:48:19 hal9
3030 This is mostly proposed copyright/licensing additions and changes. Docs
3031 are still GPL, but licensing and copyright are more visible. Also, copyright
3032 changed in doc header comments (eliminate references to JB except FAQ).
3034 Revision 1.42 2002/05/05 20:26:02 hal9
3035 Sorting out license vs copyright in these docs.
3037 Revision 1.41 2002/05/04 08:44:44 swa
3040 Revision 1.40 2002/05/04 00:43:43 hal9
3041 -Remove TOC/first page kludge with proper stylesheet fix.
3042 -Combined the two very brief sections: Intro and Quickstart.
3044 Revision 1.39 2002/05/02 15:08:25 oes
3045 Added explanation about version numbers and RPM package revisions
3047 Revision 1.38 2002/04/29 02:20:31 hal9
3048 Add info on steps for uploading and the release process on SF.
3050 Revision 1.37 2002/04/26 17:23:29 swa
3051 bookmarks cleaned, changed structure of user manual, screen and programlisting cleanups, and numerous other changes that I forgot
3053 Revision 1.36 2002/04/26 05:25:23 hal9
3054 Mass commit to catch a few scattered fixes.
3056 Revision 1.35 2002/04/17 15:16:15 oes
3057 Added link to docbook crash course
3059 Revision 1.34 2002/04/15 23:39:32 oes
3060 - Extended & fixed the release section
3061 - Added CVS guideline sections
3062 - Separated webserver section from release section
3063 - Commented out boilerplate inclusion (If you don't know yet what it is,
3064 you shouldn't mess with its code ;-)
3067 Revision 1.33 2002/04/12 03:49:53 hal9
3068 Spell checked. Clarification on where docs are kept.
3070 Revision 1.32 2002/04/11 21:29:58 jongfoster
3071 Documenting Win32 release procedure
3073 Revision 1.31 2002/04/11 09:32:52 oes
3076 Revision 1.30 2002/04/11 09:24:53 oes
3079 Revision 1.29 2002/04/10 18:45:14 swa
3082 Revision 1.28 2002/04/08 22:59:26 hal9
3083 Version update. Spell chkconfig correctly :)
3085 Revision 1.27 2002/04/08 15:31:18 hal9
3086 Touch ups to documentation section.
3088 Revision 1.26 2002/04/07 23:50:08 hal9
3089 Documentation changes to reflect HTML docs now in CVS, and new generated files
3092 Revision 1.25 2002/04/06 05:07:28 hal9
3093 -Add privoxy-man-page.sgml, for man page.
3094 -Add authors.sgml for AUTHORS (and p-authors.sgml)
3095 -Reworked various aspects of various docs.
3096 -Added additional comments to sub-docs.
3098 Revision 1.24 2002/04/04 21:33:37 hal9
3099 More on documenting the documents.
3101 Revision 1.23 2002/04/04 18:46:47 swa
3102 consistent look. reuse of copyright, history et. al.
3104 Revision 1.22 2002/04/04 17:27:56 swa
3105 more single file to be included at multiple points. make maintaining easier
3107 Revision 1.21 2002/04/04 06:48:37 hal9
3108 Structural changes to allow for conditional inclusion/exclusion of content
3109 based on entity toggles, e.g. 'entity % p-not-stable "INCLUDE"'. And
3110 definition of internal entities, e.g. 'entity p-version "2.9.13"' that will
3111 eventually be set by Makefile.
3112 More boilerplate text for use across multiple docs.
3114 Revision 1.20 2002/04/04 03:28:27 david__schmidt
3117 Revision 1.19 2002/04/03 15:09:42 david__schmidt
3118 Add OS/2 build section
3120 Revision 1.18 2002/04/03 03:51:48 hal9
3123 Revision 1.17 2002/04/03 01:21:17 hal9
3124 Implementing Andreas's suggestions for Release sections.
3126 Revision 1.16 2002/03/31 23:04:40 hal9
3127 Fleshed out the doc section, and added something for an intro so it was not
3130 Revision 1.15 2002/03/30 22:29:47 swa
3133 Revision 1.14 2002/03/30 19:04:08 swa
3134 people release differently. no good.
3135 I want to make parts of the docs only.
3137 Revision 1.13 2002/03/27 01:16:41 hal9
3140 Revision 1.12 2002/03/27 01:02:51 hal9
3141 Touch up on name change...
3143 Revision 1.11 2002/03/26 22:29:55 swa
3144 we have a new homepage!
3146 Revision 1.10 2002/03/24 12:33:01 swa
3149 Revision 1.9 2002/03/24 11:01:05 swa
3152 Revision 1.8 2002/03/23 15:13:11 swa
3153 renamed every reference to the old name with foobar.
3154 fixed "application foobar application" tag, fixed
3155 "the foobar" with "foobar". left junkbustser in cvs
3156 comments and remarks to history untouched.
3158 Revision 1.7 2002/03/11 13:13:27 swa
3159 correct feedback channels
3161 Revision 1.6 2002/02/24 14:25:06 jongfoster
3162 Formatting changes. Now changing the doctype to DocBook XML 4.1
3163 will work - no other changes are needed.
3165 Revision 1.5 2001/10/31 18:16:51 swa
3166 documentation added: howto generate docs in text and html
3167 format, howto move stuff to the webserver.
3169 Revision 1.4 2001/09/23 10:13:48 swa
3170 upload process established. run make webserver and
3171 the documentation is moved to the webserver. documents
3172 are now linked correctly.
3174 Revision 1.3 2001/09/13 15:27:40 swa
3177 Revision 1.2 2001/09/13 15:20:17 swa
3178 merged standards into developer manual
3180 Revision 1.1 2001/09/12 15:36:41 swa
3181 source files for junkbuster documentation
3183 Revision 1.3 2001/09/10 17:43:59 swa
3184 first proposal of a structure.
3186 Revision 1.2 2001/06/13 14:28:31 swa
3187 docs should have an author.
3189 Revision 1.1 2001/06/13 14:20:37 swa
3190 first import of project's documentation for the webserver.