1 #ifndef _LCGI_H
2 #define _LCGI_H
3 
4 #define CGI_HOOK_PARAMS const char *param
5 #define CGI_MODE_PARAMS void
6 
7 typedef int (*CgiHook)(CGI_HOOK_PARAMS);
8 typedef void (*CgiMode)(CGI_MODE_PARAMS);
9 
10 #define CGI_HANDLER(x) int x(CGI_HOOK_PARAMS)
11 #define CGI_MODE(x) void x(CGI_MODE_PARAMS)
12 
13 struct listserver_cgi_hook {
14    char *name;
15    CgiHook hook;
16    struct listserver_cgi_hook *next;
17 };
18 
19 struct listserver_cgi_mode {
20    char *name;
21    CgiMode mode;
22    struct listserver_cgi_mode *next;
23 };
24 
25 struct listserver_cgi_tempvar {
26    char *name;
27    char *value;
28    struct listserver_cgi_tempvar *next;
29 };
30 
31 #define CGI_UNPARSE_NORMAL	0
32 #define CGI_UNPARSE_FIRSTHASH	1
33 #define CGI_UNPARSE_GETVAR	2
34 #define CGI_UNPARSE_GETPARM     3
35 #define CGI_UNPARSE_EATHASH	4
36 
37 extern void new_cgi_hooks(void);
38 extern void nuke_cgi_hooks(void);
39 extern void add_cgi_hook(const char *name, CgiHook function);
40 extern struct listserver_cgi_hook *get_cgi_hooks(void);
41 extern struct listserver_cgi_hook *find_cgi_hook(const char *name);
42 
43 extern void new_cgi_modes(void);
44 extern void nuke_cgi_modes(void);
45 extern void add_cgi_mode(const char *name, CgiMode function);
46 extern struct listserver_cgi_mode *find_cgi_mode(const char *name);
47 
48 extern void new_cgi_tempvars(void);
49 extern void nuke_cgi_tempvars(void);
50 extern void add_cgi_tempvar(const char *name, const char *value);
51 extern struct listserver_cgi_tempvar* get_cgi_tempvars(void);
52 extern struct listserver_cgi_tempvar* find_cgi_tempvar(const char *name);
53 
54 extern int cgi_unparse_template(const char *name);
55 
56 
57 #endif
58