New API call isoburn_igopt_set_pvd_times()

This commit is contained in:
Thomas Schmitt 2010-04-07 20:22:49 +00:00
parent 90cd2f2b12
commit 137d7c4399
4 changed files with 79 additions and 2 deletions

View File

@ -456,7 +456,10 @@ int isoburn_prepare_disc_aux(struct burn_drive *in_d, struct burn_drive *out_d,
0, "FAILURE", 0); 0, "FAILURE", 0);
{ret= -1; goto ex;} {ret= -1; goto ex;}
} }
iso_write_opts_set_pvd_times(wopts,
opts->vol_creation_time, opts->vol_modification_time,
opts->vol_expiration_time, opts->vol_effective_time,
opts->vol_uuid);
ret = isoburn_disc_track_lba_nwa(out_d, NULL, 0, &lba, &nwa); ret = isoburn_disc_track_lba_nwa(out_d, NULL, 0, &lba, &nwa);
opts->effective_lba= nwa; opts->effective_lba= nwa;
@ -860,6 +863,10 @@ int isoburn_igopt_new(struct isoburn_imgen_opts **new_o, int flag)
o->data_start_lba= -1; o->data_start_lba= -1;
o->system_area_data= NULL; o->system_area_data= NULL;
o->system_area_options= 0; o->system_area_options= 0;
o->vol_creation_time= 0;
o->vol_modification_time= 0;
o->vol_expiration_time= 0;
o->vol_effective_time= 0;
return(1); return(1);
} }
@ -1103,3 +1110,32 @@ int isoburn_igopt_get_system_area(struct isoburn_imgen_opts *opts,
} }
int isoburn_igopt_set_pvd_times(struct isoburn_imgen_opts *opts,
time_t vol_creation_time, time_t vol_modification_time,
time_t vol_expiration_time, time_t vol_effective_time,
char *vol_uuid)
{
opts->vol_creation_time = vol_creation_time;
opts->vol_modification_time = vol_modification_time;
opts->vol_expiration_time = vol_expiration_time;
opts->vol_effective_time = vol_effective_time;
strncpy(opts->vol_uuid, vol_uuid, 16);
opts->vol_uuid[16] = 0;
return(1);
}
int isoburn_igopt_get_pvd_times(struct isoburn_imgen_opts *opts,
time_t *vol_creation_time, time_t *vol_modification_time,
time_t *vol_expiration_time, time_t *vol_effective_time,
char vol_uuid[17])
{
*vol_creation_time = opts->vol_creation_time;
*vol_modification_time = opts->vol_modification_time;
*vol_expiration_time = opts->vol_expiration_time;
*vol_effective_time = opts->vol_effective_time;
strcpy(vol_uuid, opts->vol_uuid);
return(1);
}

View File

@ -502,6 +502,15 @@ struct isoburn_imgen_opts {
*/ */
int system_area_options; int system_area_options;
/* User settable PVD time stamps */
time_t vol_creation_time;
time_t vol_modification_time;
time_t vol_expiration_time;
time_t vol_effective_time;
/* To eventually override vol_modification_time by unconverted string
and timezone 0 */
char vol_uuid[17];
}; };

View File

@ -1189,6 +1189,38 @@ int isoburn_igopt_set_system_area(struct isoburn_imgen_opts *o,
int isoburn_igopt_get_system_area(struct isoburn_imgen_opts *o, int isoburn_igopt_get_system_area(struct isoburn_imgen_opts *o,
char data[32768], int *options); char data[32768], int *options);
/** Explicitely set the four timestamps of the emerging ISO image.
Default with all parameters is 0.
@since 0.5.4
ECMA-119 defines the timestamps in the Primary Volume Descriptor as:
@param creation_time
When "the information in the volume was created."
A value of 0 means that the timepoint of write start is to be used.
@param modification_time
When "the informationin the volume was last modified."
A value of 0 means that the timepoint of write start is to be used.
@param expiration_time
When "the information in the volume may be regarded as obsolete."
A value of 0 means that the information never shall expire.
@param effective_time
When "the information in the volume may be used."
A value of 0 means that not such retention is intended.
@param uuid
If this text is not empty, then it overrides vol_modification_time
by copying the first 16 decimal digits from uuid, eventually
padding up with decimal '1', and writing a NUL-byte as timezone GMT.
It should express a reasonable time in form YYYYMMDDhhmmsscc
E.g.: 2010040711405800 = 7 Apr 2010 11:40:58 (+0 centiseconds)
@return 1 success, <=0 failure
*/
int isoburn_igopt_set_pvd_times(struct isoburn_imgen_opts *opts,
time_t creation_time, time_t modification_time,
time_t expiration_time, time_t effective_time,
char *uuid);
int isoburn_igopt_get_pvd_times(struct isoburn_imgen_opts *opts,
time_t *creation_time, time_t *modification_time,
time_t *expiration_time, time_t *effective_time,
char uuid[17]);
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/* End of Options for image generation */ /* End of Options for image generation */

View File

@ -1 +1 @@
#define Xorriso_timestamP "2010.04.07.073024" #define Xorriso_timestamP "2010.04.07.202148"