diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-11-28 13:57:56 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-11-28 14:09:46 +0200 |
commit | 6efafc3f28d24b6e31052263d1c8f154049e9f65 (patch) | |
tree | de88792b974d1370d6e5ff9828e1dd2fc763bcc0 /examples | |
parent | 1528dfded819e3c8ccba459425b0dc18b1f3a722 (diff) | |
download | mailutils-6efafc3f28d24b6e31052263d1c8f154049e9f65.tar.gz mailutils-6efafc3f28d24b6e31052263d1c8f154049e9f65.tar.bz2 |
sieve: more improvements to the argument/tag runtime access API
* include/mailutils/sieve.h (mu_sieve_handler_t): Change signature:
remove args and tags arguments, they are contained in struct
mu_sieve_machine now.
(mu_sieve_get_comparator)
(mu_sieve_relcmpn_t): Change signature.
(mu_sieve_tag_lookup,mu_sieve_tag_lookup_untyped): Remove
(mu_sieve_get_tag,mu_sieve_get_tag_untyped): New protos.
(mu_sieve_value_get_optional): Replace by
mu_sieve_get_arg_optional.
(mu_sieve_value_get_untyped): Replace by
mu_sieve_get_arg_untyped.
(mu_sieve_value_get): Replace by
mu_sieve_get_arg.
All uses changed.
* libmu_sieve/sieve-priv.h (mu_sieve_machine): New members:
arg_list and tag_list
* libmu_sieve/runtime.c (instr_run): Set up identifier, arg_list,
and tag_list in mu_sieve_machine_t before calling the handler.
Reset them afterward.
* libmu_sieve/util.c (mu_sieve_value_get_optional): Replace by
mu_sieve_get_arg_optional.
(mu_sieve_value_get_untyped): Replace by
mu_sieve_get_arg_untyped.
(mu_sieve_value_get): Replace by
mu_sieve_get_arg.
(mu_sieve_tag_lookup): Replace by mu_sieve_get_tag
(mu_sieve_tag_lookup_untyped): Replace by
mu_sieve_get_tag_untyped
Diffstat (limited to 'examples')
-rw-r--r-- | examples/numaddr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/numaddr.c b/examples/numaddr.c index b0737938c..7981e0bc2 100644 --- a/examples/numaddr.c +++ b/examples/numaddr.c @@ -78,7 +78,7 @@ _count_items (void *item, void *data) /* Handler for the numaddr test */ static int -numaddr_test (mu_sieve_machine_t mach, mu_list_t args, mu_list_t tags) +numaddr_test (mu_sieve_machine_t mach) { mu_sieve_value_t *h; struct val_ctr vc; @@ -86,9 +86,9 @@ numaddr_test (mu_sieve_machine_t mach, mu_list_t args, mu_list_t tags) /* Retrieve required arguments: */ /* First argument: list of header names */ - h = mu_sieve_value_get_untyped (mach, args, 0); + h = mu_sieve_get_arg_untyped (mach, 0); /* Second argument: Limit on the number of addresses */ - mu_sieve_value_get (mach, args, 1, SVT_NUMBER, &vc.limit); + mu_sieve_get_arg (mach, 1, SVT_NUMBER, &vc.limit); /* Fill in the val_ctr structure */ mu_message_get_header (mu_sieve_get_message (mach), &vc.hdr); @@ -99,7 +99,7 @@ numaddr_test (mu_sieve_machine_t mach, mu_list_t args, mu_list_t tags) /* Here rc >= 1 iff the counted number of addresses is greater or equal to vc.limit. If `:under' tag was given we reverse the return value */ - if (mu_sieve_tag_lookup (mach, tags, "under", SVT_VOID, NULL)) + if (mu_sieve_get_tag (mach, "under", SVT_VOID, NULL)) rc = !rc; return rc; |