[CELT-dev] [PATCH] Add celt_api_version to return API version, useful for dlopen()ed libraries.
thorvald at natvig.com
thorvald at natvig.com
Wed Nov 25 12:45:23 PST 2009
From: Thorvald Natvig <slicer at users.sourceforge.net>
---
configure.ac | 4 ++++
libcelt/celt.c | 4 ++++
libcelt/celt.h | 5 +++++
3 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index 4f13d7e..7611fe9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,6 +10,8 @@ CELT_MICRO_VERSION=0
CELT_EXTRA_VERSION=
CELT_VERSION=$CELT_MAJOR_VERSION.$CELT_MINOR_VERSION.$CELT_MICRO_VERSION$CELT_EXTRA_VERSION
+CELT_API_VERSION=1
+
CELT_LT_CURRENT=0
CELT_LT_REVISION=0
CELT_LT_AGE=0
@@ -23,6 +25,7 @@ VERSION=$CELT_VERSION
PACKAGE=celt
AC_SUBST(CELT_VERSION)
+AC_SUBST(CELT_API_VERSION)
AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
AM_MAINTAINER_MODE
@@ -90,6 +93,7 @@ AC_DEFINE_UNQUOTED(CELT_MAJOR_VERSION, ${CELT_MAJOR_VERSION}, [Version major])
AC_DEFINE_UNQUOTED(CELT_MINOR_VERSION, ${CELT_MINOR_VERSION}, [Version minor])
AC_DEFINE_UNQUOTED(CELT_MICRO_VERSION, ${CELT_MICRO_VERSION}, [Version micro])
AC_DEFINE_UNQUOTED(CELT_EXTRA_VERSION, "${CELT_EXTRA_VERSION}", [Version extra])
+AC_DEFINE_UNQUOTED(CELT_API_VERSION, ${CELT_API_VERSION}, [API version])
has_float_approx=no
#case "$host_cpu" in
diff --git a/libcelt/celt.c b/libcelt/celt.c
index 782c6c3..80043ee 100644
--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -1555,3 +1555,7 @@ const char *celt_strerror(int error)
return error_strings[-error];
}
+int celt_api_version()
+{
+ return CELT_API_VERSION;
+}
diff --git a/libcelt/celt.h b/libcelt/celt.h
index 9e59b43..ba2b369 100644
--- a/libcelt/celt.h
+++ b/libcelt/celt.h
@@ -276,6 +276,11 @@ EXPORT int celt_decoder_ctl(CELTDecoder * st, int request, ...);
*/
EXPORT const char *celt_strerror(int error);
+/** Returns version of CELT API
+ * @return API version
+ */
+EXPORT int celt_api_version();
+
/* @} */
--
1.6.4
More information about the celt-dev
mailing list