Commit 681799f9 by dlezcano

Added the function returning the version and the corresponding cli

parent 70a59143
# -*- 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])
......
......@@ -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
......@@ -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
......
/*
* 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;
}
/*
* 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment