diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2012-11-09 23:22:10 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-11-09 23:22:10 +0100 |
commit | a2cca1adeab6bb1a47542c6422ddcd6d87276c71 (patch) | |
tree | 6fe244608457c04638dd45a49a1543ffef56d547 /monitor/display.h | |
parent | 4ca6da89a97f061ca3228efbbada018dc031db8e (diff) | |
download | bluez-a2cca1adeab6bb1a47542c6422ddcd6d87276c71.tar.gz |
monitor: Allow printing with different indents
Diffstat (limited to 'monitor/display.h')
-rw-r--r-- | monitor/display.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/monitor/display.h b/monitor/display.h index 34199e791..28ea9fee7 100644 --- a/monitor/display.h +++ b/monitor/display.h @@ -40,13 +40,14 @@ bool use_color(void); #define COLOR_ERROR "\x1B[1;31m" -#define print_text(color, fmt, args...) do { \ - printf("%-8c%s" fmt "%s\n", ' ', \ - use_color() ? color : "", ## args, \ +#define print_indent(indent, color, fmt, args...) do { \ + printf("%*c%s" fmt "%s\n", (indent), ' ', \ + use_color() ? (color) : "", ## args, \ use_color() ? COLOR_OFF : ""); \ } while (0); -#define print_field(fmt, args...) print_text(COLOR_OFF, fmt, ## args) +#define print_text(color, fmt, args...) print_indent(8, color, fmt, ## args) +#define print_field(fmt, args...) print_indent(8, COLOR_OFF, fmt, ## args) int num_columns(void); |