diff options
-rw-r--r-- | src/fe-common/core/printtext.c | 15 | ||||
-rw-r--r-- | src/fe-common/core/printtext.h | 2 | ||||
-rw-r--r-- | src/perl/ui/UI.xs | 2 |
3 files changed, 15 insertions, 4 deletions
diff --git a/src/fe-common/core/printtext.c b/src/fe-common/core/printtext.c index 93a688f1..a807d52c 100644 --- a/src/fe-common/core/printtext.c +++ b/src/fe-common/core/printtext.c @@ -274,7 +274,7 @@ static char *printtext_expand_formats(const char *str, int *flags) return ret; } -void printtext_dest(TEXT_DEST_REC *dest, const char *text, va_list va) +static void printtext_dest_args(TEXT_DEST_REC *dest, const char *text, va_list va) { char *str; @@ -289,6 +289,15 @@ void printtext_dest(TEXT_DEST_REC *dest, const char *text, va_list va) g_free(str); } +void printtext_dest(TEXT_DEST_REC *dest, const char *text, ...) +{ + va_list va; + + va_start(va, text); + printtext_dest_args(dest, text, va); + va_end(va); +} + /* Write text to target - convert color codes */ void printtext(void *server, const char *target, int level, const char *text, ...) { @@ -300,7 +309,7 @@ void printtext(void *server, const char *target, int level, const char *text, .. format_create_dest(&dest, server, target, level, NULL); va_start(va, text); - printtext_dest(&dest, text, va); + printtext_dest_args(&dest, text, va); va_end(va); } @@ -336,7 +345,7 @@ void printtext_window(WINDOW_REC *window, int level, const char *text, ...) window != NULL ? window : active_win); va_start(va, text); - printtext_dest(&dest, text, va); + printtext_dest_args(&dest, text, va); va_end(va); } diff --git a/src/fe-common/core/printtext.h b/src/fe-common/core/printtext.h index 14f46564..656ca412 100644 --- a/src/fe-common/core/printtext.h +++ b/src/fe-common/core/printtext.h @@ -2,6 +2,7 @@ #define __PRINTTEXT_H #include "fe-windows.h" +#include "formats.h" void printformat_module(const char *module, void *server, const char *target, int level, int formatnum, ...); void printformat_module_window(const char *module, WINDOW_REC *window, int level, int formatnum, ...); @@ -13,6 +14,7 @@ void printtext(void *server, const char *target, int level, const char *text, .. void printtext_string(void *server, const char *target, int level, const char *text); void printtext_window(WINDOW_REC *window, int level, const char *text, ...); void printtext_multiline(void *server, const char *target, int level, const char *format, const char *text); +void printtext_dest(TEXT_DEST_REC *dest, const char *text, ...); /* only GUI should call these - used for printing text to somewhere else than windows */ diff --git a/src/perl/ui/UI.xs b/src/perl/ui/UI.xs index 846bbc8f..d427dd07 100644 --- a/src/perl/ui/UI.xs +++ b/src/perl/ui/UI.xs @@ -70,7 +70,7 @@ void printformat_perl(TEXT_DEST_REC *dest, char *format, char **arglist) &dest, GINT_TO_POINTER(formatnum), arglist); str = format_get_text_theme_charargs(theme, module, dest, formatnum, arglist); - if (*str != '\0') printtext_window(dest->window, dest->level, "%s", str); + if (*str != '\0') printtext_dest(dest, "%s", str); g_free(str); g_free(module); } |