Trac is being migrated to new services! Issues can be found in our new
YouTrack instance and WIKI pages can be found on our
website.
- Timestamp:
-
Apr 22, 2008, 4:13:20 AM (16 years ago)
- Author:
-
queueram
- Comment:
-
Added Pidgin coding style standards provided by Sadrul
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v1
|
v1
|
|
| 1 | = Coding Standards = |
| 2 | |
| 3 | We try to follow K&R coding style in most of or code. Here are some examples to help explain: |
| 4 | |
| 5 | == Braces == |
| 6 | * Braces start at the same line as the if/while/do/for block |
| 7 | * End braces are on their own lines, indented to the starting of the |
| 8 | block, e.g.: |
| 9 | {{{ |
| 10 | #!c |
| 11 | for (i = 0; i < x; i++) { |
| 12 | /* the code here, indented by a tab */ |
| 13 | } |
| 14 | }}} |
| 15 | * The starting braces for functions, structs etc. are on their own lines e.g.: |
| 16 | {{{ |
| 17 | #!c |
| 18 | struct _somestruct |
| 19 | { |
| 20 | /* stuff */ |
| 21 | }; |
| 22 | }}} |
| 23 | |
| 24 | == Indentation == |
| 25 | * We use tab for indentation (and it's preferable that you use 8-space tabs in your editor) |
| 26 | |
| 27 | |
| 28 | == Whitespace == |
| 29 | * A space (or a newline) after ; , = |
| 30 | * A space in front of = and ( except for function calls. e.g.: |
| 31 | {{{ |
| 32 | #!c |
| 33 | for (i = 0; i < x; i++) .. |
| 34 | |
| 35 | some_function(var1, var2); |
| 36 | }}} |
| 37 | |
| 38 | == Comments == |
| 39 | * A comment or two in the static (non-exported) functions is good, but not essential. |
| 40 | * Every function added in any header file must be documented. See any of the header files in our tree for example. |
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!