summaryrefslogtreecommitdiffstats
path: root/mbox.c
diff options
context:
space:
mode:
authorDamien Riegel <damien@riegel.io>2016-05-26 14:05:42 -0700
committerDamien Riegel <damien@riegel.io>2016-05-26 14:05:42 -0700
commit938a56572752a0f7fc31660222444cab91a30ece (patch)
treedd3acb055af2f6ab49245bdab0d36e003076ea45 /mbox.c
parent127fd40600a18cbd6dc2d5580f49ac75fc71e659 (diff)
add check operation to struct mx_ops
In mx_check_mailbox switch case, we simply call <mailbox>_check_mailbox, so this operation can be move into the mx_ops structure pretty easily. This commit adds a mandatory "check" operation to struct mx_ops and change all mailboxes to use it. Check functions are made static as they are only used in their respective source files now.
Diffstat (limited to 'mbox.c')
-rw-r--r--mbox.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mbox.c b/mbox.c
index 823c8e9c..da692100 100644
--- a/mbox.c
+++ b/mbox.c
@@ -577,7 +577,7 @@ int mbox_strict_cmp_headers (const HEADER *h1, const HEADER *h2)
* 0 no change
* -1 error
*/
-int mbox_check_mailbox (CONTEXT *ctx, int *index_hint)
+static int mbox_check_mailbox (CONTEXT *ctx, int *index_hint)
{
struct stat st;
char buffer[LONG_STRING];
@@ -1273,10 +1273,12 @@ struct mx_ops mx_mbox_ops = {
.open = mbox_open_mailbox,
.close = mbox_close_mailbox,
.open_new_msg = mbox_open_new_message,
+ .check = mbox_check_mailbox,
};
struct mx_ops mx_mmdf_ops = {
.open = mbox_open_mailbox,
.close = mbox_close_mailbox,
.open_new_msg = mbox_open_new_message,
+ .check = mbox_check_mailbox,
};