Unit CDFS

From Ultibo.org
Revision as of 02:39, 30 December 2016 by Ultibo (Talk | contribs)

Jump to: navigation, search

Return to Unit Reference


Description


Ultibo CDFS interface unit

To be documented

Constants



CDFS specific constants cdfs*
cdfsIso9660 = 0;  
cdfsJoilet = 1;  
cdfsSierra = 2;  
cdfsRockRidge = 3;  
cdfsAudio = 4;  
cdfsUDF = 5;  
 
cdfsNames:array[0..5] of String = (
'CD001',  
'CD001',  
'CDROM',  
,  
'CDAUDIO',  
);  
 
cdfsAnyName = '*';  
cdfsDotName = '.';  
cdfsDotDotName = '..';  
cdfsBlankName = ;  
cdfsVersionName = '1'; Used by version information on end of identifier (Not Used)
cdfsSeparator1Name = '.'; Dot on end of identifier when no extension exists (File only)
cdfsSeparator2Name = ';'; Used by version information on end of identifier (File only)
 
cdfsJolietMaxPath = 240; 120 (240 bytes)
cdfsJolietMaxFile = 64; (128 bytes)
cdfsISO9660MaxPath = 240;  
cdfsISO9660MaxFile = 30; 31 for Directories
 
cdfsISO9660StandardIdentifier = 'CD001';  
cdfsELTORITOSystemIdentifier = 'EL TORITO SPECIFICATION';  
 
cdfsFirstSector = 0;  
cdfsReservedSectors = 16;  
cdfsISO9660StartSector = 16;  
cdfsELTORITOBootSector = 17;  
 
cdfsISO9660StructureVersion = 1;  
cdfsISO9660DescriptorVersion = 1;  
cdfsELTORITODescriptorVersion = 1;  
 
cdfsJolietUCS2Sequence1 = #37 + #47 + #64; '%/@'
cdfsJolietUCS2Sequence2 = #37 + #47 + #67; '%/C'
cdfsJolietUCS2Sequence3 = #37 + #47 + #69; '%/E'
 
cdfsDotIdentifier = $00;  
cdfsDotDotIdentifier = $01;  
 
cdfsSeparator1Value = $2E; '.'
cdfsSeparator2Value = $3B; ';'
 
cdfsTimeStartYear = 1900; CDFS Time starts at 1900
cdfsTimeOffsetInterval = 15; Offset is in 15 minute intervals
 
cdfsNullFileTime:TFileTime = (dwLowDateTime:$00000000;dwHighDateTime:$00000000);  
 
cdfsStartCluster = 16;  
cdfsUnknownCluster = LongWord(-1);  
 
cdfsRootPathNumber = 1;  
 
cdfsPathRecordSize = 9; Minimum
cdfsExtendedRecordSize = 250; Minimum
cdfsDirectoryRecordSize = 34; Minimum
 
cdfsFileIdentifierSize = 1; Minimum
cdfsPathIdentifierSize = 1; Minimum
 
cdfsHeaderRecordSize = 32; Fixed
cdfsCatalogRecordSize = 32; Fixed
cdfsExtensionRecordSize = 32; Fixed
 
cdfsEvenSize = 0;  
cdfsUnevenSize = 1;  
 
cdfsRootRecordOffset = 156; Offset of Root Directory in Descriptor
 
cdfsInstanceFirst = 0;  
cdfsInstanceLast = Byte(-1);  
 
cdfsTableTypeMask = $00FF0000;  
cdfsTableTypeShift = 16;  
cdfsTableInstanceMask = $0000FF00;  
cdfsTableInstanceShift = 8;  
cdfsTableDescriptorMask = $000000FF;  
cdfsTableDescriptorShift = 0;  
 
cdfsBitmapUnknown = LongWord(-1);  


CDFS bitmap mask constants cdfsBitmapMask*
cdfsBitmapMaskBits = 64; Int64 Bitmap Masks
cdfsBitmapMaskNone = $0000000000000000; Int64 Used for fast counting of free blocks
cdfsBitmapMaskAll = $FFFFFFFFFFFFFFFF; Int64 Used for fast counting of used blocks


CDFS volume flag constants cdfsVolumeFlag*
cdfsVolumeFlagNone = $00;  
cdfsVolumeFlagUnregistered = $01; If set this SVD contains an unregistered escape sequence


CDFS file flag constants cdfsFileFlag*
cdfsFileFlagNone = $00;  
cdfsFileFlagExistence = $01; If set this file is hidden
cdfsFileFlagDirectory = $02; If set this record is a directory
cdfsFileFlagAssociated = $04; If set this file is an associated file
cdfsFileFlagRecord = $08; If set record information is recorded for this file
cdfsFileFlagProtection = $10; If set permissions are recorded for this file
cdfsFileFlagReserved1 = $20; Reserved
cdfsFileFlagReserved2 = $40; Reserved
cdfsFileFlagMore = $80; If set there are more directory records for this file


