New option -pvd_info

This commit is contained in:
Thomas Schmitt 2009-10-05 17:20:38 +00:00
parent 9766c28d4f
commit 38a3059748
6 changed files with 101 additions and 11 deletions

View File

@ -2,7 +2,7 @@
.\" First parameter, NAME, should be all caps .\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1) .\" other parameters are allowed: see man(7), man(1)
.TH XORRISO 1 "Sep 29, 2009" .TH XORRISO 1 "Oct 05, 2009"
.\" Please adjust this date whenever revising the manpage. .\" Please adjust this date whenever revising the manpage.
.\" .\"
.\" Some roff macros, for reference: .\" Some roff macros, for reference:
@ -1898,12 +1898,12 @@ or -rollback.
If you insist in -volid "ISOIMAGE", set it again after those commands. If you insist in -volid "ISOIMAGE", set it again after those commands.
.TP .TP
\fB\-publisher\fR text \fB\-publisher\fR text
Set the publisher string to be written with the next -commit. Permissible Set the publisher id string to be written with the next -commit. Permissible
are up to 128 characters. are up to 128 characters. This setting gets overridden by image loading.
.TP .TP
\fB\-application_id\fR text \fB\-application_id\fR text
Set the application id string to be written with the next -commit. Permissible Set the application id string to be written with the next -commit. Permissible
are up to 128 characters. are up to 128 characters. This setting gets overridden by image loading.
.TP .TP
\fB\-out_charset\fR character_set_name \fB\-out_charset\fR character_set_name
Set the character set to which file names get converted when writing an Set the character set to which file names get converted when writing an
@ -2380,6 +2380,11 @@ prepared and only in last moment is revoked by this option.
Print available space on output media and the free space after Print available space on output media and the free space after
subtracting already foreseeable consumption by next -commit. subtracting already foreseeable consumption by next -commit.
.TP .TP
\fB\-pvd_info\fR
Print various id strings which can be found in loaded ISO images. Some of
them may be changed by options -volid, -publisher, -application_id. For these
ids -pvd_info reports what would be written with the next -commit.
.TP
.B Navigation in ISO image and disk filesystem: .B Navigation in ISO image and disk filesystem:
.TP .TP
\fB\-cd\fR iso_rr_path \fB\-cd\fR iso_rr_path

View File

