Author: bursa
Date: Wed Jul 4 20:05:52 2007
New Revision: 3381
URL:
http://source.netsurf-browser.org?rev=3D3381&view=3Drev
Log:
Add section on Coding Style.
Modified:
trunk/netsurf/Docs/00-overview
Modified: trunk/netsurf/Docs/00-overview
URL:
http://source.netsurf-browser.org/trunk/netsurf/Docs/00-overview?rev=
=3D3381&r1=3D3380&r2=3D3381&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/netsurf/Docs/00-overview (original)
+++ trunk/netsurf/Docs/00-overview Wed Jul 4 20:05:52 2007
@@ -56,3 +56,25 @@
- libjpeg (JPEG support)
http://www.ijg.org/[]
- zlib
http://www.gzip.org/zlib/[]
- OpenSSL (HTTPS support)
http://www.openssl.org/[]
+
+Coding Style
+------------
+NetSurf's source is organised in modules. A module usually consists of a .=
c and
+.h file. For example the html module is in html.c and html.h.
+
+All functions (including static functions) in a module should start <modul=
e>_,
+for example html_create(), html_process_data(), etc. This makes functions =
easy
+to find and names unique through the source, which is=C2=A0helpful for bac=
ktraces,
+documentation, etc.
+
+Global variables in a module (including static) should also start <module>=
_.
+
+Static functions should all be declared at the top.
+
+Put functions in a logical order, for example any init function first, then
+functions it calls, then the next externally available function, functions=
it
+calls, etc.
+
+We use K&R style, tabs for indent, 80 characters wide,
+lower_case_with_underscores.
+