The Media Robot Driver library is a callable interface for
controlling SCSI-2 medium-changers. The interface consists of
two include files and an object library which are installed in an
operating system specific location. The operating system specific
locations are shown in Library File Locations.
Table 1-1 Library File Locations
Windows NT \Program Files\MRU\mrd.dll
UNIX /usr/lib/libmrd.a
OpenVMS SYS$LIBRARY:MRD$RTL.EXE
The <mrd_common.h> include file defines data structures used to
provide information about the medium-changer and its elements.
The <mrd_common.h> file also defines a large number of symbolic
constants for element type codes, offsets within SCSI structures,
masks for SCSI bit fields, and other useful structures. The <mrd_
common.h> file also includes prototype definitions of all the
medium-changer functions provided in the interface.
The <mrd_message.h> include file defines constants for each error
code returned by the MRD interface. Function prototypes are also
included for routines that will return a string corresponding to
the error code.
On Digital UNIX, these strings are retrieved from an I18N message
catalog that is part of the installed software. Code and routines
are also included for words and element exception messages that
might be commonly used by a medium-changer application.
1 – Element Addresses
The first OpenVMS implementation of MRD supported the TF and TA
family DLT media-changers. It used Mass Storage Control Protocol
Display commands to indicate what cartridge should be moved.
The MSCP uses cartridge address names instead of numbers as SCSI
does. When SCSI support was added to the MRD, the convention
of using strings for the address was kept and thus it has been
since.
In the common interface example programs, the character strings
for the addresses are taken directly from the command line
arguments and no special formatting is necessary. But, in
practice, a program will probably keep SCSI addresses in
numeric form and will have to convert those to strings. In the
MRU command line interface and graphic user interface we use
sprintf(3) for this:
int element_number ;
char element[MRD_NAME_SIZE+1] ;
element_number = 5 ;
sprintf(element, "%d", element_number) ;