New address modes 8 and 9 for isoburn_set_msc1(), isoburn_get_mount_params(), isoburn_get_mount_params_v2()

This commit is contained in:
Thomas Schmitt 2024-06-29 23:24:01 +02:00
parent 9ea76568f6
commit 2e4b824d65
3 changed files with 25 additions and 8 deletions

View File

@ -2198,8 +2198,9 @@ int isoburn_set_msc1(struct burn_drive *d, int adr_mode, char *adr_value,
struct isoburn_toc_session **sessions= NULL; struct isoburn_toc_session **sessions= NULL;
struct isoburn_toc_track **tracks= NULL; struct isoburn_toc_track **tracks= NULL;
static char mode_names[][20]= {"auto", "session", "track", "lba", "volid", static char mode_names[][20]= {"auto", "session", "track", "lba", "volid",
"at_time", "not_after", "not_before"}; "at_time", "not_after", "not_before",
static int max_mode_names= 7; "before", "after"};
static int max_mode_names= 9;
regex_t re; regex_t re;
regmatch_t match[1]; regmatch_t match[1];
enum burn_disc_status s; enum burn_disc_status s;
@ -2227,7 +2228,7 @@ not_found:;
if(adr_mode<0 || adr_mode>max_mode_names) if(adr_mode<0 || adr_mode>max_mode_names)
goto unknown_mode; goto unknown_mode;
sprintf(msg, "Failed to find \"%s\" \"%s%s\"", mode_names[adr_mode], sprintf(msg, "Failed to find \"%s\" \"%s%s\"", mode_names[adr_mode],
adr_mode >= 5 && adr_mode <= 7 ? "=" : "", adr_mode >= 5 && adr_mode <= 9 ? "=" : "",
strlen(adr_value)<=80 ? adr_value : "-oversized-string-"); strlen(adr_value)<=80 ? adr_value : "-oversized-string-");
isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0); isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0);
ret= 0; goto ex; ret= 0; goto ex;
@ -2287,7 +2288,7 @@ not_found:;
if(ret==2) if(ret==2)
o->fabricated_msc1-= 16; o->fabricated_msc1-= 16;
} }
} else if(adr_mode >= 4 && adr_mode <= 7) { } else if(adr_mode >= 4 && adr_mode <= 9) {
/* search for volume id that is equal to adr_value */ /* search for volume id that is equal to adr_value */
if(adr_mode == 4 && (flag & 4)) { if(adr_mode == 4 && (flag & 4)) {
ret= regcomp(&re, adr_value, 0); ret= regcomp(&re, adr_value, 0);
@ -2314,7 +2315,7 @@ not_found:;
ret= isoburn_toc_track_get_emul_v2(tracks[0], &lba, &size, volid, 0); ret= isoburn_toc_track_get_emul_v2(tracks[0], &lba, &size, volid, 0);
if(ret < 0) if(ret < 0)
continue; continue;
if(ret == 0 || (adr_mode >= 5 && adr_mode <= 7)) { if(ret == 0 || (adr_mode >= 5 && adr_mode <= 9)) {
isoburn_get_track_lba(tracks[0], &lba, 0); isoburn_get_track_lba(tracks[0], &lba, 0);
info_type= (adr_mode == 4 ? 1 : 3 + !!(flag & 4)); info_type= (adr_mode == 4 ? 1 : 3 + !!(flag & 4));
ret= isoburn_read_iso_head_v2(d, lba, &size, volid, info_type); ret= isoburn_read_iso_head_v2(d, lba, &size, volid, info_type);
@ -2346,6 +2347,14 @@ not_found:;
best_lba= lba; best_lba= lba;
goto take_best_lba; goto take_best_lba;
} }
} else if(adr_mode == 8) {
if(seconds >= (time_t) adr_num)
continue;
} else if(adr_mode == 9) {
if(seconds > (time_t) adr_num) {
best_lba= lba;
goto take_best_lba;
}
} }
} }
best_lba= lba; best_lba= lba;

View File

@ -560,6 +560,10 @@ void isoburn_disc_erase(struct burn_drive *drive, int fast);
not after adr_value (seconds after 1970 GMT) not after adr_value (seconds after 1970 GMT)
7= start lba of first session with modification time 7= start lba of first session with modification time
not before adr_value (seconds after 1970 GMT) not before adr_value (seconds after 1970 GMT)
8= start lba of last session with modification time
before but not at adr_value (seconds after 1970 GMT)
9= start lba of first session with modification time
after but not at adr_value (seconds after 1970 GMT
@param adr_value A string describing the value to be eventually used. @param adr_value A string describing the value to be eventually used.
@param flag Bitfield for control purposes. @param flag Bitfield for control purposes.
bit0= @since 0.2.2 bit0= @since 0.2.2
@ -568,7 +572,7 @@ void isoburn_disc_erase(struct burn_drive *drive, int fast);
at adr_value-16 and eventually adjust setting. at adr_value-16 and eventually adjust setting.
bit1= insist in seeing a disc object with at least one session bit1= insist in seeing a disc object with at least one session
bit2= with adr_mode 4: use adr_value as regular expression bit2= with adr_mode 4: use adr_value as regular expression
with adr_mode 5 to 7: use creation time rather than with adr_mode 5 to 9: use creation time rather than
modification time modification time
*/ */
int isoburn_set_msc1(struct burn_drive *d, int adr_mode, char *adr_value, int isoburn_set_msc1(struct burn_drive *d, int adr_mode, char *adr_value,
@ -802,6 +806,10 @@ int isoburn_read_iso_head_v2(struct burn_drive *d, off_t lba,
not after adr_value (seconds after 1970 GMT) not after adr_value (seconds after 1970 GMT)
7= start lba of first session with modification time 7= start lba of first session with modification time
not before adr_value (seconds after 1970 GMT) not before adr_value (seconds after 1970 GMT)
8= start lba of last session with modification time
before but not at adr_value (seconds after 1970 GMT)
9= start lba of first session with modification time
after but not at adr_value (seconds after 1970 GMT
@param adr_value A string describing the value to be eventually used. @param adr_value A string describing the value to be eventually used.
@param lba returns the block address of the entity, -1 means invalid @param lba returns the block address of the entity, -1 means invalid
@param track returns the track number of the entity, -1 means invalid @param track returns the track number of the entity, -1 means invalid
@ -809,7 +817,7 @@ int isoburn_read_iso_head_v2(struct burn_drive *d, off_t lba,
@param volid returns the volume id of the entity if it is a ISO session @param volid returns the volume id of the entity if it is a ISO session
@param flag Bitfield for control purposes. @param flag Bitfield for control purposes.
bit2= with adr_mode 4: use adr_value as regular expression bit2= with adr_mode 4: use adr_value as regular expression
with adr_mode 5 to 7: use creation time rather than with adr_mode 5 to 9: use creation time rather than
modification time modification time
@return <=0 error , 1 ok, ISO session, 2 ok, not an ISO session @return <=0 error , 1 ok, ISO session, 2 ok, not an ISO session
*/ */

View File

@ -1 +1 @@
#define Xorriso_timestamP "2024.06.29.162751" #define Xorriso_timestamP "2024.06.29.212258"