1 /* vi: set sw=4 ts=4: */
12 /* missing: eod/seod, stoptions, stwrthreshold, densities */
13 static const struct mt_opcodes opcodes[] = {
18 {"datacompression", MTCOMPRESSION},
30 {"rewoffline", MTOFFL},
35 {"retension", MTRETEN},
39 {"setdensity", MTSETDENSITY},
40 {"drvbuffer", MTSETDRVBUFFER},
41 {"setpart", MTSETPART},
51 extern int mt_main(int argc, char **argv)
53 const char *file = "/dev/tape";
54 const struct mt_opcodes *code = opcodes;
62 if (strcmp(argv[1], "-f") == 0) {
71 while (code->name != 0) {
72 if (strcmp(code->name, argv[1]) == 0)
77 if (code->name == 0) {
78 error_msg("unrecognized opcode %s.\n", argv[1]);
82 op.mt_op = code->value;
84 op.mt_count = atoi(argv[2]);
86 op.mt_count = 1; /* One, not zero, right? */
88 if ((fd = open(file, O_RDONLY, 0)) < 0) {
93 if (ioctl(fd, MTIOCTOP, &op) != 0) {