Adapted to libisofs revison 294
This commit is contained in:
parent
4697182efd
commit
55b155efb9
@ -259,21 +259,20 @@ int isoburn_prepare_disc_aux(struct burn_drive *d, struct burn_disc **disc,
|
||||
struct burn_session *session;
|
||||
struct burn_track *track;
|
||||
struct isoburn *o;
|
||||
Ecma119WriteOpts wopts;
|
||||
IsoWriteOpts *wopts= NULL;
|
||||
enum burn_disc_status state;
|
||||
int ret, fifo_chunks;
|
||||
|
||||
ret= isoburn_find_emulator(&o, d, 0);
|
||||
if(ret<0 || o==NULL)
|
||||
return -1;
|
||||
{ret= -1; goto ex;}
|
||||
o->wrote_well= 0; /* early end will be registered as failure */
|
||||
|
||||
|
||||
state = isoburn_disc_get_status(d);
|
||||
if (state != BURN_DISC_BLANK && state != BURN_DISC_APPENDABLE
|
||||
&& (state != BURN_DISC_FULL || ! new_img)) {
|
||||
/* unsuitable status */
|
||||
return -2;
|
||||
{ret= -2; goto ex;}
|
||||
}
|
||||
|
||||
fifo_chunks= 32;
|
||||
@ -283,60 +282,54 @@ int isoburn_prepare_disc_aux(struct burn_drive *d, struct burn_disc **disc,
|
||||
fifo_chunks++;
|
||||
}
|
||||
|
||||
memset((char *) &wopts, 0, sizeof(wopts));
|
||||
wopts.level = opts->level;
|
||||
wopts.rockridge = opts->rockridge;
|
||||
wopts.joliet = opts->joliet;
|
||||
wopts.iso1999 = opts->iso1999;
|
||||
wopts.omit_version_numbers = opts->omit_version_numbers;
|
||||
wopts.allow_deep_paths = opts->allow_deep_paths;
|
||||
wopts.allow_longer_paths = opts->allow_longer_paths;
|
||||
wopts.max_37_char_filenames = opts->max_37_char_filenames;
|
||||
wopts.no_force_dots = opts->no_force_dots;
|
||||
wopts.allow_lowercase = opts->allow_lowercase;
|
||||
wopts.allow_full_ascii = opts->allow_full_ascii;
|
||||
wopts.joliet_longer_paths = opts->joliet_longer_paths;
|
||||
wopts.sort_files = opts->sort_files;
|
||||
wopts.replace_dir_mode = opts->replace_dir_mode;
|
||||
wopts.replace_file_mode = opts->replace_file_mode;
|
||||
wopts.replace_uid = opts->replace_uid;
|
||||
wopts.replace_gid = opts->replace_gid;
|
||||
wopts.dir_mode = opts->dir_mode;
|
||||
wopts.file_mode = opts->file_mode;
|
||||
wopts.gid = opts->gid;
|
||||
wopts.uid = opts->uid;
|
||||
wopts.timestamp = 0;
|
||||
wopts.output_charset = opts->output_charset;
|
||||
ret = iso_write_opts_new(&wopts, 0);
|
||||
if (ret < 0)
|
||||
goto ex;
|
||||
iso_write_opts_set_iso_level(wopts, opts->level);
|
||||
iso_write_opts_set_rockridge(wopts, opts->rockridge);
|
||||
iso_write_opts_set_joliet(wopts, opts->joliet);
|
||||
iso_write_opts_set_iso1999(wopts, opts->iso1999);
|
||||
iso_write_opts_set_omit_version_numbers(wopts, opts->omit_version_numbers);
|
||||
iso_write_opts_set_allow_deep_paths(wopts, opts->allow_deep_paths);
|
||||
iso_write_opts_set_allow_longer_paths(wopts, opts->allow_longer_paths);
|
||||
iso_write_opts_set_max_37_char_filenames(wopts, opts->max_37_char_filenames);
|
||||
iso_write_opts_set_no_force_dots(wopts, opts->no_force_dots);
|
||||
iso_write_opts_set_allow_lowercase(wopts, opts->allow_lowercase);
|
||||
iso_write_opts_set_allow_full_ascii(wopts, opts->allow_full_ascii);
|
||||
iso_write_opts_set_joliet_longer_paths(wopts, opts->joliet_longer_paths);
|
||||
iso_write_opts_set_sort_files(wopts, opts->sort_files);
|
||||
iso_write_opts_set_replace_mode(wopts, opts->replace_dir_mode,
|
||||
opts->replace_file_mode, opts->replace_uid, opts->replace_gid);
|
||||
iso_write_opts_set_default_dir_mode(wopts, opts->dir_mode);
|
||||
iso_write_opts_set_default_file_mode(wopts, opts->file_mode);
|
||||
iso_write_opts_set_default_uid(wopts, opts->uid);
|
||||
iso_write_opts_set_default_gid(wopts, opts->gid);
|
||||
iso_write_opts_set_output_charset(wopts, opts->output_charset);
|
||||
#ifdef Libisoburn_no_fifO
|
||||
wopts.fifo_size= fifo_chunks;
|
||||
|
||||
/* <<<
|
||||
fprintf(stderr, "libisoburn_DEBUG: fifo chunks: %d\n", fifo_chunks);
|
||||
*/
|
||||
iso_write_opts_set_fifo_size(wopts, fifo_chunks);
|
||||
#endif /* Libisoburn_no_fifO */
|
||||
|
||||
if (new_img) {
|
||||
wopts.ms_block = 0;
|
||||
wopts.appendable = 0;
|
||||
wopts.overwrite = NULL;
|
||||
iso_write_opts_set_ms_block(wopts, 0);
|
||||
iso_write_opts_set_appendable(wopts, 0);
|
||||
iso_write_opts_set_overwrite_buf(wopts, NULL);
|
||||
} else {
|
||||
int lba, nwa;
|
||||
ret = isoburn_disc_track_lba_nwa(d, NULL, 0, &lba, &nwa);
|
||||
if (ret != 1)
|
||||
return -3;
|
||||
{ret= -3; goto ex;}
|
||||
if (nwa == 0 && state == BURN_DISC_APPENDABLE) {
|
||||
/* invalid nwa */
|
||||
return -4;
|
||||
{ret= -4; goto ex;}
|
||||
}
|
||||
iso_write_opts_set_ms_block(wopts, nwa);
|
||||
iso_write_opts_set_appendable(wopts, 1);
|
||||
iso_write_opts_set_overwrite_buf(wopts, o->target_iso_head);
|
||||
}
|
||||
|
||||
wopts.ms_block = nwa;
|
||||
wopts.appendable = 1;
|
||||
wopts.overwrite = o->target_iso_head;
|
||||
}
|
||||
|
||||
ret = iso_image_create_burn_source(o->image, &wopts, &wsrc);
|
||||
ret = iso_image_create_burn_source(o->image, wopts, &wsrc);
|
||||
if (ret < 0)
|
||||
return -1;
|
||||
{ret= -1; goto ex;}
|
||||
|
||||
/* TODO check return values for failure. propertly clean-up on error */
|
||||
|
||||
@ -347,7 +340,7 @@ int isoburn_prepare_disc_aux(struct burn_drive *d, struct burn_disc **disc,
|
||||
burn_source_free(wsrc);
|
||||
if (o->fifo == NULL) {
|
||||
fprintf(stderr, "Cannot attach fifo\n");
|
||||
return -1;
|
||||
{ret= -1; goto ex;}
|
||||
}
|
||||
#endif /* ! Libisoburn_no_fifO */
|
||||
|
||||
@ -369,7 +362,11 @@ int isoburn_prepare_disc_aux(struct burn_drive *d, struct burn_disc **disc,
|
||||
burn_session_free(session);
|
||||
|
||||
o->wrote_well= -1; /* neutral */
|
||||
return 1;
|
||||
ret= 1;
|
||||
ex:
|
||||
if(wopts!=NULL)
|
||||
{iso_write_opts_free(wopts); wopts= NULL;}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int isoburn_prepare_disc(struct burn_drive *d, struct burn_disc **disc,
|
||||
|
@ -106,9 +106,11 @@ int isoburn_read_image(struct burn_drive *d,
|
||||
struct isoburn_read_opts *read_opts,
|
||||
IsoImage **image)
|
||||
{
|
||||
int ret;
|
||||
struct iso_read_opts ropts;
|
||||
struct iso_read_image_features features;
|
||||
int ret, int_num;
|
||||
IsoReadOpts *ropts= NULL;
|
||||
struct iso_read_image_features *features= NULL;
|
||||
uint32_t ms_block;
|
||||
|
||||
enum burn_disc_status status= BURN_DISC_BLANK;
|
||||
IsoDataSource *ds= NULL;
|
||||
struct isoburn *o= NULL;
|
||||
@ -164,35 +166,43 @@ int isoburn_read_image(struct burn_drive *d,
|
||||
|
||||
memset((char *) &ropts, 0, sizeof(ropts));
|
||||
|
||||
ret = isoburn_disc_get_msc1(d, (int*) &ropts.block);
|
||||
ret = isoburn_disc_get_msc1(d, &int_num);
|
||||
if (ret < 0)
|
||||
return -2;
|
||||
ropts.norock = read_opts->norock;
|
||||
ropts.nojoliet = read_opts->nojoliet;
|
||||
ropts.noiso1999 = read_opts->noiso1999;
|
||||
ropts.preferjoliet = read_opts->preferjoliet;
|
||||
ropts.mode = read_opts->mode;
|
||||
ropts.uid = read_opts->uid;
|
||||
ropts.gid = read_opts->gid;
|
||||
ropts.input_charset = read_opts->input_charset;
|
||||
ms_block= int_num;
|
||||
|
||||
/* create the data source */
|
||||
ret = iso_read_opts_new(&ropts, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
/* Important: do not return until iso_read_opts_free() */
|
||||
iso_read_opts_set_start_block(ropts, ms_block);
|
||||
iso_read_opts_set_no_rockridge(ropts, read_opts->norock);
|
||||
iso_read_opts_set_no_joliet(ropts, read_opts->nojoliet);
|
||||
iso_read_opts_set_no_iso1999(ropts, read_opts->noiso1999);
|
||||
iso_read_opts_set_preferjoliet(ropts, read_opts->preferjoliet);
|
||||
iso_read_opts_set_default_permissions(ropts, read_opts->mode);
|
||||
iso_read_opts_set_default_uid(ropts, read_opts->uid);
|
||||
iso_read_opts_set_default_gid(ropts, read_opts->gid);
|
||||
iso_read_opts_set_input_charset(ropts, read_opts->input_charset);
|
||||
ds = isoburn_data_source_new(d);
|
||||
ret = iso_image_import(o->image, ds, &ropts, &features);
|
||||
ret = iso_image_import(o->image, ds, ropts, &features);
|
||||
iso_read_opts_free(ropts);
|
||||
iso_data_source_unref(ds);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
/* Important: do not return until free(features) */
|
||||
|
||||
if (image) {
|
||||
*image = o->image;
|
||||
iso_image_ref(*image); /*protects object from premature free*/
|
||||
}
|
||||
|
||||
read_opts->hasRR = features.hasRR;
|
||||
read_opts->hasJoliet = features.hasJoliet;
|
||||
read_opts->hasIso1999 = features.hasIso1999;
|
||||
read_opts->hasElTorito = features.hasElTorito;
|
||||
read_opts->size = features.size;
|
||||
read_opts->hasRR = features->hasRR;
|
||||
read_opts->hasJoliet = features->hasJoliet;
|
||||
read_opts->hasIso1999 = features->hasIso1999;
|
||||
read_opts->hasElTorito = features->hasElTorito;
|
||||
read_opts->size = features->size;
|
||||
free(features);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
# to be executed in a common parent of the directories given with
|
||||
# $isofs $isoburn $burn
|
||||
|
||||
isofs=./nglibisofs-develop/src
|
||||
isofs=./nglibisofs-develop/libisofs
|
||||
burn=./libburn-develop/libburn
|
||||
isoburn=./libisoburn-develop/libisoburn
|
||||
xorr=./libisoburn-develop/xorriso
|
||||
|
@ -129,7 +129,7 @@ copy_files \
|
||||
|
||||
create_dir "$lone_dir"/libisofs
|
||||
goto_dir "$current_dir"/nglibisofs-develop
|
||||
copy_files src/*.[ch] "$lone_dir"/libisofs
|
||||
copy_files libisofs/*.[ch] "$lone_dir"/libisofs
|
||||
|
||||
# To get a common version.h
|
||||
cat version.h.in >> "$lone_dir"/version.h.in
|
||||
|
@ -1 +1 @@
|
||||
#define Xorriso_timestamP "2008.01.28.140149"
|
||||
#define Xorriso_timestamP "2008.01.28.171915"
|
||||
|
@ -1341,7 +1341,7 @@ int Xorriso__text_to_sev(char *severity_name, int *severity_number, int flag)
|
||||
|
||||
int Xorriso_process_msg_queues(struct XorrisO *xorriso, int flag)
|
||||
{
|
||||
int ret, error_code= 0, os_errno= 0, count= 0, pass;
|
||||
int ret, error_code= 0, os_errno= 0, count= 0, pass, imgid;
|
||||
char severity[80];
|
||||
|
||||
if(!xorriso->libs_are_started)
|
||||
@ -1349,8 +1349,8 @@ int Xorriso_process_msg_queues(struct XorrisO *xorriso, int flag)
|
||||
for(pass= 0; pass< 2; pass++) {
|
||||
while(1) {
|
||||
if(pass==0)
|
||||
ret= iso_obtain_msgs("ALL", &error_code,
|
||||
xorriso->info_text, &os_errno, severity);
|
||||
ret= iso_obtain_msgs("ALL", &error_code, &imgid,
|
||||
xorriso->info_text, severity);
|
||||
else
|
||||
ret= burn_msgs_obtain("ALL", &error_code, xorriso->info_text, &os_errno,
|
||||
severity);
|
||||
|
Loading…
Reference in New Issue
Block a user