VMS Help  —  MRD Library, mrd_find_cartridge, Description
    This routine allows searching for the element location of a piece
    of media using the volume tag as a search key. If the element_
    type value is zero (0), all elements will searched in the order
    Slot, Drive, Transport and Port. The element_name and element_
    count arguments will be ignored in this case.

    When a specific element type is specified, the search will be
    limited to that element type. The element_name will used as the
    starting location for a search and element_count as the number
    of elements from that address to search. Using these arguments
    a search of a large number of elements may be broken up into a
    number of smaller searches.

    When a matching element is found, the element_info_t data for
    that element will copied into the space pointed to by result.
    The zero relative element address and element type will also be
    copied into the space provided.

1  –  Element Info

    The element_info_t data structure is defined in the include file
    <mrd_common.h>. The fields of this data structure are described
    below:

    o  name - The name field holds the volume tag of the media if
       applicable.

    o  state - The state field can have one of the following values:

          ELEMENT_FULL,
          ELELMENT_EMPTY, or
          ELEMENT_EXCEPT.

    o  port_type - If the element_type parameter specifies PORT, the
       port_type field will have one of the following values:

          IN_OUT_PORT,
          INPORT,
          OUTPORT.

    o  status - The status field can have one of the following
       values:

          MRD_STATUS_SLOT_INVALID,
          MRD_STATUS_DEVICE_INVALID,
          MRD_STATUS_TRANSPORT_INVALID,
          MRD_STATUS_PORT_INVALID, or
          MRD_STATUS_SUCCESS.

    o  flags - Use the ELEMENT_VALID mask on the flags field to
       indicate whether or not the full Read Element Status data
       is valid. The ELEMENT_PVOLTAG and ELEMENT_AVOLTAG indicate
       whether the primary or alternate volume tags of the Read
       Element Status data are valid.

    o  element_addr - This is the address of the element, unadjusted
       for the starting address. The routine mrd_map_element(3mrd)
       can be used to convert an absolute element address to a
       relative address and type. This field will be set to -1 when
       the information is not valid.

    o  source_addr - On most SCSI-2 medium-changers, this is the
       address where a cartridge resided before being moved to its
       current location. The routine mrd_map_element(3mrd) can be
       used to convert an absolute element address to a relative
       address and type. This field will be set to -1 when the
       information is not valid. On some SCSI-2 medium-changers (the
       DLT family loaders) this will be the element address of the
       slot itself.

    o  data - This a copy of the SCSI-2 Read Element Status data
       when the ELEMENT_VALID bit is set in the flags field. A byte-
       order neutral declaration of this data structure is included
       in the <mrd_common.h> include file as the mrd_reades_t data
       structure.
Close Help