1 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN"[
2 <!entity % dummy "INCLUDE">
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 p-version "2.9.13">
11 <!entity p-status "BETA">
12 <!entity % p-not-stable "INCLUDE"> <!-- set to IGNORE for stable release -->
13 <!entity % p-stable "IGNORE"> <!-- set INCLUDE for stable release -->
14 <!entity % p-text "IGNORE"> <!-- define we are not a text only doc -->
15 <!entity % p-doc "INCLUDE"> <!-- and we are a formal doc -->
18 File : $Source: /cvsroot/ijbswa/current/doc/source/developer-manual.sgml,v $
20 Purpose : developer manual
21 This file belongs into
22 ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/
24 $Id: developer-manual.sgml,v 1.22 2002/04/04 17:27:56 swa Exp $
26 Written by and Copyright (C) 2001 the SourceForge
27 Privoxy team. http://www.privoxy.org/
29 Based on the Internet Junkbuster originally written
30 by and Copyright (C) 1997 Anonymous Coders and
31 Junkbusters Corporation. http://www.junkbusters.com
36 <title>Privoxy Developer Manual</title>
38 <pubdate>$Id: developer-manual.sgml,v 1.22 2002/04/04 17:27:56 swa Exp $</pubdate>
43 <orgname>By: Privoxy Developers</orgname>
52 This is here to keep vim syntax file from breaking :/
53 If I knew enough to fix it, I would.
54 PLEASE DO NOT REMOVE! HB: hal@foobox.net
59 The developer manual gives the users information on how to help the developer
60 team. It provides guidance on coding, testing, documentation and other
64 <!-- Include privoxy.sgml boilerplate text: -->
68 <!-- end boilerplate -->
71 You can find the latest version of the this manual at <ulink
72 url="http://www.privoxy.org/developer-manual/">http://www.privoxy.org/developer-manual/</ulink>.
73 Please see the Contact section on how to contact the developers.
77 <!-- Feel free to send a note to the developers at <email>ijbswa-developers@lists.sourceforge.net</email>. -->
83 <!-- ~~~~~ New section ~~~~~ -->
84 <sect1 id="intro" label=""><title></title>
85 <!-- dummy section to force TOC on page by itself -->
86 <!-- DO NOT REMOVE! please ;) -->
90 <!-- ~~~~~ New section ~~~~~ -->
93 <!-- ~~~~~ New section ~~~~~ -->
94 <sect1 label="1" id="introduction"><title>Introduction</title>
97 I don't like seeing blank space :) So added *something* here.
101 <application>Privoxy</application>, as an heir to
102 <application>Junkbuster</application>, is an Open Source project
103 and licensed under the GPL. As such, <application>Privoxy</application>
104 development is potentially open to anyone who has the time, knowledge,
105 and desire to contribute in any capacity. Our goals are simply to
106 continue the mission, to improve <application>Privoxy</application>, and
107 to make it available to as wide an audience as possible.
110 One does not have to be a programmer to contribute. Packaging, testing,
111 and porting, are all important jobs as well.
115 <!-- ~~~~~ New section ~~~~~ -->
116 <sect1 id="quickstart"><title>Quickstart to Privoxy Development</title>
118 You'll need an account on <ulink
119 url="http://sourceforge.net">Sourceforge</ulink> to support our development.
120 Mail your ID to the list and wait until a project manager has added you.
124 For the time being (read, this section is under construction), please note the
125 following guidelines for changing stuff in the code. If it is
126 <orderedlist numeration="arabic">
128 A bugfix / clean-up / cosmetic thing: shoot
131 A new feature that can be turned off: shoot
134 A clear improvement w/o side effects on other parts of the code: shoot
137 A matter of taste: ask the list
140 A major redesign of some part of the code: ask the list
146 <!-- ~~~~~ New section ~~~~~ -->
147 <sect1 id="documentation"><title>Documentation Guidelines</title>
149 All formal documents are maintained in docbook SGML and located
150 in the <computeroutput>doc/source</computeroutput> directory. You will
151 need <ulink url="http://www.docbook.org">docbook</ulink> and the
152 docbook stylesheets (or comparable alternatives), and either
153 <application>jade</application> or <application>openjade</application>
154 installed in order to build docs from source. Currently there is
156 url="../user-manual/index.html"><citetitle>user-manual</citetitle></ulink>,
158 url="../faq/index.html"><citetitle>FAQ</citetitle></ulink>,
159 and, of course this, the <citetitle>developer-manual</citetitle> in
163 Other, less formal documents (e.g. README, LICENSE) are
164 maintained as plain text files in the toplevel source
168 Packagers are encouraged to include this documentation. For those
169 without the ability to build the docs locally, text versions of
170 each are kept in CVS. Or HTML versions can be downloaded from the <ulink
171 url="http://www.privoxy.org">www.privoxy.org</ulink> website, which
172 should be fairly current.
175 Formal documents are built with the Makefile targets of
176 <computeroutput>make dok</computeroutput>, or alternately
177 <computeroutput>make redhat-dok</computeroutput>. If you
178 have problems, try both. The build process uses the document
179 SGML sources in <computeroutput>doc/source</computeroutput> to
180 update all text files in <computeroutput>doc/text</computeroutput>
181 and to update all HTML documents in
182 <computeroutput>doc/webserver</computeroutput>.
185 Documentation writers should please make sure documents build
186 successfully before committing to CVS.
189 How do you update the webserver (i.e. the pages on privoxy.org)?
190 <orderedlist numeration="arabic">
192 First, build the docs by running <computeroutput>make
193 dok</computeroutput> (or alternately <computeroutput>make
194 redhat-dok</computeroutput>).
197 Run <computeroutput>make webserver</computeroutput> which copies all files from
198 <computeroutput>doc/webserver</computeroutput> to the sourceforge webserver
205 <!-- <listitem><para>be consistent with the redirect script (i.e. the <application>Privoxy</application> program -->
206 <!-- points via the redirect URL at sf to valid end-points in the document)</para></listitem> -->
208 <!-- ~~~~~ New section ~~~~~ -->
209 <sect1 id="coding"><title>Coding Guidelines</title>
211 <sect2 id="s1"><title>Introduction</title>
213 <para>This set of standards is designed to make our lives easier. It is
214 developed with the simple goal of helping us keep the "new and improved
215 <application>Privoxy</application>" consistent and reliable. Thus making
216 maintenance easier and increasing chances of success of the
219 <para>And that of course comes back to us as individuals. If we can
220 increase our development and product efficiencies then we can solve more
221 of the request for changes/improvements and in general feel good about
222 ourselves. ;-></para>
226 <sect2 id="s2"><title>Using Comments</title>
229 <sect3 id="s3"><title>Comment, Comment, Comment</title>
231 <para><emphasis>Explanation:</emphasis></para>
233 <para>Comment as much as possible without commenting the obvious.
234 For example do not comment "aVariable is equal to bVariable".
235 Instead explain why aVariable should be equal to the bVariable.
236 Just because a person can read code does not mean they will
237 understand why or what is being done. A reader may spend a lot
238 more time figuring out what is going on when a simple comment
239 or explanation would have prevented the extra research. Please
240 help your brother IJB'ers out!</para>
242 <para>The comments will also help justify the intent of the code.
243 If the comment describes something different than what the code
244 is doing then maybe a programming error is occurring.</para>
246 <para><emphasis>Example:</emphasis></para>
248 /* if page size greater than 1k ... */
249 if ( PageLength() > 1024 )
251 ... "block" the page up ...
254 /* if page size is small, send it in blocks */
255 if ( PageLength() > 1024 )
257 ... "block" the page up ...
260 This demonstrates 2 cases of "what not to do". The first is a
261 "syntax comment". The second is a comment that does not fit what
262 is actually being done.
268 <sect3 id="s4"><title>Use blocks for comments</title>
270 <para><emphasis>Explanation:</emphasis></para>
272 <para>Comments can help or they can clutter. They help when they
273 are differentiated from the code they describe. One line
274 comments do not offer effective separation between the comment
275 and the code. Block identifiers do, by surrounding the code
276 with a clear, definable pattern.</para>
278 <para><emphasis>Example:</emphasis></para>
280 /*********************************************************************
281 * This will stand out clearly in your code!
282 *********************************************************************/
283 if ( thisVariable == thatVariable )
285 DoSomethingVeryImportant();
289 /* unfortunately, this may not */
290 if ( thisVariable == thatVariable )
292 DoSomethingVeryImportant();
296 if ( thisVariable == thatVariable ) /* this may not either */
298 DoSomethingVeryImportant();
301 <para><emphasis>Exception:</emphasis></para>
303 <para>If you are trying to add a small logic comment and do not
304 wish to "disrubt" the flow of the code, feel free to use a 1
305 line comment which is NOT on the same line as the code.</para>
311 <sect3 id="s5"><title>Keep Comments on their own line</title>
313 <para><emphasis>Explanation:</emphasis></para>
315 <para>It goes back to the question of readability. If the comment
316 is on the same line as the code it will be harder to read than
317 the comment that is on its own line.</para>
319 <para>There are three exceptions to this rule, which should be
320 violated freely and often: during the definition of variables,
321 at the end of closing braces, when used to comment
324 <para><emphasis>Example:</emphasis></para>
326 /*********************************************************************
327 * This will stand out clearly in your code,
328 * But the second example won't.
329 *********************************************************************/
330 if ( thisVariable == thatVariable )
332 DoSomethingVeryImportant();
335 if ( thisVariable == thatVariable ) /*can you see me?*/
337 DoSomethingVeryImportant(); /*not easily*/
341 /*********************************************************************
342 * But, the encouraged exceptions:
343 *********************************************************************/
344 int urls_read = 0; /* # of urls read + rejected */
345 int urls_rejected = 0; /* # of urls rejected */
349 DoSomethingVeryImportant();
353 short DoSomethingVeryImportant(
354 short firstparam, /* represents something */
355 short nextparam /* represents something else */ )
359 } /* -END- DoSomethingVeryImportant */
364 <sect3 id="s6"><title>Comment each logical step</title>
366 <para><emphasis>Explanation:</emphasis></para>
368 <para>Logical steps should be commented to help others follow the
369 intent of the written code and comments will make the code more
372 <para>If you have 25 lines of code without a comment, you should
373 probably go back into it to see where you forgot to put
376 <para>Most "for", "while", "do", etc... loops _probably_ need a
377 comment. After all, these are usually major logic
384 <sect3 id="s7"><title>Comment All Functions Thoroughly</title>
386 <para><emphasis>Explanation:</emphasis></para>
388 <para>A reader of the code should be able to look at the comments
389 just prior to the beginning of a function and discern the
390 reason for its existence and the consequences of using it. The
391 reader should not have to read through the code to determine if
392 a given function is safe for a desired use. The proper
393 information thoroughly presented at the introduction of a
394 function not only saves time for subsequent maintenance or
395 debugging, it more importantly aids in code reuse by allowing a
396 user to determine the safety and applicability of any function
397 for the problem at hand. As a result of such benefits, all
398 functions should contain the information presented in the
399 addendum section of this document.</para>
405 <sect3 id="s8"><title>Comment at the end of braces if the
406 content is more than one screen length</title>
408 <para><emphasis>Explanation:</emphasis></para>
410 <para>Each closing brace should be followed on the same line by a
411 comment that describes the origination of the brace if the
412 original brace is off of the screen, or otherwise far away from
413 the closing brace. This will simplify the debugging,
414 maintenance, and readability of the code.</para>
416 <para>As a suggestion , use the following flags to make the
417 comment and its brace more readable:</para>
419 <para>use following a closing brace: } /* -END- if() or while ()
422 <para><emphasis>Example:</emphasis></para>
426 DoSomethingVeryImportant();
427 ...some long list of commands...
428 } /* -END- if x is 1 */
434 DoSomethingVeryImportant();
435 ...some long list of commands...
436 } /* -END- if ( 1 == X ) */
442 <sect2 id="s9"><title>Naming Conventions</title>
446 <sect3 id="s10"><title>Variable Names</title>
448 <para><emphasis>Explanation:</emphasis></para>
450 <para>Use all lowercase, and seperate words via an underscore
451 ('_'). Do not start an identifier with an underscore. (ANSI C
452 reserves these for use by the compiler and system headers.) Do
453 not use identifiers which are reserved in ANSI C++. (E.g.
454 template, class, true, false, ...). This is in case we ever
455 decide to port Privoxy to C++.</para>
457 <para><emphasis>Example:</emphasis></para>
459 int ms_iis5_hack = 0;</programlisting>
461 <para><emphasis>Instead of:</emphasis></para>
465 int msiis5hack = 0; int msIis5Hack = 0;
473 <sect3 id="s11"><title>Function Names</title>
475 <para><emphasis>Explanation:</emphasis></para>
477 <para>Use all lowercase, and seperate words via an underscore
478 ('_'). Do not start an identifier with an underscore. (ANSI C
479 reserves these for use by the compiler and system headers.) Do
480 not use identifiers which are reserved in ANSI C++. (E.g.
481 template, class, true, false, ...). This is in case we ever
482 decide to port Privoxy to C++.</para>
484 <para><emphasis>Example:</emphasis></para>
486 int load_some_file( struct client_state *csp )</programlisting>
488 <para><emphasis>Instead of:</emphasis></para>
492 int loadsomefile( struct client_state *csp )
493 int loadSomeFile( struct client_state *csp )
501 <sect3 id="s12"><title>Header file prototypes</title>
503 <para><emphasis>Explanation:</emphasis></para>
505 <para>Use a descriptive parameter name in the function prototype
506 in header files. Use the same parameter name in the header file
507 that you use in the c file.</para>
509 <para><emphasis>Example:</emphasis></para>
511 (.h) extern int load_aclfile( struct client_state *csp );
512 (.c) int load_aclfile( struct client_state *csp )</programlisting>
514 <para><emphasis>Instead of:</emphasis>
516 (.h) extern int load_aclfile( struct client_state * ); or
517 (.h) extern int load_aclfile();
518 (.c) int load_aclfile( struct client_state *csp )
526 <sect3 id="s13"><title>Enumerations, and #defines</title>
528 <para><emphasis>Explanation:</emphasis></para>
530 <para>Use all capital letters, with underscores between words. Do
531 not start an identifier with an underscore. (ANSI C reserves
532 these for use by the compiler and system headers.)</para>
534 <para><emphasis>Example:</emphasis></para>
536 (enumeration) : enum Boolean { FALSE, TRUE };
537 (#define) : #define DEFAULT_SIZE 100;</programlisting>
539 <para><emphasis>Note:</emphasis> We have a standard naming scheme for #defines
540 that toggle a feature in the preprocessor: FEATURE_>, where
541 > is a short (preferably 1 or 2 word) description.</para>
543 <para><emphasis>Example:</emphasis></para>
545 #define FEATURE_FORCE 1
548 #define FORCE_PREFIX blah
549 #endif /* def FEATURE_FORCE */
554 <sect3 id="s14"><title>Constants</title>
556 <para><emphasis>Explanation:</emphasis></para>
558 <para>Spell common words out entirely (do not remove vowels).</para>
560 <para>Use only widely-known domain acronyms and abbreviations.
561 Capitalize all letters of an acronym.</para>
563 <para>Use underscore (_) to separate adjacent acronyms and
564 abbreviations. Never terminate a name with an underscore.</para>
566 <para><emphasis>Example:</emphasis></para>
568 #define USE_IMAGE_LIST 1</programlisting>
570 <para><emphasis>Instead of:</emphasis></para>
574 #define USE_IMG_LST 1 or
575 #define _USE_IMAGE_LIST 1 or
576 #define USE_IMAGE_LIST_ 1 or
577 #define use_image_list 1 or
578 #define UseImageList 1
588 <sect2 id="s15"><title>Using Space</title>
592 <sect3 id="s16"><title>Put braces on a line by themselves.</title>
594 <para><emphasis>Explanation:</emphasis></para>
596 <para>The brace needs to be on a line all by itself, not at the
597 end of the statement. Curly braces should line up with the
598 construct that they're associated with. This practice makes it
599 easier to identify the opening and closing braces for a
602 <para><emphasis>Example:</emphasis></para>
609 <para><emphasis>Instead of:</emphasis></para>
611 <para>if ( this == that ) { ... }</para>
615 <para>if ( this == that ) { ... }</para>
617 <para><emphasis>Note:</emphasis> In the special case that the if-statement is
618 inside a loop, and it is trivial, i.e. it tests for a
619 condidtion that is obvious from the purpose of the block,
620 one-liners as above may optically preserve the loop structure
621 and make it easier to read.</para>
623 <para><emphasis>Status:</emphasis> developer-discrection.</para>
625 <para><emphasis>Example exception:</emphasis></para>
627 while ( more lines are read )
629 /* Please document what is/is not a comment line here */
630 if ( it's a comment ) continue;
632 do_something( line );
638 <sect3 id="s17"><title>ALL control statements should have a
641 <para><emphasis>Explanation:</emphasis></para>
643 <para>Using braces to make a block will make your code more
644 readable and less prone to error. All control statements should
645 have a block defined.</para>
647 <para><emphasis>Example:</emphasis></para>
655 <para><emphasis>Instead of:</emphasis></para>
657 <para>if ( this == that ) DoSomething(); DoSomethingElse();</para>
661 <para>if ( this == that ) DoSomething();</para>
663 <para><emphasis>Note:</emphasis> The first example in "Instead of" will execute
664 in a manner other than that which the developer desired (per
665 indentation). Using code braces would have prevented this
666 "feature". The "explanation" and "exception" from the point
667 above also applies.</para>
673 <sect3 id="s18"><title>Do not belabor/blow-up boolean
676 <para><emphasis>Example:</emphasis></para>
678 structure->flag = ( condition );</programlisting>
680 <para><emphasis>Instead of:</emphasis></para>
682 <para>if ( condition ) { structure->flag = 1; } else {
683 structure->flag = 0; }</para>
685 <para><emphasis>Note:</emphasis> The former is readable and consice. The later
686 is wordy and inefficient. Please assume that any developer new
687 to the project has at least a "good" knowledge of C/C++. (Hope
688 I do not offend by that last comment ... 8-)</para>
694 <sect3 id="s19"><title>Use white space freely because it is
697 <para><emphasis>Explanation:</emphasis></para>
699 <para>Make it readable. The notable exception to using white space
700 freely is listed in the next guideline.</para>
702 <para><emphasis>Example:</emphasis></para>
706 int anotherValue = 0;
707 int thisVariable = 0;
709 if ( thisVariable == thatVariable )
711 firstValue = oldValue + ( ( someValue - anotherValue ) - whatever )
716 <sect3 id="s20"><title>Don't use white space around structure
719 <para><emphasis>Explanation:</emphasis></para>
721 <para>- structure pointer operator ( "->" ) - member operator (
722 "." ) - functions and parentheses</para>
724 <para>It is a general coding practice to put pointers, references,
725 and function parentheses next to names. With spaces, the
726 connection between the object and variable/function name is not
729 <para><emphasis>Example:</emphasis></para>
733 FunctionName();</programlisting>
735 <para><emphasis>Instead of:</emphasis> aStruct -> aMember; aStruct . aMember;
736 FunctionName ();</para>
742 <sect3 id="s21"><title>Make the last brace of a function stand
745 <para><emphasis>Example:</emphasis></para>
752 } /* -END- function1 */
757 } /* -END- function2 */
760 <para><emphasis>Instead of:</emphasis></para>
762 <para>int function1( ... ) { ...code... return( retCode ); } int
763 function2( ... ) { }</para>
765 <para><emphasis>Note:</emphasis> Use 1 blank line before the closing brace and 2
766 lines afterwards. This makes the end of function standout to
767 the most casual viewer. Although function comments help
768 seperate functions, this is still a good coding practice. In
769 fact, I follow these rules when using blocks in "for", "while",
770 "do" loops, and long if {} statements too. After all whitespace
773 <para><emphasis>Status:</emphasis> developer-discrection on the number of blank
774 lines. Enforced is the end of function comments.</para>
780 <sect3 id="s22"><title>Use 3 character indentions</title>
782 <para><emphasis>Explanation:</emphasis></para>
784 <para>If some use 8 character TABs and some use 3 character TABs,
785 the code can look *very* ragged. So use 3 character indentions
786 only. If you like to use TABs, pass your code through a filter
787 such as "expand -t3" before checking in your code.</para>
789 <para><emphasis>Example:</emphasis></para>
791 static const char * const url_code_map[256] =
801 return( ALWAYS_TRUE );
805 return( HOW_DID_YOU_GET_HERE );
808 return( NEVER_GETS_HERE );
817 <sect2 id="s23"><title>Initializing</title>
821 <sect3 id="s24"><title>Initialize all variables</title>
823 <para><emphasis>Explanation:</emphasis></para>
825 <para>Do not assume that the variables declared will not be used
826 until after they have been assigned a value somewhere else in
827 the code. Remove the chance of accidentally using an unassigned
830 <para><emphasis>Example:</emphasis></para>
834 struct *ptr = NULL;</programlisting>
836 <para><emphasis>Note:</emphasis> It is much easier to debug a SIGSEGV if the
837 message says you are trying to access memory address 00000000
838 and not 129FA012; or arrayPtr[20] causes a SIGSEV vs.
841 <para><emphasis>Status:</emphasis> developer-discrection if and only if the
842 variable is assigned a value "shortly after" declaration.</para>
848 <sect2 id="s25"><title>Functions</title>
852 <sect3 id="s26"><title>Name functions that return a boolean as a
855 <para><emphasis>Explanation:</emphasis></para>
857 <para>Value should be phrased as a question that would logically
858 be answered as a true or false statement</para>
860 <para><emphasis>Example:</emphasis></para>
869 <sect3 id="s27"><title>Always specify a return type for a
872 <para><emphasis>Explanation:</emphasis></para>
874 <para>The default return for a function is an int. To avoid
875 ambiguity, create a return for a function when the return has a
876 purpose, and create a void return type if the function does not
877 need to return anything.</para>
883 <sect3 id="s28"><title>Minimize function calls when iterating by
884 using variables</title>
886 <para><emphasis>Explanation:</emphasis></para>
888 <para>It is easy to write the following code, and a clear argument
889 can be made that the code is easy to understand:</para>
891 <para><emphasis>Example:</emphasis></para>
893 for ( size_t cnt = 0; cnt < blockListLength(); cnt ++ )
898 <para><emphasis>Note:</emphasis> Unfortunately, this makes a function call for
899 each and every iteration. This increases the overhead in the
900 program, because the compiler has to look up the function each
901 time, call it, and return a value. Depending on what occurs in
902 the blockListLength() call, it might even be creating and
903 destroying structures with each iteration, even though in each
904 case it is comparing "cnt" to the same value, over and over.
905 Remember too - even a call to blockListLength() is a function
906 call, with the same overhead.</para>
908 <para>Instead of using a function call during the iterations,
909 assign the value to a variable, and evaluate using the
912 <para><emphasis>Example:</emphasis></para>
914 size_t len = blockListLength();
916 for ( size_t cnt = 0; cnt < len; cnt ++ )
921 <para><emphasis>Exceptions:</emphasis> if the value of blockListLength() *may*
922 change or could *potentially* change, then you must code the
923 function call in the for/while loop.</para>
929 <sect3 id="s29"><title>Pass and Return by Const Reference</title>
931 <para><emphasis>Explanation:</emphasis></para>
933 <para>This allows a developer to define a const pointer and call
934 your function. If your function does not have the const
935 keyword, we may not be able to use your function. Consider
936 strcmp, if it were defined as: extern int strcmp( char *s1,
939 <para>I could then not use it to compare argv's in main: int main(
940 int argc, const char *argv[] ) { strcmp( argv[0], "privoxy"
943 <para>Both these pointers are *const*! If the c runtime library
944 maintainers do it, we should too.</para>
950 <sect3 id="s30"><title>Pass and Return by Value</title>
952 <para><emphasis>Explanation:</emphasis></para>
954 <para>Most structures cannot fit onto a normal stack entry (i.e.
955 they are not 4 bytes or less). Aka, a function declaration
956 like: int load_aclfile( struct client_state csp )</para>
958 <para>would not work. So, to be consistent, we should declare all
959 prototypes with "pass by value": int load_aclfile( struct
960 client_state *csp )</para>
966 <sect3 id="s31"><title>Names of include files</title>
968 <para><emphasis>Explanation:</emphasis></para>
970 <para>Your include statements should contain the file name without
971 a path. The path should be listed in the Makefile, using -I as
972 processor directive to search the indicated paths. An exception
973 to this would be for some proprietary software that utilizes a
974 partial path to distinguish their header files from system or
975 other header files.</para>
977 <para><emphasis>Example:</emphasis></para>
979 #include <iostream.h> /* This is not a local include */
980 #include "config.h" /* This IS a local include */
983 <para><emphasis>Exception:</emphasis></para>
987 /* This is not a local include, but requires a path element. */
988 #include <sys/fileName.h>
992 <para><emphasis>Note:</emphasis> Please! do not add "-I." to the Makefile
993 without a _very_ good reason. This duplicates the #include
994 "file.h" behaviour.</para>
1000 <sect3 id="s32"><title>Provide multiple inclusion
1003 <para><emphasis>Explanation:</emphasis></para>
1005 <para>Prevents compiler and linker errors resulting from
1006 redefinition of items.</para>
1008 <para>Wrap each header file with the following syntax to prevent
1009 multiple inclusions of the file. Of course, replace PROJECT_H
1010 with your file name, with "." Changed to "_", and make it
1013 <para><emphasis>Example:</emphasis></para>
1015 #ifndef PROJECT_H_INCLUDED
1016 #define PROJECT_H_INCLUDED
1018 #endif /* ndef PROJECT_H_INCLUDED */
1023 <sect3 id="s33"><title>Use `extern "C"` when appropriate</title>
1025 <para><emphasis>Explanation:</emphasis></para>
1027 <para>If our headers are included from C++, they must declare our
1028 functions as `extern "C"`. This has no cost in C, but increases
1029 the potential re-usability of our code.</para>
1031 <para><emphasis>Example:</emphasis></para>
1036 #endif /* def __cplusplus */
1038 ... function definitions here ...
1042 #endif /* def __cplusplus */
1047 <sect3 id="s34"><title>Where Possible, Use Forward Struct
1048 Declaration Instead of Includes</title>
1050 <para><emphasis>Explanation:</emphasis></para>
1052 <para>Useful in headers that include pointers to other struct's.
1053 Modifications to excess header files may cause needless
1056 <para><emphasis>Example:</emphasis></para>
1058 /*********************************************************************
1059 * We're avoiding an include statement here!
1060 *********************************************************************/
1062 extern file_list *xyz;</programlisting>
1064 <para><emphasis>Note:</emphasis> If you declare "file_list xyz;" (without the
1065 pointer), then including the proper header file is necessary.
1066 If you only want to prototype a pointer, however, the header
1067 file is unneccessary.</para>
1069 <para><emphasis>Status:</emphasis> Use with discrection.</para>
1075 <sect2 id="s35"><title>General Coding Practices</title>
1079 <sect3 id="s36"><title>Turn on warnings</title>
1081 <para><emphasis>Explanation</emphasis></para>
1083 <para>Compiler warnings are meant to help you find bugs. You
1084 should turn on as many as possible. With GCC, the switch is
1085 "-Wall". Try and fix as many warnings as possible.</para>
1091 <sect3 id="s37"><title>Provide a default case for all switch
1094 <para><emphasis>Explanation:</emphasis></para>
1096 <para>What you think is guaranteed is never really guaranteed. The
1097 value that you don't think you need to check is the one that
1098 someday will be passed. So, to protect yourself from the
1099 unknown, always have a default step in a switch statement.</para>
1101 <para><emphasis>Example:</emphasis></para>
1103 switch( hash_string( cmd ) )
1105 case hash_actions_file :
1115 ... anomly code goes here ...
1116 continue; / break; / exit( 1 ); / etc ...
1118 } /* end switch( hash_string( cmd ) ) */</programlisting>
1120 <para><emphasis>Note:</emphasis> If you already have a default condition, you
1121 are obviously exempt from this point. Of note, most of the
1122 WIN32 code calls `DefWindowProc' after the switch statement.
1123 This API call *should* be included in a default statement.</para>
1125 <para><emphasis>Another Note:</emphasis> This is not so much a readability issue
1126 as a robust programming issue. The "anomly code goes here" may
1127 be no more than a print to the STDERR stream (as in
1128 load_config). Or it may really be an ABEND condition.</para>
1130 <para><emphasis>Status:</emphasis> Programmer discretion is advised.</para>
1136 <sect3 id="s38"><title>Try to avoid falling through cases in a
1137 switch statement.</title>
1139 <para><emphasis>Explanation:</emphasis></para>
1141 <para>In general, you will want to have a 'break' statement within
1142 each 'case' of a switch statement. This allows for the code to
1143 be more readable and understandable, and furthermore can
1144 prevent unwanted surprises if someone else later gets creative
1145 and moves the code around.</para>
1147 <para>The language allows you to plan the fall through from one
1148 case statement to another simply by omitting the break
1149 statement within the case statement. This feature does have
1150 benefits, but should only be used in rare cases. In general,
1151 use a break statement for each case statement.</para>
1153 <para>If you choose to allow fall through, you should comment both
1154 the fact of the fall through and reason why you felt it was
1161 <sect3 id="s39"><title>Use 'long' or 'short' Instead of
1164 <para><emphasis>Explanation:</emphasis></para>
1166 <para>On 32-bit platforms, int usually has the range of long. On
1167 16-bit platforms, int has the range of short.</para>
1169 <para><emphasis>Status:</emphasis> open-to-debate. In the case of most FSF
1170 projects (including X/GNU-Emacs), there are typedefs to int4,
1171 int8, int16, (or equivalence ... I forget the exact typedefs
1172 now). Should we add these to IJB now that we have a "configure"
1179 <sect3 id="s40"><title>Don't mix size_t and other types</title>
1181 <para><emphasis>Explanation:</emphasis></para>
1183 <para>The type of size_t varies across platforms. Do not make
1184 assumptions about whether it is signed or unsigned, or about
1185 how long it is. Do not compare a size_t against another
1186 variable of a different type (or even against a constant)
1187 without casting one of the values. Try to avoid using size_t if
1194 <sect3 id="s41"><title>Declare each variable and struct on its
1197 <para><emphasis>Explanation:</emphasis></para>
1199 <para>It can be tempting to declare a series of variables all on
1200 one line. Don't.</para>
1202 <para><emphasis>Example:</emphasis></para>
1206 long c = 0;</programlisting>
1208 <para><emphasis>Instead of:</emphasis></para>
1210 <para>long a, b, c;</para>
1212 <para><emphasis>Explanation:</emphasis> - there is more room for comments on the
1213 individual variables - easier to add new variables without
1214 messing up the original ones - when searching on a variable to
1215 find its type, there is less clutter to "visually"
1218 <para><emphasis>Exceptions:</emphasis> when you want to declare a bunch of loop
1219 variables or other trivial variables; feel free to declare them
1220 on 1 line. You should, although, provide a good comment on
1221 their functions.</para>
1223 <para><emphasis>Status:</emphasis> developer-discrection.</para>
1229 <sect3 id="s42"><title>Use malloc/zalloc sparingly</title>
1231 <para><emphasis>Explanation:</emphasis></para>
1233 <para>Create a local stuct (on the stack) if the variable will
1234 live and die within the context of one function call.</para>
1236 <para>Only "malloc" a struct (on the heap) if the variable's life
1237 will extend beyond the context of one function call.</para>
1239 <para><emphasis>Example:</emphasis></para>
1241 If a function creates a struct and stores a pointer to it in a
1242 list, then it should definately be allocated via `malloc'.
1247 <sect3 id="s43"><title>The Programmer Who Uses 'malloc' is
1248 Responsible for Ensuring 'free'</title>
1250 <para><emphasis>Explanation:</emphasis></para>
1252 <para>If you have to "malloc" an instance, you are responsible for
1253 insuring that the instance is `free'd, even if the deallocation
1254 event falls within some other programmer's code. You are also
1255 responsible for ensuring that deletion is timely (i.e. not too
1256 soon, not too late). This is known as "low-coupling" and is a
1257 "good thing (tm)". You may need to offer a
1258 free/unload/destuctor type function to accomodate this.</para>
1260 <para><emphasis>Example:</emphasis></para>
1262 int load_re_filterfile( struct client_state *csp ) { ... }
1263 static void unload_re_filterfile( void *f ) { ... }</programlisting>
1265 <para><emphasis>Exceptions:</emphasis></para>
1267 <para>The developer cannot be expected to provide `free'ing
1268 functions for C run-time library functions ... such as
1271 <para><emphasis>Status:</emphasis> developer-discrection. The "main" use of this
1272 standard is for allocating and freeing data structures (complex
1279 <sect3 id="s44"><title>Add loaders to the `file_list' structure
1280 and in order</title>
1282 <para><emphasis>Explanation:</emphasis></para>
1284 <para>I have ordered all of the "blocker" file code to be in alpha
1285 order. It is easier to add/read new blockers when you expect a
1286 certain order.</para>
1288 <para><emphasis>Note:</emphasis> It may appear that the alpha order is broken in
1289 places by POPUP tests coming before PCRS tests. But since
1290 POPUPs can also be referred to as KILLPOPUPs, it is clear that
1291 it should come first.</para>
1297 <sect3 id="s45"><title>"Uncertain" new code and/or changes to
1298 exitinst code, use FIXME</title>
1300 <para><emphasis>Explanation:</emphasis></para>
1302 <para>If you have enough confidence in new code or confidence in
1303 your changes, but are not *quite* sure of the reprocussions,
1306 <para>/* FIXME: this code has a logic error on platform XYZ, *
1307 attempthing to fix */ #ifdef PLATFORM ...changed code here...
1312 <para>/* FIXME: I think the original author really meant this...
1313 */ ...changed code here...</para>
1317 <para>/* FIXME: new code that *may* break something else... */
1318 ...new code here...</para>
1320 <para><emphasis>Note:</emphasis> If you make it clear that this may or may not
1321 be a "good thing (tm)", it will be easier to identify and
1322 include in the project (or conversly exclude from the
1330 <sect2 id="s46"><title>Addendum: Template for files and function
1331 comment blocks:</title>
1333 <para><emphasis>Example for file comments:</emphasis></para>
1335 const char FILENAME_rcs[] = "$Id: developer-manual.sgml,v 1.22 2002/04/04 17:27:56 swa Exp $";
1336 /*********************************************************************
1338 * File : $S<!-- Break CVS Substitution -->ource$
1340 * Purpose : (Fill me in with a good description!)
1342 * Copyright : Written by and Copyright (C) 2001 the SourceForge
1343 * Privoxy team. http://www.privoxy.org/
1345 * Based on the Internet Junkbuster originally written
1346 * by and Copyright (C) 1997 Anonymous Coders and
1347 * Junkbusters Corporation. http://www.junkbusters.com
1349 * This program is free software; you can redistribute it
1350 * and/or modify it under the terms of the GNU General
1351 * Public License as published by the Free Software
1352 * Foundation; either version 2 of the License, or (at
1353 * your option) any later version.
1355 * This program is distributed in the hope that it will
1356 * be useful, but WITHOUT ANY WARRANTY; without even the
1357 * implied warranty of MERCHANTABILITY or FITNESS FOR A
1358 * PARTICULAR PURPOSE. See the GNU General Public
1359 * License for more details.
1361 * The GNU General Public License should be included with
1362 * this file. If not, you can view it at
1363 * http://www.gnu.org/copyleft/gpl.html
1364 * or write to the Free Software Foundation, Inc., 59
1365 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1368 * $L<!-- Break CVS Substitution -->og$
1370 *********************************************************************/
1375 ...necessary include files for us to do our work...
1377 const char FILENAME_h_rcs[] = FILENAME_H_VERSION;
1380 <para><emphasis>Note:</emphasis> This declares the rcs variables that should be
1381 added to the "show-proxy-args" page. If this is a brand new
1382 creation by you, you are free to change the "Copyright" section
1383 to represent the rights you wish to maintain.</para>
1385 <para><emphasis>Note:</emphasis> The formfeed character that is present right
1386 after the comment flower box is handy for (X|GNU)Emacs users to
1387 skip the verbige and get to the heart of the code (via
1388 `forward-page' and `backward-page'). Please include it if you
1391 <para><emphasis>Example for file header comments:</emphasis></para>
1395 #define FILENAME_H_VERSION "$Id: developer-manual.sgml,v 1.22 2002/04/04 17:27:56 swa Exp $"
1396 /*********************************************************************
1398 * File : $S<!-- Break CVS Substitution -->ource$
1400 * Purpose : (Fill me in with a good description!)
1402 * Copyright : Written by and Copyright (C) 2001 the SourceForge
1403 * Privoxy team. http://www.privoxy.org/
1405 * Based on the Internet Junkbuster originally written
1406 * by and Copyright (C) 1997 Anonymous Coders and
1407 * Junkbusters Corporation. http://www.junkbusters.com
1409 * This program is free software; you can redistribute it
1410 * and/or modify it under the terms of the GNU General
1411 * Public License as published by the Free Software
1412 * Foundation; either version 2 of the License, or (at
1413 * your option) any later version.
1415 * This program is distributed in the hope that it will
1416 * be useful, but WITHOUT ANY WARRANTY; without even the
1417 * implied warranty of MERCHANTABILITY or FITNESS FOR A
1418 * PARTICULAR PURPOSE. See the GNU General Public
1419 * License for more details.
1421 * The GNU General Public License should be included with
1422 * this file. If not, you can view it at
1423 * http://www.gnu.org/copyleft/gpl.html
1424 * or write to the Free Software Foundation, Inc., 59
1425 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1428 * $L<!-- Break CVS Substitution -->og$
1430 *********************************************************************/
1433 #include "project.h"
1439 ... function headers here ...
1442 /* Revision control strings from this header and associated .c file */
1443 extern const char FILENAME_rcs[];
1444 extern const char FILENAME_h_rcs[];
1451 #endif /* ndef _FILENAME_H */
1460 <para><emphasis>Example for function comments:</emphasis></para>
1462 /*********************************************************************
1464 * Function : FUNCTION_NAME
1466 * Description : (Fill me in with a good description!)
1469 * 1 : param1 = pointer to an important thing
1470 * 2 : x = pointer to something else
1472 * Returns : 0 => Ok, everything else is an error.
1474 *********************************************************************/
1475 int FUNCTION_NAME( void *param1, const char *x )
1483 <para><emphasis>Note:</emphasis> If we all follow this practice, we should be
1484 able to parse our code to create a "self-documenting" web
1491 <!-- ~~~~~ New section ~~~~~ -->
1492 <sect1 id="cvs"><title>Version Control Guidelines</title>
1493 <para>To be filled. note on cvs comments. Don't only comment what you did,
1494 but also why you did it!
1498 <!-- ~~~~~ New section ~~~~~ -->
1499 <sect1 id="testing"><title>Testing Guidelines</title>
1503 <!-- ~~~~~ New section ~~~~~ -->
1504 <sect2 id="testing-plan"><title>Testplan for releases</title>
1506 Explain release numbers. major, minor. developer releases. etc.
1508 <orderedlist numeration="arabic">
1510 Remove any existing rpm with rpm -e
1513 Remove any file that was left over. This includes (but is not limited to)
1515 <listitem><para>/var/log/privoxy</para></listitem>
1516 <listitem><para>/etc/privoxy</para></listitem>
1517 <listitem><para>/usr/sbin/privoxy</para></listitem>
1518 <listitem><para>/etc/init.d/privoxy</para></listitem>
1519 <listitem><para>/usr/doc/privoxy*</para></listitem>
1523 Install the rpm. Any error messages?
1525 <listitem><para>start,stop,status <application>Privoxy</application> with the specific script
1526 (e.g. /etc/rc.d/init/privoxy stop). Reboot your machine. Does
1527 autostart work?</para></listitem>
1528 <listitem><para>Start browsing. Does <application>Privoxy</application> work? Logfile written?</para></listitem>
1529 <listitem><para>Remove the rpm. Any error messages? All files removed?</para></listitem>
1534 <!-- ~~~~~ New section ~~~~~ -->
1535 <sect2 id="testing-report"><title>Test reports</title>
1537 Please submit test reports only with the <ulink url="http://sourceforge.net/tracker/?func=add&group_id=11118&atid=395005">test form</ulink>
1538 at sourceforge. Three simple steps:
1541 <listitem><para>Select category: the distribution you test on.</para></listitem>
1542 <listitem><para>Select group: the version of <application>Privoxy</application> that we are about to release.</para></listitem>
1543 <listitem><para>Fill the Summary and Detailed Description with something
1544 intelligent (keep it short and precise).</para>
1547 Do not mail to the mailinglist (we cannot keep track on issues there).
1553 <!-- ~~~~~ New section ~~~~~ -->
1554 <sect1 id="newrelease"><title>Releasing a new version</title>
1556 To minimize trouble with distribution contents, webpage
1557 errors and the like, we strongly encourage you
1558 to follow this section if you prepare a new release of
1559 code or new pages on the webserver.
1562 The following programs are required to follow this process:
1563 <filename>ncftpput</filename> (ncftp), <filename>scp</filename> (ssh),
1564 <filename>gmake</filename> (GNU's version of make), autoconf, cvs, ???.
1567 <sect2 id="beforerelease">
1568 <title>Before the Release</title>
1570 The following <emphasis>must be done by one of the
1571 developers</emphasis> prior to each new release:
1577 Make sure that everybody who has worked on the code in the last
1578 couple of days has had a chance to yell <quote>no!</quote> in case
1579 they have pending changes/fixes in their pipelines.
1584 Increment the version number in <filename>configure.in</filename> in
1585 CVS. Also, the RPM release number in
1586 <filename>configure.in</filename>. Do NOT touch version information
1587 after export from CVS. <emphasis>All packages</emphasis> will use the
1588 version and release data from <filename>configure.in</filename>.
1589 Local files should not be changed, except prior to a CVS commit!!!
1590 This way we are all on the same page!
1595 If the default actionsfile has changed since last release,
1596 bump up its version info in this line:
1600 {+add-header{X-Actions-File-Version: A.B} -filter -no-popups}
1604 Then change the version info in doc/webserver/actions/index.php,
1605 line: '$required_actions_file_version = "A.B";'
1610 Tag all files in CVS with the version number with
1611 <quote><command>cvs tag v_X_Y_Z</command></quote> (where X = major, Y
1612 = minor, Z = point). Don't use vX_Y_Z, ver_X_Y_Z, v_X.Y.Z (won't work)
1618 The first package uploaded should be the official
1619 <quote>tarball</quote> release. This is built with the
1620 <quote><command>make tarball-dist</command></quote> Makefile
1621 target, and then can be uploaded with
1622 <quote><command>make tarball-upload</command></quote> (see below).
1629 <sect2 id="newrelease-web"><title>Update the webserver</title>
1631 All files must be group-readable and group-writable (or no one else
1632 will be able to change them). To update the webserver, create any
1633 pages locally in the <filename>doc/webserver</filename> directory (or
1634 create new directories under <filename>doc/webserver</filename>), then do
1642 Note that <quote><command>make dok</command></quote>
1643 (or <quote><command>make redhat-dok</command></quote>) creates
1644 <filename>doc/webserver/user-manual</filename>,
1645 <filename>doc/webserver/developer-manual</filename>,
1646 <filename>doc/webserver/faq</filename> and
1647 <filename>doc/webserver/man-page</filename> automatically.
1650 Please do NOT use any other means of transferring files to the
1651 webserver. <quote><command>make webserver</command></quote> not only
1652 uploads, but will make sure that the appropriate permissions are
1653 preserved for shared group access.
1657 <sect2 id="newrelease-rpm"><title>SuSE or Red Hat</title>
1659 Ensure that you have the latest code version. Hence run:
1664 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
1665 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa export -r v_X_Y_Z current
1673 autoheader && autoconf && ./configure
1681 make suse-dist or make redhat-dist
1685 To upload the package to Sourceforge, simply issue
1689 make suse-upload or make redhat-upload
1693 Go to the displayed URL and release the file publicly on Sourceforge.
1697 <sect2 id="newrelease-os2"><title>OS/2</title>
1699 Ensure that you have the latest code version. Hence run:
1704 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
1705 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa export -r v_X_Y_Z current
1707 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co os2setup
1711 You will need a mix of development tools.
1712 The main compilation takes place with IBM Visual Age C++.
1713 Some ancillary work takes place with GNU tools, available from
1714 various sources like hobbes.nmsu.edu.
1715 Specificially, you will need <filename>autoheader</filename>,
1716 <filename>autoconf</filename> and <filename>sh</filename> tools.
1717 The packaging takes place with WarpIN, available from various sources, including
1718 its home page: <ulink url="http://www.xworkplace.org/">xworkplace</ulink>.
1721 Change directory to the <filename>os2setup</filename> directory.
1722 Edit the os2build.cmd file to set the final executable filename.
1725 installExeName='privoxyos2_setup_X.Y.Z.exe'
1727 Next, edit the <filename>IJB.wis</filename> file so the release number matches
1728 in the <filename>PACKAGEID</filename> section:
1730 PACKAGEID="Privoxy Team\Privoxy\Privoxy Package\X\Y\Z"
1732 You're now ready to build. Run:
1736 And in the <filename>./files</filename> directory you will have the
1737 WarpIN-installable executable.
1738 Upload this anonymously to
1739 <filename>uploads.sourceforge.net/incoming</filename>, create a release
1740 for it, and you're done.
1744 <sect2 id="newrelease-solaris"><title>Solaris</title>
1746 Login to Sourceforge's compilefarm via ssh
1750 ssh cf.sourceforge.net
1754 Choose the right operating system (not the Debian one). If you have
1755 downloaded <application>Privoxy</application> before,
1760 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
1761 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa export -r v_X_Y_Z current
1765 If not, please <ulink
1766 url="http://www.privoxy.org/user-manual/user-manual/installation.html#INSTALLATION-SOURCE">checkout
1767 Privoxy via CVS first</ulink>. Run:
1771 autoheader && autoconf && ./configure
1783 which creates a gzip'ed tar archive. Sadly, you cannot use <command>make
1784 solaris-upload</command> on the Sourceforge machine (no ncftpput). You now have
1785 to manually upload the archive to Sourceforge's ftp server and release
1790 <sect2 id="newrelease-windows"><title>Windows</title>
1792 Ensure that you have the latest code version. Hence run
1797 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
1798 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa export -r v_X_Y_Z current
1806 autoheader && autoconf && ./configure
1814 <sect2 id="newrelease-debian"><title>Debian</title>
1816 Ensure that you have the latest code version. Hence run:
1821 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
1822 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa export -r v_X_Y_Z current
1830 autoheader && autoconf && ./configure
1838 <sect2 id="newrelease-macosx"><title>Mac OSX</title>
1840 Ensure that you have the latest code version. Hence run:
1845 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
1846 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa export -r v_X_Y_Z current
1848 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co osxsetup
1852 From the osxsetup directory, run:
1858 This will run <filename>autoheader</filename>, <filename>autoconf</filename> and
1859 <filename>configure</filename> as well as <filename>make</filename>.
1860 Finally, it will copy over the necessary files to the ./osxsetup/files directory
1861 for further processing by <filename>PackageMaker</filename>.
1864 Bring up PackageMaker with the PrivoxyPackage.pmsp definition file, modify the package
1865 name to match the release, and hit the "Create package" button.
1866 If you specify ./Privoxy.pkg as the output package name, you can then create
1867 the distributable zip file with the command:
1869 zip -r privoxyosx_setup_x.y.z.zip Privoxy.pkg
1871 You can then upload <filename>privoxyosx_setup_x.y.z.zip</filename> anonymously to
1872 <filename>uploads.sourceforge.net/incoming</filename>,
1873 create a release for it, and you're done.
1877 <sect2 id="newrelease-freebsd"><title>FreeBSD</title>
1879 Change the version number of <application>Privoxy</application> in the
1880 configure.in file. Run:
1882 autoheader && autoconf && ./configure
1887 Login to Sourceforge's compilefarm via ssh:
1891 ssh cf.sourceforge.net
1895 Choose the right operating system. If you have downloaded Privoxy
1901 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
1902 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa export -r v_X_Y_Z current
1906 If not, please <ulink
1907 url="http://www.privoxy.org/user-manual/user-manual/installation.html#INSTALLATION-SOURCE">checkout
1908 Privoxy via CVS first</ulink>. Run:
1912 autoheader && autoconf && ./configure
1924 which creates a gzip'ed tar archive. Sadly, you cannot use <command>make
1925 freebsd-upload</command> on the Sourceforge machine (no ncftpput). You now have
1926 to manually upload the archive to Sourceforge's ftp server and release
1931 <sect2 id="newrelease-tarball"><title>Tarball</title>
1933 Ensure that you have the latest code version. Hence run:
1938 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
1939 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa export -r v_X_Y_Z current
1948 autoheader && autoconf && ./configure
1960 To upload the package to Sourceforge, simply issue
1968 Goto the displayed URL and release the file publicly on Sourceforge.
1972 <sect2 id="newrelease-hpux"><title>HP-UX 11</title>
1974 Ensure that you have the latest code version. Hence run:
1979 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
1980 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa export -r v_X_Y_Z current
1988 autoheader && autoconf && ./configure
1996 <sect2 id="newrelease-amiga"><title>Amiga OS</title>
1998 Ensure that you have the latest code version. Hence run:
2003 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
2004 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa export -r v_X_Y_Z current
2012 autoheader && autoconf && ./configure
2020 <sect2 id="newrelease-aix"><title>AIX</title>
2022 Login to Sourceforge's compilefarm via ssh:
2026 ssh cf.sourceforge.net
2030 Choose the right operating system. If you have downloaded Privoxy
2036 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
2037 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa export -r v_X_Y_Z current
2041 If not, please <ulink
2042 url="http://www.privoxy.org/user-manual/user-manual/installation.html#INSTALLATION-SOURCE">checkout
2043 Privoxy via CVS first</ulink>. Run:
2047 autoheader && autoconf && ./configure
2059 which creates a gzip'ed tar archive. Sadly, you cannot use <command>make
2060 aix-upload</command> on the Sourceforge machine (no ncftpput). You now have
2061 to manually upload the archive to Sourceforge's ftp server and release
2068 <!-- ~~~~~ New section ~~~~~ -->
2069 <sect1 id="contact"><title>Contacting the developers, Bug Reporting and Feature Requests</title>
2070 <!-- Include contacting.sgml -->
2072 <!-- end contacting -->
2075 <!-- ~~~~~ New section ~~~~~ -->
2076 <sect1 id="copyright"><title>Copyright and History</title>
2078 <sect2><title>Copyright</title>
2079 <!-- Include copyright.sgml -->
2084 <sect2><title>History</title>
2085 <!-- Include history.sgml -->
2092 <!-- ~~~~~ New section ~~~~~ -->
2093 <sect1 id="seealso"><title>See also</title>
2094 <!-- Include seealso.sgml -->
2102 This program is free software; you can redistribute it
2103 and/or modify it under the terms of the GNU General
2104 Public License as published by the Free Software
2105 Foundation; either version 2 of the License, or (at
2106 your option) any later version.
2108 This program is distributed in the hope that it will
2109 be useful, but WITHOUT ANY WARRANTY; without even the
2110 implied warranty of MERCHANTABILITY or FITNESS FOR A
2111 PARTICULAR PURPOSE. See the GNU General Public
2112 License for more details.
2114 The GNU General Public License should be included with
2115 this file. If not, you can view it at
2116 http://www.gnu.org/copyleft/gpl.html
2117 or write to the Free Software Foundation, Inc., 59
2118 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2120 $Log: developer-manual.sgml,v $
2121 Revision 1.22 2002/04/04 17:27:56 swa
2122 more single file to be included at multiple points. make maintaining easier
2124 Revision 1.21 2002/04/04 06:48:37 hal9
2125 Structural changes to allow for conditional inclusion/exclusion of content
2126 based on entity toggles, e.g. 'entity % p-not-stable "INCLUDE"'. And
2127 definition of internal entities, e.g. 'entity p-version "2.9.13"' that will
2128 eventually be set by Makefile.
2129 More boilerplate text for use across multiple docs.
2131 Revision 1.20 2002/04/04 03:28:27 david__schmidt
2134 Revision 1.19 2002/04/03 15:09:42 david__schmidt
2135 Add OS/2 build section
2137 Revision 1.18 2002/04/03 03:51:48 hal9
2140 Revision 1.17 2002/04/03 01:21:17 hal9
2141 Implementing Andreas's suggestions for Release sections.
2143 Revision 1.16 2002/03/31 23:04:40 hal9
2144 Fleshed out the doc section, and added something for an intro so it was not
2147 Revision 1.15 2002/03/30 22:29:47 swa
2150 Revision 1.14 2002/03/30 19:04:08 swa
2151 people release differently. no good.
2152 I want to make parts of the docs only.
2154 Revision 1.13 2002/03/27 01:16:41 hal9
2157 Revision 1.12 2002/03/27 01:02:51 hal9
2158 Touch up on name change...
2160 Revision 1.11 2002/03/26 22:29:55 swa
2161 we have a new homepage!
2163 Revision 1.10 2002/03/24 12:33:01 swa
2166 Revision 1.9 2002/03/24 11:01:05 swa
2169 Revision 1.8 2002/03/23 15:13:11 swa
2170 renamed every reference to the old name with foobar.
2171 fixed "application foobar application" tag, fixed
2172 "the foobar" with "foobar". left junkbustser in cvs
2173 comments and remarks to history untouched.
2175 Revision 1.7 2002/03/11 13:13:27 swa
2176 correct feedback channels
2178 Revision 1.6 2002/02/24 14:25:06 jongfoster
2179 Formatting changes. Now changing the doctype to DocBook XML 4.1
2180 will work - no other changes are needed.
2182 Revision 1.5 2001/10/31 18:16:51 swa
2183 documentation added: howto generate docs in text and html
2184 format, howto move stuff to the webserver.
2186 Revision 1.4 2001/09/23 10:13:48 swa
2187 upload process established. run make webserver and
2188 the documentation is moved to the webserver. documents
2189 are now linked correctly.
2191 Revision 1.3 2001/09/13 15:27:40 swa
2194 Revision 1.2 2001/09/13 15:20:17 swa
2195 merged standards into developer manual
2197 Revision 1.1 2001/09/12 15:36:41 swa
2198 source files for junkbuster documentation
2200 Revision 1.3 2001/09/10 17:43:59 swa
2201 first proposal of a structure.
2203 Revision 1.2 2001/06/13 14:28:31 swa
2204 docs should have an author.
2206 Revision 1.1 2001/06/13 14:20:37 swa
2207 first import of project's documentation for the webserver.