Skip to content
Snippets Groups Projects
Commit 3fcf493e authored by Stephan Bosch's avatar Stephan Bosch
Browse files

plugins: lda-sieve: Reformat lda-sieve-log.c.

parent f32d00e2
No related branches found
No related tags found
No related merge requests found
...@@ -17,9 +17,9 @@ struct lda_sieve_log_ehandler { ...@@ -17,9 +17,9 @@ struct lda_sieve_log_ehandler {
struct mail_deliver_context *mdctx; struct mail_deliver_context *mdctx;
}; };
static const char *ATTR_FORMAT(2, 0) lda_sieve_log_expand_message static const char *ATTR_FORMAT(2, 0)
(struct sieve_error_handler *_ehandler, lda_sieve_log_expand_message(struct sieve_error_handler *_ehandler,
const char *fmt, va_list args) const char *fmt, va_list args)
{ {
struct lda_sieve_log_ehandler *ehandler = struct lda_sieve_log_ehandler *ehandler =
(struct lda_sieve_log_ehandler *) _ehandler; (struct lda_sieve_log_ehandler *) _ehandler;
...@@ -28,61 +28,62 @@ static const char *ATTR_FORMAT(2, 0) lda_sieve_log_expand_message ...@@ -28,61 +28,62 @@ static const char *ATTR_FORMAT(2, 0) lda_sieve_log_expand_message
string_t *str; string_t *str;
const char *error; const char *error;
table = mail_deliver_ctx_get_log_var_expand_table table = mail_deliver_ctx_get_log_var_expand_table(
(mdctx, t_strdup_vprintf(fmt, args)); mdctx, t_strdup_vprintf(fmt, args));
str = t_str_new(256); str = t_str_new(256);
if (var_expand(str, mdctx->set->deliver_log_format, table, &error) <= 0) { if (var_expand(str, mdctx->set->deliver_log_format,
table, &error) <= 0) {
i_error("Failed to expand deliver_log_format=%s: %s", i_error("Failed to expand deliver_log_format=%s: %s",
mdctx->set->deliver_log_format, error); mdctx->set->deliver_log_format, error);
} }
return str_c(str); return str_c(str);
} }
static void ATTR_FORMAT(4, 0) lda_sieve_log_verror static void ATTR_FORMAT(4, 0)
(struct sieve_error_handler *ehandler, unsigned int flags, lda_sieve_log_verror(struct sieve_error_handler *ehandler, unsigned int flags,
const char *location, const char *fmt, va_list args) const char *location, const char *fmt, va_list args)
{ {
sieve_direct_error(ehandler->svinst, sieve_direct_error(ehandler->svinst, ehandler->parent,
ehandler->parent, flags, location, "%s", flags, location, "%s",
lda_sieve_log_expand_message(ehandler, fmt, args)); lda_sieve_log_expand_message(ehandler, fmt, args));
} }
static void ATTR_FORMAT(4, 0) lda_sieve_log_vwarning static void ATTR_FORMAT(4, 0)
(struct sieve_error_handler *ehandler, unsigned int flags, lda_sieve_log_vwarning(struct sieve_error_handler *ehandler, unsigned int flags,
const char *location, const char *fmt, va_list args) const char *location, const char *fmt, va_list args)
{ {
sieve_direct_warning(ehandler->svinst, sieve_direct_warning(ehandler->svinst, ehandler->parent,
ehandler->parent, flags, location, "%s", flags, location, "%s",
lda_sieve_log_expand_message(ehandler, fmt, args)); lda_sieve_log_expand_message(ehandler, fmt, args));
} }
static void ATTR_FORMAT(4, 0) lda_sieve_log_vinfo static void ATTR_FORMAT(4, 0)
(struct sieve_error_handler *ehandler, unsigned int flags, lda_sieve_log_vinfo(struct sieve_error_handler *ehandler, unsigned int flags,
const char *location, const char *fmt, va_list args) const char *location, const char *fmt, va_list args)
{ {
sieve_direct_info(ehandler->svinst, sieve_direct_info(ehandler->svinst, ehandler->parent,
ehandler->parent, flags, location, "%s", flags, location, "%s",
lda_sieve_log_expand_message(ehandler, fmt, args)); lda_sieve_log_expand_message(ehandler, fmt, args));
} }
static void ATTR_FORMAT(4, 0) lda_sieve_log_vdebug static void ATTR_FORMAT(4, 0)
(struct sieve_error_handler *ehandler, unsigned int flags, lda_sieve_log_vdebug(struct sieve_error_handler *ehandler, unsigned int flags,
const char *location, const char *fmt, va_list args) const char *location, const char *fmt, va_list args)
{ {
sieve_direct_debug(ehandler->svinst, sieve_direct_debug(ehandler->svinst, ehandler->parent,
ehandler->parent, flags, location, "%s", flags, location, "%s",
lda_sieve_log_expand_message(ehandler, fmt, args)); lda_sieve_log_expand_message(ehandler, fmt, args));
} }
struct sieve_error_handler *lda_sieve_log_ehandler_create struct sieve_error_handler *
(struct sieve_error_handler *parent, lda_sieve_log_ehandler_create(struct sieve_error_handler *parent,
struct mail_deliver_context *mdctx) struct mail_deliver_context *mdctx)
{ {
struct lda_sieve_log_ehandler *ehandler; struct lda_sieve_log_ehandler *ehandler;
pool_t pool; pool_t pool;
if ( parent == NULL ) if (parent == NULL)
return NULL; return NULL;
pool = pool_alloconly_create("lda_sieve_log_ehandler", 2048); pool = pool_alloconly_create("lda_sieve_log_ehandler", 2048);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.