]> git.proxmox.com Git - mirror_lxc.git/commitdiff
Added the function returning the version and the corresponding cli
authordlezcano <dlezcano>
Wed, 17 Sep 2008 10:26:16 +0000 (10:26 +0000)
committerdlezcano <dlezcano>
Wed, 17 Sep 2008 10:26:16 +0000 (10:26 +0000)
configure.in
src/lxc/Makefile.am
src/lxc/lxc.h
src/lxc/lxc_version.c [new file with mode: 0644]
src/lxc/version.c [new file with mode: 0644]

index a5311d5f575dcc64e0f027eefbadb1b8677221d0..46d750972726165bbb77a415231f088a0e731957 100644 (file)
@@ -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])
index 2c00d3e52487c6f78d75339dd0610d21c7f8818d..f13b77de9241f2958c28f03c69d1e55977274d15 100644 (file)
@@ -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
index 4df9c4a0953b16d6a4232943d58a8b0890a734ec..22e6bd066a62cdb87fe0025520841d5c8fea73bb 100644 (file)
@@ -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 (file)
index 0000000..621c937
--- /dev/null
@@ -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 (file)
index 0000000..53bb793
--- /dev/null
@@ -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;
+}