Implement general-purpose processing of unsolicited responses in imap client.
* include/mailutils/imap.h (mu_imap_response_action_t): New typedef. (mu_imap_foreach_response): New proto. (MU_IMAP_CB_PERMANENT_FLAGS,MU_IMAP_CB_MESSAGE_COUNT) (MU_IMAP_CB_RECENT_COUNT,MU_IMAP_CB_FIRST_UNSEEN) (MU_IMAP_CB_UIDNEXT,MU_IMAP_CB_UIDVALIDITY) (MU_IMAP_CB_OK,_MU_IMAP_CB_MAX): New constants. (mu_imap_callback_t): New typedef. (mu_imap_callback,mu_imap_register_callback_function): New protos. (MU_IMAP_RESPONSE_ALERT,MU_IMAP_RESPONSE_BADCHARSET) (MU_IMAP_RESPONSE_CAPABILITY,MU_IMAP_RESPONSE_PARSE) (MU_IMAP_RESPONSE_PERMANENTFLAGS,MU_IMAP_RESPONSE_READ_ONLY) (MU_IMAP_RESPONSE_READ_WRITE,MU_IMAP_RESPONSE_TRYCREATE) (MU_IMAP_RESPONSE_UIDNEXT,MU_IMAP_RESPONSE_UIDVALIDITY) (MU_IMAP_RESPONSE_UNSEEN): New constants. (mu_imap_response_codes): New extern. * include/mailutils/sys/imap.h (_mu_imap) <callback>: New member. (_mu_imap_collect_flags, _mu_imap_list_at): New protos. * libproto/imap/resplist.c (_mu_imap_list_at): New function. * libproto/imap/callback.c: New file. * libproto/imap/resproc.c: New file. * libproto/imap/Makefile.am: Add new files. * libproto/imap/capability.c: Rewrite using mu_imap_foreach_response. * libproto/imap/id.c: Likewise. * libproto/imap/select.c: Likewise.
Showing
9 changed files
with
432 additions
and
148 deletions
libproto/imap/callback.c
0 → 100644
libproto/imap/resproc.c
0 → 100644
-
Please register or sign in to post a comment