summaryrefslogtreecommitdiff
path: root/ui-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-view.c')
-rw-r--r--ui-view.c55
1 files changed, 0 insertions, 55 deletions
diff --git a/ui-view.c b/ui-view.c
deleted file mode 100644
index 8873415..0000000
--- a/ui-view.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* ui-view.c: functions to output _any_ object, given it's sha1
- *
- * Copyright (C) 2006 Lars Hjemli
- *
- * Licensed under GNU General Public License v2
- * (see COPYING for full license text)
- */
-
-#include "cgit.h"
-
-void cgit_print_view(const char *hex, char *path)
-{
- unsigned char sha1[20];
- enum object_type type;
- unsigned char *buf;
- unsigned long size;
-
- if (get_sha1_hex(hex, sha1)){
- cgit_print_error(fmt("Bad hex value: %s", hex));
- return;
- }
-
- type = sha1_object_info(sha1, &size);
- if (type == OBJ_BAD) {
- cgit_print_error(fmt("Bad object name: %s", hex));
- return;
- }
-
- buf = read_sha1_file(sha1, &type, &size);
- if (!buf) {
- cgit_print_error(fmt("Error reading object %s", hex));
- return;
- }
-
- buf[size] = '\0';
- html("<table class='list'>\n");
- html("<tr class='nohover'><th class='left'>");
- if (path)
- htmlf("%s (", path);
- htmlf("%s %s, %li bytes", typename(type), hex, size);
- if (path)
- html(")");
-
- html(" <a href='");
- html_attr(cgit_pageurl(cgit_query_repo, "blob",
- fmt("id=%s&amp;path=%s",
- hex,
- path)));
- html("'>download</a>");
- html("</th></tr>\n");
- html("<tr><td class='blob'>\n");
- html_txt(buf);
- html("\n</td></tr>\n");
- html("</table>\n");
-}
2007-05-11 12:12:48 +0200'>2007-05-11Add submodule links in tree listingLars Hjemli6-12/+27 2007-05-11Add submodules.sh and use it during buildsLars Hjemli3-13/+222 2007-05-11Added git as a submoduleLars Hjemli2-1/+1 2007-05-09Add support for downloading single blobsLars Hjemli5-3/+47 2007-05-08ui-view: show pathname if specified in querystringLars Hjemli3-5/+10 2007-05-08Update to libgit 1.5.2-rc2Lars Hjemli9-837/+50 2007-02-21Layout updateLars Hjemli9-32/+127 2007-02-08Make snapshot feature configurableLars Hjemli5-6/+22 2007-02-08Add support for snapshotsLars Hjemli8-8/+153 2007-02-05cgit v0.2v0.2Lars Hjemli1-1/+1 2007-02-05Add support for prefix and gitsrc arguments to 'make'Lars Hjemli2-15/+37 2007-02-04Update cgitrc templateLars Hjemli1-21/+32 2007-02-04Add support for lightweight tagsLars Hjemli2-19/+37 2007-02-04Read repo-info from /etc/cgitrcLars Hjemli5-55/+120 2007-02-04Do not die if tag has no messageLars Hjemli1-2/+2 2007-02-03Fix search for non-virtual urlsLars Hjemli1-0/+6 2007-01-28Update README with install/config informationLars Hjemli1-24/+28