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_session *session;
|
||||||
struct burn_track *track;
|
struct burn_track *track;
|
||||||
struct isoburn *o;
|
struct isoburn *o;
|
||||||
Ecma119WriteOpts wopts;
|
IsoWriteOpts *wopts= NULL;
|
||||||
enum burn_disc_status state;
|
enum burn_disc_status state;
|
||||||
int ret, fifo_chunks;
|
int ret, fifo_chunks;
|
||||||
|
|
||||||
ret= isoburn_find_emulator(&o, d, 0);
|
ret= isoburn_find_emulator(&o, d, 0);
|
||||||
if(ret<0 || o==NULL)
|
if(ret<0 || o==NULL)
|
||||||
return -1;
|
{ret= -1; goto ex;}
|
||||||
o->wrote_well= 0; /* early end will be registered as failure */
|
o->wrote_well= 0; /* early end will be registered as failure */
|
||||||
|
|
||||||
|
|
||||||
state = isoburn_disc_get_status(d);
|
state = isoburn_disc_get_status(d);
|
||||||
if (state != BURN_DISC_BLANK && state != BURN_DISC_APPENDABLE
|
if (state != BURN_DISC_BLANK && state != BURN_DISC_APPENDABLE
|
||||||
&& (state != BURN_DISC_FULL || ! new_img)) {
|
&& (state != BURN_DISC_FULL || ! new_img)) {
|
||||||
/* unsuitable status */
|
/* unsuitable status */
|
||||||
return -2;
|
{ret= -2; goto ex;}
|
||||||
}
|
}
|
||||||
|
|
||||||
fifo_chunks= 32;
|
fifo_chunks= 32;
|
||||||
@ -283,60 +282,54 @@ int isoburn_prepare_disc_aux(struct burn_drive *d, struct burn_disc **disc,
|
|||||||
fifo_chunks++;
|
fifo_chunks++;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset((char *) &wopts, 0, sizeof(wopts));
|
ret = iso_write_opts_new(&wopts, 0);
|
||||||
wopts.level = opts->level;
|
if (ret < 0)
|
||||||
wopts.rockridge = opts->rockridge;
|
goto ex;
|
||||||
wopts.joliet = opts->joliet;
|
iso_write_opts_set_iso_level(wopts, opts->level);
|
||||||
wopts.iso1999 = opts->iso1999;
|
iso_write_opts_set_rockridge(wopts, opts->rockridge);
|
||||||
wopts.omit_version_numbers = opts->omit_version_numbers;
|
iso_write_opts_set_joliet(wopts, opts->joliet);
|
||||||
wopts.allow_deep_paths = opts->allow_deep_paths;
|
iso_write_opts_set_iso1999(wopts, opts->iso1999);
|
||||||
wopts.allow_longer_paths = opts->allow_longer_paths;
|
iso_write_opts_set_omit_version_numbers(wopts, opts->omit_version_numbers);
|
||||||
wopts.max_37_char_filenames = opts->max_37_char_filenames;
|
iso_write_opts_set_allow_deep_paths(wopts, opts->allow_deep_paths);
|
||||||
wopts.no_force_dots = opts->no_force_dots;
|
iso_write_opts_set_allow_longer_paths(wopts, opts->allow_longer_paths);
|
||||||
wopts.allow_lowercase = opts->allow_lowercase;
|
iso_write_opts_set_max_37_char_filenames(wopts, opts->max_37_char_filenames);
|
||||||
wopts.allow_full_ascii = opts->allow_full_ascii;
|
iso_write_opts_set_no_force_dots(wopts, opts->no_force_dots);
|
||||||
wopts.joliet_longer_paths = opts->joliet_longer_paths;
|
iso_write_opts_set_allow_lowercase(wopts, opts->allow_lowercase);
|
||||||
wopts.sort_files = opts->sort_files;
|
iso_write_opts_set_allow_full_ascii(wopts, opts->allow_full_ascii);
|
||||||
wopts.replace_dir_mode = opts->replace_dir_mode;
|
iso_write_opts_set_joliet_longer_paths(wopts, opts->joliet_longer_paths);
|
||||||
wopts.replace_file_mode = opts->replace_file_mode;
|
iso_write_opts_set_sort_files(wopts, opts->sort_files);
|
||||||
wopts.replace_uid = opts->replace_uid;
|
iso_write_opts_set_replace_mode(wopts, opts->replace_dir_mode,
|
||||||
wopts.replace_gid = opts->replace_gid;
|
opts->replace_file_mode, opts->replace_uid, opts->replace_gid);
|
||||||
wopts.dir_mode = opts->dir_mode;
|
iso_write_opts_set_default_dir_mode(wopts, opts->dir_mode);
|
||||||
wopts.file_mode = opts->file_mode;
|
iso_write_opts_set_default_file_mode(wopts, opts->file_mode);
|
||||||
wopts.gid = opts->gid;
|
iso_write_opts_set_default_uid(wopts, opts->uid);
|
||||||
wopts.uid = opts->uid;
|
iso_write_opts_set_default_gid(wopts, opts->gid);
|
||||||
wopts.timestamp = 0;
|
iso_write_opts_set_output_charset(wopts, opts->output_charset);
|
||||||
wopts.output_charset = opts->output_charset;
|
|
||||||
#ifdef Libisoburn_no_fifO
|
#ifdef Libisoburn_no_fifO
|
||||||
wopts.fifo_size= fifo_chunks;
|
iso_write_opts_set_fifo_size(wopts, fifo_chunks);
|
||||||
|
|
||||||
/* <<<
|
|
||||||
fprintf(stderr, "libisoburn_DEBUG: fifo chunks: %d\n", fifo_chunks);
|
|
||||||
*/
|
|
||||||
#endif /* Libisoburn_no_fifO */
|
#endif /* Libisoburn_no_fifO */
|
||||||
|
|
||||||
if (new_img) {
|
if (new_img) {
|
||||||
wopts.ms_block = 0;
|
iso_write_opts_set_ms_block(wopts, 0);
|
||||||
wopts.appendable = 0;
|
iso_write_opts_set_appendable(wopts, 0);
|
||||||
wopts.overwrite = NULL;
|
iso_write_opts_set_overwrite_buf(wopts, NULL);
|
||||||
} else {
|
} else {
|
||||||
int lba, nwa;
|
int lba, nwa;
|
||||||
ret = isoburn_disc_track_lba_nwa(d, NULL, 0, &lba, &nwa);
|
ret = isoburn_disc_track_lba_nwa(d, NULL, 0, &lba, &nwa);
|
||||||
if (ret != 1)
|
if (ret != 1)
|
||||||
return -3;
|
{ret= -3; goto ex;}
|
||||||
if (nwa == 0 && state == BURN_DISC_APPENDABLE) {
|
if (nwa == 0 && state == BURN_DISC_APPENDABLE) {
|
||||||
/* invalid nwa */
|
/* 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;
|
ret = iso_image_create_burn_source(o->image, wopts, &wsrc);
|
||||||
wopts.appendable = 1;
|
|
||||||
wopts.overwrite = o->target_iso_head;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = iso_image_create_burn_source(o->image, &wopts, &wsrc);
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return -1;
|
{ret= -1; goto ex;}
|
||||||
|
|
||||||
/* TODO check return values for failure. propertly clean-up on error */
|
/* 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);
|
burn_source_free(wsrc);
|
||||||
if (o->fifo == NULL) {
|
if (o->fifo == NULL) {
|
||||||
fprintf(stderr, "Cannot attach fifo\n");
|
fprintf(stderr, "Cannot attach fifo\n");
|
||||||
return -1;
|
{ret= -1; goto ex;}
|
||||||
}
|
}
|
||||||
#endif /* ! Libisoburn_no_fifO */
|
#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);
|
burn_session_free(session);
|
||||||
|
|
||||||
o->wrote_well= -1; /* neutral */
|
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,
|
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,
|
struct isoburn_read_opts *read_opts,
|
||||||
IsoImage **image)
|
IsoImage **image)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret, int_num;
|
||||||
struct iso_read_opts ropts;
|
IsoReadOpts *ropts= NULL;
|
||||||
struct iso_read_image_features features;
|
struct iso_read_image_features *features= NULL;
|
||||||
|
uint32_t ms_block;
|
||||||
|
|
||||||
enum burn_disc_status status= BURN_DISC_BLANK;
|
enum burn_disc_status status= BURN_DISC_BLANK;
|
||||||
IsoDataSource *ds= NULL;
|
IsoDataSource *ds= NULL;
|
||||||
struct isoburn *o= NULL;
|
struct isoburn *o= NULL;
|
||||||
@ -164,35 +166,43 @@ int isoburn_read_image(struct burn_drive *d,
|
|||||||
|
|
||||||
memset((char *) &ropts, 0, sizeof(ropts));
|
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)
|
if (ret < 0)
|
||||||
return -2;
|
return -2;
|
||||||
ropts.norock = read_opts->norock;
|
ms_block= int_num;
|
||||||
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;
|
|
||||||
|
|
||||||
/* create the data source */
|
/* 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);
|
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);
|
iso_data_source_unref(ds);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
/* Important: do not return until free(features) */
|
||||||
|
|
||||||
if (image) {
|
if (image) {
|
||||||
*image = o->image;
|
*image = o->image;
|
||||||
iso_image_ref(*image); /*protects object from premature free*/
|
iso_image_ref(*image); /*protects object from premature free*/
|
||||||
}
|
}
|
||||||
|
read_opts->hasRR = features->hasRR;
|
||||||
read_opts->hasRR = features.hasRR;
|
read_opts->hasJoliet = features->hasJoliet;
|
||||||
read_opts->hasJoliet = features.hasJoliet;
|
read_opts->hasIso1999 = features->hasIso1999;
|
||||||
read_opts->hasIso1999 = features.hasIso1999;
|
read_opts->hasElTorito = features->hasElTorito;
|
||||||
read_opts->hasElTorito = features.hasElTorito;
|
read_opts->size = features->size;
|
||||||
read_opts->size = features.size;
|
free(features);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# to be executed in a common parent of the directories given with
|
# to be executed in a common parent of the directories given with
|
||||||
# $isofs $isoburn $burn
|
# $isofs $isoburn $burn
|
||||||
|
|
||||||
isofs=./nglibisofs-develop/src
|
isofs=./nglibisofs-develop/libisofs
|
||||||
burn=./libburn-develop/libburn
|
burn=./libburn-develop/libburn
|
||||||
isoburn=./libisoburn-develop/libisoburn
|
isoburn=./libisoburn-develop/libisoburn
|
||||||
xorr=./libisoburn-develop/xorriso
|
xorr=./libisoburn-develop/xorriso
|
||||||
|
@ -129,7 +129,7 @@ copy_files \
|
|||||||
|
|
||||||
create_dir "$lone_dir"/libisofs
|
create_dir "$lone_dir"/libisofs
|
||||||
goto_dir "$current_dir"/nglibisofs-develop
|
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
|
# To get a common version.h
|
||||||
cat version.h.in >> "$lone_dir"/version.h.in
|
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 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];
|
char severity[80];
|
||||||
|
|
||||||
if(!xorriso->libs_are_started)
|
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++) {
|
for(pass= 0; pass< 2; pass++) {
|
||||||
while(1) {
|
while(1) {
|
||||||
if(pass==0)
|
if(pass==0)
|
||||||
ret= iso_obtain_msgs("ALL", &error_code,
|
ret= iso_obtain_msgs("ALL", &error_code, &imgid,
|
||||||
xorriso->info_text, &os_errno, severity);
|
xorriso->info_text, severity);
|
||||||
else
|
else
|
||||||
ret= burn_msgs_obtain("ALL", &error_code, xorriso->info_text, &os_errno,
|
ret= burn_msgs_obtain("ALL", &error_code, xorriso->info_text, &os_errno,
|
||||||
severity);
|
severity);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user