| fprint(2, "usage: read [-h host] [-t type] score\n"); |
| threadmain(int argc, char *argv[]) |
| uchar score[VtScoreSize]; |
| fmtinstall('F', vtfcallfmt); |
| fmtinstall('V', vtscorefmt); |
| type = atoi(EARGF(usage())); |
| if(vtparsescore(argv[0], nil, score) < 0) |
| sysfatal("could not parse score '%s': %r", argv[0]); |
| buf = vtmallocz(VtMaxLumpSize); |
| sysfatal("could not connect to server: %r"); |
| sysfatal("vtconnect: %r"); |
| for(type=0; type<VtMaxType; type++){ |
| n = vtread(z, score, type, buf, VtMaxLumpSize); |
| fprint(2, "venti/read%s%s %V %d\n", host ? " -h" : "", host ? host : "", |
| n = vtread(z, score, type, buf, VtMaxLumpSize); |
| sysfatal("could not read block: %r"); |
| if(write(1, buf, n) != n) |