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(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 view</h2>");
36 htmlf("sha1=%s<br/>type=%s<br/>size=%i<br/>", hex, type, size);