bzr branch
http://gegoxaren.bato24.eu/bzr/gpump/trunk
|
2
by Gustav Hartvigsson
Added a hacking manual. |
1 |
THE HACKING DOCUMENT |
2 |
What to know when hacking on GPump |
|
3 |
||
4 |
1) It is written in C/GLib |
|
5 |
||
6 |
2) Use "1TBS" brace stryle. |
|
7 |
||
8 |
3) Use two spaces for indentation |
|
9 |
||
10 |
4) Use a spacious coding style. Put room between things as much as you can. |
|
11 |
||
12 |
Examples: |
|
13 |
||
14 |
Naming: |
|
15 |
Files should be capitalised if, and only if they represent a type and or class. |
|
16 |
files that only contain helper functions should not be capitalised. |
|
17 |
||
18 |
Types should be capitalised but not variable or function names, this is to |
|
19 |
comply with other GLib/GObject/GTK+ project naming conventions. |
|
20 |
||
21 |
Pointers: |
|
22 |
||
23 |
MyType * my_valiable; |
|
24 |
MyType * my_function (); |
|
25 |
||
26 |
Code example: |
|
27 |
||
28 |
typedef struct Foo Foo; |
|
29 |
||
30 |
struct Foo { |
|
31 |
gint some_int; |
|
32 |
GString * some_gstring; |
|
33 |
GIOStream * some_io_stream; |
|
34 |
};
|
|
35 |
||
36 |
Foo * foo_new () { |
|
37 |
/* code goes here */ |
|
38 |
}
|
|
39 |