From 4a0be586662843382ecfa53af34a13b291312bc0 Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Sun, 17 Jun 2007 18:12:03 +0200 Subject: Add cgit_diff_link() This adds a new function used to generate links to the diff page and uses it everywhere such links appear (expect for single files in the diffstat displayed on the commit page: this is now a link to the tree page). The updated diff-page now expects zero, one or two revision specifiers, in parameters head, id and id2. Id defaults to head unless otherwise specified, while head (as usual) defaults to repo.defbranch. If id2 isn't specified, it defaults to the first parent of id1. The most important change is of course that now all repo pages (summary, log, tree, commit and diff) has support for passing on the current branch and revision, i.e. the road is now open for a 'static' menu with links to all of these pages. Signed-off-by: Lars Hjemli --- cgit.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cgit.h') diff --git a/cgit.h b/cgit.h index c276a24..bd2dd0d 100644 --- a/cgit.h +++ b/cgit.h @@ -207,6 +207,8 @@ extern void cgit_log_link(char *name, char *title, char *class, char *head, char *rev, char *path); extern void cgit_commit_link(char *name, char *title, char *class, char *head, char *rev); +extern void cgit_diff_link(char *name, char *title, char *class, char *head, + char *new_rev, char *old_rev, char *path); extern void cgit_print_error(char *msg); extern void cgit_print_date(time_t secs, char *format); @@ -223,9 +225,8 @@ extern void cgit_print_summary(); extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path, int pager); extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path); extern void cgit_print_tree(const char *rev, char *path); -extern void cgit_print_commit(const char *hex); -extern void cgit_print_diff(const char *head, const char *old_hex, const char *new_hex, - char *path); +extern void cgit_print_commit(char *hex); +extern void cgit_print_diff(const char *new_hex, const char *old_hex); extern void cgit_print_snapshot(struct cacheitem *item, const char *hex, const char *format, const char *prefix, const char *filename); -- cgit v1.2.3-70-g09d2