summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-09-25 02:05:25 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-09-25 13:51:51 +0300
commite6a4af6694f213311bd07c27ccf21c2193740f32 (patch)
tree427ad2974b75bf8fce4f9d4a6feb4720dce8c2f9 /include
parentf03d42afb0fa7599b626fc0c005424edfd123f99 (diff)
mtd-utils: new bareverbose() helper
Add a new helper that lets people do simple verbose output without any implicit strings added around it. Good for progress bars and such. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'include')
-rw-r--r--include/common.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/common.h b/include/common.h
index e87b215..11b0cf6 100644
--- a/include/common.h
+++ b/include/common.h
@@ -38,10 +38,12 @@ extern "C" {
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
/* Verbose messages */
-#define verbose(verbose, fmt, ...) do { \
+#define bareverbose(verbose, fmt, ...) do { \
if (verbose) \
- printf(PROGRAM_NAME ": " fmt "\n", ##__VA_ARGS__); \
+ printf(fmt, ##__VA_ARGS__); \
} while(0)
+#define verbose(verbose, fmt, ...) \
+ bareverbose(verbose, PROGRAM_NAME ": " fmt "\n", ##__VA_ARGS__)
/* Normal messages */
#define normsg(fmt, ...) do { \