projects
/
privoxy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fresh build of ALL html docs.
[privoxy.git]
/
doc
/
webserver
/
developer-manual
/
coding.html
diff --git
a/doc/webserver/developer-manual/coding.html
b/doc/webserver/developer-manual/coding.html
index
ca973e3
..
656a97d
100644
(file)
--- a/
doc/webserver/developer-manual/coding.html
+++ b/
doc/webserver/developer-manual/coding.html
@@
-1,11
+1,11
@@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Coding Guidelines</TITLE
><META
NAME="GENERATOR"
<HTML
><HEAD
><TITLE
>Coding Guidelines</TITLE
><META
NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
-"><LINK
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="Privoxy Developer Manual"
HREF="index.html"><LINK
REL="HOME"
TITLE="Privoxy Developer Manual"
HREF="index.html"><LINK
@@
-73,13
+73,17
@@
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
><H1
CLASS="SECT1"
><A
-NAME="CODING">4. Coding Guidelines</H1
+NAME="CODING"
+>4. Coding Guidelines</A
+></H1
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
-NAME="S1">4.1. Introduction</H2
+NAME="S1"
+>4.1. Introduction</A
+></H2
><P
>This set of standards is designed to make our lives easier. It is
developed with the simple goal of helping us keep the "new and improved
><P
>This set of standards is designed to make our lives easier. It is
developed with the simple goal of helping us keep the "new and improved
@@
-100,13
+104,17
@@
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
><H2
CLASS="SECT2"
><A
-NAME="S2">4.2. Using Comments</H2
+NAME="S2"
+>4.2. Using Comments</A
+></H2
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
-NAME="S3">4.2.1. Comment, Comment, Comment</H3
+NAME="S3"
+>4.2.1. Comment, Comment, Comment</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-117,8
+125,8
@@
CLASS="EMPHASIS"
></P
><P
>Comment as much as possible without commenting the obvious.
></P
><P
>Comment as much as possible without commenting the obvious.
- For example do not comment "
aVariable is equal to bVariable
".
- Instead explain why
aVariable should be equal to the bVariable
.
+ For example do not comment "
variable_a is equal to variable_b
".
+ Instead explain why
variable_a should be equal to the variable_b
.
Just because a person can read code does not mean they will
understand why or what is being done. A reader may spend a lot
more time figuring out what is going on when a simple comment
Just because a person can read code does not mean they will
understand why or what is being done. A reader may spend a lot
more time figuring out what is going on when a simple comment
@@
-145,13
+153,13
@@
WIDTH="100%"
><PRE
CLASS="PROGRAMLISTING"
>/* if page size greater than 1k ... */
><PRE
CLASS="PROGRAMLISTING"
>/* if page size greater than 1k ... */
-if (
PageL
ength() > 1024 )
+if (
page_l
ength() > 1024 )
{
... "block" the page up ...
}
/* if page size is small, send it in blocks */
{
... "block" the page up ...
}
/* if page size is small, send it in blocks */
-if (
PageL
ength() > 1024 )
+if (
page_l
ength() > 1024 )
{
... "block" the page up ...
}
{
... "block" the page up ...
}
@@
-168,7
+176,9
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S4">4.2.2. Use blocks for comments</H3
+NAME="S4"
+>4.2.2. Use blocks for comments</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-202,22
+212,22
@@
CLASS="PROGRAMLISTING"
>/*********************************************************************
* This will stand out clearly in your code!
*********************************************************************/
>/*********************************************************************
* This will stand out clearly in your code!
*********************************************************************/
-if ( this
Variable == thatV
ariable )
+if ( this
_variable == that_v
ariable )
{
{
-
DoSomethingVeryI
mportant();
+
do_something_very_i
mportant();
}
/* unfortunately, this may not */
}
/* unfortunately, this may not */
-if ( this
Variable == thatV
ariable )
+if ( this
_variable == that_v
ariable )
{
{
-
DoSomethingVeryI
mportant();
+
do_something_very_i
mportant();
}
}
-if ( this
Variable == thatV
ariable ) /* this may not either */
+if ( this
_variable == that_v
ariable ) /* this may not either */
{
{
-
DoSomethingVeryI
mportant();
+
do_something_very_i
mportant();
}</PRE
></TD
></TR
}</PRE
></TD
></TR
@@
-240,7
+250,9
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S5">4.2.3. Keep Comments on their own line</H3
+NAME="S5"
+>4.2.3. Keep Comments on their own line</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-278,14
+290,14
@@
CLASS="PROGRAMLISTING"
* This will stand out clearly in your code,
* But the second example won't.
*********************************************************************/
* This will stand out clearly in your code,
* But the second example won't.
*********************************************************************/
-if ( this
Variable == thatV
ariable )
+if ( this
_variable == this_v
ariable )
{
{
-
DoSomethingVeryI
mportant();
+
do_something_very_i
mportant();
}
}
-if ( this
Variable == thatV
ariable ) /*can you see me?*/
+if ( this
_variable == this_v
ariable ) /*can you see me?*/
{
{
-
DoSomethingVeryI
mportant(); /*not easily*/
+
do_something_very_i
mportant(); /*not easily*/
}
}
@@
-297,17
+309,17
@@
int urls_rejected = 0; /* # of urls rejected */
if ( 1 == X )
{
if ( 1 == X )
{
-
DoSomethingVeryI
mportant();
+
do_something_very_i
mportant();
}
}
-short
DoSomethingVeryI
mportant(
+short
do_something_very_i
mportant(
short firstparam, /* represents something */
short nextparam /* represents something else */ )
{
...code here...
short firstparam, /* represents something */
short nextparam /* represents something else */ )
{
...code here...
-} /* -END-
DoSomethingVeryI
mportant */</PRE
+} /* -END-
do_something_very_i
mportant */</PRE
></TD
></TR
></TABLE
></TD
></TR
></TABLE
@@
-317,7
+329,9
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S6">4.2.4. Comment each logical step</H3
+NAME="S6"
+>4.2.4. Comment each logical step</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-344,7
+358,9
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S7">4.2.5. Comment All Functions Thoroughly</H3
+NAME="S7"
+>4.2.5. Comment All Functions Thoroughly</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-372,8
+388,10
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S8">4.2.6. Comment at the end of braces if the
- content is more than one screen length</H3
+NAME="S8"
+>4.2.6. Comment at the end of braces if the
+ content is more than one screen length</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-412,7
+430,7
@@
WIDTH="100%"
CLASS="PROGRAMLISTING"
>if ( 1 == X )
{
CLASS="PROGRAMLISTING"
>if ( 1 == X )
{
-
DoSomethingVeryI
mportant();
+
do_something_very_i
mportant();
...some long list of commands...
} /* -END- if x is 1 */
...some long list of commands...
} /* -END- if x is 1 */
@@
-420,7
+438,7
@@
or:
if ( 1 == X )
{
if ( 1 == X )
{
-
DoSomethingVeryI
mportant();
+
do_something_very_i
mportant();
...some long list of commands...
} /* -END- if ( 1 == X ) */</PRE
></TD
...some long list of commands...
} /* -END- if ( 1 == X ) */</PRE
></TD
@@
-433,13
+451,17
@@
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
><H2
CLASS="SECT2"
><A
-NAME="S9">4.3. Naming Conventions</H2
+NAME="S9"
+>4.3. Naming Conventions</A
+></H2
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
-NAME="S10">4.3.1. Variable Names</H3
+NAME="S10"
+>4.3.1. Variable Names</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-503,7
+525,9
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S11">4.3.2. Function Names</H3
+NAME="S11"
+>4.3.2. Function Names</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-568,7
+592,9
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S12">4.3.3. Header file prototypes</H3
+NAME="S12"
+>4.3.3. Header file prototypes</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-631,7
+657,9
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S13">4.3.4. Enumerations, and #defines</H3
+NAME="S13"
+>4.3.4. Enumerations, and #defines</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-705,7
+733,9
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S14">4.3.5. Constants</H3
+NAME="S14"
+>4.3.5. Constants</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-775,13
+805,17
@@
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
><H2
CLASS="SECT2"
><A
-NAME="S15">4.4. Using Space</H2
+NAME="S15"
+>4.4. Using Space</A
+></H2
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
-NAME="S16">4.4.1. Put braces on a line by themselves.</H3
+NAME="S16"
+>4.4.1. Put braces on a line by themselves.</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-885,8
+919,10
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S17">4.4.2. ALL control statements should have a
- block</H3
+NAME="S17"
+>4.4.2. ALL control statements should have a
+ block</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-917,8
+953,8
@@
WIDTH="100%"
CLASS="PROGRAMLISTING"
>if ( this == that )
{
CLASS="PROGRAMLISTING"
>if ( this == that )
{
-
DoS
omething();
-
DoSomethingE
lse();
+
do_s
omething();
+
do_something_e
lse();
}</PRE
></TD
></TR
}</PRE
></TD
></TR
@@
-932,11
+968,11
@@
CLASS="EMPHASIS"
></SPAN
></P
><P
></SPAN
></P
><P
->if ( this == that )
DoSomething(); DoSomethingE
lse();</P
+>if ( this == that )
do_something(); do_something_e
lse();</P
><P
>or</P
><P
><P
>or</P
><P
->if ( this == that )
DoS
omething();</P
+>if ( this == that )
do_s
omething();</P
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-955,8
+991,10
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S18">4.4.3. Do not belabor/blow-up boolean
- expressions</H3
+NAME="S18"
+>4.4.3. Do not belabor/blow-up boolean
+ expressions</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1005,8
+1043,10
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S19">4.4.4. Use white space freely because it is
- free</H3
+NAME="S19"
+>4.4.4. Use white space freely because it is
+ free</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1034,14
+1074,14
@@
WIDTH="100%"
><TD
><PRE
CLASS="PROGRAMLISTING"
><TD
><PRE
CLASS="PROGRAMLISTING"
->int first
V
alue = 0;
-int some
V
alue = 0;
-int another
V
alue = 0;
-int this
V
ariable = 0;
+>int first
_v
alue = 0;
+int some
_v
alue = 0;
+int another
_v
alue = 0;
+int this
_v
ariable = 0;
-if ( this
Variable == thatV
ariable )
+if ( this
_variable == this_v
ariable )
-first
Value = oldValue + ( ( someValue - anotherV
alue ) - whatever )</PRE
+first
_value = old_value + ( ( some_value - another_v
alue ) - whatever )</PRE
></TD
></TR
></TABLE
></TD
></TR
></TABLE
@@
-1051,8
+1091,10
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S20">4.4.5. Don't use white space around structure
- operators</H3
+NAME="S20"
+>4.4.5. Don't use white space around structure
+ operators</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1085,9
+1127,9
@@
WIDTH="100%"
><TD
><PRE
CLASS="PROGRAMLISTING"
><TD
><PRE
CLASS="PROGRAMLISTING"
->a
Struct->aM
ember;
-a
Struct.aM
ember;
-
FunctionN
ame();</PRE
+>a
_struct->a_m
ember;
+a
_struct.a_m
ember;
+
function_n
ame();</PRE
></TD
></TR
></TABLE
></TD
></TR
></TABLE
@@
-1098,16
+1140,18
@@
CLASS="emphasis"
CLASS="EMPHASIS"
>Instead of:</I
></SPAN
CLASS="EMPHASIS"
>Instead of:</I
></SPAN
-> a
Struct -> aMember; aStruct . aM
ember;
-
FunctionN
ame ();</P
+> a
_struct -> a_member; a_struct . a_m
ember;
+
function_n
ame ();</P
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
-NAME="S21">4.4.6. Make the last brace of a function stand
- out</H3
+NAME="S21"
+>4.4.6. Make the last brace of a function stand
+ out</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1127,7
+1171,7
@@
CLASS="PROGRAMLISTING"
>int function1( ... )
{
...code...
>int function1( ... )
{
...code...
- return( ret
C
ode );
+ return( ret
_c
ode );
} /* -END- function1 */
} /* -END- function1 */
@@
-1147,7
+1191,7
@@
CLASS="EMPHASIS"
></SPAN
></P
><P
></SPAN
></P
><P
->int function1( ... ) { ...code... return( ret
C
ode ); } int
+>int function1( ... ) { ...code... return( ret
_c
ode ); } int
function2( ... ) { }</P
><P
><SPAN
function2( ... ) { }</P
><P
><SPAN
@@
-1178,7
+1222,9
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S22">4.4.7. Use 3 character indentions</H3
+NAME="S22"
+>4.4.7. Use 3 character indentions</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1238,13
+1284,17
@@
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
><H2
CLASS="SECT2"
><A
-NAME="S23">4.5. Initializing</H2
+NAME="S23"
+>4.5. Initializing</A
+></H2
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
-NAME="S24">4.5.1. Initialize all variables</H3
+NAME="S24"
+>4.5.1. Initialize all variables</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1274,8
+1324,8
@@
WIDTH="100%"
><TD
><PRE
CLASS="PROGRAMLISTING"
><TD
><PRE
CLASS="PROGRAMLISTING"
->short a
nS
hort = 0;
-float a
F
loat = 0;
+>short a
_s
hort = 0;
+float a
_f
loat = 0;
struct *ptr = NULL;</PRE
></TD
></TR
struct *ptr = NULL;</PRE
></TD
></TR
@@
-1289,8
+1339,8
@@
CLASS="EMPHASIS"
></SPAN
> It is much easier to debug a SIGSEGV if the
message says you are trying to access memory address 00000000
></SPAN
> It is much easier to debug a SIGSEGV if the
message says you are trying to access memory address 00000000
- and not 129FA012; or array
P
tr[20] causes a SIGSEV vs.
- array
P
tr[0].</P
+ and not 129FA012; or array
_p
tr[20] causes a SIGSEV vs.
+ array
_p
tr[0].</P
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1307,14
+1357,18
@@
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
><H2
CLASS="SECT2"
><A
-NAME="S25">4.6. Functions</H2
+NAME="S25"
+>4.6. Functions</A
+></H2
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
-NAME="S26">4.6.1. Name functions that return a boolean as a
- question.</H3
+NAME="S26"
+>4.6.1. Name functions that return a boolean as a
+ question.</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1342,9
+1396,9
@@
WIDTH="100%"
><TD
><PRE
CLASS="PROGRAMLISTING"
><TD
><PRE
CLASS="PROGRAMLISTING"
->
ShouldWeBlockT
his();
-
ContainsAnI
mage();
-
IsWebPageB
lank();</PRE
+>
should_we_block_t
his();
+
contains_an_i
mage();
+
is_web_page_b
lank();</PRE
></TD
></TR
></TABLE
></TD
></TR
></TABLE
@@
-1354,8
+1408,10
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S27">4.6.2. Always specify a return type for a
- function.</H3
+NAME="S27"
+>4.6.2. Always specify a return type for a
+ function.</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1375,8
+1431,10
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S28">4.6.3. Minimize function calls when iterating by
- using variables</H3
+NAME="S28"
+>4.6.3. Minimize function calls when iterating by
+ using variables</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1404,7
+1462,7
@@
WIDTH="100%"
><TD
><PRE
CLASS="PROGRAMLISTING"
><TD
><PRE
CLASS="PROGRAMLISTING"
->for ( size_t cnt = 0; cnt < block
ListLength(); cnt
++ )
+>for ( size_t cnt = 0; cnt < block
_list_length(); cnt
++ )
{
....
}</PRE
{
....
}</PRE
@@
-1422,10
+1480,10
@@
CLASS="EMPHASIS"
each and every iteration. This increases the overhead in the
program, because the compiler has to look up the function each
time, call it, and return a value. Depending on what occurs in
each and every iteration. This increases the overhead in the
program, because the compiler has to look up the function each
time, call it, and return a value. Depending on what occurs in
- the block
ListL
ength() call, it might even be creating and
+ the block
_list_l
ength() call, it might even be creating and
destroying structures with each iteration, even though in each
case it is comparing "cnt" to the same value, over and over.
destroying structures with each iteration, even though in each
case it is comparing "cnt" to the same value, over and over.
- Remember too - even a call to block
ListL
ength() is a function
+ Remember too - even a call to block
_list_l
ength() is a function
call, with the same overhead.</P
><P
>Instead of using a function call during the iterations,
call, with the same overhead.</P
><P
>Instead of using a function call during the iterations,
@@
-1447,9
+1505,9
@@
WIDTH="100%"
><TD
><PRE
CLASS="PROGRAMLISTING"
><TD
><PRE
CLASS="PROGRAMLISTING"
->size_t len = block
ListL
ength();
+>size_t len = block
_list_l
ength();
-for ( size_t cnt = 0; cnt < len; cnt
++ )
+for ( size_t cnt = 0; cnt < len; cnt++ )
{
....
}</PRE
{
....
}</PRE
@@
-1463,8
+1521,8
@@
CLASS="emphasis"
CLASS="EMPHASIS"
>Exceptions:</I
></SPAN
CLASS="EMPHASIS"
>Exceptions:</I
></SPAN
-> if the value of block
ListLength() *may*
- change or could *potentially* change, then you must code the
+> if the value of block
_list_length()
+
*may*
change or could *potentially* change, then you must code the
function call in the for/while loop.</P
></DIV
><DIV
function call in the for/while loop.</P
></DIV
><DIV
@@
-1472,7
+1530,9
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S29">4.6.4. Pass and Return by Const Reference</H3
+NAME="S29"
+>4.6.4. Pass and Return by Const Reference</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1500,7
+1560,9
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S30">4.6.5. Pass and Return by Value</H3
+NAME="S30"
+>4.6.5. Pass and Return by Value</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1523,7
+1585,9
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S31">4.6.6. Names of include files</H3
+NAME="S31"
+>4.6.6. Names of include files</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1599,8
+1663,10
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S32">4.6.7. Provide multiple inclusion
- protection</H3
+NAME="S32"
+>4.6.7. Provide multiple inclusion
+ protection</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1646,7
+1712,9
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S33">4.6.8. Use `extern "C"` when appropriate</H3
+NAME="S33"
+>4.6.8. Use `extern "C"` when appropriate</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1694,8
+1762,10
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S34">4.6.9. Where Possible, Use Forward Struct
- Declaration Instead of Includes</H3
+NAME="S34"
+>4.6.9. Where Possible, Use Forward Struct
+ Declaration Instead of Includes</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1758,13
+1828,17
@@
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
><H2
CLASS="SECT2"
><A
-NAME="S35">4.7. General Coding Practices</H2
+NAME="S35"
+>4.7. General Coding Practices</A
+></H2
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
-NAME="S36">4.7.1. Turn on warnings</H3
+NAME="S36"
+>4.7.1. Turn on warnings</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1783,8
+1857,10
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S37">4.7.2. Provide a default case for all switch
- statements</H3
+NAME="S37"
+>4.7.2. Provide a default case for all switch
+ statements</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1854,7
+1930,7
@@
CLASS="EMPHASIS"
> This is not so much a readability issue
as a robust programming issue. The "anomaly code goes here" may
be no more than a print to the STDERR stream (as in
> This is not so much a readability issue
as a robust programming issue. The "anomaly code goes here" may
be no more than a print to the STDERR stream (as in
- load_config). Or it may really be an
ABEND
condition.</P
+ load_config). Or it may really be an
abort
condition.</P
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1869,8
+1945,10
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S38">4.7.3. Try to avoid falling through cases in a
- switch statement.</H3
+NAME="S38"
+>4.7.3. Try to avoid falling through cases in a
+ switch statement.</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1901,8
+1979,10
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S39">4.7.4. Use 'long' or 'short' Instead of
- 'int'</H3
+NAME="S39"
+>4.7.4. Use 'long' or 'short' Instead of
+ 'int'</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1932,7
+2012,9
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S40">4.7.5. Don't mix size_t and other types</H3
+NAME="S40"
+>4.7.5. Don't mix size_t and other types</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-1946,16
+2028,17
@@
CLASS="EMPHASIS"
assumptions about whether it is signed or unsigned, or about
how long it is. Do not compare a size_t against another
variable of a different type (or even against a constant)
assumptions about whether it is signed or unsigned, or about
how long it is. Do not compare a size_t against another
variable of a different type (or even against a constant)
- without casting one of the values. Try to avoid using size_t if
- you can.</P
+ without casting one of the values.</P
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
-NAME="S41">4.7.6. Declare each variable and struct on its
- own line.</H3
+NAME="S41"
+>4.7.6. Declare each variable and struct on its
+ own line.</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-2020,7
+2103,7
@@
CLASS="EMPHASIS"
></SPAN
> when you want to declare a bunch of loop
variables or other trivial variables; feel free to declare them
></SPAN
> when you want to declare a bunch of loop
variables or other trivial variables; feel free to declare them
- on
1
line. You should, although, provide a good comment on
+ on
one
line. You should, although, provide a good comment on
their functions.</P
><P
><SPAN
their functions.</P
><P
><SPAN
@@
-2036,7
+2119,9
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S42">4.7.7. Use malloc/zalloc sparingly</H3
+NAME="S42"
+>4.7.7. Use malloc/zalloc sparingly</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-2078,8
+2163,10
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S43">4.7.8. The Programmer Who Uses 'malloc' is
- Responsible for Ensuring 'free'</H3
+NAME="S43"
+>4.7.8. The Programmer Who Uses 'malloc' is
+ Responsible for Ensuring 'free'</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-2145,8
+2232,10
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S44">4.7.9. Add loaders to the `file_list' structure
- and in order</H3
+NAME="S44"
+>4.7.9. Add loaders to the `file_list' structure
+ and in order</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-2176,8
+2265,10
@@
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
><H3
CLASS="SECT3"
><A
-NAME="S45">4.7.10. "Uncertain" new code and/or changes to
- existing code, use FIXME</H3
+NAME="S45"
+>4.7.10. "Uncertain" new code and/or changes to
+ existing code, use FIXME or XXX</A
+></H3
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-2222,8
+2313,10
@@
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
><H2
CLASS="SECT2"
><A
-NAME="S46">4.8. Addendum: Template for files and function
- comment blocks:</H2
+NAME="S46"
+>4.8. Addendum: Template for files and function
+ comment blocks:</A
+></H2
><P
><SPAN
CLASS="emphasis"
><P
><SPAN
CLASS="emphasis"
@@
-2240,14
+2333,14
@@
WIDTH="100%"
><TD
><PRE
CLASS="PROGRAMLISTING"
><TD
><PRE
CLASS="PROGRAMLISTING"
->const char FILENAME_rcs[] = "$Id: developer-manual.sgml,v 2.
3 2002/09/05 02:27:59 hal9
Exp $";
+>const char FILENAME_rcs[] = "$Id: developer-manual.sgml,v 2.
13 2007/10/30 17:59:31 fabiankeil
Exp $";
/*********************************************************************
*
* File : $Source$
*
* Purpose : (Fill me in with a good description!)
*
/*********************************************************************
*
* File : $Source$
*
* Purpose : (Fill me in with a good description!)
*
- * Copyright : Written by and Copyright (C) 2001 the SourceForge
+ * Copyright : Written by and Copyright (C) 2001
-2007
the SourceForge
* Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
* Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
@@
-2269,8
+2362,9
@@
CLASS="PROGRAMLISTING"
* The GNU General Public License should be included with
* this file. If not, you can view it at
* http://www.gnu.org/copyleft/gpl.html
* The GNU General Public License should be included with
* this file. If not, you can view it at
* http://www.gnu.org/copyleft/gpl.html
- * or write to the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * or write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ,
+ * USA
*
* Revisions :
* $Log$
*
* Revisions :
* $Log$
@@
-2327,14
+2421,14
@@
WIDTH="100%"
CLASS="PROGRAMLISTING"
>#ifndef _FILENAME_H
#define _FILENAME_H
CLASS="PROGRAMLISTING"
>#ifndef _FILENAME_H
#define _FILENAME_H
-#define FILENAME_H_VERSION "$Id: developer-manual.sgml,v 2.
3 2002/09/05 02:27:59 hal9
Exp $"
+#define FILENAME_H_VERSION "$Id: developer-manual.sgml,v 2.
13 2007/10/30 17:59:31 fabiankeil
Exp $"
/*********************************************************************
*
* File : $Source$
*
* Purpose : (Fill me in with a good description!)
*
/*********************************************************************
*
* File : $Source$
*
* Purpose : (Fill me in with a good description!)
*
- * Copyright : Written by and Copyright (C) 2001 the SourceForge
+ * Copyright : Written by and Copyright (C) 2001
-2007
the SourceForge
* Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
* Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
@@
-2356,8
+2450,9
@@
CLASS="PROGRAMLISTING"
* The GNU General Public License should be included with
* this file. If not, you can view it at
* http://www.gnu.org/copyleft/gpl.html
* The GNU General Public License should be included with
* this file. If not, you can view it at
* http://www.gnu.org/copyleft/gpl.html
- * or write to the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * or write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ,
+ * USA
*
* Revisions :
* $Log$
*
* Revisions :
* $Log$