From: Nicolas Boullis <nboullis@debian.org>
Date: Sun, 1 Jan 2012 00:41:21 +0100
Subject: Resurrect symbols in libvcdinfo

The library with SONAME libvcdinfo.so.0 used to have symbols vcdinfo_msf2lba,
vcdinfo_lba2msf, vcdinfo_msf2lsn and _vcd_malloc; resurrect them not to break
the ABI.
===================================================================
---
 include/libvcd/info.h |  2 +-
 lib/info.c            | 42 ++++++++++++++++++++++++++++++++++++++++++
 lib/util.c            | 12 ++++++++++++
 3 files changed, 55 insertions(+), 1 deletion(-)

diff --git a/include/libvcd/info.h b/include/libvcd/info.h
index 19f4b4e..643a04b 100644
--- a/include/libvcd/info.h
+++ b/include/libvcd/info.h
@@ -752,7 +752,7 @@ extern "C" {
     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.
diff --git a/lib/info.c b/lib/info.c
index cb58173..ee69f21 100644
--- a/lib/info.c
+++ b/lib/info.c
@@ -1640,6 +1640,48 @@ vcdinfo_inc_msf (uint8_t *p_min, uint8_t *p_sec, int8_t *p_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.
+*/
+#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)
 {
diff --git a/lib/util.c b/lib/util.c
index 3093b98..20cd8e0 100644
--- a/lib/util.c
+++ b/lib/util.c
@@ -118,6 +118,18 @@ _vcd_strsplit(const char str[], char delim) /* fixme -- non-reentrant */
   return strv;
 }
 
+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)
 {
