mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 19:24:40 +00:00
General refactor and cleanup.
This commit is contained in:
216
src/helpers.c
216
src/helpers.c
@@ -25,76 +25,146 @@ int32_t aaruf_get_media_tag_type_for_datatype(int32_t type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case CompactDiscPartialToc: return CD_TOC;
|
||||
case CompactDiscSessionInfo: return CD_SessionInfo;
|
||||
case CompactDiscToc: return CD_FullTOC;
|
||||
case CompactDiscPma: return CD_PMA;
|
||||
case CompactDiscAtip: return CD_ATIP;
|
||||
case CompactDiscLeadInCdText: return CD_TEXT;
|
||||
case DvdPfi: return DVD_PFI;
|
||||
case DvdLeadInCmi: return DVD_CMI;
|
||||
case DvdDiscKey: return DVD_DiscKey;
|
||||
case DvdBca: return DVD_BCA;
|
||||
case DvdDmi: return DVD_DMI;
|
||||
case DvdMediaIdentifier: return DVD_MediaIdentifier;
|
||||
case DvdMediaKeyBlock: return DVD_MKB;
|
||||
case DvdRamDds: return DVDRAM_DDS;
|
||||
case DvdRamMediumStatus: return DVDRAM_MediumStatus;
|
||||
case DvdRamSpareArea: return DVDRAM_SpareArea;
|
||||
case DvdRRmd: return DVDR_RMD;
|
||||
case DvdRPrerecordedInfo: return DVDR_PreRecordedInfo;
|
||||
case DvdRMediaIdentifier: return DVDR_MediaIdentifier;
|
||||
case DvdRPfi: return DVDR_PFI;
|
||||
case DvdAdip: return DVD_ADIP;
|
||||
case HdDvdCpi: return HDDVD_CPI;
|
||||
case HdDvdMediumStatus: return HDDVD_MediumStatus;
|
||||
case DvdDlLayerCapacity: return DVDDL_LayerCapacity;
|
||||
case DvdDlMiddleZoneAddress: return DVDDL_MiddleZoneAddress;
|
||||
case DvdDlJumpIntervalSize: return DVDDL_JumpIntervalSize;
|
||||
case DvdDlManualLayerJumpLba: return DVDDL_ManualLayerJumpLBA;
|
||||
case BlurayDi: return BD_DI;
|
||||
case BlurayBca: return BD_BCA;
|
||||
case BlurayDds: return BD_DDS;
|
||||
case BlurayCartridgeStatus: return BD_CartridgeStatus;
|
||||
case BluraySpareArea: return BD_SpareArea;
|
||||
case AacsVolumeIdentifier: return AACS_VolumeIdentifier;
|
||||
case AacsSerialNumber: return AACS_SerialNumber;
|
||||
case AacsMediaIdentifier: return AACS_MediaIdentifier;
|
||||
case AacsMediaKeyBlock: return AACS_MKB;
|
||||
case AacsDataKeys: return AACS_DataKeys;
|
||||
case AacsLbaExtents: return AACS_LBAExtents;
|
||||
case CprmMediaKeyBlock: return AACS_CPRM_MKB;
|
||||
case HybridRecognizedLayers: return Hybrid_RecognizedLayers;
|
||||
case ScsiMmcWriteProtection: return MMC_WriteProtection;
|
||||
case ScsiMmcDiscInformation: return MMC_DiscInformation;
|
||||
case ScsiMmcTrackResourcesInformation: return MMC_TrackResourcesInformation;
|
||||
case ScsiMmcPowResourcesInformation: return MMC_POWResourcesInformation;
|
||||
case ScsiInquiry: return SCSI_INQUIRY;
|
||||
case ScsiModePage2A: return SCSI_MODEPAGE_2A;
|
||||
case AtaIdentify: return ATA_IDENTIFY;
|
||||
case AtapiIdentify: return ATAPI_IDENTIFY;
|
||||
case PcmciaCis: return PCMCIA_CIS;
|
||||
case SecureDigitalCid: return SD_CID;
|
||||
case SecureDigitalCsd: return SD_CSD;
|
||||
case SecureDigitalScr: return SD_SCR;
|
||||
case SecureDigitalOcr: return SD_OCR;
|
||||
case MultiMediaCardCid: return MMC_CID;
|
||||
case MultiMediaCardCsd: return MMC_CSD;
|
||||
case MultiMediaCardOcr: return MMC_OCR;
|
||||
case MultiMediaCardExtendedCsd: return MMC_ExtendedCSD;
|
||||
case XboxSecuritySector: return Xbox_SecuritySector;
|
||||
case FloppyLeadOut: return Floppy_LeadOut;
|
||||
case DvdDiscControlBlock: return DCB;
|
||||
case CompactDiscFirstTrackPregap: return CD_FirstTrackPregap;
|
||||
case CompactDiscLeadOut: return CD_LeadOut;
|
||||
case ScsiModeSense6: return SCSI_MODESENSE_6;
|
||||
case ScsiModeSense10: return SCSI_MODESENSE_10;
|
||||
case UsbDescriptors: return USB_Descriptors;
|
||||
case XboxDmi: return Xbox_DMI;
|
||||
case XboxPfi: return Xbox_PFI;
|
||||
case CompactDiscMediaCatalogueNumber: return CD_MCN;
|
||||
case CompactDiscLeadIn: return CD_LeadIn;
|
||||
default: return -1;
|
||||
case CompactDiscPartialToc:
|
||||
return CD_TOC;
|
||||
case CompactDiscSessionInfo:
|
||||
return CD_SessionInfo;
|
||||
case CompactDiscToc:
|
||||
return CD_FullTOC;
|
||||
case CompactDiscPma:
|
||||
return CD_PMA;
|
||||
case CompactDiscAtip:
|
||||
return CD_ATIP;
|
||||
case CompactDiscLeadInCdText:
|
||||
return CD_TEXT;
|
||||
case DvdPfi:
|
||||
return DVD_PFI;
|
||||
case DvdLeadInCmi:
|
||||
return DVD_CMI;
|
||||
case DvdDiscKey:
|
||||
return DVD_DiscKey;
|
||||
case DvdBca:
|
||||
return DVD_BCA;
|
||||
case DvdDmi:
|
||||
return DVD_DMI;
|
||||
case DvdMediaIdentifier:
|
||||
return DVD_MediaIdentifier;
|
||||
case DvdMediaKeyBlock:
|
||||
return DVD_MKB;
|
||||
case DvdRamDds:
|
||||
return DVDRAM_DDS;
|
||||
case DvdRamMediumStatus:
|
||||
return DVDRAM_MediumStatus;
|
||||
case DvdRamSpareArea:
|
||||
return DVDRAM_SpareArea;
|
||||
case DvdRRmd:
|
||||
return DVDR_RMD;
|
||||
case DvdRPrerecordedInfo:
|
||||
return DVDR_PreRecordedInfo;
|
||||
case DvdRMediaIdentifier:
|
||||
return DVDR_MediaIdentifier;
|
||||
case DvdRPfi:
|
||||
return DVDR_PFI;
|
||||
case DvdAdip:
|
||||
return DVD_ADIP;
|
||||
case HdDvdCpi:
|
||||
return HDDVD_CPI;
|
||||
case HdDvdMediumStatus:
|
||||
return HDDVD_MediumStatus;
|
||||
case DvdDlLayerCapacity:
|
||||
return DVDDL_LayerCapacity;
|
||||
case DvdDlMiddleZoneAddress:
|
||||
return DVDDL_MiddleZoneAddress;
|
||||
case DvdDlJumpIntervalSize:
|
||||
return DVDDL_JumpIntervalSize;
|
||||
case DvdDlManualLayerJumpLba:
|
||||
return DVDDL_ManualLayerJumpLBA;
|
||||
case BlurayDi:
|
||||
return BD_DI;
|
||||
case BlurayBca:
|
||||
return BD_BCA;
|
||||
case BlurayDds:
|
||||
return BD_DDS;
|
||||
case BlurayCartridgeStatus:
|
||||
return BD_CartridgeStatus;
|
||||
case BluraySpareArea:
|
||||
return BD_SpareArea;
|
||||
case AacsVolumeIdentifier:
|
||||
return AACS_VolumeIdentifier;
|
||||
case AacsSerialNumber:
|
||||
return AACS_SerialNumber;
|
||||
case AacsMediaIdentifier:
|
||||
return AACS_MediaIdentifier;
|
||||
case AacsMediaKeyBlock:
|
||||
return AACS_MKB;
|
||||
case AacsDataKeys:
|
||||
return AACS_DataKeys;
|
||||
case AacsLbaExtents:
|
||||
return AACS_LBAExtents;
|
||||
case CprmMediaKeyBlock:
|
||||
return AACS_CPRM_MKB;
|
||||
case HybridRecognizedLayers:
|
||||
return Hybrid_RecognizedLayers;
|
||||
case ScsiMmcWriteProtection:
|
||||
return MMC_WriteProtection;
|
||||
case ScsiMmcDiscInformation:
|
||||
return MMC_DiscInformation;
|
||||
case ScsiMmcTrackResourcesInformation:
|
||||
return MMC_TrackResourcesInformation;
|
||||
case ScsiMmcPowResourcesInformation:
|
||||
return MMC_POWResourcesInformation;
|
||||
case ScsiInquiry:
|
||||
return SCSI_INQUIRY;
|
||||
case ScsiModePage2A:
|
||||
return SCSI_MODEPAGE_2A;
|
||||
case AtaIdentify:
|
||||
return ATA_IDENTIFY;
|
||||
case AtapiIdentify:
|
||||
return ATAPI_IDENTIFY;
|
||||
case PcmciaCis:
|
||||
return PCMCIA_CIS;
|
||||
case SecureDigitalCid:
|
||||
return SD_CID;
|
||||
case SecureDigitalCsd:
|
||||
return SD_CSD;
|
||||
case SecureDigitalScr:
|
||||
return SD_SCR;
|
||||
case SecureDigitalOcr:
|
||||
return SD_OCR;
|
||||
case MultiMediaCardCid:
|
||||
return MMC_CID;
|
||||
case MultiMediaCardCsd:
|
||||
return MMC_CSD;
|
||||
case MultiMediaCardOcr:
|
||||
return MMC_OCR;
|
||||
case MultiMediaCardExtendedCsd:
|
||||
return MMC_ExtendedCSD;
|
||||
case XboxSecuritySector:
|
||||
return Xbox_SecuritySector;
|
||||
case FloppyLeadOut:
|
||||
return Floppy_LeadOut;
|
||||
case DvdDiscControlBlock:
|
||||
return DCB;
|
||||
case CompactDiscFirstTrackPregap:
|
||||
return CD_FirstTrackPregap;
|
||||
case CompactDiscLeadOut:
|
||||
return CD_LeadOut;
|
||||
case ScsiModeSense6:
|
||||
return SCSI_MODESENSE_6;
|
||||
case ScsiModeSense10:
|
||||
return SCSI_MODESENSE_10;
|
||||
case UsbDescriptors:
|
||||
return USB_Descriptors;
|
||||
case XboxDmi:
|
||||
return Xbox_DMI;
|
||||
case XboxPfi:
|
||||
return Xbox_PFI;
|
||||
case CompactDiscMediaCatalogueNumber:
|
||||
return CD_MCN;
|
||||
case CompactDiscLeadIn:
|
||||
return CD_LeadIn;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,7 +263,9 @@ int32_t aaruf_get_xml_mediatype(int32_t type)
|
||||
case MilCD:
|
||||
case VideoNow:
|
||||
case VideoNowColor:
|
||||
case VideoNowXp: return OpticalDisc;
|
||||
default: return BlockMedia;
|
||||
case VideoNowXp:
|
||||
return OpticalDisc;
|
||||
default:
|
||||
return BlockMedia;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user