Re-implement MH sequences via mailbox properties.
* libmailutils/mailbox/header.c (mu_header_clear): New function. (mu_header_sget_value_n): Tolerate pval == NULL. * libmailutils/property/assocprop.c (_assoc_prop_setval): Bugfix. (_assoc_prop_clear): New method. (mu_assoc_property_init): Reference the stream. (mu_assoc_property_init): Initialize _prop_clear. * libmailutils/property/create.c (_mu_property_init): Now extern. * libmailutils/property/propset.c (mu_property_set_value): Null value means unset. * libmailutils/tests/prop.at: Test property clear and invalidate. * libmailutils/tests/prop.c: New commands: 0 for property clear and ! for invalidate. * libmailutils/property/mhprop.c: New file. * libmailutils/property/propclr.c: New file. * libmailutils/property/propinv.c: New file. * libmailutils/property/Makefile.am (noinst_LTLIBRARIES): Add new files. * include/mailutils/header.h (mu_header_clear): New proto. * include/mailutils/property.h (mu_property_clear) (mu_property_invalidate): New protos. (mu_mh_prop): New struct. (mu_mh_property_init): New proto. * include/mailutils/sys/property.h (_mu_property) <_prop_clear>: New member. (_mu_property_init): New proto. * include/mailutils/mh.h: New file. * include/mailutils/Makefile.am (pkginclude_HEADERS): Add mh.h * libproto/mh/profile.c: New file. * libproto/mh/Makefile.am (libmu_mh_la_SOURCES): Add new files. * libproto/mh/mbox.c (mh_get_property): New static function. (_mailbox_mh_init): Set _get_property. * mh/mh_global.c (current_message, sequences): Remove. Use mbox properties instead. (mh_global_sequences_get) (mh_global_sequences_set) (mh_global_sequences_iterate) (mh_global_sequences_drop): Take mbox as first argument. All callers updated. * mh/mh_init.c (mh_init2): Remove call to mh_global_sequences_get. * mh/mh_msgset.c (msgset_cur): Use mh_mailbox_get_cur. * mh/mh_sequence.c (mh_seq_read, write_sequence) (delete_sequence, mh_seq_add, mh_seq_delete): Take mbox as first argument. All callers updated. * mh/mh.h: Include mailutils/property.h. (current_message): Remove. (mh_mailbox_cur_default): New extern. (mh_global_sequences_get) (mh_global_sequences_set) (mh_global_sequences_iterate) (mh_global_sequences_drop): Take mbox as first argument. All callers updated. * mh/mh_format.c (builtin_cur): Rewrite using mh_message_number. * mh/mboxprop.c: New file. * mh/Makefile.am (libmh_a_SOURCES): Add new file. * mh/folder.c: Update calls to sequence management functions. * mh/mark.c: Likewise. * mh/pick.c: Likewise. * mh/inc.c (main): Set mh_mailbox_cur_default to 1. Invalidate properties if changecur is not set. * mh/prompter.c (main): Destroy the iterator. * mh/rmf.c: Rewrite using mu_mailbox_remove. * mh/scan.c: Always close the mailbox. * mh/tests/folder.at: Update. * mh/tests/inc.at: Update. Inc now sets cur to 1 if it was not originally set. This is what others MHs do.
Showing
37 changed files
with
899 additions
and
149 deletions
include/mailutils/mh.h
0 → 100644
libmailutils/property/mhprop.c
0 → 100644
libmailutils/property/propclr.c
0 → 100644
libmailutils/property/propinv.c
0 → 100644
libproto/mh/profile.c
0 → 100644
mh/mboxprop.c
0 → 100644
-
Please register or sign in to post a comment