]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Move private definitions to private header
authorJan Safranek <jsafrane@redhat.com>
Fri, 12 Mar 2010 15:50:10 +0000 (16:50 +0100)
committerDhaval Giani <dhaval.giani@gmail.com>
Sun, 21 Mar 2010 21:02:01 +0000 (22:02 +0100)
Most of the macro definitions in licgroup.h are internal, let's move them
to private header. Applications should not depend on them. The only one
really needed is CG_VALUE_MAX, which is used in struct cgroup_stat.

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
include/libcgroup.h
src/libcgroup-internal.h
src/tools/lssubsys.c
src/tools/tools-common.h

index b5d7a429f00f367eb5fc8e30788822ee8dbd8662..b7d997b53decc0011d0b97342f0a6f46e3adb737 100644 (file)
@@ -26,22 +26,11 @@ __BEGIN_DECLS
 #include <sys/types.h>
 #include <linux/cn_proc.h>
 
-/* Maximum number of mount points/controllers */
-#define MAX_MNT_ELEMENTS       8
-/* Estimated number of groups created */
-#define MAX_GROUP_ELEMENTS     128
-
 /*
  * NOTE: Wide characters are not supported at the moment. Wide character support
  * would require us to use a scanner/parser that can parse beyond ASCII
  */
 
-/* Definitions for the uid and gid members of a cgroup_rules */
-#define CGRULE_INVALID (-1)
-#define CGRULE_WILD (-2)
-
-#define CGRULE_SUCCESS_STORE_PID       "SUCCESS_STORE_PID"
-
 /* Flags for cgroup_change_cgroup_uid_gid() */
 enum cgflags {
        CGFLAG_USECACHE = 0x01,
@@ -126,15 +115,7 @@ struct cgroup_file_info {
        short depth;
 };
 
-#define CG_NV_MAX 100
-#define CG_CONTROLLER_MAX 100
-/* this is NOT ENOUGH for stat variables */
 #define CG_VALUE_MAX 100
-/* Max number of mounted hierarchies. Event if one controller is mounted per
- * hier, it can not exceed CG_CONTROLLER_MAX
- */
-#define CG_HIER_MAX  CG_CONTROLLER_MAX
-
 struct cgroup_stat {
        char name[FILENAME_MAX];
        char value[CG_VALUE_MAX];
index 8c5cc2fd600c8f77a6177ae3e8fb85de5d139e4d..55fa9fdc761c38ea8b5a07149f2474d65f0df206 100644 (file)
@@ -26,6 +26,25 @@ __BEGIN_DECLS
 #include <sys/stat.h>
 #include <sys/types.h>
 
+/* Maximum number of mount points/controllers */
+#define MAX_MNT_ELEMENTS       8
+/* Estimated number of groups created */
+#define MAX_GROUP_ELEMENTS     128
+
+#define CG_NV_MAX 100
+#define CG_CONTROLLER_MAX 100
+/* Max number of mounted hierarchies. Event if one controller is mounted per
+ * hier, it can not exceed CG_CONTROLLER_MAX
+ */
+#define CG_HIER_MAX  CG_CONTROLLER_MAX
+
+/* Definitions for the uid and gid members of a cgroup_rules */
+#define CGRULE_INVALID (-1)
+#define CGRULE_WILD (-2)
+
+#define CGRULE_SUCCESS_STORE_PID       "SUCCESS_STORE_PID"
+
+
 #define CGRULES_CONF_FILE       "/etc/cgrules.conf"
 #define CGRULES_MAX_FIELDS_PER_LINE            3
 
index cdb828421354d03e3bbd9c065cc40342de314cfe..ebb59b164ea99a75a8c7aac3e63ab634e7826415 100644 (file)
@@ -17,6 +17,7 @@
 #include <getopt.h>
 
 #include <libcgroup.h>
+#include <libcgroup-internal.h>
 
 enum flag{
     FL_MOUNT = 1,      /* show the mount points */
index 752eb57b32d25339db5ccaf16354a119098e2ab6..b261dc326d2047f08b439f4cc37f6ca0de1bf801 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "config.h"
 #include <libcgroup.h>
+#include <libcgroup-internal.h>
 
 #ifdef CGROUP_DEBUG
 #define cgroup_dbg(x...) printf(x)