9 // XXX What to do here?
10 VtMaxLumpSize = 65535,
16 fprint(2, "usage: read [-h host] [-t type] score\n");
17 threadexitsall("usage");
21 threadmain(int argc, char *argv[])
24 uchar score[VtScoreSize];
29 fmtinstall('F', vtfcallfmt);
30 fmtinstall('V', vtscorefmt);
36 host = EARGF(usage());
39 type = atoi(EARGF(usage()));
49 if(vtparsescore(argv[0], nil, score) < 0)
50 sysfatal("could not parse score '%s': %r", argv[0]);
52 buf = vtmallocz(VtMaxLumpSize);
56 sysfatal("could not connect to server: %r");
59 sysfatal("vtconnect: %r");
63 for(type=0; type<VtMaxType; type++){
64 n = vtread(z, score, type, buf, VtMaxLumpSize);
66 fprint(2, "venti/read%s%s %V %d\n", host ? " -h" : "", host ? host : "",
72 n = vtread(z, score, type, buf, VtMaxLumpSize);
76 sysfatal("could not read block: %r");
77 if(write(1, buf, n) != n)
78 sysfatal("write: %r");