@ -15907,6 +15907,7 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
"", "",
" -tell_media_space", " -tell_media_space",
" Print foreseeable available space on output media", " Print foreseeable available space on output media",
" -pvd_info Print various id strings of the loaded ISO image."
"", "",
"Options with variable length path list [...] need the list delimiter text", "Options with variable length path list [...] need the list delimiter text",
"as end mark if they are followed by another option. By default this delimiter", "as end mark if they are followed by another option. By default this delimiter",
@ -17770,6 +17771,13 @@ int Xorriso_option_publisher(struct XorrisO *xorriso, char *name, int flag)
} }
/* Option -pvd_info */
int Xorriso_option_pvd_info(struct XorrisO *xorriso, int flag)
{
return(Xorriso_pvd_info(xorriso, 0));
}
/* Option -pwd alias -pwdi */ /* Option -pwd alias -pwdi */
int Xorriso_option_pwdi(struct XorrisO *xorriso, int flag) int Xorriso_option_pwdi(struct XorrisO *xorriso, int flag)
{ {
@ -19114,7 +19122,7 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
static char arg0_commands[][40]= { static char arg0_commands[][40]= {
"ban_stdio_write","close_filter_list","commit","devices","end", "ban_stdio_write","close_filter_list","commit","devices","end",
"for_backup", "help", "for_backup", "help",
"list_formats","no_rc","print_size","pwd","pwdi","pwdx", "list_formats","no_rc","print_size","pvd_info","pwd","pwdi","pwdx",
"rollback","rollback_end","tell_media_space","toc","version", "rollback","rollback_end","tell_media_space","toc","version",
"" ""
}; };
@ -19772,6 +19780,9 @@ next_command:;
(*idx)++; (*idx)++;
Xorriso_option_publisher(xorriso, arg1, 0); Xorriso_option_publisher(xorriso, arg1, 0);
} else if(strcmp(cmd,"pvd_info")==0) {
Xorriso_option_pvd_info(xorriso, 0);
} else if(strcmp(cmd,"pwd")==0 || strcmp(cmd,"pwdi")==0) { } else if(strcmp(cmd,"pwd")==0 || strcmp(cmd,"pwdi")==0) {
Xorriso_option_pwdi(xorriso, 0); Xorriso_option_pwdi(xorriso, 0);

View File

@ -835,6 +835,9 @@ int Xorriso_option_prog_help(struct XorrisO *xorriso, char *name, int flag);
/* Option -publisher */ /* Option -publisher */
int Xorriso_option_publisher(struct XorrisO *xorriso, char *name, int flag); int Xorriso_option_publisher(struct XorrisO *xorriso, char *name, int flag);
/* Option -pvd_info */
int Xorriso_option_pvd_info(struct XorrisO *xorriso, int flag);
/* Option -pwd alias -pwdi */ /* Option -pwd alias -pwdi */
int Xorriso_option_pwdi(struct XorrisO *xorriso, int flag); int Xorriso_option_pwdi(struct XorrisO *xorriso, int flag);

View File

@ -1 +1 @@
#define Xorriso_timestamP "2009.10.05.165632" #define Xorriso_timestamP "2009.10.05.172143"

View File

@ -136,6 +136,14 @@ unsigned long Xorriso_get_di_counteR= 0;
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
static const char *un0(const char *text)
{
if(text == NULL)
return("");
return(text);
}
int Xorriso_destroy_node_array(struct XorrisO *xorriso, int flag) int Xorriso_destroy_node_array(struct XorrisO *xorriso, int flag)
{ {
int i; int i;
@ -1220,6 +1228,10 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
xorriso->in_sector_map= NULL; xorriso->in_sector_map= NULL;
Xorriso_set_image_severities(xorriso, 0); Xorriso_set_image_severities(xorriso, 0);
Xorriso_update_volid(xorriso, 0); Xorriso_update_volid(xorriso, 0);
Sfile_str(xorriso->application_id,
(char *) un0(iso_image_get_application_id(volset)), 0);
Sfile_str(xorriso->publisher,
(char *) un0(iso_image_get_publisher_id(volset)), 0);
if(xorriso->out_drive_handle != NULL && if(xorriso->out_drive_handle != NULL &&
xorriso->out_drive_handle != xorriso->in_drive_handle) { xorriso->out_drive_handle != xorriso->in_drive_handle) {
@ -5250,6 +5262,7 @@ int Xorriso_media_product(struct XorrisO *xorriso, int flag)
bit4=do no report failure if no drive aquired bit4=do no report failure if no drive aquired
bit5=only report "Drive current" and "Drive type" bit5=only report "Drive current" and "Drive type"
bit6=report "Media product" with bit0 bit6=report "Media product" with bit0
bit7=only report "Drive current"
*/ */
int Xorriso_toc(struct XorrisO *xorriso, int flag) int Xorriso_toc(struct XorrisO *xorriso, int flag)
{ {
@ -5291,6 +5304,8 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
(is_inout_drive ? "-dev" : (flag&2 ? "-outdev" : "-indev")), (is_inout_drive ? "-dev" : (flag&2 ? "-outdev" : "-indev")),
devadr); devadr);
Xorriso_toc_line(xorriso, flag & 8); Xorriso_toc_line(xorriso, flag & 8);
if(flag & 128)
return(1);
sprintf(respt, "Drive type : vendor '%s' product '%s' revision '%s'\n", sprintf(respt, "Drive type : vendor '%s' product '%s' revision '%s'\n",
dinfo[0].vendor, dinfo[0].product, dinfo[0].revision); dinfo[0].vendor, dinfo[0].product, dinfo[0].revision);
if((flag & 32) | !(flag & 1)) if((flag & 32) | !(flag & 1))
@ -9391,6 +9406,7 @@ int Xorriso_is_split(struct XorrisO *xorriso, char *path, void *node,
/* @param flag bit0= grow_overwriteable_iso /* @param flag bit0= grow_overwriteable_iso
bit1= obtain info from outdev bit1= obtain info from outdev
bit2= no need to obtain msc2 (NWA)
*/ */
int Xorriso_msinfo(struct XorrisO *xorriso, int *msc1, int *msc2, int flag) int Xorriso_msinfo(struct XorrisO *xorriso, int *msc1, int *msc2, int flag)
{ {
@ -9399,6 +9415,7 @@ int Xorriso_msinfo(struct XorrisO *xorriso, int *msc1, int *msc2, int flag)
struct burn_drive_info *dinfo; struct burn_drive_info *dinfo;
enum burn_disc_status disc_state; enum burn_disc_status disc_state;
*msc1= *msc2= -1;
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
"on attempt to obtain msinfo", flag&2); "on attempt to obtain msinfo", flag&2);
if(ret<=0) if(ret<=0)
@ -9408,12 +9425,15 @@ int Xorriso_msinfo(struct XorrisO *xorriso, int *msc1, int *msc2, int flag)
disc_state= isoburn_disc_get_status(drive); disc_state= isoburn_disc_get_status(drive);
else else
disc_state= burn_disc_get_status(drive); disc_state= burn_disc_get_status(drive);
if(disc_state != BURN_DISC_APPENDABLE) { if(disc_state != BURN_DISC_APPENDABLE &&
!(disc_state == BURN_DISC_FULL && (flag & 4))) {
Xorriso_process_msg_queues(xorriso,0); Xorriso_process_msg_queues(xorriso,0);
sprintf(xorriso->info_text, if(!(flag & 4)) {
"%s media is not appendable. Cannot obtain -msinfo.", sprintf(xorriso->info_text,
(flag&2) ? "Output" : "Input"); "%s media is not appendable. Cannot obtain -msinfo.",
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); (flag&2) ? "Output" : "Input");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
}
return(0); return(0);
} }
ret= isoburn_disc_get_msc1(drive, msc1); ret= isoburn_disc_get_msc1(drive, msc1);
@ -9423,6 +9443,8 @@ int Xorriso_msinfo(struct XorrisO *xorriso, int *msc1, int *msc2, int flag)
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0); return(0);
} }
if(flag & 4)
return(1);
ret= isoburn_disc_track_lba_nwa(drive, NULL, 0, &dummy, msc2); ret= isoburn_disc_track_lba_nwa(drive, NULL, 0, &dummy, msc2);
if(ret<0) { if(ret<0) {
Xorriso_process_msg_queues(xorriso,0); Xorriso_process_msg_queues(xorriso,0);
@ -12840,3 +12862,50 @@ ex:;
} }
int Xorriso_pvd_info(struct XorrisO *xorriso, int flag)
{
int ret, msc1= -1, msc2;
IsoImage *image;
struct burn_drive_info *dinfo;
struct burn_drive *drive;
char *msg;
msg= xorriso->result_line;
ret= Xorriso_get_volume(xorriso, &image, 0);
if(ret<=0)
return(ret);
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive, "", 16);
if(ret > 0) {
ret= Xorriso_msinfo(xorriso, &msc1, &msc2, 1 | 4);
if(ret<0)
return(ret);
Xorriso_toc(xorriso, 128);
if(msc1 >= 0) {
sprintf(msg, "PVD address : %ds\n", msc1 + 16);
Xorriso_result(xorriso,0);
}
}
sprintf(msg, "System Id : %s\n", un0(iso_image_get_system_id(image)));
Xorriso_result(xorriso,0);
sprintf(msg, "Volume Id : %s\n", xorriso->volid);
Xorriso_result(xorriso,0);
sprintf(msg, "Volume Set Id: %s\n", un0(iso_image_get_volset_id(image)));
Xorriso_result(xorriso,0);
sprintf(msg, "Publisher Id : %s\n", xorriso->publisher);
Xorriso_result(xorriso,0);
sprintf(msg, "Preparer Id : %s\n",
un0(iso_image_get_data_preparer_id(image)));
Xorriso_result(xorriso,0);
sprintf(msg, "App Id : %s\n", xorriso->application_id);
Xorriso_result(xorriso,0);
sprintf(msg, "Copyright Id : %s\n",
un0(iso_image_get_copyright_file_id(image)));
Xorriso_result(xorriso,0);
sprintf(msg, "Abstract Id : %s\n",
un0(iso_image_get_abstract_file_id(image)));
Xorriso_result(xorriso,0);
sprintf(msg, "Biblio Id : %s\n", un0(iso_image_get_biblio_file_id(image)));
Xorriso_result(xorriso,0);
return(1);
}

View File

@ -483,6 +483,8 @@ int Xorriso_drive_snooze(struct XorrisO *xorriso, int flag);
int Xorriso_is_plain_image_file(struct XorrisO *xorriso, void *in_node, int Xorriso_is_plain_image_file(struct XorrisO *xorriso, void *in_node,
char *path, int flag); char *path, int flag);
int Xorriso_pvd_info(struct XorrisO *xorriso, int flag);
/* A pseudo file type for El-Torito bootsectors as in man 2 stat : /* A pseudo file type for El-Torito bootsectors as in man 2 stat :
For now take the highest possible value. For now take the highest possible value.