From 383e049be4af763bba9539f426ff02df39a694b5 Mon Sep 17 00:00:00 2001 From: Daniel Caujolle-Bert Date: Mon, 28 May 2001 21:47:42 +0000 Subject: Add version informations in API. CVS patchset: 97 CVS date: 2001/05/28 21:47:42 --- acconfig.h | 4 ++++ configure.in | 8 ++++++- include/xine.h.tmpl.in | 59 +++++++++++++++++++++++++++++++++++++++++++++++++- src/xine-engine/xine.c | 46 ++++++++++++++++++++++++++++++++++++++- 4 files changed, 114 insertions(+), 3 deletions(-) diff --git a/acconfig.h b/acconfig.h index aaf2d438b..212caa961 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,3 +1,7 @@ +#undef XINE_MAJOR +#undef XINE_MINOR +#undef XINE_SUB + /* Define this if you're running x86 architecture */ #undef __i386__ diff --git a/configure.in b/configure.in index e7b58c067..ab902d2e9 100644 --- a/configure.in +++ b/configure.in @@ -21,9 +21,15 @@ XINE_SUB=0 XINE_PRE=".alpha1" TAR_NAME="xine-lib-"$XINE_MAJOR.$XINE_MINOR.$XINE_SUB$XINE_PRE SPEC_VERSION=$XINE_MAJOR.$XINE_MINOR.$XINE_SUB$XINE_PRE + AC_SUBST(XINE_MAJOR) AC_SUBST(XINE_MINOR) AC_SUBST(XINE_SUB) + +AC_DEFINE_UNQUOTED(XINE_MAJOR, $XINE_MAJOR) +AC_DEFINE_UNQUOTED(XINE_MINOR, $XINE_MINOR) +AC_DEFINE_UNQUOTED(XINE_SUB, $XINE_SUB) + AC_SUBST(TAR_NAME) AC_SUBST(SPEC_VERSION) @@ -367,7 +373,7 @@ dnl Some informations about xine-lib compilation dnl XINE_BUILD_CC="`$CC -v 2>&1 | tail -1`" XINE_BUILD_OS="`uname -s -r -m`" -XINE_BUILD_DATE="`date`" +XINE_BUILD_DATE="`date \"+%a %d %b %Y %T\"`" AC_SUBST(XINE_BUILD_CC) AC_SUBST(XINE_BUILD_OS) AC_SUBST(XINE_BUILD_DATE) diff --git a/include/xine.h.tmpl.in b/include/xine.h.tmpl.in index 8d7413875..296dc0ca4 100644 --- a/include/xine.h.tmpl.in +++ b/include/xine.h.tmpl.in @@ -29,7 +29,7 @@ \endverbatim */ /* - * $Id: xine.h.tmpl.in,v 1.18 2001/05/26 22:04:38 f1rmb Exp $ + * $Id: xine.h.tmpl.in,v 1.19 2001/05/28 21:47:43 f1rmb Exp $ * */ @@ -213,6 +213,63 @@ typedef void (*gui_status_callback_func_t)(int nStatus); * @defgroup xine_api API functions * @{ */ + +/** + * @defgroup xine_version API functions + * @ingroup xine_api + * @{ + */ +/** + * \fn *xine_get_str_version(void); + * \brief return string version, like "0.5.0" + * \param None. + * \return string version + * + */ +char *xine_get_str_version(void); + +/** + * \fn int xine_get_major_version(void); + * \brief return version information + * \param None. + * \return major version. + * + */ +int xine_get_major_version(void); + +/** + * \fn int xine_get_minor_version(void); + * \brief return version information + * \param None. + * \return minor version. + * + */ +int xine_get_minor_version(void); + +/** + * \fn int xine_get_sub_version(void); + * \brief return version information + * \param None. + * \return sub version. + * + */ +int xine_get_sub_version(void); + +/** + * \fn int xine_check_version(int major, int minor, int sub); + * \brief check minimal version. + * \param major major version wanted. + * \param minorr minor version wanted. + * \param sub sub version wanted. + * \return 1 if installed version is >= to desired, otherwise 0 + * + * Compare version numbers with xine installed version. + */ +int xine_check_version(int major, int minor, int sub); + +/** @} end of xine_version */ + + /** @defgroup xine_init_api Init functions * @ingroup xine_api * @{ diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index f7d6557cb..2012be021 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine.c,v 1.19 2001/05/28 12:08:20 f1rmb Exp $ + * $Id: xine.c,v 1.20 2001/05/28 21:47:43 f1rmb Exp $ * * top-level xine functions * @@ -528,3 +528,47 @@ int xine_get_status(xine_t *this) { return this->status; } +/* *** + * Version information/check + */ + +/* + * Return version in string, like "0.5.0" + */ +char *xine_get_str_version(void) { + return VERSION; +} + +/* + * Return major version + */ +int xine_get_major_version(void) { + return XINE_MAJOR; +} + +/* + * Return minor version + */ +int xine_get_minor_version(void) { + return XINE_MINOR; +} + +/* + * Return sub version + */ +int xine_get_sub_version(void) { + return XINE_SUB; +} + +/* + * Check if xine version is <= to specifier version. + */ +int xine_check_version(int major, int minor, int sub) { + + if((XINE_MAJOR > major) || + ((XINE_MAJOR == major) && (XINE_MINOR > minor)) || + ((XINE_MAJOR == major) && (XINE_MINOR == minor) && (XINE_SUB >= sub))) + return 1; + + return 0; +} -- cgit v1.2.3