aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordlezcano <dlezcano>2008-09-17 10:26:16 +0000
committerdlezcano <dlezcano>2008-09-17 10:26:16 +0000
commit681799f9b33144ea787325f753de49320d8c02f1 (patch)
tree6ce3d38b25f93eb96c77937de776dcecf324f19e
parentFix using the right file name for the freezer (diff)
downloadlxc-681799f9b33144ea787325f753de49320d8c02f1.tar.gz
lxc-681799f9b33144ea787325f753de49320d8c02f1.tar.bz2
lxc-681799f9b33144ea787325f753de49320d8c02f1.zip
Added the function returning the version and the corresponding cli
-rw-r--r--configure.in2
-rw-r--r--src/lxc/Makefile.am7
-rw-r--r--src/lxc/lxc.h5
-rw-r--r--src/lxc/lxc_version.c30
-rw-r--r--src/lxc/version.c29
5 files changed, 71 insertions, 2 deletions
diff --git a/configure.in b/configure.in
index a5311d5..46d7509 100644
--- a/configure.in
+++ b/configure.in
@@ -1,7 +1,7 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
-AC_INIT([lxc], [0.2.1])
+AC_INIT([lxc], [0.2.2])
AC_CONFIG_SRCDIR([configure.in])
AC_CONFIG_AUX_DIR([config])
diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am
index 2c00d3e..f13b77d 100644
--- a/src/lxc/Makefile.am
+++ b/src/lxc/Makefile.am
@@ -22,6 +22,7 @@ liblxc_la_SOURCES = \
monitor.c monitor.h \
kill.c \
freezer.c \
+ version.c \
lxc_cgroup.c lxc_cgroup.h \
lxc.h \
lxc_utils.h \
@@ -55,7 +56,8 @@ bin_PROGRAMS = \
lxc-freeze \
lxc-info \
lxc-unfreeze \
- lxc-priority
+ lxc-priority \
+ lxc-version
lxc_create_SOURCES = lxc_create.c lxc_config.c lxc_config.h
lxc_create_LDADD = liblxc.la
@@ -95,3 +97,6 @@ lxc_unfreeze_LDADD = liblxc.la
lxc_priority_SOURCES = lxc_priority.c
lxc_priority_LDADD = liblxc.la
+
+lxc_version_SOURCES = lxc_version.c
+lxc_version_LDADD = liblxc.la
diff --git a/src/lxc/lxc.h b/src/lxc/lxc.h
index 4df9c4a..22e6bd0 100644
--- a/src/lxc/lxc.h
+++ b/src/lxc/lxc.h
@@ -250,6 +250,11 @@ extern int lxc_cgroup_get_cpuset(const char *name, long *cpumask,
*/
extern int lxc_cgroup_get_cpu_usage(const char *name, long long *usage);
+/*
+ * Returns a the version number of the library
+ */
+extern const char const *lxc_version(void);
+
#ifdef __cplusplus
}
#endif
diff --git a/src/lxc/lxc_version.c b/src/lxc/lxc_version.c
new file mode 100644
index 0000000..621c937
--- /dev/null
+++ b/src/lxc/lxc_version.c
@@ -0,0 +1,30 @@
+/*
+ * lxc: linux Container library
+ *
+ * (C) Copyright IBM Corp. 2007, 2008
+ *
+ * Authors:
+ * Daniel Lezcano <dlezcano at fr.ibm.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 <stdio.h>
+#include <lxc/lxc.h>
+
+int main(int argc, char *argv[])
+{
+ printf("Version: %s\n", lxc_version());
+ return 0;
+}
diff --git a/src/lxc/version.c b/src/lxc/version.c
new file mode 100644
index 0000000..53bb793
--- /dev/null
+++ b/src/lxc/version.c
@@ -0,0 +1,29 @@
+/*
+ * lxc: linux Container library
+ *
+ * (C) Copyright IBM Corp. 2007, 2008
+ *
+ * Authors:
+ * Daniel Lezcano <dlezcano at fr.ibm.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 "../config.h"
+
+const char const* lxc_version(void)
+{
+ return PACKAGE_VERSION;
+}