New -as mkisofs options -hide, -hide-joliet, -hide-list, -hide-joliet-list

This commit is contained in:
2010-06-23 13:43:40 +00:00
parent c933076b4b
commit 558667d32a
14 changed files with 394 additions and 120 deletions

View File

@ -568,9 +568,12 @@ ex:;
/* @param flag bit1= add '+' to perms
bit2-3: hidden_state : 0=off, 1=iso_rr, 2=joliet= 3=on
*/
int Xorriso__mode_to_perms(mode_t st_mode, char perms[11], int flag)
{
int hidden_state;
strcpy(perms,"--------- ");
if(st_mode&S_IRUSR) perms[0]= 'r';
if(st_mode&S_IWUSR) perms[1]= 'w';
@ -599,8 +602,19 @@ int Xorriso__mode_to_perms(mode_t st_mode, char perms[11], int flag)
else
perms[8]= 'T';
}
if(flag & 2)
perms[9]= '+';
hidden_state= (flag >> 2) & 3;
if(hidden_state == 1)
perms[9]= 'I';
else if(hidden_state == 2)
perms[9]= 'J';
else if(hidden_state == 3)
perms[9]= 'H';
if(flag & 2) {
if(hidden_state)
perms[9]= tolower(perms[9]);
else
perms[9]= '+';
}
return(1);
}
@ -611,7 +625,7 @@ int Xorriso__mode_to_perms(mode_t st_mode, char perms[11], int flag)
*/
int Xorriso_format_ls_l(struct XorrisO *xorriso, struct stat *stbuf, int flag)
{
int show_major_minor= 0, high_shift= 0, high_mask= 0, hidden_state;
int show_major_minor= 0, high_shift= 0, high_mask= 0;
char *rpt, perms[11], mm_text[80];
mode_t st_mode;
dev_t dev, major, minor;
@ -623,15 +637,7 @@ int Xorriso_format_ls_l(struct XorrisO *xorriso, struct stat *stbuf, int flag)
if(S_ISDIR(st_mode))
strcat(rpt, "d");
else if(S_ISREG(st_mode)) {
hidden_state= (flag >> 2) & 3;
if(hidden_state == 1)
strcat(rpt, "R");
else if(hidden_state == 2)
strcat(rpt, "J");
else if(hidden_state == 3)
strcat(rpt, "H");
else
strcat(rpt, "-");
strcat(rpt, "-");
} else if(S_ISLNK(st_mode))
strcat(rpt, "l");
else if(S_ISBLK(st_mode)) {
@ -649,7 +655,7 @@ int Xorriso_format_ls_l(struct XorrisO *xorriso, struct stat *stbuf, int flag)
else
strcat(rpt, "?");
Xorriso__mode_to_perms(st_mode, perms, flag & 2);
Xorriso__mode_to_perms(st_mode, perms, flag & (2 | 12));
strcat(rpt, perms);
sprintf(rpt+strlen(rpt)," %3u ",(unsigned int) stbuf->st_nlink);