summaryrefslogtreecommitdiffabout
path: root/cgit.h
Unidiff
Diffstat (limited to 'cgit.h') (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/cgit.h b/cgit.h
index b6b60c6..f06a941 100644
--- a/cgit.h
+++ b/cgit.h
@@ -1,101 +1,105 @@
1#ifndef CGIT_H 1#ifndef CGIT_H
2#define CGIT_H 2#define CGIT_H
3 3
4#include "git.h" 4#include "git.h"
5#include <openssl/sha.h> 5#include <openssl/sha.h>
6#include <ctype.h> 6#include <ctype.h>
7#include <sched.h> 7#include <sched.h>
8 8
9typedef void (*configfn)(const char *name, const char *value); 9typedef void (*configfn)(const char *name, const char *value);
10 10
11struct cacheitem { 11struct cacheitem {
12 char *name; 12 char *name;
13 struct stat st; 13 struct stat st;
14 int ttl; 14 int ttl;
15 int fd; 15 int fd;
16}; 16};
17 17
18struct commitinfo { 18struct commitinfo {
19 struct commit *commit; 19 struct commit *commit;
20 char *author; 20 char *author;
21 char *author_email;
22 unsigned long author_date;
21 char *committer; 23 char *committer;
24 char *committer_email;
25 unsigned long committer_date;
22 char *subject; 26 char *subject;
23 char *msg; 27 char *msg;
24}; 28};
25 29
26extern const char cgit_version[]; 30extern const char cgit_version[];
27 31
28extern char *cgit_root; 32extern char *cgit_root;
29extern char *cgit_root_title; 33extern char *cgit_root_title;
30extern char *cgit_css; 34extern char *cgit_css;
31extern char *cgit_logo; 35extern char *cgit_logo;
32extern char *cgit_logo_link; 36extern char *cgit_logo_link;
33extern char *cgit_virtual_root; 37extern char *cgit_virtual_root;
34extern char *cgit_cache_root; 38extern char *cgit_cache_root;
35 39
36extern int cgit_nocache; 40extern int cgit_nocache;
37extern int cgit_max_lock_attempts; 41extern int cgit_max_lock_attempts;
38extern int cgit_cache_root_ttl; 42extern int cgit_cache_root_ttl;
39extern int cgit_cache_repo_ttl; 43extern int cgit_cache_repo_ttl;
40extern int cgit_cache_dynamic_ttl; 44extern int cgit_cache_dynamic_ttl;
41extern int cgit_cache_static_ttl; 45extern int cgit_cache_static_ttl;
42extern int cgit_cache_max_create_time; 46extern int cgit_cache_max_create_time;
43 47
44extern char *cgit_repo_name; 48extern char *cgit_repo_name;
45extern char *cgit_repo_desc; 49extern char *cgit_repo_desc;
46extern char *cgit_repo_owner; 50extern char *cgit_repo_owner;
47 51
48extern int cgit_query_has_symref; 52extern int cgit_query_has_symref;
49extern int cgit_query_has_sha1; 53extern int cgit_query_has_sha1;
50 54
51extern char *cgit_querystring; 55extern char *cgit_querystring;
52extern char *cgit_query_repo; 56extern char *cgit_query_repo;
53extern char *cgit_query_page; 57extern char *cgit_query_page;
54extern char *cgit_query_head; 58extern char *cgit_query_head;
55extern char *cgit_query_sha1; 59extern char *cgit_query_sha1;
56extern int cgit_query_ofs; 60extern int cgit_query_ofs;
57 61
58extern int htmlfd; 62extern int htmlfd;
59 63
60extern void cgit_global_config_cb(const char *name, const char *value); 64extern void cgit_global_config_cb(const char *name, const char *value);
61extern void cgit_repo_config_cb(const char *name, const char *value); 65extern void cgit_repo_config_cb(const char *name, const char *value);
62extern void cgit_querystring_cb(const char *name, const char *value); 66extern void cgit_querystring_cb(const char *name, const char *value);
63 67
64extern char *fmt(const char *format,...); 68extern char *fmt(const char *format,...);
65 69
66extern void html(const char *txt); 70extern void html(const char *txt);
67extern void htmlf(const char *format,...); 71extern void htmlf(const char *format,...);
68extern void html_txt(char *txt); 72extern void html_txt(char *txt);
69extern void html_attr(char *txt); 73extern void html_attr(char *txt);
70extern void html_link_open(char *url, char *title, char *class); 74extern void html_link_open(char *url, char *title, char *class);
71extern void html_link_close(void); 75extern void html_link_close(void);
72 76
73extern int cgit_read_config(const char *filename, configfn fn); 77extern int cgit_read_config(const char *filename, configfn fn);
74extern int cgit_parse_query(char *txt, configfn fn); 78extern int cgit_parse_query(char *txt, configfn fn);
75extern struct commitinfo *cgit_parse_commit(struct commit *commit); 79extern struct commitinfo *cgit_parse_commit(struct commit *commit);
76 80
77extern void cache_prepare(struct cacheitem *item); 81extern void cache_prepare(struct cacheitem *item);
78extern int cache_lock(struct cacheitem *item); 82extern int cache_lock(struct cacheitem *item);
79extern int cache_unlock(struct cacheitem *item); 83extern int cache_unlock(struct cacheitem *item);
80extern int cache_cancel_lock(struct cacheitem *item); 84extern int cache_cancel_lock(struct cacheitem *item);
81extern int cache_exist(struct cacheitem *item); 85extern int cache_exist(struct cacheitem *item);
82extern int cache_expired(struct cacheitem *item); 86extern int cache_expired(struct cacheitem *item);
83 87
84extern char *cgit_repourl(const char *reponame); 88extern char *cgit_repourl(const char *reponame);
85extern char *cgit_pageurl(const char *reponame, const char *pagename, 89extern char *cgit_pageurl(const char *reponame, const char *pagename,
86 const char *query); 90 const char *query);
87 91
88extern void cgit_print_error(char *msg); 92extern void cgit_print_error(char *msg);
89extern void cgit_print_date(unsigned long secs); 93extern void cgit_print_date(unsigned long secs);
90extern void cgit_print_docstart(char *title, struct cacheitem *item); 94extern void cgit_print_docstart(char *title, struct cacheitem *item);
91extern void cgit_print_docend(); 95extern void cgit_print_docend();
92extern void cgit_print_pageheader(char *title); 96extern void cgit_print_pageheader(char *title);
93 97
94extern void cgit_print_repolist(struct cacheitem *item); 98extern void cgit_print_repolist(struct cacheitem *item);
95extern void cgit_print_summary(); 99extern void cgit_print_summary();
96extern void cgit_print_log(const char *tip, int ofs, int cnt); 100extern void cgit_print_log(const char *tip, int ofs, int cnt);
97extern void cgit_print_view(const char *hex); 101extern void cgit_print_view(const char *hex);
98extern void cgit_print_tree(const char *hex); 102extern void cgit_print_tree(const char *hex);
99extern void cgit_print_commit(const char *hex); 103extern void cgit_print_commit(const char *hex);
100 104
101#endif /* CGIT_H */ 105#endif /* CGIT_H */