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.
Showing
20 changed files
with
402 additions
and
104 deletions
libmailutils/list/foreachdir.c
0 → 100644
libmailutils/msgset/foreachmsg.c
0 → 100644
libmailutils/msgset/foreachnum.c
0 → 100644
libmailutils/msgset/negate.c
0 → 100644
-
Please register or sign in to post a comment