]> git.sesse.net Git - mlt/commitdiff
Add mlt_version API.
authorDan Dennedy <dan@dennedy.org>
Fri, 17 Dec 2010 05:54:13 +0000 (21:54 -0800)
committerDan Dennedy <dan@dennedy.org>
Fri, 17 Dec 2010 05:54:13 +0000 (21:54 -0800)
Contributed by Jonathan Thomas.

src/framework/Makefile
src/framework/mlt.h
src/framework/mlt_version.c [new file with mode: 0644]
src/framework/mlt_version.h [new file with mode: 0644]
src/swig/mlt.i

index b523e36e16de3aef13f0a5ef14b5bdc61de4c1fb..0c61cee035bf86d04483a77a2808246b673dace0 100644 (file)
@@ -16,6 +16,7 @@ SHFLAGS += -install_name $(libdir)/$(SONAME) -current_version $(version) -compat
 endif
 
 OBJS = mlt_frame.o \
+          mlt_version.o \
           mlt_geometry.o \
           mlt_deque.o \
           mlt_property.o \
@@ -40,6 +41,7 @@ OBJS = mlt_frame.o \
           mlt_cache.o
 
 INCS = mlt_consumer.h \
+          mlt_version.h \
           mlt_factory.h \
           mlt_filter.h \
           mlt.h \
index db008928dc1596217048a5f0755488e91feeb867..b8adca9a03a088b0e7eb3128ab516c489224ade6 100644 (file)
@@ -24,9 +24,6 @@
 #ifndef _MLT_H_
 #define _MLT_H_
 
-#define LIBMLT_VERSION_INT ((0<<16)+(5<<8)+10)
-#define LIBMLT_VERSION     0.5.10
-
 #ifdef __cplusplus
 extern "C"
 {
@@ -51,6 +48,7 @@ extern "C"
 #include "mlt_repository.h"
 #include "mlt_log.h"
 #include "mlt_cache.h"
+#include "mlt_version.h"
 
 #ifdef __cplusplus
 }
diff --git a/src/framework/mlt_version.c b/src/framework/mlt_version.c
new file mode 100644 (file)
index 0000000..52169a4
--- /dev/null
@@ -0,0 +1,50 @@
+/**
+ * \file mlt_version.c
+ * \brief contains version information
+ *
+ * Copyright (C) 2010 Ushodaya Enterprises Limited
+ * \author Jonathan Thomas <Jonathan.Oomph@gmail.com>
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "mlt_version.h"
+
+int mlt_version_get_int( )
+{
+       return LIBMLT_VERSION_INT;
+}
+
+char *mlt_version_get_string( )
+{
+       return LIBMLT_VERSION;
+}
+
+int mlt_version_get_major( )
+{
+       return LIBMLT_VERSION_MAJOR;
+}
+
+int mlt_version_get_minor( )
+{
+       return LIBMLT_VERSION_MINOR;
+}
+
+int mlt_version_get_revision( )
+{
+       return LIBMLT_VERSION_REVISION;
+}
+
+
diff --git a/src/framework/mlt_version.h b/src/framework/mlt_version.h
new file mode 100644 (file)
index 0000000..354fbc5
--- /dev/null
@@ -0,0 +1,42 @@
+/**
+ * \file mlt_version.h
+ * \brief contains version information
+ *
+ * Copyright (C) 2010 Ushodaya Enterprises Limited
+ * \author Jonathan Thomas <Jonathan.Oomph@gmail.com>
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef _MLT_VERSION_H_
+#define _MLT_VERSION_H_
+
+// Add quotes around any #define variables
+#define STRINGIZE2(s)           #s
+#define STRINGIZE(s)            STRINGIZE2(s)
+
+#define LIBMLT_VERSION_MAJOR    0
+#define LIBMLT_VERSION_MINOR    5
+#define LIBMLT_VERSION_REVISION 10
+#define LIBMLT_VERSION_INT      ((LIBMLT_VERSION_MAJOR<<16)+(LIBMLT_VERSION_MINOR<<8)+LIBMLT_VERSION_REVISION)
+#define LIBMLT_VERSION          STRINGIZE(LIBMLT_VERSION_MAJOR.LIBMLT_VERSION_MINOR.LIBMLT_VERSION_REVISION)
+
+extern int mlt_version_get_int( );
+extern int mlt_version_get_major( );
+extern int mlt_version_get_minor( );
+extern int mlt_version_get_revision( );
+extern char *mlt_version_get_string( );
+
+#endif
index 4610699ff0ba67e47ae653fff8322e2a62e4d6af..cb57ad6c0f63af3dab58d0d113bac90a41b90e2a 100644 (file)
@@ -67,6 +67,7 @@ namespace Mlt {
 
 %include <framework/mlt_types.h>
 %include <framework/mlt_factory.h>
+%include <framework/mlt_version.h>
 int mlt_log_get_level( void );
 void mlt_log_set_level( int );
 %include <MltFactory.h>