blob: 3c2f5011c002853e41406f74e4a1f0152fdb2684 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
Coding standards
----------------
Contributed code should roughly follow [OpenBSD style][1]. For Emacs,
I am using the following snippet to get the appropriate indentation:
(c-add-style
"openbsd"
'("bsd"
(c-basic-offset . 8)
(c-tab-width . 8)
(fill-column . 80)
(indent-tabs-mode . t)
(c-offsets-alist . ((defun-block-intro . +)
(statement-block-intro . +)
(statement-case-intro . +)
(statement-cont . *)
(substatement-open . *)
(substatement . +)
(arglist-cont-nonempty . *)
(inclass . +)
(inextern-lang . 0)
(knr-argdecl-intro . +)))))
Important stuff is to use tabulations. Each tabulation has a width of
8 characters. This limits excessive nesting. Try to respect the 80
columns limit if possible.
Opening braces are on the same line, except for functions where they
are on their own lines. Closing braces are always on their own
lives. Return type for functions are on their own lines too:
int
main(int argc, char *argv[])
{
/* [...] */
}
[1]: http://www.openbsd.org/cgi-bin/man.cgi?query=style&sektion=9
Submitting patches
------------------
Patches against git tip are preferred. Please, clone the repository:
git clone https://github.com/lldpd/lldpd.git
Do any modification you need. Commit the modifications with a
meaningful message:
1. Use a descriptive first-line.
2. Prepend the first line with the name of the subsystem modified
(`lldpd`, `lib`, `client`) or something a bit more precise.
3. Don't be afraid to put a lot of details in the commit message.
Use `git format-patch` to get patches to submit:
git format-patch origin/master
Feel free to use `git send-email` which is like `git format-patch` but
will propose to directly send patches by email. You can also open a
[pull request][2] on Github.
[2]: https://help.github.com/articles/using-pull-requests
|