diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-04-23 13:20:19 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-04-23 13:20:19 +0100 |
commit | e73e539a28af82a10c073b01a5a80ac9ea06f0b0 (patch) | |
tree | ed62c84506878748e724702b7c4f5c37951fe8f3 /src/libutil | |
parent | 83e2ab5d0b021d42fb6e436ef1af9c923e25bc25 (diff) | |
download | rspamd-e73e539a28af82a10c073b01a5a80ac9ea06f0b0.tar.gz rspamd-e73e539a28af82a10c073b01a5a80ac9ea06f0b0.zip |
Add `rspamd_printf` utility function.
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/printf.c | 13 | ||||
-rw-r--r-- | src/libutil/printf.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/libutil/printf.c b/src/libutil/printf.c index d72ec95c8..0c4c8f03d 100644 --- a/src/libutil/printf.c +++ b/src/libutil/printf.c @@ -225,6 +225,19 @@ rspamd_fprintf (FILE *f, const gchar *fmt, ...) } glong +rspamd_printf (const gchar *fmt, ...) +{ + va_list args; + glong r; + + va_start (args, fmt); + r = rspamd_vprintf_common (rspamd_printf_append_file, stdout, fmt, args); + va_end (args); + + return r; +} + +glong rspamd_log_fprintf (FILE *f, const gchar *fmt, ...) { va_list args; diff --git a/src/libutil/printf.h b/src/libutil/printf.h index a4e03791d..bd5c62cb6 100644 --- a/src/libutil/printf.h +++ b/src/libutil/printf.h @@ -65,6 +65,7 @@ typedef glong (*rspamd_printf_append_func)(const gchar *buf, glong buflen, gpointer ud); glong rspamd_fprintf (FILE *f, const gchar *fmt, ...); +glong rspamd_printf (const gchar *fmt, ...); glong rspamd_log_fprintf (FILE *f, const gchar *fmt, ...); glong rspamd_snprintf (gchar *buf, glong max, const gchar *fmt, ...); gchar *rspamd_vsnprintf (gchar *buf, glong max, const gchar *fmt, va_list args); |