| 1 | == HelenOS Coding Style Standard == |
| 2 | |
| 3 | === Entity Naming === |
| 4 | |
| 5 | * Names' words shall be separated by underscore "_". |
| 6 | * Types shall be suffixed with "_t". |
| 7 | * Macros shall be upper case. |
| 8 | |
| 9 | === Names === |
| 10 | |
| 11 | * Use sensible, descriptive names. |
| 12 | * Only use English names. |
| 13 | * Variables with a large scope should have long names, variables with a small scope can have short names. |
| 14 | * Use name prefixes for identifiers declared in different modules. |
| 15 | |
| 16 | === Indentation and Spacing === |
| 17 | |
| 18 | * Do not use spaces for indentation, except for long line wrapping purposes. |
| 19 | * Consider breaking long lines at 80-character boundary. The wrapped line should continue indented four spaces to the right of the original indentation. |
| 20 | * Braces shall follow "K&R Bracing Style". |
| 21 | * Braces shall be indented 1 tab to the right of the starting position of the enclosing statement or declaration. |
| 22 | * Braces without any contents may be placed on the same line. |
| 23 | * Each statement shall be placed on a line on its own. |
| 24 | * All binary arithmetic, bitwise and assignment operators and the ternary conditional operator (?:) shall be surrounded by spaces; the comma operator shall be followed by a space but not preceded; all other operators shall not be used with spaces. |
| 25 | |
| 26 | === Comments === |
| 27 | |
| 28 | * Comments shall be written in English. |
| 29 | * Multiline comments begin with "*" on each inner line. |
| 30 | * Use Doxygen style comments for documenting functions. |
| 31 | * All comments shall be placed above the line the comment describes, indented identically. |
| 32 | * Every function shall have a comment that describes its purpose. |
| 33 | |
| 34 | === Miscellaneous === |
| 35 | |
| 36 | * New lines are represented by the LF ('\n') character. Do not use CR + LF or CR. |