New find test -disk_name
This commit is contained in:
@ -1835,6 +1835,46 @@ int Xorriso__file_start_lba(IsoNode *node,
|
||||
}
|
||||
|
||||
|
||||
int Xorriso_retrieve_disk_path(struct XorrisO *xorriso, IsoNode *node,
|
||||
char disk_path[SfileadrL], int flag)
|
||||
{
|
||||
IsoFile *file;
|
||||
IsoStream *stream= NULL, *input_stream;
|
||||
char type_text[80], *source_path = NULL;
|
||||
|
||||
if(!LIBISO_ISREG(node))
|
||||
return(0);
|
||||
|
||||
/* Obtain most fundamental input stream */
|
||||
file= (IsoFile *) node;
|
||||
input_stream= iso_file_get_stream(file);
|
||||
if(input_stream == NULL)
|
||||
return(0);
|
||||
while(1) {
|
||||
stream= input_stream;
|
||||
input_stream= iso_stream_get_input_stream(stream, 0);
|
||||
if(input_stream == NULL)
|
||||
break;
|
||||
}
|
||||
|
||||
/* Obtain disk path if applicable */
|
||||
type_text[0]= 0;
|
||||
Xorriso_stream_type(xorriso, node, stream, type_text, 0);
|
||||
if(strcmp(type_text, "disk") != 0 && strcmp(type_text, "cout") != 0)
|
||||
return(0); /* among othersi rejected: "image" */
|
||||
source_path= iso_stream_get_source_path(stream, 0);
|
||||
if(source_path == NULL)
|
||||
return(0);
|
||||
if(strlen(source_path) >= SfileadrL) {
|
||||
free(source_path);
|
||||
return(0);
|
||||
}
|
||||
strcpy(disk_path, source_path);
|
||||
free(source_path);
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
int Xorriso_show_stream(struct XorrisO *xorriso, void *in_node,
|
||||
char *path, int flag)
|
||||
{
|
||||
|
Reference in New Issue
Block a user