src/utils_cgi.[ch]: Move "html_print_search_box" to here.
[collection4.git] / src / utils_cgi.h
1 #ifndef UTILS_CGI_H
2 #define UTILS_CGI_H 1
3
4 #include <time.h>
5
6 typedef int (*page_callback_t) (void *user_data);
7
8 struct page_callbacks_s
9 {
10   page_callback_t top_left;
11   page_callback_t top_center;
12   page_callback_t top_right;
13   page_callback_t middle_left;
14   page_callback_t middle_center;
15   page_callback_t middle_right;
16   page_callback_t bottom_left;
17   page_callback_t bottom_center;
18   page_callback_t bottom_right;
19 };
20 typedef struct page_callbacks_s page_callbacks_t;
21
22 #define PAGE_CALLBACKS_INIT \
23 { NULL, NULL, NULL, \
24   NULL, NULL, NULL, \
25   NULL, NULL, NULL }
26
27 int param_init (void);
28 void param_finish (void);
29
30 const char *param (const char *key);
31
32 int uri_escape (char *dst, const char *src, size_t size);
33
34 const char *script_name (void);
35
36 int time_to_rfc1123 (time_t t, char *buffer, size_t buffer_size);
37
38 char *html_escape (const char *string);
39 char *html_escape_buffer (char *buffer, size_t buffer_size);
40 char *html_escape_copy (char *dest, const char *src, size_t n);
41
42 int html_print_page (const char *title,
43     const page_callbacks_t *cb, void *user_data);
44
45 int html_print_search_box (void *user_data);
46
47 /* vim: set sw=2 sts=2 et fdm=marker : */
48 #endif /* UTILS_CGI_H */