diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2007-12-22 15:43:19 +0200 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2007-12-22 17:49:58 +0200 |
commit | c036f9958b3719a949999ca4fe9866ba56b3f713 (patch) | |
tree | c223609251d68d34b57d6b2989451d51960f1580 /ubi-utils/src/common.h | |
parent | c4d478578c7a1343ad053fca79d80fdc4962ca6f (diff) |
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 <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'ubi-utils/src/common.h')
-rw-r--r-- | ubi-utils/src/common.h | 17 |
1 files changed, 13 insertions, 4 deletions
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__ */ |