3 int main(int argc, char **argv)
8 static unsigned int top_index[256];
10 if (fread(top_index, sizeof(top_index), 1, stdin) != 1)
11 die("unable to read index");
13 for (i = 0; i < 256; i++) {
14 unsigned n = ntohl(top_index[i]);
16 die("corrupt index file");
19 for (i = 0; i < nr; i++) {
22 if (fread(entry, 24, 1, stdin) != 1)
23 die("unable to read entry %u/%u", i, nr);
24 offset = ntohl(entry[0]);
25 printf("%u %s\n", offset, sha1_to_hex((void *)(entry+1)));