#ifndef _RESPONSE_H_ #define _RESPONSE_H_ enum ResponseStatus { SUCCESS = 10, CONTENT_UNCHANGED = 11, PERMANENT_REDIRECT = 20, TEMPORARY_REDIRECT = 21, MALFORMED_REQUEST = 30, INVALID_REQUEST = 31, NOT_AVAILABLE = 32, INTERNAL_ERROR = 40, NOT_SUPPORTED = 41, SLOW_DOWN = 42, CLIENT_CERTIFICATE_REQUIRED = 50 }; struct mime_type { char *type; char *subtype; }; struct response { enum ResponseStatus status; char *message; struct mime_type type; unsigned int length; char *hash; char *content; }; /** * Parses a string into a `struct response`. */ int parse_response(struct response *res, char *s); /** * Deallocates `struct response *res`. */ void free_response(struct response *res); enum ResponseError { INVALID_STATUS = -1, UNKNOWN_KEY = -2, }; #endif