New command -report_system_area
This commit is contained in:
@ -1390,3 +1390,53 @@ hint_revoke:;
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int Xorriso_report_system_area(struct XorrisO *xorriso, char *form, int flag)
|
||||
{
|
||||
int ret;
|
||||
char *text = NULL, *cpt, *npt;
|
||||
IsoImage *image;
|
||||
|
||||
if(strcmp(form, "help") == 0) {
|
||||
ret= iso_image_report_system_area(NULL, &text, 1);
|
||||
} else if(strcmp(form, "") == 0 || strcmp(form, "plain") == 0) {
|
||||
ret= Xorriso_get_volume(xorriso, &image, 0);
|
||||
if(ret <= 0)
|
||||
goto ex;
|
||||
ret= iso_image_report_system_area(image, &text, 0);
|
||||
} else {
|
||||
strcpy(xorriso->info_text,
|
||||
"-report_system_area form parameter not recognized: ");
|
||||
Text_shellsafe(form, xorriso->info_text, 1);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
ret= 0; goto ex;
|
||||
}
|
||||
if(ret < 0)
|
||||
goto ex;
|
||||
if(text == NULL || ret == 0) {
|
||||
strcpy(xorriso->info_text, "No System Area was loaded");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
|
||||
ret= 2; goto ex;
|
||||
}
|
||||
if(text[0] == 0) {
|
||||
strcpy(xorriso->info_text, "System Area only contains 0-bytes");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
|
||||
ret= 2; goto ex;
|
||||
}
|
||||
for(npt= cpt= text; npt != NULL; cpt= npt + 1) {
|
||||
npt= strchr(cpt, '\n');
|
||||
if(npt == NULL)
|
||||
strcpy(xorriso->result_line, cpt);
|
||||
else {
|
||||
strncpy(xorriso->result_line, cpt, npt - cpt + 1);
|
||||
xorriso->result_line[npt - cpt + 1]= 0;
|
||||
}
|
||||
Xorriso_result(xorriso,0);
|
||||
}
|
||||
|
||||
ret= 1;
|
||||
ex:;
|
||||
if(text != NULL)
|
||||
free(text);
|
||||
return(ret);
|
||||
}
|
||||
|
Reference in New Issue
Block a user