summaryrefslogtreecommitdiffabout
path: root/cgit.h
Unidiff
Diffstat (limited to 'cgit.h') (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/cgit.h b/cgit.h
index 292e488..b7f8827 100644
--- a/cgit.h
+++ b/cgit.h
@@ -1,167 +1,169 @@
1#ifndef CGIT_H 1#ifndef CGIT_H
2#define CGIT_H 2#define CGIT_H
3 3
4 4
5#include <git-compat-util.h> 5#include <git-compat-util.h>
6#include <cache.h> 6#include <cache.h>
7#include <grep.h> 7#include <grep.h>
8#include <object.h> 8#include <object.h>
9#include <tree.h> 9#include <tree.h>
10#include <commit.h> 10#include <commit.h>
11#include <tag.h> 11#include <tag.h>
12#include <diff.h> 12#include <diff.h>
13#include <diffcore.h> 13#include <diffcore.h>
14#include <refs.h> 14#include <refs.h>
15#include <revision.h> 15#include <revision.h>
16#include <log-tree.h> 16#include <log-tree.h>
17#include <archive.h> 17#include <archive.h>
18#include <xdiff/xdiff.h> 18#include <xdiff/xdiff.h>
19 19
20 20
21typedef void (*configfn)(const char *name, const char *value); 21typedef void (*configfn)(const char *name, const char *value);
22 22
23struct cacheitem { 23struct cacheitem {
24 char *name; 24 char *name;
25 struct stat st; 25 struct stat st;
26 int ttl; 26 int ttl;
27 int fd; 27 int fd;
28}; 28};
29 29
30struct repoinfo { 30struct repoinfo {
31 char *url; 31 char *url;
32 char *name; 32 char *name;
33 char *path; 33 char *path;
34 char *desc; 34 char *desc;
35 char *owner; 35 char *owner;
36 char *module_link;
36 int snapshots; 37 int snapshots;
37}; 38};
38 39
39struct repolist { 40struct repolist {
40 int length; 41 int length;
41 int count; 42 int count;
42 struct repoinfo *repos; 43 struct repoinfo *repos;
43}; 44};
44 45
45struct commitinfo { 46struct commitinfo {
46 struct commit *commit; 47 struct commit *commit;
47 char *author; 48 char *author;
48 char *author_email; 49 char *author_email;
49 unsigned long author_date; 50 unsigned long author_date;
50 char *committer; 51 char *committer;
51 char *committer_email; 52 char *committer_email;
52 unsigned long committer_date; 53 unsigned long committer_date;
53 char *subject; 54 char *subject;
54 char *msg; 55 char *msg;
55}; 56};
56 57
57struct taginfo { 58struct taginfo {
58 char *tagger; 59 char *tagger;
59 char *tagger_email; 60 char *tagger_email;
60 int tagger_date; 61 int tagger_date;
61 char *msg; 62 char *msg;
62}; 63};
63 64
64extern const char cgit_version[]; 65extern const char cgit_version[];
65 66
66extern struct repolist cgit_repolist; 67extern struct repolist cgit_repolist;
67extern struct repoinfo *cgit_repo; 68extern struct repoinfo *cgit_repo;
68 69
69extern char *cgit_root_title; 70extern char *cgit_root_title;
70extern char *cgit_css; 71extern char *cgit_css;
71extern char *cgit_logo; 72extern char *cgit_logo;
72extern char *cgit_logo_link; 73extern char *cgit_logo_link;
74extern char *cgit_module_link;
73extern char *cgit_virtual_root; 75extern char *cgit_virtual_root;
74extern char *cgit_cache_root; 76extern char *cgit_cache_root;
75 77
76extern int cgit_nocache; 78extern int cgit_nocache;
77extern int cgit_snapshots; 79extern int cgit_snapshots;
78extern int cgit_max_lock_attempts; 80extern int cgit_max_lock_attempts;
79extern int cgit_cache_root_ttl; 81extern int cgit_cache_root_ttl;
80extern int cgit_cache_repo_ttl; 82extern int cgit_cache_repo_ttl;
81extern int cgit_cache_dynamic_ttl; 83extern int cgit_cache_dynamic_ttl;
82extern int cgit_cache_static_ttl; 84extern int cgit_cache_static_ttl;
83extern int cgit_cache_max_create_time; 85extern int cgit_cache_max_create_time;
84 86
85extern int cgit_max_msg_len; 87extern int cgit_max_msg_len;
86 88
87extern char *cgit_repo_name; 89extern char *cgit_repo_name;
88extern char *cgit_repo_desc; 90extern char *cgit_repo_desc;
89extern char *cgit_repo_owner; 91extern char *cgit_repo_owner;
90 92
91extern int cgit_query_has_symref; 93extern int cgit_query_has_symref;
92extern int cgit_query_has_sha1; 94extern int cgit_query_has_sha1;
93 95
94extern char *cgit_querystring; 96extern char *cgit_querystring;
95extern char *cgit_query_repo; 97extern char *cgit_query_repo;
96extern char *cgit_query_page; 98extern char *cgit_query_page;
97extern char *cgit_query_search; 99extern char *cgit_query_search;
98extern char *cgit_query_head; 100extern char *cgit_query_head;
99extern char *cgit_query_sha1; 101extern char *cgit_query_sha1;
100extern char *cgit_query_sha2; 102extern char *cgit_query_sha2;
101extern char *cgit_query_path; 103extern char *cgit_query_path;
102extern char *cgit_query_name; 104extern char *cgit_query_name;
103extern int cgit_query_ofs; 105extern int cgit_query_ofs;
104 106
105extern int htmlfd; 107extern int htmlfd;
106 108
107extern void cgit_global_config_cb(const char *name, const char *value); 109extern void cgit_global_config_cb(const char *name, const char *value);
108extern void cgit_repo_config_cb(const char *name, const char *value); 110extern void cgit_repo_config_cb(const char *name, const char *value);
109extern void cgit_querystring_cb(const char *name, const char *value); 111extern void cgit_querystring_cb(const char *name, const char *value);
110 112
111extern int chk_zero(int result, char *msg); 113extern int chk_zero(int result, char *msg);
112extern int chk_positive(int result, char *msg); 114extern int chk_positive(int result, char *msg);
113 115
114extern int hextoint(char c); 116extern int hextoint(char c);
115 117
116extern void *cgit_free_commitinfo(struct commitinfo *info); 118extern void *cgit_free_commitinfo(struct commitinfo *info);
117 119
118extern char *fmt(const char *format,...); 120extern char *fmt(const char *format,...);
119 121
120extern void html(const char *txt); 122extern void html(const char *txt);
121extern void htmlf(const char *format,...); 123extern void htmlf(const char *format,...);
122extern void html_txt(char *txt); 124extern void html_txt(char *txt);
123extern void html_ntxt(int len, char *txt); 125extern void html_ntxt(int len, char *txt);
124extern void html_attr(char *txt); 126extern void html_attr(char *txt);
125extern void html_hidden(char *name, char *value); 127extern void html_hidden(char *name, char *value);
126extern void html_link_open(char *url, char *title, char *class); 128extern void html_link_open(char *url, char *title, char *class);
127extern void html_link_close(void); 129extern void html_link_close(void);
128extern void html_filemode(unsigned short mode); 130extern void html_filemode(unsigned short mode);
129 131
130extern int cgit_read_config(const char *filename, configfn fn); 132extern int cgit_read_config(const char *filename, configfn fn);
131extern int cgit_parse_query(char *txt, configfn fn); 133extern int cgit_parse_query(char *txt, configfn fn);
132extern struct commitinfo *cgit_parse_commit(struct commit *commit); 134extern struct commitinfo *cgit_parse_commit(struct commit *commit);
133extern struct taginfo *cgit_parse_tag(struct tag *tag); 135extern struct taginfo *cgit_parse_tag(struct tag *tag);
134 136
135extern char *cache_safe_filename(const char *unsafe); 137extern char *cache_safe_filename(const char *unsafe);
136extern int cache_lock(struct cacheitem *item); 138extern int cache_lock(struct cacheitem *item);
137extern int cache_unlock(struct cacheitem *item); 139extern int cache_unlock(struct cacheitem *item);
138extern int cache_cancel_lock(struct cacheitem *item); 140extern int cache_cancel_lock(struct cacheitem *item);
139extern int cache_exist(struct cacheitem *item); 141extern int cache_exist(struct cacheitem *item);
140extern int cache_expired(struct cacheitem *item); 142extern int cache_expired(struct cacheitem *item);
141 143
142extern char *cgit_repourl(const char *reponame); 144extern char *cgit_repourl(const char *reponame);
143extern char *cgit_pageurl(const char *reponame, const char *pagename, 145extern char *cgit_pageurl(const char *reponame, const char *pagename,
144 const char *query); 146 const char *query);
145 147
146extern void cgit_print_error(char *msg); 148extern void cgit_print_error(char *msg);
147extern void cgit_print_date(unsigned long secs); 149extern void cgit_print_date(unsigned long secs);
148extern void cgit_print_docstart(char *title, struct cacheitem *item); 150extern void cgit_print_docstart(char *title, struct cacheitem *item);
149extern void cgit_print_docend(); 151extern void cgit_print_docend();
150extern void cgit_print_pageheader(char *title, int show_search); 152extern void cgit_print_pageheader(char *title, int show_search);
151extern void cgit_print_snapshot_start(const char *mimetype, 153extern void cgit_print_snapshot_start(const char *mimetype,
152 const char *filename, 154 const char *filename,
153 struct cacheitem *item); 155 struct cacheitem *item);
154 156
155extern void cgit_print_repolist(struct cacheitem *item); 157extern void cgit_print_repolist(struct cacheitem *item);
156extern void cgit_print_summary(); 158extern void cgit_print_summary();
157extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep); 159extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep);
158extern void cgit_print_view(const char *hex, char *path); 160extern void cgit_print_view(const char *hex, char *path);
159extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path); 161extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path);
160extern void cgit_print_tree(const char *hex, char *path); 162extern void cgit_print_tree(const char *hex, char *path);
161extern void cgit_print_commit(const char *hex); 163extern void cgit_print_commit(const char *hex);
162extern void cgit_print_diff(const char *old_hex, const char *new_hex); 164extern void cgit_print_diff(const char *old_hex, const char *new_hex);
163extern void cgit_print_snapshot(struct cacheitem *item, const char *hex, 165extern void cgit_print_snapshot(struct cacheitem *item, const char *hex,
164 const char *format, const char *prefix, 166 const char *format, const char *prefix,
165 const char *filename); 167 const char *filename);
166 168
167#endif /* CGIT_H */ 169#endif /* CGIT_H */