HACKING 1.3 KB

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