From f51c13a87f53644c8f133c6a645ff9d2f548244c Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 7 May 2008 21:43:25 +0000 Subject: [PATCH] New API function isoburn_read_iso_head() --- libisoburn/trunk/libisoburn/burn_wrap.c | 16 +++++++++------- libisoburn/trunk/libisoburn/libisoburn.h | 17 +++++++++++++++++ libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/libisoburn/trunk/libisoburn/burn_wrap.c b/libisoburn/trunk/libisoburn/burn_wrap.c index 8453c1f8..91f6a214 100644 --- a/libisoburn/trunk/libisoburn/burn_wrap.c +++ b/libisoburn/trunk/libisoburn/burn_wrap.c @@ -925,10 +925,11 @@ int isoburn_report_iso_error(int iso_error_code, char msg_text[], int os_errno, } -/* @param flag bit0-7: info return mode +/* API + @param flag bit0-7: info return mode 0= do not return anything in info (do not even touch it) 1= return volume id - @return 1 seems to be a valid ISO image , 0 seems not to be ISO, <0 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, int *image_blocks, char *info, int flag) @@ -937,6 +938,7 @@ int isoburn_read_iso_head(struct burn_drive *d, int lba, int ret, i, info_mode; off_t data_count; + *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) @@ -945,7 +947,7 @@ int isoburn_read_iso_head(struct burn_drive *d, int lba, data= buffer+32*1024; /* is this an ISO image ? */ if(data[0]!=1) - return(0); + return(0); if(strncmp((char *) (data+1),"CD001",5)!=0) return(0); @@ -1174,16 +1176,16 @@ failure:; int isoburn_toc_disc_get_sectors(struct isoburn_toc_disc *disc) { struct isoburn_toc_entry *t; - int count= 0; + int ret= 0; if(disc==NULL) return(0); if(disc->toc!=NULL) { for(t= disc->toc; t!=NULL; t= t->next) - count+= t->track_blocks; + ret= t->start_lba + t->track_blocks; } else if(disc->disc!=NULL) - count= burn_disc_get_sectors(disc->disc); - return(count); + ret= burn_disc_get_sectors(disc->disc); + return(ret); } diff --git a/libisoburn/trunk/libisoburn/libisoburn.h b/libisoburn/trunk/libisoburn/libisoburn.h index ab6756ee..122db931 100644 --- a/libisoburn/trunk/libisoburn/libisoburn.h +++ b/libisoburn/trunk/libisoburn/libisoburn.h @@ -495,6 +495,23 @@ void isoburn_toc_track_get_entry(struct isoburn_toc_track *t, void isoburn_toc_disc_free(struct isoburn_toc_disc *disc); +/** Try whether at the data at the given address look like a ISO 9660 + image header and obtain its alleged size. Depending on the info mode + one other string of text information can be retrieved too. + @since 0.1.6 + @param drive The drive with the media to inspect + @param lba The block number from where to read + @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) + @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, + int *image_blocks, char *info, int flag); + + /* ----------------------------------------------------------------------- */ /* diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index 4b6c9a70..909e160c 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2008.05.07.175640" +#define Xorriso_timestamP "2008.05.07.214343"