[vlc-devel] [PATCH] libvlc: add functions libvlc_get_version() and others
Tanguy Krotoff
tkrotoff at gmail.com
Sat Mar 29 20:28:59 CET 2008
---
include/vlc/libvlc.h | 27 +++++++++++++++++++++++++++
src/Makefile.am | 1 +
src/control/core.c | 17 +++++++++++++++++
3 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/include/vlc/libvlc.h b/include/vlc/libvlc.h
index a626df0..7e00fb2 100644
--- a/include/vlc/libvlc.h
+++ b/include/vlc/libvlc.h
@@ -145,6 +145,33 @@ VLC_PUBLIC_API void libvlc_release( libvlc_instance_t * );
*/
VLC_PUBLIC_API void libvlc_retain( libvlc_instance_t * );
+/**
+ * Retrieve libvlc version.
+ *
+ * Example: "0.9.0-git Grishenko"
+ *
+ * \return a string containing the libvlc version
+ */
+VLC_PUBLIC_API const char * libvlc_get_version();
+
+/**
+ * Retrieve libvlc compiler version.
+ *
+ * Example: "gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)"
+ *
+ * \return a string containing the libvlc compiler version
+ */
+VLC_PUBLIC_API const char * libvlc_get_compiler();
+
+/**
+ * Retrieve libvlc changeset.
+ *
+ * Example: "aa9bce0bc4"
+ *
+ * \return a string containing the libvlc changeset
+ */
+VLC_PUBLIC_API const char * libvlc_get_changeset();
+
/** @}*/
/*****************************************************************************
diff --git a/src/Makefile.am b/src/Makefile.am
index f690d1c..ca0bb08 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -185,6 +185,7 @@ libvlc_la_LIBADD = `$(VLC_CONFIG) -libs libvlc` $(AM_LIBADD) $(LTLIBINTL)
libvlc_la_DEPENDENCIES = libvlc.sym
libvlc_control_la_SOURCES = $(SOURCES_libvlc_control)
+nodist_libvlc_control_la_SOURCES = misc/revision.c
libvlc_control_la_LIBADD = libvlc.la
libvlc_control_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
libvlc_control_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0
diff --git a/src/control/core.c b/src/control/core.c
index 08f550b..dffbd2f 100644
--- a/src/control/core.c
+++ b/src/control/core.c
@@ -20,6 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
+
#include "libvlc_internal.h"
#include <vlc/libvlc.h>
@@ -173,3 +174,19 @@ int libvlc_get_vlc_id( libvlc_instance_t *p_instance )
{
return p_instance->p_libvlc_int->i_object_id;
}
+
+const char * libvlc_get_version()
+{
+ return VERSION_MESSAGE;
+}
+
+const char * libvlc_get_compiler()
+{
+ return VLC_COMPILER;
+}
+
+extern const char psz_vlc_changeset[];
+const char * libvlc_get_changeset()
+{
+ return psz_vlc_changeset;
+}
--
1.5.4.3
More information about the vlc-devel
mailing list