2
0

DEVELOPING 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. Here are some notes to help you develop code for Xmlrpc-c. I include
  2. as "developing" debugging to figure out why Xmlrpc-c doesn't work for
  3. you.
  4. CODE LIBRARY
  5. ------------
  6. The master Xmlrpc-c source code tree is the CVS repository on
  7. Sourceforge. Anybody can read it; only the maintainer can commit to
  8. it. If you're not the maintainer, simply use a 'cvs diff' command in
  9. your CVS working directory to create a patch file that embodies your
  10. changes and email that to the maintainer. He can easily apply that
  11. patch to his own CVS working directory and then commit the changes.
  12. MAKE VARIABLES
  13. --------------
  14. You can pass make variable values to GNU Make to change the build.
  15. There are two common ways to do this:
  16. 1) Like this:
  17. $ make MYVAR=myvalue
  18. 2) Via an environment variable, like this:
  19. $ MYVAR=myvalue make
  20. or
  21. $ export MYVAR=myvalue
  22. $ make
  23. See GNU Make and shell documentation for details.
  24. In Xmlrpc-c make files, there are two make variables that add
  25. arbitrary options to every compile command: CADD and CFLAGS_PERSONAL.
  26. They both do the same thing. CADD is meant to be set on an individual
  27. make command, whereas CFLAGS_PERSONAL is meant to be a long-lived
  28. environment variable. CFLAGS_PERSONAL is for flags you like on all
  29. your compiles, but maybe others don't.
  30. One of my favorite CADD settings is CADD=--save-temps. To the GNU
  31. Compiler, --save-temps means to create, in addition to the object
  32. code, a file containing the intermediate preprocessed C code and a
  33. file containing the intermediate assembler source code. I can use
  34. that to debug certain things.
  35. The Xmlrpc-c build uses -g by default with Gcc, so you don't need to
  36. use CADD to get debugging symbols in your object code.
  37. There's also LADD for linker options.
  38. CODE STYLE
  39. ----------
  40. The maintainer is pretty particular about coding style, but doesn't
  41. require anyone to submit code in any particular style. He changes
  42. what he thinks isn't maintainable enough as submitted. You could do
  43. him a big favor, though, and reduce the chance of him introducing bugs
  44. into your code, but trying to copy the style you see in existing code.
  45. The major theme is high level programming -- closer to English prose
  46. and further from machine instructions.
  47. Probably the most important thing is not to use tabs. Tabs are
  48. actually quite common in Unix C programming, but apart from tradition,
  49. they are a bad idea. They don't look the same to everyone. A person
  50. must suffer an additional configuration step -- setting up tab stops
  51. in order to see the code the right way. Spaces, on the other hand,
  52. look the same to everyone. Very old editors made it easier to compose
  53. with tabs than with spaces, but with modern ones, there is no
  54. difference.
  55. The maintainer tries to catch all tabs in code submitted to him and
  56. convert them to spaces, but this often leaves the code incorrectly
  57. indented. Better to give him code that already has the right number
  58. of spaces explicitly.