Changed name of freshly introduce API call iso_write_opts_set_high_empty_address

to iso_write_opts_set_old_empty, reverted the meaning and the default.
This commit is contained in:
Thomas Schmitt 2011-01-26 19:38:50 +01:00
parent 200697898d
commit 74c68224c7
5 changed files with 25 additions and 28 deletions

View File

@ -384,7 +384,7 @@ void write_one_dir_record(Ecma119Image *t, Ecma119Node *node, int file_id,
* the content block address to a dummy value.
*/
len = 0;
if (t->high_empty_address)
if (! t->old_empty)
block = t->empty_file_block;
else
block = 0;
@ -1580,7 +1580,7 @@ int ecma119_image_new(IsoImage *src, IsoWriteOpts *opts, Ecma119Image **img)
target->hardlinks = opts->hardlinks;
target->aaip = opts->aaip;
target->always_gmt = opts->always_gmt;
target->high_empty_address = opts->high_empty_address;
target->old_empty = opts->old_empty;
target->untranslated_name_len = opts->untranslated_name_len;
target->allow_dir_id_ext = opts->allow_dir_id_ext;
target->omit_version_numbers = opts->omit_version_numbers
@ -1933,7 +1933,7 @@ int ecma119_image_new(IsoImage *src, IsoWriteOpts *opts, Ecma119Image **img)
will account resp. write this single block.
*/
if (i == file_src_writer_index) {
if (target->high_empty_address)
if (! target->old_empty)
target->empty_file_block = target->curblock;
opts->data_start_lba = target->curblock;
}
@ -2379,7 +2379,7 @@ int iso_write_opts_new(IsoWriteOpts **opts, int profile)
wopts->ascii_disc_label[0] = 0;
wopts->will_cancel = 0;
wopts->allow_dir_id_ext = 0;
wopts->high_empty_address = 0;
wopts->old_empty = 0;
wopts->untranslated_name_len = 0;
*opts = wopts;
@ -2469,12 +2469,12 @@ int iso_write_opts_set_aaip(IsoWriteOpts *opts, int enable)
return ISO_SUCCESS;
}
int iso_write_opts_set_high_empty_address(IsoWriteOpts *opts, int enable)
int iso_write_opts_set_old_empty(IsoWriteOpts *opts, int enable)
{
if (opts == NULL) {
return ISO_NULL_POINTER;
}
opts->high_empty_address = enable ? 1 : 0;
opts->old_empty = enable ? 1 : 0;
return ISO_SUCCESS;
}

View File

@ -245,14 +245,9 @@ struct iso_write_opts {
gid_t gid; /** gid to use when replace_gid == 2. */
/**
* Let symbolic links, device files, and empty data files point to
* a block address after the end of the directory tree, rather than
* using LBA 0 for links and devices, and the address of the Volume
* Descriptor Set Terminator for empty data files.
* Single-pass reader libarchive sorts by ths address and needs to see all
* directory info before processing any data files.
* See API call iso_write_opts_set_old_empty().
*/
unsigned int high_empty_address :1;
unsigned int old_empty :1;
/**
* Extra Caution: This option breaks any assumptions about names that
@ -495,7 +490,7 @@ struct ecma119_image
mode_t dir_mode;
time_t timestamp;
unsigned int high_empty_address :1;
unsigned int old_empty :1;
unsigned int untranslated_name_len;
/**

View File

@ -232,10 +232,10 @@ int filesrc_writer_compute_data_blocks(IsoImageWriter *writer)
t = writer->target;
/* Eventually reserve a single zeroed block for all files which have
/* Normally reserve a single zeroed block for all files which have
no block address: symbolic links, device files, empty data files.
*/
if (t->high_empty_address)
if (! t->old_empty)
t->curblock++;
/* on appendable images, ms files shouldn't be included */
@ -359,11 +359,11 @@ int filesrc_writer_write_data(IsoImageWriter *writer)
iso_msg_debug(t->image->id, "Writing Files...");
/* Eventually write a single zeroed block as block address target for all
/* Normally write a single zeroed block as block address target for all
files which have no block address:
symbolic links, device files, empty data files.
*/
if (t->high_empty_address) {
if (! t->old_empty) {
ret = iso_write(t, buffer, BLOCK_SIZE);
if (ret < 0)
goto ex;

View File

@ -1371,22 +1371,24 @@ int iso_write_opts_set_hardlinks(IsoWriteOpts *opts, int enable);
int iso_write_opts_set_aaip(IsoWriteOpts *opts, int enable);
/**
* Let symbolic links, device files, and empty data files point to a
* dedicated block of zero bytes after the end of the directory trees, rather
* than using address 0 for links and device files, resp. the address of the
* Volume Descriptor Set Terminator for empty data files.
* (Single-pass reader libarchive sorts by this address and needs to see all
* directory info before processing any data files.)
* Use this only if you need to reproduce a suboptimal behavior of older
* versions of libisofs. They used address 0 for links and device files,
* and the address of the Volume Descriptor Set Terminator for empty data
* files.
* New versions let symbolic links, device files, and empty data files point
* to a dedicated block of zero-bytes after the end of the directory trees.
* (Single-pass reader libarchive needs to see all directory info before
* processing any data files.)
*
* @param opts
* The option set to be manipulated.
* @param enable
* 1 = use the address of a block after the directory tree.
* 0 = use the traditional block addresses in the range of 0 to 31.
* 1 = use the suboptimal block addresses in the range of 0 to 115.
* 0 = use the address of a block after the directory tree. (Default)
*
* @since 1.0.2
*/
int iso_write_opts_set_high_empty_address(IsoWriteOpts *opts, int enable);
int iso_write_opts_set_old_empty(IsoWriteOpts *opts, int enable);
/**
* Caution: This option breaks any assumptions about names that

View File

@ -274,7 +274,6 @@ iso_write_opts_set_dir_rec_mtime;
iso_write_opts_set_disc_label;
iso_write_opts_set_fifo_size;
iso_write_opts_set_hardlinks;
iso_write_opts_set_high_empty_address;
iso_write_opts_set_iso1999;
iso_write_opts_set_iso_level;
iso_write_opts_set_joliet;
@ -282,6 +281,7 @@ iso_write_opts_set_joliet_longer_paths;
iso_write_opts_set_max_37_char_filenames;
iso_write_opts_set_ms_block;
iso_write_opts_set_no_force_dots;
iso_write_opts_set_old_empty;
iso_write_opts_set_omit_version_numbers;
iso_write_opts_set_output_charset;
iso_write_opts_set_overwrite_buf;