#ifndef __TERGIV_CALLBACK_HTTP #define __TERGIV_CALLBACK_HTTP #include "../sockets/socket_server.h" #include "request_method.h" #include "response_code.h" #include "http_headers.h" void callback_http(callback_args* args); typedef struct client_message { enum RequestMethod method; char* url; char* version; char* headers[HE_LENGTH]; } client_message; typedef struct response_message { enum ResponseCode response_code; char* headers[HE_LENGTH]; char* body; size_t body_size; int free_body; } response_message; typedef struct http_callbacks { union { struct { void (*get_callback)(client_message* in_message, response_message* out_message); }; void (*all_callbacks[RM_UNKNOWN])(client_message* in_message, response_message* out_message); }; } http_callbacks; #endif /* __TERGIV_CALLBACK_HTTP */