diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-11-24 15:25:07 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-11-24 15:25:07 +0200 |
commit | 05df35d07a46f70e7d09a4da39fdd2d7a7d58ed0 (patch) | |
tree | 0ed8642e5ffb858ba12f1b01dfa3db1934fd4230 /lib | |
parent | a4c1a0e88bdeb8372ae66e27da4009a49b0f8009 (diff) | |
download | mailutils-05df35d07a46f70e7d09a4da39fdd2d7a7d58ed0.tar.gz mailutils-05df35d07a46f70e7d09a4da39fdd2d7a7d58ed0.tar.bz2 |
sieve: simplify action logging API
* include/mailutils/sieve.h (mu_sieve_action_log_t): Change proto.
* lib/sieve.c (_sieve_action_log): Rewrite.
* libmu_sieve/util.c (mu_sieve_log_action): Rewrite.
* python/libmu_py/sieve.c (_sieve_action_printer): Rewrite.
* sieve/sieve.c (_sieve_action_log): Rewrite.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sieve.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/sieve.c b/lib/sieve.c index a7450c1ef..249b5607d 100644 --- a/lib/sieve.c +++ b/lib/sieve.c @@ -28,15 +28,17 @@ struct sieve_log_data }; static void -_sieve_action_log (void *data, - mu_stream_t stream, size_t msgno, - mu_message_t msg, +_sieve_action_log (mu_sieve_machine_t mach, const char *action, const char *fmt, va_list ap) { - struct sieve_log_data *ldat = data; + struct sieve_log_data *ldat = mu_sieve_get_data (mach); int pfx = 0; + mu_stream_t stream; + mu_message_t msg = mu_sieve_get_message (mach); + mu_sieve_get_diag_stream (mach, &stream); mu_stream_printf (stream, "\033s<%d>", MU_LOG_NOTICE); + if (ldat) { if (ldat->user) @@ -70,6 +72,7 @@ _sieve_action_log (void *data, mu_stream_vprintf (stream, fmt, ap); } mu_stream_printf (stream, "\n"); + mu_stream_unref (stream); } static int |