diff options
author | James Bursa <james@netsurf-browser.org> | 2007-07-04 19:05:52 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2007-07-04 19:05:52 +0000 |
commit | 98224bf5a3de43738d8f0f7d1616b901355291be (patch) | |
tree | 3d08c514242255ff80a8b5636794cfa95973bbe5 /Docs | |
parent | 594eb74c4c180dd903a9a3162321e87b8a208576 (diff) | |
download | netsurf-98224bf5a3de43738d8f0f7d1616b901355291be.tar.gz netsurf-98224bf5a3de43738d8f0f7d1616b901355291be.tar.bz2 |
Add section on Coding Style.
svn path=/trunk/netsurf/; revision=3381
Diffstat (limited to 'Docs')
-rw-r--r-- | Docs/00-overview | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Docs/00-overview b/Docs/00-overview index c7984d06b..654854432 100644 --- a/Docs/00-overview +++ b/Docs/00-overview @@ -56,3 +56,25 @@ http://netsurf.strcprstskrzkrk.co.uk/developer/[] - 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 <module>_, +for example html_create(), html_process_data(), etc. This makes functions easy +to find and names unique through the source, which is helpful for backtraces, +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. + |