#include <IOKit/storage/IOCDTypes.h>
IOKit/storage/IOCDTypes.h
(enable 8-bit struct packing)
typedefCDMSF
typedef struct CDMSF CDMSF;
macrokCDMCNMaxLength
#define kCDMCNMaxLength 13
macrokCDISRCMaxLength
#define kCDISRCMaxLength 12
typedefCDMCN
typedef char CDMCN [kCDMCNMaxLength + 1]
typedefCDISRC
typedef char CDISRC[kCDISRCMaxLength + 1]
macrokCDAudioStatusUnsupported
#define kCDAudioStatusUnsupported 0x00
macrokCDAudioStatusActive
#define kCDAudioStatusActive 0x11
macrokCDAudioStatusPaused
#define kCDAudioStatusPaused 0x12
macrokCDAudioStatusSuccess
#define kCDAudioStatusSuccess 0x13
macrokCDAudioStatusFailure
#define kCDAudioStatusFailure 0x14
macrokCDAudioStatusNone
#define kCDAudioStatusNone 0x15
structCDAudioStatus
| UInt8 | status | |||||||||||||||||||
| unnamed struct at Kernel/IOKit/storage/IOCDTypes.h:76:5 | position | |||||||||||||||||||
| ||||||||||||||||||||
typedefCDAudioStatus
typedef struct CDAudioStatus CDAudioStatus;
structCDTOCDescriptor
| UInt8 | session | |
| UInt8:4 | control | |
| UInt8:4 | adr | |
| UInt8 | tno | |
| UInt8 | point | |
| CDMSF | address | |
| UInt8 | zero | |
| CDMSF | p |
typedefCDTOCDescriptor
typedef struct CDTOCDescriptor CDTOCDescriptor;
structCDTOC
| UInt16 | length | |
| UInt8 | sessionFirst | |
| UInt8 | sessionLast | |
| CDTOCDescriptor[0] | descriptors |
typedefCDTOC
typedef struct CDTOC CDTOC;
functionCDTOCGetDescriptorCount
static inline UInt32 CDTOCGetDescriptorCount(CDTOC * toc)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu SDK Kernel.framework IOKit/storage/IOCDTypes.h (inline)
Returns the number of track descriptors in the given CD table of contents, computed from the TOC's big-endian length field; returns 0 if the length describes less than a full CDTOC header.
functionCDConvertMSFToLBA
static inline UInt32 CDConvertMSFToLBA(CDMSF msf)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu SDK Kernel.framework IOKit/storage/IOCDTypes.h (inline)
Converts a minute:second:frame address to a logical block address: ((minute * 60 + second) * 75) + frame - 150, the 150-frame (two second) lead-in offset making MSF 00:02:00 equal LBA 0.
functionCDConvertMSFToClippedLBA
static inline UInt32 CDConvertMSFToClippedLBA(CDMSF msf)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu SDK Kernel.framework IOKit/storage/IOCDTypes.h (inline)
Converts a minute:second:frame address to a logical block address in the manner of CDConvertMSFToLBA, but returns 0 for addresses within the initial two-second lead-in (minute 0, second <= 1), clipping what would be negative block numbers.
functionCDConvertLBAToMSF
static inline CDMSF CDConvertLBAToMSF(UInt32 lba)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu SDK Kernel.framework IOKit/storage/IOCDTypes.h (inline)
Converts a logical block address to a minute:second:frame address, adding the 150-frame lead-in offset (LBA 0 becomes MSF 00:02:00).
functionCDConvertTrackNumberToMSF
static inline CDMSF CDConvertTrackNumberToMSF(UInt8 track, CDTOC * toc)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu SDK Kernel.framework IOKit/storage/IOCDTypes.h (inline)
Returns the starting minute:second:frame address of the given track, found by searching the TOC descriptors for one with point equal to track and adr 1. Returns 0xFF:0xFF:0xFF if the track is not present. The CDTOC is assumed complete, with no descriptors clipped by an undersized buffer.
enumCDSectorArea
| kCDSectorAreaSync | 128 | |
| kCDSectorAreaHeader | 32 | |
| kCDSectorAreaSubHeader | 64 | |
| kCDSectorAreaUser | 16 | |
| kCDSectorAreaAuxiliary | 8 | |
| kCDSectorAreaErrorFlags | 2 | |
| kCDSectorAreaSubChannel | 1 | |
| kCDSectorAreaSubChannelQ | 4 |
typedefCDSectorArea
typedef enum CDSectorArea CDSectorArea;
enumCDSectorType
| kCDSectorTypeUnknown | 0 | |
| kCDSectorTypeCDDA | 1 | |
| kCDSectorTypeMode1 | 2 | |
| kCDSectorTypeMode2 | 3 | |
| kCDSectorTypeMode2Form1 | 4 | |
| kCDSectorTypeMode2Form2 | 5 | |
| kCDSectorTypeCount | 6 |
typedefCDSectorType
typedef enum CDSectorType CDSectorType;
enumCDSectorSize
| kCDSectorSizeCDDA | 2352 | |
| kCDSectorSizeMode1 | 2048 | |
| kCDSectorSizeMode2 | 2336 | |
| kCDSectorSizeMode2Form1 | 2048 | |
| kCDSectorSizeMode2Form2 | 2328 | |
| kCDSectorSizeWhole | 2352 |
typedefCDSectorSize
typedef enum CDSectorSize CDSectorSize;
enum(anonymous)
| kCDMediaTypeUnknown | 256 | |
| kCDMediaTypeROM | 258 | CD-ROM |
| kCDMediaTypeR | 260 | CD-R |
| kCDMediaTypeRW | 261 | CD-RW |
| kCDMediaTypeMin | 256 | |
| kCDMediaTypeMax | 511 |
typedefCDMediaType
typedef UInt32 CDMediaType
macrokCDSpeedMin
#define kCDSpeedMin 0x00B0
macrokCDSpeedMax
#define kCDSpeedMax 0xFFFF
enum(anonymous)
| kCDTOCFormatTOC | 2 | CDTOC |
| kCDTOCFormatPMA | 3 | CDPMA |
| kCDTOCFormatATIP | 4 | CDATIP |
| kCDTOCFormatTEXT | 5 | CDTEXT |
structCDPMADescriptor
Read Table Of Contents Format 0x03
| UInt8 | reserved | |
| UInt8:4 | control | |
| UInt8:4 | adr | |
| UInt8 | tno | |
| UInt8 | point | |
| CDMSF | address | |
| UInt8 | zero | |
| CDMSF | p |
typedefCDPMADescriptor
typedef struct CDPMADescriptor CDPMADescriptor
structCDPMA
| UInt16 | dataLength | |
| UInt8 | reserved | |
| UInt8 | reserved2 | |
| CDPMADescriptor[0] | descriptors |
typedefCDPMA
typedef struct CDPMA CDPMA
structCDATIP
Read Table Of Contents Format 0x04
| UInt16 | dataLength | |
| UInt8[2] | reserved | |
| UInt8:3 | referenceSpeed | |
| UInt8:1 | reserved3 | |
| UInt8:3 | indicativeTargetWritingPower | |
| UInt8:1 | reserved2 | |
| UInt8:6 | reserved5 | |
| UInt8:1 | unrestrictedUse | |
| UInt8:1 | reserved4 | |
| UInt8:1 | a3Valid | |
| UInt8:1 | a2Valid | |
| UInt8:1 | a1Valid | |
| UInt8:3 | discSubType | |
| UInt8:1 | discType | |
| UInt8:1 | reserved6 | |
| UInt8 | reserved7 | |
| CDMSF | startTimeOfLeadIn | |
| UInt8 | reserved8 | |
| CDMSF | lastPossibleStartTimeOfLeadOut | |
| UInt8 | reserved9 | |
| UInt8[3] | a1 | |
| UInt8 | reserved10 | |
| UInt8[3] | a2 | |
| UInt8 | reserved11 | |
| UInt8[3] | a3 | |
| UInt8 | reserved12 |
typedefCDATIP
typedef struct CDATIP CDATIP
structCDTEXTDescriptor
Read Table Of Contents Format 0x05
| UInt8 | packType | |
| UInt8 | trackNumber | |
| UInt8 | sequenceNumber | |
| UInt8:4 | characterPosition | |
| UInt8:3 | blockNumber | |
| UInt8:1 | doubleByteCharacterCode | |
| UInt8[12] | textData | |
| UInt8[2] | reserved |
typedefCDTEXTDescriptor
typedef struct CDTEXTDescriptor CDTEXTDescriptor
structCDTEXT
| UInt16 | dataLength | |
| UInt8 | reserved | |
| UInt8 | reserved2 | |
| CDTEXTDescriptor[0] | descriptors |
typedefCDTEXT
typedef struct CDTEXT CDTEXT
structCDDiscInfo
Read Disc Information Format
| UInt16 | dataLength | |
| UInt8:2 | discStatus | |
| UInt8:2 | stateOfLastSession | |
| UInt8:1 | erasable | |
| UInt8:3 | reserved | |
| UInt8 | numberOfFirstTrack | |
| UInt8 | numberOfSessionsLSB | |
| UInt8 | firstTrackNumberInLastSessionLSB | |
| UInt8 | lastTrackNumberInLastSessionLSB | |
| UInt8:5 | reserved3 | |
| UInt8:1 | unrestrictedUse | |
| UInt8:1 | discBarCodeValid | |
| UInt8:1 | discIdentificationValid | |
| UInt8 | discType | |
| UInt8 | numberOfSessionsMSB | |
| UInt8 | firstTrackNumberInLastSessionMSB | |
| UInt8 | lastTrackNumberInLastSessionMSB | |
| UInt32 | discIdentification | |
| UInt8 | reserved7 | |
| CDMSF | lastSessionLeadInStartTime | |
| UInt8 | reserved8 | |
| CDMSF | lastPossibleStartTimeOfLeadOut | |
| UInt8[8] | discBarCode | |
| UInt8 | reserved9 | |
| UInt8 | numberOfOPCTableEntries | |
| UInt8[0] | opcTableEntries |
typedefCDDiscInfo
typedef struct CDDiscInfo CDDiscInfo
typedefCDTrackInfoAddressType
Read Track Information Address Types
typedef UInt8 CDTrackInfoAddressType
enum(anonymous)
| kCDTrackInfoAddressTypeLBA | 0 | |
| kCDTrackInfoAddressTypeTrackNumber | 1 | |
| kCDTrackInfoAddressTypeSessionNumber | 2 |
structCDTrackInfo
Read Track Information Format
| UInt16 | dataLength | |
| UInt8 | trackNumberLSB | |
| UInt8 | sessionNumberLSB | |
| UInt8 | reserved | |
| UInt8:4 | trackMode | |
| UInt8:1 | copy | |
| UInt8:1 | damage | |
| UInt8:2 | reserved3 | |
| UInt8:4 | dataMode | |
| UInt8:1 | fixedPacket | |
| UInt8:1 | packet | |
| UInt8:1 | blank | |
| UInt8:1 | reservedTrack | |
| UInt8:1 | nextWritableAddressValid | |
| UInt8:1 | lastRecordedAddressValid | |
| UInt8:6 | reserved5 | |
| UInt32 | trackStartAddress | |
| UInt32 | nextWritableAddress | |
| UInt32 | freeBlocks | |
| UInt32 | fixedPacketSize | |
| UInt32 | trackSize | |
| UInt32 | lastRecordedAddress | |
| UInt8 | trackNumberMSB | |
| UInt8 | sessionNumberMSB | |
| UInt8 | reserved6 | |
| UInt8 | reserved7 |
typedefCDTrackInfo
typedef struct CDTrackInfo CDTrackInfo