The Pedigree Project 0.1
iso9660.h
1/*
2 * Copyright (c) 2008-2014, Pedigree Developers
3 *
4 * Please see the CONTRIB file in the root of the source tree for a full
5 * list of contributors.
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19
20#ifndef ISO9660_H
21#define ISO9660_H
22
23#include "pedigree/kernel/processor/types.h"
24#include "pedigree/kernel/utilities/PointerGuard.h"
25
29 uint8_t Year[4];
30 uint8_t Month[2];
31 uint8_t Day[2];
32 uint8_t Hour[2];
33 uint8_t Minute[2];
34 uint8_t Second[2];
35 uint8_t CentiSeconds[2];
36 uint8_t Offset;
37} __attribute__((packed));
38
40 uint8_t Year;
41 uint8_t Month;
42 uint8_t Day;
43 uint8_t Hour;
44 uint8_t Minute;
45 uint8_t Second;
46 uint8_t Offset;
47} __attribute__((packed));
48
50 uint8_t Type;
51 uint8_t Ident[5];
52 uint8_t Version;
53} __attribute__((packed));
54
57
58 uint8_t Unused1;
59
60 uint8_t SysIdent[32];
61 uint8_t VolIdent[32];
62
63 uint8_t Unused2[8];
64
65 uint32_t VolSpaceSize_LE; // little-endian
66 uint32_t VolSpaceSize_BE; // big-endian
67
68 uint8_t Unused3_EscSequences[32]; // Supplementary descriptors use this field
69
70 uint16_t VolSetSize_LE;
71 uint16_t VolSetSize_BE;
72
73 uint16_t VolSeqNum_LE;
74 uint16_t VolSeqNum_BE;
75
76 uint16_t LogicalBlockSize_LE;
77 uint16_t LogicalBlockSize_BE;
78
79 uint32_t PathTableSize_LE;
80 uint32_t PathTableSize_BE;
81
82 uint32_t TypeLPathTableOccurence;
83 uint32_t TypeLPathTableOptionOccurence;
84 uint32_t TypeMPathTableOccurence;
85 uint32_t TypeMPathTableOptionOccurence;
86
87 uint8_t RootDirRecord[34];
88
89 uint8_t VolSetIdent[128];
90 uint8_t PublisherIdent[128];
91 uint8_t DataPreparerIdent[128];
92 uint8_t ApplicationIdent[128];
93 uint8_t CopyrightFileIdent[37];
94 uint8_t AbstractFileIdent[37];
95 uint8_t BiblioFileIdent[37];
96
97 Iso9660Timestamp VolumeCreationTime;
98 Iso9660Timestamp VolumeModificationTime;
99 Iso9660Timestamp VolumeExpiryTime;
100 Iso9660Timestamp VolumeEffectiveTime;
101
102 uint8_t FileStructVersion;
103
104 uint8_t Rsvd1;
105
106 uint8_t ApplicationUse[512];
107
108 uint8_t Rsvd2[653];
109} __attribute__((packed));
110
112 uint8_t RecLen;
113
114 uint8_t ExtAttrRecordLen;
115
116 uint32_t ExtentLocation_LE;
117 uint32_t ExtentLocation_BE;
118
119 uint32_t DataLen_LE;
120 uint32_t DataLen_BE;
121
123
124 uint8_t FileFlags;
125 uint8_t FileUnitSize;
126 uint8_t InterleaveGapSize;
127
128 uint16_t VolSeqNum_LE;
129 uint16_t VolSeqNum_BE;
130
131 uint8_t FileIdentLen;
132} __attribute__((packed));
133
135#define PRIM_VOL_DESC 1
136#define SUPP_VOL_DESC 2
137#define TERM_VOL_DESC 255
138
140String WideToMultiByteStr(uint8_t* in, size_t inLen, size_t maxLen);
141
142#endif