The following list identifies the common routines. o mrd_eject(3mrd) o mrd_find_cartridge(3mrd) o mrd_home(3mrd) o mrd_initialize(3mrd) o mrd_inject(3mrd) o mrd_load(3mrd) o mrd_lock(3mrd) o mrd_map_element(3mrd) o mrd_move(3mrd) o mrd_position(3mrd) o mrd_ready_inport(3mrd) o mrd_scsi_decode(3mrd) o mrd_startup(3mrd) o mrd_show(3mrd) o mrd_shutdown(3mrd) o mrd_strelement(3mrd) o mrd_strexcept(3mrd) o mrd_unload(3mrd) The common routines will open a robot to perform their operations. All these routines will close the robot when successfully completed, except for mrd_show(3mrd). The mrd_ show(3mrd) routine closes the robot only when it encounters an error. The routine mrd_startup(3mrd) is used to open a medium-changer. It will fill in a robot_info_t data structure that contains the number of elements of each type, their addresses and the medium- changer SCSI Inquiry data. Thus, it is unnecessary (and often not desirable) to keep the robot open while it is being used. The routine mrd_shutdown(3mrd) can be used to close the robot. Aside from closing the file and setting the channel field to BAD_ CHANNEL, it has no effect on the other data in the robot_info_t data structure. Use the mrd_show(3mrd) routine to obtain information about the contents and state of the slots, drive, ports and transports of the medium-changer. The mrd_show(3mrd) routine will open a robot, but it will also work if the robot is already open when the routine is called. For each element requested, an element_ info_t data structure will be set if the element exists. The mrd_show(3mrd) function will accept the address of a robot_info_ t data structure. If the robot has already been opened by mrd_ startup(3mrd), this open robot will be used by the routine. If the robot isn't open (indicated by the channel field set to BAD_ CHANNEL), the medium-changer indicated by the robot_name will be opened. If the routine completes successfully, the medium- changer will remain open. On an error, the medium-changer will be closed and the channel field reset to BAD_CHANNEL. By keeping the medium-changer open, multiple calls can be made to mrd_show(3mrd) without incurring the time to call mrd_startup(3mrd) each time. The routine mrd_move(3mrd) is a general interface to the SCSI Move Medium command. It allows the specification of source and destination elements for the move, whether the medium should be inverted and an optional volume tag. On medium-changers which have a vision system to read bar-codes, the volume tag can be used to verify that the medium in the source slot is the one desired. The routines mrd_load(3mrd), mrd_unload(3mrd), mrd_inject(3mrd) and mrd_eject(3mrd) are specialized interfaces to the SCSI Move Medium command. Load will move a medium from a slot to a drive. Unload will move a medium from a drive to a slot. Inject moves a medium from a port to a slot and Eject from a slot to a port. On the TL82x family of libraries, mrd_eject(3mrd) can also be used to clear a medium from the Pass-Through Mechanism. The routine mrd_lock(3mrd) enables sending a SCSI Prevent/Allow Media Removal command. Whether this command is supported, and its effect, depends on the robot. The routine mrd_initialize(3mrd) sends a SCSI Initialize Element Status command. The effect of this command varies among robots, but it typically causes complete reinventory of the medium- changer. The routine mrd_position(3mrd) sends a SCSI Position to Element command. The routine mrd_ready_inport(3mrd) sends a vendor unique, Ready Inport command. On the TL82n family of libraries, this command enables the button which opens the Inport/Outport Device inport door. Other libraries and loaders may silently ignore this command or treat it as an illegal command. On medium-changers which keep track of a medium's previous element location, the routine mrd_home(3mrd) returns a medium to that location. On medium-changers with vision systems to read bar-code labels, the routine mrd_find_cartridge(3mrd) will search for a specified volume tag. The routine will search the entire library, or just a subset of elements according to the arguments used. The routine mrd_map_element(3mrd) accepts an element's absolute address and returns the element type and zero relative address. The routine mrd_strstatus(3mrd) accepts an MRD error status code and returns the corresponding message text. The routine mrd_ strelement(3mrd) accepts an MRD_ELEMENT code for various words which apply to SCSI-2 medium-changer elements and returns the corresponding string. The routine mrd_strexcept(3mrd) accepts the Additional Sense Code and Additional Sense Code Qualifier for an element with an exception and returns the corresponding message text.