static void st_status(struct mtget *bp) { printf("Mode Density Blocksize bpi " "Compression\n" "Current: %-17s %-12s %-7d %s\n" "---------available modes---------\n" "0: %-17s %-12s %-7d %s\n" "1: %-17s %-12s %-7d %s\n" "2: %-17s %-12s %-7d %s\n" "3: %-17s %-12s %-7d %s\n", denstostring(bp->mt_density), getblksiz(bp->mt_blksiz), mt_density_bp(bp->mt_density, TRUE), comptostring(bp->mt_comp), denstostring(bp->mt_density0), getblksiz(bp->mt_blksiz0), mt_density_bp(bp->mt_density0, TRUE), comptostring(bp->mt_comp0), denstostring(bp->mt_density1), getblksiz(bp->mt_blksiz1), mt_density_bp(bp->mt_density1, TRUE), comptostring(bp->mt_comp1), denstostring(bp->mt_density2), getblksiz(bp->mt_blksiz2), mt_density_bp(bp->mt_density2, TRUE), comptostring(bp->mt_comp2), denstostring(bp->mt_density3), getblksiz(bp->mt_blksiz3), mt_density_bp(bp->mt_density3, TRUE), comptostring(bp->mt_comp3)); if (bp->mt_dsreg != MTIO_DSREG_NIL) { const char sfmt[] = "Current Driver State: %s.\n"; printf("---------------------------------\n"); const char *state_str; state_str = get_driver_state_str(bp->mt_dsreg); if (state_str == NULL) { char foo[32]; (void) sprintf(foo, "Unknown state 0x%x", bp->mt_dsreg); printf(sfmt, foo); } else { printf(sfmt, state_str); } } if (bp->mt_resid == 0 && bp->mt_fileno == (daddr_t) -1 && bp->mt_blkno == (daddr_t) -1) return; printf("---------------------------------\n"); printf("File Number: %d\tRecord Number: %d\tResidual Count %d\n", bp->mt_fileno, bp->mt_blkno, bp->mt_resid); }
void st_status(struct mtget *bp) { printf("Mode Density Blocksize bpi " "Compression\n" "Current: %-17s %-12s %-7d %s\n" "---------available modes---------\n" "0: %-17s %-12s %-7d %s\n" "1: %-17s %-12s %-7d %s\n" "2: %-17s %-12s %-7d %s\n" "3: %-17s %-12s %-7d %s\n", denstostring(bp->mt_density), getblksiz(bp->mt_blksiz), denstobp(bp->mt_density, TRUE), comptostring(bp->mt_comp), denstostring(bp->mt_density0), getblksiz(bp->mt_blksiz0), denstobp(bp->mt_density0, TRUE), comptostring(bp->mt_comp0), denstostring(bp->mt_density1), getblksiz(bp->mt_blksiz1), denstobp(bp->mt_density1, TRUE), comptostring(bp->mt_comp1), denstostring(bp->mt_density2), getblksiz(bp->mt_blksiz2), denstobp(bp->mt_density2, TRUE), comptostring(bp->mt_comp2), denstostring(bp->mt_density3), getblksiz(bp->mt_blksiz3), denstobp(bp->mt_density3, TRUE), comptostring(bp->mt_comp3)); if (bp->mt_dsreg != MTIO_DSREG_NIL) { auto char foo[32]; const char *sfmt = "Current Driver State: %s.\n"; printf("---------------------------------\n"); switch (bp->mt_dsreg) { case MTIO_DSREG_REST: printf(sfmt, "at rest"); break; case MTIO_DSREG_RBSY: printf(sfmt, "Communicating with drive"); break; case MTIO_DSREG_WR: printf(sfmt, "Writing"); break; case MTIO_DSREG_FMK: printf(sfmt, "Writing Filemarks"); break; case MTIO_DSREG_ZER: printf(sfmt, "Erasing"); break; case MTIO_DSREG_RD: printf(sfmt, "Reading"); break; case MTIO_DSREG_FWD: printf(sfmt, "Spacing Forward"); break; case MTIO_DSREG_REV: printf(sfmt, "Spacing Reverse"); break; case MTIO_DSREG_POS: printf(sfmt, "Hardware Positioning (direction unknown)"); break; case MTIO_DSREG_REW: printf(sfmt, "Rewinding"); break; case MTIO_DSREG_TEN: printf(sfmt, "Retensioning"); break; case MTIO_DSREG_UNL: printf(sfmt, "Unloading"); break; case MTIO_DSREG_LD: printf(sfmt, "Loading"); break; default: (void) sprintf(foo, "Unknown state 0x%x", bp->mt_dsreg); printf(sfmt, foo); break; } } if (bp->mt_resid == 0 && bp->mt_fileno == (daddr_t) -1 && bp->mt_blkno == (daddr_t) -1) return; printf("---------------------------------\n"); printf("File Number: %u\tRecord Number: %u\tResidual Count %d\n", bp->mt_fileno, bp->mt_blkno, bp->mt_resid); }