Code generator for C struct serialization