mt.c File Reference

#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mtio.h>

Include dependency graph for mt.c:

Go to the source code of this file.

Data Structures

struct  tape_operation

Defines

#define nil   NULL
#define _POSIX_SOURCE   1
#define DS_OK   0
#define DS_ERR   1
#define DS_EOF   2
#define SENSE_KEY   0x0F
#define SENSE_ILI   0x20
#define SENSE_EOM   0x40
#define SENSE_EOF   0x80
#define SELF   -1
#define IGN   -1
#define NNG   0
#define POS   1
#define arraysize(a)   (sizeof(a)/sizeof((a)[0]))
#define arraylimit(a)   ((a) + arraysize(a))

Typedefs

typedef tape_operation tape_operation_t

Functions

void usage (void)
int main (int argc, char **argv)

Variables

tape_operation_t tapeops []
char * dev_state []
char * scsi_sense []


Define Documentation

#define _POSIX_SOURCE   1
 

Definition at line 6 of file mt.c.

#define arraylimit a   )     ((a) + arraysize(a))
 

Definition at line 62 of file mt.c.

#define arraysize a   )     (sizeof(a)/sizeof((a)[0]))
 

Definition at line 61 of file mt.c.

#define DS_EOF   2
 

Definition at line 21 of file mt.c.

#define DS_ERR   1
 

Definition at line 20 of file mt.c.

#define DS_OK   0
 

Definition at line 19 of file mt.c.

#define IGN   -1
 

Definition at line 38 of file mt.c.

#define nil   NULL
 

Definition at line 4 of file mt.c.

#define NNG   0
 

Definition at line 39 of file mt.c.

#define POS   1
 

Definition at line 40 of file mt.c.

#define SELF   -1
 

Definition at line 37 of file mt.c.

Referenced by atapi_sendpacket(), cons_write(), copy_fdsets(), dev_ioctl(), do_copy(), do_dev_name(), do_diagnostics(), do_diocntl(), do_exit(), do_fcntl(), do_get_kmess(), do_getinfo(), do_getstat(), do_getsysinfo(), do_initialize(), do_ioctl(), do_iopenable(), do_kill(), do_procstat(), do_rdlink(), do_reboot(), do_rescue(), do_sdevio(), do_select(), do_slink(), do_slot_name(), do_svrctl(), do_times(), do_umap(), do_video(), do_vm_map(), do_vrdwt(), dp_getblock(), dp_nic2user(), dp_pio16_nic2user(), dp_pio16_user2nic(), dp_user2nic(), dsp_ioctl(), dsp_write(), ec_nic2user(), ec_user2nic(), el1_interrupt(), el1_send(), el3_rx_complete(), f_transfer(), fxp_do_conf(), fxp_init_buf(), fxp_init_hw(), fxp_readv(), fxp_writev(), get_part_table(), get_set_input(), get_set_output(), get_set_volume(), get_userdata(), getsigset(), gettime(), handle_req(), handle_status(), in_transfer(), init_buffer(), init_params(), insb(), insw(), kbd_loadmap(), kputc(), log_append(), m_ioctl(), m_transfer(), main(), map_regs(), mem2user(), mem_getblock(), panic(), pio_getblock(), prepare_output(), put_userdata(), r_transfer(), rl_init_buf(), rl_readv(), rl_writev(), scr_init(), sense_request(), subread(), subwrite(), sys_getinfo(), test_read(), tickdelay(), user2mem(), vir2phys(), w_identify(), w_io_test(), w_other(), and w_transfer().

#define SENSE_EOF   0x80
 

Definition at line 27 of file mt.c.

#define SENSE_EOM   0x40
 

Definition at line 26 of file mt.c.

#define SENSE_ILI   0x20
 

Definition at line 25 of file mt.c.

#define SENSE_KEY   0x0F
 

Definition at line 24 of file mt.c.


Typedef Documentation

typedef struct tape_operation tape_operation_t
 


Function Documentation

int main int  argc,
char **  argv
 

Definition at line 82 of file mt.c.

References arraylimit, count, ERANGE, errno, exit(), fprintf(), getenv(), mtop::mt_count, nil, op, r, stderr, strcmp, strlen(), strncmp(), strtol(), tapeops, and usage.

void usage void   ) 
 

Definition at line 76 of file mt.c.

References exit(), fprintf(), and stderr.


Variable Documentation

char* dev_state[]
 

Initial value:

 {
        "OK", "ERR", "EOF"
}

Definition at line 65 of file mt.c.

char* scsi_sense[]
 

Initial value:

 {
        "NO SENSE INFO", "RECOVERED ERROR", "NOT READY", "MEDIUM ERROR",
        "HARDWARE ERROR", "ILLEGAL REQUEST", "UNIT ATTENTION", "DATA PROTECT",
        "BLANK CHECK", "VENDOR UNIQUE ERROR", "COPY ABORTED", "ABORTED COMMAND",
        "EQUAL", "VOLUME OVERFLOW", "MISCOMPARE", "SENSE RESERVED"
}

Definition at line 69 of file mt.c.

tape_operation_t tapeops[]
 

Initial value:

 {
        { MTWEOF,  "eof",      POS },   
        { MTWEOF,  "weof",     POS },   
        { MTFSF,   "fsf",      POS },   
        { MTFSR,   "fsr",      POS },   
        { MTBSF,   "bsf",      NNG },   
        { MTBSR,   "bsr",      POS },   
        { MTEOM,   "eom",      IGN },   
        { MTREW,   "rewind",   IGN },   
        { MTOFFL,  "offline",  IGN },   
        { MTOFFL,  "rewoffl",  IGN },   
        { SELF,    "status",   IGN },   
        { MTRETEN, "retension",IGN },   
        { MTERASE, "erase",    IGN },   
        { MTMODE,  "density",  NNG },   
        { MTBLKZ,  "blksize",  NNG },   
        { MTBLKZ,  "blocksize",NNG },   
}

Definition at line 42 of file mt.c.

Referenced by main().


Generated on Fri Apr 14 23:07:01 2006 for minix by  doxygen 1.4.6