summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-12-28 12:04:30 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2011-12-28 12:04:30 +0200
commit26cfa2197d5a2866f1a08c48f94d65504fdef7b1 (patch)
tree6adb4c1aaadef34f9c5ad495cb38d72e50e3afb9 /testsuite
parente7ab6892fa88d513d83945121c9b6864db4b30f7 (diff)
downloadmailutils-26cfa2197d5a2866f1a08c48f94d65504fdef7b1.tar.gz
mailutils-26cfa2197d5a2866f1a08c48f94d65504fdef7b1.tar.bz2
msgset: implement "foreach" calls.
* imap4d/copy.c (copy_env) <src>: Remove. Not needed now. (size_sum,do_copy): Change to a mu_msgset_message_action_t. (try_copy,safe_copy): Change signature; use mu_msgset_foreach_message. * imap4d/fetch.c (_fetch_from_message): Change to a mu_msgset_message_action_t. (imap4d_fetch0): Use mu_msgset_foreach_message. * imap4d/imap4d.h (imap4d_message_action_t): Remove typedef. (util_foreach_message): Remove. Use mu_msgset_foreach_message. * imap4d/store.c (_do_store): Change to a mu_msgset_message_action_t. (imap4d_store0): Use mu_msgset_foreach_message. * imap4d/util.c (util_foreach_message): Remove. * include/mailutils/list.h (mu_list_foreach_dir): New proto. * include/mailutils/msgset.h (mu_msgset_msgno_action_t) (mu_msgset_message_action_t): New typedefs. (mu_msgset_negate,mu_msgset_foreach_dir_msgno) (mu_msgset_foreach_msgno,mu_msgset_foreach_dir_message) (mu_msgset_foreach_message): New protos. * libmailutils/list/foreachdir.c: New file. * libmailutils/list/Makefile.am (liblist_la_SOURCES): Add foreachdir.c. * libmailutils/list/head.c (mu_list_head): Fix conditional. * libmailutils/list/tail.c (mu_list_tail): Likewise. * libmailutils/msgset/foreachmsg.c: New file. * libmailutils/msgset/foreachnum.c: New file. * libmailutils/msgset/negate.c: New file. * libmailutils/msgset/Makefile.am (libmsgset_la_SOURCES): Add new files. * libmailutils/msgset/getitr.c (mu_msgset_get_iterator): Call mu_msgset_aggregate before doing anything. * libmailutils/msgset/getlist.c (mu_msgset_get_list): Likewise. * libmailutils/msgset/locate.c (mu_msgset_locate): Likewise. * libmailutils/msgset/parse.c (parse_msgrange): Remove duplicated code. * testsuite/msgset.c: Implement -neg option.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/msgset.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/testsuite/msgset.c b/testsuite/msgset.c
index ae2a09961..9e6f53288 100644
--- a/testsuite/msgset.c
+++ b/testsuite/msgset.c
@@ -117,6 +117,13 @@ main (int argc, char **argv)
MU_ASSERT (mu_msgset_sub_range (msgset, range.msg_beg,
range.msg_end));
}
+ else if (strcmp (arg, "-neg") == 0)
+ {
+ mu_msgset_t negated_set;
+ MU_ASSERT (mu_msgset_negate (msgset, &negated_set));
+ mu_msgset_free (msgset);
+ msgset = negated_set;
+ }
else
{
mu_error ("unknown option %s", arg);

Return to:

Send suggestions and report system problems to the System administrator.