HACKING 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. Hi!
  2. You can obtain the latest source tree for Gearman by issuing the following command:
  3. git clone https://github.com/gearman/gearmand
  4. You will need to have git installed in order for this to work.
  5. If you are building from source control (i.e. git) you should setup your environment via:
  6. ./bootstrap.sh autoreconf
  7. This will build the files you will need in order to run "./configure".
  8. If you are working on the server here are some handy environmental variables
  9. you can set so that you can debug make test:
  10. GEARMAN_VALGRIND <- runs the server under valgrind.
  11. GEARMAN_MANUAL_GDB <-- runs the server under a remote version of GDB.
  12. GEARMAN_LOG <-- generates a log file for you with the output of the debug for the server
  13. GDB will pause the server while you do run the GDB command.
  14. Coding Style
  15. ------------
  16. Variables during assignment should be like:
  17. a= 12;
  18. When in doubt, use (). It means I clearly know that you meant for an
  19. operation to follow a specific order.
  20. Cast return types void when there is a possibility of failure (don't
  21. bother with printf, use common sense):
  22. (void)some_function(...);
  23. New functions should be named "object_verb_(item_to_act_on)". You
  24. should email the list if you are extending the API.
  25. Use spaces after while, for, do, if, else. Don't around anything else.
  26. If/else bracket style is:
  27. if ()
  28. {
  29. }
  30. else
  31. {
  32. }
  33. Make sure structs have a typedef with a _st suffix, enums have a _t
  34. suffix, and functions have a _fn suffix. For example:
  35. typedef struct gearman_task { ... } gearman_task_st;
  36. typedef enum gearman_return { ... } gearman_return_t;
  37. typedef gearman_return_t (gearman_complete_fn)(gearman_task_st *task);
  38. Cheers,
  39. -Brian