]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Reduce public API (V2)
authorStéphane Graber <stgraber@ubuntu.com>
Mon, 2 Dec 2013 18:58:02 +0000 (13:58 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 2 Dec 2013 23:17:41 +0000 (18:17 -0500)
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 <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
19 files changed:
src/lxc/Makefile.am
src/lxc/bdev.c
src/lxc/lxc_config.c
src/lxc/lxc_create.c
src/lxc/lxc_snapshot.c
src/lxc/lxccontainer.c
src/lxc/lxccontainer.h
src/lxc/version.c [deleted file]
src/lxc/version.h.in
src/tests/attach.c
src/tests/cgpath.c
src/tests/concurrent.c
src/tests/console.c
src/tests/containertests.c
src/tests/get_item.c
src/tests/list.c
src/tests/lxcpath.c
src/tests/snapshot.c
src/tests/startone.c

index bf93baa98173a2b7596edbdf57255ce418f2cc57..5369700420de801c38b78029712c076aedfdb8d2 100644 (file)
@@ -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)
 
index 03fecfb894b537bcdd220a20bb8479f54508cd28..249815e722f129eebcfeca0082147b3419cf61e4 100644 (file)
@@ -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)
index 21bde64564a54e26d61a0b2c9f8b1ae1af74a14a..8a4114d19465fca4f2741431e83a3ccaaa6ccab3 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include <stdio.h>
+#include <string.h>
 #include "config.h"
 #include <lxc/lxccontainer.h>
 
index 754afbf2fdc61c65620ba0b0d0ff9c3d83c5967e..7399683d7d695cd178624a30949dc509101f57fc 100644 (file)
@@ -23,6 +23,7 @@
 #include <libgen.h>
 #include <unistd.h>
 #include <ctype.h>
+#include <fcntl.h>
 #include <sys/types.h>
 
 #include <lxc/lxc.h>
index d80dd3920fac1d48a26d6a79b5daaa7a2c87bc99..f80afe5e4670d61c119a36254ac27483c99f81d7 100644 (file)
@@ -24,6 +24,7 @@
 #include <unistd.h>
 #include <ctype.h>
 #include <sys/types.h>
+#include <fcntl.h>
 
 #include <lxc/lxc.h>
 #include <lxc/log.h>
index 50796ae1622dbf9bdb6fc109241120b17bc217c6..7f54f5028c7dd12874149203ba6f36acef7d12b8 100644 (file)
@@ -50,6 +50,7 @@
 #include <sched.h>
 #include <arpa/inet.h>
 #include <libgen.h>
+#include "lxclock.h"
 
 #if HAVE_IFADDRS_H
 #include <ifaddrs.h>
@@ -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)
index d57aead05bafff1d85c5f09679ab3c9ad2728e5e..4ad3b6616f4ad6b61d22548ffdb636b89dc86d66 100644 (file)
 
 #ifndef __LXC_CONTAINER_H
 #define __LXC_CONTAINER_H
-#include "lxclock.h"
 #include "attach_options.h"
-#include <stdlib.h>
 #include <malloc.h>
-
+#include <semaphore.h>
 #include <stdbool.h>
+#include <stdlib.h>
 
 #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 (file)
index bfa34bd..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * lxc: linux Container library
- *
- * (C) Copyright IBM Corp. 2007, 2008
- *
- * Authors:
- * Daniel Lezcano <daniel.lezcano at free.fr>
- *
- * 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;
-}
index 6867b6ed2f6af7327f4c33a0a01c103c1da66036..eb9f103536d271fb178fba8fce8951d4d7c14e1c 100644 (file)
@@ -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
index 2f0cb0892bb1e924254ce3a3ac9357f750ab1208..54f899f58df988090d024b8abeddd4f2affd5377 100644 (file)
@@ -23,6 +23,8 @@
 #include <lxc/utils.h>
 #include <lxc/lsm/lsm.h>
 
+#include <string.h>
+#include <sys/stat.h>
 #include <errno.h>
 #include <unistd.h>
 
index 1c14468e0d399e781067b552a667397efeab6e90..ef192c6275d09fba12514d2db7577553f2219411 100644 (file)
@@ -26,6 +26,8 @@
 #include <sys/wait.h>
 #include <stdlib.h>
 #include <errno.h>
+#include <string.h>
+#include <sys/stat.h>
 #include "../lxc/cgroup.h"
 #include "../lxc/lxc.h"
 #include "../lxc/commands.h"
index 6ae2662519aad164f1cd0dd41925489912a6d2a0..b9749df7067c3384662c973e87de76aa06095c18 100644 (file)
@@ -20,6 +20,8 @@
 #include <stdio.h>
 #include <pthread.h>
 #include <unistd.h>
+#include <string.h>
+#include <fcntl.h>
 #define _GNU_SOURCE
 #include <getopt.h>
 
index 558e2790501670f147b806a5bdcf9e90710e0769..351f47ae7198914fb4448f81809d6b6952b189dc 100644 (file)
@@ -24,6 +24,8 @@
 #include <errno.h>
 #include <unistd.h>
 #include <stdio.h>
+#include <string.h>
+#include <sys/stat.h>
 
 #define TTYCNT      4
 #define TTYCNT_STR "4"
index 8ec840f6b447cd31efa82f44436ea15734de6614..e6f05af9032b29850bfc9888955165d5b27c24b7 100644 (file)
@@ -25,6 +25,7 @@
 #include <sys/wait.h>
 #include <stdlib.h>
 #include <errno.h>
+#include <string.h>
 #include <lxc/state.h>
 
 #define MYNAME "lxctest1"
index 9475130ad62c1182c5579240dada10cf26347af3..10ab3d108edc3b5791b2574917e59834fad3e6a5 100644 (file)
@@ -25,6 +25,7 @@
 #include <sys/wait.h>
 #include <stdlib.h>
 #include <errno.h>
+#include <string.h>
 #include <lxc/state.h>
 
 #define MYNAME "lxctest1"
index 639f7d50a276e8bb1b51c6e3bf84d0473d2cdc46..9559c231824101b026307a0201eb7b4850a1d9b4 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <lxc/lxccontainer.h>
 
 static void test_list_func(const char *lxcpath, const char *type,
index 0fa5b2d820bd22fdd0185e038bc6f422e7cb28a0..60189901c09b4d109d89d4d067c960fb918e83e1 100644 (file)
@@ -24,6 +24,7 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <stdlib.h>
+#include <string.h>
 #include <errno.h>
 
 #define MYNAME "lxctest1"
index 79805afd890c6dd41b627d14b7759e345a621ae0..d9fed363221ec86afac52d0b1ba7eecd13bed333 100644 (file)
@@ -21,6 +21,8 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
+#include <sys/stat.h>
 #include "../lxc/lxc.h"
 
 #define MYNAME "snapxxx1"
index 31ef503033d3894c09daaabfd9530a31ceba8768..08587eacebe886e18feddbde28ecef889114443d 100644 (file)
@@ -24,6 +24,7 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <stdlib.h>
+#include <string.h>
 #include <errno.h>
 
 #define MYNAME "lxctest1"