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.

Version 1 (modified by queueram, 16 years ago) (diff)

Added Pidgin coding style standards provided by Sadrul

Coding Standards

We try to follow K&R coding style in most of or code. Here are some examples to help explain:

Braces

  • Braces start at the same line as the if/while/do/for block
  • End braces are on their own lines, indented to the starting of the block, e.g.:
    for (i = 0; i < x; i++) {
            /* the code here, indented by a tab */
    }
    
  • The starting braces for functions, structs etc. are on their own lines e.g.:
    struct _somestruct
    {
            /* stuff */
    };
    

Indentation

  • We use tab for indentation (and it's preferable that you use 8-space tabs in your editor)

Whitespace

  • A space (or a newline) after ; , =
  • A space in front of = and ( except for function calls. e.g.:
    for (i = 0; i < x; i++) ..
    
    some_function(var1, var2);
    

Comments

  • A comment or two in the static (non-exported) functions is good, but not essential.
  • 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!