"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libisofs/ecma119.c" between
xorriso-1.4.6.tar.gz and xorriso-1.4.8.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.

ecma119.c  (xorriso-1.4.6):ecma119.c  (xorriso-1.4.8)
/* /*
* Copyright (c) 2007 Vreixo Formoso * Copyright (c) 2007 Vreixo Formoso
* Copyright (c) 2007 Mario Danic * Copyright (c) 2007 Mario Danic
* Copyright (c) 2009 - 2016 Thomas Schmitt * Copyright (c) 2009 - 2017 Thomas Schmitt
* *
* 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
* modify it under the terms of the GNU General Public License version 2 * modify it under the terms of the GNU General Public License version 2
* or later as published by the Free Software Foundation. * or later as published by the Free Software Foundation.
* See COPYING file for details. * See COPYING file for details.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "../config.h" #include "../config.h"
#endif #endif
skipping to change at line 1414 skipping to change at line 1414
(*write_count)++) { (*write_count)++) {
ret = iso_write(target, buf, BLOCK_SIZE); ret = iso_write(target, buf, BLOCK_SIZE);
if (ret < 0) if (ret < 0)
goto ex; goto ex;
} }
/* Write volume descriptors subtracting /* Write volume descriptors subtracting
target->partiton_offset from any LBA pointer. target->partiton_offset from any LBA pointer.
*/ */
target->eff_partition_offset = target->opts->partition_offset; target->eff_partition_offset = target->opts->partition_offset;
target->pvd_size_is_total_size = 0;
for (i = 0; i < (int) target->nwriters; ++i) { for (i = 0; i < (int) target->nwriters; ++i) {
writer = target->writers[i]; writer = target->writers[i];
/* Not all writers have an entry in the partion volume descriptor set. /* Not all writers have an entry in the partion volume descriptor set.
It must be guaranteed that they write exactly one block. It must be guaranteed that they write exactly one block.
*/ */
/* >>> TWINTREE: Enhance ISO1999 writer and add it here */ /* >>> TWINTREE: Enhance ISO1999 writer and add it here */
if(writer->write_vol_desc != ecma119_writer_write_vol_desc && if(writer->write_vol_desc != ecma119_writer_write_vol_desc &&
writer->write_vol_desc != joliet_writer_write_vol_desc) writer->write_vol_desc != joliet_writer_write_vol_desc)
skipping to change at line 1492 skipping to change at line 1493
target->image->id, ISO_LIBJTE_END_FAILED, 0); target->image->id, ISO_LIBJTE_END_FAILED, 0);
return ISO_LIBJTE_END_FAILED; return ISO_LIBJTE_END_FAILED;
} }
} }
#endif /* Libisofs_with_libjtE */ #endif /* Libisofs_with_libjtE */
return 1; return 1;
} }
/* >>> need opportunity to just mark a partition in the older sessions
*/
struct iso_interval_zeroizer { struct iso_interval_zeroizer {
int z_type; /* 0= $zero_start"-"$zero_end , int z_type; /* 0= $zero_start"-"$zero_end ,
1= "zero_mbrpt" , 2= "zero_gpt" , 3= "zero_apm" 1= "zero_mbrpt" , 2= "zero_gpt" , 3= "zero_apm"
*/ */
off_t zero_start; off_t zero_start;
off_t zero_end; off_t zero_end;
}; };
struct iso_interval_reader { struct iso_interval_reader {
skipping to change at line 1993 skipping to change at line 1991
ret = iso_ivr_zeroize(ivr, buf, *buf_fill, 0); ret = iso_ivr_zeroize(ivr, buf, *buf_fill, 0);
if (ret < 0) if (ret < 0)
return ret; return ret;
ivr->read_count += *buf_fill; ivr->read_count += *buf_fill;
return ISO_SUCCESS; return ISO_SUCCESS;
} }
/* Tells whether ivr is a reader from imported_iso in a multi-session
add-on situation, and thus to be kept in place.
*/
int iso_interval_reader_keep(Ecma119Image *target,
struct iso_interval_reader *ivr,
int flag)
{
/* Source must be "imported_iso" */
if (!(ivr->flags & 1))
return 0;
/* It must not be a new ISO */
if (!target->opts->appendable)
return 0;
/* --- From here on return either 1 or <0 --- */
/* multi-session write offset must be larger than interval end */
if (target->opts->ms_block <= ivr->end_byte / BLOCK_SIZE)
return ISO_MULTI_OVER_IMPORTED;
return 1;
}
int iso_interval_reader_start_size(Ecma119Image *t, char *path,
off_t *start_byte, off_t *byte_count,
int flag)
{
struct iso_interval_reader *ivr;
int keep, ret;
ret = iso_interval_reader_new(t->image, path, &ivr, byte_count, 0);
if (ret < 0)
return ret;
*start_byte = ivr->start_byte;
keep = iso_interval_reader_keep(t, ivr, 0);
if (keep < 0)
return(keep);
iso_interval_reader_destroy(&ivr, 0);
return ISO_SUCCESS + (keep > 0);
}
int iso_write_partition_file(Ecma119Image *target, char *path, int iso_write_partition_file(Ecma119Image *target, char *path,
uint32_t prepad, uint32_t blocks, int flag) uint32_t prepad, uint32_t blocks, int flag)
{ {
struct iso_interval_reader *ivr = NULL; struct iso_interval_reader *ivr = NULL;
int buf_fill; int buf_fill;
off_t byte_count; off_t byte_count;
FILE *fp = NULL; FILE *fp = NULL;
uint32_t i; uint32_t i;
skipping to change at line 2018 skipping to change at line 2058
ret = iso_write(target, buf, BLOCK_SIZE); ret = iso_write(target, buf, BLOCK_SIZE);
if (ret < 0) if (ret < 0)
goto ex; goto ex;
} }
if (flag & 1) { if (flag & 1) {
ret = iso_interval_reader_new(target->image, path, ret = iso_interval_reader_new(target->image, path,
&ivr, &byte_count, 0); &ivr, &byte_count, 0);
if (ret < 0) if (ret < 0)
goto ex; goto ex;
ret = iso_interval_reader_keep(target, ivr, 0);
if (ret < 0)
goto ex;
if (ret > 0) {
/* From imported_iso and for add-on session. Leave it in place. */
ret = ISO_SUCCESS;
goto ex;
}
for (i = 0; i < blocks; i++) { for (i = 0; i < blocks; i++) {
ret = iso_interval_reader_read(ivr, buf, &buf_fill, 0); ret = iso_interval_reader_read(ivr, buf, &buf_fill, 0);
if (ret < 0) if (ret < 0)
goto ex; goto ex;
ret = iso_write(target, buf, BLOCK_SIZE); ret = iso_write(target, buf, BLOCK_SIZE);
if (ret < 0) if (ret < 0)
goto ex; goto ex;
} }
} else { } else {
fp = fopen(path, "rb"); fp = fopen(path, "rb");
skipping to change at line 3466 skipping to change at line 3514
wopts->efi_boot_partition = NULL; wopts->efi_boot_partition = NULL;
wopts->efi_boot_part_flag = 0; wopts->efi_boot_part_flag = 0;
for (i = 0; i < ISO_MAX_PARTITIONS; i++) { for (i = 0; i < ISO_MAX_PARTITIONS; i++) {
wopts->appended_partitions[i] = NULL; wopts->appended_partitions[i] = NULL;
wopts->appended_part_types[i] = 0; wopts->appended_part_types[i] = 0;
wopts->appended_part_flags[i] = 0; wopts->appended_part_flags[i] = 0;
} }
wopts->appended_as_gpt = 0; wopts->appended_as_gpt = 0;
wopts->appended_as_apm = 0; wopts->appended_as_apm = 0;
wopts->part_like_isohybrid = 0; wopts->part_like_isohybrid = 0;
wopts->iso_mbr_part_type = -1;
wopts->ascii_disc_label[0] = 0; wopts->ascii_disc_label[0] = 0;
wopts->will_cancel = 0; wopts->will_cancel = 0;
wopts->allow_dir_id_ext = 0; wopts->allow_dir_id_ext = 0;
wopts->old_empty = 0; wopts->old_empty = 0;
wopts->untranslated_name_len = 0; wopts->untranslated_name_len = 0;
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
wopts->hfsp_serial_number[i] = 0; wopts->hfsp_serial_number[i] = 0;
wopts->apm_block_size = 0; wopts->apm_block_size = 0;
wopts->hfsp_block_size = 0; wopts->hfsp_block_size = 0;
memset(wopts->gpt_disk_guid, 0, 16); memset(wopts->gpt_disk_guid, 0, 16);
skipping to change at line 4200 skipping to change at line 4249
opts->appended_as_apm = !!apm; opts->appended_as_apm = !!apm;
return ISO_SUCCESS; return ISO_SUCCESS;
} }
int iso_write_opts_set_part_like_isohybrid(IsoWriteOpts *opts, int alike) int iso_write_opts_set_part_like_isohybrid(IsoWriteOpts *opts, int alike)
{ {
opts->part_like_isohybrid = !!alike; opts->part_like_isohybrid = !!alike;
return ISO_SUCCESS; return ISO_SUCCESS;
} }
int iso_write_opts_set_iso_mbr_part_type(IsoWriteOpts *opts, int part_type)
{
if (part_type < -1 || part_type > 255)
part_type = -1;
opts->iso_mbr_part_type = part_type;
return ISO_SUCCESS;
}
int iso_write_opts_set_disc_label(IsoWriteOpts *opts, char *label) int iso_write_opts_set_disc_label(IsoWriteOpts *opts, char *label)
{ {
strncpy(opts->ascii_disc_label, label, ISO_DISC_LABEL_SIZE - 1); strncpy(opts->ascii_disc_label, label, ISO_DISC_LABEL_SIZE - 1);
opts->ascii_disc_label[ISO_DISC_LABEL_SIZE - 1] = 0; opts->ascii_disc_label[ISO_DISC_LABEL_SIZE - 1] = 0;
return ISO_SUCCESS; return ISO_SUCCESS;
} }
int iso_write_opts_set_hfsp_serial_number(IsoWriteOpts *opts, int iso_write_opts_set_hfsp_serial_number(IsoWriteOpts *opts,
uint8_t serial_number[8]) uint8_t serial_number[8])
{ {
 End of changes. 7 change blocks. 
4 lines changed or deleted 61 lines changed or added

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