summaryrefslogtreecommitdiff
path: root/http.h
diff options
context:
space:
mode:
authorcflip <cflip@cflip.net>2023-05-08 21:25:21 -0600
committercflip <cflip@cflip.net>2023-05-08 21:25:21 -0600
commit7f1d6bbc335288df1e24e7c8f305c32afe6b050a (patch)
tree3ca1784ab73315e44dd9e03b2f0e244a59158fbc /http.h
parent83fb0b96c94e7f596f81d5bc346150904457ed64 (diff)
Begin rewriting cfws in C
Diffstat (limited to 'http.h')
-rw-r--r--http.h25
1 files changed, 25 insertions, 0 deletions
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