]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
include/debug: add another debug macros
authorKarel Zak <kzak@redhat.com>
Fri, 21 Mar 2014 11:04:12 +0000 (12:04 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 21 Mar 2014 11:04:12 +0000 (12:04 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
include/debug.h

index 069447967e0dfa4f833d7ec7dfb311521f7eeaae..2eb9d4421ed3d42feda780f5b096fb18cdd0fa22 100644 (file)
@@ -16,7 +16,7 @@
 #define UL_DEBUG_DEFINE_FLAG(p, m) p ## m
 
 /* l - library name, p - flag prefix, m - flag postfix, x - function */
-# define __UL_DBG(l, p, m, x) \
+#define __UL_DBG(l, p, m, x) \
        do { \
                if ((p ## m) & l ## _debug_mask) { \
                        fprintf(stderr, "%d: %s: %8s: ", getpid(), # l, # m); \
                } \
        } while (0)
 
+#define __UL_DBG_CALL(l, p, m, x) \
+       do { \
+               if ((p ## m) & l ## _debug_mask) { \
+                       x; \
+               } \
+       } while (0)
+
+#define __UL_DBG_FLUSH(l, p) \
+       do { \
+               if (l ## _debug_mask && \
+                   l ## _debug_mask != p ## INIT) { \
+                       fflush(stderr); \
+               } \
+       } while (0)
+
+
 #define __UL_INIT_DEBUG(lib, pref, mask, env) \
        do { \
                if (lib ## _debug_mask & pref ## INIT) \