Implement bidirectional iteration over lists.
* include/mailutils/iterator.h (mu_itrctl_qry_direction) (mu_itrctl_set_direction): New mu_itrctl_req constants. * mailbox/iterator.c (mu_iterator_dup): Bugfix: copy dup as well. * mailbox/list.c (struct list_iterator) <backwards>: New member. (first, next): Move direction depends on the value of list_iterator.backwards. (list_itrctl): Handle mu_itrctl_qry_direction and mu_itrctl_set_direction * examples/listop.c (ictl_dir): New function. (ictl_ins): Handle new subcommand "dir". (help): Show new subcommand "dir". * mailbox/testsuite/mailbox/list.exp: Add tests for iteration backwards.
Showing
5 changed files
with
88 additions
and
3 deletions
-
Please register or sign in to post a comment