summaryrefslogtreecommitdiffstatshomepage
path: root/html.h
blob: a55d4b2d3563d56f6e7a56d5ae70b68cb1496727 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef HTML_H
#define HTML_H

extern int htmlfd;

extern void html_raw(const char *txt, size_t size);
extern void html(const char *txt);
extern void htmlf(const char *format,...);
extern void html_status(int code, const char *msg, int more_headers);
extern void html_txt(char *txt);
extern void html_ntxt(int len, char *txt);
extern void html_attr(char *txt);
extern void html_url_path(char *txt);
extern void html_url_arg(char *txt);
extern void html_hidden(char *name, char *value);
extern void html_option(char *value, char *text, char *selected_value);
extern void html_link_open(char *url, char *title, char *class);
extern void html_link_close(void);
extern void html_fileperm(unsigned short mode);
extern int html_include(const char *filename);

extern int http_parse_querystring(char *txt, void (*fn)(const char *name, const char *value));

#endif /* HTML_H */
n class="p">(name); if (S_ISDIR(mode)) html("/"); html("</a></div></td>"); htmlf("<td class='filesize'>%li</td>", size); htmlf("<td class='filemode'>%06o</td>", mode); html("</tr>\n"); free(name); return 0; } void cgit_print_tree(const char *hex) { struct tree *tree; unsigned char sha1[20]; if (get_sha1_hex(hex, sha1)) { cgit_print_error(fmt("Invalid object id: %s", hex)); return; } tree = parse_tree_indirect(sha1); if (!tree) { cgit_print_error(fmt("Not a tree object: %s", hex)); return; } html("<h2>Tree content</h2>\n"); html("<table class='list'>\n"); html("<tr><th>Name</th>"); html("<th class='filesize'>Size</th>"); html("<th class='filemode'>Mode</th></tr>\n"); read_tree_recursive(tree, "", 0, 1, NULL, print_entry); html("</table>\n"); }