1 /* ui-view.c: functions to output _any_ object, given it's sha1
3 * Copyright (C) 2006 Lars Hjemli
5 * Licensed under GNU General Public License v2
6 * (see COPYING for full license text)
11 void cgit_print_view(const char *hex)
13 unsigned char sha1[20];
18 if (get_sha1_hex(hex, sha1)){
19 cgit_print_error(fmt("Bad hex value: %s", hex));
23 if (sha1_object_info(sha1, type, &size)){
24 cgit_print_error("Bad object name");
28 buf = read_sha1_file(sha1, type, &size);
30 cgit_print_error("Error reading object");
35 html("<h2>Object content</h2>\n");
36 html("<table class='list'>\n");
37 htmlf("<tr><th>%s %s, %li bytes</th></tr>\n", type, hex, size);
38 html("<tr><td class='blob'>\n");
40 html("\n</td></tr>\n");