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: 's avatarStéphane Graber <stgraber@ubuntu.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent a22185dd
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)
......
......@@ -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)
......
......@@ -19,6 +19,7 @@
*/
#include <stdio.h>
#include <string.h>
#include "config.h"
#include <lxc/lxccontainer.h>
......
......@@ -23,6 +23,7 @@
#include <libgen.h>
#include <unistd.h>
#include <ctype.h>
#include <fcntl.h>
#include <sys/types.h>
#include <lxc/lxc.h>
......
......@@ -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>
......
......@@ -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)
......
......@@ -22,12 +22,11 @@
#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.
*/
......
/*
* 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;
}
......@@ -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
......@@ -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>
......
......@@ -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"
......
......@@ -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>
......
......@@ -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"
......
......@@ -25,6 +25,7 @@
#include <sys/wait.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <lxc/state.h>
#define MYNAME "lxctest1"
......
......@@ -25,6 +25,7 @@
#include <sys/wait.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <lxc/state.h>
#define MYNAME "lxctest1"
......
......@@ -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,
......
......@@ -24,6 +24,7 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#define MYNAME "lxctest1"
......
......@@ -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"
......
......@@ -24,6 +24,7 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#define MYNAME "lxctest1"
......
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