New info mode 2 with isoburn_read_iso_head()

This commit is contained in:
Thomas Schmitt 2008-07-12 18:18:09 +00:00
parent f232270f8a
commit 0107b4189f
3 changed files with 20 additions and 9 deletions

View File

@ -942,7 +942,8 @@ int isoburn_report_iso_error(int iso_error_code, char msg_text[], int os_errno,
/* @param flag bit0-7: info return mode
0= do not return anything in info (do not even touch it)
1= return volume id
1= copy volume id to info (info needs 33 bytes)
2= do not touch info (caller will copy 64 kB header to it)
bit14= -reserved -
bit15= -reserved-
@return 1 seems to be a valid ISO image , 0 format not recognized, <0 error
@ -971,6 +972,8 @@ int isoburn_read_iso_head_parse(struct burn_drive *d, unsigned char *data,
break;
else
info[i]= 0;
} else if(info_mode==2) {
;
} else {
isoburn_msgs_submit(NULL, 0x00060000,
"Program error: Unknown info mode with isoburn_read_iso_head()",
@ -984,7 +987,8 @@ int isoburn_read_iso_head_parse(struct burn_drive *d, unsigned char *data,
/* API
@param flag bit0-7: info return mode
0= do not return anything in info (do not even touch it)
1= return volume id
1= copy volume id to info (info needs 33 bytes)
2= copy 64 kB header to info (needs 65536 bytes)
bit14= check both half buffers (not only second)
return 2 if found in first block
bit15= return-1 on read error
@ -995,25 +999,27 @@ int isoburn_read_iso_head(struct burn_drive *d, int lba,
int *image_blocks, char *info, int flag)
{
unsigned char buffer[64*1024];
int ret;
int ret, info_mode;
off_t data_count;
info_mode= flag&255;
*image_blocks= 0;
ret = burn_read_data(d, ((off_t) lba) * (off_t) 2048, (char *) buffer,
(off_t) 64*1024, &data_count, 2); /* no error messages */
if(ret<=0)
return(-1*!!(flag&(1<<15)));
if(info_mode==2)
memcpy(info, buffer, 64*1024);
if(flag&(1<<14)) {
ret= isoburn_read_iso_head_parse(d, buffer, image_blocks, info,
flag&255);
ret= isoburn_read_iso_head_parse(d, buffer, image_blocks, info, info_mode);
if(ret<0)
return(ret);
if(ret>0)
return(2);
}
ret= isoburn_read_iso_head_parse(d, buffer+32*1024, image_blocks, info,
flag&255);
info_mode);
return(ret);
}

View File

@ -579,8 +579,13 @@ void isoburn_toc_disc_free(struct isoburn_toc_disc *disc);
@param image_blocks The number of 2048 bytes blocks
@param info Caller provided memory, enough to take eventual info reply
@param flag bit0-7: info return mode
0= do not return anything in info (do not even touch it)
1= return volume id (info needs 33 bytes)
0= do not return anything in info (do not even touch it)
1= copy volume id to info (info needs 33 bytes)
2= @since 0.2.2 :
copy 64 kB header to info (needs 65536 bytes)
bit14= check both half buffers (not only second)
return 2 if found in first block
bit15= return-1 on read error
@return 1 seems to be a valid ISO image , 0 format not recognized, <0 error
*/
int isoburn_read_iso_head(struct burn_drive *d, int lba,

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.07.10.164412"
#define Xorriso_timestamP "2008.07.12.181846"