Updated Vladimir Serbinenko's work. Replaced his extension of Iso_File_Src
by a function that computes the size from Iso_File_Src.sections.
This commit is contained in:
parent
e5a4e33ebd
commit
1a5c02a27e
@ -598,12 +598,22 @@ struct ecma119_image
|
|||||||
/*
|
/*
|
||||||
* HFS+ related information
|
* HFS+ related information
|
||||||
*/
|
*/
|
||||||
HFSPlusNode *hfsplus_root;
|
HFSPlusNode *hfsp_leafs;
|
||||||
|
struct hfsplus_btree_level *hfsp_levels;
|
||||||
|
uint32_t hfsp_nlevels;
|
||||||
uint32_t hfsp_part_start;
|
uint32_t hfsp_part_start;
|
||||||
uint32_t hfsp_nfiles;
|
uint32_t hfsp_nfiles;
|
||||||
uint32_t hfsp_ndirs;
|
uint32_t hfsp_ndirs;
|
||||||
uint32_t hfsp_cat_id;
|
uint32_t hfsp_cat_id;
|
||||||
uint32_t hfsp_allocation_blocks;
|
uint32_t hfsp_allocation_blocks;
|
||||||
|
uint32_t hfsp_allocation_file_start;
|
||||||
|
uint32_t hfsp_extent_file_start;
|
||||||
|
uint32_t hfsp_catalog_file_start;
|
||||||
|
uint32_t hfsp_total_blocks;
|
||||||
|
uint32_t hfsp_allocation_size;
|
||||||
|
uint32_t hfsp_nleafs;
|
||||||
|
uint32_t hfsp_curleaf;
|
||||||
|
uint32_t hfsp_nnodes;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ISO 9660:1999 related information
|
* ISO 9660:1999 related information
|
||||||
|
1444
libisofs/hfsplus.c
1444
libisofs/hfsplus.c
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2012 Thomas Schmitt
|
|
||||||
* Copyright (c) 2012 Vladimir Serbinenko
|
* Copyright (c) 2012 Vladimir Serbinenko
|
||||||
*
|
*
|
||||||
* This file is part of the libisofs project; you can redistribute it and/or
|
* This file is part of the libisofs project; you can redistribute it and/or
|
||||||
@ -9,88 +8,170 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Declare HFS+ related structures.
|
* Declare Joliet related structures.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LIBISO_HFSPLUS_H
|
#ifndef LIBISO_HFSPLUS_H
|
||||||
#define LIBISO_HFSPLUS_H
|
#define LIBISO_HFSPLUS_H
|
||||||
|
|
||||||
|
#include "libisofs.h"
|
||||||
#include "ecma119.h"
|
#include "ecma119.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* <<< dummies */
|
|
||||||
|
|
||||||
#define LIBISO_HFSPLUS_NAME_MAX 255
|
#define LIBISO_HFSPLUS_NAME_MAX 255
|
||||||
|
|
||||||
enum hfsplus_node_type {
|
enum hfsplus_node_type {
|
||||||
HFSPLUS_FILE,
|
HFSPLUS_DIR = 1,
|
||||||
HFSPLUS_DIR
|
HFSPLUS_FILE = 2,
|
||||||
|
HFSPLUS_DIR_THREAD = 3,
|
||||||
|
HFSPLUS_FILE_THREAD = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hfsplus_dir_info {
|
struct hfsplus_btree_node
|
||||||
HFSPlusNode **children;
|
{
|
||||||
size_t nchildren;
|
uint32_t start;
|
||||||
size_t len;
|
uint32_t cnt;
|
||||||
size_t block;
|
uint32_t strlen;
|
||||||
|
uint16_t *str;
|
||||||
|
uint32_t parent_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct hfsplus_btree_level
|
||||||
|
{
|
||||||
|
uint32_t level_size;
|
||||||
|
struct hfsplus_btree_node *nodes;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hfsplus_node
|
struct hfsplus_node
|
||||||
{
|
{
|
||||||
uint16_t *name; /**< Name in UCS-2BE. */
|
uint16_t *name; /* Name in UTF-16BE, decomposed. */
|
||||||
|
uint16_t *cmp_name; /* Name used for comparing. */
|
||||||
|
|
||||||
HFSPlusNode *parent;
|
IsoNode *node; /*< reference to the iso node */
|
||||||
|
|
||||||
IsoNode *node; /*< reference to the iso node */
|
enum hfsplus_node_type type;
|
||||||
|
IsoFileSrc *file;
|
||||||
enum hfsplus_node_type type;
|
uint32_t cat_id;
|
||||||
union {
|
uint32_t parent_id;
|
||||||
IsoFileSrc *file;
|
uint32_t nchildren;
|
||||||
struct hfsplus_dir_info *dir;
|
|
||||||
} info;
|
|
||||||
|
|
||||||
/* <<< dummies */
|
|
||||||
int cat_id;
|
|
||||||
|
|
||||||
|
uint32_t strlen;
|
||||||
|
uint32_t used_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hfsplus_volheader {
|
|
||||||
|
|
||||||
uint16_t magic;
|
|
||||||
uint16_t version;
|
|
||||||
uint32_t attributes;
|
|
||||||
uint32_t last_mounted_version;
|
|
||||||
uint32_t ctime;
|
|
||||||
uint32_t utime;
|
|
||||||
uint32_t backup_time;
|
|
||||||
uint32_t fsck_time;
|
|
||||||
uint32_t file_count;
|
|
||||||
uint32_t folder_count;
|
|
||||||
uint32_t blksize;
|
|
||||||
uint32_t catalog_node_id;
|
|
||||||
uint32_t rsrc_clumpsize;
|
|
||||||
uint32_t data_clumpsize;
|
|
||||||
uint32_t total_blocks;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* >>> ts B20523 : what else is needed here ? */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a IsoWriter to deal with HFS+ structures, and add it to the given
|
|
||||||
* target.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* 1 on success, < 0 on error
|
|
||||||
*/
|
|
||||||
int hfsplus_writer_create(Ecma119Image *target);
|
int hfsplus_writer_create(Ecma119Image *target);
|
||||||
|
|
||||||
|
|
||||||
/* Not to be called but only for comparison with target->writers[i]
|
|
||||||
*/
|
|
||||||
int hfsplus_writer_write_vol_desc(IsoImageWriter *writer);
|
int hfsplus_writer_write_vol_desc(IsoImageWriter *writer);
|
||||||
|
|
||||||
|
struct hfsplus_extent
|
||||||
|
{
|
||||||
|
/* The first block of a file on disk. */
|
||||||
|
uint32_t start;
|
||||||
|
/* The amount of blocks described by this extent. */
|
||||||
|
uint32_t count;
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
struct hfsplus_forkdata
|
||||||
|
{
|
||||||
|
uint64_t size;
|
||||||
|
uint32_t clumpsize;
|
||||||
|
uint32_t blocks;
|
||||||
|
struct hfsplus_extent extents[8];
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
struct hfsplus_volheader
|
||||||
|
{
|
||||||
|
uint16_t magic;
|
||||||
|
uint16_t version;
|
||||||
|
uint32_t attributes;
|
||||||
|
uint32_t last_mounted_version;
|
||||||
|
uint32_t journal;
|
||||||
|
uint32_t ctime;
|
||||||
|
uint32_t utime;
|
||||||
|
uint32_t backup_time;
|
||||||
|
uint32_t fsck_time;
|
||||||
|
uint32_t file_count;
|
||||||
|
uint32_t folder_count;
|
||||||
|
uint32_t blksize;
|
||||||
|
uint32_t total_blocks;
|
||||||
|
uint32_t free_blocks;
|
||||||
|
uint32_t next_allocation;
|
||||||
|
uint32_t rsrc_clumpsize;
|
||||||
|
uint32_t data_clumpsize;
|
||||||
|
uint32_t catalog_node_id;
|
||||||
|
uint32_t write_count;
|
||||||
|
uint64_t encodings_bitmap;
|
||||||
|
uint32_t ppc_bootdir;
|
||||||
|
uint32_t intel_bootfile;
|
||||||
|
/* Folder opened when disk is mounted. */
|
||||||
|
uint32_t showfolder;
|
||||||
|
uint32_t os9folder;
|
||||||
|
uint32_t unused;
|
||||||
|
uint32_t osxfolder;
|
||||||
|
uint64_t num_serial;
|
||||||
|
struct hfsplus_forkdata allocations_file;
|
||||||
|
struct hfsplus_forkdata extents_file;
|
||||||
|
struct hfsplus_forkdata catalog_file;
|
||||||
|
struct hfsplus_forkdata attrib_file;
|
||||||
|
struct hfsplus_forkdata startup_file;
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
struct hfsplus_btnode
|
||||||
|
{
|
||||||
|
uint32_t next;
|
||||||
|
uint32_t prev;
|
||||||
|
int8_t type;
|
||||||
|
uint8_t height;
|
||||||
|
uint16_t count;
|
||||||
|
uint16_t unused;
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
/* The header of a HFS+ B+ Tree. */
|
||||||
|
struct hfsplus_btheader
|
||||||
|
{
|
||||||
|
uint16_t depth;
|
||||||
|
uint32_t root;
|
||||||
|
uint32_t leaf_records;
|
||||||
|
uint32_t first_leaf_node;
|
||||||
|
uint32_t last_leaf_node;
|
||||||
|
uint16_t nodesize;
|
||||||
|
uint16_t keysize;
|
||||||
|
uint32_t total_nodes;
|
||||||
|
uint32_t free_nodes;
|
||||||
|
uint16_t reserved1;
|
||||||
|
uint32_t clump_size;
|
||||||
|
uint8_t btree_type;
|
||||||
|
uint8_t key_compare;
|
||||||
|
uint32_t attributes;
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
struct hfsplus_catfile_thread
|
||||||
|
{
|
||||||
|
uint16_t type;
|
||||||
|
uint16_t reserved;
|
||||||
|
uint32_t parentid;
|
||||||
|
uint16_t namelen;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct hfsplus_catfile_common
|
||||||
|
{
|
||||||
|
uint16_t type;
|
||||||
|
uint16_t flags;
|
||||||
|
uint32_t valence; /* for files: reserved. */
|
||||||
|
uint32_t fileid;
|
||||||
|
uint32_t ctime;
|
||||||
|
uint32_t mtime;
|
||||||
|
uint32_t attr_mtime;
|
||||||
|
uint32_t atime;
|
||||||
|
uint32_t backup_time;
|
||||||
|
uint32_t uid;
|
||||||
|
uint32_t gid;
|
||||||
|
uint8_t user_flags;
|
||||||
|
uint8_t group_flags;
|
||||||
|
uint16_t mode;
|
||||||
|
uint32_t special;
|
||||||
|
uint8_t finder_info[32];
|
||||||
|
uint32_t text_encoding;
|
||||||
|
uint32_t reserved;
|
||||||
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
|
||||||
#endif /* LIBISO_HFSPLUS_H */
|
#endif /* LIBISO_HFSPLUS_H */
|
||||||
|
@ -7046,6 +7046,10 @@ int iso_md5_match(char first_md5[16], char second_md5[16]);
|
|||||||
(FAILURE, HIGH, -379) */
|
(FAILURE, HIGH, -379) */
|
||||||
#define ISO_AAIP_ACL_MULT_OBJ 0xE830FE83
|
#define ISO_AAIP_ACL_MULT_OBJ 0xE830FE83
|
||||||
|
|
||||||
|
/** File sections do not form consequtive array of blocks
|
||||||
|
(FAILURE, HIGH, -378) */
|
||||||
|
#define ISO_SECT_SCATTERED 0xE830FE82
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Internal developer note:
|
/* Internal developer note:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user