path: root/wt-status.h
diff options
authorJonathan Nieder <>2011-02-26 05:09:41 (GMT)
committerJunio C Hamano <>2011-03-08 20:12:42 (GMT)
commitbecbdae82bb8bb193c2f1e9d8b32a60bdef8b0e4 (patch)
tree66c92c293581575690b26ab211b6d880a45d8eab /wt-status.h
parent26db0f2e3afc043e184a5e0ce5eb7c53aeb1f644 (diff)
wt-status: add helpers for printing wt-status lines
Introduce status_printf{,_ln,_more} wrapper functions around color_vfprintf() which take care of adding "#" to the beginning of status lines automatically. The semantics: - status_printf() is just like color_fprintf() but it adds a "# " at the beginning of each line of output; - status_printf_ln() is a convenience function that additionally adds "\n" at the end; - status_printf_more() is a variant of status_printf() used to continue lines that have already started. It suppresses the "#" at the beginning of the first line. Helped-by: Junio C Hamano <> Signed-off-by: Jonathan Nieder <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'wt-status.h')
1 files changed, 7 insertions, 0 deletions
diff --git a/wt-status.h b/wt-status.h
index 20b17cf..595c5fa 100644
--- a/wt-status.h
+++ b/wt-status.h
@@ -68,4 +68,11 @@ void wt_status_collect(struct wt_status *s);
void wt_shortstatus_print(struct wt_status *s, int null_termination, int show_branch);
void wt_porcelain_print(struct wt_status *s, int null_termination);
+void status_printf_ln(struct wt_status *s, const char *color, const char *fmt, ...)
+ ;
+void status_printf(struct wt_status *s, const char *color, const char *fmt, ...)
+ ;
+void status_printf_more(struct wt_status *s, const char *color, const char *fmt, ...)
+ __attribute__((format(printf, 3, 4)));
#endif /* STATUS_H */