]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
include: refuse inclusion of seperate header files
authorLennart Poettering <mzyvopt@0pointer.de>
Wed, 24 Mar 2010 14:51:55 +0000 (15:51 +0100)
committerDhaval Giani <dhaval.giani@gmail.com>
Wed, 24 Mar 2010 16:06:20 +0000 (17:06 +0100)
Later on it might make sense to move around function definitions between
header files. Hence make sure that nobody includes any header file
directly except the main one.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Reviewed-By: Jan Safranek <jsafrane@redhat.com>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
include/libcgroup.h
include/libcgroup/config.h
include/libcgroup/error.h
include/libcgroup/groups.h
include/libcgroup/init.h
include/libcgroup/iterators.h
include/libcgroup/tasks.h

index 27812c558f4624c721109df9fcc59de95581067c..e53a00bd6d01ea239ac6223f4345beaa1a0248cc 100644 (file)
@@ -16,6 +16,8 @@
 #ifndef _LIBCGROUP_H
 #define _LIBCGROUP_H
 
+#define _LIBCGROUP_H_INSIDE
+
 #include <libcgroup/error.h>
 #include <libcgroup/init.h>
 #include <libcgroup/iterators.h>
@@ -23,4 +25,6 @@
 #include <libcgroup/tasks.h>
 #include <libcgroup/config.h>
 
+#undef _LIBCGROUP_H_INSIDE
+
 #endif /* _LIBCGROUP_H  */
index 68029b8adb74debd7347528e43104eb01b88d9bc..eb5fe8cb52fc451617d56a74736a83fc7aa84951 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef _LIBCGROUP_CONFIG_H
 #define _LIBCGROUP_CONFIG_H
 
+#ifndef _LIBCGROUP_H_INSIDE
+#error "Only <libcgroup.h> should be included directly."
+#endif
+
 #include <features.h>
 
 __BEGIN_DECLS
index 4d756ff06cf76e528de92b446e001c7f8160a156..9a463b9eb4b8e9928941482aede441635ea8f244 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef _LIBCGROUP_ERROR_H
 #define _LIBCGROUP_ERROR_H
 
+#ifndef _LIBCGROUP_H_INSIDE
+#error "Only <libcgroup.h> should be included directly."
+#endif
+
 #include <features.h>
 
 __BEGIN_DECLS
index ba010118806adb66a68956a56ef25cc34e9cc4a6..2d123c20e419431470d80259033e14a60092aa63 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef _LIBCGROUP_GROUPS_H
 #define _LIBCGROUP_GROUPS_H
 
+#ifndef _LIBCGROUP_H_INSIDE
+#error "Only <libcgroup.h> should be included directly."
+#endif
+
 #include <features.h>
 #include <sys/types.h>
 #include <stdbool.h>
index 0e8f0f64836734f7c8de678ce116950e807b8004..b38eb615775724e66dbcd53caa98c09797e21828 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef _LIBCGROUP_INIT_H
 #define _LIBCGROUP_INIT_H
 
+#ifndef _LIBCGROUP_H_INSIDE
+#error "Only <libcgroup.h> should be included directly."
+#endif
+
 #include <features.h>
 
 __BEGIN_DECLS
index c724abf8058a1b2c751454e30e4f378e7e156ff1..3e9f9f726ec0af827fe172f65b6d325b752c98ca 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef _LIBCGROUP_ITERATORS_H
 #define _LIBCGROUP_ITERATORS_H
 
+#ifndef _LIBCGROUP_H_INSIDE
+#error "Only <libcgroup.h> should be included directly."
+#endif
+
 #include <sys/types.h>
 #include <stdio.h>
 #include <features.h>
index 0bd4fb11ffb686b475283e2cddc24aee8ce4d511..665f993ddb5e1f894725cf8341be68a6f4cdb1f4 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef _LIBCGROUP_TASKS_H
 #define _LIBCGROUP_TASKS_H
 
+#ifndef _LIBCGROUP_H_INSIDE
+#error "Only <libcgroup.h> should be included directly."
+#endif
+
 #include <libcgroup/groups.h>
 
 #include <features.h>
@@ -122,5 +126,3 @@ int cgroup_register_unchanged_process(pid_t pid, int flags);
 __END_DECLS
 
 #endif /* _LIBCGROUP_TASKS_H */
-
-