Implement `iterator_ctl' function.
* include/mailutils/iterator.h (mu_itrctl_req): New enum. (mu_iterator_skip, mu_iterator_ctl) (mu_iterator_set_itrctl): New prototypes. * include/mailutils/list.h (mu_list_free_item): New prototype. * libproto/include/iterator0.h (struct _mu_iterator)<itrctl>: New method. * libproto/include/list0.h (_mu_list_clear): New proto. * mailbox/iterator.c (mu_iterator_set_itrctl): New function. (mu_iterator_skip, mu_iterator_ctl): New functions. * mailbox/list.c (_insert_item): Re-implement function. (mu_list_insert): Use _insert_item again. (mu_list_remove): Don't keep track of the previous item. (list_itrctl): New function. (mu_list_get_iterator): Set itrctl method. * mailbox/listlist.c (clear_list): Rename to _mu_list_clear, remove static qualifier. All uses updated. * mailbox/freeitem.c: New file. * mailbox/Makefile.am (libmailutils_la_SOURCES): Add freeitem.c. * examples/listop.c (read_list): Rewrite to simplify calling convention. All callers updated. (inctl_tell,ictl_del,ictl_repl) (ictl_ins,ictl): New functions. (help): Add new commands. (shell): Handle "inctl" command. (delete): Fix memory leak. (main): Set mu_list_free_item as a destroy_item function. * mailbox/testsuite/mailbox/listop.c: Add ictl tests. * libmu_cfg/sieve.c (_add_path): Set mu_list_free_item as a destroy_item function. * mailbox/gocs.c (mu_gocs_store): Likewise. * maidag/lmtp.c (cfun_rcpt_to): Likewise. * imap4d/namespace.c (namespace_init): Likewise. * libmu_sieve/conf.c (_path_append): Likewise.
Showing
17 changed files
with
405 additions
and
88 deletions
mailbox/freeitem.c
0 → 100644
-
Please register or sign in to post a comment