HACKING ======= General remarks --------------- * Code is a maximum of 80 characters wide. This keeps it readable also where the original screen width limitations do not apply any more. * Use C99, in particular stdint and stdbool, except that variables go at the beginning of the block. You may use embedded counters in `for' loops though. * Do not initialise variables, pointers in particular, where they are declared. Initialise immediately before usage and read compiler warnings to find out whether any variables are being used without initialisation. * Use variable names in `sizeof()` statements rather than type names. Otherwise refactorings including changing the datatype can render those broken. Example: foo_t *f; memset (f, 0, sizeof (*f)); * Do not include a `default' case when switching over enumerations, so you'll get warnings when a values is added. * Avoid casts whenever possible - especially with function pointers - as they hinder the compiler's semantic analysis to do its thing. Including files --------------- * Always include files in the following order: 1. C headers, in alphabetical order. 2. Dependency libraries' headers, in alphabetical order. 3. Project headers, in alphabetical order. * In header files only ever include using pointy brackets and directory prefix. This makes sure that installed headers work correctly and facilitates installation of multiple incompatible library versions in the same prefix. Example foo.h: `#include ` In C files plain inclusion of headers from the project is encouraged, just give the header's file name and leave setting of directories to the build system. Example foo.c: `#include "foo.h"` * In Makefile.am foo_CPPFLAGS always put local include paths before global ones, so ambiguous headers are resolved in favour of the local ones. Making a release ---------------- * NEWS. * TODO. * Commit and push. * `make distcheck`. * Tag and push. * Upload tarball. * Announce. * Bump version and add extra version in configure.in. * Commit and push. * Update web-page.