grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / filesys / cdfs / udf.h
blob1213f33a4b07fdddac6c42aa994962af04d1fbab
1 /*
2 * Copyright (C) 2013, The AROS Development Team
3 * All right reserved.
4 * Author: Jason S. McMullan <jason.mcmullan@gmail.com>
6 * Licensed under the AROS PUBLIC LICENSE (APL) Version 1.1
7 */
9 #ifndef UDF_H
10 #define UDF_H
12 #include <exec/types.h>
14 /* UDF 1.5 support, based off of the OSTA subset of ECMA-167
15 * Data structures for Plain, Spare, and VAT filesystems
18 #ifndef __packed
19 #define __packed __attribute__((__packed__))
20 #endif
22 typedef UBYTE Uint8;
23 typedef BYTE Int8;
24 typedef struct { USHORT le16; } Uint16;
25 typedef struct { USHORT le16; } Int16;
26 typedef struct { ULONG le32; } Uint32;
27 typedef struct { ULONG le32; } Int32;
28 typedef struct { UQUAD le32; } Uint64;
29 typedef struct { UQUAD le32; } Int64;
31 typedef struct osta_compressed {
32 Uint8 CompressionID;
33 #define OSTA_COMPRESSIONID_8BIT 8 // UTF-8 stream
34 #define OSTA_COMPRESSIONID_16BIT 16 // UTF-16 stream
35 UBYTE Stream[0];
36 } osta_compressed;
38 typedef struct charspec {
39 Uint8 CharacterSetType;
40 #define UDF_CS0 0 /* UDF OSTA Compressed Unicode */
41 #define UDF_CS1 1 /* ECMA-6 (ISO/IEC 10646-1) */
42 #define UDF_CS2 2 /* ECMA-119 file identifiers:
43 * 0123456789._
44 * ABCDEFGHIJKLMNOPQRSTUVWXYZ
46 #define UDF_CS3 3 /* ISO/IEC 9945-1:
47 * 0123456789._-
48 * abcdefghijklmnopqrstuvwxyz
49 * ABCDEFGHIJKLMNOPQRSTUVWXYZ
51 #define UDF_CS4 4 /* International ECMA-6 */
52 #define UDF_CS5 5 /* ECMA-94 (Latin-1) */
53 #define UDF_CS6 6 /* ECMA-35 + ECMA-48 */
54 #define UDF_CS7 7 /* EMCA-35 + ECMA-48 + their extension characters */
55 #define UDF_CS8 8 /* Portable set:
56 * 0123456789._-!#$%&'()^`{}~
57 * abcdefghijklmnopqrstuvwxyz
58 * ABCDEFGHIJKLMNOPQRSTUVWXYZ
60 UBYTE CharacterSetInfo[63];
61 #define UDF_CS0_OSTA_INFORMATION "OSTA Compressed Unicode"
62 /* CS0 - Valid graphic characters
63 * CS1 - Valid graphic characters
64 * CS2 - ZERO
65 * CS3 - ZERO
66 * CS4 - ZERO
67 * CS5 - ZERO
68 * CS6 - Valid graphic characters
69 * CS7 - Valid graphic characters
70 * CS8 - ZERO
72 } charspec __packed;
73 // UDF 1.02 calls 'charspec' 'Charspec'
74 #define Charspec charspec
76 typedef struct dstring {
77 Uint8 Length;
78 UBYTE Data[0];
79 } dstring __packed;
81 typedef struct timestamp {
82 Uint16 TypeAndZone;
83 #define UDF_TZ_TYPE_of(x) (((x) >> 12) & 0xf)
84 #define UDF_TZ_TYPE_UCT 0
85 #define UDF_TZ_TYPE_LOCAL 1
86 #define UDF_TZ_TYPE_UNKNOWN 2
87 #define UDF_TZ_of(x) (((x) & 0x7ff) | (((x) >> 11) * 0xf800))
88 #define UDF_TZ_UNSPEC -2047
89 Int16 Year; // 1 - 9999
90 Uint8 Month; // 1 - 12
91 Uint8 Day; // 1 - 31
92 Uint8 Hour; // 0 - 23
93 Uint8 Minute; // 0 - 59
94 Uint8 Second; // 0 - 59
95 Uint8 Centiseconds; // 0 - 99
96 Uint8 HundredsofMicrosecs; // 0 - 99
97 Uint8 Microseconds; // 0 - 99
98 } timestamp __packed;
100 struct regid {
101 Uint8 Flags;
102 #define UDF_REGID_DIRTY (1 << 0)
103 #define UDF_REGID_PROTECTED (1 << 1)
104 UBYTE Identifier[23];
105 union {
106 UBYTE Suffix[8];
107 struct DomainIdentifierSuffix {
108 Uint16 UDFRevision;
109 Uint8 DomainFlags;
110 #define UDF_REGID_DOMAINFLAGS_WPROTECT_HARD (1 << 0)
111 #define UDF_REGID_DOMAINFLAGS_WPROTECT_SOFT (1 << 1)
112 UBYTE Reserved[5];
113 } DomainSuffix;
114 struct UDFIdentifierSuffix {
115 Uint16 UDFRevision;
116 Uint8 OSClass;
117 #define UTF_OSCLASS_UNDEFINED 0
118 #define UTF_OSCLASS_DOS 1
119 #define UTF_OSCLASS_OS2 2
120 #define UTF_OSCLASS_MACOS 3
121 #define UTF_OSCLASS_UNIX 4
122 #define UTF_OSCLASS_WIN9X 5
123 #define UTF_OSCLASS_WINNT 6
124 #define UTF_OSCLASS_OS400 7
125 #define UTF_OSCLASS_BEOS 8
126 #define UTF_OSCLASS_WINCE 9
127 Uint8 OSIdentifier;
128 UBYTE Reserved[4];
129 } UDFSuffix;
130 struct ImplentationIdentifierSuffix {
131 Uint8 OSClass;
132 Uint8 OSIdentifier;
133 UBYTE ImplementationUse[6];
134 } ImplementationSuffix;
136 } regid __packed;
138 // UDF 1.02 calls 'regid' 'EntityID' (following ISO 13346 1/7.4 naming)
139 #define EnityID regid
142 typedef struct extent_ad {
143 Uint32 Length;
144 Uint32 Location;
145 } extent_ad __packed;
147 typedef struct tag {
148 Uint16 TagIdentifier;
149 #define UDF_TAG_PRIMARY_VOLUME 1
150 #define UDF_TAG_ANCHOR_VOLUME_PTR 2
151 #define UDF_TAG_VOLUME_PTR 3
153 #define UDF_TAG_PARTITION 5
154 #define UDF_TAG_LOGICAL_VOLUME 6
155 #define UDF_TAG_UNALLOCATED_SPACE 7
156 #define UDF_TAG_TERMINATING 8
157 #define UDF_TAG_LOGICAL_VOLUME_INT 9
158 Uint16 DescriptorVersion; /* 2 = NSR02, 3 = NSR03 */
159 Uint8 TagChecksum; /* Checksum of bytes 0-3 & 5-15 mod 256 */
160 UBYTE Reserved[1];
161 Uint16 TagSerialNumber;
162 Uint16 DescriptorCRC; /* CRC-ITU-T (x^16 + x^12 + x^5 + 1) */
163 Uint16 DescriptorCRCLength;
164 UInt32 TagLocation; /* Extent of this tag */
165 } tag __packed;
167 /****************** Volume & Partitions ******************/
169 struct udfVolume {
170 Uint8 Type; /* 0 0 0 */
171 UBYTE Id[5]; /* BEA01, BOOT2, NSR02, NSR03, TEA01 */
172 Uint8 Version; /* 1 1 1 */
173 union {
174 UBYTE Data[2041];
175 struct UDF_VolumeDescriptor_BOOT2 {
176 UBYTE Reserved[1];
177 regid ArchitectureType;
178 regid BootIdentifier;
179 Uint32 BootExtentLocation;
180 Uint32 BootExtentLength;
181 Uint64 LoadAddress;
182 Uint64 StartAddress;
183 timestamp CreationTime;
184 Uint16 Flags;
185 #define UDF_BOOT2_IGNORE (1 << 0)
186 UBYTE Reserved[32];
187 UBYTE BootUse[1906];
188 } BOOT2;
189 struct { } BEA01;
190 struct { } TEA01;
191 struct { } NSR02;
192 struct { } NSR03;
193 } __packed;
195 struct udfPrimaryVolume {
196 tag Tag;
197 Uint32 VolumeDescriptorSequenceNumber;
198 Uint32 PrimaryVolumeDescriptorNumber;
199 union {
200 dstring VolumeIdentifier;
201 UBYTE VolumeIdentifier_[32];
203 Uint16 VolumeSequenceNumber;
204 Uint16 MaximumVolumeSequenceNumber;
205 Uint16 InterchangeLevel;
206 #define UDF_VOLUME_INTERCHANGE_SINGLE 2
207 #define UDF_VOLUME_INTERCHANGE_MULTI 3
208 Uint16 MaximumInterchangeLevel;
209 Uint32 CharacterSetList;
210 #define UDF_VOLUME_CHARACTERSETLIST (1 << 0) // This is the ONLY value allowed!
211 Uint32 MaximumCharacterSetList;
212 union {
213 dstring VolumeSetIdentifier;
214 UBYTE VolumeSetIdentifier_[128];
216 charspec DescriptorCharacterSet;
217 charspec ExplanatoryCharacterSet;
218 extent_ad VolumeAbstract;
219 extent_ad VolumeCopyright;
220 regid ApplicationIdentifier;
221 timestamp RecordingDateandTime;
222 regid ImplementationIdentifier;
223 UBYTE ImplementationUse[64];
224 Uint32 PredecessorVolumeDescriptorSequenceLocation;
225 Uint16 Flags;
226 #define UDF_PRIMARY_VOLUME_COMMON (1 << 0)
227 UBYTE Reserved[22];
228 } __packed;
230 struct udfAnchorVolumePointer {
231 tag Tag;
232 extent_ad MainVolumeDescriptorSequenceExtent;
233 extent_ad ReserveVolumeDescriptorSequenceExtent;
234 UBYTE Reserved[480];
235 } __packed;
237 struct udfVolumePointer {
238 tag Tag;
239 Uint32 VolumeSequenceNumber;
240 extent_ad NextVolumeExtent;
241 UBYTE Reserved[484];
242 } __packed;
244 struct udfPartition {
245 tag Tag;
246 Uint32 VolumeSequenceNumber;
247 Uint16 Flags;
248 #define UDF_PARTITION_FLAGS_ALLOCATED (1 << 0)
249 Uint16 Number;
250 regid Contents; /* "+FDC01" - ECMA-107
251 * "+CD001" - ECMA-119
252 * "+CDW02" - ECMA-168
253 * "+NSR02" - ECMA-167/2
254 * "+NSR03" - ECMA-167
256 UBYTE ContentsUse[128];
257 Uint32 AccessType;
258 #define UDF_PARTITION_ACCESSTYPE_RO 1 /* Read only */
259 #define UDF_PARTITION_ACCESSTYPE_WORM 2 /* Write once */
260 #define UDF_PARTITION_ACCESSTYPE_REW 3 /* Read/Erase/Write */
261 #define UDF_PARTITION_ACCESSTYPE_RW 4 /* Read/Write */
262 Uint32 StartingLocation;
263 Uint32 Length;
264 regid ImplementationIdentifier;
265 UBYTE ImplementationUse[128];
266 UBYTE Reserved[156];
267 } __packed;
269 struct udfLogicalVolume {
270 tag Tag;
271 Uint32 VolumeDescriptorSequenceNumber;
272 charspec DescriptorCharacterSet;
273 union {
274 dstring Identifier;
275 UBYTE Identifier_[128];
277 Uint32 LogicalBlockSize;
278 regid DomainIdentifier;
279 UBYTE LogicalVolumeContentsUse[16];
280 Uint32 MapTableLength; /* MT_L */
281 Uint32 NumberOfParititionMaps;
282 regid ImplementationIdentifier;
283 UBYTE ImplementationUse[128];
284 extent_ad IntegritySequenceExtent;
285 UBYTE PartitionMaps[0];
286 } __packed;
288 struct udfPartitionMap {
289 Uint8 Type;
290 #define UDF_PARTITIONMAP_TYPE_1 1
291 #define UDF_PARTITIONMAP_TYPE_2 2
292 Uint8 Length;
293 union {
294 UBYTE Data[0];
295 struct {
296 Uint16 VolumeSequenceNumber;
297 Uint16 PartitionNumber;
298 } Type_1;
299 struct {
300 UBYTE Reserved[2];
301 regid PartitionTypeIdentifier;
302 Uint16 VolumeSequenceNumber;
303 Uint16 PartitionNumber;
304 UBYTE Reserved[24];
305 } Type_2;
307 } __packed;
309 struct udfSparingTable {
310 tag Tag;
311 regid Identifier;
312 Uint16 MapEntries;
313 UBYTE Reserved[2];
314 Uint32 SequenceNumber;
315 struct udfSparingMapEntry {
316 Uint32 OriginalLocation;
317 #define UDF_MAPENTRY_AVAILABLE 0xffffffff
318 #define UDF_MAPENTRY_DEFECTIVE 0xfffffff0
319 Uint32 MappedLocation;
320 } MapEntry[0];
323 struct udfUnallocatedSpaceDesc {
324 tag Tag;
325 Uint32 VolumeDescriptorSequenceNumber;
326 Uint32 NumberofAlloctionDescriptors;
327 extent_ad AlloctionDescriptor[0];
328 } __packed;
330 struct udfTerminating {
331 tag Tag;
332 UBYTE Reserved[496];
333 } __packed;
335 struct udfLogicalVolumeIntegrityDesc {
336 tag Tag;
337 timestamp RecordingDateandTime;
338 Uint32 IntegrityType;
339 #define UDF_LOGICALVOLUMEINTEGRITY_TYPE_OPEN 0
340 #define UDF_LOGICALVOLUMEINTEGRITY_TYPE_CLOSE 1
341 extent_ad NextIntegrityExtent;
342 UBYTE LogicalVolumeContentsUse[32];
343 Uint32 NumberOfPartitions;
344 Uint32 LengthOfImplementationUse;
345 Uint32 Data[0]; /* Free Space Table, Size Table, Impl. Use */
346 } __packed;
348 struct udfLogicalVolumeIntegrityImplementationUse {
349 regid ImplementationID;
350 Uint32 NumberofFiles;
351 Uint32 NumberofDirectories;
352 Uint16 MinimumUDFReadRevision;
353 Uint16 MinimumUDFWriteRevision;
354 Uint16 MaximumUDFWriteRevision;
355 UBYTE ImplementationUse[0];
356 } __packed;
358 struct udfImpUseVolume {
359 tag Tag;
360 Uint32 VolumeDescriptorSequenceNumber;
361 regid ImplementationIdentifier;
362 union {
363 UBYTE ImplementationUse[460];
364 struct LVInformation {
365 charspec LVICharset;
366 union {
367 dstring LogicalVolumeIdentifier;
368 UBYTE LogicalVolumeIdentifier_[128];
370 union {
371 dstring LVInfo1;
372 UBYTE LVInfo1_[36];
374 union {
375 dstring LVInfo2;
376 UBYTE LVInfo2_[36];
378 union {
379 dstring LVInfo3;
380 UBYTE LVInfo3_[36];
382 regid ImplementationId;
383 UBYTE ImplementationUse[128];
384 } LVInformation;
386 } __packed;
390 /****************** Filesystem ***************************/
392 typedef struct lb_addr {
393 Uint32 LogicalBlock;
394 Uint16 Partition;
395 } lb_addr __packed;
397 typedef struct short_ad {
398 Uint32 TypeLength;
399 #define UDF_SHORT_AD_LENGTH_of(x) ((x) & 0x3fffffff)
400 #define UDF_SHORT_AD_TYPE_of(x) (((x) >> 30) & 3)
401 #define UDF_SHORT_AD_TYPE_RECORDED 0
402 #define UDF_SHORT_AD_TYPE_ALLOCATED 1
403 #define UDF_SHORT_AD_TYPE_FREE 2
404 #define UDF_SHORT_AD_TYPE_NEXT 3
405 Uint32 ExtentLocation;
406 } short_ad __packed;
408 typedef struct long_ad {
409 Uint32 ExtentLength;
410 lb_addr ExtentLocation;
411 union {
412 UBYTE ImplementationUse[6];
413 struct ADImpUse {
414 Uint16 flags;
415 UBYTE impUse[4];
416 } ADImpUse;
418 } long_ad __packed;
420 /* NOTE: This is here for completeness
421 * ext_ad structures ARE NOT USED in UDF <= 2.60
423 typedef struct ext_ad {
424 Uint32 ExtentLength;
425 Uint32 RecordedLength;
426 Uint32 InformationLength;
427 lb_addr ExtentLocation;
428 UBYTE ImplementationUse[2];
429 } ext_ad __packed;
431 #define UDF_TAG_FILE_SET 256
432 #define UDF_TAG_FILE_IDENTIFIER 257
433 #define UDF_TAG_ALLOCATION_EXTENT 258
434 #define UDF_TAG_INDIRECT_ENTRY 259
435 #define UDF_TAG_TERMINAL_ENTRY 260
436 #define UDF_TAG_FILE_ENTRY 261
437 #define UDF_TAG_EXTENDED_ATTRIBUTE 262
438 #define UDF_TAG_UNALLOCATED_SPACE 263
439 #define UDF_TAG_SPACE_BITMAP 264
440 #define UDF_TAG_PARTITION_INTEGRITY 265
441 #define UDF_TAG_EXTENDED_FILE 266
443 // ECMA-167 4/14.1
444 struct udfFileSet {
445 tag Tag;
446 timestamp RecordingDateandTime;
447 Uint16 InterchangeLevel;
448 Uint16 MaximumInterchangeLevel;
449 Uint32 CharacterSetList;
450 Uint32 MaximumCharacterSetList;
451 Uint32 FileSetNumber;
452 Uint32 FileSetDescriptorNumber;
453 charspec LogicalVolumeIdentifierCharacterSet;
454 union {
455 dstring LogicalVolumeIdentifier;
456 UBYTE LogicalVolumeIdentifier_[128];
458 charspec FileSetCharacterSet;
459 union {
460 dstring Identifier;
461 UBYTE Identifier_[32];
463 union {
464 dstring CopyrightFileIdentifier;
465 UBYTE CopyrightFileIdentifier_[32];
467 union {
468 dstring AbstractFileIdentifier;
469 UBYTE AbstractFileIdentifier_[32];
471 long_ad RootDirectoryICB;
472 regid DomainIdentifier;
473 long_ad NextExtent;
474 UBYTE Reserved[48];
475 } __packed;
477 // ECMA-167 4/14.3
478 struct udfPartitionHeader {
479 short_ad UnallocatedSpaceTable;
480 short_ad UnallocatedSpaceBitmap;
481 short_ad PartitionIntegrityTable;
482 short_ad FreedSpaceTable;
483 short_ad FreedSpaceBitmap;
484 UBYTE Reserved[88];
485 } __packed;
487 // ECMA-167 4/14.4
488 struct udfFileIdentifier {
489 tag Tag;
490 Uint16 FileVersionNumber;
491 Uint8 FileCharacteristics;
492 #define UDF_FILEID_FLAGS_HIDDEN (1 << 0)
493 #define UDF_FILEID_FLAGS_DIRECTORY (1 << 1)
494 #define UDF_FILEID_FLAGS_DELETED (1 << 2)
495 #define UDF_FILEID_FLAGS_PARENT (1 << 3)
496 #define UDF_FILEID_FLAGS_METADATA (1 << 4)
497 Uint8 FileIdentifierLength; /* L_FI */
498 long_ad ICB;
499 Uint16 ImplementationUseLength; /* L_IU */
500 UBYTE Data[0]; /* L_IU + L_FI */
501 } __packed;
503 // ECMA-167 4/14.5
504 struct udfAllocationExtent {
505 tag Tag;
506 Uint32 PreviousAllocationExtentLocation; // Must be 0
507 Uint32 AllocationDescriptorLength;
508 // allocation descriptors follow
509 } __packed;
511 // ECMA-167 4/14.6
512 typedef struct icbtag {
513 Uint32 PriorRecordedNumberofDirectEntries;
514 Uint16 StrategyType;
515 #define UDF_ICBTAG_STRATEGY_1 // ECMA-167 4/A.2 Unused in UDF
516 #define UDF_ICBTAG_STRATEGY_2 // ECMA-167 4/A.3 Unused in UDF
517 #define UDF_ICBTAG_STRATEGY_3 // ECMA-167 4/A.4 Unused in UDF
518 #define UDF_ICBTAG_STRATEGY_4 // ECMA-167 4/A.5 UDF <= 2.60
519 #define UDF_ICBTAG_STRATEGY_4096 // UDF specific
520 UBYTE StrategyParameter[2];
521 Uint16 NumberofEntries;
522 UBYTE Reserved[1];
523 Uint8 FileType;
524 #define UDF_FILETYPE_UNALLOCATED_SPACE 1
525 #define UDF_FILETYPE_PARTITION_INTEGRITY 2
526 #define UDF_FILETYPE_INDIRECT_ENTRY 3
527 #define UDF_FILETYPE_DIRECTORY 4
528 #define UDF_FILETYPE_FILE 5
529 #define UDF_FILETYPE_DEVICE_BLOCK 6
530 #define UDF_FILETYPE_DEVICE_CHAR 7
531 #define UDF_FILETYPE_EXTENDED_ATTRIBUTE 8
532 #define UDF_FILETYPE_DEVICE_FIFO 9
533 #define UDF_FILETYPE_DEVICE_SOCKET 10
534 #define UDF_FILETYPE_TERMINAL_ENTRY 11
535 #define UDF_FILETYPE_SYMLINK 12
536 #define UDF_FILETYPE_STREAM_DIRECTORY 13
537 lb_addr ParentICBLocation;
538 Uint16 Flags;
539 #define UDF_ICBTAG_FLAGS_ALLOCTYPE_of(x) ((x) & 7)
540 #define UDF_ALLOCTYPE_SHORT_AD 0
541 #define UDF_ALLOCTYPE_LONG_AD 1
542 #define UDF_ALLOCTYPE_EXTENDED_AD 2 // NOT USED IN UDF!
543 #define UDF_ALLOCTYPE_TINY 3
544 #define UDF_ICBTAG_FLAGS_DIRECTORY_SORT (1 << 3)
545 #define UDF_ICBTAG_FLAGS_NON_RELOCATABLE (1 << 4)
546 #define UDF_ICBTAG_FLAGS_ARCHIVE (1 << 5)
547 #define UDF_ICBTAG_FLAGS_SETUID (1 << 6)
548 #define UDF_ICBTAG_FLAGS_SETGID (1 << 7)
549 #define UDF_ICBTAG_FLAGS_STICKY (1 << 8)
550 #define UDF_ICBTAG_FLAGS_CONTIGUOUS (1 << 9)
551 #define UDF_ICBTAG_FLAGS_SYSTEM (1 << 10)
552 #define UDF_ICBTAG_FLAGS_TRANSFORMED (1 << 11)
553 #define UDF_ICBTAG_FLAGS_MULTIVERSION (1 << 12)
554 #define UDF_ICBTAG_FLAGS_STREAM (1 << 13)
555 } icbtag __packed;
557 // ECMA-167 4/14.7
558 struct udfICBIndirect {
559 tag Tag;
560 icbtag ICBTag;
561 long_ad IndirectICB;
562 } __packed;
564 // ECMA-167 4/14.8
565 struct udfICBTerminal {
566 tag Tag;
567 icbtag ICBTag;
568 } __packed;
570 // ECMA-167 4/14.9
571 struct udfICBFileEntry {
572 tag Tag;
573 icbtag ICBTag;
574 Uint32 Uid;
575 Uint32 Gid;
576 Uint32 Permissions;
577 #define UDF_FILEPERM_OX (1 << 0)
578 #define UDF_FILEPERM_OW (1 << 1)
579 #define UDF_FILEPERM_OR (1 << 2)
580 #define UDF_FILEPERM_OA (1 << 3)
581 #define UDF_FILEPERM_OD (1 << 4)
582 #define UDF_FILEPERM_GX (1 << 5)
583 #define UDF_FILEPERM_GW (1 << 6)
584 #define UDF_FILEPERM_GR (1 << 7)
585 #define UDF_FILEPERM_GA (1 << 8)
586 #define UDF_FILEPERM_GD (1 << 9)
587 #define UDF_FILEPERM_UX (1 << 10)
588 #define UDF_FILEPERM_UW (1 << 11)
589 #define UDF_FILEPERM_UR (1 << 12)
590 #define UDF_FILEPERM_UA (1 << 13)
591 #define UDF_FILEPERM_UD (1 << 14)
592 Uint16 FileLinkCount;
593 Uint8 RecordFormat;
594 #define UDF_RECORDFORMAT_BIN 0 /* We only support this for now */
595 Uint8 RecordDisplayAttributes;
596 #define UDF_RECORDATTR_BIN 0 /* We only support this for now */
597 Uint32 RecordLength;
598 Uint64 InformationLength;
599 Uint64 LogicalBlocksRecorded;
600 timestamp AccessTime;
601 timestamp ModificationTime;
602 timestamp AttributeTime;
603 Uint32 Checkpoint;
604 long_ad ExtendedAttributeICB;
605 regid ImplementationIdentifier;
606 Uint64 UniqueId;
607 Uint32 ExtendedAttributeLength; // L_EA
608 Uint32 AllocationDescriptorLength; // L_AD
609 UBYTE Data[0]; // L_EA + L_AD
610 } __packed;
612 // ECMA-167 4/14.10 - Extended Attributes are ignored
614 // ECMA-167 4/14.11 - Unallocated Space
615 struct udfICBUnallocatedSpace {
616 tag Tag;
617 icbtag ICBTag;
618 Uint32 AllocationDescriptorLength; // L_AD
619 UBYTE Data[0]; // L_AD
620 } __packed;
622 // ECMA-167 4/14.12 - Space Bitmap Descriptor
623 struct udfSpaceBitmap {
624 tag Tag;
625 Uint32 Bits; // N_BT
626 Uint32 Bytes; // N_B
627 UBYTE Bitmap[0]; // N_B
628 } __packed;
630 // ECMA-167 4/14.13 - Partition Integrity
631 struct udfICBPartitionIntegrity {
632 tag Tag;
633 icbtag ICBTag;
634 timestamp RecordingTime;
635 Uint8 IntegrityType;
636 #define UDF_PARTITIONINTEGRITY_OPEN 0
637 #define UDF_PARTITIONINTEGRITY_CLOSE 1
638 #define UDF_PARTITIONINTEGRITY_STABLE 2
639 UBYTE Reserved[175];
640 regid ImplementationIdentifier;
641 UBYTE ImplementationUse[256];
642 } __packed;
644 // ECMA-167 4/14.16 - Pathname
645 struct udfPathComponent {
646 Uint8 Type;
647 #define UDF_PATHTYPE_ROOT 1
648 #define UDF_PATHTYPE_ROOT_OF 2 /* ":" */
649 #define UDF_PATHTYPE_PARENT_OF 3 /* "/" */
650 #define UDF_PATHTYPE_DIR_OF 4 /* "" */
651 #define UDF_PATHTYPE_FILE 5
652 Uint8 IdentifierLength; // L_CI
653 Uint16 FileVersion; // Shall be 0
654 UBYTE Identifier[0]; // L_CI bytes
655 } __packed;
657 #endif /* UDF_H */