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-02-28 01:43:56 +0100 |
| commit | d26f046fc9149693a6ebc28301ccc3581c0f144e (patch) | |
| tree | 9da22edd4840304d6cd19a27efab58ce245985aa /handler.h | |
| download | slcl-d26f046fc9149693a6ebc28301ccc3581c0f144e.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 */ |
