2 * Copyright (C) 2013, The AROS Development Team
4 * Author: Jason S. McMullan <jason.mcmullan@gmail.com>
6 * Licensed under the AROS PUBLIC LICENSE (APL) Version 1.1
12 #include <exec/types.h>
13 #include <dos/filehandler.h>
16 #define __packed __attribute__((__packed__))
20 typedef TEXT strA
; /* ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_
23 typedef TEXT strD
; /* ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_ */
24 typedef struct { ULONG LSB
; ULONG MSB
; } int32LM
;
25 typedef struct { UWORD LSB
; UWORD MSB
;} int16LM
;
38 int8 TimeZone
; /* 0 = GMT-12, 1 = GMT-11:45, 2 = GMT-11:30, etc */
42 int8 Years
; /* 1900 + Year */
43 int8 Month
; /* Base 1 */
44 int8 Day
; /* Base 1 */
45 int8 Hour
; /* Base 0 */
46 int8 Minute
; /* Base 0 */
47 int8 Second
; /* Base 0 */
48 int8 TimeZone
; /* 0 = GMT-12, 1 = GMT-11:45, 2 = GMT-11:30, etc */
53 #define ISO_Volume_Boot 0
54 #define ISO_Volume_Primary 1
55 #define ISO_Volume_Supplementary 2
56 #define ISO_Volume_Partition 3
57 #define ISO_Volume_Terminator 255
62 struct isoVolumeBoot
{
63 strA BootSystemIdentifier
[32];
64 strA BootIdentifier
[32];
65 UBYTE BootSystemUse
[1977];
67 struct isoVolumePrimary
{
69 strA SystemIdentifier
[32];
70 strD VolumeIdentifier
[32];
72 int32LM VolumeSpaceSize
;
74 int16LM VolumeSetSize
;
75 int16LM VolumeSequenceNumber
;
76 int16LM LogicalBlockSize
;
77 int32LM PathTableSize
;
78 int32L TypeLPathTable
;
79 int32L TypeLOptionalPathTable
;
80 int32M TypeMPathTable
;
81 int32M TypeMOptionalPathTable
;
82 UBYTE RootDirectoryEntry
[34];
83 strD VolumeSetIdentifier
[128];
84 strA PublisherIdentifier
[128];
85 strA DataPreparerIdentifier
[128];
86 strA ApplicationIdentifier
[128];
87 strD CopyrightFileIdentifier
[38];
88 strD AbstractFileIdentifier
[36];
89 strD BibliographicFileIdentifier
[37];
90 ascDate VolumeCreation
;
91 ascDate VolumeModification
;
92 ascDate VolumeExpiration
;
93 ascDate VolumeEffective
;
94 int8 FileStructureVersion
;
96 UBYTE Application
[512];
100 } __packed Terminator
;
104 struct isoPathTable
{
105 int8 DirectoryIdentifierLength
;
106 int8 ExtendedAttributeLength
;
107 int32 ExtentLocation
; /* LBA */
108 int16 ParentDirectory
;
109 strD DirectoryIdentifier
[0]; /* Padded to an even number */
112 struct isoDirectory
{
113 int8 DirectoryLength
;
114 int8 ExtendedAttributeLength
;
115 int32LM ExtentLocation
; /* LBA */
116 int32LM DataLength
; /* In bytes */
117 binDate RecordingDate
;
119 #define ISO_Directory_HIDDEN (1 << 0) /* Hidden file */
120 #define ISO_Directory_ISDIR (1 << 1) /* Is a directrory node */
121 #define ISO_Directory_ASSOC (1 << 2) /* Associated File */
122 #define ISO_Directory_EXTFORMAT (1 << 3) /* Extended Attribute has format info */
123 #define ISO_Directory_EXTPERM (1 << 4) /* Extended Attribute has permission info */
124 #define ISO_Directory_CONTINUED (1 << 5) /* File continued in another entry */
127 int16LM VolumeSequence
;
128 int8 FileIdentifierLength
;
129 strD FileIdentifier
[0]; /* Padded to an even length */
130 /* System Use area follows the FileIdentifier */
133 /* Rock-Ridge and Amiga extensions */
136 int16 Signature
; /* Always treat as MSB */
140 #define RR_SystemUse_SP 0x5350 /* System Use Sharing Protocol */
141 #define RR_SystemUse_SP_VERSION 1
143 UBYTE CheckBytes
[2]; /* 0xBE 0xEF */
146 #define RR_SystemUse_ST 0x5354 /* System Use Sharing Termination */
147 #define RR_SystemUse_ST_VERSION 1
150 #define RR_SystemUse_CE 0x4345 /* Continuation Entry */
151 #define RR_SystemUse_CE_VERSION 1
157 #define RR_SystemUse_ER 0x4552 /* Extension Reference */
158 #define RR_SystemUse_ER_VERSION 1
160 int8 IdentifierLength
; /* LEN_ID */
161 int8 DescriptorLength
; /* LEN_DES */
162 int8 SourceLength
; /* LEN_SRC */
163 int8 ExtensionVersion
; /* EXT_VER */
164 UBYTE Data
[0]; /* LEN_ID + LEN_DES + LEN_SRC */
166 #define RR_SystemUse_AS 0x4153 /* Amiga */
167 #define RR_SystemUse_AS_VERSION 1
170 #define RR_AS_PROTECTION (1 << 0) /* Protection bits present */
171 #define RR_AS_COMMENT (1 << 1) /* Comment field present */
172 #define RR_AS_COMMENT_CONTINUE (1 << 2) /* Comment continues in next SUA */
175 #define RR_SystemUse_RR 0x5252 /* RockRidge capabilities */
176 #define RR_SystemUse_RR_VERSION 1
179 #define RR_RR_FLAGS_PX (1 << 0) /* PX Flag is valid */
180 #define RR_RR_FLAGS_PN (1 << 0) /* PX Flag is valid */
181 #define RR_RR_FLAGS_SL (1 << 0) /* PX Flag is valid */
182 #define RR_RR_FLAGS_NM (1 << 0) /* PX Flag is valid */
183 #define RR_RR_FLAGS_CL (1 << 0) /* PX Flag is valid */
184 #define RR_RR_FLAGS_PL (1 << 0) /* PX Flag is valid */
185 #define RR_RR_FLAGS_RE (1 << 0) /* PX Flag is valid */
186 #define RR_RR_FLAGS_TF (1 << 0) /* PX Flag is valid */
188 #define RR_SystemUse_PX 0x5058 /* POSIX */
189 #define RR_SystemUse_PX_VERSION 1
192 #define S_IRUSR 0000400
193 #define S_IWUSR 0000200
194 #define S_IXUSR 0000100
195 #define S_IRGRP 0000040
196 #define S_IWGRP 0000020
197 #define S_IXGRP 0000010
198 #define S_IROTH 0000004
199 #define S_IWOTH 0000002
200 #define S_IXOTH 0000001
201 #define S_ISUID 0004000
202 #define S_ISGID 0002000
203 #define S_ENFMT 0002000
204 #define S_ISVTX 0001000
205 #define S_IFSOCK 0140000
206 #define S_IFLINK 0120000
207 #define S_IFREG 0100000
208 #define S_IFBLK 0060000
209 #define S_IFCHR 0020000
210 #define S_IFDIR 0040000
211 #define S_IFIFO 0010000
217 #define RR_SystemUse_PN 0x504e
218 #define RR_SystemUse_PN_VERISON 1
223 #define RR_SystemUse_SL 0x534c
224 #define RR_SystemUse_SL_VERSION 1
227 #define RR_SL_CONTINUE (1 << 0)
230 struct rrSL_Component
{
232 #define RR_SL_COMPONENT_CONTINUE (1 << 0)
233 #define RR_SL_COMPONENT_CURRENT (1 << 1)
234 #define RR_SL_COMPONENT_PARENT (1 << 2)
235 #define RR_SL_COMPONENT_ROOT (1 << 3)
236 #define RR_SL_COMPONENT_VOLUME (1 << 4) /* Obsolete */
237 #define RR_SL_COMPONENT_HOSTNAME (1 << 5) /* Obsolete */
240 } __packed SL_Component
;
243 #define RR_SystemUse_NM 0x4e4d
244 #define RR_SystemUse_NM_VERSION 1
247 #define RR_NM_COMPONENT_CONTINUE (1 << 0)
248 #define RR_NM_COMPONENT_CURRENT (1 << 1)
249 #define RR_NM_COMPONENT_PARENT (1 << 2)
252 #define RR_SystemUse_CL 0x434c
253 #define RR_SystemUse_CL_VERSION 1
255 int32LM ChildDirectory
; /* LBA */
257 #define RR_SystemUse_PL 0x504c
258 #define RR_SystemUse_PL_VERSION 1
260 int32LM ParentDirectory
; /* LBA */
262 #define RR_SystemUse_RE 0x524c
263 #define RR_SystemUse_RE_VERSION 1
266 #define RR_SystemUse_TF 0x5446
267 #define RR_SystemUse_TF_VERSION 1
270 #define RR_TF_CREATION (1 << 0)
271 #define RR_TF_MODIFY (1 << 1)
272 #define RR_TF_ACCESS (1 << 2)
273 #define RR_TF_ATTRIBUTES (1 << 3)
274 #define RR_TF_BACKUP (1 << 4)
275 #define RR_TF_EXPIRATION (1 << 5)
276 #define RR_TF_EFFECTIVE (1 << 6)
277 #define RR_TF_LONG_FORM (1 << 7)
278 UBYTE Data
[]; /* Array of ascDate or binDate format */
280 #define RR_SystemUse_SF 0x5346
281 #define RR_SystemUse_SF_VERSION 1
283 int32LM st_size_High
;
291 struct rrSparseFileTable
{
292 int32LM TableEntry
[256];
293 #define RR_SFT_BLOCK(x) ((x) & 0x00ffffff) /* LBA */
294 #define RR_SFT_TABLE (1 << 30)
295 #define RR_SFT_EMPTY (1 << 31)
300 struct SystemUseASProtection
{
307 struct SystemUseASComment
{
312 extern const struct CDFSOps ISO9660_Ops
;
314 #endif /* ISO9660_H */