Added iso9660 driver (not yet working).
[planlOS.git] / system / modules / iso9660 / directory_record.h
blob0d9d6c94074ff6b99de20e805900270f72c432eb
1 /*
2 * iso9660 - An iso9660 CDI driver with Rockridge support
4 * Copyright (C) 2008 Janosch Gräf
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 3 of the License, or (at your option)
9 * any later version.
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, see <http://www.gnu.org/licenses/>.
20 #ifndef _DIRECTORY_RECORD_H_
21 #define _DIRECTORY_RECORD_H_
23 #include <stdint.h>
25 // Date from ISO9660 directory entry
26 struct iso9660_dirrec_date {
27 // Number of years since 1900
28 uint8_t year;
30 // Month (1=January, 2=February)
31 uint8_t month;
33 // Day of month
34 uint8_t day;
36 // Hour
37 uint8_t hour;
39 // Minute
40 uint8_t minute;
42 // Second
43 uint8_t second;
45 // GMT offset (in 15min intervals)
46 int8_t gmtoff;
47 } __attribute__ ((packed));
49 #define ISO9660_DIRREC_HIDDEN 1
50 #define ISO9660_DIRREC_DIR 2
51 #define ISO9660_DIRREC_ASSOC 4
52 #define ISO9660_DIRREC_RECFMT 8
53 #define ISO9660_DIRREC_PERM 16
54 #define ISO9660_DIRREC_NOTFINAL 128
56 // ISO9660 directory entry
57 struct iso9660_dirrec {
58 // Size of this record (must be even)
59 uint8_t record_size;
61 // Number of sectors in extended attribute record
62 uint8_t num_sectors_extattrrec;
64 // First sector for file/directory data (0 if empty)
65 uint32_t data_sector;
66 uint32_t data_sector_be;
68 // File/directory data size
69 uint32_t data_size;
70 uint32_t data_size_be;
72 // Date of creation
73 struct iso9660_dirrec_date date_creation;
75 // File flags
76 uint8_t flags;
78 // Unit size for interleaved files (should be 0)
79 uint8_t interleaved_unit_size;
81 // Gap size for interleaved files (should be 0)
82 uint8_t interleaved_gap_size;
84 // Volume sequence number
85 uint16_t volume_seq;
86 uint16_t volume_seq_be;
88 // Identifier length
89 uint8_t identifier_length;
91 // Identifier
92 uint8_t identifier[1];
93 } __attribute__ ((packed));
95 #endif