4 Please read 'submitting-patches' and 'translation-help' in the same directory
10 1. All code should be indented with tabs. (Ignore the use of only spaces in
11 this file) By default, source files contain the following VIM modeline:
12 /* vim: set ts=2 sw=2 noet: */
14 2. When opening new blocks such as 'while', 'if', or 'for', leave the opening
15 brace on the same line as the beginning of the codeblock. The closing brace
16 gets its own line (the only exception being 'else'). Do not use extra
17 spaces around the parentheses of the block. ALWAYS use opening/closing
18 braces, even if it's just a one-line block.
20 for(lp = list; lp; lp = lp->next) {
21 newlist = _alpm_list_add(newlist, strdup(lp->data));
35 3. When declaring a new function, put the opening and closing braces on their
36 own line. Also, when declaring a pointer, do not put a space between the
37 asterisk and the variable name.
39 pmlist_t *_alpm_list_add(pmlist_t *list, void *data)
48 4. Comments should be ANSI-C89 compliant. That means no "// Comment" style;
49 use only "/* Comment */" style.
51 5. Return statements should be written like a function call.
57 6. The sizeof() operator should accept a type, not a value. (TODO: in certain
58 cases, it may be better- should this be a set guideline? Read "The Practice
68 Currently our #include usage is in messy shape, but this is no reason to
69 continue down this messy path. When adding an include to a file, follow this
70 general pattern, including blank lines:
74 #include <standardheader.h>
78 Follow this with some more headers, depending on whether the file is in libalpm
79 or pacman proper. For libalpm:
83 #include "alpm_list.h"
84 #include "anythingelse.h"
89 #include <alpm_list.h>
93 #include "anythingelse.h"
95 vim: set ts=2 sw=2 et: