~clint-fewbar/ubuntu/precise/gearmand/drop-unneeded-patches

« back to all changes in this revision

Viewing changes to HACKING

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2009-08-11 10:06:22 UTC
  • mto: (1.2.3 upstream) (6.1.1 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20090811100622-6ig4iknanc73olum
ImportĀ upstreamĀ versionĀ 0.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Hi!
2
 
 
3
 
If you are working on the server here are some handy environmental variables
4
 
you can set so that you can debug make test:
5
 
 
6
 
GEARMAN_VALGRIND <- runs the server under valgrind.
7
 
GEARMAN_MANUAL_GDB <-- runs the server under a remote version of GDB.
8
 
GEARMAN_LOG <-- generates a log file for you with the output of the debug for the server
9
 
 
10
 
GDB will pause the server while you do run the GDB command.
11
 
 
12
 
Coding Style
13
 
------------
14
 
 
15
 
Variables during assignment should be like:
16
 
a= 12;
17
 
 
18
 
When in doubt, use (). It means I clearly know that you meant for an
19
 
operation to follow a specific order.
20
 
 
21
 
Cast return types void when there is a possibility of failure (don't
22
 
bother with printf, use common sense):
23
 
 
24
 
(void)some_function(...);
25
 
 
26
 
New functions should be named "object_verb_(item_to_act_on)". You
27
 
should email the list if you are extending the API.
28
 
 
29
 
Use spaces after while, for, do, if, else. Don't around anything else.
30
 
 
31
 
If/else bracket style is:
32
 
if ()
33
 
{
34
 
}
35
 
else
36
 
{
37
 
}
38
 
 
39
 
Make sure structs have a typedef with a _st suffix, enums have a _t
40
 
suffix, and functions have a _fn suffix. For example:
41
 
 
42
 
typedef struct gearman_task { ... } gearman_task_st;
43
 
typedef enum gearman_return { ... } gearman_return_t;
44
 
typedef gearman_return_t (gearman_complete_fn)(gearman_task_st *task);
45
 
 
46
 
 
47
 
Cheers,
48
 
  -Brian