diff options
author | Karel Zak | 2009-11-27 00:33:37 +0100 |
---|---|---|
committer | Karel Zak | 2010-06-03 15:20:10 +0200 |
commit | c12cec75b09a9dc8711d4323fda017a0b77f1105 (patch) | |
tree | de503fcb48bbcc8b80c12b6a386331304e1fe216 /shlibs/mount/src/mountP.h | |
parent | libmount: add basic utils (diff) | |
download | kernel-qcow2-util-linux-c12cec75b09a9dc8711d4323fda017a0b77f1105.tar.gz kernel-qcow2-util-linux-c12cec75b09a9dc8711d4323fda017a0b77f1105.tar.xz kernel-qcow2-util-linux-c12cec75b09a9dc8711d4323fda017a0b77f1105.zip |
libmount: add debug support
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/mountP.h')
-rw-r--r-- | shlibs/mount/src/mountP.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/shlibs/mount/src/mountP.h b/shlibs/mount/src/mountP.h index 172341349..5ac3b6bc0 100644 --- a/shlibs/mount/src/mountP.h +++ b/shlibs/mount/src/mountP.h @@ -16,11 +16,43 @@ /* features */ #define CONFIG_CDROM_NOMEDIUM_RETRIES 5 #define CONFIG_LIBMOUNT_ASSERT +#define CONFIG_LIBMOUNT_DEBUG #ifdef CONFIG_LIBMOUNT_ASSERT #include <assert.h> #endif +/* + * Debug + */ +#if defined(TEST_PROGRAM) && !defined(LIBMOUNT_DEBUG) +#define CONFIG_LIBMOUNT_DEBUG +#endif + +#define DEBUG_INIT (1 << 1) +#define DEBUG_ALL 0xFFFF + +#ifdef CONFIG_LIBMOUNT_DEBUG +#include <stdio.h> +extern int libmount_debug_mask; +extern void mnt_init_debug(int mask); +#define DBG(m,x) if ((m) & libmount_debug_mask) x; +#else +#define DBG(m,x) +#define mnt_init_debug(x) +#endif + +#ifdef TEST_PROGRAM +struct mtest { + const char *name; + int (*body)(struct mtest *ts, int argc, char *argv[]); + const char *usage; +}; + +/* utils.c */ +extern int mnt_run_test(struct mtest *tests, int argc, char *argv[]); +#endif + /* utils.c */ extern char *mnt_getenv_safe(const char *arg); #ifndef HAVE_STRNLEN |