aboutsummaryrefslogtreecommitdiff
path: root/handler.h
blob: 855001088c13c40f512dd32bd36032366828728f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 */