-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcallback.h
38 lines (31 loc) · 816 Bytes
/
callback.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <dirent.h>
#include <err.h>
#include <event2/buffer.h>
#include <event2/event.h>
#include <event2/http.h>
#include <event2/keyvalq_struct.h>
#include <event2/util.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <chpl-mem.h>
static char* mymalloc(int64_t n) {
char *ret = (char*) chpl_malloc(n);
return ret;
}
static void myfree(char *x) {
chpl_free(x);
}
void http_handler(struct evhttp_request *request, void *privParams);
void c_http_handler(struct evhttp_request *request, void *privParams) {
http_handler(request, privParams);
}
void CreateServerCB(struct evhttp* server){
evhttp_set_gencb(server, c_http_handler, 0);
}