Description: Resurrect symbols in libvcdinfo libvcdinfo.so used to provide the following symbols that were drop- ped: vcdinfo_msf2lba, vcdinfo_lba2msf, vcdinfo_msf2lsn, _vcd_malloc This patch resurrects them so as not to restore backwards compatibili- ty with the old ABI. Author: Nicolas Boullis --- vcdimager-2.0.1.old/include/libvcd/info.h +++ vcdimager-2.0.1/include/libvcd/info.h @@ -752,7 +752,7 @@ See also msf_to_lba which uses msf_t as its single parameter. */ void - vcdinfo_lba2msf (lba_t lba, uint8_t *min, uint8_t *sec, uint8_t *frame); + vcdinfo_lba2msf (lba_t lba, uint8_t *p_min, uint8_t *p_sec, uint8_t *p_frame); /*! Get the item id for a given list ID. --- vcdimager-2.0.1.old/lib/info.c +++ vcdimager-2.0.1/lib/info.c @@ -1640,6 +1640,48 @@ } } +/*! + Convert minutes, seconds and frame (MSF components) into a + logical block address (or LBA). + See also cdio_msf_to_lba which uses msf_t as its single parameter. +*/ +#undef vcdinfo_msf2lba +lba_t +vcdinfo_msf2lba (uint8_t min, uint8_t sec, int8_t frame) +{ + return CDIO_CD_FRAMES_PER_SEC*(CDIO_CD_SECS_PER_MIN*min + sec) + frame; +} + +/*! + Convert minutes, seconds and frame (MSF components) into a + logical block address (or LBA). + See also cdio_msf_to_lba which uses msf_t as its single parameter. +*/ +void +vcdinfo_lba2msf (lba_t lba, uint8_t *p_min, uint8_t *p_sec, uint8_t *p_frame) +{ + *p_min = lba / (60*75); + lba %= (60*75); + *p_sec = lba / 75; + *p_frame = lba % 75; +} + +/*! + Convert minutes, seconds and frame (MSF components) into a + logical sector number (or LSN). +*/ +lsn_t +vcdinfo_msf2lsn (uint8_t min, uint8_t sec, int8_t frame) +{ + lba_t lba=75*(60*min + sec) + frame; + if (lba < CDIO_PREGAP_SECTORS) { + vcd_error ("lba (%u) less than pregap sector (%u)", + (unsigned int) lba, CDIO_PREGAP_SECTORS); + return lba; + } + return lba - CDIO_PREGAP_SECTORS; +} + const char * vcdinfo_ofs2str (const vcdinfo_obj_t *p_obj, unsigned int offset, bool ext) { --- vcdimager-2.0.1.old/lib/util.c +++ vcdimager-2.0.1/lib/util.c @@ -119,6 +119,18 @@ } void * +_vcd_malloc (size_t size) +{ + void *new_mem = malloc (size); + + vcd_assert (new_mem != NULL); + + memset (new_mem, 0, size); + + return new_mem; +} + +void * _vcd_memdup (const void *mem, size_t count) { void *new_mem = NULL;