From: Stéphane Graber Date: Mon, 2 Dec 2013 18:58:02 +0000 (-0500) Subject: Reduce public API (V2) X-Git-Tag: lxc-1.0.0.beta1~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95ee490bbdb97ab2b4f1dfa63a0a26e0dd1c2f17;p=thirdparty%2Flxc.git Reduce public API (V2) This removes all but the following headers from our includes: - attach_options.h - lxccontainer.h - version.h This also removes the duplicate lxc_version function (lxc_get_version has been preferred for a while). lxclock.h is now considered private. As a result quite a lot of files needed addition of extra includes previously inherited from lxclock.h. Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn --- diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am index bf93baa98..536970042 100644 --- a/src/lxc/Makefile.am +++ b/src/lxc/Makefile.am @@ -1,23 +1,6 @@ pkginclude_HEADERS = \ - arguments.h \ - attach.h \ attach_options.h \ - bdev.h \ - caps.h \ - cgroup.h \ - conf.h \ - console.h \ - error.h \ - list.h \ - log.h \ lxccontainer.h \ - lxc.h \ - lxclock.h \ - monitor.h \ - namespace.h \ - start.h \ - state.h \ - utils.h \ version.h if IS_BIONIC @@ -87,7 +70,7 @@ liblxc_so_SOURCES = \ lxcutmp.c lxcutmp.h \ lxclock.h lxclock.c \ lxccontainer.c lxccontainer.h \ - version.c version.h \ + version.h \ \ $(LSM_SOURCES) diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c index 03fecfb89..249815e72 100644 --- a/src/lxc/bdev.c +++ b/src/lxc/bdev.c @@ -47,6 +47,7 @@ #include "namespace.h" #include "parse.h" #include "utils.h" +#include "lxclock.h" #ifndef BLKGETSIZE64 #define BLKGETSIZE64 _IOR(0x12,114,size_t) diff --git a/src/lxc/lxc_config.c b/src/lxc/lxc_config.c index 21bde6456..8a4114d19 100644 --- a/src/lxc/lxc_config.c +++ b/src/lxc/lxc_config.c @@ -19,6 +19,7 @@ */ #include +#include #include "config.h" #include diff --git a/src/lxc/lxc_create.c b/src/lxc/lxc_create.c index 754afbf2f..7399683d7 100644 --- a/src/lxc/lxc_create.c +++ b/src/lxc/lxc_create.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include diff --git a/src/lxc/lxc_snapshot.c b/src/lxc/lxc_snapshot.c index d80dd3920..f80afe5e4 100644 --- a/src/lxc/lxc_snapshot.c +++ b/src/lxc/lxc_snapshot.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 50796ae16..7f54f5028 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -50,6 +50,7 @@ #include #include #include +#include "lxclock.h" #if HAVE_IFADDRS_H #include @@ -2107,7 +2108,7 @@ const char *lxc_get_default_zfs_root(void) const char *lxc_get_version(void) { - return lxc_version(); + return LXC_VERSION; } static int copy_file(char *old, char *new) diff --git a/src/lxc/lxccontainer.h b/src/lxc/lxccontainer.h index d57aead05..4ad3b6616 100644 --- a/src/lxc/lxccontainer.h +++ b/src/lxc/lxccontainer.h @@ -22,12 +22,11 @@ #ifndef __LXC_CONTAINER_H #define __LXC_CONTAINER_H -#include "lxclock.h" #include "attach_options.h" -#include #include - +#include #include +#include #define LXC_CLONE_KEEPNAME (1 << 0) /*!< Do not edit the rootfs to change the hostname */ #define LXC_CLONE_COPYHOOKS (1 << 1) /*!< Copy all hooks into the container directory */ @@ -41,6 +40,8 @@ struct bdev_specs; struct lxc_snapshot; +struct lxc_lock; + /*! * An LXC container. */ diff --git a/src/lxc/version.c b/src/lxc/version.c deleted file mode 100644 index bfa34bdb0..000000000 --- a/src/lxc/version.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * lxc: linux Container library - * - * (C) Copyright IBM Corp. 2007, 2008 - * - * Authors: - * Daniel Lezcano - * - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "../config.h" - -const char *lxc_version(void) -{ - return PACKAGE_VERSION; -} diff --git a/src/lxc/version.h.in b/src/lxc/version.h.in index 6867b6ed2..eb9f10353 100644 --- a/src/lxc/version.h.in +++ b/src/lxc/version.h.in @@ -28,9 +28,4 @@ #define LXC_VERSION_MICRO @LXC_VERSION_MICRO@ #define LXC_VERSION "@LXC_VERSION@" -/* - * Returns the version number of the library - */ -extern const char *lxc_version(void); - #endif diff --git a/src/tests/attach.c b/src/tests/attach.c index 2f0cb0892..54f899f58 100644 --- a/src/tests/attach.c +++ b/src/tests/attach.c @@ -23,6 +23,8 @@ #include #include +#include +#include #include #include diff --git a/src/tests/cgpath.c b/src/tests/cgpath.c index 1c14468e0..ef192c627 100644 --- a/src/tests/cgpath.c +++ b/src/tests/cgpath.c @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include "../lxc/cgroup.h" #include "../lxc/lxc.h" #include "../lxc/commands.h" diff --git a/src/tests/concurrent.c b/src/tests/concurrent.c index 6ae266251..b9749df70 100644 --- a/src/tests/concurrent.c +++ b/src/tests/concurrent.c @@ -20,6 +20,8 @@ #include #include #include +#include +#include #define _GNU_SOURCE #include diff --git a/src/tests/console.c b/src/tests/console.c index 558e27905..351f47ae7 100644 --- a/src/tests/console.c +++ b/src/tests/console.c @@ -24,6 +24,8 @@ #include #include #include +#include +#include #define TTYCNT 4 #define TTYCNT_STR "4" diff --git a/src/tests/containertests.c b/src/tests/containertests.c index 8ec840f6b..e6f05af90 100644 --- a/src/tests/containertests.c +++ b/src/tests/containertests.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #define MYNAME "lxctest1" diff --git a/src/tests/get_item.c b/src/tests/get_item.c index 9475130ad..10ab3d108 100644 --- a/src/tests/get_item.c +++ b/src/tests/get_item.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #define MYNAME "lxctest1" diff --git a/src/tests/list.c b/src/tests/list.c index 639f7d50a..9559c2318 100644 --- a/src/tests/list.c +++ b/src/tests/list.c @@ -19,6 +19,7 @@ #include #include +#include #include static void test_list_func(const char *lxcpath, const char *type, diff --git a/src/tests/lxcpath.c b/src/tests/lxcpath.c index 0fa5b2d82..60189901c 100644 --- a/src/tests/lxcpath.c +++ b/src/tests/lxcpath.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #define MYNAME "lxctest1" diff --git a/src/tests/snapshot.c b/src/tests/snapshot.c index 79805afd8..d9fed3632 100644 --- a/src/tests/snapshot.c +++ b/src/tests/snapshot.c @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include "../lxc/lxc.h" #define MYNAME "snapxxx1" diff --git a/src/tests/startone.c b/src/tests/startone.c index 31ef50303..08587eace 100644 --- a/src/tests/startone.c +++ b/src/tests/startone.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #define MYNAME "lxctest1"