| fprint(2, "usage: mkroot [-h host] name type score blocksize prev\n"); |
| threadmain(int argc, char *argv[]) |
| uchar score[VtScoreSize]; |
| fmtinstall('V', vtscorefmt); |
| fmtinstall('F', vtfcallfmt); |
| strecpy(root.name, root.name+sizeof root.name, argv[0]); |
| strecpy(root.type, root.type+sizeof root.type, argv[1]); |
| if(vtparsescore(argv[2], nil, root.score) < 0) |
| sysfatal("bad score '%s'", argv[2]); |
| root.blocksize = atoi(argv[3]); |
| if(vtparsescore(argv[4], nil, root.prev) < 0) |
| sysfatal("bad score '%s'", argv[4]); |
| sysfatal("could not connect to server: %r"); |
| sysfatal("vtconnect: %r"); |
| if(vtwrite(z, score, VtRootType, buf, VtRootSize) < 0) |