Hello community,
here is the log from the commit of package libdiscid
checked in at Fri Aug 15 00:55:07 CEST 2008.
--------
--- libdiscid/libdiscid.changes 2007-12-05 14:43:01.000000000 +0100
+++ libdiscid/libdiscid.changes 2008-08-14 06:40:57.000000000 +0200
@@ -1,0 +2,7 @@
+Thu Aug 14 06:37:47 CEST 2008 - crrodriguez@suse.de
+
+- update to version 0.2.1 libdiscid1
+ * Addded the discid_get_webservice_url() function
+ * other non linux relevant changes
+
+-------------------------------------------------------------------
Old:
----
libdiscid-0.1.1.tar.bz2
New:
----
libdiscid-0.2.1.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libdiscid.spec ++++++
--- /var/tmp/diff_new_pack.Rr8811/_old 2008-08-15 00:51:13.000000000 +0200
+++ /var/tmp/diff_new_pack.Rr8811/_new 2008-08-15 00:51:13.000000000 +0200
@@ -1,18 +1,26 @@
#
-# spec file for package libdiscid (Version 0.1.1)
+# spec file for package libdiscid (Version 0.2.1)
#
-# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
-# This file and all modifications and additions to the pristine
-# package are under the same license as the package itself.
+# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
+
Name: libdiscid
Url: http://musicbrainz.org/doc/libdiscid
-Version: 0.1.1
-Release: 2
+Version: 0.2.1
+Release: 1
License: LGPL v2.1 or later
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Group: Development/Libraries/C and C++
@@ -39,13 +47,14 @@
Luk� Lalinsk�
Robert Kaye
-%package -n libdiscid0
+%package -n libdiscid1
+License: LGPL v2.1 or later
Group: Development/Libraries/C and C++
Summary: Library for creating MusicBrainz DiscIDs from audio CDs
# provide for debuginfo package (always requiring main package name)
Provides: libdiscid = %{version}-%{release}
-%description -n libdiscid0
+%description -n libdiscid1
libdiscid is a C library for creating MusicBrainz DiscIDs from audio
CDs. It reads a CD's table of contents (TOC) and generates an
identifier which can be used to lookup the CD at MusicBrainz.
@@ -66,9 +75,10 @@
Robert Kaye
%package devel
+License: LGPL v2.1 or later
Group: Development/Libraries/C and C++
Summary: Library for creating MusicBrainz DiscIDs from audio CDs
-Requires: libdiscid0 = %{version}
+Requires: libdiscid1 = %{version}
%description devel
libdiscid is a C library for creating MusicBrainz DiscIDs from audio
@@ -94,15 +104,7 @@
%setup -q
%build
-autoreconf -fi
-CFLAGS="%{optflags}"
-CXXFLAGS="%{optflags}"
-%if 0%{?suse_version} > 1000
-CFLAGS="$CFLAGS -fstack-protector"
-CXXFLAGS="$CXXFLAGS -fstack-protector"
-%endif
-export CFLAGS
-export CXXFLAGS
+autoreconf -fiv
%configure --disable-static --with-pic
%{__make} %{?jobs:-j%jobs}
@@ -113,13 +115,13 @@
%clean
%{__rm} -rf "$RPM_BUILD_ROOT"
-%post -n libdiscid0 -p /sbin/ldconfig
+%post -n libdiscid1 -p /sbin/ldconfig
-%postun -n libdiscid0 -p /sbin/ldconfig
+%postun -n libdiscid1 -p /sbin/ldconfig
-%files -n libdiscid0
+%files -n libdiscid1
%defattr(-,root,root)
-%{_libdir}/libdiscid.so.0*
+%{_libdir}/libdiscid.so.1*
%files devel
%defattr(-,root,root)
@@ -129,9 +131,13 @@
%{_libdir}/pkgconfig/libdiscid.pc
%changelog
-* Wed Dec 05 2007 - ro@suse.de
+* Thu Aug 14 2008 crrodriguez@suse.de
+- update to version 0.2.1 libdiscid1
+ * Addded the discid_get_webservice_url() function
+ * other non linux relevant changes
+* Wed Dec 05 2007 ro@suse.de
- provide main package name in library package for debuginfo
-* Sat Sep 01 2007 - crrodriguez@suse.de
+* Sat Sep 01 2007 crrodriguez@suse.de
- initial version for CODE 11 as a dependency of libmusicbrainz3.
-* Sat Aug 18 2007 - crrodriguez@suse.de
+* Sun Aug 19 2007 crrodriguez@suse.de
- firs version for the opensuse buildservice
++++++ libdiscid-0.1.1.tar.bz2 -> libdiscid-0.2.1.tar.bz2 ++++++
++++ 7572 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.1.1/AUTHORS new/libdiscid-0.2.1/AUTHORS
--- old/libdiscid-0.1.1/AUTHORS 2006-09-04 18:07:50.000000000 +0200
+++ new/libdiscid-0.2.1/AUTHORS 2008-03-13 07:17:22.000000000 +0100
@@ -17,5 +17,8 @@
- Invented and originally implemented the DiscID algorithm.
- Ported the darwin code.
+ Patrick Hurrelmann <outi at bytephobia.de>
+ - Implemented and tested FreeBSD support.
+
--
-$Id$
+$Id: AUTHORS 9736 2008-03-09 13:37:29Z matt $
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.1.1/ChangeLog new/libdiscid-0.2.1/ChangeLog
--- old/libdiscid-0.1.1/ChangeLog 2007-01-16 18:39:56.000000000 +0100
+++ new/libdiscid-0.2.1/ChangeLog 2008-03-13 07:17:22.000000000 +0100
@@ -2,9 +2,23 @@
--------------------
+libdiscid-0.2.1:
+
+ - Added code for automatic CD drive detection on darwin (Rob).
+
+
+libdiscid-0.2.0:
+
+ - Use accurate TOC reading method for multi-session CDs on
+ Windows NT/2000/XP (Lukas).
+ - Replace custom MSVC makefile with CMake build system (Lukas).
+ - Added support for FreeBSD (Patrick Hurrelmann).
+ - Addded the discid_get_webservice_url() function (Rob).
+
+
libdiscid-0.1.1:
- - Use generic 'cdaudio' device name on windows (Luks).
+ - Use generic 'cdaudio' device name on windows (Lukas).
libdiscid-0.1.0:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.1.1/CMakeLists.txt new/libdiscid-0.2.1/CMakeLists.txt
--- old/libdiscid-0.1.1/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/libdiscid-0.2.1/CMakeLists.txt 2008-03-13 07:17:22.000000000 +0100
@@ -0,0 +1,68 @@
+PROJECT(libdiscid)
+SET(PROJECT_VERSION 0.1.1)
+
+# 1. If the library source code has changed at all since the last update, then increment revision.
+# 2. If any interfaces have been added, removed, or changed since the last update, increment current, and set revision to 0.
+# 3. If any interfaces have been added since the last public release, then increment age.
+# 4. If any interfaces have been removed since the last public release, then set age to 0.
+SET(libdiscid_SOVERSION_CURRENT 0)
+SET(libdiscid_SOVERSION_REVISION 1)
+SET(libdiscid_SOVERSION_AGE 0)
+
+SET(libdiscid_VERSION ${libdiscid_SOVERSION_CURRENT}.${libdiscid_SOVERSION_AGE}.${libdiscid_SOVERSION_REVISION})
+SET(libdiscid_SOVERSION ${libdiscid_SOVERSION_CURRENT})
+
+SET(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)")
+SET(EXEC_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Installation prefix for executables and object code libraries" FORCE)
+SET(BIN_INSTALL_DIR ${EXEC_INSTALL_PREFIX}/bin CACHE PATH "Installation prefix for user executables" FORCE)
+SET(LIB_INSTALL_DIR ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX} CACHE PATH "Installation prefix for object code libraries" FORCE)
+SET(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include CACHE PATH "Installation prefix for C header files" FORCE)
+
+# compatibility with automake
+SET(PACKAGE ${PROJECT_NAME})
+SET(VERSION ${PROJECT_VERSION})
+SET(prefix ${CMAKE_INSTALL_PREFIX})
+SET(exec_prefix ${EXEC_INSTALL_PREFIX})
+SET(includedir ${INCLUDE_INSTALL_DIR})
+SET(libdir ${LIB_INSTALL_DIR})
+
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libdiscid.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libdiscid.pc)
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile)
+
+IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ SET(libdiscid_OSDEP_SRCS src/disc_linux.c)
+ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ SET(libdiscid_OSDEP_SRCS src/disc_darwin.c)
+ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+ SET(libdiscid_OSDEP_SRCS src/disc_win32.c src/disc_win32_new.c)
+ SET(libdiscid_OSDEP_LIBS winmm)
+ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ MESSAGE(FATAL_ERROR "unsupported operating system")
+ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+
+ADD_LIBRARY(libdiscid SHARED ${libdiscid_OSDEP_SRCS} src/base64.c src/disc.c src/sha1.c)
+TARGET_LINK_LIBRARIES(libdiscid ${libdiscid_OSDEP_LIBS})
+SET_TARGET_PROPERTIES(libdiscid PROPERTIES
+ OUTPUT_NAME discid
+ VERSION ${libdiscid_VERSION}
+ SOVERSION ${libdiscid_SOVERSION}
+)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+ADD_EXECUTABLE(discid examples/discid.c)
+TARGET_LINK_LIBRARIES(discid libdiscid)
+
+ADD_EXECUTABLE(test_discid test/test_discid.c)
+TARGET_LINK_LIBRARIES(test_discid libdiscid)
+
+INSTALL(TARGETS libdiscid DESTINATION ${LIB_INSTALL_DIR})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libdiscid.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+INSTALL(FILES include/discid/discid.h DESTINATION ${INCLUDE_INSTALL_DIR}/discid)
+
+ADD_CUSTOM_TARGET(docs doxygen)
+
+ADD_CUSTOM_TARGET(dist
+ rm -rf "${PROJECT_NAME}-${PROJECT_VERSION}"
+ COMMAND svn export http://svn.musicbrainz.org/${PROJECT_NAME}/trunk "${PROJECT_NAME}-${PROJECT_VERSION}"
+ COMMAND tar -zcvf "${PROJECT_NAME}-${PROJECT_VERSION}.tar.gz" "${PROJECT_NAME}-${PROJECT_VERSION}"
+)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.1.1/configure.ac new/libdiscid-0.2.1/configure.ac
--- old/libdiscid-0.1.1/configure.ac 2007-01-16 18:34:07.000000000 +0100
+++ new/libdiscid-0.2.1/configure.ac 2008-03-13 07:17:22.000000000 +0100
@@ -5,7 +5,7 @@
dnl The libtool version number has to be changed ALWAYS, no matter how
dnl small the change to the source code was!
dnl
-AC_INIT(libdiscid, 0.1.1)
+AC_INIT(libdiscid, 0.2.1)
AC_CONFIG_SRCDIR(src/disc.c)
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS(config.h)
@@ -17,10 +17,8 @@
#*-beos*) os=beos; LIBS='-lbe -lroot' ;;
*-mingw*) os=win32; LIBS='-lwinmm' ;;
*-cygwin*) os=win32; LIBS='-lwinmm' ;;
- #*-freebsd*) os=freebsd ;;
- *-darwin*) os=darwin ;;
- #*-irix*) os=irix; CXXFLAGS="$CFLAGS -fsquangle";
- # LIBS='-lcdaudio -lmediad -lds' ;;
+ *-freebsd*) os=freebsd ;;
+ *-darwin*) os=darwin; LIBS='-framework CoreFoundation -framework IOKit';;
*-linux*) os=linux ;;
#*-netbsd*) os=netbsd ;;
#*-openbsd*) os=openbsd ;;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.1.1/discid.def new/libdiscid-0.2.1/discid.def
--- old/libdiscid-0.1.1/discid.def 2006-09-04 18:07:50.000000000 +0200
+++ new/libdiscid-0.2.1/discid.def 1970-01-01 01:00:00.000000000 +0100
@@ -1,16 +0,0 @@
-LIBRARY discid
-EXPORTS
- discid_new
- discid_free
- discid_read
- discid_put
- discid_get_error_msg
- discid_get_id
- discid_get_freedb_id
- discid_get_submission_url
- discid_get_default_device
- discid_get_first_track_num
- discid_get_last_track_num
- discid_get_sectors
- discid_get_track_offset
- discid_get_track_length
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.1.1/examples/discid.c new/libdiscid-0.2.1/examples/discid.c
--- old/libdiscid-0.1.1/examples/discid.c 2007-01-16 18:31:33.000000000 +0100
+++ new/libdiscid-0.2.1/examples/discid.c 2008-03-13 07:17:22.000000000 +0100
@@ -18,7 +18,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- $Id: discid.c 8505 2006-09-30 00:02:18Z luks $
+ $Id: discid.c 9569 2007-10-26 22:04:08Z robert $
--------------------------------------------------------------------------- */
#include
@@ -57,6 +57,7 @@
}
printf("Submit via : %s\n", discid_get_submission_url(disc));
+ printf("WS url : %s\n", discid_get_webservice_url(disc));
discid_free(disc);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.1.1/include/discid/discid.h new/libdiscid-0.2.1/include/discid/discid.h
--- old/libdiscid-0.1.1/include/discid/discid.h 2007-01-16 18:31:33.000000000 +0100
+++ new/libdiscid-0.2.1/include/discid/discid.h 2008-03-13 07:17:20.000000000 +0100
@@ -18,12 +18,23 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- $Id: discid.h 8505 2006-09-30 00:02:18Z luks $
+ $Id: discid.h 9569 2007-10-26 22:04:08Z robert $
--------------------------------------------------------------------------- */
#ifndef MUSICBRAINZ_DISC_ID_H
#define MUSICBRAINZ_DISC_ID_H
+#ifdef WIN32
+# ifdef libdiscid_EXPORTS
+# define LIBDISCID_API __declspec(dllexport)
+# else
+# define LIBDISCID_API __declspec(dllimport)
+# endif
+#else
+# define LIBDISCID_API
+#endif
+
+
#ifdef __cplusplus
extern "C" {
@@ -90,7 +101,7 @@
*
* @return a DiscId object, or NULL.
*/
-DiscId *discid_new();
+LIBDISCID_API DiscId *discid_new();
/**
@@ -98,7 +109,7 @@
*
* @param d a DiscId object created by discid_new()
*/
-void discid_free(DiscId *d);
+LIBDISCID_API void discid_free(DiscId *d);
/**
@@ -118,7 +129,7 @@
* @param device an operating system dependent device identifier, or NULL
* @return true if successful, or false on error.
*/
-int discid_read(DiscId *d, const char *device);
+LIBDISCID_API int discid_read(DiscId *d, const char *device);
/**
@@ -142,7 +153,7 @@
* @param offsets a pointer to an array of 100 track offsets
* @return true if the given data was valid, and false on error
*/
-int discid_put(DiscId *d, int first, int last, int *offsets);
+LIBDISCID_API int discid_put(DiscId *d, int first, int last, int *offsets);
/**
@@ -154,7 +165,7 @@
* @param d a DiscId object created by discid_new()
* @return a string describing the error that occurred
*/
-char *discid_get_error_msg(DiscId *d);
+LIBDISCID_API char *discid_get_error_msg(DiscId *d);
/**
@@ -165,7 +176,7 @@
* @param d a DiscId object created by discid_new()
* @return a string containing a MusicBrainz DiscID
*/
-char *discid_get_id(DiscId *d);
+LIBDISCID_API char *discid_get_id(DiscId *d);
/**
@@ -176,7 +187,7 @@
* @param d a DiscId object created by discid_new()
* @return a string containing a FreeDB DiscID
*/
-char *discid_get_freedb_id(DiscId *d);
+LIBDISCID_API char *discid_get_freedb_id(DiscId *d);
/**
@@ -191,15 +202,27 @@
* @param d a DiscId object created by discid_new()
* @return a string containing an URL
*/
-char *discid_get_submission_url(DiscId *d);
+LIBDISCID_API char *discid_get_submission_url(DiscId *d);
+/**
+ * Return an URL for retrieving CD information from MusicBrainz' web service
+ *
+ * The URL provides the CD information in XML.
+ * See http://musicbrainz.org/development/mmd for details.
+ *
+ * The returned string is only valid as long as the DiscId object exists.
+ *
+ * @param d a DiscId object created by discid_new()
+ * @return a string containing an URL
+ */
+LIBDISCID_API char *discid_get_webservice_url(DiscId *d);
/**
* Return the name of the default disc drive for this operating system.
*
* @return a string containing an operating system dependent device identifier
*/
-char *discid_get_default_device(void);
+LIBDISCID_API char *discid_get_default_device(void);
/**
@@ -208,7 +231,7 @@
* @param d a DiscId object created by discid_new()
* @return the number of the first track
*/
-int discid_get_first_track_num(DiscId *d);
+LIBDISCID_API int discid_get_first_track_num(DiscId *d);
/**
@@ -217,7 +240,7 @@
* @param d a DiscId object created by discid_new()
* @return the number of the last track
*/
-int discid_get_last_track_num(DiscId *d);
+LIBDISCID_API int discid_get_last_track_num(DiscId *d);
/**
@@ -226,7 +249,7 @@
* @param d a DiscId object created by discid_new()
* @return the length of the disc in sectors
*/
-int discid_get_sectors(DiscId *d);
+LIBDISCID_API int discid_get_sectors(DiscId *d);
/**
@@ -239,7 +262,7 @@
* @param track_num the number of a track
* @return sector offset of the specified track
*/
-int discid_get_track_offset(DiscId *d, int track_num);
+LIBDISCID_API int discid_get_track_offset(DiscId *d, int track_num);
/**
@@ -252,7 +275,7 @@
* @param track_num the number of a track
* @return length of the specified track
*/
-int discid_get_track_length(DiscId *d, int track_num);
+LIBDISCID_API int discid_get_track_length(DiscId *d, int track_num);
#ifdef __cplusplus
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.1.1/include/discid/discid_private.h new/libdiscid-0.2.1/include/discid/discid_private.h
--- old/libdiscid-0.1.1/include/discid/discid_private.h 2007-01-16 18:31:33.000000000 +0100
+++ new/libdiscid-0.2.1/include/discid/discid_private.h 2008-03-13 07:17:20.000000000 +0100
@@ -18,7 +18,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- $Id: discid_private.h 8505 2006-09-30 00:02:18Z luks $
+ $Id: discid_private.h 9569 2007-10-26 22:04:08Z robert $
--------------------------------------------------------------------------- */
/*
@@ -43,6 +43,8 @@
/* The URL that can be used for submitting DiscIDs (no parameters yet) */
#define MB_SUBMISSION_URL "http://mm.musicbrainz.org/bare/cdlookup.html"
+/* The URL that can be used for retrieving XML for a CD */
+#define MB_WEBSERVICE_URL "http://mm.musicbrainz.org/ws/1/release"
/*
* This data structure represents an audio disc.
@@ -58,6 +60,7 @@
char id[MB_DISC_ID_LENGTH+1];
char freedb_id[FREEDB_DISC_ID_LENGTH+1];
char submission_url[MB_MAX_URL_LENGTH+1];
+ char webservice_url[MB_MAX_URL_LENGTH+1];
char error_msg[MB_ERROR_MSG_LENGTH+1];
int success;
} mb_disc_private;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.1.1/Makefile.am new/libdiscid-0.2.1/Makefile.am
--- old/libdiscid-0.1.1/Makefile.am 2007-01-16 18:31:33.000000000 +0100
+++ new/libdiscid-0.2.1/Makefile.am 2008-03-13 07:17:22.000000000 +0100
@@ -17,7 +17,7 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
-# $Id: Makefile.am 8505 2006-09-30 00:02:18Z luks $
+# $Id: Makefile.am 9183 2007-06-16 11:52:50Z luks $
#
AUTOMAKE_OPTIONS = foreign
@@ -26,4 +26,4 @@
pcdir = $(libdir)/pkgconfig
pc_DATA = libdiscid.pc
-EXTRA_DIST = libdiscid.pc.in Doxyfile.in Makefile.msvc discid.def
+EXTRA_DIST = libdiscid.pc.in Doxyfile.in CMakeLists.txt
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.1.1/Makefile.msvc new/libdiscid-0.2.1/Makefile.msvc
--- old/libdiscid-0.1.1/Makefile.msvc 2006-09-04 18:07:50.000000000 +0200
+++ new/libdiscid-0.2.1/Makefile.msvc 1970-01-01 01:00:00.000000000 +0100
@@ -1,67 +0,0 @@
-# Usage:
-# nmake -f Makefile.msvc
-#
-# Flags that can be set on the nmake command line:
-# MFLAGS={/MT|/MD} for defining the compilation model
-# MFLAGS=/MT (the default) Multi-threaded, statically linked - libcmt.lib
-# MFLAGS=/MD Multi-threaded, dynamically linked - msvcrt.lib
-# DEBUG=1 for compiling with debugging information
-#
-
-!ifndef DEBUG
-DEBUG = 0
-!endif
-
-!ifndef MFLAGS
-MFLAGS = /MT
-!endif
-
-!if $(DEBUG)
-OPTIMFLAGS = /Od
-!else
-OPTIMFLAGS = /DNDEBUG /Ox
-!endif
-
-CFLAGS = /nologo $(MFLAGS) $(OPTIMFLAGS) /W3 /Iinclude
-
-LDFLAGS = /nologo /NODEFAULTLIB:LIBC
-
-SHAREDLIB = discid.dll
-IMPLIB = discid.dll.lib
-STATICLIB = discid.lib
-
-OBJS = \
- src\base64.obj \
- src\disc.obj \
- src\disc_win32.obj \
- src\sha1.obj
-
-all: $(SHAREDLIB) $(STATICLIB) examples\discid.exe
-
-$(SHAREDLIB): $(OBJS)
- link $(LDFLAGS) /dll /out:$(SHAREDLIB) /def:discid.def /implib:$(IMPLIB) winmm.lib $(OBJS)
-
-$(IMPLIB): $(SHAREDLIB)
-
-$(STATICLIB): $(OBJS)
- lib /nologo /out:$(STATICLIB) $(OBJS)
-
-.c.obj:
- cl /c $(CFLAGS) /Fo$@ $<
-
-examples\discid.exe: examples\discid.c $(STATICLIB)
- cl /c $(CFLAGS) /Foexamples\discid.obj examples\discid.c
- link $(LDFLAGS) /out:$@ examples\discid.obj $(STATICLIB) winmm.lib
-
-test\test_discid.exe: test\test_discid.c $(STATICLIB)
- cl /c $(CFLAGS) /Fotest\test_discid.obj test\test_discid.c
- link $(LDFLAGS) /out:$@ test\test_discid.obj $(STATICLIB) winmm.lib
-
-check: test\test_discid.exe
- test\test_discid.exe
-
-clean:
- -del $(OBJS) $(SHAREDLIB) $(IMPLIB) $(STATICLIB)
- -del examples\discid.exe examples\discid.obj
- -del test\test_discid.exe test\test_discid.obj
-
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.1.1/src/disc.c new/libdiscid-0.2.1/src/disc.c
--- old/libdiscid-0.1.1/src/disc.c 2007-01-16 18:31:33.000000000 +0100
+++ new/libdiscid-0.2.1/src/disc.c 2008-03-13 07:17:21.000000000 +0100
@@ -20,7 +20,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- $Id: disc.c 8505 2006-09-30 00:02:18Z luks $
+ $Id: disc.c 9569 2007-10-26 22:04:08Z robert $
--------------------------------------------------------------------------- */
#include
@@ -40,7 +40,7 @@
static void create_disc_id(mb_disc_private *d, char buf[]);
static void create_freedb_disc_id(mb_disc_private *d, char buf[]);
static void create_submission_url(mb_disc_private *d, char buf[]);
-
+static void create_webservice_url(mb_disc_private *d, char buf[]);
/****************************************************************************
@@ -112,6 +112,19 @@
return disc->submission_url;
}
+char *discid_get_webservice_url(DiscId *d) {
+ mb_disc_private *disc = (mb_disc_private *) d;
+ assert( disc != NULL );
+ assert( disc->success );
+
+ if ( ! disc->success )
+ return NULL;
+
+ if ( strlen(disc->webservice_url) == 0 )
+ create_webservice_url(disc, disc->webservice_url);
+
+ return disc->webservice_url;
+}
int discid_read(DiscId *d, const char *device) {
mb_disc_private *disc = (mb_disc_private *) d;
@@ -311,4 +324,31 @@
}
}
+/*
+ * Create a web service URL based on the TOC data found in the mb_disc_private
+ * object. The URL is placed in the provided string buffer.
+ */
+static void create_webservice_url(mb_disc_private *d, char buf[]) {
+ char tmp[1024];
+ int i;
+
+ assert( d != NULL );
+
+ strcpy(buf, MB_WEBSERVICE_URL);
+
+ strcat(buf, "?type=xml&discid=");
+ strcat(buf, discid_get_id((DiscId *) d));
+
+ sprintf(tmp, "&toc=%d+%d+%d",
+ d->first_track_num,
+ d->last_track_num,
+ d->track_offsets[0]);
+ strcat(buf, tmp);
+
+ for (i = d->first_track_num; i <= d->last_track_num; i++) {
+ sprintf(tmp, "+%d", d->track_offsets[i]);
+ strcat(buf, tmp);
+ }
+}
+
/* EOF */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.1.1/src/disc_darwin.c new/libdiscid-0.2.1/src/disc_darwin.c
--- old/libdiscid-0.1.1/src/disc_darwin.c 2007-01-16 18:31:33.000000000 +0100
+++ new/libdiscid-0.2.1/src/disc_darwin.c 2008-03-13 07:17:21.000000000 +0100
@@ -33,26 +33,119 @@
#include
#include
#include
+#include
+#include
+#include
+#include
+#include
#include
#include
+#include
+
+#include
#include "discid/discid_private.h"
-#define MB_DEFAULT_DEVICE "/dev/rdisk1";
#define TOC_BUFFER_LEN 1024
+#define MAXPATHLEN 1024
+
+static char defaultDevice[MAXPATHLEN] = "\0";
+
+static kern_return_t find_ejectable_cd_media( io_iterator_t *mediaIterator )
+{
+ mach_port_t masterPort;
+ kern_return_t kernResult;
+ CFMutableDictionaryRef classesToMatch;
-char *mb_disc_get_default_device_unportable(void) {
- return MB_DEFAULT_DEVICE;
+ kernResult = IOMasterPort( MACH_PORT_NULL, &masterPort );
+ if ( kernResult != KERN_SUCCESS )
+ return kernResult;
+
+ // CD media are instances of class kIOCDMediaClass.
+ classesToMatch = IOServiceMatching( kIOCDMediaClass );
+ if ( classesToMatch != NULL )
+ {
+ // Each IOMedia object has a property with key kIOMediaEjectableKey
+ // which is true if the media is indeed ejectable. So add this
+ // property to the CFDictionary for matching.
+ CFDictionarySetValue( classesToMatch, CFSTR( kIOMediaEjectableKey ), kCFBooleanTrue );
+ }
+
+ return IOServiceGetMatchingServices( masterPort, classesToMatch, mediaIterator );
}
-int mb_disc_read_unportable(mb_disc_private *disc, const char *device) {
+static kern_return_t get_device_file_path( io_iterator_t mediaIterator, char *deviceFilePath, CFIndex maxPathSize )
+{
+ io_object_t nextMedia;
+ kern_return_t kernResult = KERN_FAILURE;
+
+ *deviceFilePath = '\0';
+ nextMedia = IOIteratorNext( mediaIterator );
+ if ( nextMedia )
+ {
+ CFTypeRef deviceFilePathAsCFString;
+ deviceFilePathAsCFString = IORegistryEntryCreateCFProperty(
+ nextMedia, CFSTR( kIOBSDNameKey ),
+ kCFAllocatorDefault, 0 );
+
+ *deviceFilePath = '\0';
+ if ( deviceFilePathAsCFString )
+ {
+ size_t devPathLength;
+ strcpy( deviceFilePath, _PATH_DEV );
+ // Add "r" before the BSD node name from the I/O Registry
+ // to specify the raw disk node. The raw disk node receives
+ // I/O requests directly and does not go through the
+ // buffer cache.
+ strcat( deviceFilePath, "r");
+ devPathLength = strlen( deviceFilePath );
+ if ( CFStringGetCString( deviceFilePathAsCFString,
+ deviceFilePath + devPathLength,
+ maxPathSize - devPathLength,
+ kCFStringEncodingASCII ) )
+ kernResult = KERN_SUCCESS;
+
+ CFRelease( deviceFilePathAsCFString );
+ }
+ }
+ IOObjectRelease( nextMedia );
+
+ return kernResult;
+}
+
+char *mb_disc_get_default_device_unportable(void)
+{
+ kern_return_t kernResult;
+ io_iterator_t mediaIterator;
+
+ *defaultDevice = 0;
+
+ kernResult = find_ejectable_cd_media( &mediaIterator );
+ if ( kernResult != KERN_SUCCESS )
+ return "";
+
+ kernResult = get_device_file_path( mediaIterator, defaultDevice, MAXPATHLEN - 1);
+ if ( kernResult != KERN_SUCCESS )
+ return "";
+
+ return defaultDevice;
+}
+
+int mb_disc_read_unportable(mb_disc_private *disc, const char *device)
+{
int fd;
int i;
dk_cd_read_toc_t toc;
CDTOC *cdToc;
-
- if (device == NULL)
- device = MB_DEFAULT_DEVICE;
+
+ if (device == NULL || *device == 0)
+ device = mb_disc_get_default_device_unportable();
+
+ if (!*device)
+ {
+ snprintf(disc->error_msg, MB_ERROR_MSG_LENGTH, "No CD-ROMs found. Please insert a disc and try again.");
+ return 0;
+ }
fd = open(device, O_RDONLY | O_NONBLOCK);
if (fd < 0) {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.1.1/src/disc_freebsd.c new/libdiscid-0.2.1/src/disc_freebsd.c
--- old/libdiscid-0.1.1/src/disc_freebsd.c 1970-01-01 01:00:00.000000000 +0100
+++ new/libdiscid-0.2.1/src/disc_freebsd.c 2008-03-13 07:17:21.000000000 +0100
@@ -0,0 +1,176 @@
+/* --------------------------------------------------------------------------
+
+ MusicBrainz -- The Internet music metadatabase
+
+ Copyright (C) 2008 Patrick Hurrelmann
+ Copyright (C) 2006 Matthias Friedrich
+ Copyright (C) 2000 Robert Kaye
+ Copyright (C) 1999 Marc E E van Woerkom
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ $Id: disc_freebsd.c 9646 2008-01-12 11:41:50Z matt $
+
+--------------------------------------------------------------------------- */
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+#include "discid/discid_private.h"
+
+#define CD_FRAMES 75 /* per second */
+#define CD_DATA_TRACK 0x04
+#define CD_LEADOUT 0xAA
+
+#define MB_DEFAULT_DEVICE "/dev/acd0"
+
+#define XA_INTERVAL ((60 + 90 + 2) * CD_FRAMES)
+
+
+/* TODO: make sure it's available */
+int snprintf(char *str, size_t size, const char *format, ...);
+
+
+static int read_toc_header(int fd, int *first, int *last) {
+ struct ioc_toc_header th;
+ struct ioc_read_toc_single_entry te;
+
+ int ret = ioctl(fd, CDIOREADTOCHEADER, &th);
+
+ if ( ret < 0 )
+ return ret; /* error */
+
+ *first = th.starting_track;
+ *last = th.ending_track;
+
+ /*
+ * Hide the last track if this is a multisession disc. Note that
+ * currently only dual-session discs with one track in the second
+ * session are handled correctly.
+ */
+ te.address_format = CD_LBA_FORMAT;
+ te.track = th.ending_track;
+ ret = ioctl(fd, CDIOREADTOCENTRY, &te);
+
+ if (( te.entry.control & CD_DATA_TRACK) != 0 )
+ (*last)--;
+
+ return ret;
+}
+
+
+static int read_toc_entry(int fd, int track_num, unsigned long *lba) {
+ struct ioc_read_toc_single_entry te;
+ int ret;
+
+ te.track = track_num;
+ te.address_format = CD_LBA_FORMAT;
+
+ ret = ioctl(fd, CDIOREADTOCENTRY, &te);
+ assert( te.address_format == CD_LBA_FORMAT );
+
+ if ( ret == 0 )
+ *lba = ntohl(te.entry.addr.lba);
+
+ return ret;
+}
+
+
+static int read_leadout(int fd, unsigned long *lba) {
+ struct ioc_toc_header th;
+ struct ioc_read_toc_single_entry te;
+ int ret;
+
+ ret = ioctl(fd, CDIOREADTOCHEADER, &th);
+ te.track = th.ending_track;
+ te.address_format = CD_LBA_FORMAT;
+ ret = ioctl(fd, CDIOREADTOCENTRY, &te);
+
+ if (( te.entry.control & CD_DATA_TRACK) != 0 ) {
+ *lba = ntohl(te.entry.addr.lba) - 11400;
+ return ret;
+ }
+
+ return read_toc_entry(fd, CD_LEADOUT, lba);
+}
+
+
+char *mb_disc_get_default_device_unportable(void) {
+ return MB_DEFAULT_DEVICE;
+}
+
+
+int mb_disc_read_unportable(mb_disc_private *disc, const char *device) {
+ int fd;
+ unsigned long lba;
+ int first, last;
+ int i;
+
+ if ( (fd = open(device, O_RDONLY | O_NONBLOCK)) < 0 ) {
+ snprintf(disc->error_msg, MB_ERROR_MSG_LENGTH,
+ "cannot open device `%s'", device);
+ return 0;
+ }
+
+ /*
+ * Find the numbers of the first track (usually 1) and the last track.
+ */
+ if ( read_toc_header(fd, &first, &last) < 0 ) {
+ snprintf(disc->error_msg, MB_ERROR_MSG_LENGTH,
+ "cannot read table of contents");
+ close(fd);
+ return 0;
+ }
+
+ /* basic error checking */
+ if ( last == 0 ) {
+ snprintf(disc->error_msg, MB_ERROR_MSG_LENGTH,
+ "this disc has no tracks");
+ close(fd);
+ return 0;
+ }
+
+ disc->first_track_num = first;
+ disc->last_track_num = last;
+
+ /*
+ * Get the logical block address (lba) for the end of the audio data.
+ * The "LEADOUT" track is the track beyond the final audio track, so
+ * we're looking for the block address of the LEADOUT track.
+ */
+ read_leadout(fd, &lba);
+ disc->track_offsets[0] = lba + 150;
+
+ /*
+ * Now, for every track, find out the block address where it starts.
+ */
+ for (i = first; i <= last; i++) {
+ read_toc_entry(fd, i, &lba);
+ disc->track_offsets[i] = lba + 150;
+ }
+
+ close(fd);
+
+ return 1;
+}
+
+/* EOF */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.1.1/src/disc_win32.c new/libdiscid-0.2.1/src/disc_win32.c
--- old/libdiscid-0.1.1/src/disc_win32.c 2007-01-16 18:31:33.000000000 +0100
+++ new/libdiscid-0.2.1/src/disc_win32.c 2008-03-13 07:17:21.000000000 +0100
@@ -19,7 +19,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- $Id: disc_win32.c 8506 2006-09-30 19:02:57Z luks $
+ $Id: disc_win32.c 9184 2007-06-17 15:46:00Z luks $
----------------------------------------------------------------------------*/
@@ -35,6 +35,8 @@
#define MB_DEFAULT_DEVICE "cdaudio"
+int mb_disc_read_unportable_nt(mb_disc_private *disc, const char *device);
+
char *mb_disc_get_default_device_unportable(void) {
return MB_DEFAULT_DEVICE;
}
@@ -44,6 +46,15 @@
char mci_command[128];
char mci_return[128];
char alias[128], device_str[128], error_msg[256];
+
+ if ( GetVersion() < 0x80000000 ) {
+ if ( strlen(device) == 0 || strcmp(device, "cdaudio") == 0 ) {
+ sprintf(device_str, "D:"); /* FIXME */
+ device = device_str;
+ }
+ return mb_disc_read_unportable_nt(disc, device);
+ }
+
if ( strlen(device) == 0 || strcmp(device, "cdaudio") == 0 ) {
sprintf(device_str, "cdaudio");
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libdiscid-0.1.1/src/Makefile.am new/libdiscid-0.2.1/src/Makefile.am
--- old/libdiscid-0.1.1/src/Makefile.am 2007-01-16 18:41:26.000000000 +0100
+++ new/libdiscid-0.2.1/src/Makefile.am 2008-03-13 07:17:21.000000000 +0100
@@ -17,12 +17,13 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
-# $Id: Makefile.am 8791 2007-01-16 17:41:25Z matt $
+# $Id: Makefile.am 9770 2008-03-12 21:40:24Z robert $
#
lib_LTLIBRARIES = libdiscid.la
libdiscid_la_SOURCES = base64.c sha1.c disc.c
-EXTRA_libdiscid_la_SOURCES = disc_linux.c disc_win32.c disc_darwin.c
+EXTRA_libdiscid_la_SOURCES = \
+ disc_linux.c disc_win32.c disc_darwin.c disc_freebsd.c
AM_CPPFLAGS = -I$(top_srcdir)/include
libdiscid_la_LIBADD = @DISC_OS_OBJ@
@@ -42,6 +43,6 @@
# increment age.
# 6. If any interfaces have been removed since the last public release, then
# set age to 0.
-libdiscid_la_LDFLAGS = -version-info 0:1:0 -no-undefined
+libdiscid_la_LDFLAGS = -version-info 2:1:1 -no-undefined
EXTRA_DIST = base64.h sha1.h
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org