diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2012-09-23 17:09:27 +0200 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2012-09-23 17:09:27 +0200 |
commit | e66d87fde0e3a88ba92a0f8282eef35b452968dd (patch) | |
tree | c0e60f0ce98a31cf0a719ff70d4ea9f7cbf43173 /src/printf-utils.h | |
parent | e4f7cf7bc5678d3ad26818625fb5b3e49c7af94d (diff) | |
download | 0xFFFF-e66d87fde0e3a88ba92a0f8282eef35b452968dd.tar.bz2 |
Added macro PRINTF_ERROR_RETURN which working with progressbar
Diffstat (limited to 'src/printf-utils.h')
-rw-r--r-- | src/printf-utils.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/printf-utils.h b/src/printf-utils.h index f475214..9255c9c 100644 --- a/src/printf-utils.h +++ b/src/printf-utils.h @@ -20,6 +20,8 @@ #ifndef PRINTF_UTILS_H #define PRINTF_UTILS_H +#include "global.h" + extern int printf_prev; #define PRINTF_BACK() do { if ( printf_prev ) { printf("\r%-*s\r", printf_prev, ""); printf_prev = 0; } } while (0) @@ -27,6 +29,7 @@ extern int printf_prev; #define PRINTF_LINE(...) do { PRINTF_BACK(); PRINTF_ADD(__VA_ARGS__); fflush(stdout); } while (0) #define PRINTF_END() do { if ( printf_prev ) { printf("\n"); printf_prev = 0; } } while (0) #define PRINTF_ERROR(...) do { PRINTF_END(); ERROR_INFO(__VA_ARGS__); } while (0) +#define PRINTF_ERROR_RETURN(str, ...) do { PRINTF_ERROR("%s", str); return __VA_ARGS__; } while (0) void printf_progressbar(unsigned long long part, unsigned long long total); void printf_and_wait(const char * format, ...); |