"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libisofs/hfsplus.c" between
xorriso-1.5.2.tar.gz and xorriso-1.5.4.tar.gz

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.

hfsplus.c  (xorriso-1.5.2):hfsplus.c  (xorriso-1.5.4)
skipping to change at line 537 skipping to change at line 537
t->curblock = hfsp_curblock / block_fac; t->curblock = hfsp_curblock / block_fac;
if (hfsp_curblock % block_fac) if (hfsp_curblock % block_fac)
t->curblock++; t->curblock++;
iso_msg_debug(t->image->id, "(a) curblock=%d, nodes =%d", t->curblock, t->hf sp_nnodes); iso_msg_debug(t->image->id, "(a) curblock=%d, nodes =%d", t->curblock, t->hf sp_nnodes);
return ISO_SUCCESS; return ISO_SUCCESS;
} }
static void set_time (uint32_t *tm, uint32_t t) static inline uint32_t mac_time_offset(uint32_t t)
{ {
iso_msb ((uint8_t *) tm, t + 2082844800, 4); uint32_t val;
iso_msb ((uint8_t *) &val, t + 2082844800, sizeof(val));
return val;
} }
int nop_writer_write_vol_desc(IsoImageWriter *writer) int nop_writer_write_vol_desc(IsoImageWriter *writer)
{ {
return ISO_SUCCESS; return ISO_SUCCESS;
} }
static static
uid_t px_get_uid(Ecma119Image *t, IsoNode *n) uid_t px_get_uid(Ecma119Image *t, IsoNode *n)
{ {
skipping to change at line 609 skipping to change at line 611
memset (&sb, 0, sizeof (sb)); memset (&sb, 0, sizeof (sb));
t->hfsp_allocation_size = (t->hfsp_total_blocks + 7) >> 3; t->hfsp_allocation_size = (t->hfsp_total_blocks + 7) >> 3;
iso_msb ((uint8_t *) &sb.magic, 0x482b, 2); iso_msb ((uint8_t *) &sb.magic, 0x482b, 2);
iso_msb ((uint8_t *) &sb.version, 4, 2); iso_msb ((uint8_t *) &sb.version, 4, 2);
/* Cleanly unmounted, software locked. */ /* Cleanly unmounted, software locked. */
iso_msb ((uint8_t *) &sb.attributes, (1 << 8) | (1 << 15), 4); iso_msb ((uint8_t *) &sb.attributes, (1 << 8) | (1 << 15), 4);
iso_msb ((uint8_t *) &sb.last_mounted_version, 0x6c69736f, 4); iso_msb ((uint8_t *) &sb.last_mounted_version, 0x6c69736f, 4);
set_time (&sb.ctime, t->now); sb.ctime = mac_time_offset(t->now);
set_time (&sb.utime, t->now); sb.utime = mac_time_offset(t->now);
set_time (&sb.fsck_time, t->now); sb.fsck_time = mac_time_offset(t->now);
iso_msb ((uint8_t *) &sb.file_count, t->hfsp_nfiles, 4); iso_msb ((uint8_t *) &sb.file_count, t->hfsp_nfiles, 4);
iso_msb ((uint8_t *) &sb.folder_count, t->hfsp_ndirs - 1, 4); iso_msb ((uint8_t *) &sb.folder_count, t->hfsp_ndirs - 1, 4);
iso_msb ((uint8_t *) &sb.blksize, block_size, 4); iso_msb ((uint8_t *) &sb.blksize, block_size, 4);
iso_msb ((uint8_t *) &sb.catalog_node_id, t->hfsp_cat_id, 4); iso_msb ((uint8_t *) &sb.catalog_node_id, t->hfsp_cat_id, 4);
iso_msb ((uint8_t *) &sb.rsrc_clumpsize, block_size, 4); iso_msb ((uint8_t *) &sb.rsrc_clumpsize, block_size, 4);
iso_msb ((uint8_t *) &sb.data_clumpsize, block_size, 4); iso_msb ((uint8_t *) &sb.data_clumpsize, block_size, 4);
iso_msb ((uint8_t *) &sb.total_blocks, t->hfsp_total_blocks, 4); iso_msb ((uint8_t *) &sb.total_blocks, t->hfsp_total_blocks, 4);
iso_msb ((uint8_t *) &sb.encodings_bitmap + 4, 1, 4); iso_msb ((uint8_t *) &sb.encodings_bitmap + 4, 1, 4);
iso_msb ((uint8_t *) &sb.allocations_file.size + 4, t->hfsp_allocation_size, 4); iso_msb ((uint8_t *) &sb.allocations_file.size + 4, t->hfsp_allocation_size, 4);
skipping to change at line 844 skipping to change at line 846
iso_msb ((uint8_t *) buffer + curoff + 2, t->hfsp_leafs[curno de].parent_id, 4); iso_msb ((uint8_t *) buffer + curoff + 2, t->hfsp_leafs[curno de].parent_id, 4);
iso_msb ((uint8_t *) buffer + curoff + 6, t->hfsp_leafs[curno de].strlen, 2); iso_msb ((uint8_t *) buffer + curoff + 6, t->hfsp_leafs[curno de].strlen, 2);
curoff += 8; curoff += 8;
memcpy (buffer + curoff, t->hfsp_leafs[curnode].name, t->hfsp _leafs[curnode].strlen * 2); memcpy (buffer + curoff, t->hfsp_leafs[curnode].name, t->hfsp _leafs[curnode].strlen * 2);
curoff += t->hfsp_leafs[curnode].strlen * 2; curoff += t->hfsp_leafs[curnode].strlen * 2;
common = (struct hfsplus_catfile_common *) (buffer + curoff); common = (struct hfsplus_catfile_common *) (buffer + curoff);
((uint8_t *) &common->type)[1] = t->hfsp_leafs[curnode].type; ((uint8_t *) &common->type)[1] = t->hfsp_leafs[curnode].type;
iso_msb ((uint8_t *) &common->valence, t->hfsp_leafs[curnode] .nchildren, 4); iso_msb ((uint8_t *) &common->valence, t->hfsp_leafs[curnode] .nchildren, 4);
iso_msb ((uint8_t *) &common->fileid, t->hfsp_leafs[curnode]. cat_id, 4); iso_msb ((uint8_t *) &common->fileid, t->hfsp_leafs[curnode]. cat_id, 4);
set_time (&common->ctime, t->hfsp_leafs[curnode].node->ctime) common->ctime = mac_time_offset(t->hfsp_leafs[curnode].node->
; ctime);
set_time (&common->mtime, t->hfsp_leafs[curnode].node->mtime) common->mtime = mac_time_offset(t->hfsp_leafs[curnode].node->
; mtime);
/* FIXME: distinguish attr_mtime and mtime. */ /* FIXME: distinguish attr_mtime and mtime. */
set_time (&common->attr_mtime, t->hfsp_leafs[curnode].node->m common->attr_mtime = mac_time_offset(t->hfsp_leafs[curnode].n
time); ode->mtime);
set_time (&common->atime, t->hfsp_leafs[curnode].node->atime) common->atime = mac_time_offset(t->hfsp_leafs[curnode].node->
; atime);
iso_msb ((uint8_t *) &common->uid, px_get_uid (t, t->hfsp_lea fs[curnode].node), 4); iso_msb ((uint8_t *) &common->uid, px_get_uid (t, t->hfsp_lea fs[curnode].node), 4);
iso_msb ((uint8_t *) &common->gid, px_get_gid (t, t->hfsp_lea fs[curnode].node), 4); iso_msb ((uint8_t *) &common->gid, px_get_gid (t, t->hfsp_lea fs[curnode].node), 4);
iso_msb ((uint8_t *) &common->mode, px_get_mode (t, t->hfsp_l eafs[curnode].node, (t->hfsp_leafs[curnode].type == HFSPLUS_DIR)), 2); iso_msb ((uint8_t *) &common->mode, px_get_mode (t, t->hfsp_l eafs[curnode].node, (t->hfsp_leafs[curnode].type == HFSPLUS_DIR)), 2);
/* /*
FIXME: FIXME:
uint8_t user_flags; uint8_t user_flags;
uint8_t group_flags; uint8_t group_flags;
finder info finder info
skipping to change at line 1566 skipping to change at line 1567
*/ */
qsort(target->hfsp_leafs, target->hfsp_nleafs, qsort(target->hfsp_leafs, target->hfsp_nleafs,
sizeof(*target->hfsp_leafs), cmp_node); sizeof(*target->hfsp_leafs), cmp_node);
} }
iso_msg_debug(target->image->id, iso_msg_debug(target->image->id,
"HFS+ mangling done. Resolved Collisions: %lu", "HFS+ mangling done. Resolved Collisions: %lu",
(unsigned long) target->hfsp_collision_count); (unsigned long) target->hfsp_collision_count);
return ISO_SUCCESS; return ISO_SUCCESS;
} }
void iso_setup_hfsplus_block_size(Ecma119Image *target)
{
if (target->opts->hfsp_block_size == 0)
target->opts->hfsp_block_size = HFSPLUS_DEFAULT_BLOCK_SIZE;
target->hfsp_cat_node_size = 2 * target->opts->hfsp_block_size;
target->hfsp_iso_block_fac = 2048 / target->opts->hfsp_block_size;
}
int hfsplus_writer_create(Ecma119Image *target) int hfsplus_writer_create(Ecma119Image *target)
{ {
int ret; int ret;
IsoImageWriter *writer = NULL; IsoImageWriter *writer = NULL;
int max_levels; int max_levels;
int level = 0; int level = 0;
IsoNode *pos; IsoNode *pos;
IsoDir *dir; IsoDir *dir;
int i; int i;
uint32_t cat_node_size; uint32_t cat_node_size;
writer = calloc(1, sizeof(IsoImageWriter)); writer = calloc(1, sizeof(IsoImageWriter));
if (writer == NULL) { if (writer == NULL) {
ret = ISO_OUT_OF_MEM; ret = ISO_OUT_OF_MEM;
goto ex; goto ex;
} }
make_hfsplus_decompose_pages(); make_hfsplus_decompose_pages();
make_hfsplus_class_pages(); make_hfsplus_class_pages();
if (target->opts->hfsp_block_size == 0) iso_setup_hfsplus_block_size(target);
target->opts->hfsp_block_size = HFSPLUS_DEFAULT_BLOCK_SIZE;
target->hfsp_cat_node_size = 2 * target->opts->hfsp_block_size;
target->hfsp_iso_block_fac = 2048 / target->opts->hfsp_block_size;
cat_node_size = target->hfsp_cat_node_size; cat_node_size = target->hfsp_cat_node_size;
writer->compute_data_blocks = hfsplus_writer_compute_data_blocks; writer->compute_data_blocks = hfsplus_writer_compute_data_blocks;
writer->write_vol_desc = nop_writer_write_vol_desc; writer->write_vol_desc = nop_writer_write_vol_desc;
writer->write_data = hfsplus_writer_write_data; writer->write_data = hfsplus_writer_write_data;
writer->free_data = hfsplus_writer_free_data; writer->free_data = hfsplus_writer_free_data;
writer->data = NULL; writer->data = NULL;
writer->target = target; writer->target = target;
iso_msg_debug(target->image->id, "Creating HFS+ tree..."); iso_msg_debug(target->image->id, "Creating HFS+ tree...");
skipping to change at line 1779 skipping to change at line 1785
target->hfsp_levels[level].nodes[target->hfsp_levels[level].level_size].s tr = target->hfsp_levels[level - 1].nodes[last_start].str; target->hfsp_levels[level].nodes[target->hfsp_levels[level].level_size].s tr = target->hfsp_levels[level - 1].nodes[last_start].str;
target->hfsp_levels[level].nodes[target->hfsp_levels[level].level_size].p arent_id = target->hfsp_levels[level - 1].nodes[last_start].parent_id; target->hfsp_levels[level].nodes[target->hfsp_levels[level].level_size].p arent_id = target->hfsp_levels[level - 1].nodes[last_start].parent_id;
target->hfsp_levels[level].level_size++; target->hfsp_levels[level].level_size++;
target->hfsp_nnodes += target->hfsp_levels[level].level_size; target->hfsp_nnodes += target->hfsp_levels[level].level_size;
} }
target->hfsp_nlevels = level + 1; target->hfsp_nlevels = level + 1;
if (target->hfsp_nnodes > (cat_node_size - 0x100) * 8) if (target->hfsp_nnodes > (cat_node_size - 0x100) * 8)
{ {
iso_msg_submit(target->image->id, ISO_MANGLE_TOO_MUCH_FILES, 0, iso_msg_submit(target->image->id, ISO_HFSPLUS_TOO_MANY_FILES, 0,
"HFS+ map nodes aren't implemented"); "HFS+ map nodes aren't implemented");
ret = ISO_MANGLE_TOO_MUCH_FILES; ret = ISO_HFSPLUS_TOO_MANY_FILES;
goto ex; goto ex;
} }
/* add this writer to image */ /* add this writer to image */
target->writers[target->nwriters++] = writer; target->writers[target->nwriters++] = writer;
writer = NULL; writer = NULL;
ret = ISO_SUCCESS; ret = ISO_SUCCESS;
ex:; ex:;
if (writer != NULL) if (writer != NULL)
 End of changes. 9 change blocks. 
20 lines changed or deleted 26 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)