]> source.dussan.org Git - rspamd.git/commitdiff
Add %T for printing rspamd_ftok_t
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 6 Oct 2015 15:51:35 +0000 (16:51 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 6 Oct 2015 15:51:35 +0000 (16:51 +0100)
src/libutil/printf.c
src/libutil/printf.h

index 7fe7a9c26ae3a75476525fddfce326cd459ed62e..9204060b2a0bb332e5787451a38e227459aa037d 100644 (file)
@@ -338,6 +338,7 @@ rspamd_vprintf_common (rspamd_printf_append_func func,
        guint64 ui64;
        guint width, sign, hex, humanize, bytes, frac_width, i;
        rspamd_fstring_t *v;
+       rspamd_ftok_t *tok;
        GString *gs;
        GError *err;
        gboolean bv;
@@ -457,6 +458,11 @@ rspamd_vprintf_common (rspamd_printf_append_func func,
 
                                continue;
 
+                       case 'T':
+                               tok = va_arg (args, rspamd_ftok_t *);
+                               RSPAMD_PRINTF_APPEND (tok->begin, tok->len);
+                               continue;
+
                        case 'v':
                                gs = va_arg (args, GString *);
                                RSPAMD_PRINTF_APPEND (gs->str, gs->len);
@@ -523,7 +529,7 @@ rspamd_vprintf_common (rspamd_printf_append_func func,
                                sign = 1;
                                break;
 
-                       case 'T':
+                       case 't':
                                i64 = (gint64) va_arg (args, time_t);
                                sign = 1;
                                break;
index d0db483d9d74007cf38f178a5c8268717acbff0a..8cd699212d019dd9d8dcbc87d9b7145fe13c1dff 100644 (file)
@@ -44,7 +44,8 @@
  *     %P                                                  pid_t
  *     %r                                          rlim_t
  *     %p                                                  void *
- *     %V                                                  f_str_t *
+ *     %V                                                  rspamd_fstring_t *
+ *     %T                                                  rspamd_ftok_t
  *     %v                          GString *
  *     %s                                                  null-terminated string
  *     %xs                         hex encoded string
@@ -52,6 +53,7 @@
  *     %Z                                                  '\0'
  *     %N                                                  '\n'
  *     %c                                                  gchar
+ *     %t                                                  time_t
  *     %e                          GError *
  *     %%                                                  %
  *