From f34478cbe0214a201e7ecef3e79ed6c957b7beee Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Mon, 24 Mar 2008 16:00:27 +0100 Subject: Refactor snapshot support The snapshot support needs to be split between output- and config-related functions to get the layering between shared.c and ui-*.c right. There is also some codestyle-issues which needs fixing to make the snapshot functions more similar to the rest of the cgit code. Signed-off-by: Lars Hjemli --- ui-shared.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'ui-shared.c') diff --git a/ui-shared.c b/ui-shared.c index 2596023..aa65988 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -573,4 +573,19 @@ void cgit_print_filemode(unsigned short mode) html_fileperm(mode); } -/* vim:set sw=8: */ +void cgit_print_snapshot_links(const char *repo, const char *head, + const char *hex, int snapshots) +{ + const struct cgit_snapshot_format* f; + char *filename; + + for (f = cgit_snapshot_formats; f->suffix; f++) { + if (!(snapshots & f->bit)) + continue; + filename = fmt("%s-%s%s", cgit_repobasename(repo), hex, + f->suffix); + cgit_snapshot_link(filename, NULL, NULL, (char *)head, + (char *)hex, filename); + html("
"); + } +} -- cgit v1.2.3-59-g8ed1b