summaryrefslogtreecommitdiff
path: root/HACKING
blob: 9c3c28f1c741bdb4e2a3d1f029af27100a1d2bf1 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Building
========

Dependencies

    * glib 2.12 or later
    * D-Bus 1.0 and Glib bindings
    * PAM
    * ConsoleKit 0.2.3
    * gnome-vfs (for file monitoring in greeter)

Getting From SVN

To get the very latest copy you'll need to pull it from SVN. Here's
how you'll do it.

svn co http://svn.gnome.org/svn/gdm/trunk gdm


Browse the code in SVN: http://svn.gnome.org/viewcvs/gdm/trunk/

Making Changes
==============

 * Patches must be submitted in unified diff form.  Using the "-p"
   option is strongly preferred.

   See:
   http://www.xenomai.org/index.php/Teaching_-p_to_svn_diff

 * All but the most trivial patches must be submitted to GNOME
   bugzilla or the GDM mailing list <gdm-list@gnome.org> for approval.

 * Patches must apply cleanly to SVN trunk.

 * Patches should not introduce additional compilation warnings.

 * Patches must use the GDM Coding Style.


Coding Style
============

 * Follow the coding style already used.
 * Trailing whitespace is not allowed.
 * Use spaces (not tabs) for indentation.
 * Brace on same line as block statement.
 * Use braces on all blocks (even single line blocks).
 * Code must conform to C89/C90 (ANSI/ISO C) (ie. no C99).
 * Spaces between functions and arguments, or macros and arguments.
 * Spaces before and after most binary operators.
 * Spaces after most unary operators (including a comma).
 * Return value on line before function definition.
 * Brace on line after function definition.
 * Do not initialize local variables in their declarations.
 * Line up function arguments in declarations.
 * One variable declaration per line.
 * Line up variable names in declarations.
 * Limit the use of function prototypes by defining functions
   in the file before they are used.
 * Whenever possible conditional expressions should not have side
   effects (eg. don't set a value or call a function in an if
   statement).
 * '*' goes with variable not type, when declaring a pointer.
 * Function arguments follow the function call on the same line, and if
   lengthy are (where possible) wrapped to the column of the first brace.
 * Always compare pointers with NULL instead of using "!".
 * If you make a non-trivial and copyrightable change to a file
   be sure to add your name to the copyright information at the
   beginning of the file.
 * Use gtk-doc style comments on public functions whenever possible.
 * In most cases, don't abbreviate words in function and variable names.
 * Function names are lowercase, words separated by underscores.
 * Macros and enums are all uppercase, words seperated by
   underscores.
 * Types are all words capitalized, no separators between words.

 * Don't use gchar.  "char" is just fine.
 * Public functions should check input using g_return_if_fail.
 * Private functions should check input using g_assert.
 * Handle the default case in switch statements with
   a warning or g_assert_not_reached.
 * Prefer glib functions over native ones when available.
 * Use glib string handling functions when possible.

 * When in doubt copy the style of the rest of the file.