Coding style
General rules
Indenting and spaces
Throughout all of the project, a tab spacing of 8 spaces has been used. This is the default on most platforms, and the only one tolerated for the project.Likewise, a maximum width of 80 characters per line is enforced, for the following reasons:
- it is easier to read shorter lines,
- more generally, to maintain readability on each and every text console,
- to be also as readable as likely on even smaller screens (eg embedded devices)
- to enforce source code to be written with a maximum of three sub-scopes per function.
Spurious spaces at the end of lines, or lines containing solely white-space characters are forbidden.
Specific to the C programming language
Any function and variable that is not meant to be exported (available to other objects) must be declared "static", and prefixed with an underscore ("_").Specific to the Gtk+ library
Any function that is not available in Gtk+ 2.4 should not be relied upon; the program must compile and work normally without them. It is encouraged to use newer, better functions when available; they must however be accompanied by a fallback version of the code.Dialog windows should use the GtkDialog class by default.