A simple data serializer in C