]> Pileus Git - site/blob - src/html.h
Add status codes
[site] / src / html.h
1 /* Links */
2 #define PILEUS   "http://pileus.org/"
3
4 #define DEV_LIST "http://pileus.org/mailman/listinfo/dev"
5 #define DEV_ARCH "http://pileus.org/pipermail/dev/"
6
7 /* Constants */
8 #define BASE "pages"
9
10 /* Forward declarations */
11 typedef struct page_t page_t;
12 typedef struct menu_t menu_t;
13
14 /* Menu display display types */
15 typedef enum {
16         SHOW_NORMAL,
17         SHOW_ACTIVE,
18         SHOW_HIDDEN,
19 } show_t;
20
21 /* Page information */
22 struct page_t {
23         char     *title; // title tag
24         char     *keys;  // meta keywords tag, or NULL
25         char     *desc;  // meta description tag, or NULL
26         char     *error; // http status
27         char     *text;  // unfiltered text
28         char     *html;  // generated html
29 };
30
31 /* Navigation menu entry */
32 struct menu_t {
33         char     *path;  // path to the page
34         char     *name;  // name of the page
35         char     *base;  // base file name of the page
36         menu_t   *next;  // next menu item
37         menu_t   *kids;  // child menu items for directories
38         show_t    show;  // is this part of the current path?
39 };
40
41 /* Helper functions */
42 void href(const char *url);
43
44 void print_link(char *path, char *name, int cur);
45 void print_menu(menu_t *menu, int first, int last);
46
47 /* Global functions */
48 void print_header(page_t *page);
49 void print_page(page_t *page, menu_t *menu);