diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-01-09 01:22:54 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-07-20 23:52:47 +0200 |
| commit | 2968c5f67daa1c571f5f9cf9445de907f9490636 (patch) | |
| tree | d6919b2446976f4818c62ad419065e3d92061e25 /handler.h | |
| download | libweb-2968c5f67daa1c571f5f9cf9445de907f9490636.tar.gz | |
Initial commit
Diffstat (limited to 'handler.h')
| -rw-r--r-- | handler.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/handler.h b/handler.h new file mode 100644 index 0000000..8550010 --- /dev/null +++ b/handler.h @@ -0,0 +1,17 @@ +#ifndef HANDLER_H +#define HANDLER_H + +#include "http.h" +#include <stddef.h> + +struct handler; +typedef int (*handler_fn)(const struct http_payload *p, + struct http_response *r, void *user); + +struct handler *handler_alloc(const char *tmpdir); +void handler_free(struct handler *h); +int handler_add(struct handler *h, const char *url, enum http_op op, + handler_fn f, void *user); +int handler_listen(struct handler *h, short port); + +#endif /* HANDLER_H */ |
