scripts: add PATH variable
[platform/core/uifw/headless-server.git] / CODING_STYLE
1 == Coding style ==
2
3 You should follow the style of the file you're editing. In general, we
4 try to follow the rules below.
5
6 - indent with tabs, and a tab is always 4 characters wide
7 - opening braces are on the same line as the if statement;
8 - no braces in an if-body with just one statement;
9 - if one of the branches of an if-else codition has braces, than the
10   other branch should also have braces;
11 - there is always an empty line between variable declarations and the
12   code;
13
14 static int
15 my_function(void)
16 {
17    int a = 0;
18
19    if (a)
20       b();
21    else
22       c();
23
24    if (a) {
25       b();
26       c();
27    } else {
28       d();
29    }
30 }
31
32 - lines should be less than 80 characters wide;
33 - when breaking lines with functions calls, the parameters are aligned
34   with the opening parenthesis;
35 - when assigning a variable with the result of a function call, if the
36   line would be longer we break it around the equal '=' sign if it makes
37   sense;
38
39    long_variable_name =
40       function_with_a_really_long_name(parameter1, parameter2,
41                    parameter3, parameter4);
42
43    x = function_with_a_really_long_name(parameter1, parameter2,
44                     parameter3, parameter4);
45
46 == astyle options ==
47 #command line
48 #astyle -A8 -t4 -p -z2 -H -k3 -W3 -xC80 -xL -n -r "./*.c"
49 #or 
50 #astyle -A8t8pz2Hk3W3xC80xLnrf "*.c"
51
52 #default style : linux
53 --style=linux
54 --indent=tab=8
55 --indent=force-tab-x=8
56
57 #Padding Options
58 --pad-oper
59 --pad-header
60 --align-pointer=name
61 --align-reference=name
62
63 #Formatting Options
64 --max-code-length=80
65 --break-after-logical
66
67 #Other Options
68 --suffix=none
69 --recursive
70 --lineend=linux
71
72 == VI options ==
73 TODO: