| fprint(2, "usage: root [-h host] score\n"); |
| threadmain(int argc, char *argv[]) |
| uchar score[VtScoreSize]; |
| fmtinstall('F', vtfcallfmt); |
| fmtinstall('V', vtscorefmt); |
| buf = vtmallocz(VtMaxLumpSize); |
| sysfatal("could not connect to server: %r"); |
| sysfatal("vtconnect: %r"); |
| if(vtparsescore(argv[i], nil, score) < 0){ |
| fprint(2, "cannot parse score '%s': %r\n", argv[i]); |
| n = vtread(z, score, VtRootType, buf, VtMaxLumpSize); |
| fprint(2, "could not read block %V: %r\n", score); |
| fprint(2, "block %V is wrong size %d != 300\n", score, n); |
| if(vtrootunpack(&root, buf) < 0){ |
| fprint(2, "unpacking block %V: %r\n", score); |
| print("%V: %q %q %V %d %V\n", score, root.name, root.type, root.score, root.blocksize, root.prev); |