]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
libcgroup: Move dbg() to libcgroup-internal.h
authorDhaval Giani <dhaval@linux.vnet.ibm.com>
Wed, 25 Feb 2009 13:31:29 +0000 (13:31 +0000)
committerDhaval Giani <dhaval@linux.vnet.ibm.com>
Wed, 25 Feb 2009 13:31:29 +0000 (13:31 +0000)
From: Jan Safranek <jsafrane@redhat.com>

I think dbg() should be in internal header file and not in the public one.
The tools get their own definition of dbg() so they don't need to include
library private header.

dbg() is defined on three places now, it will make more sense when the sources
are distributed to different directories.

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@342 4f4bb910-9a46-0410-90c8-c897d4f1cd53

cgrulesengd.h
libcgroup-internal.h
libcgroup.h
tools-common.h

index f49f79f3b4ff477f39baf0060bdd52f6ebd8fb03..1dc5bdae2d9156890d0fede97f310ada61790566 100644 (file)
@@ -32,9 +32,9 @@ __BEGIN_DECLS
 
 /* A simple macro for printing messages only when CGROUP_DEBUG is defined. */
 #ifdef CGROUP_DEBUG
-  #define fdbg(a, b...) fprintf(a, b)
+  #define dbg(a...) printf(a)
 #else
-  #define fdbg(a, b...) do {} while(0)
+  #define dbg(a...) do {} while (0)
 #endif /* CGROUP_DEBUG */
 
 /* The following ten macros are all for the Netlink code. */
index af5d396c72cf006675c37eb2acb889b218980145..a94f6cdbdd11dbf23934d9fb0a091c34021d5ede 100644 (file)
@@ -26,6 +26,12 @@ __BEGIN_DECLS
 
 #define CGROUP_BUFFER_LEN (5 * FILENAME_MAX)
 
+#ifdef CGROUP_DEBUG
+#define dbg(x...) printf(x)
+#else
+#define dbg(x...) do {} while (0)
+#endif
+
 struct control_value {
        char name[FILENAME_MAX];
        char value[CG_VALUE_MAX];
index dee4648619cfe134f7b68d8de9b500cd04e7913f..08613cf1bdf9cd7dfb7fccbfd46122f435a5b373 100644 (file)
@@ -43,12 +43,6 @@ __BEGIN_DECLS
 /* Estimated number of groups created */
 #define MAX_GROUP_ELEMENTS     128
 
-#ifdef CGROUP_DEBUG
-#define dbg(x...) printf(x)
-#else
-#define dbg(x...) do {} while(0)
-#endif
-
 /*
  * 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
index cd16804c20016c3768adb96c1411a4c2528e507b..bb5dd30e8b00172faa83fd1dfa43736d2c3c7a9b 100644 (file)
 #define __TOOLS_COMMON
 
 #include <libcgroup.h>
-#include "libcgroup-internal.h"
+
+#ifdef CGROUP_DEBUG
+#define dbg(x...) printf(x)
+#else
+#define dbg(x...) do {} while (0)
+#endif
 
 /**
  * Auxiliary specifier of group, used to store parsed command line options.