diff options
Diffstat (limited to 'cgit.h')
-rw-r--r-- | cgit.h | 31 |
1 files changed, 29 insertions, 2 deletions
@@ -28,6 +28,7 @@ | |||
28 | #define CMD_BLOB 5 | 28 | #define CMD_BLOB 5 |
29 | #define CMD_SNAPSHOT 6 | 29 | #define CMD_SNAPSHOT 6 |
30 | #define CMD_TAG 7 | 30 | #define CMD_TAG 7 |
31 | #define CMD_REFS 8 | ||
31 | 32 | ||
32 | /* | 33 | /* |
33 | * Dateformats used on misc. pages | 34 | * Dateformats used on misc. pages |
@@ -98,6 +99,21 @@ struct taginfo { | |||
98 | char *msg; | 99 | char *msg; |
99 | }; | 100 | }; |
100 | 101 | ||
102 | struct refinfo { | ||
103 | const char *refname; | ||
104 | struct object *object; | ||
105 | union { | ||
106 | struct taginfo *tag; | ||
107 | struct commitinfo *commit; | ||
108 | }; | ||
109 | }; | ||
110 | |||
111 | struct reflist { | ||
112 | struct refinfo **refs; | ||
113 | int alloc; | ||
114 | int count; | ||
115 | }; | ||
116 | |||
101 | extern const char *cgit_version; | 117 | extern const char *cgit_version; |
102 | 118 | ||
103 | extern struct repolist cgit_repolist; | 119 | extern struct repolist cgit_repolist; |
@@ -128,6 +144,8 @@ extern int cgit_cache_dynamic_ttl; | |||
128 | extern int cgit_cache_static_ttl; | 144 | extern int cgit_cache_static_ttl; |
129 | extern int cgit_cache_max_create_time; | 145 | extern int cgit_cache_max_create_time; |
130 | extern int cgit_summary_log; | 146 | extern int cgit_summary_log; |
147 | extern int cgit_summary_tags; | ||
148 | extern int cgit_summary_branches; | ||
131 | 149 | ||
132 | extern int cgit_max_msg_len; | 150 | extern int cgit_max_msg_len; |
133 | extern int cgit_max_repodesc_len; | 151 | extern int cgit_max_repodesc_len; |
@@ -162,6 +180,10 @@ extern int chk_non_negative(int result, char *msg); | |||
162 | extern int hextoint(char c); | 180 | extern int hextoint(char c); |
163 | extern char *trim_end(const char *str, char c); | 181 | extern char *trim_end(const char *str, char c); |
164 | 182 | ||
183 | extern void cgit_add_ref(struct reflist *list, struct refinfo *ref); | ||
184 | extern int cgit_refs_cb(const char *refname, const unsigned char *sha1, | ||
185 | int flags, void *cb_data); | ||
186 | |||
165 | extern void *cgit_free_commitinfo(struct commitinfo *info); | 187 | extern void *cgit_free_commitinfo(struct commitinfo *info); |
166 | 188 | ||
167 | extern int cgit_diff_files(const unsigned char *old_sha1, | 189 | extern int cgit_diff_files(const unsigned char *old_sha1, |
@@ -170,7 +192,7 @@ extern int cgit_diff_files(const unsigned char *old_sha1, | |||
170 | 192 | ||
171 | extern void cgit_diff_tree(const unsigned char *old_sha1, | 193 | extern void cgit_diff_tree(const unsigned char *old_sha1, |
172 | const unsigned char *new_sha1, | 194 | const unsigned char *new_sha1, |
173 | filepair_fn fn); | 195 | filepair_fn fn, const char *prefix); |
174 | 196 | ||
175 | extern void cgit_diff_commit(struct commit *commit, filepair_fn fn); | 197 | extern void cgit_diff_commit(struct commit *commit, filepair_fn fn); |
176 | 198 | ||
@@ -214,6 +236,8 @@ extern void cgit_log_link(char *name, char *title, char *class, char *head, | |||
214 | char *rev, char *path, int ofs); | 236 | char *rev, char *path, int ofs); |
215 | extern void cgit_commit_link(char *name, char *title, char *class, char *head, | 237 | extern void cgit_commit_link(char *name, char *title, char *class, char *head, |
216 | char *rev); | 238 | char *rev); |
239 | extern void cgit_refs_link(char *name, char *title, char *class, char *head, | ||
240 | char *rev, char *path); | ||
217 | extern void cgit_snapshot_link(char *name, char *title, char *class, | 241 | extern void cgit_snapshot_link(char *name, char *title, char *class, |
218 | char *head, char *rev, char *archivename); | 242 | char *head, char *rev, char *archivename); |
219 | extern void cgit_diff_link(char *name, char *title, char *class, char *head, | 243 | extern void cgit_diff_link(char *name, char *title, char *class, char *head, |
@@ -230,6 +254,8 @@ extern void cgit_print_pageheader(char *title, int show_search); | |||
230 | extern void cgit_print_snapshot_start(const char *mimetype, | 254 | extern void cgit_print_snapshot_start(const char *mimetype, |
231 | const char *filename, | 255 | const char *filename, |
232 | struct cacheitem *item); | 256 | struct cacheitem *item); |
257 | extern void cgit_print_branches(int maxcount); | ||
258 | extern void cgit_print_tags(int maxcount); | ||
233 | 259 | ||
234 | extern void cgit_print_repolist(struct cacheitem *item); | 260 | extern void cgit_print_repolist(struct cacheitem *item); |
235 | extern void cgit_print_summary(); | 261 | extern void cgit_print_summary(); |
@@ -237,8 +263,9 @@ extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char * | |||
237 | extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path); | 263 | extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path); |
238 | extern void cgit_print_tree(const char *rev, char *path); | 264 | extern void cgit_print_tree(const char *rev, char *path); |
239 | extern void cgit_print_commit(char *hex); | 265 | extern void cgit_print_commit(char *hex); |
266 | extern void cgit_print_refs(); | ||
240 | extern void cgit_print_tag(char *revname); | 267 | extern void cgit_print_tag(char *revname); |
241 | extern void cgit_print_diff(const char *new_hex, const char *old_hex); | 268 | extern void cgit_print_diff(const char *new_hex, const char *old_hex, const char *prefix); |
242 | extern void cgit_print_snapshot(struct cacheitem *item, const char *head, | 269 | extern void cgit_print_snapshot(struct cacheitem *item, const char *head, |
243 | const char *hex, const char *prefix, | 270 | const char *hex, const char *prefix, |
244 | const char *filename, int snapshot); | 271 | const char *filename, int snapshot); |