# HG changeset patch
# User Damien Riegel <[email protected]>
# Date 1462473615 14400
#      Thu May 05 14:40:15 2016 -0400
# Node ID 2007ebda7ccc4acce3c9492bfa75440fe16a4123
# Parent  9f66909d2d50d829c7828f997e0f26ff1a7bcdf9
populate open callback for all mailboxes

Reuse functions that were used in the switch case of mx_open_mailbox.

While we're at it, create a dedicated structure for mmdf mailbox as it
might be necessary in the future to use different callbacks.

diff -r 9f66909d2d50 -r 2007ebda7ccc imap/imap.c
--- a/imap/imap.c       Thu May 05 14:39:35 2016 -0400
+++ b/imap/imap.c       Thu May 05 14:40:15 2016 -0400
@@ -2040,5 +2040,6 @@
 }
 
 struct mx_ops mx_imap_ops = {
+  .open = imap_open_mailbox,
   .close = imap_close_mailbox,
 };
diff -r 9f66909d2d50 -r 2007ebda7ccc mbox.c
--- a/mbox.c    Thu May 05 14:39:35 2016 -0400
+++ b/mbox.c    Thu May 05 14:40:15 2016 -0400
@@ -1266,5 +1266,11 @@
 }
 
 struct mx_ops mx_mbox_ops = {
+  .open = mbox_open_mailbox,
   .close = mbox_close_mailbox,
 };
+
+struct mx_ops mx_mmdf_ops = {
+  .open = mbox_open_mailbox,
+  .close = mbox_close_mailbox,
+};
diff -r 9f66909d2d50 -r 2007ebda7ccc mh.c
--- a/mh.c      Thu May 05 14:39:35 2016 -0400
+++ b/mh.c      Thu May 05 14:40:15 2016 -0400
@@ -2367,9 +2367,11 @@
 }
 
 struct mx_ops mx_maildir_ops = {
+  .open = maildir_open_mailbox,
   .close = mh_close_mailbox,
 };
 
 struct mx_ops mx_mh_ops = {
+  .open = mh_open_mailbox,
   .close = mh_close_mailbox,
 };
diff -r 9f66909d2d50 -r 2007ebda7ccc mx.h
--- a/mx.h      Thu May 05 14:39:35 2016 -0400
+++ b/mx.h      Thu May 05 14:40:15 2016 -0400
@@ -84,5 +84,6 @@
 extern struct mx_ops mx_maildir_ops;
 extern struct mx_ops mx_mbox_ops;
 extern struct mx_ops mx_mh_ops;
+extern struct mx_ops mx_mmdf_ops;
 
 #endif
diff -r 9f66909d2d50 -r 2007ebda7ccc pop.c
--- a/pop.c     Thu May 05 14:39:35 2016 -0400
+++ b/pop.c     Thu May 05 14:40:15 2016 -0400
@@ -930,5 +930,6 @@
 }
 
 struct mx_ops mx_pop_ops = {
+  .open = pop_open_mailbox,
   .close = pop_close_mailbox,
 };

Reply via email to