New command -modesty_on_drive, new -as cdrecord -immed, minbuf=, modesty_on_drive=
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
|
||||
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
|
||||
|
||||
Copyright 2007-2013 Thomas Schmitt, <scdbackup@gmx.net>
|
||||
Copyright 2007-2015 Thomas Schmitt, <scdbackup@gmx.net>
|
||||
|
||||
Provided under GPL version 2 or later.
|
||||
|
||||
@ -799,6 +799,94 @@ ex:;
|
||||
}
|
||||
|
||||
|
||||
int Xorriso_option_modesty_on_drive(struct XorrisO *xorriso, char *mode,
|
||||
int flag)
|
||||
{
|
||||
char *npt, *cpt, *ppt;
|
||||
int l, num, set_min;
|
||||
|
||||
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 == 3 && strncmp(cpt, "off", l) == 0) {
|
||||
xorriso->modesty_on_drive= 0;
|
||||
} else if(l == 1 && strncmp(cpt, "0", l) == 0) {
|
||||
xorriso->modesty_on_drive= 0;
|
||||
} else if(l == 2 && strncmp(cpt, "on", l) == 0) {
|
||||
xorriso->modesty_on_drive= 1;
|
||||
} else if(l == 1 && strncmp(cpt, "1", l) == 0) {
|
||||
xorriso->modesty_on_drive= 1;
|
||||
} else if(l == 2 && strncmp(cpt, "-1", l) == 0) {
|
||||
;
|
||||
} else if(*cpt >= '1' && *cpt <= '9') {
|
||||
ppt= cpt;
|
||||
set_min= 2;
|
||||
set_size_percent:;
|
||||
sscanf(ppt, "%d", &num);
|
||||
if(num == -1) {
|
||||
;
|
||||
} else if(num < 25) {
|
||||
bad_percent:;
|
||||
sprintf(xorriso->info_text, "-modesty_on_drive: percentage out of range [25 to 100]");
|
||||
Text_shellsafe(cpt, xorriso->info_text, 1);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
return(0);
|
||||
} else if(num > 100) {
|
||||
goto bad_percent;
|
||||
}
|
||||
if(set_min == 2) {
|
||||
xorriso->modesty_on_drive= 1;
|
||||
}
|
||||
if(set_min)
|
||||
xorriso->min_buffer_percent= num;
|
||||
else
|
||||
xorriso->max_buffer_percent= num;
|
||||
} else if(l >= 12 && strncmp(cpt, "min_percent=", 12) == 0) {
|
||||
ppt= cpt + 12;
|
||||
set_min= 1;
|
||||
goto set_size_percent;
|
||||
} else if(l >= 12 && strncmp(cpt, "max_percent=", 12) == 0) {
|
||||
ppt= cpt + 12;
|
||||
set_min= 0;
|
||||
goto set_size_percent;
|
||||
} else if(l >= 8 && strncmp(cpt, "min_usec=", 8) == 0) {
|
||||
ppt= cpt + 8;
|
||||
set_min= 1;
|
||||
set_sec:;
|
||||
sscanf(ppt, "%d", &num);
|
||||
if(num < 0)
|
||||
num= 0;
|
||||
if(set_min == 1)
|
||||
xorriso->min_buffer_usec= num;
|
||||
else if(set_min == 0)
|
||||
xorriso->max_buffer_percent= num;
|
||||
else
|
||||
xorriso->buffer_timeout_sec= num;
|
||||
} else if(l >= 8 && strncmp(cpt, "max_usec=", 8) == 0) {
|
||||
ppt= cpt + 8;
|
||||
set_min= 0;
|
||||
goto set_sec;
|
||||
} else if(l >= 11 && strncmp(cpt, "timeout_sec=", 11) == 0) {
|
||||
ppt= cpt + 11;
|
||||
set_min= -1;
|
||||
goto set_sec;
|
||||
} else {
|
||||
sprintf(xorriso->info_text, "-modesty_on_drive: unknown mode ");
|
||||
Text_shellsafe(cpt, xorriso->info_text, 1);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
/* Options -mount , -mount_cmd , -session_string */
|
||||
/* @param bit0= -mount_cmd: print mount command to result channel rather
|
||||
than performing it
|
||||
@ -1151,7 +1239,7 @@ int Xorriso_option_no_rc(struct XorrisO *xorriso, int flag)
|
||||
}
|
||||
|
||||
|
||||
/* Option -not_leaf , (-hide_disk_leaf resp. -as mkisofs -hide) */
|
||||
/* Option -not_leaf , (-hide_disk_leaf , -as mkisofs -hide) */
|
||||
/* @param flag bit0-bit5= hide rather than adding to disk_exclusions
|
||||
bit0= add to iso_rr_hidings
|
||||
bit1= add to joliet_hidings
|
||||
@ -1323,7 +1411,7 @@ ex:;
|
||||
}
|
||||
|
||||
|
||||
/* Option -not_paths , (-hide_disk_paths resp. -as mkisofs -hide) */
|
||||
/* Option -not_paths , (-hide_disk_paths , -as mkisofs -hide) */
|
||||
/* @param flag bit0= add to iso_rr_hidings rather than disk_exclusions
|
||||
bit1= add to joliet_hidings rather than disk_exclusions
|
||||
bit2= enable disk pattern expansion regardless of -disk_pattern
|
||||
|
Reference in New Issue
Block a user