Logo Search packages:      
Sourcecode: vcdimager version File versions

uint16_t vcdinfo_get_multi_default_offset ( const vcdinfo_obj_t *  obj,
lid_t  lid,
unsigned int  entry_num 
)

Get default or multi-default LID offset.

Return the LID offset associated with a the "default" entry of the passed-in LID parameter. Note "default" entries are associated with PSDs that are (extended) selection lists. If the "default" is a multi-default, we use entry_num to find the proper "default" offset. Otherwise this routine is exactly like vcdinfo_get_default_offset with the exception of requiring an additional "entry_num" parameter.

Returns:
VCDINFO_INVALID_OFFSET is returned on error, or if the LID is not a selection list or no "default" entry. Otherwise the LID offset is returned.
Return the LID offset associated with a the "default" entry of the passed-in LID parameter. Note "default" entries are associated with PSDs that are (extended) selection lists. If the "default" offset is a multi-default, we use entry_num to find the proper "default" offset. Otherwise this routine is exactly like vcdinfo_get_default_offset with the exception of requiring an additional "entry_num" parameter.

Returns:
VCDINFO_INVALID_OFFSET is returned on error, or if the LID is not a selection list or no "default" entry. Otherwise the LID offset is returned.

Definition at line 563 of file info.c.

References vcdinf_psd_get_itemid(), vcdinfo_classify_itemid(), vcdinfo_get_default_offset(), vcdinfo_get_multi_default_offset(), VCDINFO_INVALID_OFFSET, vcdinfo_lid_get_pxd(), vcdinfo_selection_get_offset(), and vcdinfo_track_get_entry().

Referenced by vcdinfo_get_multi_default_lid(), and vcdinfo_get_multi_default_offset().

{
  uint16_t offset=vcdinfo_get_default_offset(obj, lid);

  switch (offset) {
  case PSD_OFS_MULTI_DEF:
  case PSD_OFS_MULTI_DEF_NO_NUM: 
    {
      /* Have some work todo... Figure the selection number. */
      PsdListDescriptor_t pxd;
      
      vcdinfo_lid_get_pxd(obj, &pxd, lid);

      switch (pxd.descriptor_type) {
        
      case PSD_TYPE_SELECTION_LIST:
      case PSD_TYPE_EXT_SELECTION_LIST: {
        vcdinfo_itemid_t selection_itemid;
        uint16_t selection_itemid_num;
        unsigned int start_entry_num;

        if (pxd.psd == NULL) return VCDINFO_INVALID_OFFSET;
        selection_itemid_num  = vcdinf_psd_get_itemid(pxd.psd);
        vcdinfo_classify_itemid(selection_itemid_num, &selection_itemid);
        if (selection_itemid.type != VCDINFO_ITEM_TYPE_TRACK) {
          return VCDINFO_INVALID_OFFSET;
        }

        start_entry_num = vcdinfo_track_get_entry(obj, selection_itemid.num);
        return vcdinfo_selection_get_offset(obj, lid, 
                                            entry_num-start_entry_num);
      }
      default: ;
      }
    }
  default:
    return VCDINFO_INVALID_OFFSET;
  }
}


Generated by  Doxygen 1.6.0   Back to index