CDFS permissions constants cdfsPermission*
cdfsPermissionSystemRead = $0001; If set system cannot Read
cdfsPermissionSystemWrite = $0002; If set system cannot Write
cdfsPermissionSystemExecute = $0004; If set system cannot Execute
cdfsPermissionReserved1 = $0008; Reserved
cdfsPermissionOwnerRead = $0010; If set owner cannot Read
cdfsPermissionOwnerWrite = $0020; If set owner cannot Write
cdfsPermissionOwnerExecute = $0040; If set owner cannot Execute
cdfsPermissionReserved2 = $0080; Reserved
cdfsPermissionGroupRead = $0100; If set group cannot Read
cdfsPermissionGroupWrite = $0200; If set group cannot Write
cdfsPermissionGroupExecute = $0400; If set group cannot Execute
cdfsPermissionReserved3 = $0800; Reserved
cdfsPermissionOtherRead = $1000; If set other cannot Read
cdfsPermissionOtherWrite = $2000; If set other cannot Write
cdfsPermissionOtherExecute = $4000; If set other cannot Execute
cdfsPermissionReserved4 = $8000; Reserved


CDFS path table constants cdfsPathTable*
cdfsPathTableTypePrimary = $00;  
cdfsPathTableTypeAlternate = $01;  
cdfsPathTableTypePrimaryM = $02;  
cdfsPathTableTypeAlternateM = $03;  


CDFS volume descriptor constants cdfsVolumeDescriptor*
cdfsVolumeDescriptorTypeBoot = $00;  
cdfsVolumeDescriptorTypePrimary = $01;  
cdfsVolumeDescriptorTypeSupplementary = $02;  
cdfsVolumeDescriptorTypePartition = $03;  
cdfsVolumeDescriptorTypeTerminator = $FF;  


CDFS header constants cdfsElTorito*
cdfsElToritoHeaderId = $01;  
cdfsElToritoBootIndicator = $88;  
cdfsElToritoNoBootIndicator = $00;  
cdfsElToritoHeaderIndicator = $90; 91 if final header
cdfsElToritoHeaderTerminator = $91;  
cdfsElToritoExtensionIndicator = $44;  


CDFS signature constants cdfsElToritoSignature*
cdfsElToritoSignature = $AA55;  


CDFS platform Id constants cdfsElToritoPlatform*
cdfsElToritoPlatformIdx86 = $00;  
cdfsElToritoPlatformIdPPC = $01;  
cdfsElToritoPlatformIdMac = $02;  


CDFS media type constants cdfsElToritoMedia*
cdfsElToritoMediaTypeNone = $00; No Emulation
cdfsElToritoMediaType12M = $01; 1.2 meg diskette
cdfsElToritoMediaType144M = $02; 1.44 meg diskette
cdfsElToritoMediaType288M = $03; 2.88 meg diskette
cdfsElToritoMediaTypeHDD = $04; Hard Disk (drive 80)
cdfsElToritoMediaTypeMask = $0F; Values 5-F Reserved, invalid at this time
 
cdfsElToritoMediaFlagReserved = $10; Reserved, must be 0
cdfsElToritoMediaFlagContinuation = $20; Continuation Entry Follows
cdfsElToritoMediaFlagAtapi = $40; Image contains ATAPI driver
cdfsElToritoMediaFlagScsi = $80; Image contains SCSI drivers
cdfsElToritoMediaFlagMask = $F0;  


CDFS extension flag constants cdfsElToritoExtensionFlag*
cdfsElToritoExtensionFlagExtension = $20; Extension Record Follows


Type definitions


To be documented

Public variables


None defined

Function declarations



Initialization functions

procedure CDFSInit;
Description: To be documented
Note None documented


procedure CDFSQuit;
Description: To be documented
Note None documented


CDFS helper functions

function CDFSDataToPointer(const AData; ASize:Integer; ASwap:Boolean):Pointer;
Description: Creates a pointer and copies data from a buffer
Note Allows byte order swapping on copy


function CDFSPointerToData(APointer:Pointer; var AData; ASize:Integer; ASwap:Boolean):Boolean;
Description: Copies data to a buffer from supplied pointer
Note Allows byte order swapping on copy


function CDFSIdentifierToString(const AIdentifier; ASize:Integer; AUnicode:Boolean):String;
Description: Converts the supplied indentifier to a string
Note Accounts for unicode and byte ordering


function CDFSStringToIdentifier(const AString:String; var AIdentifier; ASize:Integer; AUnicode:Boolean):Boolean;
Description: Converts the supplied string to an identifier
Note Accounts for unicode and byte ordering


function CDFSIdentifierToFileName(const AIdentifier; ASize:Integer; AUnicode:Boolean):String;
Description: Converts the supplied identifier to a filename
Note Accounts for dot and dot dot special entries


function CDFSFileNameToIdentifier(const AFileName:String; var AIdentifier; ASize:Integer; AUnicode:Boolean):Boolean;
Description: Converts the supplied filename to an identifier
Note Accounts for dot and dot dot special entries


function CDFSTimeToFileTime(const ATime:TCDFSTime):TFileTime;
Description: Converts a CDFS Time in Local to a File Time in UTC
Note None documented


function FileTimeToCDFSTime(const AFileTime:TFileTime; var ATime:TCDFSTime):Boolean;
Description: Converts a File Time in UTC to a CDFS Time in Local
Note None documented


function CDFSDateTimeToFileTime(const ADateTime:TCDFSDateTime):TFileTime;
Description: Converts a CDFS Date Time in Local to a File Time in UTC
Note None documented


function FileTimeToCDFSDateTime(const AFileTime:TFileTime; var ADateTime:TCDFSDateTime):Boolean;
Description: Converts a File Time in UTC to a CDFS Date Time in Local
Note None documented


Return to Unit Reference