path: root/documentation/modular_coding_style.mdwn
diff options
authorDaniel Silverstone <>2017-02-04 09:41:13 +0000
committerDaniel Silverstone <>2017-02-04 09:41:13 +0000
commite7366bf41f68cfe07e9ea03fc4a398baecbae651 (patch)
tree5bb9c3cbe7eab7e70ff1ebd65d9de59a694762df /documentation/modular_coding_style.mdwn
Initial conversion from MediaWiki, 20170204
Diffstat (limited to 'documentation/modular_coding_style.mdwn')
1 files changed, 39 insertions, 0 deletions
diff --git a/documentation/modular_coding_style.mdwn b/documentation/modular_coding_style.mdwn
new file mode 100644
index 0000000..da07a8a
--- /dev/null
+++ b/documentation/modular_coding_style.mdwn
@@ -0,0 +1,39 @@
+[[!meta title="Documentation/Modular Coding Style"]]
+[[!meta author="James Bursa"]]
+[[!meta date="2011-11-26T22:20:15Z"]]
+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
+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.
+Coding Style
+We use K&R (2nd edition ANSI C) style, tabs for indent, 80 characters
+wide, lower\_case\_with\_underscores.
+See the [Style
+Guide]( for
+further information and examples.
+[[!inline raw=yes pages="Documentation"]]