Useful macros, data structures and algorithms in C