xorriso  1.5.4.pl02
About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.
  Fossies Dox: xorriso-1.5.4.pl02.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

hfsplus.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 Vladimir Serbinenko
3  *
4  * This file is part of the libisofs project; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License version 2
6  * or later as published by the Free Software Foundation.
7  * See COPYING file for details.
8  */
9 
10 /**
11  * Declare HFS+ related structures.
12  */
13 
14 #ifndef LIBISO_HFSPLUS_H
15 #define LIBISO_HFSPLUS_H
16 
17 #include "libisofs.h"
18 #include "ecma119.h"
19 
20 #define LIBISO_HFSPLUS_NAME_MAX 255
21 
22 
28 };
29 
31 {
32  uint32_t start;
33  uint32_t cnt;
34  uint32_t strlen;
35  uint16_t *str;
36  uint32_t parent_id;
37 };
38 
40 {
41  uint32_t level_size;
43 };
44 
46 {
47  /* Note: .type HFSPLUS_DIR_THREAD and HFSPLUS_FILE_THREAD do not own their
48  .name and .cmp_name. They have copies of others, if ever.
49  */
50  uint16_t *name; /* Name in UTF-16BE, decomposed. */
51  uint16_t *cmp_name; /* Name used for comparing. */
52 
53  IsoNode *node; /*< reference to the iso node */
54 
56  uint32_t symlink_block;
57  char *symlink_dest;
58 
61  uint32_t cat_id;
62  uint32_t parent_id;
63  uint32_t nchildren;
64 
65  uint32_t strlen;
66  uint32_t used_size;
67 };
68 
71 
73 {
74  /* The first block of a file on disk. */
75  uint32_t start;
76  /* The amount of blocks described by this extent. */
77  uint32_t count;
78 } __attribute__ ((packed));
79 
81 {
82  uint64_t size;
83  uint32_t clumpsize;
84  uint32_t blocks;
85  struct hfsplus_extent extents[8];
86 } __attribute__ ((packed));
87 
89 {
90  uint16_t magic;
91  uint16_t version;
92  uint32_t attributes;
94  uint32_t journal;
95  uint32_t ctime;
96  uint32_t utime;
97  uint32_t backup_time;
98  uint32_t fsck_time;
99  uint32_t file_count;
100  uint32_t folder_count;
101  uint32_t blksize;
102  uint32_t total_blocks;
103  uint32_t free_blocks;
104  uint32_t next_allocation;
105  uint32_t rsrc_clumpsize;
106  uint32_t data_clumpsize;
107  uint32_t catalog_node_id;
108  uint32_t write_count;
110  uint32_t ppc_bootdir;
111  uint32_t intel_bootfile;
112  /* Folder opened when disk is mounted. */
113  uint32_t showfolder;
114  uint32_t os9folder;
115  uint32_t unused;
116  uint32_t osxfolder;
117  uint64_t num_serial;
123 } __attribute__ ((packed));
124 
126 {
127  uint32_t next;
128  uint32_t prev;
129  int8_t type;
130  uint8_t height;
131  uint16_t count;
132  uint16_t unused;
133 } __attribute__ ((packed));
134 
135 /* The header of a HFS+ B+ Tree. */
137 {
138  uint16_t depth;
139  uint32_t root;
140  uint32_t leaf_records;
141  uint32_t first_leaf_node;
142  uint32_t last_leaf_node;
143  uint16_t nodesize;
144  uint16_t keysize;
145  uint32_t total_nodes;
146  uint32_t free_nodes;
147  uint16_t reserved1;
148  uint32_t clump_size;
149  uint8_t btree_type;
150  uint8_t key_compare;
151  uint32_t attributes;
152  uint32_t reserved[16];
153 } __attribute__ ((packed));
154 
156 {
157  uint16_t type;
158  uint16_t reserved;
159  uint32_t parentid;
160  uint16_t namelen;
161 } __attribute__ ((packed));
162 
164 {
165  uint16_t type;
166  uint16_t flags;
167  uint32_t valence; /* for files: reserved. */
168  uint32_t fileid;
169  uint32_t ctime;
170  uint32_t mtime;
171  uint32_t attr_mtime;
172  uint32_t atime;
173  uint32_t backup_time;
174  uint32_t uid;
175  uint32_t gid;
176  uint8_t user_flags;
177  uint8_t group_flags;
178  uint16_t mode;
179  uint32_t special;
180  uint8_t file_type[4]; /* For folders: window size */
181  uint8_t file_creator[4]; /* For folders: window size */
182  uint8_t finder_info[24];
183  uint32_t text_encoding;
184  uint32_t reserved;
185 } __attribute__ ((packed));
186 
187 #define HFSPLUS_MAX_DECOMPOSE_LEN 4
188 
189 extern uint16_t (*hfsplus_decompose_pages[256])[HFSPLUS_MAX_DECOMPOSE_LEN + 1];
191 
192 extern uint16_t *hfsplus_class_pages[256];
194 
195 extern const uint16_t hfsplus_casefold[];
196 
197 int iso_get_hfsplus_name(char *input_charset, int imgid, char *name,
198  uint16_t **result, uint32_t *result_len, uint16_t **cmp_name);
199 
201 
202 #endif /* LIBISO_HFSPLUS_H */
void iso_setup_hfsplus_block_size(Ecma119Image *target)
Definition: hfsplus.c:1582
uint16_t * hfsplus_class_pages[256]
int hfsplus_writer_create(Ecma119Image *target)
Definition: hfsplus.c:1590
void make_hfsplus_class_pages()
hfsplus_node_type
Definition: hfsplus.h:23
@ HFSPLUS_FILE_THREAD
Definition: hfsplus.h:27
@ HFSPLUS_DIR_THREAD
Definition: hfsplus.h:26
@ HFSPLUS_DIR
Definition: hfsplus.h:24
@ HFSPLUS_FILE
Definition: hfsplus.h:25
void make_hfsplus_decompose_pages()
#define HFSPLUS_MAX_DECOMPOSE_LEN
Definition: hfsplus.h:187
const uint16_t hfsplus_casefold[]
int hfsplus_tail_writer_create(Ecma119Image *target)
Definition: hfsplus.c:1817
uint16_t(*[256] hfsplus_decompose_pages)[4+1]
int iso_get_hfsplus_name(char *input_charset, int imgid, char *name, uint16_t **result, uint32_t *result_len, uint16_t **cmp_name)
Definition: hfsplus.c:118
Definition: node.h:100
uint16_t nodesize
Definition: hfsplus.h:143
uint32_t root
Definition: hfsplus.h:139
uint32_t attributes
Definition: hfsplus.h:151
uint16_t depth
Definition: hfsplus.h:138
uint32_t leaf_records
Definition: hfsplus.h:140
uint32_t first_leaf_node
Definition: hfsplus.h:141
uint32_t reserved[16]
Definition: hfsplus.h:152
uint16_t reserved1
Definition: hfsplus.h:147
uint32_t total_nodes
Definition: hfsplus.h:145
uint32_t last_leaf_node
Definition: hfsplus.h:142
uint8_t key_compare
Definition: hfsplus.h:150
uint32_t free_nodes
Definition: hfsplus.h:146
uint16_t keysize
Definition: hfsplus.h:144
uint8_t btree_type
Definition: hfsplus.h:149
uint32_t clump_size
Definition: hfsplus.h:148
uint8_t height
Definition: hfsplus.h:130
uint32_t prev
Definition: hfsplus.h:128
int8_t type
Definition: hfsplus.h:129
uint16_t count
Definition: hfsplus.h:131
uint32_t next
Definition: hfsplus.h:127
uint16_t unused
Definition: hfsplus.h:132
struct hfsplus_btree_node * nodes
Definition: hfsplus.h:42
uint32_t level_size
Definition: hfsplus.h:41
uint32_t strlen
Definition: hfsplus.h:34
uint16_t * str
Definition: hfsplus.h:35
uint32_t cnt
Definition: hfsplus.h:33
uint32_t start
Definition: hfsplus.h:32
uint32_t parent_id
Definition: hfsplus.h:36
uint8_t file_creator[4]
Definition: hfsplus.h:181
uint32_t backup_time
Definition: hfsplus.h:173
uint8_t file_type[4]
Definition: hfsplus.h:180
uint32_t text_encoding
Definition: hfsplus.h:183
uint8_t finder_info[24]
Definition: hfsplus.h:182
uint32_t count
Definition: hfsplus.h:77
uint32_t start
Definition: hfsplus.h:75
uint32_t blocks
Definition: hfsplus.h:84
struct hfsplus_extent extents[8]
Definition: hfsplus.h:85
uint32_t clumpsize
Definition: hfsplus.h:83
uint64_t size
Definition: hfsplus.h:82
uint32_t nchildren
Definition: hfsplus.h:63
uint32_t parent_id
Definition: hfsplus.h:62
uint16_t * name
Definition: hfsplus.h:50
char * symlink_dest
Definition: hfsplus.h:57
enum hfsplus_node_type type
Definition: hfsplus.h:59
IsoFileSrc * file
Definition: hfsplus.h:60
enum hfsplus_node::@3 unix_type
IsoNode * node
Definition: hfsplus.h:53
uint16_t * cmp_name
Definition: hfsplus.h:51
uint32_t used_size
Definition: hfsplus.h:66
uint32_t strlen
Definition: hfsplus.h:65
uint32_t symlink_block
Definition: hfsplus.h:56
@ UNIX_SYMLINK
Definition: hfsplus.h:55
@ UNIX_SPECIAL
Definition: hfsplus.h:55
uint32_t cat_id
Definition: hfsplus.h:61
uint32_t total_blocks
Definition: hfsplus.h:102
uint16_t version
Definition: hfsplus.h:91
uint32_t osxfolder
Definition: hfsplus.h:116
uint32_t file_count
Definition: hfsplus.h:99
uint32_t rsrc_clumpsize
Definition: hfsplus.h:105
uint32_t write_count
Definition: hfsplus.h:108
uint32_t journal
Definition: hfsplus.h:94
struct hfsplus_forkdata attrib_file
Definition: hfsplus.h:121
uint32_t data_clumpsize
Definition: hfsplus.h:106
uint64_t num_serial
Definition: hfsplus.h:117
uint32_t free_blocks
Definition: hfsplus.h:103
uint32_t attributes
Definition: hfsplus.h:92
uint32_t backup_time
Definition: hfsplus.h:97
uint32_t next_allocation
Definition: hfsplus.h:104
uint32_t unused
Definition: hfsplus.h:115
struct hfsplus_forkdata catalog_file
Definition: hfsplus.h:120
uint32_t blksize
Definition: hfsplus.h:101
uint32_t ctime
Definition: hfsplus.h:95
uint16_t magic
Definition: hfsplus.h:90
uint32_t catalog_node_id
Definition: hfsplus.h:107
uint32_t last_mounted_version
Definition: hfsplus.h:93
uint32_t intel_bootfile
Definition: hfsplus.h:111
uint32_t fsck_time
Definition: hfsplus.h:98
uint64_t encodings_bitmap
Definition: hfsplus.h:109
uint32_t folder_count
Definition: hfsplus.h:100
struct hfsplus_forkdata startup_file
Definition: hfsplus.h:122
uint32_t os9folder
Definition: hfsplus.h:114
uint32_t ppc_bootdir
Definition: hfsplus.h:110
struct hfsplus_forkdata allocations_file
Definition: hfsplus.h:118
uint32_t showfolder
Definition: hfsplus.h:113
struct hfsplus_forkdata extents_file
Definition: hfsplus.h:119
uint32_t utime
Definition: hfsplus.h:96