structs, malloc and all the #ifdef you could ever want