]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-shared.c
Makefile: autobuild dependency rules
[ps-cgit] / ui-shared.c
index 25960233f65546820313001759f455d5944f68b8..aa6598843ef9f569726a686bb69aa98168b303ce 100644 (file)
@@ -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("<br/>");
+       }
+}