Preparations for ISO/HFS+ hybrid images by Vladimir Serbinenko
This commit is contained in:
@ -1213,31 +1213,58 @@ int Xorriso__bourne_to_reg(char bourne_expr[], char reg_expr[], int flag)
|
||||
|
||||
int Xorriso__hide_mode(char *mode, int flag)
|
||||
{
|
||||
if(strcmp(mode, "on") == 0)
|
||||
return(1 | 2);
|
||||
else if(strcmp(mode, "iso_rr") == 0)
|
||||
return(1);
|
||||
else if(strcmp(mode, "joliet") == 0)
|
||||
return(2);
|
||||
else if(strcmp(mode, "off") == 0)
|
||||
return(0);
|
||||
return(-1);
|
||||
char *npt, *cpt;
|
||||
int l, value= 0;
|
||||
|
||||
npt= cpt= mode;
|
||||
for(; npt!=NULL; cpt= npt+1) {
|
||||
npt= strchr(cpt,':');
|
||||
if(npt==NULL)
|
||||
l= strlen(cpt);
|
||||
else
|
||||
l= npt-cpt;
|
||||
if(l == 0)
|
||||
continue;
|
||||
if(l == 2 && strncmp(cpt, "on", l) == 0)
|
||||
value= 1 | 2 | 4;
|
||||
else if(l == 6 && strncmp(cpt, "iso_rr", l) == 0)
|
||||
value |= 1;
|
||||
else if(l == 6 && strncmp(cpt, "joliet", l) == 0)
|
||||
value |= 2;
|
||||
else if(l == 7 && strncmp(cpt, "hfsplus", l) == 0)
|
||||
value |= 4;
|
||||
else if(l == 3 && strncmp(cpt, "off", l) == 0)
|
||||
value= 0;
|
||||
else
|
||||
return(-1);
|
||||
}
|
||||
return(value);
|
||||
}
|
||||
|
||||
|
||||
char *Xorriso__hide_mode_text(int hide_mode, int flag)
|
||||
{
|
||||
switch(hide_mode & 3) {
|
||||
case 0:
|
||||
return "off";
|
||||
case 1:
|
||||
return "iso_rr";
|
||||
case 2:
|
||||
return "joliet";
|
||||
case 3:
|
||||
return "on";
|
||||
char *acc= NULL;
|
||||
|
||||
acc = calloc(1, 80);
|
||||
if(acc == NULL)
|
||||
return(NULL);
|
||||
acc[0]= 0;
|
||||
if(hide_mode == 0) {
|
||||
strcat(acc, "off:");
|
||||
} else if(hide_mode == 7) {
|
||||
strcat(acc, "on:");
|
||||
} else {
|
||||
if(hide_mode & 1)
|
||||
strcat(acc, "iso_rr:");
|
||||
if(hide_mode & 2)
|
||||
strcat(acc, "joliet:");
|
||||
if(hide_mode & 4)
|
||||
strcat(acc, "hfsplus:");
|
||||
}
|
||||
return "invalid";
|
||||
if(acc[0])
|
||||
acc[strlen(acc) - 1]= 0; /* cut off last colon */
|
||||
return acc;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user