From 7f1d6bbc335288df1e24e7c8f305c32afe6b050a Mon Sep 17 00:00:00 2001 From: cflip Date: Mon, 8 May 2023 21:25:21 -0600 Subject: Begin rewriting cfws in C --- http.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 http.h (limited to 'http.h') diff --git a/http.h b/http.h new file mode 100644 index 0000000..b39e271 --- /dev/null +++ b/http.h @@ -0,0 +1,25 @@ +#ifndef _H_HTTP +#define _H_HTTP + +#define CFWS_MAXURI 128 + +enum http_req_method { + HTTP_METHOD_GET +}; + +enum http_res_code { + HTTP_RESPONSE_OK = 200, + HTTP_RESPONSE_NOTFOUND = 404 +}; + +struct http_request { + int method; + char *uri; +}; + +struct http_request http_parse_request(const char *); +void http_free_request(struct http_request *); + +void http_build_response(char **, enum http_res_code, const char *); + +#endif -- cgit v1.2.3