diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2012-11-09 23:46:29 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-11-09 23:46:29 +0100 |
commit | 5784a830bf1f98c6b70da50de5364964551d45a4 (patch) | |
tree | be6e85fce33d0bd004d5fc08da847b8f0b9713b2 /monitor/display.h | |
parent | 5b7dc670216b366ba0d6e8407233ac861e51b5e1 (diff) | |
download | bluez-5784a830bf1f98c6b70da50de5364964551d45a4.tar.gz |
monitor: Use more advanced indent printing
Diffstat (limited to 'monitor/display.h')
-rw-r--r-- | monitor/display.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/monitor/display.h b/monitor/display.h index 28ea9fee7..d7269ae4d 100644 --- a/monitor/display.h +++ b/monitor/display.h @@ -40,14 +40,17 @@ bool use_color(void); #define COLOR_ERROR "\x1B[1;31m" -#define print_indent(indent, color, fmt, args...) do { \ - printf("%*c%s" fmt "%s\n", (indent), ' ', \ - use_color() ? (color) : "", ## args, \ - use_color() ? COLOR_OFF : ""); \ +#define print_indent(indent, color, prefix, title, fmt, args...) do { \ + printf("%*c%s%s%s%s" fmt "\n", (indent), ' ', \ + use_color() ? (color) : "", prefix, title, \ + use_color() ? COLOR_OFF : "", ## args); \ } while (0); -#define print_text(color, fmt, args...) print_indent(8, color, fmt, ## args) -#define print_field(fmt, args...) print_indent(8, 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); |