generated
[privoxy.git] / doc / webserver / developer-manual / index.html
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Privoxy Developer Manual</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.64
8 "><LINK
9 REL="NEXT"
10 TITLE="Introduction"
11 HREF="introduction.html"><LINK
12 REL="STYLESHEET"
13 TYPE="text/css"
14 HREF="../p_doc.css"></HEAD
15 ><BODY
16 CLASS="ARTICLE"
17 BGCOLOR="#EEEEEE"
18 TEXT="#000000"
19 LINK="#0000FF"
20 VLINK="#840084"
21 ALINK="#0000FF"
22 ><DIV
23 CLASS="ARTICLE"
24 ><DIV
25 CLASS="TITLEPAGE"
26 ><H1
27 CLASS="TITLE"
28 ><A
29 NAME="AEN2"
30 >Privoxy Developer Manual</A
31 ></H1
32 ><DIV
33 CLASS="AUTHORGROUP"
34 ><A
35 NAME="AEN5"
36 ></A
37 ><H3
38 CLASS="AUTHOR"
39 ><A
40 NAME="AEN6"
41 ></A
42 ></H3
43 ><DIV
44 CLASS="AFFILIATION"
45 ><SPAN
46 CLASS="ORGNAME"
47 >By: Privoxy Developers<BR></SPAN
48 ></DIV
49 ></DIV
50 ><P
51 CLASS="PUBDATE"
52 >$Id: developer-manual.sgml,v 1.40 2002/05/04 00:43:43 hal9 Exp $<BR></P
53 ><DIV
54 ><DIV
55 CLASS="ABSTRACT"
56 ><A
57 NAME="AEN9"
58 ></A
59 ><P
60 ></P
61 ><P
62 > The developer manual gives the users information on how to help the developer
63  team. It provides guidance on coding, testing, documentation and other
64  issues. 
65  </P
66 ><P
67 > You can find the latest version of the this manual at <A
68 HREF="http://www.privoxy.org/developer-manual/"
69 TARGET="_top"
70 >http://www.privoxy.org/developer-manual/</A
71 >.
72  Please see <A
73 HREF="contact.html"
74 TARGET="_top"
75 >the Contact section</A
76
77  on how to contact the developers.</P
78 ><P
79 ></P
80 ></DIV
81 ></DIV
82 ><HR></DIV
83 ><DIV
84 CLASS="TOC"
85 ><DL
86 ><DT
87 ><B
88 >Table of Contents</B
89 ></DT
90 ><DT
91 >1. <A
92 HREF="introduction.html"
93 >Introduction</A
94 ></DT
95 ><DD
96 ><DL
97 ><DT
98 >1.1. <A
99 HREF="introduction.html#QUICKSTART"
100 >Quickstart to Privoxy Development</A
101 ></DT
102 ></DL
103 ></DD
104 ><DT
105 >2. <A
106 HREF="cvs.html"
107 >The CVS Repository</A
108 ></DT
109 ><DD
110 ><DL
111 ><DT
112 >2.1. <A
113 HREF="cvs.html#CVSACCESS"
114 >Access to CVS</A
115 ></DT
116 ><DT
117 >2.2. <A
118 HREF="cvs.html#CVSCOMMIT"
119 >CVS Commit Guideline</A
120 ></DT
121 ><DT
122 >2.3. <A
123 HREF="cvs.html#CVSWHENASK"
124 >Discussing Changes First</A
125 ></DT
126 ></DL
127 ></DD
128 ><DT
129 >3. <A
130 HREF="documentation.html"
131 >Documentation Guidelines</A
132 ></DT
133 ><DD
134 ><DL
135 ><DT
136 >3.1. <A
137 HREF="documentation.html#SGML"
138 >Quickstart to Docbook and SGML</A
139 ></DT
140 ><DT
141 >3.2. <A
142 HREF="documentation.html#DOCSTYLE"
143 ><SPAN
144 CLASS="APPLICATION"
145 >Privoxy</SPAN
146 > Documentation Style</A
147 ></DT
148 ><DT
149 >3.3. <A
150 HREF="documentation.html#AEN209"
151 >Privoxy Custom Entities</A
152 ></DT
153 ></DL
154 ></DD
155 ><DT
156 >4. <A
157 HREF="coding.html"
158 >Coding Guidelines</A
159 ></DT
160 ><DD
161 ><DL
162 ><DT
163 >4.1. <A
164 HREF="coding.html#S1"
165 >Introduction</A
166 ></DT
167 ><DT
168 >4.2. <A
169 HREF="coding.html#S2"
170 >Using Comments</A
171 ></DT
172 ><DD
173 ><DL
174 ><DT
175 >4.2.1. <A
176 HREF="coding.html#S3"
177 >Comment, Comment, Comment</A
178 ></DT
179 ><DT
180 >4.2.2. <A
181 HREF="coding.html#S4"
182 >Use blocks for comments</A
183 ></DT
184 ><DT
185 >4.2.3. <A
186 HREF="coding.html#S5"
187 >Keep Comments on their own line</A
188 ></DT
189 ><DT
190 >4.2.4. <A
191 HREF="coding.html#S6"
192 >Comment each logical step</A
193 ></DT
194 ><DT
195 >4.2.5. <A
196 HREF="coding.html#S7"
197 >Comment All Functions Thoroughly</A
198 ></DT
199 ><DT
200 >4.2.6. <A
201 HREF="coding.html#S8"
202 >Comment at the end of braces if the
203     content is more than one screen length</A
204 ></DT
205 ></DL
206 ></DD
207 ><DT
208 >4.3. <A
209 HREF="coding.html#S9"
210 >Naming Conventions</A
211 ></DT
212 ><DD
213 ><DL
214 ><DT
215 >4.3.1. <A
216 HREF="coding.html#S10"
217 >Variable Names</A
218 ></DT
219 ><DT
220 >4.3.2. <A
221 HREF="coding.html#S11"
222 >Function Names</A
223 ></DT
224 ><DT
225 >4.3.3. <A
226 HREF="coding.html#S12"
227 >Header file prototypes</A
228 ></DT
229 ><DT
230 >4.3.4. <A
231 HREF="coding.html#S13"
232 >Enumerations, and #defines</A
233 ></DT
234 ><DT
235 >4.3.5. <A
236 HREF="coding.html#S14"
237 >Constants</A
238 ></DT
239 ></DL
240 ></DD
241 ><DT
242 >4.4. <A
243 HREF="coding.html#S15"
244 >Using Space</A
245 ></DT
246 ><DD
247 ><DL
248 ><DT
249 >4.4.1. <A
250 HREF="coding.html#S16"
251 >Put braces on a line by themselves.</A
252 ></DT
253 ><DT
254 >4.4.2. <A
255 HREF="coding.html#S17"
256 >ALL control statements should have a
257     block</A
258 ></DT
259 ><DT
260 >4.4.3. <A
261 HREF="coding.html#S18"
262 >Do not belabor/blow-up boolean
263     expressions</A
264 ></DT
265 ><DT
266 >4.4.4. <A
267 HREF="coding.html#S19"
268 >Use white space freely because it is
269     free</A
270 ></DT
271 ><DT
272 >4.4.5. <A
273 HREF="coding.html#S20"
274 >Don't use white space around structure
275     operators</A
276 ></DT
277 ><DT
278 >4.4.6. <A
279 HREF="coding.html#S21"
280 >Make the last brace of a function stand
281     out</A
282 ></DT
283 ><DT
284 >4.4.7. <A
285 HREF="coding.html#S22"
286 >Use 3 character indentions</A
287 ></DT
288 ></DL
289 ></DD
290 ><DT
291 >4.5. <A
292 HREF="coding.html#S23"
293 >Initializing</A
294 ></DT
295 ><DD
296 ><DL
297 ><DT
298 >4.5.1. <A
299 HREF="coding.html#S24"
300 >Initialize all variables</A
301 ></DT
302 ></DL
303 ></DD
304 ><DT
305 >4.6. <A
306 HREF="coding.html#S25"
307 >Functions</A
308 ></DT
309 ><DD
310 ><DL
311 ><DT
312 >4.6.1. <A
313 HREF="coding.html#S26"
314 >Name functions that return a boolean as a
315     question.</A
316 ></DT
317 ><DT
318 >4.6.2. <A
319 HREF="coding.html#S27"
320 >Always specify a return type for a
321     function.</A
322 ></DT
323 ><DT
324 >4.6.3. <A
325 HREF="coding.html#S28"
326 >Minimize function calls when iterating by
327     using variables</A
328 ></DT
329 ><DT
330 >4.6.4. <A
331 HREF="coding.html#S29"
332 >Pass and Return by Const Reference</A
333 ></DT
334 ><DT
335 >4.6.5. <A
336 HREF="coding.html#S30"
337 >Pass and Return by Value</A
338 ></DT
339 ><DT
340 >4.6.6. <A
341 HREF="coding.html#S31"
342 >Names of include files</A
343 ></DT
344 ><DT
345 >4.6.7. <A
346 HREF="coding.html#S32"
347 >Provide multiple inclusion
348     protection</A
349 ></DT
350 ><DT
351 >4.6.8. <A
352 HREF="coding.html#S33"
353 >Use `extern "C"` when appropriate</A
354 ></DT
355 ><DT
356 >4.6.9. <A
357 HREF="coding.html#S34"
358 >Where Possible, Use Forward Struct
359     Declaration Instead of Includes</A
360 ></DT
361 ></DL
362 ></DD
363 ><DT
364 >4.7. <A
365 HREF="coding.html#S35"
366 >General Coding Practices</A
367 ></DT
368 ><DD
369 ><DL
370 ><DT
371 >4.7.1. <A
372 HREF="coding.html#S36"
373 >Turn on warnings</A
374 ></DT
375 ><DT
376 >4.7.2. <A
377 HREF="coding.html#S37"
378 >Provide a default case for all switch
379     statements</A
380 ></DT
381 ><DT
382 >4.7.3. <A
383 HREF="coding.html#S38"
384 >Try to avoid falling through cases in a
385     switch statement.</A
386 ></DT
387 ><DT
388 >4.7.4. <A
389 HREF="coding.html#S39"
390 >Use 'long' or 'short' Instead of
391     'int'</A
392 ></DT
393 ><DT
394 >4.7.5. <A
395 HREF="coding.html#S40"
396 >Don't mix size_t and other types</A
397 ></DT
398 ><DT
399 >4.7.6. <A
400 HREF="coding.html#S41"
401 >Declare each variable and struct on its
402     own line.</A
403 ></DT
404 ><DT
405 >4.7.7. <A
406 HREF="coding.html#S42"
407 >Use malloc/zalloc sparingly</A
408 ></DT
409 ><DT
410 >4.7.8. <A
411 HREF="coding.html#S43"
412 >The Programmer Who Uses 'malloc' is
413     Responsible for Ensuring 'free'</A
414 ></DT
415 ><DT
416 >4.7.9. <A
417 HREF="coding.html#S44"
418 >Add loaders to the `file_list' structure
419     and in order</A
420 ></DT
421 ><DT
422 >4.7.10. <A
423 HREF="coding.html#S45"
424 >"Uncertain" new code and/or changes to
425     existing code, use FIXME</A
426 ></DT
427 ></DL
428 ></DD
429 ><DT
430 >4.8. <A
431 HREF="coding.html#S46"
432 >Addendum: Template for files and function
433     comment blocks:</A
434 ></DT
435 ></DL
436 ></DD
437 ><DT
438 >5. <A
439 HREF="testing.html"
440 >Testing Guidelines</A
441 ></DT
442 ><DD
443 ><DL
444 ><DT
445 >5.1. <A
446 HREF="testing.html#TESTING-PLAN"
447 >Testplan for releases</A
448 ></DT
449 ><DT
450 >5.2. <A
451 HREF="testing.html#TESTING-REPORT"
452 >Test reports</A
453 ></DT
454 ></DL
455 ></DD
456 ><DT
457 >6. <A
458 HREF="newrelease.html"
459 >Releasing a New Version</A
460 ></DT
461 ><DD
462 ><DL
463 ><DT
464 >6.1. <A
465 HREF="newrelease.html#VERSIONNUMBERS"
466 >Version numbers</A
467 ></DT
468 ><DT
469 >6.2. <A
470 HREF="newrelease.html#BEFORERELEASE"
471 >Before the Release: Freeze</A
472 ></DT
473 ><DT
474 >6.3. <A
475 HREF="newrelease.html#THERELEASE"
476 >Building and Releasing the Packages</A
477 ></DT
478 ><DD
479 ><DL
480 ><DT
481 >6.3.1. <A
482 HREF="newrelease.html#NEWRELEASE-TARBALL"
483 >Source Tarball</A
484 ></DT
485 ><DT
486 >6.3.2. <A
487 HREF="newrelease.html#NEWRELEASE-RPM"
488 >SuSE or Red Hat RPM</A
489 ></DT
490 ><DT
491 >6.3.3. <A
492 HREF="newrelease.html#NEWRELEASE-OS2"
493 >OS/2</A
494 ></DT
495 ><DT
496 >6.3.4. <A
497 HREF="newrelease.html#NEWRELEASE-SOLARIS"
498 >Solaris</A
499 ></DT
500 ><DT
501 >6.3.5. <A
502 HREF="newrelease.html#NEWRELEASE-WINDOWS"
503 >Windows</A
504 ></DT
505 ><DT
506 >6.3.6. <A
507 HREF="newrelease.html#NEWRELEASE-DEBIAN"
508 >Debian</A
509 ></DT
510 ><DT
511 >6.3.7. <A
512 HREF="newrelease.html#NEWRELEASE-MACOSX"
513 >Mac OSX</A
514 ></DT
515 ><DT
516 >6.3.8. <A
517 HREF="newrelease.html#NEWRELEASE-FREEBSD"
518 >FreeBSD</A
519 ></DT
520 ><DT
521 >6.3.9. <A
522 HREF="newrelease.html#NEWRELEASE-HPUX"
523 >HP-UX 11</A
524 ></DT
525 ><DT
526 >6.3.10. <A
527 HREF="newrelease.html#NEWRELEASE-AMIGA"
528 >Amiga OS</A
529 ></DT
530 ><DT
531 >6.3.11. <A
532 HREF="newrelease.html#NEWRELEASE-AIX"
533 >AIX</A
534 ></DT
535 ></DL
536 ></DD
537 ><DT
538 >6.4. <A
539 HREF="newrelease.html#RELEASING"
540 >Uploading and Releasing Your Package</A
541 ></DT
542 ><DT
543 >6.5. <A
544 HREF="newrelease.html#AFTERRELEASE"
545 >After the Release</A
546 ></DT
547 ></DL
548 ></DD
549 ><DT
550 >7. <A
551 HREF="webserver-update.html"
552 >Update the Webserver</A
553 ></DT
554 ><DT
555 >8. <A
556 HREF="contact.html"
557 >Contacting the developers, Bug Reporting and Feature Requests</A
558 ></DT
559 ><DD
560 ><DL
561 ><DT
562 >8.1. <A
563 HREF="contact.html#CONTACT-SUPPORT"
564 >Get Support</A
565 ></DT
566 ><DT
567 >8.2. <A
568 HREF="contact.html#CONTACT-BUGS"
569 >Report bugs</A
570 ></DT
571 ><DT
572 >8.3. <A
573 HREF="contact.html#CONTACT-FEATURE"
574 >Request new features</A
575 ></DT
576 ><DT
577 >8.4. <A
578 HREF="contact.html#CONTACT-ADS"
579 >Report ads or other filter problems</A
580 ></DT
581 ><DT
582 >8.5. <A
583 HREF="contact.html#CONTACT-OTHER"
584 >Other</A
585 ></DT
586 ></DL
587 ></DD
588 ><DT
589 >9. <A
590 HREF="copyright.html"
591 >Copyright and History</A
592 ></DT
593 ><DD
594 ><DL
595 ><DT
596 >9.1. <A
597 HREF="copyright.html#AEN1057"
598 >Copyright</A
599 ></DT
600 ><DT
601 >9.2. <A
602 HREF="copyright.html#AEN1064"
603 >History</A
604 ></DT
605 ></DL
606 ></DD
607 ><DT
608 >10. <A
609 HREF="seealso.html"
610 >See also</A
611 ></DT
612 ></DL
613 ></DIV
614 ></DIV
615 ><DIV
616 CLASS="NAVFOOTER"
617 ><HR
618 ALIGN="LEFT"
619 WIDTH="100%"><TABLE
620 WIDTH="100%"
621 BORDER="0"
622 CELLPADDING="0"
623 CELLSPACING="0"
624 ><TR
625 ><TD
626 WIDTH="33%"
627 ALIGN="left"
628 VALIGN="top"
629 >&nbsp;</TD
630 ><TD
631 WIDTH="34%"
632 ALIGN="center"
633 VALIGN="top"
634 >&nbsp;</TD
635 ><TD
636 WIDTH="33%"
637 ALIGN="right"
638 VALIGN="top"
639 ><A
640 HREF="introduction.html"
641 >Next</A
642 ></TD
643 ></TR
644 ><TR
645 ><TD
646 WIDTH="33%"
647 ALIGN="left"
648 VALIGN="top"
649 >&nbsp;</TD
650 ><TD
651 WIDTH="34%"
652 ALIGN="center"
653 VALIGN="top"
654 >&nbsp;</TD
655 ><TD
656 WIDTH="33%"
657 ALIGN="right"
658 VALIGN="top"
659 >Introduction</TD
660 ></TR
661 ></TABLE
662 ></DIV
663 ></BODY
664 ></HTML
665 >