Removed development macro Libisofs_with_checksumS

and made the affected code unconditional.
This commit is contained in:
2010-05-08 22:24:02 +02:00
parent 9cf460a3b1
commit 3528493b92
11 changed files with 1 additions and 292 deletions

View File

@ -81,14 +81,10 @@ int iso_image_new(const char *name, IsoImage **image)
img->inode_counter = 0;
img->used_inodes = NULL;
img->used_inodes_start = 0;
#ifdef Libisofs_with_checksumS
img->checksum_start_lba = 0;
img->checksum_end_lba = 0;
img->checksum_idx_count = 0;
img->checksum_array = NULL;
#endif
*image = img;
return ISO_SUCCESS;
}
@ -145,17 +141,12 @@ void iso_image_unref(IsoImage *image)
int iso_image_free_checksums(IsoImage *image, int flag)
{
#ifdef Libisofs_with_checksumS
image->checksum_start_lba = 0;
image->checksum_end_lba = 0;
image->checksum_idx_count = 0;
if (image->checksum_array != NULL)
free(image->checksum_array);
image->checksum_array = NULL;
#endif /* Libisofs_with_checksumS */
return 1;
}
@ -592,39 +583,23 @@ ex:;
int iso_image_get_session_md5(IsoImage *image, uint32_t *start_lba,
uint32_t *end_lba, char md5[16], int flag)
{
#ifdef Libisofs_with_checksumS
if (image->checksum_array == NULL || image->checksum_idx_count < 1)
return 0;
*start_lba = image->checksum_start_lba;
*end_lba = image->checksum_end_lba;
memcpy(md5, image->checksum_array, 16);
return ISO_SUCCESS;
#else
return 0;
#endif /* ! Libisofs_with_checksumS */
}
int iso_image_set_checksums(IsoImage *image, char *checksum_array,
uint32_t start_lba, uint32_t end_lba,
uint32_t idx_count, int flag)
{
#ifdef Libisofs_with_checksumS
iso_image_free_checksums(image, 0);
image->checksum_array = checksum_array;
image->checksum_start_lba = start_lba;
image->checksum_end_lba = end_lba;
image->checksum_idx_count = idx_count;
#endif /* Libisofs_with_checksumS */
return 1;
}