2 04e4e993 2023-08-14 op * Copyright (c) 2023 Omar Polo <op@omarpolo.com>
4 04e4e993 2023-08-14 op * Permission to use, copy, modify, and distribute this software for any
5 04e4e993 2023-08-14 op * purpose with or without fee is hereby granted, provided that the above
6 04e4e993 2023-08-14 op * copyright notice and this permission notice appear in all copies.
8 04e4e993 2023-08-14 op * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 04e4e993 2023-08-14 op * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 04e4e993 2023-08-14 op * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 04e4e993 2023-08-14 op * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 04e4e993 2023-08-14 op * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 04e4e993 2023-08-14 op * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 04e4e993 2023-08-14 op * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 04e4e993 2023-08-14 op enum http_method {
18 04e4e993 2023-08-14 op METHOD_UNKNOWN,
23 c83e450a 2023-08-14 op enum http_version {
28 04e4e993 2023-08-14 op struct request {
29 04e4e993 2023-08-14 op char buf[BUFSIZ];
39 04e4e993 2023-08-14 op struct reswriter {
43 04e4e993 2023-08-14 op char buf[BUFSIZ];
47 04e4e993 2023-08-14 op int http_parse(struct request *, int);
48 04e4e993 2023-08-14 op int http_read(struct request *, int);
49 c83e450a 2023-08-14 op void http_response_init(struct reswriter *, struct request *, int);
50 04e4e993 2023-08-14 op int http_reply(struct reswriter *, int, const char *, const char *);
51 04e4e993 2023-08-14 op int http_flush(struct reswriter *);
52 04e4e993 2023-08-14 op int http_write(struct reswriter *, const char *, size_t);
53 04e4e993 2023-08-14 op int http_writes(struct reswriter *, const char *);
54 04e4e993 2023-08-14 op int http_fmt(struct reswriter *, const char *, ...);
55 04e4e993 2023-08-14 op int http_urlescape(struct reswriter *, const char *);
56 04e4e993 2023-08-14 op int http_htmlescape(struct reswriter *, const char *);
57 04e4e993 2023-08-14 op int http_close(struct reswriter *);
58 04e4e993 2023-08-14 op void http_free_request(struct request *);