forked from tjjh89017/eserv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcgi_custom.h
49 lines (38 loc) · 823 Bytes
/
cgi_custom.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
39
40
41
42
43
44
45
46
47
48
#ifndef __CGI_CUSTOM_H__
#define __CGI_CUSTOM_H__
#include "eserv/cgi.h"
extern int cgi_page_sum(ExHttp *pHttp);
extern int cgi_page_txt(ExHttp *pHttp);
extern int cgi_page_login(ExHttp *pHttp);
extern int cgi_page_gallery(ExHttp *pHttp);
extern int cgi_hash_test(ExHttp *pHttp);
/* customized page handler declare here */
cgi_page cgi_pages[] = {
{
.name = "sum.cgi",
.callback = cgi_page_sum,
},
{
.name = "txt.cgi",
.callback = cgi_page_txt,
},
{
.name = "login.cgi",
.callback = cgi_page_login,
},
{
.name = "gallery.cgi",
.callback = cgi_page_gallery,
},
{
.name = "hash_test.cgi",
.callback = cgi_hash_test,
},
};
void register_cgi(){
size_t i;
for (i = 0; i < sizeof(cgi_pages) / sizeof(cgi_page); i++)
cgi_page_add(cgi_pages[i].name,
cgi_pages[i].callback);
}
#endif