From c036f9958b3719a949999ca4fe9866ba56b3f713 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Sat, 22 Dec 2007 15:43:19 +0200 Subject: ubi-utils: introduce ubinfo utility Add new handy UBI utility which prints various type of UBI information. This commit also includes a lot of fixes and cleanups in libubi, and other utilities. It was quite complex to separate this all out and I figured that nobody anyway would really need this, and decided to save my time for more useful things. Signed-off-by: Artem Bityutskiy --- ubi-utils/src/common.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'ubi-utils/src/common.h') diff --git a/ubi-utils/src/common.h b/ubi-utils/src/common.h index c20d308..0e33dd1 100644 --- a/ubi-utils/src/common.h +++ b/ubi-utils/src/common.h @@ -19,19 +19,28 @@ #ifndef __UBI_UTILS_COMMON_H__ #define __UBI_UTILS_COMMON_H__ +#ifdef __cplusplus +extern "C" { +#endif + /* Maximum device node name length */ #define MAX_NODE_LEN 255 /* Error messages */ -#define errmsg(fmt, ...) do { \ - fprintf(stderr, "Error: " fmt "\n", ##__VA_ARGS__); \ +#define errmsg(fmt, ...) do { \ + fprintf(stderr, PROGRAM_NAME " error: " fmt "\n", ##__VA_ARGS__); \ } while(0) /* Warnings */ -#define warnmsg(fmt, ...) do { \ - fprintf(stderr, "Warning: " fmt "\n", ##__VA_ARGS__); \ +#define warnmsg(fmt, ...) do { \ + fprintf(stderr, PROGRAM_NAME " warning: " fmt "\n", ##__VA_ARGS__); \ } while(0) int ubiutils_get_multiplier(const char *str); +void ubiutils_print_bytes(long long bytes, int bracket); + +#ifdef __cplusplus +} +#endif #endif /* !__UBI_UTILS_COMMON_H__ */ -- cgit v1.2.3