revert between 56095 -> 55830 in arch
[AROS.git] / rom / filesys / CDVDFS / src / iso9660.h
blobd4c678bb7d5f4c236074cfd8a6781e5670f234a7
1 /* iso9660.h: */
3 #ifndef _ISO9660_H_
4 #define _ISO9660_H_
6 #include "generic.h"
7 #ifdef __AROS__
8 #include <aros/macros.h>
9 #else
10 #define AROS_BIG_ENDIAN 1
11 #endif
13 typedef struct directory_record {
14 unsigned char length;
15 unsigned char ext_attr_length;
16 #if !AROS_BIG_ENDIAN
17 uint32_t extent_loc;
18 uint32_t extent_loc_m;
19 #else
20 uint32_t extent_loc_i;
21 uint32_t extent_loc;
22 #endif
23 #if !AROS_BIG_ENDIAN
24 uint32_t data_length;
25 uint32_t data_length_m;
26 #else
27 uint32_t data_length_i;
28 uint32_t data_length;
29 #endif
30 unsigned char year;
31 unsigned char month;
32 unsigned char day;
33 unsigned char hour;
34 unsigned char minute;
35 unsigned char second;
36 char tz;
37 unsigned char flags;
38 unsigned char file_unit_size;
39 unsigned char gap_size;
40 #if !AROS_BIG_ENDIAN
41 unsigned short sequence;
42 unsigned short sequence_m;
43 #else
44 unsigned short sequence_i;
45 unsigned short sequence;
46 #endif
47 unsigned char file_id_length;
48 char file_id[1];
49 } __attribute__((packed) )directory_record;
51 /* Some of file flags we use */
52 #define FILE_FLAG_HIDDEN 0x01
53 #define FILE_FLAG_DIRECTORY 0x02
54 #define FILE_FLAG_ASSOCIATED 0x04
56 typedef char time_and_date[17];
58 typedef struct prim_vol_desc {
59 unsigned char type;
60 char id[5];
61 unsigned char version;
62 char pad1;
63 char system_id[32];
64 char volume_id[32];
65 char pad2[8];
66 #if !AROS_BIG_ENDIAN
67 uint32_t space_size;
68 uint32_t space_size_m;
69 #else
70 uint32_t space_size_i;
71 uint32_t space_size;
72 #endif
73 char pad3[32];
74 #if !AROS_BIG_ENDIAN
75 unsigned short set_size;
76 unsigned short set_size_m;
77 #else
78 unsigned short set_size_i;
79 unsigned short set_size;
80 #endif
81 #if !AROS_BIG_ENDIAN
82 unsigned short sequence;
83 unsigned short sequence_m;
84 #else
85 unsigned short sequence_i;
86 unsigned short sequence;
87 #endif
88 #if !AROS_BIG_ENDIAN
89 unsigned short block_size;
90 unsigned short block_size_m;
91 #else
92 unsigned short block_size_i;
93 unsigned short block_size;
94 #endif
95 #if !AROS_BIG_ENDIAN
96 uint32_t path_size;
97 uint32_t path_size_m;
98 #else
99 uint32_t path_size_i;
100 uint32_t path_size;
101 #endif
102 #if !AROS_BIG_ENDIAN
103 uint32_t table;
104 uint32_t opt_table;
105 uint32_t m_table;
106 uint32_t opt_m_table;
107 #else
108 uint32_t i_table;
109 uint32_t opt_i_table;
110 uint32_t table;
111 uint32_t opt_table;
112 #endif
113 directory_record root;
114 char volume_set_id[128];
115 char publisher_id[128];
116 char data_preparer[128];
117 char application_id[128];
118 char copyright[37];
119 char abstract_file_id[37];
120 char bibliographic_id[37];
121 time_and_date vol_creation;
122 time_and_date vol_modification;
123 time_and_date vol_expiration;
124 time_and_date vol_effective;
125 unsigned char file_structure_version;
126 char pad4;
127 char application_use[512];
128 char reserved[653];
129 } prim_vol_desc;
131 /* for internal use only: */
133 typedef struct iso_vol_info {
134 prim_vol_desc pvd;
135 int skip;
136 unsigned short blockshift;
137 } t_iso_vol_info;
139 typedef struct iso_obj_info {
140 directory_record *dir;
141 uint32_t parent_loc; /* for files only */
142 } t_iso_obj_info;
144 t_bool Iso_Init_Vol_Info(VOLUME *p_volume, int p_skip, t_ulong p_offset, t_ulong svd_offset);
145 t_bool Uses_Iso_Protocol(CDROM *p_cdrom, t_ulong *p_offset);
146 t_bool Uses_High_Sierra_Protocol(CDROM *p_cdrom);
147 directory_record *Get_Directory_Record
148 (VOLUME *p_volume, uint32_t p_location, uint32_t p_offset);
149 CDROM_OBJ *Iso_Create_Directory_Obj(VOLUME *p_volume, uint32_t p_location);
151 #if !AROS_BIG_ENDIAN
152 #define l_table m_table
153 #define opt_l_table opt_m_table
154 #else
155 #define l_table i_table
156 #define opt_l_table opt_i_table
157 #endif
159 #endif /* _ISO9660_H_ */