Developer tips
Hopefully as this develops, I will have time to update this with some helpful details of understanding the code and structure of the program. In the meantime, it is the less-interesting stuff.
Code style
For the consistency and overall well-being of the project, please make sure any source code submitted is good quality and in the style of that which exists already:
- max 79 character line length
- 4-space indentation, no tab characters (check your text editor's settings)
- source code compiles without any warnings or errors
Comments, indentation, braces, bracketing, variable and function names should be in the style of the existing code — there is plenty to use for examples.
- keywords which require brackets do not have a space; eg. while(), for(), if()
- declare variables of the same type on one line; eg. char *artist, *title;, except where they are being grouped logically in a large structure
- declare all variables at the start of a function
- opening curly brace is on the same line; eg. if(n == 1) {, except for function definitions where it is on the line below
- where an if block or a loop only has one statement, don't use curly braces
- all comments use /* */ (no //), and multiline comments begin following lines with a *
- two blank lines separate each function or structure declarations
xwax is written in C, and the intended compiler is gcc, but xwax is known already to be quite portable to other compilers.
Patches
Send patches to the mailing list as attachments in unified diff please — try diff -up or use Git. Make sure patches contain only the relevant modifications (not cosmetic code changes, unless that's what it's a patch on) and that it's clear which version of the xwax source you are patching against (preferably the latest in the 'master' branch of the development source).
