Skip to content

Commit

Permalink
adjust include statements (v2)
Browse files Browse the repository at this point in the history
Use "#include <somefile.h>" style for external or exported headers only.

changes since v1:
 - adjusted formatting as Stéphane suggested

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  • Loading branch information
caglar10ur authored and hallyn committed Jan 1, 2014
1 parent 23b9d42 commit f2363e3
Show file tree
Hide file tree
Showing 54 changed files with 125 additions and 114 deletions.
2 changes: 1 addition & 1 deletion src/lua-lxc/core.c
Expand Up @@ -30,7 +30,7 @@
#include <unistd.h>
#include <libgen.h>
#include <lxc/lxccontainer.h>
#include <lxc/commands.h>
#include "lxc/commands.h"

#if LUA_VERSION_NUM < 502
#define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l))
Expand Down
2 changes: 1 addition & 1 deletion src/lxc/attach.h
Expand Up @@ -25,7 +25,7 @@
#define _attach_h

#include <sys/types.h>
#include "attach_options.h"
#include <lxc/attach_options.h>

struct lxc_proc_context_info {
char *lsm_label;
Expand Down
1 change: 1 addition & 0 deletions src/lxc/bdev.c
Expand Up @@ -37,6 +37,7 @@
#include <libgen.h>
#include <linux/loop.h>
#include <dirent.h>

#include "lxc.h"
#include "config.h"
#include "conf.h"
Expand Down
7 changes: 3 additions & 4 deletions src/lxc/cgroup.c
Expand Up @@ -45,10 +45,9 @@
#include "conf.h"
#include "utils.h"
#include "bdev.h"

#include <lxc/log.h>
#include <lxc/cgroup.h>
#include <lxc/start.h>
#include "log.h"
#include "cgroup.h"
#include "start.h"

#if IS_BIONIC
#include <../include/lxcmntent.h>
Expand Down
4 changes: 2 additions & 2 deletions src/lxc/checkpoint.c
Expand Up @@ -20,8 +20,8 @@
* 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 <lxc/lxc.h>
#include <lxc/log.h>
#include "lxc.h"
#include "log.h"

lxc_log_define(lxc_checkpoint, lxc);

Expand Down
13 changes: 6 additions & 7 deletions src/lxc/commands.c
Expand Up @@ -33,13 +33,12 @@
#include <malloc.h>
#include <stdlib.h>

#include <lxc/log.h>
#include <lxc/lxc.h>
#include <lxc/conf.h>
#include <lxc/start.h> /* for struct lxc_handler */
#include <lxc/utils.h>
#include <lxc/cgroup.h>

#include "log.h"
#include "lxc.h"
#include "conf.h"
#include "start.h" /* for struct lxc_handler */
#include "utils.h"
#include "cgroup.h"
#include "commands.h"
#include "console.h"
#include "confile.h"
Expand Down
5 changes: 2 additions & 3 deletions src/lxc/conf.h
Expand Up @@ -31,9 +31,8 @@
#include <sys/types.h>
#include <stdbool.h>

#include <lxc/list.h>

#include <lxc/start.h> /* for lxc_handler */
#include "list.h"
#include "start.h" /* for lxc_handler */

#if HAVE_SCMP_FILTER_CTX
typedef void * scmp_filter_ctx;
Expand Down
5 changes: 2 additions & 3 deletions src/lxc/confile.c
Expand Up @@ -41,9 +41,8 @@
#include "config.h"
#include "confile.h"
#include "utils.h"

#include <lxc/log.h>
#include <lxc/conf.h>
#include "log.h"
#include "conf.h"
#include "network.h"

#if HAVE_SYS_PERSONALITY_H
Expand Down
2 changes: 1 addition & 1 deletion src/lxc/confile.h
Expand Up @@ -22,7 +22,7 @@
*/

#include <stdio.h>
#include "attach_options.h"
#include <lxc/attach_options.h>

#ifndef _confile_h
#define _confile_h
Expand Down
1 change: 1 addition & 0 deletions src/lxc/console.c
Expand Up @@ -32,6 +32,7 @@
#include <termios.h>

#include <lxc/lxccontainer.h>

#include "log.h"
#include "conf.h"
#include "config.h"
Expand Down
1 change: 1 addition & 0 deletions src/lxc/error.c
Expand Up @@ -24,6 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h>

#include "error.h"
#include "log.h"

Expand Down
5 changes: 2 additions & 3 deletions src/lxc/freezer.c
Expand Up @@ -34,9 +34,8 @@
#include "error.h"
#include "state.h"
#include "monitor.h"

#include <lxc/log.h>
#include <lxc/cgroup.h>
#include "log.h"
#include "cgroup.h"

lxc_log_define(lxc_freezer, lxc);

Expand Down
1 change: 1 addition & 0 deletions src/lxc/lsm/apparmor.c
Expand Up @@ -26,6 +26,7 @@
#include <sys/stat.h>
#include <sys/mount.h>
#include <sys/apparmor.h>

#include "log.h"
#include "lsm/lsm.h"

Expand Down
1 change: 1 addition & 0 deletions src/lxc/lsm/selinux.c
Expand Up @@ -25,6 +25,7 @@
#include <sys/types.h>
#include <unistd.h>
#include <selinux/selinux.h>

#include "log.h"
#include "lsm/lsm.h"

Expand Down
2 changes: 1 addition & 1 deletion src/lxc/lxc.h
Expand Up @@ -30,7 +30,7 @@ extern "C" {
#include <stddef.h>
#include <sys/select.h>
#include <sys/types.h>
#include <lxc/state.h>
#include "state.h"

struct lxc_msg;
struct lxc_conf;
Expand Down
6 changes: 3 additions & 3 deletions src/lxc/lxc_cgroup.c
Expand Up @@ -26,10 +26,10 @@
#include <libgen.h>
#include <sys/types.h>

#include <lxc/lxc.h>
#include <lxc/log.h>

#include <lxc/lxccontainer.h>

#include "lxc.h"
#include "log.h"
#include "arguments.h"

lxc_log_define(lxc_cgroup_ui, lxc_cgroup);
Expand Down
7 changes: 3 additions & 4 deletions src/lxc/lxc_checkpoint.c
Expand Up @@ -30,10 +30,9 @@
#include <sys/types.h>
#include <fcntl.h>

#include <lxc/lxc.h>
#include <lxc/log.h>
#include <lxc/utils.h>

#include "lxc.h"
#include "log.h"
#include "utils.h"
#include "arguments.h"
#include "config.h"
#include "caps.h"
Expand Down
3 changes: 2 additions & 1 deletion src/lxc/lxc_clone.c
Expand Up @@ -27,12 +27,13 @@
#include <errno.h>
#include <ctype.h>

#include <lxc/lxccontainer.h>

#include "log.h"
#include "config.h"
#include "lxc.h"
#include "conf.h"
#include "state.h"
#include <lxc/lxccontainer.h>

lxc_log_define(lxc_clone, lxc);

Expand Down
4 changes: 3 additions & 1 deletion src/lxc/lxc_config.c
Expand Up @@ -20,9 +20,11 @@

#include <stdio.h>
#include <string.h>
#include "config.h"

#include <lxc/lxccontainer.h>

#include "config.h"

struct lxc_config_items {
char *name;
const char *(*fn)(void);
Expand Down
1 change: 1 addition & 0 deletions src/lxc/lxc_console.c
Expand Up @@ -39,6 +39,7 @@
#include <sys/ioctl.h>

#include <lxc/lxccontainer.h>

#include "error.h"
#include "lxc.h"
#include "log.h"
Expand Down
7 changes: 3 additions & 4 deletions src/lxc/lxc_create.c
Expand Up @@ -26,10 +26,9 @@
#include <fcntl.h>
#include <sys/types.h>

#include <lxc/lxc.h>
#include <lxc/log.h>
#include <lxc/bdev.h>

#include "lxc.h"
#include "log.h"
#include "bdev.h"
#include "arguments.h"
#include "utils.h"

Expand Down
5 changes: 2 additions & 3 deletions src/lxc/lxc_destroy.c
Expand Up @@ -24,9 +24,8 @@
#include <unistd.h>
#include <sys/types.h>

#include <lxc/lxc.h>
#include <lxc/log.h>

#include "lxc.h"
#include "log.h"
#include "arguments.h"
#include "utils.h"

Expand Down
5 changes: 3 additions & 2 deletions src/lxc/lxc_freeze.c
Expand Up @@ -26,10 +26,11 @@
#include <libgen.h>
#include <string.h>

#include <lxc/lxc.h>
#include <lxc/log.h>
#include <lxc/lxccontainer.h>

#include "lxc.h"
#include "log.h"

#include "arguments.h"

lxc_log_define(lxc_freeze_ui, lxc_cgroup);
Expand Down
6 changes: 3 additions & 3 deletions src/lxc/lxc_info.c
Expand Up @@ -29,11 +29,11 @@
#include <libgen.h>
#include <sys/types.h>

#include <lxc/lxc.h>
#include <lxc/log.h>
#include <lxc/utils.h>
#include <lxc/lxccontainer.h>

#include "lxc.h"
#include "log.h"
#include "utils.h"
#include "commands.h"
#include "arguments.h"

Expand Down
1 change: 1 addition & 0 deletions src/lxc/lxc_kill.c
Expand Up @@ -26,6 +26,7 @@
#include <sys/param.h>
#include <stdlib.h>
#include <signal.h>

#include "commands.h"
#include "arguments.h"
#include "namespace.h"
Expand Down
6 changes: 3 additions & 3 deletions src/lxc/lxc_monitor.c
Expand Up @@ -29,9 +29,9 @@
#include <sys/types.h>
#include <errno.h>

#include <lxc/lxc.h>
#include <lxc/log.h>
#include <lxc/monitor.h>
#include "lxc.h"
#include "log.h"
#include "monitor.h"
#include "arguments.h"

lxc_log_define(lxc_monitor_ui, lxc_monitor);
Expand Down
10 changes: 5 additions & 5 deletions src/lxc/lxc_monitord.c
Expand Up @@ -38,11 +38,11 @@
#include <netinet/in.h>
#include <net/if.h>

#include <lxc/af_unix.h>
#include <lxc/log.h>
#include <lxc/mainloop.h>
#include <lxc/monitor.h>
#include <lxc/utils.h>
#include "af_unix.h"
#include "log.h"
#include "mainloop.h"
#include "monitor.h"
#include "utils.h"

#define CLIENTFDS_CHUNK 64

Expand Down
9 changes: 4 additions & 5 deletions src/lxc/lxc_snapshot.c
Expand Up @@ -17,19 +17,18 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include <lxc/lxccontainer.h>

#include <stdio.h>
#include <libgen.h>
#include <unistd.h>
#include <ctype.h>
#include <sys/types.h>
#include <fcntl.h>

#include <lxc/lxc.h>
#include <lxc/log.h>
#include <lxc/bdev.h>
#include <lxc/lxccontainer.h>

#include "lxc.h"
#include "log.h"
#include "bdev.h"
#include "arguments.h"
#include "utils.h"

Expand Down
3 changes: 2 additions & 1 deletion src/lxc/lxc_start.c
Expand Up @@ -40,10 +40,11 @@
#include <netinet/in.h>
#include <net/if.h>

#include <lxc/lxccontainer.h>

#include "log.h"
#include "caps.h"
#include "lxc.h"
#include <lxc/lxccontainer.h>
#include "conf.h"
#include "cgroup.h"
#include "utils.h"
Expand Down
6 changes: 3 additions & 3 deletions src/lxc/lxc_stop.c
Expand Up @@ -25,10 +25,10 @@
#include <unistd.h>
#include <sys/types.h>

#include <lxc/lxc.h>
#include <lxc/log.h>

#include <lxc/lxccontainer.h>

#include "lxc.h"
#include "log.h"
#include "arguments.h"
#include "commands.h"
#include "utils.h"
Expand Down
4 changes: 2 additions & 2 deletions src/lxc/lxc_unfreeze.c
Expand Up @@ -25,10 +25,10 @@
#include <libgen.h>
#include <sys/types.h>

#include <lxc/lxc.h>
#include <lxc/log.h>
#include <lxc/lxccontainer.h>

#include "lxc.h"
#include "log.h"
#include "arguments.h"

lxc_log_define(lxc_unfreeze_ui, lxc_cgroup);
Expand Down
1 change: 1 addition & 0 deletions src/lxc/lxc_user_nic.c
Expand Up @@ -45,6 +45,7 @@
#include <linux/rtnetlink.h>
#include <linux/sockios.h>
#include <sys/param.h>

#include "config.h"
#include "utils.h"
#include "network.h"
Expand Down
1 change: 1 addition & 0 deletions src/lxc/lxc_usernsexec.c
Expand Up @@ -38,6 +38,7 @@
#include <sched.h>
#include <pwd.h>
#include <grp.h>

#include "config.h"
#include "namespace.h"
#include "utils.h"
Expand Down

0 comments on commit f2363e3

Please sign in to comment.