From: Fabian Keil
The comments will also help justify the intent of the code. If the comment describes something different than what the code is doing @@ -85,13 +85,13 @@
/* if page size greater than 1k ... */ -if ( page_length() > 1024 ) +if (page_length() > 1024) { ... "block" the page up ... } /* if page size is small, send it in blocks */ -if ( page_length() > 1024 ) +if (page_length() > 1024) { ... "block" the page up ... } @@ -127,20 +127,20 @@ is actually being done. /********************************************************************* * This will stand out clearly in your code! *********************************************************************/ -if ( this_variable == that_variable ) +if (this_variable == that_variable) { do_something_very_important(); } /* unfortunately, this may not */ -if ( this_variable == that_variable ) +if (this_variable == that_variable) { do_something_very_important(); } -if ( this_variable == that_variable ) /* this may not either */ +if (this_variable == that_variable) /* this may not either */ { do_something_very_important(); } @@ -182,12 +182,12 @@ if ( this_variable == that_variable ) /* this may not either */ * This will stand out clearly in your code, * But the second example won't. *********************************************************************/ -if ( this_variable == this_variable ) +if (this_variable == this_variable) { do_something_very_important(); } -if ( this_variable == this_variable ) /*can you see me?*/ +if (this_variable == this_variable) /*can you see me?*/ { do_something_very_important(); /*not easily*/ } @@ -199,7 +199,7 @@ if ( this_variable == this_variable ) /*can you see me?*/ int urls_read = 0; /* # of urls read + rejected */ int urls_rejected = 0; /* # of urls rejected */ -if ( 1 == X ) +if (1 == X) { do_something_very_important(); } @@ -281,7 +281,7 @@ short do_something_very_important(@@ -902,7 +898,7 @@ is_web_page_blank();@@ -362,7 +362,7 @@ int msiis5hack = 0; int msIis5Hack = 0; -if ( 1 == X ) +if (1 == X) { do_something_very_important(); ...some long list of commands... @@ -289,11 +289,11 @@ if ( 1 == X ) or: -if ( 1 == X ) +if (1 == X) { do_something_very_important(); ...some long list of commands... -} /* -END- if ( 1 == X ) */ +} /* -END- if (1 == X) */@@ -375,8 +375,8 @@ int load_some_file( struct client_state *csp ) -int load_some_file( struct client_state *csp ) +int load_some_file(struct client_state *csp)@@ -400,8 +400,8 @@ int loadSomeFile( struct client_state *csp ) -int loadsomefile( struct client_state *csp ) -int loadSomeFile( struct client_state *csp ) +int loadsomefile(struct client_state *csp) +int loadSomeFile(struct client_state *csp)@@ -414,9 +414,9 @@ int loadSomeFile( struct client_state *csp ) -(.h) extern int load_aclfile( struct client_state *csp ); -(.c) int load_aclfile( struct client_state *csp ) +(.h) extern int load_aclfile(struct client_state *csp); +(.c) int load_aclfile(struct client_state *csp)@@ -440,7 +440,7 @@ int loadSomeFile( struct client_state *csp ) -(.h) extern int load_aclfile( struct client_state * ); or +(.h) extern int load_aclfile(struct client_state *); or (.h) extern int load_aclfile(); -(.c) int load_aclfile( struct client_state *csp ) +(.c) int load_aclfile(struct client_state *csp)@@ -535,7 +535,7 @@ int loadSomeFile( struct client_state *csp ) -(enumeration) : enum Boolean { FALSE, TRUE }; +(enumeration) : enum Boolean {FALSE, TRUE}; (#define) : #define DEFAULT_SIZE 100;@@ -745,7 +741,7 @@ int function2( ... ) -if ( this == that ) +if (this == that) { ... } @@ -547,11 +547,11 @@ if ( this == that )Instead of:
-if ( this == that ) { ... }
+if (this == that) { ... }
or
-if ( this == that ) { ... }
+if (this == that) { ... }
Note: In the special case that the if-statement is inside a loop, and it is @@ -569,12 +569,12 @@ if ( this == that )
@@ -599,7 +599,7 @@ while ( more lines are read ) -while ( more lines are read ) +while (more lines are read) { /* Please document what is/is not a comment line here */ - if ( it's a comment ) continue; + if (it's a comment) continue; - do_something( line ); + do_something(line); }@@ -729,14 +725,14 @@ function_name(); int function1( ... ) { ...code... - return( ret_code ); + return(ret_code); -} /* -END- function1 */ +} /* -END- function1 */ int function2( ... ) { -} /* -END- function2 */ +} /* -END- function2 */ -if ( this == that ) +if (this == that) { do_something(); do_something_else(); @@ -612,11 +612,11 @@ if ( this == that )Instead of:
-if ( this == that ) do_something(); do_something_else();
+if (this == that) do_something(); do_something_else();
or
-if ( this == that ) do_something();
+if (this == that) do_something();
Note: The first example in "Instead of" will execute in a manner other than @@ -635,7 +635,7 @@ if ( this == that )
@@ -644,7 +644,7 @@ structure->flag = ( condition ); -structure->flag = ( condition ); +structure->flag = (condition);Instead of:
-if ( condition ) { structure->flag = 1; } else { +
if (condition) { structure->flag = 1; } else { structure->flag = 0; }
Note: The @@ -674,10 +674,6 @@ int first_value = 0; int some_value = 0; int another_value = 0; int this_variable = 0; - -if ( this_variable == this_variable ) - -first_value = old_value + ( ( some_value - another_value ) - whatever )
Instead of:
-int function1( ... ) { ...code... return( ret_code ); } int +
int function1( ... ) { ...code... return(ret_code); } int function2( ... ) { }
Note: Use 1 @@ -787,16 +783,16 @@ static const char * const url_code_map[256] = int function1( ... ) { - if ( 1 ) + if (1) { - return( ALWAYS_TRUE ); + return ALWAYS_TRUE; } else { - return( HOW_DID_YOU_GET_HERE ); + return HOW_DID_YOU_GET_HERE; } - return( NEVER_GETS_HERE ); + return NEVER_GETS_HERE; }
-for ( size_t cnt = 0; cnt < block_list_length(); cnt++ ) +for (size_t cnt = 0; cnt < block_list_length(); cnt++) { .... } @@ -932,7 +928,7 @@ for ( size_t cnt = 0; cnt < block_list_length(); cnt++ )size_t len = block_list_length(); -for ( size_t cnt = 0; cnt < len; cnt++ ) +for (size_t cnt = 0; cnt < len; cnt++) { .... } @@ -957,10 +953,10 @@ for ( size_t cnt = 0; cnt < len; cnt++ )This allows a developer to define a const pointer and call your function. If your function does not have the const keyword, we may not be able to use your function. Consider strcmp, if it were defined - as: extern int strcmp( char *s1, char *s2 );
+ as: extern int strcmp(char *s1, char *s2); -I could then not use it to compare argv's in main: int main( int - argc, const char *argv[] ) { strcmp( argv[0], "privoxy" ); }
+I could then not use it to compare argv's in main: int main(int + argc, const char *argv[]) { strcmp(argv[0], "privoxy"); }
Both these pointers are *const*! If the c runtime library maintainers do it, we should too.
@@ -975,11 +971,11 @@ for ( size_t cnt = 0; cnt < len; cnt++ )Most structures cannot fit onto a normal stack entry (i.e. they are not 4 bytes or less). Aka, a function declaration like: int - load_aclfile( struct client_state csp )
+ load_aclfile(struct client_state csp)would not work. So, to be consistent, we should declare all - prototypes with "pass by value": int load_aclfile( struct - client_state *csp )
+ prototypes with "pass by value": int load_aclfile(struct client_state + *csp)@@ -1161,22 +1157,22 @@ extern file_list *xyz;@@ -1223,24 +1219,7 @@ switch( hash_string( cmd ) ) -switch( hash_string( cmd ) ) +switch (hash_string(cmd)) { - case hash_actions_file : + case hash_actions_file: ... code ... break; - case hash_confdir : + case hash_confdir: ... code ... break; - default : + default: log_error( ... ); ... anomaly code goes here ... continue; / break; / exit( 1 ); / etc ... -} /* end switch( hash_string( cmd ) ) */ +} /* end switch (hash_string(cmd)) */-- -4.7.4. Use 'long' or 'short' - Instead of 'int'
- -Explanation:
- -On 32-bit platforms, int usually has the range of long. On 16-bit - platforms, int has the range of short.
- -Status: - open-to-debate. In the case of most FSF projects (including - X/GNU-Emacs), there are typedefs to int4, int8, int16, (or - equivalence ... I forget the exact typedefs now). Should we add these - to IJB now that we have a "configure" script?
--4.7.5. Don't mix size_t and +
4.7.4. Don't mix size_t and other types
-4.7.6. Declare each variable +
4.7.5. Declare each variable and struct on its own line.
-4.7.7. Use malloc/zalloc +
4.7.6. Use malloc/zalloc sparingly
-4.7.8. The Programmer Who +
4.7.7. The Programmer Who Uses 'malloc' is Responsible for Ensuring 'free'
-int load_re_filterfile( struct client_state *csp ) { ... } -static void unload_re_filterfile( void *f ) { ... } +int load_re_filterfile(struct client_state *csp) { ... } +static void unload_re_filterfile(void *f) { ... }
Explanation: If you have enough confidence in new code or confidence in your
changes, but are not *quite* sure of the repercussions, add this: /* FIXME: this code has a logic error on platform XYZ, *
- attempting to fix */ #ifdef PLATFORM ...changed code here...
- #endif /* XXX: this code has a logic error on platform XYZ, * attempting
+ to fix */ #ifdef PLATFORM ...changed code here... #endif or: /* FIXME: I think the original author really meant this... */
+ /* XXX: I think the original author really meant this... */
...changed code here... or: /* FIXME: new code that *may* break something else... */ ...new
- code here... /* XXX: new code that *may* break something else... */ ...new code
+ here... Note: If you
make it clear that this may or may not be a "good thing (tm)", it
@@ -1422,10 +1400,10 @@ static void unload_re_filterfile( void *f ) { ... }
Privoxy is free software; you can
redistribute it and/or modify it under the terms of the
A long time ago, there was the Internet Junkbuster, by Anonymous Coders and
- Junkbusters
- Corporation. This saved many users a lot of pain in the early days
- of web advertising and user tracking. A long time ago, there was the Internet
+ Junkbuster, by Anonymous Coders and Junkbusters Corporation.
+ This saved many users a lot of pain in the early days of web
+ advertising and user tracking. But the web, its protocols and standards, and with it, the
techniques for forcing ads on users, give up autonomy over their
browsing, and for tracking them, keeps evolving. Unfortunately, the
Internet Junkbuster did not. Version
- 2.0.2, published in 1998, was (and is) the last official release available from Junkbusters Corporation. Fortunately, it had been
- released under the GNU GPL, which allowed further development by others. So Stefan Waldherr started maintaining an improved version of the
software, to which eventually a number of people contributed patches.
@@ -115,6 +110,10 @@
The result of this is Privoxy,
whose first stable version, 3.0, was released August, 2002. As of 2012 the Junkbusters Corporation's website
+ (http://www.junkbusters.com/) has been shut down, but Privoxy is still
+ actively maintained. Branches are used to fork a sub-development path from the main
- trunk. Within the current module where the
- sources are, there is always at least one "branch" from the main trunk devoted to a stable release
- series. The main trunk is where active development takes place for the
- next stable series (e.g. 3.2.x). So just prior to each stable series
- (e.g. 3.0.x), a branch is created just for stable series releases (e.g.
- 3.0.0 -> 3.0.1 -> 3.0.2, etc). Once the initial stable release of
- any stable branch has taken place, this branch is only used for bugfixes, which
- have had prior testing before being committed to CVS. (See Version Numbers below for details
- on versioning.) At one time there were two distinct branches: stable and unstable.
The more drastic changes were to be in the unstable branch. These
branches have now been merged to minimize time and effort of
@@ -97,9 +83,8 @@
The source tree is the heart of every software project. Every effort
must be made to ensure that it is readable, compilable and consistent
- at all times. There are differing guidelines for the stable branch and
- the main development trunk, and we ask anyone with CVS access to
- strictly adhere to the following guidelines: Basic Guidelines, for all branches: Packagers are encouraged to include this documentation. For those
without the ability to build the docs locally, text versions of each are
kept in CVS. HTML versions are also being kept in CVS under doc/webserver/*. And PDF version are kept in doc/pdf/*. Formal documents are built with the Makefile targets of make dok, or alternately make redhat-dok. If you have problems, try both.
- The build process uses the document SGML sources in doc/source/*/* to update all text files in
- doc/text/ and to update all HTML
- documents in doc/webserver/. Documentation writers should please make sure documents build
successfully before committing to CVS, if possible. First, build the docs by running make
- dok (or alternately make
- redhat-dok). For PDF docs, do make dok-pdf. Our documents are available in differing formats. Right now,
- they are just plain text, HTML, and PDF, but others are always a
+ they are just plain text and/or HTML, but others are always a
future possibility. Be careful with URLs (<ulink>), and avoid
this mistake: Privoxy documentation is using a
@@ -388,7 +384,7 @@
$Id: developer-manual.sgml,v 2.38 2011/12/26
- 17:05:40 fabiankeil Exp $ $Id: developer-manual.sgml,v 2.51 2012/06/19
+ 12:48:04 fabiankeil Exp $ Please note that this document is constantly evolving. This copy
- represents the state at the release of version 3.0.19. You can find
+ represents the state at the release of version 3.0.20. You can find
the latest version of the this manual at http://www.privoxy.org/developer-manual/. Please see
@@ -84,7 +84,7 @@
This will create ../privoxy_3.0.19-stable-1_i386.deb which can be
+ "FILENAME">../privoxy_3.0.20-UNRELEASED-1_i386.deb which can be
uploaded. To upload the package to Sourceforge, simply issue First, make sure that
you have freshly exported the right version into an empty
- directory. (See "Building and releasing packages" above).
- Then get the Mac OS X setup module: There are three modules available in the CVS repository for use on
+ Mac OS X, though technically only two of them generate a release (the
+ other can be used to install from source). The OSXPackageBuilder module generates OS X installer packages
+ supporting all Macs running OS X 10.4 and above. Obtain it from CVS
+ as follows into a folder parallel to the exported privoxy
+ source: The module contains complete instructions on its usage in the
+ file OS X Package Builder HOWTO.txt. Once the package(s) have been generated, you can then upload
+ them directly to the Files section of the Sourceforge project in
+ the Macintosh (OS X) folder. Each new version release of Privoxy
+ should have a new subfolder created in which to store its files.
+ Please ensure that the folder contains a readme file that makes it
+ clear which package is for whichversion of OS X. This module is
+ deprecated since the installer it generates places all Privoxy
+ files in one folder in a non-standard location, and supports only
+ Intel Macs running OS X 10.6 or higher. Check out the module from CVS as follows into a folder parallel
+ to the exported privoxy source: Then run: Then run: This will run autoheader, autoconf and configure as
- well as make. Finally, it will copy over
- the necessary files to the ./osxsetup/files directory for further
- processing by PackageMaker. This will run autoheader, autoconf and configure as
+ well as make. Finally, it will copy over
+ the necessary files to the ./osxsetup/files directory for further
+ processing by PackageMaker. Bring up PackageMaker with the PrivoxyPackage.pmsp definition
- file, modify the package name to match the release, and hit the
- "Create package" button. If you specify ./Privoxy.pkg as the output
- package name, you can then create the distributable zip file with the
- command: Bring up PackageMaker with the PrivoxyPackage.pmsp definition
+ file, modify the package name to match the release, and hit the
+ "Create package" button. If you specify ./Privoxy.pkg as the output
+ package name, you can then create the distributable zip file with
+ the command: You can then upload this file directly to the Files section of
+ the Sourceforge project in the Macintosh (OS X) folder. Each new
+ version release of Privoxy should have a new subfolder created in
+ which to store its files. Please ensure that the folder contains a
+ readme file that makes it clear which version(s) of OS X the
+ package supports. The macsetup module is ideal if you wish to build and install
+ Privoxy from source on a single machine. Check out the module from CVS as follows into a folder parallel
+ to the exported privoxy source: You can then upload privoxyosx_setup_x.y.z.zip anonymously to uploads.sourceforge.net/incoming, create a release
- for it, and you're done. Use the release notes and Change Log from
- the source tarball package. The module contains complete instructions on its usage in its
+ README file. The end result will be the
+ exported version of Privoxy installed on the build machine. Now just follow the prompts. Be sure to add any appropriate Release
notes. You should see your freshly uploaded packages in
4.7.10. "Uncertain" new code
- and/or changes to existing code, use FIXME or XXX
+ 4.7.9. "Uncertain" new code
+ and/or changes to existing code, use XXX
-const char FILENAME_rcs[] = "$Id$";
+const char FILENAME_rcs[] = "$I<!-- Break CVS Substitution -->d$";
/*********************************************************************
*
- * File : $Source$
+ * File : $S<!-- Break CVS Substitution -->ource$
*
* Purpose : (Fill me in with a good description!)
*
@@ -1485,10 +1463,10 @@ const char FILENAME_h_rcs[] = FILENAME_H_VERSION;
#ifndef _FILENAME_H
#define _FILENAME_H
-#define FILENAME_H_VERSION "$Id$"
+#define FILENAME_H_VERSION "$I<!-- Break CVS Substitution -->d$"
/*********************************************************************
*
- * File : $Source$
+ * File : $S<!-- Break CVS Substitution -->ource$
*
* Purpose : (Fill me in with a good description!)
*
@@ -1567,10 +1545,10 @@ extern const char FILENAME_h_rcs[];
* Returns : 0 => Ok, everything else is an error.
*
*********************************************************************/
-int FUNCTION_NAME( void *param1, const char *x )
+int FUNCTION_NAME(void *param1, const char *x)
{
...
- return( 0 );
+ return 0;
}
diff --git a/doc/webserver/developer-manual/copyright.html b/doc/webserver/developer-manual/copyright.html
index ec5c4d2b..c8241a8f 100644
--- a/doc/webserver/developer-manual/copyright.html
+++ b/doc/webserver/developer-manual/copyright.html
@@ -50,7 +50,7 @@
"CITETITLE">GNU General Public License.
9.1. License
+ 9.1. License
9.2. History
+ 9.2. History
-
3.3. Privoxy Custom
+
3.3. Privoxy Custom
Entities
p-version: the Privoxy version string, e.g.
- "3.0.19".
+ "3.0.20".
diff --git a/doc/webserver/developer-manual/index.html b/doc/webserver/developer-manual/index.html
index cb1fc2fa..2d72c1bf 100644
--- a/doc/webserver/developer-manual/index.html
+++ b/doc/webserver/developer-manual/index.html
@@ -22,8 +22,8 @@
2001-2009 by Privoxy
Developers
-
@@ -757,7 +757,7 @@
- debchange -v 3.0.19-stable-1 "New upstream version"
+ debchange -v 3.0.20-UNRELEASED-1 "New upstream version"
@@ -777,59 +777,134 @@
-
-
-
-
+
-
+
+
6.3.8.1. OSXPackageBuilder
+ module
+
+
+
+
+
+
+
+
+
+ cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co OSXPackageBuilder
+
+ 6.3.8.2. osxsetup module
+ (DEPRECATED)
+
+
+
+
+
-
+
-
cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co osxsetup
-
-
-
-
+
-
+
+
+
+
+
-
+
-
cd osxsetup
build
-
-
+
+
-
+
-
+
+
+
+
+
-
+
-
zip -r privoxyosx_setup_x.y.z.zip Privoxy.pkg
- 6.3.8.3. macsetup module
+
+
+
-
+
+
+
+
+ cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co macsetup
+
+
-
-
-
-
-
-
- http://www.junkbusters.com/ht/en/cookies.html, an
- explanation how cookies are used to track web users.
-
-
-
-
-
-
- http://www.junkbusters.com/ijb.html, the original
- Internet Junkbuster.
-
-
-
-
-
-
-
- http://www.junkbusters.com/ht/en/cookies.html,
- an explanation how cookies are used to track web users.
-
-
-
-
-
-
- http://www.junkbusters.com/ijb.html, the original
- Internet Junkbuster.
-